import * as pty from "node-pty"; import { PtySnapshotStore } from "./pty-snapshot.js"; import type { PtyControlEvent, PtySnapshotSubscription } from "./pty-view-engine.js"; import type { PtyHandle } from "./pty-lifecycle.js"; /** Cap for small per-session bookkeeping maps that must survive PTY respawns. */ export declare const SESSION_MAP_CAP = 512; /** Bound live headless terminal instances in the long-running gateway. */ export declare const STREAM_MAP_CAP = 128; export declare function setCapped(map: Map, key: string, value: V, cap?: number): void; interface PtyStreamManagerOptions { snapshotStore?: PtySnapshotStore; } /** * Per-session terminal state shared by interactive engines. A real headless * xterm replaces the old raw byte tail, and subscribers pause at an exact * sequence boundary until their authoritative snapshot has been framed. */ export declare class PtyStreamManager { private readonly label; private readonly hasWarmPty; private readonly streams; private readonly snapshotStore; constructor(label: string, hasWarmPty: (sessionId: string) => boolean, options?: PtyStreamManagerOptions); attach(sessionId: string, proc: pty.IPty, onData?: () => void): void; /** The session's visible terminal rows as plain text, or undefined when no * snapshot is attached. Used to read a pending TUI dialog off the screen — * the raw byte tail cannot serve for that, because the CLI positions text * with cursor moves rather than writing the spaces between columns. */ viewport(sessionId: string): Promise | undefined; resize(sessionId: string, cols: number, rows: number): void; subscribeWithSnapshot(sessionId: string, data: (chunk: Buffer) => void, control?: (event: PtyControlEvent) => void): PtySnapshotSubscription; onPtyExit(sessionId: string, event: { exitCode: number; signal?: number; }): void; reportError(sessionId: string, message: string): void; flushSnapshot(sessionId: string): Promise; private checkReadiness; private scheduleCapture; private queuePendingGeneration; private emitData; private emitControl; private deliver; private streamFor; } export declare function createPtyHandle(proc: pty.IPty): PtyHandle; export {}; //# sourceMappingURL=pty-stream.d.ts.map