Skip to main content

Crate cap_rs_orchestrator

Crate cap_rs_orchestrator 

Source
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.yaml schema + validation.
event
Types crossing the engine↔consumer boundary. This boundary is an in-process mpsc channel 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 Driver for a session. Behind a trait so tests use scripted stubs and the engine uses real CLI agents.
real_factory
Builds real cap-rs drivers. 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, no Mutex<Driver>.
worktree
Per-session workspace allocation. Default is one git worktree per session, branched off the fleet’s base_branch.

Enums§

OrchestratorError
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 repo with the default static YAML routing strategy.
run_with_strategy
Convenience façade: run a fleet with a custom routing strategy.