@fungi.computer/computer 0.3.2 → 0.4.1

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.
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/stream.js
33
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/stream.js
34
34
  var require_stream = __commonJS({
35
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/stream.js"(exports2, module2) {
35
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/stream.js"(exports2, module2) {
36
36
  "use strict";
37
37
  var { Duplex } = require("stream");
38
38
  function emitClose(stream) {
@@ -127,9 +127,9 @@ var require_stream = __commonJS({
127
127
  }
128
128
  });
129
129
 
130
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js
130
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/constants.js
131
131
  var require_constants = __commonJS({
132
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js"(exports2, module2) {
132
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/constants.js"(exports2, module2) {
133
133
  "use strict";
134
134
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
135
135
  var hasBlob = typeof Blob !== "undefined";
@@ -149,9 +149,221 @@ var require_constants = __commonJS({
149
149
  }
150
150
  });
151
151
 
152
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js
152
+ // ../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js
153
+ var require_node_gyp_build = __commonJS({
154
+ "../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js"(exports2, module2) {
155
+ var fs = require("fs");
156
+ var path = require("path");
157
+ var os = require("os");
158
+ var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
159
+ var vars = process.config && process.config.variables || {};
160
+ var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
161
+ var abi = process.versions.modules;
162
+ var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
163
+ var arch = process.env.npm_config_arch || os.arch();
164
+ var platform = process.env.npm_config_platform || os.platform();
165
+ var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
166
+ var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
167
+ var uv = (process.versions.uv || "").split(".")[0];
168
+ module2.exports = load;
169
+ function load(dir) {
170
+ return runtimeRequire(load.resolve(dir));
171
+ }
172
+ load.resolve = load.path = function(dir) {
173
+ dir = path.resolve(dir || ".");
174
+ try {
175
+ var name = runtimeRequire(path.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
176
+ if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
177
+ } catch (err) {
178
+ }
179
+ if (!prebuildsOnly) {
180
+ var release = getFirst(path.join(dir, "build/Release"), matchBuild);
181
+ if (release) return release;
182
+ var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
183
+ if (debug) return debug;
184
+ }
185
+ var prebuild = resolve(dir);
186
+ if (prebuild) return prebuild;
187
+ var nearby = resolve(path.dirname(process.execPath));
188
+ if (nearby) return nearby;
189
+ var target = [
190
+ "platform=" + platform,
191
+ "arch=" + arch,
192
+ "runtime=" + runtime,
193
+ "abi=" + abi,
194
+ "uv=" + uv,
195
+ armv ? "armv=" + armv : "",
196
+ "libc=" + libc,
197
+ "node=" + process.versions.node,
198
+ process.versions.electron ? "electron=" + process.versions.electron : "",
199
+ typeof __webpack_require__ === "function" ? "webpack=true" : ""
200
+ // eslint-disable-line
201
+ ].filter(Boolean).join(" ");
202
+ throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
203
+ function resolve(dir2) {
204
+ var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
205
+ var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
206
+ if (!tuple) return;
207
+ var prebuilds = path.join(dir2, "prebuilds", tuple.name);
208
+ var parsed = readdirSync(prebuilds).map(parseTags);
209
+ var candidates = parsed.filter(matchTags(runtime, abi));
210
+ var winner = candidates.sort(compareTags(runtime))[0];
211
+ if (winner) return path.join(prebuilds, winner.file);
212
+ }
213
+ };
214
+ function readdirSync(dir) {
215
+ try {
216
+ return fs.readdirSync(dir);
217
+ } catch (err) {
218
+ return [];
219
+ }
220
+ }
221
+ function getFirst(dir, filter) {
222
+ var files = readdirSync(dir).filter(filter);
223
+ return files[0] && path.join(dir, files[0]);
224
+ }
225
+ function matchBuild(name) {
226
+ return /\.node$/.test(name);
227
+ }
228
+ function parseTuple(name) {
229
+ var arr = name.split("-");
230
+ if (arr.length !== 2) return;
231
+ var platform2 = arr[0];
232
+ var architectures = arr[1].split("+");
233
+ if (!platform2) return;
234
+ if (!architectures.length) return;
235
+ if (!architectures.every(Boolean)) return;
236
+ return { name, platform: platform2, architectures };
237
+ }
238
+ function matchTuple(platform2, arch2) {
239
+ return function(tuple) {
240
+ if (tuple == null) return false;
241
+ if (tuple.platform !== platform2) return false;
242
+ return tuple.architectures.includes(arch2);
243
+ };
244
+ }
245
+ function compareTuples(a, b) {
246
+ return a.architectures.length - b.architectures.length;
247
+ }
248
+ function parseTags(file) {
249
+ var arr = file.split(".");
250
+ var extension = arr.pop();
251
+ var tags = { file, specificity: 0 };
252
+ if (extension !== "node") return;
253
+ for (var i = 0; i < arr.length; i++) {
254
+ var tag = arr[i];
255
+ if (tag === "node" || tag === "electron" || tag === "node-webkit") {
256
+ tags.runtime = tag;
257
+ } else if (tag === "napi") {
258
+ tags.napi = true;
259
+ } else if (tag.slice(0, 3) === "abi") {
260
+ tags.abi = tag.slice(3);
261
+ } else if (tag.slice(0, 2) === "uv") {
262
+ tags.uv = tag.slice(2);
263
+ } else if (tag.slice(0, 4) === "armv") {
264
+ tags.armv = tag.slice(4);
265
+ } else if (tag === "glibc" || tag === "musl") {
266
+ tags.libc = tag;
267
+ } else {
268
+ continue;
269
+ }
270
+ tags.specificity++;
271
+ }
272
+ return tags;
273
+ }
274
+ function matchTags(runtime2, abi2) {
275
+ return function(tags) {
276
+ if (tags == null) return false;
277
+ if (tags.runtime && tags.runtime !== runtime2 && !runtimeAgnostic(tags)) return false;
278
+ if (tags.abi && tags.abi !== abi2 && !tags.napi) return false;
279
+ if (tags.uv && tags.uv !== uv) return false;
280
+ if (tags.armv && tags.armv !== armv) return false;
281
+ if (tags.libc && tags.libc !== libc) return false;
282
+ return true;
283
+ };
284
+ }
285
+ function runtimeAgnostic(tags) {
286
+ return tags.runtime === "node" && tags.napi;
287
+ }
288
+ function compareTags(runtime2) {
289
+ return function(a, b) {
290
+ if (a.runtime !== b.runtime) {
291
+ return a.runtime === runtime2 ? -1 : 1;
292
+ } else if (a.abi !== b.abi) {
293
+ return a.abi ? -1 : 1;
294
+ } else if (a.specificity !== b.specificity) {
295
+ return a.specificity > b.specificity ? -1 : 1;
296
+ } else {
297
+ return 0;
298
+ }
299
+ };
300
+ }
301
+ function isNwjs() {
302
+ return !!(process.versions && process.versions.nw);
303
+ }
304
+ function isElectron() {
305
+ if (process.versions && process.versions.electron) return true;
306
+ if (process.env.ELECTRON_RUN_AS_NODE) return true;
307
+ return typeof window !== "undefined" && window.process && window.process.type === "renderer";
308
+ }
309
+ function isAlpine(platform2) {
310
+ return platform2 === "linux" && fs.existsSync("/etc/alpine-release");
311
+ }
312
+ load.parseTags = parseTags;
313
+ load.matchTags = matchTags;
314
+ load.compareTags = compareTags;
315
+ load.parseTuple = parseTuple;
316
+ load.matchTuple = matchTuple;
317
+ load.compareTuples = compareTuples;
318
+ }
319
+ });
320
+
321
+ // ../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/index.js
322
+ var require_node_gyp_build2 = __commonJS({
323
+ "../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/index.js"(exports2, module2) {
324
+ var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
325
+ if (typeof runtimeRequire.addon === "function") {
326
+ module2.exports = runtimeRequire.addon.bind(runtimeRequire);
327
+ } else {
328
+ module2.exports = require_node_gyp_build();
329
+ }
330
+ }
331
+ });
332
+
333
+ // ../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/fallback.js
334
+ var require_fallback = __commonJS({
335
+ "../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/fallback.js"(exports2, module2) {
336
+ "use strict";
337
+ var mask = (source, mask2, output, offset, length) => {
338
+ for (var i = 0; i < length; i++) {
339
+ output[offset + i] = source[i] ^ mask2[i & 3];
340
+ }
341
+ };
342
+ var unmask = (buffer, mask2) => {
343
+ const length = buffer.length;
344
+ for (var i = 0; i < length; i++) {
345
+ buffer[i] ^= mask2[i & 3];
346
+ }
347
+ };
348
+ module2.exports = { mask, unmask };
349
+ }
350
+ });
351
+
352
+ // ../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/index.js
353
+ var require_bufferutil = __commonJS({
354
+ "../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/index.js"(exports2, module2) {
355
+ "use strict";
356
+ try {
357
+ module2.exports = require_node_gyp_build2()(__dirname);
358
+ } catch (e) {
359
+ module2.exports = require_fallback();
360
+ }
361
+ }
362
+ });
363
+
364
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/buffer-util.js
153
365
  var require_buffer_util = __commonJS({
154
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
366
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
155
367
  "use strict";
156
368
  var { EMPTY_BUFFER } = require_constants();
157
369
  var FastBuffer = Buffer[Symbol.species];
@@ -209,7 +421,7 @@ var require_buffer_util = __commonJS({
209
421
  };
210
422
  if (!process.env.WS_NO_BUFFER_UTIL) {
211
423
  try {
212
- const bufferUtil = require("bufferutil");
424
+ const bufferUtil = require_bufferutil();
213
425
  module2.exports.mask = function(source, mask, output, offset, length) {
214
426
  if (length < 48) _mask(source, mask, output, offset, length);
215
427
  else bufferUtil.mask(source, mask, output, offset, length);
@@ -224,9 +436,9 @@ var require_buffer_util = __commonJS({
224
436
  }
225
437
  });
226
438
 
227
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js
439
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/limiter.js
228
440
  var require_limiter = __commonJS({
229
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js"(exports2, module2) {
441
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/limiter.js"(exports2, module2) {
230
442
  "use strict";
231
443
  var kDone = /* @__PURE__ */ Symbol("kDone");
232
444
  var kRun = /* @__PURE__ */ Symbol("kRun");
@@ -274,9 +486,9 @@ var require_limiter = __commonJS({
274
486
  }
275
487
  });
276
488
 
277
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/permessage-deflate.js
489
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/permessage-deflate.js
278
490
  var require_permessage_deflate = __commonJS({
279
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
491
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
280
492
  "use strict";
281
493
  var zlib = require("zlib");
282
494
  var bufferUtil = require_buffer_util();
@@ -653,9 +865,58 @@ var require_permessage_deflate = __commonJS({
653
865
  }
654
866
  });
655
867
 
656
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js
868
+ // ../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/fallback.js
869
+ var require_fallback2 = __commonJS({
870
+ "../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/fallback.js"(exports2, module2) {
871
+ "use strict";
872
+ function isValidUTF8(buf) {
873
+ const len = buf.length;
874
+ let i = 0;
875
+ while (i < len) {
876
+ if ((buf[i] & 128) === 0) {
877
+ i++;
878
+ } else if ((buf[i] & 224) === 192) {
879
+ if (i + 1 === len || (buf[i + 1] & 192) !== 128 || (buf[i] & 254) === 192) {
880
+ return false;
881
+ }
882
+ i += 2;
883
+ } else if ((buf[i] & 240) === 224) {
884
+ if (i + 2 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || buf[i] === 224 && (buf[i + 1] & 224) === 128 || // overlong
885
+ buf[i] === 237 && (buf[i + 1] & 224) === 160) {
886
+ return false;
887
+ }
888
+ i += 3;
889
+ } else if ((buf[i] & 248) === 240) {
890
+ if (i + 3 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || (buf[i + 3] & 192) !== 128 || buf[i] === 240 && (buf[i + 1] & 240) === 128 || // overlong
891
+ buf[i] === 244 && buf[i + 1] > 143 || buf[i] > 244) {
892
+ return false;
893
+ }
894
+ i += 4;
895
+ } else {
896
+ return false;
897
+ }
898
+ }
899
+ return true;
900
+ }
901
+ module2.exports = isValidUTF8;
902
+ }
903
+ });
904
+
905
+ // ../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/index.js
906
+ var require_utf_8_validate = __commonJS({
907
+ "../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/index.js"(exports2, module2) {
908
+ "use strict";
909
+ try {
910
+ module2.exports = require_node_gyp_build2()(__dirname);
911
+ } catch (e) {
912
+ module2.exports = require_fallback2();
913
+ }
914
+ }
915
+ });
916
+
917
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/validation.js
657
918
  var require_validation = __commonJS({
658
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js"(exports2, module2) {
919
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/validation.js"(exports2, module2) {
659
920
  "use strict";
660
921
  var { isUtf8 } = require("buffer");
661
922
  var { hasBlob } = require_constants();
@@ -844,7 +1105,7 @@ var require_validation = __commonJS({
844
1105
  };
845
1106
  } else if (!process.env.WS_NO_UTF_8_VALIDATE) {
846
1107
  try {
847
- const isValidUTF8 = require("utf-8-validate");
1108
+ const isValidUTF8 = require_utf_8_validate();
848
1109
  module2.exports.isValidUTF8 = function(buf) {
849
1110
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
850
1111
  };
@@ -854,9 +1115,9 @@ var require_validation = __commonJS({
854
1115
  }
855
1116
  });
856
1117
 
857
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js
1118
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/receiver.js
858
1119
  var require_receiver = __commonJS({
859
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js"(exports2, module2) {
1120
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/receiver.js"(exports2, module2) {
860
1121
  "use strict";
861
1122
  var { Writable } = require("stream");
862
1123
  var PerMessageDeflate = require_permessage_deflate();
@@ -1446,9 +1707,9 @@ var require_receiver = __commonJS({
1446
1707
  }
1447
1708
  });
1448
1709
 
1449
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/sender.js
1710
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/sender.js
1450
1711
  var require_sender = __commonJS({
1451
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/sender.js"(exports2, module2) {
1712
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/sender.js"(exports2, module2) {
1452
1713
  "use strict";
1453
1714
  var { Duplex } = require("stream");
1454
1715
  var { randomFillSync } = require("crypto");
@@ -1934,9 +2195,9 @@ var require_sender = __commonJS({
1934
2195
  }
1935
2196
  });
1936
2197
 
1937
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js
2198
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/event-target.js
1938
2199
  var require_event_target = __commonJS({
1939
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js"(exports2, module2) {
2200
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/event-target.js"(exports2, module2) {
1940
2201
  "use strict";
1941
2202
  var { kForOnEventAttribute, kListener } = require_constants();
1942
2203
  var kCode = /* @__PURE__ */ Symbol("kCode");
@@ -2163,9 +2424,9 @@ var require_event_target = __commonJS({
2163
2424
  }
2164
2425
  });
2165
2426
 
2166
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js
2427
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/extension.js
2167
2428
  var require_extension = __commonJS({
2168
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js"(exports2, module2) {
2429
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/extension.js"(exports2, module2) {
2169
2430
  "use strict";
2170
2431
  var { tokenChars } = require_validation();
2171
2432
  function push(dest, name, elem) {
@@ -2316,9 +2577,9 @@ var require_extension = __commonJS({
2316
2577
  }
2317
2578
  });
2318
2579
 
2319
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js
2580
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket.js
2320
2581
  var require_websocket = __commonJS({
2321
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js"(exports2, module2) {
2582
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket.js"(exports2, module2) {
2322
2583
  "use strict";
2323
2584
  var EventEmitter2 = require("events");
2324
2585
  var https = require("https");
@@ -3199,9 +3460,9 @@ var require_websocket = __commonJS({
3199
3460
  }
3200
3461
  });
3201
3462
 
3202
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/subprotocol.js
3463
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/subprotocol.js
3203
3464
  var require_subprotocol = __commonJS({
3204
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
3465
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
3205
3466
  "use strict";
3206
3467
  var { tokenChars } = require_validation();
3207
3468
  function parse(header) {
@@ -3244,9 +3505,9 @@ var require_subprotocol = __commonJS({
3244
3505
  }
3245
3506
  });
3246
3507
 
3247
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js
3508
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket-server.js
3248
3509
  var require_websocket_server = __commonJS({
3249
- "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
3510
+ "../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
3250
3511
  "use strict";
3251
3512
  var EventEmitter2 = require("events");
3252
3513
  var http = require("http");
@@ -10280,6 +10541,7 @@ var ImportTableEntry = class {
10280
10541
  this.activePull.reject(error);
10281
10542
  this.activePull = void 0;
10282
10543
  }
10544
+ if (this.onBrokenRegistrations) for (let i of this.onBrokenRegistrations) delete this.session.onBrokenCallbacks[i];
10283
10545
  this.onBrokenRegistrations = void 0;
10284
10546
  }
10285
10547
  }
@@ -10437,6 +10699,7 @@ var RpcSessionImpl = class {
10437
10699
  refcount: 1
10438
10700
  };
10439
10701
  this.reverseExports.set(hook, exportId);
10702
+ this.watchExport(exportId, hook);
10440
10703
  return exportId;
10441
10704
  }
10442
10705
  }
@@ -10454,6 +10717,22 @@ var RpcSessionImpl = class {
10454
10717
  unexport(ids) {
10455
10718
  for (let id of ids) this.releaseExport(id, 1);
10456
10719
  }
10720
+ watchExport(exportId, hook) {
10721
+ hook.onBroken((error) => {
10722
+ queueMicrotask(() => {
10723
+ if (this.abortReason !== void 0 || this.exports[exportId]?.hook !== hook) return;
10724
+ try {
10725
+ this.send([
10726
+ "reject",
10727
+ exportId,
10728
+ Devaluator.devaluate(error, void 0, this, void 0, this.encodingLevel)
10729
+ ]);
10730
+ } catch (err) {
10731
+ this.abort(err);
10732
+ }
10733
+ });
10734
+ });
10735
+ }
10457
10736
  releaseExport(exportId, refcount) {
10458
10737
  let entry = this.exports[exportId];
10459
10738
  if (!entry) throw new Error(`no such export ID: ${exportId}`);
@@ -10720,8 +10999,8 @@ var RpcSessionImpl = class {
10720
10999
  } catch (err) {
10721
11000
  Promise.resolve(err);
10722
11001
  }
10723
- for (let i in this.onBrokenCallbacks) try {
10724
- this.onBrokenCallbacks[i](error);
11002
+ for (let callback of Object.values(this.onBrokenCallbacks)) try {
11003
+ callback(error);
10725
11004
  } catch (err) {
10726
11005
  Promise.resolve(err);
10727
11006
  }
@@ -10772,11 +11051,13 @@ var RpcSessionImpl = class {
10772
11051
  case "pipe": {
10773
11052
  let { readable, writable } = new TransformStream();
10774
11053
  let hook = streamImpl.createWritableStreamHook(writable);
11054
+ let exportId = this.exports.length;
10775
11055
  this.exports.push({
10776
11056
  hook,
10777
11057
  refcount: 1,
10778
11058
  pipeReadable: readable
10779
11059
  });
11060
+ this.watchExport(exportId, hook);
10780
11061
  continue;
10781
11062
  }
10782
11063
  case "pull": {
@@ -11279,6 +11560,7 @@ var WritableStreamStubHook = class WritableStreamStubHook2 extends StubHook {
11279
11560
  }
11280
11561
  }
11281
11562
  onBroken(callback) {
11563
+ this.getState().writer.closed.then(void 0, callback);
11282
11564
  }
11283
11565
  };
11284
11566
  var INITIAL_WINDOW = 262144;
@@ -11373,6 +11655,20 @@ function createWritableStreamFromHook(hook) {
11373
11655
  }
11374
11656
  };
11375
11657
  return new WritableStream({
11658
+ start(controller) {
11659
+ hook.onBroken((err) => {
11660
+ if (pendingError === void 0) {
11661
+ pendingError = err;
11662
+ controller.error(err);
11663
+ disposeHook();
11664
+ }
11665
+ if (windowReject) {
11666
+ windowReject(err);
11667
+ windowResolve = void 0;
11668
+ windowReject = void 0;
11669
+ }
11670
+ });
11671
+ },
11376
11672
  write(chunk, controller) {
11377
11673
  if (pendingError !== void 0) throw pendingError;
11378
11674
  const payload = RpcPayload.fromAppParams([chunk]);
@@ -15070,15 +15366,15 @@ function hasObjects(db, hashes) {
15070
15366
  if (hashes.length === 0) return [];
15071
15367
  const present = /* @__PURE__ */ new Set();
15072
15368
  for (let i = 0; i < hashes.length; i += PROBE_BATCH) {
15073
- const window = hashes.slice(i, i + PROBE_BATCH);
15074
- const placeholders = window.map(() => "?").join(", ");
15369
+ const window2 = hashes.slice(i, i + PROBE_BATCH);
15370
+ const placeholders = window2.map(() => "?").join(", ");
15075
15371
  const rows = db.all(
15076
15372
  `SELECT b.hash
15077
15373
  FROM vfs_blobs b
15078
15374
  JOIN vfs_blob_bytes bb ON bb.hash = b.hash
15079
15375
  WHERE b.hash IN (${placeholders})
15080
15376
  AND length(bb.bytes) = b.size`,
15081
- ...window
15377
+ ...window2
15082
15378
  );
15083
15379
  for (const row of rows) present.add(toHex2(row.hash));
15084
15380
  }
@@ -15279,7 +15575,7 @@ function iterableToReadableStream(it) {
15279
15575
  });
15280
15576
  }
15281
15577
 
15282
- // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/wrapper.mjs
15578
+ // ../../node_modules/.pnpm/ws@8.18.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/wrapper.mjs
15283
15579
  var import_stream = __toESM(require_stream(), 1);
15284
15580
  var import_receiver = __toESM(require_receiver(), 1);
15285
15581
  var import_sender = __toESM(require_sender(), 1);
@@ -1,3 +1,3 @@
1
- import type { WorkspaceRuntimeExecHandle } from "@fungi.computer/cloudflare-computer";
1
+ import type { WorkspaceRuntimeExecHandle, WorkspaceRuntimeResultOptions } from "@fungi.computer/cloudflare-computer";
2
2
  /** A host deadline cancels the owned execution, rather than merely abandoning its result. */
3
- export declare function computerExecutionResult(run: WorkspaceRuntimeExecHandle<"utf8">, signal?: AbortSignal): Promise<import("@fungi.computer/cloudflare-computer").WorkspaceRuntimeResult<"utf8">>;
3
+ export declare function computerExecutionResult(run: WorkspaceRuntimeExecHandle<"utf8">, signal?: AbortSignal, options?: WorkspaceRuntimeResultOptions): Promise<import("@fungi.computer/cloudflare-computer").WorkspaceRuntimeResult<"utf8">>;
@@ -1,7 +1,7 @@
1
1
  /** A host deadline cancels the owned execution, rather than merely abandoning its result. */
2
- export async function computerExecutionResult(run, signal) {
2
+ export async function computerExecutionResult(run, signal, options) {
3
3
  if (signal === undefined)
4
- return await run.result();
4
+ return await run.result(options);
5
5
  let interrupt = () => undefined;
6
6
  const interrupted = new Promise((resolve) => {
7
7
  interrupt = () => {
@@ -13,7 +13,7 @@ export async function computerExecutionResult(run, signal) {
13
13
  });
14
14
  try {
15
15
  const result = await Promise.race([
16
- run.result().then((value) => ({ kind: "result", value })),
16
+ run.result(options).then((value) => ({ kind: "result", value })),
17
17
  interrupted,
18
18
  ]);
19
19
  if (result.kind === "result")
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ export type { WorkspaceRuntimeResultOptions } from "@fungi.computer/cloudflare-computer";
1
2
  export { createLocalBackendReplayStore } from "./local-backend-replay.js";
2
- import { Workspace, WorkspaceProxy, WorkspaceServiceProxy, type WorkspaceStub } from "@fungi.computer/cloudflare-computer";
3
+ import { Workspace, WorkspaceProxy, WorkspaceServiceProxy, type WorkspaceStub, type WorkspaceRuntimeResultOptions } from "@fungi.computer/cloudflare-computer";
3
4
  import { type WorkerShellBackendOptions } from "@fungi.computer/cloudflare-computer/backends/worker-shell";
4
5
  import { type IWorkspaceContainerAPI } from "@fungi.computer/cloudflare-computer/backends/container";
5
6
  import { DurableObject } from "cloudflare:workers";
@@ -250,7 +251,7 @@ export declare class ComputerDO extends ContainerComputer implements ComputerFil
250
251
  * or the first available in the default order. Host-only `hosted` execution
251
252
  * excludes local backends, including an explicitly named local backend.
252
253
  */
253
- protected executeOperationAfterAcceptance(input: ComputerExecRequest, accept: () => void, kind: "exec" | "bash" | "hosted", budget?: ComputerExecutionBudget, signal?: AbortSignal, executionContext?: ComputerValue): Promise<ComputerOperationResult>;
254
+ protected executeOperationAfterAcceptance(input: ComputerExecRequest, accept: () => void, kind: "exec" | "bash" | "hosted", budget?: ComputerExecutionBudget, signal?: AbortSignal, executionContext?: ComputerValue, resultOptions?: WorkspaceRuntimeResultOptions): Promise<ComputerOperationResult>;
254
255
  /**
255
256
  * Run one command on a routed backend. Owners admit and meter hosted
256
257
  * backends here; a member's own machine is neither reserved nor metered.
package/dist/index.js CHANGED
@@ -131,7 +131,7 @@ async function write(workspace, input) {
131
131
  bytes: utf8.encode(content).byteLength,
132
132
  });
133
133
  }
134
- async function exec(workspace, input, backend, signal, execution) {
134
+ async function exec(workspace, input, backend, signal, execution, resultOptions) {
135
135
  const env_1 = { stack: [], error: void 0, hasError: false };
136
136
  try {
137
137
  // The host request has already been decoded under its admitted budget.
@@ -149,7 +149,7 @@ async function exec(workspace, input, backend, signal, execution) {
149
149
  execution?.dispatch();
150
150
  const run = __addDisposableResource(env_1, await workspace.runtime.exec(command, nativeOptions), false);
151
151
  execution?.opened();
152
- const result = await computerExecutionResult(run, signal);
152
+ const result = await computerExecutionResult(run, signal, resultOptions);
153
153
  const synchronizationFailure = result.sync.status === "pending"
154
154
  ? `Computer command filesystem synchronization failed: ${result.sync.error}`
155
155
  : null;
@@ -1009,7 +1009,7 @@ export class ComputerDO extends ContainerComputer {
1009
1009
  * or the first available in the default order. Host-only `hosted` execution
1010
1010
  * excludes local backends, including an explicitly named local backend.
1011
1011
  */
1012
- async executeOperationAfterAcceptance(input, accept, kind, budget = genericComputerExecutionBudget, signal, executionContext) {
1012
+ async executeOperationAfterAcceptance(input, accept, kind, budget = genericComputerExecutionBudget, signal, executionContext, resultOptions) {
1013
1013
  const { requestId, ...command } = computerExecutionRequestSchema(budget).parse(input);
1014
1014
  const route = kind === "exec" && command.backend === undefined
1015
1015
  ? undefined
@@ -1067,7 +1067,7 @@ export class ComputerDO extends ContainerComputer {
1067
1067
  },
1068
1068
  };
1069
1069
  }
1070
- const output = await exec(workspace, command, route?.id, signal, execution);
1070
+ const output = await exec(workspace, command, route?.id, signal, execution, resultOptions);
1071
1071
  completed = true;
1072
1072
  operations.settle(requestId, output);
1073
1073
  }
@@ -19518,6 +19518,16 @@ var appBackendBindingKinds = {
19518
19518
  requires: ["workflow.run", "workflow.arm"],
19519
19519
  effect: "write"
19520
19520
  },
19521
+ pauseSchedule: {
19522
+ cap: "app.workflow.run",
19523
+ requires: ["workflow.run", "workflow.arm"],
19524
+ effect: "write"
19525
+ },
19526
+ resumeSchedule: {
19527
+ cap: "app.workflow.run",
19528
+ requires: ["workflow.run", "workflow.arm"],
19529
+ effect: "write"
19530
+ },
19521
19531
  schedules: {
19522
19532
  cap: "app.workflow.read",
19523
19533
  requires: ["workflow.run"],
@@ -19659,7 +19669,27 @@ var appBackendBindingKinds = {
19659
19669
  name: "AGENTS",
19660
19670
  operations: {
19661
19671
  list: { cap: "agent.list", requires: ["agent.list"], effect: "read" },
19662
- send: { cap: "agent.send", requires: ["agent.send"], effect: "write" }
19672
+ send: { cap: "agent.send", requires: ["agent.send"], effect: "write" },
19673
+ schedules: {
19674
+ cap: "agent.read",
19675
+ requires: ["agent.read"],
19676
+ effect: "read"
19677
+ },
19678
+ pauseSchedule: {
19679
+ cap: "agent.manage",
19680
+ requires: ["agent.manage"],
19681
+ effect: "write"
19682
+ },
19683
+ resumeSchedule: {
19684
+ cap: "agent.manage",
19685
+ requires: ["agent.manage"],
19686
+ effect: "write"
19687
+ },
19688
+ deleteSchedule: {
19689
+ cap: "agent.manage",
19690
+ requires: ["agent.manage"],
19691
+ effect: "write"
19692
+ }
19663
19693
  }
19664
19694
  }
19665
19695
  };
@@ -19714,13 +19744,17 @@ var emptyAppDeclaration = Object.freeze({
19714
19744
 
19715
19745
  // ../puffball/dist/app-api.js
19716
19746
  var appApiMethodNameSchema = String4.check(makeFilter2(isAppApiMethodName));
19747
+ function isJsonContainer(value) {
19748
+ return value !== null && typeof value === "object";
19749
+ }
19717
19750
  function withinDepth(value, depth = 0) {
19718
19751
  if (depth > 16)
19719
19752
  return false;
19720
- if (is2(ArraySchema(Json2))(value))
19721
- return value.every((child) => withinDepth(child, depth + 1));
19722
- if (is2(JsonObject)(value))
19723
- return Object.values(value).every((child) => withinDepth(child, depth + 1));
19753
+ if (isJsonContainer(value)) {
19754
+ for (const child of Object.values(value))
19755
+ if (!withinDepth(child, depth + 1))
19756
+ return false;
19757
+ }
19724
19758
  return true;
19725
19759
  }
19726
19760
  var projection = JsonObject.pipe(check(makeFilter2((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 2e4 && withinDepth(value), { message: "App API schema exceeds its byte or depth bound" })));
@@ -19731,15 +19765,12 @@ var method = Struct({
19731
19765
  output: projection,
19732
19766
  pending: optional2(Literal2(true)),
19733
19767
  hidden: optional2(Literal2(true)),
19734
- anonymous: optional2(Literal2(true)),
19735
19768
  present: optional2(Struct({
19736
19769
  verb: String4.check(isMinLength(1), isMaxLength(32))
19737
19770
  })),
19738
19771
  effect: Literals(["read", "write", "external"]),
19739
19772
  requires: ArraySchema(Literals(appCapabilityIds)).pipe(check(makeFilter2((values) => new Set(values).size === values.length)))
19740
- }).check(makeFilter2((value) => value.anonymous !== true || value.effect === "read" && value.requires.length === 0, {
19741
- message: "Anonymous methods must be reads with no required capabilities"
19742
- }));
19773
+ });
19743
19774
  var appApiSchema = Struct({
19744
19775
  methods: Record(String4, method).pipe(check(makeFilter2((methods) => Object.keys(methods).every(is2(appApiMethodNameSchema)), { message: "Invalid App API method name" })), check(makeFilter2((methods) => Object.keys(methods).length <= 64)), check(makeFilter2((methods) => {
19745
19776
  const names = Object.keys(methods);
@@ -21842,6 +21873,7 @@ var BirdDogAgentJobPayloadSchema = Struct({
21842
21873
  });
21843
21874
  var BirdDogAgentJobInputSchema = Struct({
21844
21875
  work: BirdDogAgentWorkSchema,
21876
+ delivery: Literals(["steer", "followUp"]),
21845
21877
  mail: optional2(BirdDogMailSchema)
21846
21878
  });
21847
21879
 
@@ -22350,7 +22382,7 @@ var symbols = {
22350
22382
  // Oyster: the open shell that holds the Apps' pearl.
22351
22383
  oyster: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("path", { fill: grape, d: "M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z" }), (0, import_jsx_runtime4.jsx)("circle", { fill: cream, cx: "34.9", cy: "41.9", r: "11.3" }), (0, import_jsx_runtime4.jsxs)("g", { fill: ink, children: [(0, import_jsx_runtime4.jsx)("rect", { x: "29.9", y: "33.2", width: "3.2", height: "5.6", rx: "1.6" }), (0, import_jsx_runtime4.jsx)("rect", { x: "36.7", y: "33.2", width: "3.2", height: "5.6", rx: "1.6" })] }), (0, import_jsx_runtime4.jsx)("path", { fill: grape, d: "M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: "none", stroke: yellow, strokeWidth: "3", strokeLinecap: "round", d: "M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1" })] }),
22352
22384
  // Tourtois: the desktop shell, a tortoise carrying window panes.
22353
- tourtois: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: cream, x: "11.07", y: "35.73", width: "26.8", height: "9.7", rx: "3.25", transform: "rotate(-5 24.47 40.58)" }), (0, import_jsx_runtime4.jsx)("path", { fill: yellow, d: "M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: blue, d: "M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: cream, d: "M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z" }), (0, import_jsx_runtime4.jsxs)("g", { fill: cream, children: [(0, import_jsx_runtime4.jsx)("circle", { cx: "14.7", cy: "18.45", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.6", cy: "17.65", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "20.5", cy: "16.85", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.9", cy: "22.2", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "21", cy: "21.5", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "24.1", cy: "20.75", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "28.2", cy: "25.3", r: "1" })] }), (0, import_jsx_runtime4.jsx)("circle", { fill: coral, cx: "21.7", cy: "26.6", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { fill: yellow, cx: "24.9", cy: "25.9", r: "1.05" }), (0, import_jsx_runtime4.jsxs)("g", { fill: mint, children: [(0, import_jsx_runtime4.jsx)("ellipse", { cx: "8.8", cy: "36.6", rx: "3.6", ry: "1.9", transform: "rotate(22 8.8 36.6)" }), (0, import_jsx_runtime4.jsx)("path", { d: "M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5 12 41Z" }), (0, import_jsx_runtime4.jsx)("path", { d: "M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z" })] }), (0, import_jsx_runtime4.jsx)("ellipse", { fill: mint, cx: "46.4", cy: "30.6", rx: "8.1", ry: "8.3" }), (0, import_jsx_runtime4.jsxs)("g", { fill: ink, children: [(0, import_jsx_runtime4.jsx)("rect", { x: "45.05", y: "26.95", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 46.2 29.3)" }), (0, import_jsx_runtime4.jsx)("rect", { x: "49.25", y: "26.4", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 50.4 28.7)" })] }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z", transform: "rotate(-8 48.9 33.5)" }), (0, import_jsx_runtime4.jsx)("path", { fill: "none", stroke: yellow, strokeWidth: "3", strokeLinecap: "round", d: "M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7" })] }),
22385
+ tourtois: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: cream, x: "11.07", y: "35.73", width: "26.8", height: "9.7", rx: "3.25", transform: "rotate(-5 24.47 40.58)" }), (0, import_jsx_runtime4.jsx)("path", { fill: yellow, d: "M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: blue, d: "M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: cream, d: "M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z" }), (0, import_jsx_runtime4.jsxs)("g", { fill: cream, children: [(0, import_jsx_runtime4.jsx)("circle", { cx: "14.7", cy: "18.45", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.6", cy: "17.65", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "20.5", cy: "16.85", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.9", cy: "22.2", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "21", cy: "21.5", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "24.1", cy: "20.75", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "28.2", cy: "25.3", r: "1" })] }), (0, import_jsx_runtime4.jsx)("circle", { fill: coral, cx: "21.7", cy: "26.6", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { fill: yellow, cx: "24.9", cy: "25.9", r: "1.05" }), (0, import_jsx_runtime4.jsxs)("g", { fill: mint, children: [(0, import_jsx_runtime4.jsx)("ellipse", { cx: "8.8", cy: "36.6", rx: "3.6", ry: "1.9", transform: "rotate(22 8.8 36.6)" }), (0, import_jsx_runtime4.jsx)("path", { d: "M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5L12 41Z" }), (0, import_jsx_runtime4.jsx)("path", { d: "M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z" })] }), (0, import_jsx_runtime4.jsx)("ellipse", { fill: mint, cx: "46.4", cy: "30.6", rx: "8.1", ry: "8.3" }), (0, import_jsx_runtime4.jsxs)("g", { fill: ink, children: [(0, import_jsx_runtime4.jsx)("rect", { x: "45.05", y: "26.95", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 46.2 29.3)" }), (0, import_jsx_runtime4.jsx)("rect", { x: "49.25", y: "26.4", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 50.4 28.7)" })] }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z", transform: "rotate(-8 48.9 33.5)" }), (0, import_jsx_runtime4.jsx)("path", { fill: "none", stroke: yellow, strokeWidth: "3", strokeLinecap: "round", d: "M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7" })] }),
22354
22386
  // The launcher's "All Apps": four App tiles, no install arrow.
22355
22387
  allApps: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: coral, x: "7", y: "7.25", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(-6.2 18.6 18.6)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: blue, x: "33.9", y: "7.25", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(6.2 45.5 18.6)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: mint, x: "7", y: "34.15", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(6.2 18.6 45.5)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: yellow, x: "33.9", y: "34.15", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(-6.2 45.5 45.5)" })] }),
22356
22388
  // Search: a magnifying glass.
@@ -35641,7 +35673,7 @@ async function stopHtmlGroup(child) {
35641
35673
  }
35642
35674
  throw new Error("HTML process group survived its five-second cleanup bound");
35643
35675
  }
35644
- function runHtmlCommand(args2, cwd, env, command = "pnpm") {
35676
+ function runHtmlCommand(args2, cwd, env, command = "pnpm", onOutput) {
35645
35677
  return acquireUseRelease2(
35646
35678
  sync2(() => {
35647
35679
  if (process.platform === "win32")
@@ -35656,11 +35688,13 @@ function runHtmlCommand(args2, cwd, env, command = "pnpm") {
35656
35688
  let stdout = "";
35657
35689
  let stderr = "";
35658
35690
  child.stdout.on("data", (chunk) => {
35691
+ onOutput?.("stdout", chunk);
35659
35692
  stdout += chunk.toString();
35660
35693
  if (Buffer2.byteLength(stdout) > 1024 * 1024)
35661
35694
  reject(new Error("HTML command output exceeded its bound"));
35662
35695
  });
35663
35696
  child.stderr.on("data", (chunk) => {
35697
+ onOutput?.("stderr", chunk);
35664
35698
  stderr += chunk.toString();
35665
35699
  if (Buffer2.byteLength(stderr) > 1024 * 1024)
35666
35700
  reject(new Error("HTML command diagnostics exceeded their bound"));
@@ -35701,10 +35735,10 @@ function snapshotBuildEnvironment(sourceSnapshotPath) {
35701
35735
  }
35702
35736
  function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
35703
35737
  if (recipe.kind === "source-html")
35704
- return rebuildNpmSnapshot(sourceSnapshotPath, recipe);
35738
+ return rebuildNpmSnapshot(sourceSnapshotPath, recipe, options);
35705
35739
  return gen2(function* () {
35706
35740
  const env = snapshotBuildEnvironment(sourceSnapshotPath);
35707
- const run2 = (args2, cwd = sourceSnapshotPath) => runHtmlCommand(args2, cwd, env);
35741
+ const run2 = (args2, cwd = sourceSnapshotPath) => runHtmlCommand(args2, cwd, env, "pnpm", options.onOutput);
35708
35742
  if ((yield* run2(["--version"])).trim() !== "11.24.0") {
35709
35743
  return yield* fail5(new Error("Publisher requires pnpm 11.24.0"));
35710
35744
  }
@@ -35922,7 +35956,7 @@ function readHtmlBuildOutput(sourceSnapshotPath, recipe) {
35922
35956
  return Object.freeze({ kind: "bytes", bytes });
35923
35957
  });
35924
35958
  }
35925
- function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
35959
+ function rebuildNpmSnapshot(sourceSnapshotPath, recipe, options) {
35926
35960
  return gen2(function* () {
35927
35961
  const env = snapshotBuildEnvironment(sourceSnapshotPath);
35928
35962
  const home = join5(sourceSnapshotPath, ".publisher-home");
@@ -35939,7 +35973,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
35939
35973
  ["--version"],
35940
35974
  sourceSnapshotPath,
35941
35975
  env,
35942
- "npm"
35976
+ "npm",
35977
+ options.onOutput
35943
35978
  )).trim() !== recipe.toolchain.npm)
35944
35979
  return yield* fail5(
35945
35980
  new Error("Captured npm version differs from the recipe")
@@ -35948,7 +35983,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
35948
35983
  ["ci", "--include=dev", "--ignore-scripts", "--no-audit", "--no-fund"],
35949
35984
  sourceSnapshotPath,
35950
35985
  env,
35951
- "npm"
35986
+ "npm",
35987
+ options.onOutput
35952
35988
  );
35953
35989
  const program = join5(sourceSnapshotPath, ".publisher-build.mjs");
35954
35990
  yield* tryPromise2(async () => {
@@ -35969,7 +36005,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
35969
36005
  ],
35970
36006
  sourceSnapshotPath,
35971
36007
  env,
35972
- "node"
36008
+ "node",
36009
+ options.onOutput
35973
36010
  );
35974
36011
  return yield* readHtmlBuildOutput(sourceSnapshotPath, recipe);
35975
36012
  });
@@ -36110,7 +36147,9 @@ function createLocalBuildExecutor(options = {}) {
36110
36147
  if ((yield* runHtmlCommand(
36111
36148
  ["--version"],
36112
36149
  source.snapshotPath,
36113
- environment
36150
+ environment,
36151
+ "pnpm",
36152
+ options.onOutput
36114
36153
  )).trim() !== "11.24.0")
36115
36154
  return yield* fail5(
36116
36155
  new Error("Publisher requires pnpm 11.24.0")
@@ -36121,7 +36160,9 @@ function createLocalBuildExecutor(options = {}) {
36121
36160
  options.packageCacheDirectory
36122
36161
  ),
36123
36162
  source.snapshotPath,
36124
- environment
36163
+ environment,
36164
+ "pnpm",
36165
+ options.onOutput
36125
36166
  );
36126
36167
  }
36127
36168
  }
@@ -36272,6 +36313,9 @@ async function buildTeamCandidate(input) {
36272
36313
  const onPhase = (phase, milliseconds) => {
36273
36314
  phases[phase] += milliseconds;
36274
36315
  };
36316
+ const onOutput = (stream, bytes2) => {
36317
+ input.onOutput?.(stream, bytes2);
36318
+ };
36275
36319
  const prepareStarted = performance.now();
36276
36320
  const candidate = await runPromise2(
36277
36321
  createCapturedCandidatePreparer(config2, {
@@ -36280,10 +36324,11 @@ async function buildTeamCandidate(input) {
36280
36324
  config2.sourceRevision
36281
36325
  ),
36282
36326
  buildExecutor: createLocalBuildExecutor(
36283
- input.packageStoreDirectory === void 0 ? { packageScripts: "run", onPhase } : {
36327
+ input.packageStoreDirectory === void 0 ? { packageScripts: "run", onPhase, onOutput } : {
36284
36328
  packageScripts: "run",
36285
36329
  packageStoreDirectory: input.packageStoreDirectory,
36286
- onPhase
36330
+ onPhase,
36331
+ onOutput
36287
36332
  }
36288
36333
  )
36289
36334
  }).prepareCandidate(parseReleaseId("rel_build"))
@@ -36354,7 +36399,10 @@ try {
36354
36399
  repositoryPath,
36355
36400
  outputPath,
36356
36401
  // Computer scratch survives captured snapshot cleanup, without a global or durable Workspace store.
36357
- packageStoreDirectory: "/var/tmp/fungi-app-package-store"
36402
+ packageStoreDirectory: "/var/tmp/fungi-app-package-store",
36403
+ onOutput: (stream, bytes) => {
36404
+ process[stream].write(bytes);
36405
+ }
36358
36406
  });
36359
36407
  const reportUrl = process.env.TEAM_BUILD_REPORT;
36360
36408
  if (!reportUrl) throw new TeamCandidateBuildError("report_failed");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/computer",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Cloudflare Computer host for one durable Fungi Computer",
6
6
  "type": "module",
@@ -60,10 +60,10 @@
60
60
  "@fungi.computer/capnweb": "0.12.0",
61
61
  "@fungi.computer/cloudflare-computer": "0.2.1-fungi.2",
62
62
  "@fungi.computer/cordyceps": "0.4.0",
63
- "@fungi.computer/knapsack": "0.4.0",
63
+ "@fungi.computer/knapsack": "0.4.2",
64
64
  "@fungi.computer/seam": "0.2.0",
65
65
  "@fungi.computer/watchdog": "0.1.0",
66
- "@fungi.computer/computer-contract": "0.0.5",
66
+ "@fungi.computer/computer-contract": "0.0.7",
67
67
  "effect": "4.0.2",
68
68
  "just-bash": "3.4.2",
69
69
  "zod": "4.4.3"
@@ -115,10 +115,10 @@
115
115
  "format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",
116
116
  "lint:anti-slop": "node ../../tooling/repository/scripts/lint-package-anti-slop.mjs",
117
117
  "test:merge": "pnpm run test",
118
- "test:nightly": "bash ../../.agents/skills/orchestrate-multi-lane-work/scripts/run-proof.sh node test/egress-proof.mjs",
118
+ "test:nightly": "bash ../../tooling/proof-runner/run-proof.sh node test/egress-proof.mjs",
119
119
  "test:app-method-execution": "node test/app-method-execution-proof.mjs",
120
120
  "test:execution-lifecycle": "node test/execution-lifecycle-proof.mjs",
121
- "test:unit": "node --test test/egress-policy.test.mjs test/preview.test.mjs test/fleet.test.mjs test/proof-worker.test.mjs test/workspace-sync.test.mjs test/files-patch.test.mjs test/exec-output.test.mjs && node --test test/seam-signature.test.mjs test/local-backend-replay.test.mjs test/machine-link-reopen-replay.test.mjs test/computer-backends.test.mjs test/terminal-welcome.test.mjs test/on-box-vm.test.mjs && node test/terminal-protocol.test.mjs && node test/container-policy.test.mjs && node test/files-adapter-proof.mjs && node test/operation-record-proof.mjs && node test/process-inventory-proof.mjs",
121
+ "test:unit": "node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/egress-policy.test.mjs test/preview.test.mjs test/fleet.test.mjs test/proof-worker.test.mjs test/native-readiness.test.mjs test/workspace-sync.test.mjs test/runtime-observer.test.mjs test/files-patch.test.mjs test/exec-output.test.mjs && node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/seam-signature.test.mjs test/local-backend-replay.test.mjs test/machine-link-reopen-replay.test.mjs test/computer-backends.test.mjs test/terminal-welcome.test.mjs test/on-box-vm.test.mjs && node test/terminal-protocol.test.mjs && node test/container-policy.test.mjs && node test/files-adapter-proof.mjs && node test/operation-record-proof.mjs && node test/process-inventory-proof.mjs",
122
122
  "test:fleet-native": "node test/fleet.native.mjs",
123
123
  "test:light-shell:native": "node --import tsx test/light-shell.native.mjs --state",
124
124
  "assemble:image": "node scripts/assemble-image.mjs"