autohand-cli 0.9.0 → 0.9.2

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 (455) hide show
  1. package/README.md +118 -76
  2. package/dist/AgentRegistry-BBQRODQC.cjs +18 -0
  3. package/dist/AgentRegistry-JBXZUPML.js +18 -0
  4. package/dist/{CommunitySkillsCache-ZEQWP6YM.js → CommunitySkillsCache-CI7UN2DX.js} +2 -2
  5. package/dist/CommunitySkillsCache-XTQ6RMTA.cjs +8 -0
  6. package/dist/{HookManager-CWLTFKWO.js → HookManager-BELBPQQI.js} +1 -1
  7. package/dist/{HookManager-TMAJQU4S.cjs → HookManager-ZL2CLAJW.cjs} +2 -2
  8. package/dist/{ImportWizard-MQXEED2U.cjs → ImportWizard-U6CIJREW.cjs} +13 -13
  9. package/dist/{ImportWizard-QBKQEXDW.js → ImportWizard-VJFSWSUQ.js} +4 -4
  10. package/dist/LearnAdvisor-LAURA3IB.cjs +9 -0
  11. package/dist/LearnAdvisor-RFOBXFG7.js +9 -0
  12. package/dist/MemoryManager-3A2VRPF2.js +9 -0
  13. package/dist/MemoryManager-UOEQZIDC.cjs +9 -0
  14. package/dist/{NVIDIAProvider-2HR737UE.js → NVIDIAProvider-AFNJNWJM.js} +1 -1
  15. package/dist/NVIDIAProvider-L5GTYRCQ.cjs +14 -0
  16. package/dist/{PermissionManager-KMYILJ4Z.js → PermissionManager-N2LDSOYF.js} +3 -3
  17. package/dist/PermissionManager-ZNURIEYR.cjs +11 -0
  18. package/dist/ProviderFactory-3BFS65V7.cjs +13 -0
  19. package/dist/{ProviderFactory-HFPRVQ25.js → ProviderFactory-XUT6BSGB.js} +4 -2
  20. package/dist/SessionManager-LGPQIA57.cjs +10 -0
  21. package/dist/{SessionManager-PNBTJJTQ.js → SessionManager-OR4KDDDS.js} +2 -2
  22. package/dist/{SkillsRegistry-4RRD5GMX.js → SkillsRegistry-IL3GWROU.js} +2 -2
  23. package/dist/SkillsRegistry-PM34DQNA.cjs +9 -0
  24. package/dist/SubAgent-2WG4QQB5.cjs +13 -0
  25. package/dist/SubAgent-ICGN23TQ.js +13 -0
  26. package/dist/{SyncApiClient-LRPFNCKJ.js → SyncApiClient-G3FM65IV.js} +1 -1
  27. package/dist/SyncApiClient-ODBDECOG.cjs +11 -0
  28. package/dist/{about-BW3PDZUU.js → about-OYVGQMJJ.js} +5 -4
  29. package/dist/about-U2BH7HDR.cjs +15 -0
  30. package/dist/{acp-VHEL7BOW.js → acp-JWHGXZL5.js} +207 -102
  31. package/dist/{acp-EOETGAHC.cjs → acp-S37JOBCS.cjs} +226 -121
  32. package/dist/actionExecutor-2QEPMELQ.cjs +28 -0
  33. package/dist/actionExecutor-6NCCORRB.js +28 -0
  34. package/dist/add-dir-KFUHSIR2.cjs +11 -0
  35. package/dist/{add-dir-VFX7QT4E.js → add-dir-MM2BM2Z2.js} +2 -2
  36. package/dist/agent-DUIYLIVN.js +132 -0
  37. package/dist/agent-YYEHGDAK.cjs +132 -0
  38. package/dist/agents-GBGG4CW7.cjs +19 -0
  39. package/dist/agents-ZH34C72F.js +19 -0
  40. package/dist/agents-new-ERXLS7SB.cjs +17 -0
  41. package/dist/agents-new-EVTGPTA4.js +17 -0
  42. package/dist/{autoSkill-EFMK6WU6.js → autoSkill-HEWKJ5JV.js} +2 -2
  43. package/dist/autoSkill-YL6PN6AV.cjs +20 -0
  44. package/dist/automode-4BJ7FNPL.cjs +10 -0
  45. package/dist/{automode-BMYSRM34.js → automode-S4U7A7Q2.js} +2 -2
  46. package/dist/chrome-45ZXHL5N.cjs +22 -0
  47. package/dist/{chrome-NHJ44WUN.js → chrome-BBSRVG6S.js} +2 -2
  48. package/dist/chrome-IFVZRHAT.cjs +50 -0
  49. package/dist/chrome-MYE6DNA2.js +22 -0
  50. package/dist/chunk-24CEJYEG.cjs +579 -0
  51. package/dist/{chunk-47PHDKNW.cjs → chunk-255GIVM2.cjs} +6 -6
  52. package/dist/{chunk-DIZTWFVR.cjs → chunk-2BDSR2OW.cjs} +238 -61
  53. package/dist/{chunk-BL2UC7HC.js → chunk-2BPIR7LA.js} +121 -4
  54. package/dist/{chunk-BQ22N3TX.cjs → chunk-2NY7OHBF.cjs} +47 -27
  55. package/dist/chunk-2WUNHTXL.js +303 -0
  56. package/dist/{chunk-HQWQZML5.cjs → chunk-34B6ZO6W.cjs} +124 -7
  57. package/dist/{chunk-5JTTM5SC.js → chunk-3BJN7GAH.js} +1 -1
  58. package/dist/{chunk-4256YRCO.cjs → chunk-3CAXECWJ.cjs} +30 -17
  59. package/dist/{chunk-KNTUI4TZ.cjs → chunk-3CBYUBZC.cjs} +5 -5
  60. package/dist/chunk-3DF3GZQ7.js +277 -0
  61. package/dist/{chunk-E26KKI46.cjs → chunk-3JURXAL6.cjs} +61 -8
  62. package/dist/{chunk-MOJ7ADW4.cjs → chunk-3KWAP2Y3.cjs} +88 -9
  63. package/dist/{chunk-OHWMWKJQ.js → chunk-3MCK6UBL.js} +1 -1
  64. package/dist/{chunk-5VHP6HDQ.js → chunk-3TH7IK4M.js} +62 -9
  65. package/dist/{chunk-ACDQGA4Z.js → chunk-3V77OB3W.js} +7 -72
  66. package/dist/{chunk-HS4USDND.cjs → chunk-3Y5UEK7K.cjs} +4 -4
  67. package/dist/{chunk-XV2HXRHX.js → chunk-4GPPSBEZ.js} +3 -3
  68. package/dist/chunk-5CMBAJ6K.js +377 -0
  69. package/dist/{chunk-MO4KP6XS.cjs → chunk-5YRXFBYZ.cjs} +35 -6
  70. package/dist/chunk-5ZNYX4VH.cjs +71 -0
  71. package/dist/chunk-6AC2TT26.js +156 -0
  72. package/dist/{chunk-UGFVM77J.cjs → chunk-6EIQ6A6U.cjs} +2 -2
  73. package/dist/{chunk-SWCQM52V.js → chunk-6HSEDXVF.js} +4 -4
  74. package/dist/{chunk-QQ7PANOP.js → chunk-6NUXK62F.js} +1 -1
  75. package/dist/{chunk-5CMYEM3R.cjs → chunk-6TGCAPYH.cjs} +62 -9
  76. package/dist/{chunk-NMQ47RCG.js → chunk-6W3SZCSP.js} +1 -1
  77. package/dist/{chunk-VRMZO6TB.js → chunk-73LV3DDZ.js} +7 -6
  78. package/dist/{chunk-3GUEUCZK.js → chunk-7BGGLIQF.js} +85 -1
  79. package/dist/{chunk-RBHANOYY.js → chunk-7DJJGKM6.js} +47 -3
  80. package/dist/{chunk-LQBONA55.cjs → chunk-7EEK7CRR.cjs} +85 -1
  81. package/dist/chunk-7TO3PDMV.cjs +324 -0
  82. package/dist/chunk-7UU22RSH.cjs +277 -0
  83. package/dist/{chunk-E6GFD7VR.cjs → chunk-A3GAM6FM.cjs} +11 -11
  84. package/dist/{chunk-DEQVRSV5.cjs → chunk-A7DJU75T.cjs} +8 -8
  85. package/dist/{chunk-DPSIGY6L.cjs → chunk-AAAO4ERQ.cjs} +9 -9
  86. package/dist/{chunk-FQAVGSPW.js → chunk-AAJLMP57.js} +2 -2
  87. package/dist/chunk-ABR756QN.js +529 -0
  88. package/dist/{chunk-JYKPWK5O.js → chunk-APFGDIPD.js} +3 -1
  89. package/dist/{chunk-Y3M2DABP.js → chunk-APQYRMYL.js} +4 -4
  90. package/dist/{chunk-Q2IL4DDI.cjs → chunk-AZKOIF2G.cjs} +62 -19
  91. package/dist/{chunk-MXVIDIC6.cjs → chunk-AZLHUPNC.cjs} +2 -2
  92. package/dist/chunk-B55VCYSQ.cjs +30 -0
  93. package/dist/{chunk-WZV6UVPY.js → chunk-BLQUMSM3.js} +1 -1
  94. package/dist/{chunk-PHJO5YAL.cjs → chunk-BXKPX6K4.cjs} +9 -9
  95. package/dist/{chunk-3KLSNNRW.cjs → chunk-C66FN2LP.cjs} +4 -4
  96. package/dist/{chunk-OV3PVUYN.js → chunk-CH7KUFAS.js} +9 -9
  97. package/dist/{chunk-CWINVFRI.cjs → chunk-CILSXOPI.cjs} +17 -17
  98. package/dist/{chunk-3UT7R3XV.js → chunk-CM24K6ZT.js} +145 -12
  99. package/dist/chunk-CMEZ42F2.cjs +303 -0
  100. package/dist/{chunk-46C73ZKK.cjs → chunk-CNQKIWIS.cjs} +152 -19
  101. package/dist/{chunk-5JFTY3VU.js → chunk-CSTUTDTH.js} +2 -1
  102. package/dist/{chunk-REMGR23V.cjs → chunk-CSUGNNJY.cjs} +10 -4
  103. package/dist/{chunk-TBOLJDUG.js → chunk-D6HB3H3L.js} +31 -11
  104. package/dist/{chunk-OM24WXEE.js → chunk-D7AYKVKW.js} +2 -2
  105. package/dist/{chunk-6GUODJKM.cjs → chunk-DLCXWOWT.cjs} +23 -23
  106. package/dist/{chunk-CH2J4PVE.cjs → chunk-DMM2BKSV.cjs} +121 -28
  107. package/dist/{chunk-M4KNC5BQ.js → chunk-DW3DPV77.js} +1 -1
  108. package/dist/chunk-ECQD2QC3.cjs +33 -0
  109. package/dist/{chunk-UEIXJG45.js → chunk-EEYOS3UC.js} +116 -80
  110. package/dist/{chunk-7HPWMALN.js → chunk-EF2EN5CR.js} +2 -2
  111. package/dist/{chunk-7LWQCE4Y.cjs → chunk-EFXFURDY.cjs} +192 -58
  112. package/dist/chunk-EK34UZPB.cjs +40 -0
  113. package/dist/{chunk-7JLT2VNW.cjs → chunk-FJR6EZLO.cjs} +9666 -7201
  114. package/dist/{chunk-GZ6DV2UG.js → chunk-FPO7YNPQ.js} +1 -1
  115. package/dist/{chunk-O64I2GYI.js → chunk-FS4I6BNR.js} +1 -1
  116. package/dist/{chunk-MX75JYIY.js → chunk-FSJ2MNOC.js} +3 -3
  117. package/dist/{chunk-7RFJB75Y.js → chunk-GEHZMC4G.js} +11 -8
  118. package/dist/{chunk-UWFG2R2I.cjs → chunk-GO6C2RAR.cjs} +36 -9
  119. package/dist/{chunk-WGLBC5AY.cjs → chunk-GSMR6V36.cjs} +4 -4
  120. package/dist/{chunk-Z3XSSF7B.js → chunk-GSZWATME.js} +1 -1
  121. package/dist/{chunk-7MU7LWF3.cjs → chunk-GYLGCR6F.cjs} +5 -5
  122. package/dist/{chunk-O6TQP7U7.cjs → chunk-H3OOWNYQ.cjs} +3 -3
  123. package/dist/{chunk-2QL6MNXG.js → chunk-H65446XW.js} +115 -20
  124. package/dist/chunk-H7HXRRHK.js +324 -0
  125. package/dist/{chunk-ZZ63NW7A.cjs → chunk-HN2JTDN5.cjs} +17 -17
  126. package/dist/{chunk-AOKCI722.cjs → chunk-HNXUZ5OY.cjs} +2 -2
  127. package/dist/{chunk-AUYSIEVV.cjs → chunk-HOYT3E65.cjs} +3 -3
  128. package/dist/{chunk-DMRXF5DU.js → chunk-HTPY5ESD.js} +3 -3
  129. package/dist/chunk-HTU4W3GB.js +183 -0
  130. package/dist/{chunk-3DDL2E55.cjs → chunk-HVLWH2AF.cjs} +10 -10
  131. package/dist/{chunk-HSCUPEA4.cjs → chunk-HZTEU4W5.cjs} +74 -105
  132. package/dist/{chunk-XGMI6IYB.cjs → chunk-I5T7LPFP.cjs} +7 -7
  133. package/dist/{chunk-XIVFAD2L.js → chunk-IB5CJXE7.js} +173 -12
  134. package/dist/chunk-INNXFLDR.cjs +388 -0
  135. package/dist/{chunk-75EDROHL.cjs → chunk-JFLEP3T7.cjs} +10 -10
  136. package/dist/chunk-JJGDOBFL.js +40 -0
  137. package/dist/{chunk-VBOFPU5M.cjs → chunk-JM3ZTQUK.cjs} +13 -9
  138. package/dist/{chunk-HJIXWGQZ.js → chunk-JSU46T6K.js} +1 -1
  139. package/dist/{chunk-AT7OWLY5.js → chunk-K6WN6BT4.js} +1 -1
  140. package/dist/{chunk-LN7D3EJZ.js → chunk-KA2U6MY2.js} +4 -3
  141. package/dist/{chunk-3S563FNF.cjs → chunk-KIQH3SMT.cjs} +34 -31
  142. package/dist/{chunk-BWF4VDYE.js → chunk-KPRXHIE2.js} +54 -85
  143. package/dist/{chunk-Z4LIPMPM.js → chunk-L6OH44HL.js} +13 -9
  144. package/dist/{chunk-A7HHCIDQ.js → chunk-LIO3RX2Z.js} +2 -2
  145. package/dist/{chunk-DLP436GI.js → chunk-LOSXLH7P.js} +110 -17
  146. package/dist/{chunk-IEXKKKOF.cjs → chunk-LSOR72PB.cjs} +23 -23
  147. package/dist/{chunk-IAGCRVJ3.js → chunk-MA3AVDCC.js} +55 -12
  148. package/dist/{chunk-B5CGDNMR.js → chunk-ME3S2WIR.js} +3 -3
  149. package/dist/{chunk-HKYZSUQ5.js → chunk-NC2I2M4P.js} +4 -4
  150. package/dist/{chunk-GBMDFWJX.cjs → chunk-NC4A4LVC.cjs} +13 -13
  151. package/dist/{chunk-E46DJH5S.js → chunk-NGEK5FCJ.js} +176 -3
  152. package/dist/{chunk-TQ33WBY5.cjs → chunk-NHWHEW7M.cjs} +2 -1
  153. package/dist/{chunk-62RTC3XX.js → chunk-NKW6CHXQ.js} +1 -1
  154. package/dist/{chunk-3PXKRVCW.js → chunk-NOWCRKP2.js} +10 -4
  155. package/dist/{chunk-HXJEGMGB.js → chunk-NUB2LMB6.js} +2 -2
  156. package/dist/chunk-NVATU4V6.cjs +44 -0
  157. package/dist/chunk-O246MKIW.cjs +267 -0
  158. package/dist/{chunk-QCHIDZBA.js → chunk-OGFWL2PS.js} +1 -1
  159. package/dist/{chunk-JJ4KA7HK.cjs → chunk-ONNGAR6W.cjs} +415 -551
  160. package/dist/{chunk-TKKN34TV.js → chunk-OOFR6A62.js} +33 -4
  161. package/dist/{chunk-6NVAK6CK.js → chunk-OZ7FHO7J.js} +2 -2
  162. package/dist/{chunk-2CGE7ZV3.cjs → chunk-P5EWGUI2.cjs} +201 -28
  163. package/dist/{chunk-GGLKUENP.js → chunk-P6BQJPAI.js} +191 -14
  164. package/dist/{chunk-TWQDAUZU.js → chunk-PG2JIU5M.js} +60 -7
  165. package/dist/chunk-PI27G2ED.cjs +377 -0
  166. package/dist/{chunk-YV63VW4K.js → chunk-PI7LRPL6.js} +1 -1
  167. package/dist/{chunk-TXPSTCG7.cjs → chunk-PMPEC5HN.cjs} +18 -15
  168. package/dist/{chunk-ROLA6EFO.cjs → chunk-PYUP7AKY.cjs} +14 -14
  169. package/dist/{chunk-BFQDQRDE.js → chunk-QC5Z3ZT5.js} +2 -2
  170. package/dist/chunk-QDO4L2A7.cjs +156 -0
  171. package/dist/{chunk-LFDPTJYF.cjs → chunk-QDXRI5AM.cjs} +1 -1
  172. package/dist/{chunk-3LJJG5YY.cjs → chunk-QLZOMZO5.cjs} +4 -3
  173. package/dist/chunk-QVXMSQOG.js +430 -0
  174. package/dist/{chunk-ZHJ7JGME.cjs → chunk-R4UKBKDY.cjs} +11 -11
  175. package/dist/{chunk-IGMPWJ2I.cjs → chunk-R75AWII3.cjs} +118 -23
  176. package/dist/{chunk-VGEV44V2.cjs → chunk-RD5PLUIX.cjs} +191 -30
  177. package/dist/{chunk-I24CWKKK.js → chunk-RGB34CV5.js} +3 -3
  178. package/dist/{chunk-CHI52KFR.cjs → chunk-RJCZLFHE.cjs} +246 -39
  179. package/dist/{chunk-D2OSPLYC.cjs → chunk-RKWNM2BJ.cjs} +2 -2
  180. package/dist/{chunk-FGT6KK6T.js → chunk-RMVONICR.js} +3 -3
  181. package/dist/{chunk-Q6AC3PHY.cjs → chunk-RPSYRJL7.cjs} +10 -4
  182. package/dist/chunk-RS2E32YB.js +71 -0
  183. package/dist/chunk-RWKU2X7O.js +388 -0
  184. package/dist/chunk-RZLEGVMH.cjs +565 -0
  185. package/dist/{chunk-5F6ZKSHO.js → chunk-S2L3Y677.js} +1 -1
  186. package/dist/{chunk-ARBEHFCG.js → chunk-S7KVUIOS.js} +1 -1
  187. package/dist/{chunk-AC7DZ6SK.cjs → chunk-SACJJ6NO.cjs} +5 -3
  188. package/dist/{chunk-IKUMVBCW.cjs → chunk-SD3NTC7D.cjs} +48 -4
  189. package/dist/{chunk-CBFH2J3O.js → chunk-SJQU2ZFR.js} +246 -39
  190. package/dist/{chunk-GWO66KBI.js → chunk-SKAQKQFF.js} +12 -2
  191. package/dist/chunk-T4DXP5OP.js +30 -0
  192. package/dist/{chunk-CFFE4VA3.js → chunk-T6FTB6K2.js} +1 -1
  193. package/dist/{chunk-U4C3HW6P.js → chunk-T6N6GRFT.js} +13 -10
  194. package/dist/{chunk-D6GZBSOX.js → chunk-TJFKA6A7.js} +82 -3
  195. package/dist/{chunk-2HOLOHVK.js → chunk-TJZUPS4Z.js} +163 -299
  196. package/dist/{chunk-RBZ7AFX7.cjs → chunk-TLKHZ425.cjs} +2 -2
  197. package/dist/{chunk-J2K57QM7.cjs → chunk-TQ24NLXO.cjs} +6 -6
  198. package/dist/{chunk-LUMV3DB2.js → chunk-TWBAU46X.js} +1 -1
  199. package/dist/{chunk-OPNI6O7F.cjs → chunk-TZB5XADL.cjs} +4 -4
  200. package/dist/{chunk-6HH236FV.cjs → chunk-UAYXZXWU.cjs} +4 -4
  201. package/dist/{chunk-MPULXVC4.cjs → chunk-UKBFNBDO.cjs} +11 -11
  202. package/dist/chunk-UMJYX5KD.js +565 -0
  203. package/dist/chunk-USKYTHDL.cjs +235 -0
  204. package/dist/chunk-V4HGZSKQ.cjs +183 -0
  205. package/dist/{chunk-MQESBFBZ.cjs → chunk-VAJUSZMC.cjs} +21 -20
  206. package/dist/{chunk-PQLKJCIE.js → chunk-VGQG4NBJ.js} +2 -2
  207. package/dist/chunk-VLUIVJ3J.js +235 -0
  208. package/dist/chunk-VOBINVMV.cjs +430 -0
  209. package/dist/{chunk-L4F7SUYL.js → chunk-VSHKKCSH.js} +16 -5
  210. package/dist/{chunk-LDJQ5QHG.cjs → chunk-VSZU3MGA.cjs} +28 -17
  211. package/dist/{chunk-YFXTE422.cjs → chunk-VWHAUB77.cjs} +8 -3
  212. package/dist/{chunk-EZJHLOWP.js → chunk-VXGYFX45.js} +20 -7
  213. package/dist/{chunk-JIMSII7R.js → chunk-WH6YUQDB.js} +193 -59
  214. package/dist/{chunk-VKBIE6I6.js → chunk-WQ6TD55V.js} +2 -2
  215. package/dist/{chunk-ZR46OJNZ.js → chunk-WQWECXTY.js} +3 -3
  216. package/dist/{chunk-SOLBYSLY.cjs → chunk-WVDJUJH6.cjs} +2 -2
  217. package/dist/{chunk-QKP772OZ.js → chunk-X24VIVDZ.js} +963 -103
  218. package/dist/{chunk-37M5UM6I.js → chunk-X4NRTLXD.js} +7 -1
  219. package/dist/chunk-X53SHYCG.js +27 -0
  220. package/dist/{chunk-PUD76XQT.cjs → chunk-XB2Z4ZAK.cjs} +5 -5
  221. package/dist/chunk-Y47OJGLB.cjs +27 -0
  222. package/dist/{chunk-WRTXCQ3V.cjs → chunk-Y4MN27V3.cjs} +1080 -220
  223. package/dist/{chunk-ZK6HOR62.js → chunk-YEHFYZFU.js} +7 -2
  224. package/dist/{chunk-FFBDRUO5.cjs → chunk-YICIUY23.cjs} +1 -1
  225. package/dist/{chunk-PDHT7LQS.cjs → chunk-YMXYC777.cjs} +3 -3
  226. package/dist/{chunk-TJNBASFD.cjs → chunk-Z3GRWK6O.cjs} +8 -8
  227. package/dist/{chunk-JP3YHTQ2.cjs → chunk-Z5GG2KSL.cjs} +4 -4
  228. package/dist/{chunk-ZPD2AO3U.js → chunk-ZER7DYQK.js} +2 -2
  229. package/dist/{chunk-UXLW45ZE.cjs → chunk-ZFDXZEZJ.cjs} +25 -90
  230. package/dist/chunk-ZFV4HJA6.js +579 -0
  231. package/dist/chunk-ZHMYTI5D.cjs +529 -0
  232. package/dist/{chunk-CCVMREXI.js → chunk-ZLR2TFBC.js} +35 -8
  233. package/dist/{chunk-J5ADZN6V.cjs → chunk-ZTWNU5QZ.cjs} +20 -20
  234. package/dist/chunk-ZUYYHKQA.js +44 -0
  235. package/dist/{chunk-AUFNACED.js → chunk-ZVLVLDYN.js} +9086 -6621
  236. package/dist/clear-AJGXD2BB.cjs +12 -0
  237. package/dist/{clear-OFLFQ3MR.js → clear-HAHDSWKW.js} +3 -3
  238. package/dist/communityInstaller-IRR6M3N6.cjs +22 -0
  239. package/dist/{communityInstaller-COB2KTOW.js → communityInstaller-OLKEUGMX.js} +6 -6
  240. package/dist/completion-G7Z436TF.cjs +17 -0
  241. package/dist/{completion-PT4VM2H2.js → completion-ZS3AXJ6A.js} +5 -5
  242. package/dist/{config-R4O7GBTY.js → config-OWYAQPCX.js} +5 -3
  243. package/dist/config-W2BHT2QE.cjs +22 -0
  244. package/dist/{constants-HVCHVQAF.js → constants-AS6K67AA.js} +5 -3
  245. package/dist/constants-B4W5BT7F.cjs +23 -0
  246. package/dist/{export-3PK3VFCE.js → export-5HIU3KMD.js} +5 -5
  247. package/dist/export-GFD32UY2.cjs +15 -0
  248. package/dist/{extractSessionMemories-A2JX5WJ2.js → extractSessionMemories-K6ZVAW2F.js} +1 -1
  249. package/dist/{extractSessionMemories-XL3MS37F.cjs → extractSessionMemories-LLOIJR5U.cjs} +2 -2
  250. package/dist/feature-KP74CZ3F.cjs +14 -0
  251. package/dist/feature-OPNVMB2E.js +14 -0
  252. package/dist/features-LT55MURX.cjs +24 -0
  253. package/dist/features-ZDIU26WX.js +24 -0
  254. package/dist/feedback-7WTJFQ6S.js +18 -0
  255. package/dist/feedback-CEOJ3453.cjs +18 -0
  256. package/dist/go-2CY5SZNR.js +16 -0
  257. package/dist/go-O2CSQON4.cjs +16 -0
  258. package/dist/goal-DL2N2AWT.cjs +16 -0
  259. package/dist/goal-IJS7VZSG.js +16 -0
  260. package/dist/help-RNOGDEBA.cjs +12 -0
  261. package/dist/{help-X3OAZ3CY.js → help-TCWD2IRH.js} +2 -2
  262. package/dist/{history-YKFPHBJN.js → history-ATOR5OQV.js} +2 -2
  263. package/dist/history-UUSGX2AL.cjs +14 -0
  264. package/dist/{hooks-7TA4PIIB.js → hooks-R3Z5QKUP.js} +6 -6
  265. package/dist/hooks-RWM5UY67.cjs +18 -0
  266. package/dist/{i18n-2KBUU7XL.js → i18n-4QI4TD4I.js} +1 -1
  267. package/dist/i18n-MFAEU5RV.cjs +33 -0
  268. package/dist/ide-6PBTCCUQ.js +15 -0
  269. package/dist/ide-UE3G7NMQ.cjs +15 -0
  270. package/dist/{import-I7T4ZHYL.cjs → import-2IG76KAN.cjs} +6 -4
  271. package/dist/{import-JWPYKXCZ.js → import-E47QL4DW.js} +2 -2
  272. package/dist/import-NQDNBFUL.cjs +10 -0
  273. package/dist/{import-4CHYLS4K.js → import-VQIHGJWS.js} +6 -4
  274. package/dist/index.cjs +512 -305
  275. package/dist/index.d.cts +40 -0
  276. package/dist/index.d.ts +40 -0
  277. package/dist/index.js +402 -195
  278. package/dist/init-DX3RDGDT.cjs +10 -0
  279. package/dist/{init-262MWZV4.js → init-Q54OAAFZ.js} +2 -2
  280. package/dist/{inputPrompt-YGBHDUEP.js → inputPrompt-V2VBDRM7.js} +3 -3
  281. package/dist/inputPrompt-WVGVWAHS.cjs +90 -0
  282. package/dist/language-I6KXAOXD.js +23 -0
  283. package/dist/language-XMIVOH5E.cjs +23 -0
  284. package/dist/learn-JPVVGTKU.js +23 -0
  285. package/dist/learn-NLSHI2MZ.cjs +23 -0
  286. package/dist/login-NABQYLYC.cjs +28 -0
  287. package/dist/login-XPOVFSWN.js +28 -0
  288. package/dist/logout-HNHCGB4Q.js +25 -0
  289. package/dist/logout-SKGDXJSW.cjs +25 -0
  290. package/dist/{mcp-5O6PUL4G.js → mcp-EN73YFGZ.js} +8 -6
  291. package/dist/mcp-TADZCPJQ.cjs +22 -0
  292. package/dist/{mcp-install-P6DHES7V.cjs → mcp-install-2GKWWBAS.cjs} +15 -13
  293. package/dist/{mcp-install-6XWXLFVY.js → mcp-install-3TBTVSHW.js} +10 -8
  294. package/dist/memory-GRXFTDIN.cjs +10 -0
  295. package/dist/{memory-Q54CESNM.js → memory-K2P3CDCH.js} +2 -2
  296. package/dist/{model-6AJ77PJG.js → model-DEG22OWA.js} +2 -2
  297. package/dist/model-OSD74T7Z.cjs +10 -0
  298. package/dist/new-4NWBOATU.cjs +12 -0
  299. package/dist/{new-ZXHEWC2S.js → new-KJAP2MB6.js} +3 -3
  300. package/dist/onboarding-2U5WE2OA.js +39 -0
  301. package/dist/onboarding-5DZFCO5Q.cjs +39 -0
  302. package/dist/permissions-KY5I6YQ3.cjs +10 -0
  303. package/dist/{permissions-YHJMVA6L.js → permissions-TKYON7PP.js} +2 -2
  304. package/dist/{plan-YYUAXPTL.js → plan-DYHHLZSS.js} +1 -1
  305. package/dist/plan-PYKP652W.cjs +13 -0
  306. package/dist/quit-GSKJL42O.js +14 -0
  307. package/dist/quit-TQSRTBUT.cjs +14 -0
  308. package/dist/{registry-34GL6BNJ.js → registry-EZ4V4TUQ.js} +1339 -1
  309. package/dist/{registry-V24W7YK6.cjs → registry-LCWYI4IB.cjs} +1378 -40
  310. package/dist/resume-4VWJXARX.cjs +17 -0
  311. package/dist/resume-TLHWWWFN.js +17 -0
  312. package/dist/{review-QHP2KP4Q.js → review-CSK4IYTO.js} +1 -1
  313. package/dist/review-XLJEUH5K.cjs +9 -0
  314. package/dist/{rpc-S3DGW6KV.js → rpc-3DLQBDWU.js} +301 -130
  315. package/dist/{rpc-NPS3PU4O.cjs → rpc-O36WUU3L.cjs} +399 -228
  316. package/dist/search-DSX2CY4A.cjs +22 -0
  317. package/dist/search-I3QUDUQL.js +22 -0
  318. package/dist/sessionBranching-DVNOUWJT.cjs +19 -0
  319. package/dist/sessionBranching-FKV4CR36.js +19 -0
  320. package/dist/sessions-3JUOT3ED.cjs +10 -0
  321. package/dist/{sessions-IYAXMK23.js → sessions-VWMDIPOS.js} +2 -2
  322. package/dist/settings-FT2LZZUV.js +45 -0
  323. package/dist/settings-RL4KNWHB.cjs +45 -0
  324. package/dist/setup-HQEJVOYT.js +32 -0
  325. package/dist/setup-MN54LKOL.cjs +32 -0
  326. package/dist/share-BUAFZNBX.cjs +17 -0
  327. package/dist/share-CGB6MAVJ.js +17 -0
  328. package/dist/skills/builtin/code-reviewer/SKILL.md +64 -0
  329. package/dist/skills/builtin/goal-writer/SKILL.md +124 -0
  330. package/dist/{skills-VWOMV3CR.js → skills-7DKR3HRZ.js} +8 -8
  331. package/dist/{skills-MVIZNHT4.js → skills-BBBENOEY.js} +9 -9
  332. package/dist/skills-OQM7IHAF.cjs +29 -0
  333. package/dist/{skills-GGMZOVIE.cjs → skills-RA2PKL63.cjs} +10 -10
  334. package/dist/{skills-install-VTAMCNNY.cjs → skills-install-D7K476SL.cjs} +16 -16
  335. package/dist/{skills-install-QBA5RCV6.js → skills-install-T4SOKJSL.js} +9 -9
  336. package/dist/skills-new-S33NGEU3.js +18 -0
  337. package/dist/skills-new-UVYH53MD.cjs +18 -0
  338. package/dist/slashCommands-MWOUDSQP.js +111 -0
  339. package/dist/slashCommands-XASURUTV.cjs +111 -0
  340. package/dist/squad-PIIYDFVH.cjs +15 -0
  341. package/dist/squad-VHYOVEJP.js +15 -0
  342. package/dist/status-GHFTXQBL.js +25 -0
  343. package/dist/status-WXMIJIU3.cjs +25 -0
  344. package/dist/statusline-2K7AC6ZQ.js +21 -0
  345. package/dist/statusline-GROI4HOC.cjs +21 -0
  346. package/dist/sync-254WF6JI.cjs +42 -0
  347. package/dist/sync-2DIZN4EH.cjs +24 -0
  348. package/dist/{sync-7BILIQHP.js → sync-J6I2ZUKQ.js} +6 -4
  349. package/dist/{sync-7OKF6636.js → sync-Z3LVSEEV.js} +8 -5
  350. package/dist/{teammate-J6PHGL23.cjs → teammate-EXR76PEQ.cjs} +9 -8
  351. package/dist/{teammate-GZQSCIMS.js → teammate-K4DAOFEQ.js} +8 -7
  352. package/dist/templates-ARG2VRWW.cjs +11 -0
  353. package/dist/templates-UGVZV3KJ.js +11 -0
  354. package/dist/theme-MVQDSU47.js +23 -0
  355. package/dist/theme-QAKEYWJG.cjs +23 -0
  356. package/dist/ui/questionModal.cjs +6 -6
  357. package/dist/ui/questionModal.js +5 -5
  358. package/dist/{undo-SZEHLX7X.js → undo-5AU47JHF.js} +2 -2
  359. package/dist/undo-ME6WKUXZ.cjs +10 -0
  360. package/dist/usage-QTKO2YMD.js +25 -0
  361. package/dist/usage-TYNJKVER.cjs +25 -0
  362. package/package.json +10 -4
  363. package/dist/AgentRegistry-EGBDIUAK.cjs +0 -10
  364. package/dist/AgentRegistry-XPWSVO3Q.js +0 -10
  365. package/dist/CommunitySkillsCache-2OIUV227.cjs +0 -8
  366. package/dist/LearnAdvisor-46FG2XIP.js +0 -9
  367. package/dist/LearnAdvisor-XBRDNAGH.cjs +0 -9
  368. package/dist/MemoryManager-34L4YOKA.cjs +0 -8
  369. package/dist/MemoryManager-WJMLPWGU.js +0 -8
  370. package/dist/NVIDIAProvider-MVTL62PR.cjs +0 -14
  371. package/dist/PermissionManager-5OOJ7FAT.cjs +0 -11
  372. package/dist/ProviderFactory-C3YPXTDD.cjs +0 -11
  373. package/dist/SessionManager-WAPTFMDO.cjs +0 -10
  374. package/dist/SkillsRegistry-7AJP74GJ.cjs +0 -9
  375. package/dist/SubAgent-FDIH3DXB.js +0 -11
  376. package/dist/SubAgent-HVL2ICVZ.cjs +0 -11
  377. package/dist/SyncApiClient-VMBOLQ6H.cjs +0 -11
  378. package/dist/about-FCAX37YC.cjs +0 -14
  379. package/dist/actionExecutor-33I47NZS.js +0 -24
  380. package/dist/actionExecutor-4YBMR3YH.cjs +0 -24
  381. package/dist/add-dir-7SS6KSH5.cjs +0 -11
  382. package/dist/agent-DMRUFU4M.cjs +0 -116
  383. package/dist/agent-WCJEYQJT.js +0 -116
  384. package/dist/agents-CHROO3VU.cjs +0 -17
  385. package/dist/agents-UVDUL65K.js +0 -17
  386. package/dist/agents-new-AUBWSOXP.js +0 -17
  387. package/dist/agents-new-Y562WC47.cjs +0 -17
  388. package/dist/autoSkill-YOLLFTP2.cjs +0 -20
  389. package/dist/automode-DBLKTTKD.cjs +0 -10
  390. package/dist/chrome-ATC4OO5I.cjs +0 -20
  391. package/dist/chrome-O62WXV7F.js +0 -20
  392. package/dist/chrome-XHJLCO4M.cjs +0 -50
  393. package/dist/chunk-6XVVIY54.cjs +0 -256
  394. package/dist/chunk-AU6JAGZJ.cjs +0 -231
  395. package/dist/chunk-N6O3XUZ2.cjs +0 -23
  396. package/dist/chunk-VDWJMWDF.js +0 -256
  397. package/dist/clear-33TWQ2ES.cjs +0 -12
  398. package/dist/communityInstaller-TWMGPSYM.cjs +0 -22
  399. package/dist/completion-IIZMHXYP.cjs +0 -17
  400. package/dist/config-KL6WU7R2.cjs +0 -20
  401. package/dist/constants-RLMJ5D5P.cjs +0 -21
  402. package/dist/export-WLGNWEMJ.cjs +0 -15
  403. package/dist/feedback-G635NCLJ.js +0 -18
  404. package/dist/feedback-LLMK3TZH.cjs +0 -18
  405. package/dist/help-BAXLP2M2.cjs +0 -12
  406. package/dist/history-6HOJSEMT.cjs +0 -14
  407. package/dist/hooks-XVFU67T2.cjs +0 -18
  408. package/dist/i18n-MUJMKTFM.cjs +0 -33
  409. package/dist/ide-CCQ33PGC.cjs +0 -15
  410. package/dist/ide-VLVFBZ5F.js +0 -15
  411. package/dist/import-J46F54JY.cjs +0 -10
  412. package/dist/init-EE5Y7RBL.cjs +0 -10
  413. package/dist/inputPrompt-IIFKCX5Q.cjs +0 -90
  414. package/dist/language-CVLPB7OV.js +0 -21
  415. package/dist/language-ZTWFHUSV.cjs +0 -21
  416. package/dist/learn-PON7I5QS.js +0 -23
  417. package/dist/learn-XLRSVNA3.cjs +0 -23
  418. package/dist/login-223QTGBG.cjs +0 -26
  419. package/dist/login-6IKTBUBY.js +0 -26
  420. package/dist/logout-RN2AG6SI.js +0 -23
  421. package/dist/logout-U3M4FFX7.cjs +0 -23
  422. package/dist/mcp-NUQ76QQB.cjs +0 -20
  423. package/dist/memory-CYMDQ2YC.cjs +0 -10
  424. package/dist/model-IDRCKDML.cjs +0 -10
  425. package/dist/new-7LEWOUF2.cjs +0 -12
  426. package/dist/onboarding-FXX7YHSJ.cjs +0 -35
  427. package/dist/onboarding-JYNMK6NI.js +0 -35
  428. package/dist/permissions-YBNSANIA.cjs +0 -10
  429. package/dist/plan-XEJMOT55.cjs +0 -13
  430. package/dist/quit-B43SJ6E4.cjs +0 -10
  431. package/dist/quit-GWTNHQSP.js +0 -10
  432. package/dist/resume-DYVOQN5L.cjs +0 -16
  433. package/dist/resume-M25UQKOX.js +0 -16
  434. package/dist/review-UWHWQHCB.cjs +0 -9
  435. package/dist/search-CPX4PWHP.js +0 -20
  436. package/dist/search-VUF3M4N3.cjs +0 -20
  437. package/dist/sessions-JODKER5D.cjs +0 -10
  438. package/dist/settings-55BNW6BF.js +0 -33
  439. package/dist/settings-BKTS7OMC.cjs +0 -33
  440. package/dist/setup-IRC5HQG2.js +0 -29
  441. package/dist/setup-MMQ7TWOP.cjs +0 -29
  442. package/dist/share-6JRQECAH.cjs +0 -17
  443. package/dist/share-YM5MJKMO.js +0 -17
  444. package/dist/skills-LWSOKOSH.cjs +0 -29
  445. package/dist/skills-new-GPL46YV2.js +0 -18
  446. package/dist/skills-new-L5BEZN5V.cjs +0 -18
  447. package/dist/slashCommands-FBPCIWM5.cjs +0 -95
  448. package/dist/slashCommands-FCWY5DXW.js +0 -95
  449. package/dist/status-3B5SDZPL.js +0 -17
  450. package/dist/status-TTGRF6NC.cjs +0 -17
  451. package/dist/sync-77CXVVTK.cjs +0 -21
  452. package/dist/sync-EH4K5U3N.cjs +0 -40
  453. package/dist/theme-64BYGJ57.cjs +0 -21
  454. package/dist/theme-YJE6HEON.js +0 -21
  455. package/dist/undo-PRTEGL2J.cjs +0 -10
