Skip to main content

agent_sdk_tools/
lib.rs

1//! Tool surface contracts and infrastructure for the Agent SDK.
2//!
3//! This crate defines the traits and registries that tools implement and the
4//! runtime dispatches against, without coupling to any specific LLM provider
5//! or runtime loop implementation.
6//!
7//! # Modules
8//!
9//! | Module | Description |
10//! |--------|-------------|
11//! | [`tools`]       | Tool traits, registry, `ToolContext`, name types |
12//! | [`hooks`]       | Lifecycle hooks (pre/post tool, events, errors) |
13//! | [`audit`]       | Authoritative tool audit sink (full lifecycle outcomes) |
14//! | [`stores`]      | Persistence traits for messages, state, events, and tool executions |
15//! | [`environment`] | Filesystem / process environment abstraction |
16//! | [`seed`]        | Durable reconstruction types (`ToolContextSeed`, `ExecutionContextFactory`) |
17
18#![forbid(unsafe_code)]
19
20pub mod audit;
21pub mod authority;
22pub mod environment;
23pub mod hooks;
24pub mod seed;
25pub mod stores;
26pub mod tools;
27
28// Convenience re-exports
29pub use audit::{NoopAuditSink, ToolAuditSink};
30pub use authority::{EventAuthority, LocalEventAuthority};
31pub use environment::{Environment, ExecResult, FileEntry, GrepMatch, NullEnvironment};
32pub use hooks::{AgentHooks, AllowAllHooks, DefaultHooks, LoggingHooks, ToolDecision};
33pub use seed::{DefaultContextFactory, ExecutionContextFactory, HostDependencies, ToolContextSeed};
34pub use stores::{
35    EventStore, InMemoryEventStore, InMemoryExecutionStore, InMemoryStore, MessageStore,
36    StateStore, StoredTurnEvents, ToolExecutionStore,
37};
38pub use tools::{
39    AsyncTool, DynamicToolName, ErasedAsyncTool, ErasedListenTool, ErasedTool, ErasedToolStatus,
40    ListenExecuteTool, ListenStopReason, ListenToolUpdate, PrimitiveToolName, ProgressStage,
41    SimpleTool, SimpleToolAdapter, Tool, ToolContext, ToolName, ToolRegistry, ToolStatus,
42    TypedTool, TypedToolAdapter, invalid_tool_input_result, stage_to_string, tool_name_from_str,
43    tool_name_to_string, validate_tool_input,
44};
45
46// Core audit record re-exports for downstream convenience.
47pub use agent_sdk_foundation::audit::{
48    AuditProvenance, ToolAuditOutcome, ToolAuditRecord, ToolAuditRecordParams,
49};