autohand-cli 0.7.9 → 0.7.11

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.
Files changed (254) hide show
  1. package/README.md +19 -0
  2. package/dist/{AutomodeManager-YVCJXOMQ.js → AutomodeManager-NGRAO2MH.js} +35 -8
  3. package/dist/{AutomodeManager-HV6M7EAX.cjs → AutomodeManager-ZKQMBM4T.cjs} +35 -8
  4. package/dist/{CommunitySkillsCache-YWDFZBKP.js → CommunitySkillsCache-ILWHWE5P.js} +2 -2
  5. package/dist/CommunitySkillsCache-KHC6RUJW.cjs +7 -0
  6. package/dist/MemoryManager-6ZT7IDO5.cjs +7 -0
  7. package/dist/MemoryManager-AJGS5AKB.js +7 -0
  8. package/dist/PermissionManager-HG6W2DGU.cjs +10 -0
  9. package/dist/{PermissionManager-WYP5JPCQ.js → PermissionManager-U5OMGR3L.js} +3 -3
  10. package/dist/SessionManager-BJ2G6VV4.cjs +9 -0
  11. package/dist/{SessionManager-SFBDIBGA.js → SessionManager-ENPGYK5J.js} +2 -2
  12. package/dist/SkillsRegistry-6ZFOCT25.cjs +8 -0
  13. package/dist/{SkillsRegistry-E437FFJV.js → SkillsRegistry-C2SHOZ5D.js} +2 -2
  14. package/dist/about-225R5LMN.cjs +11 -0
  15. package/dist/about-BCPUOQVH.js +11 -0
  16. package/dist/add-dir-3BMVJ5H3.cjs +9 -0
  17. package/dist/{add-dir-PNU7AGKO.js → add-dir-RP2BL3JW.js} +2 -1
  18. package/dist/agents-JQ2PHCQB.js +10 -0
  19. package/dist/agents-RGSZ2BM3.cjs +10 -0
  20. package/dist/agents-new-LSJN2L2T.cjs +13 -0
  21. package/dist/agents-new-MZUEVKSK.js +13 -0
  22. package/dist/automode-DP3BMYJB.cjs +9 -0
  23. package/dist/{automode-QCRJSBRT.js → automode-XOF3U3OB.js} +2 -1
  24. package/dist/{chunk-A5KU3JZW.cjs → chunk-34OGUMRO.cjs} +9 -5
  25. package/dist/{chunk-NTFNUTY2.js → chunk-3652ROFD.js} +2 -2
  26. package/dist/{chunk-KNLBEUAV.cjs → chunk-3DQSBW4B.cjs} +10 -6
  27. package/dist/{chunk-32R47CAQ.cjs → chunk-3S4DEIJP.cjs} +2 -2
  28. package/dist/chunk-46WX5IO2.cjs +499 -0
  29. package/dist/{chunk-IYZBLUEJ.js → chunk-4ULBAYME.js} +8 -6
  30. package/dist/{chunk-5UC3VAJ2.cjs → chunk-4XHHW7QX.cjs} +9 -8
  31. package/dist/{chunk-JRV4SOJU.cjs → chunk-5BQ57AZC.cjs} +9 -9
  32. package/dist/{chunk-7WKEDH3E.cjs → chunk-5FZM7KLB.cjs} +13 -10
  33. package/dist/{chunk-FN5S5OE7.cjs → chunk-5NZA4UB4.cjs} +3 -3
  34. package/dist/{chunk-PFS5ZOCO.js → chunk-5Q3W4DEU.js} +18 -10
  35. package/dist/{chunk-VMMGT42E.cjs → chunk-65GTO4QM.cjs} +7 -3
  36. package/dist/{chunk-CXZEPTRI.js → chunk-6P3K4YUW.js} +6 -2
  37. package/dist/chunk-73XIKTZL.js +124 -0
  38. package/dist/{chunk-P6EGMTK4.js → chunk-7QNW24ZT.js} +8 -4
  39. package/dist/{chunk-XT4OSHSB.cjs → chunk-AEYOIPHD.cjs} +6 -2
  40. package/dist/{chunk-KXNAGJE6.cjs → chunk-ANUQFV43.cjs} +6 -6
  41. package/dist/chunk-ATR3RORT.js +499 -0
  42. package/dist/{chunk-XOSFZHSS.js → chunk-B72CC4O6.js} +2 -2
  43. package/dist/{chunk-TAZJSKFD.js → chunk-BBIKQW66.js} +9 -5
  44. package/dist/{chunk-FFA4LDAO.cjs → chunk-BDIZGBDA.cjs} +8 -3
  45. package/dist/{chunk-YDJA5ETO.js → chunk-BG4OQUKP.js} +1 -1
  46. package/dist/chunk-BKGPWAEE.js +94 -0
  47. package/dist/{chunk-3DVEGFBZ.js → chunk-BODVOW7B.js} +64 -13
  48. package/dist/{chunk-7GJR65DQ.js → chunk-BXV5O6VU.js} +9 -8
  49. package/dist/{chunk-HUA44A35.cjs → chunk-BZ73ZQTE.cjs} +17 -11
  50. package/dist/{chunk-T7HQBZZB.cjs → chunk-C2E3GJEE.cjs} +12 -9
  51. package/dist/{chunk-UP6YRP44.js → chunk-C5SVIQG3.js} +10 -5
  52. package/dist/{chunk-4YQ2OJAL.js → chunk-D2XFTCRP.js} +1 -1
  53. package/dist/{chunk-R5PZPF55.js → chunk-DEAEO7RI.js} +1 -1
  54. package/dist/chunk-DMPVI3YK.cjs +400 -0
  55. package/dist/{chunk-DRXFJR7F.cjs → chunk-DMXN5LJB.cjs} +17 -16
  56. package/dist/{chunk-PVSYZXS7.js → chunk-DTXY7JDL.js} +11 -10
  57. package/dist/{chunk-C26EN22G.cjs → chunk-DUDDZRCS.cjs} +9 -5
  58. package/dist/{chunk-WT367RVU.js → chunk-E7YL3AHT.js} +15 -9
  59. package/dist/{chunk-CHVXUA3O.cjs → chunk-EV53SLSB.cjs} +4 -4
  60. package/dist/{chunk-VQDWNDP5.js → chunk-GD4AFYJ3.js} +1 -1
  61. package/dist/{chunk-AQNY2M6Q.cjs → chunk-GIZL57FE.cjs} +3 -1
  62. package/dist/{chunk-I4HVBWYF.js → chunk-GLAE5K5W.js} +7 -2
  63. package/dist/{chunk-4AMTDSQ3.cjs → chunk-HDSEJMWI.cjs} +6 -3
  64. package/dist/{chunk-ZWS3KSMK.js → chunk-HQQ4NKER.js} +5 -2
  65. package/dist/{chunk-WBDPILKI.cjs → chunk-HVOBMOZ2.cjs} +6 -2
  66. package/dist/{chunk-CMNQAF6C.js → chunk-IJFTBVSD.js} +12 -9
  67. package/dist/{chunk-RDGYHJ52.js → chunk-IPI3JXKP.js} +9 -6
  68. package/dist/chunk-JS7IPR7P.js +249 -0
  69. package/dist/{chunk-CPO5KEQS.cjs → chunk-KC5FPUOF.cjs} +2 -2
  70. package/dist/{chunk-TUO5SZRD.cjs → chunk-L42HTMMR.cjs} +2 -2
  71. package/dist/chunk-LOXOD4IS.cjs +8630 -0
  72. package/dist/{chunk-6DSJ7XST.cjs → chunk-LQ5V5YC7.cjs} +13 -10
  73. package/dist/chunk-M6N5HSY3.js +209 -0
  74. package/dist/{chunk-LJCSSR5V.cjs → chunk-MNCWB5F7.cjs} +5 -5
  75. package/dist/{chunk-BTVNRLSE.js → chunk-MYNHJHDZ.js} +1 -1
  76. package/dist/{chunk-O3EX3SAD.cjs → chunk-N4ZSG6JJ.cjs} +2 -2
  77. package/dist/{chunk-OO7EKEJH.cjs → chunk-NBD4PL2E.cjs} +17 -14
  78. package/dist/chunk-NF7RIHJK.js +45 -0
  79. package/dist/{chunk-KJAZ4YAR.cjs → chunk-NGBN2NGH.cjs} +76 -25
  80. package/dist/{chunk-MRDZHNCF.cjs → chunk-NRORJRD4.cjs} +4 -4
  81. package/dist/{chunk-OTS4YFSZ.cjs → chunk-OKABWSWA.cjs} +7 -3
  82. package/dist/{chunk-4BZ65NIH.js → chunk-OLG7LZBD.js} +1 -1
  83. package/dist/{chunk-KZ7VMQTC.js → chunk-OMEH2EVE.js} +5 -1
  84. package/dist/{chunk-LCBOOA7S.js → chunk-P5VDZ6PV.js} +1 -1
  85. package/dist/{chunk-V5MTBGM4.cjs → chunk-PA2H2263.cjs} +6 -2
  86. package/dist/chunk-PGRH5Q77.cjs +249 -0
  87. package/dist/chunk-PNSRJT46.js +380 -0
  88. package/dist/{chunk-UL5T2XIY.cjs → chunk-PSED4Z4X.cjs} +13 -11
  89. package/dist/{chunk-PGH3MHPP.js → chunk-PWLLLJHU.js} +3 -1
  90. package/dist/{chunk-DOTAX65F.js → chunk-PYLR4J2D.js} +8 -4
  91. package/dist/{chunk-3SDEZTZD.js → chunk-QC6IUDDJ.js} +1 -1
  92. package/dist/{chunk-WJICM4SK.cjs → chunk-QM7HZCQW.cjs} +11 -6
  93. package/dist/chunk-QRQ5EX7I.cjs +380 -0
  94. package/dist/{chunk-RX4KPL6H.js → chunk-QU64XI5X.js} +9 -6
  95. package/dist/{chunk-LKIKNRUP.js → chunk-R4OLUJV7.js} +8 -5
  96. package/dist/{chunk-FSTLJIR5.cjs → chunk-R7SDL3DJ.cjs} +16 -13
  97. package/dist/{chunk-LY5VN3B3.cjs → chunk-RJP3SZ7Q.cjs} +41 -253
  98. package/dist/{chunk-KS45GREN.js → chunk-RJXNNIFW.js} +7 -4
  99. package/dist/{chunk-LYMZDJX5.cjs → chunk-S5G7OEN2.cjs} +26 -18
  100. package/dist/{chunk-3DGR4GNN.cjs → chunk-SA4JOV4F.cjs} +10 -8
  101. package/dist/chunk-SAGM3TE3.cjs +94 -0
  102. package/dist/{chunk-WCN5WDOI.cjs → chunk-TSY7JHIV.cjs} +2 -2
  103. package/dist/chunk-U23U52ZN.cjs +124 -0
  104. package/dist/chunk-UET7BDX2.js +8630 -0
  105. package/dist/{chunk-J7VV7JAB.js → chunk-UM4QEO36.js} +6 -4
  106. package/dist/{chunk-NCLCL7JK.js → chunk-WD5ZF6HE.js} +1 -1
  107. package/dist/{chunk-HF65HHDU.cjs → chunk-WH5RW7DV.cjs} +24 -22
  108. package/dist/{chunk-GSOEIEOU.js → chunk-WJ276BIP.js} +5 -1
  109. package/dist/{chunk-OXJCLU3X.js → chunk-WLTVF77A.js} +1 -1
  110. package/dist/{chunk-WGO4ACS7.cjs → chunk-WOGJXDBU.cjs} +3 -3
  111. package/dist/{chunk-QJ53OSGF.js → chunk-WRJLBHWB.js} +6 -2
  112. package/dist/chunk-X4OLP5C5.cjs +209 -0
  113. package/dist/{chunk-HWDP4HQO.cjs → chunk-XL77XYI2.cjs} +4 -4
  114. package/dist/{chunk-QAJM6VG5.js → chunk-XLI7SHCH.js} +2 -2
  115. package/dist/chunk-Y27LG4BQ.cjs +45 -0
  116. package/dist/chunk-YKSSNFDZ.js +400 -0
  117. package/dist/{chunk-VRI7EXV6.js → chunk-YMDLUTF2.js} +5 -1
  118. package/dist/{chunk-J2RUI7GJ.js → chunk-YVY27BJT.js} +5 -3
  119. package/dist/{chunk-K6CZ2AGI.js → chunk-ZBIBLOZL.js} +35 -247
  120. package/dist/completion-HVSWU5GR.cjs +13 -0
  121. package/dist/completion-WJ2MVNDH.js +13 -0
  122. package/dist/constants-RBQTR32A.cjs +20 -0
  123. package/dist/{constants-OFIAR4E5.js → constants-V6J54N3X.js} +1 -1
  124. package/dist/export-NN7F5ANA.js +11 -0
  125. package/dist/export-UPS3AK2P.cjs +11 -0
  126. package/dist/feedback-KPNRMSP4.js +14 -0
  127. package/dist/feedback-OTXZVKE7.cjs +14 -0
  128. package/dist/help-M7NFPCM4.js +58 -0
  129. package/dist/help-UBHIUDQR.cjs +58 -0
  130. package/dist/history-2KUM6GN4.cjs +13 -0
  131. package/dist/history-RZFT34Q7.js +13 -0
  132. package/dist/hooks-7QSUBHBM.cjs +12 -0
  133. package/dist/hooks-S4MD4QSR.js +12 -0
  134. package/dist/i18n-6NKENUIV.js +32 -0
  135. package/dist/i18n-MXQXQOVE.cjs +32 -0
  136. package/dist/ide-5STDV43A.cjs +11 -0
  137. package/dist/ide-W2NYXOWQ.js +11 -0
  138. package/dist/index.cjs +15320 -12906
  139. package/dist/index.js +15465 -13051
  140. package/dist/init-FG5KEJCZ.cjs +9 -0
  141. package/dist/init-TV4MJDYK.js +9 -0
  142. package/dist/language-52Q7CSAY.cjs +16 -0
  143. package/dist/language-FXFDGOBF.js +16 -0
  144. package/dist/localProjectPermissions-2EATUDZM.cjs +17 -0
  145. package/dist/{localProjectPermissions-FD5AK5FB.js → localProjectPermissions-WQYMGI42.js} +2 -2
  146. package/dist/login-AN42IOBK.js +18 -0
  147. package/dist/login-I65V4TGU.cjs +18 -0
  148. package/dist/logout-KK5UWGNG.js +16 -0
  149. package/dist/logout-VYYNWBHZ.cjs +16 -0
  150. package/dist/mcp-4SKTDECJ.js +15 -0
  151. package/dist/mcp-AGWPTMAX.cjs +15 -0
  152. package/dist/mcp-install-3NN2HAYR.cjs +473 -0
  153. package/dist/mcp-install-KTV52DQK.js +473 -0
  154. package/dist/memory-LG4K6XV6.cjs +9 -0
  155. package/dist/{memory-4GSP7NKV.js → memory-LRDK2SYC.js} +2 -1
  156. package/dist/model-P5D7ATE7.cjs +9 -0
  157. package/dist/{model-HKEFSH5E.js → model-WBFJIGUN.js} +2 -1
  158. package/dist/{new-EEZC4XXV.js → new-5A7RQEKI.js} +2 -1
  159. package/dist/new-EAATWI2G.cjs +9 -0
  160. package/dist/permissions-5URK6C44.js +12 -0
  161. package/dist/permissions-CJUDVG63.cjs +12 -0
  162. package/dist/quit-A33JHDG7.cjs +9 -0
  163. package/dist/quit-IYBLN3DB.js +9 -0
  164. package/dist/resume-OPSJTCH7.cjs +12 -0
  165. package/dist/resume-TOWEEN5D.js +12 -0
  166. package/dist/search-GOLIE5BA.js +14 -0
  167. package/dist/search-H42HGUK5.cjs +14 -0
  168. package/dist/{sessions-4KXIT76T.js → sessions-B5NENDKY.js} +2 -1
  169. package/dist/sessions-YHAVEMWY.cjs +9 -0
  170. package/dist/share-3YWFZGNM.cjs +13 -0
  171. package/dist/share-T6I2LRGS.js +13 -0
  172. package/dist/{skills-PB4HXV4R.js → skills-ICEQ2TNC.js} +2 -1
  173. package/dist/skills-LFVNZOMF.cjs +13 -0
  174. package/dist/{skills-install-UBBNXWD5.js → skills-install-6RN7FVCP.js} +9 -8
  175. package/dist/{skills-install-7SFS24HY.cjs → skills-install-LU6GA2WF.cjs} +14 -13
  176. package/dist/skills-new-5BM5PDFX.cjs +14 -0
  177. package/dist/skills-new-KWBWOX74.js +14 -0
  178. package/dist/status-BAGXGSKE.js +10 -0
  179. package/dist/status-BMD2UFHC.cjs +10 -0
  180. package/dist/sync-6M3WRKMH.cjs +39 -0
  181. package/dist/sync-73D2MP65.cjs +16 -0
  182. package/dist/{sync-LYKDHRFM.js → sync-EXYX7HXW.js} +2 -2
  183. package/dist/sync-LL6M67CN.js +16 -0
  184. package/dist/theme-IFEI2IBJ.cjs +16 -0
  185. package/dist/theme-U3SKEULY.js +16 -0
  186. package/dist/ui/questionModal.cjs +28 -0
  187. package/dist/ui/questionModal.d.cts +11 -0
  188. package/dist/ui/questionModal.d.ts +11 -0
  189. package/dist/ui/questionModal.js +28 -0
  190. package/dist/undo-4DS67OAW.cjs +9 -0
  191. package/dist/undo-YMALVAPN.js +9 -0
  192. package/package.json +9 -8
  193. package/dist/CommunitySkillsCache-N2RWBCY2.cjs +0 -7
  194. package/dist/MemoryManager-J7APSLZ7.js +0 -7
  195. package/dist/MemoryManager-RLLYVIDY.cjs +0 -7
  196. package/dist/PermissionManager-ISI5OAJK.cjs +0 -10
  197. package/dist/SessionManager-7MF76Q3Q.cjs +0 -9
  198. package/dist/SkillsRegistry-UTK2YT4M.cjs +0 -8
  199. package/dist/add-dir-OMK3Y4DM.cjs +0 -8
  200. package/dist/agents-N2ZB4O2A.cjs +0 -9
  201. package/dist/agents-ZMT7HBRT.js +0 -9
  202. package/dist/agents-new-3EWS2NR3.cjs +0 -11
  203. package/dist/agents-new-TCGUYK5I.js +0 -11
  204. package/dist/automode-BRHUHGXU.cjs +0 -8
  205. package/dist/chunk-6SM6N7DJ.js +0 -2828
  206. package/dist/chunk-BEIG7V7Q.cjs +0 -51
  207. package/dist/chunk-L5QWMGLV.cjs +0 -2828
  208. package/dist/chunk-Z3Q2AFDS.js +0 -51
  209. package/dist/completion-NCSTSKTL.cjs +0 -11
  210. package/dist/completion-NTZERPAZ.js +0 -11
  211. package/dist/constants-B2X7KDIH.cjs +0 -20
  212. package/dist/export-5AJNVX4O.cjs +0 -9
  213. package/dist/export-ZQHTLV4W.js +0 -9
  214. package/dist/feedback-F7BMGSV6.cjs +0 -12
  215. package/dist/feedback-NL7CWTRY.js +0 -12
  216. package/dist/help-PKC6QCNG.js +0 -10
  217. package/dist/help-UEELQRHP.cjs +0 -10
  218. package/dist/hooks-AX5VPCZ3.cjs +0 -10
  219. package/dist/hooks-V22HVLQT.js +0 -10
  220. package/dist/init-DML7AOII.js +0 -8
  221. package/dist/init-SLLSDDJN.cjs +0 -8
  222. package/dist/language-IEKARNQH.js +0 -13
  223. package/dist/language-ULQCKXAD.cjs +0 -13
  224. package/dist/localProjectPermissions-7FI3XF4K.cjs +0 -17
  225. package/dist/login-PD3DFJLM.js +0 -15
  226. package/dist/login-VHGT4YKT.cjs +0 -15
  227. package/dist/logout-2QXNFGDT.js +0 -13
  228. package/dist/logout-A4SMKEFO.cjs +0 -13
  229. package/dist/memory-CFNC7RJH.cjs +0 -8
  230. package/dist/model-TKVEJ5BC.cjs +0 -8
  231. package/dist/new-EB2MBQXA.cjs +0 -8
  232. package/dist/permissions-S7433NQJ.js +0 -10
  233. package/dist/permissions-YZ6WCDBL.cjs +0 -10
  234. package/dist/quit-2RYFGIJP.cjs +0 -8
  235. package/dist/quit-RSYIERO5.js +0 -8
  236. package/dist/resume-54ERVSFM.cjs +0 -10
  237. package/dist/resume-YJ5CVKAP.js +0 -10
  238. package/dist/search-4TEQMUPU.js +0 -11
  239. package/dist/search-QGLS4SV7.cjs +0 -11
  240. package/dist/sessions-7RTCPVNE.cjs +0 -8
  241. package/dist/share-2B2T3AUU.cjs +0 -11
  242. package/dist/share-SZMXZIA3.js +0 -11
  243. package/dist/skills-HVQNCTGK.cjs +0 -12
  244. package/dist/skills-new-5FSDAJWE.js +0 -12
  245. package/dist/skills-new-IOTZYE6F.cjs +0 -12
  246. package/dist/status-AGPSKXSW.js +0 -9
  247. package/dist/status-WOINF556.cjs +0 -9
  248. package/dist/sync-64MZDWGG.js +0 -14
  249. package/dist/sync-F5ECJW25.cjs +0 -39
  250. package/dist/sync-W5UR7BEP.cjs +0 -14
  251. package/dist/theme-CWG3ZLHB.cjs +0 -13
  252. package/dist/theme-HQKV7YAP.js +0 -13
  253. package/dist/undo-2WR2ZIEC.cjs +0 -8
  254. package/dist/undo-7QJBXARS.js +0 -8
