/** * Maintenance signal — notifies active poll loops immediately when the * maintenance flag file is written, so they can return the maintenance * response before the server process is killed. * * Uses fs.watch() on the data directory to detect flag creation without * requiring callers to poll. The exported emitMaintenanceSignal() is * available for manual/test triggering. */ /** Close the filesystem watcher (call during shutdown). */ export declare function closeMaintenanceWatcher(): void; /** * Record that a thread observed the maintenance flag. * @returns true on the FIRST observation this cycle (for one-shot side effects * like a Telegram notification), false on repeat observations. */ export declare function markMaintenanceObserved(threadId: number): boolean; /** Whether a thread has already observed the maintenance flag this cycle. */ export declare function hasObservedMaintenance(threadId: number): boolean; /** Reset the observed set (call when the maintenance flag is cleared). */ export declare function clearMaintenanceObserved(): void; /** Manually fire the maintenance signal (e.g. from tests or from code that * writes the flag directly without going through the file system watcher). */ export declare function emitMaintenanceSignal(): void; /** * Subscribe to the maintenance signal. * @returns An unsubscribe function — call it to remove the listener. */ export declare function onMaintenanceSignal(cb: () => void): () => void; //# sourceMappingURL=maintenance-signal.d.ts.map