/**
 * OwlCoda Native SSE Stream Consumer
 *
 * Consumes Server-Sent Events from the Anthropic streaming API
 * and accumulates them into a complete AssistantResponse.
 */
import type { AssistantResponse, StreamAccumulator, StreamEvent } from './types.js';
/** Create a fresh stream accumulator. */
export declare function createAccumulator(): StreamAccumulator;
/**
 * Parse raw SSE text into individual events.
 * Handles the `event: X\ndata: Y\n\n` format.
 */
export declare function parseSSE(chunk: string): StreamEvent[];
/**
 * Process a single SSE event and update the accumulator.
 * Returns a text delta if one was emitted (for real-time display).
 */
export declare function processEvent(acc: StreamAccumulator, sseEvent: StreamEvent): {
    textDelta?: string;
    toolName?: string;
    thinkingStart?: boolean;
    thinkingDelta?: string;
    thinkingEnd?: boolean;
};
/** Finalize the accumulator into a complete AssistantResponse. */
export declare function finalizeStream(acc: StreamAccumulator): AssistantResponse;
/**
 * Consume a full SSE stream from a ReadableStream.
 * Calls onTextDelta for real-time text display.
 */
export declare function consumeStream(stream: ReadableStream<Uint8Array>, onTextDelta?: (text: string) => void, onUsage?: (tokens: {
    input: number;
    output: number;
}) => void, onThinking?: (event: 'start' | 'delta' | 'end', text?: string) => void, signal?: AbortSignal): Promise<AssistantResponse>;
