linkshell-cli 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/src/runtime/bridge-session.d.ts +2 -4
- package/dist/cli/src/runtime/bridge-session.js +104 -38
- package/dist/cli/src/runtime/bridge-session.js.map +1 -1
- package/dist/cli/tsconfig.tsbuildinfo +1 -1
- package/dist/shared-protocol/src/index.d.ts +149 -6
- package/dist/shared-protocol/src/index.js +25 -0
- package/dist/shared-protocol/src/index.js.map +1 -1
- package/package.json +1 -1
- package/src/runtime/bridge-session.ts +119 -42
|
@@ -10,6 +10,7 @@ export declare const envelopeSchema: z.ZodObject<{
|
|
|
10
10
|
id: z.ZodString;
|
|
11
11
|
type: z.ZodString;
|
|
12
12
|
sessionId: z.ZodString;
|
|
13
|
+
terminalId: z.ZodOptional<z.ZodString>;
|
|
13
14
|
deviceId: z.ZodOptional<z.ZodString>;
|
|
14
15
|
timestamp: z.ZodString;
|
|
15
16
|
traceId: z.ZodOptional<z.ZodString>;
|
|
@@ -17,20 +18,22 @@ export declare const envelopeSchema: z.ZodObject<{
|
|
|
17
18
|
ack: z.ZodOptional<z.ZodNumber>;
|
|
18
19
|
payload: z.ZodUnknown;
|
|
19
20
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
id: string;
|
|
21
21
|
type: string;
|
|
22
|
+
id: string;
|
|
22
23
|
sessionId: string;
|
|
23
24
|
timestamp: string;
|
|
25
|
+
terminalId?: string | undefined;
|
|
24
26
|
deviceId?: string | undefined;
|
|
25
27
|
traceId?: string | undefined;
|
|
26
28
|
seq?: number | undefined;
|
|
27
29
|
ack?: number | undefined;
|
|
28
30
|
payload?: unknown;
|
|
29
31
|
}, {
|
|
30
|
-
id: string;
|
|
31
32
|
type: string;
|
|
33
|
+
id: string;
|
|
32
34
|
sessionId: string;
|
|
33
35
|
timestamp: string;
|
|
36
|
+
terminalId?: string | undefined;
|
|
34
37
|
deviceId?: string | undefined;
|
|
35
38
|
traceId?: string | undefined;
|
|
36
39
|
seq?: number | undefined;
|
|
@@ -86,7 +89,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
|
|
|
86
89
|
}, "strip", z.ZodTypeAny, {
|
|
87
90
|
role: "host" | "client";
|
|
88
91
|
clientName: string;
|
|
89
|
-
provider?: "
|
|
92
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
90
93
|
protocolVersion?: number | undefined;
|
|
91
94
|
hostname?: string | undefined;
|
|
92
95
|
platform?: string | undefined;
|
|
@@ -95,7 +98,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
|
|
|
95
98
|
}, {
|
|
96
99
|
role: "host" | "client";
|
|
97
100
|
clientName: string;
|
|
98
|
-
provider?: "
|
|
101
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
99
102
|
protocolVersion?: number | undefined;
|
|
100
103
|
hostname?: string | undefined;
|
|
101
104
|
platform?: string | undefined;
|
|
@@ -275,6 +278,85 @@ export declare const screenIcePayloadSchema: z.ZodObject<{
|
|
|
275
278
|
sdpMid?: string | null | undefined;
|
|
276
279
|
sdpMLineIndex?: number | null | undefined;
|
|
277
280
|
}>;
|
|
281
|
+
export declare const terminalSpawnPayloadSchema: z.ZodObject<{
|
|
282
|
+
cwd: z.ZodString;
|
|
283
|
+
provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
cwd: string;
|
|
286
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
287
|
+
}, {
|
|
288
|
+
cwd: string;
|
|
289
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
290
|
+
}>;
|
|
291
|
+
export declare const terminalInfoSchema: z.ZodObject<{
|
|
292
|
+
terminalId: z.ZodString;
|
|
293
|
+
cwd: z.ZodString;
|
|
294
|
+
projectName: z.ZodString;
|
|
295
|
+
provider: z.ZodString;
|
|
296
|
+
status: z.ZodEnum<["running", "exited"]>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
status: "running" | "exited";
|
|
299
|
+
terminalId: string;
|
|
300
|
+
provider: string;
|
|
301
|
+
cwd: string;
|
|
302
|
+
projectName: string;
|
|
303
|
+
}, {
|
|
304
|
+
status: "running" | "exited";
|
|
305
|
+
terminalId: string;
|
|
306
|
+
provider: string;
|
|
307
|
+
cwd: string;
|
|
308
|
+
projectName: string;
|
|
309
|
+
}>;
|
|
310
|
+
export declare const terminalListPayloadSchema: z.ZodObject<{
|
|
311
|
+
terminals: z.ZodArray<z.ZodObject<{
|
|
312
|
+
terminalId: z.ZodString;
|
|
313
|
+
cwd: z.ZodString;
|
|
314
|
+
projectName: z.ZodString;
|
|
315
|
+
provider: z.ZodString;
|
|
316
|
+
status: z.ZodEnum<["running", "exited"]>;
|
|
317
|
+
}, "strip", z.ZodTypeAny, {
|
|
318
|
+
status: "running" | "exited";
|
|
319
|
+
terminalId: string;
|
|
320
|
+
provider: string;
|
|
321
|
+
cwd: string;
|
|
322
|
+
projectName: string;
|
|
323
|
+
}, {
|
|
324
|
+
status: "running" | "exited";
|
|
325
|
+
terminalId: string;
|
|
326
|
+
provider: string;
|
|
327
|
+
cwd: string;
|
|
328
|
+
projectName: string;
|
|
329
|
+
}>, "many">;
|
|
330
|
+
}, "strip", z.ZodTypeAny, {
|
|
331
|
+
terminals: {
|
|
332
|
+
status: "running" | "exited";
|
|
333
|
+
terminalId: string;
|
|
334
|
+
provider: string;
|
|
335
|
+
cwd: string;
|
|
336
|
+
projectName: string;
|
|
337
|
+
}[];
|
|
338
|
+
}, {
|
|
339
|
+
terminals: {
|
|
340
|
+
status: "running" | "exited";
|
|
341
|
+
terminalId: string;
|
|
342
|
+
provider: string;
|
|
343
|
+
cwd: string;
|
|
344
|
+
projectName: string;
|
|
345
|
+
}[];
|
|
346
|
+
}>;
|
|
347
|
+
export declare const terminalSpawnedPayloadSchema: z.ZodObject<{
|
|
348
|
+
terminalId: z.ZodString;
|
|
349
|
+
cwd: z.ZodString;
|
|
350
|
+
projectName: z.ZodString;
|
|
351
|
+
}, "strip", z.ZodTypeAny, {
|
|
352
|
+
terminalId: string;
|
|
353
|
+
cwd: string;
|
|
354
|
+
projectName: string;
|
|
355
|
+
}, {
|
|
356
|
+
terminalId: string;
|
|
357
|
+
cwd: string;
|
|
358
|
+
projectName: string;
|
|
359
|
+
}>;
|
|
278
360
|
export declare const fileUploadPayloadSchema: z.ZodObject<{
|
|
279
361
|
data: z.ZodString;
|
|
280
362
|
filename: z.ZodString;
|
|
@@ -308,7 +390,7 @@ export declare const protocolMessageSchemas: {
|
|
|
308
390
|
}, "strip", z.ZodTypeAny, {
|
|
309
391
|
role: "host" | "client";
|
|
310
392
|
clientName: string;
|
|
311
|
-
provider?: "
|
|
393
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
312
394
|
protocolVersion?: number | undefined;
|
|
313
395
|
hostname?: string | undefined;
|
|
314
396
|
platform?: string | undefined;
|
|
@@ -317,7 +399,7 @@ export declare const protocolMessageSchemas: {
|
|
|
317
399
|
}, {
|
|
318
400
|
role: "host" | "client";
|
|
319
401
|
clientName: string;
|
|
320
|
-
provider?: "
|
|
402
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
321
403
|
protocolVersion?: number | undefined;
|
|
322
404
|
hostname?: string | undefined;
|
|
323
405
|
platform?: string | undefined;
|
|
@@ -553,6 +635,66 @@ export declare const protocolMessageSchemas: {
|
|
|
553
635
|
data: string;
|
|
554
636
|
filename: string;
|
|
555
637
|
}>;
|
|
638
|
+
readonly "terminal.spawn": z.ZodObject<{
|
|
639
|
+
cwd: z.ZodString;
|
|
640
|
+
provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
|
|
641
|
+
}, "strip", z.ZodTypeAny, {
|
|
642
|
+
cwd: string;
|
|
643
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
644
|
+
}, {
|
|
645
|
+
cwd: string;
|
|
646
|
+
provider?: "claude" | "codex" | "custom" | undefined;
|
|
647
|
+
}>;
|
|
648
|
+
readonly "terminal.spawned": z.ZodObject<{
|
|
649
|
+
terminalId: z.ZodString;
|
|
650
|
+
cwd: z.ZodString;
|
|
651
|
+
projectName: z.ZodString;
|
|
652
|
+
}, "strip", z.ZodTypeAny, {
|
|
653
|
+
terminalId: string;
|
|
654
|
+
cwd: string;
|
|
655
|
+
projectName: string;
|
|
656
|
+
}, {
|
|
657
|
+
terminalId: string;
|
|
658
|
+
cwd: string;
|
|
659
|
+
projectName: string;
|
|
660
|
+
}>;
|
|
661
|
+
readonly "terminal.list": z.ZodObject<{
|
|
662
|
+
terminals: z.ZodArray<z.ZodObject<{
|
|
663
|
+
terminalId: z.ZodString;
|
|
664
|
+
cwd: z.ZodString;
|
|
665
|
+
projectName: z.ZodString;
|
|
666
|
+
provider: z.ZodString;
|
|
667
|
+
status: z.ZodEnum<["running", "exited"]>;
|
|
668
|
+
}, "strip", z.ZodTypeAny, {
|
|
669
|
+
status: "running" | "exited";
|
|
670
|
+
terminalId: string;
|
|
671
|
+
provider: string;
|
|
672
|
+
cwd: string;
|
|
673
|
+
projectName: string;
|
|
674
|
+
}, {
|
|
675
|
+
status: "running" | "exited";
|
|
676
|
+
terminalId: string;
|
|
677
|
+
provider: string;
|
|
678
|
+
cwd: string;
|
|
679
|
+
projectName: string;
|
|
680
|
+
}>, "many">;
|
|
681
|
+
}, "strip", z.ZodTypeAny, {
|
|
682
|
+
terminals: {
|
|
683
|
+
status: "running" | "exited";
|
|
684
|
+
terminalId: string;
|
|
685
|
+
provider: string;
|
|
686
|
+
cwd: string;
|
|
687
|
+
projectName: string;
|
|
688
|
+
}[];
|
|
689
|
+
}, {
|
|
690
|
+
terminals: {
|
|
691
|
+
status: "running" | "exited";
|
|
692
|
+
terminalId: string;
|
|
693
|
+
provider: string;
|
|
694
|
+
cwd: string;
|
|
695
|
+
projectName: string;
|
|
696
|
+
}[];
|
|
697
|
+
}>;
|
|
556
698
|
};
|
|
557
699
|
export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
|
|
558
700
|
export declare function createEnvelope<T>(input: {
|
|
@@ -563,6 +705,7 @@ export declare function createEnvelope<T>(input: {
|
|
|
563
705
|
seq?: number;
|
|
564
706
|
ack?: number;
|
|
565
707
|
deviceId?: string;
|
|
708
|
+
terminalId?: string;
|
|
566
709
|
traceId?: string;
|
|
567
710
|
}): Envelope;
|
|
568
711
|
export declare function parseEnvelope(raw: string): Envelope;
|
|
@@ -26,6 +26,7 @@ export const envelopeSchema = z.object({
|
|
|
26
26
|
id: z.string().min(1),
|
|
27
27
|
type: z.string().min(1),
|
|
28
28
|
sessionId: z.string().min(1),
|
|
29
|
+
terminalId: z.string().min(1).optional(),
|
|
29
30
|
deviceId: z.string().min(1).optional(),
|
|
30
31
|
timestamp: z.string().datetime(),
|
|
31
32
|
traceId: z.string().min(1).optional(),
|
|
@@ -130,6 +131,26 @@ export const screenIcePayloadSchema = z.object({
|
|
|
130
131
|
sdpMid: z.string().nullable().optional(),
|
|
131
132
|
sdpMLineIndex: z.number().nullable().optional(),
|
|
132
133
|
});
|
|
134
|
+
// ── Terminal spawn/list payloads ───────────────────────────────────
|
|
135
|
+
export const terminalSpawnPayloadSchema = z.object({
|
|
136
|
+
cwd: z.string().min(1),
|
|
137
|
+
provider: z.enum(["claude", "codex", "custom"]).optional(),
|
|
138
|
+
});
|
|
139
|
+
export const terminalInfoSchema = z.object({
|
|
140
|
+
terminalId: z.string().min(1),
|
|
141
|
+
cwd: z.string(),
|
|
142
|
+
projectName: z.string(),
|
|
143
|
+
provider: z.string(),
|
|
144
|
+
status: z.enum(["running", "exited"]),
|
|
145
|
+
});
|
|
146
|
+
export const terminalListPayloadSchema = z.object({
|
|
147
|
+
terminals: z.array(terminalInfoSchema),
|
|
148
|
+
});
|
|
149
|
+
export const terminalSpawnedPayloadSchema = z.object({
|
|
150
|
+
terminalId: z.string().min(1),
|
|
151
|
+
cwd: z.string(),
|
|
152
|
+
projectName: z.string(),
|
|
153
|
+
});
|
|
133
154
|
// ── File upload payloads ────────────────────────────────────────────
|
|
134
155
|
export const fileUploadPayloadSchema = z.object({
|
|
135
156
|
data: z.string(), // base64 encoded
|
|
@@ -167,6 +188,9 @@ export const protocolMessageSchemas = {
|
|
|
167
188
|
"screen.answer": screenAnswerPayloadSchema,
|
|
168
189
|
"screen.ice": screenIcePayloadSchema,
|
|
169
190
|
"file.upload": fileUploadPayloadSchema,
|
|
191
|
+
"terminal.spawn": terminalSpawnPayloadSchema,
|
|
192
|
+
"terminal.spawned": terminalSpawnedPayloadSchema,
|
|
193
|
+
"terminal.list": terminalListPayloadSchema,
|
|
170
194
|
};
|
|
171
195
|
// ── UUID helper (works in Node, Web, and Expo) ─────────────────────
|
|
172
196
|
function generateId() {
|
|
@@ -185,6 +209,7 @@ export function createEnvelope(input) {
|
|
|
185
209
|
id: input.id ?? generateId(),
|
|
186
210
|
type: input.type,
|
|
187
211
|
sessionId: input.sessionId,
|
|
212
|
+
terminalId: input.terminalId,
|
|
188
213
|
deviceId: input.deviceId,
|
|
189
214
|
timestamp: new Date().toISOString(),
|
|
190
215
|
traceId: input.traceId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../shared-protocol/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,iBAAiB;IACjB,YAAY;IACZ,QAAQ;IACR,cAAc;IACd,MAAM;IACN,YAAY;CACb,CAAC,CAAC;AAGH,MAA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GAAW;IACvC,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiB;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAAW,EACX,OAAgB;IAEhB,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -36,6 +36,18 @@ const HEARTBEAT_INTERVAL = 15_000;
|
|
|
36
36
|
const RECONNECT_BASE_DELAY = 1_000;
|
|
37
37
|
const RECONNECT_MAX_DELAY = 30_000;
|
|
38
38
|
const RECONNECT_MAX_ATTEMPTS = 20;
|
|
39
|
+
const DEFAULT_TERMINAL_ID = "default";
|
|
40
|
+
|
|
41
|
+
interface TerminalInstance {
|
|
42
|
+
id: string;
|
|
43
|
+
pty: pty.IPty;
|
|
44
|
+
cwd: string;
|
|
45
|
+
projectName: string;
|
|
46
|
+
provider: string;
|
|
47
|
+
scrollback: ScrollbackBuffer;
|
|
48
|
+
outputSeq: number;
|
|
49
|
+
status: "running" | "exited";
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
function getPairingGatewayParam(gatewayHttpUrl: string): string | undefined {
|
|
41
53
|
try {
|
|
@@ -96,10 +108,7 @@ function resolvePairingGateway(
|
|
|
96
108
|
export class BridgeSession {
|
|
97
109
|
private readonly options: BridgeSessionOptions;
|
|
98
110
|
private socket: WebSocket | undefined;
|
|
99
|
-
private
|
|
100
|
-
private outputSeq = 0;
|
|
101
|
-
private lastAckedSeq = -1;
|
|
102
|
-
private scrollback = new ScrollbackBuffer(1000);
|
|
111
|
+
private terminals = new Map<string, TerminalInstance>();
|
|
103
112
|
private heartbeatTimer: ReturnType<typeof setInterval> | undefined;
|
|
104
113
|
private reconnectTimer: ReturnType<typeof setTimeout> | undefined;
|
|
105
114
|
private reconnectAttempts = 0;
|
|
@@ -128,7 +137,7 @@ export class BridgeSession {
|
|
|
128
137
|
if (!this.sessionId) {
|
|
129
138
|
await this.createPairing();
|
|
130
139
|
}
|
|
131
|
-
this.spawnTerminal();
|
|
140
|
+
this.spawnTerminal(DEFAULT_TERMINAL_ID, process.cwd());
|
|
132
141
|
this.connectGateway();
|
|
133
142
|
}
|
|
134
143
|
|
|
@@ -253,26 +262,55 @@ export class BridgeSession {
|
|
|
253
262
|
}
|
|
254
263
|
|
|
255
264
|
private handleMessage(envelope: Envelope): void {
|
|
265
|
+
const tid = envelope.terminalId ?? DEFAULT_TERMINAL_ID;
|
|
256
266
|
switch (envelope.type) {
|
|
257
267
|
case "terminal.input": {
|
|
258
268
|
const p = parseTypedPayload("terminal.input", envelope.payload);
|
|
259
|
-
this.
|
|
269
|
+
const term = this.terminals.get(tid);
|
|
270
|
+
if (term && term.status === "running") term.pty.write(p.data);
|
|
260
271
|
break;
|
|
261
272
|
}
|
|
262
273
|
case "terminal.resize": {
|
|
263
274
|
const p = parseTypedPayload("terminal.resize", envelope.payload);
|
|
264
|
-
this.
|
|
275
|
+
const term = this.terminals.get(tid);
|
|
276
|
+
if (term && term.status === "running") term.pty.resize(p.cols, p.rows);
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
case "terminal.spawn": {
|
|
280
|
+
const p = parseTypedPayload("terminal.spawn", envelope.payload);
|
|
281
|
+
const newId = `term-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
282
|
+
this.spawnTerminal(newId, p.cwd, p.provider);
|
|
283
|
+
// Notify client
|
|
284
|
+
this.send(createEnvelope({
|
|
285
|
+
type: "terminal.spawned",
|
|
286
|
+
sessionId: this.sessionId,
|
|
287
|
+
terminalId: newId,
|
|
288
|
+
payload: { terminalId: newId, cwd: p.cwd, projectName: basename(p.cwd) },
|
|
289
|
+
}));
|
|
290
|
+
// Send updated list
|
|
291
|
+
this.sendTerminalList();
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
case "terminal.list": {
|
|
295
|
+
this.sendTerminalList();
|
|
265
296
|
break;
|
|
266
297
|
}
|
|
267
298
|
case "session.ack": {
|
|
268
299
|
const p = parseTypedPayload("session.ack", envelope.payload);
|
|
269
|
-
|
|
270
|
-
|
|
300
|
+
const term = this.terminals.get(tid);
|
|
301
|
+
if (term) {
|
|
302
|
+
term.scrollback.trimUpTo(p.seq);
|
|
303
|
+
}
|
|
271
304
|
break;
|
|
272
305
|
}
|
|
273
306
|
case "session.resume": {
|
|
274
307
|
const p = parseTypedPayload("session.resume", envelope.payload);
|
|
275
|
-
|
|
308
|
+
// Replay all terminals
|
|
309
|
+
for (const [termId, term] of this.terminals) {
|
|
310
|
+
this.replayFrom(termId, term, p.lastAckedSeq);
|
|
311
|
+
}
|
|
312
|
+
// Also send terminal list so client knows what's available
|
|
313
|
+
this.sendTerminalList();
|
|
276
314
|
break;
|
|
277
315
|
}
|
|
278
316
|
case "session.heartbeat":
|
|
@@ -302,9 +340,10 @@ export class BridgeSession {
|
|
|
302
340
|
const tempPath = join(tmpdir(), `linkshell-image-${Date.now()}.${ext}`);
|
|
303
341
|
writeFileSync(tempPath, Buffer.from(p.data, "base64"));
|
|
304
342
|
this.log(`image saved to ${tempPath}`);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
343
|
+
const term = this.terminals.get(tid);
|
|
344
|
+
if (term && term.status === "running") {
|
|
345
|
+
term.pty.write(`\x1b[200~${tempPath}\x1b[201~`);
|
|
346
|
+
}
|
|
308
347
|
break;
|
|
309
348
|
}
|
|
310
349
|
default:
|
|
@@ -312,8 +351,23 @@ export class BridgeSession {
|
|
|
312
351
|
}
|
|
313
352
|
}
|
|
314
353
|
|
|
315
|
-
private
|
|
316
|
-
const
|
|
354
|
+
private sendTerminalList(): void {
|
|
355
|
+
const terminals = [...this.terminals.values()].map((t) => ({
|
|
356
|
+
terminalId: t.id,
|
|
357
|
+
cwd: t.cwd,
|
|
358
|
+
projectName: t.projectName,
|
|
359
|
+
provider: t.provider,
|
|
360
|
+
status: t.status,
|
|
361
|
+
}));
|
|
362
|
+
this.send(createEnvelope({
|
|
363
|
+
type: "terminal.list",
|
|
364
|
+
sessionId: this.sessionId,
|
|
365
|
+
payload: { terminals },
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
private replayFrom(terminalId: string, term: TerminalInstance, afterSeq: number): void {
|
|
370
|
+
const messages = term.scrollback.replayFrom(afterSeq);
|
|
317
371
|
for (const msg of messages) {
|
|
318
372
|
const payload = msg.payload as {
|
|
319
373
|
stream: string;
|
|
@@ -326,6 +380,7 @@ export class BridgeSession {
|
|
|
326
380
|
createEnvelope({
|
|
327
381
|
type: "terminal.output",
|
|
328
382
|
sessionId: this.sessionId,
|
|
383
|
+
terminalId,
|
|
329
384
|
seq: msg.seq,
|
|
330
385
|
payload: { ...payload, isReplay: true },
|
|
331
386
|
}),
|
|
@@ -333,30 +388,39 @@ export class BridgeSession {
|
|
|
333
388
|
}
|
|
334
389
|
}
|
|
335
390
|
|
|
336
|
-
private spawnTerminal(): void {
|
|
337
|
-
// Filter out undefined env values — node-pty's native posix_spawnp chokes on them
|
|
391
|
+
private spawnTerminal(terminalId: string, cwd: string, providerOverride?: string): void {
|
|
338
392
|
const cleanEnv: Record<string, string> = {};
|
|
339
393
|
for (const [k, v] of Object.entries(this.options.providerConfig.env)) {
|
|
340
394
|
if (v !== undefined) cleanEnv[k] = v;
|
|
341
395
|
}
|
|
342
396
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
397
|
+
const term: TerminalInstance = {
|
|
398
|
+
id: terminalId,
|
|
399
|
+
pty: pty.spawn(
|
|
400
|
+
this.options.providerConfig.command,
|
|
401
|
+
this.options.providerConfig.args,
|
|
402
|
+
{
|
|
403
|
+
name: "xterm-256color",
|
|
404
|
+
cols: this.options.cols,
|
|
405
|
+
rows: this.options.rows,
|
|
406
|
+
cwd,
|
|
407
|
+
env: cleanEnv,
|
|
408
|
+
},
|
|
409
|
+
),
|
|
410
|
+
cwd,
|
|
411
|
+
projectName: basename(cwd),
|
|
412
|
+
provider: providerOverride ?? this.options.providerConfig.provider,
|
|
413
|
+
scrollback: new ScrollbackBuffer(1000),
|
|
414
|
+
outputSeq: 0,
|
|
415
|
+
status: "running",
|
|
416
|
+
};
|
|
354
417
|
|
|
355
|
-
|
|
356
|
-
const seq =
|
|
418
|
+
term.pty.onData((data) => {
|
|
419
|
+
const seq = term.outputSeq++;
|
|
357
420
|
const envelope = createEnvelope({
|
|
358
421
|
type: "terminal.output",
|
|
359
422
|
sessionId: this.sessionId,
|
|
423
|
+
terminalId,
|
|
360
424
|
seq,
|
|
361
425
|
payload: {
|
|
362
426
|
stream: "stdout" as const,
|
|
@@ -366,24 +430,34 @@ export class BridgeSession {
|
|
|
366
430
|
isFinal: false,
|
|
367
431
|
},
|
|
368
432
|
});
|
|
369
|
-
|
|
433
|
+
term.scrollback.push(envelope);
|
|
370
434
|
this.send(envelope);
|
|
371
435
|
});
|
|
372
436
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
437
|
+
term.pty.onExit(({ exitCode, signal }) => {
|
|
438
|
+
term.status = "exited";
|
|
439
|
+
this.send(createEnvelope({
|
|
376
440
|
type: "terminal.exit",
|
|
377
441
|
sessionId: this.sessionId,
|
|
442
|
+
terminalId,
|
|
378
443
|
payload: { exitCode, signal },
|
|
379
|
-
});
|
|
380
|
-
this.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
444
|
+
}));
|
|
445
|
+
this.sendTerminalList();
|
|
446
|
+
|
|
447
|
+
// If all terminals exited, close the session
|
|
448
|
+
const allExited = [...this.terminals.values()].every((t) => t.status === "exited");
|
|
449
|
+
if (allExited) {
|
|
450
|
+
this.exited = true;
|
|
451
|
+
setTimeout(() => {
|
|
452
|
+
this.stopHeartbeat();
|
|
453
|
+
this.socket?.close();
|
|
454
|
+
}, 500);
|
|
455
|
+
process.exitCode = exitCode ?? 0;
|
|
456
|
+
}
|
|
386
457
|
});
|
|
458
|
+
|
|
459
|
+
this.terminals.set(terminalId, term);
|
|
460
|
+
this.log(`spawned terminal ${terminalId} in ${cwd}`);
|
|
387
461
|
}
|
|
388
462
|
|
|
389
463
|
private send(message: Envelope): void {
|
|
@@ -517,7 +591,10 @@ export class BridgeSession {
|
|
|
517
591
|
}
|
|
518
592
|
this.socket?.close();
|
|
519
593
|
this.socket = undefined;
|
|
520
|
-
this.
|
|
594
|
+
for (const term of this.terminals.values()) {
|
|
595
|
+
if (term.status === "running") term.pty.kill();
|
|
596
|
+
}
|
|
597
|
+
this.terminals.clear();
|
|
521
598
|
process.exitCode = exitCode;
|
|
522
599
|
}
|
|
523
600
|
}
|