autohand-cli 0.8.2 → 0.9.0

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 (551) hide show
  1. package/README.md +173 -74
  2. package/dist/AgentRegistry-EGBDIUAK.cjs +10 -0
  3. package/dist/{AgentRegistry-7LDL5HJH.js → AgentRegistry-XPWSVO3Q.js} +3 -3
  4. package/dist/{AutomodeManager-MWLKGPZK.js → AutomodeManager-APLLPEYJ.js} +32 -18
  5. package/dist/{AutomodeManager-NYIZNODK.cjs → AutomodeManager-MPSXT2RH.cjs} +38 -24
  6. package/dist/CommunitySkillsCache-2OIUV227.cjs +8 -0
  7. package/dist/CommunitySkillsCache-ZEQWP6YM.js +8 -0
  8. package/dist/GitHubRegistryFetcher-CYJLF2XL.cjs +7 -0
  9. package/dist/{GitHubRegistryFetcher-6JQ5JEDZ.js → GitHubRegistryFetcher-J2BWPXJF.js} +2 -2
  10. package/dist/HookManager-CWLTFKWO.js +7 -0
  11. package/dist/HookManager-TMAJQU4S.cjs +7 -0
  12. package/dist/{ImportWizard-35YBJ4AM.cjs → ImportWizard-MQXEED2U.cjs} +41 -17
  13. package/dist/{ImportWizard-XH7CINCH.js → ImportWizard-QBKQEXDW.js} +35 -11
  14. package/dist/LearnAdvisor-46FG2XIP.js +9 -0
  15. package/dist/LearnAdvisor-XBRDNAGH.cjs +9 -0
  16. package/dist/McpClientManager-BNSKLHIN.cjs +8 -0
  17. package/dist/{McpClientManager-7RM6YT35.js → McpClientManager-SL35BR24.js} +2 -2
  18. package/dist/MemoryManager-34L4YOKA.cjs +8 -0
  19. package/dist/MemoryManager-WJMLPWGU.js +8 -0
  20. package/dist/NVIDIAProvider-2HR737UE.js +14 -0
  21. package/dist/NVIDIAProvider-MVTL62PR.cjs +14 -0
  22. package/dist/PermissionManager-5OOJ7FAT.cjs +11 -0
  23. package/dist/{PermissionManager-ATUV34LQ.js → PermissionManager-KMYILJ4Z.js} +4 -4
  24. package/dist/{ProjectProfiler-ZDWR2ODG.cjs → ProjectProfiler-CDAE7ECW.cjs} +2 -1
  25. package/dist/{ProjectProfiler-UMJJSOCE.js → ProjectProfiler-NZTJDRHD.js} +2 -1
  26. package/dist/ProviderFactory-C3YPXTDD.cjs +11 -0
  27. package/dist/ProviderFactory-HFPRVQ25.js +11 -0
  28. package/dist/SessionManager-PNBTJJTQ.js +10 -0
  29. package/dist/SessionManager-WAPTFMDO.cjs +10 -0
  30. package/dist/SkillsRegistry-4RRD5GMX.js +9 -0
  31. package/dist/SkillsRegistry-7AJP74GJ.cjs +9 -0
  32. package/dist/SubAgent-FDIH3DXB.js +11 -0
  33. package/dist/SubAgent-HVL2ICVZ.cjs +11 -0
  34. package/dist/{SyncApiClient-LVIO4C2S.js → SyncApiClient-LRPFNCKJ.js} +2 -2
  35. package/dist/SyncApiClient-VMBOLQ6H.cjs +11 -0
  36. package/dist/about-BW3PDZUU.js +14 -0
  37. package/dist/about-FCAX37YC.cjs +14 -0
  38. package/dist/acp-EOETGAHC.cjs +1517 -0
  39. package/dist/acp-VHEL7BOW.js +1517 -0
  40. package/dist/actionExecutor-33I47NZS.js +24 -0
  41. package/dist/actionExecutor-4YBMR3YH.cjs +24 -0
  42. package/dist/add-dir-7SS6KSH5.cjs +11 -0
  43. package/dist/add-dir-VFX7QT4E.js +11 -0
  44. package/dist/agent-DMRUFU4M.cjs +116 -0
  45. package/dist/agent-WCJEYQJT.js +116 -0
  46. package/dist/agents/builtin/code-cleaner.md +1 -1
  47. package/dist/agents/builtin/docs-writer.md +1 -1
  48. package/dist/agents/builtin/researcher.md +2 -2
  49. package/dist/agents/builtin/reviewer.md +1 -1
  50. package/dist/agents/builtin/tester.md +1 -1
  51. package/dist/agents/builtin/todo-resolver.md +1 -1
  52. package/dist/agents-CHROO3VU.cjs +17 -0
  53. package/dist/agents-UVDUL65K.js +17 -0
  54. package/dist/agents-new-AUBWSOXP.js +17 -0
  55. package/dist/agents-new-Y562WC47.cjs +17 -0
  56. package/dist/{autoSkill-6TGBTEQD.js → autoSkill-EFMK6WU6.js} +3 -3
  57. package/dist/autoSkill-YOLLFTP2.cjs +20 -0
  58. package/dist/automode-BMYSRM34.js +10 -0
  59. package/dist/automode-DBLKTTKD.cjs +10 -0
  60. package/dist/browserToolBridge-BXRQB4B4.cjs +58 -0
  61. package/dist/browserToolBridge-F5N66PE7.js +58 -0
  62. package/dist/{cc-7LEIJ3KF.js → cc-AYEP2CA3.js} +1 -1
  63. package/dist/{cc-Q5MM4AWC.cjs → cc-S2QLQFBR.cjs} +1 -1
  64. package/dist/chrome-ATC4OO5I.cjs +20 -0
  65. package/dist/chrome-NHJ44WUN.js +50 -0
  66. package/dist/chrome-O62WXV7F.js +20 -0
  67. package/dist/chrome-XHJLCO4M.cjs +50 -0
  68. package/dist/chromeSkill-53TH55PM.js +105 -0
  69. package/dist/chromeSkill-THW7N4IY.cjs +105 -0
  70. package/dist/{chunk-HOAHWIQ5.cjs → chunk-2CGE7ZV3.cjs} +26 -26
  71. package/dist/chunk-2H5O745H.js +63 -0
  72. package/dist/chunk-2HOLOHVK.js +2219 -0
  73. package/dist/{chunk-3PDTTAKJ.js → chunk-2QL6MNXG.js} +15 -8
  74. package/dist/{chunk-PGRH5Q77.cjs → chunk-2VHB43IX.cjs} +35 -6
  75. package/dist/{chunk-VG34MG2U.js → chunk-37M5UM6I.js} +9 -6
  76. package/dist/{chunk-6HYLHBQG.cjs → chunk-3DDL2E55.cjs} +20 -16
  77. package/dist/chunk-3EDDDZS2.cjs +5 -0
  78. package/dist/{chunk-6OYHF6MF.js → chunk-3GUEUCZK.js} +28 -4
  79. package/dist/{chunk-N254NRHT.cjs → chunk-3HT76LNN.cjs} +9 -2
  80. package/dist/{chunk-DVUHHH3B.cjs → chunk-3KLSNNRW.cjs} +4 -4
  81. package/dist/chunk-3LJJG5YY.cjs +387 -0
  82. package/dist/chunk-3OF56EMA.cjs +197 -0
  83. package/dist/chunk-3PXKRVCW.js +108 -0
  84. package/dist/{chunk-IKGWDOGU.cjs → chunk-3S563FNF.cjs} +160 -79
  85. package/dist/chunk-3UT7R3XV.js +663 -0
  86. package/dist/chunk-4256YRCO.cjs +80 -0
  87. package/dist/chunk-46C73ZKK.cjs +663 -0
  88. package/dist/chunk-46MTALKD.js +44 -0
  89. package/dist/{chunk-AEJH23FO.cjs → chunk-47PHDKNW.cjs} +6 -6
  90. package/dist/chunk-4LMUDS2K.js +124 -0
  91. package/dist/{chunk-HLHTG5ZU.cjs → chunk-5CMYEM3R.cjs} +14 -12
  92. package/dist/{chunk-MBBY4ZIK.js → chunk-5F6ZKSHO.js} +4 -1
  93. package/dist/chunk-5JFTY3VU.js +74 -0
  94. package/dist/chunk-5JTTM5SC.js +59 -0
  95. package/dist/{chunk-IETRBBMP.cjs → chunk-5K3CDSWZ.cjs} +108 -31
  96. package/dist/{chunk-GJH7XMSK.js → chunk-5VHP6HDQ.js} +8 -6
  97. package/dist/{chunk-6ZCULLCA.js → chunk-62RTC3XX.js} +1 -1
  98. package/dist/{chunk-MSED7RH2.cjs → chunk-6GUODJKM.cjs} +112 -41
  99. package/dist/{chunk-47CKWKEX.cjs → chunk-6HH236FV.cjs} +9 -4
  100. package/dist/{chunk-WHE2SWHU.js → chunk-6NVAK6CK.js} +2 -2
  101. package/dist/chunk-6R25D2H5.js +121 -0
  102. package/dist/{chunk-3PCTTUNW.cjs → chunk-6XVVIY54.cjs} +55 -25
  103. package/dist/{chunk-3L53OA4E.cjs → chunk-75EDROHL.cjs} +10 -10
  104. package/dist/{chunk-G4CAKI3V.js → chunk-7HPWMALN.js} +7 -2
  105. package/dist/chunk-7JLT2VNW.cjs +18963 -0
  106. package/dist/chunk-7LWQCE4Y.cjs +987 -0
  107. package/dist/{chunk-OLSBBZW6.cjs → chunk-7MU7LWF3.cjs} +5 -5
  108. package/dist/{chunk-HLQV64Y5.js → chunk-7RFJB75Y.js} +140 -59
  109. package/dist/{chunk-X2MSVKDV.js → chunk-A7HHCIDQ.js} +2 -2
  110. package/dist/{chunk-SKYG33B2.cjs → chunk-AC7DZ6SK.cjs} +3 -3
  111. package/dist/{chunk-XX2ZO7DS.js → chunk-ACDQGA4Z.js} +90 -16
  112. package/dist/{chunk-CZXGCVTR.cjs → chunk-AOKCI722.cjs} +2 -2
  113. package/dist/chunk-ARBEHFCG.js +715 -0
  114. package/dist/{chunk-OOKY3HPZ.js → chunk-AT7OWLY5.js} +50 -9
  115. package/dist/chunk-AU6JAGZJ.cjs +231 -0
  116. package/dist/chunk-AUFNACED.js +18963 -0
  117. package/dist/{chunk-CDBPBM2K.cjs → chunk-AUYSIEVV.cjs} +3 -3
  118. package/dist/chunk-B4HSNOIH.cjs +354 -0
  119. package/dist/{chunk-EGMZDTSL.js → chunk-B5CGDNMR.js} +10 -2
  120. package/dist/{chunk-34M3HWLR.js → chunk-BFQDQRDE.js} +2 -2
  121. package/dist/{chunk-2AA5MFES.js → chunk-BL2UC7HC.js} +8 -5
  122. package/dist/{chunk-LNMYK2F5.cjs → chunk-BQ22N3TX.cjs} +56 -41
  123. package/dist/chunk-BQU3HAE7.js +21 -0
  124. package/dist/chunk-BWF4VDYE.js +3897 -0
  125. package/dist/chunk-BYE7RQFZ.cjs +121 -0
  126. package/dist/{chunk-APIXPPMT.js → chunk-CBFH2J3O.js} +855 -33
  127. package/dist/chunk-CCVMREXI.js +420 -0
  128. package/dist/chunk-CFAWTLSC.js +13 -0
  129. package/dist/{chunk-G27PQQFD.js → chunk-CFFE4VA3.js} +1 -1
  130. package/dist/{chunk-ZYQMLKOK.cjs → chunk-CH2J4PVE.cjs} +212 -70
  131. package/dist/{chunk-7BTSG4ME.cjs → chunk-CHI52KFR.cjs} +855 -33
  132. package/dist/{chunk-DJDE4DTT.cjs → chunk-CWINVFRI.cjs} +25 -19
  133. package/dist/{chunk-HXGBSJL5.cjs → chunk-D2OSPLYC.cjs} +2 -2
  134. package/dist/{chunk-GBHDROGL.js → chunk-D6GZBSOX.js} +16 -4
  135. package/dist/{chunk-CNBKZEX5.cjs → chunk-DA7NBAJK.cjs} +49 -17
  136. package/dist/chunk-DEQVRSV5.cjs +866 -0
  137. package/dist/{chunk-RGR6ME5J.cjs → chunk-DI57A4BX.cjs} +25 -28
  138. package/dist/{chunk-WM5PAOTQ.cjs → chunk-DIZTWFVR.cjs} +1649 -484
  139. package/dist/{chunk-YZXUDM5X.js → chunk-DLP436GI.js} +204 -62
  140. package/dist/{chunk-OHUZKDGX.js → chunk-DMRXF5DU.js} +3 -3
  141. package/dist/{chunk-U46VYPLR.cjs → chunk-DPSIGY6L.cjs} +9 -9
  142. package/dist/{chunk-DN573ME7.cjs → chunk-DRWDEHE5.cjs} +4 -4
  143. package/dist/{chunk-SEKD5FH3.cjs → chunk-E26KKI46.cjs} +5 -2
  144. package/dist/{chunk-J4Q7XR3G.js → chunk-E46DJH5S.js} +3 -3
  145. package/dist/{chunk-Q7XSCYND.cjs → chunk-E6GFD7VR.cjs} +49 -26
  146. package/dist/chunk-ES2HJQ4N.js +37 -0
  147. package/dist/chunk-EZJHLOWP.js +80 -0
  148. package/dist/chunk-FFBDRUO5.cjs +59 -0
  149. package/dist/{chunk-AYSFIUFW.js → chunk-FGT6KK6T.js} +38 -15
  150. package/dist/{chunk-SAHBLB3E.js → chunk-FP46B4X3.js} +208 -3
  151. package/dist/{chunk-DSPQEHDT.js → chunk-FQAVGSPW.js} +2 -2
  152. package/dist/chunk-FQVG6ZHF.js +197 -0
  153. package/dist/chunk-GBMDFWJX.cjs +152 -0
  154. package/dist/{chunk-DRE2RXBZ.js → chunk-GGLKUENP.js} +1605 -440
  155. package/dist/{chunk-S52YW5ZQ.js → chunk-GNBBIAMD.js} +16 -19
  156. package/dist/{chunk-MYISNQH4.js → chunk-GWO66KBI.js} +1 -1
  157. package/dist/chunk-GWY26SUD.cjs +63 -0
  158. package/dist/{chunk-YGN4CQIP.js → chunk-GZ6DV2UG.js} +1 -1
  159. package/dist/{chunk-EZMINVLU.js → chunk-H4D2Q2AL.js} +5 -2
  160. package/dist/chunk-HDK2EHVH.cjs +570 -0
  161. package/dist/chunk-HJIXWGQZ.js +139 -0
  162. package/dist/{chunk-6RF7UKUS.js → chunk-HKYZSUQ5.js} +48 -47
  163. package/dist/{chunk-LQGVEP3E.js → chunk-HQUSEWT4.js} +45 -13
  164. package/dist/{chunk-HTLINWX6.cjs → chunk-HQWQZML5.cjs} +16 -13
  165. package/dist/{chunk-DVZOENQ7.cjs → chunk-HS4USDND.cjs} +9 -4
  166. package/dist/chunk-HSCUPEA4.cjs +3897 -0
  167. package/dist/{chunk-JCLYQ2JC.js → chunk-HXJEGMGB.js} +12 -6
  168. package/dist/{chunk-LJFUXC56.cjs → chunk-HXQREVTA.cjs} +9 -6
  169. package/dist/{chunk-SCXX4LW5.js → chunk-I24CWKKK.js} +15 -8
  170. package/dist/chunk-IAGCRVJ3.js +355 -0
  171. package/dist/chunk-IEXKKKOF.cjs +92 -0
  172. package/dist/{chunk-5IXII4HX.cjs → chunk-IGMPWJ2I.cjs} +19 -12
  173. package/dist/chunk-IKUMVBCW.cjs +33 -0
  174. package/dist/{chunk-XTB6VJVQ.cjs → chunk-J2K57QM7.cjs} +6 -6
  175. package/dist/{chunk-O4IF4NJT.cjs → chunk-J5ADZN6V.cjs} +57 -56
  176. package/dist/chunk-J5HE6CUM.cjs +124 -0
  177. package/dist/{chunk-JS7IPR7P.js → chunk-JAQO6XDB.js} +31 -2
  178. package/dist/chunk-JIMSII7R.js +987 -0
  179. package/dist/chunk-JJ4KA7HK.cjs +2219 -0
  180. package/dist/chunk-JMN3GZU6.js +570 -0
  181. package/dist/{chunk-X5VSP65C.cjs → chunk-JP3YHTQ2.cjs} +4 -4
  182. package/dist/{chunk-SKV2F3NM.js → chunk-JYKPWK5O.js} +1 -1
  183. package/dist/{chunk-NNPAM4HC.cjs → chunk-KNTUI4TZ.cjs} +12 -6
  184. package/dist/{chunk-HIVRCQS2.js → chunk-L4F7SUYL.js} +56 -25
  185. package/dist/{chunk-C5IJIM2V.cjs → chunk-LDJQ5QHG.cjs} +68 -37
  186. package/dist/{chunk-ULQ6MDSJ.cjs → chunk-LFDPTJYF.cjs} +43 -35
  187. package/dist/chunk-LJD7KR3L.cjs +44 -0
  188. package/dist/chunk-LN7D3EJZ.js +387 -0
  189. package/dist/{chunk-643VRA5S.cjs → chunk-LQBONA55.cjs} +32 -8
  190. package/dist/{chunk-NCC6ETZS.js → chunk-LUMV3DB2.js} +41 -33
  191. package/dist/chunk-M4KNC5BQ.js +78 -0
  192. package/dist/chunk-MO4KP6XS.cjs +229 -0
  193. package/dist/{chunk-BVKXEQVG.cjs → chunk-MOJ7ADW4.cjs} +22 -10
  194. package/dist/chunk-MPULXVC4.cjs +715 -0
  195. package/dist/{chunk-X5YJ34FZ.cjs → chunk-MQESBFBZ.cjs} +46 -23
  196. package/dist/chunk-MUNUUFU7.cjs +21 -0
  197. package/dist/{chunk-X3WS5LDG.js → chunk-MX75JYIY.js} +7 -5
  198. package/dist/chunk-MXVIDIC6.cjs +139 -0
  199. package/dist/{chunk-3K2ESU53.cjs → chunk-N6O3XUZ2.cjs} +2 -2
  200. package/dist/{chunk-IVM5F2AE.js → chunk-NBGOIFKP.js} +265 -18
  201. package/dist/{chunk-SLQAYV3W.js → chunk-NMQ47RCG.js} +8 -2
  202. package/dist/{chunk-JYTDYJVW.js → chunk-O64I2GYI.js} +1 -1
  203. package/dist/{chunk-IFFXSTOM.cjs → chunk-O6TQP7U7.cjs} +3 -3
  204. package/dist/{chunk-AYS2ASM7.js → chunk-OHWMWKJQ.js} +1 -1
  205. package/dist/{chunk-N23UAW4I.js → chunk-OM24WXEE.js} +7 -2
  206. package/dist/{chunk-MAKMSQMQ.cjs → chunk-OPNI6O7F.cjs} +8 -6
  207. package/dist/chunk-OR67YXQK.cjs +13 -0
  208. package/dist/{chunk-QOXPOR5D.js → chunk-OV3PVUYN.js} +115 -44
  209. package/dist/{chunk-TNZRZQ7Q.js → chunk-PB7W7R72.js} +3 -78
  210. package/dist/chunk-PCM3N3CL.cjs +37 -0
  211. package/dist/{chunk-A4IJHHV7.cjs → chunk-PDHT7LQS.cjs} +52 -11
  212. package/dist/{chunk-LA7H35XM.cjs → chunk-PHJO5YAL.cjs} +9 -9
  213. package/dist/{chunk-KPELYZ6L.js → chunk-PQLKJCIE.js} +2 -2
  214. package/dist/chunk-PUD76XQT.cjs +78 -0
  215. package/dist/chunk-Q2IL4DDI.cjs +355 -0
  216. package/dist/{chunk-WPVWQSL7.cjs → chunk-Q6AC3PHY.cjs} +16 -13
  217. package/dist/{chunk-XRZEUWKF.js → chunk-QCHIDZBA.js} +1 -1
  218. package/dist/{chunk-IQ5RXU6O.js → chunk-QEGOB6QV.js} +1 -1
  219. package/dist/{chunk-JSBRDJBE.js → chunk-QGM4M3NI.js} +8 -1
  220. package/dist/chunk-QKP772OZ.js +4291 -0
  221. package/dist/chunk-QQ7PANOP.js +59 -0
  222. package/dist/{chunk-YHD6TUIR.cjs → chunk-QW2RW2GY.cjs} +2 -0
  223. package/dist/chunk-RAKO7UN7.js +114 -0
  224. package/dist/chunk-RBHANOYY.js +33 -0
  225. package/dist/chunk-RBZ7AFX7.cjs +29 -0
  226. package/dist/{chunk-TXSDBGKX.cjs → chunk-REMGR23V.cjs} +46 -49
  227. package/dist/chunk-ROLA6EFO.cjs +85 -0
  228. package/dist/{chunk-TBEGGJNC.cjs → chunk-SOLBYSLY.cjs} +33 -16
  229. package/dist/{chunk-FKSDEWDH.js → chunk-SWCQM52V.js} +68 -25
  230. package/dist/{chunk-H5SWOLG6.js → chunk-TBOLJDUG.js} +39 -24
  231. package/dist/chunk-TH26BQJG.js +101 -0
  232. package/dist/{chunk-245KJE5Y.cjs → chunk-TJNBASFD.cjs} +14 -6
  233. package/dist/chunk-TKKN34TV.js +229 -0
  234. package/dist/chunk-TQ33WBY5.cjs +74 -0
  235. package/dist/{chunk-EGFT4PGW.js → chunk-TWQDAUZU.js} +5 -2
  236. package/dist/{chunk-OGV4WJ5L.cjs → chunk-TXPSTCG7.cjs} +74 -59
  237. package/dist/{chunk-CAMZTXV6.js → chunk-U4C3HW6P.js} +67 -52
  238. package/dist/{chunk-5P2NXKP3.js → chunk-UEIXJG45.js} +104 -76
  239. package/dist/{chunk-22D2CNTP.cjs → chunk-UGFVM77J.cjs} +5 -2
  240. package/dist/chunk-UOQECODR.js +34 -0
  241. package/dist/chunk-UR27UDTB.js +354 -0
  242. package/dist/chunk-UWFG2R2I.cjs +420 -0
  243. package/dist/{chunk-Y72HH2TF.cjs → chunk-UXLW45ZE.cjs} +102 -28
  244. package/dist/{chunk-FPHU2ES6.cjs → chunk-VBOFPU5M.cjs} +6 -0
  245. package/dist/{chunk-JX3DFKBI.js → chunk-VDWJMWDF.js} +54 -24
  246. package/dist/{chunk-LENHP55G.cjs → chunk-VGEV44V2.cjs} +1076 -158
  247. package/dist/{chunk-33RSHBDH.js → chunk-VKBIE6I6.js} +38 -7
  248. package/dist/{chunk-CWMZKFTT.js → chunk-VRMZO6TB.js} +31 -8
  249. package/dist/chunk-VUGOOGHB.js +400 -0
  250. package/dist/chunk-WBU4Q4GS.cjs +400 -0
  251. package/dist/chunk-WGLBC5AY.cjs +59 -0
  252. package/dist/{chunk-KWXVKLQ5.cjs → chunk-WGNMOVMT.cjs} +7 -82
  253. package/dist/{chunk-RKJTGGMU.cjs → chunk-WKRDBCP2.cjs} +221 -16
  254. package/dist/chunk-WRTXCQ3V.cjs +4291 -0
  255. package/dist/chunk-WTB7AFL6.cjs +101 -0
  256. package/dist/{chunk-NDMIPTV4.js → chunk-WZV6UVPY.js} +8 -3
  257. package/dist/chunk-XF2WIKHR.cjs +34 -0
  258. package/dist/{chunk-L3WAH3EM.cjs → chunk-XGMI6IYB.cjs} +46 -15
  259. package/dist/{chunk-FW774QXH.js → chunk-XIVFAD2L.js} +1048 -130
  260. package/dist/chunk-XV2HXRHX.js +85 -0
  261. package/dist/{chunk-72FKPBT5.js → chunk-Y3M2DABP.js} +16 -12
  262. package/dist/{chunk-QNGEW5TC.js → chunk-YV63VW4K.js} +1 -1
  263. package/dist/{chunk-UJ2JSM6H.js → chunk-YVQI26H4.js} +2 -0
  264. package/dist/{chunk-RD5XAJR2.cjs → chunk-YWTIXHU6.cjs} +266 -19
  265. package/dist/chunk-YZWE7XSM.js +5 -0
  266. package/dist/{chunk-I5IW3T2Y.js → chunk-Z3XSSF7B.js} +32 -15
  267. package/dist/{chunk-6UJMCWRY.js → chunk-Z4LIPMPM.js} +6 -0
  268. package/dist/chunk-ZASDSY7P.cjs +114 -0
  269. package/dist/{chunk-R33VKSH5.cjs → chunk-ZHJ7JGME.cjs} +11 -11
  270. package/dist/chunk-ZPD2AO3U.js +866 -0
  271. package/dist/{chunk-7UOUW76C.js → chunk-ZQAT5VT5.js} +101 -24
  272. package/dist/chunk-ZR46OJNZ.js +152 -0
  273. package/dist/{chunk-G3V4SFET.cjs → chunk-ZZ63NW7A.cjs} +78 -35
  274. package/dist/clear-33TWQ2ES.cjs +12 -0
  275. package/dist/clear-OFLFQ3MR.js +12 -0
  276. package/dist/{communityInstaller-6KCFN7YZ.js → communityInstaller-COB2KTOW.js} +9 -6
  277. package/dist/communityInstaller-TWMGPSYM.cjs +22 -0
  278. package/dist/completion-IIZMHXYP.cjs +17 -0
  279. package/dist/completion-PT4VM2H2.js +17 -0
  280. package/dist/config-KL6WU7R2.cjs +20 -0
  281. package/dist/{config-ZN66VXPS.js → config-R4O7GBTY.js} +7 -5
  282. package/dist/{constants-UFM5B232.js → constants-HVCHVQAF.js} +2 -2
  283. package/dist/constants-RLMJ5D5P.cjs +21 -0
  284. package/dist/{defaultHooks-RCXPHF4M.cjs → defaultHooks-2V2CQL63.cjs} +26 -11
  285. package/dist/{defaultHooks-RDRMER3Z.js → defaultHooks-TMHDU3FS.js} +26 -11
  286. package/dist/export-3PK3VFCE.js +15 -0
  287. package/dist/export-WLGNWEMJ.cjs +15 -0
  288. package/dist/{extractSessionMemories-V7K42ZHW.js → extractSessionMemories-A2JX5WJ2.js} +1 -1
  289. package/dist/{extractSessionMemories-SDW2MVBQ.cjs → extractSessionMemories-XL3MS37F.cjs} +1 -1
  290. package/dist/feedback-G635NCLJ.js +18 -0
  291. package/dist/feedback-LLMK3TZH.cjs +18 -0
  292. package/dist/fffSearchProvider-2YCNKOYD.js +412 -0
  293. package/dist/fffSearchProvider-W6627E2V.cjs +412 -0
  294. package/dist/filesystem-L6DQKGWK.js +11 -0
  295. package/dist/filesystem-PGUPCMVK.cjs +11 -0
  296. package/dist/{formatters-6K7QVWQL.cjs → formatters-53XTCNGQ.cjs} +1 -1
  297. package/dist/{formatters-DQHO5I36.js → formatters-T6KV4BPP.js} +1 -1
  298. package/dist/help-BAXLP2M2.cjs +12 -0
  299. package/dist/{help-2BLR7L43.js → help-X3OAZ3CY.js} +3 -3
  300. package/dist/history-6HOJSEMT.cjs +14 -0
  301. package/dist/{history-5FZ3M2AK.js → history-YKFPHBJN.js} +3 -3
  302. package/dist/hooks-7TA4PIIB.js +18 -0
  303. package/dist/hooks-XVFU67T2.cjs +18 -0
  304. package/dist/{i18n-K7QOWIBH.js → i18n-2KBUU7XL.js} +2 -2
  305. package/dist/i18n-MUJMKTFM.cjs +33 -0
  306. package/dist/ide-CCQ33PGC.cjs +15 -0
  307. package/dist/ide-VLVFBZ5F.js +15 -0
  308. package/dist/immediateCommandRouter-MTEHZXQX.js +15 -0
  309. package/dist/immediateCommandRouter-ROXU3MWT.cjs +15 -0
  310. package/dist/{import-UXM3VK7B.js → import-4CHYLS4K.js} +4 -4
  311. package/dist/{import-QEME3E4T.cjs → import-I7T4ZHYL.cjs} +4 -4
  312. package/dist/import-J46F54JY.cjs +10 -0
  313. package/dist/import-JWPYKXCZ.js +10 -0
  314. package/dist/index.cjs +747 -22356
  315. package/dist/index.d.cts +93 -0
  316. package/dist/index.d.ts +93 -0
  317. package/dist/index.js +786 -22395
  318. package/dist/init-262MWZV4.js +10 -0
  319. package/dist/init-EE5Y7RBL.cjs +10 -0
  320. package/dist/inkMode-VUE6ZDLD.cjs +7 -0
  321. package/dist/inkMode-WBNFOSAT.js +7 -0
  322. package/dist/inputPrompt-IIFKCX5Q.cjs +90 -0
  323. package/dist/inputPrompt-YGBHDUEP.js +90 -0
  324. package/dist/language-CVLPB7OV.js +21 -0
  325. package/dist/language-ZTWFHUSV.cjs +21 -0
  326. package/dist/learn-PON7I5QS.js +23 -0
  327. package/dist/learn-XLRSVNA3.cjs +23 -0
  328. package/dist/{lint-D5UOJWIK.cjs → lint-4NDGCSCL.cjs} +1 -1
  329. package/dist/{lint-NJPZWVN2.js → lint-FZ7ZJUB3.js} +1 -1
  330. package/dist/login-223QTGBG.cjs +26 -0
  331. package/dist/login-6IKTBUBY.js +26 -0
  332. package/dist/logout-RN2AG6SI.js +23 -0
  333. package/dist/logout-U3M4FFX7.cjs +23 -0
  334. package/dist/mcp-5O6PUL4G.js +20 -0
  335. package/dist/mcp-NUQ76QQB.cjs +20 -0
  336. package/dist/{mcp-install-VESN42PI.js → mcp-install-6XWXLFVY.js} +18 -11
  337. package/dist/{mcp-install-G27HSS3Z.cjs → mcp-install-P6DHES7V.cjs} +22 -15
  338. package/dist/memory-CYMDQ2YC.cjs +10 -0
  339. package/dist/memory-Q54CESNM.js +10 -0
  340. package/dist/{message-ZJ5AYAMT.cjs → message-4OKO775J.cjs} +1 -1
  341. package/dist/{message-JUBOK2VU.js → message-X3LOAAM7.js} +1 -1
  342. package/dist/model-6AJ77PJG.js +10 -0
  343. package/dist/model-IDRCKDML.cjs +10 -0
  344. package/dist/new-7LEWOUF2.cjs +12 -0
  345. package/dist/new-ZXHEWC2S.js +12 -0
  346. package/dist/onboarding-FXX7YHSJ.cjs +35 -0
  347. package/dist/onboarding-JYNMK6NI.js +35 -0
  348. package/dist/{patch-MOD7QC3D.cjs → patch-DJ2GPFST.cjs} +1 -1
  349. package/dist/{patch-5F6VBIT3.js → patch-NIJWIRHS.js} +1 -1
  350. package/dist/permissions-YBNSANIA.cjs +10 -0
  351. package/dist/permissions-YHJMVA6L.js +10 -0
  352. package/dist/plan-XEJMOT55.cjs +13 -0
  353. package/dist/plan-YYUAXPTL.js +13 -0
  354. package/dist/pr-review-CW6J7P62.cjs +9 -0
  355. package/dist/pr-review-YZSBQVT2.js +9 -0
  356. package/dist/quit-B43SJ6E4.cjs +10 -0
  357. package/dist/quit-GWTNHQSP.js +10 -0
  358. package/dist/rawMode-6W5AXAKI.cjs +7 -0
  359. package/dist/rawMode-GFNLXQPU.js +7 -0
  360. package/dist/{registry-KWZGYJC2.js → registry-34GL6BNJ.js} +30 -45
  361. package/dist/{registry-YN4FQPOO.cjs → registry-V24W7YK6.cjs} +66 -81
  362. package/dist/repeat-P4FAPE3Y.cjs +17 -0
  363. package/dist/repeat-RALE6AUO.js +17 -0
  364. package/dist/resume-DYVOQN5L.cjs +16 -0
  365. package/dist/resume-M25UQKOX.js +16 -0
  366. package/dist/review-QHP2KP4Q.js +9 -0
  367. package/dist/review-UWHWQHCB.cjs +9 -0
  368. package/dist/ripgrep-67SCU2BA.cjs +9 -0
  369. package/dist/ripgrep-VHJQQ55W.js +9 -0
  370. package/dist/rpc-NPS3PU4O.cjs +3730 -0
  371. package/dist/rpc-S3DGW6KV.js +3730 -0
  372. package/dist/search-CPX4PWHP.js +20 -0
  373. package/dist/search-VUF3M4N3.cjs +20 -0
  374. package/dist/{session-BSU2L5UI.cjs → session-LXKC4X5Q.cjs} +1 -1
  375. package/dist/{session-SZMRN5KG.js → session-NMMO4QOL.js} +1 -1
  376. package/dist/sessions-IYAXMK23.js +10 -0
  377. package/dist/sessions-JODKER5D.cjs +10 -0
  378. package/dist/settings-55BNW6BF.js +33 -0
  379. package/dist/settings-BKTS7OMC.cjs +33 -0
  380. package/dist/setup-IRC5HQG2.js +29 -0
  381. package/dist/setup-MMQ7TWOP.cjs +29 -0
  382. package/dist/share-6JRQECAH.cjs +17 -0
  383. package/dist/share-YM5MJKMO.js +17 -0
  384. package/dist/{skills-FYY6F2WV.cjs → skills-GGMZOVIE.cjs} +14 -11
  385. package/dist/skills-LWSOKOSH.cjs +29 -0
  386. package/dist/{skills-6OL4OSGA.js → skills-MVIZNHT4.js} +13 -10
  387. package/dist/skills-VWOMV3CR.js +29 -0
  388. package/dist/{skills-install-6CSWC24P.js → skills-install-QBA5RCV6.js} +22 -71
  389. package/dist/{skills-install-O3LZ2ETC.cjs → skills-install-VTAMCNNY.cjs} +35 -84
  390. package/dist/skills-new-GPL46YV2.js +18 -0
  391. package/dist/skills-new-L5BEZN5V.cjs +18 -0
  392. package/dist/slashCommands-FBPCIWM5.cjs +95 -0
  393. package/dist/slashCommands-FCWY5DXW.js +95 -0
  394. package/dist/status-3B5SDZPL.js +17 -0
  395. package/dist/status-TTGRF6NC.cjs +17 -0
  396. package/dist/summarizer-DGPHE5IQ.js +17 -0
  397. package/dist/summarizer-JNXLUAQG.cjs +17 -0
  398. package/dist/sync-77CXVVTK.cjs +21 -0
  399. package/dist/{sync-KWX67OUN.js → sync-7BILIQHP.js} +4 -4
  400. package/dist/sync-7OKF6636.js +21 -0
  401. package/dist/sync-EH4K5U3N.cjs +40 -0
  402. package/dist/{tasks-5FPBIFLC.js → tasks-R5MBGAQ6.js} +1 -1
  403. package/dist/{tasks-TXGKGNH6.cjs → tasks-V4WB3MFR.cjs} +1 -1
  404. package/dist/{team-5YXP3JGR.js → team-JESCHGWB.js} +1 -1
  405. package/dist/{team-IIWEZKNR.cjs → team-VQQKWGZB.cjs} +1 -1
  406. package/dist/{teammate-L6EZQ3I2.js → teammate-GZQSCIMS.js} +29 -8
  407. package/dist/{teammate-2KMKJXAM.cjs → teammate-J6PHGL23.cjs} +30 -9
  408. package/dist/theme-64BYGJ57.cjs +21 -0
  409. package/dist/theme-YJE6HEON.js +21 -0
  410. package/dist/tools-3PPTTKFV.js +9 -0
  411. package/dist/tools-THIQA7WC.cjs +9 -0
  412. package/dist/ui/questionModal.cjs +9 -6
  413. package/dist/ui/questionModal.js +8 -5
  414. package/dist/undo-PRTEGL2J.cjs +10 -0
  415. package/dist/undo-SZEHLX7X.js +10 -0
  416. package/dist/{update-TVAJMMBC.js → update-53WMKYVS.js} +1 -1
  417. package/dist/{update-Z6BIIQDC.cjs → update-NV6QRYY7.cjs} +1 -1
  418. package/dist/web-3BA2WV37.cjs +37 -0
  419. package/dist/web-6FYGBX5K.js +37 -0
  420. package/dist/workspaceSafety-MDJGHK6D.cjs +9 -0
  421. package/dist/workspaceSafety-XOUMUBVB.js +9 -0
  422. package/dist/yolo-GF2YD7ZI.js +9 -0
  423. package/dist/yolo-OGDA7HNC.cjs +9 -0
  424. package/dist/yoloMode-3DJDA75U.cjs +17 -0
  425. package/dist/yoloMode-4JOOSU26.js +17 -0
  426. package/package.json +46 -49
  427. package/dist/AgentRegistry-NQCLWABO.cjs +0 -10
  428. package/dist/CommunitySkillsCache-6QPRMTJO.js +0 -8
  429. package/dist/CommunitySkillsCache-GTQMOCCO.cjs +0 -8
  430. package/dist/GitHubRegistryFetcher-S7QFUEKV.cjs +0 -7
  431. package/dist/HookManager-Q2KYMCP4.cjs +0 -7
  432. package/dist/HookManager-TTP4Y6DC.js +0 -7
  433. package/dist/LearnAdvisor-A4Q5PPBI.js +0 -9
  434. package/dist/LearnAdvisor-GASQD7HT.cjs +0 -9
  435. package/dist/McpClientManager-RKD7C6OY.cjs +0 -8
  436. package/dist/MemoryManager-GUNLRP5S.js +0 -8
  437. package/dist/MemoryManager-TNSGKDKX.cjs +0 -8
  438. package/dist/PermissionManager-KMN53FJP.cjs +0 -11
  439. package/dist/ProviderFactory-MR5B23QJ.js +0 -9
  440. package/dist/ProviderFactory-VFGCJJX6.cjs +0 -9
  441. package/dist/SessionManager-FEUAU3ZJ.cjs +0 -10
  442. package/dist/SessionManager-IKWAK2PI.js +0 -10
  443. package/dist/SkillsRegistry-KPQFTRIT.cjs +0 -9
  444. package/dist/SkillsRegistry-XJSKPDF2.js +0 -9
  445. package/dist/SubAgent-NYH6GWQ3.js +0 -11
  446. package/dist/SubAgent-PZKBDUBA.cjs +0 -11
  447. package/dist/SyncApiClient-ZNYMT36M.cjs +0 -11
  448. package/dist/about-HHTF2YFL.js +0 -12
  449. package/dist/about-JGRVNNQC.cjs +0 -12
  450. package/dist/actionExecutor-U6IBN2TU.cjs +0 -19
  451. package/dist/actionExecutor-XT5FW3W6.js +0 -19
  452. package/dist/add-dir-247K3XRY.js +0 -10
  453. package/dist/add-dir-GS4DXKKH.cjs +0 -10
  454. package/dist/agents-R6ZEFTVR.cjs +0 -12
  455. package/dist/agents-WJPQWQF2.js +0 -12
  456. package/dist/agents-new-HKVEIBDJ.js +0 -14
  457. package/dist/agents-new-X6GTHIO6.cjs +0 -14
  458. package/dist/autoSkill-H4T6VVDA.cjs +0 -20
  459. package/dist/automode-BC6NVECO.js +0 -10
  460. package/dist/automode-WN2RSOGW.cjs +0 -10
  461. package/dist/chunk-33A755XB.cjs +0 -168
  462. package/dist/chunk-3OTU3RS3.cjs +0 -1607
  463. package/dist/chunk-4PKF7WPD.js +0 -100
  464. package/dist/chunk-ALYU6VTM.js +0 -105
  465. package/dist/chunk-AS6RTLN7.cjs +0 -203
  466. package/dist/chunk-BWN2CLLM.cjs +0 -298
  467. package/dist/chunk-HQ7YZKXE.js +0 -168
  468. package/dist/chunk-HVKOZ2VP.cjs +0 -115
  469. package/dist/chunk-J6QET7EF.cjs +0 -454
  470. package/dist/chunk-LWUJFGOZ.js +0 -115
  471. package/dist/chunk-P47WPOXN.js +0 -298
  472. package/dist/chunk-PRRCJFU3.cjs +0 -85
  473. package/dist/chunk-RO6WYEWH.js +0 -454
  474. package/dist/chunk-SYVYLZZF.cjs +0 -24
  475. package/dist/chunk-T73IDKDF.js +0 -111
  476. package/dist/chunk-YRLYSQEQ.cjs +0 -105
  477. package/dist/chunk-ZQE72E6W.cjs +0 -100
  478. package/dist/chunk-ZVY2XD6T.js +0 -1607
  479. package/dist/clear-UO4MNWZW.cjs +0 -12
  480. package/dist/clear-ZJ5NYP6E.js +0 -12
  481. package/dist/communityInstaller-PVSOFDZD.cjs +0 -19
  482. package/dist/completion-MMF2PN2H.js +0 -14
  483. package/dist/completion-UI5WKHXI.cjs +0 -14
  484. package/dist/config-E7RINK4R.cjs +0 -18
  485. package/dist/constants-6CPCJ3DY.cjs +0 -21
  486. package/dist/export-N4XIVDSL.cjs +0 -12
  487. package/dist/export-W22L4D5C.js +0 -12
  488. package/dist/feedback-DR6ADSNE.cjs +0 -15
  489. package/dist/feedback-FEEAP4QW.js +0 -15
  490. package/dist/filesystem-3SGCW2BF.js +0 -10
  491. package/dist/filesystem-MCFXJQ6R.cjs +0 -10
  492. package/dist/help-AQHGTS7P.cjs +0 -12
  493. package/dist/history-NIUDRMKA.cjs +0 -14
  494. package/dist/hooks-2EY4IPKV.js +0 -13
  495. package/dist/hooks-LJVORRIG.cjs +0 -13
  496. package/dist/i18n-ARDG2SMC.cjs +0 -33
  497. package/dist/ide-GFW6IJHD.js +0 -12
  498. package/dist/ide-N2ZNSSB3.cjs +0 -12
  499. package/dist/import-DFVN3KNZ.js +0 -10
  500. package/dist/import-ZS6DPGU5.cjs +0 -10
  501. package/dist/init-PY75HA3S.cjs +0 -10
  502. package/dist/init-QNMWLAVY.js +0 -10
  503. package/dist/language-5UE4G2BT.cjs +0 -18
  504. package/dist/language-UXMHEZUJ.js +0 -18
  505. package/dist/learn-HJ3FLNZC.cjs +0 -20
  506. package/dist/learn-MVYS3RU5.js +0 -20
  507. package/dist/localProjectPermissions-N77HA3XK.js +0 -18
  508. package/dist/localProjectPermissions-UFSMNTBJ.cjs +0 -18
  509. package/dist/login-DSE7H63A.js +0 -20
  510. package/dist/login-V3MEWPKN.cjs +0 -20
  511. package/dist/logout-BMVCLKKW.js +0 -18
  512. package/dist/logout-XEG7FHOZ.cjs +0 -18
  513. package/dist/mcp-PYUR4PHO.js +0 -18
  514. package/dist/mcp-SG6JFLGC.cjs +0 -18
  515. package/dist/memory-4ZMMEZ2Z.js +0 -10
  516. package/dist/memory-QSGMVVGH.cjs +0 -10
  517. package/dist/model-NANLBZ4Z.cjs +0 -10
  518. package/dist/model-ZXNV4AF7.js +0 -10
  519. package/dist/new-5QJY5JP2.js +0 -12
  520. package/dist/new-PMMG55UX.cjs +0 -12
  521. package/dist/permissions-LECTCJ4H.cjs +0 -13
  522. package/dist/permissions-VP5VGIBL.js +0 -13
  523. package/dist/plan-G5CEKJI4.js +0 -11
  524. package/dist/plan-QKOHE3LH.cjs +0 -11
  525. package/dist/quit-BKOOPHU5.cjs +0 -10
  526. package/dist/quit-FVFNYACP.js +0 -10
  527. package/dist/resume-EXFQSQPH.js +0 -13
  528. package/dist/resume-PP2IQM5S.cjs +0 -13
  529. package/dist/search-C56FBN67.cjs +0 -17
  530. package/dist/search-XGZDYBF4.js +0 -17
  531. package/dist/sessions-54KI3F2Q.js +0 -10
  532. package/dist/sessions-DDTSPNVW.cjs +0 -10
  533. package/dist/settings-BDO37TTO.cjs +0 -30
  534. package/dist/settings-FHRDFPLK.js +0 -30
  535. package/dist/share-IERCTBGN.cjs +0 -14
  536. package/dist/share-TGROUE6R.js +0 -14
  537. package/dist/skills-OM4IGBAA.cjs +0 -26
  538. package/dist/skills-S3GRN323.js +0 -26
  539. package/dist/skills-new-ALD2PTHN.js +0 -15
  540. package/dist/skills-new-PWLKK7GW.cjs +0 -15
  541. package/dist/slashCommands-L4ZD33LJ.js +0 -75
  542. package/dist/slashCommands-YY2VUUDF.cjs +0 -75
  543. package/dist/status-3PC5XWSS.cjs +0 -11
  544. package/dist/status-KCLVOYPD.js +0 -11
  545. package/dist/sync-6SDWG5RK.js +0 -18
  546. package/dist/sync-7JMZVEQD.cjs +0 -40
  547. package/dist/sync-WHURZL3U.cjs +0 -18
  548. package/dist/theme-BE5A4FPN.cjs +0 -18
  549. package/dist/theme-YMFCQP7J.js +0 -18
  550. package/dist/undo-KZHUUZTD.cjs +0 -10
  551. package/dist/undo-NEIEHQVX.js +0 -10
