pe-tools 0.1.0

Tool registry and MCP adapter for Potential Expectations — schema-driven tool nodes and protocol bridge
Documentation
//! # pe-tools — Tool system for Potential Expectations
//!
//! Provides the tool abstraction and execution infrastructure:
//!
//! - [`Tool`] trait — interface every callable tool implements
//! - [`FunctionTool`] — wraps any async function as a tool
//! - [`ToolRegistry`] — stores and retrieves tools by name
//! - [`ToolNode`] — built-in graph node that handles parallel tool execution
//! - [`ToolCallInterceptor`] — hook to inspect/modify tool calls before execution
//! - [`InjectedState`], [`InjectedStore`] — dependency injection markers
//! - [`tools_condition`] — standard ReAct routing condition
//!
//! ## Usage
//!
//! ```ignore
//! // Register tools
//! let mut registry = ToolRegistry::new();
//! registry.register(my_search_tool)?;
//! registry.register(my_calculator_tool)?;
//!
//! // Create a ToolNode for the graph
//! let tool_node = ToolNode::<MyState>::new(Arc::new(registry));
//!
//! // Wire into ReAct pattern
//! graph.add_node("tools", tool_node);
//! graph.add_conditional_edge("chat", tools_condition::<MyState>);
//! graph.add_edge("tools", "chat");
//! ```

pub mod conditions;
pub mod inject;
pub mod interceptor;
pub mod registry;
pub mod selector;
pub mod tool;
pub mod tool_node;

// Re-export primary types at crate root
pub use conditions::tools_condition;
pub use inject::{InjectedState, InjectedStore};
pub use interceptor::{PassthroughInterceptor, ToolCallInterceptor};
pub use registry::ToolRegistry;
pub use selector::{AllToolsSelector, ToolSelector};
pub use tool::{
    FunctionTool, StructuredFunctionTool, Tool, ToolFunc, ToolFuture, ToolResult, ToolResultFuture,
};
pub use tool_node::ToolNode;