@nimbus-sh/worker 0.4.0 → 0.5.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 (83) hide show
  1. package/README.md +46 -43
  2. package/dist/_shared/preview-host.d.ts +14 -1
  3. package/dist/_shared/preview-host.d.ts.map +1 -1
  4. package/dist/_shared/preview-host.js +28 -3
  5. package/dist/_shared/session-router.d.ts +43 -0
  6. package/dist/_shared/session-router.d.ts.map +1 -1
  7. package/dist/_shared/session-router.js +59 -12
  8. package/dist/facets/durable-images.d.ts +50 -0
  9. package/dist/facets/durable-images.d.ts.map +1 -0
  10. package/dist/facets/durable-images.js +75 -0
  11. package/dist/facets/durable-slots.d.ts +45 -0
  12. package/dist/facets/durable-slots.d.ts.map +1 -0
  13. package/dist/facets/durable-slots.js +94 -0
  14. package/dist/facets/esbuild-transform.d.ts +10 -0
  15. package/dist/facets/esbuild-transform.d.ts.map +1 -0
  16. package/dist/facets/esbuild-transform.js +36 -0
  17. package/dist/facets/manager.d.ts +160 -5
  18. package/dist/facets/manager.d.ts.map +1 -1
  19. package/dist/facets/manager.js +554 -97
  20. package/dist/git/commands.d.ts +22 -0
  21. package/dist/git/commands.d.ts.map +1 -1
  22. package/dist/git/commands.js +431 -424
  23. package/dist/git-bundle.generated.d.ts +2 -2
  24. package/dist/git-bundle.generated.d.ts.map +1 -1
  25. package/dist/git-bundle.generated.js +3 -3
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -1
  29. package/dist/node-shims-artifact.generated.js +3 -3
  30. package/dist/router/index.d.ts.map +1 -1
  31. package/dist/router/index.js +59 -2
  32. package/dist/router/public-directory-do.d.ts +17 -0
  33. package/dist/router/public-directory-do.d.ts.map +1 -0
  34. package/dist/router/public-directory-do.js +16 -0
  35. package/dist/router/public-directory.d.ts +75 -0
  36. package/dist/router/public-directory.d.ts.map +1 -0
  37. package/dist/router/public-directory.js +115 -0
  38. package/dist/router/remote-api.d.ts +9 -1
  39. package/dist/router/remote-api.d.ts.map +1 -1
  40. package/dist/router/remote-api.js +19 -2
  41. package/dist/runtime/node-shims.d.ts +4 -1
  42. package/dist/runtime/node-shims.d.ts.map +1 -1
  43. package/dist/runtime/node-shims.js +324 -6
  44. package/dist/session/agent.d.ts +11 -0
  45. package/dist/session/agent.d.ts.map +1 -1
  46. package/dist/session/helpers.js +1 -1
  47. package/dist/session/init-phases.d.ts +17 -23
  48. package/dist/session/init-phases.d.ts.map +1 -1
  49. package/dist/session/init-phases.js +17 -41
  50. package/dist/session/init.d.ts.map +1 -1
  51. package/dist/session/init.js +19 -15
  52. package/dist/session/keys.d.ts +8 -0
  53. package/dist/session/keys.d.ts.map +1 -1
  54. package/dist/session/keys.js +8 -0
  55. package/dist/session/nimbus-session.d.ts +29 -4
  56. package/dist/session/nimbus-session.d.ts.map +1 -1
  57. package/dist/session/nimbus-session.js +62 -9
  58. package/dist/session/port-capability.d.ts +95 -8
  59. package/dist/session/port-capability.d.ts.map +1 -1
  60. package/dist/session/port-capability.js +165 -8
  61. package/dist/session/programmatic.d.ts +50 -2
  62. package/dist/session/programmatic.d.ts.map +1 -1
  63. package/dist/session/programmatic.js +104 -6
  64. package/dist/session/routes.d.ts +17 -0
  65. package/dist/session/routes.d.ts.map +1 -1
  66. package/dist/session/routes.js +92 -25
  67. package/dist/session/rpc.d.ts.map +1 -1
  68. package/dist/session/rpc.js +14 -4
  69. package/dist/session/shell-socket.d.ts +76 -0
  70. package/dist/session/shell-socket.d.ts.map +1 -0
  71. package/dist/session/shell-socket.js +172 -0
  72. package/dist/session/start-real-vite.js +1 -1
  73. package/dist/session/supervisor-op.d.ts +5 -0
  74. package/dist/session/supervisor-op.d.ts.map +1 -0
  75. package/dist/session/supervisor-op.js +74 -0
  76. package/dist/session/supervisor-rpc.d.ts +6 -10
  77. package/dist/session/supervisor-rpc.d.ts.map +1 -1
  78. package/dist/session/supervisor-rpc.js +91 -70
  79. package/dist/session/ws.d.ts.map +1 -1
  80. package/dist/session/ws.js +19 -4
  81. package/package.json +4 -4
  82. package/public/_assets/runtime/{node-shims-fea906843f6d594e.js → node-shims-9e1380d9ee430fcc.js} +320 -5
  83. package/public/s/index.html +101 -5
