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 automation;
17pub mod circuit_breaker;
18pub mod context_budget;
19pub mod driver;
20pub mod fighter_loop;
21pub mod guard;
22pub mod http_pool;
23pub mod mcp;
24pub mod model_router;
25pub mod session_repair;
26pub mod tool_executor;
27pub mod tools;
28
29pub use circuit_breaker::{CircuitState, CircuitStatus, ProviderCircuitBreaker};
30pub use context_budget::{ContextBudget, TrimAction};
31pub use driver::{
32    AnthropicDriver, AzureOpenAiDriver, BedrockDriver, CompletionRequest, CompletionResponse,
33    GeminiDriver, LlmDriver, OllamaDriver, OpenAiCompatibleDriver, StopReason, StreamCallback,
34    StreamChunk, TokenUsage, ToolCallDelta, create_driver, create_driver_with_client,
35    strip_thinking_tags,
36};
37pub use fighter_loop::{FighterLoopParams, FighterLoopResult, run_fighter_loop};
38pub use guard::{GuardConfig, GuardVerdict, LoopGuard, LoopGuardVerdict};
39pub use http_pool::{HttpPool, HttpPoolConfig};
40pub use mcp::McpClient;
41pub use model_router::{ModelRouter, ModelTier};
42pub use session_repair::{RepairStats, repair_session};
43pub use tool_executor::{ToolExecutionContext, execute_tool};
44pub use tools::{ToolGroup, ToolSelector, all_tools, tools_for_capabilities};