Expand description
Pure type definitions for the agent-base runtime.
This crate contains data structures and enums with zero runtime dependencies — no async, no I/O, no trait objects. It exists so that downstream crates (SDKs, protocol layers, tool definitions) can depend on just the types without pulling in the full agent-base runtime.
agent-base re-exports everything from this crate, so existing
use agent_base::Content continues to work.
Structs§
- Action
- One unit of “something the model asked the runtime to do”.
- Action
Outcome - Per-action result — the model-visible fate of one
Action(D9: a policy refusal lands here, never as a silent drop). Batch-level failure isExecError; “something went wrong along the way” is an outcome, not an error. - Activation
Context - Context passed to
Tool::should_activatefor Deferred tools. - Approval
Request - AskOption
- One candidate the user can pick.
idis the caller’s stable key (echoed back on pick);labelis what the picker shows and what comes back with the answer. - Checkpoint
Data - Guard
Ctx - Guard context information — built by runtime, passed to guard.
- Migration
Source - Provenance mark for checkpoint data converted on read (T5 migration layer): the payload was written by a pre-M3 binary in an older wire shape.
- Notice
- Display-only notice from an engine mechanism.
- Observation
- What the runtime observed after executing a batch of actions (D15: always
returned once anything ran —
ExecErroris reserved for “nothing ran”). - Plan
Item - A single step in a lightweight plan checklist.
- RunState
- Run-level state tracking for the react loop.
- Session
Id - Unique identifier for an agent session.
- Stream
Integrity - Structural integrity facts about one assembled tool-call batch.
- Tool
Metadata - Machine-readable metadata for a registered tool — origin, version, and runtime requirements in a stable shape consumers can inspect without parsing the LLM-facing definition JSON.
- Tool
Result Data - Legacy per-result record from the pre-M3 checkpoint payload. Kept so the
T5 migration layer can read old
AfterToolCalls { results }data. - Update
Plan Args - Arguments for the
update_plantool.
Enums§
- Action
Format - Which protocol an action came from. The format label travels with every
Actionso mixed backends stay distinguishable in persisted payloads. - Approval
Decision - AskAnswer
- What the user did with an ask.
- Batch
Status - Batch-level health of an execution round (D15).
- Checkpoint
Step - Content
- Structured content returned by a tool, aligned with the MCP
contentarray shape (no envelope, no orchestration/failure/truncation semantics). - Finish
Reason - Semantic finish reason, replacing scattered
Option<String>matching. - Guard
Decision - Guard decision — returned by guard, executed by base loop.
- Message
Role - Migration
Kind - Notice
Kind - Notice category — decides how consumers render the notification.
- Observation
Event - The tax-3 channel: observations become events, big payloads stay behind a
reference (D9: no
Errorvariant — refusals and interceptions live inActionOutcome). - Plan
Step Status - Lightweight plan step status — display-only, no execution semantics.
- Risk
Level - RunOutcome
- The outcome of an Agent turn or run.
- Tool
Exposure - Visibility level of a tool to the LLM model.
Constants§
- CHECKPOINT_
VERSION - The checkpoint payload version this build writes and understands. Payloads
without a
versionfield are pre-versioning and read as 0.
Functions§
- content_
details - Extract structured detail metadata from tool output. When multiple
Detailentries exist, they are merged into a single object. ReturnsNoneif noDetailentries are present. - content_
images - Extract the pictures a tool’s output hands the model to look at, in the
order they were produced — the image face of a tool result, exactly as
content_textis its textual face. Empty when the output carried none. - content_
text - Join the textual portion of tool output into a single string for display
and session history. Non-text variants (e.g.
Image,Detail) are skipped;Artifactis skipped too — its model face is the summary+reference line already carried inText(the typed channel marks the artifact for UI).