@ai-ecoverse/slicc-kernel 1.112.0 → 1.113.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.
package/dist/node.js CHANGED
@@ -4099,6 +4099,8 @@ var S_ISGID3 = 1024;
4099
4099
  var READ_ATTEMPTS = 3;
4100
4100
  var MAX_LINKS5 = 40;
4101
4101
  var CHECK_MS = 1e3;
4102
+ var ABSENT_MS = 2;
4103
+ var ABSENT_NAMES = 4096;
4102
4104
  var FILE_HANDLES = 4096;
4103
4105
  var STALE = /* @__PURE__ */ new Set(["NotFoundError", "TypeMismatchError"]);
4104
4106
  var EXECUTABLE = /\/node_modules\/(?:@[^/]+\/)?[^/]+\/bin\//;
@@ -4229,6 +4231,8 @@ var OpfsFs = class {
4229
4231
  meta;
4230
4232
  dirs = new PathMap();
4231
4233
  files = new PathMap();
4234
+ absent = new PathMap();
4235
+ changes = 0;
4232
4236
  snapshots = /* @__PURE__ */ new WeakMap();
4233
4237
  found = /* @__PURE__ */ new WeakMap();
4234
4238
  checked = /* @__PURE__ */ new WeakMap();
@@ -4467,8 +4471,14 @@ var OpfsFs = class {
4467
4471
  return true;
4468
4472
  }
4469
4473
  forget(path) {
4474
+ this.changes++;
4470
4475
  this.dirs.deleteTree(path);
4471
4476
  this.files.deleteTree(path);
4477
+ this.absent.deleteTree(path);
4478
+ }
4479
+ missed(path) {
4480
+ if (this.absent.size >= ABSENT_NAMES) this.absent.clear();
4481
+ this.absent.set(path, performance.now());
4472
4482
  }
4473
4483
  remember(path, handle, looked = false) {
4474
4484
  if (handle.kind !== "file") return handle;
@@ -4518,8 +4528,15 @@ var OpfsFs = class {
4518
4528
  this.snapshots.delete(cached);
4519
4529
  }
4520
4530
  }
4531
+ const kept = this.dirs.get(path);
4532
+ if (kept && await this.current(path, kept)) return kept;
4533
+ const gone = this.absent.get(path);
4534
+ if (gone !== void 0 && performance.now() - gone < ABSENT_MS) {
4535
+ throw translate({ name: "NotFoundError" }, path);
4536
+ }
4537
+ const seen = this.changes;
4521
4538
  const [dir, name2] = await this.parent(path);
4522
- const known = this.dirs.has(path);
4539
+ const known = kept !== void 0;
4523
4540
  return this.inDir(dir, async (parent) => {
4524
4541
  const [first, second] = known ? ["directory", "file"] : ["file", "directory"];
4525
4542
  try {
@@ -4529,7 +4546,9 @@ var OpfsFs = class {
4529
4546
  }
4530
4547
  return this.remember(path, await this.child(parent, name2, second), true);
4531
4548
  }).catch((err) => {
4532
- throw translate(err, path);
4549
+ const error = translate(err, path);
4550
+ if (error.code === "ENOENT" && seen === this.changes) this.missed(path);
4551
+ throw error;
4533
4552
  });
4534
4553
  }
4535
4554
  real(path) {
@@ -4656,7 +4675,9 @@ var OpfsFs = class {
4656
4675
  }
4657
4676
  flushing = {};
4658
4677
  touch(now, ...dirs) {
4678
+ this.changes++;
4659
4679
  for (const dir of dirs) {
4680
+ this.absent.deleteTree(dir);
4660
4681
  this.dirTimes.set(dir, now);
4661
4682
  this.dirDirty.add(dir);
4662
4683
  }
@@ -6510,7 +6531,7 @@ function satisfies(version, range2) {
6510
6531
  }
6511
6532
 
6512
6533
  // src/version.ts
6513
- var KERNEL_VERSION = true ? "1.112.0" : "0.0.0-dev";
6534
+ var KERNEL_VERSION = true ? "1.113.0" : "0.0.0-dev";
6514
6535
  var OS_RELEASE = "6.0.0-slicc";
6515
6536
  function procVersion() {
6516
6537
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC