Add per-task terminals over WebSocket with an xterm.js Terminal tab

This commit is contained in:
Ian Gulliver
2026-10-15 12:06:50 -07:00
parent 37bf1b60a7
commit ff22f33025
33 changed files with 1600 additions and 167 deletions
+50 -1
View File
@@ -456,6 +456,25 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/terminal": {
parameters: {
query?: never;
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
/** @description A WebSocket attached to the task's terminal, a login shell in its worktree, started at cols by rows if none is running. The server first sends what the terminal has recently printed, then its output as it comes, all as binary messages. The client sends input as binary messages and resizes as text messages holding a TerminalSize. When the shell exits the server closes with code 4000 and the exit status as the reason. */
get: operations["getTaskTerminal"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/snapshots": {
parameters: {
query?: never;
@@ -1052,7 +1071,11 @@ export interface components {
focused: boolean;
};
/** @enum {string} */
TaskTab: "transcript" | "changes" | "files" | "inbox" | "project";
TaskTab: "transcript" | "changes" | "files" | "terminal" | "inbox" | "project";
TerminalSize: {
cols: number;
rows: number;
};
Status: {
/** @description Agent processes currently running. */
live_agents: number;
@@ -1897,6 +1920,32 @@ export interface operations {
409: components["responses"]["Error"];
};
};
getTaskTerminal: {
parameters: {
query: {
cols: number;
rows: number;
};
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Switched to the WebSocket protocol. */
101: {
headers: {
[name: string]: unknown;
};
content?: never;
};
400: components["responses"]["Error"];
404: components["responses"]["Error"];
409: components["responses"]["Error"];
};
};
listSnapshots: {
parameters: {
query?: never;