export declare function isFinalUsageFrame(parsed: { usage?: unknown; choices?: unknown[] | undefined; }): boolean; /** * Mid-stream silence budget. * * This is deliberately generous because "no bytes" does **not** mean "dead * socket" on an OpenAI-compatible endpoint. Most self-hosted runtimes (vLLM / * SGLang and the tool-call parsers layered on top of them) buffer an entire * `tool_calls` delta before emitting it, so a model writing a large file goes * completely silent on the wire for as long as the generation takes. A 90s * budget aborted those healthy streams at `firstToken + 90s`, reported the * abort as a network failure, and burned three identical retries that each * re-generated the same prefix before one happened to finish inside the window. */ export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 240000; export declare const THINKING_STREAM_IDLE_TIMEOUT_MS = 900000; export declare const THINKING_STREAM_INITIAL_IDLE_TIMEOUT_MS = 900000; export declare function streamIdleBudgets(reasoningEnabled: boolean): { idleTimeoutMs: number; outputIdleTimeoutMs: number; }; export declare const STREAM_STALL_MARKER = "no model output"; export interface StreamLineReaderOptions { signal?: AbortSignal | undefined; idleTimeoutMs?: number | undefined; maxBytes?: number | undefined; onActivity?: (() => void) | undefined; outputIdleTimeoutMs?: number | undefined; outputProgress?: (() => number) | undefined; } export declare function readStreamLines(response: Response, options?: StreamLineReaderOptions): AsyncGenerator; export declare function createSseFrameAssembler(options?: { maxBufferedBytes?: number; }): { pushLine: (line: string) => string | undefined; };