@floegence/floeterm-terminal-web 0.5.24 → 0.6.0
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/README.md +20 -0
- package/dist/core/PagedTerminalOutputCoordinator.js +3 -4
- package/dist/core/PagedTerminalOutputCoordinator.js.map +1 -1
- package/dist/core/TerminalCore.d.ts +3 -0
- package/dist/core/TerminalCore.d.ts.map +1 -1
- package/dist/core/TerminalCore.js +96 -21
- package/dist/core/TerminalCore.js.map +1 -1
- package/dist/core/TerminalOutputPipeline.js +2 -2
- package/dist/core/TerminalOutputPipeline.js.map +1 -1
- package/dist/entries/live.d.ts +7 -0
- package/dist/entries/live.d.ts.map +1 -0
- package/dist/entries/live.js +4 -0
- package/dist/entries/live.js.map +1 -0
- package/dist/fabric/BeamtermFabricRenderer.d.ts +11 -4
- package/dist/fabric/BeamtermFabricRenderer.d.ts.map +1 -1
- package/dist/fabric/BeamtermFabricRenderer.js +259 -47
- package/dist/fabric/BeamtermFabricRenderer.js.map +1 -1
- package/dist/fabric/TerminalFabricCoordinator.d.ts +1 -1
- package/dist/fabric/TerminalFabricCoordinator.d.ts.map +1 -1
- package/dist/fabric/TerminalFabricCoordinator.js +4 -7
- package/dist/fabric/TerminalFabricCoordinator.js.map +1 -1
- package/dist/fabric/TerminalLiveFabric.d.ts +3 -43
- package/dist/fabric/TerminalLiveFabric.d.ts.map +1 -1
- package/dist/fabric/TerminalLiveFabric.js +3 -97
- package/dist/fabric/TerminalLiveFabric.js.map +1 -1
- package/dist/fabric/types.d.ts +41 -3
- package/dist/fabric/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/BeamtermResourceLoader.d.ts +1 -1
- package/dist/internal/BeamtermResourceLoader.d.ts.map +1 -1
- package/dist/internal/BeamtermResourceLoader.js +1 -1
- package/dist/internal/BeamtermResourceLoader.js.map +1 -1
- package/dist/internal/SequenceBuffer.d.ts +7 -11
- package/dist/internal/SequenceBuffer.d.ts.map +1 -1
- package/dist/internal/SequenceBuffer.js +52 -103
- package/dist/internal/SequenceBuffer.js.map +1 -1
- package/dist/live/client.d.ts +62 -0
- package/dist/live/client.d.ts.map +1 -0
- package/dist/live/client.js +326 -0
- package/dist/live/client.js.map +1 -0
- package/dist/live/codec.d.ts +97 -0
- package/dist/live/codec.d.ts.map +1 -0
- package/dist/live/codec.js +386 -0
- package/dist/live/codec.js.map +1 -0
- package/dist/live/transport.d.ts +37 -0
- package/dist/live/transport.d.ts.map +1 -0
- package/dist/live/transport.js +194 -0
- package/dist/live/transport.js.map +1 -0
- package/dist/manager/TerminalInstanceController.d.ts +11 -0
- package/dist/manager/TerminalInstanceController.d.ts.map +1 -1
- package/dist/manager/TerminalInstanceController.js +265 -38
- package/dist/manager/TerminalInstanceController.js.map +1 -1
- package/dist/types.d.ts +41 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -2
|
@@ -1,134 +1,83 @@
|
|
|
1
1
|
const defaultConfig = {
|
|
2
|
-
maxPendingChunks:
|
|
3
|
-
|
|
4
|
-
cleanupIntervalMs: 5000,
|
|
5
|
-
forceCleanupThreshold: 60,
|
|
6
|
-
// If we keep seeing chunks ahead of the expected sequence for too long, assume a missing
|
|
7
|
-
// chunk was dropped (e.g. transient websocket loss) and advance to keep the UI responsive.
|
|
8
|
-
maxStallMs: 500
|
|
2
|
+
maxPendingChunks: 4096,
|
|
3
|
+
maxPendingBytes: 8 * 1024 * 1024,
|
|
9
4
|
};
|
|
10
|
-
|
|
5
|
+
const normalizePositiveInteger = (value, fallback) => (typeof value === 'number' && Number.isSafeInteger(value) && value > 0 ? value : fallback);
|
|
6
|
+
// Reliable transports may reorder delivery across the history/live handoff, but
|
|
7
|
+
// they must never infer or skip a missing sequence. Recovery owns gap resolution.
|
|
11
8
|
export class SequenceBuffer {
|
|
12
9
|
constructor(config = {}) {
|
|
13
10
|
this.expectedSequence = 1;
|
|
14
11
|
this.pending = new Map();
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
|
|
12
|
+
this.pendingBytes = 0;
|
|
13
|
+
this.config = {
|
|
14
|
+
maxPendingChunks: normalizePositiveInteger(config.maxPendingChunks, defaultConfig.maxPendingChunks),
|
|
15
|
+
maxPendingBytes: normalizePositiveInteger(config.maxPendingBytes, defaultConfig.maxPendingBytes),
|
|
16
|
+
};
|
|
18
17
|
}
|
|
19
18
|
reset(startSequence) {
|
|
20
|
-
this.expectedSequence =
|
|
19
|
+
this.expectedSequence = Number.isSafeInteger(startSequence) && startSequence > 0
|
|
20
|
+
? startSequence
|
|
21
|
+
: 1;
|
|
21
22
|
this.pending.clear();
|
|
22
|
-
this.
|
|
23
|
-
this.lastCleanupMs = Date.now();
|
|
23
|
+
this.pendingBytes = 0;
|
|
24
24
|
}
|
|
25
25
|
flushPending() {
|
|
26
|
-
if (this.pending.size === 0) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
26
|
const ready = [];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.pendingInsertedAt.delete(sequence);
|
|
35
|
-
if (!chunk || sequence < this.expectedSequence) {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
27
|
+
while (this.pending.has(this.expectedSequence)) {
|
|
28
|
+
const chunk = this.pending.get(this.expectedSequence);
|
|
29
|
+
this.pending.delete(this.expectedSequence);
|
|
30
|
+
this.pendingBytes -= chunk.data.byteLength;
|
|
38
31
|
ready.push(chunk);
|
|
39
|
-
this.expectedSequence
|
|
32
|
+
this.expectedSequence += 1;
|
|
40
33
|
}
|
|
41
34
|
return ready;
|
|
42
35
|
}
|
|
43
|
-
push(chunk,
|
|
36
|
+
push(chunk, _now = Date.now()) {
|
|
44
37
|
const sequence = chunk.sequence;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
if (!Number.isSafeInteger(sequence) || sequence < 1) {
|
|
39
|
+
return [chunk];
|
|
40
|
+
}
|
|
41
|
+
if (sequence < this.expectedSequence || this.pending.has(sequence)) {
|
|
42
|
+
return [];
|
|
49
43
|
}
|
|
50
|
-
this.cleanupIfNeeded(now);
|
|
51
|
-
ready.push(...this.flushIfStalled(now));
|
|
52
44
|
if (sequence === this.expectedSequence) {
|
|
53
|
-
ready.push(chunk);
|
|
54
45
|
this.expectedSequence += 1;
|
|
55
|
-
|
|
56
|
-
const next = this.pending.get(this.expectedSequence);
|
|
57
|
-
if (next) {
|
|
58
|
-
ready.push(next);
|
|
59
|
-
}
|
|
60
|
-
this.pending.delete(this.expectedSequence);
|
|
61
|
-
this.pendingInsertedAt.delete(this.expectedSequence);
|
|
62
|
-
this.expectedSequence += 1;
|
|
63
|
-
}
|
|
64
|
-
return ready;
|
|
46
|
+
return [chunk, ...this.flushPending()];
|
|
65
47
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!this.pendingInsertedAt.has(sequence)) {
|
|
70
|
-
this.pendingInsertedAt.set(sequence, now);
|
|
71
|
-
}
|
|
72
|
-
return ready;
|
|
48
|
+
if (this.pending.size + 1 > this.config.maxPendingChunks
|
|
49
|
+
|| this.pendingBytes + chunk.data.byteLength > this.config.maxPendingBytes) {
|
|
50
|
+
throw new Error('terminal output reorder queue limit exceeded');
|
|
73
51
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.pendingInsertedAt.clear();
|
|
78
|
-
}
|
|
79
|
-
ready.push(chunk);
|
|
80
|
-
return ready;
|
|
52
|
+
this.pending.set(sequence, chunk);
|
|
53
|
+
this.pendingBytes += chunk.data.byteLength;
|
|
54
|
+
return [];
|
|
81
55
|
}
|
|
82
|
-
|
|
83
|
-
if (
|
|
84
|
-
|
|
56
|
+
assertCoveredThrough(sequence) {
|
|
57
|
+
if (!Number.isSafeInteger(sequence) || sequence < 0) {
|
|
58
|
+
throw new Error('terminal output replay boundary is invalid');
|
|
85
59
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
for (const seq of this.pending.keys()) {
|
|
89
|
-
if (seq < minPendingSeq) {
|
|
90
|
-
minPendingSeq = seq;
|
|
91
|
-
minPendingInsertedAt = this.pendingInsertedAt.get(seq) ?? now;
|
|
92
|
-
}
|
|
60
|
+
if (this.expectedSequence <= sequence) {
|
|
61
|
+
throw new Error(`missing terminal output sequence ${this.expectedSequence} before replay boundary ${sequence}`);
|
|
93
62
|
}
|
|
94
|
-
if (!Number.isFinite(minPendingSeq) || minPendingSeq <= this.expectedSequence) {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
const ageMs = now - minPendingInsertedAt;
|
|
98
|
-
if (ageMs < this.config.maxStallMs) {
|
|
99
|
-
return [];
|
|
100
|
-
}
|
|
101
|
-
this.expectedSequence = minPendingSeq;
|
|
102
|
-
const ready = [];
|
|
103
|
-
while (this.pending.has(this.expectedSequence)) {
|
|
104
|
-
const next = this.pending.get(this.expectedSequence);
|
|
105
|
-
if (next) {
|
|
106
|
-
ready.push(next);
|
|
107
|
-
}
|
|
108
|
-
this.pending.delete(this.expectedSequence);
|
|
109
|
-
this.pendingInsertedAt.delete(this.expectedSequence);
|
|
110
|
-
this.expectedSequence += 1;
|
|
111
|
-
}
|
|
112
|
-
return ready;
|
|
113
63
|
}
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
this.pendingInsertedAt.clear();
|
|
118
|
-
this.lastCleanupMs = now;
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (now - this.lastCleanupMs < this.config.cleanupIntervalMs) {
|
|
122
|
-
return;
|
|
64
|
+
coverThrough(sequence) {
|
|
65
|
+
if (!Number.isSafeInteger(sequence) || sequence < 0) {
|
|
66
|
+
throw new Error('terminal output replay coverage is invalid');
|
|
123
67
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (seq < this.expectedSequence || seq > cutoff) {
|
|
127
|
-
this.pending.delete(seq);
|
|
128
|
-
this.pendingInsertedAt.delete(seq);
|
|
129
|
-
}
|
|
68
|
+
if (sequence < this.expectedSequence - 1) {
|
|
69
|
+
return [];
|
|
130
70
|
}
|
|
131
|
-
|
|
71
|
+
const covered = [...this.pending.entries()]
|
|
72
|
+
.filter(([pendingSequence]) => pendingSequence <= sequence)
|
|
73
|
+
.sort(([left], [right]) => left - right)
|
|
74
|
+
.map(([pendingSequence, chunk]) => {
|
|
75
|
+
this.pending.delete(pendingSequence);
|
|
76
|
+
this.pendingBytes -= chunk.data.byteLength;
|
|
77
|
+
return chunk;
|
|
78
|
+
});
|
|
79
|
+
this.expectedSequence = sequence + 1;
|
|
80
|
+
return [...covered, ...this.flushPending()];
|
|
132
81
|
}
|
|
133
82
|
}
|
|
134
83
|
//# sourceMappingURL=SequenceBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceBuffer.js","sourceRoot":"","sources":["../../src/internal/SequenceBuffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SequenceBuffer.js","sourceRoot":"","sources":["../../src/internal/SequenceBuffer.ts"],"names":[],"mappings":"AAOA,MAAM,aAAa,GAAyB;IAC1C,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,KAAyB,EAAE,QAAgB,EAAU,EAAE,CAAC,CACxF,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CACzF,CAAC;AAEF,gFAAgF;AAChF,kFAAkF;AAClF,MAAM,OAAO,cAAc;IAMzB,YAAY,SAAwC,EAAE;QAL9C,qBAAgB,GAAG,CAAC,CAAC;QACZ,YAAO,GAAG,IAAI,GAA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3B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,QAAQ,GAAG,IAAI,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;aACxC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,eAAe,IAAI,QAAQ,CAAC;aAC1D,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC;aACvC,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YACrC,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;YAC3C,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,gBAAgB,GAAG,QAAQ,GAAG,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { StreamKind, type OutputRecord } from './codec.js';
|
|
2
|
+
export declare const MAX_QUEUED_INPUT_BYTES: number;
|
|
3
|
+
export declare enum TerminalLiveErrorCode {
|
|
4
|
+
ProtocolViolation = 1,
|
|
5
|
+
PermissionDenied = 2,
|
|
6
|
+
SessionNotFound = 3,
|
|
7
|
+
ActivationFailed = 4,
|
|
8
|
+
SlowConsumer = 5,
|
|
9
|
+
Internal = 6
|
|
10
|
+
}
|
|
11
|
+
export declare class TerminalLiveServerError extends Error {
|
|
12
|
+
readonly code: number;
|
|
13
|
+
readonly serverMessage: string;
|
|
14
|
+
constructor(code: number, serverMessage: string);
|
|
15
|
+
}
|
|
16
|
+
export type TerminalLiveCloseReason = 'stream_ended' | 'session_closed';
|
|
17
|
+
export interface TerminalByteStream {
|
|
18
|
+
read(): Promise<Uint8Array | null>;
|
|
19
|
+
write(data: Uint8Array): Promise<void>;
|
|
20
|
+
close(): Promise<void> | void;
|
|
21
|
+
reset?(error?: Error): Promise<void> | void;
|
|
22
|
+
}
|
|
23
|
+
export type TerminalLiveAttachRequest = Readonly<{
|
|
24
|
+
sessionId: string;
|
|
25
|
+
connectionId: string;
|
|
26
|
+
attachGeneration: number;
|
|
27
|
+
cols: number;
|
|
28
|
+
rows: number;
|
|
29
|
+
}>;
|
|
30
|
+
export type TerminalLiveAttached = Readonly<{
|
|
31
|
+
historyBoundarySequence: number;
|
|
32
|
+
historyGeneration: number;
|
|
33
|
+
historyStartSequence: number;
|
|
34
|
+
geometryGeneration: number;
|
|
35
|
+
cols: number;
|
|
36
|
+
rows: number;
|
|
37
|
+
}>;
|
|
38
|
+
export type TerminalLiveGeometry = Readonly<{
|
|
39
|
+
generation: number;
|
|
40
|
+
outputSequenceBoundary: number;
|
|
41
|
+
cols: number;
|
|
42
|
+
rows: number;
|
|
43
|
+
}>;
|
|
44
|
+
export type TerminalLiveConnection = Readonly<{
|
|
45
|
+
attached: TerminalLiveAttached;
|
|
46
|
+
sendInput(data: Uint8Array): Promise<void>;
|
|
47
|
+
resize(cols: number, rows: number): Promise<void>;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
}>;
|
|
50
|
+
export type ConnectTerminalLiveOptions = Readonly<{
|
|
51
|
+
openStream: (kind: typeof StreamKind, options?: Readonly<{
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}>) => Promise<TerminalByteStream>;
|
|
54
|
+
attach: TerminalLiveAttachRequest;
|
|
55
|
+
onOutputBatch: (records: readonly OutputRecord[]) => void;
|
|
56
|
+
onGeometry?: (geometry: TerminalLiveGeometry) => void;
|
|
57
|
+
onClosed?: (reason: TerminalLiveCloseReason) => void;
|
|
58
|
+
onError?: (error: Error) => void;
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const connectTerminalLive: (options: ConnectTerminalLiveOptions) => Promise<TerminalLiveConnection>;
|
|
62
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/live/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAYV,KAAK,YAAY,EAElB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,sBAAsB,QAAkB,CAAC;AAEtD,oBAAY,qBAAqB;IAC/B,iBAAiB,IAAI;IACrB,gBAAgB,IAAI;IACpB,eAAe,IAAI;IACnB,gBAAgB,IAAI;IACpB,YAAY,IAAI;IAChB,QAAQ,IAAI;CACb;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAMhD;AAED,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,IAAI,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACnC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,M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AAC,OAAO,EAAE,SAAS,YAAY,EAAE,KAAK,IAAI,CAAC;IAC1D,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;AAyRH,eAAO,MAAM,mBAAmB,GAAU,SAAS,0BAA0B,KAAG,OAAO,CAAC,sBAAsB,CA6C7G,CAAC"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { MAX_INPUT_BYTES, StreamKind, TerminalLiveDecoder, TerminalLiveFrameType, decodeAttached, decodeGeometryChanged, decodeOutputBatch, decodeProtocolError, decodeResizeApplied, encodeAttach, encodeInput, encodeResize, } from './codec.js';
|
|
2
|
+
export const MAX_QUEUED_INPUT_BYTES = 8 * 1024 * 1024;
|
|
3
|
+
export var TerminalLiveErrorCode;
|
|
4
|
+
(function (TerminalLiveErrorCode) {
|
|
5
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["ProtocolViolation"] = 1] = "ProtocolViolation";
|
|
6
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["PermissionDenied"] = 2] = "PermissionDenied";
|
|
7
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["SessionNotFound"] = 3] = "SessionNotFound";
|
|
8
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["ActivationFailed"] = 4] = "ActivationFailed";
|
|
9
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["SlowConsumer"] = 5] = "SlowConsumer";
|
|
10
|
+
TerminalLiveErrorCode[TerminalLiveErrorCode["Internal"] = 6] = "Internal";
|
|
11
|
+
})(TerminalLiveErrorCode || (TerminalLiveErrorCode = {}));
|
|
12
|
+
export class TerminalLiveServerError extends Error {
|
|
13
|
+
constructor(code, serverMessage) {
|
|
14
|
+
super(`terminal live server error ${code}: ${serverMessage}`);
|
|
15
|
+
this.name = 'TerminalLiveServerError';
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.serverMessage = serverMessage;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class FrameReader {
|
|
21
|
+
constructor(stream) {
|
|
22
|
+
this.stream = stream;
|
|
23
|
+
this.decoder = new TerminalLiveDecoder();
|
|
24
|
+
this.pending = [];
|
|
25
|
+
}
|
|
26
|
+
async read() {
|
|
27
|
+
while (this.pending.length === 0) {
|
|
28
|
+
const chunk = await this.stream.read();
|
|
29
|
+
if (chunk == null)
|
|
30
|
+
return null;
|
|
31
|
+
this.pending = this.decoder.push(chunk);
|
|
32
|
+
}
|
|
33
|
+
return this.pending.shift() ?? null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const toSafeNumber = (value, name) => {
|
|
37
|
+
const number = Number(value);
|
|
38
|
+
if (!Number.isSafeInteger(number) || number < 0)
|
|
39
|
+
throw new Error(`${name} exceeds JavaScript safe integer range`);
|
|
40
|
+
return number;
|
|
41
|
+
};
|
|
42
|
+
class TerminalLiveConnectionImpl {
|
|
43
|
+
constructor(stream, reader, attached, onOutputBatch, onGeometry, onClosed, onError) {
|
|
44
|
+
this.stream = stream;
|
|
45
|
+
this.reader = reader;
|
|
46
|
+
this.onOutputBatch = onOutputBatch;
|
|
47
|
+
this.onGeometry = onGeometry;
|
|
48
|
+
this.onClosed = onClosed;
|
|
49
|
+
this.onError = onError;
|
|
50
|
+
this.inputSequence = 0n;
|
|
51
|
+
this.resizeSequence = 0n;
|
|
52
|
+
this.queuedInputBytes = 0;
|
|
53
|
+
this.pendingGeometries = [];
|
|
54
|
+
this.writeTail = Promise.resolve();
|
|
55
|
+
this.resizeWaiters = new Map();
|
|
56
|
+
this.closed = false;
|
|
57
|
+
this.failed = false;
|
|
58
|
+
this.attached = {
|
|
59
|
+
historyBoundarySequence: toSafeNumber(attached.historyBoundarySequence, 'historyBoundarySequence'),
|
|
60
|
+
historyGeneration: toSafeNumber(attached.historyGeneration, 'historyGeneration'),
|
|
61
|
+
historyStartSequence: toSafeNumber(attached.historyStartSequence, 'historyStartSequence'),
|
|
62
|
+
geometryGeneration: toSafeNumber(attached.geometryGeneration, 'geometryGeneration'),
|
|
63
|
+
cols: attached.cols,
|
|
64
|
+
rows: attached.rows,
|
|
65
|
+
};
|
|
66
|
+
this.geometry = {
|
|
67
|
+
generation: this.attached.geometryGeneration,
|
|
68
|
+
outputSequenceBoundary: this.attached.historyBoundarySequence,
|
|
69
|
+
cols: this.attached.cols,
|
|
70
|
+
rows: this.attached.rows,
|
|
71
|
+
};
|
|
72
|
+
this.nextOutputSequence = attached.historyBoundarySequence + 1n;
|
|
73
|
+
this.lastOutputSequence = attached.historyBoundarySequence;
|
|
74
|
+
this.onGeometry?.(this.geometry);
|
|
75
|
+
}
|
|
76
|
+
start() {
|
|
77
|
+
void this.readLoop();
|
|
78
|
+
}
|
|
79
|
+
async sendInput(data) {
|
|
80
|
+
if (this.closed)
|
|
81
|
+
throw new Error('terminal live connection is closed');
|
|
82
|
+
if (data.byteLength === 0)
|
|
83
|
+
return;
|
|
84
|
+
if (data.byteLength > MAX_QUEUED_INPUT_BYTES || this.queuedInputBytes + data.byteLength > MAX_QUEUED_INPUT_BYTES) {
|
|
85
|
+
throw new Error('terminal live input queue limit exceeded');
|
|
86
|
+
}
|
|
87
|
+
const frameCount = Math.ceil(data.byteLength / MAX_INPUT_BYTES);
|
|
88
|
+
const firstSequence = this.inputSequence + 1n;
|
|
89
|
+
this.inputSequence += BigInt(frameCount);
|
|
90
|
+
this.queuedInputBytes += data.byteLength;
|
|
91
|
+
try {
|
|
92
|
+
await this.enqueueWrite(async () => {
|
|
93
|
+
// Encode one frame at a time only when the byte stream is ready for it.
|
|
94
|
+
// A maximum-size paste therefore retains the caller's byte buffer plus
|
|
95
|
+
// one 64 KiB wire frame instead of another full paste-sized frame set.
|
|
96
|
+
for (let frameIndex = 0, offset = 0; offset < data.byteLength; frameIndex += 1, offset += MAX_INPUT_BYTES) {
|
|
97
|
+
const encoded = encodeInput({
|
|
98
|
+
sequence: firstSequence + BigInt(frameIndex),
|
|
99
|
+
data: data.subarray(offset, Math.min(data.byteLength, offset + MAX_INPUT_BYTES)),
|
|
100
|
+
});
|
|
101
|
+
await this.stream.write(encoded);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
this.queuedInputBytes -= data.byteLength;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async resize(cols, rows) {
|
|
110
|
+
if (this.closed)
|
|
111
|
+
throw new Error('terminal live connection is closed');
|
|
112
|
+
this.resizeSequence += 1n;
|
|
113
|
+
const sequence = this.resizeSequence;
|
|
114
|
+
const applied = new Promise((resolve, reject) => {
|
|
115
|
+
this.resizeWaiters.set(sequence, { resolve, reject });
|
|
116
|
+
});
|
|
117
|
+
try {
|
|
118
|
+
await this.enqueueWrite(() => this.stream.write(encodeResize({ sequence, cols, rows })));
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
this.resizeWaiters.delete(sequence);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
return await applied;
|
|
125
|
+
}
|
|
126
|
+
async close() {
|
|
127
|
+
if (this.closed)
|
|
128
|
+
return;
|
|
129
|
+
this.closed = true;
|
|
130
|
+
const error = new Error('terminal live connection is closed');
|
|
131
|
+
this.rejectResizeWaiters(error);
|
|
132
|
+
await this.stream.close();
|
|
133
|
+
}
|
|
134
|
+
enqueueWrite(operation) {
|
|
135
|
+
const run = this.writeTail.then(operation);
|
|
136
|
+
this.writeTail = run.catch(() => undefined);
|
|
137
|
+
return run;
|
|
138
|
+
}
|
|
139
|
+
async readLoop() {
|
|
140
|
+
try {
|
|
141
|
+
while (!this.closed) {
|
|
142
|
+
const frame = await this.reader.read();
|
|
143
|
+
if (frame == null) {
|
|
144
|
+
this.closed = true;
|
|
145
|
+
this.rejectResizeWaiters(new Error('terminal live stream ended'));
|
|
146
|
+
this.onClosed?.('stream_ended');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
switch (frame.type) {
|
|
150
|
+
case TerminalLiveFrameType.OutputBatch:
|
|
151
|
+
{
|
|
152
|
+
const batch = decodeOutputBatch(frame);
|
|
153
|
+
const records = batch.records;
|
|
154
|
+
for (const record of records) {
|
|
155
|
+
if (record.sequence !== this.nextOutputSequence) {
|
|
156
|
+
throw new Error(`expected output sequence ${this.nextOutputSequence}, received ${record.sequence}`);
|
|
157
|
+
}
|
|
158
|
+
this.nextOutputSequence += 1n;
|
|
159
|
+
}
|
|
160
|
+
this.applyGeometry({
|
|
161
|
+
generation: toSafeNumber(batch.geometryGeneration, 'geometryGeneration'),
|
|
162
|
+
outputSequenceBoundary: toSafeNumber(records[0].sequence - 1n, 'outputSequenceBoundary'),
|
|
163
|
+
cols: batch.cols,
|
|
164
|
+
rows: batch.rows,
|
|
165
|
+
});
|
|
166
|
+
this.onOutputBatch(records);
|
|
167
|
+
if (records.length > 0)
|
|
168
|
+
this.lastOutputSequence = records[records.length - 1].sequence;
|
|
169
|
+
this.flushPendingGeometries();
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
case TerminalLiveFrameType.ResizeApplied: {
|
|
173
|
+
const applied = decodeResizeApplied(frame);
|
|
174
|
+
const waiter = this.resizeWaiters.get(applied.sequence);
|
|
175
|
+
if (!waiter)
|
|
176
|
+
throw new Error('unexpected terminal live resize acknowledgement');
|
|
177
|
+
this.queueGeometry({
|
|
178
|
+
generation: toSafeNumber(applied.geometryGeneration, 'geometryGeneration'),
|
|
179
|
+
outputSequenceBoundary: toSafeNumber(applied.outputSequenceBoundary, 'outputSequenceBoundary'),
|
|
180
|
+
cols: applied.cols,
|
|
181
|
+
rows: applied.rows,
|
|
182
|
+
}, applied.outputSequenceBoundary, applied.sequence);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
case TerminalLiveFrameType.GeometryChanged: {
|
|
186
|
+
const geometry = decodeGeometryChanged(frame);
|
|
187
|
+
this.queueGeometry({
|
|
188
|
+
generation: toSafeNumber(geometry.generation, 'geometryGeneration'),
|
|
189
|
+
outputSequenceBoundary: toSafeNumber(geometry.outputSequenceBoundary, 'outputSequenceBoundary'),
|
|
190
|
+
cols: geometry.cols,
|
|
191
|
+
rows: geometry.rows,
|
|
192
|
+
}, geometry.outputSequenceBoundary);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case TerminalLiveFrameType.SessionClosed:
|
|
196
|
+
if (frame.payload.byteLength !== 0)
|
|
197
|
+
throw new Error('invalid terminal live session closed payload');
|
|
198
|
+
this.closed = true;
|
|
199
|
+
this.rejectResizeWaiters(new Error('terminal session closed'));
|
|
200
|
+
this.onClosed?.('session_closed');
|
|
201
|
+
await this.stream.close();
|
|
202
|
+
return;
|
|
203
|
+
case TerminalLiveFrameType.Error: {
|
|
204
|
+
const protocolError = decodeProtocolError(frame);
|
|
205
|
+
throw new TerminalLiveServerError(protocolError.code, protocolError.message);
|
|
206
|
+
}
|
|
207
|
+
default:
|
|
208
|
+
throw new Error(`invalid terminal live server frame: 0x${frame.type.toString(16)}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (value) {
|
|
213
|
+
const error = value instanceof Error ? value : new Error(String(value));
|
|
214
|
+
await this.fail(error);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
rejectResizeWaiters(error) {
|
|
218
|
+
for (const waiter of this.resizeWaiters.values())
|
|
219
|
+
waiter.reject(error);
|
|
220
|
+
this.resizeWaiters.clear();
|
|
221
|
+
this.pendingGeometries = [];
|
|
222
|
+
}
|
|
223
|
+
queueGeometry(geometry, outputSequenceBoundary, resizeSequence) {
|
|
224
|
+
this.pendingGeometries.push({ geometry, outputSequenceBoundary, resizeSequence });
|
|
225
|
+
this.flushPendingGeometries();
|
|
226
|
+
}
|
|
227
|
+
flushPendingGeometries() {
|
|
228
|
+
if (this.pendingGeometries.length === 0)
|
|
229
|
+
return;
|
|
230
|
+
const ready = [];
|
|
231
|
+
const waiting = [];
|
|
232
|
+
for (const pending of this.pendingGeometries) {
|
|
233
|
+
(pending.outputSequenceBoundary <= this.lastOutputSequence ? ready : waiting).push(pending);
|
|
234
|
+
}
|
|
235
|
+
this.pendingGeometries = waiting;
|
|
236
|
+
ready.sort((left, right) => (left.outputSequenceBoundary === right.outputSequenceBoundary
|
|
237
|
+
? left.geometry.generation - right.geometry.generation
|
|
238
|
+
: left.outputSequenceBoundary < right.outputSequenceBoundary ? -1 : 1));
|
|
239
|
+
for (const pending of ready) {
|
|
240
|
+
this.applyGeometry(pending.geometry);
|
|
241
|
+
if (pending.resizeSequence !== undefined) {
|
|
242
|
+
const waiter = this.resizeWaiters.get(pending.resizeSequence);
|
|
243
|
+
if (!waiter)
|
|
244
|
+
continue;
|
|
245
|
+
this.resizeWaiters.delete(pending.resizeSequence);
|
|
246
|
+
waiter.resolve();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
applyGeometry(next) {
|
|
251
|
+
if (next.generation < this.geometry.generation)
|
|
252
|
+
return;
|
|
253
|
+
if (next.generation === this.geometry.generation) {
|
|
254
|
+
if (next.cols !== this.geometry.cols || next.rows !== this.geometry.rows) {
|
|
255
|
+
throw new Error('terminal live geometry changed without advancing its generation');
|
|
256
|
+
}
|
|
257
|
+
if (next.outputSequenceBoundary > this.geometry.outputSequenceBoundary) {
|
|
258
|
+
this.geometry = next;
|
|
259
|
+
}
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
this.geometry = next;
|
|
263
|
+
this.onGeometry?.(next);
|
|
264
|
+
}
|
|
265
|
+
async fail(error) {
|
|
266
|
+
if (this.failed)
|
|
267
|
+
return;
|
|
268
|
+
this.failed = true;
|
|
269
|
+
this.closed = true;
|
|
270
|
+
this.rejectResizeWaiters(error);
|
|
271
|
+
this.onError?.(error);
|
|
272
|
+
try {
|
|
273
|
+
if (this.stream.reset)
|
|
274
|
+
await this.stream.reset(error);
|
|
275
|
+
else
|
|
276
|
+
await this.stream.close();
|
|
277
|
+
}
|
|
278
|
+
catch {
|
|
279
|
+
// The original protocol error is authoritative.
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
export const connectTerminalLive = async (options) => {
|
|
284
|
+
let stream = null;
|
|
285
|
+
try {
|
|
286
|
+
stream = await options.openStream(StreamKind, options.signal ? { signal: options.signal } : undefined);
|
|
287
|
+
await stream.write(encodeAttach({
|
|
288
|
+
sessionId: options.attach.sessionId,
|
|
289
|
+
connectionId: options.attach.connectionId,
|
|
290
|
+
attachGeneration: BigInt(options.attach.attachGeneration),
|
|
291
|
+
cols: options.attach.cols,
|
|
292
|
+
rows: options.attach.rows,
|
|
293
|
+
}));
|
|
294
|
+
const reader = new FrameReader(stream);
|
|
295
|
+
const first = await reader.read();
|
|
296
|
+
if (first == null)
|
|
297
|
+
throw new Error('terminal live stream ended before attach acknowledgement');
|
|
298
|
+
if (first.type === TerminalLiveFrameType.Error) {
|
|
299
|
+
const protocolError = decodeProtocolError(first);
|
|
300
|
+
throw new TerminalLiveServerError(protocolError.code, protocolError.message);
|
|
301
|
+
}
|
|
302
|
+
if (first.type !== TerminalLiveFrameType.Attached) {
|
|
303
|
+
throw new Error(`invalid terminal live server frame before attach: 0x${first.type.toString(16)}`);
|
|
304
|
+
}
|
|
305
|
+
const connection = new TerminalLiveConnectionImpl(stream, reader, decodeAttached(first), options.onOutputBatch, options.onGeometry, options.onClosed, options.onError);
|
|
306
|
+
connection.start();
|
|
307
|
+
return connection;
|
|
308
|
+
}
|
|
309
|
+
catch (value) {
|
|
310
|
+
const error = value instanceof Error ? value : new Error(String(value));
|
|
311
|
+
options.onError?.(error);
|
|
312
|
+
if (stream) {
|
|
313
|
+
try {
|
|
314
|
+
if (stream.reset)
|
|
315
|
+
await stream.reset(error);
|
|
316
|
+
else
|
|
317
|
+
await stream.close();
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
// The attach error is authoritative.
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
throw error;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/live/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,YAAY,GAIb,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtD,MAAM,CAAN,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,2FAAqB,CAAA;IACrB,yFAAoB,CAAA;IACpB,uFAAmB,CAAA;IACnB,yFAAoB,CAAA;IACpB,iFAAgB,CAAA;IAChB,yEAAY,CAAA;AACd,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,QAOhC;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAIhD,YAAY,IAAY,EAAE,aAAqB;QAC7C,KAAK,CAAC,8BAA8B,IAAI,KAAK,aAAa,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;CACF;AAoDD,MAAM,WAAW;IAIf,YAA6B,MAA0B;QAA1B,WAAM,GAAN,MAAM,CAAoB;QAHtC,YAAO,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC7C,YAAO,GAAwB,EAAE,CAAC;IAEgB,C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