/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ /** How often the page asks the CLI whether it is still there. */ export declare const HEARTBEAT_MS = 1000; /** * How long one probe may take before it counts as a miss. * * Longer than the interval, because a busy CLI answering slowly is still * alive — but bounded, or a probe against a half-open socket never settles and * the page waits on it forever while showing controls that cannot work. */ export declare const HEARTBEAT_TIMEOUT_MS = 2500; export interface CliLiveness { /** The CLI answered its last probe. Everything that talks to it is gated on this. */ readonly online: boolean; /** `startedAt` of the process that last answered, or undefined before the first. */ readonly startedAt: number | undefined; /** * The CLI answered, but it is a DIFFERENT process than the one this page was * talking to. It is reachable, and it remembers none of the runs on screen. */ readonly restarted: boolean; } export declare const INITIAL_LIVENESS: CliLiveness; /** * Folds one probe result into the liveness state. * * Pure, so the rule that matters — what counts as a restart — can be tested * without a server or a timer. */ export declare function reduceHeartbeat(previous: CliLiveness, probe: { readonly ok: boolean; readonly startedAt?: number | undefined; }): CliLiveness;