Skip to content

HerdrUpdateService

Defined in: src/herdr-update.ts:145

Tracks whether a newer herdr (the external terminal multiplexer Shepherd drives) is published upstream and, on demand, drives herdr update for the operator. It surfaces a badge keyed off updateAvailable.

The check parses the installed version from herdr --version and compares it against herdr.dev/latest.json. It is fail-safe: any error (binary missing, network down, malformed payload) yields updateAvailable:false, so a broken check can never raise a false badge.

apply() spawns herdr update --handoff as a managed child of shepherd (no systemd-run, no shepherd restart). Shepherd stays up — no 502. Success is determined by re-reading herdr --version after the child exits, not by exit code (herdr update exits 0 even when it prints “Herdr was not updated”). The terminal result is emitted via onDone.

new HerdrUpdateService(deps?): HerdrUpdateService

Defined in: src/herdr-update.ts:157

HerdrUpdateDeps = {}

HerdrUpdateService

apply(): object

Defined in: src/herdr-update.ts:239

Kick off the update in the background. Returns immediately so the HTTP endpoint can answer 202; progress streams via onLog and the terminal outcome via onDone. Guards against a double-launch while one is in flight.

object

started: boolean


check(now): Promise<HerdrUpdateStatus>

Defined in: src/herdr-update.ts:307

Re-read the installed herdr version and the latest published one, then compare. On any failure returns updateAvailable:false with an error set.

number

Promise<HerdrUpdateStatus>


current(): HerdrUpdateStatus | null

Defined in: src/herdr-update.ts:232

Last computed status, or null before the first check.

HerdrUpdateStatus | null