Expand description
Tool surface contracts and infrastructure for the Agent SDK.
This crate defines the traits and registries that tools implement and the runtime dispatches against, without coupling to any specific LLM provider or runtime loop implementation.
§Modules
| Module | Description |
|---|---|
tools | Tool traits, registry, ToolContext, name types |
hooks | Lifecycle hooks (pre/post tool, events, errors) |
audit | Authoritative tool audit sink (full lifecycle outcomes) |
stores | Persistence traits for messages, state, events, and tool executions |
environment | Filesystem / process environment abstraction |
seed | Durable reconstruction types (ToolContextSeed, ExecutionContextFactory) |
Re-exports§
pub use audit::NoopAuditSink;pub use audit::ToolAuditSink;pub use authority::EventAuthority;pub use authority::LocalEventAuthority;pub use environment::Environment;pub use environment::ExecResult;pub use environment::FileEntry;pub use environment::GrepMatch;pub use environment::NullEnvironment;pub use hooks::AgentHooks;pub use hooks::AllowAllHooks;pub use hooks::DefaultHooks;pub use hooks::LoggingHooks;pub use hooks::ToolDecision;pub use seed::DefaultContextFactory;pub use seed::ExecutionContextFactory;pub use seed::HostDependencies;pub use seed::ToolContextSeed;pub use stores::EventStore;pub use stores::InMemoryEventStore;pub use stores::InMemoryExecutionStore;pub use stores::InMemoryStore;pub use stores::MessageStore;pub use stores::StateStore;pub use stores::StoredTurnEvents;pub use stores::ToolExecutionStore;pub use tools::AsyncTool;pub use tools::DynamicToolName;pub use tools::ErasedAsyncTool;pub use tools::ErasedListenTool;pub use tools::ErasedTool;pub use tools::ErasedToolStatus;pub use tools::ListenExecuteTool;pub use tools::ListenStopReason;pub use tools::ListenToolUpdate;pub use tools::PrimitiveToolName;pub use tools::ProgressStage;pub use tools::SimpleTool;pub use tools::SimpleToolAdapter;pub use tools::Tool;pub use tools::ToolContext;pub use tools::ToolName;pub use tools::ToolRegistry;pub use tools::ToolStatus;pub use tools::TypedTool;pub use tools::TypedToolAdapter;pub use tools::invalid_tool_input_result;pub use tools::stage_to_string;pub use tools::tool_name_from_str;pub use tools::tool_name_to_string;pub use tools::validate_tool_input;
Modules§
- audit
- Authoritative tool audit sink.
- authority
- Event envelope authority — governs how raw events are wrapped in
AgentEventEnvelopes with unique IDs, sequence numbers, and timestamps. - environment
- hooks
- Agent lifecycle hooks for customization.
- seed
- Durable reconstruction types for worker-context recovery.
- stores
- Storage traits for message history, agent state, and event persistence.
- tools
- Tool definition and registry.
Structs§
- Audit
Provenance - Provider / model provenance for an audit record.
- Tool
Audit Record - Single authoritative audit record for one tool-call lifecycle event.
- Tool
Audit Record Params - Arguments for building a
ToolAuditRecordviaToolAuditRecord::new.
Enums§
- Tool
Audit Outcome - Lifecycle outcome for a single tool call.