import { type WakeLaneInput } from './wake-lanes'; /** * Identifies THIS daemon process, minted once at module load. * * Sent on the socket handshake, on every wake receipt, and with every terminal * report. The hub records it against the wake row, so it can answer "did the * process that took this wake die?" — the one question a lease timeout cannot * answer, because a healthy agent run is legitimately open for 30+ minutes. */ export declare const BOOT_ID: `${string}-${string}-${string}-${string}-${string}`; export interface AckedLane { lane: string; /** The hub row this boot owns, when the wake came from the queue. */ pendingWakeId?: string | null; type: string; ackedAt: string; } /** * How a finished wake outcome is reported to the hub. * * `'queued'` is deliberately `'none'`, not deferred. A queued wake is already * durably retained in the bridge outbox, so the outbox drain is the ONLY retry * owner. Asking the hub to retry it as well runs the same lane twice: the * observed live failure was one human "Improve plan" pass spawning two plan * sessions. `'deferred'` keeps the hub retry because no outbox copy owns it. */ export type HubWakeReport = 'terminal' | 'deferred' | 'none'; export declare function hubWakeReport(outcome: string): HubWakeReport; /** The lane an event belongs to, or null when it has no coalescing identity. */ export declare function laneOf(event: WakeLaneInput & { type: string; }): string | null; /** * Record that this boot has taken ownership of a wake. * * Returns null for a lane-less wake: those are refused by the outbox and by * `PendingWakeService.enqueue` for the same reason — two identity-less wakes * cannot be told apart, so nothing here may pretend to settle one. */ export declare function noteAck(agentId: string, event: WakeLaneInput & { type: string; pendingWakeId?: string | null; }): AckedLane | null; /** * Take the lane's debt, if this boot still owes a report for it. * * Returns null when there is nothing to settle — which is the normal case for a * live (unqueued) wake that never had a hub row. Callers treat null as a no-op, * never as an error. */ export declare function takeLane(agentId: string, lane: string): AckedLane | null; /** Take EVERY unsettled lane for an agent (one session ends, one lane finishes). */ export declare function takeAllLanes(agentId: string): AckedLane[]; /** Outstanding debt, for `/ping`, `bridge-state` and diagnostics. */ export declare function unsettledCount(agentId: string): number; /** Drop an agent's debt entirely (its loop is stopping). */ export declare function forgetAgent(agentId: string): void;