Expand description
cap-rs-orchestrator — headless engine that runs N collaborating CLI agents
in one process, driven by a declarative fleet.yaml.
See docs/cap-orchestrator-engine-design.md.
Modules§
- audit
- Immutable, ordered record of every cross-session route the engine performs. Human-auditable per CAP’s “orchestrator-mediated, human-auditable” rule.
- config
- Declarative
fleet.yamlschema + validation. - event
- Types crossing the engine↔consumer boundary. This boundary is an in-process
mpscchannel today and the seam for the future remote (WebSocket) layer. - executor
- Deterministic state machine. Owns the registry + audit log; interprets the
DSL to drive fan-out, joins, and routing. Runs in its own task; the consumer
reads
OrchestratorEvents from the returned channel. - factory
- Constructs a concrete
Driverfor a session. Behind a trait so tests use scripted stubs and the engine uses real CLI agents. - real_
factory - Builds real
cap-rsdrivers. Each first-class agent name maps to its highest-fidelity structured path: - registry
- Owns all live sessions: maps id → inbox sender + task handle.
- routing
- Pluggable routing strategies for the orchestrator.
- session
- One tokio task per session, owning a
Box<dyn Driver>. Communicates only over channels — no shared mutable state, noMutex<Driver>. - worktree
- Per-session workspace allocation. Default is one git worktree per session,
branched off the fleet’s
base_branch.
Enums§
- Orchestrator
Error - Errors surfaced by the orchestrator engine.
Functions§
- chat
- Convenience façade: run an interactive chat fleet against real CLI agents in
repo. - run
- Convenience façade: run a fleet against real CLI agents in
repowith the default static YAML routing strategy. - run_
with_ strategy - Convenience façade: run a fleet with a custom routing strategy.