Skip to main content

punch_runtime/
lib.rs

1//! # punch-runtime
2//!
3//! The agent execution engine for the Punch Agent Combat System.
4//!
5//! This crate contains the core fighter loop, LLM driver abstraction,
6//! tool execution engine, MCP client, loop guard / circuit breaker,
7//! context budget management, and session repair.
8//!
9//! ## Terminology
10//!
11//! - **Fighter**: An AI agent (conversational or task-oriented)
12//! - **Gorilla**: An autonomous agent that runs without user prompts
13//! - **Bout**: A session / conversation
14//! - **Move**: A tool invocation
15
16pub mod circuit_breaker;
17pub mod context_budget;
18pub mod driver;
19pub mod fighter_loop;
20pub mod guard;
21pub mod http_pool;
22pub mod mcp;
23pub mod session_repair;
24pub mod tool_executor;
25pub mod tools;
26
27pub use circuit_breaker::{CircuitStatus, CircuitState, ProviderCircuitBreaker};
28pub use context_budget::{ContextBudget, TrimAction};
29pub use driver::{
30    AnthropicDriver, AzureOpenAiDriver, BedrockDriver, CompletionRequest, CompletionResponse,
31    GeminiDriver, LlmDriver, OllamaDriver, OpenAiCompatibleDriver, StopReason, TokenUsage,
32    create_driver, create_driver_with_client, strip_thinking_tags,
33};
34pub use http_pool::{HttpPool, HttpPoolConfig};
35pub use fighter_loop::{FighterLoopParams, FighterLoopResult, run_fighter_loop};
36pub use guard::{GuardConfig, GuardVerdict, LoopGuard, LoopGuardVerdict};
37pub use mcp::McpClient;
38pub use session_repair::{RepairStats, repair_session};
39pub use tool_executor::{ToolExecutionContext, execute_tool};
40pub use tools::{all_tools, tools_for_capabilities};