/** Stable subsystem identifiers shared by the daemon (writer) and `agents daemon` (reader). */
export declare const SUBSYSTEM_SECRETS_BROKER = "secrets-broker";
export declare const SUBSYSTEM_BROWSER_IPC = "browser-ipc";
/**
 * Daemon startup itself (RUSH-2418). Unlike the two above, this record is
 * written from BOTH sides: the launching CLI records a start that produced no
 * live daemon, and the daemon records its own successful claim. Its
 * `consecutiveFailures` is what `ensureDaemonStarted` reads to open the
 * auto-start circuit breaker, so a daemon dying on boot stops being relaunched
 * by every foreground command that happens to want one.
 */
export declare const SUBSYSTEM_DAEMON_START = "daemon-start";
/** One subsystem's health as of the last time it reported in. */
export interface SubsystemHealth {
    /** Stable identifier, e.g. 'secrets-broker', 'browser-ipc'. */
    subsystem: string;
    /** Most recent error message, or null if it has never failed. */
    lastError: string | null;
    /** ISO timestamp of the most recent error, or null. */
    lastErrorAt: string | null;
    /** Consecutive failures since the last success (0 when currently healthy). */
    consecutiveFailures: number;
    /** ISO timestamp of the most recent success, or null if it has never succeeded. */
    lastOkAt: string | null;
    /**
     * `ServiceSupervisor`'s lifecycle state (`idle`/`running`/`parked`/`stopped`),
     * written by `recordSubsystemState` on every transition. Only present for
     * supervisor-managed subsystems (RUSH-3193 P4) — a subsystem that predates the
     * supervisor (e.g. `daemon-start`) never has this field, which is how `agents
     * daemon services` tells a measured state from an inferred one.
     */
    state?: string;
}
/** Record a successful subsystem check-in — clears the failure streak. */
export declare function recordSubsystemOk(subsystem: string, at?: string): void;
/** Record a subsystem failure — bumps the consecutive-failure streak. */
export declare function recordSubsystemError(subsystem: string, error: string, at?: string): void;
/**
 * Refine the reason on an already-counted failure, without bumping the streak.
 *
 * Exists because a start is counted BEFORE its outcome is known (RUSH-2418):
 * the launcher marks the attempt, then replaces the provisional reason with the
 * real one if it fails outright. Calling `recordSubsystemError` a second time
 * would count one failed start as two.
 *
 * Describing a failure that was never counted would be a lie in the other
 * direction — a `lastError` with `consecutiveFailures: 0` — so an unreported
 * subsystem is left alone rather than given a blank record to decorate.
 */
export declare function recordSubsystemErrorReason(subsystem: string, error: string, at?: string): void;
/**
 * Record a `ServiceSupervisor` lifecycle-state transition, without touching
 * the ok/error streak. Cross-process readers (`agents daemon services`) have
 * no other way to see `parked`/`stopped` vs `running` — `agents daemon
 * status` runs as a separate process from the daemon (see module docblock).
 */
export declare function recordSubsystemState(subsystem: string, state: string): void;
/** Read one subsystem's health record, or null if it has never reported in. */
export declare function readSubsystemHealth(subsystem: string): SubsystemHealth | null;
/** Read every subsystem's health record, sorted by subsystem name. */
export declare function readAllSubsystemHealth(): SubsystemHealth[];
