import * as fs from "node:fs"; import { type IntercomEventBus, type SubagentState } from "../../shared/types.ts"; import type { CompletionNotification, CompletionNotifier } from "./notify.ts"; type ResultWatcherFs = Pick; type ResultWatcherTimers = { setTimeout: typeof setTimeout; clearTimeout: typeof clearTimeout; setInterval: typeof setInterval; clearInterval: typeof clearInterval; }; type ResultWatcherDeps = { fs?: ResultWatcherFs; timers?: ResultWatcherTimers; notifier?: Pick; /** Receives persisted completions before active-session delivery filtering. */ observeCompletion?: (result: CompletionNotification & { runId: string; }) => void; /** External grouped-result transport. Disable when native completion notifications own delivery. */ deliverIntercomResults?: boolean; }; /** * Watches persisted async results for the session currently owned by this * runtime. `stopResultWatcher()` revokes ownership before closing resources, * so old callbacks can never emit or delete after reload/session replacement. */ export declare function createResultWatcher(pi: { events: IntercomEventBus; }, state: SubagentState, resultsDir: string, completionTtlMs: number, deps?: ResultWatcherDeps): { startResultWatcher: () => void; primeExistingResults: (options?: { triggerTurn?: boolean; }) => void; stopResultWatcher: () => void; }; export {}; //# sourceMappingURL=result-watcher.d.ts.map