@@ -0,0 +1,473 @@
1
+ import {
2
+ safePrompt
3
+ } from "./chunk-WD5ZF6HE.js";
4
+ import {
5
+ saveConfig
6
+ } from "./chunk-ZBIBLOZL.js";
7
+ import "./chunk-JS7IPR7P.js";
8
+ import "./chunk-PNSRJT46.js";
9
+ import "./chunk-NF7RIHJK.js";
10
+ import {
11
+ AUTOHAND_PATHS
12
+ } from "./chunk-PWLLLJHU.js";
13
+ import "./chunk-UET7BDX2.js";
14
+
15
+ // src/commands/mcp-install.ts
16
+ import chalk from "chalk";
17
+
18
+ // src/mcp/McpRegistryFetcher.ts
19
+ var DEFAULT_REPO = "autohandai/community-mcp";
20
+ var DEFAULT_BRANCH = "main";
21
+ var McpRegistryFetcher = class {
22
+ constructor(config = {}) {
23
+ const repo = config.repo || DEFAULT_REPO;
24
+ const branch = config.branch || DEFAULT_BRANCH;
25
+ this.baseUrl = `https://raw.githubusercontent.com/${repo}/${branch}`;
26
+ this.timeout = config.timeout || 15e3;
27
+ }
28
+ /**
29
+ * Fetch the registry.json index file
30
+ */
31
+ async fetchRegistry() {
32
+ const url = `${this.baseUrl}/registry.json`;
33
+ const controller = new AbortController();
34
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
35
+ try {
36
+ const response = await fetch(url, {
37
+ headers: {
38
+ Accept: "application/json",
39
+ "User-Agent": "autohand-cli"
40
+ },
41
+ signal: controller.signal
42
+ });
43
+ if (!response.ok) {
44
+ throw new Error(`Failed to fetch MCP registry: HTTP ${response.status}`);
45
+ }
46
+ const data = await response.json();
47
+ return this.validateRegistry(data);
48
+ } finally {
49
+ clearTimeout(timeoutId);
50
+ }
51
+ }
52
+ /**
53
+ * Fetch a README file for a specific MCP server
54
+ */
55
+ async fetchServerReadme(serverDirectory) {
56
+ const url = `${this.baseUrl}/${serverDirectory}/README.md`;
57
+ const controller = new AbortController();
58
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
59
+ try {
60
+ const response = await fetch(url, {
61
+ headers: {
62
+ "User-Agent": "autohand-cli"
63
+ },
64
+ signal: controller.signal
65
+ });
66
+ if (!response.ok) {
67
+ throw new Error(`Failed to fetch README: HTTP ${response.status}`);
68
+ }
69
+ return response.text();
70
+ } finally {
71
+ clearTimeout(timeoutId);
72
+ }
73
+ }
74
+ /**
75
+ * Validate and normalize the registry data
76
+ */
77
+ validateRegistry(data) {
78
+ if (!data || typeof data !== "object") {
79
+ throw new Error("Invalid MCP registry: expected object");
80
+ }
81
+ const registry = data;
82
+ if (!Array.isArray(registry.servers)) {
83
+ throw new Error("Invalid MCP registry: missing servers array");
84
+ }
85
+ if (!Array.isArray(registry.categories)) {
86
+ throw new Error("Invalid MCP registry: missing categories array");
87
+ }
88
+ const validatedServers = [];
89
+ for (const server of registry.servers) {
90
+ if (this.isValidServer(server)) {
91
+ validatedServers.push(server);
92
+ }
93
+ }
94
+ return {
95
+ version: String(registry.version || "1.0.0"),
96
+ updatedAt: String(registry.updatedAt || (/* @__PURE__ */ new Date()).toISOString()),
97
+ servers: validatedServers,
98
+ categories: registry.categories
99
+ };
100
+ }
101
+ /**
102
+ * Type guard for valid MCP server objects
103
+ */
104
+ isValidServer(server) {
105
+ if (!server || typeof server !== "object") return false;
106
+ const s = server;
107
+ return typeof s.id === "string" && typeof s.name === "string" && typeof s.description === "string" && typeof s.directory === "string" && (s.transport === "stdio" || s.transport === "sse");
108
+ }
109
+ /**
110
+ * Search servers by query (client-side filtering)
111
+ */
112
+ filterServers(servers, query) {
113
+ if (!query.trim()) return servers;
114
+ const lowerQuery = query.toLowerCase();
115
+ return servers.filter((server) => {
116
+ const searchText = [
117
+ server.name,
118
+ server.description,
119
+ server.category,
120
+ ...server.tags || []
121
+ ].join(" ").toLowerCase();
122
+ return searchText.includes(lowerQuery);
123
+ });
124
+ }
125
+ /**
126
+ * Get servers by category
127
+ */
128
+ getServersByCategory(servers, categoryId) {
129
+ return servers.filter((server) => server.category === categoryId);
130
+ }
131
+ /**
132
+ * Get featured servers
133
+ */
134
+ getFeaturedServers(servers) {
135
+ return servers.filter((server) => server.isFeatured);
136
+ }
137
+ /**
138
+ * Find a server by name or ID
139
+ */
140
+ findServer(servers, nameOrId) {
141
+ const lower = nameOrId.toLowerCase();
142
+ return servers.find(
143
+ (s) => s.id.toLowerCase() === lower || s.name.toLowerCase() === lower
144
+ ) || null;
145
+ }
146
+ /**
147
+ * Find similar servers based on simple string matching
148
+ */
149
+ findSimilarServers(servers, query, limit = 5) {
150
+ const lower = query.toLowerCase();
151
+ const scored = servers.map((server) => {
152
+ let score = 0;
153
+ if (server.name.toLowerCase().includes(lower)) score += 10;
154
+ if (server.description.toLowerCase().includes(lower)) score += 5;
155
+ if (server.tags?.some((t) => t.toLowerCase().includes(lower))) score += 3;
156
+ return { server, score };
157
+ });
158
+ return scored.filter((s) => s.score > 0).sort((a, b) => b.score - a.score).slice(0, limit).map((s) => s.server);
159
+ }
160
+ };
161
+
162
+ // src/mcp/McpRegistryCache.ts
163
+ import fs from "fs-extra";
164
+ import path from "path";
165
+ var DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
166
+ var McpRegistryCache = class {
167
+ constructor(config = {}) {
168
+ this.cacheDir = config.cacheDir || AUTOHAND_PATHS.mcpCache;
169
+ this.ttlMs = config.ttlMs ?? DEFAULT_TTL_MS;
170
+ }
171
+ /**
172
+ * Get cached registry if it exists and is not expired
173
+ */
174
+ async getRegistry() {
175
+ const cached = await this.readCachedRegistry();
176
+ if (!cached) return null;
177
+ if (Date.now() - cached.fetchedAt >= this.ttlMs) {
178
+ return null;
179
+ }
180
+ return cached.registry;
181
+ }
182
+ /**
183
+ * Get cached registry ignoring TTL (for offline fallback)
184
+ */
185
+ async getRegistryIgnoreTTL() {
186
+ const cached = await this.readCachedRegistry();
187
+ return cached?.registry || null;
188
+ }
189
+ /**
190
+ * Save registry to cache
191
+ */
192
+ async setRegistry(registry, etag) {
193
+ const cached = {
194
+ registry,
195
+ fetchedAt: Date.now(),
196
+ etag
197
+ };
198
+ await fs.ensureDir(this.cacheDir);
199
+ await fs.writeJson(this.registryPath, cached, { spaces: 2 });
200
+ }
201
+ /**
202
+ * Clear all cached data
203
+ */
204
+ async clear() {
205
+ await fs.remove(this.cacheDir);
206
+ }
207
+ // ========== Private Methods ==========
208
+ get registryPath() {
209
+ return path.join(this.cacheDir, "registry.json");
210
+ }
211
+ async readCachedRegistry() {
212
+ if (!await fs.pathExists(this.registryPath)) {
213
+ return null;
214
+ }
215
+ try {
216
+ const data = await fs.readJson(this.registryPath);
217
+ if (typeof data === "object" && data !== null && typeof data.fetchedAt === "number" && data.registry && Array.isArray(data.registry.servers)) {
218
+ return data;
219
+ }
220
+ return null;
221
+ } catch {
222
+ return null;
223
+ }
224
+ }
225
+ };
226
+
227
+ // src/commands/mcp-install.ts
228
+ async function mcpInstall(ctx, serverName) {
229
+ const { mcpManager, config } = ctx;
230
+ if (!mcpManager || !config) {
231
+ console.log(chalk.red("MCP manager or config not available."));
232
+ return null;
233
+ }
234
+ const cache = new McpRegistryCache();
235
+ const fetcher = new McpRegistryFetcher();
236
+ let registry;
237
+ try {
238
+ const cached = await cache.getRegistry();
239
+ if (cached) {
240
+ registry = cached;
241
+ } else {
242
+ console.log(chalk.cyan("Fetching community MCP registry..."));
243
+ registry = await fetcher.fetchRegistry();
244
+ await cache.setRegistry(registry);
245
+ }
246
+ } catch (error) {
247
+ const stale = await cache.getRegistryIgnoreTTL();
248
+ if (stale) {
249
+ console.log(chalk.yellow("Using cached registry (offline mode)"));
250
+ registry = stale;
251
+ } else {
252
+ console.log(chalk.red("Failed to fetch MCP registry. Please check your internet connection."));
253
+ console.log(chalk.gray(error instanceof Error ? error.message : "Unknown error"));
254
+ return null;
255
+ }
256
+ }
257
+ if (serverName) {
258
+ return directInstall(ctx, registry, fetcher, serverName);
259
+ }
260
+ return interactiveBrowser(ctx, registry, fetcher);
261
+ }
262
+ async function directInstall(ctx, registry, fetcher, serverName) {
263
+ const server = fetcher.findServer(registry.servers, serverName);
264
+ if (!server) {
265
+ console.log(chalk.red(`MCP server not found: ${serverName}`));
266
+ const similar = fetcher.findSimilarServers(registry.servers, serverName, 3);
267
+ if (similar.length > 0) {
268
+ console.log(chalk.gray("Did you mean:"));
269
+ for (const s of similar) {
270
+ console.log(chalk.gray(` - ${s.name}: ${s.description}`));
271
+ }
272
+ }
273
+ return null;
274
+ }
275
+ return installServer(ctx, server);
276
+ }
277
+ async function interactiveBrowser(ctx, registry, fetcher) {
278
+ console.log();
279
+ console.log(chalk.bold.cyan("Community MCP Servers"));
280
+ console.log(chalk.gray("\u2500".repeat(50)));
281
+ console.log(chalk.gray(`${registry.servers.length} servers available`));
282
+ console.log();
283
+ console.log(chalk.bold("Categories:"));
284
+ for (const cat of registry.categories) {
285
+ const count = registry.servers.filter((s) => s.category === cat.id).length;
286
+ console.log(chalk.gray(` ${cat.name} (${count})`));
287
+ }
288
+ console.log();
289
+ const featured = fetcher.getFeaturedServers(registry.servers);
290
+ if (featured.length > 0) {
291
+ console.log(chalk.bold.yellow("Featured Servers:"));
292
+ for (const server of featured) {
293
+ const rating = server.rating ? `\u2605 ${server.rating.toFixed(1)}` : "";
294
+ console.log(` ${chalk.green("\u25CF")} ${chalk.bold(server.name)} ${chalk.gray(rating)}`);
295
+ console.log(chalk.gray(` ${server.description}`));
296
+ }
297
+ console.log();
298
+ }
299
+ const choices = registry.servers.map((server) => ({
300
+ name: server.id,
301
+ message: formatServerChoice(server),
302
+ value: server.id
303
+ }));
304
+ const answer = await safePrompt([
305
+ {
306
+ type: "autocomplete",
307
+ name: "server",
308
+ message: "Select a server to install (type to search)",
309
+ choices
310
+ }
311
+ ]);
312
+ if (!answer?.server) {
313
+ console.log(chalk.gray("No server selected."));
314
+ return null;
315
+ }
316
+ const selectedServer = registry.servers.find((s) => s.id === answer.server);
317
+ if (!selectedServer) {
318
+ console.log(chalk.red("Server not found."));
319
+ return null;
320
+ }
321
+ console.log();
322
+ console.log(chalk.bold.cyan(`Server: ${selectedServer.name}`));
323
+ console.log(chalk.gray("\u2500".repeat(50)));
324
+ console.log(chalk.white("Description: ") + selectedServer.description);
325
+ console.log(chalk.white("Category: ") + selectedServer.category);
326
+ console.log(chalk.white("Transport: ") + selectedServer.transport);
327
+ if (selectedServer.npmPackage) {
328
+ console.log(chalk.white("Package: ") + selectedServer.npmPackage);
329
+ }
330
+ if (selectedServer.tags?.length) {
331
+ console.log(chalk.white("Tags: ") + selectedServer.tags.join(", "));
332
+ }
333
+ if (selectedServer.envVars?.length) {
334
+ console.log(chalk.white("Required Env Vars: ") + selectedServer.envVars.join(", "));
335
+ }
336
+ if (selectedServer.requiredArgs?.length) {
337
+ console.log(chalk.white("Required Args: ") + selectedServer.requiredArgs.join(" "));
338
+ }
339
+ console.log();
340
+ return installServer(ctx, selectedServer);
341
+ }
342
+ async function installServer(ctx, server) {
343
+ const { mcpManager, config } = ctx;
344
+ if (!mcpManager || !config) {
345
+ return "MCP manager or config not available.";
346
+ }
347
+ if (config.mcp?.servers?.some((s) => s.name === server.id)) {
348
+ const confirm = await safePrompt([
349
+ {
350
+ type: "confirm",
351
+ name: "overwrite",
352
+ message: `Server "${server.name}" already installed. Overwrite?`,
353
+ initial: false
354
+ }
355
+ ]);
356
+ if (!confirm?.overwrite) {
357
+ console.log(chalk.gray("Installation cancelled."));
358
+ return null;
359
+ }
360
+ const idx = config.mcp.servers.findIndex((s) => s.name === server.id);
361
+ if (idx >= 0) {
362
+ try {
363
+ await mcpManager.disconnect(server.id);
364
+ } catch {
365
+ }
366
+ config.mcp.servers.splice(idx, 1);
367
+ }
368
+ }
369
+ if (server.envVars && server.envVars.length > 0) {
370
+ const missingVars = server.envVars.filter((v) => !process.env[v]);
371
+ if (missingVars.length > 0) {
372
+ console.log(chalk.yellow(`Required environment variables not set: ${missingVars.join(", ")}`));
373
+ console.log(chalk.gray("Set them in your shell profile or pass via env config."));
374
+ }
375
+ }
376
+ const serverArgs = server.args ? [...server.args] : [];
377
+ if (server.requiredArgs && server.requiredArgs.length > 0) {
378
+ console.log(chalk.yellow(`This server requires additional arguments: ${server.requiredArgs.join(" ")}`));
379
+ for (const reqArg of server.requiredArgs) {
380
+ const answer = await safePrompt([
381
+ {
382
+ type: "input",
383
+ name: "value",
384
+ message: `Enter value for ${reqArg}:`
385
+ }
386
+ ]);
387
+ if (answer?.value) {
388
+ serverArgs.push(answer.value);
389
+ }
390
+ }
391
+ }
392
+ const env = {};
393
+ if (server.envVars) {
394
+ for (const v of server.envVars) {
395
+ if (process.env[v]) {
396
+ env[v] = process.env[v];
397
+ }
398
+ }
399
+ }
400
+ const newServer = {
401
+ name: server.id,
402
+ transport: server.transport,
403
+ command: server.command,
404
+ args: serverArgs.length > 0 ? serverArgs : void 0,
405
+ env: Object.keys(env).length > 0 ? env : void 0,
406
+ autoConnect: true
407
+ };
408
+ if (!config.mcp) {
409
+ config.mcp = {};
410
+ }
411
+ if (!config.mcp.servers) {
412
+ config.mcp.servers = [];
413
+ }
414
+ config.mcp.servers.push(newServer);
415
+ try {
416
+ await saveConfig(config);
417
+ console.log(chalk.green(`\u2713 Installed ${server.name} to config`));
418
+ try {
419
+ console.log(chalk.cyan(`Connecting to ${server.name}...`));
420
+ await mcpManager.connect(newServer);
421
+ const tools = mcpManager.getToolsForServer(server.id);
422
+ console.log(chalk.green(`\u2713 Connected (${tools.length} tools available)`));
423
+ return `MCP server "${server.name}" installed and connected successfully.`;
424
+ } catch (connectError) {
425
+ console.log(chalk.yellow(`Installed but could not connect: ${connectError instanceof Error ? connectError.message : "Unknown error"}`));
426
+ return `MCP server "${server.name}" installed. Connect manually with /mcp connect ${server.id}`;
427
+ }
428
+ } catch (error) {
429
+ console.log(chalk.red("Failed to save config."));
430
+ console.log(chalk.gray(error instanceof Error ? error.message : "Unknown error"));
431
+ return null;
432
+ }
433
+ }
434
+ function formatServerChoice(server) {
435
+ const parts = [];
436
+ if (server.isFeatured) {
437
+ parts.push(chalk.yellow("\u2605"));
438
+ } else if (server.isCurated) {
439
+ parts.push(chalk.green("\u2713"));
440
+ } else {
441
+ parts.push(" ");
442
+ }
443
+ parts.push(chalk.bold(server.name.padEnd(25)));
444
+ if (server.rating) {
445
+ parts.push(chalk.gray(`${server.rating.toFixed(1)}`));
446
+ }
447
+ parts.push(chalk.gray(server.description.slice(0, 40)));
448
+ return parts.join(" ");
449
+ }
450
+ export {
451
+ mcpInstall
452
+ };
453
+ /**
454
+ * @license
455
+ * Copyright 2025 Autohand AI LLC
456
+ * SPDX-License-Identifier: Apache-2.0
457
+ *
458
+ * McpRegistryFetcher - Fetches community MCP server registry from GitHub
459
+ */
460
+ /**
461
+ * @license
462
+ * Copyright 2025 Autohand AI LLC
463
+ * SPDX-License-Identifier: Apache-2.0
464
+ *
465
+ * McpRegistryCache - TTL-based caching for community MCP registry
466
+ */
467
+ /**
468
+ * @license
469
+ * Copyright 2025 Autohand AI LLC
470
+ * SPDX-License-Identifier: Apache-2.0
471
+ *
472
+ * MCP install command - Browse and install community MCP servers from GitHub
473
+ */
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk3DQSBW4Bcjs = require('./chunk-3DQSBW4B.cjs');
5
+ require('./chunk-LOXOD4IS.cjs');
6
+
7
+
8
+
9
+ exports.memory = _chunk3DQSBW4Bcjs.memory; exports.metadata = _chunk3DQSBW4Bcjs.metadata;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  memory,
3
3
  metadata
