@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.
@@ -9280,7 +9280,7 @@ function satisfies(version, range2) {
9280
9280
  }
9281
9281
 
9282
9282
  // src/version.ts
9283
- var KERNEL_VERSION = true ? "1.194.8" : "0.0.0-dev";
9283
+ var KERNEL_VERSION = true ? "1.194.9" : "0.0.0-dev";
9284
9284
  var OS_RELEASE = "6.0.0-slicc";
9285
9285
  function procVersion() {
9286
9286
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -36912,8 +36912,7 @@ var Launcher = class {
36912
36912
  const command = await this.commandAt(at, scope);
36913
36913
  return command?.script ? command : void 0;
36914
36914
  }
36915
- async interpreted(file, argv, cwd, scope, depth = 0) {
36916
- const command = await this.scriptCommand(file, cwd, scope);
36915
+ async interpreted(file, argv, cwd, scope, command, depth = 0) {
36917
36916
  const script = command?.script ?? this.fs.resolvePath(cwd, file);
36918
36917
  const byPath = command && file.includes("/") && !COMMAND2.test(file);
36919
36918
  const named = byPath ? { [script]: this.fs.resolvePath(cwd, file) } : {};
@@ -36927,10 +36926,16 @@ var Launcher = class {
36927
36926
  if (!interp) return void 0;
36928
36927
  const found = await this.resolve(interp, interp, cwd, scope);
36929
36928
  if (!found) {
36930
- if (depth >= MAX_INTERPRETERS || !await this.scriptCommand(interp, cwd, scope)) {
36931
- return void 0;
36932
- }
36933
- const inner = await this.interpreted(interp, [interp, ...passed], cwd, scope, depth + 1);
36929
+ const next3 = depth < MAX_INTERPRETERS ? await this.scriptCommand(interp, cwd, scope) : void 0;
36930
+ if (!next3) return void 0;
36931
+ const inner = await this.interpreted(
36932
+ interp,
36933
+ [interp, ...passed],
36934
+ cwd,
36935
+ scope,
36936
+ next3,
36937
+ depth + 1
36938
+ );
36934
36939
  const via = [interp, ...inner?.via ?? []];
36935
36940
  const sources = [script, ...inner?.sources ?? []];
36936
36941
  const bins = [...command?.bin ? [script] : [], ...inner?.bins ?? []];
@@ -36963,13 +36968,16 @@ var Launcher = class {
36963
36968
  throw fsError("EACCES", "lease CLI path mismatch");
36964
36969
  if (direct) {
36965
36970
  const shim = direct.shim ? { sources: [direct.shim], asked: direct.asked ? { [direct.shim]: direct.asked } : {} } : {};
36966
- return { target: direct, args: [...direct.prefix ?? [], ...argv.slice(1)], ...shim };
36971
+ const args = [...direct.prefix ?? [], ...argv.slice(1)];
36972
+ return { planned: { target: direct, args, ...shim } };
36967
36973
  }
36968
- if (catalogOnly && !await this.scriptCommand(file, cwd, scope)) return void 0;
36969
- const script = await this.interpreted(file, argv, cwd, scope);
36970
- return script && { ...script, script: true };
36974
+ const command = await this.scriptCommand(file, cwd, scope);
36975
+ if (catalogOnly && !command) return {};
36976
+ const examined = command || file === "" ? {} : { examined: this.fs.resolvePath(cwd, file) };
36977
+ const script = await this.interpreted(file, argv, cwd, scope, command);
36978
+ return { planned: script && { ...script, script: true }, ...examined };
36971
36979
  }
36972
- async mayExec(cred, req, planned) {
36980
+ async mayExec(cred, req, { planned, examined }) {
36973
36981
  const { dac } = this;
36974
36982
  if (!dac) return;
36975
36983
  const g = {
@@ -36981,10 +36989,8 @@ var Launcher = class {
36981
36989
  links: this.links.get(req.pid)
36982
36990
  };
36983
36991
  const byPath = (file) => file.includes("/") && !COMMAND2.test(file);
36984
- if (byPath(req.file)) {
36985
- const path = this.fs.resolvePath(req.cwd, req.file);
36986
- await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36987
- }
36992
+ const path = byPath(req.file) ? this.fs.resolvePath(req.cwd, req.file) : examined;
36993
+ if (path !== void 0) await need(g, "exec", path, planned?.script ? R_OK | X_OK : X_OK);
36988
36994
  const via = planned?.via ?? [];
36989
36995
  for (const [i, file] of via.entries()) {
36990
36996
  if (!byPath(file)) continue;
@@ -37033,9 +37039,9 @@ var Launcher = class {
37033
37039
  throw codeOf8(err) === "EACCES" ? new SpawnError("EACCES") : err;
37034
37040
  };
37035
37041
  const file = await this.execFile(req.file, req.cwd, this.execGuard(cred, ppid)).catch(refused5);
37036
- const planned = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
37037
- await this.mayExec(cred, { ...req, file, pid: ppid }, planned).catch(refused5);
37038
- if (planned) return planned;
37042
+ const plan = await this.plan(file, req.argv, req.cwd, scope, req.argv0, catalogOnly);
37043
+ await this.mayExec(cred, { ...req, file, pid: ppid }, plan).catch(refused5);
37044
+ if (plan.planned) return plan.planned;
37039
37045
  throw new SpawnError(catalogOnly ? "ENOENT" : await this.unrunnable(file, req.cwd, scope));
37040
37046
  }
37041
37047
  async enterable(g, cwd) {
@@ -37182,7 +37188,7 @@ var Launcher = class {
37182
37188
  }
37183
37189
  async backing(asked, cwd) {
37184
37190
  const file = await this.execFile(asked, cwd);
37185
- const planned = await this.plan(file, [file], cwd, "");
37191
+ const { planned } = await this.plan(file, [file], cwd, "");
37186
37192
  return planned && this.backingOf(planned, file, cwd, "");
37187
37193
  }
37188
37194
  async backingOf(planned, file, cwd, scope) {
@@ -39168,7 +39174,7 @@ var Launcher = class {
39168
39174
  const plan = async () => {
39169
39175
  const found = await this.plan(file, argv, cwd, scope);
39170
39176
  await this.mayExec(credOf(account), { file, cwd, pid: 0, tag }, found);
39171
- return found;
39177
+ return found.planned;
39172
39178
  };
39173
39179
  const planned = await plan();
39174
39180
  return { cwd, file, planned: planned && { ...planned, replan: plan } };