/**
 * Cursor Streaming Frame Parser
 * Incrementally parses ConnectRPC frames from arbitrary chunk boundaries
 */
/// <reference types="node" />
/// <reference types="node" />
/** Frame parsing result types */
export type FrameResult = {
    type: 'error';
    message: string;
    status: number;
    errorType: string;
} | {
    type: 'text';
    text: string;
} | {
    type: 'thinking';
    text: string;
} | {
    type: 'toolCall';
    toolCall: {
        id: string;
        type: string;
        function: {
            name: string;
            arguments: string;
        };
        isLast: boolean;
    };
};
export declare class CursorConnectFrameError extends Error {
    readonly status: number;
    readonly errorType: string;
    constructor(message: string, status?: number, errorType?: string);
}
export declare function mapCursorConnectError(code?: string): {
    status: number;
    errorType: string;
};
/**
 * Decompress payload if gzip-compressed.
 * Skips decompression for JSON error payloads.
 * NOTE: Uses synchronous gzip for single-request CLI tool. Async not warranted for small payloads.
 */
export declare function decompressPayload(payload: Buffer, flags: number): Buffer;
/**
 * Incrementally parses ConnectRPC frames from arbitrary chunk boundaries.
 *
 * Usage:
 *   const parser = new StreamingFrameParser();
 *   req.on('data', (chunk) => {
 *     for (const frame of parser.push(chunk)) { handle(frame); }
 *   });
 */
export declare class StreamingFrameParser {
    private buffer;
    /** Feed a new chunk. Returns zero or more parsed frames. */
    push(chunk: Buffer): FrameResult[];
    hasPartial(): boolean;
    finish(): FrameResult[];
}
//# sourceMappingURL=cursor-stream-parser.d.ts.map