hermes

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 8 Imported by: 0

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

func BuildCommand(agentSessionID, mode string, resume bool, envExports string) string

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

func DiscoverSessionID(spawnStart time.Time) (string, bool)

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.

func New

func New() agent.Agent

New returns the hermes Agent. Exposed (not just via init) so test code that needs a fresh registry can re-register after agent.Reset().

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL