@ai-ecoverse/slicc-kernel 1.73.1 → 1.73.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.
@@ -5150,6 +5150,9 @@ var init_cpu_clock = __esm({
5150
5150
  });
5151
5151
 
5152
5152
  // src/realm/sync-sab-bridge.ts
5153
+ function syncCallCount() {
5154
+ return calls;
5155
+ }
5153
5156
  function createSyncSabTransport(sab, port3, deps = {}) {
5154
5157
  const views = sabViews(sab);
5155
5158
  const { header, window } = views;
@@ -5171,6 +5174,7 @@ function createSyncSabTransport(sab, port3, deps = {}) {
5171
5174
  call(req, timeoutMs, label, transfer = []) {
5172
5175
  if (deps.memory) publishMemory(sab, deps.memory());
5173
5176
  const id = ++seq;
5177
+ calls += Number(!PATH_OPS.has(req.op));
5174
5178
  const deadline = now() + timeoutMs;
5175
5179
  let out = null;
5176
5180
  let status2 = 0;
@@ -5354,12 +5358,15 @@ function createSyncFsSabBridge(transport, opts = {}) {
5354
5358
  statfs: (path = "/") => parseSyncFsUsage(json2({ op: "statfs", path }, path))
5355
5359
  };
5356
5360
  }
5361
+ var PATH_OPS, calls;
5357
5362
  var init_sync_sab_bridge = __esm({
5358
5363
  "src/realm/sync-sab-bridge.ts"() {
5359
5364
  "use strict";
5360
5365
  init_cpu_clock();
5361
5366
  init_sync_fs_wire();
5362
5367
  init_sync_sab_wire();
5368
+ PATH_OPS = new Set(SYNC_FS_OPS);
5369
+ calls = 0;
5363
5370
  }
5364
5371
  });
5365
5372
 
@@ -6508,6 +6515,9 @@ function refusal(err) {
6508
6515
  const code2 = err?.code;
6509
6516
  return code2 === "EACCES" || code2 === "EPERM";
6510
6517
  }
6518
+ function cachedStat(s, dir) {
6519
+ return s.stat !== void 0 && (!dir || s.statAt === syncCallCount());
6520
+ }
6511
6521
  function linkedStates(bridgeOf) {
6512
6522
  const opens = /* @__PURE__ */ new Map();
6513
6523
  const byId = /* @__PURE__ */ new Map();
@@ -6590,7 +6600,8 @@ function createHelpers(Fs, ops) {
6590
6600
  }
6591
6601
  }
6592
6602
  function freshState(stat) {
6593
- return { ...stat ? { stat } : {}, len: 0, loaded: false, dirty: false, openCount: 0 };
6603
+ const statAt = syncCallCount();
6604
+ return { ...stat ? { stat, statAt } : {}, len: 0, loaded: false, dirty: false, openCount: 0 };
6594
6605
  }
6595
6606
  function makeNode(parent, name2, st) {
6596
6607
  const node = Fs.createNode(parent, name2, modeFromStat(st), 0);
@@ -6604,9 +6615,9 @@ function createHelpers(Fs, ops) {
6604
6615
  const size = node.live.ranged?.size() ?? node.live.len;
6605
6616
  return { ...node.live.stat, size };
6606
6617
  }
6607
- if (!node.live.stat) {
6618
+ if (!cachedStat(node.live, Fs.isDir(node.mode))) {
6608
6619
  const st = call2(() => bridgeOf(node).lstat(liveNodePath(linked.holder(node))));
6609
- node.live.stat = st;
6620
+ Object.assign(node.live, { stat: st, statAt: syncCallCount() });
6610
6621
  node.mode = modeFromStat(st);
6611
6622
  }
6612
6623
  return node.live.stat;
@@ -6755,8 +6766,9 @@ function createNodeOps(h) {
6755
6766
  flushNode(node);
6756
6767
  metadataCall(() => bridgeOf(node).utimes(path, atime, mtime, now));
6757
6768
  };
6769
+ const stamped = typeof Fs.doSetAttr !== "function";
6758
6770
  const timesOf = (node, attr2) => {
6759
- const mtime = toMs(attr2.mtime) ?? attr2.timestamp;
6771
+ const mtime = toMs(attr2.mtime) ?? (stamped ? attr2.timestamp : void 0);
6760
6772
  const atime = toMs(attr2.atime);
6761
6773
  if (mtime !== void 0 && attr2.atime !== null) return [atime ?? mtime, mtime];
6762
6774
  if (atime === void 0 && mtime === void 0) return void 0;
@@ -6765,8 +6777,10 @@ function createNodeOps(h) {
6765
6777
  };
6766
6778
  return {
6767
6779
  getattr(node) {
6768
- const st = statOf(node);
6769
6780
  const owned = bridgeOf(node).owners === true;
6781
+ if (owned && Fs.isLink(node.mode) && statOf(node).uid === void 0)
6782
+ node.live.stat = void 0;
6783
+ const st = statOf(node);
6770
6784
  const s = node.live;
6771
6785
  const size = Fs.isDir(node.mode) ? 4096 : s.ranged?.size() ?? (s.loaded ? s.len : st.size);
6772
6786
  const mtime = new Date(st.mtimeMs ?? 0);
@@ -7293,6 +7307,7 @@ var init_live_vfs_fs = __esm({
7293
7307
  init_types();
7294
7308
  init_wasi_errno();
7295
7309
  init_sync_fs_wire();
7310
+ init_sync_sab_bridge();
7296
7311
  S_IFDIR = 16384;
7297
7312
  S_IFREG = 32768;
7298
7313
  S_IFLNK = 40960;
@@ -8771,6 +8786,11 @@ function number(r) {
8771
8786
  if (!r.ok) return -wasiErrno(r.errno);
8772
8787
  return r.kind === "json" && typeof r.json === "number" ? r.json : -wasiErrno("EIO");
8773
8788
  }
8789
+ function throughKernel(sig) {
8790
+ if (sig === 0) return false;
8791
+ const action = defaultAction(sig);
8792
+ return action === "terminate" || action === "stop";
8793
+ }
8774
8794
  function restarted2(issue) {
8775
8795
  for (; ; ) {
8776
8796
  const r = issue();
@@ -8983,7 +9003,7 @@ function createProcessKernel(deps) {
8983
9003
  return status(call2({ op: "umount", target: at(target), flags }, `umount ${target}`));
8984
9004
  },
8985
9005
  kill(pid, sig) {
8986
- if (pid === deps.pid) {
9006
+ if (pid === deps.pid && !throughKernel(sig)) {
8987
9007
  if (sig !== 0) deps.raise?.(sig);
8988
9008
  return 0;
8989
9009
  }
@@ -9027,6 +9047,7 @@ var S_IFMT2, S_IFDIR2, POLLIN2, POLLOUT2, POLLERR2, POLLHUP2, POLLNVAL, SELECT_S
9027
9047
  var init_process_children = __esm({
9028
9048
  "src/process/process-children.ts"() {
9029
9049
  "use strict";
9050
+ init_signals();
9030
9051
  init_process_fork();
9031
9052
  init_wasi_errno();
9032
9053
  S_IFMT2 = 61440;