Updater commands

updater checks a JSON manifest, downloads an artifact, replaces the bundle and starts the new copy. It is registered only when the config has an updater section: an app with no update story carries no download-and-replace surface at all, and naming updater in plugins without that section is the unknown-plugin error it should be.

Nothing is installed that this run did not verify. download requires a sha256, fetches https only, verifies a signature with the config's pinned key alone, and records a receipt that install refuses to work without. An app that pins updater.pubkey also requires a signature: with only a digest, a server that answers both the manifest and the artifact picks both halves.

Commands

commandargumentsanswer
confignone{ endpoint, pubkey, autoCheck, allowFileUrl }
check{ endpoint, currentVersion }{ available, version?, url?, notes?, sha256?, signature?, pubkey?, error? }
download{ url, sha256, signature?, pubkey? }{ ok, path, bytes, sha256, signer? }
install{ path, appPath, relaunch? }{ ok, appPath, backup } or { ok: false, code, message, installed?, parkedAt?, appPath, backup }
relaunch{ appPath }{ ok, started: true }

config reports what the updater section set, so a page can render an update pane without guessing. check reads the manifest, compares versions numerically (0.10.0 beats 0.9.0, and 1.0.0 beats 1.0.0-beta.1), and answers available: false with version when there is nothing newer — a failure arrives in error, never as a throw. A manifest whose pubkey is not the configured one is refused as bad-manifest. endpoint falls back to the config's own. check obeys the same scheme policy as download: https only, or file: only when updater.allowFileUrl is set, with the refusal in error.

download requires sha256 — a 64-hex digest, either case — because an artifact nothing verified is no artifact: without it the answer is invalid-arguments with requires: "sha256". The URL must be https. A file: URL is fetched only when the config sets updater.allowFileUrl, and that refusal carries requires: "updater.allowFileUrl"; any other scheme is refused outright. signature is base64 Ed25519 over the artifact bytes. When updater.pubkey is set in the config, a download with no signature is refused as invalid-arguments with requires: "signature" — a digest alone is not verification for a pinned app. A pubkey argument may only name the configured key, never replace it; both are canonical base64 of 32 bytes. The verified digest comes back in sha256, and signer names the key that verified it.

install renames the new bundle over the old and parks the old at <appPath>.old. It refuses a path this run did not download (unverified-artifact), re-checks the digest so a file changed since download is hash-mismatch, refuses a target that is not an existing .app directory, and refuses a target that is not the bundle this process is running from. relaunch: true starts the new copy after the swap. A launch failure answers { ok: false, code: "relaunch-failed", installed: true, appPath, backup }: the swap stays landed and is never rolled back, but ok means the app is running the new build. If a forward rename fails and restoring the old bundle fails too, the answer is rollback-failed with parkedAt: <backup> — the only copy of the old app is at that path.

install and relaunch refuse off macOS. Both answer unsupported-platform on any other platform: the swap renames an .app bundle and the launch uses open -n, and no other OS has that path. An app that cannot apply an update says so by name instead of reporting a success that can never finish.

Failure codes: invalid-arguments, check-failed, bad-manifest, download-failed, invalid-archive, hash-mismatch, signature-mismatch, install-failed, rollback-failed, relaunch-failed, not-an-app-bundle, unsupported-platform, unverified-artifact, handler-error. Every failure that needs something also carries requires, and one that is about a file carries its path.