import type { TerminalConnector, TerminalUiState } from "@volter-ai-dev/supercode-terminal/ui"; /** A WebSocket, or a page's own socket onto an exec's stream with that shape. */ export interface DockerExecSocket extends EventTarget { readonly readyState: number; binaryType: "blob" | "arraybuffer"; send(data: string | ArrayBufferLike | ArrayBufferView | Blob): void; close(code?: number, reason?: string): void; } export interface DockerExecTerminalOptions { /** The daemon's base, versioned or not: `http://agent/v1.51`, a binding's base, this page's origin. */ base: string; containerId: string; /** Opens `/exec/{id}/start`; a WebSocket to the same address by default. */ socket?: (url: string) => DockerExecSocket; /** Sent with every request: a bearer token for an agent, nothing in a tab. */ headers?: Record; shell?: readonly string[]; cwd?: string; env?: Record; /** Bytes of each shell's newest output a view replays when it attaches. */ bufferBytes?: number; } /** One shell's own start, over the controller's defaults. */ export interface DockerExecShellOptions { cwd?: string; env?: Record; label?: string; } export interface DockerExecTerminal { getState(): TerminalUiState; subscribe(listener: () => void): () => void; readonly connector: TerminalConnector; /** Opens a shell and attaches to it; resolves to its id, rejects with the daemon's words. */ create(shell?: DockerExecShellOptions): Promise; attach(sessionId: string): void; /** Ends a shell, or dismisses one that exited. */ stop(sessionId: string): Promise; /** Ends every shell. */ dispose(): void; } export declare function dockerExecTerminal(options: DockerExecTerminalOptions): DockerExecTerminal;