/** * ci-watch/poller.ts, the daemon polls registered CI watches. * * checkWatch (service.ts) does the whole job, status source, persisted * store, notifier, fix-session offer/starter, but used to be invoked ONLY by * the manual `ci.watches.run` verb, so a "standing watch" stood still unless * someone poked it. This module registers the recurring check on the daemon's * EXISTING scheduling machinery, the watcher registry's polling watcher * (the same host the daemon heartbeat runs on), so the fleet/watcher surface * shows it, its heartbeat/failure states are the registry's own, and stop * semantics come for free. * * Rate-limit posture: one sequential pass over all watches per tick (never * parallel gh calls), a floor on the cadence, and an overlap guard so a slow * pass can never stack a second one on top. */ import type { CiWatchService } from './service.js'; /** Default poll cadence. */ export declare const DEFAULT_CI_POLL_INTERVAL_MS = 60000; /** The cadence floor, polls faster than this hammer the status source's rate limits. */ export declare const MIN_CI_POLL_INTERVAL_MS = 15000; /** The polling watcher's stable id on the watcher registry. */ export declare const CI_WATCH_POLLER_ID = "ci-watch-poller"; /** The slice of the watcher registry the poller registers on. */ export interface CiPollingHost { registerPollingWatcher(input: { id: string; label: string; source: { id: string; kind: 'watcher'; label: string; enabled: boolean; createdAt: number; updatedAt: number; metadata: Record; }; intervalMs: number; run: () => Promise | string | void; }): unknown; startWatcher(id: string): unknown; } /** The slice of the CI-watch service one poll pass needs. */ export type CiWatchPollTarget = Pick; /** * One poll pass: check every registered watch, sequentially, never throwing, * a single repo's failure must not starve the rest. Returns a one-line * checkpoint summary for the watcher registry's heartbeat trail. Exported so * tests drive passes directly without timers. */ export declare function runCiWatchPollPass(service: CiWatchPollTarget): Promise; /** * Register (and start) the recurring CI-watch poll on the watcher registry. * The cadence is clamped to {@link MIN_CI_POLL_INTERVAL_MS}; an in-flight * pass suppresses the next tick (overlap guard) so a slow status source can * never stack passes. */ export declare function registerCiWatchPolling(host: CiPollingHost, service: CiWatchPollTarget, options?: { readonly intervalMs?: number | undefined; }): void; //# sourceMappingURL=poller.d.ts.map