Fix terminal worker state mirroring

This commit is contained in:
Mohamed Boudra
2026-05-01 16:19:25 +07:00
parent af38c6e135
commit 51f7ef3171
6 changed files with 289 additions and 58 deletions
@@ -1,5 +1,6 @@
import type { TerminalExitInfo, ServerMessage, ClientMessage } from "./terminal.js";
import type { TerminalState } from "../shared/messages.js";
import type { CaptureTerminalLinesResult } from "./terminal.js";
export interface WorkerTerminalInfo {
id: string;
@@ -51,6 +52,14 @@ export type TerminalWorkerRequest =
terminalId: string;
options?: WorkerKillAndWaitOptions;
}
| {
type: "captureTerminal";
requestId: string;
terminalId: string;
start?: number;
end?: number;
stripAnsi?: boolean;
}
| {
type: "listDirectories";
requestId: string;
@@ -96,6 +105,11 @@ export type TerminalWorkerEvent =
terminalId: string;
message: ServerMessage;
}
| {
type: "terminalStateUpdated";
terminalId: string;
state: TerminalState;
}
| {
type: "terminalExit";
terminalId: string;
@@ -120,3 +134,5 @@ export type TerminalWorkerEvent =
};
export type TerminalWorkerToParentMessage = TerminalWorkerResponse | TerminalWorkerEvent;
export type TerminalWorkerCaptureResult = CaptureTerminalLinesResult;