The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(plugins): broadcast_plugin_event contract, delivery scope and rss-reader migration
teknium13593b635635e
diff --git a/website/docs/developer-guide/desktop-plugin-sdk.md b/website/docs/developer-guide/desktop-plugin-sdk.mdindex a303aa09322..9432bd03dec 100644--- a/website/docs/developer-guide/desktop-plugin-sdk.md+++ b/website/docs/developer-guide/desktop-plugin-sdk.md@@ -1385,21 +1385,36 @@ own desktop half over the app's global event stream — the same stream```pythonfrom hermes_cli.plugin_events import broadcast_plugin_event-broadcast_plugin_event("rss-reader", "items", {"count": 3})-# → event "plugin.rss-reader.items" reaches every connected desktop client+broadcast_plugin_event("rss-reader", "feed.updated", {"count": 3})+# → event "plugin.rss-reader.feed.updated" reaches every connected desktop client``````javascript-host.onEvent('plugin.rss-reader.items', payload => queryClient.invalidateQueries({ queryKey: ['items'] }))+// register(ctx): the subscription is retired with the plugin+host.onEvent('plugin.rss-reader.feed.updated', ({ payload }) => refreshFeeds(payload))```-The name is always `plugin.<your plugin id>.<event>` — the plugin id namespaces-it, so `broadcast_plugin_event` takes the BARE event name (`"items"`, not-`"plugin.rss-reader.items"`) and raises on anything else. Delivery is-fire-and-forget (a wedged client is skipped, never stalling your handler). Use-this instead of importing `tui_gateway.server` internals; for plugin-scoped-frames with a payload tailored per connection, `ctx.socket('/events')` remains-the richer door.+`broadcast_plugin_event(plugin_id, event, payload=None)`: the wire name is+always `plugin.<plugin_id>.<event>`. `plugin_id` is your catalog name+(`[a-z0-9_-]{1,64}`, no dots — it is the namespace and can't spell another+plugin's); `event` is the BARE dotted name (`"feed.updated"`, not+`"plugin.rss-reader.feed.updated"`), segments of `[A-Za-z0-9_-]`, so `""`,+`"../x"` or `"a..b"` raise `ValueError` instead of stranding the desktop half+on a name nobody emits. `payload` is a JSON dict (or omitted → `{}`), delivered+as the event's `payload`; the frame carries `session_id: ""` like every global+event. Delivery is fire-and-forget (a wedged client is skipped, never stalling+your handler) and per process: under `hermes serve` (the Desktop backend, where+both `plugin_api.py` routers and slash commands run) it reaches every connected+window; in a process with no connected client it is a logged no-op. Use this+instead of importing `tui_gateway.server` internals; for plugin-scoped frames+with a payload tailored per connection, `ctx.socket('/events')` remains the+richer door.++Migration (rss-reader): drop the `~/.hermes/rss-reader/commands.jsonl` queue,+`GET /commands` and the 3 s `ctx.rest('/commands')` poll — the Python side+calls `broadcast_plugin_event('rss-reader', 'feed.updated', payload)` where it+used to enqueue, and the desktop side replaces the timer with+`host.onEvent('plugin.rss-reader.feed.updated', fn)` inside `register(ctx)`.### Calling it from the plugindiff --git a/website/docs/user-guide/features/plugin-catalog.md b/website/docs/user-guide/features/plugin-catalog.mdindex dc7e0d3caa7..e9e8dc3ec2f 100644--- a/website/docs/user-guide/features/plugin-catalog.md+++ b/website/docs/user-guide/features/plugin-catalog.md@@ -88,7 +88,10 @@ The catalog is designed so you know exactly what you're installing:the obvious moves outside the plugin SDK (patching built-in prototypes,`eval`, importing anything other than `@hermes/plugin-sdk`/`react`,including remote scripts), and the app's loader refuses every non-SDK- import again at load time. Treat the lint as a review aid, not a+ import again at load time. The lint reads a `<script` regex — a literal or+ the pattern string of `new RegExp(...)` — as the sanitiser it is, not as+ injection; a `<script` string written into the DOM still fails. Treat the+ lint as a review aid, not aguarantee; give Desktop halves the same scrutiny you'd give a Python half.- **Capability declarations.** Entries state up front which tools, hooks, andmiddleware the plugin provides and which environment variables (API keys