Documentation
¶
Overview ¶
Package hermes implements an AGGREGATE adapter for the Hermes CLI.
Hermes records per-session token counters in a SQLite database at <home>/state.db. A single session's columns GROW as the session runs across many polls, so this adapter is aggregate: it emits one AggregateSnapshot per session row (the current cumulative totals) keyed by the session id. The collector compares each snapshot against the last stored state and appends a positive delta as an immutable event, so totals never undercount and survive a later deletion of the source row.
CRITICAL: strictly read-only. The SQLite database is opened with mode=ro so a poll can never create, lock for writing, or modify the agent's state.
Index ¶
- Constants
- func New() adapter.Adapter
- type Adapter
- func (Adapter) Capabilities() model.ToolCapability
- func (a Adapter) Collect(ctx context.Context, src adapter.Source) (adapter.Observation, error)
- func (a Adapter) CollectIncremental(ctx context.Context, src adapter.Source, cp *model.SourceCheckpoint) (adapter.Observation, error)
- func (a Adapter) Discover(ctx context.Context, cfg adapter.DiscoverConfig) ([]adapter.Source, error)
- func (Adapter) DisplayName() string
- func (Adapter) ID() string
Constants ¶
const (
// HomeEnv may hold a comma-separated list of Hermes home directories.
HomeEnv = "HERMES_HOME"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct{}
Adapter reads the Hermes state database. Read-only.
func (Adapter) Capabilities ¶
func (Adapter) Capabilities() model.ToolCapability
Capabilities declares what this project can say about Hermes.
Cost is COMPUTED and there is NO activity at all: this adapter references model.ActivityEvent nowhere, so its surface exposes usage and nothing else.
The v2026.9.11 live session capture and exact writer accounting evidence are recorded in testdata/live-2026.9.11.provenance.md.
func (Adapter) Collect ¶
Collect opens the state database read-only and emits one AggregateSnapshot per session row. A malformed/unreadable row is skipped rather than failing the whole cycle; a non-fatal error is returned describing skipped rows.
func (Adapter) CollectIncremental ¶
func (a Adapter) CollectIncremental(ctx context.Context, src adapter.Source, cp *model.SourceCheckpoint) (adapter.Observation, error)
CollectIncremental applies the two-level gate described on ckptState. A nil cp is a full read.
func (Adapter) Discover ¶
func (a Adapter) Discover(ctx context.Context, cfg adapter.DiscoverConfig) ([]adapter.Source, error)
Discover locates each <home>/state.db that exists as a regular file.
func (Adapter) DisplayName ¶
DisplayName returns the human-friendly name.