Skip to main content

punch_kernel/
lib.rs

1//! # punch-kernel
2//!
3//! **The Ring** — central kernel and orchestrator for the Punch Agent Combat System.
4//!
5//! This crate coordinates fighters (conversational agents), gorillas (autonomous
6//! agents), the event bus, the scheduler, the background executor, the workflow
7//! engine, and the metering engine. It is the single entry point through which
8//! the rest of the system interacts with the agent runtime.
9
10pub mod a2a_executor;
11pub mod agent_messaging;
12pub mod background;
13pub mod budget;
14pub mod config_watcher;
15pub mod event_bus;
16pub mod metering;
17pub mod metrics;
18pub mod patterns;
19pub mod registry;
20pub mod ring;
21pub mod scheduler;
22pub mod shutdown;
23pub mod swarm;
24pub mod tenant_registry;
25pub mod triggers;
26pub mod troop;
27pub mod workflow;
28pub mod workflow_conditions;
29pub mod workflow_loops;
30pub mod workflow_validation;
31
32pub use a2a_executor::A2ATaskExecutor;
33pub use agent_messaging::MessageRouter;
34pub use background::{BackgroundExecutor, fighter_manifest_from_gorilla, run_gorilla_tick};
35pub use budget::{BudgetEnforcer, BudgetLimit, BudgetStatus, BudgetVerdict};
36pub use config_watcher::{KernelConfigDiff, KernelConfigWatcher};
37pub use event_bus::EventBus;
38pub use metering::{MeteringEngine, ModelPrice, SpendPeriod};
39pub use metrics::{MetricsRegistry, register_default_metrics};
40pub use patterns::{
41    ChainHandler, MapReduceConfig, MapReduceResult, ScatterResponse, SupervisedWorker,
42    SupervisorConfig, auction_filter_bids, auction_select_winner, chain_find_handler, chain_walk,
43    execute_auction, execute_chain_of_responsibility, execute_map_reduce,
44    execute_map_reduce_distributed, execute_scatter_gather, map_reduce_merge, map_split,
45    scatter_select, supervisor_handle_failure, supervisor_monitor_health,
46};
47pub use registry::AgentRegistry;
48pub use ring::{FighterEntry, GorillaEntry, Ring};
49pub use scheduler::Scheduler;
50pub use shutdown::ShutdownCoordinator;
51pub use swarm::{FighterLoad, ProgressReport, SwarmCoordinator};
52pub use tenant_registry::TenantRegistry;
53pub use triggers::{
54    Trigger, TriggerAction, TriggerCondition, TriggerEngine, TriggerId, TriggerSummary,
55};
56pub use troop::{TaskAssignmentResult, TroopManager};
57pub use workflow::{
58    CircuitBreakerState, DagExecutionResult, DagWorkflow, DagWorkflowStep, DeadLetterEntry,
59    ExecutionTraceEntry, OnError, StepExecutor, StepResult, StepStatus, Workflow, WorkflowEngine,
60    WorkflowId, WorkflowRun, WorkflowRunId, WorkflowRunStatus, WorkflowStep, execute_dag,
61    expand_dag_variables,
62};
63pub use workflow_conditions::{Condition, evaluate_condition};
64pub use workflow_loops::{LoopConfig, LoopState, calculate_backoff, parse_foreach_items};
65pub use workflow_validation::{ValidationError, topological_sort, validate_workflow};