@ai-ecoverse/slicc-kernel 1.143.1 → 1.143.2

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.
@@ -6725,7 +6725,7 @@ var KERNEL_VERSION, OS_RELEASE;
6725
6725
  var init_version = __esm({
6726
6726
  "src/version.ts"() {
6727
6727
  "use strict";
6728
- KERNEL_VERSION = true ? "1.143.1" : "0.0.0-dev";
6728
+ KERNEL_VERSION = true ? "1.143.2" : "0.0.0-dev";
6729
6729
  OS_RELEASE = "6.0.0-slicc";
6730
6730
  }
6731
6731
  });
package/dist/node.js CHANGED
@@ -7982,7 +7982,7 @@ function satisfies(version, range2) {
7982
7982
  }
7983
7983
 
7984
7984
  // src/version.ts
7985
- var KERNEL_VERSION = true ? "1.143.1" : "0.0.0-dev";
7985
+ var KERNEL_VERSION = true ? "1.143.2" : "0.0.0-dev";
7986
7986
  var OS_RELEASE = "6.0.0-slicc";
7987
7987
  function procVersion() {
7988
7988
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -10515,7 +10515,7 @@ function route(watch, type, path) {
10515
10515
  }
10516
10516
  function routed(watch, root, type, path) {
10517
10517
  if (path === root || type === "rename" && root !== "/" && under3(root, path)) {
10518
- noted(watch, { type, filename: baseOf3(root) });
10518
+ noted(watch, { type, filename: watch.names.get(root) ?? baseOf3(root) });
10519
10519
  if (type === "rename") noted(watch, { ended: true });
10520
10520
  return true;
10521
10521
  }
@@ -10525,6 +10525,11 @@ function routed(watch, root, type, path) {
10525
10525
  } else return false;
10526
10526
  return true;
10527
10527
  }
10528
+ function remapped(root, from, to) {
10529
+ if (root === from) return to;
10530
+ if (from !== "/" && root.startsWith(`${from}/`)) return to + root.slice(from.length);
10531
+ return void 0;
10532
+ }
10528
10533
  var FsWatchers = class {
10529
10534
  watchers = /* @__PURE__ */ new Set();
10530
10535
  typed = /* @__PURE__ */ new Set();
@@ -10559,6 +10564,7 @@ var FsWatchers = class {
10559
10564
  const other = alias === void 0 ? main : normalizePath(alias);
10560
10565
  const watch = {
10561
10566
  roots: other === main ? [main] : [main, other],
10567
+ names: /* @__PURE__ */ new Map(),
10562
10568
  recursive,
10563
10569
  notes: [],
10564
10570
  overflowed: false,
@@ -10608,6 +10614,35 @@ var FsWatchers = class {
10608
10614
  for (const watch of [...this.typed]) route(watch, type, at);
10609
10615
  }
10610
10616
  }
10617
+ moved(from, to) {
10618
+ const source = normalizePath(from);
10619
+ const target = normalizePath(to);
10620
+ const followed2 = /* @__PURE__ */ new Set();
10621
+ for (const watch of this.typed) {
10622
+ const [main] = watch.roots;
10623
+ const roots = watch.roots.map((root) => remapped(root, source, target) ?? root);
10624
+ if (roots.every((root, i) => root === watch.roots[i])) continue;
10625
+ followed2.add(watch);
10626
+ const names2 = /* @__PURE__ */ new Map();
10627
+ watch.roots.forEach((root, i) => {
10628
+ names2.set(roots[i], watch.names.get(root) ?? baseOf3(root));
10629
+ });
10630
+ watch.names = names2;
10631
+ watch.roots = [...new Set(roots)];
10632
+ if (main === source) {
10633
+ noted(watch, { type: "rename", filename: names2.get(target), moved: true });
10634
+ }
10635
+ }
10636
+ return followed2;
10637
+ }
10638
+ renamed(from, to) {
10639
+ const followed2 = this.moved(from, to);
10640
+ if (this.typed.size === 0) return;
10641
+ for (const path of [from, to]) {
10642
+ const at = normalizePath(path);
10643
+ for (const watch of [...this.typed]) if (!followed2.has(watch)) route(watch, "rename", at);
10644
+ }
10645
+ }
10611
10646
  changed(...paths) {
10612
10647
  this.report(paths);
10613
10648
  this.emit("change", paths);
@@ -10711,7 +10746,16 @@ var FsWatchers = class {
10711
10746
  }
10712
10747
  },
10713
10748
  rm: reshaping(after(fs.rm.bind(fs), (path) => [path], "rename")),
10714
- rename: reshaping(after(fs.rename.bind(fs), (from, to) => [from, to], "rename")),
10749
+ rename: reshaping(async (from, to) => {
10750
+ let done4 = false;
10751
+ try {
10752
+ await fs.rename(from, to);
10753
+ done4 = true;
10754
+ } finally {
10755
+ this.report([from, to]);
10756
+ if (done4) this.renamed(from, to);
10757
+ }
10758
+ }),
10715
10759
  link: reshaping(
10716
10760
  after(
10717
10761
  (from, to, follow2) => fs.link(from, to, follow2),