Files
hermes-agent/website/docs/developer-guide/plugins
unsupportedpastels 3829eed29e feat(plugins): plugins can read the turn's client and who is attached to its session
A notification plugin uses these to skip a phone alert while the user is
active at the client that sent the turn.

`hermes_cli.plugin_session.turn_client()` (and `ctx.turn_client()`) returns
the label the submitting connection announced, from the turn's own admission
stamp, or None outside a turn, in a delegated child, and for unannounced,
messaging and cron turns.

`session_viewers()` (and `ctx.session_viewers()`) lists the connections
attached to the calling session with their idle data
(`gateway.session_presence.viewers`). The session comes only from what the
calling task-local context bound (never `os.environ`): a turn's, or the
one a plugin's own slash command was typed in, which the gateway binds the
same way (no turn runs there, so `turn_client()` is None). A context with
only a route bound names no session and reads []. The live session must
answer to the bound route, so another session's id is never borrowed. A delegated child, which runs in a
copy of its parent's context, reads []. The authority is the one `TurnRunner`
binds its owner with: the active runtime scope's, so a routed profile's turn
reads its own authority, never the launch profile's. No gateway in the
process (CLI, managed worker, plugin host): [].

Both are labels and reports clients chose: attribution only. Listed in
plugin_api.json (public-api.md regenerated) and the plugin guide.
2026-11-23 11:34:19 -05:00
..
…