/**
 * SSE reader for the shared `/api/llm/stream` proxy. Concatenates `text_delta`
 * events; surfaces `error` events and non-OK HTTP responses as
 * `LlmStreamError` instances that carry the same structured envelope the
 * model-stream contract uses. `fetch` + auth-header resolver are injected so
 * this module stays host-agnostic.
 */
import { type ShortcutXLModelStreamErrorDetails } from '../../../contracts/model-stream.js';
export interface LlmStreamRequest {
    readonly baseUrl: string;
    readonly body: Record<string, unknown>;
    readonly fetch: typeof globalThis.fetch;
    readonly authHeaders: () => Promise<Record<string, string>>;
    readonly signal?: AbortSignal;
}
/**
 * Error thrown by `readLlmStreamText` carrying the structured stream-error
 * envelope (`provider_error_type`/`retryable`/`retry_after_ms`/`status`) so
 * callers can inspect failure semantics instead of regexing the message.
 */
export declare class LlmStreamError extends Error {
    readonly details: ShortcutXLModelStreamErrorDetails | undefined;
    constructor(message: string, details: ShortcutXLModelStreamErrorDetails | undefined);
}
/** POST `/api/llm/stream`, consume the SSE response, return concatenated `text_delta`. */
export declare function readLlmStreamText(options: LlmStreamRequest): Promise<string>;
//# sourceMappingURL=llm-stream.d.ts.map