@openacp/cli 2026.408.2 → 2026.408.3

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/cli.js CHANGED
@@ -19319,18 +19319,41 @@ function resolveAgentCommand(cmd) {
19319
19319
  try {
19320
19320
  const fullPath = execFileSync6("which", [cmd], { encoding: "utf-8" }).trim();
19321
19321
  if (fullPath) {
19322
- const content = fs40.readFileSync(fullPath, "utf-8");
19323
- if (content.startsWith("#!/usr/bin/env node")) {
19324
- return { command: process.execPath, args: [fullPath] };
19322
+ try {
19323
+ const content = fs40.readFileSync(fullPath, "utf-8");
19324
+ if (content.startsWith("#!/usr/bin/env node")) {
19325
+ return { command: process.execPath, args: [fullPath] };
19326
+ }
19327
+ } catch {
19325
19328
  }
19329
+ return { command: fullPath, args: [] };
19326
19330
  }
19327
19331
  } catch {
19328
19332
  }
19329
19333
  if (cmd === "npx" || cmd === "uvx") {
19330
- const sibling = path44.join(path44.dirname(process.execPath), cmd);
19331
- if (fs40.existsSync(sibling)) {
19332
- return { command: sibling, args: [] };
19334
+ const seen = /* @__PURE__ */ new Set();
19335
+ const candidates = [];
19336
+ const addCandidate = (dir) => {
19337
+ if (!seen.has(dir)) {
19338
+ seen.add(dir);
19339
+ candidates.push(dir);
19340
+ }
19341
+ };
19342
+ addCandidate(path44.dirname(process.execPath));
19343
+ try {
19344
+ addCandidate(path44.dirname(fs40.realpathSync(process.execPath)));
19345
+ } catch {
19346
+ }
19347
+ addCandidate("/opt/homebrew/bin");
19348
+ addCandidate("/usr/local/bin");
19349
+ for (const dir of candidates) {
19350
+ const candidate = path44.join(dir, cmd);
19351
+ if (fs40.existsSync(candidate)) {
19352
+ log31.info({ cmd, resolved: candidate }, "Resolved package runner from fallback search");
19353
+ return { command: candidate, args: [] };
19354
+ }
19333
19355
  }
19356
+ log31.warn({ cmd, execPath: process.execPath, candidates }, "Could not find package runner");
19334
19357
  }
19335
19358
  return { command: cmd, args: [] };
19336
19359
  }