Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,59 @@ paths:
schema:
$ref: "#/components/schemas/Error"

/v1/status:
get:
operationId: statusSnapshot
tags: [system]
summary: Get a redacted daemon status snapshot
responses:
"200":
description: Current daemon status
content:
application/json:
schema:
type: object

/v1/agent/status:
get:
operationId: agentLiveStatus
tags: [system]
summary: Live per-agent status for external mission-control dashboards
description: |
Returns machine-readable live state (working/idle/stale) for every
active agent session, derived from daemon ground truth: an in-flight
generation means working; recency of last use distinguishes idle from
stale. Designed for supervisors such as terminal mission-control
dashboards to poll.
responses:
"200":
description: Live agent statuses
content:
application/json:
schema:
type: object
properties:
generated_at:
type: string
agents:
type: array
items:
type: object
properties:
session_id:
type: string
agent:
type: string
state:
type: string
enum: [working, idle, stale]
turns:
type: integer
cwd:
type: string
last_used:
type: string

/v1/ready:
get:
operationId: readinessProbe
Expand Down Expand Up @@ -681,6 +734,68 @@ paths:
schema:
$ref: "#/components/schemas/Error"

/v1/sessions/{id}/lease:
post:
operationId: acquireSessionLease
tags: [sessions]
summary: Acquire a single-owner lease on a session
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: Lease acquired
content:
application/json:
schema:
type: object
properties:
session_id:
type: string
fence:
type: string
"400":
description: Invalid session id
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
operationId: releaseSessionLease
tags: [sessions]
summary: Release a session lease (requires the current fence)
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: fence
in: query
schema:
type: string
responses:
"200":
description: Lease released
content:
application/json:
schema:
type: object
properties:
session_id:
type: string
released:
type: string
"409":
description: Lease owned by another fence
content:
application/json:
schema:
$ref: "#/components/schemas/Error"

/v1/sessions/{id}/graph:
get:
operationId: getSessionGraph
Expand Down
3 changes: 3 additions & 0 deletions tests/test_openapi_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def test_every_daemon_path_has_an_sdk_support_decision() -> None:
"/v1/sessions/{id}": "supported",
"/v1/sessions/{id}/graph": "supported",
"/v1/sessions/{id}/messages": "supported",
"/v1/sessions/{id}/lease": "unsupported: session lease endpoint",
"/v1/stats": "supported",
"/v1/status": "unsupported: daemon status endpoint",
"/v1/agent/status": "unsupported: agent status endpoint",
"/v1/review": "unsupported: asynchronous review orchestration",
"/v1/review/status": "unsupported: review worker status",
"/v1/cancel": "unsupported: in-flight request cancellation",
Expand Down
Loading