/**
 * SessionRecoveryConsumer — the LIFELINE-side executor for codex session-wedge
 * self-recovery (tier C). It is the AUTHORITY half of the Signal-vs-Authority
 * split: the server-process sentinel emits requests via SessionRecoveryChannel;
 * this consumer (run from TelegramLifeline, where ServerSupervisor lives) reads
 * them and actually performs the server restart + queue replay.
 *
 * The logic is deliberately separated from TelegramLifeline and takes its
 * effects as injected callbacks (`restart`, `replay`) + an injectable clock, so
 * it is unit-testable without standing up a lifeline. TelegramLifeline wires the
 * real `supervisor.performGracefulRestart` and `replayQueue` and calls `tick()`
 * on an interval.
 *
 * Safety properties (this is the highest-blast-radius path — it restarts the
 * whole agent server):
 *  - DRY-RUN first: `dryRun:true` logs what it WOULD do and acks recovered
 *    without restarting. Ships in this mode.
 *  - DURABLE cooldown: before any restart it checks `channel.isInCooldown`. A
 *    tier-C restart wipes the sentinel's in-memory bound, so this durable guard
 *    is the only thing preventing a restart-can't-fix wedge from looping.
 *  - Records the restart BEFORE acting, so a crash mid-restart still counts
 *    against the cooldown.
 *  - Dedups on (sessionId, attemptId) so a lingering request (the sentinel was
 *    restarted before it could clear it) is not re-executed.
 *  - Never writes the request file (the server owns it) — ack + cooldown only.
 *
 * Spec: docs/specs/CODEX-SESSION-WEDGE-SELF-RECOVERY.md
 */
import type { SessionRecoveryChannel } from './SessionRecoveryChannel.js';
export interface SessionRecoveryConsumerOptions {
    channel: SessionRecoveryChannel;
    /** Perform the server restart (TelegramLifeline → supervisor.performGracefulRestart). */
    restart: (reason: string) => Promise<boolean>;
    /** Replay the queued messages after the server is back (TelegramLifeline.replayQueue). */
    replay: () => void;
    /** When true, log only — never actually restart. Ships true. */
    dryRun: boolean;
    /** Minimum gap between tier-C restarts for the same session (loop guard). */
    cooldownMs: number;
    /** Injectable clock (epoch ms). Defaults to Date.now. */
    now?: () => number;
    /** Injectable logger. Defaults to console.log. */
    log?: (msg: string) => void;
}
export declare class SessionRecoveryConsumer {
    private readonly channel;
    private readonly restart;
    private readonly replay;
    private readonly dryRun;
    private readonly cooldownMs;
    private readonly now;
    private readonly log;
    constructor(opts: SessionRecoveryConsumerOptions);
    /** One pass: handle every pending tier-C recovery request. Best-effort — a
     *  read/exec failure on one request never throws out of tick(). */
    tick(): Promise<void>;
    private handle;
    private ack;
}
//# sourceMappingURL=SessionRecoveryConsumer.d.ts.map