@ai-ecoverse/slicc-kernel 1.147.7 → 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.7" : "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
@@ -23322,6 +23336,7 @@ function isWasmSyscall(req) {
23322
23336
  return typeof op === "string" && SYSCALL_OPS.has(op);
23323
23337
  }
23324
23338
  var MAX_READ = 1024 * 1024;
23339
+ var MAX_PREAD = 16 * 1024 * 1024;
23325
23340
  var O_NONBLOCK = 2048;
23326
23341
  var WRITE_ACCESS = 3;
23327
23342
  var KEYBOARD = /* @__PURE__ */ new Set([SIG.INT, SIG.QUIT, SIG.TSTP]);
@@ -24268,7 +24283,7 @@ var WasmProcess = class {
24268
24283
  return {
24269
24284
  ok: true,
24270
24285
  kind: "bytes",
24271
- bytes: await file.pread(Math.min(req.max, MAX_READ), req.offset)
24286
+ bytes: await file.pread(Math.min(req.max, MAX_PREAD), req.offset)
24272
24287
  };
24273
24288
  case "fd-pwrite":
24274
24289
  return { ok: true, kind: "json", json: await file.pwrite(req.body, req.offset) };
@@ -29316,6 +29331,9 @@ var Launcher = class {
29316
29331
  this.watchers.heard("rename", change.trees ?? []);
29317
29332
  });
29318
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
+ );
29319
29337
  this.unlinked = new UnlinkedKeeper(
29320
29338
  fs,
29321
29339
  { [Symbol.iterator]: () => holders.flatMap((set3) => [...set3]).values() },