@nimbus-sh/worker 0.2.3 → 0.3.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 (129) hide show
  1. package/dist/_shared/session-router.d.ts +8 -0
  2. package/dist/_shared/session-router.d.ts.map +1 -1
  3. package/dist/_shared/session-router.js +8 -0
  4. package/dist/facets/cirrus-real.js +1 -1
  5. package/dist/facets/manager.d.ts +40 -126
  6. package/dist/facets/manager.d.ts.map +1 -1
  7. package/dist/facets/manager.js +97 -313
  8. package/dist/facets/opencode-staging.d.ts +1 -1
  9. package/dist/facets/opencode-staging.d.ts.map +1 -1
  10. package/dist/facets/opencode-staging.js +4 -0
  11. package/dist/facets/vite-dev-server.d.ts +2 -2
  12. package/dist/facets/vite-dev-server.js +4 -4
  13. package/dist/git/commands.d.ts +8 -0
  14. package/dist/git/commands.d.ts.map +1 -1
  15. package/dist/git/commands.js +41 -9
  16. package/dist/git/network-facet.d.ts +1 -1
  17. package/dist/git/network-facet.d.ts.map +1 -1
  18. package/dist/git/network-facet.js +35 -12
  19. package/dist/git-bundle.generated.d.ts +2 -2
  20. package/dist/git-bundle.generated.d.ts.map +1 -1
  21. package/dist/git-bundle.generated.js +3 -3
  22. package/dist/index.js +1 -1
  23. package/dist/loaders/child-process/spawn-facet.js +1 -1
  24. package/dist/loaders/child-process/spawn-pool.d.ts.map +1 -1
  25. package/dist/loaders/child-process/spawn-pool.js +2 -2
  26. package/dist/loaders/generated-workers.d.ts +1 -1
  27. package/dist/loaders/generated-workers.d.ts.map +1 -1
  28. package/dist/loaders/generated-workers.js +2 -2
  29. package/dist/loaders/npm-resolve-preamble.d.ts +3 -3
  30. package/dist/loaders/npm-resolve-preamble.js +3 -3
  31. package/dist/loaders/pre-bundle-preamble.d.ts +5 -5
  32. package/dist/loaders/pre-bundle-preamble.js +6 -6
  33. package/dist/loaders/process-host.d.ts +6 -107
  34. package/dist/loaders/process-host.d.ts.map +1 -1
  35. package/dist/loaders/process-host.js +6 -405
  36. package/dist/npm/install-batch-facet.js +1 -1
  37. package/dist/npm/installer.d.ts +4 -4
  38. package/dist/npm/installer.js +18 -18
  39. package/dist/npm/pre-bundle-facet.d.ts +2 -2
  40. package/dist/npm/pre-bundle-facet.js +5 -5
  41. package/dist/npm/resolve-facet.d.ts +1 -1
  42. package/dist/npm/resolve-facet.js +1 -1
  43. package/dist/npm/resolve-one-facet.d.ts +5 -5
  44. package/dist/npm/resolve-one-facet.js +5 -5
  45. package/dist/router/index.js +1 -1
  46. package/dist/router/remote-api.js +8 -0
  47. package/dist/runtime/bun-repl.d.ts +1 -1
  48. package/dist/runtime/bun-repl.js +3 -3
  49. package/dist/runtime/facet-loader-host.d.ts +5 -8
  50. package/dist/runtime/facet-loader-host.d.ts.map +1 -1
  51. package/dist/runtime/facet-loader-host.js +7 -11
  52. package/dist/runtime/node-repl.js +2 -2
  53. package/dist/runtime/python-repl.js +3 -3
  54. package/dist/runtime/ruby-repl.js +2 -2
  55. package/dist/runtime/ruby-resident.js +1 -1
  56. package/dist/session/hibernation.d.ts +18 -51
  57. package/dist/session/hibernation.d.ts.map +1 -1
  58. package/dist/session/hibernation.js +49 -186
  59. package/dist/session/init-phases.d.ts +2 -2
  60. package/dist/session/init-phases.d.ts.map +1 -1
  61. package/dist/session/init-phases.js +1 -1
  62. package/dist/session/init.d.ts.map +1 -1
  63. package/dist/session/init.js +6 -3
  64. package/dist/session/keys.d.ts +14 -37
  65. package/dist/session/keys.d.ts.map +1 -1
  66. package/dist/session/keys.js +17 -37
  67. package/dist/session/nimbus-session.d.ts +10 -4
  68. package/dist/session/nimbus-session.d.ts.map +1 -1
  69. package/dist/session/nimbus-session.js +20 -11
  70. package/dist/session/port-capability.d.ts +43 -0
  71. package/dist/session/port-capability.d.ts.map +1 -0
  72. package/dist/session/port-capability.js +49 -0
  73. package/dist/session/programmatic.d.ts +41 -5
  74. package/dist/session/programmatic.d.ts.map +1 -1
  75. package/dist/session/programmatic.js +147 -15
  76. package/dist/session/routes.d.ts +2 -0
  77. package/dist/session/routes.d.ts.map +1 -1
  78. package/dist/session/routes.js +91 -16
  79. package/dist/session/rpc.d.ts +35 -8
  80. package/dist/session/rpc.d.ts.map +1 -1
  81. package/dist/session/rpc.js +73 -14
  82. package/dist/session/start-real-vite.d.ts.map +1 -1
  83. package/dist/session/start-real-vite.js +2 -0
  84. package/dist/session/state-store.d.ts +3 -2
  85. package/dist/session/state-store.d.ts.map +1 -1
  86. package/dist/session/state-store.js +3 -2
  87. package/dist/session/supervisor-rpc.d.ts.map +1 -1
  88. package/dist/session/supervisor-rpc.js +5 -0
  89. package/dist/session/ws.d.ts +2 -2
  90. package/dist/session/ws.d.ts.map +1 -1
  91. package/dist/session/ws.js +2 -2
  92. package/dist/wrangler/nimbus-wrangler.js +1 -1
  93. package/package.json +3 -2
  94. package/dist/facets/inner-do-registry.d.ts +0 -41
  95. package/dist/facets/inner-do-registry.d.ts.map +0 -1
  96. package/dist/facets/inner-do-registry.js +0 -51
  97. package/dist/facets/launch-pacer.d.ts +0 -111
  98. package/dist/facets/launch-pacer.d.ts.map +0 -1
  99. package/dist/facets/launch-pacer.js +0 -130
  100. package/dist/loaders/fanout-pool.d.ts +0 -207
  101. package/dist/loaders/fanout-pool.d.ts.map +0 -1
  102. package/dist/loaders/fanout-pool.js +0 -363
  103. package/dist/loaders/loader-pool.d.ts +0 -294
  104. package/dist/loaders/loader-pool.d.ts.map +0 -1
  105. package/dist/loaders/loader-pool.js +0 -642
  106. package/dist/loaders/process-fabric.d.ts +0 -509
  107. package/dist/loaders/process-fabric.d.ts.map +0 -1
  108. package/dist/loaders/process-fabric.js +0 -360
  109. package/dist/loaders/vendor/errors.d.ts +0 -24
  110. package/dist/loaders/vendor/errors.d.ts.map +0 -1
  111. package/dist/loaders/vendor/errors.js +0 -46
  112. package/dist/loaders/vendor/serialize.d.ts +0 -3
  113. package/dist/loaders/vendor/serialize.d.ts.map +0 -1
  114. package/dist/loaders/vendor/serialize.js +0 -25
  115. package/dist/loaders/vendor/types.d.ts +0 -69
  116. package/dist/loaders/vendor/types.d.ts.map +0 -1
  117. package/dist/loaders/vendor/types.js +0 -4
  118. package/dist/loaders/workerd-facet-host.d.ts +0 -141
  119. package/dist/loaders/workerd-facet-host.d.ts.map +0 -1
  120. package/dist/loaders/workerd-facet-host.js +0 -284
  121. package/dist/session/bindings.d.ts +0 -209
  122. package/dist/session/bindings.d.ts.map +0 -1
  123. package/dist/session/bindings.js +0 -680
  124. package/dist/session/ctx-exports.d.ts +0 -16
  125. package/dist/session/ctx-exports.d.ts.map +0 -1
  126. package/dist/session/ctx-exports.js +0 -22
  127. package/dist/session/ws-hibernation-config.d.ts +0 -64
  128. package/dist/session/ws-hibernation-config.d.ts.map +0 -1
  129. package/dist/session/ws-hibernation-config.js +0 -89
