@ai-ecoverse/slicc-kernel 1.141.1 → 1.141.2

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.
package/dist/node.js CHANGED
@@ -7514,7 +7514,7 @@ function satisfies(version, range2) {
7514
7514
  }
7515
7515
 
7516
7516
  // src/version.ts
7517
- var KERNEL_VERSION = true ? "1.141.1" : "0.0.0-dev";
7517
+ var KERNEL_VERSION = true ? "1.141.2" : "0.0.0-dev";
7518
7518
  var OS_RELEASE = "6.0.0-slicc";
7519
7519
  function procVersion() {
7520
7520
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -13609,6 +13609,10 @@ function mayTrace(viewer, target) {
13609
13609
  const uid = of.ruid === by.euid && of.euid === by.euid && of.suid === by.euid;
13610
13610
  return uid && of.rgid === by.egid && of.egid === by.egid && of.sgid === by.egid;
13611
13611
  }
13612
+ function fileIdentity(ino, mtimeMs) {
13613
+ if (ino === void 0 || mtimeMs === void 0 || !Number.isFinite(mtimeMs)) return void 0;
13614
+ return `${ino}:${Math.trunc(mtimeMs)}`;
13615
+ }
13612
13616
 
13613
13617
  // src/fs/pages.ts
13614
13618
  var PAGE = 64 * 1024;
@@ -14169,12 +14173,7 @@ var ProcTree = class {
14169
14173
  const exe = () => this.info(Number(top))?.exe === void 0 ? [] : ["exe"];
14170
14174
  return { kind: "dir", names: () => [...PID_NAMES, ...exe(), "task"] };
14171
14175
  }
14172
- if (leaf === "exe") {
14173
- const info = this.info(Number(top));
14174
- if (info?.exe === void 0) return void 0;
14175
- const denied2 = !mayTrace(this.ownInfo(), info);
14176
- return { kind: "link", target: info.exe, ...denied2 ? { denied: denied2 } : {} };
14177
- }
14176
+ if (leaf === "exe") return this.exe(Number(top));
14178
14177
  if (!PID_NAMES.includes(leaf)) return void 0;
14179
14178
  return {
14180
14179
  kind: "file",
@@ -14186,6 +14185,13 @@ var ProcTree = class {
14186
14185
  }
14187
14186
  };
14188
14187
  }
14188
+ exe(pid) {
14189
+ const info = this.info(pid);
14190
+ if (info?.exe === void 0) return void 0;
14191
+ const denied2 = !mayTrace(this.ownInfo(), info);
14192
+ const id2 = info.exeId === void 0 ? {} : { id: info.exeId };
14193
+ return { kind: "link", target: info.exe, ...denied2 ? { denied: denied2 } : {}, ...id2 };
14194
+ }
14189
14195
  ownInfo() {
14190
14196
  const processes2 = this.listing().processes;
14191
14197
  return processes2.find((p) => p.tid === this.pid) ?? processes2.find((p) => p.pid === this.pid);
@@ -14251,10 +14257,18 @@ var ProcTree = class {
14251
14257
  return node.names();
14252
14258
  }
14253
14259
  escape(path) {
14260
+ return this.escapeTo(path)?.target;
14261
+ }
14262
+ escapeTo(path) {
14254
14263
  const node = this.node(this.parts(path, true));
14255
14264
  if (node?.kind !== "link" || !node.target.startsWith("/")) return void 0;
14256
14265
  if (node.denied) throw syncError("EACCES", path);
14257
- return node.target;
14266
+ return node.id === void 0 ? { target: node.target } : { target: node.target, id: node.id };
14267
+ }
14268
+ linkTo(path) {
14269
+ const node = this.node(this.parts(path, false));
14270
+ if (node?.kind !== "link" || node.id === void 0 || node.denied) return void 0;
14271
+ return { target: node.target, id: node.id };
14258
14272
  }
14259
14273
  readlink(path) {
14260
14274
  const node = this.find(path, false);
@@ -27844,8 +27858,14 @@ function dataModuleUrl(source) {
27844
27858
  return { url: `data:text/javascript;base64,${btoa(binary2)}`, revoke: () => {
27845
27859
  } };
27846
27860
  }
27861
+ function exeIdOf(exeId) {
27862
+ return exeId === void 0 ? {} : { exeId };
27863
+ }
27847
27864
  function describe(req, tty) {
27848
- const exe = req.exe === void 0 ? {} : { exe: req.exe };
27865
+ const exe = {
27866
+ ...req.exe === void 0 ? {} : { exe: req.exe },
27867
+ ...req.exeId === void 0 ? {} : { exeId: req.exeId }
27868
+ };
27849
27869
  return { argv: [req.argv0, ...req.args], tty, started: Date.now(), ...exe };
27850
27870
  }
27851
27871
  function linksOf2(req) {
@@ -28991,6 +29011,15 @@ var Launcher = class {
28991
29011
  const optional = `${root}-names${beside.slice(root.length)}`;
28992
29012
  return await this.base.exists(optional) ? optional : void 0;
28993
29013
  }
29014
+ exeId(target) {
29015
+ if (target.abi !== "wasi" || (target.copy ?? target.glue) !== target.wasm) {
29016
+ return Promise.resolve({});
29017
+ }
29018
+ return this.base.stat(target.wasm).then(
29019
+ (st) => exeIdOf(fileIdentity(st.ino, st.mtime.getTime())),
29020
+ () => ({})
29021
+ );
29022
+ }
28994
29023
  async program(target, env, caller) {
28995
29024
  if (target.abi === "js" && target.wasm === SUDO_PATH) {
28996
29025
  return { abi: "js", glue: SUDO_SOURCE, path: SUDO_PATH };
@@ -29038,11 +29067,12 @@ var Launcher = class {
29038
29067
  const planned = chosen(asked, env);
29039
29068
  const { target, args } = planned;
29040
29069
  let program;
29070
+ let exeId;
29041
29071
  await this.pnpmReady();
29042
29072
  try {
29043
29073
  const caller = { pid: req.ppid ?? 0, uid: req.cred.euid, tag: req.tag };
29044
29074
  if (this.integrity) await this.checkedSources(planned, caller);
29045
- program = await this.program(target, env, caller);
29075
+ [program, exeId] = await Promise.all([this.program(target, env, caller), this.exeId(target)]);
29046
29076
  } catch (err) {
29047
29077
  await req.fds.closeAll();
29048
29078
  throw err;
@@ -29061,6 +29091,7 @@ var Launcher = class {
29061
29091
  program,
29062
29092
  argv0: target.argv0,
29063
29093
  exe: target.copy ?? target.glue,
29094
+ ...exeId,
29064
29095
  args,
29065
29096
  env,
29066
29097
  cwdSlot