@ai-ecoverse/slicc-kernel 1.194.8 → 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.
@@ -8166,7 +8166,7 @@ var init_version = __esm({
8166
8166
  "src/version.ts"() {
8167
8167
  "use strict";
8168
8168
  init_captured_globals();
8169
- KERNEL_VERSION = true ? "1.194.8" : "0.0.0-dev";
8169
+ KERNEL_VERSION = true ? "1.194.9" : "0.0.0-dev";
8170
8170
  OS_RELEASE = "6.0.0-slicc";
8171
8171
  }
8172
8172
  });
@@ -8165,7 +8165,7 @@ var init_version = __esm({
8165
8165
  "src/version.ts"() {
8166
8166
  "use strict";
8167
8167
  init_captured_globals();
8168
- KERNEL_VERSION = true ? "1.194.8" : "0.0.0-dev";
8168
+ KERNEL_VERSION = true ? "1.194.9" : "0.0.0-dev";
8169
8169
  OS_RELEASE = "6.0.0-slicc";
8170
8170
  }
8171
8171
  });
package/dist/node.js CHANGED
@@ -7512,7 +7512,7 @@ function satisfies(version, range2) {
7512
7512
  }
7513
7513
 
7514
7514
  // src/version.ts
7515
- var KERNEL_VERSION = true ? "1.194.8" : "0.0.0-dev";
7515
+ var KERNEL_VERSION = true ? "1.194.9" : "0.0.0-dev";
7516
7516
  var OS_RELEASE = "6.0.0-slicc";
7517
7517
  function procVersion() {
7518
7518
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -36873,8 +36873,7 @@ var Launcher = class {
36873
36873
  const command = await this.commandAt(at, scope);
36874
36874
  return command?.script ? command : void 0;
36875
36875
  }
36876
- async interpreted(file, argv, cwd, scope, depth = 0) {
36877
- const command = await this.scriptCommand(file, cwd, scope);
36876
+ async interpreted(file, argv, cwd, scope, command, depth = 0) {
36878
36877
  const script = command?.script ?? this.fs.resolvePath(cwd, file);
36879
36878
  const byPath = command && file.includes("/") && !COMMAND2.test(file);
36880
36879
  const named = byPath ? { [script]: this.fs.resolvePath(cwd, file) } : {};
@@ -36888,10 +36887,16 @@ var Launcher = class {
36888
36887
  if (!interp) return void 0;
36889
36888
  const found = await this.resolve(interp, interp, cwd, scope);
36890
36889
  if (!found) {
36891
- if (depth >= MAX_INTERPRETERS || !await this.scriptCommand(interp, cwd, scope)) {
36892
- return void 0;
36893
- }
36894
- const inner = await this.interpreted(interp, [interp, ...passed], cwd, scope, depth + 1);
36890
+ const next3 = depth < MAX_INTERPRETERS ? await this.scriptCommand(interp, cwd, scope) : void 0;
36891
+ if (!next3) return void 0;
36892
+ const inner = await this.interpreted(
36893
+ interp,
36894
+ [interp, ...passed],
36895
+ cwd,
36896
+ scope,
36897
+ next3,
36898
+ depth + 1
36899
+ );
36895
36900
  const via = [interp, ...inner?.via ?? []];
36896
36901
  const sources = [script, ...inner?.sources ?? []];
36897
36902
  const bins = [...command?.bin ? [script] : [], ...inner?.bins ?? []];
@@ -36924,13 +36929,16 @@ var Launcher = class {
36924
36929
  throw fsError("EACCES", "lease CLI path mismatch");
36925
36930
  if (direct) {
36926
36931
  const shim = direct.shim ? { sources: [direct.shim], asked: direct.asked ? { [direct.shim]: direct.asked } : {} } : {};
36927
- return { target: direct, args: [...direct.prefix ?? [], ...argv.slice(1)], ...shim };
36932
+ const args = [...direct.prefix ?? [], ...argv.slice(1)];
36933
+ return { planned: { target: direct, args, ...shim } };
36928
36934
  }
36929
- if (catalogOnly && !await this.scriptCommand(file, cwd, scope)) return void 0;
36930
- const script = await this.interpreted(file, argv, cwd, scope);
36931
- return script && { ...script, script: true };
36935
+ const command = await this.scriptCommand(file, cwd, scope);
36936
+ if (catalogOnly && !command) return {};
36937
+ const examined = command || file === "" ? {} : { examined: this.fs.resolvePath(cwd, file) };
36938
+ const script = await this.interpreted(file, argv, cwd, scope, command);
36939
+ return { planned: script && { ...script, script: true }, ...examined };
36932
36940
  }
36933
- async mayExec(cred, req, planned) {
36941
+ async mayExec(cred, req, { planned, examined }) {
36934
36942
  const { dac } = this;
36935
36943
  if (!dac) return;
36936
36944
  const g = {
@@ -36942,10 +36950,8 @@ var Launcher = class {
36942
36950
  links: this.links.get(req.pid)
36943
36951
  };
36944
36952
  const byPath = (file) => file.includes("/") && !COMMAND2.test(file);
36945
- if (byPath(req.file)) {
36946
- const path = this.fs.resolvePath(req.cwd, req.file);
36947
- await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36948
- }
36953
+ const path = byPath(req.file) ? this.fs.resolvePath(req.cwd, req.file) : examined;
36954
+ if (path !== void 0) await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36949
36955
  const via = planned?.via ?? [];
36950
36956
  for (const [i, file] of via.entries()) {
36951
36957
  if (!byPath(file)) continue;
@@ -36994,9 +37000,9 @@ var Launcher = class {
36994
37000
  throw codeOf9(err) === "EACCES" ? new SpawnError("EACCES") : err;
36995
37001
  };
36996
37002
  const file = await this.execFile(req.file, req.cwd, this.execGuard(cred, ppid)).catch(refused5);
36997
- const planned = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
36998
- await this.mayExec(cred, { ...req, file, pid: ppid }, planned).catch(refused5);
36999
- if (planned) return planned;
37003
+ const plan = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
37004
+ await this.mayExec(cred, { ...req, file, pid: ppid }, plan).catch(refused5);
37005
+ if (plan.planned) return plan.planned;
37000
37006
  throw new SpawnError(catalogOnly ? "ENOENT" : await this.unrunnable(file, req.cwd, scope));
37001
37007
  }
37002
37008
  async enterable(g, cwd) {
@@ -37143,7 +37149,7 @@ var Launcher = class {
37143
37149
  }
37144
37150
  async backing(asked, cwd) {
37145
37151
  const file = await this.execFile(asked, cwd);
37146
- const planned = await this.plan(file, [file], cwd, "");
37152
+ const { planned } = await this.plan(file, [file], cwd, "");
37147
37153
  return planned && this.backingOf(planned, file, cwd, "");
37148
37154
  }
37149
37155
  async backingOf(planned, file, cwd, scope) {
@@ -39129,7 +39135,7 @@ var Launcher = class {
39129
39135
  const plan = async () => {
39130
39136
  const found = await this.plan(file, argv, cwd, scope);
39131
39137
  await this.mayExec(credOf(account), { file, cwd, pid: 0, tag }, found);
39132
- return found;
39138
+ return found.planned;
39133
39139
  };
39134
39140
  const planned = await plan();
39135
39141
  return { cwd, file, planned: planned && { ...planned, replan: plan } };