@ai-ecoverse/slicc-kernel 1.147.8 → 1.147.9

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.
@@ -1562,6 +1562,19 @@ var OpfsFs = class {
1562
1562
  for (const path of paths) this.forget(path);
1563
1563
  this.channel?.postMessage(paths);
1564
1564
  }
1565
+ heldUnder = () => [];
1566
+ heldBy(held) {
1567
+ this.heldUnder = held;
1568
+ }
1569
+ async pinHeld(dir) {
1570
+ const held = this.heldUnder(dir);
1571
+ if (held.length === 0) return;
1572
+ const known = await this.meta.get(held);
1573
+ const bare = held.filter((_, i) => known[i]?.ino === void 0);
1574
+ for (const p of bare) {
1575
+ await this.meta.update(p, (entry) => ({ ...occupied(entry), path: p, ino: inodeOf(p) }));
1576
+ }
1577
+ }
1565
1578
  remoteChanges(listener) {
1566
1579
  return this.remote?.listen(listener) ?? (() => {
1567
1580
  });
@@ -2692,6 +2705,7 @@ var OpfsFs = class {
2692
2705
  if (targetStat?.isDirectory && (await this.readdir(destination)).length > 0) {
2693
2706
  throw fsError("ENOTEMPTY", to);
2694
2707
  }
2708
+ if (sourceStat.isDirectory) await this.pinHeld(source.path);
2695
2709
  const now = Date.now();
2696
2710
  const moving = await this.movedOwner(source);
2697
2711
  const carry = (entry2) => ({
@@ -7805,7 +7819,7 @@ function satisfies(version, range2) {
7805
7819
  }
7806
7820
 
7807
7821
  // src/version.ts
7808
- var KERNEL_VERSION = true ? "1.147.8" : "0.0.0-dev";
7822
+ var KERNEL_VERSION = true ? "1.147.9" : "0.0.0-dev";
7809
7823
  var OS_RELEASE = "6.0.0-slicc";
7810
7824
  function procVersion() {
7811
7825
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -29317,6 +29331,9 @@ var Launcher = class {
29317
29331
  this.watchers.heard("rename", change.trees ?? []);
29318
29332
  });
29319
29333
  const holders = [this.held, this.openFiles];
29334
+ options.fs.heldBy?.(
29335
+ (dir) => holders.flatMap((set3) => [...set3].flatMap((holder) => [...holder.held()])).filter((p) => p.startsWith(`${dir}/`) && this.mounts.locate(p) === void 0)
29336
+ );
29320
29337
  this.unlinked = new UnlinkedKeeper(
29321
29338
  fs,
29322
29339
  { [Symbol.iterator]: () => holders.flatMap((set3) => [...set3]).values() },