@ai-ecoverse/slicc-kernel 1.196.47 → 1.196.49

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.
@@ -9480,7 +9480,7 @@ var init_version = __esm({
9480
9480
  "src/version.ts"() {
9481
9481
  "use strict";
9482
9482
  init_captured_globals();
9483
- KERNEL_VERSION = true ? "1.196.47" : "0.0.0-dev";
9483
+ KERNEL_VERSION = true ? "1.196.49" : "0.0.0-dev";
9484
9484
  OS_RELEASE = "6.0.0-slicc";
9485
9485
  }
9486
9486
  });
@@ -9479,7 +9479,7 @@ var init_version = __esm({
9479
9479
  "src/version.ts"() {
9480
9480
  "use strict";
9481
9481
  init_captured_globals();
9482
- KERNEL_VERSION = true ? "1.196.47" : "0.0.0-dev";
9482
+ KERNEL_VERSION = true ? "1.196.49" : "0.0.0-dev";
9483
9483
  OS_RELEASE = "6.0.0-slicc";
9484
9484
  }
9485
9485
  });
package/dist/node.js CHANGED
@@ -7845,7 +7845,7 @@ function satisfies(version, range2) {
7845
7845
  }
7846
7846
 
7847
7847
  // src/version.ts
7848
- var KERNEL_VERSION = true ? "1.196.47" : "0.0.0-dev";
7848
+ var KERNEL_VERSION = true ? "1.196.49" : "0.0.0-dev";
7849
7849
  var OS_RELEASE = "6.0.0-slicc";
