@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.
package/dist/node.js CHANGED
@@ -3305,7 +3305,7 @@ function satisfies(version, range2) {
3305
3305
  }
3306
3306
 
3307
3307
  // src/version.ts
3308
- var KERNEL_VERSION = true ? "1.147.7" : "0.0.0-dev";
3308
+ var KERNEL_VERSION = true ? "1.147.9" : "0.0.0-dev";
3309
3309
  var OS_RELEASE = "6.0.0-slicc";
3310
3310
  function procVersion() {
3311
3311
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -19243,6 +19243,7 @@ function isWasmSyscall(req) {
19243
19243
  return typeof op === "string" && SYSCALL_OPS.has(op);
19244
19244
  }
19245
19245
  var MAX_READ = 1024 * 1024;
19246
+ var MAX_PREAD = 16 * 1024 * 1024;
19246
19247
  var O_NONBLOCK = 2048;
19247
19248
  var WRITE_ACCESS = 3;
19248
19249
  var KEYBOARD = /* @__PURE__ */ new Set([SIG.INT, SIG.QUIT, SIG.TSTP]);
@@ -20189,7 +20190,7 @@ var WasmProcess = class {
20189
20190
  return {
20190
20191
  ok: true,
20191
20192
  kind: "bytes",
20192
- bytes: await file.pread(Math.min(req.max, MAX_READ), req.offset)
20193
+ bytes: await file.pread(Math.min(req.max, MAX_PREAD), req.offset)
20193
20194
  };
20194
20195
  case "fd-pwrite":
20195
20196
  return { ok: true, kind: "json", json: await file.pwrite(req.body, req.offset) };
@@ -23585,6 +23586,19 @@ var OpfsFs = class {
23585
23586
  for (const path of paths) this.forget(path);
23586
23587
  this.channel?.postMessage(paths);
23587
23588
  }
23589
+ heldUnder = () => [];
23590
+ heldBy(held) {
23591
+ this.heldUnder = held;
23592
+ }
23593
+ async pinHeld(dir) {
23594
+ const held = this.heldUnder(dir);
23595
+ if (held.length === 0) return;
23596
+ const known = await this.meta.get(held);
23597
+ const bare = held.filter((_, i) => known[i]?.ino === void 0);
23598
+ for (const p of bare) {
23599
+ await this.meta.update(p, (entry) => ({ ...occupied(entry), path: p, ino: inodeOf(p) }));
23600
+ }
23601
+ }
23588
23602
  remoteChanges(listener) {
23589
23603
  return this.remote?.listen(listener) ?? (() => {
23590
23604
  });
@@ -24715,6 +24729,7 @@ var OpfsFs = class {
24715
24729
  if (targetStat?.isDirectory && (await this.readdir(destination)).length > 0) {
24716
24730
  throw fsError("ENOTEMPTY", to);
24717
24731
  }
24732
+ if (sourceStat.isDirectory) await this.pinHeld(source.path);
24718
24733
  const now = Date.now();
24719
24734
  const moving = await this.movedOwner(source);
24720
24735
  const carry = (entry2) => ({
@@ -28333,6 +28348,9 @@ var Launcher = class {
28333
28348
  this.watchers.heard("rename", change.trees ?? []);
28334
28349
  });
28335
28350
  const holders = [this.held, this.openFiles];
28351
+ options.fs.heldBy?.(
28352
+ (dir) => holders.flatMap((set3) => [...set3].flatMap((holder) => [...holder.held()])).filter((p) => p.startsWith(`${dir}/`) && this.mounts.locate(p) === void 0)
28353
+ );
28336
28354
  this.unlinked = new UnlinkedKeeper(
28337
28355
  fs,
28338
28356
  { [Symbol.iterator]: () => holders.flatMap((set3) => [...set3]).values() },