@@ -0,0 +1,1517 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
+
3
+
4
+ var _chunk7JLT2VNWcjs = require('./chunk-7JLT2VNW.cjs');
5
+
6
+
7
+ var _chunk5K3CDSWZcjs = require('./chunk-5K3CDSWZ.cjs');
8
+ require('./chunk-QMAKTSZB.cjs');
9
+ require('./chunk-HQWQZML5.cjs');
10
+ require('./chunk-VGEV44V2.cjs');
11
+ require('./chunk-Q6AC3PHY.cjs');
12
+ require('./chunk-5CMYEM3R.cjs');
13
+ require('./chunk-DI57A4BX.cjs');
14
+ require('./chunk-LQBONA55.cjs');
15
+ require('./chunk-AU6JAGZJ.cjs');
16
+ require('./chunk-GBMDFWJX.cjs');
17
+ require('./chunk-FFBDRUO5.cjs');
18
+ require('./chunk-GWY26SUD.cjs');
19
+ require('./chunk-ROLA6EFO.cjs');
20
+ require('./chunk-PCM3N3CL.cjs');
21
+ require('./chunk-BYE7RQFZ.cjs');
22
+ require('./chunk-PHJO5YAL.cjs');
23
+ require('./chunk-Z36XBUMX.cjs');
24
+ require('./chunk-U3WDY42C.cjs');
25
+ require('./chunk-FHK7UDOJ.cjs');
26
+ require('./chunk-DRWDEHE5.cjs');
27
+ require('./chunk-AUYSIEVV.cjs');
28
+ require('./chunk-HDK2EHVH.cjs');
29
+ require('./chunk-PDHT7LQS.cjs');
30
+ require('./chunk-MQESBFBZ.cjs');
31
+ require('./chunk-TXPSTCG7.cjs');
32
+ require('./chunk-PUD76XQT.cjs');
33
+ require('./chunk-IEXKKKOF.cjs');
34
+ require('./chunk-CWINVFRI.cjs');
35
+ require('./chunk-J2K57QM7.cjs');
36
+ require('./chunk-J5ADZN6V.cjs');
37
+ require('./chunk-3S563FNF.cjs');
38
+ require('./chunk-DPSIGY6L.cjs');
39
+ require('./chunk-JHGIWNHL.cjs');
40
+ require('./chunk-ZASDSY7P.cjs');
41
+ require('./chunk-6GUODJKM.cjs');
42
+ require('./chunk-SOLBYSLY.cjs');
43
+ require('./chunk-OPNI6O7F.cjs');
44
+ require('./chunk-E6GFD7VR.cjs');
45
+ require('./chunk-47PHDKNW.cjs');
46
+ require('./chunk-QCLYBIMM.cjs');
47
+ require('./chunk-M7RVTUWE.cjs');
48
+ require('./chunk-AC7DZ6SK.cjs');
49
+ require('./chunk-75EDROHL.cjs');
50
+ require('./chunk-6XVVIY54.cjs');
51
+ require('./chunk-WGLBC5AY.cjs');
52
+ require('./chunk-LDJQ5QHG.cjs');
53
+ require('./chunk-O6TQP7U7.cjs');
54
+ require('./chunk-MFK6HE47.cjs');
55
+ require('./chunk-TJNBASFD.cjs');
56
+ require('./chunk-JP3YHTQ2.cjs');
57
+ require('./chunk-3KLSNNRW.cjs');
58
+ require('./chunk-6HH236FV.cjs');
59
+ require('./chunk-HS4USDND.cjs');
60
+
61
+
62
+ var _chunkDA7NBAJKcjs = require('./chunk-DA7NBAJK.cjs');
63
+ require('./chunk-YFXTE422.cjs');
64
+ require('./chunk-DIZTWFVR.cjs');
65
+ require('./chunk-HXQREVTA.cjs');
66
+ require('./chunk-4JNNTOGF.cjs');
67
+ require('./chunk-RBZ7AFX7.cjs');
68
+ require('./chunk-VXCMGBXY.cjs');
69
+ require('./chunk-XGMI6IYB.cjs');
70
+ require('./chunk-AOKCI722.cjs');
71
+ require('./chunk-N6O3XUZ2.cjs');
72
+ require('./chunk-UXLW45ZE.cjs');
73
+ require('./chunk-OR67YXQK.cjs');
74
+ require('./chunk-DEQVRSV5.cjs');
75
+ require('./chunk-J5HE6CUM.cjs');
76
+ require('./chunk-UGFVM77J.cjs');
77
+ require('./chunk-QW2RW2GY.cjs');
78
+ require('./chunk-ZHJ7JGME.cjs');
79
+ require('./chunk-JJ4KA7HK.cjs');
80
+ require('./chunk-WTB7AFL6.cjs');
81
+
82
+
83
+ var _chunkWRTXCQ3Vcjs = require('./chunk-WRTXCQ3V.cjs');
84
+ require('./chunk-HSCUPEA4.cjs');
85
+ require('./chunk-WBU4Q4GS.cjs');
86
+ require('./chunk-LFDPTJYF.cjs');
87
+ require('./chunk-MUNUUFU7.cjs');
88
+ require('./chunk-MOJ7ADW4.cjs');
89
+ require('./chunk-WKRDBCP2.cjs');
90
+ require('./chunk-B4HSNOIH.cjs');
91
+ require('./chunk-BQ22N3TX.cjs');
92
+ require('./chunk-IGMPWJ2I.cjs');
93
+ require('./chunk-2CGE7ZV3.cjs');
94
+ require('./chunk-3DDL2E55.cjs');
95
+ require('./chunk-4256YRCO.cjs');
96
+ require('./chunk-LJD7KR3L.cjs');
97
+ require('./chunk-ZZ63NW7A.cjs');
98
+ require('./chunk-7MU7LWF3.cjs');
99
+ require('./chunk-UWFG2R2I.cjs');
100
+
101
+
102
+ var _chunkMO4KP6XScjs = require('./chunk-MO4KP6XS.cjs');
103
+
104
+
105
+
106
+ var _chunk7LWQCE4Ycjs = require('./chunk-7LWQCE4Y.cjs');
107
+
108
+
109
+ var _chunk3LJJG5YYcjs = require('./chunk-3LJJG5YY.cjs');
110
+ require('./chunk-XDLH4EDL.cjs');
111
+ require('./chunk-MPULXVC4.cjs');
112
+ require('./chunk-Q2IL4DDI.cjs');
113
+ require('./chunk-FMB3TSWP.cjs');
114
+ require('./chunk-IKUMVBCW.cjs');
115
+
116
+
117
+ var _chunkREMGR23Vcjs = require('./chunk-REMGR23V.cjs');
118
+
119
+
120
+
121
+ var _chunk3OF56EMAcjs = require('./chunk-3OF56EMA.cjs');
122
+ require('./chunk-D2OSPLYC.cjs');
123
+ require('./chunk-CH2J4PVE.cjs');
124
+ require('./chunk-KNTUI4TZ.cjs');
125
+ require('./chunk-TQ33WBY5.cjs');
126
+
127
+
128
+ var _chunk46C73ZKKcjs = require('./chunk-46C73ZKK.cjs');
129
+ require('./chunk-MXVIDIC6.cjs');
130
+ require('./chunk-3EDDDZS2.cjs');
131
+ require('./chunk-YWTIXHU6.cjs');
132
+ require('./chunk-2VHB43IX.cjs');
133
+ require('./chunk-E26KKI46.cjs');
134
+ require('./chunk-XF2WIKHR.cjs');
135
+
136
+
137
+ var _chunkWGNMOVMTcjs = require('./chunk-WGNMOVMT.cjs');
138
+ require('./chunk-CHI52KFR.cjs');
139
+ require('./chunk-VBOFPU5M.cjs');
140
+ require('./chunk-3HT76LNN.cjs');
141
+
142
+ // src/modes/acp/index.ts
143
+ var _stream = require('stream');
144
+ var _sdk = require('@agentclientprotocol/sdk');
145
+
146
+ // src/modes/acp/adapter.ts
147
+
148
+
149
+ // src/modes/acp/types.ts
150
+ var ACP_HOOK_NOTIFICATIONS = {
151
+ HOOK_PRE_TOOL: "autohand.hook.preTool",
152
+ HOOK_POST_TOOL: "autohand.hook.postTool",
153
+ HOOK_FILE_MODIFIED: "autohand.hook.fileModified",
154
+ HOOK_PRE_PROMPT: "autohand.hook.prePrompt",
155
+ HOOK_POST_RESPONSE: "autohand.hook.postResponse",
156
+ HOOK_SESSION_ERROR: "autohand.hook.sessionError",
157
+ HOOK_STOP: "autohand.hook.stop",
158
+ HOOK_SESSION_START: "autohand.hook.sessionStart",
159
+ HOOK_SESSION_END: "autohand.hook.sessionEnd",
160
+ HOOK_SUBAGENT_STOP: "autohand.hook.subagentStop",
161
+ HOOK_PERMISSION_REQUEST: "autohand.hook.permissionRequest",
162
+ HOOK_NOTIFICATION: "autohand.hook.notification",
163
+ // Setup wizard notifications
164
+ SETUP_STARTED: "autohand.setup.started",
165
+ SETUP_STEP_START: "autohand.setup.stepStart",
166
+ SETUP_STEP_COMPLETE: "autohand.setup.stepComplete",
167
+ SETUP_CANCELLED: "autohand.setup.cancelled",
168
+ SETUP_ERROR: "autohand.setup.error",
169
+ SETUP_COMPLETE: "autohand.setup.complete"
170
+ };
171
+ var TOOL_KIND_MAP = {
172
+ // Read operations
173
+ read_file: "read",
174
+ list_tree: "read",
175
+ list_directory: "read",
176
+ file_stats: "read",
177
+ file_info: "read",
178
+ // Search operations
179
+ fff_grep: "search",
180
+ fff_find: "search",
181
+ find: "search",
182
+ web_search: "fetch",
183
+ web_repo: "fetch",
184
+ // Edit operations
185
+ write_file: "edit",
186
+ append_file: "edit",
187
+ apply_patch: "edit",
188
+ format_file: "edit",
189
+ replace_in_file: "edit",
190
+ search_replace: "edit",
191
+ create_directory: "edit",
192
+ copy_path: "edit",
193
+ // Move/delete operations
194
+ rename_path: "move",
195
+ delete_path: "delete",
196
+ // Execute operations
197
+ run_command: "execute",
198
+ custom_command: "execute",
199
+ git_status: "execute",
200
+ git_diff: "execute",
201
+ git_commit: "execute",
202
+ git_add: "execute",
203
+ git_init: "execute",
204
+ git_log: "execute",
205
+ git_list_untracked: "execute",
206
+ git_checkout: "execute",
207
+ git_branch: "execute",
208
+ // Dependencies
209
+ dependency_add: "execute",
210
+ dependency_remove: "execute",
211
+ dependency_update: "execute",
212
+ dependency_list: "read",
213
+ // Think/plan operations
214
+ todo_write: "think",
215
+ plan: "think",
216
+ smart_context_cropper: "think",
217
+ thinking: "think",
218
+ // Memory/other operations
219
+ save_memory: "other",
220
+ recall_memory: "other",
221
+ tools_registry: "other",
222
+ tool_search: "other",
223
+ skill: "other",
224
+ sleep: "other",
225
+ project_info: "read",
226
+ workspace_info: "read"
227
+ // MCP tools (prefixed with mcp__)
228
+ // These are dynamically matched via resolveToolKind()
229
+ };
230
+ var TOOL_DISPLAY_NAMES = {
231
+ // Read operations
232
+ read_file: "Read",
233
+ list_tree: "List",
234
+ tool_search: "Search tools",
235
+ skill: "Skill",
236
+ sleep: "Wait",
237
+ list_directory: "List",
238
+ file_stats: "Stats",
239
+ file_info: "Info",
240
+ // Search operations
241
+ fff_grep: "Search",
242
+ fff_find: "Find files",
243
+ find: "Search",
244
+ search: "Search",
245
+ search_files: "Search",
246
+ search_with_context: "Search",
247
+ semantic_search: "Search",
248
+ web_search: "Web Search",
249
+ web_repo: "Web Repo",
250
+ // Edit operations
251
+ write_file: "Write",
252
+ append_file: "Append",
253
+ apply_patch: "Patch",
254
+ notebook_edit: "Notebook",
255
+ format_file: "Format",
256
+ replace_in_file: "Replace",
257
+ search_replace: "Replace",
258
+ create_directory: "Create",
259
+ copy_path: "Copy",
260
+ // Move/delete operations
261
+ rename_path: "Rename",
262
+ delete_path: "Delete",
263
+ // Execute operations
264
+ run_command: "Run",
265
+ custom_command: "Custom",
266
+ git_status: "Git Status",
267
+ git_diff: "Git Diff",
268
+ git_commit: "Git Commit",
269
+ git_add: "Git Add",
270
+ git_init: "Git Init",
271
+ git_log: "Git Log",
272
+ git_list_untracked: "Git Untracked",
273
+ git_checkout: "Git Checkout",
274
+ git_branch: "Git Branch",
275
+ // Dependencies
276
+ dependency_add: "Add Dep",
277
+ dependency_remove: "Remove Dep",
278
+ dependency_update: "Update Dep",
279
+ dependency_list: "List Deps",
280
+ // Think/plan operations
281
+ todo_write: "Todo",
282
+ plan: "Plan",
283
+ smart_context_cropper: "Thinking",
284
+ thinking: "Thinking",
285
+ // Memory/other
286
+ save_memory: "Save Memory",
287
+ recall_memory: "Recall Memory",
288
+ tools_registry: "Tools",
289
+ project_info: "Project Info",
290
+ workspace_info: "Workspace Info"
291
+ };
292
+ function resolveToolKind(toolName) {
293
+ if (toolName in TOOL_KIND_MAP) {
294
+ return TOOL_KIND_MAP[toolName];
295
+ }
296
+ if (toolName.startsWith("mcp__")) {
297
+ return "execute";
298
+ }
299
+ return "other";
300
+ }
301
+ function resolveToolDisplayName(toolName) {
302
+ if (toolName in TOOL_DISPLAY_NAMES) {
303
+ return TOOL_DISPLAY_NAMES[toolName];
304
+ }
305
+ if (toolName.startsWith("mcp__")) {
306
+ const parts = toolName.split("__");
307
+ if (parts.length >= 3) {
308
+ return `MCP: ${parts[1]}/${parts.slice(2).join("/")}`;
309
+ }
310
+ }
311
+ return toolName.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
312
+ }
313
+ var DEFAULT_ACP_COMMANDS = [
314
+ { name: "help", description: "Show available commands" },
315
+ { name: "new", description: "Start a new conversation" },
316
+ { name: "model", description: "Select or change the model" },
317
+ { name: "resume", description: "Resume a previous session" },
318
+ { name: "sessions", description: "List recent sessions" },
319
+ { name: "session", description: "Show current session info" },
320
+ { name: "status", description: "Show Autohand status" },
321
+ { name: "undo", description: "Undo the last file change" },
322
+ { name: "init", description: "Create AGENTS.md file" },
323
+ { name: "memory", description: "Manage conversation memory" },
324
+ { name: "skills", description: "List available skills" },
325
+ { name: "export", description: "Export conversation" },
326
+ { name: "permissions", description: "Manage tool permissions" },
327
+ { name: "feedback", description: "Send feedback to Autohand" },
328
+ { name: "agents", description: "List available agents" },
329
+ { name: "hooks", description: "Manage lifecycle hooks" },
330
+ { name: "automode", description: "Toggle autonomous agent loop" },
331
+ { name: "add-dir", description: "Add additional working directory" },
332
+ { name: "share", description: "Share session transcript" },
333
+ { name: "formatters", description: "Manage code formatters" },
334
+ { name: "lint", description: "Run code linting" },
335
+ { name: "mcp", description: "Manage MCP servers" },
336
+ {
337
+ name: "mcp install",
338
+ description: "Browse and install community MCP servers"
339
+ },
340
+ { name: "sync", description: "Sync settings with cloud" },
341
+ { name: "history", description: "Show conversation history" },
342
+ { name: "about", description: "Show Autohand version and links" },
343
+ { name: "plan", description: "Toggle plan mode" },
344
+ { name: "ide", description: "IDE integration settings" },
345
+ { name: "search", description: "Configure web search" },
346
+ { name: "login", description: "Sign in to Autohand account" },
347
+ { name: "logout", description: "Sign out of Autohand account" },
348
+ { name: "learn", description: "Analyze project and recommend skills" },
349
+ { name: "skills search", description: "Search community skills" },
350
+ { name: "skills trending", description: "Show trending community skills" },
351
+ { name: "skills remove", description: "Remove an installed skill" }
352
+ ];
353
+ var DEFAULT_ACP_MODES = [
354
+ {
355
+ id: "interactive",
356
+ name: "Interactive",
357
+ description: "Default mode with approval prompts for risky actions"
358
+ },
359
+ {
360
+ id: "full-access",
361
+ name: "Full Access",
362
+ description: "Auto-approve all actions within the workspace"
363
+ },
364
+ {
365
+ id: "unrestricted",
366
+ name: "Unrestricted",
367
+ description: "Skip all approval prompts (use with caution)"
368
+ },
369
+ {
370
+ id: "auto-mode",
371
+ name: "Auto Mode",
372
+ description: "Autonomous multi-step execution loop"
373
+ },
374
+ {
375
+ id: "restricted",
376
+ name: "Restricted",
377
+ description: "Deny all dangerous operations automatically"
378
+ },
379
+ {
380
+ id: "dry-run",
381
+ name: "Dry Run",
382
+ description: "Preview actions without applying changes"
383
+ }
384
+ ];
385
+ function buildConfigOptions(_config) {
386
+ const options = [];
387
+ options.push({
388
+ type: "select",
389
+ id: "thinking_level",
390
+ name: "Thinking Level",
391
+ description: "Control the depth of LLM reasoning",
392
+ options: [
393
+ { value: "none", name: "None" },
394
+ { value: "normal", name: "Normal" },
395
+ { value: "extended", name: "Extended" }
396
+ ],
397
+ currentValue: "normal"
398
+ });
399
+ options.push({
400
+ type: "select",
401
+ id: "auto_commit",
402
+ name: "Auto Commit",
403
+ description: "Automatically commit changes with LLM-generated messages",
404
+ options: [
405
+ { value: "off", name: "Off" },
406
+ { value: "on", name: "On" }
407
+ ],
408
+ currentValue: "off"
409
+ });
410
+ const contextCompactEnabled = true;
411
+ options.push({
412
+ type: "select",
413
+ id: "context_compact",
414
+ name: "Context Compaction",
415
+ description: "Automatically compact context when sessions grow long",
416
+ options: [
417
+ { value: "on", name: "On" },
418
+ { value: "off", name: "Off" }
419
+ ],
420
+ currentValue: contextCompactEnabled ? "on" : "off"
421
+ });
422
+ return options;
423
+ }
424
+ function parseAvailableModels(config) {
425
+ const models = [];
426
+ const providerName = _nullishCoalesce(config.provider, () => ( "openrouter"));
427
+ const providerConfig = config[providerName];
428
+ if (_optionalChain([providerConfig, 'optionalAccess', _ => _.model])) {
429
+ models.push(providerConfig.model);
430
+ }
431
+ const popularModels = [
432
+ "openrouter/auto",
433
+ "anthropic/claude-sonnet-4-20250514",
434
+ "openai/gpt-4o",
435
+ "openai/gpt-5",
436
+ "google/gemini-3.0-pro",
437
+ "deepseek/deepseek-v4",
438
+ "anthropic/claude-5-sonnet",
439
+ "anthropic/claude-5-opus"
440
+ ];
441
+ for (const m of popularModels) {
442
+ if (!models.includes(m)) {
443
+ models.push(m);
444
+ }
445
+ }
446
+ return models;
447
+ }
448
+ function resolveDefaultMode(config) {
449
+ if (_optionalChain([config, 'optionalAccess', _2 => _2.permissions, 'optionalAccess', _3 => _3.mode]) === "unrestricted") return "unrestricted";
450
+ if (_optionalChain([config, 'optionalAccess', _4 => _4.permissions, 'optionalAccess', _5 => _5.mode]) === "restricted") return "restricted";
451
+ return "interactive";
452
+ }
453
+ function resolveDefaultModel(config) {
454
+ const providerName = _nullishCoalesce(config.provider, () => ( "openrouter"));
455
+ const providerConfig = config[providerName];
456
+ return _nullishCoalesce(_optionalChain([providerConfig, 'optionalAccess', _6 => _6.model]), () => ( "anthropic/claude-5-sonnet"));
457
+ }
458
+
459
+ // src/modes/acp/permissions.ts
460
+ function createPermissionBridge(options) {
461
+ const { connection, sessionId } = options;
462
+ let { modeId } = options;
463
+ const setMode = (newModeId) => {
464
+ modeId = newModeId;
465
+ };
466
+ const confirmAction = async (message, context) => {
467
+ if (modeId === "unrestricted" || modeId === "full-access" || modeId === "auto-mode") {
468
+ return { decision: "allow_once" };
469
+ }
470
+ if (modeId === "restricted" || modeId === "dry-run") {
471
+ return { decision: "deny_once" };
472
+ }
473
+ const toolName = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _7 => _7.tool]), () => ( "action"));
474
+ const kind = resolveToolKind(toolName);
475
+ const title = resolveToolDisplayName(toolName);
476
+ const toolCallId = `perm_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
477
+ const locations = [];
478
+ if (_optionalChain([context, 'optionalAccess', _8 => _8.path])) {
479
+ locations.push({ path: context.path });
480
+ }
481
+ try {
482
+ const response = await connection.requestPermission({
483
+ sessionId,
484
+ toolCall: {
485
+ toolCallId,
486
+ title: `${title}: ${message}`,
487
+ kind,
488
+ status: "pending",
489
+ locations,
490
+ rawInput: {
491
+ tool: toolName,
492
+ description: message,
493
+ command: _optionalChain([context, 'optionalAccess', _9 => _9.command]),
494
+ path: _optionalChain([context, 'optionalAccess', _10 => _10.path]),
495
+ args: _optionalChain([context, 'optionalAccess', _11 => _11.args])
496
+ }
497
+ },
498
+ options: [
499
+ { kind: "allow_once", name: "Yes", optionId: "allow_once" },
500
+ { kind: "reject_once", name: "No", optionId: "deny_once" },
501
+ { kind: "allow_once", name: "Allow Once", optionId: "allow_session" },
502
+ { kind: "reject_once", name: "Deny Once", optionId: "deny_session" },
503
+ { kind: "allow_always", name: "Allow Always (Project)", optionId: "allow_always_project" },
504
+ { kind: "allow_always", name: "Allow Always (User)", optionId: "allow_always_user" },
505
+ { kind: "reject_always", name: "Deny Always (Project)", optionId: "deny_always_project" },
506
+ { kind: "reject_always", name: "Deny Always (User)", optionId: "deny_always_user" },
507
+ { kind: "reject_once", name: "Enter alternative...", optionId: "alternative" }
508
+ ]
509
+ });
510
+ if (response.outcome.outcome === "selected") {
511
+ const optionId = response.outcome.optionId;
512
+ if (optionId === "alternative") {
513
+ const meta = response.outcome._meta;
514
+ const alternative = typeof _optionalChain([meta, 'optionalAccess', _12 => _12.alternative]) === "string" ? meta.alternative.trim() : "";
515
+ return alternative ? { decision: "alternative", alternative } : { decision: "deny_once" };
516
+ }
517
+ return { decision: optionId };
518
+ }
519
+ return { decision: "deny_once" };
520
+ } catch (error) {
521
+ process.stderr.write(
522
+ `[ACP] Permission request failed: ${error instanceof Error ? error.message : String(error)}
523
+ `
524
+ );
525
+ return { decision: "deny_once" };
526
+ }
527
+ };
528
+ return { confirmAction, setMode };
529
+ }
530
+
531
+ // src/modes/acp/adapter.ts
532
+ var AutohandAcpAdapter = (_class = class _AutohandAcpAdapter {
533
+ constructor(connection, cliOptions = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
534
+ this.connection = connection;
535
+ this.cliOptions = cliOptions;
536
+ }
537
+
538
+
539
+ __init() {this.sessions = /* @__PURE__ */ new Map()}
540
+ __init2() {this.agents = /* @__PURE__ */ new Map()}
541
+ __init3() {this.permissionBridges = /* @__PURE__ */ new Map()}
542
+ __init4() {this.sessionConfigOptions = /* @__PURE__ */ new Map()}
543
+ __init5() {this.cancelledSessions = /* @__PURE__ */ new Set()}
544
+ __init6() {this.config = null}
545
+
546
+ __init7() {this.toolStartTimes = /* @__PURE__ */ new Map()}
547
+ static __initStatic() {this.LIST_SESSIONS_PAGE_SIZE = 50}
548
+ async ensureConfig() {
549
+ if (!this.config) {
550
+ this.config = await _chunk46C73ZKKcjs.loadConfig.call(void 0, void 0, process.cwd());
551
+ }
552
+ return this.config;
553
+ }
554
+ buildSessionModes(modeId) {
555
+ return {
556
+ availableModes: DEFAULT_ACP_MODES.map((m) => ({
557
+ id: m.id,
558
+ name: m.name,
559
+ description: m.description
560
+ })),
561
+ currentModeId: modeId
562
+ };
563
+ }
564
+ buildSessionModels(config, modelId) {
565
+ return {
566
+ availableModels: parseAvailableModels(config).map((m) => ({
567
+ modelId: m,
568
+ name: _nullishCoalesce(m.split("/").pop(), () => ( m))
569
+ })),
570
+ currentModelId: modelId
571
+ };
572
+ }
573
+ cloneConfigOptions(options) {
574
+ return structuredClone(options);
575
+ }
576
+ getSessionConfigOptions(sessionId) {
577
+ const options = _nullishCoalesce(this.sessionConfigOptions.get(sessionId), () => ( []));
578
+ return this.cloneConfigOptions(options);
579
+ }
580
+ validateMode(modeId) {
581
+ if (!DEFAULT_ACP_MODES.some((mode) => mode.id === modeId)) {
582
+ throw _sdk.RequestError.invalidParams({ message: `Unsupported mode: ${modeId}` });
583
+ }
584
+ }
585
+ validateModel(config, modelId) {
586
+ const models = parseAvailableModels(config);
587
+ if (!models.includes(modelId)) {
588
+ throw _sdk.RequestError.invalidParams({ message: `Unsupported model: ${modelId}` });
589
+ }
590
+ }
591
+ convertAcpMcpServers(mcpServers) {
592
+ if (!mcpServers || mcpServers.length === 0) {
593
+ return [];
594
+ }
595
+ return mcpServers.map((server) => {
596
+ if ("command" in server) {
597
+ return {
598
+ name: server.name,
599
+ transport: "stdio",
600
+ command: server.command,
601
+ args: [...server.args],
602
+ env: Object.fromEntries(server.env.map((variable) => [variable.name, variable.value])),
603
+ autoConnect: true
604
+ };
605
+ }
606
+ return {
607
+ name: server.name,
608
+ transport: server.type,
609
+ url: server.url,
610
+ headers: Object.fromEntries(server.headers.map((header) => [header.name, header.value])),
611
+ autoConnect: true
612
+ };
613
+ });
614
+ }
615
+ async connectSessionMcpServers(agent, mcpServers) {
616
+ const converted = this.convertAcpMcpServers(mcpServers);
617
+ if (converted.length === 0) {
618
+ return;
619
+ }
620
+ await agent.connectAcpMcpServers(converted);
621
+ }
622
+ resolveWorkspaceRoot(sessionId, cwd) {
623
+ let workspaceRoot = cwd;
624
+ if (_chunk7LWQCE4Ycjs.isSessionWorktreeEnabled.call(void 0, this.cliOptions.worktree)) {
625
+ const sessionWorktree = _chunk7LWQCE4Ycjs.prepareSessionWorktree.call(void 0, {
626
+ cwd,
627
+ worktree: this.cliOptions.worktree,
628
+ mode: "acp"
629
+ });
630
+ workspaceRoot = sessionWorktree.worktreePath;
631
+ process.stderr.write(
632
+ `[ACP] Session ${sessionId} using git worktree ${sessionWorktree.worktreePath} (${sessionWorktree.branchName})
633
+ `
634
+ );
635
+ }
636
+ return workspaceRoot;
637
+ }
638
+ async createManagedSession(sessionId, workspaceRoot) {
639
+ const config = await this.ensureConfig();
640
+ if (!config.ui) {
641
+ config.ui = {};
642
+ }
643
+ config.ui.useInkRenderer = false;
644
+ const modeId = resolveDefaultMode(config);
645
+ const modelId = resolveDefaultModel(config);
646
+ const runtime = {
647
+ config,
648
+ workspaceRoot,
649
+ options: {
650
+ yes: modeId === "unrestricted" || modeId === "full-access",
651
+ unrestricted: modeId === "unrestricted",
652
+ restricted: modeId === "restricted",
653
+ dryRun: modeId === "dry-run",
654
+ contextCompact: true
655
+ // Default enabled; ACP config can toggle via applyAcpConfigOption
656
+ },
657
+ isRpcMode: true
658
+ };
659
+ const provider = _chunkWRTXCQ3Vcjs.ProviderFactory.create(config);
660
+ const files = new (0, _chunk5K3CDSWZcjs.FileActionManager)(workspaceRoot);
661
+ const agent = new (0, _chunk7JLT2VNWcjs.AutohandAgent)(provider, files, runtime);
662
+ await agent.initializeForRPC();
663
+ const state = {
664
+ sessionId,
665
+ modeId,
666
+ modelId,
667
+ workspaceRoot,
668
+ createdAt: Date.now(),
669
+ abortController: new AbortController(),
670
+ promptCount: 0
671
+ };
672
+ this.sessions.set(sessionId, state);
673
+ this.agents.set(sessionId, agent);
674
+ this.sessionConfigOptions.set(sessionId, buildConfigOptions(config));
675
+ agent.setOutputListener((event) => {
676
+ this.handleAgentOutput(sessionId, event);
677
+ });
678
+ const permBridge = createPermissionBridge({
679
+ connection: this.connection,
680
+ sessionId,
681
+ modeId
682
+ });
683
+ agent.setConfirmationCallback(async (message, context) => {
684
+ return permBridge.confirmAction(message, context);
685
+ });
686
+ this.permissionBridges.set(sessionId, permBridge);
687
+ return { config, state, agent };
688
+ }
689
+ restoreConversation(messages) {
690
+ const conversation = _chunkDA7NBAJKcjs.ConversationManager.getInstance();
691
+ if (!conversation.isInitialized()) {
692
+ throw new Error("Conversation manager is not initialized");
693
+ }
694
+ for (const msg of messages) {
695
+ if (msg.role === "system") {
696
+ if (!msg.content.startsWith("You are Autohand")) {
697
+ conversation.addSystemNote(msg.content);
698
+ }
699
+ continue;
700
+ }
701
+ let convertedToolCalls;
702
+ if (msg.toolCalls && Array.isArray(msg.toolCalls)) {
703
+ convertedToolCalls = msg.toolCalls.map((tc) => ({
704
+ id: tc.id,
705
+ type: "function",
706
+ function: {
707
+ name: tc.tool || _optionalChain([tc, 'access', _13 => _13.function, 'optionalAccess', _14 => _14.name]) || "unknown",
708
+ arguments: typeof tc.args === "string" ? tc.args : JSON.stringify(tc.args || {})
709
+ }
710
+ }));
711
+ }
712
+ conversation.addMessage({
713
+ role: msg.role,
714
+ content: msg.content,
715
+ name: msg.name,
716
+ tool_calls: convertedToolCalls,
717
+ tool_call_id: msg.tool_call_id
718
+ });
719
+ }
720
+ }
721
+ async replayConversation(sessionId, messages) {
722
+ for (const msg of messages) {
723
+ if (!_optionalChain([msg, 'access', _15 => _15.content, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()])) {
724
+ continue;
725
+ }
726
+ if (msg.role === "user") {
727
+ await this.connection.sessionUpdate({
728
+ sessionId,
729
+ update: {
730
+ sessionUpdate: "user_message_chunk",
731
+ content: { type: "text", text: msg.content }
732
+ }
733
+ });
734
+ continue;
735
+ }
736
+ if (msg.role === "assistant") {
737
+ await this.connection.sessionUpdate({
738
+ sessionId,
739
+ update: {
740
+ sessionUpdate: "agent_message_chunk",
741
+ content: { type: "text", text: msg.content }
742
+ }
743
+ });
744
+ continue;
745
+ }
746
+ if (msg.role === "tool") {
747
+ await this.connection.sessionUpdate({
748
+ sessionId,
749
+ update: {
750
+ sessionUpdate: "agent_message_chunk",
751
+ content: { type: "text", text: `[tool] ${msg.content}` }
752
+ }
753
+ });
754
+ continue;
755
+ }
756
+ if (msg.role === "system" && !msg.content.startsWith("You are Autohand")) {
757
+ await this.connection.sessionUpdate({
758
+ sessionId,
759
+ update: {
760
+ sessionUpdate: "agent_message_chunk",
761
+ content: { type: "text", text: `[system] ${msg.content}` }
762
+ }
763
+ });
764
+ }
765
+ }
766
+ }
767
+ async restoreSession(sessionId, cwd, mcpServers) {
768
+ const workspaceRoot = this.resolveWorkspaceRoot(sessionId, cwd);
769
+ const { config, state, agent } = await this.createManagedSession(sessionId, workspaceRoot);
770
+ await this.connectSessionMcpServers(agent, mcpServers);
771
+ const sessionManager = agent.getSessionManager();
772
+ try {
773
+ const loadedSession = await sessionManager.loadSession(sessionId);
774
+ const messages = loadedSession.getMessages();
775
+ this.restoreConversation(messages);
776
+ if (loadedSession.metadata.model) {
777
+ state.modelId = loadedSession.metadata.model;
778
+ }
779
+ this.sessions.set(sessionId, state);
780
+ return { config, state, messages };
781
+ } catch (error) {
782
+ this.sessions.delete(sessionId);
783
+ this.agents.delete(sessionId);
784
+ this.permissionBridges.delete(sessionId);
785
+ this.sessionConfigOptions.delete(sessionId);
786
+ throw error;
787
+ }
788
+ }
789
+ // ==========================================================================
790
+ // ACP Agent Interface: initialize
791
+ // ==========================================================================
792
+ async initialize(params) {
793
+ this.clientCapabilities = params.clientCapabilities;
794
+ this.config = await _chunk46C73ZKKcjs.loadConfig.call(void 0, void 0, process.cwd());
795
+ return {
796
+ protocolVersion: _sdk.PROTOCOL_VERSION,
797
+ agentCapabilities: {
798
+ promptCapabilities: {
799
+ embeddedContext: true,
800
+ image: true
801
+ },
802
+ loadSession: true,
803
+ mcpCapabilities: {
804
+ http: true,
805
+ sse: true
806
+ },
807
+ sessionCapabilities: {
808
+ list: {},
809
+ resume: {},
810
+ fork: {}
811
+ }
812
+ },
813
+ agentInfo: {
814
+ name: "autohand-cli",
815
+ title: "Autohand Code",
816
+ version: _chunkREMGR23Vcjs.package_default.version
817
+ }
818
+ };
819
+ }
820
+ // ==========================================================================
821
+ // ACP Agent Interface: authenticate
822
+ // ==========================================================================
823
+ async authenticate(_params) {
824
+ if (_optionalChain([this, 'access', _18 => _18.config, 'optionalAccess', _19 => _19.auth, 'optionalAccess', _20 => _20.token])) {
825
+ return {};
826
+ }
827
+ const provider = _nullishCoalesce(_optionalChain([this, 'access', _21 => _21.config, 'optionalAccess', _22 => _22.provider]), () => ( "openrouter"));
828
+ const providerConfig = _optionalChain([this, 'access', _23 => _23.config, 'optionalAccess', _24 => _24[provider]]);
829
+ if (_optionalChain([providerConfig, 'optionalAccess', _25 => _25.apiKey])) {
830
+ return {};
831
+ }
832
+ throw _sdk.RequestError.authRequired({
833
+ message: "Please run `autohand --setup` or `autohand login` in your terminal."
834
+ });
835
+ }
836
+ // ==========================================================================
837
+ // ACP Agent Interface: newSession
838
+ // ==========================================================================
839
+ async newSession(params) {
840
+ const sessionId = crypto.randomUUID();
841
+ const workspaceRoot = this.resolveWorkspaceRoot(sessionId, params.cwd);
842
+ const { config, state, agent } = await this.createManagedSession(sessionId, workspaceRoot);
843
+ await this.connectSessionMcpServers(agent, params.mcpServers);
844
+ this.emitHookSessionStart(sessionId, "startup");
845
+ const response = {
846
+ sessionId,
847
+ modes: this.buildSessionModes(state.modeId),
848
+ models: this.buildSessionModels(config, state.modelId),
849
+ configOptions: this.getSessionConfigOptions(sessionId),
850
+ _meta: {
851
+ commands: DEFAULT_ACP_COMMANDS.map((cmd) => ({
852
+ name: cmd.name,
853
+ description: cmd.description
854
+ }))
855
+ }
856
+ };
857
+ return response;
858
+ }
859
+ // ==========================================================================
860
+ // ACP Agent Interface: prompt
861
+ // ==========================================================================
862
+ async prompt(params) {
863
+ const session = this.sessions.get(params.sessionId);
864
+ const agent = this.agents.get(params.sessionId);
865
+ if (!session || !agent) {
866
+ throw _sdk.RequestError.invalidParams({ message: "Session not found" });
867
+ }
868
+ session.abortController = new AbortController();
869
+ this.cancelledSessions.delete(params.sessionId);
870
+ let instruction = "";
871
+ if (params.prompt) {
872
+ for (const block of params.prompt) {
873
+ if (block.type === "text") {
874
+ instruction += block.text;
875
+ } else if (block.type === "resource") {
876
+ const resourceUri = _nullishCoalesce(_optionalChain([block, 'access', _26 => _26.resource, 'optionalAccess', _27 => _27.uri]), () => ( ""));
877
+ instruction += `
878
+ [Resource: ${resourceUri}]`;
879
+ }
880
+ }
881
+ }
882
+ if (!instruction.trim()) {
883
+ return { stopReason: "end_turn" };
884
+ }
885
+ session.promptCount++;
886
+ if (session.promptCount === 1) {
887
+ const title = instruction.trim().slice(0, 120);
888
+ this.connection.sessionUpdate({
889
+ sessionId: params.sessionId,
890
+ update: {
891
+ sessionUpdate: "session_info_update",
892
+ title,
893
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
894
+ }
895
+ });
896
+ } else {
897
+ this.connection.sessionUpdate({
898
+ sessionId: params.sessionId,
899
+ update: {
900
+ sessionUpdate: "session_info_update",
901
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
902
+ }
903
+ });
904
+ }
905
+ const trimmed = instruction.trim();
906
+ if (trimmed.startsWith("/") && !_chunk7JLT2VNWcjs.isLikelyFilePathSlashInput.call(void 0, trimmed)) {
907
+ const { command, args } = agent.parseSlashCommand(trimmed);
908
+ if (agent.isSlashCommand(trimmed)) {
909
+ try {
910
+ if (agent.isSlashCommandSupported(command)) {
911
+ const result = await agent.handleSlashCommand(command, args);
912
+ if (result !== null) {
913
+ await this.connection.sessionUpdate({
914
+ sessionId: params.sessionId,
915
+ update: {
916
+ sessionUpdate: "agent_message_chunk",
917
+ content: { type: "text", text: result }
918
+ }
919
+ });
920
+ } else {
921
+ await this.connection.sessionUpdate({
922
+ sessionId: params.sessionId,
923
+ update: {
924
+ sessionUpdate: "agent_message_chunk",
925
+ content: { type: "text", text: `Command ${command} executed.` }
926
+ }
927
+ });
928
+ }
929
+ } else {
930
+ await this.connection.sessionUpdate({
931
+ sessionId: params.sessionId,
932
+ update: {
933
+ sessionUpdate: "agent_message_chunk",
934
+ content: { type: "text", text: `Unknown command: ${command}. Type /help for available commands.` }
935
+ }
936
+ });
937
+ }
938
+ } catch (err) {
939
+ const errMsg = err instanceof Error ? err.message : String(err);
940
+ await this.connection.sessionUpdate({
941
+ sessionId: params.sessionId,
942
+ update: {
943
+ sessionUpdate: "agent_message_chunk",
944
+ content: { type: "text", text: `Error: ${errMsg}` }
945
+ }
946
+ });
947
+ }
948
+ return { stopReason: "end_turn" };
949
+ }
950
+ }
951
+ const turnStart = Date.now();
952
+ this.emitHookPrePrompt(params.sessionId, instruction, []);
953
+ try {
954
+ const success = await agent.runInstruction(instruction);
955
+ const turnDuration = Date.now() - turnStart;
956
+ this.emitHookStop(params.sessionId, 0, 0, turnDuration);
957
+ if (!success && this.cancelledSessions.has(params.sessionId)) {
958
+ return { stopReason: "cancelled" };
959
+ }
960
+ return { stopReason: "end_turn" };
961
+ } catch (err) {
962
+ if (session.abortController.signal.aborted || this.cancelledSessions.has(params.sessionId)) {
963
+ return { stopReason: "cancelled" };
964
+ }
965
+ const classified = this.classifyAndFormatError(err);
966
+ process.stderr.write(`[ACP] Prompt error (${classified.code}): ${classified.message}
967
+ `);
968
+ this.emitHookSessionError(params.sessionId, classified.message, classified.code);
969
+ await this.connection.sessionUpdate({
970
+ sessionId: params.sessionId,
971
+ update: {
972
+ sessionUpdate: "agent_message_chunk",
973
+ content: { type: "text", text: `Error (${classified.code}): ${classified.message}` }
974
+ }
975
+ });
976
+ return { stopReason: "end_turn" };
977
+ }
978
+ }
979
+ // ==========================================================================
980
+ // ACP Agent Interface: cancel
981
+ // ==========================================================================
982
+ async cancel(params) {
983
+ const session = this.sessions.get(params.sessionId);
984
+ const agent = this.agents.get(params.sessionId);
985
+ if (session) {
986
+ session.abortController.abort();
987
+ this.cancelledSessions.add(params.sessionId);
988
+ }
989
+ if (agent) {
990
+ agent.cancelCurrentInstruction();
991
+ }
992
+ }
993
+ // ==========================================================================
994
+ // ACP Agent Interface: setSessionMode
995
+ // ==========================================================================
996
+ async setSessionMode(params) {
997
+ const session = this.sessions.get(params.sessionId);
998
+ const agent = this.agents.get(params.sessionId);
999
+ if (!session) {
1000
+ throw _sdk.RequestError.invalidParams({ message: "Session not found" });
1001
+ }
1002
+ if (!agent) {
1003
+ throw _sdk.RequestError.invalidParams({ message: "Session agent not found" });
1004
+ }
1005
+ this.validateMode(params.modeId);
1006
+ session.modeId = params.modeId;
1007
+ _optionalChain([this, 'access', _28 => _28.permissionBridges, 'access', _29 => _29.get, 'call', _30 => _30(params.sessionId), 'optionalAccess', _31 => _31.setMode, 'call', _32 => _32(params.modeId)]);
1008
+ agent.applyAcpMode(params.modeId);
1009
+ process.stderr.write(`[ACP] Session ${params.sessionId} mode set to: ${params.modeId}
1010
+ `);
1011
+ await this.connection.sessionUpdate({
1012
+ sessionId: params.sessionId,
1013
+ update: {
1014
+ sessionUpdate: "current_mode_update",
1015
+ currentModeId: params.modeId
1016
+ }
1017
+ });
1018
+ return {};
1019
+ }
1020
+ // ==========================================================================
1021
+ // ACP Agent Interface: unstable_setSessionModel
1022
+ // ==========================================================================
1023
+ async unstable_setSessionModel(params) {
1024
+ const session = this.sessions.get(params.sessionId);
1025
+ const agent = this.agents.get(params.sessionId);
1026
+ if (!session) {
1027
+ throw _sdk.RequestError.invalidParams({ message: "Session not found" });
1028
+ }
1029
+ if (!agent) {
1030
+ throw _sdk.RequestError.invalidParams({ message: "Session agent not found" });
1031
+ }
1032
+ const config = await this.ensureConfig();
1033
+ this.validateModel(config, params.modelId);
1034
+ session.modelId = params.modelId;
1035
+ agent.applyAcpModel(params.modelId);
1036
+ process.stderr.write(`[ACP] Session ${params.sessionId} model set to: ${params.modelId}
1037
+ `);
1038
+ return {};
1039
+ }
1040
+ async unstable_setSessionConfigOption(params) {
1041
+ const options = this.sessionConfigOptions.get(params.sessionId);
1042
+ const agent = this.agents.get(params.sessionId);
1043
+ if (!options || !agent) {
1044
+ throw _sdk.RequestError.invalidParams({ message: "Session not found" });
1045
+ }
1046
+ const option = options.find((entry) => entry.id === params.configId);
1047
+ if (!option) {
1048
+ throw _sdk.RequestError.invalidParams({ message: `Unknown config option: ${params.configId}` });
1049
+ }
1050
+ const validValues = [];
1051
+ if (option.type === "select" && "options" in option) {
1052
+ for (const entry of option.options) {
1053
+ if ("value" in entry) {
1054
+ validValues.push(entry.value);
1055
+ } else if ("options" in entry) {
1056
+ for (const subEntry of entry.options) {
1057
+ validValues.push(subEntry.value);
1058
+ }
1059
+ }
1060
+ }
1061
+ }
1062
+ if (typeof params.value === "string" && !validValues.includes(params.value)) {
1063
+ throw _sdk.RequestError.invalidParams({
1064
+ message: `Invalid value "${params.value}" for config option "${params.configId}"`
1065
+ });
1066
+ }
1067
+ option.currentValue = params.value;
1068
+ agent.applyAcpConfigOption(params.configId, String(params.value));
1069
+ return {
1070
+ configOptions: this.cloneConfigOptions(options)
1071
+ };
1072
+ }
1073
+ // ==========================================================================
1074
+ // ACP Agent Interface: unstable_listSessions (optional)
1075
+ // ==========================================================================
1076
+ async unstable_listSessions(params) {
1077
+ try {
1078
+ const { SessionManager } = await Promise.resolve().then(() => _interopRequireWildcard(require("./SessionManager-WAPTFMDO.cjs")));
1079
+ const sessionManager = new SessionManager();
1080
+ await sessionManager.initialize();
1081
+ const sessions = await sessionManager.listSessions();
1082
+ const filtered = params.cwd ? sessions.filter((session) => session.projectPath === params.cwd) : sessions;
1083
+ const offset = params.cursor ? Number.parseInt(params.cursor, 10) : 0;
1084
+ if (Number.isNaN(offset) || offset < 0) {
1085
+ throw _sdk.RequestError.invalidParams({ message: `Invalid cursor: ${params.cursor}` });
1086
+ }
1087
+ const paged = filtered.slice(offset, offset + _AutohandAcpAdapter.LIST_SESSIONS_PAGE_SIZE);
1088
+ const nextOffset = offset + paged.length;
1089
+ const nextCursor = nextOffset < filtered.length ? String(nextOffset) : void 0;
1090
+ return {
1091
+ sessions: paged.map((s) => ({
1092
+ sessionId: s.sessionId,
1093
+ cwd: _nullishCoalesce(s.projectPath, () => ( "")),
1094
+ title: _nullishCoalesce(_nullishCoalesce(s.summary, () => ( s.projectName)), () => ( `Session ${s.sessionId.slice(0, 8)}`)),
1095
+ updatedAt: _nullishCoalesce(s.lastActiveAt, () => ( s.createdAt))
1096
+ })),
1097
+ ...nextCursor ? { nextCursor } : {}
1098
+ };
1099
+ } catch (err) {
1100
+ process.stderr.write(`[ACP] Failed to list sessions: ${err instanceof Error ? err.message : String(err)}
1101
+ `);
1102
+ return { sessions: [] };
1103
+ }
1104
+ }
1105
+ // ==========================================================================
1106
+ // ACP Agent Interface: unstable_resumeSession (optional)
1107
+ // ==========================================================================
1108
+ async unstable_resumeSession(_params) {
1109
+ try {
1110
+ const params = _params;
1111
+ const { config, state } = await this.restoreSession(params.sessionId, params.cwd, params.mcpServers);
1112
+ this.emitHookSessionStart(params.sessionId, "resume");
1113
+ process.stderr.write(`[ACP] Resumed session ${params.sessionId}
1114
+ `);
1115
+ return {
1116
+ modes: this.buildSessionModes(state.modeId),
1117
+ models: this.buildSessionModels(config, state.modelId),
1118
+ configOptions: this.getSessionConfigOptions(params.sessionId)
1119
+ };
1120
+ } catch (error) {
1121
+ const message = error instanceof Error ? error.message : String(error);
1122
+ throw _sdk.RequestError.invalidParams({ message: `Failed to resume session: ${message}` });
1123
+ }
1124
+ }
1125
+ // ==========================================================================
1126
+ // ACP Agent Interface: unstable_forkSession (optional)
1127
+ // ==========================================================================
1128
+ async unstable_forkSession(params) {
1129
+ const sourceSession = this.sessions.get(params.sessionId);
1130
+ if (!sourceSession) {
1131
+ throw _sdk.RequestError.invalidParams({ message: "Source session not found" });
1132
+ }
1133
+ const sourceAgent = this.agents.get(params.sessionId);
1134
+ if (sourceAgent) {
1135
+ try {
1136
+ const conversation = _chunkDA7NBAJKcjs.ConversationManager.getInstance();
1137
+ const { extractAndSaveSessionMemories } = await Promise.resolve().then(() => _interopRequireWildcard(require("./extractSessionMemories-XL3MS37F.cjs")));
1138
+ await extractAndSaveSessionMemories({
1139
+ llm: sourceAgent.getLlmProvider(),
1140
+ memoryManager: sourceAgent.getMemoryManager(),
1141
+ conversationHistory: conversation.history(),
1142
+ workspaceRoot: sourceSession.workspaceRoot
1143
+ });
1144
+ } catch (e) {
1145
+ }
1146
+ }
1147
+ const newSessionResponse = await this.newSession({
1148
+ cwd: sourceSession.workspaceRoot,
1149
+ mcpServers: []
1150
+ });
1151
+ return {
1152
+ sessionId: newSessionResponse.sessionId
1153
+ };
1154
+ }
1155
+ // ==========================================================================
1156
+ // ACP Agent Interface: loadSession (optional)
1157
+ // ==========================================================================
1158
+ async loadSession(params) {
1159
+ try {
1160
+ const { config, state, messages } = await this.restoreSession(params.sessionId, params.cwd, params.mcpServers);
1161
+ await this.replayConversation(params.sessionId, messages);
1162
+ this.emitHookSessionStart(params.sessionId, "resume");
1163
+ process.stderr.write(`[ACP] Loaded session ${params.sessionId} with ${messages.length} messages
1164
+ `);
1165
+ return {
1166
+ modes: this.buildSessionModes(state.modeId),
1167
+ models: this.buildSessionModels(config, state.modelId),
1168
+ configOptions: this.getSessionConfigOptions(params.sessionId)
1169
+ };
1170
+ } catch (error) {
1171
+ const message = error instanceof Error ? error.message : String(error);
1172
+ throw _sdk.RequestError.invalidParams({ message: `Failed to load session: ${message}` });
1173
+ }
1174
+ }
1175
+ // ==========================================================================
1176
+ // Hook Lifecycle Notifications
1177
+ // ==========================================================================
1178
+ /**
1179
+ * Safely emit a hook notification via extNotification.
1180
+ * Hook notifications must never crash the agent — errors are logged and swallowed.
1181
+ */
1182
+ async emitHookSafe(method, params) {
1183
+ try {
1184
+ await this.connection.extNotification(method, params);
1185
+ } catch (err) {
1186
+ process.stderr.write(
1187
+ `[ACP] Failed to emit hook notification ${method}: ${err instanceof Error ? err.message : String(err)}
1188
+ `
1189
+ );
1190
+ }
1191
+ }
1192
+ emitHookPreTool(sessionId, toolId, toolName, args) {
1193
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_PRE_TOOL, {
1194
+ sessionId,
1195
+ toolId,
1196
+ toolName,
1197
+ args,
1198
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1199
+ });
1200
+ }
1201
+ emitHookPostTool(sessionId, toolId, toolName, success, duration, output) {
1202
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_POST_TOOL, {
1203
+ sessionId,
1204
+ toolId,
1205
+ toolName,
1206
+ success,
1207
+ duration,
1208
+ output,
1209
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1210
+ });
1211
+ }
1212
+ emitHookFileModified(sessionId, filePath, changeType, toolId) {
1213
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_FILE_MODIFIED, {
1214
+ sessionId,
1215
+ filePath,
1216
+ changeType,
1217
+ toolId,
1218
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1219
+ });
1220
+ }
1221
+ emitHookPrePrompt(sessionId, instruction, mentionedFiles) {
1222
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_PRE_PROMPT, {
1223
+ sessionId,
1224
+ instruction,
1225
+ mentionedFiles,
1226
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1227
+ });
1228
+ }
1229
+ emitHookPostResponse(sessionId, tokensUsed, toolCallsCount, duration) {
1230
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_POST_RESPONSE, {
1231
+ sessionId,
1232
+ tokensUsed,
1233
+ toolCallsCount,
1234
+ duration,
1235
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1236
+ });
1237
+ }
1238
+ emitHookSessionError(sessionId, error, code, context) {
1239
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_SESSION_ERROR, {
1240
+ sessionId,
1241
+ error,
1242
+ code,
1243
+ context,
1244
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1245
+ });
1246
+ }
1247
+ emitHookStop(sessionId, tokensUsed, toolCallsCount, duration) {
1248
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_STOP, {
1249
+ sessionId,
1250
+ tokensUsed,
1251
+ toolCallsCount,
1252
+ duration,
1253
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1254
+ });
1255
+ }
1256
+ emitHookSessionStart(sessionId, sessionType) {
1257
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_SESSION_START, {
1258
+ sessionId,
1259
+ sessionType,
1260
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1261
+ });
1262
+ }
1263
+ emitHookSessionEnd(sessionId, reason, duration) {
1264
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_SESSION_END, {
1265
+ sessionId,
1266
+ reason,
1267
+ duration,
1268
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1269
+ });
1270
+ }
1271
+ emitHookSubagentStop(sessionId, subagentId, subagentName, subagentType, success, duration, error) {
1272
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_SUBAGENT_STOP, {
1273
+ sessionId,
1274
+ subagentId,
1275
+ subagentName,
1276
+ subagentType,
1277
+ success,
1278
+ duration,
1279
+ error,
1280
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1281
+ });
1282
+ }
1283
+ emitHookPermissionRequest(sessionId, tool, path, command, args) {
1284
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_PERMISSION_REQUEST, {
1285
+ sessionId,
1286
+ tool,
1287
+ path,
1288
+ command,
1289
+ args,
1290
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1291
+ });
1292
+ }
1293
+ emitHookNotification(sessionId, notificationType, message) {
1294
+ void this.emitHookSafe(ACP_HOOK_NOTIFICATIONS.HOOK_NOTIFICATION, {
1295
+ sessionId,
1296
+ notificationType,
1297
+ message,
1298
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1299
+ });
1300
+ }
1301
+ // ==========================================================================
1302
+ // Agent Output → ACP Session Updates
1303
+ // ==========================================================================
1304
+ /**
1305
+ * Translates AutohandAgent output events into ACP session update notifications.
1306
+ * This is the core bridge between the agent's internal event system and the ACP protocol.
1307
+ */
1308
+ async handleAgentOutput(sessionId, event) {
1309
+ try {
1310
+ switch (event.type) {
1311
+ case "thinking":
1312
+ if (event.thought) {
1313
+ await this.connection.sessionUpdate({
1314
+ sessionId,
1315
+ update: {
1316
+ sessionUpdate: "agent_message_chunk",
1317
+ content: {
1318
+ type: "thinking",
1319
+ text: event.thought
1320
+ }
1321
+ }
1322
+ });
1323
+ }
1324
+ break;
1325
+ case "message":
1326
+ if (event.content) {
1327
+ await this.connection.sessionUpdate({
1328
+ sessionId,
1329
+ update: {
1330
+ sessionUpdate: "agent_message_chunk",
1331
+ content: {
1332
+ type: "text",
1333
+ text: event.content
1334
+ }
1335
+ }
1336
+ });
1337
+ }
1338
+ break;
1339
+ case "tool_start":
1340
+ if (event.toolName) {
1341
+ const toolCallId = _nullishCoalesce(event.toolId, () => ( `tool_${Date.now()}`));
1342
+ const kind = resolveToolKind(event.toolName);
1343
+ const title = resolveToolDisplayName(event.toolName);
1344
+ const locations = [];
1345
+ if (_optionalChain([event, 'access', _33 => _33.toolArgs, 'optionalAccess', _34 => _34.path]) && typeof event.toolArgs.path === "string") {
1346
+ locations.push({ path: event.toolArgs.path });
1347
+ }
1348
+ if (_optionalChain([event, 'access', _35 => _35.toolArgs, 'optionalAccess', _36 => _36.file]) && typeof event.toolArgs.file === "string") {
1349
+ locations.push({ path: event.toolArgs.file });
1350
+ }
1351
+ await this.connection.sessionUpdate({
1352
+ sessionId,
1353
+ update: {
1354
+ sessionUpdate: "tool_call",
1355
+ toolCallId,
1356
+ title,
1357
+ kind,
1358
+ status: "in_progress",
1359
+ locations,
1360
+ rawInput: _nullishCoalesce(event.toolArgs, () => ( {}))
1361
+ }
1362
+ });
1363
+ this.toolStartTimes.set(toolCallId, Date.now());
1364
+ this.emitHookPreTool(sessionId, toolCallId, event.toolName, _nullishCoalesce(event.toolArgs, () => ( {})));
1365
+ }
1366
+ break;
1367
+ case "tool_end":
1368
+ if (event.toolName) {
1369
+ const toolCallId = _nullishCoalesce(event.toolId, () => ( "unknown"));
1370
+ const status = event.toolSuccess !== false ? "completed" : "failed";
1371
+ await this.connection.sessionUpdate({
1372
+ sessionId,
1373
+ update: {
1374
+ sessionUpdate: "tool_call_update",
1375
+ toolCallId,
1376
+ status,
1377
+ rawOutput: event.toolOutput ? { output: event.toolOutput } : void 0
1378
+ }
1379
+ });
1380
+ const startTime = this.toolStartTimes.get(toolCallId);
1381
+ const duration = startTime ? Date.now() - startTime : 0;
1382
+ this.toolStartTimes.delete(toolCallId);
1383
+ this.emitHookPostTool(
1384
+ sessionId,
1385
+ toolCallId,
1386
+ event.toolName,
1387
+ event.toolSuccess !== false,
1388
+ duration,
1389
+ event.toolOutput
1390
+ );
1391
+ }
1392
+ break;
1393
+ case "schedule_triggered":
1394
+ if (event.content) {
1395
+ await this.connection.sessionUpdate({
1396
+ sessionId,
1397
+ update: {
1398
+ sessionUpdate: "agent_message_chunk",
1399
+ content: { type: "text", text: `[Scheduled job triggered] ${event.content}` }
1400
+ }
1401
+ });
1402
+ }
1403
+ break;
1404
+ case "file_modified":
1405
+ if (event.filePath) {
1406
+ this.emitHookFileModified(
1407
+ sessionId,
1408
+ event.filePath,
1409
+ _nullishCoalesce(event.changeType, () => ( "modify")),
1410
+ _nullishCoalesce(event.toolId, () => ( ""))
1411
+ );
1412
+ }
1413
+ break;
1414
+ case "error":
1415
+ if (event.content) {
1416
+ const classified = this.classifyAndFormatError(event.content);
1417
+ await this.connection.sessionUpdate({
1418
+ sessionId,
1419
+ update: {
1420
+ sessionUpdate: "agent_message_chunk",
1421
+ content: {
1422
+ type: "text",
1423
+ text: `Error (${classified.code}): ${classified.message}`
1424
+ }
1425
+ }
1426
+ });
1427
+ this.emitHookSessionError(sessionId, classified.message, classified.code);
1428
+ }
1429
+ break;
1430
+ }
1431
+ } catch (err) {
1432
+ process.stderr.write(
1433
+ `[ACP] Failed to send session update: ${err instanceof Error ? err.message : String(err)}
1434
+ `
1435
+ );
1436
+ }
1437
+ }
1438
+ /**
1439
+ * Classify an error and return a structured result for ACP consumers.
1440
+ * Accepts either an Error instance (including ApiError), a string, or an unknown.
1441
+ */
1442
+ classifyAndFormatError(error) {
1443
+ if (error instanceof _chunk3OF56EMAcjs.ApiError) {
1444
+ return {
1445
+ message: error.rawDetail || error.message,
1446
+ code: error.code,
1447
+ recoverable: error.retryable
1448
+ };
1449
+ }
1450
+ const message = error instanceof Error ? error.message : String(error);
1451
+ const classified = _chunk3OF56EMAcjs.classifyApiError.call(void 0, 0, message);
1452
+ return {
1453
+ message,
1454
+ code: classified.code,
1455
+ recoverable: classified.retryable
1456
+ };
1457
+ }
1458
+ }, _class.__initStatic(), _class);
1459
+
1460
+ // src/modes/acp/index.ts
1461
+ function redirectConsoleToStderr() {
1462
+ const stderrWrite = (...args) => {
1463
+ process.stderr.write(args.map(String).join(" ") + "\n");
1464
+ };
1465
+ console.log = stderrWrite;
1466
+ console.info = stderrWrite;
1467
+ console.warn = stderrWrite;
1468
+ console.debug = stderrWrite;
1469
+ }
1470
+ async function runAcpMode(options) {
1471
+ const workspacePath = _nullishCoalesce(options.path, () => ( process.cwd()));
1472
+ const workspacePathValidation = await _chunk3LJJG5YYcjs.validateWorkspacePath.call(void 0, workspacePath);
1473
+ if (!workspacePathValidation.valid) {
1474
+ process.stderr.write(`[ACP] Error: ${workspacePathValidation.error}
1475
+ `);
1476
+ process.exit(1);
1477
+ }
1478
+ const safetyCheck = _chunkWGNMOVMTcjs.checkWorkspaceSafety.call(void 0, workspacePath);
1479
+ if (!safetyCheck.safe) {
1480
+ process.stderr.write(`[ACP] Error: Unsafe workspace \u2014 ${safetyCheck.reason}
1481
+ `);
1482
+ process.exit(1);
1483
+ }
1484
+ redirectConsoleToStderr();
1485
+ process.env.AUTOHAND_CLIENT_NAME = "acp";
1486
+ process.stderr.write("[ACP] Starting native ACP mode...\n");
1487
+ _chunkMO4KP6XScjs.installProcessErrorHandlers.call(void 0, );
1488
+ const input = _stream.Writable.toWeb(process.stdout);
1489
+ const output = _stream.Readable.toWeb(process.stdin);
1490
+ const stream = _sdk.ndJsonStream.call(void 0, input, output);
1491
+ const _connection = new (0, _sdk.AgentSideConnection)(
1492
+ (conn) => new AutohandAcpAdapter(conn, options),
1493
+ stream
1494
+ );
1495
+ process.stdin.resume();
1496
+ _connection.signal.addEventListener("abort", () => {
1497
+ process.stderr.write("[ACP] Connection closed.\n");
1498
+ process.exit(0);
1499
+ });
1500
+ process.stderr.write("[ACP] Native ACP mode ready. Waiting for client...\n");
1501
+ }
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+ exports.ACP_HOOK_NOTIFICATIONS = ACP_HOOK_NOTIFICATIONS; exports.AutohandAcpAdapter = AutohandAcpAdapter; exports.DEFAULT_ACP_COMMANDS = DEFAULT_ACP_COMMANDS; exports.DEFAULT_ACP_MODES = DEFAULT_ACP_MODES; exports.TOOL_DISPLAY_NAMES = TOOL_DISPLAY_NAMES; exports.TOOL_KIND_MAP = TOOL_KIND_MAP; exports.buildConfigOptions = buildConfigOptions; exports.createPermissionBridge = createPermissionBridge; exports.parseAvailableModels = parseAvailableModels; exports.resolveDefaultMode = resolveDefaultMode; exports.resolveDefaultModel = resolveDefaultModel; exports.resolveToolDisplayName = resolveToolDisplayName; exports.resolveToolKind = resolveToolKind; exports.runAcpMode = runAcpMode;