@@ -35,6 +35,7 @@ import { VITE_CONFIG_KEY } from './keys.js';
35
35
  import { estimateSupervisorHeap, WORKERD_EVICTION_LABELS } from '@nimbus-sh/platform/heap-estimate.js';
36
36
  import { loadShellState, loadKernelMounts, getScrollbackStats, clearSessionState, appendScrollback, loadScrollback } from './state-store.js';
37
37
  import { classifyWsUpgrade, joinExistingSession } from './init-phases.js';
38
+ import { closeStaleShellSockets, tagShellSocket } from './shell-socket.js';
38
39
  import { EsbuildService } from '@nimbus-sh/core/runtime/esbuild-service.js';
39
40
  import { ViteDevServer } from '../facets/vite-dev-server.js';
40
41
  import { notifyTerminalEvent, wireProcessLogSocketBroadcast } from '../runtime/process-logs-api.js';
@@ -46,8 +47,8 @@ import { facetIdBudget } from '@nimbus-sh/fabric/budgets.js';
46
47
  import { loaderLedgerStats } from '@nimbus-sh/fabric/budgets.js';
47
48
  import { HOSTED_WEBSOCKET_CAPABILITY_HEADER, HOSTED_WEBSOCKET_KEY_HEADER, } from '@nimbus-sh/fabric/process-host.js';
48
49
  import { routeHostedWebSocket } from './rpc.js';
49
- import { clearPortCapability, persistPortCapability, readPortCapability, restorePortCapability, } from './port-capability.js';
50
- import { PREVIEW_CAPABILITY_HEADER } from '../_shared/session-router.js';
50
+ import { clearPortCapability, persistPortCapability, readPortCapability, readPortReservation, restorePortCapability, } from './port-capability.js';
51
+ import { PREVIEW_CAPABILITY_HEADER, PUBLIC_BEARER_HEADER, CALLER_SCOPES_HEADER, renderSessionStatusPage } from '../_shared/session-router.js';
51
52
  import { renderNoDevServerHtml } from './helpers.js';
52
53
  import { handleAgentRequest } from './agent.js';
53
54
  import { captureSessionAiCredential } from './ai.js';
@@ -139,8 +140,11 @@ async function restorePersistedDevServer(self, onlyPort) {
139
140
  return;
140
141
  }
141
142
  self.ensureSqliteFs();
142
- if (!self.esbuildService)
143
- self.esbuildService = new EsbuildService(self.sqliteFs);
143
+ if (!self.esbuildService) {
144
+ if (!self.sqliteFs)
145
+ throw new Error('Session VFS is not initialized');
146
+ self.esbuildService = new EsbuildService(self.sqliteFs.as(CRED_KERNEL));
147
+ }
144
148
  // Prefer the current request's basePath (just captured from the
145
149
  // X-Nimbus-Base header) over the stored one — the latter is only
146
150
  // a fallback for cold rehydrates that precede any header hit.
