/**
 * Server-Sent Events (SSE) Stream Consumer
 * Handles streaming connections to the agent endpoint
 */
import { AGUIEvent } from '../../types/agui.js';
export interface SSEClientOptions {
    url: string;
    method?: 'GET' | 'POST';
    headers?: Record<string, string>;
    body?: any;
    timeoutMs?: number;
    onEvent: (event: AGUIEvent) => void;
    onError?: (error: Error) => void;
    onComplete?: () => void;
    /** Complete stream when RUN_FINISHED or RUN_ERROR event is received */
    completeOnRunEnd?: boolean;
    /** Timeout (ms) after last event to assume stream is complete (default: 120000) */
    idleTimeoutMs?: number;
}
export declare class SSEClient {
    private abortController;
    /**
     * Start consuming SSE stream from the agent endpoint
     */
    consume(options: SSEClientOptions): Promise<void>;
    /**
     * Process the ReadableStream and parse SSE events
     * @returns Reason for stream completion
     */
    private processStream;
    /**
     * Abort the current stream connection
     */
    abort(): void;
}
/**
 * Convenience function for simple SSE consumption
 * Completes when RUN_FINISHED/RUN_ERROR event is received, or when connection closes
 */
export declare function consumeSSEStream(url: string, payload: any, onEvent: (event: AGUIEvent) => void, headers?: Record<string, string>, options?: {
    idleTimeoutMs?: number;
}): Promise<void>;
//# sourceMappingURL=sseStream.d.ts.map