autohand-cli 0.7.8 → 0.7.10
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 +19 -0
- package/dist/{AutomodeManager-YVCJXOMQ.js → AutomodeManager-NGRAO2MH.js} +35 -8
- package/dist/{AutomodeManager-HV6M7EAX.cjs → AutomodeManager-ZKQMBM4T.cjs} +35 -8
- package/dist/{CommunitySkillsCache-Q22FUAR5.js → CommunitySkillsCache-ILWHWE5P.js} +2 -2
- package/dist/CommunitySkillsCache-KHC6RUJW.cjs +7 -0
- package/dist/MemoryManager-6ZT7IDO5.cjs +7 -0
- package/dist/MemoryManager-AJGS5AKB.js +7 -0
- package/dist/PermissionManager-HG6W2DGU.cjs +10 -0
- package/dist/{PermissionManager-HATZKTRC.js → PermissionManager-U5OMGR3L.js} +3 -3
- package/dist/SessionManager-BJ2G6VV4.cjs +9 -0
- package/dist/{SessionManager-S5R6O3NU.js → SessionManager-ENPGYK5J.js} +2 -2
- package/dist/SkillsRegistry-6ZFOCT25.cjs +8 -0
- package/dist/{SkillsRegistry-R5WDM6T3.js → SkillsRegistry-C2SHOZ5D.js} +2 -2
- package/dist/{SyncApiClient-FAOMIZAP.js → SyncApiClient-AYXYSOJM.js} +1 -1
- package/dist/SyncApiClient-ID3KXEMA.cjs +10 -0
- package/dist/about-RGUM5QQ4.cjs +11 -0
- package/dist/about-VDR3SIHS.js +11 -0
- package/dist/add-dir-3BMVJ5H3.cjs +9 -0
- package/dist/{add-dir-PNU7AGKO.js → add-dir-RP2BL3JW.js} +2 -1
- package/dist/agents-JQ2PHCQB.js +10 -0
- package/dist/agents-RGSZ2BM3.cjs +10 -0
- package/dist/agents-new-LSJN2L2T.cjs +13 -0
- package/dist/agents-new-MZUEVKSK.js +13 -0
- package/dist/automode-DP3BMYJB.cjs +9 -0
- package/dist/{automode-QCRJSBRT.js → automode-XOF3U3OB.js} +2 -1
- package/dist/cc-2W6M7J45.cjs +8 -0
- package/dist/cc-UTTLESTY.js +8 -0
- package/dist/{chunk-B4ZPNXZE.cjs → chunk-34OGUMRO.cjs} +9 -5
- package/dist/chunk-3652ROFD.js +589 -0
- package/dist/{chunk-KNLBEUAV.cjs → chunk-3DQSBW4B.cjs} +10 -6
- package/dist/{chunk-XFPITUFJ.cjs → chunk-3S4DEIJP.cjs} +50 -8
- package/dist/{chunk-5MDDOGTD.cjs → chunk-3UNX56GC.cjs} +30 -37
- package/dist/chunk-46WX5IO2.cjs +499 -0
- package/dist/{chunk-OC5YDNFC.js → chunk-4ULBAYME.js} +42 -57
- package/dist/{chunk-VEDIYPWY.cjs → chunk-5BQ57AZC.cjs} +9 -9
- package/dist/{chunk-B5N5UAMO.cjs → chunk-5FZM7KLB.cjs} +13 -10
- package/dist/{chunk-JBKP2CLA.cjs → chunk-5NZA4UB4.cjs} +47 -47
- package/dist/{chunk-VPAN5H7Q.js → chunk-5Q3W4DEU.js} +43 -36
- package/dist/{chunk-VMMGT42E.cjs → chunk-65GTO4QM.cjs} +7 -3
- package/dist/{chunk-CXZEPTRI.js → chunk-6P3K4YUW.js} +6 -2
- package/dist/{chunk-MDWULS57.js → chunk-6UJMCWRY.js} +56 -33
- package/dist/chunk-73XIKTZL.js +124 -0
- package/dist/{chunk-23JQSCTO.js → chunk-7QNW24ZT.js} +8 -4
- package/dist/{chunk-XT4OSHSB.cjs → chunk-AEYOIPHD.cjs} +6 -2
- package/dist/chunk-ANUQFV43.cjs +589 -0
- package/dist/chunk-ATR3RORT.js +499 -0
- package/dist/{chunk-A6QBABQ7.js → chunk-B72CC4O6.js} +2 -2
- package/dist/{chunk-TAZJSKFD.js → chunk-BBIKQW66.js} +9 -5
- package/dist/{chunk-FFA4LDAO.cjs → chunk-BDIZGBDA.cjs} +8 -3
- package/dist/{chunk-3YEDXG6S.js → chunk-BG4OQUKP.js} +1 -1
- package/dist/{chunk-WIUGUR5T.js → chunk-BODVOW7B.js} +67 -16
- package/dist/{chunk-A552JHUJ.cjs → chunk-BZ73ZQTE.cjs} +34 -25
- package/dist/{chunk-YDOR2OCA.cjs → chunk-C22G4UE4.cjs} +27 -19
- package/dist/{chunk-GFJ6AETU.cjs → chunk-C2E3GJEE.cjs} +12 -9
- package/dist/{chunk-UL7YPRCU.js → chunk-C5SVIQG3.js} +10 -5
- package/dist/{chunk-6KMAJTU3.js → chunk-CUBYCLNL.js} +3 -2
- package/dist/{chunk-52MLYK5P.js → chunk-D2XFTCRP.js} +1 -1
- package/dist/{chunk-OBV3UUIL.js → chunk-DEAEO7RI.js} +1 -1
- package/dist/chunk-DMPVI3YK.cjs +400 -0
- package/dist/{chunk-C26EN22G.cjs → chunk-DUDDZRCS.cjs} +9 -5
- package/dist/{chunk-4RWTUT2Z.js → chunk-E7YL3AHT.js} +32 -23
- package/dist/{chunk-54GVL2SE.cjs → chunk-EAOEAQGF.cjs} +3 -2
- package/dist/{chunk-PU534KPO.cjs → chunk-EV53SLSB.cjs} +4 -4
- package/dist/{chunk-EDGV5BNH.js → chunk-F3EIOVSQ.js} +26 -33
- package/dist/{chunk-SFGJQPGC.cjs → chunk-FPHU2ES6.cjs} +56 -33
- package/dist/{chunk-G77ZY4QG.js → chunk-GD4AFYJ3.js} +1 -1
- package/dist/{chunk-PMMSDR44.cjs → chunk-GIZL57FE.cjs} +5 -1
- package/dist/{chunk-I4HVBWYF.js → chunk-GLAE5K5W.js} +7 -2
- package/dist/{chunk-4AMTDSQ3.cjs → chunk-HDSEJMWI.cjs} +6 -3
- package/dist/chunk-HLFZPN65.js +94 -0
- package/dist/{chunk-ZWS3KSMK.js → chunk-HQQ4NKER.js} +5 -2
- package/dist/{chunk-WBDPILKI.cjs → chunk-HVOBMOZ2.cjs} +6 -2
- package/dist/{chunk-MJFBVQHB.js → chunk-IPI3JXKP.js} +10 -7
- package/dist/chunk-IXFOH4OC.cjs +222 -0
- package/dist/chunk-JS7IPR7P.js +249 -0
- package/dist/{chunk-7TOHYAUF.cjs → chunk-KC5FPUOF.cjs} +2 -2
- package/dist/{chunk-7VW3A7DO.cjs → chunk-L42HTMMR.cjs} +2 -2
- package/dist/chunk-LGGZQTLM.cjs +209 -0
- package/dist/chunk-LOXOD4IS.cjs +8630 -0
- package/dist/chunk-MNCWB5F7.cjs +63 -0
- package/dist/{chunk-AVL4DKQO.js → chunk-MYNHJHDZ.js} +1 -1
- package/dist/{chunk-GDTZQSJ6.cjs → chunk-N4ZSG6JJ.cjs} +2 -2
- package/dist/chunk-NCC6ETZS.js +362 -0
- package/dist/chunk-NF7RIHJK.js +45 -0
- package/dist/{chunk-SYJLMBLP.cjs → chunk-NGBN2NGH.cjs} +77 -26
- package/dist/{chunk-SLISYSP4.cjs → chunk-NRORJRD4.cjs} +4 -4
- package/dist/{chunk-OTS4YFSZ.cjs → chunk-OKABWSWA.cjs} +7 -3
- package/dist/{chunk-KH7BCZJN.js → chunk-OLG7LZBD.js} +1 -1
- package/dist/{chunk-KZ7VMQTC.js → chunk-OMEH2EVE.js} +5 -1
- package/dist/{chunk-U5WIP4HS.js → chunk-P5VDZ6PV.js} +47 -5
- package/dist/{chunk-V5MTBGM4.cjs → chunk-PA2H2263.cjs} +6 -2
- package/dist/chunk-PGRH5Q77.cjs +249 -0
- package/dist/{chunk-DPJ3IIBB.js → chunk-PM62ZYXA.js} +18 -10
- package/dist/chunk-PNSRJT46.js +380 -0
- package/dist/{chunk-C3IFF3EH.cjs → chunk-PSED4Z4X.cjs} +43 -58
- package/dist/{chunk-EKY5PKQI.js → chunk-PWLLLJHU.js} +5 -1
- package/dist/{chunk-DOTAX65F.js → chunk-PYLR4J2D.js} +8 -4
- package/dist/{chunk-YWKZF2SA.js → chunk-QC6IUDDJ.js} +46 -46
- package/dist/{chunk-4M2GX7RH.cjs → chunk-QM7HZCQW.cjs} +11 -6
- package/dist/chunk-QRQ5EX7I.cjs +380 -0
- package/dist/{chunk-YDH2BMEN.js → chunk-QU64XI5X.js} +9 -6
- package/dist/{chunk-3L76MLO5.cjs → chunk-R7SDL3DJ.cjs} +27 -31
- package/dist/{chunk-WQSWU2QA.cjs → chunk-RJP3SZ7Q.cjs} +46 -255
- package/dist/{chunk-BAFJQUWR.js → chunk-RJXNNIFW.js} +18 -22
- package/dist/{chunk-YAGD43KA.cjs → chunk-S5G7OEN2.cjs} +47 -40
- package/dist/{chunk-2JPUEN44.cjs → chunk-SA4JOV4F.cjs} +61 -86
- package/dist/chunk-SAG6IY5Z.cjs +94 -0
- package/dist/chunk-TSV4LVHK.js +35 -0
- package/dist/{chunk-JHFH3N4U.cjs → chunk-TSY7JHIV.cjs} +2 -2
- package/dist/chunk-U23U52ZN.cjs +124 -0
- package/dist/chunk-UET7BDX2.js +8630 -0
- package/dist/chunk-ULQ6MDSJ.cjs +362 -0
- package/dist/{chunk-WH3D42BQ.js → chunk-UM4QEO36.js} +59 -84
- package/dist/chunk-VXCMGBXY.cjs +35 -0
- package/dist/chunk-WD5ZF6HE.js +63 -0
- package/dist/chunk-WH5RW7DV.cjs +85 -0
- package/dist/{chunk-GSOEIEOU.js → chunk-WJ276BIP.js} +5 -1
- package/dist/{chunk-P2Z6GDEN.js → chunk-WLTVF77A.js} +1 -1
- package/dist/{chunk-53BR4MUW.cjs → chunk-WOGJXDBU.cjs} +3 -3
- package/dist/{chunk-QJ53OSGF.js → chunk-WRJLBHWB.js} +6 -2
- package/dist/chunk-WYLFLZ42.js +222 -0
- package/dist/{chunk-B7EUETGY.cjs → chunk-XL77XYI2.cjs} +4 -4
- package/dist/{chunk-NI3BQXKU.js → chunk-XLI7SHCH.js} +2 -2
- package/dist/chunk-Y27LG4BQ.cjs +45 -0
- package/dist/chunk-Y6OWFIUF.js +209 -0
- package/dist/chunk-YKSSNFDZ.js +400 -0
- package/dist/{chunk-VRI7EXV6.js → chunk-YMDLUTF2.js} +5 -1
- package/dist/chunk-YVY27BJT.js +85 -0
- package/dist/{chunk-GWIAMKKF.js → chunk-ZBIBLOZL.js} +40 -249
- package/dist/completion-HVSWU5GR.cjs +13 -0
- package/dist/completion-WJ2MVNDH.js +13 -0
- package/dist/constants-RBQTR32A.cjs +20 -0
- package/dist/{constants-ZLG6M5SI.js → constants-V6J54N3X.js} +1 -1
- package/dist/export-NN7F5ANA.js +11 -0
- package/dist/export-UPS3AK2P.cjs +11 -0
- package/dist/feedback-ARI7CLVQ.js +14 -0
- package/dist/feedback-OZTPYHKJ.cjs +14 -0
- package/dist/help-4674IV4D.cjs +58 -0
- package/dist/help-ENG5KV2M.js +58 -0
- package/dist/history-2KUM6GN4.cjs +13 -0
- package/dist/history-RZFT34Q7.js +13 -0
- package/dist/hooks-7QSUBHBM.cjs +12 -0
- package/dist/hooks-S4MD4QSR.js +12 -0
- package/dist/i18n-6NKENUIV.js +32 -0
- package/dist/i18n-MXQXQOVE.cjs +32 -0
- package/dist/ide-5STDV43A.cjs +11 -0
- package/dist/ide-W2NYXOWQ.js +11 -0
- package/dist/index.cjs +18002 -13864
- package/dist/index.js +18252 -14114
- package/dist/init-FG5KEJCZ.cjs +9 -0
- package/dist/init-TV4MJDYK.js +9 -0
- package/dist/language-52Q7CSAY.cjs +16 -0
- package/dist/language-FXFDGOBF.js +16 -0
- package/dist/localProjectPermissions-2EATUDZM.cjs +17 -0
- package/dist/{localProjectPermissions-YFFAKLUZ.js → localProjectPermissions-WQYMGI42.js} +2 -2
- package/dist/login-AN42IOBK.js +18 -0
- package/dist/login-I65V4TGU.cjs +18 -0
- package/dist/logout-KK5UWGNG.js +16 -0
- package/dist/logout-VYYNWBHZ.cjs +16 -0
- package/dist/mcp-4SKTDECJ.js +15 -0
- package/dist/mcp-AGWPTMAX.cjs +15 -0
- package/dist/mcp-install-3NN2HAYR.cjs +473 -0
- package/dist/mcp-install-KTV52DQK.js +473 -0
- package/dist/memory-LG4K6XV6.cjs +9 -0
- package/dist/{memory-4GSP7NKV.js → memory-LRDK2SYC.js} +2 -1
- package/dist/model-P5D7ATE7.cjs +9 -0
- package/dist/{model-HKEFSH5E.js → model-WBFJIGUN.js} +2 -1
- package/dist/{new-EEZC4XXV.js → new-5A7RQEKI.js} +2 -1
- package/dist/new-EAATWI2G.cjs +9 -0
- package/dist/permissions-5URK6C44.js +12 -0
- package/dist/permissions-CJUDVG63.cjs +12 -0
- package/dist/plan-B3CW5DXJ.cjs +10 -0
- package/dist/plan-JFGNRL2S.js +10 -0
- package/dist/quit-A33JHDG7.cjs +9 -0
- package/dist/quit-IYBLN3DB.js +9 -0
- package/dist/resume-OPSJTCH7.cjs +12 -0
- package/dist/resume-TOWEEN5D.js +12 -0
- package/dist/search-GOLIE5BA.js +14 -0
- package/dist/search-H42HGUK5.cjs +14 -0
- package/dist/{sessions-4KXIT76T.js → sessions-B5NENDKY.js} +2 -1
- package/dist/sessions-YHAVEMWY.cjs +9 -0
- package/dist/share-2JD2AKKX.cjs +13 -0
- package/dist/share-MYGDOTQE.js +13 -0
- package/dist/{skills-3YEEODHK.js → skills-ICEQ2TNC.js} +2 -1
- package/dist/skills-LFVNZOMF.cjs +13 -0
- package/dist/{skills-install-KAXAQSN6.js → skills-install-6RN7FVCP.js} +9 -7
- package/dist/{skills-install-FTGOHOZ4.cjs → skills-install-LU6GA2WF.cjs} +14 -12
- package/dist/skills-new-5BM5PDFX.cjs +14 -0
- package/dist/skills-new-KWBWOX74.js +14 -0
- package/dist/status-M3XHJELG.cjs +10 -0
- package/dist/status-ZQDUYMKQ.js +10 -0
- package/dist/sync-6M3WRKMH.cjs +39 -0
- package/dist/sync-73D2MP65.cjs +16 -0
- package/dist/{sync-H4UHHLKU.js → sync-EXYX7HXW.js} +3 -3
- package/dist/sync-LL6M67CN.js +16 -0
- package/dist/theme-IFEI2IBJ.cjs +16 -0
- package/dist/theme-U3SKEULY.js +16 -0
- package/dist/ui/questionModal.cjs +28 -0
- package/dist/ui/questionModal.d.cts +11 -0
- package/dist/ui/questionModal.d.ts +11 -0
- package/dist/ui/questionModal.js +28 -0
- package/dist/undo-4DS67OAW.cjs +9 -0
- package/dist/undo-YMALVAPN.js +9 -0
- package/package.json +3 -2
- package/dist/CommunitySkillsCache-2BITCEAA.cjs +0 -7
- package/dist/MemoryManager-2ATHG7BH.js +0 -7
- package/dist/MemoryManager-AENCGCEW.cjs +0 -7
- package/dist/PermissionManager-6HZGTK2N.cjs +0 -10
- package/dist/SessionManager-AG4WT3DP.cjs +0 -9
- package/dist/SkillsRegistry-ZXU6YDRP.cjs +0 -8
- package/dist/SyncApiClient-UOA4VLLD.cjs +0 -10
- package/dist/add-dir-OMK3Y4DM.cjs +0 -8
- package/dist/agents-ICAC3KD3.js +0 -9
- package/dist/agents-YONWPKFS.cjs +0 -9
- package/dist/agents-new-NV557UVG.cjs +0 -10
- package/dist/agents-new-QHM3CO4B.js +0 -10
- package/dist/automode-BRHUHGXU.cjs +0 -8
- package/dist/chunk-3HPUOQJN.cjs +0 -23
- package/dist/chunk-5DN5KNXU.js +0 -81
- package/dist/chunk-7BYSXAKS.js +0 -23
- package/dist/chunk-ARVFUZOB.js +0 -736
- package/dist/chunk-BEIG7V7Q.cjs +0 -51
- package/dist/chunk-GWXXFQ3F.cjs +0 -81
- package/dist/chunk-XFQS2VGT.cjs +0 -736
- package/dist/chunk-Z3Q2AFDS.js +0 -51
- package/dist/completion-WVFWX7XQ.cjs +0 -10
- package/dist/completion-Y42FKDT3.js +0 -10
- package/dist/constants-G2PLP5HH.cjs +0 -20
- package/dist/export-BKBJ7PB2.cjs +0 -8
- package/dist/export-WJ5P6E5Z.js +0 -8
- package/dist/feedback-HZBCTSFG.js +0 -10
- package/dist/feedback-JBQ3UPGZ.cjs +0 -10
- package/dist/help-PKC6QCNG.js +0 -10
- package/dist/help-UEELQRHP.cjs +0 -10
- package/dist/hooks-G4VLYMLX.cjs +0 -9
- package/dist/hooks-LN4A6NQL.js +0 -9
- package/dist/init-DML7AOII.js +0 -8
- package/dist/init-SLLSDDJN.cjs +0 -8
- package/dist/language-KODBDE5R.js +0 -12
- package/dist/language-SJT475NW.cjs +0 -12
- package/dist/localProjectPermissions-AYQYGTOE.cjs +0 -17
- package/dist/login-TC2KROQI.js +0 -14
- package/dist/login-TYMR2ZD3.cjs +0 -14
- package/dist/logout-2ECV365P.js +0 -12
- package/dist/logout-CO3CPYZJ.cjs +0 -12
- package/dist/memory-CFNC7RJH.cjs +0 -8
- package/dist/model-TKVEJ5BC.cjs +0 -8
- package/dist/new-EB2MBQXA.cjs +0 -8
- package/dist/permissions-5MTH22EF.js +0 -9
- package/dist/permissions-IP5SITPI.cjs +0 -9
- package/dist/quit-2RYFGIJP.cjs +0 -8
- package/dist/quit-RSYIERO5.js +0 -8
- package/dist/resume-EPOEF3WV.cjs +0 -9
- package/dist/resume-LOYD5MMP.js +0 -9
- package/dist/sessions-7RTCPVNE.cjs +0 -8
- package/dist/share-APR5S2CS.cjs +0 -10
- package/dist/share-VLJFDZKR.js +0 -10
- package/dist/skills-CRM55MKM.cjs +0 -12
- package/dist/skills-new-JF4FKNUT.cjs +0 -11
- package/dist/skills-new-JYX2GBKM.js +0 -11
- package/dist/status-DAEFE7ZC.cjs +0 -9
- package/dist/status-PBFFUC4Q.js +0 -9
- package/dist/sync-3B7SNBYC.js +0 -14
- package/dist/sync-4RARBQIH.cjs +0 -39
- package/dist/sync-YZ6YZ42H.cjs +0 -14
- package/dist/theme-3XV5BWUB.js +0 -12
- package/dist/theme-Z2WS5XWZ.cjs +0 -12
- package/dist/undo-2WR2ZIEC.cjs +0 -8
- package/dist/undo-7QJBXARS.js +0 -8
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveConfig
|
|
3
|
+
} from "./chunk-ZBIBLOZL.js";
|
|
4
|
+
import {
|
|
5
|
+
I18nProvider
|
|
6
|
+
} from "./chunk-NF7RIHJK.js";
|
|
7
|
+
import {
|
|
8
|
+
t
|
|
9
|
+
} from "./chunk-UET7BDX2.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/mcp.ts
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
|
|
14
|
+
// src/ui/ink/components/McpServerList.tsx
|
|
15
|
+
import { useState, useCallback } from "react";
|
|
16
|
+
import { Box, Text, useInput, render } from "ink";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function McpServerList({ servers, onToggle, onDone }) {
|
|
19
|
+
const [cursor, setCursor] = useState(0);
|
|
20
|
+
const [toggling, setToggling] = useState(null);
|
|
21
|
+
const handleToggle = useCallback(async () => {
|
|
22
|
+
const server = servers[cursor];
|
|
23
|
+
if (!server || toggling) return;
|
|
24
|
+
setToggling(server.name);
|
|
25
|
+
onToggle(server.name, server.status);
|
|
26
|
+
setToggling(null);
|
|
27
|
+
}, [cursor, servers, toggling, onToggle]);
|
|
28
|
+
useInput((char, key) => {
|
|
29
|
+
if (key.escape || char === "q" && !key.ctrl) {
|
|
30
|
+
onDone();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (key.upArrow) {
|
|
34
|
+
setCursor((prev) => prev > 0 ? prev - 1 : servers.length - 1);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (key.downArrow) {
|
|
38
|
+
setCursor((prev) => prev < servers.length - 1 ? prev + 1 : 0);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (char === " " || key.return) {
|
|
42
|
+
handleToggle();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (servers.length === 0) {
|
|
47
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", bold: true, children: "MCP Servers" }),
|
|
49
|
+
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
50
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: "No MCP servers configured." }),
|
|
51
|
+
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
52
|
+
/* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
53
|
+
"Add a server: /mcp add ",
|
|
54
|
+
"<name>",
|
|
55
|
+
" ",
|
|
56
|
+
"<command>",
|
|
57
|
+
" [args...]"
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: "Browse: /mcp install" }),
|
|
60
|
+
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
61
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: "Press ESC or q to close" })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", bold: true, children: "MCP Servers" }),
|
|
66
|
+
/* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u2500".repeat(56) }) }),
|
|
67
|
+
servers.map((server, i) => {
|
|
68
|
+
const isSelected = i === cursor;
|
|
69
|
+
const isToggling = toggling === server.name;
|
|
70
|
+
const statusIcon = server.status === "connected" ? "\u25CF" : server.status === "error" ? "\u25CF" : "\u25CB";
|
|
71
|
+
const statusColor = server.status === "connected" ? "green" : server.status === "error" ? "red" : "gray";
|
|
72
|
+
const statusLabel = server.status === "connected" ? "enabled" : server.status === "error" ? "error" : "disabled";
|
|
73
|
+
const toolsInfo = server.status === "connected" && server.toolCount > 0 ? ` (${server.toolCount} tools)` : "";
|
|
74
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Text, { color: isSelected ? "yellow" : void 0, children: isSelected ? "\u25B8 " : " " }),
|
|
77
|
+
/* @__PURE__ */ jsxs(Text, { color: statusColor, children: [
|
|
78
|
+
statusIcon,
|
|
79
|
+
" "
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsx(Text, { bold: isSelected, children: server.name.padEnd(24) }),
|
|
82
|
+
/* @__PURE__ */ jsx(Text, { color: statusColor, children: isToggling ? "toggling..." : statusLabel }),
|
|
83
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: toolsInfo })
|
|
84
|
+
] }),
|
|
85
|
+
isSelected && server.status === "error" && server.error && /* @__PURE__ */ jsx(Box, { marginLeft: 4, children: /* @__PURE__ */ jsxs(Text, { color: "red", dimColor: true, children: [
|
|
86
|
+
" ",
|
|
87
|
+
server.error
|
|
88
|
+
] }) })
|
|
89
|
+
] }, server.name);
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
92
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
93
|
+
/* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
94
|
+
"\u2191\u2193",
|
|
95
|
+
" navigate ",
|
|
96
|
+
"\u23CE/space",
|
|
97
|
+
" toggle ",
|
|
98
|
+
"q/esc",
|
|
99
|
+
" close"
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: "Connected servers provide tools to the agent" })
|
|
102
|
+
] })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
async function showMcpServerList(options) {
|
|
106
|
+
if (!process.stdout.isTTY) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let currentServers = [...options.servers];
|
|
110
|
+
return new Promise((resolve) => {
|
|
111
|
+
let completed = false;
|
|
112
|
+
let instance;
|
|
113
|
+
const renderList = () => {
|
|
114
|
+
const element = /* @__PURE__ */ jsx(I18nProvider, { children: /* @__PURE__ */ jsx(
|
|
115
|
+
McpServerList,
|
|
116
|
+
{
|
|
117
|
+
servers: currentServers,
|
|
118
|
+
onToggle: async (name, status) => {
|
|
119
|
+
currentServers = await options.onToggle(name, status);
|
|
120
|
+
instance.rerender(
|
|
121
|
+
/* @__PURE__ */ jsx(I18nProvider, { children: /* @__PURE__ */ jsx(
|
|
122
|
+
McpServerList,
|
|
123
|
+
{
|
|
124
|
+
servers: currentServers,
|
|
125
|
+
onToggle: async (n, s) => {
|
|
126
|
+
currentServers = await options.onToggle(n, s);
|
|
127
|
+
renderList();
|
|
128
|
+
},
|
|
129
|
+
onDone: () => {
|
|
130
|
+
if (completed) return;
|
|
131
|
+
completed = true;
|
|
132
|
+
instance.unmount();
|
|
133
|
+
resolve();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
) })
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
onDone: () => {
|
|
140
|
+
if (completed) return;
|
|
141
|
+
completed = true;
|
|
142
|
+
instance.unmount();
|
|
143
|
+
resolve();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
) });
|
|
147
|
+
if (instance) {
|
|
148
|
+
instance.rerender(element);
|
|
149
|
+
} else {
|
|
150
|
+
instance = render(element, { exitOnCtrlC: false });
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
renderList();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/commands/mcp.ts
|
|
158
|
+
async function mcp(ctx, args = []) {
|
|
159
|
+
const { mcpManager, config } = ctx;
|
|
160
|
+
if (!mcpManager) {
|
|
161
|
+
return "MCP manager not available.";
|
|
162
|
+
}
|
|
163
|
+
const subcommand = args[0]?.toLowerCase();
|
|
164
|
+
switch (subcommand) {
|
|
165
|
+
case "connect":
|
|
166
|
+
return handleConnect(mcpManager, config, args.slice(1));
|
|
167
|
+
case "disconnect":
|
|
168
|
+
return handleDisconnect(mcpManager, args.slice(1));
|
|
169
|
+
case "list":
|
|
170
|
+
case "tools":
|
|
171
|
+
return handleListTools(mcpManager);
|
|
172
|
+
case "add":
|
|
173
|
+
return handleAdd(mcpManager, config, args.slice(1));
|
|
174
|
+
case "remove":
|
|
175
|
+
case "rm":
|
|
176
|
+
return handleRemove(mcpManager, config, args.slice(1));
|
|
177
|
+
default:
|
|
178
|
+
return showInteractiveList(mcpManager, config);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function buildServerItems(manager, config) {
|
|
182
|
+
const runtimeServers = manager.listServers();
|
|
183
|
+
const items = runtimeServers.map((s) => ({
|
|
184
|
+
name: s.name,
|
|
185
|
+
status: s.status,
|
|
186
|
+
toolCount: s.toolCount
|
|
187
|
+
}));
|
|
188
|
+
const runtimeNames = new Set(runtimeServers.map((s) => s.name));
|
|
189
|
+
const configServers = config?.mcp?.servers ?? [];
|
|
190
|
+
for (const cs of configServers) {
|
|
191
|
+
if (!runtimeNames.has(cs.name)) {
|
|
192
|
+
items.push({
|
|
193
|
+
name: cs.name,
|
|
194
|
+
status: "disconnected",
|
|
195
|
+
toolCount: 0
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return items;
|
|
200
|
+
}
|
|
201
|
+
async function showInteractiveList(manager, config) {
|
|
202
|
+
const items = buildServerItems(manager, config);
|
|
203
|
+
if (items.length === 0) {
|
|
204
|
+
const lines = [];
|
|
205
|
+
lines.push("");
|
|
206
|
+
lines.push(chalk.bold.cyan(t("commands.mcp.title")));
|
|
207
|
+
lines.push(chalk.gray("\u2500".repeat(50)));
|
|
208
|
+
lines.push("");
|
|
209
|
+
lines.push(t("commands.mcp.noServers"));
|
|
210
|
+
lines.push("");
|
|
211
|
+
lines.push(chalk.gray("Add a server:"));
|
|
212
|
+
lines.push(chalk.gray(" /mcp add <name> <command> [args...]"));
|
|
213
|
+
lines.push("");
|
|
214
|
+
lines.push(chalk.gray("Browse community servers:"));
|
|
215
|
+
lines.push(chalk.gray(" /mcp install"));
|
|
216
|
+
return lines.join("\n");
|
|
217
|
+
}
|
|
218
|
+
await showMcpServerList({
|
|
219
|
+
servers: items,
|
|
220
|
+
onToggle: async (serverName, currentStatus) => {
|
|
221
|
+
if (currentStatus === "connected") {
|
|
222
|
+
try {
|
|
223
|
+
await manager.disconnect(serverName);
|
|
224
|
+
} catch {
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
const serverConfig = config?.mcp?.servers?.find((s) => s.name === serverName);
|
|
228
|
+
if (serverConfig) {
|
|
229
|
+
try {
|
|
230
|
+
await manager.connect(serverConfig);
|
|
231
|
+
} catch {
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return buildServerItems(manager, config);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
const updatedServers = manager.listServers();
|
|
239
|
+
const connectedCount = updatedServers.filter((s) => s.status === "connected").length;
|
|
240
|
+
const totalTools = updatedServers.reduce(
|
|
241
|
+
(sum, s) => sum + (s.status === "connected" ? s.toolCount : 0),
|
|
242
|
+
0
|
|
243
|
+
);
|
|
244
|
+
if (connectedCount > 0) {
|
|
245
|
+
return `${connectedCount} server${connectedCount > 1 ? "s" : ""} connected (${totalTools} tools available)`;
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
async function handleConnect(manager, config, args) {
|
|
250
|
+
const serverName = args[0];
|
|
251
|
+
if (!serverName) {
|
|
252
|
+
return "Usage: /mcp connect <server-name>";
|
|
253
|
+
}
|
|
254
|
+
const serverConfig = config?.mcp?.servers?.find((s) => s.name === serverName);
|
|
255
|
+
if (!serverConfig) {
|
|
256
|
+
return `Server "${serverName}" not found in config. Use /mcp add to add it first.`;
|
|
257
|
+
}
|
|
258
|
+
try {
|
|
259
|
+
console.log(chalk.cyan(t("commands.mcp.connecting")));
|
|
260
|
+
await manager.connect(serverConfig);
|
|
261
|
+
const tools = manager.getToolsForServer(serverName);
|
|
262
|
+
return `Connected to ${serverName} (${tools.length} tools available)`;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
return `Failed to connect to ${serverName}: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async function handleDisconnect(manager, args) {
|
|
268
|
+
const serverName = args[0];
|
|
269
|
+
if (!serverName) {
|
|
270
|
+
return "Usage: /mcp disconnect <server-name>";
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
await manager.disconnect(serverName);
|
|
274
|
+
return `Disconnected from ${serverName}`;
|
|
275
|
+
} catch (error) {
|
|
276
|
+
return `Failed to disconnect from ${serverName}: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function handleListTools(manager) {
|
|
280
|
+
const tools = manager.getAllTools();
|
|
281
|
+
const lines = [];
|
|
282
|
+
lines.push("");
|
|
283
|
+
lines.push(chalk.bold.cyan("MCP Tools"));
|
|
284
|
+
lines.push(chalk.gray("\u2500".repeat(50)));
|
|
285
|
+
if (tools.length === 0) {
|
|
286
|
+
lines.push("");
|
|
287
|
+
lines.push("No tools available. Connect to an MCP server first.");
|
|
288
|
+
return lines.join("\n");
|
|
289
|
+
}
|
|
290
|
+
const byServer = /* @__PURE__ */ new Map();
|
|
291
|
+
for (const tool of tools) {
|
|
292
|
+
const existing = byServer.get(tool.serverName) ?? [];
|
|
293
|
+
existing.push(tool);
|
|
294
|
+
byServer.set(tool.serverName, existing);
|
|
295
|
+
}
|
|
296
|
+
for (const [serverName, serverTools] of byServer) {
|
|
297
|
+
lines.push("");
|
|
298
|
+
lines.push(chalk.bold(`${serverName} (${serverTools.length} tools):`));
|
|
299
|
+
for (const tool of serverTools) {
|
|
300
|
+
const shortName = tool.name.replace(`mcp__${serverName}__`, "");
|
|
301
|
+
lines.push(` ${chalk.yellow(shortName)} ${chalk.gray(tool.description.slice(0, 60))}`);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
lines.push("");
|
|
305
|
+
lines.push(chalk.gray(`Total: ${tools.length} tools from ${byServer.size} servers`));
|
|
306
|
+
return lines.join("\n");
|
|
307
|
+
}
|
|
308
|
+
async function handleAdd(manager, config, args) {
|
|
309
|
+
if (args.length < 2) {
|
|
310
|
+
return "Usage: /mcp add <name> <command> [args...]";
|
|
311
|
+
}
|
|
312
|
+
if (!config) {
|
|
313
|
+
return "Config not available.";
|
|
314
|
+
}
|
|
315
|
+
const [name, command, ...serverArgs] = args;
|
|
316
|
+
if (config.mcp?.servers?.some((s) => s.name === name)) {
|
|
317
|
+
return `Server "${name}" already exists in config. Use /mcp remove first.`;
|
|
318
|
+
}
|
|
319
|
+
if (!config.mcp) {
|
|
320
|
+
config.mcp = {};
|
|
321
|
+
}
|
|
322
|
+
if (!config.mcp.servers) {
|
|
323
|
+
config.mcp.servers = [];
|
|
324
|
+
}
|
|
325
|
+
const newServer = {
|
|
326
|
+
name,
|
|
327
|
+
transport: "stdio",
|
|
328
|
+
command,
|
|
329
|
+
args: serverArgs.length > 0 ? serverArgs : void 0,
|
|
330
|
+
autoConnect: true
|
|
331
|
+
};
|
|
332
|
+
config.mcp.servers.push(newServer);
|
|
333
|
+
try {
|
|
334
|
+
await saveConfig(config);
|
|
335
|
+
try {
|
|
336
|
+
await manager.connect(newServer);
|
|
337
|
+
const tools = manager.getToolsForServer(name);
|
|
338
|
+
return `Added and connected to "${name}" (${tools.length} tools available)`;
|
|
339
|
+
} catch (connectError) {
|
|
340
|
+
return `Added "${name}" to config but failed to connect: ${connectError instanceof Error ? connectError.message : "Unknown error"}`;
|
|
341
|
+
}
|
|
342
|
+
} catch (error) {
|
|
343
|
+
return `Failed to save config: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
async function handleRemove(manager, config, args) {
|
|
347
|
+
const serverName = args[0];
|
|
348
|
+
if (!serverName) {
|
|
349
|
+
return "Usage: /mcp remove <server-name>";
|
|
350
|
+
}
|
|
351
|
+
if (!config) {
|
|
352
|
+
return "Config not available.";
|
|
353
|
+
}
|
|
354
|
+
const serverIndex = config.mcp?.servers?.findIndex((s) => s.name === serverName);
|
|
355
|
+
if (serverIndex === void 0 || serverIndex < 0) {
|
|
356
|
+
return `Server "${serverName}" not found in config.`;
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
await manager.disconnect(serverName);
|
|
360
|
+
} catch {
|
|
361
|
+
}
|
|
362
|
+
config.mcp.servers.splice(serverIndex, 1);
|
|
363
|
+
try {
|
|
364
|
+
await saveConfig(config);
|
|
365
|
+
return `Removed "${serverName}" from config`;
|
|
366
|
+
} catch (error) {
|
|
367
|
+
return `Failed to save config: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
var metadata = {
|
|
371
|
+
command: "/mcp",
|
|
372
|
+
description: t("commands.mcp.description"),
|
|
373
|
+
implemented: true
|
|
374
|
+
};
|
|
375
|
+
var installMetadata = {
|
|
376
|
+
command: "/mcp install",
|
|
377
|
+
description: t("commands.mcp.installDescription"),
|
|
378
|
+
implemented: true
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export {
|
|
382
|
+
mcp,
|
|
383
|
+
metadata,
|
|
384
|
+
installMetadata
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* @license
|
|
388
|
+
* Copyright 2025 Autohand AI LLC
|
|
389
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
390
|
+
*
|
|
391
|
+
* Interactive MCP Server toggle list - Ink component
|
|
392
|
+
* Allows users to enable/disable MCP servers with arrow keys + space
|
|
393
|
+
*/
|
|
394
|
+
/**
|
|
395
|
+
* @license
|
|
396
|
+
* Copyright 2025 Autohand AI LLC
|
|
397
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
398
|
+
*
|
|
399
|
+
* MCP command - List and manage MCP (Model Context Protocol) servers
|
|
400
|
+
*/
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
t
|
|
3
|
+
} from "./chunk-UET7BDX2.js";
|
|
4
|
+
|
|
1
5
|
// src/commands/init.ts
|
|
2
6
|
async function init(ctx) {
|
|
3
7
|
await ctx.createAgentsFile();
|
|
@@ -5,7 +9,7 @@ async function init(ctx) {
|
|
|
5
9
|
}
|
|
6
10
|
var metadata = {
|
|
7
11
|
command: "/init",
|
|
8
|
-
description: "
|
|
12
|
+
description: t("commands.init.description"),
|
|
9
13
|
implemented: true
|
|
10
14
|
};
|
|
11
15
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveConfig
|
|
3
|
+
} from "./chunk-ZBIBLOZL.js";
|
|
4
|
+
import {
|
|
5
|
+
showModal
|
|
6
|
+
} from "./chunk-PNSRJT46.js";
|
|
7
|
+
import {
|
|
8
|
+
LANGUAGE_DISPLAY_NAMES,
|
|
9
|
+
SUPPORTED_LOCALES,
|
|
10
|
+
changeLanguage,
|
|
11
|
+
getCurrentLocale,
|
|
12
|
+
t
|
|
13
|
+
} from "./chunk-UET7BDX2.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/language.ts
|
|
16
|
+
import chalk from "chalk";
|
|
17
|
+
async function language(ctx) {
|
|
18
|
+
const currentLocale = getCurrentLocale();
|
|
19
|
+
const currentDisplayName = LANGUAGE_DISPLAY_NAMES[currentLocale];
|
|
20
|
+
console.log(chalk.cyan(`
|
|
21
|
+
\u{1F310} ${t("commands.language.title")}
|
|
22
|
+
`));
|
|
23
|
+
console.log(chalk.gray(`${t("commands.language.currentLanguage", { language: currentDisplayName })}`));
|
|
24
|
+
console.log();
|
|
25
|
+
const options = SUPPORTED_LOCALES.map((locale) => ({
|
|
26
|
+
label: locale === currentLocale ? `${LANGUAGE_DISPLAY_NAMES[locale]} (${t("common.current")})` : LANGUAGE_DISPLAY_NAMES[locale],
|
|
27
|
+
value: locale
|
|
28
|
+
}));
|
|
29
|
+
const result = await showModal({
|
|
30
|
+
title: t("commands.language.selectPrompt"),
|
|
31
|
+
options,
|
|
32
|
+
initialIndex: SUPPORTED_LOCALES.indexOf(currentLocale)
|
|
33
|
+
});
|
|
34
|
+
if (!result) {
|
|
35
|
+
console.log(chalk.gray("\nLanguage selection cancelled."));
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const selected = result.value;
|
|
39
|
+
if (selected === currentLocale) {
|
|
40
|
+
console.log(chalk.gray(`
|
|
41
|
+
${t("commands.language.noChange")}`));
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
await changeLanguage(selected);
|
|
45
|
+
ctx.config.ui = { ...ctx.config.ui, locale: selected };
|
|
46
|
+
await saveConfig(ctx.config);
|
|
47
|
+
const newDisplayName = LANGUAGE_DISPLAY_NAMES[selected];
|
|
48
|
+
console.log(chalk.green(`
|
|
49
|
+
\u2713 ${t("commands.language.changed", { language: newDisplayName })}`));
|
|
50
|
+
console.log();
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
async function languageInfo() {
|
|
54
|
+
const currentLocale = getCurrentLocale();
|
|
55
|
+
const currentDisplayName = LANGUAGE_DISPLAY_NAMES[currentLocale];
|
|
56
|
+
console.log(chalk.cyan(`
|
|
57
|
+
\u{1F310} ${t("commands.language.title")}
|
|
58
|
+
`));
|
|
59
|
+
console.log(chalk.gray(`${t("commands.language.currentLanguage", { language: currentDisplayName })}`));
|
|
60
|
+
console.log(chalk.gray(`Locale code: ${chalk.white(currentLocale)}`));
|
|
61
|
+
console.log();
|
|
62
|
+
console.log(chalk.gray("Supported languages:"));
|
|
63
|
+
for (const locale of SUPPORTED_LOCALES) {
|
|
64
|
+
const marker = locale === currentLocale ? chalk.green("\u25CF") : chalk.gray("\u25CB");
|
|
65
|
+
console.log(` ${marker} ${LANGUAGE_DISPLAY_NAMES[locale]}`);
|
|
66
|
+
}
|
|
67
|
+
console.log();
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
var metadata = {
|
|
71
|
+
command: "/language",
|
|
72
|
+
description: "change display language",
|
|
73
|
+
implemented: true
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
language,
|
|
78
|
+
languageInfo,
|
|
79
|
+
metadata
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @license
|
|
83
|
+
* Copyright 2025 Autohand AI LLC
|
|
84
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
85
|
+
*/
|