/** * Scheduler - drives the periodic check loop. * * Uses setInterval under the hood. Each WatchConfig gets its own timer * so independent intervals are fully supported. * * Full pipeline per check: * Fetcher/BrowserFetcher - Cleaner - Parser - DiffEngine - Store - Notifier */ import { type DiffReport, type IStore, type WatchConfig, type WatcherStatus } from "../models.js"; export type GlobalCallback = (report: DiffReport) => void | Promise; export declare class Scheduler { private readonly store; private readonly fetcher; private readonly browserFetcher; private readonly fileFetcher; private readonly parser; private readonly engine; private readonly notifier; private readonly globalCallbacks; private readonly timers; private readonly urlStates; /** URLs where AI was permanently disabled (invalid key / bad model). */ private readonly aiDisabled; private readonly semaphore; /** Global floor on minimum seconds between checks (can be overridden per-watcher). */ private readonly globalMinInterval; private configs; constructor(store: IStore, concurrency?: number, globalMinInterval?: number); addGlobalCallback(cb: GlobalCallback): void; /** * Start monitoring all configs. * * Each config runs an immediate first check, then repeats every * `config.interval` seconds (± jitter). * * Returns a `stop()` function. */ start(configs: WatchConfig[]): () => void; private scheduleCron; /** Wrapper that applies semaphore + maintenance/active-hours skip logic before check(). */ private runCheck; stop(): void; /** Run a single check and return the DiffReport (or null on first run / error). */ checkOnce(config: WatchConfig): Promise; pause(urlOrId: string): void; resume(urlOrId: string): void; getStatuses(configs: WatchConfig[]): WatcherStatus[]; /** Returns the canonical identity key for a config (id takes priority over url). */ private stateKey; private initState; private makeEmptyState; private getState; private handleStatusChange; /** Compute interval with optional ±jitter, floored by minInterval. */ private effectiveInterval; private check; /** * Re-fetch and compare content against `expectedContent` to confirm a change is stable. * Returns true if the change persists, false if the content reverted. */ private checkConfirm; /** Fire all alerts and side-effects for a confirmed change. */ private dispatchChange; private pruneByRetention; } //# sourceMappingURL=index.d.ts.map