enact-core 0.0.2

Core agent runtime for Enact - Graph-Native AI agents
Documentation
//! Tool module - Tool trait and policy-aware execution
//!
//! ## Key Invariant: All tool execution must go through ToolExecutor
//!
//! The ToolExecutor ensures that every tool invocation passes through
//! ToolPolicy::evaluate() before execution. This is the security boundary.
//!
//! ```ignore
//! // CORRECT: Use ToolExecutor for all tool calls
//! let executor = ToolExecutor::new(policy);
//! let result = executor.execute(&tool, args, &ctx).await?;
//!
//! // WRONG: Direct tool.execute() bypasses policy!
//! // let result = tool.execute(args).await?; // Don't do this!
//! ```

mod agent_tool;
mod discovery;
mod dispatcher;
mod function;
mod r#trait;

pub mod browser;
pub mod cost;
pub mod filesystem;
pub mod git;
pub mod http;
pub mod mcp;
pub mod reasoning;
pub mod sandbox;
pub mod shell;
pub mod web_search;

// Tool trait
pub use r#trait::{DynTool, Tool};

// Tool implementations
pub use cost::{CostMetrics, CostTool, CostTracker};
pub use filesystem::{FileReadTool, FileWriteTool};
pub use function::FunctionTool;
pub use git::GitTool;
pub use http::HttpRequestTool;
pub use shell::ShellTool;
pub use web_search::WebSearchTool;

// AgentTool - privileged adapter (see agent_tool.rs for security warnings)
// Note: AgentTool is available but should only be used by trusted runtime components
pub use agent_tool::AgentTool;

// Policy-aware executor (REQUIRED for all tool invocations)
pub use dispatcher::{ToolExecutionContext, ToolExecutionError, ToolExecutor};