Skip to main content

Module version

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§

CheckQuery
RestartInfo
Detected restart mode plus the command to show the operator.
UpgradeAcceptedResponse
202 body for POST /api/version/upgrade: the id to poll status with.
UpgradeRequest
UpgradeStatusQuery
UpgradeStatusResponse
Response body for GET /api/version/upgrade/status. When no upgrade has run this process only state: "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 — see crate::openapi.
VersionCheckResponse
Response body for GET /api/version/check. On success every field except error is 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 — see crate::openapi.
VersionErrorResponse
Error envelope for the /api/version/* endpoints (4xx).

Enums§

RestartMode
How a post-upgrade restart is achieved in this environment.
UpgradeStatusState
Wire-format lifecycle state for GET /api/version/upgrade/status. Mirrors UpgradeState plus Idle (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]