Expand description
brainwires-tool-runtime — the execution-runtime half of the Brainwires
tool surface. Companion crate to brainwires-tool-builtins (the concrete
tools), unified by the brainwires-tools façade.
§What lives here
executor::ToolExecutor— the trait every tool dispatcher implements.registry::ToolRegistry+registry::ToolCategory— composable tool registry and category metadata.error— tool-error taxonomy + retry classification.sanitization— content-source tagging, injection detection, sensitive-data redaction.tool_search::ToolSearchTool— meta-tool for keyword / regex / (withragfeature) semantic tool discovery.smart_router— query-driven category filtering.transaction::TransactionManager— idempotency + staging-area bookkeeping for file-mutating tools (native only).validation::ValidationTool— duplicate/syntax/build checks (native only).
§Feature-gated runtime modules
orchestrator(ororchestrator-wasm) —orchestrator::OrchestratorTool(Rhai script executor).oauth— OAuth 2.0 client, PKCE, pluggable token store.openapi— OpenAPI 3 spec → tool descriptor conversion.sandbox—sandbox_executor::SandboxedToolExecutor(wraps anyToolExecutorto route bash/code-exec throughbrainwires-sandbox).sessions—sessions::SessionsTool(sessions_list,sessions_history,sessions_send,sessions_spawn) over abrainwires-session::SessionBroker.rag—tool_embedding::ToolEmbeddingIndexbackingToolSearchTool’s semantic mode.
Concrete builtin tools (bash, file_ops, git, web, search, code_exec,
interpreters, browser, email, calendar, system, semantic_search) live in
brainwires-tool-builtins. The umbrella brainwires-tools façade re-exports
both crates.
Re-exports§
pub use error::ResourceType;pub use error::RetryStrategy;pub use error::ToolErrorCategory;pub use error::ToolOutcome;pub use error::classify_error;pub use executor::PreHookDecision;pub use executor::ToolExecutor;pub use executor::ToolPreHook;pub use registry::ToolCategory;pub use registry::ToolRegistry;pub use sanitization::contains_sensitive_data;pub use sanitization::filter_tool_output;pub use sanitization::is_injection_attempt;pub use sanitization::redact_sensitive_data;pub use sanitization::sanitize_external_content;pub use sanitization::wrap_with_content_source;pub use smart_router::analyze_messages;pub use smart_router::analyze_query;pub use smart_router::get_context_for_analysis;pub use smart_router::get_smart_tools;pub use smart_router::get_smart_tools_with_mcp;pub use smart_router::get_tools_for_categories;pub use tool_search::ToolSearchTool;pub use transaction::TransactionManager;pub use validation::ValidationTool;pub use validation::get_validation_tools;pub use orchestrator::OrchestratorTool;pub use openapi::HttpMethod;pub use openapi::OpenApiAuth;pub use openapi::OpenApiEndpoint;pub use openapi::OpenApiParam;pub use openapi::OpenApiTool;pub use openapi::execute_openapi_tool;pub use openapi::openapi_to_tools;pub use sandbox_executor::SandboxedToolExecutor;pub use sessions::SessionsTool;pub use tool_embedding::ToolEmbeddingIndex;
Modules§
- error
- Tool-error taxonomy + retry classification. Tool Error Taxonomy and Classification
- executor
ToolExecutortrait + pre-hook surface. Tool Executor trait- oauth
- OAuth 2.0 client, PKCE, pluggable token store. OAuth 2.0 middleware for tool integrations.
- openapi
- OpenAPI 3 spec → tool descriptor conversion. OpenAPI Tool Generation — Automatically create tools from OpenAPI 3.x specs
- orchestrator
- Rhai-script orchestration tool. Tool Orchestrator - Rhai-based tool orchestration for AI agents
- registry
- Composable tool registry + category metadata. Tool Registry - Composable container for tool definitions
- sandbox_
executor - Container-sandbox executor wrapper. Sandboxed tool executor decorator.
- sanitization
- Content-source tagging, injection detection, sensitive-data redaction. Prompt-injection sanitization and sensitive-data filtering for external content.
- sessions
SessionsTool+ companion types overbrainwires-session::SessionBroker. Session-control tools exposed to the agent.- smart_
router - Query-driven category filter (
analyze_query,get_smart_tools). Smart Tool Router - tool_
embedding - RAG-backed tool-embedding index (powers
ToolSearchTool’s semantic mode). ToolEmbedding - Semantic tool discovery via embedding similarity - tool_
search - Meta-tool for keyword / regex / (with
rag) semantic tool discovery. Tool Search - Meta-tool for discovering available tools dynamically - transaction
- Idempotency + staging-area bookkeeping for file-mutating tools. Two-phase commit transaction manager for file write operations.
- validation
- Code-quality checks (duplicates, syntax, build). Validation tools for agents to verify their work
Structs§
- Commit
Result - Result returned by a successful
StagingBackend::commit. - Idempotency
Record - Record of a completed idempotent write operation.
- Idempotency
Registry - Shared registry that deduplicates mutating file-system tool calls within a run.
- Staged
Write - A single write operation that has been staged but not yet committed.
- Tool
- A tool that can be used by the AI agent
- Tool
Context - Execution context for a tool.
- Tool
Input Schema - JSON Schema for tool input
- Tool
Result - Result of a tool execution
Traits§
- Staging
Backend - Trait for staging write operations before committing to the filesystem.