import type { StreamFn } from "@earendil-works/pi-agent-core"; export interface IdleTimeoutOptions { /** No stream event within this many ms ⇒ considered stalled. */ idleMs: number; /** Max retries for pre-first-token stalls. */ maxRetries: number; /** Optional diagnostic sink. */ log?: (message: string) => void; } /** * Wrap a streamFn so each per-turn model stream is guarded by an idle watchdog with * bounded retries. The returned function has the same (model, context, options) * signature and returns the same async-iterable + result() shape. */ export declare function wrapStreamFnWithIdleTimeout(inner: StreamFn, opts: IdleTimeoutOptions): StreamFn;