@openacp/cli 0.4.11 → 0.5.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/README.md +41 -3
- package/dist/agent-catalog-LAAVBVLY.js +10 -0
- package/dist/agent-dependencies-FCLRGMZM.js +23 -0
- package/dist/agent-registry-KZANAFXQ.js +8 -0
- package/dist/agent-store-ZBXGOFPH.js +8 -0
- package/dist/chunk-5HGXUCMX.js +83 -0
- package/dist/chunk-5HGXUCMX.js.map +1 -0
- package/dist/chunk-5MH66WUY.js +424 -0
- package/dist/chunk-5MH66WUY.js.map +1 -0
- package/dist/{chunk-FKOARMAE.js → chunk-776VAU3T.js} +3 -3
- package/dist/chunk-GUHCS6X7.js +282 -0
- package/dist/chunk-GUHCS6X7.js.map +1 -0
- package/dist/{chunk-3DIPXFZJ.js → chunk-IRGYTNLP.js} +2 -2
- package/dist/chunk-IURZ4QHG.js +91 -0
- package/dist/chunk-IURZ4QHG.js.map +1 -0
- package/dist/{chunk-WYZFGHHI.js → chunk-JRF4G4X7.js} +60 -24
- package/dist/chunk-JRF4G4X7.js.map +1 -0
- package/dist/chunk-NAMYZIS5.js +1 -0
- package/dist/{chunk-ZW444AQY.js → chunk-NDR5JCS7.js} +2 -2
- package/dist/{chunk-66RVSUAR.js → chunk-PHC67OP4.js} +567 -103
- package/dist/chunk-PHC67OP4.js.map +1 -0
- package/dist/{chunk-W7QQA6CW.js → chunk-QODDJ4PH.js} +83 -36
- package/dist/chunk-QODDJ4PH.js.map +1 -0
- package/dist/{chunk-YRJEZD7R.js → chunk-VBEWSWVL.js} +2 -2
- package/dist/{chunk-C33LTDZV.js → chunk-Z46LGZ7R.js} +21 -8
- package/dist/chunk-Z46LGZ7R.js.map +1 -0
- package/dist/cli.js +440 -64
- package/dist/cli.js.map +1 -1
- package/dist/{config-XURP6B3S.js → config-PCPIBPUA.js} +2 -2
- package/dist/config-editor-RGV6VKPZ.js +12 -0
- package/dist/{config-registry-OGX4YM2U.js → config-registry-SNKA2EH2.js} +2 -2
- package/dist/{daemon-GWJM2S4A.js → daemon-JZLFRUW6.js} +3 -3
- package/dist/daemon-JZLFRUW6.js.map +1 -0
- package/dist/data/registry-snapshot.json +876 -0
- package/dist/doctor-N2HKKUUQ.js +9 -0
- package/dist/doctor-N2HKKUUQ.js.map +1 -0
- package/dist/index.d.ts +138 -17
- package/dist/index.js +24 -15
- package/dist/integrate-X7LI6MUO.js +257 -0
- package/dist/integrate-X7LI6MUO.js.map +1 -0
- package/dist/{main-2QKD2EI2.js → main-DSQBCJHR.js} +18 -15
- package/dist/{main-2QKD2EI2.js.map → main-DSQBCJHR.js.map} +1 -1
- package/dist/{menu-CARRTW2F.js → menu-J5YVH665.js} +2 -4
- package/dist/menu-J5YVH665.js.map +1 -0
- package/dist/{setup-TTOL7XAN.js → setup-3A3XDGCM.js} +4 -3
- package/dist/setup-3A3XDGCM.js.map +1 -0
- package/dist/suggest-RST5VOHB.js +36 -0
- package/dist/suggest-RST5VOHB.js.map +1 -0
- package/package.json +11 -2
- package/dist/agent-registry-7HC6D4CH.js +0 -7
- package/dist/chunk-66RVSUAR.js.map +0 -1
- package/dist/chunk-BGKQHQB4.js +0 -276
- package/dist/chunk-BGKQHQB4.js.map +0 -1
- package/dist/chunk-C33LTDZV.js.map +0 -1
- package/dist/chunk-VA2M52CM.js +0 -15
- package/dist/chunk-VA2M52CM.js.map +0 -1
- package/dist/chunk-W7QQA6CW.js.map +0 -1
- package/dist/chunk-WYZFGHHI.js.map +0 -1
- package/dist/config-editor-AALY3URF.js +0 -11
- package/dist/doctor-X477CVZN.js +0 -9
- package/dist/integrate-WUPLRJD3.js +0 -145
- package/dist/integrate-WUPLRJD3.js.map +0 -1
- /package/dist/{agent-registry-7HC6D4CH.js.map → agent-catalog-LAAVBVLY.js.map} +0 -0
- /package/dist/{config-XURP6B3S.js.map → agent-dependencies-FCLRGMZM.js.map} +0 -0
- /package/dist/{config-editor-AALY3URF.js.map → agent-registry-KZANAFXQ.js.map} +0 -0
- /package/dist/{config-registry-OGX4YM2U.js.map → agent-store-ZBXGOFPH.js.map} +0 -0
- /package/dist/{chunk-FKOARMAE.js.map → chunk-776VAU3T.js.map} +0 -0
- /package/dist/{chunk-3DIPXFZJ.js.map → chunk-IRGYTNLP.js.map} +0 -0
- /package/dist/{daemon-GWJM2S4A.js.map → chunk-NAMYZIS5.js.map} +0 -0
- /package/dist/{chunk-ZW444AQY.js.map → chunk-NDR5JCS7.js.map} +0 -0
- /package/dist/{chunk-YRJEZD7R.js.map → chunk-VBEWSWVL.js.map} +0 -0
- /package/dist/{doctor-X477CVZN.js.map → config-PCPIBPUA.js.map} +0 -0
- /package/dist/{menu-CARRTW2F.js.map → config-editor-RGV6VKPZ.js.map} +0 -0
- /package/dist/{setup-TTOL7XAN.js.map → config-registry-SNKA2EH2.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
installPlugin,
|
|
4
4
|
listPlugins,
|
|
5
5
|
uninstallPlugin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NDR5JCS7.js";
|
|
7
|
+
import "./chunk-JRF4G4X7.js";
|
|
8
|
+
import "./chunk-ESOPMQAY.js";
|
|
7
9
|
import {
|
|
8
10
|
apiCall,
|
|
9
11
|
readApiPort,
|
|
@@ -16,8 +18,6 @@ import {
|
|
|
16
18
|
getLatestVersion,
|
|
17
19
|
runUpdate
|
|
18
20
|
} from "./chunk-KSIQZC3J.js";
|
|
19
|
-
import "./chunk-WYZFGHHI.js";
|
|
20
|
-
import "./chunk-ESOPMQAY.js";
|
|
21
21
|
|
|
22
22
|
// src/cli.ts
|
|
23
23
|
import { setDefaultAutoSelectFamily } from "net";
|
|
@@ -25,61 +25,66 @@ import { setDefaultAutoSelectFamily } from "net";
|
|
|
25
25
|
// src/cli/commands.ts
|
|
26
26
|
function printHelp() {
|
|
27
27
|
console.log(`
|
|
28
|
-
|
|
28
|
+
\x1B[1mOpenACP\x1B[0m \u2014 Self-hosted bridge for AI coding agents
|
|
29
|
+
Connect Telegram (and more) to 28+ AI coding agents via ACP protocol.
|
|
30
|
+
|
|
31
|
+
\x1B[1mGetting Started:\x1B[0m
|
|
32
|
+
openacp First run launches setup wizard
|
|
33
|
+
openacp After setup, starts the server
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
\x1B[1mServer:\x1B[0m
|
|
31
36
|
openacp Start (mode from config)
|
|
32
37
|
openacp start Start as background daemon
|
|
33
38
|
openacp stop Stop background daemon
|
|
34
39
|
openacp status Show daemon status
|
|
35
40
|
openacp logs Tail daemon log file
|
|
36
|
-
openacp
|
|
41
|
+
openacp --foreground Force foreground mode
|
|
42
|
+
|
|
43
|
+
\x1B[1mAgent Management:\x1B[0m
|
|
44
|
+
openacp agents Browse all agents (installed + available)
|
|
45
|
+
openacp agents install <name> Install an agent from the ACP Registry
|
|
46
|
+
openacp agents uninstall <name> Remove an installed agent
|
|
47
|
+
openacp agents info <name> Show details, dependencies & setup guide
|
|
48
|
+
openacp agents run <name> [-- args] Run agent CLI directly (login, config...)
|
|
49
|
+
openacp agents refresh Force-refresh agent list from registry
|
|
50
|
+
|
|
51
|
+
\x1B[2mExamples:\x1B[0m
|
|
52
|
+
openacp agents install gemini Install Gemini CLI
|
|
53
|
+
openacp agents run gemini -- auth login Login to Google
|
|
54
|
+
openacp agents run claude -- login Login to Anthropic
|
|
55
|
+
openacp agents info cursor See setup instructions
|
|
56
|
+
|
|
57
|
+
\x1B[1mConfiguration:\x1B[0m
|
|
58
|
+
openacp config Interactive config editor
|
|
37
59
|
openacp config set <key> <value> Set a config value
|
|
38
|
-
openacp reset
|
|
60
|
+
openacp reset Re-run setup wizard
|
|
39
61
|
openacp update Update to latest version
|
|
40
|
-
openacp doctor
|
|
41
|
-
openacp doctor --dry-run
|
|
42
|
-
openacp install <package> Install a plugin adapter
|
|
43
|
-
openacp uninstall <package> Uninstall a plugin adapter
|
|
44
|
-
openacp plugins List installed plugins
|
|
45
|
-
openacp --foreground Force foreground mode
|
|
46
|
-
openacp --version Show version
|
|
47
|
-
openacp --help Show this help
|
|
48
|
-
adopt <agent> <id> Adopt an external agent session into OpenACP
|
|
49
|
-
integrate <agent> Install/uninstall agent integration for session transfer
|
|
62
|
+
openacp doctor Run system diagnostics
|
|
63
|
+
openacp doctor --dry-run Check only, don't fix
|
|
50
64
|
|
|
51
|
-
|
|
52
|
-
openacp
|
|
53
|
-
openacp
|
|
54
|
-
openacp
|
|
55
|
-
openacp api send <id> <prompt> Send prompt to session
|
|
56
|
-
openacp api cancel <id> Cancel a session
|
|
57
|
-
openacp api dangerous <id> [on|off] Toggle dangerous mode
|
|
58
|
-
openacp api agents List available agents
|
|
59
|
-
openacp api topics [--status s1,s2] List topics
|
|
60
|
-
openacp api delete-topic <id> [--force] Delete a topic
|
|
61
|
-
openacp api cleanup [--status s1,s2] Cleanup finished topics
|
|
62
|
-
openacp api health Show system health
|
|
63
|
-
openacp api adapters List registered adapters
|
|
64
|
-
openacp api tunnel Show tunnel status
|
|
65
|
-
openacp api config Show runtime config (deprecated)
|
|
66
|
-
openacp api config set <key> <value> Update config value (deprecated)
|
|
67
|
-
openacp api restart Restart daemon
|
|
68
|
-
openacp api notify <message> Send notification to all channels
|
|
69
|
-
openacp api version Show daemon version
|
|
65
|
+
\x1B[1mPlugins:\x1B[0m
|
|
66
|
+
openacp install <package> Install adapter (e.g. @openacp/adapter-discord)
|
|
67
|
+
openacp uninstall <package> Remove adapter
|
|
68
|
+
openacp plugins List installed plugins
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
\x1B[1mSession Transfer:\x1B[0m
|
|
71
|
+
openacp integrate <agent> Install handoff integration
|
|
72
|
+
openacp integrate <agent> --uninstall
|
|
73
|
+
openacp adopt <agent> <id> Adopt an external session
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
\x1B[1mDaemon API:\x1B[0m \x1B[2m(requires running daemon)\x1B[0m
|
|
76
|
+
openacp api status Active sessions
|
|
77
|
+
openacp api session <id> Session details
|
|
78
|
+
openacp api new [agent] [workspace] Create session
|
|
79
|
+
openacp api send <id> <prompt> Send prompt
|
|
80
|
+
openacp api cancel <id> Cancel session
|
|
81
|
+
openacp api dangerous <id> on|off Toggle dangerous mode
|
|
82
|
+
openacp api topics [--status ...] List topics
|
|
83
|
+
openacp api cleanup [--status ...] Cleanup old topics
|
|
84
|
+
openacp api health System health check
|
|
85
|
+
openacp api restart Restart daemon
|
|
78
86
|
|
|
79
|
-
|
|
80
|
-
openacp
|
|
81
|
-
openacp install @openacp/adapter-discord
|
|
82
|
-
openacp uninstall @openacp/adapter-discord
|
|
87
|
+
\x1B[2mMore info: https://github.com/Open-ACP/OpenACP\x1B[0m
|
|
83
88
|
`);
|
|
84
89
|
}
|
|
85
90
|
async function cmdVersion() {
|
|
@@ -426,7 +431,30 @@ async function cmdApi(args2) {
|
|
|
426
431
|
}
|
|
427
432
|
console.log(`Daemon version: ${data.version}`);
|
|
428
433
|
} else {
|
|
434
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
435
|
+
const apiSubcommands = [
|
|
436
|
+
"new",
|
|
437
|
+
"cancel",
|
|
438
|
+
"status",
|
|
439
|
+
"agents",
|
|
440
|
+
"topics",
|
|
441
|
+
"delete-topic",
|
|
442
|
+
"cleanup",
|
|
443
|
+
"send",
|
|
444
|
+
"session",
|
|
445
|
+
"dangerous",
|
|
446
|
+
"health",
|
|
447
|
+
"restart",
|
|
448
|
+
"config",
|
|
449
|
+
"adapters",
|
|
450
|
+
"tunnel",
|
|
451
|
+
"notify",
|
|
452
|
+
"version"
|
|
453
|
+
];
|
|
454
|
+
const suggestion = suggestMatch(subCmd ?? "", apiSubcommands);
|
|
429
455
|
console.error(`Unknown api command: ${subCmd || "(none)"}
|
|
456
|
+
`);
|
|
457
|
+
if (suggestion) console.error(`Did you mean: ${suggestion}?
|
|
430
458
|
`);
|
|
431
459
|
console.log("Usage:");
|
|
432
460
|
console.log(" openacp api status Show active sessions");
|
|
@@ -460,8 +488,8 @@ async function cmdApi(args2) {
|
|
|
460
488
|
}
|
|
461
489
|
async function cmdStart() {
|
|
462
490
|
await checkAndPromptUpdate();
|
|
463
|
-
const { startDaemon, getPidPath } = await import("./daemon-
|
|
464
|
-
const { ConfigManager } = await import("./config-
|
|
491
|
+
const { startDaemon, getPidPath } = await import("./daemon-JZLFRUW6.js");
|
|
492
|
+
const { ConfigManager } = await import("./config-PCPIBPUA.js");
|
|
465
493
|
const cm = new ConfigManager();
|
|
466
494
|
if (await cm.exists()) {
|
|
467
495
|
await cm.load();
|
|
@@ -478,7 +506,7 @@ async function cmdStart() {
|
|
|
478
506
|
}
|
|
479
507
|
}
|
|
480
508
|
async function cmdStop() {
|
|
481
|
-
const { stopDaemon } = await import("./daemon-
|
|
509
|
+
const { stopDaemon } = await import("./daemon-JZLFRUW6.js");
|
|
482
510
|
const result = stopDaemon();
|
|
483
511
|
if (result.stopped) {
|
|
484
512
|
console.log(`OpenACP daemon stopped (was PID ${result.pid})`);
|
|
@@ -488,7 +516,7 @@ async function cmdStop() {
|
|
|
488
516
|
}
|
|
489
517
|
}
|
|
490
518
|
async function cmdStatus() {
|
|
491
|
-
const { getStatus } = await import("./daemon-
|
|
519
|
+
const { getStatus } = await import("./daemon-JZLFRUW6.js");
|
|
492
520
|
const status = getStatus();
|
|
493
521
|
if (status.running) {
|
|
494
522
|
console.log(`OpenACP is running (PID ${status.pid})`);
|
|
@@ -498,7 +526,7 @@ async function cmdStatus() {
|
|
|
498
526
|
}
|
|
499
527
|
async function cmdLogs() {
|
|
500
528
|
const { spawn } = await import("child_process");
|
|
501
|
-
const { ConfigManager, expandHome } = await import("./config-
|
|
529
|
+
const { ConfigManager, expandHome } = await import("./config-PCPIBPUA.js");
|
|
502
530
|
const pathMod = await import("path");
|
|
503
531
|
const cm = new ConfigManager();
|
|
504
532
|
let logDir = "~/.openacp/logs";
|
|
@@ -522,6 +550,16 @@ async function cmdConfig(args2 = []) {
|
|
|
522
550
|
console.error("Usage: openacp config set <path> <value>");
|
|
523
551
|
process.exit(1);
|
|
524
552
|
}
|
|
553
|
+
const { ConfigSchema } = await import("./config-PCPIBPUA.js");
|
|
554
|
+
const topLevelKey = configPath.split(".")[0];
|
|
555
|
+
const validConfigKeys = Object.keys(ConfigSchema.shape);
|
|
556
|
+
if (!validConfigKeys.includes(topLevelKey)) {
|
|
557
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
558
|
+
const suggestion = suggestMatch(topLevelKey, validConfigKeys);
|
|
559
|
+
console.error(`Unknown config key: ${topLevelKey}`);
|
|
560
|
+
if (suggestion) console.error(`Did you mean: ${suggestion}?`);
|
|
561
|
+
process.exit(1);
|
|
562
|
+
}
|
|
525
563
|
let value = configValue;
|
|
526
564
|
try {
|
|
527
565
|
value = JSON.parse(configValue);
|
|
@@ -544,7 +582,7 @@ async function cmdConfig(args2 = []) {
|
|
|
544
582
|
console.log("Note: restart required for this change to take effect.");
|
|
545
583
|
}
|
|
546
584
|
} else {
|
|
547
|
-
const { ConfigManager: ConfigManager2 } = await import("./config-
|
|
585
|
+
const { ConfigManager: ConfigManager2 } = await import("./config-PCPIBPUA.js");
|
|
548
586
|
const cm2 = new ConfigManager2();
|
|
549
587
|
if (!await cm2.exists()) {
|
|
550
588
|
console.error('No config found. Run "openacp" first to set up.');
|
|
@@ -557,8 +595,8 @@ async function cmdConfig(args2 = []) {
|
|
|
557
595
|
}
|
|
558
596
|
return;
|
|
559
597
|
}
|
|
560
|
-
const { runConfigEditor } = await import("./config-editor-
|
|
561
|
-
const { ConfigManager } = await import("./config-
|
|
598
|
+
const { runConfigEditor } = await import("./config-editor-RGV6VKPZ.js");
|
|
599
|
+
const { ConfigManager } = await import("./config-PCPIBPUA.js");
|
|
562
600
|
const cm = new ConfigManager();
|
|
563
601
|
if (!await cm.exists()) {
|
|
564
602
|
console.error('No config found. Run "openacp" first to set up.');
|
|
@@ -583,7 +621,7 @@ function buildNestedUpdateFromPath(dotPath, value) {
|
|
|
583
621
|
return result;
|
|
584
622
|
}
|
|
585
623
|
async function cmdReset() {
|
|
586
|
-
const { getStatus } = await import("./daemon-
|
|
624
|
+
const { getStatus } = await import("./daemon-JZLFRUW6.js");
|
|
587
625
|
const status = getStatus();
|
|
588
626
|
if (status.running) {
|
|
589
627
|
console.error("OpenACP is running. Stop it first: openacp stop");
|
|
@@ -667,7 +705,7 @@ async function cmdAdopt(args2) {
|
|
|
667
705
|
}
|
|
668
706
|
}
|
|
669
707
|
async function cmdIntegrate(args2) {
|
|
670
|
-
const { getIntegration, listIntegrations } = await import("./integrate-
|
|
708
|
+
const { getIntegration, listIntegrations } = await import("./integrate-X7LI6MUO.js");
|
|
671
709
|
const agent = args2[1];
|
|
672
710
|
const uninstall = args2.includes("--uninstall");
|
|
673
711
|
if (!agent) {
|
|
@@ -677,8 +715,12 @@ async function cmdIntegrate(args2) {
|
|
|
677
715
|
}
|
|
678
716
|
const integration = getIntegration(agent);
|
|
679
717
|
if (!integration) {
|
|
718
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
719
|
+
const available = listIntegrations();
|
|
720
|
+
const suggestion = suggestMatch(agent, available);
|
|
680
721
|
console.log(`No integration available for '${agent}'.`);
|
|
681
|
-
console.log(`
|
|
722
|
+
if (suggestion) console.log(`Did you mean: ${suggestion}?`);
|
|
723
|
+
console.log(`Available: ${available.join(", ")}`);
|
|
682
724
|
process.exit(1);
|
|
683
725
|
}
|
|
684
726
|
for (const item of integration.items) {
|
|
@@ -706,8 +748,21 @@ async function cmdIntegrate(args2) {
|
|
|
706
748
|
}
|
|
707
749
|
}
|
|
708
750
|
async function cmdDoctor(args2) {
|
|
751
|
+
const knownFlags = ["--dry-run"];
|
|
752
|
+
const unknownFlags = args2.slice(1).filter(
|
|
753
|
+
(a) => a.startsWith("--") && !knownFlags.includes(a)
|
|
754
|
+
);
|
|
755
|
+
if (unknownFlags.length > 0) {
|
|
756
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
757
|
+
for (const flag of unknownFlags) {
|
|
758
|
+
const suggestion = suggestMatch(flag, knownFlags);
|
|
759
|
+
console.error(`Unknown flag: ${flag}`);
|
|
760
|
+
if (suggestion) console.error(`Did you mean: ${suggestion}?`);
|
|
761
|
+
}
|
|
762
|
+
process.exit(1);
|
|
763
|
+
}
|
|
709
764
|
const dryRun = args2.includes("--dry-run");
|
|
710
|
-
const { DoctorEngine } = await import("./doctor-
|
|
765
|
+
const { DoctorEngine } = await import("./doctor-N2HKKUUQ.js");
|
|
711
766
|
const engine = new DoctorEngine({ dryRun });
|
|
712
767
|
console.log("\n\u{1FA7A} OpenACP Doctor\n");
|
|
713
768
|
const report = await engine.runAll();
|
|
@@ -749,25 +804,345 @@ async function cmdDoctor(args2) {
|
|
|
749
804
|
process.exit(1);
|
|
750
805
|
}
|
|
751
806
|
}
|
|
807
|
+
async function cmdAgents(args2) {
|
|
808
|
+
const subcommand = args2[1];
|
|
809
|
+
switch (subcommand) {
|
|
810
|
+
case "install":
|
|
811
|
+
return agentsInstall(args2[2], args2.includes("--force"));
|
|
812
|
+
case "uninstall":
|
|
813
|
+
return agentsUninstall(args2[2]);
|
|
814
|
+
case "refresh":
|
|
815
|
+
return agentsRefresh();
|
|
816
|
+
case "info":
|
|
817
|
+
return agentsInfo(args2[2]);
|
|
818
|
+
case "run":
|
|
819
|
+
return agentsRun(args2[2], args2.slice(3));
|
|
820
|
+
case "list":
|
|
821
|
+
case void 0:
|
|
822
|
+
return agentsList();
|
|
823
|
+
default: {
|
|
824
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
825
|
+
const agentSubcommands = ["install", "uninstall", "refresh", "info", "run", "list"];
|
|
826
|
+
const suggestion = suggestMatch(subcommand, agentSubcommands);
|
|
827
|
+
console.error(`Unknown agents command: ${subcommand}`);
|
|
828
|
+
if (suggestion) console.error(`Did you mean: ${suggestion}?`);
|
|
829
|
+
console.error(`
|
|
830
|
+
Run 'openacp agents' to see available agents.`);
|
|
831
|
+
process.exit(1);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
async function agentsList() {
|
|
836
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
837
|
+
const catalog = new AgentCatalog();
|
|
838
|
+
catalog.load();
|
|
839
|
+
await catalog.refreshRegistryIfStale();
|
|
840
|
+
const items = catalog.getAvailable();
|
|
841
|
+
const installed = items.filter((i) => i.installed);
|
|
842
|
+
const available = items.filter((i) => !i.installed);
|
|
843
|
+
console.log("");
|
|
844
|
+
if (installed.length > 0) {
|
|
845
|
+
console.log(" \x1B[1mInstalled agents:\x1B[0m\n");
|
|
846
|
+
for (const item of installed) {
|
|
847
|
+
const deps = item.missingDeps?.length ? ` \x1B[33m(needs: ${item.missingDeps.join(", ")})\x1B[0m` : "";
|
|
848
|
+
console.log(
|
|
849
|
+
` \x1B[32m\u2713\x1B[0m ${item.key.padEnd(18)} ${item.name.padEnd(22)} v${item.version.padEnd(10)} ${item.distribution}${deps}`
|
|
850
|
+
);
|
|
851
|
+
if (item.description) {
|
|
852
|
+
console.log(` \x1B[2m${item.description}\x1B[0m`);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
console.log("");
|
|
856
|
+
}
|
|
857
|
+
if (available.length > 0) {
|
|
858
|
+
console.log(" \x1B[1mAvailable to install:\x1B[0m\n");
|
|
859
|
+
for (const item of available) {
|
|
860
|
+
const icon = item.available ? "\x1B[2m\u2B07\x1B[0m" : "\x1B[33m\u26A0\x1B[0m";
|
|
861
|
+
const deps = item.missingDeps?.length ? ` \x1B[33m(needs: ${item.missingDeps.join(", ")})\x1B[0m` : "";
|
|
862
|
+
console.log(
|
|
863
|
+
` ${icon} ${item.key.padEnd(18)} ${item.name.padEnd(22)} v${item.version.padEnd(10)} ${item.distribution}${deps}`
|
|
864
|
+
);
|
|
865
|
+
if (item.description) {
|
|
866
|
+
console.log(` \x1B[2m${item.description}\x1B[0m`);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
console.log("");
|
|
870
|
+
}
|
|
871
|
+
console.log(
|
|
872
|
+
` \x1B[2mInstall an agent: openacp agents install <name>\x1B[0m`
|
|
873
|
+
);
|
|
874
|
+
console.log("");
|
|
875
|
+
}
|
|
876
|
+
async function agentsInstall(nameOrId, force) {
|
|
877
|
+
if (!nameOrId) {
|
|
878
|
+
console.log("\n Usage: openacp agents install <name>");
|
|
879
|
+
console.log(" Run 'openacp agents' to see available agents.\n");
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
883
|
+
const catalog = new AgentCatalog();
|
|
884
|
+
catalog.load();
|
|
885
|
+
await catalog.refreshRegistryIfStale();
|
|
886
|
+
const progress = {
|
|
887
|
+
onStart(_id, name) {
|
|
888
|
+
process.stdout.write(`
|
|
889
|
+
\u23F3 Installing ${name}...
|
|
890
|
+
`);
|
|
891
|
+
},
|
|
892
|
+
onStep(step) {
|
|
893
|
+
process.stdout.write(` \x1B[32m\u2713\x1B[0m ${step}
|
|
894
|
+
`);
|
|
895
|
+
},
|
|
896
|
+
onDownloadProgress(percent) {
|
|
897
|
+
const filled = Math.round(percent / 5);
|
|
898
|
+
const empty = 20 - filled;
|
|
899
|
+
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
900
|
+
process.stdout.write(`\r ${bar} ${String(percent).padStart(3)}%`);
|
|
901
|
+
if (percent >= 100) process.stdout.write("\n");
|
|
902
|
+
},
|
|
903
|
+
onSuccess(name) {
|
|
904
|
+
console.log(`
|
|
905
|
+
\x1B[32m\u2713 ${name} installed successfully!\x1B[0m
|
|
906
|
+
`);
|
|
907
|
+
},
|
|
908
|
+
onError(error) {
|
|
909
|
+
console.log(`
|
|
910
|
+
\x1B[31m\u2717 ${error}\x1B[0m
|
|
911
|
+
`);
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
const result = await catalog.install(nameOrId, progress, force);
|
|
915
|
+
if (!result.ok) {
|
|
916
|
+
if (result.error?.includes("not found")) {
|
|
917
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
918
|
+
const allKeys = catalog.getAvailable().map((a) => a.key);
|
|
919
|
+
const suggestion = suggestMatch(nameOrId, allKeys);
|
|
920
|
+
if (suggestion) console.log(` Did you mean: ${suggestion}?`);
|
|
921
|
+
}
|
|
922
|
+
process.exit(1);
|
|
923
|
+
}
|
|
924
|
+
const { getAgentCapabilities } = await import("./agent-dependencies-FCLRGMZM.js");
|
|
925
|
+
const caps = getAgentCapabilities(result.agentKey);
|
|
926
|
+
if (caps.integration) {
|
|
927
|
+
const { installIntegration } = await import("./integrate-X7LI6MUO.js");
|
|
928
|
+
const intResult = await installIntegration(result.agentKey, caps.integration);
|
|
929
|
+
if (intResult.success) {
|
|
930
|
+
console.log(` \x1B[32m\u2713\x1B[0m Handoff integration installed for ${result.agentKey}`);
|
|
931
|
+
} else {
|
|
932
|
+
console.log(` \x1B[33m\u26A0 Handoff integration failed: ${intResult.logs[intResult.logs.length - 1] ?? "unknown error"}\x1B[0m`);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
if (result.setupSteps?.length) {
|
|
936
|
+
console.log(" \x1B[1mNext steps to get started:\x1B[0m\n");
|
|
937
|
+
for (const step of result.setupSteps) {
|
|
938
|
+
console.log(` \u2192 ${step}`);
|
|
939
|
+
}
|
|
940
|
+
console.log(`
|
|
941
|
+
\x1B[2mRun 'openacp agents info ${result.agentKey}' for more details.\x1B[0m
|
|
942
|
+
`);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
async function agentsUninstall(name) {
|
|
946
|
+
if (!name) {
|
|
947
|
+
console.log("\n Usage: openacp agents uninstall <name>\n");
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
951
|
+
const catalog = new AgentCatalog();
|
|
952
|
+
catalog.load();
|
|
953
|
+
const result = await catalog.uninstall(name);
|
|
954
|
+
if (result.ok) {
|
|
955
|
+
const { getAgentCapabilities } = await import("./agent-dependencies-FCLRGMZM.js");
|
|
956
|
+
const caps = getAgentCapabilities(name);
|
|
957
|
+
if (caps.integration) {
|
|
958
|
+
const { uninstallIntegration } = await import("./integrate-X7LI6MUO.js");
|
|
959
|
+
await uninstallIntegration(name, caps.integration);
|
|
960
|
+
console.log(` \x1B[32m\u2713\x1B[0m Handoff integration removed for ${name}`);
|
|
961
|
+
}
|
|
962
|
+
console.log(`
|
|
963
|
+
\x1B[32m\u2713 ${name} removed.\x1B[0m
|
|
964
|
+
`);
|
|
965
|
+
} else {
|
|
966
|
+
console.log(`
|
|
967
|
+
\x1B[31m\u2717 ${result.error}\x1B[0m`);
|
|
968
|
+
if (result.error?.includes("not installed")) {
|
|
969
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
970
|
+
const installedKeys = Object.keys(catalog.getInstalledEntries());
|
|
971
|
+
const suggestion = suggestMatch(name, installedKeys);
|
|
972
|
+
if (suggestion) console.log(` Did you mean: ${suggestion}?`);
|
|
973
|
+
}
|
|
974
|
+
console.log();
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
async function agentsRefresh() {
|
|
978
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
979
|
+
const catalog = new AgentCatalog();
|
|
980
|
+
catalog.load();
|
|
981
|
+
console.log("\n Updating agent list...");
|
|
982
|
+
await catalog.fetchRegistry();
|
|
983
|
+
console.log(" \x1B[32m\u2713 Agent list updated.\x1B[0m\n");
|
|
984
|
+
}
|
|
985
|
+
async function agentsInfo(nameOrId) {
|
|
986
|
+
if (!nameOrId) {
|
|
987
|
+
console.log("\n Usage: openacp agents info <name>\n");
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
991
|
+
const catalog = new AgentCatalog();
|
|
992
|
+
catalog.load();
|
|
993
|
+
const { getAgentSetup } = await import("./agent-dependencies-FCLRGMZM.js");
|
|
994
|
+
const installed = catalog.getInstalledAgent(nameOrId);
|
|
995
|
+
if (installed) {
|
|
996
|
+
console.log(`
|
|
997
|
+
\x1B[1m${installed.name}\x1B[0m`);
|
|
998
|
+
console.log(` Version: ${installed.version}`);
|
|
999
|
+
console.log(` Type: ${installed.distribution}`);
|
|
1000
|
+
console.log(` Command: ${installed.command} ${installed.args.join(" ")}`);
|
|
1001
|
+
console.log(` Installed: ${new Date(installed.installedAt).toLocaleDateString()}`);
|
|
1002
|
+
if (installed.binaryPath) console.log(` Binary path: ${installed.binaryPath}`);
|
|
1003
|
+
const setup = installed.registryId ? getAgentSetup(installed.registryId) : void 0;
|
|
1004
|
+
if (setup) {
|
|
1005
|
+
console.log(`
|
|
1006
|
+
\x1B[1mSetup:\x1B[0m`);
|
|
1007
|
+
for (const step of setup.setupSteps) {
|
|
1008
|
+
console.log(` \u2192 ${step}`);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
console.log(`
|
|
1012
|
+
Run agent CLI: openacp agents run ${nameOrId} -- <args>`);
|
|
1013
|
+
console.log("");
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
const regAgent = catalog.findRegistryAgent(nameOrId);
|
|
1017
|
+
if (regAgent) {
|
|
1018
|
+
const availability = catalog.checkAvailability(nameOrId);
|
|
1019
|
+
console.log(`
|
|
1020
|
+
\x1B[1m${regAgent.name}\x1B[0m \x1B[2m(not installed)\x1B[0m`);
|
|
1021
|
+
console.log(` ${regAgent.description}`);
|
|
1022
|
+
console.log(` Version: ${regAgent.version}`);
|
|
1023
|
+
console.log(` License: ${regAgent.license ?? "unknown"}`);
|
|
1024
|
+
if (regAgent.website) console.log(` Website: ${regAgent.website}`);
|
|
1025
|
+
if (regAgent.repository) console.log(` Source: ${regAgent.repository}`);
|
|
1026
|
+
console.log(` Available: ${availability.available ? "\x1B[32mYes\x1B[0m" : `\x1B[33mNo\x1B[0m \u2014 ${availability.reason}`}`);
|
|
1027
|
+
const setup = getAgentSetup(regAgent.id);
|
|
1028
|
+
if (setup) {
|
|
1029
|
+
console.log(`
|
|
1030
|
+
\x1B[1mSetup after install:\x1B[0m`);
|
|
1031
|
+
for (const step of setup.setupSteps) {
|
|
1032
|
+
console.log(` \u2192 ${step}`);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
console.log(`
|
|
1036
|
+
Install: openacp agents install ${nameOrId}
|
|
1037
|
+
`);
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
1041
|
+
const allKeys = catalog.getAvailable().map((a) => a.key);
|
|
1042
|
+
const suggestion = suggestMatch(nameOrId, allKeys);
|
|
1043
|
+
console.log(`
|
|
1044
|
+
\x1B[31m"${nameOrId}" not found.\x1B[0m`);
|
|
1045
|
+
if (suggestion) console.log(` Did you mean: ${suggestion}?`);
|
|
1046
|
+
console.log(` Run 'openacp agents' to see available agents.
|
|
1047
|
+
`);
|
|
1048
|
+
}
|
|
1049
|
+
async function agentsRun(nameOrId, extraArgs) {
|
|
1050
|
+
if (!nameOrId) {
|
|
1051
|
+
console.log("\n Usage: openacp agents run <name> [-- <args>]");
|
|
1052
|
+
console.log(" Run the agent's CLI directly (e.g., for login or config).\n");
|
|
1053
|
+
console.log(" Examples:");
|
|
1054
|
+
console.log(" openacp agents run gemini -- auth login");
|
|
1055
|
+
console.log(" openacp agents run copilot -- auth login");
|
|
1056
|
+
console.log(" openacp agents run claude -- login\n");
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
const { AgentCatalog } = await import("./agent-catalog-LAAVBVLY.js");
|
|
1060
|
+
const catalog = new AgentCatalog();
|
|
1061
|
+
catalog.load();
|
|
1062
|
+
const installed = catalog.getInstalledAgent(nameOrId);
|
|
1063
|
+
if (!installed) {
|
|
1064
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
1065
|
+
const installedKeys = Object.keys(catalog.getInstalledEntries());
|
|
1066
|
+
const suggestion = suggestMatch(nameOrId, installedKeys);
|
|
1067
|
+
console.log(`
|
|
1068
|
+
\x1B[31m"${nameOrId}" is not installed.\x1B[0m`);
|
|
1069
|
+
if (suggestion) {
|
|
1070
|
+
console.log(` Did you mean: ${suggestion}?`);
|
|
1071
|
+
console.log(` Install first: openacp agents install ${suggestion}
|
|
1072
|
+
`);
|
|
1073
|
+
} else {
|
|
1074
|
+
console.log(` Install first: openacp agents install ${nameOrId}
|
|
1075
|
+
`);
|
|
1076
|
+
}
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
const userArgs = extraArgs[0] === "--" ? extraArgs.slice(1) : extraArgs;
|
|
1080
|
+
const { spawnSync } = await import("child_process");
|
|
1081
|
+
const command2 = installed.command;
|
|
1082
|
+
const acpFlags = /* @__PURE__ */ new Set(["--acp", "acp", "--acp=true", "--experimental-skills"]);
|
|
1083
|
+
const baseArgs = [];
|
|
1084
|
+
for (let i = 0; i < installed.args.length; i++) {
|
|
1085
|
+
const arg = installed.args[i];
|
|
1086
|
+
if (acpFlags.has(arg)) continue;
|
|
1087
|
+
if (arg === "--output-format" && installed.args[i + 1] === "acp") {
|
|
1088
|
+
i++;
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1091
|
+
if (arg === "exec" && installed.args[i + 1] === "--output-format") continue;
|
|
1092
|
+
baseArgs.push(arg);
|
|
1093
|
+
}
|
|
1094
|
+
const fullArgs = [...baseArgs, ...userArgs];
|
|
1095
|
+
console.log(`
|
|
1096
|
+
Running: ${command2} ${fullArgs.join(" ")}
|
|
1097
|
+
`);
|
|
1098
|
+
const result = spawnSync(command2, fullArgs, {
|
|
1099
|
+
stdio: "inherit",
|
|
1100
|
+
env: { ...process.env, ...installed.env },
|
|
1101
|
+
cwd: process.cwd()
|
|
1102
|
+
});
|
|
1103
|
+
if (result.status !== null && result.status !== 0) {
|
|
1104
|
+
process.exit(result.status);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
752
1107
|
async function cmdDefault(command2) {
|
|
753
1108
|
const forceForeground = command2 === "--foreground";
|
|
754
1109
|
if (command2 && !command2.startsWith("-")) {
|
|
1110
|
+
const { suggestMatch } = await import("./suggest-RST5VOHB.js");
|
|
1111
|
+
const topLevelCommands = [
|
|
1112
|
+
"start",
|
|
1113
|
+
"stop",
|
|
1114
|
+
"status",
|
|
1115
|
+
"logs",
|
|
1116
|
+
"config",
|
|
1117
|
+
"reset",
|
|
1118
|
+
"update",
|
|
1119
|
+
"install",
|
|
1120
|
+
"uninstall",
|
|
1121
|
+
"plugins",
|
|
1122
|
+
"api",
|
|
1123
|
+
"adopt",
|
|
1124
|
+
"integrate",
|
|
1125
|
+
"doctor",
|
|
1126
|
+
"agents"
|
|
1127
|
+
];
|
|
1128
|
+
const suggestion = suggestMatch(command2, topLevelCommands);
|
|
755
1129
|
console.error(`Unknown command: ${command2}`);
|
|
1130
|
+
if (suggestion) console.error(`Did you mean: ${suggestion}?`);
|
|
756
1131
|
printHelp();
|
|
757
1132
|
process.exit(1);
|
|
758
1133
|
}
|
|
759
1134
|
await checkAndPromptUpdate();
|
|
760
|
-
const { ConfigManager } = await import("./config-
|
|
1135
|
+
const { ConfigManager } = await import("./config-PCPIBPUA.js");
|
|
761
1136
|
const cm = new ConfigManager();
|
|
762
1137
|
if (!await cm.exists()) {
|
|
763
|
-
const { runSetup } = await import("./setup-
|
|
1138
|
+
const { runSetup } = await import("./setup-3A3XDGCM.js");
|
|
764
1139
|
const shouldStart = await runSetup(cm);
|
|
765
1140
|
if (!shouldStart) process.exit(0);
|
|
766
1141
|
}
|
|
767
1142
|
await cm.load();
|
|
768
1143
|
const config = cm.get();
|
|
769
1144
|
if (!forceForeground && config.runMode === "daemon") {
|
|
770
|
-
const { startDaemon, getPidPath } = await import("./daemon-
|
|
1145
|
+
const { startDaemon, getPidPath } = await import("./daemon-JZLFRUW6.js");
|
|
771
1146
|
const result = startDaemon(getPidPath(), config.logging.logDir);
|
|
772
1147
|
if ("error" in result) {
|
|
773
1148
|
console.error(result.error);
|
|
@@ -776,9 +1151,9 @@ async function cmdDefault(command2) {
|
|
|
776
1151
|
console.log(`OpenACP daemon started (PID ${result.pid})`);
|
|
777
1152
|
return;
|
|
778
1153
|
}
|
|
779
|
-
const { markRunning } = await import("./daemon-
|
|
1154
|
+
const { markRunning } = await import("./daemon-JZLFRUW6.js");
|
|
780
1155
|
markRunning();
|
|
781
|
-
const { startServer } = await import("./main-
|
|
1156
|
+
const { startServer } = await import("./main-DSQBCJHR.js");
|
|
782
1157
|
await startServer();
|
|
783
1158
|
}
|
|
784
1159
|
|
|
@@ -805,8 +1180,9 @@ var commands = {
|
|
|
805
1180
|
"adopt": () => cmdAdopt(args),
|
|
806
1181
|
"integrate": () => cmdIntegrate(args),
|
|
807
1182
|
"doctor": () => cmdDoctor(args),
|
|
1183
|
+
"agents": () => cmdAgents(args),
|
|
808
1184
|
"--daemon-child": async () => {
|
|
809
|
-
const { startServer } = await import("./main-
|
|
1185
|
+
const { startServer } = await import("./main-DSQBCJHR.js");
|
|
810
1186
|
await startServer();
|
|
811
1187
|
}
|
|
812
1188
|
};
|