Module version
Expand description
Version-check and restart-classification helpers for the dashboard’s upgrade affordance (RFC: In-app upgrade with optional supervised restart).
Phase 1 (read-only): GET /api/version/check reports whether a newer
release exists, plus release notes, by shelling out to
zeroclaw update --check --json — keeping a single source of truth for
update logic. Results are cached for an hour to stay well under GitHub’s
unauthenticated rate limit.
Restart classification is advisory only here: it tells the dashboard which restart command to show after an upgrade. The gateway never restarts itself in Phase 1.
Structs§
- Check
Query - Restart
Info - Detected restart mode plus the command to show the operator.
- Upgrade
Accepted Response - 202 body for
POST /api/version/upgrade: the id to poll status with. - Upgrade
Request - Upgrade
Status Query - Upgrade
Status Response - Response body for
GET /api/version/upgrade/status. When no upgrade has run this process onlystate: "idle"is set; during/after a run the remaining fields carry the live phase, log tail, and restart metadata. Single source of truth for the generated web client — seecrate::openapi. - Version
Check Response - Response body for
GET /api/version/check. On success every field excepterroris populated; on a soft failure the handler returns{ current_version, latest_version: null, is_newer: false, error }so the dashboard version badge degrades gracefully. This is the single source of truth the generated web client derives from — seecrate::openapi. - Version
Error Response - Error envelope for the
/api/version/*endpoints (4xx).
Enums§
- Restart
Mode - How a post-upgrade restart is achieved in this environment.
- Upgrade
Status State - Wire-format lifecycle state for
GET /api/version/upgrade/status. MirrorsUpgradeStateplusIdle(no upgrade started this process), and is the serializable enum the OpenAPI schema and generated web client derive from.
Functions§
- detect_
restart - Classify the runtime environment to pick exit-vs-manual and hint text.
- handle_
version_ check GET /api/version/check[?force=true][&version=X]- handle_
version_ upgrade - POST /api/version/upgrade — apply an upgrade via
zeroclaw update. - handle_
version_ upgrade_ status - GET /api/version/upgrade/status[?handoff_id=X]