import { Buffer } from 'buffer'; /** Wire channel identifiers for the binary channel-prefix protocol. */ export declare enum ShellChannel { STDIN = 0, STDOUT = 1, STDERR = 2, STATUS = 3, RESIZE = 4, HEARTBEAT = 5, CLOSE = 255, /** Sentinel for unrecognised channel bytes — not a wire value. */ UNKNOWN = -1 } /** A single decoded WebSocket frame from the shell stream. */ export interface ShellFrame { /** The channel this frame belongs to. UNKNOWN for unrecognised channel bytes. */ channel: ShellChannel; /** The original channel byte from the wire. */ rawChannelByte: number; /** Raw bytes of the frame payload (everything after the channel byte). */ payload: Buffer; /** Decode payload as UTF-8 text (replacement char on invalid bytes). */ readonly text: string; /** Parse payload as JSON. Throws SyntaxError if payload is not valid JSON. */ json(): Record; } /** Maximum frame size — matches DP WebSocketFlowController limit. */ export declare const MAX_FRAME_SIZE: number; /** * Encodes and decodes binary channel-prefix WebSocket frames. * Stateless — a single instance is safe to reuse across frames. */ export declare class ShellFramer { /** Decode one raw WebSocket binary message into a ShellFrame. */ decode(frame: Buffer): ShellFrame; /** Encode keyboard input or paste data as a STDIN frame. */ encodeStdin(data: string | Buffer): Buffer; /** Encode a terminal resize event as a RESIZE frame. */ encodeResize(width: number, height: number): Buffer; /** Encode an app-level heartbeat frame (channel 0x05, empty payload). */ encodeHeartbeat(): Buffer; /** Encode a graceful-shutdown CLOSE frame (empty payload). */ encodeClose(): Buffer; } //# sourceMappingURL=protocol.d.ts.map