@ai-ecoverse/slicc-kernel 1.131.0 → 1.132.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.
@@ -2664,7 +2664,7 @@ var KERNEL_VERSION, OS_RELEASE;
2664
2664
  var init_version = __esm({
2665
2665
  "src/version.ts"() {
2666
2666
  "use strict";
2667
- KERNEL_VERSION = true ? "1.131.0" : "0.0.0-dev";
2667
+ KERNEL_VERSION = true ? "1.132.1" : "0.0.0-dev";
2668
2668
  OS_RELEASE = "6.0.0-slicc";
2669
2669
  }
2670
2670
  });
@@ -6540,6 +6540,22 @@ function physicalPath(fs, path) {
6540
6540
  }
6541
6541
  return `/${walk.done.join("/")}`;
6542
6542
  }
6543
+ function physicalLeaf(fs, path) {
6544
+ const walk = start(path);
6545
+ for (let part = next(walk); part !== void 0; part = next(walk)) {
6546
+ const at = `/${[...walk.done, part].join("/")}`;
6547
+ let target;
6548
+ try {
6549
+ target = fs.lstat(at).isSymbolicLink ? fs.readlink(at) : void 0;
6550
+ } catch {
6551
+ const tail = walk.todo;
6552
+ return tail.some((p) => p === "." || p === "..") ? void 0 : [at, ...tail].join("/");
6553
+ }
6554
+ if (target === void 0) walk.done.push(part);
6555
+ else if (!follow(walk, target)) return void 0;
6556
+ }
6557
+ return `/${walk.done.join("/")}`;
6558
+ }
6543
6559
  async function physicalPathAsync(fs, path) {
6544
6560
  const walk = start(path);
6545
6561
  for (let part = next(walk); part !== void 0; part = next(walk)) {
@@ -11231,8 +11247,8 @@ var init_wasi_host = __esm({
11231
11247
  }
11232
11248
  linkedDev(path, follow3) {
11233
11249
  if (!follow3) return void 0;
11234
- const real = physicalPath(this.o.fs, path);
11235
- return real !== path && kernelDev(real) ? real : void 0;
11250
+ const real = physicalLeaf(this.o.fs, path);
11251
+ return real !== void 0 && real !== path && kernelDev(real) ? real : void 0;
11236
11252
  }
11237
11253
  statOf(path, follow3) {
11238
11254
  return follow3 ? this.o.fs.stat(path) : this.o.fs.lstat(path);
@@ -11260,12 +11276,12 @@ var init_wasi_host = __esm({
11260
11276
  if (!follow3) {
11261
11277
  const slash = path.lastIndexOf("/");
11262
11278
  if (slash <= 0) return void 0;
11263
- const parent = physicalPath(this.o.fs, path.slice(0, slash));
11264
- const resolved3 = `${parent}/${path.slice(slash + 1)}`;
11265
- return resolved3 !== path && this.synthetic(resolved3) ? resolved3 : void 0;
11279
+ const parent = physicalLeaf(this.o.fs, path.slice(0, slash));
11280
+ const resolved3 = parent === void 0 ? void 0 : `${parent}/${path.slice(slash + 1)}`;
11281
+ return resolved3 !== void 0 && resolved3 !== path && this.synthetic(resolved3) ? resolved3 : void 0;
11266
11282
  }
11267
- const resolved2 = physicalPath(this.o.fs, path);
11268
- return resolved2 !== path && this.synthetic(resolved2) ? resolved2 : void 0;
11283
+ const resolved2 = physicalLeaf(this.o.fs, path);
11284
+ return resolved2 !== void 0 && resolved2 !== path && this.synthetic(resolved2) ? resolved2 : void 0;
11269
11285
  } catch {
11270
11286
  return void 0;
11271
11287
  }