/** One terminal-session frame carried in a §13.6 rail data payload. `end.reason` is an * APPLICATION-defined bounded token (the reference manager uses `process-exit` / `closed` / * `expired` / `target-despawn` / `manager-restart`); the vocabulary is not fixed by the wire, so * a different endpoint can surface its own terminal causes without a core change. */ export type TerminalFrame = { k: "ready"; } | { k: "data"; b: string; } | { k: "resize"; cols: number; rows: number; } | { k: "end"; reason: string; } | { k: "drop"; bytes: number; }; /** Encode raw terminal bytes as a `data` frame (the ruled base64-in-JSON form). Accepts any * Uint8Array (a node Buffer is one). FAIL-LOUD on a non-Uint8Array: a STRING (e.g. xterm's onData * keystroke, which is a string, not bytes) would `base64Encode` its chars as NaN→0 and silently * ship NUL bytes the pty ignores — the browser must UTF-8-encode first. Throwing turns that trap * into an immediate error instead of a byte stream that vanishes into the terminal (§13.6). */ export declare function encodeTerminalData(bytes: Uint8Array): TerminalFrame; /** The bytes carried by a decoded `data` frame, as a Uint8Array (a node Buffer is one; the manager * bridge decodes utf8 via TextDecoder, the browser writes the bytes straight to xterm). */ export declare function terminalFrameBytes(frame: Extract): Uint8Array; /** Fail-loud closed-schema parse of a terminal-session frame from a rail's opaque `data`. An * unknown kind, an extra field, or a malformed value THROWS — the rail turns that into a protocol * error, so a corrupt frame can never reach the terminal as a partial write. */ export declare function decodeTerminalFrame(data: unknown): TerminalFrame; //# sourceMappingURL=session-terminal-frames.d.ts.map