Skip to main content

Crate hatchery_session_events

Crate hatchery_session_events 

Source
Expand description

Session event layer.

Turns what a provider CLI draws in its terminal (or what an ACP agent reports) into typed SessionEvents. Web HQ (and later the TUI) read only this layer: chat answers, thought and action widgets, diffs, prompt-needed alerts and avatar states are all derived from events.

Design (see docs/hatchery/research/session-ui-competitors-2026-10.md):

  • live PTY parsing is the quality base: ProviderParser modules, one per provider, plus a generic fallback;
  • every event carries its source and a Confidence: screen parsing is always Heuristic;
  • ACP is an additional source behind the same event type (acp::AcpAdapter), Structured.

Re-exports§

pub use providers::parser_for;
pub use providers::Item;
pub use providers::Parsed;
pub use providers::ProviderParser;

Modules§

acp
ACP adapter: maps session/update notifications of the Agent Client Protocol (v1 and v2 names) onto the same SessionEvent type. Confidence is Structured: these fields are what the agent said. Used as an extra scenario next to PTY parsing, e.g. to run a provider headless and get typed replies into a turn.
providers
Per-provider live PTY parsers behind one trait.

Structs§

EventStream
Feeds screens (or raw bytes) of one session through its provider parser and emits typed events.
SessionEvent
One typed event. id is stable for an item; rev grows when the same item changes (a tool call getting its result, an answer growing). Consumers upsert by id.

Enums§

ActionStatus
Confidence
EventKind
PromptKind
SessionState