import { type IngestResult } from "./ingest/index.js"; export interface WatchOptions { /** Restrict watching to these provider sources. Defaults to every parser. */ sources?: string[]; /** How long to wait after the last change before ingesting (per source). Default 2000ms. */ debounceMs?: number; /** * Safety-net re-scan interval. fs.watch can miss events (notably recursive * subdirectory writes on some runtimes), so we also re-ingest on this cadence. * Re-ingest is mtime-gated and cheap when nothing changed. Default 10000ms; * set 0 to disable. */ pollMs?: number; /** Called after each debounced ingest. */ onIngest?: (result: IngestResult) => void; /** Called when an ingest throws. */ onError?: (error: Error) => void; } export interface Watcher { /** Stop watching and clear pending timers. */ stop(): void; /** Source providers currently being watched. */ readonly sources: string[]; /** Existing provider roots being watched. */ readonly roots: WatchRootStatus[]; readonly debounceMs: number; readonly pollMs: number; } export interface WatchRootStatus { source: string; root: string; exists: boolean; lastAttemptAt: string | null; lastSuccessAt: string | null; lagSeconds: number | null; skippedFiles: number; lastError: string | null; } export interface WatchStatus { sources: string[]; roots: WatchRootStatus[]; debounceMs: number; pollMs: number; } export declare function getWatchStatus(opts?: WatchOptions): WatchStatus; /** * Watch every registered provider's session directories and re-ingest the * affected provider (debounced) whenever files change — keeping the index * continuously fresh for real-time queries. */ export declare function startWatch(opts?: WatchOptions): Watcher; //# sourceMappingURL=watch.d.ts.map