Documentation
¶
Overview ¶
Package hermes provides the Agent implementation for the Hermes Agent CLI.
Registration happens in init() — any binary that links this package will have "hermes" available in the agent registry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommand ¶
BuildCommand builds the hermes CLI command string.
agentSessionID is the hermes session ID (Session.AgentSessionID). On resume:
- if non-empty: `hermes --resume <id>`
- if empty: `hermes -c` (continue most-recent)
In both resume branches the command falls back to a fresh `hermes` on non-zero exit — matches codex's pattern for crash/Ctrl-C parity. (Hermes itself exits 0 even on bad ID, so this fallback is purely defensive against crashes during resume.)
envExports, when non-empty, is prepended verbatim as a shell prelude.
func DiscoverSessionID ¶
DiscoverSessionID polls `hermes sessions list --source cli --limit 10` for a row whose ID-encoded timestamp is at or after spawnStart, and returns the newest match.
Returns ("", false) on timeout, missing binary, or any subprocess error — callers fall through to `hermes -c` semantics, which is strictly less precise but still correct.
Types ¶
This section is empty.