autohand-cli 0.7.14 → 0.8.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 (394) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/AgentRegistry-7LDL5HJH.js +10 -0
  3. package/dist/AgentRegistry-NQCLWABO.cjs +10 -0
  4. package/dist/{AutomodeManager-NGRAO2MH.js → AutomodeManager-MWLKGPZK.js} +2 -0
  5. package/dist/{AutomodeManager-ZKQMBM4T.cjs → AutomodeManager-NYIZNODK.cjs} +3 -1
  6. package/dist/CommunitySkillsCache-6QPRMTJO.js +8 -0
  7. package/dist/CommunitySkillsCache-GTQMOCCO.cjs +8 -0
  8. package/dist/{GitHubRegistryFetcher-US2JJID4.js → GitHubRegistryFetcher-6JQ5JEDZ.js} +1 -0
  9. package/dist/{GitHubRegistryFetcher-K744NNAJ.cjs → GitHubRegistryFetcher-S7QFUEKV.cjs} +1 -0
  10. package/dist/HookManager-Q2KYMCP4.cjs +7 -0
  11. package/dist/HookManager-TTP4Y6DC.js +7 -0
  12. package/dist/ImportWizard-IWVPRKFF.cjs +466 -0
  13. package/dist/ImportWizard-KASGQPUY.js +466 -0
  14. package/dist/McpClientManager-7RM6YT35.js +8 -0
  15. package/dist/McpClientManager-RKD7C6OY.cjs +8 -0
  16. package/dist/MemoryManager-GUNLRP5S.js +8 -0
  17. package/dist/MemoryManager-TNSGKDKX.cjs +8 -0
  18. package/dist/PermissionManager-2GO5PQ6M.cjs +11 -0
  19. package/dist/{PermissionManager-U5OMGR3L.js → PermissionManager-K7UWSNB6.js} +4 -3
  20. package/dist/ProjectProfiler-UMJJSOCE.js +194 -0
  21. package/dist/ProjectProfiler-ZDWR2ODG.cjs +194 -0
  22. package/dist/ProviderFactory-EFFQBRQ6.cjs +9 -0
  23. package/dist/ProviderFactory-S3LWTQQC.js +9 -0
  24. package/dist/SessionManager-FEUAU3ZJ.cjs +10 -0
  25. package/dist/SessionManager-IKWAK2PI.js +10 -0
  26. package/dist/SkillsRegistry-GDEGFP6O.cjs +9 -0
  27. package/dist/SkillsRegistry-SI5RUHQ4.js +9 -0
  28. package/dist/SubAgent-I75HELJG.js +11 -0
  29. package/dist/SubAgent-K3QP6WHC.cjs +11 -0
  30. package/dist/{SyncApiClient-AYXYSOJM.js → SyncApiClient-LVIO4C2S.js} +1 -0
  31. package/dist/{SyncApiClient-ID3KXEMA.cjs → SyncApiClient-ZNYMT36M.cjs} +1 -0
  32. package/dist/about-B2AGTV6N.js +12 -0
  33. package/dist/about-V2HWEZZO.cjs +12 -0
  34. package/dist/actionExecutor-6XCVL2SJ.js +19 -0
  35. package/dist/actionExecutor-YRUJNB5G.cjs +19 -0
  36. package/dist/add-dir-7FBQ5IFV.js +10 -0
  37. package/dist/add-dir-ALBSYRV3.cjs +10 -0
  38. package/dist/agents/builtin/code-cleaner.md +14 -0
  39. package/dist/agents/builtin/docs-writer.md +14 -0
  40. package/dist/agents/builtin/researcher.md +14 -0
  41. package/dist/agents/builtin/reviewer.md +15 -0
  42. package/dist/agents/builtin/tester.md +15 -0
  43. package/dist/agents/builtin/todo-resolver.md +15 -0
  44. package/dist/agents-FCGEWTA3.cjs +12 -0
  45. package/dist/agents-FENGUSJD.js +12 -0
  46. package/dist/agents-new-FU3O55CO.js +14 -0
  47. package/dist/agents-new-SAFTJ7TK.cjs +14 -0
  48. package/dist/assets/icon.png +0 -0
  49. package/dist/automode-CYLGXQ4A.cjs +10 -0
  50. package/dist/automode-O7G3DUYN.js +10 -0
  51. package/dist/{cc-UTTLESTY.js → cc-7LEIJ3KF.js} +1 -0
  52. package/dist/{cc-2W6M7J45.cjs → cc-Q5MM4AWC.cjs} +1 -0
  53. package/dist/{chunk-N4ZSG6JJ.cjs → chunk-22D2CNTP.cjs} +2 -2
  54. package/dist/chunk-24QIWILL.js +51 -0
  55. package/dist/{chunk-MYNHJHDZ.js → chunk-2AA5MFES.js} +1 -1
  56. package/dist/{chunk-KWRUQRXR.js → chunk-2ELK5DMH.js} +44 -10
  57. package/dist/chunk-2JYIR3EC.cjs +1176 -0
  58. package/dist/{chunk-CRQKDBLD.js → chunk-2RIAPTET.js} +90 -66
  59. package/dist/{chunk-TSY7JHIV.cjs → chunk-33A755XB.cjs} +2 -2
  60. package/dist/chunk-3OEDGIFW.js +42 -0
  61. package/dist/{chunk-P5VDZ6PV.js → chunk-3PDTTAKJ.js} +1 -1
  62. package/dist/{chunk-ULMPJUJW.cjs → chunk-3WCOFXQS.cjs} +23 -23
  63. package/dist/{chunk-PDKNHU5G.cjs → chunk-4HKTYHNL.cjs} +22 -16
  64. package/dist/{chunk-Z4J4W6YQ.cjs → chunk-4JNNTOGF.cjs} +2 -48
  65. package/dist/chunk-55B6SBHK.js +260 -0
  66. package/dist/chunk-5DDDUUBM.cjs +29 -0
  67. package/dist/{chunk-TQB222ZB.js → chunk-5EIEWVYX.js} +2 -2
  68. package/dist/{chunk-SMHY3Q7B.cjs → chunk-5GGX6WNY.cjs} +54 -22
  69. package/dist/{chunk-3S4DEIJP.cjs → chunk-5IXII4HX.cjs} +2 -2
  70. package/dist/{chunk-3KBBARKO.js → chunk-5OBNULPU.js} +85 -28
  71. package/dist/{chunk-VVBBEYTH.cjs → chunk-5YJG6H6P.cjs} +10 -10
  72. package/dist/{chunk-PKOAXQKW.cjs → chunk-63WXWFDI.cjs} +11 -11
  73. package/dist/{chunk-DSKVMFRM.cjs → chunk-643VRA5S.cjs} +12 -4
  74. package/dist/{chunk-L5ZFPWHY.js → chunk-6OYHF6MF.js} +12 -4
  75. package/dist/chunk-7GDVDSNI.js +1176 -0
  76. package/dist/chunk-7QEE6SW6.cjs +260 -0
  77. package/dist/chunk-7UOUW76C.js +603 -0
  78. package/dist/{chunk-SZP4ULM5.cjs → chunk-AFN7LH5N.cjs} +17 -17
  79. package/dist/chunk-AHD5JJ6F.cjs +78 -0
  80. package/dist/{chunk-WLTVF77A.js → chunk-ALYU6VTM.js} +1 -1
  81. package/dist/{chunk-BRXIEKJ3.cjs → chunk-AMT2UZBI.cjs} +5 -5
  82. package/dist/{chunk-SFNT5DYE.cjs → chunk-BT35E7NE.cjs} +4 -4
  83. package/dist/{chunk-NUHYCFHW.cjs → chunk-BVKXEQVG.cjs} +54 -65
  84. package/dist/chunk-CDMGQR4L.cjs +4470 -0
  85. package/dist/chunk-CNBKZEX5.cjs +109 -0
  86. package/dist/{chunk-GD4AFYJ3.js → chunk-CVVEYUFR.js} +1 -1
  87. package/dist/chunk-CWALFEGU.js +58 -0
  88. package/dist/{chunk-MTALRU7R.cjs → chunk-D3YCFT5O.cjs} +3 -3
  89. package/dist/{chunk-CH4SPVFD.cjs → chunk-D6VG7B5X.cjs} +9 -3
  90. package/dist/{chunk-TOTDRAWG.js → chunk-DH7DKCUL.js} +1 -1
  91. package/dist/{chunk-RFNCTE4V.cjs → chunk-DLG43ZJ7.cjs} +2 -2
  92. package/dist/chunk-DN573ME7.cjs +1675 -0
  93. package/dist/{chunk-63BXZQZW.js → chunk-E23CMMNJ.js} +20 -4
  94. package/dist/{chunk-4HA7IHLJ.cjs → chunk-EEGK5DYE.cjs} +32 -16
  95. package/dist/{chunk-DTFR3WD6.js → chunk-EF4LKUQY.js} +1 -1
  96. package/dist/{chunk-PWLLLJHU.js → chunk-EGFT4PGW.js} +3 -1
  97. package/dist/{chunk-S47TCZDL.js → chunk-EIU7K7CM.js} +7 -7
  98. package/dist/{chunk-BISFR6ZL.js → chunk-EPNYD4NV.js} +1 -1
  99. package/dist/chunk-EZMINVLU.js +123 -0
  100. package/dist/{chunk-LYMTYC67.js → chunk-F23EVNJU.js} +2 -2
  101. package/dist/chunk-FHK7UDOJ.cjs +42 -0
  102. package/dist/chunk-FMB3TSWP.cjs +218 -0
  103. package/dist/{chunk-XBUMKEFN.cjs → chunk-FPAE6ORV.cjs} +91 -34
  104. package/dist/{chunk-DEAEO7RI.js → chunk-FYZ67R4R.js} +1 -1
  105. package/dist/{chunk-6SHHB2VD.js → chunk-G7SZIOHF.js} +2 -2
  106. package/dist/{chunk-FB6JWNJS.js → chunk-GBHDROGL.js} +54 -65
  107. package/dist/chunk-GCHELXLO.js +131 -0
  108. package/dist/{chunk-XPOHYKR3.js → chunk-GHSBZ3YB.js} +2 -2
  109. package/dist/chunk-GLBAF54O.js +218 -0
  110. package/dist/chunk-GO3N7LRW.cjs +131 -0
  111. package/dist/{chunk-Y2ZSH3YF.cjs → chunk-H6ZGZEBG.cjs} +57 -23
  112. package/dist/{chunk-DSCQPWUB.cjs → chunk-HA7OAVOB.cjs} +15 -15
  113. package/dist/{chunk-NMWEDN4Z.js → chunk-HFMLWH7B.js} +108 -0
  114. package/dist/{chunk-D2XFTCRP.js → chunk-HQ7YZKXE.js} +1 -1
  115. package/dist/{chunk-L42HTMMR.cjs → chunk-HTLINWX6.cjs} +2 -2
  116. package/dist/chunk-IETRBBMP.cjs +603 -0
  117. package/dist/chunk-IQ5RXU6O.js +1675 -0
  118. package/dist/{chunk-GVZPIQWB.js → chunk-ITB3FS72.js} +11 -5
  119. package/dist/{chunk-B6EBHCK2.cjs → chunk-IUMJYXBX.cjs} +6 -6
  120. package/dist/{chunk-ZBIBLOZL.js → chunk-IVM5F2AE.js} +500 -317
  121. package/dist/{chunk-GRSVQ5YZ.js → chunk-IWVQ2EW3.js} +44 -12
  122. package/dist/chunk-JJWCQLOU.cjs +59 -0
  123. package/dist/{chunk-KXAAEROY.js → chunk-JMFDD7IZ.js} +2 -2
  124. package/dist/chunk-JSBRDJBE.js +30 -0
  125. package/dist/chunk-LJFUXC56.cjs +123 -0
  126. package/dist/chunk-LL3PQ2U6.js +4470 -0
  127. package/dist/chunk-LQ4LQQG6.cjs +27 -0
  128. package/dist/chunk-LQGVEP3E.js +109 -0
  129. package/dist/{chunk-425MT6Y5.cjs → chunk-LVE6Z5SL.cjs} +9 -9
  130. package/dist/{chunk-XL77XYI2.cjs → chunk-LXDOQTXQ.cjs} +4 -4
  131. package/dist/{chunk-BG4OQUKP.js → chunk-MBBY4ZIK.js} +1 -1
  132. package/dist/{chunk-ZXIQCYYV.cjs → chunk-MGMXR67S.cjs} +9 -9
  133. package/dist/{chunk-FHUNAB2K.cjs → chunk-MHLE6AVN.cjs} +33 -6
  134. package/dist/chunk-MHSDHPC4.cjs +58 -0
  135. package/dist/chunk-MUBW5UDH.cjs +55 -0
  136. package/dist/{chunk-MNSTWHK3.cjs → chunk-MVWOQBCC.cjs} +11 -11
  137. package/dist/chunk-N254NRHT.cjs +30 -0
  138. package/dist/{chunk-SRLY7K6J.js → chunk-OBLIITWJ.js} +2 -2
  139. package/dist/{chunk-SIGWDEPS.cjs → chunk-OI7OIGNB.cjs} +10 -10
  140. package/dist/{chunk-V7YTCNMN.cjs → chunk-OPR34VHL.cjs} +5 -5
  141. package/dist/chunk-OUHQZFN4.js +78 -0
  142. package/dist/{chunk-HMRDNRTH.js → chunk-PEC45WYS.js} +2 -2
  143. package/dist/{chunk-OSUWEUZE.js → chunk-PUOE5BCN.js} +1 -1
  144. package/dist/chunk-Q2VYSHWU.js +59 -0
  145. package/dist/chunk-Q3MJ6CYS.cjs +193 -0
  146. package/dist/{chunk-QRGPAUST.js → chunk-Q5RN7RXC.js} +2 -2
  147. package/dist/{chunk-43XS26AQ.cjs → chunk-Q5RX3XGB.cjs} +4 -4
  148. package/dist/chunk-QCLYBIMM.cjs +51 -0
  149. package/dist/chunk-QMAKTSZB.cjs +48 -0
  150. package/dist/chunk-QT2VZNFA.js +29 -0
  151. package/dist/{chunk-3XJD56Z4.js → chunk-QUFAULH7.js} +9 -3
  152. package/dist/{chunk-RJP3SZ7Q.cjs → chunk-RD5XAJR2.cjs} +492 -309
  153. package/dist/chunk-RGR6ME5J.cjs +844 -0
  154. package/dist/{chunk-EOGKE5GD.cjs → chunk-RKJTGGMU.cjs} +221 -126
  155. package/dist/{chunk-NMGF2KUN.js → chunk-RO46YAPI.js} +1 -1
  156. package/dist/{chunk-2U5HFVRO.cjs → chunk-RVUQKMXX.cjs} +108 -0
  157. package/dist/chunk-S52YW5ZQ.js +844 -0
  158. package/dist/{chunk-ZLOTP56B.cjs → chunk-S6BDWWUG.cjs} +5 -5
  159. package/dist/{chunk-6DWXHBAY.js → chunk-SAHBLB3E.js} +222 -127
  160. package/dist/chunk-SALLHB2I.js +27 -0
  161. package/dist/{chunk-GIZL57FE.cjs → chunk-SEKD5FH3.cjs} +3 -1
  162. package/dist/{chunk-DZHR34H6.cjs → chunk-SHFA46CS.cjs} +8 -8
  163. package/dist/{chunk-MILZEEUV.js → chunk-SIHRD34Z.js} +2 -2
  164. package/dist/{chunk-BPTBKO7D.js → chunk-SO3QQJAZ.js} +216 -36
  165. package/dist/{chunk-HSPWX4Z2.cjs → chunk-SRQW3B6J.cjs} +223 -43
  166. package/dist/{chunk-MY3TZER2.js → chunk-T63AMO6H.js} +1 -1
  167. package/dist/{chunk-X765A7J5.js → chunk-TERCG25S.js} +1 -1
  168. package/dist/{chunk-WOGJXDBU.cjs → chunk-TFSRRZWP.cjs} +3 -3
  169. package/dist/{chunk-RRZS5A53.js → chunk-TQHOVHRS.js} +1 -1
  170. package/dist/{chunk-JHOQABEF.js → chunk-TWEKBHUO.js} +5 -5
  171. package/dist/chunk-U3WDY42C.cjs +42 -0
  172. package/dist/{chunk-CKN2BLHK.cjs → chunk-UBS46QL3.cjs} +2 -2
  173. package/dist/{chunk-H3GBSPK5.js → chunk-UGTFKUW4.js} +14 -6
  174. package/dist/chunk-UJTCTTUF.cjs +271 -0
  175. package/dist/{chunk-RUZB43HU.cjs → chunk-UTI6ZQEY.cjs} +22 -14
  176. package/dist/{chunk-OLG7LZBD.js → chunk-VG34MG2U.js} +1 -1
  177. package/dist/{chunk-ZKZRFH37.cjs → chunk-VJYPP6PP.cjs} +6 -6
  178. package/dist/{chunk-YHGTBPEC.js → chunk-VNQ5GL34.js} +1 -1
  179. package/dist/{chunk-XDVG3NM4.js → chunk-W3X6PAC7.js} +2 -48
  180. package/dist/{chunk-FK2DVRPJ.js → chunk-WFUUXADU.js} +2 -2
  181. package/dist/{chunk-R5OO7MEB.cjs → chunk-WGTJOIB7.cjs} +22 -22
  182. package/dist/{chunk-VHBUKGRG.js → chunk-WJDPVW7T.js} +4 -4
  183. package/dist/chunk-WNUVPKBW.js +42 -0
  184. package/dist/{chunk-EV53SLSB.cjs → chunk-WPVWQSL7.cjs} +4 -4
  185. package/dist/chunk-WQ3VJXZB.js +118 -0
  186. package/dist/chunk-WTNBX2JO.js +271 -0
  187. package/dist/chunk-XAV24VYN.js +48 -0
  188. package/dist/chunk-XDLH4EDL.cjs +118 -0
  189. package/dist/{chunk-U7CZFKPL.cjs → chunk-XMNHZRUB.cjs} +2 -2
  190. package/dist/chunk-XUDSXGGV.cjs +1822 -0
  191. package/dist/{chunk-WQUQ5JMM.js → chunk-XWASJ2QL.js} +4 -4
  192. package/dist/chunk-Y2SXUCNJ.js +55 -0
  193. package/dist/{chunk-AIH6GUGB.cjs → chunk-YDCDGTK6.cjs} +5 -5
  194. package/dist/chunk-YFXTE422.cjs +92 -0
  195. package/dist/chunk-YKS55CMT.js +1822 -0
  196. package/dist/{chunk-KC5FPUOF.cjs → chunk-YRLYSQEQ.cjs} +2 -2
  197. package/dist/{chunk-JWPI6O5Z.js → chunk-YS34SVY5.js} +31 -4
  198. package/dist/{chunk-FEVHH525.cjs → chunk-YYB42DCU.cjs} +4 -4
  199. package/dist/chunk-ZK6HOR62.js +92 -0
  200. package/dist/{chunk-BHV7CBNT.js → chunk-ZSE42BRE.js} +1 -1
  201. package/dist/clear-ES5WCZRF.cjs +12 -0
  202. package/dist/clear-J7XS6T5W.js +12 -0
  203. package/dist/completion-XQTDTJLK.cjs +14 -0
  204. package/dist/completion-XR6ZONJQ.js +14 -0
  205. package/dist/config-2TB3A55J.js +18 -0
  206. package/dist/config-RDMVIV26.cjs +18 -0
  207. package/dist/constants-6CPCJ3DY.cjs +21 -0
  208. package/dist/{constants-V6J54N3X.js → constants-UFM5B232.js} +2 -1
  209. package/dist/{defaultHooks-WLMRQUXG.cjs → defaultHooks-RCXPHF4M.cjs} +3 -1
  210. package/dist/{defaultHooks-R56VYG7I.js → defaultHooks-RDRMER3Z.js} +2 -0
  211. package/dist/export-EWAYH353.cjs +12 -0
  212. package/dist/export-ZWA6XGVS.js +12 -0
  213. package/dist/extractSessionMemories-SDW2MVBQ.cjs +7 -0
  214. package/dist/extractSessionMemories-V7K42ZHW.js +7 -0
  215. package/dist/feedback-5RV6ODW4.js +15 -0
  216. package/dist/feedback-ZPITHFJR.cjs +15 -0
  217. package/dist/filesystem-3SGCW2BF.js +10 -0
  218. package/dist/filesystem-MCFXJQ6R.cjs +10 -0
  219. package/dist/formatters-6K7QVWQL.cjs +10 -0
  220. package/dist/formatters-DQHO5I36.js +10 -0
  221. package/dist/{help-LKKQU2TN.js → help-I5GRCA3S.js} +3 -2
  222. package/dist/help-X52PZM24.cjs +12 -0
  223. package/dist/history-4WIOZ4TW.cjs +14 -0
  224. package/dist/{history-AV4XBFRK.js → history-OCHJBJW7.js} +3 -2
  225. package/dist/hooks-IAVTXUAI.cjs +13 -0
  226. package/dist/hooks-YF6HL23E.js +13 -0
  227. package/dist/{i18n-BSAPXM56.js → i18n-KHBXUALK.js} +2 -1
  228. package/dist/i18n-MVQIAZWS.cjs +33 -0
  229. package/dist/ide-4R3BEBIS.js +12 -0
  230. package/dist/ide-C7WSPQTR.cjs +12 -0
  231. package/dist/import-2ICSKDL7.cjs +10 -0
  232. package/dist/import-EAAX5HJR.js +170 -0
  233. package/dist/import-KRVVYJCZ.js +10 -0
  234. package/dist/import-PQJPNXA4.cjs +170 -0
  235. package/dist/index.cjs +7503 -11251
  236. package/dist/index.js +8735 -12483
  237. package/dist/init-6K3NRDOM.js +10 -0
  238. package/dist/init-AOUGGITS.cjs +10 -0
  239. package/dist/language-Q7YFDVSR.cjs +18 -0
  240. package/dist/language-Y6ZC7LET.js +18 -0
  241. package/dist/{lint-44UQJ673.cjs → lint-D5UOJWIK.cjs} +1 -0
  242. package/dist/{lint-TA2ZHVLM.js → lint-NJPZWVN2.js} +1 -0
  243. package/dist/{localProjectPermissions-WQYMGI42.js → localProjectPermissions-N77HA3XK.js} +3 -2
  244. package/dist/localProjectPermissions-UFSMNTBJ.cjs +18 -0
  245. package/dist/login-6OAH2NEH.cjs +20 -0
  246. package/dist/login-DL3377MD.js +20 -0
  247. package/dist/logout-ELQBUMTU.cjs +18 -0
  248. package/dist/logout-TLYA5W45.js +18 -0
  249. package/dist/mcp-BHOIBYUB.js +18 -0
  250. package/dist/mcp-TNUEXR5T.cjs +18 -0
  251. package/dist/{mcp-install-2KVKRAMQ.cjs → mcp-install-GROTZHAW.cjs} +26 -14
  252. package/dist/{mcp-install-77UXRN6R.js → mcp-install-KSADVDBE.js} +21 -9
  253. package/dist/memory-6DRFA43C.js +10 -0
  254. package/dist/memory-IORZE6WF.cjs +10 -0
  255. package/dist/message-JUBOK2VU.js +9 -0
  256. package/dist/message-ZJ5AYAMT.cjs +9 -0
  257. package/dist/model-CJPSPGIC.cjs +10 -0
  258. package/dist/model-MQXC56ES.js +10 -0
  259. package/dist/new-7D2B7IWM.cjs +12 -0
  260. package/dist/new-7VYM36RC.js +12 -0
  261. package/dist/{patch-BAAQIYSW.js → patch-5F6VBIT3.js} +2 -0
  262. package/dist/{patch-J32X2QQP.cjs → patch-MOD7QC3D.cjs} +3 -1
  263. package/dist/permissions-MM77OSFO.js +13 -0
  264. package/dist/permissions-W2F62DJ6.cjs +13 -0
  265. package/dist/{plan-JFGNRL2S.js → plan-G5CEKJI4.js} +1 -0
  266. package/dist/{plan-B3CW5DXJ.cjs → plan-QKOHE3LH.cjs} +1 -0
  267. package/dist/quit-7D2RDGTD.cjs +10 -0
  268. package/dist/quit-PKBSEJOL.js +10 -0
  269. package/dist/registry-A5XLMQVC.cjs +1828 -0
  270. package/dist/registry-WQLWHOLY.js +1828 -0
  271. package/dist/resume-FBKXSDOA.js +13 -0
  272. package/dist/resume-KLPDYPWQ.cjs +13 -0
  273. package/dist/search-7RNYTCNO.js +17 -0
  274. package/dist/search-UESMQZC3.cjs +17 -0
  275. package/dist/{session-T3TAZ5ZU.cjs → session-BSU2L5UI.cjs} +1 -0
  276. package/dist/{session-H5QWKE5E.js → session-SZMRN5KG.js} +1 -0
  277. package/dist/sessions-TSSUFWIJ.cjs +10 -0
  278. package/dist/sessions-WAXBUQTU.js +10 -0
  279. package/dist/settings-D6JXX5RG.js +30 -0
  280. package/dist/settings-RKYGXKDG.cjs +30 -0
  281. package/dist/share-GLX4YHS4.cjs +14 -0
  282. package/dist/share-U2M2KBFJ.js +14 -0
  283. package/dist/skills-63QLZMUO.cjs +14 -0
  284. package/dist/{skills-LJZA6PVJ.js → skills-BAMMXP3Q.js} +3 -2
  285. package/dist/{skills-install-MQINL3EC.js → skills-install-QNQWC2MV.js} +99 -28
  286. package/dist/{skills-install-IKJZN4G2.cjs → skills-install-UMK5H3SO.cjs} +107 -36
  287. package/dist/skills-new-NYKNHJHV.cjs +15 -0
  288. package/dist/skills-new-NZFGFKML.js +15 -0
  289. package/dist/slashCommands-EJ23C3Z4.cjs +69 -0
  290. package/dist/slashCommands-JQIL4EWX.js +69 -0
  291. package/dist/status-BKC7GBNQ.js +11 -0
  292. package/dist/status-FU3CPJWQ.cjs +11 -0
  293. package/dist/sync-3IEIHXIP.cjs +18 -0
  294. package/dist/sync-7JMZVEQD.cjs +40 -0
  295. package/dist/{sync-EXYX7HXW.js → sync-KWX67OUN.js} +3 -2
  296. package/dist/sync-YVPFT7SL.js +18 -0
  297. package/dist/tasks-5FPBIFLC.js +9 -0
  298. package/dist/tasks-TXGKGNH6.cjs +9 -0
  299. package/dist/team-GVK5L73L.cjs +9 -0
  300. package/dist/team-RWIKCLTG.js +9 -0
  301. package/dist/teammate-3C4MLRGH.js +139 -0
  302. package/dist/teammate-7C3UDQSH.cjs +139 -0
  303. package/dist/theme-A2CEHI7W.js +18 -0
  304. package/dist/theme-LNOQOVR4.cjs +18 -0
  305. package/dist/ui/questionModal.cjs +7 -25
  306. package/dist/ui/questionModal.js +6 -24
  307. package/dist/undo-F2IZJQUV.js +10 -0
  308. package/dist/undo-QEV42XLU.cjs +10 -0
  309. package/dist/update-TVAJMMBC.js +82 -0
  310. package/dist/update-Z6BIIQDC.cjs +82 -0
  311. package/package.json +9 -3
  312. package/dist/CommunitySkillsCache-ILWHWE5P.js +0 -7
  313. package/dist/CommunitySkillsCache-KHC6RUJW.cjs +0 -7
  314. package/dist/HookManager-X47HCM5G.cjs +0 -6
  315. package/dist/HookManager-ZXKHCD7U.js +0 -6
  316. package/dist/MemoryManager-6ZT7IDO5.cjs +0 -7
  317. package/dist/MemoryManager-AJGS5AKB.js +0 -7
  318. package/dist/PermissionManager-HG6W2DGU.cjs +0 -10
  319. package/dist/SessionManager-BJ2G6VV4.cjs +0 -9
  320. package/dist/SessionManager-ENPGYK5J.js +0 -9
  321. package/dist/SkillsRegistry-6ZFOCT25.cjs +0 -8
  322. package/dist/SkillsRegistry-C2SHOZ5D.js +0 -8
  323. package/dist/about-3BJTNSLK.js +0 -11
  324. package/dist/about-EABQNJGV.cjs +0 -11
  325. package/dist/add-dir-7FD4DMDA.cjs +0 -9
  326. package/dist/add-dir-LOYJ4YB5.js +0 -9
  327. package/dist/agents-2Y6ASV7C.js +0 -10
  328. package/dist/agents-UOSPKLQL.cjs +0 -10
  329. package/dist/agents-new-23NSGAM5.js +0 -13
  330. package/dist/agents-new-WI2EL7IJ.cjs +0 -13
  331. package/dist/automode-LGWTY3UX.js +0 -9
  332. package/dist/automode-WLBQ7MN7.cjs +0 -9
  333. package/dist/chunk-5UBW2BGC.js +0 -33
  334. package/dist/chunk-I6DBWNLN.cjs +0 -169
  335. package/dist/chunk-IZBCMJHJ.cjs +0 -33
  336. package/dist/completion-7WGMHKOR.cjs +0 -13
  337. package/dist/completion-KH33NSGP.js +0 -13
  338. package/dist/constants-RBQTR32A.cjs +0 -20
  339. package/dist/export-3QN3IH7A.js +0 -11
  340. package/dist/export-BI54X3MP.cjs +0 -11
  341. package/dist/feedback-CI4OIPOS.cjs +0 -14
  342. package/dist/feedback-GFPL5STE.js +0 -14
  343. package/dist/formatters-N5IJKYZY.cjs +0 -8
  344. package/dist/formatters-UG6VZJJ5.js +0 -8
  345. package/dist/help-CWMUGD3V.cjs +0 -11
  346. package/dist/history-73VBEMSI.cjs +0 -13
  347. package/dist/hooks-62UDQBGH.cjs +0 -12
  348. package/dist/hooks-XORDJD5X.js +0 -12
  349. package/dist/i18n-X2IU2EZD.cjs +0 -32
  350. package/dist/ide-RPKZALQV.js +0 -11
  351. package/dist/ide-YMNXJB6A.cjs +0 -11
  352. package/dist/init-J5HR4R7U.js +0 -9
  353. package/dist/init-JCC7RVMC.cjs +0 -9
  354. package/dist/language-AZISJCEZ.js +0 -16
  355. package/dist/language-F65RA6FZ.cjs +0 -16
  356. package/dist/localProjectPermissions-2EATUDZM.cjs +0 -17
  357. package/dist/login-5HLPMECE.js +0 -18
  358. package/dist/login-ISWYYBXP.cjs +0 -18
  359. package/dist/logout-3EKZM5J3.cjs +0 -16
  360. package/dist/logout-GE7TSZ24.js +0 -16
  361. package/dist/mcp-EW64QRFA.cjs +0 -15
  362. package/dist/mcp-VHS7AMF2.js +0 -15
  363. package/dist/memory-2I473RU3.js +0 -9
  364. package/dist/memory-JZ6NPSP3.cjs +0 -9
  365. package/dist/model-GXZLARPT.js +0 -9
  366. package/dist/model-Y274DBDO.cjs +0 -9
  367. package/dist/new-BG5VIGZ7.cjs +0 -9
  368. package/dist/new-YXFDQOA7.js +0 -9
  369. package/dist/permissions-QILEAGBP.cjs +0 -12
  370. package/dist/permissions-WVEOVMWO.js +0 -12
  371. package/dist/quit-NC32OEJG.cjs +0 -9
  372. package/dist/quit-WRRIGU33.js +0 -9
  373. package/dist/resume-GJIKIDPR.cjs +0 -12
  374. package/dist/resume-RMJNCAOK.js +0 -12
  375. package/dist/search-UIWIXB73.js +0 -14
  376. package/dist/search-WQNXDA2E.cjs +0 -14
  377. package/dist/sessions-HPFX2GDD.js +0 -9
  378. package/dist/sessions-SAQU6MFA.cjs +0 -9
  379. package/dist/share-2WH5ZVOO.cjs +0 -13
  380. package/dist/share-PSSWWVV5.js +0 -13
  381. package/dist/skills-YTYGART7.cjs +0 -13
  382. package/dist/skills-new-3WCU3CWB.js +0 -14
  383. package/dist/skills-new-O5LFVFZU.cjs +0 -14
  384. package/dist/slashCommands-7IRDOXOQ.cjs +0 -55
  385. package/dist/slashCommands-C6CAQA25.js +0 -55
  386. package/dist/status-4EDV2LSY.cjs +0 -10
  387. package/dist/status-NU7TJDCE.js +0 -10
  388. package/dist/sync-3GFSEIAZ.js +0 -16
  389. package/dist/sync-6M3WRKMH.cjs +0 -39
  390. package/dist/sync-CQNQDNTJ.cjs +0 -16
  391. package/dist/theme-EMJGULMI.cjs +0 -16
  392. package/dist/theme-FGDSXNU3.js +0 -16
  393. package/dist/undo-CTXQYE7C.cjs +0 -9
  394. package/dist/undo-HX2ZMECP.js +0 -9
