/** * S2S Protocol Message Framing * * Message format: * - 3 bytes: Length prefix (total message length including flag byte, big-endian) * - 1 byte: Flag byte [T][CC][RRRRR] * - T (bit 7): Terminal flag (1 = stream ends after this message) * - CC (bits 6-5): Compression (00=none, 01=zstd, 10=gzip) * - RRRRR (bits 4-0): Reserved * - Variable: Body (protobuf message or JSON error for terminal frames) */ export type CompressionType = "none" | "zstd" | "gzip"; export declare const MAX_FRAME_BYTES: number; export declare const MAX_FRAME_PAYLOAD_BYTES: number; export declare const MAX_DECOMPRESSED_PAYLOAD_BYTES: number; export interface S2SFrame { terminal: boolean; compression: CompressionType; body: Uint8Array; statusCode?: number; } /** * Frame a message for s2s protocol */ export declare function frameMessage(opts: { terminal: boolean; compression?: CompressionType; body: Uint8Array; statusCode?: number; }): Uint8Array; /** * Parser for reading s2s frames from a stream */ export declare class S2SFrameParser { private buffer; /** * Add data to the parser buffer */ push(data: Uint8Array): void; /** * Try to parse the next frame from the buffer * Returns null if not enough data available */ parseFrame(): S2SFrame | null; /** * Check if parser has any buffered data */ hasData(): boolean; } //# sourceMappingURL=framing.d.ts.map