Skip to main content

bamboo_subagent/
lib.rs

1//! `bamboo-subagent` — sub-agent fleet runtime.
2//!
3//! Slice 1 (this build): pure filesystem logic, no runtime dependency.
4//!
5//! - [`store`] — project-keyed session store + denormalized indices (rebuildable cache).
6//! - [`mailbox`] — Maildir-style persistent inbox (multi-writer / single-reader, crash-safe).
7//!
8//! See `docs/subagent-actor-runtime-design.md` (§3.4, §5) and
9//! `docs/subagent-store-mailbox-interface.md` for the design these implement.
10//!
11//! The session payload is kept opaque (generic `T: Serialize`/`DeserializeOwned`) so this
12//! crate stays a leaf and is fully unit-testable with a tempdir; higher layers pass the
13//! domain `Session`. Index rebuild is decoupled via the [`store::MetaExtractor`] seam.
14
15pub mod discovery;
16pub mod error;
17pub mod executor;
18pub mod fleet;
19pub mod launcher;
20pub mod mailbox;
21pub mod proto;
22pub mod provision;
23pub mod registry;
24pub mod store;
25pub mod transport;
26
27pub use discovery::{Discovery, Fabric, FileFabric};
28pub use error::{Result, StoreError};
29pub use executor::{ChildExecutor, ChildOutcome, EchoExecutor, EventSink, SteerInbox};
30pub use fleet::{spawn_worker, SpawnedChild};
31pub use launcher::{LocalSubprocessLauncher, WorkerLauncher};
32pub use mailbox::{
33    AdmittedSet, AgentRef, AskBody, AskMode, Delivered, InboxKind, InboxMessage, Mailbox, MsgId,
34    ReplyBody, ADMITTED_SET_CAPACITY,
35};
36pub use proto::{AgentRecord, ChildFrame, ParentFrame, RunSpec, TerminalStatus};
37pub use provision::{
38    Capabilities, ChildIdentity, ExecutorSpec, Limits, McpProxyConfig, ModelRefSpec, Placement,
39    ProvisionSpec, ScopedCredential, SecretsEnvelope, PROVISION_VERSION,
40};
41pub use registry::{RegisterChild, Registration, Registry};
42pub use store::{
43    ChildEntry, ChildFields, ChildStatus, ChildrenIndex, MetaExtractor, ProjectIndex, ProjectKey,
44    RootEntry, RootFields, SessionLoc, SubagentStore,
45};
46pub use transport::{ChildClient, TransportError, TransportResult, WsServer};