Skip to main content

Crate prospero_core

Crate prospero_core 

Source
Expand description

Core orchestration logic and shared types for Prospero.

This crate is the shared library behind the prospero CLI, the prosperod daemon, and the web/API surface. It models a fleet of Caliban agents across repos and speaks caliban’s NDJSON IPC protocol through a thin, self-contained client — the wire format is the only coupling to caliban.

Re-exports§

pub use bus::BusEvent;
pub use bus::BusSubscription;
pub use bus::EventBus;
pub use bus::InProcessBus;
pub use caliband::sources::discover_sources;
pub use caliband::wire::AttachInbound;
pub use config_store::ConfigStore;
pub use config_store::SqliteConfigStore;
pub use distributed_bus::DistributedBus;
pub use error::CoreError;
pub use error::Result;
pub use fleet::FleetConfig;
pub use fleet::FleetManager;
pub use fleet::SpawnRequest;
pub use fleet_provider::FleetAdmin;
pub use fleet_provider::FleetProvider;
pub use fleet_provider::LocalFleet;
pub use leased_ownership::LeasedOwnership;
pub use metrics::Metrics;
pub use metrics::MetricsSnapshot;
pub use ownership::Lease;
pub use ownership::Ownership;
pub use ownership::SelfOwnsAll;
pub use postgres_config_store::PostgresConfigStore;
pub use postgres_store::PostgresStore;
pub use registry::RegisteredWorkspace;
pub use registry::Registry;
pub use sqlite_store::SqliteStore;
pub use store::JsonlStore;
pub use store::Store;

Modules§

bus
Live event distribution behind a trait.
caliband
Caliban integration: wire types, NDJSON framing, the control client, and the stream-json normalizer. The wire format is the only coupling to caliban.
config_store
Mutable config records (the managed-repo registry) on the shared DB.
discovery
Resolve a repo root to its caliband control socket, and ensure a daemon is running for it.
distributed_bus
Clustered live distribution via Postgres LISTEN/NOTIFY — the doorbell.
error
Error types for the orchestration core.
event
Prospero’s normalized event type — the stable contract consumers see.
fleet
The runtime heart of the control plane.
fleet_provider
The FleetProvider seam: an ensure-desired-state + observe abstraction over a fleet of caliband-supervised agents. LocalFleet is the caliband-over-Unix -sockets backend (today’s behavior); future backends (K8sFleet — epic #274 P2; remote — prospero #1) implement the same trait. The live session plane (attach/stream/steer) is deliberately NOT part of this trait — it stays on CalibandClient and is shared across backends.
leased_ownership
Clustered single-writer ownership via a Postgres lease row per stream.
metrics
Process-lifetime operational counters for prosperod.
model
Prospero’s fleet domain model: Host -> Workspace -> [Agent].
ownership
Which process is the single writer for a given stream.
postgres_config_store
sqlx-backed Postgres ConfigStore — the clustered-tier config backend.
postgres_store
sqlx-backed Postgres Store — the clustered-tier event backend.
provider_env
Pure resolution of a repo’s caliband environment overlay.
registry
The persisted set of workspaces Prospero manages.
sqlite_store
sqlx-backed sqlite Store — the default prosperod backend.
store
Durable history for fleet events.

Structs§

Agent
Prospero’s view of a single agent (projected from a caliban AgentRecord).
FleetEvent
A normalized, sequenced fleet event.
FleetSnapshot
A point-in-time view of the whole fleet on one host.
Readiness
Aggregate readiness of prosperod, distinct from mere liveness.
RepoProviderConfig
Per-repo provider/environment configuration applied to its caliband daemon.
Source
One source checkout within a workspace. (The discover_sources filesystem logic stays in prospero-core; only this struct is shared.)
Workspace
A managed workspace (root + its source checkouts) and the agents running under its single caliband.

Enums§

AgentStatus
Lifecycle state of an agent. Mirrors caliban’s AgentStatus wire enum exactly so the same value round-trips through both protocols.
EventKind
The semantic payload of a fleet event.
OutputStream
Which textual stream a chunk of output came from.
WorkspaceHealth
Connectivity of a managed workspace’s caliband daemon.

Constants§

VERSION
Crate version, sourced from Cargo.toml.