@ken-jo/agent-connector 0.4.91 → 0.4.92
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 +301 -560
- package/dist/{action-L44DXFHT.js → action-CVIEPX4U.js} +14 -14
- package/dist/{amazon-q-B52EY2SV.js → amazon-q-TIT7FIW3.js} +5 -5
- package/dist/{amp-UXABVUKC.js → amp-NF3OAAUG.js} +5 -5
- package/dist/{antigravity-RZHN53VB.js → antigravity-7LPK7QOY.js} +6 -6
- package/dist/{antigravity-cli-JO6GUTV7.js → antigravity-cli-MDEMPPAH.js} +47 -16
- package/dist/antigravity-cli-MDEMPPAH.js.map +1 -0
- package/dist/{chunk-QKLJU4JX.js → chunk-2Y2MZRLP.js} +56 -2
- package/dist/chunk-2Y2MZRLP.js.map +1 -0
- package/dist/{chunk-UBB7T54N.js → chunk-3C5AASHM.js} +3 -3
- package/dist/{chunk-BLTVZACS.js → chunk-447JWFZO.js} +9 -9
- package/dist/{chunk-HORHRHNG.js → chunk-4NHXLXSD.js} +2 -2
- package/dist/chunk-5Z36KVU2.js +590 -0
- package/dist/chunk-5Z36KVU2.js.map +1 -0
- package/dist/{chunk-AY3RGRTT.js → chunk-6TF7MHG5.js} +2 -2
- package/dist/{chunk-R6LML2YS.js → chunk-7UT6OB52.js} +2 -2
- package/dist/{chunk-G4CEELKO.js → chunk-AY3VFNOH.js} +5 -5
- package/dist/{chunk-4HVQ7IUM.js → chunk-DI5S6TXJ.js} +17 -4
- package/dist/chunk-DI5S6TXJ.js.map +1 -0
- package/dist/{chunk-LAIITCMW.js → chunk-FBCBHEGB.js} +5 -5
- package/dist/{chunk-4NSU3KWX.js → chunk-FJCUKXGX.js} +2 -2
- package/dist/{chunk-ZMLVR4J7.js → chunk-FO5CEXXN.js} +2 -2
- package/dist/{chunk-IXOQDZWC.js → chunk-GZGLCCEE.js} +5 -1
- package/dist/chunk-GZGLCCEE.js.map +1 -0
- package/dist/{chunk-LF76VPGQ.js → chunk-IBLYVAWH.js} +28 -6
- package/dist/chunk-IBLYVAWH.js.map +1 -0
- package/dist/{chunk-4FWETID5.js → chunk-IVAWP6HH.js} +2 -2
- package/dist/{chunk-NBUEL74R.js → chunk-JFXL4HYA.js} +3 -3
- package/dist/{chunk-KIRCPLM4.js → chunk-JO2IM2JL.js} +538 -226
- package/dist/chunk-JO2IM2JL.js.map +1 -0
- package/dist/{chunk-NWLRJNXM.js → chunk-JVO6NBTT.js} +3 -3
- package/dist/{chunk-25CPWJA7.js → chunk-KA55FISM.js} +43 -43
- package/dist/{chunk-QARPXSIV.js → chunk-L26PSQTY.js} +4 -4
- package/dist/{chunk-YYNXIUR2.js → chunk-M2H7JURF.js} +2 -2
- package/dist/{chunk-56R2ER7K.js → chunk-NBYKLUF6.js} +2 -2
- package/dist/{chunk-VVFDU4IX.js → chunk-WFEHWTLM.js} +12 -5
- package/dist/{chunk-VVFDU4IX.js.map → chunk-WFEHWTLM.js.map} +1 -1
- package/dist/{chunk-LN76OGNR.js → chunk-Z2MRSS2I.js} +2 -2
- package/dist/{claude-code-WS4NAGZT.js → claude-code-7RS4YVGZ.js} +9 -9
- package/dist/cli/sdk.js +7 -7
- package/dist/cli.js +1 -1
- package/dist/{cline-NNMVCECA.js → cline-BZQAUYPC.js} +5 -5
- package/dist/{codebuddy-RBEZGXBG.js → codebuddy-G42IKGKB.js} +5 -5
- package/dist/{codebuff-RJIDSEU3.js → codebuff-5RLTLZAU.js} +5 -5
- package/dist/{codex-ZZ434GYR.js → codex-XHAMJILX.js} +11 -5
- package/dist/{codex-ZZ434GYR.js.map → codex-XHAMJILX.js.map} +1 -1
- package/dist/{continue-MNM7YVJY.js → continue-JLIB7R7X.js} +6 -6
- package/dist/{copilot-cli-SMTX5F65.js → copilot-cli-XZSUYNQZ.js} +5 -5
- package/dist/{crush-NYDBHIJE.js → crush-ESERLVLT.js} +5 -5
- package/dist/{cursor-AOELDNZU.js → cursor-FUDOV5VK.js} +6 -6
- package/dist/{detect-3S46RUMK.js → detect-Z5BDTY6B.js} +4 -4
- package/dist/{devin-PRJY2TTD.js → devin-Y7PWKVHY.js} +5 -5
- package/dist/{doctor-3CUBPQKU.js → doctor-GAP27PP2.js} +25 -21
- package/dist/doctor-GAP27PP2.js.map +1 -0
- package/dist/{droid-PTCH2K7Y.js → droid-DTO5POTK.js} +5 -5
- package/dist/{gemini-cli-QGLN2UMS.js → gemini-cli-RBIG6U2F.js} +5 -5
- package/dist/{goose-DQ6GSZ5O.js → goose-VGNOP5J2.js} +6 -6
- package/dist/{grok-cli-5QD235UB.js → grok-cli-2RFBK6J3.js} +5 -5
- package/dist/{hermes-E47IG63A.js → hermes-NUKFWZI5.js} +6 -6
- package/dist/{hook-P6EKDINW.js → hook-XPR3AHDI.js} +14 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/install-O32TDIZP.js +382 -0
- package/dist/install-O32TDIZP.js.map +1 -0
- package/dist/{introspect-DYOIX8Ov.d.ts → introspect-BkId4LGP.d.ts} +1 -1
- package/dist/{jetbrains-copilot-T2EPKROP.js → jetbrains-copilot-FXZ5AOTS.js} +23 -7
- package/dist/jetbrains-copilot-FXZ5AOTS.js.map +1 -0
- package/dist/{junie-SQ4SDLGK.js → junie-TSXIZSCE.js} +5 -5
- package/dist/{kilo-OU2ZLZKB.js → kilo-JLH3KVZJ.js} +5 -5
- package/dist/{kilo-cli-NMWGYF4F.js → kilo-cli-5W36VJQZ.js} +5 -5
- package/dist/{kimi-Z7L2LEEI.js → kimi-R62W7HKZ.js} +5 -5
- package/dist/{kiro-4IN5IH46.js → kiro-AUJMGIBL.js} +5 -5
- package/dist/{leaderboard-LF5SP6X2.js → leaderboard-YWMOSJBC.js} +5 -5
- package/dist/{mimo-code-G2CBZ4M6.js → mimo-code-PGLFFVER.js} +5 -5
- package/dist/{mistral-vibe-TRQDHAWV.js → mistral-vibe-36CZVQNQ.js} +5 -5
- package/dist/{mux-JNM3F2NW.js → mux-HWL4N5KH.js} +5 -5
- package/dist/{nemoclaw-SHA4IUML.js → nemoclaw-QPHETUXM.js} +6 -6
- package/dist/{omp-OOVUNXME.js → omp-3TFMTJ5U.js} +5 -5
- package/dist/{open-interpreter-4PKL56AA.js → open-interpreter-UTBKE2EH.js} +5 -5
- package/dist/openclaw-RYFO5TLY.js +17 -0
- package/dist/{opencode-W2RK4M7G.js → opencode-JX7GBE5Q.js} +5 -5
- package/dist/{openhands-5LNH3BKB.js → openhands-AZW4PXJ3.js} +5 -5
- package/dist/{package-2EAIYSJ4.js → package-2KKUGZFS.js} +12 -12
- package/dist/{pi-BUADR5MJ.js → pi-MRI3EBWU.js} +5 -5
- package/dist/{qwen-code-TUJNHKNI.js → qwen-code-ISR6BEET.js} +6 -6
- package/dist/{roo-code-L5F7S6QH.js → roo-code-6TSCME4R.js} +5 -5
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +12 -12
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +6 -6
- package/dist/sdk/test.d.ts +2 -2
- package/dist/sdk/test.js +10 -10
- package/dist/{serve-K62FW3V7.js → serve-EPRN7F2X.js} +14 -14
- package/dist/{status-E5MCFZM6.js → status-B2PG6YKR.js} +10 -10
- package/dist/{statusline-LIPF2KVP.js → statusline-5ERFMYSM.js} +13 -13
- package/dist/{telemetry-4OC56NTM.js → telemetry-ZMCAWBWB.js} +10 -10
- package/dist/{trae-Z7CQ2A2Q.js → trae-7KDCYIMN.js} +5 -5
- package/dist/{types-C4qMgbJn.d.ts → types-D0RqWxT8.d.ts} +43 -0
- package/dist/{uninstall-2YYKN5DX.js → uninstall-M76BHLTH.js} +35 -25
- package/dist/uninstall-M76BHLTH.js.map +1 -0
- package/dist/{upgrade-55AFPJEF.js → upgrade-JLSCNAQA.js} +23 -17
- package/dist/upgrade-JLSCNAQA.js.map +1 -0
- package/dist/{usage-3PB3WZSL.js → usage-5I72HWCR.js} +2 -2
- package/dist/{usage-event-KD5FW6W4.js → usage-event-HIX4ZI45.js} +13 -13
- package/dist/{vscode-copilot-LU5NC4ZS.js → vscode-copilot-LILHAPJI.js} +20 -5
- package/dist/vscode-copilot-LILHAPJI.js.map +1 -0
- package/dist/{warp-4PPG5LOM.js → warp-KJUCWEA3.js} +5 -5
- package/dist/{windsurf-3T3RVXKM.js → windsurf-5TGGQR5I.js} +5 -5
- package/dist/{zed-ZF2OQ75O.js → zed-EL3JCZ25.js} +5 -5
- package/package.json +1 -1
- package/dist/antigravity-cli-JO6GUTV7.js.map +0 -1
- package/dist/chunk-4HVQ7IUM.js.map +0 -1
- package/dist/chunk-7HUUINPB.js +0 -201
- package/dist/chunk-7HUUINPB.js.map +0 -1
- package/dist/chunk-IXOQDZWC.js.map +0 -1
- package/dist/chunk-KIRCPLM4.js.map +0 -1
- package/dist/chunk-LF76VPGQ.js.map +0 -1
- package/dist/chunk-QKLJU4JX.js.map +0 -1
- package/dist/doctor-3CUBPQKU.js.map +0 -1
- package/dist/install-7DMK53SB.js +0 -96
- package/dist/install-7DMK53SB.js.map +0 -1
- package/dist/jetbrains-copilot-T2EPKROP.js.map +0 -1
- package/dist/openclaw-BD56E5MV.js +0 -17
- package/dist/uninstall-2YYKN5DX.js.map +0 -1
- package/dist/upgrade-55AFPJEF.js.map +0 -1
- package/dist/vscode-copilot-LU5NC4ZS.js.map +0 -1
- /package/dist/{action-L44DXFHT.js.map → action-CVIEPX4U.js.map} +0 -0
- /package/dist/{amazon-q-B52EY2SV.js.map → amazon-q-TIT7FIW3.js.map} +0 -0
- /package/dist/{amp-UXABVUKC.js.map → amp-NF3OAAUG.js.map} +0 -0
- /package/dist/{antigravity-RZHN53VB.js.map → antigravity-7LPK7QOY.js.map} +0 -0
- /package/dist/{chunk-UBB7T54N.js.map → chunk-3C5AASHM.js.map} +0 -0
- /package/dist/{chunk-BLTVZACS.js.map → chunk-447JWFZO.js.map} +0 -0
- /package/dist/{chunk-HORHRHNG.js.map → chunk-4NHXLXSD.js.map} +0 -0
- /package/dist/{chunk-AY3RGRTT.js.map → chunk-6TF7MHG5.js.map} +0 -0
- /package/dist/{chunk-R6LML2YS.js.map → chunk-7UT6OB52.js.map} +0 -0
- /package/dist/{chunk-G4CEELKO.js.map → chunk-AY3VFNOH.js.map} +0 -0
- /package/dist/{chunk-LAIITCMW.js.map → chunk-FBCBHEGB.js.map} +0 -0
- /package/dist/{chunk-4NSU3KWX.js.map → chunk-FJCUKXGX.js.map} +0 -0
- /package/dist/{chunk-ZMLVR4J7.js.map → chunk-FO5CEXXN.js.map} +0 -0
- /package/dist/{chunk-4FWETID5.js.map → chunk-IVAWP6HH.js.map} +0 -0
- /package/dist/{chunk-NBUEL74R.js.map → chunk-JFXL4HYA.js.map} +0 -0
- /package/dist/{chunk-NWLRJNXM.js.map → chunk-JVO6NBTT.js.map} +0 -0
- /package/dist/{chunk-25CPWJA7.js.map → chunk-KA55FISM.js.map} +0 -0
- /package/dist/{chunk-QARPXSIV.js.map → chunk-L26PSQTY.js.map} +0 -0
- /package/dist/{chunk-YYNXIUR2.js.map → chunk-M2H7JURF.js.map} +0 -0
- /package/dist/{chunk-56R2ER7K.js.map → chunk-NBYKLUF6.js.map} +0 -0
- /package/dist/{chunk-LN76OGNR.js.map → chunk-Z2MRSS2I.js.map} +0 -0
- /package/dist/{claude-code-WS4NAGZT.js.map → claude-code-7RS4YVGZ.js.map} +0 -0
- /package/dist/{cline-NNMVCECA.js.map → cline-BZQAUYPC.js.map} +0 -0
- /package/dist/{codebuddy-RBEZGXBG.js.map → codebuddy-G42IKGKB.js.map} +0 -0
- /package/dist/{codebuff-RJIDSEU3.js.map → codebuff-5RLTLZAU.js.map} +0 -0
- /package/dist/{continue-MNM7YVJY.js.map → continue-JLIB7R7X.js.map} +0 -0
- /package/dist/{copilot-cli-SMTX5F65.js.map → copilot-cli-XZSUYNQZ.js.map} +0 -0
- /package/dist/{crush-NYDBHIJE.js.map → crush-ESERLVLT.js.map} +0 -0
- /package/dist/{cursor-AOELDNZU.js.map → cursor-FUDOV5VK.js.map} +0 -0
- /package/dist/{detect-3S46RUMK.js.map → detect-Z5BDTY6B.js.map} +0 -0
- /package/dist/{devin-PRJY2TTD.js.map → devin-Y7PWKVHY.js.map} +0 -0
- /package/dist/{droid-PTCH2K7Y.js.map → droid-DTO5POTK.js.map} +0 -0
- /package/dist/{gemini-cli-QGLN2UMS.js.map → gemini-cli-RBIG6U2F.js.map} +0 -0
- /package/dist/{goose-DQ6GSZ5O.js.map → goose-VGNOP5J2.js.map} +0 -0
- /package/dist/{grok-cli-5QD235UB.js.map → grok-cli-2RFBK6J3.js.map} +0 -0
- /package/dist/{hermes-E47IG63A.js.map → hermes-NUKFWZI5.js.map} +0 -0
- /package/dist/{hook-P6EKDINW.js.map → hook-XPR3AHDI.js.map} +0 -0
- /package/dist/{junie-SQ4SDLGK.js.map → junie-TSXIZSCE.js.map} +0 -0
- /package/dist/{kilo-OU2ZLZKB.js.map → kilo-JLH3KVZJ.js.map} +0 -0
- /package/dist/{kilo-cli-NMWGYF4F.js.map → kilo-cli-5W36VJQZ.js.map} +0 -0
- /package/dist/{kimi-Z7L2LEEI.js.map → kimi-R62W7HKZ.js.map} +0 -0
- /package/dist/{kiro-4IN5IH46.js.map → kiro-AUJMGIBL.js.map} +0 -0
- /package/dist/{leaderboard-LF5SP6X2.js.map → leaderboard-YWMOSJBC.js.map} +0 -0
- /package/dist/{mimo-code-G2CBZ4M6.js.map → mimo-code-PGLFFVER.js.map} +0 -0
- /package/dist/{mistral-vibe-TRQDHAWV.js.map → mistral-vibe-36CZVQNQ.js.map} +0 -0
- /package/dist/{mux-JNM3F2NW.js.map → mux-HWL4N5KH.js.map} +0 -0
- /package/dist/{nemoclaw-SHA4IUML.js.map → nemoclaw-QPHETUXM.js.map} +0 -0
- /package/dist/{omp-OOVUNXME.js.map → omp-3TFMTJ5U.js.map} +0 -0
- /package/dist/{open-interpreter-4PKL56AA.js.map → open-interpreter-UTBKE2EH.js.map} +0 -0
- /package/dist/{openclaw-BD56E5MV.js.map → openclaw-RYFO5TLY.js.map} +0 -0
- /package/dist/{opencode-W2RK4M7G.js.map → opencode-JX7GBE5Q.js.map} +0 -0
- /package/dist/{openhands-5LNH3BKB.js.map → openhands-AZW4PXJ3.js.map} +0 -0
- /package/dist/{package-2EAIYSJ4.js.map → package-2KKUGZFS.js.map} +0 -0
- /package/dist/{pi-BUADR5MJ.js.map → pi-MRI3EBWU.js.map} +0 -0
- /package/dist/{qwen-code-TUJNHKNI.js.map → qwen-code-ISR6BEET.js.map} +0 -0
- /package/dist/{roo-code-L5F7S6QH.js.map → roo-code-6TSCME4R.js.map} +0 -0
- /package/dist/{serve-K62FW3V7.js.map → serve-EPRN7F2X.js.map} +0 -0
- /package/dist/{status-E5MCFZM6.js.map → status-B2PG6YKR.js.map} +0 -0
- /package/dist/{statusline-LIPF2KVP.js.map → statusline-5ERFMYSM.js.map} +0 -0
- /package/dist/{telemetry-4OC56NTM.js.map → telemetry-ZMCAWBWB.js.map} +0 -0
- /package/dist/{trae-Z7CQ2A2Q.js.map → trae-7KDCYIMN.js.map} +0 -0
- /package/dist/{usage-3PB3WZSL.js.map → usage-5I72HWCR.js.map} +0 -0
- /package/dist/{usage-event-KD5FW6W4.js.map → usage-event-HIX4ZI45.js.map} +0 -0
- /package/dist/{warp-4PPG5LOM.js.map → warp-KJUCWEA3.js.map} +0 -0
- /package/dist/{windsurf-3T3RVXKM.js.map → windsurf-5TGGQR5I.js.map} +0 -0
- /package/dist/{zed-ZF2OQ75O.js.map → zed-EL3JCZ25.js.map} +0 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/cli/app.ts
|
|
4
|
+
import { createRequire } from "module";
|
|
5
|
+
import { homedir } from "os";
|
|
6
|
+
|
|
7
|
+
// src/cli/banner.ts
|
|
8
|
+
var PALETTES = [
|
|
9
|
+
[[255, 210, 0], [255, 110, 10], [220, 30, 25]],
|
|
10
|
+
// Sunset
|
|
11
|
+
[[255, 225, 90], [255, 120, 0], [200, 20, 20]],
|
|
12
|
+
// Lava
|
|
13
|
+
[[230, 30, 30], [255, 120, 0], [255, 220, 0]],
|
|
14
|
+
// Fire
|
|
15
|
+
[[255, 225, 120], [255, 170, 40], [225, 110, 20]],
|
|
16
|
+
// Amber gold
|
|
17
|
+
[[255, 205, 150], [255, 150, 130], [255, 120, 175]],
|
|
18
|
+
// Peach pastel
|
|
19
|
+
[[255, 80, 170], [200, 40, 200], [100, 60, 210]],
|
|
20
|
+
// Berry
|
|
21
|
+
[[0, 220, 180], [0, 160, 230], [60, 90, 230]],
|
|
22
|
+
// Ocean
|
|
23
|
+
[[80, 230, 140], [0, 200, 210], [150, 90, 235]],
|
|
24
|
+
// Aurora
|
|
25
|
+
[[170, 230, 90], [60, 200, 120], [20, 150, 140]],
|
|
26
|
+
// Forest
|
|
27
|
+
[[0, 200, 200], [40, 80, 230], [200, 40, 200]]
|
|
28
|
+
// Synthwave
|
|
29
|
+
];
|
|
30
|
+
function shouldShowBanner(gate) {
|
|
31
|
+
return gate.isTTY && !gate.json && !gate.quiet;
|
|
32
|
+
}
|
|
33
|
+
function resolveColorMode(env) {
|
|
34
|
+
if (env.noColor) return "none";
|
|
35
|
+
const term = (env.term ?? "").toLowerCase();
|
|
36
|
+
if (term === "" || term === "dumb") return "none";
|
|
37
|
+
const colorterm = (env.colorterm ?? "").toLowerCase();
|
|
38
|
+
if (colorterm === "truecolor" || colorterm === "24bit") return "truecolor";
|
|
39
|
+
if (term.includes("256")) return "ansi256";
|
|
40
|
+
return "ansi16";
|
|
41
|
+
}
|
|
42
|
+
var WIDE_FONT = {
|
|
43
|
+
A: [" \u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
44
|
+
B: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
45
|
+
C: [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D", "\u2588\u2588\u2551 ", "\u2588\u2588\u2551 ", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
46
|
+
D: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
47
|
+
E: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D", "\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u255D ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
48
|
+
F: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D", "\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u255D ", "\u2588\u2588\u2551 ", "\u255A\u2550\u255D "],
|
|
49
|
+
G: [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D ", "\u2588\u2588\u2551 \u2588\u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
50
|
+
H: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
51
|
+
I: ["\u2588\u2588\u2557", "\u2588\u2588\u2551", "\u2588\u2588\u2551", "\u2588\u2588\u2551", "\u2588\u2588\u2551", "\u255A\u2550\u255D"],
|
|
52
|
+
J: [" \u2588\u2588\u2557", " \u2588\u2588\u2551", " \u2588\u2588\u2551", "\u2588\u2588 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u255D "],
|
|
53
|
+
K: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2554\u255D", "\u2588\u2588\u2588\u2588\u2588\u2554\u255D ", "\u2588\u2588\u2554\u2550\u2588\u2588\u2557 ", "\u2588\u2588\u2551 \u2588\u2588\u2557", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
54
|
+
L: ["\u2588\u2588\u2557 ", "\u2588\u2588\u2551 ", "\u2588\u2588\u2551 ", "\u2588\u2588\u2551 ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
55
|
+
M: ["\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551", "\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551", "\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551", "\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
56
|
+
N: ["\u2588\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551", "\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551", "\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551", "\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551", "\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D"],
|
|
57
|
+
O: [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
58
|
+
P: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u2588\u2588\u2554\u2550\u2550\u2550\u255D ", "\u2588\u2588\u2551 ", "\u255A\u2550\u255D "],
|
|
59
|
+
Q: [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2580\u2580\u2550\u255D "],
|
|
60
|
+
R: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
61
|
+
S: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
62
|
+
T: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D", " \u2588\u2588\u2551 ", " \u2588\u2588\u2551 ", " \u2588\u2588\u2551 ", " \u255A\u2550\u255D "],
|
|
63
|
+
U: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
64
|
+
V: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D", " \u255A\u2588\u2588\u2588\u2588\u2554\u255D ", " \u255A\u2550\u2550\u2550\u255D "],
|
|
65
|
+
W: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551", "\u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D "],
|
|
66
|
+
X: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u255A\u2588\u2588\u2557\u2588\u2588\u2554\u255D", " \u255A\u2588\u2588\u2588\u2554\u255D ", " \u2588\u2588\u2554\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u255D \u2588\u2588\u2557", "\u255A\u2550\u255D \u255A\u2550\u255D"],
|
|
67
|
+
Y: ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D", " \u255A\u2588\u2588\u2588\u2588\u2554\u255D ", " \u255A\u2588\u2588\u2554\u255D ", " \u2588\u2588\u2551 ", " \u255A\u2550\u255D "],
|
|
68
|
+
Z: ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2588\u2588\u2588\u2554\u255D", " \u2588\u2588\u2588\u2554\u255D ", " \u2588\u2588\u2588\u2554\u255D ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
69
|
+
"0": [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
70
|
+
"1": [" \u2588\u2588\u2557", "\u2588\u2588\u2588\u2551", "\u255A\u2588\u2588\u2551", " \u2588\u2588\u2551", " \u2588\u2588\u2551", " \u255A\u2550\u255D"],
|
|
71
|
+
"2": ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2557", " \u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u2588\u2588\u2554\u2550\u2550\u2550\u255D ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
72
|
+
"3": ["\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2557", " \u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2588\u2588\u2557", "\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
73
|
+
"4": ["\u2588\u2588\u2557 \u2588\u2588\u2557", "\u2588\u2588\u2551 \u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551", " \u2588\u2588\u2551", " \u255A\u2550\u255D"],
|
|
74
|
+
"5": ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
75
|
+
"6": [" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u2550\u255D "],
|
|
76
|
+
"7": ["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551", " \u2588\u2588\u2554\u255D", " \u2588\u2588\u2554\u255D ", " \u2588\u2588\u2551 ", " \u255A\u2550\u255D "],
|
|
77
|
+
"8": [" \u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u255D "],
|
|
78
|
+
"9": [" \u2588\u2588\u2588\u2588\u2588\u2557 ", "\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557", "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2551", " \u255A\u2550\u2550\u2550\u2588\u2588\u2551", " \u2588\u2588\u2588\u2588\u2588\u2554\u255D", " \u255A\u2550\u2550\u2550\u2550\u255D "],
|
|
79
|
+
"-": [" ", " ", "\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u255D", " ", " "],
|
|
80
|
+
"_": [" ", " ", " ", " ", "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557", "\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"],
|
|
81
|
+
".": [" ", " ", " ", " ", "\u2588\u2588\u2557", "\u255A\u2550\u255D"],
|
|
82
|
+
" ": [" ", " ", " ", " ", " ", " "]
|
|
83
|
+
};
|
|
84
|
+
var GLYPH_ROWS = 6;
|
|
85
|
+
function vlen(s) {
|
|
86
|
+
return [...s].length;
|
|
87
|
+
}
|
|
88
|
+
function renderWithFont(name, font) {
|
|
89
|
+
const chars = [...name];
|
|
90
|
+
if (chars.length === 0) return null;
|
|
91
|
+
const blank = font[" "];
|
|
92
|
+
const rows = Array.from({ length: GLYPH_ROWS }, () => "");
|
|
93
|
+
for (const ch of chars) {
|
|
94
|
+
const glyph = font[ch.toUpperCase()] ?? blank;
|
|
95
|
+
for (let r = 0; r < GLYPH_ROWS; r++) {
|
|
96
|
+
rows[r] += glyph[r] ?? "";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
while (rows.length > 1 && rows[rows.length - 1].trim() === "") rows.pop();
|
|
100
|
+
return rows;
|
|
101
|
+
}
|
|
102
|
+
function blockWidth(rows) {
|
|
103
|
+
return rows.length === 0 ? 0 : Math.max(...rows.map(vlen));
|
|
104
|
+
}
|
|
105
|
+
function selectWideArt(name, columns) {
|
|
106
|
+
const limit = columns > 0 ? columns : Infinity;
|
|
107
|
+
const wide = renderWithFont(name, WIDE_FONT);
|
|
108
|
+
return wide != null && blockWidth(wide) <= limit ? wide : null;
|
|
109
|
+
}
|
|
110
|
+
function gradientRGB(t, palette) {
|
|
111
|
+
const clamp = Math.max(0, Math.min(1, t));
|
|
112
|
+
const seg = clamp >= 0.5 ? 1 : 0;
|
|
113
|
+
const local = (clamp - seg * 0.5) / 0.5;
|
|
114
|
+
const a = palette[seg];
|
|
115
|
+
const b = palette[seg + 1];
|
|
116
|
+
return [
|
|
117
|
+
Math.round(a[0] + (b[0] - a[0]) * local),
|
|
118
|
+
Math.round(a[1] + (b[1] - a[1]) * local),
|
|
119
|
+
Math.round(a[2] + (b[2] - a[2]) * local)
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
function rgbTo256(r, g, b) {
|
|
123
|
+
const q = (v) => v < 48 ? 0 : v < 115 ? 1 : Math.round((v - 35) / 40);
|
|
124
|
+
return 16 + 36 * q(r) + 6 * q(g) + q(b);
|
|
125
|
+
}
|
|
126
|
+
function rgbTo16(r, g, b) {
|
|
127
|
+
const hi = (v) => v >= 128 ? 1 : 0;
|
|
128
|
+
const key = hi(r) << 2 | hi(g) << 1 | hi(b);
|
|
129
|
+
return [90, 94, 92, 96, 91, 95, 93, 97][key];
|
|
130
|
+
}
|
|
131
|
+
var RESET = "\x1B[0m";
|
|
132
|
+
function colorChar(ch, t, color, palette) {
|
|
133
|
+
if (color === "none" || ch.trim() === "") return ch;
|
|
134
|
+
const [r, g, b] = gradientRGB(t, palette);
|
|
135
|
+
if (color === "truecolor") return `\x1B[38;2;${r};${g};${b}m${ch}${RESET}`;
|
|
136
|
+
if (color === "ansi256") return `\x1B[38;5;${rgbTo256(r, g, b)}m${ch}${RESET}`;
|
|
137
|
+
return `\x1B[${rgbTo16(r, g, b)}m${ch}${RESET}`;
|
|
138
|
+
}
|
|
139
|
+
function colorizeRow(row, color, palette) {
|
|
140
|
+
if (color === "none") return row;
|
|
141
|
+
const chars = [...row];
|
|
142
|
+
const width = Math.max(1, chars.length - 1);
|
|
143
|
+
let out = "";
|
|
144
|
+
for (let i = 0; i < chars.length; i++) {
|
|
145
|
+
out += colorChar(chars[i], i / width, color, palette);
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
function boldColorChar(ch, t, color, palette) {
|
|
150
|
+
if (color === "none") return ch;
|
|
151
|
+
const [r, g, b] = gradientRGB(t, palette);
|
|
152
|
+
const fg = color === "truecolor" ? `38;2;${r};${g};${b}` : color === "ansi256" ? `38;5;${rgbTo256(r, g, b)}` : `${rgbTo16(r, g, b)}`;
|
|
153
|
+
return `\x1B[1;${fg}m${ch}${RESET}`;
|
|
154
|
+
}
|
|
155
|
+
function renderTitle(name, color, palette) {
|
|
156
|
+
const upper = name.toUpperCase();
|
|
157
|
+
if (color === "none") return `\u25C6 ${upper}`;
|
|
158
|
+
const diamond = boldColorChar("\u25C6", 0.5, color, palette);
|
|
159
|
+
const chars = [...upper];
|
|
160
|
+
const span = Math.max(1, chars.length - 1);
|
|
161
|
+
let title = "";
|
|
162
|
+
for (let i = 0; i < chars.length; i++) {
|
|
163
|
+
title += boldColorChar(chars[i], i / span, color, palette);
|
|
164
|
+
}
|
|
165
|
+
return `${diamond} ${title}`;
|
|
166
|
+
}
|
|
167
|
+
var FOOTER_LINES = [
|
|
168
|
+
"powered by @ken-jo/agent-connector",
|
|
169
|
+
"more \u2192 https://github.com/ken-jo/agent-connector"
|
|
170
|
+
];
|
|
171
|
+
function dim(text, color) {
|
|
172
|
+
return color === "none" ? text : `\x1B[2m${text}${RESET}`;
|
|
173
|
+
}
|
|
174
|
+
function renderBrandBanner(name, opts) {
|
|
175
|
+
const { color, columns } = opts;
|
|
176
|
+
const palette = opts.palette ?? PALETTES[0];
|
|
177
|
+
const footer = FOOTER_LINES.map((l) => dim(l, color)).join("\n");
|
|
178
|
+
const art = selectWideArt(name, columns);
|
|
179
|
+
const body = art != null ? art.map((row) => colorizeRow(row, color, palette)).join("\n") : renderTitle(name, color, palette);
|
|
180
|
+
return `${body}
|
|
181
|
+
${footer}`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/cli/app.ts
|
|
185
|
+
function print(line) {
|
|
186
|
+
process.stdout.write(`${line}
|
|
187
|
+
`);
|
|
188
|
+
}
|
|
189
|
+
var activeProgramName = "agent-connector";
|
|
190
|
+
function fail(message, code = 2) {
|
|
191
|
+
process.stderr.write(`${activeProgramName}: ${message}
|
|
192
|
+
`);
|
|
193
|
+
return code;
|
|
194
|
+
}
|
|
195
|
+
function maybePrintBanner(flags) {
|
|
196
|
+
const isTTY = process.stdout.isTTY === true;
|
|
197
|
+
const noColor = process.env.NO_COLOR != null && process.env.NO_COLOR !== "";
|
|
198
|
+
if (!shouldShowBanner({ isTTY, noColor, json: flags.json === true, quiet: flags.quiet === true })) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const color = resolveColorMode({
|
|
202
|
+
noColor,
|
|
203
|
+
colorterm: process.env.COLORTERM,
|
|
204
|
+
term: process.env.TERM
|
|
205
|
+
});
|
|
206
|
+
const c = process.stdout.columns;
|
|
207
|
+
const columns = typeof c === "number" && c > 0 ? c : 80;
|
|
208
|
+
const palette = PALETTES[Math.floor(Math.random() * PALETTES.length)];
|
|
209
|
+
print(renderBrandBanner(activeProgramName, { color, columns, palette }));
|
|
210
|
+
print("");
|
|
211
|
+
}
|
|
212
|
+
function resolveOwnVersion() {
|
|
213
|
+
const req = createRequire(import.meta.url);
|
|
214
|
+
for (const rel of ["../package.json", "../../package.json", "../../../package.json"]) {
|
|
215
|
+
try {
|
|
216
|
+
const pkg = req(rel);
|
|
217
|
+
if (pkg.name === "@ken-jo/agent-connector" && typeof pkg.version === "string") {
|
|
218
|
+
return pkg.version;
|
|
219
|
+
}
|
|
220
|
+
} catch {
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return "0.0.0";
|
|
224
|
+
}
|
|
225
|
+
function parseScope(value) {
|
|
226
|
+
if (value === "user" || value === "project") return value;
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
function parseTargets(value) {
|
|
230
|
+
if (value == null || value.trim() === "") return void 0;
|
|
231
|
+
const ids = value.split(",").map((s) => s.trim()).filter((s) => s !== "");
|
|
232
|
+
return ids.length > 0 ? ids : void 0;
|
|
233
|
+
}
|
|
234
|
+
function buildConnectorSummary(connector) {
|
|
235
|
+
let server;
|
|
236
|
+
if (connector.server) {
|
|
237
|
+
const s = connector.server;
|
|
238
|
+
const cmd = s.transport === "stdio" ? [s.command, ...s.args ?? []].filter((p) => p != null && p !== "").map((p) => tildify(p)).join(" ") : s.url ?? "";
|
|
239
|
+
server = { transport: s.transport, command: cmd };
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
id: connector.id,
|
|
243
|
+
version: connector.version,
|
|
244
|
+
displayName: connector.displayName,
|
|
245
|
+
server,
|
|
246
|
+
hookEvents: [...connector.hookEvents],
|
|
247
|
+
telemetryEnabled: connector.telemetry.enabled,
|
|
248
|
+
commands: connector.commands.length,
|
|
249
|
+
skills: connector.skills.length,
|
|
250
|
+
subagents: connector.subagents.length,
|
|
251
|
+
memory: connector.memory.length,
|
|
252
|
+
hasStatusline: connector.statusline != null,
|
|
253
|
+
actions: connector.actions.length
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function tildify(path) {
|
|
257
|
+
const home = homedir().replace(/\\/g, "/");
|
|
258
|
+
const np = path.replace(/\\/g, "/");
|
|
259
|
+
if (home && (np === home || np.startsWith(home + "/"))) {
|
|
260
|
+
return "~" + np.slice(home.length);
|
|
261
|
+
}
|
|
262
|
+
return np;
|
|
263
|
+
}
|
|
264
|
+
function truncateCommand(cmd, max = 64) {
|
|
265
|
+
if (cmd.length <= max) return cmd;
|
|
266
|
+
return cmd.slice(0, max - 1) + "\u2026";
|
|
267
|
+
}
|
|
268
|
+
function classifySurface(c) {
|
|
269
|
+
const detail = c.detail.toLowerCase();
|
|
270
|
+
if (detail.startsWith("backed up") || detail.includes("backup")) return "backup";
|
|
271
|
+
if (/^mcp[._]?servers?\./.test(detail) || detail.startsWith("mcp.")) return "mcp";
|
|
272
|
+
if (detail.startsWith("hooks.") || detail.startsWith("hook ")) return "hooks";
|
|
273
|
+
if (detail.includes("nativehooks")) return "hooks";
|
|
274
|
+
if (detail.startsWith("memory")) return "memory";
|
|
275
|
+
if (detail.startsWith("statusline")) return "statusline";
|
|
276
|
+
if (detail.startsWith("actions") || detail.startsWith("action ")) return "actions";
|
|
277
|
+
if (detail.includes("configpatch")) return "other";
|
|
278
|
+
const p = (c.path ?? "").replace(/\\/g, "/").toLowerCase();
|
|
279
|
+
if (/\/commands?\//.test(p)) return "commands";
|
|
280
|
+
if (/\/skills?\//.test(p)) return "skills";
|
|
281
|
+
if (/\/(subagents?|agents?)\//.test(p)) return "subagents";
|
|
282
|
+
if (/\bcommands?\b/.test(detail)) return "commands";
|
|
283
|
+
if (/\bskills?\b/.test(detail)) return "skills";
|
|
284
|
+
if (/\bsubagents?\b/.test(detail)) return "subagents";
|
|
285
|
+
return "other";
|
|
286
|
+
}
|
|
287
|
+
var SURFACE_LABEL_SINGULAR = {
|
|
288
|
+
mcp: "MCP server",
|
|
289
|
+
hooks: "hook",
|
|
290
|
+
commands: "command",
|
|
291
|
+
skills: "skill",
|
|
292
|
+
subagents: "subagent",
|
|
293
|
+
memory: "memory block",
|
|
294
|
+
statusline: "status line",
|
|
295
|
+
actions: "action",
|
|
296
|
+
backup: "backup",
|
|
297
|
+
other: "change"
|
|
298
|
+
};
|
|
299
|
+
function countLabel(n, surface) {
|
|
300
|
+
const base = SURFACE_LABEL_SINGULAR[surface];
|
|
301
|
+
if (surface === "mcp") return "MCP server";
|
|
302
|
+
return n === 1 ? `1 ${base}` : `${n} ${base}s`;
|
|
303
|
+
}
|
|
304
|
+
function hostGlyph(status) {
|
|
305
|
+
return status === "warn" ? "!" : status === "skip" ? "=" : "\u2713";
|
|
306
|
+
}
|
|
307
|
+
function groupByHost(changes, verb) {
|
|
308
|
+
const order = [];
|
|
309
|
+
const byHost = /* @__PURE__ */ new Map();
|
|
310
|
+
for (const c of changes) {
|
|
311
|
+
if (!byHost.has(c.platform)) {
|
|
312
|
+
byHost.set(c.platform, []);
|
|
313
|
+
order.push(c.platform);
|
|
314
|
+
}
|
|
315
|
+
byHost.get(c.platform).push(c);
|
|
316
|
+
}
|
|
317
|
+
const groups = [];
|
|
318
|
+
for (const platform of order) {
|
|
319
|
+
const recs = byHost.get(platform);
|
|
320
|
+
const written = recs.filter((c) => c.action !== "skip" && c.action !== "warn");
|
|
321
|
+
const realChanges = written.filter((c) => classifySurface(c) !== "backup");
|
|
322
|
+
const warned = recs.filter((c) => c.action === "warn");
|
|
323
|
+
const status = warned.length > 0 ? "warn" : realChanges.length > 0 ? "ok" : "skip";
|
|
324
|
+
const SURFACE_ORDER = [
|
|
325
|
+
"mcp",
|
|
326
|
+
"hooks",
|
|
327
|
+
"commands",
|
|
328
|
+
"skills",
|
|
329
|
+
"subagents",
|
|
330
|
+
"memory",
|
|
331
|
+
"statusline",
|
|
332
|
+
"actions",
|
|
333
|
+
"backup",
|
|
334
|
+
"other"
|
|
335
|
+
];
|
|
336
|
+
const counts = /* @__PURE__ */ new Map();
|
|
337
|
+
const summarySource = realChanges.length > 0 ? written : realChanges;
|
|
338
|
+
for (const c of summarySource) {
|
|
339
|
+
const s = classifySurface(c);
|
|
340
|
+
counts.set(s, (counts.get(s) ?? 0) + 1);
|
|
341
|
+
}
|
|
342
|
+
const parts = SURFACE_ORDER.filter((s) => counts.has(s)).map(
|
|
343
|
+
(s) => countLabel(counts.get(s), s)
|
|
344
|
+
);
|
|
345
|
+
let summary;
|
|
346
|
+
if (parts.length > 0) {
|
|
347
|
+
summary = parts.join(" + ");
|
|
348
|
+
} else if (status === "warn") {
|
|
349
|
+
summary = "";
|
|
350
|
+
} else {
|
|
351
|
+
const reason = recs.find((c) => c.action === "skip")?.detail ?? (written.length > 0 ? "already current (re-backed-up only)" : "no changes");
|
|
352
|
+
summary = verb === "uninstall" ? `nothing to remove (${reason})` : `unchanged (${reason})`;
|
|
353
|
+
}
|
|
354
|
+
const paths = [
|
|
355
|
+
...new Set(
|
|
356
|
+
recs.filter((c) => c.path != null && c.path !== "").map((c) => tildify(c.path))
|
|
357
|
+
)
|
|
358
|
+
];
|
|
359
|
+
const warnings = warned.map((c) => c.detail);
|
|
360
|
+
groups.push({ platform, status, summary, paths, warnings });
|
|
361
|
+
}
|
|
362
|
+
return groups;
|
|
363
|
+
}
|
|
364
|
+
function renderInstallResult(result, verb) {
|
|
365
|
+
const lines = [];
|
|
366
|
+
const summary = result.connector;
|
|
367
|
+
if (summary) {
|
|
368
|
+
const head = [`${summary.id} v${summary.version}`];
|
|
369
|
+
if (summary.displayName && summary.displayName !== summary.id) {
|
|
370
|
+
head.push(summary.displayName);
|
|
371
|
+
}
|
|
372
|
+
lines.push(head.join(" \xB7 "));
|
|
373
|
+
if (summary.server) {
|
|
374
|
+
lines.push(
|
|
375
|
+
` server ${summary.server.transport} \xB7 ${truncateCommand(summary.server.command)}`
|
|
376
|
+
);
|
|
377
|
+
} else {
|
|
378
|
+
lines.push(" server (hooks-only)");
|
|
379
|
+
}
|
|
380
|
+
if (summary.hookEvents.length > 0) {
|
|
381
|
+
lines.push(` hooks ${summary.hookEvents.join(", ")}`);
|
|
382
|
+
}
|
|
383
|
+
lines.push(` telemetry ${summary.telemetryEnabled ? "on" : "off"}`);
|
|
384
|
+
if (summary.commands > 0)
|
|
385
|
+
lines.push(` commands ${summary.commands}`);
|
|
386
|
+
if (summary.skills > 0) lines.push(` skills ${summary.skills}`);
|
|
387
|
+
if (summary.subagents > 0)
|
|
388
|
+
lines.push(` subagents ${summary.subagents}`);
|
|
389
|
+
if (summary.memory > 0) lines.push(` memory ${summary.memory}`);
|
|
390
|
+
if (summary.hasStatusline) lines.push(` statusline 1`);
|
|
391
|
+
if (summary.actions > 0) lines.push(` actions ${summary.actions}`);
|
|
392
|
+
lines.push("");
|
|
393
|
+
} else {
|
|
394
|
+
const mode = result.dryRun ? " (dry-run \u2014 nothing written)" : "";
|
|
395
|
+
lines.push(`${verb} "${result.connectorId}"${mode}`);
|
|
396
|
+
}
|
|
397
|
+
const groups = groupByHost(result.changes, verb);
|
|
398
|
+
if (groups.length === 0) {
|
|
399
|
+
lines.push("(no changes)");
|
|
400
|
+
} else {
|
|
401
|
+
const verbed = verb === "uninstall" ? "removed from" : verb === "upgrade" ? "synced to" : "detected";
|
|
402
|
+
lines.push(`\u2192 ${groups.length} agent ${groups.length === 1 ? "CLI" : "CLIs"} ${verbed}:`);
|
|
403
|
+
const pad = Math.max(...groups.map((g) => g.platform.length));
|
|
404
|
+
for (const g of groups) {
|
|
405
|
+
const glyph = hostGlyph(g.status);
|
|
406
|
+
const name = g.platform.padEnd(pad);
|
|
407
|
+
const pathsCol = g.paths.join(", ");
|
|
408
|
+
const gap = pathsCol === "" ? "" : " ";
|
|
409
|
+
const summaryCol = pathsCol === "" ? g.summary : g.summary.padEnd(26) + gap;
|
|
410
|
+
lines.push(` ${glyph} ${name} ${summaryCol}${pathsCol}`.trimEnd());
|
|
411
|
+
for (const w of g.warnings) lines.push(` ! ${w}`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const tally = result.changes.reduce(
|
|
415
|
+
(acc, c) => {
|
|
416
|
+
const isWrite = c.action === "create" || c.action === "update" || c.action === "remove";
|
|
417
|
+
if (isWrite && classifySurface(c) !== "backup") acc.files += 1;
|
|
418
|
+
if (c.action === "warn") acc.warns += 1;
|
|
419
|
+
return acc;
|
|
420
|
+
},
|
|
421
|
+
{ files: 0, warns: 0 }
|
|
422
|
+
);
|
|
423
|
+
const cliCount = groups.length;
|
|
424
|
+
const cliWord = cliCount === 1 ? "CLI" : "CLIs";
|
|
425
|
+
const fileWord = tally.files === 1 ? "file" : "files";
|
|
426
|
+
lines.push("");
|
|
427
|
+
if (verb === "uninstall") {
|
|
428
|
+
if (result.dryRun) {
|
|
429
|
+
lines.push(`\u2713 Would remove ${summary?.id ?? result.connectorId} from ${cliCount} ${cliWord} \xB7 ${tally.files} ${fileWord} (dry-run \u2014 nothing written).`);
|
|
430
|
+
} else if (tally.files === 0 && tally.warns === 0) {
|
|
431
|
+
lines.push(`\u2713 Nothing to remove \u2014 ${summary?.id ?? result.connectorId} was not installed (zero residue).`);
|
|
432
|
+
} else {
|
|
433
|
+
lines.push(`\u2713 Removed ${summary?.id ?? result.connectorId} from ${cliCount} ${cliWord} \xB7 ${tally.files} ${fileWord} cleaned${tally.warns === 0 ? " (zero residue)" : ""}.`);
|
|
434
|
+
}
|
|
435
|
+
} else {
|
|
436
|
+
const what = verb === "upgrade" ? "Synced" : "Installed";
|
|
437
|
+
const wouldWhat = verb === "upgrade" ? "sync" : "install";
|
|
438
|
+
if (result.dryRun) {
|
|
439
|
+
lines.push(`\u2713 Would ${wouldWhat} ${summary?.id ?? result.connectorId} to ${cliCount} ${cliWord} \xB7 ${tally.files} ${fileWord} (dry-run \u2014 nothing written).`);
|
|
440
|
+
} else if (tally.files === 0) {
|
|
441
|
+
lines.push(`\u2713 ${summary?.id ?? result.connectorId}: already current on ${cliCount} ${cliWord} \u2014 nothing to write.`);
|
|
442
|
+
} else {
|
|
443
|
+
lines.push(`\u2713 ${what} ${summary?.id ?? result.connectorId} to ${cliCount} ${cliWord} \xB7 ${tally.files} ${fileWord}. Restart each CLI to load it.`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const inlineWarnings = new Set(groups.flatMap((g) => g.warnings));
|
|
447
|
+
const blockWarnings = result.warnings.filter((w) => !inlineWarnings.has(w));
|
|
448
|
+
if (blockWarnings.length > 0) {
|
|
449
|
+
lines.push("");
|
|
450
|
+
lines.push("warnings:");
|
|
451
|
+
for (const w of blockWarnings) lines.push(` ! ${w}`);
|
|
452
|
+
}
|
|
453
|
+
if (verb === "uninstall") {
|
|
454
|
+
lines.push(` Verify it's gone: ${activeProgramName} doctor`);
|
|
455
|
+
} else {
|
|
456
|
+
lines.push(
|
|
457
|
+
` Verify: ${activeProgramName} doctor \xB7 Remove: ${activeProgramName} uninstall`
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
return lines.join("\n");
|
|
461
|
+
}
|
|
462
|
+
var COMMANDS = {
|
|
463
|
+
detect: () => import("./detect-Z5BDTY6B.js"),
|
|
464
|
+
install: () => import("./install-O32TDIZP.js"),
|
|
465
|
+
uninstall: () => import("./uninstall-M76BHLTH.js"),
|
|
466
|
+
// `upgrade` is the single "bring everything current" verb (re-render host
|
|
467
|
+
// config + refresh the home pointer + managed channel guidance). `sync` and
|
|
468
|
+
// `update` are kept as back-compat aliases that route to the same module so
|
|
469
|
+
// existing scripts/docs keep working without a second concept to learn.
|
|
470
|
+
upgrade: () => import("./upgrade-JLSCNAQA.js"),
|
|
471
|
+
sync: () => import("./upgrade-JLSCNAQA.js"),
|
|
472
|
+
update: () => import("./upgrade-JLSCNAQA.js"),
|
|
473
|
+
package: () => import("./package-2KKUGZFS.js"),
|
|
474
|
+
doctor: () => import("./doctor-GAP27PP2.js"),
|
|
475
|
+
status: () => import("./status-B2PG6YKR.js"),
|
|
476
|
+
telemetry: () => import("./telemetry-ZMCAWBWB.js"),
|
|
477
|
+
usage: () => import("./usage-5I72HWCR.js"),
|
|
478
|
+
leaderboard: () => import("./leaderboard-YWMOSJBC.js"),
|
|
479
|
+
hook: () => import("./hook-XPR3AHDI.js"),
|
|
480
|
+
// Internal (omitted from USAGE): the statusline (HUD) entrypoint a host's
|
|
481
|
+
// status line config points at. Fail-safe: always exits 0 with at most a
|
|
482
|
+
// rendered line. See cli/commands/statusline.ts.
|
|
483
|
+
statusline: () => import("./statusline-5ERFMYSM.js"),
|
|
484
|
+
// Internal (omitted from USAGE): the user-invokable action entrypoint a future
|
|
485
|
+
// host affordance points at. USER-TRIGGERED: surfaces errors (exit 1 + stderr),
|
|
486
|
+
// unlike the fail-open hook / fail-safe statusline. See cli/commands/action.ts.
|
|
487
|
+
action: () => import("./action-CVIEPX4U.js"),
|
|
488
|
+
serve: () => import("./serve-EPRN7F2X.js"),
|
|
489
|
+
// Hidden (omitted from USAGE): the opt-in host-native turn-usage entrypoint an
|
|
490
|
+
// AfterModel / PostInvocation hook points at. Always exits 0; records a
|
|
491
|
+
// distinct `model_turn` row. See cli/commands/usage-event.ts.
|
|
492
|
+
"usage-event": () => import("./usage-event-HIX4ZI45.js")
|
|
493
|
+
};
|
|
494
|
+
var DEFAULT_PROGRAM_NAME = "agent-connector";
|
|
495
|
+
var COMMAND_USAGE = {
|
|
496
|
+
detect: "detect [--json] [--project <dir>]",
|
|
497
|
+
install: "install [<source>] [--method direct|marketplace] [--connector <source>] [--scope user|project] [--targets a,b] [--project <dir>] [--dry-run] [--force] [--quiet]\n <source> a local path OR a remote GitHub connector: owner/repo[/subpath][#ref], a github.com URL (incl. /tree/<ref>/<sub>), git@github.com:owner/repo, or github:owner/repo. Remote sources are fetched to ~/.agent-connector/sources/ and must be an agent-connector package (have an agent-connector.config.{mjs,js,json}).",
|
|
498
|
+
uninstall: "uninstall [--method auto|direct|marketplace] [--connector <path>] [--connector-id <id>] [--scope user|project] [--targets a,b] [--project <dir>] [--dry-run] [--purge] [--quiet]",
|
|
499
|
+
upgrade: "upgrade [--method direct|marketplace] [--channel stable|latest] [--connector <path>] [--scope user|project] [--targets a,b] [--project <dir>] [--dry-run] [--quiet]",
|
|
500
|
+
sync: "sync \u2014 alias of upgrade (see `upgrade --help`)",
|
|
501
|
+
update: "update \u2014 alias of upgrade (see `upgrade --help`)",
|
|
502
|
+
package: "package [--connector <path>] [--format <fmt>|all] [--out <dir>] [--project <dir>] [--dry-run]",
|
|
503
|
+
doctor: "doctor [--targets a,b] [--connector <path>] [--scope user|project] [--project <dir>] [--probe] [--explain] [--json] [--heal] [--dry-run] [--quiet]\n --explain per-(host,event) hook honor matrix (honored/degraded/dropped). Exit non-zero ONLY when an explicitly-targeted host DEGRADES a declared event (fires it but silently won't honor the reply); dropped/mcp-only hosts and fleet-wide (targets:auto) gaps are informational (exit 0).",
|
|
504
|
+
status: "status [--connector <path>] [--scope user|project] [--project <dir>] [--json]",
|
|
505
|
+
telemetry: "telemetry report|export|leaderboard [--by <dim>] [--since <dur>] [--connector <id>] [--scope <slice>] [--format csv|json] [--out <file>] [--json]",
|
|
506
|
+
usage: "usage report|export|leaderboard [--by <dim>] [--since <dur>] [--platform <id>] [--format csv|json] [--out <file>] [--json]",
|
|
507
|
+
leaderboard: "leaderboard [--since <dur>] [--connector <id>] [--scope <slice>] [--json]",
|
|
508
|
+
hook: "hook <platform> <event> --connector <id> (internal \u2014 host hook configs point here)",
|
|
509
|
+
statusline: "statusline <platform> --connector <id> (internal \u2014 host status line configs point here)",
|
|
510
|
+
action: "action <platform> <actionId> --connector <id> (internal \u2014 host action affordances point here)",
|
|
511
|
+
serve: "serve --connector <id> [--scope user|project] [--host <platformId>] -- <command> [args...] (internal \u2014 host MCP entries point here)"
|
|
512
|
+
};
|
|
513
|
+
function buildUsage(programName) {
|
|
514
|
+
return `${programName} \u2014 write your MCP server + hooks once, install everywhere.
|
|
515
|
+
|
|
516
|
+
usage: ${programName} <command> [flags]
|
|
517
|
+
|
|
518
|
+
commands:
|
|
519
|
+
detect List the AI-agent platforms installed on this machine.
|
|
520
|
+
install Deploy a connector across its target platforms (--method direct writes host config; --method marketplace drives the host's plugin install).
|
|
521
|
+
uninstall Remove a connector's registrations (--method auto reverses whichever method is actually installed).
|
|
522
|
+
upgrade Bring everything current: re-render host config + heal the home pointer + managed update guidance (alias: update, sync).
|
|
523
|
+
package Emit a marketplace/extension bundle (10 host formats, or the standard artifacts mcp-server-json | mcpb).
|
|
524
|
+
doctor Health-check every detected platform; non-zero exit on any failure.
|
|
525
|
+
status Light install-state summary: which connectors are present on which hosts (always exits 0).
|
|
526
|
+
telemetry Inspect local per-tool token telemetry (report | export | leaderboard).
|
|
527
|
+
usage Inspect host-native token usage from agent CLI logs (report | export | leaderboard).
|
|
528
|
+
leaderboard Three leaderboards: \u{1F50C} MCP/plugin (mcp-self) + \u{1F5A5}\uFE0F host/user (host-scan-logs) + \u{1F6F0}\uFE0F host-native turns (host-native-live) \u2014 never summed.
|
|
529
|
+
hook Universal json-stdio hook entrypoint (hosts call this).
|
|
530
|
+
serve Telemetry-wrapping MCP stdio proxy (wraps a real server command).
|
|
531
|
+
|
|
532
|
+
Run \`${programName} <command> --help\` for command-specific flags.`;
|
|
533
|
+
}
|
|
534
|
+
async function main(argv, opts = {}) {
|
|
535
|
+
const programName = opts.programName ?? DEFAULT_PROGRAM_NAME;
|
|
536
|
+
activeProgramName = programName;
|
|
537
|
+
const usage = buildUsage(programName);
|
|
538
|
+
const command = argv[0];
|
|
539
|
+
if (command == null || command === "--help" || command === "-h" || command === "help") {
|
|
540
|
+
print(usage);
|
|
541
|
+
return command == null ? 1 : 0;
|
|
542
|
+
}
|
|
543
|
+
if (command === "--version" || command === "-v") {
|
|
544
|
+
print(`${programName} ${resolveOwnVersion()}`);
|
|
545
|
+
return 0;
|
|
546
|
+
}
|
|
547
|
+
const loader = COMMANDS[command];
|
|
548
|
+
if (!loader) {
|
|
549
|
+
process.stderr.write(`${programName}: unknown command "${command}"
|
|
550
|
+
|
|
551
|
+
`);
|
|
552
|
+
process.stderr.write(`${usage}
|
|
553
|
+
`);
|
|
554
|
+
return 2;
|
|
555
|
+
}
|
|
556
|
+
const rest = argv.slice(1);
|
|
557
|
+
if (rest.includes("--help") || rest.includes("-h")) {
|
|
558
|
+
const sig = COMMAND_USAGE[command];
|
|
559
|
+
if (sig) {
|
|
560
|
+
print(`usage: ${programName} ${sig}`);
|
|
561
|
+
return 0;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const mod = await loader();
|
|
565
|
+
try {
|
|
566
|
+
return await mod.run(rest);
|
|
567
|
+
} catch (err) {
|
|
568
|
+
const code = err.code;
|
|
569
|
+
if (typeof code === "string" && code.startsWith("ERR_PARSE_ARGS")) {
|
|
570
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
571
|
+
const sig = COMMAND_USAGE[command];
|
|
572
|
+
if (sig) process.stderr.write(`usage: ${programName} ${sig}
|
|
573
|
+
`);
|
|
574
|
+
return fail(message);
|
|
575
|
+
}
|
|
576
|
+
throw err;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export {
|
|
581
|
+
print,
|
|
582
|
+
fail,
|
|
583
|
+
maybePrintBanner,
|
|
584
|
+
parseScope,
|
|
585
|
+
parseTargets,
|
|
586
|
+
buildConnectorSummary,
|
|
587
|
+
renderInstallResult,
|
|
588
|
+
main
|
|
589
|
+
};
|
|
590
|
+
//# sourceMappingURL=chunk-5Z36KVU2.js.map
|