Skip to main content

Crate af_agent_runtime

Crate af_agent_runtime 

Source
Expand description

The single default cloud Agent loop. It emits every model-visible fact and lifecycle transition before exposing it to projections or UI consumers.

Structs§

AgentRuntime
The single Turn/Step loop. Build it with AgentRuntime::new and the with_* methods, then call run per Turn.
ApproximateTokenMeter
Character-based estimate (about four characters per token).
CancellationToken
Hierarchical cancellation flag. Cancelling a parent cancels every child; cancelled resolves without polling.
CompactionResult
Summary text and its token usage.
ModelCompactor
Default Compactor that asks the same model for a structured summary through a durable provider attempt.
RuntimeLimits
Hard limits for one Run.
RuntimeOutcome
Terminal result of a Turn.
TurnRequest
Everything the loop needs to run one Turn.

Enums§

RuntimeError
Failure while running a Turn.

Traits§

Compactor
Produces the summary that replaces old transcript when the context overflows.
EventWriter
Fenced append/read access to the Session log for one Run.
TokenMeter
Token estimator used for limits and compaction decisions.

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.