Expand description
Request/response payloads for the HTTP API.
The shared contract types now live in prospero-types (#172) so the WASM
dashboard can use the exact same definitions — see that crate’s api module
for why. They are re-exported here from their original paths, so every import
site and all serde output are unchanged.
What stays in this crate is what does not belong in a neutral DTO crate:
the axum query extractor, and the mapping from a wire body onto
prospero-core’s domain types. ADR 0006 makes api → core one-directional,
so that mapping is the adapter’s job — pushing it into core (or into
prospero-types) would drag a transport concept downward.
Structs§
- AddWorkspace
Body - Body for
POST /api/workspaces. - Agent
Input Body - Body for
POST /api/agents/{id}/input. - Capabilities
- Backend capability signal for the dashboard (
GET /api/capabilities). - FromSeq
- Query params for
GET /api/agents/{id}/eventsand/stream. - Outcome
Counts - How many agents reached each terminal state.
- Respawned
Response - Response for
POST /api/agents/{id}/respawn. - SetConfig
Body - Body for
PUT /api/workspaces/{name}/config. - Spawn
Body - Body for
POST /api/workspaces/{repo}/agents. - Spawned
Response - Response for a successful spawn.
- Usage
Bucket - One day’s usage within a workspace — the unit the fleet charts plot.
- Usage
Group - One workspace’s totals over the whole window, plus its daily series.
- Usage
Query - Query params for
GET /api/usage. - Usage
Report GET /api/usage— aggregated spend and outcomes per workspace.- Workspace
Summary - A workspace summary (no agents) for
GET /api/workspaces.
Functions§
- spawn_
request - Map a spawn request body onto the core
SpawnRequest. - usage_
report - Fold the store’s flat (workspace, day) rows into the per-workspace report.