@@ -24,6 +24,8 @@
24
24
  * (~30 sites). RoutesHost = any pragmatic deviation, like InitHost in S6.
25
25
  */
26
26
  type RoutesHost = any;
27
+ /** Route a capability-authenticated embedder request to a guest HTTP server. */
28
+ export declare function routeCapabilityPort(self: RoutesHost, port: number, capability: string, request: Request, innerPath: string): Promise<Response>;
27
29
  export declare function handleFetch(self: RoutesHost, request: Request): Promise<Response>;
28
30
  export {};
29
31
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/session/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAsCH,KAAK,UAAU,GAAG,GAAG,CAAC;AAkQtB,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAi8BvF"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/session/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAoDH,KAAK,UAAU,GAAG,GAAG,CAAC;AA6LtB,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,QAAQ,CAAC,CAEnB;AAyGD,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8+BvF"}
@@ -40,7 +40,13 @@ import { ViteDevServer } from '../facets/vite-dev-server.js';
40
40
  import { notifyTerminalEvent, wireProcessLogSocketBroadcast } from '../runtime/process-logs-api.js';
41
41
  import { makeLongRunningPortStub } from '@nimbus-sh/core/runtime/long-running-handle.js';
42
42
  import { startRealVite } from './start-real-vite.js';
43
- import { getLoadedCodesStats } from './bindings.js';
43
+ import { getLoadedCodesStats } from '@nimbus-sh/fabric/bindings.js';
44
+ import { facetIdBudget } from '@nimbus-sh/fabric/workerd-facet-host.js';
45
+ import { loaderLedgerStats } from '@nimbus-sh/fabric/loader-ledger.js';
46
+ import { HOSTED_WEBSOCKET_CAPABILITY_HEADER, HOSTED_WEBSOCKET_KEY_HEADER, } from '@nimbus-sh/fabric/process-host.js';
47
+ import { routeHostedWebSocket } from './rpc.js';
48
+ import { clearPortCapability, persistPortCapability, readPortCapability, restorePortCapability, } from './port-capability.js';
49
+ import { PREVIEW_CAPABILITY_HEADER } from '../_shared/session-router.js';
44
50
  import { renderNoDevServerHtml } from './helpers.js';
45
51
  import { handleAgentRequest } from './agent.js';
46
52
  import { captureSessionAiCredential } from './ai.js';
@@ -50,7 +56,7 @@ import { CRED_KERNEL } from '@nimbus-sh/core/runtime/os-contracts.js';
50
56
  // uses (they did: the packument purge used a stale `/p/` segment).
51
57
  import { R2CacheClient, packumentL2Url, tarballL2Url, parseTarballAddress } from '../npm/r2-cache.js';
52
58
  import { fetchEsbuildWasmBytes, ESBUILD_WASM_L2_KEY } from '../runtime/esbuild-wasm-bytes.js';
53
- import { NimbusFanoutPool, IN_DO_THRESHOLD, MAX_PEER_FANOUT } from '../loaders/fanout-pool.js';
59
+ import { FanoutPool, IN_DO_THRESHOLD, MAX_PEER_FANOUT } from '@nimbus-sh/fabric/fanout-pool.js';
54
60
  import { z } from 'zod/v4';
55
61
  const TestSpawnEmitterBodySchema = z.object({
56
62
  lines: z.coerce.number().optional(),
@@ -105,6 +111,9 @@ async function restorePersistedDevServer(self, onlyPort) {
105
111
  const port = (config.port && Number.isFinite(config.port)) ? config.port : DEFAULT_VITE_PORT;
106
112
  if (onlyPort != null && onlyPort !== port)
107
113
  return;
114
+ // Read BEFORE the restore: bringing the server back re-registers the port,
115
+ // and a fresh registration mints a capability nobody was ever handed.
116
+ const persistedCapability = await readPortCapability(self, port);
108
117
  // A cirrus-real session rebuilds the real-vite facet, not the Cirrus shim —
109
118
  // same key, same starter the `vite` builtin uses, so a woken real-vite
110
119
  // session comes back as real-vite rather than degrading to the shim.
@@ -125,6 +134,7 @@ async function restorePersistedDevServer(self, onlyPort) {
125
134
  configDir: config.configDir || config.root,
126
135
  }).finally(() => { self._realViteRestore = null; });
127
136
  await self._realViteRestore;
137
+ await readoptCapability(self, port, persistedCapability);
128
138
  return;
129
139
  }
130
140
  self.ensureSqliteFs();
@@ -155,7 +165,9 @@ async function restorePersistedDevServer(self, onlyPort) {
155
165
  // restored server across hibernation cycles.
156
166
  try {
157
167
  self.portRegistry.bindFacetStub(entry.pid, makeLongRunningPortStub(self.viteDevServer));
168
+ await clearPortCapability(self, port);
158
169
  self.portRegistry.register(port, entry.pid);
170
+ await readoptCapability(self, port, persistedCapability);
159
171
  self._viteShimPid = entry.pid;
160
172
  self._viteShimPort = port;
161
173
  }
@@ -179,8 +191,18 @@ async function restorePersistedDevServer(self, onlyPort) {
179
191
  * the untrusted-code boundary and cannot carry it, and a plain user server on
180
192
  * any other port is mounted at root and needs no rewriting.
181
193
  */
182
- async function routeToSessionPort(self, port, request, innerPath, mountBase) {
194
+ async function routeToSessionPort(self, port, request, innerPath, mountBase, capability) {
183
195
  await restorePersistedDevServer(self, port);
196
+ if (capability !== undefined) {
197
+ // A rebuilt supervisor holds a capability nobody was handed; the durable
198
+ // one is the value in circulation, so it wins before the check.
199
+ await restorePortCapability(self, port);
200
+ if (!self.portRegistry.hasCapability(port, capability)) {
201
+ // 404, not 403: a wrong capability must not confirm that the port is
202
+ // listening at all.
203
+ return new Response('Not found', { status: 404 });
204
+ }
205
+ }
184
206
  if (port === self._viteShimPort) {
185
207
  // The preview HMR WebSocket can't cross the port-registry RPC, so it is
186
208
  // accepted in-DO for both dev servers — the same handling `/preview/` uses.
@@ -193,11 +215,28 @@ async function routeToSessionPort(self, port, request, innerPath, mountBase) {
193
215
  return self.viteDevServer.handleRequest(request, innerPath, mountBase);
194
216
  }
195
217
  }
196
- const proxied = await self.portRegistry.routeRequest(port, request, innerPath);
218
+ const proxied = capability === undefined
219
+ ? await self.portRegistry.routeRequest(port, request, innerPath)
220
+ : await self.portRegistry.routeCapabilityRequest(port, capability, request, innerPath);
197
221
  if (proxied)
198
222
  return proxied;
199
223
  return new Response(`No process listening on port ${port}`, { status: 502 });
200
224
  }
225
+ /**
226
+ * Re-adopt a preview capability the embedder already holds, after a restore
227
+ * re-registered the port under a freshly minted one.
228
+ */
229
+ async function readoptCapability(self, port, capability) {
230
+ if (!capability)
231
+ return;
232
+ if (self.portRegistry.restoreCapability(port, capability)) {
233
+ await persistPortCapability(self, port, capability);
234
+ }
235
+ }
236
+ /** Route a capability-authenticated embedder request to a guest HTTP server. */
237
+ export function routeCapabilityPort(self, port, capability, request, innerPath) {
238
+ return routeToSessionPort(self, port, request, normalizeForwardedHttpPath(innerPath), '', capability);
239
+ }
201
240
  /**
202
241
  * The public URL prefix a port-routed request is mounted at. `<port>--<sid>`
203
242
  * hosts arrive with an empty base header (mounted at the origin root); the
@@ -294,6 +333,23 @@ async function parseJsonBody(request, schema) {
294
333
  }
295
334
  export async function handleFetch(self, request) {
296
335
  const url = new URL(request.url);
336
+ // The peer end of the fetch-semantic WebSocket hop, before anything else:
337
+ // this request is a sibling coordinator's, not a browser's, and it names
338
+ // the hosted process rather than a route on this session. Both headers are
339
+ // stripped so the process never sees the transport that carried it.
340
+ const hostedWebSocket = request.headers.get(HOSTED_WEBSOCKET_KEY_HEADER);
341
+ if (hostedWebSocket) {
342
+ if (request.headers.get('upgrade')?.toLowerCase() !== 'websocket') {
343
+ return new Response('Expected WebSocket', { status: 426 });
344
+ }
345
+ const capability = request.headers.get(HOSTED_WEBSOCKET_CAPABILITY_HEADER);
346
+ if (!capability)
347
+ return new Response('Not found', { status: 404 });
348
+ const headers = new Headers(request.headers);
349
+ headers.delete(HOSTED_WEBSOCKET_KEY_HEADER);
350
+ headers.delete(HOSTED_WEBSOCKET_CAPABILITY_HEADER);
351
+ return routeHostedWebSocket(self, hostedWebSocket, capability, new Request(request.url, { method: request.method, headers }));
352
+ }
297
353
  // Capture session basePath from the routing header (if forwarded by the
298
354
  // Worker's session-router). Threaded through to ViteDevServer so the
299
355
  // served app's module URLs, HMR paths, <base href>, and router basename
@@ -666,11 +722,19 @@ export async function handleFetch(self, request) {
666
722
  // (32 entries) with FIFO eviction. The counters here let
667
723
  // ops dashboards visualise the bound + the eviction rate.
668
724
  loadedCodes: getLoadedCodesStats(),
725
+ // Per-DO Worker Loader accounting: distinct loader ids ever gotten
726
+ // (each permanently holds one of the ~5-6 dynamic-worker slots) and
727
+ // live/peak concurrent Loader fetches.
728
+ loader: loaderLedgerStats(self.ctx),
669
729
  rpc: {
670
730
  lastFrame: getLastRpcFrame(),
671
731
  },
672
732
  facet: {
673
733
  lastDispatch: getLastFacetId(),
734
+ // Facet IDs consumed over this DO's LIFETIME against the 65,536 the
735
+ // platform will ever grant it. Append-only and never reclaimed;
736
+ // crossing the wall is unrecoverable for the object.
737
+ idBudget: await facetIdBudget(self.ctx),
674
738
  },
675
739
  // ── v3 / C' observability foundation ──────────────────────
676
740
  heap,
@@ -685,7 +749,7 @@ export async function handleFetch(self, request) {
685
749
  // `autoResponseConfigured` reports the runtime's actual
686
750
  // capability (older workerd builds report false).
687
751
  hib: {
688
- isolateGen: self._w9IsolateGen,
752
+ isolateGen: self._isolateGen,
689
753
  autoResponseConfigured: self._w9WsConfig?.autoResponseConfigured ?? false,
690
754
  autoResponseError: self._w9WsConfig?.autoResponseError ?? null,
691
755
  hibernationEventTimeoutMs: self._w9WsConfig?.timeoutSetMs ?? null,
@@ -852,7 +916,7 @@ export async function handleFetch(self, request) {
852
916
  fromState: body.fromState,
853
917
  toState: body.toState,
854
918
  trigger: body.trigger,
855
- isolateGen: body.isolateGen || self._w9IsolateGen,
919
+ isolateGen: body.isolateGen || self._isolateGen,
856
920
  dataLoss: body.dataLoss === true,
857
921
  snapshotKeysRehydrated: body.snapshotKeysRehydrated || 0,
858
922
  notes: body.notes,
@@ -890,7 +954,7 @@ export async function handleFetch(self, request) {
890
954
  }
891
955
  // ── two-tier-fanout primitive probe ──────────────────────────────
892
956
  // in-DO fanout in-DO and peer-DO fanout peer-DO speedups via the
893
- // NimbusFanoutPool primitive. Independent of any specific
957
+ // FanoutPool primitive. Independent of any specific
894
958
  // production site (install-batch, pre-bundle, etc.) so the
895
959
  // primitive's behavior can be measured cleanly without
896
960
  // confounders.
@@ -1016,6 +1080,7 @@ export async function handleFetch(self, request) {
1016
1080
  try {
1017
1081
  const apiViteStub = makeLongRunningPortStub(self.viteDevServer);
1018
1082
  self.portRegistry.bindFacetStub(apiViteEntry.pid, apiViteStub);
1083
+ await clearPortCapability(self, apiVitePort);
1019
1084
  self.portRegistry.register(apiVitePort, apiViteEntry.pid);
1020
1085
  self._viteShimPid = apiViteEntry.pid;
1021
1086
  self._viteShimPort = apiVitePort;
@@ -1220,7 +1285,10 @@ export async function handleFetch(self, request) {
1220
1285
  if (portMatch) {
1221
1286
  const port = parseInt(portMatch[1]);
1222
1287
  const path = normalizeForwardedHttpPath(portMatch[2] || '/');
1223
- return routeToSessionPort(self, port, request, path, portRouteMountBase(request, port));
1288
+ // An embedder that authenticated a preview capability at its own edge
1289
+ // forwards it here; the guest's Authorization then survives the hop.
1290
+ const capability = request.headers.get(PREVIEW_CAPABILITY_HEADER);
1291
+ return routeToSessionPort(self, port, request, path, portRouteMountBase(request, port), capability ?? undefined);
1224
1292
  }
1225
1293
  // ── /api/_diag/cache — per-tier cache observability ───────────────
1226
1294
  //
@@ -1240,7 +1308,12 @@ export async function handleFetch(self, request) {
1240
1308
  const { readExecTelemetry } = await import('../facets/exec-telemetry.js');
1241
1309
  return Response.json({ records: readExecTelemetry() });
1242
1310
  }
1311
+ // Write surfaces gated like /api/_test/*: zeroing telemetry from prod
1312
+ // would erase the evidence an investigation is standing on, so without
1313
+ // NIMBUS_DEBUG these 404 rather than being a free reset vector.
1243
1314
  if (url.pathname === '/api/_diag/exec/reset' && request.method === 'POST') {
1315
+ if (!self.nimbusDebug)
1316
+ return new Response('not found', { status: 404 });
1244
1317
  const { resetExecTelemetry } = await import('../facets/exec-telemetry.js');
1245
1318
  resetExecTelemetry();
1246
1319
  return new Response(null, { status: 204 });
@@ -1251,6 +1324,8 @@ export async function handleFetch(self, request) {
1251
1324
  return Response.json(snap);
1252
1325
  }
1253
1326
  if (url.pathname === '/api/_diag/cache/reset' && request.method === 'POST') {
1327
+ if (!self.nimbusDebug)
1328
+ return new Response('not found', { status: 404 });
1254
1329
  const { reset } = await import('@nimbus-sh/core/_shared/cache-stats.js');
1255
1330
  reset();
1256
1331
  return new Response(null, { status: 204 });
@@ -1396,7 +1471,7 @@ async function handleCacheTestEndpoint(self, url, request) {
1396
1471
  }
1397
1472
  // ── two-tier-fanout primitive benchmark endpoint ────────────────────────
1398
1473
  //
1399
- // Routes under /api/_test/fanout/* exercise NimbusFanoutPool's two
1474
+ // Routes under /api/_test/fanout/* exercise FanoutPool's two
1400
1475
  // topologies (in-DO fanout in-DO + peer-DO fanout peer-DO) via a synthetic workload
1401
1476
  // that's independent of the production install-batch / pre-bundle
1402
1477
  // sites. The probe measures speedup, peer-DO routing determinism,
@@ -1425,7 +1500,7 @@ async function handleFanoutTestEndpoint(self, url, request) {
1425
1500
  const path = url.pathname;
1426
1501
  if (path === '/api/_test/fanout/topology' && request.method === 'GET') {
1427
1502
  const n = Math.max(0, parseInt(url.searchParams.get('n') || '0', 10));
1428
- const pool = new NimbusFanoutPool(env, self.ctx, {
1503
+ const pool = new FanoutPool(env, self.ctx, {
1429
1504
  tag: 'fanout-bench',
1430
1505
  timeoutMs: 60_000,
1431
1506
  });
@@ -1440,7 +1515,7 @@ async function handleFanoutTestEndpoint(self, url, request) {
1440
1515
  const keysRaw = url.searchParams.get('keys') || '';
1441
1516
  const keys = keysRaw.split(',').map((k) => k.trim()).filter(Boolean);
1442
1517
  const peerCount = Math.max(1, Math.min(parseInt(url.searchParams.get('n') || String(keys.length), 10), MAX_PEER_FANOUT));
1443
- const pool = new NimbusFanoutPool(env, self.ctx, {
1518
+ const pool = new FanoutPool(env, self.ctx, {
1444
1519
  tag: 'fanout-bench',
1445
1520
  timeoutMs: 60_000,
1446
1521
  });
@@ -1454,7 +1529,7 @@ async function handleFanoutTestEndpoint(self, url, request) {
1454
1529
  const body = await parseJsonBody(request, FanoutBenchBodySchema);
1455
1530
  const n = Math.max(1, Math.min(64, body.n || 8));
1456
1531
  const sleepMs = Math.max(0, Math.min(2000, body.sleepMs || 100));
1457
- const pool = new NimbusFanoutPool(env, self.ctx, {
1532
+ const pool = new FanoutPool(env, self.ctx, {
1458
1533
  tag: 'fanout-bench',
1459
1534
  timeoutMs: 60_000,
1460
1535
  });
@@ -1470,7 +1545,7 @@ async function handleFanoutTestEndpoint(self, url, request) {
1470
1545
  const results = await pool.submitMany(tasks, async (item, env) => {
1471
1546
  const startMs = Date.now();
1472
1547
  // Identify which env we're running in. SUPERVISOR is the
1473
- // RPC stub auto-injected by NimbusLoaderPool; its presence
1548
+ // RPC stub auto-injected by LoaderPool; its presence
1474
1549
  // tells us we're inside a loader isolate (not the supervisor).
1475
1550
  const loaderEnvKeys = Object.keys(env || {}).sort();
1476
1551
  // Sleep entirely inside the isolate — no external network.
@@ -1510,11 +1585,11 @@ async function handleFanoutTestEndpoint(self, url, request) {
1510
1585
  const n = Math.max(1, Math.min(64, body.n || 8));
1511
1586
  const sleepMs = Math.max(0, Math.min(2000, body.sleepMs || 100));
1512
1587
  // Same workload, but FORCE serial dispatch by using a single
1513
- // NimbusLoaderPool with concurrency=1 and submitting one task
1588
+ // LoaderPool with concurrency=1 and submitting one task
1514
1589
  // at a time. This is the T_serial reference for the 5× speedup
1515
1590
  // assertion.
1516
- const { NimbusLoaderPool } = await import('../loaders/loader-pool.js');
1517
- const pool = new NimbusLoaderPool(env, self.ctx, {
1591
+ const { LoaderPool } = await import('@nimbus-sh/fabric/loader-pool.js');
1592
+ const pool = new LoaderPool(env, self.ctx, {
1518
1593
  concurrency: 1,
1519
1594
  timeoutMs: 60_000,
1520
1595
  tag: 'fanout-serial',
@@ -21,8 +21,8 @@
21
21
  * these ~3 sites would each need ctx threaded through; cast at boundary
22
22
  * is acceptable per plan §IX recommendation 1.
23
23
  */
24
- import { type ResidentFacet } from '../loaders/workerd-facet-host.js';
25
- import { type HostedHttpRequest, type HostedHttpResponse } from '../loaders/process-host.js';
24
+ import { type ResidentFacet } from '@nimbus-sh/fabric/workerd-facet-host.js';
25
+ import { type HostedHttpRequest, type HostedHttpResponse } from '@nimbus-sh/fabric/process-host.js';
26
26
  import { type RuntimeOpenFlags, type VfsAcquireResult, type VfsListPage } from '@nimbus-sh/core/runtime/os-contracts.js';
27
27
  import type { WriteBatchStreamResult } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
28
28
  import { z } from 'zod/v4';
@@ -59,6 +59,21 @@ export declare function _rpcInnerDoFetch(self: RpcHost, req: {
59
59
  body: ArrayBuffer | null;
60
60
  }>;
61
61
  export declare function _rpcWriteFile(self: RpcHost, path: string, content: string | Uint8Array, pid?: number): Promise<number>;
62
+ /**
63
+ * Write one host-governed file at a session root and let ordinary Unix
64
+ * permissions keep it that way: the root becomes a sticky 1777 directory owned
65
+ * by the kernel, and the file itself is kernel-owned and read-only.
66
+ *
67
+ * The guest keeps normal use of the root — it creates, edits and removes its
68
+ * own files there, which is what the sticky bit is for — and cannot replace,
69
+ * rename or remove this one. That is the whole mechanism; there is no special
70
+ * case anywhere in the filesystem for it.
71
+ *
72
+ * Deliberately absent from the remote HTTP RPC dispatcher: the point is a file
73
+ * the sandboxed program cannot forge, so only an embedder holding the DO stub
74
+ * may write it.
75
+ */
76
+ export declare function _rpcWriteProtectedRootFile(self: RpcHost, rootPath: string, path: string, content: string | Uint8Array): Promise<void>;
62
77
  export declare function _rpcStat(self: RpcHost, path: string, pid?: number): Promise<any>;
63
78
  export declare function _rpcLstat(self: RpcHost, path: string, pid?: number): Promise<any>;
64
79
  export declare function _rpcHasLegacySymlinkUnder(self: RpcHost, path: string, pid?: number): Promise<boolean>;
@@ -342,11 +357,11 @@ export declare function vfsReaddir(self: RpcHost, path: string): {
342
357
  /** RPC: Write a file to the VFS. */
343
358
  export declare function vfsWriteFile(self: RpcHost, path: string, data: ArrayBuffer): void;
344
359
  /**
345
- * RPC: peer-DO execute leg of NimbusFanoutPool's peer-DO fanout topology.
360
+ * RPC: peer-DO execute leg of FanoutPool's peer-DO fanout topology.
346
361
  *
347
362
  * Called by a coordinator NimbusSession DO via
348
363
  * `env.NIMBUS_SESSION.idFromName(siblingName).get()._rpcFanoutExecute(...)`.
349
- * THIS DO instance acts as a peer worker: it runs ONE NimbusLoaderPool
364
+ * THIS DO instance acts as a peer worker: it runs ONE LoaderPool
350
365
  * over its assigned shard and returns the per-task results.
351
366
  *
352
367
  * Cap-sidestep mechanic
@@ -370,9 +385,9 @@ export declare function vfsWriteFile(self: RpcHost, path: string, data: ArrayBuf
370
385
  * Bytes-isolation
371
386
  * ───────────────
372
387
  * The fnSource string is forwarded verbatim into a fresh
373
- * NimbusLoaderPool, which serializes it into the loader's worker
388
+ * LoaderPool, which serializes it into the loader's worker
374
389
  * code. No supervisor-side eval. Same trust posture as every other
375
- * NimbusLoaderPool dispatch.
390
+ * LoaderPool dispatch.
376
391
  */
377
392
  export declare function _rpcFanoutExecute(self: RpcHost, fnSource: string, args: unknown[], poolOpts?: {
378
393
  tag?: string;
@@ -383,7 +398,7 @@ export declare function _rpcFanoutExecute(self: RpcHost, fnSource: string, args:
383
398
  omitSupervisor?: boolean;
384
399
  /**
385
400
  * INSTALL-HONESTY: full doId of the COORDINATOR (the DO that
386
- * called NimbusFanoutPool.submitMany). The peer's NimbusLoaderPool
401
+ * called FanoutPool.submitMany). The peer's LoaderPool
387
402
  * uses this to mint a SUPERVISOR binding that routes back to the
388
403
  * coordinator instead of the peer (default behavior pre-fix).
389
404
  * Without this, install-batch's writeBatchStream calls from inside
@@ -393,7 +408,7 @@ export declare function _rpcFanoutExecute(self: RpcHost, fnSource: string, args:
393
408
  /**
394
409
  * Invoking process pid, forwarded into the peer-side SUPERVISOR
395
410
  * binding so writeBatchStream is authorized under the caller's
396
- * credential (see NimbusLoaderPoolOptions.supervisorPid).
411
+ * credential (see LoaderPoolOptions.supervisorPid).
397
412
  */
398
413
  supervisorPid?: number;
399
414
  }): Promise<{
@@ -408,6 +423,8 @@ export declare function _rpcFanoutExecute(self: RpcHost, fnSource: string, args:
408
423
  export interface HostedProcessRecord {
409
424
  facet: Promise<ResidentFacet>;
410
425
  started: Promise<unknown>;
426
+ /** Unforgeable capability for the fetch-semantic WebSocket hop. */
427
+ webSocketCapability: string;
411
428
  /** Settles when the coordinator cancels or the process is torn down. */
412
429
  cancelled: Promise<void>;
413
430
  cancel(): void;
@@ -478,6 +495,16 @@ export declare function _rpcAwaitHostedBoot(self: RpcHost, workerKey: string): P
478
495
  * what leaves here must not be an object the loaded worker owns.
479
496
  */
480
497
  export declare function _rpcRouteHostedHttp(self: RpcHost, workerKey: string, wire: HostedHttpRequest): Promise<HostedHttpResponse>;
498
+ /**
499
+ * The peer end of the upgrade hop. Reached by `fetch` rather than RPC, so the
500
+ * 101 and its live socket travel back as themselves.
501
+ *
502
+ * The workerKey names a process and is derivable from a pid, so it does not
503
+ * authorise on its own; the capability is minted by whoever opened the process
504
+ * and never leaves the two sessions that hold it. A mismatch is a 404 and not
505
+ * a 403, so the route reveals nothing about what this peer is hosting.
506
+ */
507
+ export declare function routeHostedWebSocket(self: RpcHost, workerKey: string, capability: string, request: Request): Promise<Response>;
481
508
  /**
482
509
  * RPC: deterministic kill of a hosted process — the same teardown a
483
510
  * coordinator applies to a facet of its own, and it does not answer until it
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/session/rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAgBH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAapC,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,KAAK,WAAW,EACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAoC,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AASlH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAO3B,KAAK,OAAO,GAAG,GAAG,CAAC;AAwHnB,wBAAsB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQpG;AAEC;;;;GAIG;AACL,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAK7G;AAEC;;;;;;;;;;GAUG;AACL,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;IACv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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"}
@@ -24,15 +24,17 @@
24
24
  import { enc, dec } from '@nimbus-sh/core/_shared/bytes.js';
25
25
  import { normalizeTerminalNewlines } from '@nimbus-sh/core/_shared/terminal.js';
26
26
  import { disposeRpcResource } from '@nimbus-sh/core/_shared/rpc-dispose.js';
27
- import { getInnerDoClass } from '../facets/inner-do-registry.js';
27
+ import { getInnerDoClass } from '@nimbus-sh/fabric/inner-do-registry.js';
28
28
  import { NpmCache } from '../npm/cache.js';
29
29
  import { EsbuildService } from '@nimbus-sh/core/runtime/esbuild-service.js';
30
30
  import { SqliteRuntimeFsBridge } from '@nimbus-sh/core/runtime/sqlite-runtime-fs-bridge.js';
31
31
  import { notifyTerminalEvent } from '../runtime/process-logs-api.js';
32
- import { NimbusLoaderPool } from '../loaders/loader-pool.js';
33
- import { ResidentBootSpecSchema, } from '../loaders/process-fabric.js';
34
- import { getNimbusCtxExports, openResidentFacet, } from '../loaders/workerd-facet-host.js';
35
- import { headerPairs, isolateToken, } from '../loaders/process-host.js';
32
+ import { LoaderPool } from '@nimbus-sh/fabric/loader-pool.js';
33
+ import { residentBootSpecSchema, } from '@nimbus-sh/fabric/process-fabric.js';
34
+ import { openResidentFacet, } from '@nimbus-sh/fabric/workerd-facet-host.js';
35
+ import { supervisorEntrypoint } from '@nimbus-sh/fabric/ctx-exports.js';
36
+ import { headerPairs, isolateToken, } from '@nimbus-sh/fabric/process-host.js';
37
+ import { OpencodeStageSpecSchema } from '../facets/opencode-staging.js';
36
38
  import { recordFailure, getLastRpcFrame, getLastFacetId, } from '@nimbus-sh/core/observability/oom-discriminator.js';
37
39
  import { classifyError } from '@nimbus-sh/core/observability/oom-classify.js';
38
40
  import { acquireSupervisorReadAllocation, } from '@nimbus-sh/core/observability/heavy-alloc-coord.js';
@@ -41,6 +43,8 @@ import { CRED_KERNEL, CRED_SESSION_USER, } from '@nimbus-sh/core/runtime/os-cont
41
43
  import { getSymlinkRegistry } from '@nimbus-sh/core/vfs/symlink-registry.js';
42
44
  import { FS_LIST_PAGE_LIMIT, FS_READ_BATCH_PATH_LIMIT, FS_READ_BATCH_REQUEST_BYTES, MAX_RPC_SAFE_PAYLOAD_BYTES, } from '@nimbus-sh/core/constants.js';
43
45
  import { routeSessionLoopback } from './loopback.js';
46
+ import { clearPortCapability } from './port-capability.js';
47
+ import { normalizeVfsPath, parentVfsPath } from '@nimbus-sh/core/vfs/path.js';
44
48
  import { z } from 'zod/v4';
45
49
  const WriteBatchInodeSchema = z.object({
46
50
  path: z.string(),
@@ -238,6 +242,37 @@ export async function _rpcWriteFile(self, path, content, pid) {
238
242
  // a plain Uint8Array on the cell — the shape that arrives here.
239
243
  return runtimeFs(self, pid).writeFile(path, content);
240
244
  }
245
+ /**
246
+ * Write one host-governed file at a session root and let ordinary Unix
247
+ * permissions keep it that way: the root becomes a sticky 1777 directory owned
248
+ * by the kernel, and the file itself is kernel-owned and read-only.
249
+ *
250
+ * The guest keeps normal use of the root — it creates, edits and removes its
251
+ * own files there, which is what the sticky bit is for — and cannot replace,
252
+ * rename or remove this one. That is the whole mechanism; there is no special
253
+ * case anywhere in the filesystem for it.
254
+ *
255
+ * Deliberately absent from the remote HTTP RPC dispatcher: the point is a file
256
+ * the sandboxed program cannot forge, so only an embedder holding the DO stub
257
+ * may write it.
258
+ */
259
+ export async function _rpcWriteProtectedRootFile(self, rootPath, path, content) {
260
+ self.ensureSqliteFs();
261
+ const root = normalizeVfsPath(rootPath);
262
+ const protectedPath = normalizeVfsPath(path);
263
+ if (!root || parentVfsPath(protectedPath) !== root) {
264
+ throw new Error('protected file must be a direct child of the declared session root');
265
+ }
266
+ const fs = self.sqliteFs.as(CRED_KERNEL);
267
+ if (!fs.exists(root) || !fs.isDirectory(root)) {
268
+ throw new Error('protected file session root does not exist');
269
+ }
270
+ fs.chown(root, CRED_KERNEL.uid, CRED_KERNEL.gid);
271
+ fs.chmod(root, 0o1777);
272
+ fs.writeFile(protectedPath, content);
273
+ fs.chown(protectedPath, CRED_KERNEL.uid, CRED_KERNEL.gid);
274
+ fs.chmod(protectedPath, 0o444);
275
+ }
241
276
  export async function _rpcStat(self, path, pid) {
242
277
  return runtimeFs(self, pid).stat(path);
243
278
  }
@@ -975,6 +1010,8 @@ export async function _rpcPrefetch(self, cwd, entryCode) {
975
1010
  export async function _rpcRegisterPort(self, pid, port) {
976
1011
  // Port registration stores the facet association
977
1012
  // The actual facet stub is stored by FacetManager separately
1013
+ // A new registration retires the previous occupant's preview capability.
1014
+ await clearPortCapability(self, port);
978
1015
  self.portRegistry.register(port, pid);
979
1016
  }
980
1017
  export async function _rpcUnregisterPort(self, port) {
@@ -1135,11 +1172,11 @@ export function vfsWriteFile(self, path, data) {
1135
1172
  self.sqliteFs.as(CRED_KERNEL).writeFile(stripped, new Uint8Array(data));
1136
1173
  }
1137
1174
  /**
1138
- * RPC: peer-DO execute leg of NimbusFanoutPool's peer-DO fanout topology.
1175
+ * RPC: peer-DO execute leg of FanoutPool's peer-DO fanout topology.
1139
1176
  *
1140
1177
  * Called by a coordinator NimbusSession DO via
1141
1178
  * `env.NIMBUS_SESSION.idFromName(siblingName).get()._rpcFanoutExecute(...)`.
1142
- * THIS DO instance acts as a peer worker: it runs ONE NimbusLoaderPool
1179
+ * THIS DO instance acts as a peer worker: it runs ONE LoaderPool
1143
1180
  * over its assigned shard and returns the per-task results.
1144
1181
  *
1145
1182
  * Cap-sidestep mechanic
@@ -1163,9 +1200,9 @@ export function vfsWriteFile(self, path, data) {
1163
1200
  * Bytes-isolation
1164
1201
  * ───────────────
1165
1202
  * The fnSource string is forwarded verbatim into a fresh
1166
- * NimbusLoaderPool, which serializes it into the loader's worker
1203
+ * LoaderPool, which serializes it into the loader's worker
1167
1204
  * code. No supervisor-side eval. Same trust posture as every other
1168
- * NimbusLoaderPool dispatch.
1205
+ * LoaderPool dispatch.
1169
1206
  */
1170
1207
  export async function _rpcFanoutExecute(self, fnSource, args, poolOpts = {}) {
1171
1208
  if (!Array.isArray(args)) {
@@ -1179,7 +1216,7 @@ export async function _rpcFanoutExecute(self, fnSource, args, poolOpts = {}) {
1179
1216
  // with N=8 peers, that's 7 tasks per peer, capped to 4 here so
1180
1217
  // each peer DO stays safely below the cap.
1181
1218
  const concurrency = Math.min(args.length, 4);
1182
- const pool = new NimbusLoaderPool(self.env, self.ctx, {
1219
+ const pool = new LoaderPool(self.env, self.ctx, {
1183
1220
  concurrency,
1184
1221
  timeoutMs: poolOpts.timeoutMs,
1185
1222
  tag: poolOpts.tag ?? 'fanout-peer',
@@ -1189,7 +1226,7 @@ export async function _rpcFanoutExecute(self, fnSource, args, poolOpts = {}) {
1189
1226
  omitSupervisor: poolOpts.omitSupervisor,
1190
1227
  // INSTALL-HONESTY: route SUPERVISOR.* back to the coordinator
1191
1228
  // (the user's session DO), not the peer DO. When undefined
1192
- // (back-compat with non-fanout callers), NimbusLoaderPool falls
1229
+ // (back-compat with non-fanout callers), LoaderPool falls
1193
1230
  // back to ctx.id.toString() — the legacy behavior, correct for
1194
1231
  // single-DO callers.
1195
1232
  supervisorDoIdOverride: poolOpts.coordinatorDoId,
@@ -1222,6 +1259,9 @@ export async function _rpcFanoutExecute(self, fnSource, args, poolOpts = {}) {
1222
1259
  // Nothing here knows what the process is, and nothing here decides anything: a
1223
1260
  // coordinator reaches this leg only because its deployment set
1224
1261
  // NIMBUS_PROCESS_HOST=peer. See loaders/process-host.ts.
1262
+ /** The fabric's boot-spec shape, with the staged arm validated as Nimbus's
1263
+ * opencode stage — this RPC is the peer's trust boundary for it. */
1264
+ const ResidentBootSpecSchema = residentBootSpecSchema(OpencodeStageSpecSchema);
1225
1265
  const HostProcessOptsSchema = z.object({
1226
1266
  /** Full doId of the coordinator session (SUPERVISOR routing target). */
1227
1267
  coordinatorDoId: z.string().min(1),
@@ -1231,6 +1271,8 @@ const HostProcessOptsSchema = z.object({
1231
1271
  writerId: z.string().uuid(),
1232
1272
  /** Keyed dynamic-worker identity on THIS peer's loader. */
1233
1273
  workerKey: z.string().min(1),
1274
+ /** Unforgeable capability for the fetch-semantic WebSocket hop. */
1275
+ webSocketCapability: z.string().uuid(),
1234
1276
  /** Opaque arguments forwarded to the runner's startProcess. */
1235
1277
  startArgs: z.unknown().optional(),
1236
1278
  });
@@ -1263,11 +1305,11 @@ const HOSTED_RECORD_WAIT_MS = 30_000;
1263
1305
  */
1264
1306
  const RESIDENT_READ_RANGE_BYTES = 4 * 1024 * 1024;
1265
1307
  function peerDiskReader(supervisor) {
1266
- const ctxExports = getNimbusCtxExports();
1267
- if (!ctxExports.SupervisorRPC) {
1308
+ const supervisorRpc = supervisorEntrypoint();
1309
+ if (!supervisorRpc) {
1268
1310
  throw new Error('Nimbus: ctx.exports.SupervisorRPC unavailable');
1269
1311
  }
1270
- const fs = ctxExports.SupervisorRPC({ props: supervisor });
1312
+ const fs = supervisorRpc({ props: supervisor });
1271
1313
  return { readFile: (path) => readSupervisorFile(fs, path) };
1272
1314
  }
1273
1315
  async function readSupervisorFile(fs, path) {
@@ -1387,6 +1429,7 @@ export async function _rpcHostProcess(self, boot, opts) {
1387
1429
  registerHostedRecord(self, workerKey, {
1388
1430
  facet: facetPromise,
1389
1431
  started: startedPromise,
1432
+ webSocketCapability: hostOpts.webSocketCapability,
1390
1433
  cancelled,
1391
1434
  cancel,
1392
1435
  });
@@ -1485,6 +1528,22 @@ export async function _rpcRouteHostedHttp(self, workerKey, wire) {
1485
1528
  body,
1486
1529
  };
1487
1530
  }
1531
+ /**
1532
+ * The peer end of the upgrade hop. Reached by `fetch` rather than RPC, so the
1533
+ * 101 and its live socket travel back as themselves.
1534
+ *
1535
+ * The workerKey names a process and is derivable from a pid, so it does not
1536
+ * authorise on its own; the capability is minted by whoever opened the process
1537
+ * and never leaves the two sessions that hold it. A mismatch is a 404 and not
1538
+ * a 403, so the route reveals nothing about what this peer is hosting.
1539
+ */
1540
+ export async function routeHostedWebSocket(self, workerKey, capability, request) {
1541
+ const record = await awaitHostedRecord(self, workerKey);
1542
+ if (record.webSocketCapability !== capability)
1543
+ return new Response('Not found', { status: 404 });
1544
+ const facet = await record.facet;
1545
+ return facet.handleWebSocketRequest(request);
1546
+ }
1488
1547
  /**
1489
1548
  * RPC: deterministic kill of a hosted process — the same teardown a
1490
1549
  * coordinator applies to a facet of its own, and it does not answer until it
@@ -1 +1 @@
1
- {"version":3,"file":"start-real-vite.d.ts","sourceRoot":"","sources":["../../src/session/start-real-vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKtD,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB;gEAC4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;4EACwE;IACxE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,+EAA+E;IAC/E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,8CAA8C;IAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA6GvG"}
1
+ {"version":3,"file":"start-real-vite.d.ts","sourceRoot":"","sources":["../../src/session/start-real-vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMtD,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB;gEAC4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;4EACwE;IACxE,aAAa,CAAC,EAAE,CAAC,OAAO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