@fnndsc/calypso 0.22.0 → 0.23.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/claims.d.ts +38 -0
- package/dist/daemon/claims.js +71 -0
- package/dist/daemon/claims.js.map +1 -0
- package/dist/daemon/launch.js +4 -3
- package/dist/daemon/launch.js.map +1 -1
- package/dist/daemon/server.d.ts +56 -0
- package/dist/daemon/server.js +162 -10
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/terminals.d.ts +16 -0
- package/dist/daemon/terminals.js +21 -2
- package/dist/daemon/terminals.js.map +1 -1
- package/dist/notes.json +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Surface claims: which lines a surface's own language answers for.
|
|
3
|
+
*
|
|
4
|
+
* A browser carries a language of its own (`dag %1 census on`, `desktop show`,
|
|
5
|
+
* `pane close`). It declares its subjects on attach; a subject the session
|
|
6
|
+
* also owns (`file`, `help`) comes with the verbs the surface claims from it,
|
|
7
|
+
* and every other verb of it stays the session's. A line typed in any chell
|
|
8
|
+
* whose subject is claimed is run by the surface, never by the engine: the
|
|
9
|
+
* law a-surface-never-shadows-the-session, held in one place.
|
|
10
|
+
*
|
|
11
|
+
* Matching reads a line as the surface does: the first word is the subject;
|
|
12
|
+
* for a shared subject, the second word is the verb. Only a single command is
|
|
13
|
+
* routed: a line with a pipe, a list or a redirect is the session's to run.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
/** One claimed subject: all of it, or only the verbs listed. */
|
|
18
|
+
export interface SurfaceClaim {
|
|
19
|
+
subject: string;
|
|
20
|
+
verbs?: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The claimed subject a line is in, when the line belongs to the surface.
|
|
24
|
+
*
|
|
25
|
+
* @param claims - The surface's claims.
|
|
26
|
+
* @param line - The line typed.
|
|
27
|
+
* @returns The subject, or null when the session owns the line.
|
|
28
|
+
*/
|
|
29
|
+
export declare function claim_match(claims: ReadonlyArray<SurfaceClaim>, line: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Completion candidates the claims add for a line typed so far: subjects for
|
|
32
|
+
* a first word, a shared subject's claimed verbs for a second.
|
|
33
|
+
*
|
|
34
|
+
* @param claims - Every attached surface's claims.
|
|
35
|
+
* @param linePrefix - The line up to the cursor.
|
|
36
|
+
* @returns The candidates the claims offer for the word being completed.
|
|
37
|
+
*/
|
|
38
|
+
export declare function claimCandidates_of(claims: ReadonlyArray<SurfaceClaim>, linePrefix: string): string[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Surface claims: which lines a surface's own language answers for.
|
|
3
|
+
*
|
|
4
|
+
* A browser carries a language of its own (`dag %1 census on`, `desktop show`,
|
|
5
|
+
* `pane close`). It declares its subjects on attach; a subject the session
|
|
6
|
+
* also owns (`file`, `help`) comes with the verbs the surface claims from it,
|
|
7
|
+
* and every other verb of it stays the session's. A line typed in any chell
|
|
8
|
+
* whose subject is claimed is run by the surface, never by the engine: the
|
|
9
|
+
* law a-surface-never-shadows-the-session, held in one place.
|
|
10
|
+
*
|
|
11
|
+
* Matching reads a line as the surface does: the first word is the subject;
|
|
12
|
+
* for a shared subject, the second word is the verb. Only a single command is
|
|
13
|
+
* routed: a line with a pipe, a list or a redirect is the session's to run.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
/** A line the session runs itself, whatever its first word: a pipe, a list, a redirect. */
|
|
18
|
+
const COMPOUND = /[|;&<>]/;
|
|
19
|
+
/**
|
|
20
|
+
* The claimed subject a line is in, when the line belongs to the surface.
|
|
21
|
+
*
|
|
22
|
+
* @param claims - The surface's claims.
|
|
23
|
+
* @param line - The line typed.
|
|
24
|
+
* @returns The subject, or null when the session owns the line.
|
|
25
|
+
*/
|
|
26
|
+
export function claim_match(claims, line) {
|
|
27
|
+
const trimmed = line.trim();
|
|
28
|
+
if (trimmed === '' || COMPOUND.test(trimmed))
|
|
29
|
+
return null;
|
|
30
|
+
const words = trimmed.split(/\s+/);
|
|
31
|
+
const subject = (words[0] ?? '').toLowerCase();
|
|
32
|
+
const claim = claims.find((one) => one.subject.toLowerCase() === subject);
|
|
33
|
+
if (claim === undefined)
|
|
34
|
+
return null;
|
|
35
|
+
if (claim.verbs !== undefined && !claim.verbs.map((verb) => verb.toLowerCase()).includes((words[1] ?? '').toLowerCase()))
|
|
36
|
+
return null;
|
|
37
|
+
return subject;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Completion candidates the claims add for a line typed so far: subjects for
|
|
41
|
+
* a first word, a shared subject's claimed verbs for a second.
|
|
42
|
+
*
|
|
43
|
+
* @param claims - Every attached surface's claims.
|
|
44
|
+
* @param linePrefix - The line up to the cursor.
|
|
45
|
+
* @returns The candidates the claims offer for the word being completed.
|
|
46
|
+
*/
|
|
47
|
+
export function claimCandidates_of(claims, linePrefix) {
|
|
48
|
+
if (COMPOUND.test(linePrefix))
|
|
49
|
+
return [];
|
|
50
|
+
const words = linePrefix.replace(/^\s+/, '').split(/\s+/);
|
|
51
|
+
const offered = new Set();
|
|
52
|
+
if (words.length === 1) {
|
|
53
|
+
const typed = (words[0] ?? '').toLowerCase();
|
|
54
|
+
for (const claim of claims)
|
|
55
|
+
if (claim.subject.toLowerCase().startsWith(typed))
|
|
56
|
+
offered.add(claim.subject);
|
|
57
|
+
}
|
|
58
|
+
else if (words.length === 2) {
|
|
59
|
+
const subject = (words[0] ?? '').toLowerCase();
|
|
60
|
+
const typed = (words[1] ?? '').toLowerCase();
|
|
61
|
+
for (const claim of claims) {
|
|
62
|
+
if (claim.subject.toLowerCase() !== subject || claim.verbs === undefined)
|
|
63
|
+
continue;
|
|
64
|
+
for (const verb of claim.verbs)
|
|
65
|
+
if (verb.toLowerCase().startsWith(typed))
|
|
66
|
+
offered.add(verb);
|
|
67
|
+
}
|
|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/dist/daemon/launch.js
CHANGED
|
@@ -224,9 +224,10 @@ export async function daemon_launch(engine, beforeListen, options = {}) {
|
|
|
224
224
|
berth_write(berth);
|
|
225
225
|
// Terminals: a browser's console as a chell under a pty, attached back
|
|
226
226
|
// over loopback (or the one address bound, when that is not a wildcard).
|
|
227
|
-
// A machine where node-pty did not build offers none; its surfaces
|
|
228
|
-
//
|
|
229
|
-
|
|
227
|
+
// A machine where node-pty did not build offers none; its surfaces fall
|
|
228
|
+
// back to the transcript console (deprecated). CALYPSO_NO_PTY=1 makes a
|
|
229
|
+
// daemon that machine, so the fallback can be exercised where a pty builds.
|
|
230
|
+
const ptySpawn = process.env['CALYPSO_NO_PTY'] === '1' ? null : await ptySpawn_load();
|
|
230
231
|
if (ptySpawn !== null) {
|
|
231
232
|
const terminalHost = bindHost === '0.0.0.0' ? '127.0.0.1' : bindHost;
|
|
232
233
|
daemon.terminals_set(new Terminals({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../src/daemon/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,mBAAmB,EAAqB,MAAM,aAAa,CAAC;AAC9H,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5C,OAAO,EAAE,WAAW,EAAsC,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAAE,kBA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C,CAAC,CAAC,UAAU,WAAW,IAAI,IAAI,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI;QACnF,MAAM;QACN,WAAW;QACX,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/daemon/server.d.ts
CHANGED
|
@@ -201,6 +201,14 @@ export declare class CalypsoDaemon {
|
|
|
201
201
|
/** The downloads this daemon is serving, for their progress (downloads.ts). */
|
|
202
202
|
private readonly downloads;
|
|
203
203
|
private readonly edits;
|
|
204
|
+
/** Lines run by a surface's own language, by the surface that claims them. */
|
|
205
|
+
private readonly surfaceLines;
|
|
206
|
+
/** Each surface's terminal viewer: which terminals it draws. */
|
|
207
|
+
private readonly viewerOf;
|
|
208
|
+
/** The browser that last did something: the one a claimed line goes to when no terminal of its own typed it. */
|
|
209
|
+
private browserActive;
|
|
210
|
+
/** Subjects a surface claimed whole this session, so a line in one is refused by name when none is attached. */
|
|
211
|
+
private readonly claimedSeen;
|
|
204
212
|
private readonly deliveries;
|
|
205
213
|
/**
|
|
206
214
|
* @param options - The engine to host, the attach token, the bind address,
|
|
@@ -316,6 +324,54 @@ export declare class CalypsoDaemon {
|
|
|
316
324
|
* @param socket - The connected surface.
|
|
317
325
|
*/
|
|
318
326
|
private connection_handle;
|
|
327
|
+
/**
|
|
328
|
+
* The surface that acts for the running command: the one that issued it,
|
|
329
|
+
* except a browser's terminal, whose chell runs on this daemon's host. A
|
|
330
|
+
* shell, a pipe segment, an editor or a delivered file asked of a
|
|
331
|
+
* terminal's chell would happen on the daemon host (a browser handed a
|
|
332
|
+
* host shell, a download written to the host's disk), so they go to the
|
|
333
|
+
* browser that owns the terminal, which does them its own way or refuses
|
|
334
|
+
* by name. Its questions stay with the chell, answered in the terminal.
|
|
335
|
+
*
|
|
336
|
+
* @returns The acting surface, or null when no command runs or the
|
|
337
|
+
* terminal's browser has gone.
|
|
338
|
+
*/
|
|
339
|
+
private surfaceActing;
|
|
340
|
+
/**
|
|
341
|
+
* The surface that runs a line in its own language: the browser whose
|
|
342
|
+
* terminal typed it, else the browser that last did something, else any
|
|
343
|
+
* that claims the subject. 'absent' when the subject is a surface's but no
|
|
344
|
+
* surface that claims it is attached; null when the session owns the line.
|
|
345
|
+
*
|
|
346
|
+
* @param origin - The surface the line came from.
|
|
347
|
+
* @param line - The line.
|
|
348
|
+
* @returns The claimant, 'absent', or null.
|
|
349
|
+
*/
|
|
350
|
+
private claimant_for;
|
|
351
|
+
/**
|
|
352
|
+
* Runs a line in a surface's own language, and answers the surface that
|
|
353
|
+
* typed it with what the language said.
|
|
354
|
+
*
|
|
355
|
+
* @param origin - The surface that typed the line.
|
|
356
|
+
* @param message - The execute request.
|
|
357
|
+
* @param claimant - The surface that runs it, or 'absent'.
|
|
358
|
+
*/
|
|
359
|
+
private surfaceLine_run;
|
|
360
|
+
/**
|
|
361
|
+
* The terminals a surface draws.
|
|
362
|
+
*
|
|
363
|
+
* @param surface - The surface.
|
|
364
|
+
* @returns Their ids; none for a surface that draws no terminal.
|
|
365
|
+
*/
|
|
366
|
+
private terminalsOf;
|
|
367
|
+
/**
|
|
368
|
+
* Carries a browser's note to its consoles: the chell of every terminal it
|
|
369
|
+
* draws prints it above the line being typed.
|
|
370
|
+
*
|
|
371
|
+
* @param viewer - The browser's terminal viewer.
|
|
372
|
+
* @param text - The note.
|
|
373
|
+
*/
|
|
374
|
+
private note_relay;
|
|
319
375
|
/**
|
|
320
376
|
* Relays a cancellation request only to the surface's own foreground command.
|
|
321
377
|
*
|
package/dist/daemon/server.js
CHANGED
|
@@ -33,6 +33,7 @@ import { RequestBroker } from './broker.js';
|
|
|
33
33
|
import { CONTRACT_VERSION } from '@fnndsc/menu';
|
|
34
34
|
import { clientMessage_parse, attach_parse } from '@fnndsc/menu';
|
|
35
35
|
import { Lane } from './lane.js';
|
|
36
|
+
import { claim_match, claimCandidates_of } from './claims.js';
|
|
36
37
|
import { DownloadLedger, downloadId_valid } from './downloads.js';
|
|
37
38
|
/**
|
|
38
39
|
* The largest file `POST /vfs` will take, in bytes.
|
|
@@ -126,6 +127,14 @@ export class CalypsoDaemon {
|
|
|
126
127
|
/** The downloads this daemon is serving, for their progress (downloads.ts). */
|
|
127
128
|
downloads = new DownloadLedger();
|
|
128
129
|
edits = new RequestBroker('e', 'surface disconnected before returning the edit');
|
|
130
|
+
/** Lines run by a surface's own language, by the surface that claims them. */
|
|
131
|
+
surfaceLines = new RequestBroker('l', 'the surface that answers for this line went away before answering');
|
|
132
|
+
/** Each surface's terminal viewer: which terminals it draws. */
|
|
133
|
+
viewerOf = new Map();
|
|
134
|
+
/** The browser that last did something: the one a claimed line goes to when no terminal of its own typed it. */
|
|
135
|
+
browserActive = null;
|
|
136
|
+
/** Subjects a surface claimed whole this session, so a line in one is refused by name when none is attached. */
|
|
137
|
+
claimedSeen = new Set();
|
|
129
138
|
deliveries = new RequestBroker('d', 'surface disconnected before the file was delivered');
|
|
130
139
|
/**
|
|
131
140
|
* @param options - The engine to host, the attach token, the bind address,
|
|
@@ -552,6 +561,7 @@ export class CalypsoDaemon {
|
|
|
552
561
|
const viewer = {
|
|
553
562
|
data: (terminalId, data) => this.send(socket, { type: 'terminalData', terminalId, data }),
|
|
554
563
|
exit: (terminalId, code) => this.send(socket, { type: 'terminalExit', terminalId, code }),
|
|
564
|
+
owner: () => surface,
|
|
555
565
|
};
|
|
556
566
|
// A front that holds the token for a browser — the porter — puts it on
|
|
557
567
|
// the upgrade URL it proxies, the way `/vfs?token=` already travels; the
|
|
@@ -569,6 +579,8 @@ export class CalypsoDaemon {
|
|
|
569
579
|
}
|
|
570
580
|
if (!surface) {
|
|
571
581
|
surface = this.attach_handle(socket, parsed, urlToken);
|
|
582
|
+
if (surface !== null)
|
|
583
|
+
this.viewerOf.set(surface, viewer);
|
|
572
584
|
return;
|
|
573
585
|
}
|
|
574
586
|
const message = clientMessage_parse(parsed);
|
|
@@ -579,6 +591,16 @@ export class CalypsoDaemon {
|
|
|
579
591
|
const value = message.value;
|
|
580
592
|
const attached = surface;
|
|
581
593
|
if (value.type === 'execute') {
|
|
594
|
+
if (!attached.capabilities.shellCommands && attached.capabilities.claims.length > 0)
|
|
595
|
+
this.browserActive = attached;
|
|
596
|
+
// A line in a surface's own language is that surface's to run: it never
|
|
597
|
+
// reaches the engine, and needs no turn on the lane (the session is not
|
|
598
|
+
// touched by it).
|
|
599
|
+
const claimant = value.instrument === true ? null : this.claimant_for(attached, value.line);
|
|
600
|
+
if (claimant !== null) {
|
|
601
|
+
void this.surfaceLine_run(attached, value, claimant);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
582
604
|
// One lane for every surface: commands take turns, and a command
|
|
583
605
|
// waiting on a person stands aside (person_await), so a pane's own
|
|
584
606
|
// reads, or another surface's command, run while a question is open.
|
|
@@ -648,6 +670,21 @@ export class CalypsoDaemon {
|
|
|
648
670
|
else if (value.type === 'terminalClose') {
|
|
649
671
|
this.terminals?.close(viewer, value.terminalId);
|
|
650
672
|
}
|
|
673
|
+
else if (value.type === 'surfaceLineResult') {
|
|
674
|
+
this.surfaceLines.settle(socket, value.lineId, { rendered: value.rendered, status: value.status });
|
|
675
|
+
}
|
|
676
|
+
else if (value.type === 'surfaceLineError') {
|
|
677
|
+
this.surfaceLines.fail(socket, value.lineId, value.reason);
|
|
678
|
+
}
|
|
679
|
+
else if (value.type === 'note') {
|
|
680
|
+
this.note_relay(viewer, value.text);
|
|
681
|
+
}
|
|
682
|
+
else if (value.type === 'surfaceClaims') {
|
|
683
|
+
attached.capabilities.claims = value.claims;
|
|
684
|
+
for (const claim of value.claims)
|
|
685
|
+
if (claim.verbs === undefined)
|
|
686
|
+
this.claimedSeen.add(claim.subject.toLowerCase());
|
|
687
|
+
}
|
|
651
688
|
else {
|
|
652
689
|
this.send(socket, { type: 'error', reason: 'already attached' });
|
|
653
690
|
}
|
|
@@ -657,12 +694,114 @@ export class CalypsoDaemon {
|
|
|
657
694
|
this.terminals?.detach(viewer);
|
|
658
695
|
if (surface) {
|
|
659
696
|
this.surfaces.delete(surface);
|
|
697
|
+
this.viewerOf.delete(surface);
|
|
698
|
+
if (this.browserActive === surface)
|
|
699
|
+
this.browserActive = null;
|
|
660
700
|
// A detached surface holds no watches: whatever it kept live is
|
|
661
701
|
// released, and a subject nobody else watches stops being sampled.
|
|
662
702
|
this.engine.watch_release?.(surface.id);
|
|
663
703
|
}
|
|
664
704
|
});
|
|
665
705
|
}
|
|
706
|
+
/**
|
|
707
|
+
* The surface that acts for the running command: the one that issued it,
|
|
708
|
+
* except a browser's terminal, whose chell runs on this daemon's host. A
|
|
709
|
+
* shell, a pipe segment, an editor or a delivered file asked of a
|
|
710
|
+
* terminal's chell would happen on the daemon host (a browser handed a
|
|
711
|
+
* host shell, a download written to the host's disk), so they go to the
|
|
712
|
+
* browser that owns the terminal, which does them its own way or refuses
|
|
713
|
+
* by name. Its questions stay with the chell, answered in the terminal.
|
|
714
|
+
*
|
|
715
|
+
* @returns The acting surface, or null when no command runs or the
|
|
716
|
+
* terminal's browser has gone.
|
|
717
|
+
*/
|
|
718
|
+
surfaceActing() {
|
|
719
|
+
const origin = this.currentOrigin;
|
|
720
|
+
if (origin === null || origin.capabilities.terminal === undefined)
|
|
721
|
+
return origin;
|
|
722
|
+
const owner = this.terminals?.viewer_get(origin.capabilities.terminal)?.owner?.();
|
|
723
|
+
return owner !== null && owner !== undefined && this.surfaces.has(owner) ? owner : null;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* The surface that runs a line in its own language: the browser whose
|
|
727
|
+
* terminal typed it, else the browser that last did something, else any
|
|
728
|
+
* that claims the subject. 'absent' when the subject is a surface's but no
|
|
729
|
+
* surface that claims it is attached; null when the session owns the line.
|
|
730
|
+
*
|
|
731
|
+
* @param origin - The surface the line came from.
|
|
732
|
+
* @param line - The line.
|
|
733
|
+
* @returns The claimant, 'absent', or null.
|
|
734
|
+
*/
|
|
735
|
+
claimant_for(origin, line) {
|
|
736
|
+
const claiming = (surface) => surface !== null && surface !== undefined && surface !== origin && this.surfaces.has(surface) && claim_match(surface.capabilities.claims, line) !== null;
|
|
737
|
+
const owner = origin.capabilities.terminal === undefined ? null : this.terminals?.viewer_get(origin.capabilities.terminal)?.owner?.();
|
|
738
|
+
if (claiming(owner))
|
|
739
|
+
return owner;
|
|
740
|
+
if (claiming(this.browserActive))
|
|
741
|
+
return this.browserActive;
|
|
742
|
+
const any = [...this.surfaces].find((surface) => claiming(surface));
|
|
743
|
+
if (any !== undefined)
|
|
744
|
+
return any;
|
|
745
|
+
// A subject a surface claimed whole is no command of the session's: with
|
|
746
|
+
// no such surface attached, the line is refused by name, not run.
|
|
747
|
+
const subject = (line.trim().split(/\s+/)[0] ?? '').toLowerCase();
|
|
748
|
+
if (this.claimedSeen.has(subject) && claim_match([{ subject }], line) !== null)
|
|
749
|
+
return 'absent';
|
|
750
|
+
return null;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Runs a line in a surface's own language, and answers the surface that
|
|
754
|
+
* typed it with what the language said.
|
|
755
|
+
*
|
|
756
|
+
* @param origin - The surface that typed the line.
|
|
757
|
+
* @param message - The execute request.
|
|
758
|
+
* @param claimant - The surface that runs it, or 'absent'.
|
|
759
|
+
*/
|
|
760
|
+
async surfaceLine_run(origin, message, claimant) {
|
|
761
|
+
const subject = (message.line.trim().split(/\s+/)[0] ?? '').toLowerCase();
|
|
762
|
+
if (claimant === 'absent') {
|
|
763
|
+
this.send(origin.socket, { type: 'result', id: message.id, envelopes: [{ status: 'error', rendered: '', renderedErr: `${subject}: an ARGUS word; no ARGUS is attached to this session\n` }] });
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
try {
|
|
767
|
+
const answer = await this.surfaceLines.open(claimant.socket, (lineId) => {
|
|
768
|
+
this.send(claimant.socket, { type: 'surfaceLine', lineId, line: message.line, ...(origin.capabilities.terminal !== undefined ? { terminal: origin.capabilities.terminal } : {}) });
|
|
769
|
+
});
|
|
770
|
+
const rendered = answer.rendered === '' || answer.rendered.endsWith('\n') ? answer.rendered : `${answer.rendered}\n`;
|
|
771
|
+
this.send(origin.socket, { type: 'result', id: message.id, envelopes: [answer.status === 'ok' ? { status: 'ok', rendered } : { status: 'error', rendered: '', renderedErr: rendered }] });
|
|
772
|
+
}
|
|
773
|
+
catch (err) {
|
|
774
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
775
|
+
this.send(origin.socket, { type: 'result', id: message.id, envelopes: [{ status: 'error', rendered: '', renderedErr: `${subject}: ${reason}\n` }] });
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* The terminals a surface draws.
|
|
780
|
+
*
|
|
781
|
+
* @param surface - The surface.
|
|
782
|
+
* @returns Their ids; none for a surface that draws no terminal.
|
|
783
|
+
*/
|
|
784
|
+
terminalsOf(surface) {
|
|
785
|
+
const viewer = this.viewerOf.get(surface);
|
|
786
|
+
return viewer === undefined ? [] : this.terminals?.ids_of(viewer) ?? [];
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Carries a browser's note to its consoles: the chell of every terminal it
|
|
790
|
+
* draws prints it above the line being typed.
|
|
791
|
+
*
|
|
792
|
+
* @param viewer - The browser's terminal viewer.
|
|
793
|
+
* @param text - The note.
|
|
794
|
+
*/
|
|
795
|
+
note_relay(viewer, text) {
|
|
796
|
+
const owned = this.terminals?.ids_of(viewer) ?? [];
|
|
797
|
+
if (owned.length === 0)
|
|
798
|
+
return;
|
|
799
|
+
for (const surface of this.surfaces) {
|
|
800
|
+
if (surface.capabilities.terminal !== undefined && owned.includes(surface.capabilities.terminal)) {
|
|
801
|
+
this.send(surface.socket, { type: 'consoleNote', text });
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
666
805
|
/**
|
|
667
806
|
* Relays a cancellation request only to the surface's own foreground command.
|
|
668
807
|
*
|
|
@@ -714,9 +853,14 @@ export class CalypsoDaemon {
|
|
|
714
853
|
fileDelivery: attach.value.capabilities?.fileDelivery ?? false,
|
|
715
854
|
localFilesystem: attach.value.capabilities?.localFilesystem ?? false,
|
|
716
855
|
color: attach.value.capabilities?.color ?? false,
|
|
856
|
+
claims: attach.value.capabilities?.claims ?? [],
|
|
857
|
+
...(attach.value.capabilities?.terminal !== undefined ? { terminal: attach.value.capabilities.terminal } : {}),
|
|
717
858
|
},
|
|
718
859
|
};
|
|
719
860
|
this.surfaces.add(surface);
|
|
861
|
+
for (const claim of surface.capabilities.claims)
|
|
862
|
+
if (claim.verbs === undefined)
|
|
863
|
+
this.claimedSeen.add(claim.subject.toLowerCase());
|
|
720
864
|
this.send(socket, {
|
|
721
865
|
type: 'attached',
|
|
722
866
|
session: this.sessionId,
|
|
@@ -851,14 +995,19 @@ export class CalypsoDaemon {
|
|
|
851
995
|
* @param origin - The surface that produced the envelope.
|
|
852
996
|
* @param envelope - The envelope to publish.
|
|
853
997
|
*/
|
|
854
|
-
bus_publish(origin, envelope) {
|
|
998
|
+
bus_publish(origin, envelope, mirrored = false) {
|
|
855
999
|
this.scrollback.push({ surface: origin.id, envelope });
|
|
856
1000
|
if (this.scrollback.length > this.scrollbackSize) {
|
|
857
1001
|
this.scrollback.splice(0, this.scrollback.length - this.scrollbackSize);
|
|
858
1002
|
}
|
|
1003
|
+
// A browser that mirrors a command into its own consoles has shown it
|
|
1004
|
+
// there already: their chells are skipped, every other surface hears it.
|
|
1005
|
+
const shown = mirrored ? this.terminalsOf(origin) : [];
|
|
859
1006
|
for (const surface of this.surfaces) {
|
|
1007
|
+
if (surface.capabilities.terminal !== undefined && shown.includes(surface.capabilities.terminal))
|
|
1008
|
+
continue;
|
|
860
1009
|
if (surface !== origin) {
|
|
861
|
-
this.send(surface.socket, { type: 'session', surface: origin.id, envelope });
|
|
1010
|
+
this.send(surface.socket, { type: 'session', surface: origin.id, envelope, ...(origin.capabilities.terminal !== undefined ? { terminal: origin.capabilities.terminal } : {}) });
|
|
862
1011
|
}
|
|
863
1012
|
}
|
|
864
1013
|
}
|
|
@@ -908,7 +1057,7 @@ export class CalypsoDaemon {
|
|
|
908
1057
|
// operator actually did.
|
|
909
1058
|
if (message.instrument !== true) {
|
|
910
1059
|
for (const envelope of envelopes) {
|
|
911
|
-
this.bus_publish(origin, envelope);
|
|
1060
|
+
this.bus_publish(origin, envelope, message.mirrored === true);
|
|
912
1061
|
}
|
|
913
1062
|
}
|
|
914
1063
|
}
|
|
@@ -1071,7 +1220,7 @@ export class CalypsoDaemon {
|
|
|
1071
1220
|
* @throws {Error} When no command is executing or the surface disconnects.
|
|
1072
1221
|
*/
|
|
1073
1222
|
pipe_current(command, input) {
|
|
1074
|
-
const origin = this.
|
|
1223
|
+
const origin = this.surfaceActing();
|
|
1075
1224
|
if (!origin) {
|
|
1076
1225
|
return Promise.reject(new Error('no active command to run a pipe segment for'));
|
|
1077
1226
|
}
|
|
@@ -1088,7 +1237,7 @@ export class CalypsoDaemon {
|
|
|
1088
1237
|
* @throws {Error} When no command is executing or the surface disconnects.
|
|
1089
1238
|
*/
|
|
1090
1239
|
shell_current(command) {
|
|
1091
|
-
const origin = this.
|
|
1240
|
+
const origin = this.surfaceActing();
|
|
1092
1241
|
if (!origin) {
|
|
1093
1242
|
return Promise.reject(new Error('no active command to run a shell command for'));
|
|
1094
1243
|
}
|
|
@@ -1114,7 +1263,7 @@ export class CalypsoDaemon {
|
|
|
1114
1263
|
* @throws {Error} When no command is executing or the surface disconnects.
|
|
1115
1264
|
*/
|
|
1116
1265
|
edit_current(content, extension, path) {
|
|
1117
|
-
const origin = this.
|
|
1266
|
+
const origin = this.surfaceActing();
|
|
1118
1267
|
if (!origin) {
|
|
1119
1268
|
return Promise.reject(new Error('no active command to edit for'));
|
|
1120
1269
|
}
|
|
@@ -1146,11 +1295,11 @@ export class CalypsoDaemon {
|
|
|
1146
1295
|
}));
|
|
1147
1296
|
}
|
|
1148
1297
|
capabilities_current() {
|
|
1149
|
-
const origin = this.
|
|
1298
|
+
const origin = this.surfaceActing();
|
|
1150
1299
|
return origin ? {
|
|
1151
1300
|
fileDelivery: origin.capabilities.fileDelivery,
|
|
1152
1301
|
localFilesystem: origin.capabilities.localFilesystem,
|
|
1153
|
-
color: origin.capabilities.color,
|
|
1302
|
+
color: this.currentOrigin?.capabilities.color ?? origin.capabilities.color,
|
|
1154
1303
|
} : null;
|
|
1155
1304
|
}
|
|
1156
1305
|
/**
|
|
@@ -1168,7 +1317,7 @@ export class CalypsoDaemon {
|
|
|
1168
1317
|
* @throws {Error} When no command is executing or the surface disconnects.
|
|
1169
1318
|
*/
|
|
1170
1319
|
deliver_current(request) {
|
|
1171
|
-
const origin = this.
|
|
1320
|
+
const origin = this.surfaceActing();
|
|
1172
1321
|
if (!origin) {
|
|
1173
1322
|
return Promise.reject(new Error('no active command to deliver a file for'));
|
|
1174
1323
|
}
|
|
@@ -1197,11 +1346,14 @@ export class CalypsoDaemon {
|
|
|
1197
1346
|
async complete_run(socket, message) {
|
|
1198
1347
|
try {
|
|
1199
1348
|
const result = await this.engine.line_complete(message.prefix);
|
|
1349
|
+
// The surfaces' own subjects and claimed verbs complete like any command.
|
|
1350
|
+
const claims = [...this.surfaces].flatMap((each) => each.capabilities.claims);
|
|
1351
|
+
const offered = claimCandidates_of(claims, message.prefix).filter((word) => !result.candidates.includes(word));
|
|
1200
1352
|
this.send(socket, {
|
|
1201
1353
|
type: 'complete',
|
|
1202
1354
|
id: message.id,
|
|
1203
1355
|
prefix: result.prefix,
|
|
1204
|
-
candidates: result.candidates,
|
|
1356
|
+
candidates: [...result.candidates, ...offered],
|
|
1205
1357
|
});
|
|
1206
1358
|
}
|
|
1207
1359
|
catch (err) {
|