@@ -1,6 +1,6 @@
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9;
2
2
 
3
- var _chunkE26KKI46cjs = require('./chunk-E26KKI46.cjs');
3
+ var _chunk3JURXAL6cjs = require('./chunk-3JURXAL6.cjs');
4
4
  require('./chunk-3HT76LNN.cjs');
5
5
 
6
6
  // src/import/importers/ClaudeImporter.ts
@@ -91,7 +91,7 @@ var BaseImporter = class {
91
91
  const timestamp = Date.now();
92
92
  const uuid = _crypto2.default.randomUUID();
93
93
  const sessionId = `${uuid}-${timestamp}`;
94
- const sessionDir = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.sessions, sessionId);
94
+ const sessionDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.sessions, sessionId);
95
95
  await _fsextra2.default.ensureDir(sessionDir);
96
96
  const metadata = {
97
97
  sessionId,
@@ -121,7 +121,7 @@ var BaseImporter = class {
121
121
  * Uses the session index for O(n) lookup with `importedFrom` field.
122
122
  */
123
123
  async isAlreadyImported(source, originalId) {
124
- const indexPath = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.sessions, "index.json");
124
+ const indexPath = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.sessions, "index.json");
125
125
  if (!await _fsextra2.default.pathExists(indexPath)) {
126
126
  return false;
127
127
  }
@@ -143,7 +143,7 @@ var BaseImporter = class {
143
143
  * Creates the file if it does not exist.
144
144
  */
145
145
  async updateSessionIndex(metadata) {
146
- const indexPath = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.sessions, "index.json");
146
+ const indexPath = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.sessions, "index.json");
147
147
  let index = { sessions: [], byProject: {} };
148
148
  if (await _fsextra2.default.pathExists(indexPath)) {
149
149
  try {
@@ -171,7 +171,7 @@ var BaseImporter = class {
171
171
  index.byProject[metadata.projectPath] = [];
172
172
  }
173
173
  index.byProject[metadata.projectPath].push(metadata.sessionId);
174
- await _fsextra2.default.ensureDir(_chunkE26KKI46cjs.AUTOHAND_PATHS.sessions);
174
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.sessions);
175
175
  await _fsextra2.default.writeJson(indexPath, index, { spaces: 2 });
176
176
  }
177
177
  // ---------------------------------------------------------------
@@ -431,7 +431,7 @@ var ClaudeImporter = (_class = class extends BaseImporter {constructor(...args)
431
431
  const settings = await this.safeReadJson(settingsPath);
432
432
  const permissions = settings.permissions;
433
433
  if (_optionalChain([permissions, 'optionalAccess', _7 => _7.allow])) {
434
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
434
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
435
435
  await _fsextra2.default.ensureDir(configDir);
436
436
  const importedSettingsPath = _path2.default.join(configDir, "imported-claude-settings.json");
437
437
  await _fsextra2.default.writeJson(importedSettingsPath, {
@@ -473,7 +473,7 @@ var ClaudeImporter = (_class = class extends BaseImporter {constructor(...args)
473
473
  let success = 0;
474
474
  let failed = 0;
475
475
  const total = skillFiles.length;
476
- const destDir = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.skills, "imported-claude");
476
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.skills, "imported-claude");
477
477
  for (let i = 0; i < skillFiles.length; i++) {
478
478
  const file = skillFiles[i];
479
479
  const src = _path2.default.join(skillsDir, file.name);
@@ -532,7 +532,7 @@ var ClaudeImporter = (_class = class extends BaseImporter {constructor(...args)
532
532
  })]);
533
533
  try {
534
534
  const projectHash = dir.name.replace(/[^a-zA-Z0-9-]/g, "_");
535
- const destDir = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.projects, projectHash, "imported-claude");
535
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.projects, projectHash, "imported-claude");
536
536
  await _fsextra2.default.ensureDir(destDir);
537
537
  if (hasMemoryDir) {
538
538
  await _fsextra2.default.copy(_path2.default.join(projectDir, "memory"), _path2.default.join(destDir, "memory"));
@@ -835,7 +835,7 @@ var CodexImporter = (_class2 = class extends BaseImporter {constructor(...args2)
835
835
  try {
836
836
  const tomlContent = await _fsextra2.default.readFile(configPath, "utf-8");
837
837
  const parsed = this.parseToml(tomlContent);
838
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
838
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
839
839
  await _fsextra2.default.ensureDir(configDir);
840
840
  await _fsextra2.default.writeJson(
841
841
  _path2.default.join(configDir, "imported-codex-settings.json"),
@@ -879,7 +879,7 @@ var CodexImporter = (_class2 = class extends BaseImporter {constructor(...args2)
879
879
  let success = 0;
880
880
  let failed = 0;
881
881
  const total = skillFiles.length;
882
- const destDir = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.skills, "imported-codex");
882
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.skills, "imported-codex");
883
883
  for (let i = 0; i < skillFiles.length; i++) {
884
884
  const file = skillFiles[i];
885
885
  const src = _path2.default.join(skillsDir, file.name);
@@ -1024,6 +1024,13 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1024
1024
  });
1025
1025
  }
1026
1026
  }
1027
+ const mcpServers = this.extractMcpServers(settings);
1028
+ if (mcpServers && Object.keys(mcpServers).length > 0) {
1029
+ available.set("mcp", {
1030
+ count: Object.keys(mcpServers).length,
1031
+ description: `${Object.keys(mcpServers).length} Gemini MCP server${Object.keys(mcpServers).length !== 1 ? "s" : ""}`
1032
+ });
1033
+ }
1027
1034
  } catch (e5) {
1028
1035
  }
1029
1036
  }
@@ -1048,6 +1055,9 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1048
1055
  case "hooks":
1049
1056
  await this.importHooks(imported, errors, onProgress);
1050
1057
  break;
1058
+ case "mcp":
1059
+ await this.importMcp(imported, errors, onProgress);
1060
+ break;
1051
1061
  case "memory":
1052
1062
  await this.importMemory(imported, errors, onProgress);
1053
1063
  break;
@@ -1080,7 +1090,7 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1080
1090
  })]);
