import type { AutomationPort } from '../ports/automation-port'; import type { Logger } from '../ports/logger-port'; import type { SegmentReaderPort } from '../ports/segment-reader-port'; export type AutomationPollerState = 'idle' | 'running' | 'draining' | 'stopped'; export interface AutomationPollerConfig { automationPort: AutomationPort; segmentReaderPort: SegmentReaderPort; pollingIntervalS: number; /** * Identifies this process to the orchestrator's single-poller election. Stable for the process's * lifetime, distinct across instances. */ instanceId: string; logger?: Logger; stopTimeoutS?: number; } /** * Drives the automated inboxes of one environment: asks the orchestrator which ones to poll, reads * their segment on the client's agent, and reports back. It never decides what runs — the * orchestrator owns the concurrency cap, the active-run check and the run start. * * Kept apart from `Runner`: they share nothing but a polling shape, and a failure on one side must * not stop the other. */ export default class AutomationPoller { private readonly config; private readonly logger; private readonly inFlightInboxes; private tickTimer; private currentTick; private currentCycle; private readonly lease; private readonly inboxPoll; private sweepCutShort; private nextSweepAt; private _state; constructor(config: AutomationPollerConfig); get state(): AutomationPollerState; start(): void; stop(): Promise; private scheduleTick; private tick; private runPollCycle; } //# sourceMappingURL=automation-poller.d.ts.map