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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HerdrUpdateService(
deps?):HerdrUpdateService
Defined in: src/herdr-update.ts:157
Parameters
Section titled “Parameters”HerdrUpdateDeps = {}
Returns
Section titled “Returns”HerdrUpdateService
Methods
Section titled “Methods”apply()
Section titled “apply()”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.
Returns
Section titled “Returns”object
started
Section titled “started”started:
boolean
check()
Section titled “check()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<HerdrUpdateStatus>
current()
Section titled “current()”current():
HerdrUpdateStatus|null
Defined in: src/herdr-update.ts:232
Last computed status, or null before the first check.
Returns
Section titled “Returns”HerdrUpdateStatus | null