@nimbus-sh/worker 0.1.2 → 0.1.4

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 (160) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +6 -0
  3. package/README.md +2 -2
  4. package/dist/_shared/cache-stats.d.ts +1 -1
  5. package/dist/_shared/cache-stats.js +1 -1
  6. package/dist/_shared/exports-resolver.d.ts +0 -2
  7. package/dist/_shared/exports-resolver.d.ts.map +1 -1
  8. package/dist/_shared/exports-resolver.js +0 -2
  9. package/dist/_shared/session-router.d.ts +0 -1
  10. package/dist/_shared/session-router.d.ts.map +1 -1
  11. package/dist/_shared/session-router.js +0 -1
  12. package/dist/constants.d.ts.map +1 -1
  13. package/dist/constants.js +0 -1
  14. package/dist/facets/cirrus-real.d.ts +1 -1
  15. package/dist/facets/cirrus-real.js +1 -1
  16. package/dist/facets/manager.d.ts +0 -1
  17. package/dist/facets/manager.d.ts.map +1 -1
  18. package/dist/facets/manager.js +3 -15
  19. package/dist/facets/process.d.ts +2 -2
  20. package/dist/facets/process.js +2 -2
  21. package/dist/facets/vite-dev-server.d.ts +3 -3
  22. package/dist/facets/vite-dev-server.d.ts.map +1 -1
  23. package/dist/facets/vite-dev-server.js +6 -8
  24. package/dist/facets/wasm-swap-registry.d.ts +15 -21
  25. package/dist/facets/wasm-swap-registry.d.ts.map +1 -1
  26. package/dist/facets/wasm-swap-registry.js +41 -54
  27. package/dist/facets/ws-terminal.d.ts +4 -5
  28. package/dist/facets/ws-terminal.d.ts.map +1 -1
  29. package/dist/facets/ws-terminal.js +7 -8
  30. package/dist/git/commands.d.ts.map +1 -1
  31. package/dist/git/commands.js +0 -1
  32. package/dist/git/network-facet.d.ts.map +1 -1
  33. package/dist/git/network-facet.js +0 -2
  34. package/dist/git-bundle.generated.d.ts +2 -3
  35. package/dist/git-bundle.generated.d.ts.map +1 -1
  36. package/dist/git-bundle.generated.js +3 -4
  37. package/dist/index.js +2 -2
  38. package/dist/loaders/child-process/spawn-facet.d.ts +7 -52
  39. package/dist/loaders/child-process/spawn-facet.d.ts.map +1 -1
  40. package/dist/loaders/child-process/spawn-facet.js +7 -49
  41. package/dist/loaders/child-process/spawn-pool.d.ts +5 -44
  42. package/dist/loaders/child-process/spawn-pool.d.ts.map +1 -1
  43. package/dist/loaders/child-process/spawn-pool.js +5 -44
  44. package/dist/loaders/fanout-pool.d.ts +18 -65
  45. package/dist/loaders/fanout-pool.d.ts.map +1 -1
  46. package/dist/loaders/fanout-pool.js +25 -87
  47. package/dist/loaders/generated-workers.d.ts +1 -2
  48. package/dist/loaders/generated-workers.d.ts.map +1 -1
  49. package/dist/loaders/generated-workers.js +5 -6
  50. package/dist/loaders/loader-pool.d.ts +1 -2
  51. package/dist/loaders/loader-pool.d.ts.map +1 -1
  52. package/dist/loaders/loader-pool.js +1 -1
  53. package/dist/loaders/npm-resolve-preamble.d.ts +4 -5
  54. package/dist/loaders/npm-resolve-preamble.d.ts.map +1 -1
  55. package/dist/loaders/npm-resolve-preamble.js +14 -21
  56. package/dist/loaders/pre-bundle-preamble.d.ts.map +1 -1
  57. package/dist/loaders/pre-bundle-preamble.js +0 -1
  58. package/dist/npm/cache.js +1 -1
  59. package/dist/npm/install-batch-facet.d.ts.map +1 -1
  60. package/dist/npm/install-batch-facet.js +7 -12
  61. package/dist/npm/installer.d.ts +5 -7
  62. package/dist/npm/installer.d.ts.map +1 -1
  63. package/dist/npm/installer.js +20 -101
  64. package/dist/npm/r2-cache.d.ts +17 -29
  65. package/dist/npm/r2-cache.d.ts.map +1 -1
  66. package/dist/npm/r2-cache.js +16 -27
  67. package/dist/npm/resolve-facet.d.ts +11 -17
  68. package/dist/npm/resolve-facet.d.ts.map +1 -1
  69. package/dist/npm/resolve-facet.js +14 -28
  70. package/dist/npm/resolve-one-facet.d.ts +10 -13
  71. package/dist/npm/resolve-one-facet.d.ts.map +1 -1
  72. package/dist/npm/resolve-one-facet.js +8 -10
  73. package/dist/npm/resolver.d.ts +0 -2
  74. package/dist/npm/resolver.d.ts.map +1 -1
  75. package/dist/npm/resolver.js +0 -12
  76. package/dist/observability/oom-discriminator.d.ts +0 -2
  77. package/dist/observability/oom-discriminator.d.ts.map +1 -1
  78. package/dist/observability/oom-discriminator.js +0 -2
  79. package/dist/replica/routing.js +1 -1
  80. package/dist/router/index.d.ts +1 -1
  81. package/dist/router/index.js +1 -1
  82. package/dist/runtime/barrel-synthesizer.js +1 -1
  83. package/dist/runtime/clang-runner.d.ts +5 -6
  84. package/dist/runtime/clang-runner.d.ts.map +1 -1
  85. package/dist/runtime/clang-runner.js +5 -6
  86. package/dist/runtime/esbuild-service.d.ts.map +1 -1
  87. package/dist/runtime/esbuild-service.js +0 -3
  88. package/dist/runtime/framework-detect.d.ts +0 -1
  89. package/dist/runtime/framework-detect.d.ts.map +1 -1
  90. package/dist/runtime/framework-detect.js +0 -1
  91. package/dist/runtime/node-runner.d.ts +1 -1
  92. package/dist/runtime/node-runner.js +1 -1
  93. package/dist/runtime/node-shims.d.ts.map +1 -1
  94. package/dist/runtime/node-shims.js +0 -22
  95. package/dist/runtime/package-manager.d.ts +2 -7
  96. package/dist/runtime/package-manager.d.ts.map +1 -1
  97. package/dist/runtime/package-manager.js +2 -7
  98. package/dist/runtime/process-logs-api.js +1 -1
  99. package/dist/runtime/process-logs.d.ts +0 -1
  100. package/dist/runtime/process-logs.d.ts.map +1 -1
  101. package/dist/runtime/process-table.d.ts +2 -2
  102. package/dist/runtime/process-table.d.ts.map +1 -1
  103. package/dist/runtime/process-table.js +1 -1
  104. package/dist/runtime/python-repl.d.ts +0 -1
  105. package/dist/runtime/python-repl.d.ts.map +1 -1
  106. package/dist/runtime/python-repl.js +0 -1
  107. package/dist/runtime/python-runner.d.ts +1 -2
  108. package/dist/runtime/python-runner.d.ts.map +1 -1
  109. package/dist/runtime/python-runner.js +1 -3
  110. package/dist/runtime/repl-session.d.ts +0 -1
  111. package/dist/runtime/repl-session.d.ts.map +1 -1
  112. package/dist/runtime/repl-session.js +1 -2
  113. package/dist/runtime/require-resolver.d.ts.map +1 -1
  114. package/dist/runtime/require-resolver.js +1 -4
  115. package/dist/runtime/ruby-runner.d.ts +0 -1
  116. package/dist/runtime/ruby-runner.d.ts.map +1 -1
  117. package/dist/runtime/ruby-runner.js +0 -1
  118. package/dist/runtime/runtime-catalog.d.ts +2 -4
  119. package/dist/runtime/runtime-catalog.d.ts.map +1 -1
  120. package/dist/runtime/runtime-catalog.js +2 -4
  121. package/dist/runtime/runtime-registry.d.ts +1 -1
  122. package/dist/runtime/runtime-registry.js +1 -1
  123. package/dist/runtime/streams.d.ts.map +1 -1
  124. package/dist/runtime/streams.js +0 -1
  125. package/dist/runtime/wasi-instance.d.ts +35 -45
  126. package/dist/runtime/wasi-instance.d.ts.map +1 -1
  127. package/dist/runtime/wasi-instance.js +87 -103
  128. package/dist/runtime/wasm-runner.d.ts +9 -15
  129. package/dist/runtime/wasm-runner.d.ts.map +1 -1
  130. package/dist/runtime/wasm-runner.js +23 -29
  131. package/dist/session/bindings.d.ts +2 -7
  132. package/dist/session/bindings.d.ts.map +1 -1
  133. package/dist/session/bindings.js +3 -8
  134. package/dist/session/helpers.d.ts +2 -9
  135. package/dist/session/helpers.d.ts.map +1 -1
  136. package/dist/session/helpers.js +2 -10
  137. package/dist/session/init.d.ts +3 -6
  138. package/dist/session/init.d.ts.map +1 -1
  139. package/dist/session/init.js +25 -30
  140. package/dist/session/nimbus-session.d.ts +1 -1
  141. package/dist/session/nimbus-session.js +5 -5
  142. package/dist/session/routes.d.ts.map +1 -1
  143. package/dist/session/routes.js +9 -16
  144. package/dist/session/rpc.d.ts +2 -2
  145. package/dist/session/rpc.js +6 -6
  146. package/dist/session/supervisor-rpc.d.ts +1 -2
  147. package/dist/session/supervisor-rpc.d.ts.map +1 -1
  148. package/dist/session/supervisor-rpc.js +1 -5
  149. package/dist/shell/features.d.ts +5 -5
  150. package/dist/shell/features.js +6 -6
  151. package/dist/shell/unix-commands.js +15 -15
  152. package/dist/vfs/dev-provider.d.ts +1 -1
  153. package/dist/vfs/dev-provider.js +1 -1
  154. package/dist/vfs/sqlite-vfs.d.ts +3 -3
  155. package/dist/vfs/sqlite-vfs.d.ts.map +1 -1
  156. package/dist/vfs/sqlite-vfs.js +10 -11
  157. package/package.json +12 -2
  158. package/public/s/index.html +44 -75
  159. package/scripts/bundle-facet-workers.mjs +1 -1
  160. package/scripts/bundle-git.mjs +1 -1
