@ai-ecoverse/slicc-kernel 1.34.0 → 1.34.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.
package/dist/node.js CHANGED
@@ -339,14 +339,6 @@ function sinkFile(onData) {
339
339
  }
340
340
  });
341
341
  }
342
- function nullFile() {
343
- return new OpenFile({
344
- read: async () => new Uint8Array(0),
345
- write: async (bytes) => bytes.length,
346
- close: () => {
347
- }
348
- });
349
- }
350
342
  function written(device, bytes) {
351
343
  if (device === "full" && bytes.length > 0) throw new KernelError("ENOSPC");
352
344
  return bytes.length;
@@ -3519,7 +3511,7 @@ var ChildTable = class {
3519
3511
  captured.set(n, chunks2);
3520
3512
  return sinkFile((bytes) => chunks2.push(bytes));
3521
3513
  }
3522
- return nullFile();
3514
+ return deviceFile("null");
3523
3515
  }
3524
3516
  async wait(pid, nohang, signal, flags = {}) {
3525
3517
  let interrupt;
@@ -10600,7 +10592,7 @@ var Launcher = class {
10600
10592
  return { status: NOT_FOUND, stdout: concat5(out), stderr: concat5(err) };
10601
10593
  }
10602
10594
  const fds = new FdTable();
10603
- fds.installAt(0, options.stdin ? bytesSource(options.stdin) : nullFile());
10595
+ fds.installAt(0, options.stdin ? bytesSource(options.stdin) : deviceFile("null"));
10604
10596
  fds.installAt(1, sinkFile(stdout));
10605
10597
  fds.installAt(2, sinkFile(stderr));
10606
10598
  const group = options.pgid !== void 0 ? { pgid: options.pgid } : {};
@@ -11539,10 +11531,11 @@ function hostfsFetchOf(options) {
11539
11531
  if (hostfsOrigin === void 0) return hostfsFetch ? { hostfsFetch } : {};
11540
11532
  const base = hostfsFetch ?? ((url, init) => fetch(url, init));
11541
11533
  return {
11542
- hostfsFetch: (url, init) => base(url, {
11543
- ...init,
11544
- headers: { ...init.headers, Origin: hostfsOrigin }
11545
- })
11534
+ hostfsFetch: (url, init) => {
11535
+ const headers = new Headers(init.headers);
11536
+ headers.set("Origin", hostfsOrigin);
11537
+ return base(url, { ...init, headers });
11538
+ }
11546
11539
  };
11547
11540
  }
11548
11541
  function nodeTransport() {