7850
7850
  function procVersion() {
7851
7851
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -34260,6 +34260,7 @@ var PrivateRename = class {
34260
34260
  };
34261
34261
 
34262
34262
  // src/fs/rename-cleanup.ts
34263
+ var MANIFEST_BATCH = 64;
34263
34264
  function cleanupId(handle) {
34264
34265
  return handle.getUniqueId?.();
34265
34266
  }
@@ -34275,9 +34276,8 @@ async function copiedEntry(handle, path, file) {
34275
34276
  function absent(err) {
34276
34277
  return err.name === "NotFoundError";
34277
34278
  }
34278
- async function removeOne(parent, name2, rest2, lookup4, signal) {
34279
+ async function removeOne(parent, name2, entry, children3, signal) {
34279
34280
  signal?.throwIfAborted();
34280
- const entry = await lookup4(rest2);
34281
34281
  if (!entry) return;
34282
34282
  try {
34283
34283
  const handle = entry.kind === "file" ? await parent.getFileHandle(name2) : await parent.getDirectoryHandle(name2);
@@ -34285,10 +34285,7 @@ async function removeOne(parent, name2, rest2, lookup4, signal) {
34285
34285
  if (handle.kind === "file") {
34286
34286
  const file = await handle.getFile();
34287
34287
  if (file.lastModified !== entry.mtime || file.size !== entry.size) return;
34288
- } else {
34289
- for await (const child2 of handle.keys())
34290
- await removeOne(handle, child2, rest2 + "/" + child2, lookup4, signal);
34291
- }
34288
+ } else await children3(handle, entry.path);
34292
34289
  signal?.throwIfAborted();
34293
34290
  await parent.removeEntry(name2);
34294
34291
  } catch (err) {
@@ -34297,18 +34294,52 @@ async function removeOne(parent, name2, rest2, lookup4, signal) {
34297
34294
  }
34298
34295
  function removeCopied(parent, name2, manifest, signal, overflow) {
34299
34296
  const entries = new Map(manifest.map((entry) => [entry.path, entry]));
34300
- return removeOne(parent, name2, "", (path) => entries.get(path) ?? overflow?.(path), signal);
34297
+ async function batch(dir, names2, parentPath) {
34298
+ signal?.throwIfAborted();
34299
+ const paths = names2.map((child2) => parentPath === void 0 ? "" : parentPath + "/" + child2);
34300
+ let extra;
34301
+ if (overflow) {
34302
+ const missing7 = paths.filter((path) => !entries.has(path));
34303
+ if (missing7.length) extra = await overflow(missing7);
34304
+ }
34305
+ for (const [i, path] of paths.entries())
34306
+ await removeOne(
34307
+ dir,
34308
+ names2[i],
34309
+ entries.get(path) ?? extra?.get(path),
34310
+ children3,
34311
+ signal
34312
+ );
34313
+ }
34314
+ async function children3(dir, path) {
34315
+ const names2 = [];
34316
+ for await (const child2 of dir.keys()) {
34317
+ signal?.throwIfAborted();
34318
+ names2.push(child2);
34319
+ if (names2.length === MANIFEST_BATCH) {
34320
+ await batch(dir, names2, path);
34321
+ names2.length = 0;
34322
+ }
34323
+ }
34324
+ if (names2.length) await batch(dir, names2, path);
34325
+ }
34326
+ return batch(parent, [name2]);
34301
34327
  }
34302
34328
 
34303
34329
  // src/fs/rename-manifest.ts
34304
34330
  var INLINE_BYTES = 256 * 1024;
34305
- var BATCH = 64;
34306
34331
  function manifestRoot(intent) {
34307
34332
  return "rename-manifest:" + intent;
34308
34333
  }
34309
- async function storedStamp(meta, intent, path) {
34310
- const [row] = await meta.get([manifestRoot(intent) + path]);
34311
- return row?.copyStamp && { path, ...row.copyStamp };
34334
+ async function storedStamps(meta, intent, paths) {
34335
+ const prefix = manifestRoot(intent);
34336
+ const rows = await meta.get(paths.map((path) => prefix + path));
34337
+ const found = /* @__PURE__ */ new Map();
34338
+ for (const [i, path] of paths.entries()) {
34339
+ const stamp = rows[i]?.copyStamp;
34340
+ if (stamp) found.set(path, { ...stamp, path });
34341
+ }
34342
+ return found;
34312
34343
  }
34313
34344
  var RenameManifest = class {
34314
34345
  meta;
@@ -34333,7 +34364,7 @@ var RenameManifest = class {
34333
34364
  const { path: relative2, ...copyStamp } = entry;
34334
34365
  const path = manifestRoot(this.intent) + relative2;
34335
34366
  this.pending.push({ path, change: () => ({ path, copyStamp }) });
34336
- if (this.pending.length === BATCH) await this.flush();
34367
+ if (this.pending.length === MANIFEST_BATCH) await this.flush();
34337
34368
  }
34338
34369
  async flush() {
34339
34370
  if (!this.pending.length) return;
@@ -36694,8 +36725,12 @@ var OpfsFs = class {
36694
36725
  }
36695
36726
  async removeReserved(intent, from, reservation, rename, signal) {
36696
36727
  if (rename.unverifiedSource) {
36697
- await this.sourceId(from);
36698
- throw fsError("EBUSY", from);
36728
+ const [dir, name2] = await this.parent(from);
36729
+ return this.inDir(dir, async (parent) => {
36730
+ await parent.getDirectoryHandle(name2);
36731
+ signal?.throwIfAborted();
36732
+ await parent.removeEntry(name2);
36733
+ });
36699
36734
  }
36700
36735
  const commit = reservation.copyCommit?.intent === intent ? reservation.copyCommit : void 0;
36701
36736
  const entries = commit?.entries ?? rename.copiedEntries;
@@ -36709,7 +36744,7 @@ var OpfsFs = class {
36709
36744
  name2,
36710
36745
  entries,
36711
36746
  signal,
36712
- commit?.indexed ? (path) => storedStamp(this.meta, intent, path) : void 0
36747
+ commit?.indexed ? (paths) => storedStamps(this.meta, intent, paths) : void 0
36713
36748
  ) : parent.removeEntry(name2);
36714
36749
  });
36715
36750
  }