1081
1091
  try {
1082
1092
  const settings = await this.safeReadJson(settingsPath);
1083
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1093
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1084
1094
  await _fsextra2.default.ensureDir(configDir);
1085
1095
  await _fsextra2.default.writeJson(
1086
1096
  _path2.default.join(configDir, "imported-gemini-settings.json"),
@@ -1132,7 +1142,7 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1132
1142
  imported.set("hooks", { success: 0, failed: 0, skipped: 1 });
1133
1143
  return;
1134
1144
  }
1135
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1145
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1136
1146
  await _fsextra2.default.ensureDir(configDir);
1137
1147
  await _fsextra2.default.writeJson(
1138
1148
  _path2.default.join(configDir, "imported-gemini-hooks.json"),
@@ -1162,6 +1172,58 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1162
1172
  }
1163
1173
  }
1164
1174
  // ---------------------------------------------------------------
1175
+ // MCP
1176
+ // ---------------------------------------------------------------
1177
+ async importMcp(imported, errors, onProgress) {
1178
+ const settingsPath = _path2.default.join(this.resolvedHomePath, "settings.json");
1179
+ if (!await _fsextra2.default.pathExists(settingsPath)) {
1180
+ imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
1181
+ return;
1182
+ }
1183
+ _optionalChain([onProgress, 'optionalCall', _25 => _25({
1184
+ category: "mcp",
1185
+ current: 1,
1186
+ total: 1,
1187
+ item: "mcpServers from settings.json",
1188
+ status: "importing"
1189
+ })]);
1190
+ try {
1191
+ const settings = await this.safeReadJson(settingsPath);
1192
+ const mcpServers = this.extractMcpServers(settings);
1193
+ if (!mcpServers || Object.keys(mcpServers).length === 0) {
1194
+ imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
1195
+ return;
1196
+ }
1197
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1198
+ await _fsextra2.default.ensureDir(configDir);
1199
+ await _fsextra2.default.writeJson(
1200
+ _path2.default.join(configDir, "imported-gemini-mcp.json"),
1201
+ {
1202
+ importedFrom: "gemini",
1203
+ importedAt: (/* @__PURE__ */ new Date()).toISOString(),
1204
+ mcpServers
1205
+ },
1206
+ { spaces: 2 }
1207
+ );
1208
+ imported.set("mcp", { success: 1, failed: 0, skipped: 0 });
1209
+ _optionalChain([onProgress, 'optionalCall', _26 => _26({
1210
+ category: "mcp",
1211
+ current: 1,
1212
+ total: 1,
1213
+ item: "mcpServers from settings.json",
1214
+ status: "done"
1215
+ })]);
1216
+ } catch (err) {
1217
+ imported.set("mcp", { success: 0, failed: 1, skipped: 0 });
1218
+ errors.push({
1219
+ category: "mcp",
1220
+ item: "mcpServers from settings.json",
1221
+ error: err instanceof Error ? err.message : String(err),
1222
+ retriable: false
1223
+ });
1224
+ }
1225
+ }
1226
+ // ---------------------------------------------------------------
1165
1227
  // Memory
