import { summarize, type SubAgentLiveView } from './status-line-renderer.js'; export declare const DEFAULT_POLL_INTERVAL_MS = 10000; export declare const DEFAULT_STALE_THRESHOLD_MS: number; export type PollRecord = { readonly path: string; readonly role: string; }; export type PollerStatusEvent = { readonly kind: 'status'; readonly line: string; readonly summary: ReturnType; readonly views: readonly SubAgentLiveView[]; }; export type PollerStaleEvent = { readonly kind: 'stale'; readonly path: string; readonly role: string; readonly lastBeatAgoSec: number; readonly thresholdSec: number; }; export type PollerDoneEvent = { readonly kind: 'done'; readonly summary: ReturnType; }; export type PollerEvent = PollerStatusEvent | PollerStaleEvent | PollerDoneEvent; export type PollerHandlers = { onStatus?: (event: PollerStatusEvent) => void; onStale?: (event: PollerStaleEvent) => void; onDone?: (event: PollerDoneEvent) => void; onError?: (error: unknown) => void; }; export type PollerOptions = { prefix: string; intervalMs?: number; staleThresholdMs?: number; now?: () => Date; }; export declare class BatchHeartbeatPoller { private readonly records; private readonly handlers; private readonly options; private timer; private prevStale; private prevSummaryDone; private running; constructor(records: readonly PollRecord[], handlers: PollerHandlers, options: PollerOptions); start(): void; stop(): void; /** Force a tick (testing seam + low-level access for explicit invocation). */ tick(): void; /** * First-sight `stale` notices for the current record set (moved verbatim * out of `tick` to clear its `max-lines-per-function` arm). */ private emitStaleNotices; /** * The `done` / stop decision for the current record set (moved verbatim * out of `tick` to clear its `max-lines-per-function` arm). */ private finishIfAllTerminal; }