/** * Connect-protocol streaming envelope shared by the Cursor and Devin * transports: 1 flag byte + 4-byte big-endian payload length + payload. */ /** Flag bit: payload is compressed with the negotiated encoding (gzip). */ export declare const CONNECT_COMPRESSED_FLAG = 1; /** Flag bit: payload is the end-of-stream JSON trailer. */ export declare const CONNECT_END_STREAM_FLAG = 2; /** Wrap one Connect-protocol message: 1 flag byte + 4-byte big-endian length + payload. */ export declare function frameConnectMessage(data: Uint8Array, flags?: number): Buffer; /** One decoded Connect envelope. */ export interface ConnectFrame { flags: number; payload: Buffer; } /** Options for {@link ConnectFrameDecoder}. */ export interface ConnectFrameDecoderOptions { /** * Payload cap: a length prefix above `maxPayloadBytes` throws `error(length)` * before any of that payload is buffered. Uncapped when omitted. */ limit?: { maxPayloadBytes: number; error: (length: number) => Error; }; } /** * Incremental Connect frame decoder. Incoming chunks are kept as-is and a frame * spanning several chunks is joined once, when the length the header announced * has fully arrived — re-concatenating the pending bytes on every chunk made a * multi-MB frame cost O(size × chunks). * * Payloads alias the chunk they came from whenever a frame fits in one chunk, * so callers must not reuse chunk buffers they hand in. */ export declare class ConnectFrameDecoder { #private; constructor(options?: ConnectFrameDecoderOptions); /** * Buffer `chunk` (if any) and yield every frame now complete, in wire order. * An oversize length prefix throws after the frames that precede it. */ decode(chunk?: Uint8Array): Generator; }