@ai-ecoverse/slicc-kernel 1.167.2 → 1.167.3

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.
@@ -7511,7 +7511,7 @@ var init_version = __esm({
7511
7511
  "src/version.ts"() {
7512
7512
  "use strict";
7513
7513
  init_captured_globals();
7514
- KERNEL_VERSION = true ? "1.167.2" : "0.0.0-dev";
7514
+ KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
7515
7515
  OS_RELEASE = "6.0.0-slicc";
7516
7516
  }
7517
7517
  });
@@ -7510,7 +7510,7 @@ var init_version = __esm({
7510
7510
  "src/version.ts"() {
7511
7511
  "use strict";
7512
7512
  init_captured_globals();
7513
- KERNEL_VERSION = true ? "1.167.2" : "0.0.0-dev";
7513
+ KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
7514
7514
  OS_RELEASE = "6.0.0-slicc";
7515
7515
  }
7516
7516
  });
package/dist/node.js CHANGED
@@ -3684,7 +3684,7 @@ function satisfies(version, range2) {
3684
3684
  }
3685
3685
 
3686
3686
  // src/version.ts
3687
- var KERNEL_VERSION = true ? "1.167.2" : "0.0.0-dev";
3687
+ var KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
3688
3688
  var OS_RELEASE = "6.0.0-slicc";
3689
3689
  function procVersion() {
3690
3690
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -32862,7 +32862,7 @@ var Launcher = class {
32862
32862
  kept: async (tab, items, paths) => {
32863
32863
  for (const { path, hidden, fid } of items) {
32864
32864
  if (hidden !== void 0 && sharedKept(hidden)) await this.adoptShared(path, hidden, fid);
32865
- else this.adoptKept(path, hidden, fid, ours);
32865
+ else await this.adoptKept(path, hidden, fid, ours);
32866
32866
  }
32867
32867
  await open(tab, paths);
32868
32868
  },
@@ -32872,14 +32872,33 @@ var Launcher = class {
32872
32872
  }
32873
32873
  };
32874
32874
  }
32875
- async adoptShared(path, hidden, fid) {
32876
- const bound3 = [...this.held].map(
32877
- (holds2) => [holds2, [...holds2.boundAt(path, fid), ...holds2.boundAt(hidden, fid)]]
32878
- );
32879
- const keeping = bound3.filter(([, ids]) => ids.length > 0);
32875
+ async keptIds(hidden, fid) {
32876
+ if (fid !== void 0) return [fid];
32877
+ const st = await this.rootFs.lstat(hidden).catch(() => void 0);
32878
+ return st?.fid === void 0 ? [void 0] : [void 0, st.fid];
32879
+ }
32880
+ boundTo(path, hidden, fids) {
32881
+ const keeping = [...this.held].map(
32882
+ (holds2) => [
32883
+ holds2,
32884
+ fids.flatMap((fid) => [...holds2.boundAt(path, fid), ...holds2.boundAt(hidden, fid)])
32885
+ ]
32886
+ ).filter(([, ids]) => ids.length > 0);
32880
32887
  const nodes = [...this.openFiles].filter(
32881
32888
  (open) => [path, hidden].some((at) => open.holdsAt(at))
32882
32889
  );
32890
+ const keep2 = (file) => {
32891
+ const kept = nodes.filter(
32892
+ (open) => fids.some((fid) => open.keepBound([hidden, path], fid, file))
32893
+ ).length;
32894
+ for (let i = kept; i < nodes.length; i++) file.release();
32895
+ for (const [holds2, ids] of keeping) holds2.keepBound(ids, path, file);
32896
+ void this.rootFs.announceHolds?.([], [path, hidden], false);
32897
+ };
32898
+ return { keeping, nodes, keep: keep2 };
32899
+ }
32900
+ async adoptShared(path, hidden, fid) {
32901
+ const { keeping, nodes, keep: keep2 } = this.boundTo(path, hidden, await this.keptIds(hidden, fid));
32883
32902
  const refs = keeping.length + nodes.length;
32884
32903
  if (refs === 0) {
32885
32904
  this.held.doubt([path]);
@@ -32894,29 +32913,17 @@ var Launcher = class {
32894
32913
  this.held.doubt([path]);
32895
32914
  return;
32896
32915
  }
32897
- const kept = nodes.filter((open) => open.keepBound([hidden, path], fid, file)).length;
32898
- for (let i = kept; i < nodes.length; i++) file.release();
32899
- for (const [holds2, ids] of keeping) holds2.keepBound(ids, path, file);
32900
- void this.rootFs.announceHolds?.([], [path, hidden], false);
32916
+ keep2(file);
32901
32917
  }
32902
- adoptKept(path, hidden, fid, ours) {
32918
+ async adoptKept(path, hidden, fid, ours) {
32903
32919
  if (hidden === void 0 || !ours(hidden)) {
32904
32920
  this.held.doubt([path]);
32905
32921
  return;
32906
32922
  }
32907
- const bound3 = [...this.held].map(
32908
- (holds2) => [holds2, [...holds2.boundAt(path, fid), ...holds2.boundAt(hidden, fid)]]
32909
- );
32910
- const keeping = bound3.filter(([, ids]) => ids.length > 0);
32911
- const nodes = [...this.openFiles].filter(
32912
- (open) => [path, hidden].some((at) => open.holdsAt(at))
32913
- );
32923
+ const { keeping, nodes, keep: keep2 } = this.boundTo(path, hidden, await this.keptIds(hidden, fid));
32914
32924
  const file = this.unlinked.adopt(hidden, Math.max(keeping.length + nodes.length, 1));
32915
- const kept = nodes.filter((open) => open.keepBound([hidden, path], fid, file)).length;
32916
- for (let i = kept; i < nodes.length; i++) file.release();
32917
32925
  if (keeping.length === 0 && nodes.length === 0) file.release();
32918
- for (const [holds2, ids] of keeping) holds2.keepBound(ids, path, file);
32919
- void this.rootFs.announceHolds?.([], [path, hidden], false);
32926
+ keep2(file);
32920
32927
  }
32921
32928
  openNodes(fs, entries) {
32922
32929
  const nodes = new VfsNodes(fs, (path) => this.released(path), entries);
@@ -32953,6 +32960,7 @@ var Launcher = class {
32953
32960
  this.changes.flush();
32954
32961
  this.changes.foreign(crowded);
32955
32962
  if (crowded) {
32963
+ void this.announceHeld();
32956
32964
  void this.held.bindIds((path) => this.rootFileId(path)).then(
32957
32965
  () => Promise.all([...this.openFiles].map((open) => open.bindIds((p) => this.rootFileId(p))))
32958
32966
  ).then(() => this.announceHeld());