@@ -96,11 +96,11 @@ export class SqliteVFS {
96
96
  * (deferWrite/clearPendingWritesForPath/flushPendingWrites/
97
97
  * cleanupAfterDelete). Read by getStats() so /api/_diag/memory's
98
98
  * `heap.breakdown.vfsInFlightBytes` is no longer a hardcoded 0.
99
- * (N3, heap-correctness wave.)
99
+ * (N3, memory accounting cleanup.)
100
100
  */
101
101
  _pendingWriteBytes = 0;
102
102
  /**
103
- * N2 (heap-correctness wave). Sum of bytes currently held in the
103
+ * N2 (memory accounting cleanup). Sum of bytes currently held in the
104
104
  * `chunks: []` spool inside writeStream(). Maintained per-chunk so
105
105
  * a long-running drain shows live, not the steady-state 0.
106
106
  * Reset (or decremented to the drained amount) inside writeStream's
@@ -481,7 +481,7 @@ export class SqliteVFS {
481
481
  // ── Deferred batch writes (do86 pattern) ──────────────────────────────
482
482
  deferWrite(path, chunkId, data) {
483
483
  const key = this.cacheKey(path, chunkId);
484
- // SINGLE-OWNERSHIP BOUNDARY (H10 audit, heap-correctness wave).
484
+ // SINGLE-OWNERSHIP BOUNDARY (H10 audit, memory accounting cleanup).
485
485
  //
486
486
  // `data` is one of:
487
487
  // - a `subarray` view into the caller's source ArrayBuffer
@@ -497,7 +497,7 @@ export class SqliteVFS {
497
497
  // (slice + this) per chunk.
498
498
  //
499
499
  // _pendingWriteBytes counter is the source-of-truth for N3
500
- // (heap-correctness wave): the `vfsInFlightBytes` heap-estimator
500
+ // (memory accounting cleanup): the `vfsInFlightBytes` heap-estimator
501
501
  // contributor reads from it.
502
502
  const copy = new Uint8Array(data.length);
503
503
  copy.set(data);
@@ -854,7 +854,7 @@ export class SqliteVFS {
854
854
  // The deferred write handles persistence; cache entry stays clean
855
855
  // to avoid double-writing when the entry is eventually evicted.
856
856
  //
857
- // H10 (heap-correctness wave) — `data.slice(...)` here used to
857
+ // H10 (memory accounting cleanup) — `data.slice(...)` here used to
858
858
  // allocate a brand-new chunk-sized ArrayBuffer per chunk. Combined
859
859
  // with `deferWrite`'s defensive copy at the persistence boundary
860
860
  // (sqlite-vfs.ts:_deferWriteCopyForOwnership), the loop transient
@@ -1050,7 +1050,7 @@ export class SqliteVFS {
1050
1050
  const inode = this.inodes.get(oldPath);
1051
1051
  if (!inode)
1052
1052
  throw new Error("ENOENT: " + oldPath);
1053
- // W-3 (WASI Wave-2): if newPath already exists, unlink it first so the
1053
+ // W-3 (WASI filesystem WASI): if newPath already exists, unlink it first so the
1054
1054
  // SQL UPDATE doesn't conflict on inodes.path uniqueness. POSIX rename(2)
1055
1055
  // overwrites the destination atomically; clang's atomic-write pattern
1056
1056
  // (write tmp + rename → final) depends on this. Without this branch,
@@ -1171,7 +1171,7 @@ export class SqliteVFS {
1171
1171
  * heap estimator. We now maintain `_writeStreamSpoolBytes` that
1172
1172
  * tracks the live spool contents during the drain; the diag's
1173
1173
  * vfsInFlightBytes contributor now sums pendingWriteBytes +
1174
- * writeStreamSpoolBytes. The N2 RED probe asserts on this sum.
1174
+ * writeStreamSpoolBytes. The N2 failing probe asserts on this sum.
1175
1175
  *
1176
1176
  * Throws on SQLITE_NOMEM (with halve-retry per writeBatch); any
1177
1177
  * iterator-source error propagates unchanged. Atomicity guarantee
@@ -1183,7 +1183,7 @@ export class SqliteVFS {
1183
1183
  // We build the chunks array fully BEFORE entering transactionSync
1184
1184
  // because transactionSync is synchronous (cannot await mid-txn).
1185
1185
  //
1186
- // N2 (heap-correctness wave): track spool bytes so the diag
1186
+ // N2 (memory accounting cleanup): track spool bytes so the diag
1187
1187
  // estimator's vfsInFlightBytes is no longer a 0 lie. Increment
1188
1188
  // per chunk pushed; reset to 0 immediately before delegating to
1189
1189
  // writeBatch (the bytes are now `pendingWrites' problem if they
@@ -1427,7 +1427,6 @@ export class SqliteVFS {
1427
1427
  // B3: also maintain running counters in sync. For each payload entry,
1428
1428
  // compute the delta against any pre-existing inode at that path.
1429
1429
  //
1430
- // W2.5a (audit/sections/W2.5-plan.md): the children-index call is now
1431
1430
  // OUTSIDE the `prior === undefined` guard. Pre-W2.5a, ~37 of 46 packages
1432
1431
  // per `npm install fastify` accumulated inodes in SQL but never reached
1433
1432
  // the in-memory `this.children` index because some path's `prior` was
@@ -1608,14 +1607,14 @@ export class SqliteVFS {
1608
1607
  batchWrites: this._batchWrites,
1609
1608
  batchWriteRows: this._batchWriteRows,
1610
1609
  pendingWrites: this.pendingWrites.size,
1611
- // N3 (heap-correctness wave): real byte sum of the
1610
+ // N3 (memory accounting cleanup): real byte sum of the
1612
1611
  // pendingWrites Map. Source-of-truth for the heap-estimator's
1613
1612
  // vfsInFlightBytes contributor (was hardcoded 0 at routes.ts:347
1614
1613
  // pre-fix). Adding this AS WELL AS the entry count above so
1615
1614
  // ops dashboards that already plot the count don't break, while
1616
1615
  // memory triage gets the actual byte number.
1617
1616
  pendingWriteBytes: this._pendingWriteBytes,
1618
- // N2 (heap-correctness wave): live byte count inside the
1617
+ // N2 (memory accounting cleanup): live byte count inside the
1619
1618
  // writeStream() drain spool. Non-zero only during the brief
1620
1619
  // window between the first chunk arriving and writeBatch
1621
1620
  // returning — bounded by SHARED_RPC_FLUSH_THRESHOLD (4 MiB)
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@nimbus-sh/worker",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Nimbus runtime package for Cloudflare Workers, re-exported publicly through @nimbus-sh/sdk/worker.",
5
+ "keywords": [
6
+ "cloudflare",
7
+ "workers",
8
+ "durable-objects",
9
+ "webassembly",
10
+ "sandbox",
11
+ "runtime"
12
+ ],
5
13
  "homepage": "https://github.com/AshishKumar4/Nimbus",
6
14
  "repository": {
7
15
  "type": "git",
@@ -38,7 +46,9 @@
38
46
  "dist",
39
47
  "public",
40
48
  "scripts",
41
- "README.md"
49
+ "README.md",
50
+ "LICENSE",
51
+ "NOTICE.md"
42
52
  ],
43
53
  "scripts": {
44
54
  "bundle:git": "node scripts/bundle-git.mjs",
@@ -84,7 +84,7 @@
84
84
  /* Resize handle */
85
85
  .resize-handle { width: 4px; background: #30363d; cursor: col-resize; flex-shrink: 0; }
86
86
  .resize-handle:hover { background: #58a6ff; }
87
- /* monaco-polish (2026-05-14): vertical resize handle for editor (top) ↔
87
+ /* Vertical resize handle for editor (top) ↔
88
88
  terminal (bottom) inside the editor-stack column. Hidden outside
89
89
  editor mode (rule under .main.editor below). */
90
90
  .vresize-handle {
@@ -119,12 +119,8 @@
119
119
  .main.preview-only .resize-handle { display: none; }
120
120
  .main.preview-only .panel-preview { flex: 1; }
121
121
 
122
- /* monaco-wave-a + Wave-B (2026-05-13/14):
123
- Editor layout mode — 4-pane VSCode-style:
122
+ /* Editor layout mode:
124
123
  FILE TREE | editor-stack (editor TOP + terminal BOTTOM) | PREVIEW
125
- Single mode: 'editor'. Dropped earlier 'editor-split' (editor+preview
126
- without terminal) per user feedback "I don't need 'edit + preview'
127
- at all". Renamed 'editor-split-with-term' → 'editor' for clarity.
128
124
 
129
125
  Editor + terminal live INSIDE .panel-left-stack. In 1D modes
130
126
  (terminal-only / split / preview-only) the stack is
@@ -144,7 +140,7 @@
144
140
  modes (transparent). flex column in editor mode. */
145
141
  .panel-left-stack { display: contents; }
146
142
 
147
- /* monaco-wave-b: File-tree sidebar. Lives as a FIRST child of
143
+ /* File-tree sidebar. Lives as a FIRST child of
148
144
  .main; visible only in 'editor' mode. ~250px default width,
149
145
  resizable via .tree-resize-handle. */
150
146
  .panel-tree {
@@ -232,7 +228,7 @@
232
228
  font-size: 11px; text-align: center;
233
229
  }
234
230
 
235
- /* Editor layout (single mode, monaco-wave-b): file tree | editor-stack | preview */
231
+ /* Editor layout: file tree | editor-stack | preview */
236
232
  .main.editor .panel-tree { display: flex; }
237
233
  .main.editor .tree-resize-handle { display: block; }
238
234
  .main.editor .panel-left-stack {
@@ -298,9 +294,8 @@
298
294
  <button id="btnTerminal" class="active" title="Terminal">Terminal</button>
299
295
  <button id="btnPreview" title="Preview">Preview</button>
300
296
  <button id="btnSplit" title="Split view">Split</button>
301
- <!-- monaco-wave-b (2026-05-14): single canonical Editor mode.
302
- Drops Edit+Preview (per user "I don't need edit+preview at all").
303
- Layout: file tree | editor (top) + terminal (bottom) | preview.
297
+ <!-- Single canonical editor mode:
298
+ file tree | editor (top) + terminal (bottom) | preview.
304
299
  Lazy-loads Monaco + the tree on first click. -->
305
300
  <button id="btnEditor" title="Editor (file tree + Monaco + terminal + preview)">Editor</button>
306
301
  <div class="sep"></div>
@@ -313,7 +308,7 @@
313
308
  <span class="vite-status" id="viteStatus"></span>
314
309
  </div>
315
310
  <div class="main" id="mainPanel">
316
- <!-- monaco-wave-b (2026-05-14): file-tree sidebar. Visible ONLY
311
+ <!-- File-tree sidebar. Visible ONLY
317
312
  in editor mode (CSS toggles display:flex on .main.editor).
318
313
  The .tree-resize-handle sits between tree and editor stack;
319
314
  dragging it adjusts .panel-tree's width inline. -->
@@ -330,12 +325,11 @@
330
325
  <div class="tree-body" id="treeBody"></div>
331
326
  </div>
332
327
  <div class="tree-resize-handle" id="treeResizeHandle"></div>
333
- <!-- monaco-wave-a (2026-05-13, hotfix course-correct):
334
- The .panel-left-stack wrapper is display:contents in 1D modes
328
+ <!-- The .panel-left-stack wrapper is display:contents in 1D modes
335
329
  (terminal-only, split, preview-only) — its children act as
336
- direct flex children of .main. In editor mode (monaco-wave-b),
337
- CSS flips it to display:flex; flex-direction:column so editor
338
- and terminal stack vertically in the MIDDLE column. -->
330
+ direct flex children of .main. In editor mode, CSS flips it to
331
+ display:flex so editor and terminal stack vertically in the middle
332
+ column. -->
339
333
  <div class="panel-left-stack" id="leftStack">
340
334
  <div class="panel-editor" id="editorPanel">
341
335
  <div class="editor-bar">
@@ -358,7 +352,7 @@
358
352
  <span id="editorStatusEnc">UTF-8</span>
359
353
  </div>
360
354
  </div>
361
- <!-- monaco-polish (2026-05-14): vertical resize handle between
355
+ <!-- Vertical resize handle between
362
356
  editor (top) and terminal (bottom) inside the editor-stack
363
357
  column. Visible only in editor mode (.main.editor). -->
364
358
  <div class="vresize-handle" id="editorTerminalResizeHandle"></div>
@@ -380,9 +374,8 @@
380
374
  <iframe id="preview-frame" src="about:blank"></iframe>
381
375
  </div>
382
376
  </div>
383
- <!-- monaco-wave-a (2026-05-13): Ctrl+P command palette. Lazy-populated
384
- fuzzy file finder; fs-list message sent on first open per
385
- editor session. -->
377
+ <!-- Ctrl+P command palette. Lazy-populated fuzzy file finder; fs-list
378
+ is sent on first open per editor session. -->
386
379
  <div class="palette-overlay" id="paletteOverlay">
387
380
  <div class="palette-box">
388
381
  <input class="palette-input" id="paletteInput" placeholder="Type a file name…" autocomplete="off" spellcheck="false">
@@ -485,11 +478,8 @@
485
478
  const mainPanel = document.getElementById('mainPanel');
486
479
  const viteStatus = document.getElementById('viteStatus');
487
480
  let ws = null, rd = 1000, statsTimer = null;
488
- // monaco-wave-b (2026-05-14): single 'editor' mode replaces the
489
- // Wave-A duo of 'editor-split' (dropped per user feedback) and
490
- // 'editor-split-with-term' (renamed → 'editor'). Layout:
491
- // file tree | editor (top) + terminal (bottom) | preview
492
- // Old modes preserved verbatim: 'split', 'terminal-only', 'preview-only'.
481
+ // Current layout modes. Editor mode keeps the file tree, Monaco,
482
+ // terminal, and preview visible together.
493
483
  let layout = 'split';
494
484
 
495
485
  // ── Layout controls ──
@@ -511,7 +501,7 @@
511
501
  FileTree.ensureLoaded();
512
502
  }
513
503
  setTimeout(() => {
514
- // monaco-polish: re-apply persisted pane dims for this layout.
504
+ // Re-apply persisted pane dims for this layout.
515
505
  // PaneResizer uses inline flex which is mode-specific (split vs
516
506
  // editor have different pane structures); onLayoutChange picks
517
507
  // the right elements for the active mode.
@@ -532,7 +522,7 @@
532
522
  document.getElementById('btnRefresh').onclick = () => reloadPreview();
533
523
  document.getElementById('btnReloadPreview').onclick = () => reloadPreview();
534
524
 
535
- // ── monaco-wave-a (2026-05-13): Editor module ──
525
+ // ── Editor module ──
536
526
  //
537
527
  // Lazy-loads Monaco via cdnjs UMD on first call to ensureLoaded().
538
528
  // Cold session (terminal-only flow) never pays the ~5MB download.
@@ -541,9 +531,7 @@
541
531
  // All fs operations route through the live WS via fs-read /
542
532
  // fs-write / fs-list messages → init.ts handler → SqliteVFS.
543
533
  //
544
- // Perf-invariant: probes assert monaco-* scripts NOT loaded on a
545
- // cold terminal-only session (see tests/behavioral/monaco-wave-a/
546
- // new/monaco-lazy-not-on-cold.mjs).
534
+ // Perf-invariant: Monaco is not loaded on cold terminal-only sessions.
547
535
  const Editor = (function() {
548
536
  // CDN choice: cdnjs hosts Monaco's UMD AMD-loader (`loader.min.js`)
549
537
  // which fetches the remaining vs/* chunks on demand. Total cold
@@ -589,11 +577,8 @@
589
577
  // Send a fs-* message; await the paired result. Resolves with the
590
578
  // result frame; rejects on error or timeout (15s — generous for
591
579
  // big trees, tight enough that a hung session surfaces fast).
592
- // file-tree-fix (2026-05-14): outbound queue for fs-* frames
593
- // sent before ws.onopen fires. User repro: "fs-list failed:
594
- // WS not connected" when clicking Editor before terminal prompt.
595
- //
596
- // Race window: connect() runs at page-load and ws is in CONNECTING
580
+ // Queue fs-* frames sent before ws.onopen fires. Race window:
581
+ // connect() runs at page-load and ws is in CONNECTING
597
582
  // state (readyState === 0). If the user clicks Editor BEFORE
598
583
  // ws.onopen fires, setLayout('editor') invokes Editor.ensureLoaded
599
584
  // → eventually fsRequest, which pre-fix rejected synchronously.
@@ -722,10 +707,7 @@
722
707
  const ph = document.getElementById('editorPlaceholder');
723
708
  if (ph) ph.style.display = 'none';
724
709
 
725
- // monaco-wave-a hotfix (2026-05-13): full VSCode-like options
726
- // (per user feedback "current is useless — make it proper, nice").
727
- // This config mirrors VSCode 1.95+ defaults for a TS/JS file.
728
- // Verified against actual VSCode source (monaco.IEditorOptions).
710
+ // VS Code-like editor defaults for TS/JS files.
729
711
  editor = window.monaco.editor.create(container, {
730
712
  value: '',
731
713
  language: 'plaintext',
@@ -843,9 +825,8 @@
843
825
 
844
826
  async function openFile(path) {
845
827
  if (!path) return;
846
- // monaco-wave-b: dirty-prompt before switching files. If the
847
- // current buffer has unsaved changes, ask the user whether
848
- // to (a) save first, (b) discard and switch, or (c) cancel.
828
+ // Dirty-prompt before switching files. If the current buffer has
829
+ // unsaved changes, ask the user whether to save or discard.
849
830
  // Skip when switching to the SAME file (no-op) or when there
850
831
  // is no editor yet.
851
832
  if (editor && openPath && openPath !== path) {
@@ -895,8 +876,7 @@
895
876
  if (statusLang) statusLang.textContent = lang;
896
877
  const statusPos = document.getElementById('editorStatusPos');
897
878
  if (statusPos) statusPos.textContent = 'Ln 1, Col 1';
898
- // monaco-wave-b: mirror selection into the file tree (so
899
- // palette/Ctrl+P opens highlight the row).
879
+ // Mirror palette/Ctrl+P selection into the file tree.
900
880
  if (typeof FileTree !== 'undefined') {
901
881
  try { FileTree.setSelected(path); FileTree.markDirty(path, false); } catch {}
902
882
  }
@@ -1038,8 +1018,7 @@
1038
1018
  }
1039
1019
  });
1040
1020
 
1041
- // file-tree-watch (2026-05-15): external invalidation of the
1042
- // Cmd+P 5s-TTL palette cache. Called by the fs-watch-event
1021
+ // External invalidation of the Cmd+P 5s-TTL palette cache. Called by the fs-watch-event
1043
1022
  // dispatcher in ws.onmessage so a terminal-side write makes
1044
1023
  // the next openPalette re-run fs-list instead of serving
1045
1024
  // stale results.
@@ -1051,7 +1030,7 @@
1051
1030
  return { ensureLoaded, openFile, save, openPalette, tryHandleFsResult, drainFsQueue, invalidateFileListCache };
1052
1031
  })();
1053
1032
 
1054
- // ── monaco-wave-b (2026-05-14): FileTree module ──
1033
+ // ── FileTree module ──
1055
1034
  //
1056
1035
  // VSCode-style left sidebar showing the user VFS (rooted at
1057
1036
  // /home/user). Lazy-loads on first editor-mode activation. Tree
@@ -1109,8 +1088,8 @@
1109
1088
  const expanded = loadExpandedSet();
1110
1089
  expanded.add(ROOT);
1111
1090
 
1112
- // file-tree-fix (2026-05-14): outbound queue mirroring Editor's
1113
- // pattern. See Editor.fsRequest for the race rationale.
1091
+ // Outbound queue mirrors Editor.fsRequest for the same websocket
1092
+ // connection race.
1114
1093
  const outQueue = [];
1115
1094
  function fsRequest(frame, resultType) {
1116
1095
  const reqId = nextReqId++;
@@ -1426,10 +1405,8 @@
1426
1405
  btnRefresh.addEventListener('click', refreshTree);
1427
1406
  searchInput.addEventListener('input', rerender);
1428
1407
 
1429
- // monaco-polish (2026-05-14): tree-resize handler moved into
1430
- // PaneResizer (below module def, top-level scope) so all 3
1431
- // handles share a single persistence layer. Inline width is
1432
- // restored from localStorage in PaneResizer.restoreDims().
1408
+ // Tree resize is owned by PaneResizer so all handles share one
1409
+ // persistence layer. Inline width is restored from localStorage.
1433
1410
 
1434
1411
  // Mark a path dirty in the tree (called by Editor when buffer
1435
1412
  // diverges from disk).
@@ -1441,7 +1418,7 @@
1441
1418
  rerender();
1442
1419
  }
1443
1420
 
1444
- // ── file-tree-watch (2026-05-15): subscribe + event apply ─────
1421
+ // ── File-watch subscribe + event apply ─────
1445
1422
  //
1446
1423
  // Server-side fs-watch protocol (src/session/fs-watch.ts):
1447
1424
  //
@@ -1527,7 +1504,7 @@
1527
1504
  }, WATCH_COALESCE_MS);
1528
1505
  }
1529
1506
 
1530
- // file-tree-watch: dispatch an inbound fs-watch-event frame to
1507
+ // Dispatch an inbound fs-watch-event frame to
1531
1508
  // the tree's incremental refresh pipeline. Returns true if the
1532
1509
  // frame was consumed (caller short-circuits the rest of its
1533
1510
  // onmessage chain), false otherwise.
@@ -1660,7 +1637,7 @@
1660
1637
  }
1661
1638
  }
1662
1639
 
1663
- // ── monaco-polish (2026-05-14): pane resize manager ──
1640
+ // ── Pane resize manager ──
1664
1641
  //
1665
1642
  // Owns the 3 resize handles in editor mode + 1 in split mode:
1666
1643
  // H1 tree ↔ editor-stack (col, in editor mode) — TreeResizeHandle in FileTree IIFE
@@ -1897,17 +1874,12 @@
1897
1874
  ws.onopen = () => {
1898
1875
  setStatus('connected'); rd = 1000;
1899
1876
  ws.send(JSON.stringify({type:'resize',cols:term.cols,rows:term.rows}));
1900
- // file-tree-fix (2026-05-14): drain any fs-* frames that
1901
- // Editor / FileTree queued before WS opened. User repro
1902
- // was a cold session where clicking Editor before the first
1903
- // ws.onopen produced "fs-list failed: WS not connected".
1904
- // Drain order doesn't matter — server processes per-reqId.
1877
+ // Drain any fs-* frames that Editor / FileTree queued before WS
1878
+ // opened. Drain order does not matter; the server routes by reqId.
1905
1879
  try { if (typeof Editor !== 'undefined') Editor.drainFsQueue(); } catch {}
1906
1880
  try { if (typeof FileTree !== 'undefined') FileTree.drainFsQueue(); } catch {}
1907
- // file-tree-watch (2026-05-15): subscribe the FileTree to
1908
- // server-pushed fs-watch-event frames so terminal-side writes
1909
- // (e.g. `touch foo.c`) appear in the sidebar within ~150 ms
1910
- // without needing a manual refresh click.
1881
+ // Subscribe the FileTree to server-pushed fs-watch-event frames so
1882
+ // terminal-side writes appear without a manual refresh click.
1911
1883
  try { if (typeof FileTree !== 'undefined') FileTree.subscribeOnce(); } catch {}
1912
1884
  refreshStats();
1913
1885
  if (statsTimer) clearInterval(statsTimer);
@@ -1924,14 +1896,13 @@
1924
1896
  ws.onmessage = (e) => {
1925
1897
  try {
1926
1898
  const msg = JSON.parse(e.data);
1927
- // monaco-wave-a (2026-05-13): fs-*-result frames route to
1928
- // Editor's pending-request resolver. Return early so the
1929
- // shell-side dispatch doesn't see them as unknown types.
1899
+ // fs-*-result frames route to the editor's pending-request
1900
+ // resolver. Return early so shell dispatch does not see them
1901
+ // as unknown types.
1930
1902
  if (Editor.tryHandleFsResult(msg)) return;
1931
- // monaco-wave-b: FileTree consumes fs-list results too.
1903
+ // FileTree consumes fs-list results too.
1932
1904
  if (FileTree.tryHandleFsResult(msg)) return;
1933
- // file-tree-watch (2026-05-15): server-pushed fs-watch-event
1934
- // frames (no reqId) route to FileTree.applyWatchEvent which
1905
+ // Server-pushed fs-watch-event frames route to FileTree, which
1935
1906
  // coalesces per-parent refreshes on a 100ms window.
1936
1907
  if (FileTree.applyWatchEvent(msg)) return;
1937
1908
  if (msg.type === 'output') {
@@ -2367,9 +2338,7 @@
2367
2338
  // and ProcessTable is populated by then, no arbitrary delay needed.
2368
2339
 
2369
2340
  term.focus();
2370
- // monaco-polish (2026-05-14): default to editor mode on page load.
2371
- // Restore any persisted pane dims (tree width, middle/preview ratio,
2372
- // editor/terminal ratio) BEFORE activating layout so the first paint
2341
+ // Restore persisted pane dims before activating layout so the first paint
2373
2342
  // shows the user's prior arrangement.
2374
2343
  PaneResizer.restoreDims();
2375
2344
  setLayout('editor');
@@ -47,6 +47,7 @@ async function bundleAsPreamble(entryPath, label) {
47
47
  format: 'esm',
48
48
  target: 'esnext',
49
49
  platform: 'neutral',
50
+ absWorkingDir: root,
50
51
  write: false,
51
52
  logLevel: 'warning',
52
53
  legalComments: 'none',
@@ -106,7 +107,6 @@ async function main() {
106
107
  ' * W7-frame symbols: encodeWriteBatchStream, decodeWriteBatchStream,',
107
108
  ' * W7_MAGIC, W7_TRAILER.',
108
109
  ' *',
109
- ` * Generated at: ${new Date().toISOString()}`,
110
110
  ` * Tar size: ${(tarStripped.length / 1024).toFixed(2)} KiB`,
111
111
  ` * W7 size: ${(w7Stripped.length / 1024).toFixed(2)} KiB`,
112
112
  ' */',
@@ -47,6 +47,7 @@ async function main() {
47
47
  format: 'esm',
48
48
  target: 'esnext',
49
49
  platform: 'browser',
50
+ absWorkingDir: root,
50
51
  conditions: ['worker', 'browser', 'import'],
51
52
  // Map bare node built-ins → node: prefixed (works with nodejs_compat).
52
53
  alias: {
@@ -87,7 +88,6 @@ async function main() {
87
88
  ' * Consumed by git-network-facet.ts: passed to LOADER.load()\'s',
88
89
  ' * `modules` record so the facet can `import` isomorphic-git.',
89
90
  ' *',
90
- ` * Generated at: ${new Date().toISOString()}`,
91
91
  ` * Size: ${(code.length / 1024).toFixed(1)} KiB`,
92
92
  ' */',
93
93
  '',