@fnndsc/calypso 0.21.3 → 0.22.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/dist/daemon/berth.d.ts +25 -0
- package/dist/daemon/berth.js +95 -3
- package/dist/daemon/berth.js.map +1 -1
- package/dist/daemon/engine.d.ts +13 -0
- package/dist/daemon/lane.d.ts +37 -0
- package/dist/daemon/lane.js +66 -0
- package/dist/daemon/lane.js.map +1 -0
- package/dist/daemon/launch.d.ts +6 -0
- package/dist/daemon/launch.js +17 -2
- package/dist/daemon/launch.js.map +1 -1
- package/dist/daemon/server.d.ts +40 -6
- package/dist/daemon/server.js +125 -46
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/terminals.d.ts +159 -0
- package/dist/daemon/terminals.js +264 -0
- package/dist/daemon/terminals.js.map +1 -0
- package/dist/notes.json +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Terminals: a surface's console as a real terminal, a `chell --remote`
|
|
3
|
+
* the daemon runs under a pseudo-terminal and whose bytes it relays.
|
|
4
|
+
*
|
|
5
|
+
* A browser cannot hold a terminal, so the daemon holds one for it. Each
|
|
6
|
+
* terminal is the same chell a shell would run, attached back to this daemon
|
|
7
|
+
* over the loopback wire like any other surface; the browser draws its bytes
|
|
8
|
+
* (xterm.js) and sends back keystrokes and its size. One shell
|
|
9
|
+
* implementation serves the terminal and the browser alike.
|
|
10
|
+
*
|
|
11
|
+
* A terminal outlives the socket that opened it. The page keeps the
|
|
12
|
+
* terminal's id; a reload or a dropped connection opens it again by that id,
|
|
13
|
+
* receives what was printed meanwhile (a bounded buffer of the most recent
|
|
14
|
+
* output) and carries on, mid-command or mid-question. A terminal nobody is
|
|
15
|
+
* attached to closes after an idle timeout; its chell exiting closes it at
|
|
16
|
+
* once.
|
|
17
|
+
*
|
|
18
|
+
* The pseudo-terminal comes from `node-pty`, an optional dependency compiled
|
|
19
|
+
* at install. A daemon on a machine where it could not be built offers no
|
|
20
|
+
* terminals, and says so on attach; its surfaces keep their transcript
|
|
21
|
+
* console.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { randomBytes } from 'node:crypto';
|
|
26
|
+
/** The recent output a terminal keeps for a reattach: about a megabyte. */
|
|
27
|
+
export const TERMINAL_BUFFER_LIMIT = 1024 * 1024;
|
|
28
|
+
/** How long a terminal nobody is attached to lives: fifteen minutes. */
|
|
29
|
+
export const TERMINAL_IDLE_MS = 15 * 60 * 1000;
|
|
30
|
+
/** The smallest and largest size a terminal takes. */
|
|
31
|
+
const SIZE_MIN = 2;
|
|
32
|
+
const SIZE_MAX = 1000;
|
|
33
|
+
/**
|
|
34
|
+
* A size kept in bounds and whole.
|
|
35
|
+
*
|
|
36
|
+
* @param n - The size asked for.
|
|
37
|
+
* @returns The size used.
|
|
38
|
+
*/
|
|
39
|
+
function size_clamp(n) {
|
|
40
|
+
if (!Number.isFinite(n))
|
|
41
|
+
return 80;
|
|
42
|
+
return Math.min(SIZE_MAX, Math.max(SIZE_MIN, Math.round(n)));
|
|
43
|
+
}
|
|
44
|
+
/** The daemon's terminals. */
|
|
45
|
+
export class Terminals {
|
|
46
|
+
options;
|
|
47
|
+
terminals = new Map();
|
|
48
|
+
bufferLimit;
|
|
49
|
+
idleMs;
|
|
50
|
+
/** @param options - How terminals are started and kept. */
|
|
51
|
+
constructor(options) {
|
|
52
|
+
this.options = options;
|
|
53
|
+
this.bufferLimit = options.bufferLimit ?? TERMINAL_BUFFER_LIMIT;
|
|
54
|
+
this.idleMs = options.idleMs ?? TERMINAL_IDLE_MS;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Opens a terminal for a viewer: the one named, when it is still running,
|
|
58
|
+
* else a new one. A viewer already on the named terminal is replaced.
|
|
59
|
+
*
|
|
60
|
+
* @param viewer - Where its output goes.
|
|
61
|
+
* @param cols - The viewer's width.
|
|
62
|
+
* @param rows - The viewer's height.
|
|
63
|
+
* @param terminalId - The terminal to open again, when the viewer had one.
|
|
64
|
+
* @returns Its id and the output to draw first.
|
|
65
|
+
*/
|
|
66
|
+
open(viewer, cols, rows, terminalId) {
|
|
67
|
+
const known = terminalId === undefined ? undefined : this.terminals.get(terminalId);
|
|
68
|
+
if (known !== undefined && !known.exited) {
|
|
69
|
+
this.idle_stop(known);
|
|
70
|
+
known.viewer = viewer;
|
|
71
|
+
known.pty.resize(size_clamp(cols), size_clamp(rows));
|
|
72
|
+
return { terminalId: known.id, replay: known.buffer.join('') };
|
|
73
|
+
}
|
|
74
|
+
const terminal = this.terminal_start(size_clamp(cols), size_clamp(rows));
|
|
75
|
+
terminal.viewer = viewer;
|
|
76
|
+
return { terminalId: terminal.id, replay: '' };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Types into a terminal.
|
|
80
|
+
*
|
|
81
|
+
* @param viewer - Who types; only the terminal's own viewer may.
|
|
82
|
+
* @param terminalId - The terminal.
|
|
83
|
+
* @param data - The keystrokes.
|
|
84
|
+
* @returns False when the viewer does not hold that terminal.
|
|
85
|
+
*/
|
|
86
|
+
input(viewer, terminalId, data) {
|
|
87
|
+
const terminal = this.held(viewer, terminalId);
|
|
88
|
+
if (terminal === undefined)
|
|
89
|
+
return false;
|
|
90
|
+
terminal.pty.write(data);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Resizes a terminal.
|
|
95
|
+
*
|
|
96
|
+
* @param viewer - Who resizes; only the terminal's own viewer may.
|
|
97
|
+
* @param terminalId - The terminal.
|
|
98
|
+
* @param cols - The new width.
|
|
99
|
+
* @param rows - The new height.
|
|
100
|
+
* @returns False when the viewer does not hold that terminal.
|
|
101
|
+
*/
|
|
102
|
+
resize(viewer, terminalId, cols, rows) {
|
|
103
|
+
const terminal = this.held(viewer, terminalId);
|
|
104
|
+
if (terminal === undefined)
|
|
105
|
+
return false;
|
|
106
|
+
terminal.pty.resize(size_clamp(cols), size_clamp(rows));
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Closes a terminal its viewer is done with.
|
|
111
|
+
*
|
|
112
|
+
* @param viewer - Who closes; only the terminal's own viewer may.
|
|
113
|
+
* @param terminalId - The terminal.
|
|
114
|
+
* @returns False when the viewer does not hold that terminal.
|
|
115
|
+
*/
|
|
116
|
+
close(viewer, terminalId) {
|
|
117
|
+
const terminal = this.held(viewer, terminalId);
|
|
118
|
+
if (terminal === undefined)
|
|
119
|
+
return false;
|
|
120
|
+
terminal.viewer = null;
|
|
121
|
+
this.terminal_end(terminal);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A viewer has gone (its socket closed): its terminals keep running,
|
|
126
|
+
* unwatched, until the idle timeout or a reattach.
|
|
127
|
+
*
|
|
128
|
+
* @param viewer - The viewer that went.
|
|
129
|
+
*/
|
|
130
|
+
detach(viewer) {
|
|
131
|
+
for (const terminal of this.terminals.values()) {
|
|
132
|
+
if (terminal.viewer !== viewer)
|
|
133
|
+
continue;
|
|
134
|
+
terminal.viewer = null;
|
|
135
|
+
this.idle_start(terminal);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Ends every terminal (the daemon is stopping). */
|
|
139
|
+
stop() {
|
|
140
|
+
for (const terminal of [...this.terminals.values()])
|
|
141
|
+
this.terminal_end(terminal);
|
|
142
|
+
}
|
|
143
|
+
/** How many terminals are running. */
|
|
144
|
+
get count() {
|
|
145
|
+
return this.terminals.size;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The terminal a viewer holds, by id.
|
|
149
|
+
*
|
|
150
|
+
* @param viewer - The viewer.
|
|
151
|
+
* @param terminalId - The id.
|
|
152
|
+
* @returns The terminal, or undefined when it is not that viewer's.
|
|
153
|
+
*/
|
|
154
|
+
held(viewer, terminalId) {
|
|
155
|
+
const terminal = this.terminals.get(terminalId);
|
|
156
|
+
return terminal !== undefined && terminal.viewer === viewer && !terminal.exited ? terminal : undefined;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Starts a terminal: chell attached to this daemon, under a pty.
|
|
160
|
+
*
|
|
161
|
+
* @param cols - Its width.
|
|
162
|
+
* @param rows - Its height.
|
|
163
|
+
* @returns The terminal.
|
|
164
|
+
*/
|
|
165
|
+
terminal_start(cols, rows) {
|
|
166
|
+
const { launch, target } = this.options;
|
|
167
|
+
const id = randomBytes(12).toString('hex');
|
|
168
|
+
const pty = this.options.spawn(launch.exec, [...launch.prefixArgs, '--remote', target.identity, '--attach', target.url, '--token', target.token], {
|
|
169
|
+
name: 'xterm-256color',
|
|
170
|
+
cols,
|
|
171
|
+
rows,
|
|
172
|
+
cwd: process.env['HOME'] ?? process.cwd(),
|
|
173
|
+
// A terminal draws colour, whatever the daemon's own environment said;
|
|
174
|
+
// CHELL_TERMINAL tells the chell it is a browser's console.
|
|
175
|
+
env: { ...process.env, TERM: 'xterm-256color', COLORTERM: 'truecolor', FORCE_COLOR: '3', CHELL_TERMINAL: '1' },
|
|
176
|
+
});
|
|
177
|
+
const terminal = { id, pty, buffer: [], bufferSize: 0, viewer: null, idle: null, exited: false };
|
|
178
|
+
pty.onData((data) => {
|
|
179
|
+
this.buffer_add(terminal, data);
|
|
180
|
+
terminal.viewer?.data(id, data);
|
|
181
|
+
});
|
|
182
|
+
pty.onExit((event) => {
|
|
183
|
+
terminal.exited = true;
|
|
184
|
+
this.idle_stop(terminal);
|
|
185
|
+
this.terminals.delete(id);
|
|
186
|
+
terminal.viewer?.exit(id, event.exitCode);
|
|
187
|
+
terminal.viewer = null;
|
|
188
|
+
});
|
|
189
|
+
this.terminals.set(id, terminal);
|
|
190
|
+
return terminal;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Keeps output for a reattach, dropping the oldest past the limit.
|
|
194
|
+
*
|
|
195
|
+
* @param terminal - The terminal.
|
|
196
|
+
* @param data - What it printed.
|
|
197
|
+
*/
|
|
198
|
+
buffer_add(terminal, data) {
|
|
199
|
+
terminal.buffer.push(data);
|
|
200
|
+
terminal.bufferSize += data.length;
|
|
201
|
+
while (terminal.bufferSize > this.bufferLimit && terminal.buffer.length > 1) {
|
|
202
|
+
terminal.bufferSize -= terminal.buffer.shift().length;
|
|
203
|
+
}
|
|
204
|
+
if (terminal.bufferSize > this.bufferLimit) {
|
|
205
|
+
const only = terminal.buffer[0];
|
|
206
|
+
terminal.buffer[0] = only.slice(only.length - this.bufferLimit);
|
|
207
|
+
terminal.bufferSize = terminal.buffer[0].length;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Ends a terminal: its program is killed and it is forgotten.
|
|
212
|
+
*
|
|
213
|
+
* @param terminal - The terminal.
|
|
214
|
+
*/
|
|
215
|
+
terminal_end(terminal) {
|
|
216
|
+
this.idle_stop(terminal);
|
|
217
|
+
this.terminals.delete(terminal.id);
|
|
218
|
+
if (!terminal.exited) {
|
|
219
|
+
terminal.exited = true;
|
|
220
|
+
try {
|
|
221
|
+
terminal.pty.kill();
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Already gone.
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Starts the clock on an unwatched terminal.
|
|
230
|
+
*
|
|
231
|
+
* @param terminal - The terminal.
|
|
232
|
+
*/
|
|
233
|
+
idle_start(terminal) {
|
|
234
|
+
this.idle_stop(terminal);
|
|
235
|
+
terminal.idle = setTimeout(() => this.terminal_end(terminal), this.idleMs);
|
|
236
|
+
terminal.idle.unref();
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Stops the clock on a terminal that is watched again.
|
|
240
|
+
*
|
|
241
|
+
* @param terminal - The terminal.
|
|
242
|
+
*/
|
|
243
|
+
idle_stop(terminal) {
|
|
244
|
+
if (terminal.idle !== null)
|
|
245
|
+
clearTimeout(terminal.idle);
|
|
246
|
+
terminal.idle = null;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Loads node-pty's spawn, when node-pty was built on this machine.
|
|
251
|
+
*
|
|
252
|
+
* @returns The spawn, or null when node-pty is absent or will not load.
|
|
253
|
+
*/
|
|
254
|
+
export async function ptySpawn_load() {
|
|
255
|
+
try {
|
|
256
|
+
const name = 'node-pty';
|
|
257
|
+
const module = (await import(name));
|
|
258
|
+
return module.spawn ?? module.default?.spawn ?? null;
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=terminals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminals.js","sourceRoot":"","sources":["../../src/daemon/terminals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA8C1C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAW,IAAI,GAAG,IAAI,CAAC;AAEzD,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvD,sDAAsD;AACtD,MAAM,QAAQ,GAAW,CAAC,CAAC;AAC3B,MAAM,QAAQ,GAAW,IAAI,CAAC;AAqB9B;;;;;GAKG;AACH,SAAS,UAAU,CAAC,CAAS;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,8BAA8B;AAC9B,MAAM,OAAO,SAAS;IAMS;IALZ,SAAS,GAA0B,IAAI,GAA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