1166
1228
  // ---------------------------------------------------------------
1167
1229
  async importMemory(imported, errors, onProgress) {
@@ -1170,7 +1232,7 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1170
1232
  imported.set("memory", { success: 0, failed: 0, skipped: 1 });
1171
1233
  return;
1172
1234
  }
1173
- _optionalChain([onProgress, 'optionalCall', _25 => _25({
1235
+ _optionalChain([onProgress, 'optionalCall', _27 => _27({
1174
1236
  category: "memory",
1175
1237
  current: 1,
1176
1238
  total: 1,
@@ -1178,11 +1240,11 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1178
1240
  status: "importing"
1179
1241
  })]);
1180
1242
  try {
1181
- const destDir = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.memory, "imported-gemini");
1243
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.memory, "imported-gemini");
1182
1244
  await _fsextra2.default.ensureDir(destDir);
1183
1245
  await _fsextra2.default.copy(geminiMdPath, _path2.default.join(destDir, "GEMINI.md"));
1184
1246
  imported.set("memory", { success: 1, failed: 0, skipped: 0 });
1185
- _optionalChain([onProgress, 'optionalCall', _26 => _26({
1247
+ _optionalChain([onProgress, 'optionalCall', _28 => _28({
1186
1248
  category: "memory",
1187
1249
  current: 1,
1188
1250
  total: 1,
@@ -1199,6 +1261,20 @@ var GeminiImporter = (_class3 = class extends BaseImporter {constructor(...args3
1199
1261
  });
1200
1262
  }
1201
1263
  }
1264
+ extractMcpServers(settings) {
1265
+ const direct = settings.mcpServers;
1266
+ if (direct && typeof direct === "object" && !Array.isArray(direct)) {
1267
+ return direct;
1268
+ }
1269
+ const mcp = settings.mcp;
1270
+ if (mcp && typeof mcp === "object" && !Array.isArray(mcp)) {
1271
+ const maybeServers = _nullishCoalesce(mcp.servers, () => ( mcp.mcpServers));
1272
+ if (maybeServers && typeof maybeServers === "object" && !Array.isArray(maybeServers)) {
1273
+ return maybeServers;
1274
+ }
1275
+ }
1276
+ return void 0;
1277
+ }
1202
1278
  }, _class3);
1203
1279
 
1204
1280
  // src/import/importers/CursorImporter.ts
@@ -1302,7 +1378,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1302
1378
  }
1303
1379
  const sourcePath = hasCli ? cliConfigPath : hooksPath;
1304
1380
  const sourceFile = hasCli ? "cli-config.json" : "hooks.json";
1305
- _optionalChain([onProgress, 'optionalCall', _27 => _27({
1381
+ _optionalChain([onProgress, 'optionalCall', _29 => _29({
1306
1382
  category: "settings",
1307
1383
  current: 1,
1308
1384
  total: 1,
@@ -1311,7 +1387,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1311
1387
  })]);
1312
1388
  try {
1313
1389
  const data = await this.safeReadJson(sourcePath);
1314
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1390
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1315
1391
  await _fsextra2.default.ensureDir(configDir);
1316
1392
  await _fsextra2.default.writeJson(
1317
1393
  _path2.default.join(configDir, "imported-cursor-settings.json"),
@@ -1324,7 +1400,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1324
1400
  { spaces: 2 }
1325
1401
  );
1326
1402
  imported.set("settings", { success: 1, failed: 0, skipped: 0 });
1327
- _optionalChain([onProgress, 'optionalCall', _28 => _28({
1403
+ _optionalChain([onProgress, 'optionalCall', _30 => _30({
1328
1404
  category: "settings",
1329
1405
  current: 1,
1330
1406
  total: 1,
@@ -1350,7 +1426,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1350
1426
  imported.set("hooks", { success: 0, failed: 0, skipped: 1 });
1351
1427
  return;
1352
1428
  }
1353
- _optionalChain([onProgress, 'optionalCall', _29 => _29({
1429
+ _optionalChain([onProgress, 'optionalCall', _31 => _31({
1354
1430
  category: "hooks",
1355
1431
  current: 1,
1356
1432
  total: 1,
@@ -1359,7 +1435,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1359
1435
  })]);
1360
1436
  try {
1361
1437
  const hooksData = await this.safeReadJson(hooksPath);
1362
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1438
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1363
1439
  await _fsextra2.default.ensureDir(configDir);
1364
1440
  await _fsextra2.default.writeJson(
1365
1441
  _path2.default.join(configDir, "imported-cursor-hooks.json"),
@@ -1371,7 +1447,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1371
1447
  { spaces: 2 }
1372
1448
  );
1373
1449
  imported.set("hooks", { success: 1, failed: 0, skipped: 0 });
1374
- _optionalChain([onProgress, 'optionalCall', _30 => _30({
1450
+ _optionalChain([onProgress, 'optionalCall', _32 => _32({
1375
1451
  category: "hooks",
1376
1452
  current: 1,
1377
1453
  total: 1,
@@ -1397,7 +1473,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1397
1473
  imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
1398
1474
  return;
1399
1475
  }
1400
- _optionalChain([onProgress, 'optionalCall', _31 => _31({
1476
+ _optionalChain([onProgress, 'optionalCall', _33 => _33({
1401
1477
  category: "mcp",
1402
1478
  current: 1,
1403
1479
  total: 1,
@@ -1406,7 +1482,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1406
1482
  })]);
1407
1483
  try {
1408
1484
  const mcpData = await this.safeReadJson(mcpPath);
1409
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1485
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1410
1486
  await _fsextra2.default.ensureDir(configDir);
1411
1487
  await _fsextra2.default.writeJson(
1412
1488
  _path2.default.join(configDir, "imported-cursor-mcp.json"),
@@ -1418,7 +1494,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1418
1494
  { spaces: 2 }
1419
1495
  );
1420
1496
  imported.set("mcp", { success: 1, failed: 0, skipped: 0 });
1421
- _optionalChain([onProgress, 'optionalCall', _32 => _32({
1497
+ _optionalChain([onProgress, 'optionalCall', _34 => _34({
1422
1498
  category: "mcp",
1423
1499
  current: 1,
1424
1500
  total: 1,
@@ -1449,12 +1525,12 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1449
1525
  let success = 0;
1450
1526
  let failed = 0;
1451
1527
  const total = skillDirs.length;
1452
- const destBase = _path2.default.join(_chunkE26KKI46cjs.AUTOHAND_PATHS.skills, "imported-cursor");
1528
+ const destBase = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.skills, "imported-cursor");
1453
1529
  for (let i = 0; i < skillDirs.length; i++) {
1454
1530
  const dir = skillDirs[i];
1455
1531
  const src = _path2.default.join(skillsDir, dir.name);
1456
1532
  const dest = _path2.default.join(destBase, dir.name);
1457
- _optionalChain([onProgress, 'optionalCall', _33 => _33({
1533
+ _optionalChain([onProgress, 'optionalCall', _35 => _35({
1458
1534
  category: "skills",
1459
1535
  current: i + 1,
1460
1536
  total,
@@ -1515,7 +1591,7 @@ var CursorImporter = (_class4 = class extends BaseImporter {constructor(...args4
1515
1591
  for (let i = 0; i < dbPaths.length; i++) {
1516
1592
  const dbPath = dbPaths[i];
1517
1593
  const sessionUuid = _path2.default.basename(_path2.default.dirname(dbPath));
1518
- _optionalChain([onProgress, 'optionalCall', _34 => _34({
1594
+ _optionalChain([onProgress, 'optionalCall', _36 => _36({
1519
1595
  category: "sessions",
1520
1596
  current: i + 1,
1521
1597
  total,
@@ -1742,7 +1818,7 @@ var ClineImporter = (_class5 = class extends BaseImporter {constructor(...args5)
1742
1818
  imported.set("settings", { success: 0, failed: 0, skipped: 1 });
1743
1819
  return;
1744
1820
  }
1745
- _optionalChain([onProgress, 'optionalCall', _35 => _35({
1821
+ _optionalChain([onProgress, 'optionalCall', _37 => _37({
1746
1822
  category: "settings",
1747
1823
  current: 1,
1748
1824
  total: 1,
@@ -1756,7 +1832,7 @@ var ClineImporter = (_class5 = class extends BaseImporter {constructor(...args5)
1756
1832
  if (state.autoApprovalSettings) extracted.autoApproval = state.autoApprovalSettings;
1757
1833
  if (state.browserSettings) extracted.browser = state.browserSettings;
1758
1834
  if (state.workspaceRoots) extracted.workspaceRoots = state.workspaceRoots;
1759
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1835
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1760
1836
  await _fsextra2.default.ensureDir(configDir);
1761
1837
  await _fsextra2.default.writeJson(
1762
1838
  _path2.default.join(configDir, "imported-cline-settings.json"),
@@ -1769,7 +1845,7 @@ var ClineImporter = (_class5 = class extends BaseImporter {constructor(...args5)
1769
1845
  { spaces: 2 }
1770
1846
  );
1771
1847
  imported.set("settings", { success: 1, failed: 0, skipped: 0 });
1772
- _optionalChain([onProgress, 'optionalCall', _36 => _36({
1848
+ _optionalChain([onProgress, 'optionalCall', _38 => _38({
1773
1849
  category: "settings",
1774
1850
  current: 1,
1775
1851
  total: 1,
@@ -1845,7 +1921,7 @@ var ContinueImporter = (_class6 = class extends BaseImporter {constructor(...arg
1845
1921
  imported.set("settings", { success: 0, failed: 0, skipped: 1 });
1846
1922
  return;
1847
1923
  }
1848
- _optionalChain([onProgress, 'optionalCall', _37 => _37({
1924
+ _optionalChain([onProgress, 'optionalCall', _39 => _39({
1849
1925
  category: "settings",
1850
1926
  current: 1,
1851
1927
  total: 1,
@@ -1862,7 +1938,7 @@ var ContinueImporter = (_class6 = class extends BaseImporter {constructor(...arg
1862
1938
  if (config.contextProviders) extracted.contextProviders = config.contextProviders;
1863
1939
  if (config.slashCommands) extracted.slashCommands = config.slashCommands;
1864
1940
  if (config.embeddingsProvider) extracted.embeddingsProvider = config.embeddingsProvider;
1865
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
1941
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1866
1942
  await _fsextra2.default.ensureDir(configDir);
1867
1943
  await _fsextra2.default.writeJson(
1868
1944
  _path2.default.join(configDir, "imported-continue-settings.json"),
@@ -1870,7 +1946,7 @@ var ContinueImporter = (_class6 = class extends BaseImporter {constructor(...arg
1870
1946
  { spaces: 2 }
1871
1947
  );
1872
1948
  imported.set("settings", { success: 1, failed: 0, skipped: 0 });
1873
- _optionalChain([onProgress, 'optionalCall', _38 => _38({
1949
+ _optionalChain([onProgress, 'optionalCall', _40 => _40({
1874
1950
  category: "settings",
1875
1951
  current: 1,
1876
1952
  total: 1,
@@ -1950,7 +2026,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
1950
2026
  imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
1951
2027
  return;
1952
2028
  }
1953
- _optionalChain([onProgress, 'optionalCall', _39 => _39({
2029
+ _optionalChain([onProgress, 'optionalCall', _41 => _41({
1954
2030
  category: "mcp",
1955
2031
  current: 1,
1956
2032
  total: 1,
@@ -1959,7 +2035,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
1959
2035
  })]);
1960
2036
  try {
1961
2037
  const mcpData = await this.safeReadJson(mcpPath);
1962
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
2038
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
1963
2039
  await _fsextra2.default.ensureDir(configDir);
1964
2040
  await _fsextra2.default.writeJson(
1965
2041
  _path2.default.join(configDir, "imported-augment-mcp.json"),
@@ -1971,7 +2047,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
1971
2047
  { spaces: 2 }
1972
2048
  );
1973
2049
  imported.set("mcp", { success: 1, failed: 0, skipped: 0 });
1974
- _optionalChain([onProgress, 'optionalCall', _40 => _40({
2050
+ _optionalChain([onProgress, 'optionalCall', _42 => _42({
1975
2051
  category: "mcp",
1976
2052
  current: 1,
1977
2053
  total: 1,
@@ -1997,7 +2073,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
1997
2073
  imported.set("settings", { success: 0, failed: 0, skipped: 1 });
1998
2074
  return;
1999
2075
  }
2000
- _optionalChain([onProgress, 'optionalCall', _41 => _41({
2076
+ _optionalChain([onProgress, 'optionalCall', _43 => _43({
2001
2077
  category: "settings",
2002
2078
  current: 1,
2003
2079
  total: 1,
@@ -2006,7 +2082,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
2006
2082
  })]);
2007
2083
  try {
2008
2084
  const settings = await this.safeReadJson(settingsPath);
2009
- const configDir = _chunkE26KKI46cjs.AUTOHAND_PATHS.config;
2085
+ const configDir = _chunk3JURXAL6cjs.AUTOHAND_PATHS.config;
2010
2086
  await _fsextra2.default.ensureDir(configDir);
2011
2087
  await _fsextra2.default.writeJson(
2012
2088
  _path2.default.join(configDir, "imported-augment-settings.json"),
@@ -2018,7 +2094,7 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
2018
2094
  { spaces: 2 }
2019
2095
  );
2020
2096
  imported.set("settings", { success: 1, failed: 0, skipped: 0 });
2021
- _optionalChain([onProgress, 'optionalCall', _42 => _42({
2097
+ _optionalChain([onProgress, 'optionalCall', _44 => _44({
2022
2098
  category: "settings",
2023
2099
  current: 1,
2024
2100
  total: 1,
@@ -2037,6 +2113,1266 @@ var AugmentImporter = (_class7 = class extends BaseImporter {constructor(...args
2037
2113
  }
2038
2114
  }, _class7);
2039
2115
 
2116
+ // src/import/importers/OpencodeImporter.ts
2117
+
2118
+
2119
+
2120
+ var OpencodeImporter = (_class8 = class extends BaseImporter {constructor(...args8) { super(...args8); _class8.prototype.__init22.call(this);_class8.prototype.__init23.call(this);_class8.prototype.__init24.call(this); }
2121
+ __init22() {this.name = "opencode"}
2122
+ __init23() {this.displayName = "OpenCode"}
2123
+ __init24() {this.homePath = "~/.config/opencode"}
2124
+ get dataHome() {
2125
+ return _path2.default.join(_os2.default.homedir(), ".local", "share", "opencode");
2126
+ }
2127
+ async detect() {
2128
+ if (await _fsextra2.default.pathExists(this.resolvedHomePath)) return true;
2129
+ if (await _fsextra2.default.pathExists(this.dataHome)) return true;
2130
+ for (const config of this.globalConfigCandidates()) {
2131
+ if (await _fsextra2.default.pathExists(config.path)) return true;
2132
+ }
2133
+ return false;
2134
+ }
2135
+ async scan() {
2136
+ const available = /* @__PURE__ */ new Map();
2137
+ if (!await this.detect()) {
2138
+ return { source: this.name, available };
2139
+ }
2140
+ const settings = await this.existingConfigFiles();
2141
+ if (settings.length > 0) {
2142
+ available.set("settings", {
2143
+ count: settings.length,
2144
+ description: "OpenCode config and TUI settings"
2145
+ });
2146
+ }
2147
+ const mcp = await this.collectMcpServers(settings);
2148
+ if (Object.keys(mcp).length > 0) {
2149
+ available.set("mcp", {
2150
+ count: Object.keys(mcp).length,
2151
+ description: `${Object.keys(mcp).length} OpenCode MCP server${Object.keys(mcp).length !== 1 ? "s" : ""}`
2152
+ });
2153
+ }
2154
+ if (await _fsextra2.default.pathExists(_path2.default.join(this.resolvedHomePath, "AGENTS.md"))) {
2155
+ available.set("memory", { count: 1, description: "OpenCode global AGENTS.md rules" });
2156
+ }
2157
+ const skills = await this.discoverSkillDirs();
2158
+ if (skills.length > 0) {
2159
+ available.set("skills", {
2160
+ count: skills.length,
2161
+ description: `${skills.length} OpenCode skill${skills.length !== 1 ? "s" : ""}`
2162
+ });
2163
+ }
2164
+ const sessionFiles = await this.discoverJsonSessionFiles();
2165
+ const sqlitePath = _path2.default.join(this.dataHome, "opencode.db");
2166
+ const hasSqlite = await _fsextra2.default.pathExists(sqlitePath);
2167
+ if (sessionFiles.length > 0 || hasSqlite) {
2168
+ available.set("sessions", {
2169
+ count: sessionFiles.length + (hasSqlite ? 1 : 0),
2170
+ description: hasSqlite ? "OpenCode session database and JSON session files" : `${sessionFiles.length} OpenCode JSON session${sessionFiles.length !== 1 ? "s" : ""}`
2171
+ });
2172
+ }
2173
+ return { source: this.name, available };
2174
+ }
2175
+ async import(categories, onProgress) {
2176
+ const start = Date.now();
2177
+ const imported = /* @__PURE__ */ new Map();
2178
+ const errors = [];
2179
+ for (const category of categories) {
2180
+ switch (category) {
2181
+ case "sessions":
2182
+ await this.importSessions(imported, errors, onProgress);
2183
+ break;
2184
+ case "settings":
2185
+ await this.importSettings(imported, errors, onProgress);
2186
+ break;
2187
+ case "mcp":
2188
+ await this.importMcp(imported, errors, onProgress);
2189
+ break;
2190
+ case "memory":
2191
+ await this.importMemory(imported, errors, onProgress);
2192
+ break;
2193
+ case "skills":
2194
+ await this.importSkills(imported, errors, onProgress);
2195
+ break;
2196
+ default:
2197
+ break;
2198
+ }
2199
+ }
2200
+ return {
2201
+ source: this.name,
2202
+ imported,
2203
+ errors,
2204
+ duration: Date.now() - start
2205
+ };
2206
+ }
2207
+ async importSettings(imported, errors, onProgress) {
2208
+ const files = await this.existingConfigFiles();
2209
+ if (files.length === 0) {
2210
+ imported.set("settings", { success: 0, failed: 0, skipped: 1 });
2211
+ return;
2212
+ }
2213
+ _optionalChain([onProgress, 'optionalCall', _45 => _45({
2214
+ category: "settings",
2215
+ current: 1,
2216
+ total: 1,
2217
+ item: "OpenCode config files",
2218
+ status: "importing"
2219
+ })]);
2220
+ try {
2221
+ const importedFiles = [];
2222
+ for (const file of files) {
2223
+ const raw = await _fsextra2.default.readFile(file.path, "utf-8");
2224
+ const parsed = this.parseJsonc(raw);
2225
+ importedFiles.push({
2226
+ file: file.file,
2227
+ raw,
2228
+ ...parsed ? { parsed } : {}
2229
+ });
2230
+ }
2231
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config);
2232
+ await _fsextra2.default.writeJson(
2233
+ _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config, "imported-opencode-settings.json"),
2234
+ {
2235
+ importedFrom: "opencode",
2236
+ importedAt: (/* @__PURE__ */ new Date()).toISOString(),
2237
+ files: importedFiles
2238
+ },
2239
+ { spaces: 2 }
2240
+ );
2241
+ imported.set("settings", { success: 1, failed: 0, skipped: 0 });
2242
+ _optionalChain([onProgress, 'optionalCall', _46 => _46({
2243
+ category: "settings",
2244
+ current: 1,
2245
+ total: 1,
2246
+ item: "OpenCode config files",
2247
+ status: "done"
2248
+ })]);
2249
+ } catch (err) {
2250
+ imported.set("settings", { success: 0, failed: 1, skipped: 0 });
2251
+ errors.push({
2252
+ category: "settings",
2253
+ item: "OpenCode config files",
2254
+ error: err instanceof Error ? err.message : String(err),
2255
+ retriable: false
2256
+ });
2257
+ }
2258
+ }
2259
+ async importMcp(imported, errors, onProgress) {
2260
+ const files = await this.existingConfigFiles();
2261
+ if (files.length === 0) {
2262
+ imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
2263
+ return;
2264
+ }
2265
+ _optionalChain([onProgress, 'optionalCall', _47 => _47({
2266
+ category: "mcp",
2267
+ current: 1,
2268
+ total: 1,
2269
+ item: "mcp from opencode config",
2270
+ status: "importing"
2271
+ })]);
2272
+ try {
2273
+ const mcpServers = await this.collectMcpServers(files);
2274
+ if (Object.keys(mcpServers).length === 0) {
2275
+ imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
2276
+ return;
2277
+ }
2278
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config);
2279
+ await _fsextra2.default.writeJson(
2280
+ _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config, "imported-opencode-mcp.json"),
2281
+ {
2282
+ importedFrom: "opencode",
2283
+ importedAt: (/* @__PURE__ */ new Date()).toISOString(),
2284
+ mcpServers
2285
+ },
2286
+ { spaces: 2 }
2287
+ );
2288
+ imported.set("mcp", { success: 1, failed: 0, skipped: 0 });
2289
+ _optionalChain([onProgress, 'optionalCall', _48 => _48({
2290
+ category: "mcp",
2291
+ current: 1,
2292
+ total: 1,
2293
+ item: "mcp from opencode config",
2294
+ status: "done"
2295
+ })]);
2296
+ } catch (err) {
2297
+ imported.set("mcp", { success: 0, failed: 1, skipped: 0 });
2298
+ errors.push({
2299
+ category: "mcp",
2300
+ item: "mcp from opencode config",
2301
+ error: err instanceof Error ? err.message : String(err),
2302
+ retriable: false
2303
+ });
2304
+ }
2305
+ }
2306
+ async importMemory(imported, errors, onProgress) {
2307
+ const agentsPath = _path2.default.join(this.resolvedHomePath, "AGENTS.md");
2308
+ if (!await _fsextra2.default.pathExists(agentsPath)) {
2309
+ imported.set("memory", { success: 0, failed: 0, skipped: 1 });
2310
+ return;
2311
+ }
2312
+ _optionalChain([onProgress, 'optionalCall', _49 => _49({
2313
+ category: "memory",
2314
+ current: 1,
2315
+ total: 1,
2316
+ item: "AGENTS.md",
2317
+ status: "importing"
2318
+ })]);
2319
+ try {
2320
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.memory, "imported-opencode");
2321
+ await _fsextra2.default.ensureDir(destDir);
2322
+ await _fsextra2.default.copy(agentsPath, _path2.default.join(destDir, "AGENTS.md"));
2323
+ imported.set("memory", { success: 1, failed: 0, skipped: 0 });
2324
+ _optionalChain([onProgress, 'optionalCall', _50 => _50({
2325
+ category: "memory",
2326
+ current: 1,
2327
+ total: 1,
2328
+ item: "AGENTS.md",
2329
+ status: "done"
2330
+ })]);
2331
+ } catch (err) {
2332
+ imported.set("memory", { success: 0, failed: 1, skipped: 0 });
2333
+ errors.push({
2334
+ category: "memory",
2335
+ item: "AGENTS.md",
2336
+ error: err instanceof Error ? err.message : String(err),
2337
+ retriable: true
2338
+ });
2339
+ }
2340
+ }
2341
+ async importSkills(imported, errors, onProgress) {
2342
+ const skills = await this.discoverSkillDirs();
2343
+ if (skills.length === 0) {
2344
+ imported.set("skills", { success: 0, failed: 0, skipped: 1 });
2345
+ return;
2346
+ }
2347
+ const destBase = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.skills, "imported-opencode");
2348
+ let success = 0;
2349
+ let failed = 0;
2350
+ for (let i = 0; i < skills.length; i++) {
2351
+ const skill = skills[i];
2352
+ _optionalChain([onProgress, 'optionalCall', _51 => _51({
2353
+ category: "skills",
2354
+ current: i + 1,
2355
+ total: skills.length,
2356
+ item: skill.name,
2357
+ status: "importing"
2358
+ })]);
2359
+ try {
2360
+ await _fsextra2.default.ensureDir(destBase);
2361
+ await _fsextra2.default.copy(skill.path, _path2.default.join(destBase, skill.name));
2362
+ success++;
2363
+ } catch (err) {
2364
+ failed++;
2365
+ errors.push({
2366
+ category: "skills",
2367
+ item: skill.name,
2368
+ error: err instanceof Error ? err.message : String(err),
2369
+ retriable: true
2370
+ });
2371
+ }
2372
+ }
2373
+ imported.set("skills", { success, failed, skipped: 0 });
2374
+ }
2375
+ async importSessions(imported, errors, onProgress) {
2376
+ const jsonSessions = await this.discoverJsonSessionFiles();
2377
+ const sqlitePath = _path2.default.join(this.dataHome, "opencode.db");
2378
+ const hasSqlite = await _fsextra2.default.pathExists(sqlitePath);
2379
+ if (jsonSessions.length === 0 && !hasSqlite) {
2380
+ imported.set("sessions", { success: 0, failed: 0, skipped: 1 });
2381
+ return;
2382
+ }
2383
+ let success = 0;
2384
+ let failed = 0;
2385
+ let skipped = 0;
2386
+ const skipReasons = {};
2387
+ const trackSkip = (reason) => {
2388
+ skipped++;
2389
+ skipReasons[reason] = (_nullishCoalesce(skipReasons[reason], () => ( 0))) + 1;
2390
+ };
2391
+ const total = jsonSessions.length + (hasSqlite ? 1 : 0);
2392
+ for (let i = 0; i < jsonSessions.length; i++) {
2393
+ const sessionFile = jsonSessions[i];
2394
+ _optionalChain([onProgress, 'optionalCall', _52 => _52({
2395
+ category: "sessions",
2396
+ current: i + 1,
2397
+ total,
2398
+ item: sessionFile.sessionId,
2399
+ status: "importing"
2400
+ })]);
2401
+ try {
2402
+ const session = await this.readJsonSession(sessionFile);
2403
+ if (!session || session.messages.length === 0) {
2404
+ trackSkip("no user/assistant messages");
2405
+ continue;
2406
+ }
2407
+ const result = await this.writeAutohandSession({
2408
+ projectPath: session.projectPath,
2409
+ projectName: _path2.default.basename(session.projectPath),
2410
+ model: session.model,
2411
+ messages: session.messages,
2412
+ source: this.name,
2413
+ originalId: session.originalId,
2414
+ createdAt: session.messages[0].timestamp,
2415
+ closedAt: session.messages[session.messages.length - 1].timestamp,
2416
+ summary: session.summary,
2417
+ status: "completed"
2418
+ });
2419
+ if (result === null) {
2420
+ trackSkip("already imported");
2421
+ } else {
2422
+ success++;
2423
+ }
2424
+ } catch (err) {
2425
+ failed++;
2426
+ errors.push({
2427
+ category: "sessions",
2428
+ item: sessionFile.sessionId,
2429
+ error: err instanceof Error ? err.message : String(err),
2430
+ retriable: true
2431
+ });
2432
+ }
2433
+ }
2434
+ if (hasSqlite) {
2435
+ _optionalChain([onProgress, 'optionalCall', _53 => _53({
2436
+ category: "sessions",
2437
+ current: jsonSessions.length + 1,
2438
+ total,
2439
+ item: "opencode.db",
2440
+ status: "importing"
2441
+ })]);
2442
+ try {
2443
+ const sqliteResult = await this.importSqliteSessions(sqlitePath);
2444
+ success += sqliteResult.success;
2445
+ failed += sqliteResult.failed;
2446
+ skipped += sqliteResult.skipped;
2447
+ for (const [reason, count] of Object.entries(sqliteResult.skipReasons)) {
2448
+ skipReasons[reason] = (_nullishCoalesce(skipReasons[reason], () => ( 0))) + count;
2449
+ }
2450
+ errors.push(...sqliteResult.errors);
2451
+ } catch (err) {
2452
+ failed++;
2453
+ errors.push({
2454
+ category: "sessions",
2455
+ item: "opencode.db",
2456
+ error: err instanceof Error ? err.message : String(err),
2457
+ retriable: true
2458
+ });
2459
+ }
2460
+ }
2461
+ imported.set("sessions", {
2462
+ success,
2463
+ failed,
2464
+ skipped,
2465
+ ...Object.keys(skipReasons).length > 0 ? { skipReasons } : {}
2466
+ });
2467
+ }
2468
+ async readJsonSession(sessionFile) {
2469
+ const sessionData = this.asRecord(await _fsextra2.default.readJson(sessionFile.path));
2470
+ const originalId = _nullishCoalesce(this.readString(sessionData, "id"), () => ( sessionFile.sessionId));
2471
+ const projectPath = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.readString(sessionData, "directory"), () => ( this.readString(this.asRecord(sessionData.path), "cwd"))), () => ( this.readString(this.asRecord(sessionData.path), "root"))), () => ( process.cwd()));
2472
+ const model = this.extractModel(sessionData);
2473
+ const summary = _nullishCoalesce(this.readString(sessionData, "title"), () => ( "Imported OpenCode session"));
2474
+ const rawMessages = await this.readJsonMessages(originalId);
2475
+ const messages = rawMessages.map((message) => this.convertStoredMessage(message)).filter((message) => message !== null);
2476
+ if (messages.length === 0) return null;
2477
+ return {
2478
+ originalId,
2479
+ projectPath,
2480
+ model,
2481
+ summary,
2482
+ messages
2483
+ };
2484
+ }
2485
+ async readJsonMessages(sessionId) {
2486
+ const messageDirs = [
2487
+ _path2.default.join(this.dataHome, "storage", "message", sessionId),
2488
+ _path2.default.join(this.dataHome, "storage", "session", "message", sessionId)
2489
+ ];
2490
+ const messages = [];
2491
+ for (const messageDir of messageDirs) {
2492
+ if (!await _fsextra2.default.pathExists(messageDir)) continue;
2493
+ const entries = await this.readDir(messageDir);
2494
+ for (const entry of entries.filter((item) => item.isFile() && item.name.endsWith(".json"))) {
2495
+ const messagePath = _path2.default.join(messageDir, entry.name);
2496
+ const messageData = this.asRecord(await _fsextra2.default.readJson(messagePath));
2497
+ const messageId = _nullishCoalesce(this.readString(messageData, "id"), () => ( _path2.default.basename(entry.name, ".json")));
2498
+ const role = this.normalizeRole(
2499
+ _nullishCoalesce(_nullishCoalesce(this.readString(messageData, "role"), () => ( this.readString(this.asRecord(messageData.data), "role"))), () => ( this.readString(this.asRecord(messageData.info), "role")))
2500
+ );
2501
+ if (!role) continue;
2502
+ const parts = await this.readJsonParts(sessionId, messageId);
2503
+ const content = parts.join("") || this.readString(messageData, "content") || this.readString(this.asRecord(messageData.data), "content") || this.readString(messageData, "text");
2504
+ messages.push({
2505
+ id: messageId,
2506
+ role,
2507
+ timestamp: this.toIsoTimestamp(
2508
+ _nullishCoalesce(_nullishCoalesce(this.asRecord(messageData.time).created, () => ( messageData.time_created)), () => ( this.asRecord(messageData.data).time_created))
2509
+ ),
2510
+ content
2511
+ });
2512
+ }
2513
+ }
2514
+ return messages.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
2515
+ }
2516
+ async readJsonParts(sessionId, messageId) {
2517
+ const partDirs = [
2518
+ _path2.default.join(this.dataHome, "storage", "part", messageId),
2519
+ _path2.default.join(this.dataHome, "storage", "session", "part", sessionId, messageId)
2520
+ ];
2521
+ const parts = [];
2522
+ for (const partDir of partDirs) {
2523
+ if (!await _fsextra2.default.pathExists(partDir)) continue;
2524
+ const entries = await this.readDir(partDir);
2525
+ for (const entry of entries.filter((item) => item.isFile() && item.name.endsWith(".json"))) {
2526
+ const partData = this.asRecord(await _fsextra2.default.readJson(_path2.default.join(partDir, entry.name)));
2527
+ const text = this.extractPartText(partData);
2528
+ if (text) parts.push(text);
2529
+ }
2530
+ }
2531
+ return parts;
2532
+ }
2533
+ async importSqliteSessions(sqlitePath) {
2534
+ let DatabaseSync;
2535
+ try {
2536
+ ({ DatabaseSync } = await Promise.resolve().then(() => _interopRequireWildcard(require("sqlite"))));
2537
+ } catch (e8) {
2538
+ return {
2539
+ success: 0,
2540
+ failed: 0,
2541
+ skipped: 1,
2542
+ skipReasons: { "node:sqlite unavailable": 1 },
2543
+ errors: []
2544
+ };
2545
+ }
2546
+ const db = new DatabaseSync(sqlitePath, { readOnly: true });
2547
+ const errors = [];
2548
+ const skipReasons = {};
2549
+ let success = 0;
2550
+ let failed = 0;
2551
+ let skipped = 0;
2552
+ const trackSkip = (reason) => {
2553
+ skipped++;
2554
+ skipReasons[reason] = (_nullishCoalesce(skipReasons[reason], () => ( 0))) + 1;
2555
+ };
2556
+ try {
2557
+ const sessions = db.prepare(
2558
+ "SELECT id, directory, title, model, time_created, time_updated FROM session ORDER BY time_created ASC"
2559
+ ).all();
2560
+ for (const sessionRow of sessions) {
2561
+ const originalId = this.readString(sessionRow, "id");
2562
+ if (!originalId) {
2563
+ trackSkip("missing session id");
2564
+ continue;
2565
+ }
2566
+ try {
2567
+ const messages = this.readSqliteMessages(db, originalId);
2568
+ if (messages.length === 0) {
2569
+ trackSkip("no user/assistant messages");
2570
+ continue;
2571
+ }
2572
+ const projectPath = _nullishCoalesce(this.readString(sessionRow, "directory"), () => ( process.cwd()));
2573
+ const result = await this.writeAutohandSession({
2574
+ projectPath,
2575
+ projectName: _path2.default.basename(projectPath),
2576
+ model: this.extractModel(sessionRow),
2577
+ messages,
2578
+ source: this.name,
2579
+ originalId,
2580
+ createdAt: messages[0].timestamp,
2581
+ closedAt: messages[messages.length - 1].timestamp,
2582
+ summary: _nullishCoalesce(this.readString(sessionRow, "title"), () => ( this.buildSummary(messages))),
2583
+ status: "completed"
2584
+ });
2585
+ if (result === null) {
2586
+ trackSkip("already imported");
2587
+ } else {
2588
+ success++;
2589
+ }
2590
+ } catch (err) {
2591
+ failed++;
2592
+ errors.push({
2593
+ category: "sessions",
2594
+ item: originalId,
2595
+ error: err instanceof Error ? err.message : String(err),
2596
+ retriable: true
2597
+ });
2598
+ }
2599
+ }
2600
+ } finally {
2601
+ db.close();
2602
+ }
2603
+ return { success, failed, skipped, skipReasons, errors };
2604
+ }
2605
+ readSqliteMessages(db, sessionId) {
2606
+ const messages = db.prepare(
2607
+ "SELECT id, data, time_created FROM message WHERE session_id = ? ORDER BY time_created ASC, id ASC"
2608
+ ).all(sessionId);
2609
+ const converted = [];
2610
+ for (const messageRow of messages) {
2611
+ const data = this.parseStoredJson(messageRow.data);
2612
+ const role = this.normalizeRole(this.readString(data, "role"));
2613
+ if (!role) continue;
2614
+ const messageId = this.readString(messageRow, "id");
2615
+ if (!messageId) continue;
2616
+ const parts = db.prepare(
2617
+ "SELECT data FROM part WHERE message_id = ? ORDER BY time_created ASC, id ASC"
2618
+ ).all(messageId);
2619
+ const content = parts.map((part) => this.extractPartText(this.parseStoredJson(part.data))).filter(Boolean).join("") || this.readString(data, "content") || this.readString(data, "text") || "";
2620
+ if (!content.trim()) continue;
2621
+ converted.push({
2622
+ role,
2623
+ content,
2624
+ timestamp: this.toIsoTimestamp(messageRow.time_created)
2625
+ });
2626
+ }
2627
+ return converted;
2628
+ }
2629
+ async discoverJsonSessionFiles() {
2630
+ const sessionRoot = _path2.default.join(this.dataHome, "storage", "session");
2631
+ if (!await _fsextra2.default.pathExists(sessionRoot)) return [];
2632
+ const projectDirs = await this.readDir(sessionRoot);
2633
+ const files = [];
2634
+ for (const projectDir of projectDirs.filter((entry) => entry.isDirectory())) {
2635
+ if (projectDir.name === "message" || projectDir.name === "part" || projectDir.name === "info") {
2636
+ continue;
2637
+ }
2638
+ const dir = _path2.default.join(sessionRoot, projectDir.name);
2639
+ const entries = await this.readDir(dir);
2640
+ for (const entry of entries.filter((item) => item.isFile() && item.name.endsWith(".json"))) {
2641
+ files.push({
2642
+ path: _path2.default.join(dir, entry.name),
2643
+ projectId: projectDir.name,
2644
+ sessionId: _path2.default.basename(entry.name, ".json")
2645
+ });
2646
+ }
2647
+ }
2648
+ return files;
2649
+ }
2650
+ async existingConfigFiles() {
2651
+ const existing = [];
2652
+ for (const candidate of this.globalConfigCandidates()) {
2653
+ if (await _fsextra2.default.pathExists(candidate.path)) {
2654
+ existing.push(candidate);
2655
+ }
2656
+ }
2657
+ return existing;
2658
+ }
2659
+ globalConfigCandidates() {
2660
+ return [
2661
+ { path: _path2.default.join(this.resolvedHomePath, "opencode.json"), file: "opencode.json" },
2662
+ { path: _path2.default.join(this.resolvedHomePath, "opencode.jsonc"), file: "opencode.jsonc" },
2663
+ { path: _path2.default.join(this.resolvedHomePath, "tui.json"), file: "tui.json" },
2664
+ { path: _path2.default.join(this.resolvedHomePath, "tui.jsonc"), file: "tui.jsonc" },
2665
+ { path: _path2.default.join(this.dataHome, "opencode.json"), file: "legacy-data/opencode.json" },
2666
+ { path: _path2.default.join(this.dataHome, "opencode.jsonc"), file: "legacy-data/opencode.jsonc" },
2667
+ { path: _path2.default.join(_os2.default.homedir(), ".opencode.json"), file: "~/.opencode.json" },
2668
+ { path: _path2.default.join(_os2.default.homedir(), ".opencode.jsonc"), file: "~/.opencode.jsonc" }
2669
+ ];
2670
+ }
2671
+ async discoverSkillDirs() {
2672
+ const skillsDir = _path2.default.join(this.resolvedHomePath, "skills");
2673
+ if (!await _fsextra2.default.pathExists(skillsDir)) return [];
2674
+ const entries = await this.readDir(skillsDir);
2675
+ return entries.filter((entry) => entry.isDirectory()).map((entry) => ({
2676
+ name: entry.name,
2677
+ path: _path2.default.join(skillsDir, entry.name)
2678
+ }));
2679
+ }
2680
+ async collectMcpServers(files) {
2681
+ const combined = {};
2682
+ for (const file of files) {
2683
+ try {
2684
+ const raw = await _fsextra2.default.readFile(file.path, "utf-8");
2685
+ const parsed = this.parseJsonc(raw);
2686
+ const mcp = parsed ? this.asRecord(parsed.mcp) : {};
2687
+ Object.assign(combined, mcp);
2688
+ } catch (e9) {
2689
+ }
2690
+ }
2691
+ return combined;
2692
+ }
2693
+ parseJsonc(content) {
2694
+ try {
2695
+ return this.asRecord(JSON.parse(this.removeTrailingCommas(this.stripJsonComments(content))));
2696
+ } catch (e10) {
2697
+ return void 0;
2698
+ }
2699
+ }
2700
+ stripJsonComments(content) {
2701
+ let output = "";
2702
+ let inString = false;
2703
+ let escaped = false;
2704
+ for (let i = 0; i < content.length; i++) {
2705
+ const char = content[i];
2706
+ const next = content[i + 1];
2707
+ if (inString) {
2708
+ output += char;
2709
+ if (escaped) {
2710
+ escaped = false;
2711
+ } else if (char === "\\") {
2712
+ escaped = true;
2713
+ } else if (char === '"') {
2714
+ inString = false;
2715
+ }
2716
+ continue;
2717
+ }
2718
+ if (char === '"') {
2719
+ inString = true;
2720
+ output += char;
2721
+ continue;
2722
+ }
2723
+ if (char === "/" && next === "/") {
2724
+ while (i < content.length && content[i] !== "\n") i++;
2725
+ output += "\n";
2726
+ continue;
2727
+ }
2728
+ if (char === "/" && next === "*") {
2729
+ i += 2;
2730
+ while (i < content.length && !(content[i] === "*" && content[i + 1] === "/")) i++;
2731
+ i++;
2732
+ continue;
2733
+ }
2734
+ output += char;
2735
+ }
2736
+ return output;
2737
+ }
2738
+ removeTrailingCommas(content) {
2739
+ return content.replace(/,\s*([}\]])/g, "$1");
2740
+ }
2741
+ async readDir(dir) {
2742
+ return await _fsextra2.default.readdir(dir, { withFileTypes: true });
2743
+ }
2744
+ convertStoredMessage(message) {
2745
+ if (!_optionalChain([message, 'access', _54 => _54.content, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()])) return null;
2746
+ return {
2747
+ role: message.role,
2748
+ content: message.content,
2749
+ timestamp: message.timestamp
2750
+ };
2751
+ }
2752
+ normalizeRole(role) {
2753
+ if (role === "user" || role === "assistant" || role === "tool" || role === "system") {
2754
+ return role;
2755
+ }
2756
+ return null;
2757
+ }
2758
+ extractPartText(part) {
2759
+ const type = this.readString(part, "type");
2760
+ if (type && !["text", "reasoning"].includes(type)) return "";
2761
+ const text = _nullishCoalesce(this.readString(part, "text"), () => ( this.readString(this.asRecord(part.data), "text")));
2762
+ return _nullishCoalesce(text, () => ( ""));
2763
+ }
2764
+ extractModel(record) {
2765
+ const direct = this.readString(record, "model");
2766
+ if (direct) return direct;
2767
+ const model = this.parseStoredJson(record.model);
2768
+ const providerId = _nullishCoalesce(this.readString(model, "providerID"), () => ( this.readString(model, "provider_id")));
2769
+ const modelId = _nullishCoalesce(this.readString(model, "id"), () => ( this.readString(model, "model")));
2770
+ if (providerId && modelId) return `${providerId}/${modelId}`;
2771
+ if (modelId) return modelId;
2772
+ return "opencode";
2773
+ }
2774
+ parseStoredJson(value) {
2775
+ if (typeof value === "string") {
2776
+ try {
2777
+ return this.asRecord(JSON.parse(value));
2778
+ } catch (e11) {
2779
+ return {};
2780
+ }
2781
+ }
2782
+ return this.asRecord(value);
2783
+ }
2784
+ toIsoTimestamp(value) {
2785
+ if (typeof value === "number" && Number.isFinite(value)) {
2786
+ const milliseconds = value > 1e10 ? value : value * 1e3;
2787
+ return new Date(milliseconds).toISOString();
2788
+ }
2789
+ if (typeof value === "string" && value.trim()) {
2790
+ const time = Date.parse(value);
2791
+ return Number.isNaN(time) ? (/* @__PURE__ */ new Date()).toISOString() : new Date(time).toISOString();
2792
+ }
2793
+ return (/* @__PURE__ */ new Date()).toISOString();
2794
+ }
2795
+ buildSummary(messages) {
2796
+ const firstUser = messages.find((message) => message.role === "user");
2797
+ if (!firstUser) return "Imported OpenCode session";
2798
+ const text = firstUser.content.trim().slice(0, 100);
2799
+ return text.length < firstUser.content.trim().length ? `${text}...` : text;
2800
+ }
2801
+ readString(record, key) {
2802
+ const obj = this.asRecord(record);
2803
+ const value = obj[key];
2804
+ return typeof value === "string" ? value : void 0;
2805
+ }
2806
+ asRecord(value) {
2807
+ if (value && typeof value === "object" && !Array.isArray(value)) {
2808
+ return value;
2809
+ }
2810
+ return {};
2811
+ }
2812
+ }, _class8);
2813
+
2814
+ // src/import/importers/KimiImporter.ts
2815
+
2816
+
2817
+ var KimiImporter = (_class9 = class extends BaseImporter {constructor(...args9) { super(...args9); _class9.prototype.__init25.call(this);_class9.prototype.__init26.call(this);_class9.prototype.__init27.call(this); }
2818
+ __init25() {this.name = "kimi"}
2819
+ __init26() {this.displayName = "Kimi CLI"}
2820
+ __init27() {this.homePath = "~/.kimi"}
2821
+ async scan() {
2822
+ const available = /* @__PURE__ */ new Map();
2823
+ const home = this.resolvedHomePath;
2824
+ if (!await _fsextra2.default.pathExists(home)) {
2825
+ return { source: this.name, available };
2826
+ }
2827
+ const configPath = _path2.default.join(home, "config.toml");
2828
+ const metadataPath = _path2.default.join(home, "kimi.json");
2829
+ const settingsCount = await this.countExisting([configPath, metadataPath]);
2830
+ if (settingsCount > 0) {
2831
+ available.set("settings", {
2832
+ count: settingsCount,
2833
+ description: "Kimi config.toml and runtime metadata"
2834
+ });
2835
+ }
2836
+ if (await _fsextra2.default.pathExists(_path2.default.join(home, "mcp.json"))) {
2837
+ available.set("mcp", { count: 1, description: "Kimi MCP server configuration" });
2838
+ }
2839
+ if (await _fsextra2.default.pathExists(_path2.default.join(home, "AGENTS.md"))) {
2840
+ available.set("memory", { count: 1, description: "Kimi global AGENTS.md instructions" });
2841
+ }
2842
+ const skills = await this.discoverSkillDirs();
2843
+ if (skills.length > 0) {
2844
+ available.set("skills", {
2845
+ count: skills.length,
2846
+ description: `${skills.length} Kimi skill${skills.length !== 1 ? "s" : ""}`
2847
+ });
2848
+ }
2849
+ const sessions = await this.discoverSessionDirs();
2850
+ if (sessions.length > 0) {
2851
+ available.set("sessions", {
2852
+ count: sessions.length,
2853
+ description: `${sessions.length} Kimi session${sessions.length !== 1 ? "s" : ""}`
2854
+ });
2855
+ }
2856
+ if (await _fsextra2.default.pathExists(configPath)) {
2857
+ try {
2858
+ const config = await _fsextra2.default.readFile(configPath, "utf-8");
2859
+ const hooks = this.extractTomlArraySections(config, "hooks");
2860
+ if (hooks.length > 0) {
2861
+ available.set("hooks", {
2862
+ count: hooks.length,
2863
+ description: `${hooks.length} Kimi hook${hooks.length !== 1 ? "s" : ""}`
2864
+ });
2865
+ }
2866
+ } catch (e12) {
2867
+ }
2868
+ }
2869
+ return { source: this.name, available };
2870
+ }
2871
+ async import(categories, onProgress) {
2872
+ const start = Date.now();
2873
+ const imported = /* @__PURE__ */ new Map();
2874
+ const errors = [];
2875
+ for (const category of categories) {
2876
+ switch (category) {
2877
+ case "sessions":
2878
+ await this.importSessions(imported, errors, onProgress);
2879
+ break;
2880
+ case "settings":
2881
+ await this.importSettings(imported, errors, onProgress);
2882
+ break;
2883
+ case "mcp":
2884
+ await this.importMcp(imported, errors, onProgress);
2885
+ break;
2886
+ case "memory":
2887
+ await this.importMemory(imported, errors, onProgress);
2888
+ break;
2889
+ case "skills":
2890
+ await this.importSkills(imported, errors, onProgress);
2891
+ break;
2892
+ case "hooks":
2893
+ await this.importHooks(imported, errors, onProgress);
2894
+ break;
2895
+ default:
2896
+ break;
2897
+ }
2898
+ }
2899
+ return {
2900
+ source: this.name,
2901
+ imported,
2902
+ errors,
2903
+ duration: Date.now() - start
2904
+ };
2905
+ }
2906
+ async importSettings(imported, errors, onProgress) {
2907
+ const configPath = _path2.default.join(this.resolvedHomePath, "config.toml");
2908
+ const metadataPath = _path2.default.join(this.resolvedHomePath, "kimi.json");
2909
+ const hasConfig = await _fsextra2.default.pathExists(configPath);
2910
+ const hasMetadata = await _fsextra2.default.pathExists(metadataPath);
2911
+ if (!hasConfig && !hasMetadata) {
2912
+ imported.set("settings", { success: 0, failed: 0, skipped: 1 });
2913
+ return;
2914
+ }
2915
+ _optionalChain([onProgress, 'optionalCall', _57 => _57({
2916
+ category: "settings",
2917
+ current: 1,
2918
+ total: 1,
2919
+ item: "config.toml / kimi.json",
2920
+ status: "importing"
2921
+ })]);
2922
+ try {
2923
+ const output = {
2924
+ importedFrom: "kimi",
2925
+ importedAt: (/* @__PURE__ */ new Date()).toISOString()
2926
+ };
2927
+ if (hasConfig) {
2928
+ const raw = await _fsextra2.default.readFile(configPath, "utf-8");
2929
+ output.configToml = raw;
2930
+ output.parsed = this.parseToml(raw);
2931
+ }
2932
+ if (hasMetadata) {
2933
+ output.metadata = await this.safeReadJson(metadataPath);
2934
+ }
2935
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config);
2936
+ await _fsextra2.default.writeJson(_path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config, "imported-kimi-settings.json"), output, {
2937
+ spaces: 2
2938
+ });
2939
+ imported.set("settings", { success: 1, failed: 0, skipped: 0 });
2940
+ _optionalChain([onProgress, 'optionalCall', _58 => _58({
2941
+ category: "settings",
2942
+ current: 1,
2943
+ total: 1,
2944
+ item: "config.toml / kimi.json",
2945
+ status: "done"
2946
+ })]);
2947
+ } catch (err) {
2948
+ imported.set("settings", { success: 0, failed: 1, skipped: 0 });
2949
+ errors.push({
2950
+ category: "settings",
2951
+ item: "config.toml / kimi.json",
2952
+ error: err instanceof Error ? err.message : String(err),
2953
+ retriable: false
2954
+ });
2955
+ }
2956
+ }
2957
+ async importMcp(imported, errors, onProgress) {
2958
+ const mcpPath = _path2.default.join(this.resolvedHomePath, "mcp.json");
2959
+ if (!await _fsextra2.default.pathExists(mcpPath)) {
2960
+ imported.set("mcp", { success: 0, failed: 0, skipped: 1 });
2961
+ return;
2962
+ }
2963
+ _optionalChain([onProgress, 'optionalCall', _59 => _59({
2964
+ category: "mcp",
2965
+ current: 1,
2966
+ total: 1,
2967
+ item: "mcp.json",
2968
+ status: "importing"
2969
+ })]);
2970
+ try {
2971
+ const mcpData = await this.safeReadJson(mcpPath);
2972
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config);
2973
+ await _fsextra2.default.writeJson(
2974
+ _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config, "imported-kimi-mcp.json"),
2975
+ {
2976
+ importedFrom: "kimi",
2977
+ importedAt: (/* @__PURE__ */ new Date()).toISOString(),
2978
+ mcpServers: _nullishCoalesce(this.extractMcpServers(mcpData), () => ( mcpData))
2979
+ },
2980
+ { spaces: 2 }
2981
+ );
2982
+ imported.set("mcp", { success: 1, failed: 0, skipped: 0 });
2983
+ _optionalChain([onProgress, 'optionalCall', _60 => _60({
2984
+ category: "mcp",
2985
+ current: 1,
2986
+ total: 1,
2987
+ item: "mcp.json",
2988
+ status: "done"
2989
+ })]);
2990
+ } catch (err) {
2991
+ imported.set("mcp", { success: 0, failed: 1, skipped: 0 });
2992
+ errors.push({
2993
+ category: "mcp",
2994
+ item: "mcp.json",
2995
+ error: err instanceof Error ? err.message : String(err),
2996
+ retriable: false
2997
+ });
2998
+ }
2999
+ }
3000
+ async importMemory(imported, errors, onProgress) {
3001
+ const agentsPath = _path2.default.join(this.resolvedHomePath, "AGENTS.md");
3002
+ if (!await _fsextra2.default.pathExists(agentsPath)) {
3003
+ imported.set("memory", { success: 0, failed: 0, skipped: 1 });
3004
+ return;
3005
+ }
3006
+ _optionalChain([onProgress, 'optionalCall', _61 => _61({
3007
+ category: "memory",
3008
+ current: 1,
3009
+ total: 1,
3010
+ item: "AGENTS.md",
3011
+ status: "importing"
3012
+ })]);
3013
+ try {
3014
+ const destDir = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.memory, "imported-kimi");
3015
+ await _fsextra2.default.ensureDir(destDir);
3016
+ await _fsextra2.default.copy(agentsPath, _path2.default.join(destDir, "AGENTS.md"));
3017
+ imported.set("memory", { success: 1, failed: 0, skipped: 0 });
3018
+ _optionalChain([onProgress, 'optionalCall', _62 => _62({
3019
+ category: "memory",
3020
+ current: 1,
3021
+ total: 1,
3022
+ item: "AGENTS.md",
3023
+ status: "done"
3024
+ })]);
3025
+ } catch (err) {
3026
+ imported.set("memory", { success: 0, failed: 1, skipped: 0 });
3027
+ errors.push({
3028
+ category: "memory",
3029
+ item: "AGENTS.md",
3030
+ error: err instanceof Error ? err.message : String(err),
3031
+ retriable: true
3032
+ });
3033
+ }
3034
+ }
3035
+ async importSkills(imported, errors, onProgress) {
3036
+ const skills = await this.discoverSkillDirs();
3037
+ if (skills.length === 0) {
3038
+ imported.set("skills", { success: 0, failed: 0, skipped: 1 });
3039
+ return;
3040
+ }
3041
+ const destBase = _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.skills, "imported-kimi");
3042
+ let success = 0;
3043
+ let failed = 0;
3044
+ for (let i = 0; i < skills.length; i++) {
3045
+ const skill = skills[i];
3046
+ _optionalChain([onProgress, 'optionalCall', _63 => _63({
3047
+ category: "skills",
3048
+ current: i + 1,
3049
+ total: skills.length,
3050
+ item: skill.name,
3051
+ status: "importing"
3052
+ })]);
3053
+ try {
3054
+ await _fsextra2.default.ensureDir(destBase);
3055
+ await _fsextra2.default.copy(skill.path, _path2.default.join(destBase, skill.name));
3056
+ success++;
3057
+ } catch (err) {
3058
+ failed++;
3059
+ errors.push({
3060
+ category: "skills",
3061
+ item: skill.name,
3062
+ error: err instanceof Error ? err.message : String(err),
3063
+ retriable: true
3064
+ });
3065
+ }
3066
+ }
3067
+ imported.set("skills", { success, failed, skipped: 0 });
3068
+ }
3069
+ async importHooks(imported, errors, onProgress) {
3070
+ const configPath = _path2.default.join(this.resolvedHomePath, "config.toml");
3071
+ if (!await _fsextra2.default.pathExists(configPath)) {
3072
+ imported.set("hooks", { success: 0, failed: 0, skipped: 1 });
3073
+ return;
3074
+ }
3075
+ _optionalChain([onProgress, 'optionalCall', _64 => _64({
3076
+ category: "hooks",
3077
+ current: 1,
3078
+ total: 1,
3079
+ item: "hooks from config.toml",
3080
+ status: "importing"
3081
+ })]);
3082
+ try {
3083
+ const config = await _fsextra2.default.readFile(configPath, "utf-8");
3084
+ const hooks = this.extractTomlArraySections(config, "hooks");
3085
+ if (hooks.length === 0) {
3086
+ imported.set("hooks", { success: 0, failed: 0, skipped: 1 });
3087
+ return;
3088
+ }
3089
+ await _fsextra2.default.ensureDir(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config);
3090
+ await _fsextra2.default.writeJson(
3091
+ _path2.default.join(_chunk3JURXAL6cjs.AUTOHAND_PATHS.config, "imported-kimi-hooks.json"),
3092
+ {
3093
+ importedFrom: "kimi",
3094
+ importedAt: (/* @__PURE__ */ new Date()).toISOString(),
3095
+ hooksToml: hooks.join("\n\n")
3096
+ },
3097
+ { spaces: 2 }
3098
+ );
3099
+ imported.set("hooks", { success: 1, failed: 0, skipped: 0 });
3100
+ _optionalChain([onProgress, 'optionalCall', _65 => _65({
3101
+ category: "hooks",
3102
+ current: 1,
3103
+ total: 1,
3104
+ item: "hooks from config.toml",
3105
+ status: "done"
3106
+ })]);
3107
+ } catch (err) {
3108
+ imported.set("hooks", { success: 0, failed: 1, skipped: 0 });
3109
+ errors.push({
3110
+ category: "hooks",
3111
+ item: "hooks from config.toml",
3112
+ error: err instanceof Error ? err.message : String(err),
3113
+ retriable: false
3114
+ });
3115
+ }
3116
+ }
3117
+ async importSessions(imported, errors, onProgress) {
3118
+ const sessions = await this.discoverSessionDirs();
3119
+ if (sessions.length === 0) {
3120
+ imported.set("sessions", { success: 0, failed: 0, skipped: 1 });
3121
+ return;
3122
+ }
3123
+ let success = 0;
3124
+ let failed = 0;
3125
+ let skipped = 0;
3126
+ const skipReasons = {};
3127
+ const trackSkip = (reason) => {
3128
+ skipped++;
3129
+ skipReasons[reason] = (_nullishCoalesce(skipReasons[reason], () => ( 0))) + 1;
3130
+ };
3131
+ for (let i = 0; i < sessions.length; i++) {
3132
+ const session = sessions[i];
3133
+ _optionalChain([onProgress, 'optionalCall', _66 => _66({
3134
+ category: "sessions",
3135
+ current: i + 1,
3136
+ total: sessions.length,
3137
+ item: session.sessionId,
3138
+ status: "importing"
3139
+ })]);
3140
+ try {
3141
+ const importedSession = await this.readKimiSession(session);
3142
+ if (!importedSession || importedSession.messages.length === 0) {
3143
+ trackSkip("no user/assistant messages");
3144
+ continue;
3145
+ }
3146
+ const result = await this.writeAutohandSession({
3147
+ projectPath: importedSession.projectPath,
3148
+ projectName: _path2.default.basename(importedSession.projectPath),
3149
+ model: importedSession.model,
3150
+ messages: importedSession.messages,
3151
+ source: this.name,
3152
+ originalId: session.sessionId,
3153
+ createdAt: importedSession.messages[0].timestamp,
3154
+ closedAt: importedSession.messages[importedSession.messages.length - 1].timestamp,
3155
+ summary: importedSession.summary,
3156
+ status: "completed"
3157
+ });
3158
+ if (result === null) {
3159
+ trackSkip("already imported");
3160
+ } else {
3161
+ success++;
3162
+ }
3163
+ } catch (err) {
3164
+ failed++;
3165
+ errors.push({
3166
+ category: "sessions",
3167
+ item: session.sessionId,
3168
+ error: err instanceof Error ? err.message : String(err),
3169
+ retriable: true
3170
+ });
3171
+ }
3172
+ }
3173
+ imported.set("sessions", {
3174
+ success,
3175
+ failed,
3176
+ skipped,
3177
+ ...Object.keys(skipReasons).length > 0 ? { skipReasons } : {}
3178
+ });
3179
+ }
3180
+ async readKimiSession(session) {
3181
+ const contextPath = _path2.default.join(session.dir, "context.jsonl");
3182
+ const records = await this.readJsonlFile(contextPath);
3183
+ const state = await this.readOptionalJson(_path2.default.join(session.dir, "state.json"));
3184
+ const config = await this.readOptionalConfig();
3185
+ const messages = [];
3186
+ for (const record of records) {
3187
+ const role = this.normalizeRole(this.readString(record, "role"));
3188
+ if (!role) continue;
3189
+ const content = this.extractMessageContent(_nullishCoalesce(record.content, () => ( record.message)));
3190
+ if (!content.trim()) continue;
3191
+ messages.push({
3192
+ role,
3193
+ content,
3194
+ timestamp: this.toIsoTimestamp(_nullishCoalesce(_nullishCoalesce(record.timestamp, () => ( record.time)), () => ( record.created_at)))
3195
+ });
3196
+ }
3197
+ if (messages.length === 0) return null;
3198
+ const projectPath = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.readString(state, "cwd"), () => ( this.readString(state, "work_dir"))), () => ( this.readString(state, "workDir"))), () => ( this.readString(state, "directory"))), () => ( this.readString(state, "projectPath"))), () => ( process.cwd()));
3199
+ const title = this.readString(state, "title");
3200
+ const model = _nullishCoalesce(_nullishCoalesce(this.readString(state, "model"), () => ( this.readString(config, "default_model"))), () => ( "kimi"));
3201
+ return {
3202
+ projectPath,
3203
+ model,
3204
+ summary: _optionalChain([title, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]) || this.buildSummary(messages),
3205
+ messages
3206
+ };
3207
+ }
3208
+ async discoverSessionDirs() {
3209
+ const sessionsDir = _path2.default.join(this.resolvedHomePath, "sessions");
3210
+ if (!await _fsextra2.default.pathExists(sessionsDir)) return [];
3211
+ const workDirs = await this.readDir(sessionsDir);
3212
+ const sessions = [];
3213
+ for (const workDir of workDirs.filter((entry) => entry.isDirectory())) {
3214
+ const workDirPath = _path2.default.join(sessionsDir, workDir.name);
3215
+ const sessionDirs = await this.readDir(workDirPath);
3216
+ for (const sessionDir of sessionDirs.filter((entry) => entry.isDirectory())) {
3217
+ const dir = _path2.default.join(workDirPath, sessionDir.name);
3218
+ if (await _fsextra2.default.pathExists(_path2.default.join(dir, "context.jsonl"))) {
3219
+ sessions.push({ dir, workDirHash: workDir.name, sessionId: sessionDir.name });
3220
+ }
3221
+ }
3222
+ }
3223
+ return sessions;
3224
+ }
3225
+ async discoverSkillDirs() {
3226
+ const skillsDir = _path2.default.join(this.resolvedHomePath, "skills");
3227
+ if (!await _fsextra2.default.pathExists(skillsDir)) return [];
3228
+ const entries = await this.readDir(skillsDir);
3229
+ return entries.filter((entry) => entry.isDirectory()).map((entry) => ({
3230
+ name: entry.name,
3231
+ path: _path2.default.join(skillsDir, entry.name)
3232
+ }));
3233
+ }
3234
+ async readDir(dir) {
3235
+ return await _fsextra2.default.readdir(dir, { withFileTypes: true });
3236
+ }
3237
+ async countExisting(paths) {
3238
+ let count = 0;
3239
+ for (const candidate of paths) {
3240
+ if (await _fsextra2.default.pathExists(candidate)) count++;
3241
+ }
3242
+ return count;
3243
+ }
3244
+ async readOptionalJson(filePath) {
3245
+ if (!await _fsextra2.default.pathExists(filePath)) return {};
3246
+ try {
3247
+ const json = await _fsextra2.default.readJson(filePath);
3248
+ return this.asRecord(json);
3249
+ } catch (e13) {
3250
+ return {};
3251
+ }
3252
+ }
3253
+ async readOptionalConfig() {
3254
+ const configPath = _path2.default.join(this.resolvedHomePath, "config.toml");
3255
+ if (!await _fsextra2.default.pathExists(configPath)) return {};
3256
+ try {
3257
+ const raw = await _fsextra2.default.readFile(configPath, "utf-8");
3258
+ return this.parseToml(raw);
3259
+ } catch (e14) {
3260
+ return {};
3261
+ }
3262
+ }
3263
+ parseToml(content) {
3264
+ const result = {};
3265
+ let currentSection = "";
3266
+ for (const rawLine of content.split("\n")) {
3267
+ const line = rawLine.trim();
3268
+ if (!line || line.startsWith("#") || line.startsWith("[[")) continue;
3269
+ const sectionMatch = line.match(/^\[([^\]]+)\]$/);
3270
+ if (sectionMatch) {
3271
+ currentSection = sectionMatch[1];
3272
+ continue;
3273
+ }
3274
+ const kvMatch = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*(.+)$/);
3275
+ if (!kvMatch) continue;
3276
+ const key = currentSection ? `${currentSection}.${kvMatch[1]}` : kvMatch[1];
3277
+ let value = kvMatch[2].trim();
3278
+ const inlineComment = value.indexOf(" #");
3279
+ if (inlineComment > 0) {
3280
+ value = value.slice(0, inlineComment).trim();
3281
+ }
3282
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
3283
+ result[key] = value.slice(1, -1);
3284
+ } else if (value === "true") {
3285
+ result[key] = true;
3286
+ } else if (value === "false") {
3287
+ result[key] = false;
3288
+ } else if (/^-?\d+(\.\d+)?$/.test(value)) {
3289
+ result[key] = Number(value);
3290
+ } else {
3291
+ result[key] = value;
3292
+ }
3293
+ }
3294
+ return result;
3295
+ }
3296
+ extractTomlArraySections(content, sectionName) {
3297
+ const header = `[[${sectionName}]]`;
3298
+ const blocks = [];
3299
+ let current = null;
3300
+ for (const rawLine of content.split("\n")) {
3301
+ const line = rawLine.trim();
3302
+ if (line === header) {
3303
+ if (current && current.length > 0) blocks.push(current.join("\n").trim());
3304
+ current = [rawLine];
3305
+ continue;
3306
+ }
3307
+ if (current) {
3308
+ if (line.startsWith("[[") && line !== header) {
3309
+ blocks.push(current.join("\n").trim());
3310
+ current = null;
3311
+ } else {
3312
+ current.push(rawLine);
3313
+ }
3314
+ }
3315
+ }
3316
+ if (current && current.length > 0) blocks.push(current.join("\n").trim());
3317
+ return blocks.filter((block) => block.length > 0);
3318
+ }
3319
+ extractMcpServers(data) {
3320
+ const direct = data.mcpServers;
3321
+ if (direct && typeof direct === "object" && !Array.isArray(direct)) {
3322
+ return direct;
3323
+ }
3324
+ return void 0;
3325
+ }
3326
+ normalizeRole(role) {
3327
+ if (!role || role.startsWith("_")) return null;
3328
+ if (role === "model") return "assistant";
3329
+ if (role === "user" || role === "assistant" || role === "tool" || role === "system") {
3330
+ return role;
3331
+ }
3332
+ return null;
3333
+ }
3334
+ extractMessageContent(content) {
3335
+ if (typeof content === "string") return content;
3336
+ if (Array.isArray(content)) {
3337
+ return content.map((item) => this.extractMessageContent(item)).filter(Boolean).join("");
3338
+ }
3339
+ const record = this.asRecord(content);
3340
+ if (record) {
3341
+ const text = _nullishCoalesce(this.readString(record, "text"), () => ( this.readString(record, "content")));
3342
+ if (text) return text;
3343
+ }
3344
+ return "";
3345
+ }
3346
+ toIsoTimestamp(value) {
3347
+ if (typeof value === "string" && value.trim()) {
3348
+ const time = Date.parse(value);
3349
+ return Number.isNaN(time) ? (/* @__PURE__ */ new Date()).toISOString() : new Date(time).toISOString();
3350
+ }
3351
+ if (typeof value === "number" && Number.isFinite(value)) {
3352
+ const milliseconds = value > 1e10 ? value : value * 1e3;
3353
+ return new Date(milliseconds).toISOString();
3354
+ }
3355
+ return (/* @__PURE__ */ new Date()).toISOString();
3356
+ }
3357
+ buildSummary(messages) {
3358
+ const firstUser = messages.find((message) => message.role === "user");
3359
+ if (!firstUser) return "Imported Kimi session";
3360
+ const text = firstUser.content.trim().slice(0, 100);
3361
+ return text.length < firstUser.content.trim().length ? `${text}...` : text;
3362
+ }
3363
+ readString(record, key) {
3364
+ const obj = this.asRecord(record);
3365
+ const value = _optionalChain([obj, 'optionalAccess', _69 => _69[key]]);
3366
+ return typeof value === "string" ? value : void 0;
3367
+ }
3368
+ asRecord(value) {
3369
+ if (value && typeof value === "object" && !Array.isArray(value)) {
3370
+ return value;
3371
+ }
3372
+ return {};
3373
+ }
3374
+ }, _class9);
3375
+
2040
3376
  // src/import/registry.ts
2041
3377
  var ImporterRegistry = class {
2042
3378
 
@@ -2049,6 +3385,8 @@ var ImporterRegistry = class {
2049
3385
  this.register(new ClineImporter());
2050
3386
  this.register(new ContinueImporter());
2051
3387
  this.register(new AugmentImporter());
3388
+ this.register(new OpencodeImporter());
3389
+ this.register(new KimiImporter());
2052
3390
  }
2053
3391
  /**
2054
3392
  * Register an importer instance by its source name.