import type { DaemonInfo } from './registry.js'; import type { Aggregator } from './aggregator.js'; export type DaemonSnapshot = { sessions: any[]; schedules: any[]; }; export type SnapshotFetcher = (port: number, signal: AbortSignal) => Promise; /** * Install one daemon's authoritative snapshot into the aggregator. Runs as * the subscribeDaemon barrier — BEFORE any SSE frame is read — on both * initial attach and reconnect, so the snapshot can never clobber fresher * SSE-delivered state. * * Epoch arbitration: `signal` is the subscription's abort signal. If this * subscription was aborted (daemon offline, superseded by a newer * generation) while the fetches were in flight, the result is discarded * entirely — applying it would reverse-clobber the newer generation's * state. The aggregator's hydrate paths have no version arbitration, so the * subscription generation (this signal) is the arbitration: abort ⟺ this * generation is no longer authoritative for the daemon. The check-then- * mutate sequence below has no await in between, so no abort can interleave. * * Best-effort: on failure the live SSE stream remains the source of truth. */ export declare function reconcileDaemonSnapshot(d: DaemonInfo, agg: Aggregator, signal: AbortSignal, fetchSnapshot?: SnapshotFetcher): Promise; //# sourceMappingURL=daemon-reconcile.d.ts.map