- Python 100%
- plugin.yaml: name changed from 'xmpp-platform' to 'xmpp' so it matches the plugins.enabled entry in config.yaml (key is derived from manifest.name for flat user plugins) - adapter.py: add _env_enablement_fn() to seed PlatformConfig.extra from env vars at config load time (v0.13.0 requirement) - adapter.py: add cron_deliver_env_var="XMPP_HOME_CHANNEL" so the platform is a valid cron deliver= target Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| __init__.py | ||
| adapter.py | ||
| plugin.yaml | ||
| README.md | ||
hermes-xmpp-gateway
Native XMPP platform adapter for Hermes Agent v0.12.0+, built with slixmpp.
Connects Hermes to any XMPP server (tested with ejabberd) over direct C2S TCP as a pluggable platform plugin — drop it into plugins/platforms/xmpp/ and it auto-loads with zero core-file patches.
Features
- Drop-in plugin — no patches to
gateway/config.py,gateway/run.py, ortoolsets.py - Direct C2S TCP connection (plaintext on trusted internal vLAN)
- XEP-0085 chat state notifications (typing indicator — composing/paused)
- XEP-0308 Last Message Correction (edit_message support)
- XEP-0199 keepalive pings (60s interval)
- Configurable allowed-users list via env var
- Auto-reconnect on unexpected disconnect
- Long message chunking (10 000 char limit)
- Auto-generates
hermes-xmpptoolset via plugin registry
Requirements
pip install slixmpp
Installation (Hermes Agent v0.12.0+)
Copy the three files into your Hermes Agent install:
plugins/platforms/xmpp/
├── __init__.py
├── adapter.py
└── plugin.yaml
That's it. The gateway discovers and loads bundled platform plugins at startup via _scan_bundled_plugin_platforms(). Set XMPP_JID and XMPP_PASSWORD in your .env and the platform auto-enables through the generic plugin startup pass in _apply_env_overrides().
Configuration
Set in ~/.hermes/.env:
| Variable | Required | Description |
|---|---|---|
XMPP_JID |
✅ | Bot's JID (e.g. hermes@example.com) |
XMPP_PASSWORD |
✅ | Bot's XMPP password |
XMPP_ALLOWED_USERS |
❌ | Comma-separated JIDs allowed to chat (empty = allow all) |
XMPP_HOME_CHANNEL |
❌ | JID to announce startup to |
XMPP_HOME_CHANNEL_NAME |
❌ | Display name for home channel |
No config.yaml entry needed — the plugin's check_requirements() is called automatically.
How it works
slixmpp normally requires TLS for PLAIN auth. On a trusted internal vLAN, we override the security callback after init_plugins() to allow plaintext PLAIN auth — no certificate setup needed.
The adapter:
- Connects to the XMPP server via direct TCP (default:
roiarthurb.xyz:5222) - Authenticates using PLAIN (no TLS — trusted vLAN only)
- Registers presence and fetches the roster
- Bridges incoming
chatmessages to Hermes' gateway message handler - Sends replies as plain text stanzas, chunked at 10 000 chars
- Sends XEP-0085
composingstate while Hermes is processing - Sends XEP-0308 corrections for edited messages
Compatibility
| Hermes version | Adapter version | Installation method |
|---|---|---|
| v0.12.0+ | 2.1.0 (this repo) | Plugin (plugins/platforms/xmpp/) |
| v0.5.0–v0.11.x | 2.0.0 | Patch (gateway/platforms/xmpp.py + 4 core-file edits) |