import type { TerminalExitInfo, ServerMessage, ClientMessage, TerminalStateSnapshot, TerminalStateSnapshotOptions } from "./terminal.js"; import type { TerminalState } from "@getpaseo/protocol/messages"; import type { TerminalActivity, TerminalActivityState } from "@getpaseo/protocol/terminal-activity"; import type { CaptureTerminalLinesResult } from "./terminal-capture.js"; export interface WorkerTerminalInfo { id: string; name: string; cwd: string; workspaceId?: string; title?: string; activity: TerminalActivity | null; } export interface WorkerCreateTerminalOptions { id?: string; cwd: string; workspaceId?: string; name?: string; title?: string; env?: Record; command?: string; args?: string[]; rows?: number; cols?: number; activityToken?: string; activityUrl?: string | null; } export interface WorkerKillAndWaitOptions { gracefulTimeoutMs?: number; forceTimeoutMs?: number; } export type TerminalWorkerRequest = { type: "createTerminal"; requestId: string; options: WorkerCreateTerminalOptions; } | { type: "registerCwdEnv"; requestId: string; cwd: string; env: Record; } | { type: "setActivity"; requestId: string; terminalId: string; state: TerminalActivityState; } | { type: "clearAttention"; requestId: string; terminalId: string; } | { type: "killTerminal"; requestId: string; terminalId: string; } | { type: "killTerminalAndWait"; requestId: string; terminalId: string; options?: WorkerKillAndWaitOptions; } | { type: "getTerminalState"; requestId: string; terminalId: string; options?: TerminalStateSnapshotOptions; } | { type: "captureTerminal"; requestId: string; terminalId: string; start?: number; end?: number; stripAnsi?: boolean; } | { type: "killAll"; requestId: string; } | { type: "send"; requestId: string; terminalId: string; message: ClientMessage; }; export type TerminalWorkerResponse = { type: "response"; requestId: string; ok: true; result?: unknown; } | { type: "response"; requestId: string; ok: false; error: string; }; export type TerminalWorkerEvent = { type: "terminalCreated"; terminal: WorkerTerminalInfo; state: TerminalState; } | { type: "terminalMessage"; terminalId: string; message: ServerMessage; } | { type: "terminalExit"; terminalId: string; info: TerminalExitInfo; } | { type: "terminalTitleChange"; terminalId: string; title?: string; } | { type: "terminalCommandFinished"; terminalId: string; info: { exitCode: number | null; }; } | { type: "terminalActivityChange"; terminalId: string; activity: TerminalActivity | null; previous: TerminalActivity | null; }; export type TerminalWorkerToParentMessage = TerminalWorkerResponse | TerminalWorkerEvent; export type TerminalWorkerCaptureResult = CaptureTerminalLinesResult; export type TerminalWorkerStateResult = TerminalStateSnapshot | null; //# sourceMappingURL=terminal-worker-protocol.d.ts.map