@@ -0,0 +1,603 @@
1
+ import {
2
+ GitIgnoreParser
3
+ } from "./chunk-EZMINVLU.js";
4
+
5
+ // src/actions/filesystem.ts
6
+ import fs from "fs-extra";
7
+ import path from "path";
8
+ import { spawnSync } from "child_process";
9
+ import { applyPatch as applyUnifiedPatch } from "diff";
10
+ var FILE_LIMITS = {
11
+ /** Maximum file size for read operations (10MB) */
12
+ MAX_READ_SIZE: 10 * 1024 * 1024,
13
+ /** Maximum file size for write operations (50MB) */
14
+ MAX_WRITE_SIZE: 50 * 1024 * 1024,
15
+ /** Maximum number of files in a single directory listing */
16
+ MAX_DIR_ENTRIES: 1e4,
17
+ /** Maximum search results to return */
18
+ MAX_SEARCH_RESULTS: 1e3,
19
+ /** Maximum undo stack size */
20
+ MAX_UNDO_STACK: 100
21
+ };
22
+ var FileActionManager = class {
23
+ constructor(workspaceRoot, additionalDirs = []) {
24
+ this.undoStack = [];
25
+ // Preview mode state
26
+ this.previewMode = false;
27
+ this.pendingChanges = [];
28
+ this.batchId = null;
29
+ this.changeCounter = 0;
30
+ this.onBatchChange = null;
31
+ this.currentToolId = "";
32
+ this.currentToolName = "";
33
+ const resolvedRoot = path.resolve(workspaceRoot);
34
+ try {
35
+ this.workspaceRoot = fs.realpathSync(resolvedRoot);
36
+ } catch {
37
+ this.workspaceRoot = resolvedRoot;
38
+ }
39
+ this.additionalDirs = [];
40
+ for (const dir of additionalDirs) {
41
+ if (!dir || dir.trim() === "") {
42
+ throw new Error("Empty string is not a valid additional directory");
43
+ }
44
+ const resolved = path.resolve(dir);
45
+ let normalized;
46
+ try {
47
+ normalized = fs.realpathSync(resolved);
48
+ } catch {
49
+ normalized = resolved;
50
+ }
51
+ if (normalized.endsWith(path.sep) && normalized.length > 1) {
52
+ normalized = normalized.slice(0, -1);
53
+ }
54
+ if (!this.additionalDirs.includes(normalized)) {
55
+ this.additionalDirs.push(normalized);
56
+ }
57
+ }
58
+ }
59
+ /**
60
+ * Get all allowed directories (workspace root + additional dirs)
61
+ */
62
+ getAllowedDirectories() {
63
+ return [this.workspaceRoot, ...this.additionalDirs];
64
+ }
65
+ /**
66
+ * Add a new additional directory at runtime (for /add-dir command)
67
+ */
68
+ addAdditionalDirectory(dir) {
69
+ if (!dir || dir.trim() === "") {
70
+ throw new Error("Empty string is not a valid additional directory");
71
+ }
72
+ const resolved = path.resolve(dir);
73
+ let normalized;
74
+ try {
75
+ normalized = fs.realpathSync(resolved);
76
+ } catch {
77
+ normalized = resolved;
78
+ }
79
+ if (normalized.endsWith(path.sep) && normalized.length > 1) {
80
+ normalized = normalized.slice(0, -1);
81
+ }
82
+ if (!this.additionalDirs.includes(normalized) && normalized !== this.workspaceRoot) {
83
+ this.additionalDirs.push(normalized);
84
+ }
85
+ }
86
+ /**
87
+ * Enter preview mode - changes will be batched instead of written
88
+ */
89
+ enterPreviewMode(batchId, onBatchChange) {
90
+ this.previewMode = true;
91
+ this.batchId = batchId;
92
+ this.pendingChanges = [];
93
+ this.changeCounter = 0;
94
+ this.onBatchChange = onBatchChange ?? null;
95
+ }
96
+ /**
97
+ * Exit preview mode
98
+ */
99
+ exitPreviewMode() {
100
+ this.previewMode = false;
101
+ this.batchId = null;
102
+ this.onBatchChange = null;
103
+ }
104
+ /**
105
+ * Check if in preview mode
106
+ */
107
+ isInPreviewMode() {
108
+ return this.previewMode;
109
+ }
110
+ /**
111
+ * Get current batch ID
112
+ */
113
+ getBatchId() {
114
+ return this.batchId;
115
+ }
116
+ /**
117
+ * Set current tool context for batched changes
118
+ */
119
+ setCurrentTool(toolId, toolName) {
120
+ this.currentToolId = toolId;
121
+ this.currentToolName = toolName;
122
+ }
123
+ /**
124
+ * Get all pending changes
125
+ */
126
+ getPendingChanges() {
127
+ return [...this.pendingChanges];
128
+ }
129
+ /**
130
+ * Clear pending changes without applying
131
+ */
132
+ clearPendingChanges() {
133
+ this.pendingChanges = [];
134
+ this.changeCounter = 0;
135
+ }
136
+ /**
137
+ * Apply pending changes (selected or all)
138
+ */
139
+ async applyPendingChanges(changeIds) {
140
+ const changesToApply = changeIds ? this.pendingChanges.filter((c) => changeIds.includes(c.id)) : this.pendingChanges;
141
+ const applied = [];
142
+ const errors = [];
143
+ const wasPreviewMode = this.previewMode;
144
+ this.previewMode = false;
145
+ for (const change of changesToApply) {
146
+ try {
147
+ const fullPath = this.resolvePath(change.filePath);
148
+ if (change.changeType === "delete") {
149
+ await fs.remove(fullPath);
150
+ } else {
151
+ await fs.ensureDir(path.dirname(fullPath));
152
+ await fs.writeFile(fullPath, change.proposedContent, "utf8");
153
+ }
154
+ applied.push(change.id);
155
+ } catch (err) {
156
+ errors.push({
157
+ id: change.id,
158
+ error: err instanceof Error ? err.message : String(err)
159
+ });
160
+ }
161
+ }
162
+ this.previewMode = wasPreviewMode;
163
+ const appliedSet = new Set(applied);
164
+ this.pendingChanges = this.pendingChanges.filter((c) => !appliedSet.has(c.id));
165
+ return { applied, errors };
166
+ }
167
+ /**
168
+ * Add a change to the pending batch (internal use)
169
+ */
170
+ addBatchedChange(filePath, changeType, originalContent, proposedContent, description) {
171
+ const change = {
172
+ id: `change_${this.batchId}_${++this.changeCounter}`,
173
+ filePath,
174
+ changeType,
175
+ originalContent,
176
+ proposedContent,
177
+ description,
178
+ toolId: this.currentToolId,
179
+ toolName: this.currentToolName
180
+ };
181
+ this.pendingChanges.push(change);
182
+ if (this.onBatchChange) {
183
+ this.onBatchChange(change);
184
+ }
185
+ }
186
+ get root() {
187
+ return this.workspaceRoot;
188
+ }
189
+ async readFile(target) {
190
+ const filePath = this.resolvePath(target);
191
+ const exists = await fs.pathExists(filePath);
192
+ if (!exists) {
193
+ throw new Error(`File ${target} not found in workspace.`);
194
+ }
195
+ const stats = await fs.stat(filePath);
196
+ if (stats.size > FILE_LIMITS.MAX_READ_SIZE) {
197
+ const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
198
+ const limitMB = (FILE_LIMITS.MAX_READ_SIZE / 1024 / 1024).toFixed(0);
199
+ throw new Error(`File ${target} is too large (${sizeMB}MB). Maximum allowed: ${limitMB}MB`);
200
+ }
201
+ return fs.readFile(filePath, "utf8");
202
+ }
203
+ async writeFile(target, contents, description) {
204
+ const contentSize = Buffer.byteLength(contents, "utf8");
205
+ if (contentSize > FILE_LIMITS.MAX_WRITE_SIZE) {
206
+ const sizeMB = (contentSize / 1024 / 1024).toFixed(2);
207
+ const limitMB = (FILE_LIMITS.MAX_WRITE_SIZE / 1024 / 1024).toFixed(0);
208
+ throw new Error(`Content too large to write (${sizeMB}MB). Maximum allowed: ${limitMB}MB`);
209
+ }
210
+ const filePath = this.resolvePath(target);
211
+ const exists = await fs.pathExists(filePath);
212
+ const previous = exists ? await fs.readFile(filePath, "utf8") : "";
213
+ const changeType = exists ? "modify" : "create";
214
+ if (this.previewMode) {
215
+ this.addBatchedChange(
216
+ target,
217
+ changeType,
218
+ previous,
219
+ contents,
220
+ description ?? `${changeType === "create" ? "Create" : "Modify"} ${target}`
221
+ );
222
+ return;
223
+ }
224
+ await fs.ensureDir(path.dirname(filePath));
225
+ if (this.undoStack.length >= FILE_LIMITS.MAX_UNDO_STACK) {
226
+ this.undoStack.shift();
227
+ }
228
+ this.undoStack.push({ absolutePath: filePath, previousContents: previous });
229
+ await fs.writeFile(filePath, contents, "utf8");
230
+ }
231
+ async appendFile(target, contents) {
232
+ const current = await this.readFileSafe(target);
233
+ await this.writeFile(target, `${current}${contents}`);
234
+ }
235
+ async applyPatch(target, patch, description) {
236
+ const filePath = this.resolvePath(target);
237
+ const current = await this.readFileSafe(target);
238
+ const updated = applyUnifiedPatch(current, patch);
239
+ if (updated === false) {
240
+ throw new Error(`Failed to apply patch to ${target}`);
241
+ }
242
+ if (this.previewMode) {
243
+ this.addBatchedChange(
244
+ target,
245
+ "modify",
246
+ current,
247
+ updated,
248
+ description ?? `Apply patch to ${target}`
249
+ );
250
+ return;
251
+ }
252
+ this.undoStack.push({ absolutePath: filePath, previousContents: current });
253
+ await fs.writeFile(filePath, updated, "utf8");
254
+ }
255
+ async undoLast() {
256
+ const entry = this.undoStack.pop();
257
+ if (!entry) {
258
+ throw new Error("Undo stack is empty");
259
+ }
260
+ await fs.writeFile(entry.absolutePath, entry.previousContents, "utf8");
261
+ }
262
+ search(query, relativePath) {
263
+ const searchDir = this.resolvePath(relativePath ?? ".");
264
+ const rgResult = spawnSync("rg", [
265
+ "--line-number",
266
+ "--color",
267
+ "never",
268
+ "--no-binary",
269
+ // Skip binary files
270
+ "--max-count",
271
+ String(FILE_LIMITS.MAX_SEARCH_RESULTS),
272
+ // Enforce result limit
273
+ "--glob",
274
+ "!*.{exe,dll,so,dylib,bin,o,a,lib,pyc,pyo,class,jar,war,ear}",
275
+ "--glob",
276
+ "!*.{png,jpg,jpeg,gif,bmp,ico,svg,webp,tiff}",
277
+ "--glob",
278
+ "!*.{mp3,mp4,avi,mov,mkv,wav,flac,ogg,webm}",
279
+ "--glob",
280
+ "!*.{pdf,doc,docx,xls,xlsx,ppt,pptx}",
281
+ "--glob",
282
+ "!*.{zip,tar,gz,bz2,7z,rar,dmg,iso}",
283
+ "--glob",
284
+ "!*.{woff,woff2,ttf,eot,otf}",
285
+ "--glob",
286
+ "!**/node_modules/**",
287
+ "--glob",
288
+ "!**/.git/**",
289
+ "--glob",
290
+ "!**/dist/**",
291
+ "--glob",
292
+ "!**/build/**",
293
+ "--glob",
294
+ "!**/binaries/**",
295
+ query,
296
+ "."
297
+ ], {
298
+ cwd: searchDir,
299
+ encoding: "utf8"
300
+ });
301
+ if (rgResult.status === 0 && rgResult.stdout) {
302
+ const results = rgResult.stdout.trim().split("\n").filter(Boolean).slice(0, FILE_LIMITS.MAX_SEARCH_RESULTS).map((line) => {
303
+ const [file, lineNo, ...rest] = line.split(":");
304
+ return {
305
+ file: path.relative(this.workspaceRoot, path.join(searchDir, file)),
306
+ line: Number(lineNo),
307
+ text: rest.join(":")
308
+ };
309
+ });
310
+ return results;
311
+ }
312
+ return this.walkFallback(query, searchDir);
313
+ }
314
+ searchWithContext(query, options = {}) {
315
+ const limit = options.limit ?? 10;
316
+ const contextLines = options.context ?? 2;
317
+ const results = this.search(query, options.relativePath);
318
+ return results.slice(0, limit).map((hit) => this.renderContext(hit, contextLines)).join("\n\n");
319
+ }
320
+ semanticSearch(query, opts = {}) {
321
+ const limit = opts.limit ?? 5;
322
+ const window = opts.window ?? 400;
323
+ const baseDir = this.resolvePath(opts.relativePath ?? ".");
324
+ const ignoreFilter = new GitIgnoreParser(baseDir);
325
+ const results = [];
326
+ const stack = [baseDir];
327
+ const lowerQuery = query.toLowerCase();
328
+ while (stack.length && results.length < limit) {
329
+ const current = stack.pop();
330
+ if (!current) continue;
331
+ const relative = path.relative(this.workspaceRoot, current);
332
+ const normalizedRel = relative.replace(/\\/g, "/");
333
+ if (path.basename(current).startsWith(".") || ignoreFilter.isIgnored(normalizedRel)) {
334
+ continue;
335
+ }
336
+ try {
337
+ const stats = fs.statSync(current);
338
+ if (stats.isDirectory()) {
339
+ const entries = fs.readdirSync(current);
340
+ for (const entry of entries) {
341
+ if (!entry.startsWith(".")) {
342
+ stack.push(path.join(current, entry));
343
+ }
344
+ }
345
+ continue;
346
+ }
347
+ if (!stats.isFile()) {
348
+ continue;
349
+ }
350
+ const ext = path.extname(current).toLowerCase();
351
+ const binaryExtensions = /* @__PURE__ */ new Set([
352
+ ".exe",
353
+ ".dll",
354
+ ".so",
355
+ ".dylib",
356
+ ".bin",
357
+ ".o",
358
+ ".a",
359
+ ".lib",
360
+ ".pyc",
361
+ ".pyo",
362
+ ".class",
363
+ ".jar",
364
+ ".war",
365
+ ".ear",
366
+ ".png",
367
+ ".jpg",
368
+ ".jpeg",
369
+ ".gif",
370
+ ".bmp",
371
+ ".ico",
372
+ ".svg",
373
+ ".webp",
374
+ ".tiff",
375
+ ".mp3",
376
+ ".mp4",
377
+ ".avi",
378
+ ".mov",
379
+ ".mkv",
380
+ ".wav",
381
+ ".flac",
382
+ ".ogg",
383
+ ".webm",
384
+ ".pdf",
385
+ ".doc",
386
+ ".docx",
387
+ ".xls",
388
+ ".xlsx",
389
+ ".ppt",
390
+ ".pptx",
391
+ ".zip",
392
+ ".tar",
393
+ ".gz",
394
+ ".bz2",
395
+ ".7z",
396
+ ".rar",
397
+ ".dmg",
398
+ ".iso",
399
+ ".woff",
400
+ ".woff2",
401
+ ".ttf",
402
+ ".eot",
403
+ ".otf"
404
+ ]);
405
+ if (binaryExtensions.has(ext)) {
406
+ continue;
407
+ }
408
+ if (normalizedRel.includes("node_modules/") || normalizedRel.includes("/dist/") || normalizedRel.includes("/build/") || normalizedRel.includes("/binaries/")) {
409
+ continue;
410
+ }
411
+ const contents = fs.readFileSync(current, "utf8");
412
+ const haystack = contents.toLowerCase();
413
+ const idx = haystack.indexOf(lowerQuery);
414
+ if (idx === -1) continue;
415
+ const start = Math.max(0, idx - window);
416
+ const end = Math.min(contents.length, idx + query.length + window);
417
+ const prefixEllipsis = start > 0 ? "\u2026" : "";
418
+ const suffixEllipsis = end < contents.length ? "\u2026" : "";
419
+ const snippet = `${prefixEllipsis}${contents.slice(start, end)}${suffixEllipsis}`;
420
+ results.push({
421
+ file: normalizedRel || path.basename(current),
422
+ snippet
423
+ });
424
+ } catch {
425
+ continue;
426
+ }
427
+ }
428
+ return results;
429
+ }
430
+ async readFileSafe(target) {
431
+ const filePath = this.resolvePath(target);
432
+ if (!await fs.pathExists(filePath)) {
433
+ return "";
434
+ }
435
+ const stats = await fs.stat(filePath);
436
+ if (stats.size > FILE_LIMITS.MAX_READ_SIZE) {
437
+ const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
438
+ const limitMB = (FILE_LIMITS.MAX_READ_SIZE / 1024 / 1024).toFixed(0);
439
+ throw new Error(`File ${target} is too large (${sizeMB}MB). Maximum allowed: ${limitMB}MB`);
440
+ }
441
+ return fs.readFile(filePath, "utf8");
442
+ }
443
+ resolvePath(target) {
444
+ const normalized = path.isAbsolute(target) ? target : path.join(this.workspaceRoot, target);
445
+ const resolved = path.resolve(normalized);
446
+ let realPath;
447
+ try {
448
+ realPath = fs.realpathSync(resolved);
449
+ } catch {
450
+ const parentDir = path.dirname(resolved);
451
+ try {
452
+ const realParent = fs.realpathSync(parentDir);
453
+ realPath = path.join(realParent, path.basename(resolved));
454
+ } catch {
455
+ realPath = resolved;
456
+ }
457
+ }
458
+ const allAllowedRoots = [this.workspaceRoot, ...this.additionalDirs];
459
+ for (const allowedRoot of allAllowedRoots) {
460
+ let realRoot;
461
+ try {
462
+ realRoot = fs.realpathSync(allowedRoot);
463
+ } catch {
464
+ realRoot = allowedRoot;
465
+ }
466
+ const rootWithSep = realRoot.endsWith(path.sep) ? realRoot : `${realRoot}${path.sep}`;
467
+ if (realPath === realRoot || realPath.startsWith(rootWithSep)) {
468
+ return resolved;
469
+ }
470
+ }
471
+ const allowedDirsList = allAllowedRoots.join(", ");
472
+ throw new Error(`Path ${target} escapes the allowed directories: ${allowedDirsList}`);
473
+ }
474
+ walkFallback(query, baseDir) {
475
+ const hits = [];
476
+ const stack = [baseDir];
477
+ while (stack.length && hits.length < FILE_LIMITS.MAX_SEARCH_RESULTS) {
478
+ const current = stack.pop();
479
+ if (!current) {
480
+ continue;
481
+ }
482
+ const basename = path.basename(current);
483
+ const relative = path.relative(this.workspaceRoot, current);
484
+ if (basename.startsWith(".") || relative.includes("node_modules") || relative.startsWith("dist")) {
485
+ continue;
486
+ }
487
+ try {
488
+ const stats = fs.statSync(current);
489
+ if (stats.isDirectory()) {
490
+ const entries = fs.readdirSync(current);
491
+ for (const entry of entries) {
492
+ if (!entry.startsWith(".")) {
493
+ stack.push(path.join(current, entry));
494
+ }
495
+ }
496
+ } else if (stats.isFile()) {
497
+ const contents = fs.readFileSync(current, "utf8");
498
+ const lines = contents.split(/\r?\n/);
499
+ for (let idx = 0; idx < lines.length && hits.length < FILE_LIMITS.MAX_SEARCH_RESULTS; idx++) {
500
+ const line = lines[idx];
501
+ if (line.includes(query)) {
502
+ hits.push({
503
+ file: path.relative(this.workspaceRoot, current),
504
+ line: idx + 1,
505
+ text: line.trim()
506
+ });
507
+ }
508
+ }
509
+ }
510
+ } catch {
511
+ continue;
512
+ }
513
+ }
514
+ return hits;
515
+ }
516
+ async createDirectory(relativePath) {
517
+ const dirPath = this.resolvePath(relativePath);
518
+ await fs.ensureDir(dirPath);
519
+ }
520
+ async listDirectory(relativePath) {
521
+ const dirPath = this.resolvePath(relativePath);
522
+ const entries = await fs.readdir(dirPath, { withFileTypes: true });
523
+ if (entries.length > FILE_LIMITS.MAX_DIR_ENTRIES) {
524
+ throw new Error(`Directory has too many entries (${entries.length}). Maximum allowed: ${FILE_LIMITS.MAX_DIR_ENTRIES}`);
525
+ }
526
+ return entries.map((entry) => ({
527
+ name: entry.name,
528
+ isDirectory: entry.isDirectory()
529
+ }));
530
+ }
531
+ async deletePath(relativePath, description) {
532
+ const fullPath = this.resolvePath(relativePath);
533
+ const exists = await fs.pathExists(fullPath);
534
+ if (!exists) {
535
+ throw new Error(`${relativePath} does not exist.`);
536
+ }
537
+ const stats = await fs.stat(fullPath);
538
+ const previousContents = stats.isFile() ? await fs.readFile(fullPath, "utf8") : "";
539
+ if (this.previewMode) {
540
+ this.addBatchedChange(
541
+ relativePath,
542
+ "delete",
543
+ previousContents,
544
+ "",
545
+ description ?? `Delete ${relativePath}`
546
+ );
547
+ return;
548
+ }
549
+ this.undoStack.push({
550
+ absolutePath: fullPath,
551
+ previousContents
552
+ });
553
+ await fs.remove(fullPath);
554
+ }
555
+ async renamePath(from, to) {
556
+ const fromPath = this.resolvePath(from);
557
+ const toPath = this.resolvePath(to);
558
+ await fs.ensureDir(path.dirname(toPath));
559
+ await fs.move(fromPath, toPath, { overwrite: true });
560
+ }
561
+ async copyPath(from, to) {
562
+ const fromPath = this.resolvePath(from);
563
+ const toPath = this.resolvePath(to);
564
+ await fs.copy(fromPath, toPath, { overwrite: true });
565
+ }
566
+ async replaceInFile(relativePath, searchValue, replaceValue) {
567
+ const current = await this.readFile(relativePath);
568
+ const updated = current.replace(searchValue, replaceValue);
569
+ await this.writeFile(relativePath, updated);
570
+ }
571
+ async formatFile(relativePath, formatter) {
572
+ const current = await this.readFile(relativePath);
573
+ const formatted = await formatter(current, relativePath);
574
+ await this.writeFile(relativePath, formatted);
575
+ }
576
+ renderContext(hit, contextLines) {
577
+ const filePath = this.resolvePath(hit.file);
578
+ if (!fs.existsSync(filePath)) {
579
+ return `${hit.file}:${hit.line}`;
580
+ }
581
+ const contents = fs.readFileSync(filePath, "utf8");
582
+ const lines = contents.split(/\r?\n/);
583
+ const start = Math.max(0, hit.line - 1 - contextLines);
584
+ const end = Math.min(lines.length, hit.line - 1 + contextLines + 1);
585
+ const snippet = lines.slice(start, end).map((line, idx) => {
586
+ const number = start + idx + 1;
587
+ const marker = number === hit.line ? ">" : " ";
588
+ return `${marker} ${number.toString().padStart(4, " ")} | ${line}`;
589
+ });
590
+ return `${hit.file}:${hit.line}
591
+ ${snippet.join("\n")}`;
592
+ }
593
+ };
594
+
595
+ export {
596
+ FILE_LIMITS,
597
+ FileActionManager
598
+ };
599
+ /**
600
+ * @license
601
+ * Copyright 2025 Autohand AI LLC
602
+ * SPDX-License-Identifier: Apache-2.0
603
+ */