Hermes bus integration plugin — auto-start, auto-register, message injection, bus tools
Project description
hermes-bus-plugin
Hermes Agent plugin for message bus integration — lifecycle management, external message injection, bus tools.
A thin integration layer between Hermes Agent and the hermes-bus / hermes-notify packages.
Install
# Via Hermes plugin manager
hermes plugins install hermes-bus-plugin
# Or copy to ~/.hermes/hermes-agent/plugins/
cp -r hermes-bus-plugin ~/.hermes/hermes-agent/plugins/
hermes plugins enable hermes-bus-plugin
Session Naming
Each CLI window registers a unique bus endpoint on startup. The default endpoint is hermes-bus (first session), with hermes-bus-2, hermes-bus-3, etc. for additional sessions. To give your session a stable name that survives reconnection:
/title my-agent-name
The plugin uses the title set by /title as the bus endpoint name.
| Action | When | Description |
|---|---|---|
| Start bus daemon | Plugin load | Ensures hermes-bus is running |
| Register listener | Plugin load | Opens a bus endpoint for incoming messages |
| Print notifications | On bus message | print: true → terminal (only when context is NOT true) |
| Inject context + push | On bus message | context: true → inject into LLM context + push to Agent via pending_input (overrides print, token-heavy — use sparingly) |
| Execute command | On bus message | command → async subprocess (audio, scripts, etc.) — runs inside Hermes process, no external daemon needed |
Provided Tools
bus_send — send a message through the bus to any endpoint:
bus_send(target="notifier", type="progress", text="50% done")
bus_status — check bus health and connected endpoints:
bus_status()
bus_info — show current session's bus connection details:
bus_info()
Route Rules
Messages arriving at the bus are matched against ~/.hermes/bus-rules.yaml rules.
Each rule can trigger three independent actions:
| Field | Behavior | Default |
|---|---|---|
print |
Print to terminal | false |
print_format |
Template or script for terminal output | {text} |
context |
Inject into LLM context + push to Agent | false |
context_format |
Template or script for context/push text | {text} |
command |
Execute shell command (audio, script, etc.) | none |
Priority Logic
context and print are mutually exclusive:
context: true→ inject context + push to Agent (print is ignored). ⚠️ Token-heavy — each push triggers an Agent turn.print: true→ terminal output only (only when context is NOT true)command→ always executed if defined, independent of context/print
Format Templates
print_format and context_format support these placeholders:
| Placeholder | Description |
|---|---|
{from} |
Sender endpoint name |
{text} |
Message body text |
{type} |
Message type |
{ts} |
Unix timestamp (raw) |
{ts:%Y-%m-%d %H:%M:%S} |
strftime formatted |
{color:cyan} |
ANSI foreground color (black/red/green/yellow/blue/magenta/cyan/white) |
{color:bold_green} |
Bold color variant |
{bold} |
Bold text |
{reset} |
Reset all styles |
Script Support
If print_format or context_format starts with ~ or / and points to an executable file, the script is run with FROM, TYPE, TEXT as environment variables and its stdout is used as the rendered output (supports ANSI colors).
#!/bin/bash
# format-notify.sh — example format script
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
RESET="\033[0m"
case "$TYPE" in
task_done) echo -e "${GREEN}✔ ${FROM}${RESET} — ${TEXT}" ;;
task_error) echo -e "${YELLOW}✖ ${FROM} failed${RESET}\n ${TEXT}" ;;
*) echo -e "${FROM}: ${TEXT}" ;;
esac
# bus-rules.yaml
- match_type: task_done
print: true
print_format: "~/scripts/format-notify.sh"
Example Rules
callbacks:
# Notification only (no context)
- match_type: ack
print: true
print_format: "{color:cyan}📬 {from}{reset} {text} [{ts:%H:%M}]"
context: false
# Silent context injection
- match_type: progress
print: false
context: true
# Context + terminal + audio
- match_type: task_done
print: true
print_format: "{color:bold_green}✔ {from}{reset} → {text} {color:cyan}[{ts:%H:%M:%S}]{reset}"
context: true
command: "afplay ~/sounds/done.mp3"
Requirements
hermes-bus(pip)hermes-notify(pip)
Both are auto-detected — the plugin degrades gracefully if they're missing.
Architecture
External process ──→ hermes-bus ──→ hermes-bus-plugin ──→ LLM context
(socket) ├─ pre_llm_call hook
└─ async subprocess (command: audio/script)
Hermes session ──→ bus_send tool ──→ hermes-bus ──→ target endpoint
command execution (audio playback, shell scripts) runs inside the Hermes process via subprocess.Popen. No external daemon (bus-notifier) needed — one less process to manage, no point-to-point routing issues, no silent failures.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_bus_plugin-0.4.1.tar.gz.
File metadata
- Download URL: hermes_bus_plugin-0.4.1.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b58916466c063ecb6e39611f3d4b1a10b267a49292ab9c0ff2efb7de255aa140
|
|
| MD5 |
291eb0ce90141ad3d64fa4eac3fcd9f5
|
|
| BLAKE2b-256 |
0656ddbd44f21dd0ce5149860da79f1d5e566e7959d0bd1b9a25bd5482f3ca5d
|
File details
Details for the file hermes_bus_plugin-0.4.1-py3-none-any.whl.
File metadata
- Download URL: hermes_bus_plugin-0.4.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5c9e4269b53f57e704fd05aad303488db57eeeea1ae97d527c80d65593a9113
|
|
| MD5 |
4f7a8299f780a5863e62352209b59b50
|
|
| BLAKE2b-256 |
f48e50e0e40733f49509b2e9c731993159a498e938499f5675e042f234fca164
|