Skip to main content

Crate punch_runtime

Crate punch_runtime 

Source
Expand description

§punch-runtime

The agent execution engine for the Punch Agent Combat System.

This crate contains the core fighter loop, LLM driver abstraction, tool execution engine, MCP client, loop guard / circuit breaker, context budget management, and session repair.

§Terminology

  • Fighter: An AI agent (conversational or task-oriented)
  • Gorilla: An autonomous agent that runs without user prompts
  • Bout: A session / conversation
  • Move: A tool invocation

Re-exports§

pub use circuit_breaker::CircuitState;
pub use circuit_breaker::CircuitStatus;
pub use circuit_breaker::ProviderCircuitBreaker;
pub use context_budget::ContextBudget;
pub use context_budget::TrimAction;
pub use driver::AnthropicDriver;
pub use driver::AzureOpenAiDriver;
pub use driver::BedrockDriver;
pub use driver::CompletionRequest;
pub use driver::CompletionResponse;
pub use driver::GeminiDriver;
pub use driver::LlmDriver;
pub use driver::OllamaDriver;
pub use driver::OpenAiCompatibleDriver;
pub use driver::StopReason;
pub use driver::StreamCallback;
pub use driver::StreamChunk;
pub use driver::TokenUsage;
pub use driver::ToolCallDelta;
pub use driver::create_driver;
pub use driver::create_driver_with_client;
pub use driver::strip_thinking_tags;
pub use fighter_loop::FighterLoopParams;
pub use fighter_loop::FighterLoopResult;
pub use fighter_loop::run_fighter_loop;
pub use guard::GuardConfig;
pub use guard::GuardVerdict;
pub use guard::LoopGuard;
pub use guard::LoopGuardVerdict;
pub use http_pool::HttpPool;
pub use http_pool::HttpPoolConfig;
pub use mcp::McpClient;
pub use session_repair::RepairStats;
pub use session_repair::repair_session;
pub use tool_executor::ToolExecutionContext;
pub use tool_executor::execute_tool;
pub use tools::all_tools;
pub use tools::tools_for_capabilities;

Modules§

circuit_breaker
Provider-level circuit breaker for LLM calls.
context_budget
Context window budget management.
driver
LLM driver trait and provider implementations.
fighter_loop
The core agent execution loop.
guard
Loop guard / circuit breaker for the fighter loop.
http_pool
Shared HTTP connection pool for outbound LLM and tool calls.
mcp
MCP (Model Context Protocol) client.
session_repair
Session message history repair.
tool_executor
Tool execution engine.
tools
Built-in tool definitions (JSON schemas for the LLM).