@ai-ecoverse/slicc-kernel 1.194.7 → 1.194.9

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.
@@ -5109,7 +5109,7 @@ function satisfies(version, range2) {
5109
5109
  }
5110
5110
 
5111
5111
  // src/version.ts
5112
- var KERNEL_VERSION = true ? "1.194.7" : "0.0.0-dev";
5112
+ var KERNEL_VERSION = true ? "1.194.9" : "0.0.0-dev";
5113
5113
  var OS_RELEASE = "6.0.0-slicc";
5114
5114
  function procVersion() {
5115
5115
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -36495,8 +36495,7 @@ var Launcher = class {
36495
36495
  const command = await this.commandAt(at, scope);
36496
36496
  return command?.script ? command : void 0;
36497
36497
  }
36498
- async interpreted(file, argv, cwd, scope, depth = 0) {
36499
- const command = await this.scriptCommand(file, cwd, scope);
36498
+ async interpreted(file, argv, cwd, scope, command, depth = 0) {
36500
36499
  const script = command?.script ?? this.fs.resolvePath(cwd, file);
36501
36500
  const byPath = command && file.includes("/") && !COMMAND2.test(file);
36502
36501
  const named = byPath ? { [script]: this.fs.resolvePath(cwd, file) } : {};
@@ -36510,10 +36509,16 @@ var Launcher = class {
36510
36509
  if (!interp) return void 0;
36511
36510
  const found = await this.resolve(interp, interp, cwd, scope);
36512
36511
  if (!found) {
36513
- if (depth >= MAX_INTERPRETERS || !await this.scriptCommand(interp, cwd, scope)) {
36514
- return void 0;
36515
- }
36516
- const inner = await this.interpreted(interp, [interp, ...passed], cwd, scope, depth + 1);
36512
+ const next3 = depth < MAX_INTERPRETERS ? await this.scriptCommand(interp, cwd, scope) : void 0;
36513
+ if (!next3) return void 0;
36514
+ const inner = await this.interpreted(
36515
+ interp,
36516
+ [interp, ...passed],
36517
+ cwd,
36518
+ scope,
36519
+ next3,
36520
+ depth + 1
36521
+ );
36517
36522
  const via = [interp, ...inner?.via ?? []];
36518
36523
  const sources = [script, ...inner?.sources ?? []];
36519
36524
  const bins = [...command?.bin ? [script] : [], ...inner?.bins ?? []];
@@ -36546,13 +36551,16 @@ var Launcher = class {
36546
36551
  throw fsError("EACCES", "lease CLI path mismatch");
36547
36552
  if (direct) {
36548
36553
  const shim = direct.shim ? { sources: [direct.shim], asked: direct.asked ? { [direct.shim]: direct.asked } : {} } : {};
36549
- return { target: direct, args: [...direct.prefix ?? [], ...argv.slice(1)], ...shim };
36554
+ const args = [...direct.prefix ?? [], ...argv.slice(1)];
36555
+ return { planned: { target: direct, args, ...shim } };
36550
36556
  }
36551
- if (catalogOnly && !await this.scriptCommand(file, cwd, scope)) return void 0;
36552
- const script = await this.interpreted(file, argv, cwd, scope);
36553
- return script && { ...script, script: true };
36557
+ const command = await this.scriptCommand(file, cwd, scope);
36558
+ if (catalogOnly && !command) return {};
36559
+ const examined = command || file === "" ? {} : { examined: this.fs.resolvePath(cwd, file) };
36560
+ const script = await this.interpreted(file, argv, cwd, scope, command);
36561
+ return { planned: script && { ...script, script: true }, ...examined };
36554
36562
  }
36555
- async mayExec(cred, req, planned) {
36563
+ async mayExec(cred, req, { planned, examined }) {
36556
36564
  const { dac } = this;
36557
36565
  if (!dac) return;
36558
36566
  const g = {
@@ -36564,10 +36572,8 @@ var Launcher = class {
36564
36572
  links: this.links.get(req.pid)
36565
36573
  };
36566
36574
  const byPath = (file) => file.includes("/") && !COMMAND2.test(file);
36567
- if (byPath(req.file)) {
36568
- const path = this.fs.resolvePath(req.cwd, req.file);
36569
- await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36570
- }
36575
+ const path = byPath(req.file) ? this.fs.resolvePath(req.cwd, req.file) : examined;
36576
+ if (path !== void 0) await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36571
36577
  const via = planned?.via ?? [];
36572
36578
  for (const [i, file] of via.entries()) {
36573
36579
  if (!byPath(file)) continue;
@@ -36616,9 +36622,9 @@ var Launcher = class {
36616
36622
  throw codeOf8(err) === "EACCES" ? new SpawnError("EACCES") : err;
36617
36623
  };
36618
36624
  const file = await this.execFile(req.file, req.cwd, this.execGuard(cred, ppid)).catch(refused5);
36619
- const planned = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
36620
- await this.mayExec(cred, { ...req, file, pid: ppid }, planned).catch(refused5);
36621
- if (planned) return planned;
36625
+ const plan = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
36626
+ await this.mayExec(cred, { ...req, file, pid: ppid }, plan).catch(refused5);
36627
+ if (plan.planned) return plan.planned;
36622
36628
  throw new SpawnError(catalogOnly ? "ENOENT" : await this.unrunnable(file, req.cwd, scope));
36623
36629
  }
36624
36630
  async enterable(g, cwd) {
@@ -36765,7 +36771,7 @@ var Launcher = class {
36765
36771
  }
36766
36772
  async backing(asked, cwd) {
36767
36773
  const file = await this.execFile(asked, cwd);
36768
- const planned = await this.plan(file, [file], cwd, "");
36774
+ const { planned } = await this.plan(file, [file], cwd, "");
36769
36775
  return planned && this.backingOf(planned, file, cwd, "");
36770
36776
  }
36771
36777
  async backingOf(planned, file, cwd, scope) {
@@ -38751,7 +38757,7 @@ var Launcher = class {
38751
38757
  const plan = async () => {
38752
38758
  const found = await this.plan(file, argv, cwd, scope);
38753
38759
  await this.mayExec(credOf(account), { file, cwd, pid: 0, tag }, found);
38754
- return found;
38760
+ return found.planned;
38755
38761
  };
38756
38762
  const planned = await plan();
38757
38763
  return { cwd, file, planned: planned && { ...planned, replan: plan } };