export type TerminalWorkspace = { id: string; kind: "original"; root: string; description?: string; } | { id: string; kind: "ssh"; root: string; description?: string; host: string; port: number; user: string; keyPath: string; }; export type TerminalWorkspaceResolver = (memberId: string, workspaceId?: string) => TerminalWorkspace | undefined; export declare function configureTerminalWorkspaces(resolve: TerminalWorkspaceResolver | undefined): void; export declare function memberTerminalWorkspace(memberId: string, workspaceId?: string): TerminalWorkspace | undefined; export declare function awaitResourceClose(closed: Promise, label: string): Promise; export declare const SHELL_COLS = 160; export declare const SHELL_ROWS = 1000; export declare const BLOCK_UNTIL_MS_DEFAULT = 10000; /** Interrupt support: end every blocking terminal_exec wait for this member now. * Each race resolves as running — the command itself keeps going in the PTY. */ export declare function settleMemberShellWaits(memberId: string): void; export type ShellCreateResult = { ok: true; terminalId: string; workspace: string; cwd: string; } | { ok: false; error: string; }; export declare function createShell(args: { memberId: string; name?: string; workspace?: string; cwd?: string; }): Promise; export type ShellExecResult = { ok: true; exec: string; status: "done"; exitCode: number | null; lineStart: number; lineEnd: number; output: string; } | { ok: true; exec: string; status: "running"; lineStart: number; outputSoFar: string; note: string; } | { ok: false; error: string; }; export declare function execInShell(args: { signal?: AbortSignal; memberId: string; shell: string; command?: string; keys?: string; blockUntilMs?: number; }): Promise; export type ShellReadResult = { ok: true; status: "running" | "done"; exitCode: number | null; lineStart: number; lineEnd: number; lines: Array<{ n: number; text: string; }>; truncated: boolean; } | { ok: false; error: string; }; export declare function readShell(args: { memberId: string; shell: string; exec?: string; fromLine?: number; toLine?: number; }): ShellReadResult; /** Design-interrupt-on-message-v1.1: terminal_wait — block until an exec is done * (or the wait budget runs out). Default 30s; blockUntilMs 0 waits forever. * Done returns exit code + line range + output; a timeout returns running with * the progress so far. terminal_read stays an instant snapshot. */ export declare function waitShell(args: { signal?: AbortSignal; memberId: string; shell: string; exec: string; blockUntilMs?: number; }): Promise<{ ok: true; exec: string; status: "done"; exitCode: number | null; lineStart: number; lineEnd: number; output: string; } | { ok: true; exec: string; status: "running"; outputSoFar: string; note: string; } | { ok: false; error: string; }>; export declare function listShells(memberId: string): Array<{ id: string; name?: string; workspace: string; running: string | null; alive: boolean; lines: number; }>; export declare function closeShell(memberId: string, shellId: string): Promise<{ ok: true; } | { ok: false; error: string; }>; /** P1 file-tools sftp pool teardown shares this on member destruction. */ export declare function closeAllShellsForMember(memberId?: string): Promise; //# sourceMappingURL=terminal.d.ts.map