/** * Watcher domain state, managed sources that feed automation and routes. */ import type { AutomationSourceRecord } from '../../../automation/sources.js'; export type WatcherKind = 'webhook' | 'polling' | 'filesystem' | 'socket' | 'integration' | 'manual'; export type WatcherState = 'stopped' | 'starting' | 'running' | 'degraded' | 'failed'; export type WatcherSourceStatus = 'healthy' | 'lagging' | 'stale' | 'degraded' | 'failed' | 'unknown'; export interface WatcherRecord { readonly id: string; readonly kind: WatcherKind; readonly label: string; readonly state: WatcherState; readonly source: AutomationSourceRecord; readonly intervalMs?: number | undefined; readonly lastHeartbeatAt?: number | undefined; readonly sourceLagMs?: number | undefined; readonly sourceStatus?: WatcherSourceStatus | undefined; readonly degradedReason?: string | undefined; readonly lastCheckpoint?: string | undefined; readonly lastError?: string | undefined; readonly metadata: Record; } export interface WatcherDomainState { readonly revision: number; readonly lastUpdatedAt: number; readonly source: string; readonly watchers: Map; readonly watcherIds: string[]; readonly activeWatcherIds: string[]; readonly failedWatcherIds: string[]; readonly totalStarted: number; readonly totalStopped: number; readonly totalFailed: number; readonly totalHeartbeats: number; readonly totalDegraded: number; readonly totalLagged: number; } export declare function createInitialWatcherState(): WatcherDomainState; //# sourceMappingURL=watchers.d.ts.map