@ai-ecoverse/slicc-kernel 1.147.10 → 1.148.0

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.
@@ -1564,6 +1564,19 @@ var OpfsFs = class {
1564
1564
  for (const path of paths) this.forget(path);
1565
1565
  this.channel?.postMessage(paths);
1566
1566
  }
1567
+ async fileId(path) {
1568
+ const found = await this.locate(path, true);
1569
+ const [entry] = await this.meta.get([found.path]);
1570
+ if (entry?.fid !== void 0) return entry.fid;
1571
+ const fid = crypto.randomUUID();
1572
+ await this.meta.update(found.path, (now) => ({
1573
+ ...occupied(now),
1574
+ path: found.path,
1575
+ fid: now?.fid ?? fid
1576
+ }));
1577
+ const [stored] = await this.meta.get([found.path]);
1578
+ return stored?.fid ?? fid;
1579
+ }
1567
1580
  heldUnder = () => [];
1568
1581
  heldBy(held) {
1569
1582
  this.heldUnder = held;
@@ -2161,6 +2174,7 @@ var OpfsFs = class {
2161
2174
  atime: new Date(meta?.atimeMs ?? mtime),
2162
2175
  ctime: new Date(Math.max(touched ?? meta?.ctimeMs ?? mtime, modified)),
2163
2176
  ino: meta?.ino ?? inodeOf(path),
2177
+ ...meta?.fid !== void 0 ? { fid: meta.fid } : {},
2164
2178
  ...this.ranged && !directory ? { ranged: true } : {}
2165
2179
  };
2166
2180
  }
@@ -7826,7 +7840,7 @@ function satisfies(version, range2) {
7826
7840
  }
7827
7841
 
7828
7842
  // src/version.ts
7829
- var KERNEL_VERSION = true ? "1.147.10" : "0.0.0-dev";
7843
+ var KERNEL_VERSION = true ? "1.148.0" : "0.0.0-dev";
7830
7844
  var OS_RELEASE = "6.0.0-slicc";
7831
7845
  function procVersion() {
7832
7846
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -13429,6 +13443,7 @@ function statJson(s) {
13429
13443
  atimeMs: s.atime.getTime(),
13430
13444
  ctimeMs: s.ctime.getTime(),
13431
13445
  ino: s.ino,
13446
+ ...s.fid !== void 0 ? { fid: s.fid } : {},
13432
13447
  ...s.nlink !== void 0 ? { nlink: s.nlink } : {},
13433
13448
  ...s.dev !== void 0 ? { dev: s.dev } : {},
13434
13449
  ...s.readonly ? { readonly: true } : {},
@@ -30161,7 +30176,9 @@ var Launcher = class {
30161
30176
  ];
30162
30177
  if (after.exeId === void 0) return gone;
30163
30178
  return this.reread(target, read).then(
30164
- (again) => id2().then((last) => [again, last]),
30179
+ (again) => id2().then(
30180
+ (last) => [again, last.exeId === after.exeId ? last : gone[1]]
30181
+ ),
30165
30182
  () => gone
30166
30183
  );
30167
30184
  }
@@ -30179,8 +30196,13 @@ var Launcher = class {
30179
30196
  if (target.abi !== "wasi" || (target.copy ?? target.glue) !== target.wasm) {
30180
30197
  return Promise.resolve({});
30181
30198
  }
30199
+ const assign = this.mounts.locate(target.wasm) === void 0 ? this.rootFs.fileId : void 0;
30182
30200
  return this.base.stat(target.wasm).then(
30183
- (st) => exeIdOf(fileIdentity(st.ino, st.mtime.getTime())),
30201
+ async (st) => {
30202
+ const fid = st.fid ?? await assign?.call(this.rootFs, target.wasm);
30203
+ if (fid === void 0) return exeIdOf(fileIdentity(st.ino, st.mtime.getTime()));
30204
+ return { exeId: `fid:${fid}:${st.mtime.getTime()}` };
30205
+ },
30184
30206
  () => ({})
30185
30207
  );
30186
30208
  }