@fnndsc/calypso 0.29.15 → 0.30.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.
Files changed (79) hide show
  1. package/dist/calypso.js +19 -8
  2. package/dist/calypso.js.map +1 -1
  3. package/dist/daemon/attachFile.d.ts +26 -19
  4. package/dist/daemon/attachFile.js +42 -51
  5. package/dist/daemon/attachFile.js.map +1 -1
  6. package/dist/daemon/attachOrigin.d.ts +69 -0
  7. package/dist/daemon/attachOrigin.js +125 -0
  8. package/dist/daemon/attachOrigin.js.map +1 -0
  9. package/dist/daemon/berth.d.ts +265 -26
  10. package/dist/daemon/berth.js +521 -158
  11. package/dist/daemon/berth.js.map +1 -1
  12. package/dist/daemon/claims.js +19 -9
  13. package/dist/daemon/claims.js.map +1 -1
  14. package/dist/daemon/commandLane.d.ts +317 -0
  15. package/dist/daemon/commandLane.js +409 -0
  16. package/dist/daemon/commandLane.js.map +1 -0
  17. package/dist/daemon/console.d.ts +0 -2
  18. package/dist/daemon/console.js +7 -10
  19. package/dist/daemon/console.js.map +1 -1
  20. package/dist/daemon/consoleSession.js +4 -1
  21. package/dist/daemon/consoleSession.js.map +1 -1
  22. package/dist/daemon/elevation.d.ts +0 -3
  23. package/dist/daemon/elevation.js +1 -3
  24. package/dist/daemon/elevation.js.map +1 -1
  25. package/dist/daemon/face.d.ts +18 -4
  26. package/dist/daemon/face.js +77 -32
  27. package/dist/daemon/face.js.map +1 -1
  28. package/dist/daemon/hostControl.d.ts +114 -1
  29. package/dist/daemon/hostControl.js +104 -4
  30. package/dist/daemon/hostControl.js.map +1 -1
  31. package/dist/daemon/hostPtyRelay.d.ts +118 -0
  32. package/dist/daemon/hostPtyRelay.js +186 -0
  33. package/dist/daemon/hostPtyRelay.js.map +1 -0
  34. package/dist/daemon/httpRoutes.d.ts +257 -0
  35. package/dist/daemon/httpRoutes.js +537 -0
  36. package/dist/daemon/httpRoutes.js.map +1 -0
  37. package/dist/daemon/instance.d.ts +37 -0
  38. package/dist/daemon/instance.js +59 -0
  39. package/dist/daemon/instance.js.map +1 -0
  40. package/dist/daemon/launch.d.ts +17 -0
  41. package/dist/daemon/launch.js +198 -194
  42. package/dist/daemon/launch.js.map +1 -1
  43. package/dist/daemon/launchBanner.d.ts +76 -0
  44. package/dist/daemon/launchBanner.js +80 -0
  45. package/dist/daemon/launchBanner.js.map +1 -0
  46. package/dist/daemon/rival.d.ts +65 -0
  47. package/dist/daemon/rival.js +67 -0
  48. package/dist/daemon/rival.js.map +1 -0
  49. package/dist/daemon/server.d.ts +104 -190
  50. package/dist/daemon/server.js +358 -866
  51. package/dist/daemon/server.js.map +1 -1
  52. package/dist/daemon/settings.d.ts +42 -0
  53. package/dist/daemon/settings.js +43 -0
  54. package/dist/daemon/settings.js.map +1 -0
  55. package/dist/daemon/surface.d.ts +103 -0
  56. package/dist/daemon/surface.js +71 -0
  57. package/dist/daemon/surface.js.map +1 -0
  58. package/dist/daemon/surfaceReplies.d.ts +109 -0
  59. package/dist/daemon/surfaceReplies.js +108 -0
  60. package/dist/daemon/surfaceReplies.js.map +1 -0
  61. package/dist/daemon/terminals.js +5 -2
  62. package/dist/daemon/terminals.js.map +1 -1
  63. package/dist/daemon/token.d.ts +41 -5
  64. package/dist/daemon/token.js +43 -12
  65. package/dist/daemon/token.js.map +1 -1
  66. package/dist/daemon/uploadHold.d.ts +85 -0
  67. package/dist/daemon/uploadHold.js +205 -0
  68. package/dist/daemon/uploadHold.js.map +1 -0
  69. package/dist/daemon/vfsHeaders.d.ts +11 -0
  70. package/dist/daemon/vfsHeaders.js +60 -0
  71. package/dist/daemon/vfsHeaders.js.map +1 -0
  72. package/dist/index.d.ts +5 -5
  73. package/dist/index.js +3 -4
  74. package/dist/index.js.map +1 -1
  75. package/dist/notes.json +1 -1
  76. package/package.json +9 -4
  77. package/dist/daemon/discovery.d.ts +0 -23
  78. package/dist/daemon/discovery.js +0 -57
  79. package/dist/daemon/discovery.js.map +0 -1
