Skip to main content

Crate agent_types

Crate agent_types 

Source
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§

ActivationContext
Context passed to Tool::should_activate for Deferred tools.
ApprovalRequest
CheckpointData
GuardCtx
Guard context information — built by runtime, passed to guard.
PlanItem
A single step in a lightweight plan checklist.
SessionId
Unique identifier for an agent session.
ToolMetadata
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.
ToolResultData
UpdatePlanArgs
Arguments for the update_plan tool.

Enums§

ApprovalDecision
CheckpointStep
Content
Structured content returned by a tool, aligned with the MCP content array shape (no envelope, no orchestration/failure/truncation semantics).
FinishReason
Semantic finish reason, replacing scattered Option<String> matching.
GuardDecision
Guard decision — returned by guard, executed by base loop.
MessageRole
PlanStepStatus
Lightweight plan step status — display-only, no execution semantics.
RiskLevel
RunOutcome
The outcome of an Agent turn or run.
ToolExposure
Visibility level of a tool to the LLM model.

Functions§

content_details
Extract structured detail metadata from tool output. When multiple Detail entries exist, they are merged into a single object. Returns None if no Detail entries are present.
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.