@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 +29 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11358,18 +11358,41 @@ function resolveAgentCommand(cmd) {
|
|
|
11358
11358
|
try {
|
|
11359
11359
|
const fullPath = execFileSync("which", [cmd], { encoding: "utf-8" }).trim();
|
|
11360
11360
|
if (fullPath) {
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11361
|
+
try {
|
|
11362
|
+
const content = fs8.readFileSync(fullPath, "utf-8");
|
|
11363
|
+
if (content.startsWith("#!/usr/bin/env node")) {
|
|
11364
|
+
return { command: process.execPath, args: [fullPath] };
|
|
11365
|
+
}
|
|
11366
|
+
} catch {
|
|
11364
11367
|
}
|
|
11368
|
+
return { command: fullPath, args: [] };
|
|
11365
11369
|
}
|
|
11366
11370
|
} catch {
|
|
11367
11371
|
}
|
|
11368
11372
|
if (cmd === "npx" || cmd === "uvx") {
|
|
11369
|
-
const
|
|
11370
|
-
|
|
11371
|
-
|
|
11373
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11374
|
+
const candidates = [];
|
|
11375
|
+
const addCandidate = (dir) => {
|
|
11376
|
+
if (!seen.has(dir)) {
|
|
11377
|
+
seen.add(dir);
|
|
11378
|
+
candidates.push(dir);
|
|
11379
|
+
}
|
|
11380
|
+
};
|
|
11381
|
+
addCandidate(path7.dirname(process.execPath));
|
|
11382
|
+
try {
|
|
11383
|
+
addCandidate(path7.dirname(fs8.realpathSync(process.execPath)));
|
|
11384
|
+
} catch {
|
|
11385
|
+
}
|
|
11386
|
+
addCandidate("/opt/homebrew/bin");
|
|
11387
|
+
addCandidate("/usr/local/bin");
|
|
11388
|
+
for (const dir of candidates) {
|
|
11389
|
+
const candidate = path7.join(dir, cmd);
|
|
11390
|
+
if (fs8.existsSync(candidate)) {
|
|
11391
|
+
log4.info({ cmd, resolved: candidate }, "Resolved package runner from fallback search");
|
|
11392
|
+
return { command: candidate, args: [] };
|
|
11393
|
+
}
|
|
11372
11394
|
}
|
|
11395
|
+
log4.warn({ cmd, execPath: process.execPath, candidates }, "Could not find package runner");
|
|
11373
11396
|
}
|
|
11374
11397
|
return { command: cmd, args: [] };
|
|
11375
11398
|
}
|