import type { EngineTerminalControl } from "./protocol.ts"; /** * Host-side terminal-mode arbiter for remote custom components. * * Remote components (running in the engine child) cannot touch the host TTY — * their stdout is the JSONL transport, not a terminal. Instead they send a * typed autowrap intent; this controller owns the concrete escape sequences * and applies them to the real host terminal associated with the mounted * component. Never a raw byte channel: only the allowlisted mode below can * reach the terminal. * * Guarantees: * - Controls that arrive before the component mounts are buffered and flushed * on mount. * - In fullscreen, `TuiAltScreen` owns autowrap itself. Remote intents remain * tracked but never write over that baseline; switching back to regular mode * reapplies the active intent. * - A component's autowrap state is restored when it unmounts, or when the * whole controller resets (engine crash / restart / generation replacement / * host shutdown). * - State is component-scoped: a stale child cannot reset or alter a mode * owned by the currently mounted component. */ export declare const HOST_TERMINAL_AUTOWRAP_ON = "\u001B[?7h"; export declare const HOST_TERMINAL_AUTOWRAP_OFF = "\u001B[?7l"; export interface HostTerminalWriter { write(data: string): void; } export declare class TerminalModeController { private readonly isFullscreen; private readonly components; constructor(isFullscreen: () => boolean); /** Apply (or buffer) a typed control for a component. */ applyControl(componentId: string, control: EngineTerminalControl): void; /** Register the host terminal for a component and flush buffered controls. */ onMount(componentId: string, terminal: HostTerminalWriter): void; /** Reset and forget a single component's terminal modes. */ onUnmount(componentId: string): void; /** Reset every component (engine crash/restart/generation swap/shutdown). */ resetAll(): void; /** Reapply active controls after the host renderer changes mode. */ rebindTui(): void; private ensure; private write; private writeAutowrap; private hasAutowrapDisabledControl; private firstTerminal; private reset; } //# sourceMappingURL=terminal-mode-controller.d.ts.map