hermes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 15 Imported by: 0

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

View Source
const (
	// HomeEnv may hold a comma-separated list of Hermes home directories.
	HomeEnv = "HERMES_HOME"
)

Variables

This section is empty.

Functions

func New

func New() adapter.Adapter

New returns a Hermes adapter.

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

func (a Adapter) Collect(ctx context.Context, src adapter.Source) (adapter.Observation, error)

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

func (Adapter) DisplayName() string

DisplayName returns the human-friendly name.

func (Adapter) ID

func (Adapter) ID() string

ID returns the stable tool identifier.

Jump to

Keyboard shortcuts

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