@@ -70,4 +70,21 @@ export interface DaemonLaunchOptions {
70
70
  */
71
71
  surfaceLaunch?: SurfaceLaunch;
72
72
  }
73
+ /**
74
+ * Starts the daemon over an engine and advertises it for same-user discovery.
75
+ *
76
+ * @param engine - The engine to host (already created and connected by boot).
77
+ * @param beforeListen - Optional host preparation run after the duplicate guard
78
+ * and before the socket binds or the berth is published. It holds the berth
79
+ * file, which a door waits on, so it is the boot gate alone: a warm-up a
80
+ * surface can work beside runs after this resolves, with the daemon answering.
81
+ * @param options - What the launcher decided beyond the engine.
82
+ * @returns The launched daemon's addresses and handle, once it is listening;
83
+ * the process then stays alive on the WebSocket server.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const info: DaemonLaunchInfo = await daemon_launch(engine, warmup_gate, { hostControl });
88
+ * ```
89
+ */
73
90
  export declare function daemon_launch(engine: BrasaEngine, beforeListen?: () => Promise<void>, options?: DaemonLaunchOptions): Promise<DaemonLaunchInfo>;
@@ -18,14 +18,17 @@ import { CalypsoDaemon } from './server.js';
18
18
  import { bundledWebRoot_find, webRoot_resolve, webRootBuild_read, webRootVersion_read } from './static.js';
19
19
  import { hostFqdn_get } from './host.js';
20
20
  import { codeWatch_start } from './codeIdentity.js';
21
- import { token_generate } from './token.js';
22
- import { backend_get } from '@fnndsc/brasa/core';
23
- import { stackBanner_rows, stackBannerRow_paint, versions_get, versions_selectForBackend, buildHash_get } from '@fnndsc/brasa/core';
24
- import { identity_normalise, berth_write, berthOwn_read, berth_path, berthUrl_isAlive, closing_take } from './berth.js';
25
- import { attachFile_write, attachFile_remove } from './attachFile.js';
21
+ import { token_generate, tokenWords_say } from './token.js';
22
+ import { backend_get, builtinCommand_names } from '@fnndsc/brasa/core';
23
+ import { stackBanner_rows, versions_get, versions_selectForBackend, buildHash_get } from '@fnndsc/brasa/core';
24
+ import { identity_normalise, berth_write, berth_path, probeKey_generate, closing_take } from './berth.js';
25
+ import { attachFile_write, attachNote_lines } from './attachFile.js';
26
26
  import { CHELL_ON_PATH, chellLaunch_find } from './consoleSession.js';
27
27
  import { Terminals, ptySpawn_load } from './terminals.js';
28
- import { HOST_CONTROL_OFF, hostControl_describe, hostControl_guard, hostControl_tiers, hostPipe_run, hostShell_run, hostShellTerminal_refusal } from './hostControl.js';
28
+ import { HOST_CONTROL_OFF, daemonCapabilities_compose, pipeSegment_run, hostControl_guard, hostControl_tiers, hostShell_run, hostShellTerminal_refusal } from './hostControl.js';
29
+ import { rival_read, rivalRefusal_lines } from './rival.js';
30
+ import { launchBanner_lines } from './launchBanner.js';
31
+ import { BIND_ENV, NO_PTY_ENV, WEB_ROOT_ENV } from './settings.js';
29
32
  /** The daemon sink forwards live command output to the executing surface. */
