claude_pool/lib.rs
1//! MCP server for managing a pool of Claude CLI slots.
2//!
3//! `claude-pool` manages N Claude CLI instances behind an MCP server interface.
4//! A coordinator (typically an interactive Claude session) calls MCP tools to
5//! submit work, fan out tasks, chain pipelines, and track budgets. The pool
6//! handles slot lifecycle, session resumption, restarts, and shared context.
7//!
8//! # Architecture
9//!
10//! ```text
11//! Coordinator (interactive Claude session)
12//! +-- .mcp.json includes "claude-pool"
13//! +-- claude-pool MCP server
14//! +-- slot-0 (Claude instance)
15//! +-- slot-1 (Claude instance)
16//! +-- slot-N
17//! ```
18//!
19//! One server. N slots. Nothing else.
20
21pub mod chain;
22pub mod config;
23pub mod error;
24pub mod pool;
25pub mod skill;
26pub mod store;
27pub mod supervisor;
28pub mod types;
29pub mod workflow;
30pub mod worktree;
31
32pub use chain::{
33 ChainIsolation, ChainOptions, ChainProgress, ChainResult, ChainStatus, ChainStep, StepAction,
34 StepFailurePolicy, StepResult, execute_chain,
35};
36pub use error::{Error, Result};
37pub use pool::{DrainSummary, Pool, PoolBuilder, PoolStatus};
38pub use skill::{RegisteredSkill, Skill, SkillArgument, SkillRegistry, SkillScope, SkillSource};
39pub use store::{InMemoryStore, PoolStore};
40pub use supervisor::{SupervisorHandle, check_and_restart_slots};
41pub use types::*;
42pub use workflow::{Workflow, WorkflowArgument, WorkflowRegistry};
43pub use worktree::WorktreeManager;