Expand description
Tool system — trait, registry, and built-in tool implementations.
All tools implement the Tool trait and are registered in ToolRegistry.
Subagents get ToolRegistry::without_subagent() to prevent recursion.
Re-exports§
pub use crate::runtime::subagent::SubagentDisplayRow;pub use crate::runtime::subagent::SubagentHandle;pub use crate::runtime::subagent::SubagentRegistry;pub use crate::runtime::subagent::SubagentResult;pub use crate::runtime::subagent::SubagentState;pub use crate::runtime::subagent::SubagentStatus;pub use discovery::ActivateToolsTool;pub use discovery::SearchToolsTool;pub use respond::RespondTool;pub use secret_prompt::PromptKind;pub use secret_prompt::SecretPromptHandle;pub use secret_prompt::SecretPromptRequest;pub use send_channel::SendChannelTool;pub use shell::ShellEndTool;pub use shell::ShellSendTool;pub use shell::ShellStartTool;pub use watcher_exit::WatcherExitTool;
Modules§
- activation
SessionToolSet— per-session core + exact activated tools (Task 15, spec §7.1, §4.2).- catalog
ToolCatalog— all locally known capabilities (spec §7.1, Task 14).- discovery
- Model-facing discovery and exact-activation builtins (Task 17, spec
§4.2, §7.2, §7.3, §7.7):
search_toolsandactivate_tools. - forum
- Explicit, project-wide peer notes through the captured host memory binding.
- ledger
- Task 25 — typed tool-call ledger (spec §8.3).
- memory
- Model-facing repository memory and explicitly opted-in user notes.
- output
- Task 26 — bounded tool-output delta channels with an explicit backpressure/coalescing policy (spec §8.4).
- respond
- RespondTool — reply to an event through its original source channel.
- send_
channel - SendChannelTool — proactively send a message to a specific channel.
- shell
- Interactive PTY-based shell sessions for agents.
- watcher_
exit
Structs§
- Bash
Intermediary Snapshot - Bash
Tool - Edit
Tool - Extension
Tool - Find
Tool - Grep
Tool - LsTool
- Memory
Context Tool - Control the continuous-memory context of the current session (spec §7.2).
- Power
Shell Tool - Read
Tool - Secret
Prompt Handle - UI-only secret prompt plumbing for interactive tools.
- Secret
Prompt Queue - Secret
Prompt Request - Session
Schema Projection - Typed projection report for
ToolRegistry::session_tools_schema: the projected schema entries PLUS every pinned session member that was dropped fail-closed, with the typed reason. Metadata-only reasons: bounded identities, never schema bytes. Callers can surfacedroppedfor audit/telemetry instead of losing the signal to a log line. - Subagent
Collect Tool - Subagent
Model Authorize Tool - Subagent
Models Tool - Subagent
Resume Tool - Subagent
Start Tool - Subagent
Status Tool - Subagent
Steer Tool - Subagent
Tool - Tool
Capabilities - Runtime capability handles — shared services a tool may require.
- Tool
Channels - Streaming channels — carry partial tool output and stream events.
- Tool
Context - Context passed to tool execution — composition of channels, capabilities, and limits.
- Tool
Limits - Configuration limits and timeouts.
- Tool
Registry - Registry of available tools. Maintains a name→tool map and a cached JSON schema
array that gets sent to the API. Thread-safe via
Arc<RwLock<ToolRegistry>>. - Write
Tool
Enums§
- Concurrency
Key - Dropped
Session Member - Why a pinned session member was dropped from a schema projection.
- Tool
Origin - Explicit runtime-origin identity of a registered tool implementation.
- Tool
Output - Structured tool output.
Textis the legacy contract (whatexecutereturns).Blockscarries Anthropic-shaped content blocks destined fortool_result.content, plus a plain-textsummaryused everywhere aStringis expected today: UI preview,after_tool_callhooks, trace ledger byte counts, headless logs, and providers that cannot carry the blocks. INVARIANT:blocks[0]MUST be a{"type":"text"}block whosetext==summary(compaction readsblocks[0].text; non-Anthropic translators join only text sub-blocks).
Traits§
- Tool
- The core trait for all tools. Implement this to add a new tool.
Functions§
- bash_
intermediary_ snapshot - resolve_
agent_ prompt - Resolve an agent name to a system prompt.