/** * A manual SSE frame parser over `fetch` + `ReadableStream` — never the * `EventSource` API, which cannot send the auth header. Handles frames * split across stream chunks and multi-line `data:` fields. */ export interface SseFrame { readonly event: string; /** The concatenated `data:` lines (joined by "\n"). */ readonly data: string; /** * The frame's `id:` field when present — the server's resume token, echoed back * as `Last-Event-ID` on reconnect so the stream resumes after it. Absent for * frames without an `id:` line (e.g. the agent-run stream, which does not use it). */ readonly id?: string; } export declare function sseOpenToken(): string; /** * Incrementally parse SSE text. Feed it chunks; it yields complete frames and * retains any partial trailing frame across calls. A frame ends on a blank line. */ export declare class SseFrameParser { private buffer; /** Push a decoded text chunk; return every complete frame it now contains. */ push(chunk: string): SseFrame[]; private findSeparator; } /** * Consume an authed SSE endpoint as an async iterator of frames. The caller * supplies the fetch (with the auth header + abort signal) and handles * reconnect semantics. */ export declare function readSseFrames(response: Response, signal?: AbortSignal): AsyncGenerator; //# sourceMappingURL=sse.d.ts.map