@@ -192,8 +196,27 @@ async function restorePersistedDevServer(self, onlyPort) {
192
196
  * the untrusted-code boundary and cannot carry it, and a plain user server on
193
197
  * any other port is mounted at root and needs no rewriting.
194
198
  */
195
- async function routeToSessionPort(self, port, request, innerPath, mountBase, capability) {
199
+ export async function routeToSessionPort(self, port, request, innerPath, mountBase, capability) {
196
200
  await restorePersistedDevServer(self, port);
201
+ // The durable seam: a request on a port nothing is serving may be a
202
+ // durable application a reset left dead — the alarm pump would re-drive
203
+ // it eventually, but a URL in someone's hands cannot wait for eventually.
204
+ // 'absent' falls through to the honest 502 unchanged; 'started' continues
205
+ // to normal routing with the port freshly bound; 'failed' is mid-launch
206
+ // or a lost boot, so the page re-asks on its own timer.
207
+ if (self.ensureDurableAppOnPort !== undefined) {
208
+ const durable = await self.ensureDurableAppOnPort(port);
209
+ if (durable === 'failed') {
210
+ return new Response(renderPortStartingHtml(port), {
211
+ status: 503,
212
+ headers: {
213
+ 'Content-Type': 'text/html; charset=utf-8',
214
+ 'Cache-Control': 'no-store',
215
+ 'Retry-After': '3',
216
+ },
217
+ });
218
+ }
219
+ }
197
220
  if (capability !== undefined) {
198
221
  // A rebuilt supervisor holds a capability nobody was handed; the durable
199
222
  // one is the value in circulation, so it wins before the check.
@@ -203,6 +226,15 @@ async function routeToSessionPort(self, port, request, innerPath, mountBase, cap
203
226
  // listening at all.
204
227
  return new Response('Not found', { status: 404 });
205
228
  }
229
+ // The public bearer form arrived without a session attach: the
230
+ // capability is real, but it authorises this route only for a port the
231
+ // owner deliberately exposed — the stored visibility is the gate.
232
+ if (request.headers.get(PUBLIC_BEARER_HEADER) !== null) {
233
+ const reservation = await readPortReservation(self.ctx, port);
234
+ if (reservation === null || reservation.visibility !== 'public') {
235
+ return new Response('Not found', { status: 404 });
236
+ }
237
+ }
206
238
  }
207
239
  if (port === self._viteShimPort) {
208
240
  // The preview HMR WebSocket can't cross the port-registry RPC, so it is
@@ -223,6 +255,15 @@ async function routeToSessionPort(self, port, request, innerPath, mountBase, cap
223
255
  return proxied;
224
256
  return new Response(`No process listening on port ${port}`, { status: 502 });
225
257
  }
258
+ /** The "durable application is (re)starting" 503 page — self-refreshing. */
259
+ function renderPortStartingHtml(port) {
260
+ return renderSessionStatusPage({
261
+ title: 'Starting',
262
+ heading: 'Starting…',
263
+ body: `The application on port <code>${port}</code> is restarting.<br>This page refreshes itself.`,
264
+ metaRefreshSeconds: 3,
265
+ });
266
+ }
226
267
  /**
227
268
  * Re-adopt a preview capability the embedder already holds, after a restore
228
269
  * re-registered the port under a freshly minted one.
@@ -411,20 +452,11 @@ export async function handleFetch(self, request) {
411
452
  catch { }
412
453
  return new Response(null, { status: 101, webSocket: client });
413
454
  }
414
- // [B'.5] Three-way decision on a /ws upgrade:
415
- // 1. Warm join: kernel/shell/terminal are alive in-memory and
416
- // no real open shell socket is attached. This includes both
417
- // a drained browser session and a headless programmatic boot.
418
- // The lifecycle phase alone does not prove that a browser
419
- // terminal socket is currently attached.
420
- // 2. Cold init: no shell yet (first connect, or post-DO-
421
- // eviction). Run the full R/B/W/O sequence.
422
- // 3. Active conflict: an open socket tagged `shell` proves
423
- // another browser terminal is attached. 409 prevents
424
- // two-tab cross-wiring (multi-tab share is separate).
425
- // Decide before accepting/tagging the incoming server socket so
426
- // it cannot be mistaken for an already-attached terminal.
427
- const wsUpgrade = classifyWsUpgrade(self, self.ctx.getWebSockets());
455
+ // [B'.5] Three-way decision on a /ws upgrade — see
456
+ // classifyWsUpgrade. Decide before accepting/tagging the incoming
457
+ // server socket so it cannot be mistaken for the incumbent.
458
+ const priorSockets = self.ctx.getWebSockets();
459
+ const wsUpgrade = classifyWsUpgrade(self, priorSockets);
428
460
  if (wsUpgrade === 'conflict') {
429
461
  return new Response(JSON.stringify({
430
462
  error: 'session already has active terminal',
@@ -434,13 +466,16 @@ export async function handleFetch(self, request) {
434
466
  headers: { 'Content-Type': 'application/json' },
435
467
  });
436
468
  }
469
+ // This upgrade is taking the terminal, so no shell socket in
470
+ // `priorSockets` still has a peer. Close them: a socket whose tab
471
+ // is gone, or one a failed upgrade accepted and never handed to a
472
+ // client, otherwise stays accepted for the life of the object and
473
+ // refuses every later reconnect.
474
+ closeStaleShellSockets(self.ctx, priorSockets);
437
475
  const pair = new WebSocketPair();
438
476
  const [client, server] = Object.values(pair);
439
477
  self.ctx.acceptWebSocket(server);
440
- try {
441
- server.serializeAttachment?.({ kind: 'shell' });
442
- }
443
- catch { }
478
+ tagShellSocket(server);
444
479
  if (wsUpgrade === 'warm-join') {
445
480
  // Warm rejoin path. The existing Shell is alive; we just
446
481
  // swap the WebSocketTerminal's ws ref + replay scrollback.
@@ -449,6 +484,10 @@ export async function handleFetch(self, request) {
449
484
  }
450
485
  catch (err) {
451
486
  console.error('warm-rejoin error:', err?.message, err?.stack);
487
+ try {
488
+ server.close(1011, 'rejoin failed');
489
+ }
490
+ catch { /* already closing */ }
452
491
  return new Response('Rejoin failed: ' + err?.message, { status: 500 });
453
492
  }
454
493
  return new Response(null, { status: 101, webSocket: client });
@@ -459,6 +498,10 @@ export async function handleFetch(self, request) {
459
498
  }
460
499
  catch (err) {
461
500
  console.error('initSession error:', err?.message, err?.stack);
501
+ try {
502
+ server.close(1011, 'init failed');
503
+ }
504
+ catch { /* already closing */ }
462
505
  return new Response('Init failed: ' + err?.message, { status: 500 });
463
506
  }
464
507
  return new Response(null, { status: 101, webSocket: client });
@@ -1050,8 +1093,11 @@ export async function handleFetch(self, request) {
1050
1093
  if (self.viteDevServer?.isRunning)
1051
1094
  self.viteDevServer.stop();
1052
1095
  // Start in-process ViteDevServer
1053
- if (!self.esbuildService)
1054
- self.esbuildService = new EsbuildService(self.sqliteFs);
1096
+ if (!self.esbuildService) {
1097
+ if (!self.sqliteFs)
1098
+ throw new Error('Session VFS is not initialized');
1099
+ self.esbuildService = new EsbuildService(self.sqliteFs.as(CRED_KERNEL));
1100
+ }
1055
1101
  const basePath = self.viteBasePath;
1056
1102
  // process metadata support: allocate a PID + port even on the
1057
1103
  // /api/start-vite path so probes that drive vite via the test
@@ -1331,6 +1377,27 @@ export async function handleFetch(self, request) {
1331
1377
  reset();
1332
1378
  return new Response(null, { status: 204 });
1333
1379
  }
1380
+ // ── /api/_diag/abort — a real DO isolate reset with storage intact ──
1381
+ //
1382
+ // The eviction probe's deterministic reset: `ctx.abort()` ends this
1383
+ // isolate and its in-flight work the same way the platform's own reset
1384
+ // does, while every synced storage row survives. The abort is deferred
1385
+ // onto waitUntil so the 204 reaches the caller before the isolate
1386
+ // unwinds — answering from inside the throw would tear the response.
1387
+ //
1388
+ // Gated twice, like the other _diag writes: NIMBUS_DEBUG off → 404, and
1389
+ // the caller's verified scopes must carry `session:admin` — a reset is
1390
+ // destructive even in debug mode, and an attach-scope token is not one.
1391
+ if (url.pathname === '/api/_diag/abort' && request.method === 'POST') {
1392
+ if (!self.nimbusDebug)
1393
+ return new Response('not found', { status: 404 });
1394
+ const callerScopes = (request.headers.get(CALLER_SCOPES_HEADER) ?? '').split(' ');
1395
+ if (!callerScopes.includes('session:admin')) {
1396
+ return new Response('forbidden: session:admin scope required', { status: 403 });
1397
+ }
1398
+ self.ctx.waitUntil(new Promise((resolve) => setTimeout(resolve, 250)).then(() => self.ctx.abort()));
1399
+ return new Response(null, { status: 204 });
1400
+ }
1334
1401
  return new Response('Not found', { status: 404 });
1335
1402
  }
1336
1403
  // ── cache-and-scrub L2 benchmark endpoint ───────────────────────────────
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","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AAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAGzG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAoB7B;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC,CAKnB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAQjC;AAoBD,OAAO,EAA4D,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAElJ,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5D,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlG"}
@@ -1009,9 +1009,17 @@ export async function _rpcPrefetch(self, cwd, entryCode) {
1009
1009
  return prefetchForRequire(self.sqliteFs, entryCode, cwd).bundle;
1010
1010
  }
1011
1011
  export async function _rpcRegisterPort(self, pid, port) {
1012
- // Port registration stores the facet association
1013
- // The actual facet stub is stored by FacetManager separately
1014
- // A new registration retires the previous occupant's preview capability.
1012
+ // Port registration stores the facet association — the actual facet stub
1013
+ // is stored by FacetManager separately. Registration goes through the
1014
+ // manager so a pid binding a reserved port inherits the reservation's
1015
+ // durable contract: its journal row is stamped with the port's owner and
1016
+ // the stored capability is re-adopted rather than retired.
1017
+ if (self.facetManager) {
1018
+ await self.facetManager.registerPort(pid, port);
1019
+ return;
1020
+ }
1021
+ // No facet manager yet means nothing resident is running — a bare
1022
+ // registration retires the previous occupant's preview capability.
1015
1023
  await clearPortCapability(self, port);
1016
1024
  self.portRegistry.register(port, pid);
1017
1025
  }
@@ -1027,7 +1035,9 @@ export async function _rpcRouteLoopback(self, port, request) {
1027
1035
  export async function _rpcTransform(self, code, loader) {
1028
1036
  if (!self.esbuildService) {
1029
1037
  self.ensureSqliteFs();
1030
- self.esbuildService = new EsbuildService(self.sqliteFs);
1038
+ if (!self.sqliteFs)
1039
+ throw new Error('Session VFS is not initialized');
1040
+ self.esbuildService = new EsbuildService(self.sqliteFs.as(CRED_KERNEL));
1031
1041
  }
1032
1042
  try {
1033
1043
  const result = await self.esbuildService.transform(code, {
@@ -0,0 +1,76 @@
1
+ /**
2
+ * src/session/shell-socket.ts — who owns the session's terminal.
3
+ *
4
+ * The /ws upgrade refuses a second browser terminal on one session, so it
5
+ * has to know whether the terminal already has an owner. `readyState ===
6
+ * OPEN` does not answer that. It describes this end of the socket. A tab
7
+ * that dies without a close frame leaves a socket that still reads OPEN
8
+ * with nobody on the other end, and an upgrade that fails after accepting
9
+ * its socket leaves one whose client half was never handed to anyone. No
10
+ * close frame can ever arrive for either. Refusing every reconnect
11
+ * against such a socket locks the session out for good.
12
+ *
13
+ * Ownership needs peer-originated evidence, and that evidence has to
14
+ * outlive a hibernation cycle, because isolate memory does not. Two
15
+ * sources qualify:
16
+ *
17
+ * 1. `seenAt` in the socket's attachment. The attachment survives
18
+ * hibernation. Every inbound frame refreshes it, rate-limited to one
19
+ * write per STAMP_INTERVAL_MS, so a fast typist costs one attachment
20
+ * write per 15 s.
21
+ * 2. `ctx.getWebSocketAutoResponseTimestamp(ws)`. The runtime answers
22
+ * the configured `ping` itself without waking the object, so a ping
23
+ * never reaches case 1 and leaves no other trace. The browser
24
+ * terminal does not ping — it probes with an ordinary frame, for
25
+ * the reasons public/s/index.html gives — so this covers the other
26
+ * clients rather than that one.
27
+ *
28
+ * A close or an error is better than either: the runtime is telling the
29
+ * object outright that this socket is finished, so `clearShellSocketStamp`
30
+ * drops the evidence there and the next upgrade needs no inference at all.
31
+ *
32
+ * A socket owns the terminal while the later of the two falls inside
33
+ * SHELL_OWNER_LIVENESS_MS. The window has to cover the longest silence a
34
+ * live tab can produce. Browsers throttle a background tab's timers to
35
+ * about one tick per minute, so 120 s clears that with margin. A tab
36
+ * quiet for longer has stopped running its own code, and the upgrade that
37
+ * takes the terminal also closes its socket — so it redials cleanly
38
+ * instead of holding a terminal it can no longer use.
39
+ */
40
+ /** How long a shell socket owns the terminal after its peer was heard. */
41
+ export declare const SHELL_OWNER_LIVENESS_MS = 120000;
42
+ /** The part of `DurableObjectState` this module reads. */
43
+ export interface AutoResponseHost {
44
+ getWebSocketAutoResponseTimestamp?(ws: WebSocket): Date | null;
45
+ }
46
+ /** Tag a freshly accepted terminal socket as this session's shell owner. */
47
+ export declare function tagShellSocket(ws: WebSocket, now?: number): void;
48
+ /**
49
+ * Drop the evidence that a peer was on this socket.
50
+ *
51
+ * Called when the runtime reports the socket closed or errored. Both say
52
+ * this socket is finished, so the next upgrade must not read a stamp the
53
+ * dying handler wrote moments earlier and refuse the reconnect. Keeps the
54
+ * kind, so the socket still classifies as the terminal's while it drains.
55
+ * A peer that turns out to be alive re-stamps on its next frame.
56
+ */
57
+ export declare function clearShellSocketStamp(ws: WebSocket): void;
58
+ /**
59
+ * Record that the peer on this socket is still there.
60
+ *
61
+ * Called on every inbound shell frame. Rewrites the attachment only once
62
+ * the recorded stamp has aged past STAMP_INTERVAL_MS. No-op on sockets
63
+ * that carry another kind.
64
+ */
65
+ export declare function noteShellSocketActivity(ws: WebSocket, now?: number): void;
66
+ /** True when another browser terminal currently holds this session. */
67
+ export declare function hasLiveShellOwner(ctx: AutoResponseHost | undefined, sockets: readonly WebSocket[], now?: number): boolean;
68
+ /**
69
+ * Close the shell sockets no peer holds any more.
70
+ *
71
+ * Called on an upgrade that is taking the terminal. Without it, a socket
72
+ * whose tab is gone stays accepted for the life of the object, and every
73
+ * warm rejoin adds another one.
74
+ */
75
+ export declare function closeStaleShellSockets(ctx: AutoResponseHost | undefined, sockets: readonly WebSocket[], now?: number): void;
76
+ //# sourceMappingURL=shell-socket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-socket.d.ts","sourceRoot":"","sources":["../../src/session/shell-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,SAAU,CAAC;AAU/C,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC,CAAC,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;CAChE;AAwFD,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAE5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAKrF;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,GAAG,SAAS,EACjC,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,GAAG,GAAE,MAAmB,GACvB,OAAO,CAET;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,gBAAgB,GAAG,SAAS,EACjC,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,GAAG,GAAE,MAAmB,GACvB,IAAI,CAKN"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * src/session/shell-socket.ts — who owns the session's terminal.
3
+ *
4
+ * The /ws upgrade refuses a second browser terminal on one session, so it
5
+ * has to know whether the terminal already has an owner. `readyState ===
6
+ * OPEN` does not answer that. It describes this end of the socket. A tab
7
+ * that dies without a close frame leaves a socket that still reads OPEN
8
+ * with nobody on the other end, and an upgrade that fails after accepting
9
+ * its socket leaves one whose client half was never handed to anyone. No
10
+ * close frame can ever arrive for either. Refusing every reconnect
11
+ * against such a socket locks the session out for good.
12
+ *
13
+ * Ownership needs peer-originated evidence, and that evidence has to
14
+ * outlive a hibernation cycle, because isolate memory does not. Two
15
+ * sources qualify:
16
+ *
17
+ * 1. `seenAt` in the socket's attachment. The attachment survives
18
+ * hibernation. Every inbound frame refreshes it, rate-limited to one
19
+ * write per STAMP_INTERVAL_MS, so a fast typist costs one attachment
20
+ * write per 15 s.
21
+ * 2. `ctx.getWebSocketAutoResponseTimestamp(ws)`. The runtime answers
22
+ * the configured `ping` itself without waking the object, so a ping
23
+ * never reaches case 1 and leaves no other trace. The browser
24
+ * terminal does not ping — it probes with an ordinary frame, for
25
+ * the reasons public/s/index.html gives — so this covers the other
26
+ * clients rather than that one.
27
+ *
28
+ * A close or an error is better than either: the runtime is telling the
29
+ * object outright that this socket is finished, so `clearShellSocketStamp`
30
+ * drops the evidence there and the next upgrade needs no inference at all.
31
+ *
32
+ * A socket owns the terminal while the later of the two falls inside
33
+ * SHELL_OWNER_LIVENESS_MS. The window has to cover the longest silence a
34
+ * live tab can produce. Browsers throttle a background tab's timers to
35
+ * about one tick per minute, so 120 s clears that with margin. A tab
36
+ * quiet for longer has stopped running its own code, and the upgrade that
37
+ * takes the terminal also closes its socket — so it redials cleanly
38
+ * instead of holding a terminal it can no longer use.
39
+ */
40
+ /** How long a shell socket owns the terminal after its peer was heard. */
41
+ export const SHELL_OWNER_LIVENESS_MS = 120_000;
42
+ /** Smallest gap between two attachment writes on one socket. */
43
+ const STAMP_INTERVAL_MS = 15_000;
44
+ /** Tolerance for a `seenAt` that reads ahead of the current clock. */
45
+ const CLOCK_SKEW_MS = 60_000;
46
+ const SHELL_KIND = 'shell';
47
+ function readAttachment(ws) {
48
+ try {
49
+ const read = Reflect.get(ws, 'deserializeAttachment');
50
+ if (typeof read !== 'function')
51
+ return null;
52
+ return Reflect.apply(read, ws, []);
53
+ }
54
+ catch {
55
+ return null;
56
+ }
57
+ }
58
+ function writeAttachment(ws, attachment) {
59
+ try {
60
+ const write = Reflect.get(ws, 'serializeAttachment');
61
+ if (typeof write === 'function')
62
+ Reflect.apply(write, ws, [attachment]);
63
+ }
64
+ catch { /* the socket is closing, or the runtime refused the write */ }
65
+ }
66
+ /**
67
+ * Read a shell socket's stamp in one attachment pass.
68
+ *
69
+ * Returns null when the socket carries another kind, and a stamp of null
70
+ * when it is a shell socket nothing has stamped yet. An attachment
71
+ * outlives the deploy that wrote it and is untrusted on the way back, so
72
+ * a stamp that is not a plain timestamp, or that reads further ahead than
73
+ * the clocks can differ, counts as no stamp at all.
74
+ */
75
+ function readShellStamp(ws, now) {
76
+ const attachment = readAttachment(ws);
77
+ if (typeof attachment !== 'object' || attachment === null)
78
+ return null;
79
+ const record = attachment;
80
+ if (record.kind !== SHELL_KIND)
81
+ return null;
82
+ const seenAt = record.seenAt;
83
+ if (typeof seenAt !== 'number' || !Number.isFinite(seenAt) || seenAt > now + CLOCK_SKEW_MS) {
84
+ return { seenAt: null };
85
+ }
86
+ return { seenAt };
87
+ }
88
+ /** When the runtime last answered a ping on this socket, if it ever did. */
89
+ function autoResponseAt(ctx, ws, now) {
90
+ // Null whenever the runtime has never auto-answered on this socket.
91
+ const at = ctx?.getWebSocketAutoResponseTimestamp?.(ws) ?? null;
92
+ if (!at)
93
+ return null;
94
+ const ms = at.getTime();
95
+ if (!Number.isFinite(ms) || ms > now + CLOCK_SKEW_MS)
96
+ return null;
97
+ return ms;
98
+ }
99
+ /** True while a peer is still proven to be on this shell socket. */
100
+ function ownsTerminal(ctx, ws, stamp, now) {
101
+ const answered = autoResponseAt(ctx, ws, now);
102
+ const heard = stamp.seenAt === null
103
+ ? answered
104
+ : (answered === null ? stamp.seenAt : Math.max(stamp.seenAt, answered));
105
+ return heard !== null && now - heard < SHELL_OWNER_LIVENESS_MS;
106
+ }
107
+ /** The open shell sockets, each with the stamp it carries. */
108
+ function openShellSockets(sockets, now) {
109
+ const found = [];
110
+ for (const ws of sockets) {
111
+ if (ws.readyState !== WebSocket.OPEN)
112
+ continue;
113
+ const stamp = readShellStamp(ws, now);
114
+ if (stamp)
115
+ found.push({ ws, stamp });
116
+ }
117
+ return found;
118
+ }
119
+ /** Tag a freshly accepted terminal socket as this session's shell owner. */
120
+ export function tagShellSocket(ws, now = Date.now()) {
121
+ writeAttachment(ws, { kind: SHELL_KIND, seenAt: now });
122
+ }
123
+ /**
124
+ * Drop the evidence that a peer was on this socket.
125
+ *
126
+ * Called when the runtime reports the socket closed or errored. Both say
127
+ * this socket is finished, so the next upgrade must not read a stamp the
128
+ * dying handler wrote moments earlier and refuse the reconnect. Keeps the
129
+ * kind, so the socket still classifies as the terminal's while it drains.
130
+ * A peer that turns out to be alive re-stamps on its next frame.
131
+ */
132
+ export function clearShellSocketStamp(ws) {
133
+ if (readShellStamp(ws, Date.now()) === null)
134
+ return;
135
+ writeAttachment(ws, { kind: SHELL_KIND });
136
+ }
137
+ /**
138
+ * Record that the peer on this socket is still there.
139
+ *
140
+ * Called on every inbound shell frame. Rewrites the attachment only once
141
+ * the recorded stamp has aged past STAMP_INTERVAL_MS. No-op on sockets
142
+ * that carry another kind.
143
+ */
144
+ export function noteShellSocketActivity(ws, now = Date.now()) {
145
+ const stamp = readShellStamp(ws, now);
146
+ if (!stamp)
147
+ return;
148
+ if (stamp.seenAt !== null && now - stamp.seenAt < STAMP_INTERVAL_MS)
149
+ return;
150
+ writeAttachment(ws, { kind: SHELL_KIND, seenAt: now });
151
+ }
152
+ /** True when another browser terminal currently holds this session. */
153
+ export function hasLiveShellOwner(ctx, sockets, now = Date.now()) {
154
+ return openShellSockets(sockets, now).some(({ ws, stamp }) => ownsTerminal(ctx, ws, stamp, now));
155
+ }
156
+ /**
157
+ * Close the shell sockets no peer holds any more.
158
+ *
159
+ * Called on an upgrade that is taking the terminal. Without it, a socket
160
+ * whose tab is gone stays accepted for the life of the object, and every
161
+ * warm rejoin adds another one.
162
+ */
163
+ export function closeStaleShellSockets(ctx, sockets, now = Date.now()) {
164
+ for (const { ws, stamp } of openShellSockets(sockets, now)) {
165
+ if (ownsTerminal(ctx, ws, stamp, now))
166
+ continue;
167
+ try {
168
+ ws.close(1001, 'terminal taken over');
169
+ }
170
+ catch { /* already closing */ }
171
+ }
172
+ }
@@ -53,7 +53,7 @@ export async function startRealVite(self, opts) {
53
53
  if (cfgPath) {
54
54
  try {
55
55
  if (!self.esbuildService)
56
- self.esbuildService = new EsbuildService(self.sqliteFs);
56
+ self.esbuildService = new EsbuildService(kernelFs);
57
57
  const bundleResult = await self.esbuildService.build([cfgPath], {
58
58
  bundle: true,
59
59
  format: 'esm',
@@ -0,0 +1,5 @@
1
+ import type { SupervisorOpEnvelope } from '@nimbus-sh/core/workspace/supervisor-op.js';
2
+ import type { NimbusSession } from './nimbus-session.js';
3
+ /** Preserve hosted accounting and lifecycle work behind the shared host seam. */
4
+ export declare function sessionSupervisorOp(host: NimbusSession, envelope: SupervisorOpEnvelope): Promise<unknown>;
5
+ //# sourceMappingURL=supervisor-op.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-op.d.ts","sourceRoot":"","sources":["../../src/session/supervisor-op.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAuEzD,iFAAiF;AACjF,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,OAAO,CAAC,CASlB"}
@@ -0,0 +1,74 @@
1
+ // Only named supervisor operations are callable; no RPC name comes from input.
2
+ const routes = {
3
+ readFile: { method: '_rpcReadFile', args: [0, 'pid'] },
4
+ readFileBytes: { method: '_rpcReadFileBytes', args: [0, 'pid'] },
5
+ writeFile: { method: '_rpcWriteFile', args: [0, 1, 'pid'] },
6
+ stat: { method: '_rpcStat', args: [0, 'pid'] },
7
+ lstat: { method: '_rpcLstat', args: [0, 'pid'] },
8
+ hasLegacySymlinkUnder: { method: '_rpcHasLegacySymlinkUnder', args: [0, 'pid'] },
9
+ utimes: { method: '_rpcUtimes', args: [0, 1, 2, 'pid'] },
10
+ chmod: { method: '_rpcChmod', args: [0, 1, 'pid'] },
11
+ access: { method: '_rpcAccess', args: [0, 1, 'pid'] },
12
+ chown: { method: '_rpcChown', args: [0, 1, 2, 'pid', 3] },
13
+ setUmask: { method: '_rpcSetUmask', args: [0, 'pid'] },
14
+ readdir: { method: '_rpcReaddir', args: [0, 'pid'] },
15
+ exists: { method: '_rpcExists', args: [0, 'pid'] },
16
+ mkdir: { method: '_rpcMkdir', args: [0, 'pid'] },
17
+ rmdir: { method: '_rpcRmdir', args: [0, 'pid'] },
18
+ rename: { method: '_rpcRename', args: [0, 1, 'pid'] },
19
+ unlink: { method: '_rpcUnlink', args: [0, 'pid'] },
20
+ readlink: { method: '_rpcReadlink', args: [0, 'pid'] },
21
+ symlink: { method: '_rpcSymlink', args: [0, 1, 'pid'] },
22
+ fsAcquire: { method: '_rpcFsAcquire', args: [0, 1, 'pid'] },
23
+ fsRevision: { method: '_rpcFsRevision', args: [0, 'pid'] },
24
+ fsList: { method: '_rpcFsList', args: [0, 1, 'pid'] },
25
+ wsOpen: { method: '_rpcWsOpen', args: [0, 1, 'pid'] },
26
+ wsPoll: { method: '_rpcWsPoll', args: [0, 1, 'pid'] },
27
+ wsSend: { method: '_rpcWsSend', args: [0, 1, 2, 'pid'] },
28
+ wsClose: { method: '_rpcWsClose', args: [0, 1, 2, 'pid'] },
29
+ fsOpen: { method: '_rpcFsOpen', args: [0, 1, 'pid'] },
30
+ fsRead: { method: '_rpcFsRead', args: [0, 1, 2, 'pid'] },
31
+ fsWrite: { method: '_rpcFsWrite', args: [0, 1, 2, 'pid'] },
32
+ fsClose: { method: '_rpcFsClose', args: [0, 'pid'] },
33
+ fsReadRange: { method: '_rpcFsReadRange', args: [0, 1, 2, 'pid'] },
34
+ fsReadRangeUncached: { method: '_rpcFsReadRangeUncached', args: [0, 1, 2, 'pid'] },
35
+ fsReadBatch: { method: '_rpcFsReadBatch', args: [0, 'pid'] },
36
+ fsWriteRange: { method: '_rpcFsWriteRange', args: [0, 1, 2, 'pid'] },
37
+ fsAppend: { method: '_rpcFsAppend', args: [0, 'writerId', 1, 2, 3, 'pid'] },
38
+ fsAppendAck: { method: '_rpcFsAppendAck', args: [0, 1, 2, 'pid'] },
39
+ fsTruncate: { method: '_rpcFsTruncate', args: [0, 1, 'pid'] },
40
+ writeBatch: { method: '_rpcWriteBatch', args: [0, 'pid'] },
41
+ writeBatchStream: { method: '_rpcWriteBatchStream', args: ['stream', 'mutationOwner', 'pid'] },
42
+ putRegistryEntries: { method: '_rpcPutRegistryEntries', args: [0] },
43
+ stdout: { method: '_rpcStdout', args: ['pid', 0] },
44
+ stderr: { method: '_rpcStderr', args: ['pid', 0] },
45
+ reportExit: { method: '_rpcReportExit', args: ['pid', 0, 1] },
46
+ prefetch: { method: '_rpcPrefetch', args: [0, 1] },
47
+ registerPort: { method: '_rpcRegisterPort', args: ['pid', 0] },
48
+ ensureDurableApp: { method: '_rpcEnsureDurableApp', args: [0] },
49
+ removeDurableApp: { method: '_rpcRemoveDurableApp', args: [0] },
50
+ unregisterPort: { method: '_rpcUnregisterPort', args: [0] },
51
+ routeLoopback: { method: '_rpcRouteLoopback', args: [0, 1] },
52
+ transform: { method: '_rpcTransform', args: [0, 1] },
53
+ cpSpawn: { method: '_rpcCpSpawn', args: [0] },
54
+ cpStdinWrite: { method: '_rpcCpStdinWrite', args: [0, 1] },
55
+ cpStdinEnd: { method: '_rpcCpStdinEnd', args: [0] },
56
+ cpReadStdin: { method: '_rpcCpReadStdin', args: [0, 1] },
57
+ cpReadOutput: { method: '_rpcCpReadOutput', args: [0, 1, 2, 3] },
58
+ cpDrainOutput: { method: '_rpcCpDrainOutput', args: [0] },
59
+ cpKill: { method: '_rpcCpKill', args: [0, 1] },
60
+ cpWait: { method: '_rpcCpWait', args: [0, 1] },
61
+ cpDispatchInline: { method: '_rpcCpDispatchInline', args: [0, 1] },
62
+ };
63
+ /** Preserve hosted accounting and lifecycle work behind the shared host seam. */
64
+ export async function sessionSupervisorOp(host, envelope) {
65
+ if (!envelope || typeof envelope.op !== 'string' || !Object.hasOwn(routes, envelope.op)) {
66
+ throw new Error(`supervisor op: '${envelope?.op}' is not served by this host`);
67
+ }
68
+ const route = routes[envelope.op];
69
+ const args = route.args.map((slot) => typeof slot === 'number' ? envelope.args?.[slot] : envelope[slot]);
70
+ const method = host[route.method];
71
+ if (typeof method !== 'function')
72
+ throw new Error(`supervisor op: missing host method ${route.method}`);
73
+ return Reflect.apply(method, host, args);
74
+ }