Skip to main content

Crate af_agent_session

Crate af_agent_session 

Source
Expand description

Event-sourced Agent sessions. The append-only log is the conversation SSOT; messages, runs, interactions and UI state are deterministic projections.

Structs§

AppliedMeteringCorrection
Accepted correction with server-derived actor and immutable event position.
MeteringCorrection
Privileged report that replaces the derived measurement, never its original event.
OpenToolCall
A tool call awaiting its result.
OperationUsage
Latest measurement for one stable Run operation; revision zero is its original fact.
ProjectedContext
Injected context as projected for UI and replay.
ProjectedMessage
Message as projected for UI and replay.
RecordedToolCall
A tool call as recorded in AssistantToolCalls.
SessionEvent
One committed Session event with its position in the log.
SessionMetadata
Versioned organizational metadata projected from the Session log.
SessionProjection
Deterministic projection of a Session log used by the runtime, recovery and UI.

Enums§

ContentBlock
Typed content unit; UI and models parse types, never prose conventions.
DeliveryMode
How queued input reaches a Run.
Event
Every model-visible fact and lifecycle transition of a Session. The log is the source of truth; everything else is a projection.
EventError
Invariant violated while applying an event.
InteractionKind
What the Run asks the user for.
InteractionResolution
How the user resolved an interaction.
MeteringDetails
Stable attribution for one operation; contains no request, secret or price.
MeteringOutcome
Result known at the time this immutable measurement was recorded.
MeteringSource
Origin of token or resource measurements.
RunState
Projected lifecycle state of one Run: live, parked on an interaction, or terminal.
RunStatus
Terminal Run status.
ToolAuthorizationStatus
Authorization outcome of a tool call.

Constants§

SESSION_EVENT_FORMAT_VERSION
Wire/storage format of Event; only structural changes bump it.

Traits§

SessionEventStore
Append-only Session event storage.

Functions§

cancel_events
Events that close an interrupted Run as cancelled.
failure_events
Events that close an interrupted Run as failed with error_code.
recovery_events
Events that close an interrupted Run as failed with worker_restarted, so recovery starts from a clean lifecycle.
session_deletion_events
Events that tombstone a Session and close its Runs.
text
One text content block.