4
- } from "./chunk-TAZJSKFD.js";
4
+ } from "./chunk-BBIKQW66.js";
5
+ import "./chunk-UET7BDX2.js";
5
6
  export {
6
7
  memory,
7
8
  metadata
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkAEYOIPHDcjs = require('./chunk-AEYOIPHD.cjs');
5
+ require('./chunk-LOXOD4IS.cjs');
6
+
7
+
8
+
9
+ exports.metadata = _chunkAEYOIPHDcjs.metadata; exports.model = _chunkAEYOIPHDcjs.model;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  metadata,
3
3
  model
4
- } from "./chunk-KZ7VMQTC.js";
4
+ } from "./chunk-OMEH2EVE.js";
5
+ import "./chunk-UET7BDX2.js";
5
6
  export {
6
7
  metadata,
7
8
  model
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  metadata,
3
3
  newConversation
4
- } from "./chunk-ZWS3KSMK.js";
4
+ } from "./chunk-HQQ4NKER.js";
5
+ import "./chunk-UET7BDX2.js";
5
6
  export {
6
7
  metadata,
7
8
  newConversation
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkHDSEJMWIcjs = require('./chunk-HDSEJMWI.cjs');
5
+ require('./chunk-LOXOD4IS.cjs');
6
+
7
+
8
+
9
+ exports.metadata = _chunkHDSEJMWIcjs.metadata; exports.newConversation = _chunkHDSEJMWIcjs.newConversation;
@@ -0,0 +1,12 @@
1
+ import {
2
+ metadata,
3
+ permissions
4
+ } from "./chunk-QU64XI5X.js";
5
+ import "./chunk-WD5ZF6HE.js";
6
+ import "./chunk-PNSRJT46.js";
7
+ import "./chunk-NF7RIHJK.js";
8
+ import "./chunk-UET7BDX2.js";
9
+ export {
10
+ metadata,
11
+ permissions
12
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk5FZM7KLBcjs = require('./chunk-5FZM7KLB.cjs');
5
+ require('./chunk-MNCWB5F7.cjs');
6
+ require('./chunk-QRQ5EX7I.cjs');
7
+ require('./chunk-Y27LG4BQ.cjs');
8
+ require('./chunk-LOXOD4IS.cjs');
9
+
10
+
11
+
12
+ exports.metadata = _chunk5FZM7KLBcjs.metadata; exports.permissions = _chunk5FZM7KLBcjs.permissions;
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkHVOBMOZ2cjs = require('./chunk-HVOBMOZ2.cjs');
5
+ require('./chunk-LOXOD4IS.cjs');
6
+
7
+
8
+
9
+ exports.metadata = _chunkHVOBMOZ2cjs.metadata; exports.quit = _chunkHVOBMOZ2cjs.quit;
@@ -0,0 +1,9 @@
1
+ import {
2
+ metadata,
3
+ quit
4
+ } from "./chunk-WJ276BIP.js";
5
+ import "./chunk-UET7BDX2.js";
6
+ export {
7
+ metadata,
8
+ quit
9
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkBZ73ZQTEcjs = require('./chunk-BZ73ZQTE.cjs');
5
+ require('./chunk-QRQ5EX7I.cjs');
6
+ require('./chunk-Y27LG4BQ.cjs');
7
+ require('./chunk-GIZL57FE.cjs');
8
+ require('./chunk-LOXOD4IS.cjs');
9
+
10
+
11
+
12
+ exports.metadata = _chunkBZ73ZQTEcjs.metadata; exports.resume = _chunkBZ73ZQTEcjs.resume;
@@ -0,0 +1,12 @@
1
+ import {
2
+ metadata,
3
+ resume
4
+ } from "./chunk-E7YL3AHT.js";
5
+ import "./chunk-PNSRJT46.js";
6
+ import "./chunk-NF7RIHJK.js";
7
+ import "./chunk-PWLLLJHU.js";
8
+ import "./chunk-UET7BDX2.js";
9
+ export {
10
+ metadata,
11
+ resume
12
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ metadata,
3
+ search
4
+ } from "./chunk-3652ROFD.js";
5
+ import "./chunk-ZBIBLOZL.js";
6
+ import "./chunk-JS7IPR7P.js";
7
+ import "./chunk-PNSRJT46.js";
8
+ import "./chunk-NF7RIHJK.js";
9
+ import "./chunk-PWLLLJHU.js";
10
+ import "./chunk-UET7BDX2.js";
11
+ export {
12
+ metadata,
13
+ search
14
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkANUQFV43cjs = require('./chunk-ANUQFV43.cjs');
5
+ require('./chunk-RJP3SZ7Q.cjs');
6
+ require('./chunk-PGRH5Q77.cjs');
7
+ require('./chunk-QRQ5EX7I.cjs');
8
+ require('./chunk-Y27LG4BQ.cjs');
9
+ require('./chunk-GIZL57FE.cjs');
10
+ require('./chunk-LOXOD4IS.cjs');
11
+
12
+
13
+
14
+ exports.metadata = _chunkANUQFV43cjs.metadata; exports.search = _chunkANUQFV43cjs.search;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  metadata,
3
3
  sessions
4
- } from "./chunk-QJ53OSGF.js";
4
+ } from "./chunk-WRJLBHWB.js";
5
+ import "./chunk-UET7BDX2.js";
5
6
  export {
6
7
  metadata,
7
8
  sessions
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk65GTO4QMcjs = require('./chunk-65GTO4QM.cjs');
5
+ require('./chunk-LOXOD4IS.cjs');
6
+
7
+
8
+
9
+ exports.metadata = _chunk65GTO4QMcjs.metadata; exports.sessions = _chunk65GTO4QMcjs.sessions;
@@ -0,0 +1,13 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkDMXN5LJBcjs = require('./chunk-DMXN5LJB.cjs');
5
+ require('./chunk-4XHHW7QX.cjs');
6
+ require('./chunk-QRQ5EX7I.cjs');
7
+ require('./chunk-Y27LG4BQ.cjs');
8
+ require('./chunk-GIZL57FE.cjs');
9
+ require('./chunk-LOXOD4IS.cjs');
10
+
11
+
12
+
13
+ exports.execute = _chunkDMXN5LJBcjs.execute; exports.metadata = _chunkDMXN5LJBcjs.metadata;
@@ -0,0 +1,13 @@
1
+ import {
2
+ execute,
3
+ metadata
4
+ } from "./chunk-DTXY7JDL.js";
5
+ import "./chunk-BXV5O6VU.js";
6
+ import "./chunk-PNSRJT46.js";
7
+ import "./chunk-NF7RIHJK.js";
8
+ import "./chunk-PWLLLJHU.js";
9
+ import "./chunk-UET7BDX2.js";
10
+ export {
11
+ execute,
12
+ metadata
13
+ };