Skip to main content

Crate brainwires_tool_system

Crate brainwires_tool_system 

Source
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 (orchestrator feature) - Rhai script orchestration
  • code_exec (interpreters feature) - Sandboxed multi-language code execution
  • semantic_search (rag feature) - 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§

BashTool
Bash execution tool implementation
CommitResult
Result returned by a successful StagingBackend::commit.
FileOpsTool
File operations tool implementation
GitTool
Git operations tool implementation
IdempotencyRecord
Record of a completed idempotent write operation.
IdempotencyRegistry
Shared registry that deduplicates mutating file-system tool calls within a run.
SearchTool
Regex-based code pattern search tool
StagedWrite
A single write operation that has been staged but not yet committed.
Tool
A tool that can be used by the AI agent
ToolContext
Execution context for a tool.
ToolInputSchema
JSON Schema for tool input
ToolOutcome
Outcome of a tool execution (for SEAL learning)
ToolRegistry
Composable tool registry - stores and queries tool definitions.
ToolResult
Result of a tool execution
ToolSearchTool
Meta-tool for discovering available tools dynamically.
WebTool
Web fetching tool implementation

Enums§

ResourceType
Resource types for Resource errors
RetryStrategy
Retry strategy for transient errors
ToolCategory
Tool categories for filtering tools by purpose
ToolErrorCategory
Error taxonomy based on AgentDebug paper (arxiv:2509.25370)

Traits§

StagingBackend
Trait for staging write operations before committing to the filesystem.

Functions§

classify_error
Classify an error from a tool result