@ai-ecoverse/slicc-kernel 1.75.1 → 1.76.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.
package/dist/node.js CHANGED
@@ -5312,7 +5312,8 @@ function commandOf(pkg, name2, raw, packageAbi, shared) {
5312
5312
  return { name: name2, abi: packageAbi, glue: script, wasm: script, argv0: name2, script, ...withEnv };
5313
5313
  }
5314
5314
  const abi = abiOf(raw.abi, packageAbi);
5315
- const argv0 = typeof raw.argv0 === "string" && raw.argv0 ? raw.argv0 : name2;
5315
+ const fixed = typeof raw.argv0 === "string" && raw.argv0 !== "";
5316
+ const argv0 = fixed ? raw.argv0 : name2;
5316
5317
  const args = argsOf(pkg, raw.args);
5317
5318
  if (abi === "js") {
5318
5319
  const module = inside(pkg, raw.module);
@@ -5323,6 +5324,7 @@ function commandOf(pkg, name2, raw, packageAbi, shared) {
5323
5324
  glue: module,
5324
5325
  wasm: module,
5325
5326
  argv0,
5327
+ ...fixed ? { argv0Fixed: true } : {},
5326
5328
  ...raw.argv0Path === true ? { argv0Path: true } : {},
5327
5329
  ...args ? { args } : {},
5328
5330
  ...withEnv
@@ -5338,6 +5340,7 @@ function commandOf(pkg, name2, raw, packageAbi, shared) {
5338
5340
  glue,
5339
5341
  wasm,
5340
5342
  argv0,
5343
+ ...fixed ? { argv0Fixed: true } : {},
5341
5344
  ...raw.argv0Path === true ? { argv0Path: true } : {},
5342
5345
  ...abi === "wasi" && raw.preopenRoot === true ? { preopenRoot: true } : {},
5343
5346
  ...args ? { args } : {},
@@ -11163,6 +11166,7 @@ async function runChild(req, deps) {
11163
11166
  {
11164
11167
  file: req.file,
11165
11168
  argv: req.argv,
11169
+ ...req.argv0 !== void 0 ? { argv0: req.argv0 } : {},
11166
11170
  env: req.env,
11167
11171
  cwd: req.cwd,
11168
11172
  ...req.pgid !== void 0 ? { pgid: req.pgid } : {},
@@ -12121,9 +12125,10 @@ var WasmProcess = class {
12121
12125
  return "deliver";
12122
12126
  }
12123
12127
  async spawn(req) {
12124
- const { file, argv, env, cwd, stdio, inherit: inherit2, exec, pgid, session } = req;
12128
+ const { file, argv, argv0, env, cwd, stdio, inherit: inherit2, exec, pgid, session } = req;
12125
12129
  const group = { ...pgid !== void 0 ? { pgid } : {}, ...session ? { session } : {} };
12126
- const spawned = { file, argv, env, cwd, ...group, ...exec ? { exec } : {} };
12130
+ const named = argv0 !== void 0 ? { argv0 } : {};
12131
+ const spawned = { file, argv, ...named, env, cwd, ...group, ...exec ? { exec } : {} };
12127
12132
  const pid = await this.children.spawn(spawned, stdio, inherit2);
12128
12133
  if (!exec) return pid;
12129
12134
  if (this.killed) void Promise.allSettled([this.options.kill?.(pid, SIG.KILL)]);
@@ -16054,6 +16059,7 @@ function targetOf(command) {
16054
16059
  glue: command.glue,
16055
16060
  wasm: command.wasm,
16056
16061
  argv0: command.argv0,
16062
+ ...command.argv0Fixed ? { fixed: true } : {},
16057
16063
  ...command.args ? { prefix: command.args } : {},
16058
16064
  ...command.env ? { env: command.env } : {},
16059
16065
  ...command.unset ? { unset: command.unset } : {},
@@ -16416,8 +16422,10 @@ var Launcher = class {
16416
16422
  const target = withScriptEnv(found, command);
16417
16423
  return { target, args: [...target.prefix ?? [], ...passed], via: [interp] };
16418
16424
  }
16419
- async plan(file, argv, cwd, scope) {
16420
- const direct = await this.resolve(file, argv[0] ?? file, cwd, scope);
16425
+ async plan(file, argv, cwd, scope, argv0) {
16426
+ const found = await this.resolve(file, argv[0] ?? file, cwd, scope);
16427
+ const named = typeof argv0 === "string" && found && !found.fixed;
16428
+ const direct = named ? { ...found, argv0 } : found;
16421
16429
  if (direct) return { target: direct, args: [...direct.prefix ?? [], ...argv.slice(1)] };
16422
16430
  const script = await this.interpreted(file, argv, cwd, scope);
16423
16431
  return script && { ...script, script: true };
@@ -16806,7 +16814,7 @@ var Launcher = class {
16806
16814
  }
16807
16815
  const cred = grant ? grant.cred : this.credOf(ppid);
16808
16816
  const scope = grant ? "" : await this.scopeOf(cred.euid);
16809
- const planned = await this.plan(req.file, req.argv, req.cwd, scope);
16817
+ const planned = await this.plan(req.file, req.argv, req.cwd, scope, req.argv0);
16810
16818
  try {
16811
16819
  await this.mayExec(cred, { ...req, pid: ppid }, planned);
16812
16820
  } catch (err) {