/**
 * HandoffReceiver — the INCOMING-machine side of the planned handoff (spec §8
 * G3d/G3e), the counterpart to the outgoing-only HandoffSentinel.
 *
 * The incoming machine is already receiving the live tail (via /api/live-tail).
 * When the outgoing machine signals a handoff is beginning, this receiver:
 *   1. builds its "caught up" ack — echoing the live-tail sequence it holds, the
 *      ingress position it will resume from, and a hash of the thread history it
 *      loaded (the outgoing verifies this echo before yielding);
 *   2. sends the ack to the outgoing machine;
 *   3. on the explicit `yield` signal (the ONLY trigger), acquires the lease via
 *      the consented path.
 *
 * State machine: idle → catching_up → ack_sent → acquired | failed.
 *
 * The yield is acted on ONLY while a handoff is in progress (ack_sent) — a stray
 * yield with no handoff underway is ignored (and the lease's own consent guard
 * refuses a yield from a non-holder regardless). All I/O is injected, so the
 * sequencing is unit-testable without a network.
 */
import type { HandoffAck } from './HandoffSentinel.js';
export type HandoffReceiverState = 'idle' | 'catching_up' | 'ack_sent' | 'acquired' | 'failed';
export interface HandoffReceiverOps {
    /** Build the "caught up" ack from the live-tail buffer + adapter ingress + thread hash. */
    buildAck: () => Promise<HandoffAck>;
    /** Send the ack to the outgoing machine (HandoffWireTransport.sendAck). */
    sendAck: (ack: HandoffAck) => Promise<boolean>;
    /** Acquire the lease on the verified yield (coordinator.acquireLeaseOnConsent). */
    acquireOnYield: () => Promise<boolean>;
}
export interface HandoffReceiverConfig {
    logger?: (msg: string) => void;
    onTerminal?: (state: 'acquired' | 'failed', detail: string) => void;
}
export declare class HandoffReceiver {
    private readonly ops;
    private readonly cfg;
    private _state;
    constructor(ops: HandoffReceiverOps, cfg?: HandoffReceiverConfig);
    get state(): HandoffReceiverState;
    private log;
    /**
     * The outgoing machine has begun a handoff to us. Build + send our caught-up
     * ack. Returns true if the ack was sent (the outgoing will verify the echo and,
     * if it matches + validation passes, send a yield).
     */
    onBeginHandoff(): Promise<boolean>;
    /**
     * The outgoing machine sent the explicit yield. Acquire the lease — but ONLY if
     * a handoff is genuinely in progress (we sent an ack). A stray yield is ignored.
     */
    onYield(): Promise<boolean>;
    /** Reset to idle (e.g. a handoff was aborted or completed). */
    reset(): void;
}
//# sourceMappingURL=HandoffReceiver.d.ts.map