@openma/cli 0.3.0-beta.0 → 0.3.0-beta.1
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/index.js +27 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -415,7 +415,18 @@ ${c.bold("Up to date.")}
|
|
|
415
415
|
createdAt: Math.floor(Date.now() / 1e3)
|
|
416
416
|
});
|
|
417
417
|
log.ok(`credentials written ${c.dim(paths().credsFile)}`);
|
|
418
|
-
|
|
418
|
+
let agents = await detectAll();
|
|
419
|
+
const hasClaudeAcp = agents.some((a) => a.id === "claude-code-acp");
|
|
420
|
+
if (!hasClaudeAcp && await isOnPath2("claude")) {
|
|
421
|
+
log.step("found `claude` on PATH \u2014 installing ACP wrapper @zed-industries/claude-code-acp");
|
|
422
|
+
const ok = await npmInstallGlobal("@zed-industries/claude-code-acp");
|
|
423
|
+
if (ok) {
|
|
424
|
+
log.ok("claude-code-acp installed");
|
|
425
|
+
agents = await detectAll();
|
|
426
|
+
} else {
|
|
427
|
+
log.warn("auto-install failed \u2014 install manually: npm i -g @zed-industries/claude-code-acp");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
419
430
|
if (agents.length > 0) {
|
|
420
431
|
log.ok(`agents detected ${c.dim(agents.map((a) => a.id).join(", "))}`);
|
|
421
432
|
} else {
|
|
@@ -525,6 +536,21 @@ function openBrowser(url2) {
|
|
|
525
536
|
setTimeout(() => resolve(), 100);
|
|
526
537
|
});
|
|
527
538
|
}
|
|
539
|
+
function isOnPath2(cmd) {
|
|
540
|
+
return new Promise((resolve) => {
|
|
541
|
+
const probe = process.platform === "win32" ? "where" : "which";
|
|
542
|
+
const p = spawn3(probe, [cmd], { stdio: "ignore" });
|
|
543
|
+
p.once("error", () => resolve(false));
|
|
544
|
+
p.once("exit", (code) => resolve(code === 0));
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function npmInstallGlobal(pkg) {
|
|
548
|
+
return new Promise((resolve) => {
|
|
549
|
+
const p = spawn3("npm", ["install", "-g", pkg], { stdio: "inherit" });
|
|
550
|
+
p.once("error", () => resolve(false));
|
|
551
|
+
p.once("exit", (code) => resolve(code === 0));
|
|
552
|
+
});
|
|
553
|
+
}
|
|
528
554
|
var init_setup = __esm({
|
|
529
555
|
"src/bridge/commands/setup.ts"() {
|
|
530
556
|
"use strict";
|