Expand description
Brainwires Tools - Built-in tool implementations for the Brainwires Agent Framework
This crate provides a composable set of tools that agents can use:
§Always Available
- bash - Shell command execution with proactive output management
- file_ops - File read/write/edit/patch/list/search/delete/create_directory
- git - Git operations (status, diff, log, stage, commit, push, pull, etc.)
- web - URL fetching
- search - Regex-based code search (respects .gitignore)
- validation - Code quality checks (duplicates, build, syntax)
- tool_search - Meta-tool for dynamic tool discovery
- error - Error taxonomy and classification for retry strategies
§Feature-Gated
- orchestrator (
orchestratorfeature) - Rhai script orchestration - code_exec (
interpretersfeature) - Sandboxed multi-language code execution - semantic_search (
ragfeature) - RAG-powered semantic codebase search
§Registry
The ToolRegistry is a composable container. Create one and register
whichever tools you need, or use ToolRegistry::with_builtins() for all.
ⓘ
use brainwires_tool_system::{ToolRegistry, BashTool, FileOpsTool};
let mut registry = ToolRegistry::new();
registry.register_tools(BashTool::get_tools());
registry.register_tools(FileOpsTool::get_tools());Re-exports§
pub use executor::PreHookDecision;pub use executor::ToolExecutor;pub use executor::ToolPreHook;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 transaction::TransactionManager;pub use validation::ValidationTool;pub use validation::get_validation_tools;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;
Modules§
- executor
- Tool Executor trait
- sanitization
- Prompt-injection sanitization and sensitive-data filtering for external content.
- smart_
router - Smart Tool Router
- transaction
- Two-phase commit transaction manager for file write operations.
- validation
- Validation tools for agents to verify their work
Structs§
- Bash
Tool - Bash execution tool implementation
- Commit
Result - Result returned by a successful
StagingBackend::commit. - File
OpsTool - File operations tool implementation
- GitTool
- Git operations tool implementation
- Idempotency
Record - Record of a completed idempotent write operation.
- Idempotency
Registry - Shared registry that deduplicates mutating file-system tool calls within a run.
- Search
Tool - Regex-based code pattern search tool
- 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
Outcome - Outcome of a tool execution (for SEAL learning)
- Tool
Registry - Composable tool registry - stores and queries tool definitions.
- Tool
Result - Result of a tool execution
- Tool
Search Tool - Meta-tool for discovering available tools dynamically.
- WebTool
- Web fetching tool implementation
Enums§
- Resource
Type - Resource types for Resource errors
- Retry
Strategy - Retry strategy for transient errors
- Tool
Category - Tool categories for filtering tools by purpose
- Tool
Error Category - Error taxonomy based on AgentDebug paper (arxiv:2509.25370)
Traits§
- Staging
Backend - Trait for staging write operations before committing to the filesystem.
Functions§
- classify_
error - Classify an error from a tool result