30
33
  export class DaemonSink {
31
34
  daemon;
@@ -66,29 +69,7 @@ export function daemonSurface_create(daemon, policy = HOST_CONTROL_OFF) {
66
69
  // would either archive a directory a shell wanted whole or hand a browser
67
70
  // a tree it cannot hold.
68
71
  get capabilities() {
69
- const attached = daemon.capabilities_current();
70
- return {
71
- hiddenInput: true,
72
- localEdit: true,
73
- tty: true,
74
- // Colour follows the executing surface: a colour terminal or a browser
75
- // console renders ANSI, a bare pipe does not.
76
- color: attached?.color ?? false,
77
- // A segment runs on this host under host control, else on the acting
78
- // surface: a chell runs one, a browser none. Said truly, a builtin
79
- // that would hand text to a system program answers in the kernel instead.
80
- pipeSegments: policy.tiers.has('pipes') || (attached?.pipeSegments ?? false),
81
- shellCommands: true,
82
- fileDelivery: attached?.fileDelivery ?? false,
83
- // The daemon's disk belongs to nobody attending this session — unless
84
- // the operator who started it declared otherwise with the `files`
85
- // tier of --host-control, in which case it is theirs by declaration.
86
- engineFilesystem: policy.tiers.has('files'),
87
- localFilesystem: attached?.localFilesystem ?? false,
88
- // Long jobs that change things beyond this host, and bill: only the
89
- // operator who started the daemon grants them, never a surface.
90
- tasks: policy.tiers.has('tasks') || (attached?.tasks ?? false),
91
- };
72
+ return daemonCapabilities_compose(daemon.capabilities_current(), policy);
92
73
  },
93
74
  peers: () => daemon.surfaces_list(),
94
75
  prompt: (request) => daemon.prompt_current({
@@ -97,11 +78,13 @@ export function daemonSurface_create(daemon, policy = HOST_CONTROL_OFF) {
97
78
  ...(request.wants === undefined ? {} : { wants: request.wants }),
98
79
  ...(request.path === undefined ? {} : { path: request.path }),
99
80
  ...(request.commit === undefined ? {} : { commit: request.commit }),
81
+ ...(request.purpose === undefined ? {} : { purpose: request.purpose }),
82
+ ...(request.subject === undefined ? {} : { subject: request.subject }),
100
83
  }),
101
84
  // Under host control the host wins: the segment or the shell runs here,
102
85
  // output on the session bus like any command's. Otherwise both relay to
103
86
  // the surface that typed them.
104
- pipeSegment: (command, input, signal) => policy.tiers.has('pipes') ? hostPipe_run(command, input, signal) : daemon.pipe_current(command, input),
87
+ pipeSegment: (command, input, signal) => pipeSegment_run(policy, command, input, (segment, bytes) => daemon.pipe_current(segment, bytes), signal),
105
88
  // A terminal's chell is on this host: under host control it runs `!` in
106
89
  // its own pty, so a full-screen program gets a terminal (#1096). A
107
90
  // surface that is a terminal elsewhere (a remote chell in ssh) gets a pty
@@ -120,7 +103,7 @@ export function daemonSurface_create(daemon, policy = HOST_CONTROL_OFF) {
120
103
  return Promise.reject(new Error(refusal));
121
104
  return hostShell_run(command, (channel, chunk) => { daemon.output_current(channel, chunk); }, signal);
122
105
  },
123
- localEdit: (request) => daemon.edit_current(request.content, request.extension, request.path),
106
+ localEdit: (request) => daemon.edit_current(request.content, request.extension, request.path, request.named),
124
107
  fileDeliver: (request) => daemon.deliver_current(request),
125
108
  // A command following a task waits out of the lane, so the session runs other lines meanwhile.
126
109
  aside: (waiting) => daemon.aside_current(waiting),
@@ -128,17 +111,6 @@ export function daemonSurface_create(daemon, policy = HOST_CONTROL_OFF) {
128
111
  hold: (holds) => daemon.hold_take(holds),
129
112
  };
130
113
  }
131
- /**
132
- * Starts the daemon over an engine and advertises it for same-user discovery.
133
- *
134
- * @param engine - The engine to host (already created and connected by boot).
135
- * @param beforeListen - Optional host preparation run after the duplicate guard
136
- * and before the socket binds or the berth is published. It holds the berth
137
- * file, which a door waits on, so it is the boot gate alone: a warm-up a
138
- * surface can work beside runs after this resolves, with the daemon answering.
139
- * @returns The launched daemon's addresses and handle, once it is listening;
140
- * the process then stays alive on the WebSocket server.
141
- */
142
114
  /**
143
115
  * The daemon's prompt provider: the backend's prompt context for the last
144
116
  * command, with the host-control tiers this daemon declares.
@@ -155,65 +127,34 @@ function promptProvider_wrap(prompt, hostControl) {
155
127
  ...(hostControl.tiers.size > 0 ? { hostControl: hostControl_tiers(hostControl) } : {}),
156
128
  });
157
129
  }
158
- export async function daemon_launch(engine, beforeListen, options = {}) {
159
- // Force color into the engine's rendered text: no TTY here to auto-detect.
160
- if (chalk.level < 1) {
161
- chalk.level = 3;
162
- }
163
- // Key the berth by the identity this daemon hosts, so several daemons —
164
- // one per identity — can advertise on one machine. A daemon with no restored
165
- // session (disconnected standalone start) has the backend's disconnected
166
- // identity, so it stays discoverable.
167
- const backend = backend_get();
168
- const sessionIdentity = await backend.session.identity_get();
169
- const identity = identity_normalise(sessionIdentity.user, sessionIdentity.where);
170
- // Guard against a split-brain second daemon for this identity: if one is
171
- // already live, point the operator at it and refuse rather than host a rival
172
- // and orphan the running one's berth. This covers both launch paths (chell
173
- // --daemon and the standalone calypso binary), since both land here.
174
- const existing = berthOwn_read(identity);
175
- if (existing && (await berthUrl_isAlive(existing.url))) {
176
- const attachHint = sessionIdentity.connected ? ` ${identity}` : '';
177
- console.error(chalk.red(`[!] Calypso is already running for ${identity} at ${existing.url}`));
178
- console.error(chalk.gray(` attach with: chell --remote${attachHint}`));
179
- process.exit(1);
180
- }
181
- if (beforeListen) {
182
- await beforeListen();
183
- }
184
- const token = token_generate();
185
- // The web surface is served from the same port as the wire when a built
186
- // bundle is found: an explicit CALYPSO_WEB_ROOT wins, then the working
187
- // directory, then the checkout enclosing this module — so a dev-tree
188
- // `chell --daemon` serves the surface from any directory, with no
189
- // configuration at all — and last the bundle the launcher found (an
190
- // installed ARGUS, for somebody who installed rather than cloned).
191
- const webRoot = webRoot_resolve([
192
- process.env['CALYPSO_WEB_ROOT'],
130
+ /**
131
+ * Where the web surface is served from, when a built bundle is found: an explicit CALYPSO_WEB_ROOT wins, then the
132
+ * working directory, then the checkout enclosing this module — so a dev-tree `chell --daemon` serves the surface
133
+ * from any directory, with no configuration at all — and last the bundle the launcher found (an installed ARGUS,
134
+ * for somebody who installed rather than cloned).
135
+ *
136
+ * @param options - What the launcher decided; its `webRoot` is the bundle it found, read after the rest.
137
+ * @returns The web root, or null when none is found.
138
+ */
139
+ function launchWebRoot_resolve(options) {
140
+ return webRoot_resolve([
141
+ process.env[WEB_ROOT_ENV],
193
142
  path.join(process.cwd(), 'apps', 'argus', 'dist'),
194
143
  bundledWebRoot_find() ?? undefined,
195
144
  options.webRoot ?? undefined,
196
145
  ]);
197
- // Loopback is the posture; CALYPSO_BIND is a deliberate, per-launch
198
- // opt-out for demos on a trusted network. The attach token still gates
199
- // every session, but the web bundle and the wire become reachable from
200
- // any host that can route here.
201
- const bindHost = process.env['CALYPSO_BIND'] ?? '127.0.0.1';
202
- const hostControl = options.hostControl ?? HOST_CONTROL_OFF;
203
- const refusal = hostControl_guard(hostControl, bindHost);
204
- if (refusal !== null) {
205
- console.error(chalk.red(`[!] ${refusal}`));
206
- process.exit(1);
207
- }
208
- // The page this kernel starts beside, remembered now: a bundle rebuilt on
209
- // disk later is served fresh while this process keeps its old code, and a
210
- // surface compares its own stamp against this one to say so.
211
- const surfaceBuild = webRoot !== null ? webRootBuild_read(webRoot) : null;
212
- // The daemon's own code, fingerprinted now: read again on a slow clock and
213
- // on every attach, and the answer pushed when it flips.
214
- let codeWatch = null;
215
- const elevation = elevation_read(process.env);
216
- const daemon = new CalypsoDaemon({
146
+ }
147
+ /**
148
+ * Makes the daemon over an engine, with what the launcher decided.
149
+ *
150
+ * @param engine - The engine to host.
151
+ * @param facts - What the daemon is made with.
152
+ * @param codeCheck - Reads the daemon's own code on disk again, on each attach.
153
+ * @returns The daemon, not yet listening.
154
+ */
155
+ function launchDaemon_make(engine, facts, codeCheck) {
156
+ const { token, bindHost, webRoot, backend, hostControl, surfaceBuild, elevation } = facts;
157
+ return new CalypsoDaemon({
217
158
  engine,
218
159
  token,
219
160
  host: bindHost,
@@ -230,123 +171,186 @@ export async function daemon_launch(engine, beforeListen, options = {}) {
230
171
  // The stack the session is made of: ChRIS's packages only for a ChRIS session.
231
172
  stack: { ...versions_selectForBackend(versions_get(), backend.id), build: buildHash_get(), ...(surfaceBuild !== null ? { surface: surfaceBuild } : {}) },
232
173
  hostControl: hostControl_tiers(hostControl),
174
+ // The words the engine runs itself, so an attached chell grants a pipeline's host segments as the engine routes them.
175
+ engineCommands_list: () => builtinCommand_names(),
233
176
  // The door this session can be raised at with the person's password, when its host named one (D14).
234
177
  ...(elevation !== null ? { elevation } : {}),
235
- codeCheck: () => { void codeWatch?.check().catch(() => undefined); },
178
+ codeCheck,
236
179
  });
237
- if (elevation !== null)
238
- console.log(chalk.gray(` MANAGE by password: ${elevation.user} may raise a surface of this session with their ChRIS password`));
239
- codeWatch = await codeWatch_start((stale) => daemon.stale_set(stale)).catch(() => null);
240
- // The engine takes its sink and its surface through its own seam: output
241
- // relays to the attached surfaces, and prompts, pipes, the shell and edits
242
- // reach them (or this host, where a host-control tier allows).
243
- engine.sink_install(new DaemonSink(daemon));
244
- engine.surface_install(daemonSurface_create(daemon, hostControl));
245
- // Jobs that were running when the daemon last stopped go on, or say why not.
246
- const resumed = engine.jobs_resume?.() ?? 0;
247
- const port = await daemon.start();
248
- // The berth records where this daemon can actually be reached. Loopback is
249
- // right for the ordinary case and wrong the moment CALYPSO_BIND opens the
250
- // wire to the network: a berth copied to another machine, or an address
251
- // pasted into `chell --remote --attach`, has to name a host that resolves
252
- // from somewhere else.
253
- // Every address printed or written below names this host once, and by
254
- // its fully qualified name: a wildcard bind has no routable form, and the
255
- // bare hostname resolves only inside its own search domain. Pasted on
256
- // another machine, the qualified name still works.
257
- const displayHost = bindHost === '0.0.0.0' ? await hostFqdn_get() : bindHost;
258
- const url = `ws://${displayHost}:${port}`;
259
- // The berth says what code this daemon runs: a door that ships newer code
260
- // restarts the session at the next login rather than mount an older kernel.
261
- const berth = { identity, url, token, pid: process.pid, versions: { ...versions_get() }, booted: new Date().toISOString() };
180
+ }
181
+ /**
182
+ * Writes the berth: where this daemon can be reached, what code it runs (a door that ships newer code restarts the
183
+ * session at the next login rather than mount an older kernel), and how it proves it is this instance
184
+ * (`/instance`): a key of this launch's, over its identity, pid and boot.
185
+ *
186
+ * @param daemon - The daemon, listening.
187
+ * @param identity - The identity it hosts.
188
+ * @param url - Its wire address.
189
+ * @param token - Its attach token.
190
+ * @returns When it booted, as the berth says.
191
+ */
192
+ function launchBerth_publish(daemon, identity, url, token) {
193
+ const booted = new Date().toISOString();
194
+ const probeKey = probeKey_generate();
195
+ daemon.instance_set({ probeKey, identity, pid: process.pid, booted });
196
+ const berth = { identity, url, token, pid: process.pid, versions: { ...versions_get() }, booted, probeKey };
262
197
  berth_write(berth);
263
- // Terminals: a browser's console as a chell under a pty, attached back
264
- // over loopback (or the one address bound, when that is not a wildcard).
265
- // A machine where node-pty did not build offers none; its surfaces fall
266
- // back to the transcript console (deprecated). CALYPSO_NO_PTY=1 makes a
267
- // daemon that machine, so the fallback can be exercised where a pty builds.
268
- const ptySpawn = process.env['CALYPSO_NO_PTY'] === '1' ? null : await ptySpawn_load();
269
- // The same ptys run a terminal surface's `!` under host control.
198
+ return booted;
199
+ }
200
+ /**
201
+ * Offers terminals: a browser's console as a chell under a pty, attached back over loopback (or the one address
202
+ * bound, when that is not a wildcard). A machine where node-pty did not build offers none; its surfaces fall back
203
+ * to the transcript console (deprecated). The same ptys run a terminal surface's `!` under host control.
204
+ *
205
+ * @param daemon - The daemon, listening.
206
+ * @param ptySpawn - node-pty's spawn, or null when this machine offers no ptys.
207
+ * @param identity - The identity a terminal's chell attaches as.
208
+ * @param port - The port bound.
209
+ * @param token - The attach token.
210
+ * @param bindHost - The address bound.
211
+ * @param options - What the launcher decided; its `surfaceLaunch` is read only when a pty is offered.
212
+ */
213
+ function launchTerminals_offer(daemon, ptySpawn, identity, port, token, bindHost, options) {
270
214
  daemon.ptySpawn_set(ptySpawn);
271
215
  if (ptySpawn !== null) {
272
216
  const terminalHost = bindHost === '0.0.0.0' ? '127.0.0.1' : bindHost;
273
217
  daemon.terminals_set(new Terminals({
274
218
  spawn: ptySpawn,
275
219
  launch: options.surfaceLaunch ?? chellLaunch_find() ?? CHELL_ON_PATH,
276
- target: { identity, url: `ws://${terminalHost}:${port}`, token },
220
+ target: { identity, url: `ws://${terminalHost}:${String(port)}`, token },
277
221
  }));
278
222
  }
279
- const attachHint = sessionIdentity.connected ? ` ${identity}` : '';
280
- // The boot animation keeps repainting this terminal, and scrollback dies with
281
- // the next clear. The same addresses go to a file so they can be read back
282
- // without fighting either.
283
- const noteLines = [
284
- `identity: ${identity}`,
285
- `wire: ${url}`,
286
- `token: ${token}`,
287
- ...(webRoot !== null
288
- ? [`ARGUS: http://${displayHost}:${port}/?token=${token}`]
289
- : []),
290
- `attach: chell --remote --attach ${url} --token ${token}`,
291
- ...(hostControl.tiers.size > 0
292
- ? [`host control: ${hostControl_describe(hostControl)}${hostControl.exposed && bindHost !== '127.0.0.1' ? ` (EXPOSED on ${bindHost})` : ''}`]
293
- : []),
294
- ];
295
- const notePath = attachFile_write(noteLines);
296
- const cleanup = () => { if (notePath !== null)
297
- attachFile_remove(); };
298
- if (notePath !== null) {
299
- process.once('exit', cleanup);
300
- process.once('SIGINT', () => { cleanup(); process.exit(0); });
301
- }
302
- // Ended from outside (a porter's restart or end, a plain kill): every
303
- // surface is told why before the process goes, from the reason the host
304
- // left beside the berth, so a dropped wire is never mistaken for a crash.
223
+ }
224
+ /**
225
+ * Exits with the rival refusal lines if `rival` is non-null.
226
+ *
227
+ * @param rival - Standing rival daemon, or null.
228
+ * @param identity - Normalized session identity.
229
+ * @param sessionIdentity - Session identity (read for `.connected` only when `rival` is non-null).
230
+ */
231
+ function rivalGuard_enforce(rival, identity, sessionIdentity) {
232
+ if (rival === null)
233
+ return;
234
+ const [refusal, hint] = rivalRefusal_lines(rival, sessionIdentity.connected ? ` ${identity}` : '');
235
+ console.error(chalk.red(refusal));
236
+ console.error(chalk.gray(hint));
237
+ process.exit(1);
238
+ }
239
+ /**
240
+ * Exits if `hostControl` is refused on `bindHost`.
241
+ *
242
+ * @param hostControl - Host control policy.
243
+ * @param bindHost - Bind host address.
244
+ */
245
+ function hostControlGuard_enforce(hostControl, bindHost) {
246
+ const refusal = hostControl_guard(hostControl, bindHost);
247
+ if (refusal === null)
248
+ return;
249
+ console.error(chalk.red(`[!] ${refusal}`));
250
+ process.exit(1);
251
+ }
252
+ /**
253
+ * Installs SIGINT/SIGTERM handlers and writes the attach note for `identity`.
254
+ *
255
+ * @param daemon - Launched daemon instance.
256
+ * @param identity - Normalized session identity.
257
+ * @param booted - ISO timestamp when the berth booted.
258
+ * @returns The path of the written attach note, or null when not written.
259
+ */
260
+ function launchSignals_install(daemon, identity, booted) {
261
+ const notePath = attachFile_write(attachNote_lines(identity, booted));
262
+ if (notePath !== null)
263
+ process.once('SIGINT', () => { process.exit(0); });
305
264
  process.once('SIGTERM', () => {
306
265
  const cause = closing_take(identity) ?? 'stop';
307
- void daemon.closing_announce(cause).finally(() => { cleanup(); process.exit(0); });
266
+ void daemon.closing_announce(cause).finally(() => { process.exit(0); });
308
267
  });
309
- // The stack, every package written out once, versions in a clean column:
310
- // the build hash rides the listening line below rather than one row's
311
- // version, which pushed that row past the column the rest share.
312
- const build = buildHash_get();
313
- for (const row of stackBanner_rows(versions_selectForBackend(versions_get(), backend.id), webRoot !== null ? webRootVersion_read(webRoot) : null)) {
314
- console.log(` ${stackBannerRow_paint(row, { name: chalk.bold.cyan, phrase: chalk.white, version: chalk.gray })}`);
315
- }
316
- console.log(chalk.green(`[+] CALYPSO listening on ${url} ${chalk.gray(`(build ${build})`)}`));
317
- if (hostControl.tiers.size > 0) {
318
- // Annunciated every launch: this daemon acts on its own host.
319
- console.log(chalk.yellow(`[!] HOST CONTROL: ${hostControl_describe(hostControl)} — ${hostControl.tiers.has('tasks') && hostControl.tiers.size === 1 ? 'this session may start jobs that change the cloud and bill' : `\`!\`, pipes, and the disk are this host's${hostControl.tiers.has('tasks') ? '; jobs may change the cloud and bill' : ''}`}`));
320
- if (hostControl.exposed && bindHost !== '127.0.0.1') {
321
- console.log(chalk.red(`[!] HOST CONTROL EXPOSED ON ${bindHost}: the attach URL is a shell on this host`));
322
- }
323
- }
324
- if (resumed > 0)
325
- console.log(chalk.yellow(`[!] ${resumed} task${resumed === 1 ? '' : 's'} picked up again after the restart (ls /proc)`));
326
- console.log(chalk.gray(` identity: ${identity}`));
327
- console.log(chalk.gray(` token: ${token}`));
328
- console.log(chalk.gray(` berth: ${berth_path(identity)}`));
329
- console.log(chalk.gray(` attach a surface with: chell --remote${attachHint}`));
330
- if (bindHost !== '127.0.0.1') {
331
- // Berth discovery is a file in this host's runtime directory, so it cannot
332
- // reach another machine. An explicit address is how a surface elsewhere
333
- // attaches, and it is worth printing ready to paste.
334
- console.log(chalk.gray(` from another machine: chell --remote --attach ${url} --token ${token}`));
335
- }
336
- if (webRoot !== null) {
337
- console.log(chalk.green(`[+] ARGUS web surface at http://${displayHost}:${port}/?token=${token}`));
338
- console.log(chalk.gray(` serving: ${webRoot}`));
339
- }
340
- if (notePath !== null) {
341
- console.log(chalk.gray(` these lines also in: ${notePath}`));
342
- console.log(chalk.gray(' or run: calypso --berths'));
268
+ return notePath;
269
+ }
270
+ /**
271
+ * Prints the startup stack and address banner lines for a newly listening daemon.
272
+ *
273
+ * @param params - Banner inputs.
274
+ */
275
+ function launchBanner_print(params) {
276
+ const words = tokenWords_say(params.token, process.stdout.isTTY === true, params.berthPath);
277
+ const stackRows = stackBanner_rows(versions_selectForBackend(versions_get(), params.backendId), params.webRoot !== null ? webRootVersion_read(params.webRoot) : null);
278
+ const attachHint = params.connected ? ` ${params.identity}` : '';
279
+ for (const line of launchBanner_lines({
280
+ stackRows,
281
+ url: params.url,
282
+ build: buildHash_get(),
283
+ hostControl: params.hostControl,
284
+ bindHost: params.bindHost,
285
+ resumed: params.resumed,
286
+ identity: params.identity,
287
+ words,
288
+ berthPath: params.berthPath,
289
+ attachHint,
290
+ displayHost: params.displayHost,
291
+ port: params.port,
292
+ webRoot: params.webRoot,
293
+ notePath: params.notePath,
294
+ })) {
295
+ console.log(line);
343
296
  }
297
+ }
298
+ /**
299
+ * Starts the daemon over an engine and advertises it for same-user discovery.
300
+ *
301
+ * @param engine - The engine to host (already created and connected by boot).
302
+ * @param beforeListen - Optional host preparation run after the duplicate guard
303
+ * and before the socket binds or the berth is published. It holds the berth
304
+ * file, which a door waits on, so it is the boot gate alone: a warm-up a
305
+ * surface can work beside runs after this resolves, with the daemon answering.
306
+ * @param options - What the launcher decided beyond the engine.
307
+ * @returns The launched daemon's addresses and handle, once it is listening;
308
+ * the process then stays alive on the WebSocket server.
309
+ *
310
+ * @example
311
+ * ```ts
312
+ * const info: DaemonLaunchInfo = await daemon_launch(engine, warmup_gate, { hostControl });
313
+ * ```
314
+ */
315
+ export async function daemon_launch(engine, beforeListen, options = {}) {
316
+ if (chalk.level < 1)
317
+ chalk.level = 3;
318
+ const backend = backend_get();
319
+ const sessionIdentity = await backend.session.identity_get();
320
+ const identity = identity_normalise(sessionIdentity.user, sessionIdentity.where);
321
+ rivalGuard_enforce(await rival_read(identity), identity, sessionIdentity);
322
+ if (beforeListen)
323
+ await beforeListen();
324
+ const token = token_generate();
325
+ const webRoot = launchWebRoot_resolve(options);
326
+ const bindHost = process.env[BIND_ENV] ?? '127.0.0.1';
327
+ const hostControl = options.hostControl ?? HOST_CONTROL_OFF;
328
+ hostControlGuard_enforce(hostControl, bindHost);
329
+ const surfaceBuild = webRoot !== null ? webRootBuild_read(webRoot) : null;
330
+ let codeWatch = null;
331
+ const elevation = elevation_read(process.env);
332
+ const daemon = launchDaemon_make(engine, { token, bindHost, webRoot, backend, hostControl, surfaceBuild, elevation }, () => { void codeWatch?.check().catch(() => undefined); });
333
+ if (elevation !== null)
334
+ console.log(chalk.gray(` MANAGE by password: ${elevation.user} may raise a surface of this session with their ChRIS password`));
335
+ codeWatch = await codeWatch_start((stale) => { daemon.stale_set(stale); }).catch(() => null);
336
+ engine.sink_install(new DaemonSink(daemon));
337
+ engine.surface_install(daemonSurface_create(daemon, hostControl));
338
+ const resumed = engine.jobs_resume?.() ?? 0;
339
+ const port = await daemon.start();
340
+ const displayHost = bindHost === '0.0.0.0' ? await hostFqdn_get() : bindHost;
341
+ const url = `ws://${displayHost}:${String(port)}`;
342
+ const booted = launchBerth_publish(daemon, identity, url, token);
343
+ const ptySpawn = process.env[NO_PTY_ENV] === '1' ? null : await ptySpawn_load();
344
+ launchTerminals_offer(daemon, ptySpawn, identity, port, token, bindHost, options);
345
+ const notePath = launchSignals_install(daemon, identity, booted);
346
+ const berthPath = berth_path(identity);
347
+ launchBanner_print({ backendId: backend.id, webRoot, url, hostControl, bindHost, resumed, identity, connected: sessionIdentity.connected, token, berthPath, displayHost, port, notePath });
344
348
  return {
345
349
  identity,
346
350
  url,
347
351
  token,
348
- berthPath: berth_path(identity),
349
- argusUrl: webRoot !== null ? `http://${displayHost}:${port}/?token=${token}` : null,
352
+ berthPath,
353
+ argusUrl: webRoot !== null ? `http://${displayHost}:${String(port)}/?token=${token}` : null,
350
354
  daemon,
351
355
  hostControl,
352
356
  bindHost,
@@ -1 +1 @@
1
- {"version":3,"file":"launch.js","sourceRoot":"","sources":["../../src/daemon/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AACpE,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,i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