@ai-ecoverse/slicc-kernel 1.196.39 → 1.196.40

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.
@@ -5303,7 +5303,7 @@ function satisfies(version, range2) {
5303
5303
  }
5304
5304
 
5305
5305
  // src/version.ts
5306
- var KERNEL_VERSION = true ? "1.196.39" : "0.0.0-dev";
5306
+ var KERNEL_VERSION = true ? "1.196.40" : "0.0.0-dev";
5307
5307
  var OS_RELEASE = "6.0.0-slicc";
5308
5308
  function procVersion() {
5309
5309
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -33961,6 +33961,9 @@ var SOURCE_RETRY_MS = 250;
33961
33961
  var SOURCE_BACKOFF_MS = 1e3;
33962
33962
  var Copies = class extends Map {
33963
33963
  remaining = [];
33964
+ marker(intent, to) {
33965
+ return intent && this.remaining.length ? { intent, to, entries: this.remaining } : void 0;
33966
+ }
33964
33967
  };
33965
33968
  function needsCopy(handle, swap) {
33966
33969
  return swap || handle.kind === "directory" && !movable(handle);
@@ -34021,14 +34024,19 @@ function sidecar(meta) {
34021
34024
  }
34022
34025
  function occupied(entry) {
34023
34026
  if (!entry?.vacated) return entry ?? {};
34024
- const { vacated: _, ...kept } = entry;
34027
+ const { vacated: _, copyCommit: _copy, ...kept } = entry;
34025
34028
  return kept;
34026
34029
  }
34027
34030
  function directoryTime(path, entry, ms) {
34028
34031
  return (entry?.timesAt ?? -1) >= ms ? entry : { ...entry, path, mtimeMs: ms, mtimeFor: 0, ctimeMs: ms, timesAt: ms };
34029
34032
  }
34030
- function vacatedAt(path) {
34031
- return { path, ino: inodeOf(`${path}\0${crypto.randomUUID()}`), vacated: true };
34033
+ function vacatedAt(path, copyCommit) {
34034
+ return {
34035
+ path,
34036
+ ino: inodeOf(`${path}\0${crypto.randomUUID()}`),
34037
+ vacated: true,
34038
+ ...copyCommit && { copyCommit }
34039
+ };
34032
34040
  }
34033
34041
  function missing5(err) {
34034
34042
  const code = err?.code;
@@ -35737,6 +35745,7 @@ var OpfsFs = class {
35737
35745
  });
35738
35746
  if (swap) await PLAIN3.rm.call(this, destination);
35739
35747
  if (second) await this.intend({ from: staged2, to: destination, root, ...owned4 }, second);
35748
+ left.copyCommit = copies.marker(first, destination);
35740
35749
  await this.meta.move(source.path, destination, carry, left);
35741
35750
  this.movePending(source.path, destination);
35742
35751
  if (!moved3 && first)
@@ -35747,7 +35756,7 @@ var OpfsFs = class {
35747
35756
  copies.remaining = [];
35748
35757
  const placed = await this.place(hidden, dir, name2, copies, copying);
35749
35758
  if (!placed && second) {
35750
- const mark = vacatedAt(staged2);
35759
+ const mark = vacatedAt(staged2, copies.marker(second, destination));
35751
35760
  await this.meta.update(staged2, () => mark);
35752
35761
  await this.releaseSource(second, staged2, destination, mark.ino, lock, copies.remaining);
35753
35762
  } else if (second) await this.meta.update(second, () => void 0);
@@ -36187,7 +36196,7 @@ var OpfsFs = class {
36187
36196
  const entries = await this.meta.get([from, to]);
36188
36197
  let mark = entries[0];
36189
36198
  if (!mark?.vacated || entries[1]?.ino !== ino) {
36190
- mark = vacatedAt(from);
36199
+ mark = vacatedAt(from, copies.marker(intent, to));
36191
36200
  await this.meta.move(
36192
36201
  from,
36193
36202
  to,
@@ -36413,12 +36422,14 @@ var OpfsFs = class {
36413
36422
  }
36414
36423
  async resumeCopiedTree(intent, rename) {
36415
36424
  const { from, to, root } = rename;
36416
- const left = await this.real(from);
36417
- if (left && root) {
36418
- const [mark, placed] = await this.meta.get([from, to]);
36419
- if (mark?.vacated && mark.ino !== void 0 && placed?.ino === root.ino)
36420
- return this.releaseSource(intent, from, to, mark.ino, rename.lock);
36425
+ const [mark, placed] = await this.meta.get([from, to]);
36426
+ if (mark?.vacated && mark.ino !== void 0 && mark.copyCommit?.intent === intent) {
36427
+ const commit = mark.copyCommit;
36428
+ return this.releaseSource(intent, from, commit.to, mark.ino, rename.lock, commit.entries);
36421
36429
  }
36430
+ const left = await this.real(from);
36431
+ if (left && root && mark?.vacated && mark.ino !== void 0 && placed?.ino === root.ino)
36432
+ return this.releaseSource(intent, from, to, mark.ino, rename.lock);
36422
36433
  if (rename.privateCopy) {
36423
36434
  if (left) {
36424
36435
  const src = await this.locate(from, false);
@@ -36454,7 +36465,7 @@ var OpfsFs = class {
36454
36465
  this.forget(from);
36455
36466
  this.forget(to);
36456
36467
  }
36457
- const mark = left ? vacatedAt(from) : void 0;
36468
+ const mark = left ? vacatedAt(from, copies.marker(intent, to)) : void 0;
36458
36469
  if ((await this.meta.under(from)).some((entry) => !entry.vacated)) {
36459
36470
  await this.meta.move(
36460
36471
  from,