/** * Epoch watcher for lane-bound sessions: the prompt-awareness half of "perfect sync". Watches * the shared `epoch.json` (fs.watch on its directory -- the file is replaced by rename) and, on * an epoch advance by ANOTHER lane, injects one deterministic staleness notice through the host's * message seam. Enforcement never rides on this watcher -- the lane gate (G8) and the land CAS * (G3) fail closed even if it dies; this only makes lanes learn promptly instead of at their * next tool call. */ import type { WorktreeSyncEpoch } from "./codes.ts"; export interface EpochWatcherConfig { epochFile: string; /** The lane this session is bound to: lands BY this lane never notify it. */ laneKey: string; notify: (text: string) => void; /** Debounce for rename/change event bursts. */ debounceMs?: number; } export interface EpochWatcherHandle { stop(): void; } /** Deterministic notice text -- assembled from epoch facts, never model-generated. */ export declare function formatEpochNotice(epoch: WorktreeSyncEpoch, laneKey: string): string; /** * Start watching. The initial epoch is read once as the baseline; only ADVANCES past it notify * (a fresh session never gets a notice for history). fs.watch is backed by a low-frequency * poll re-read on each event burst only -- no timers run while the store is quiet. */ export declare function startEpochWatcher(config: EpochWatcherConfig): EpochWatcherHandle; //# sourceMappingURL=watcher.d.ts.map