autohand-cli 0.9.0 → 0.9.1

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 (414) hide show
  1. package/README.md +20 -2
  2. package/dist/{AgentRegistry-XPWSVO3Q.js → AgentRegistry-GOV7FN2O.js} +2 -2
  3. package/dist/AgentRegistry-J2C6JBZ3.cjs +10 -0
  4. package/dist/CommunitySkillsCache-22BB3J6H.cjs +8 -0
  5. package/dist/{CommunitySkillsCache-ZEQWP6YM.js → CommunitySkillsCache-ZACDPD4J.js} +2 -2
  6. package/dist/{HookManager-CWLTFKWO.js → HookManager-2S6AHOC3.js} +1 -1
  7. package/dist/{HookManager-TMAJQU4S.cjs → HookManager-TVEQI5ZU.cjs} +2 -2
  8. package/dist/{ImportWizard-QBKQEXDW.js → ImportWizard-AEBMAKXE.js} +4 -4
  9. package/dist/{ImportWizard-MQXEED2U.cjs → ImportWizard-AF2XL6DS.cjs} +13 -13
  10. package/dist/LearnAdvisor-KKEQ5QCV.js +9 -0
  11. package/dist/LearnAdvisor-Q7RAYLPF.cjs +9 -0
  12. package/dist/MemoryManager-PMNAEZMB.cjs +8 -0
  13. package/dist/{MemoryManager-WJMLPWGU.js → MemoryManager-QZRLTUB5.js} +2 -2
  14. package/dist/NVIDIAProvider-C3FWQOBZ.cjs +14 -0
  15. package/dist/{NVIDIAProvider-2HR737UE.js → NVIDIAProvider-SJPY3ONR.js} +1 -1
  16. package/dist/{PermissionManager-KMYILJ4Z.js → PermissionManager-MT7KBNNR.js} +3 -3
  17. package/dist/PermissionManager-URCNP5EC.cjs +11 -0
  18. package/dist/ProviderFactory-56N3ECE4.cjs +12 -0
  19. package/dist/{ProviderFactory-HFPRVQ25.js → ProviderFactory-RB4RVAF6.js} +3 -2
  20. package/dist/SessionManager-2IZGWASQ.cjs +10 -0
  21. package/dist/{SessionManager-PNBTJJTQ.js → SessionManager-554PHVPC.js} +2 -2
  22. package/dist/SkillsRegistry-GMRVONOQ.cjs +9 -0
  23. package/dist/{SkillsRegistry-4RRD5GMX.js → SkillsRegistry-NHHMIUYJ.js} +2 -2
  24. package/dist/SubAgent-4GOR2FIJ.js +13 -0
  25. package/dist/SubAgent-ZJMDH4FI.cjs +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-3USFSGOH.js} +5 -4
  29. package/dist/about-QR52U5DD.cjs +15 -0
  30. package/dist/{acp-VHEL7BOW.js → acp-5Y2W6OZP.js} +129 -90
  31. package/dist/{acp-EOETGAHC.cjs → acp-GSYE75OB.cjs} +135 -96
  32. package/dist/actionExecutor-KHUU3Z3Q.cjs +28 -0
  33. package/dist/{actionExecutor-33I47NZS.js → actionExecutor-PLQJZLZV.js} +12 -8
  34. package/dist/add-dir-BTAD5OZS.cjs +11 -0
  35. package/dist/{add-dir-VFX7QT4E.js → add-dir-HCERJDBR.js} +2 -2
  36. package/dist/agent-B3EVT7NN.cjs +126 -0
  37. package/dist/agent-SATQ3WZ3.js +126 -0
  38. package/dist/agents-44CRJGM7.cjs +18 -0
  39. package/dist/agents-NN4ZAJ7R.js +18 -0
  40. package/dist/agents-new-6D6G4QS6.cjs +17 -0
  41. package/dist/agents-new-7GAQ25EK.js +17 -0
  42. package/dist/{autoSkill-EFMK6WU6.js → autoSkill-66PKCYTW.js} +2 -2
  43. package/dist/autoSkill-VQLGBELN.cjs +20 -0
  44. package/dist/automode-45DWV4TN.cjs +10 -0
  45. package/dist/{automode-BMYSRM34.js → automode-BUF3VGXU.js} +2 -2
  46. package/dist/chrome-Q2U73HZB.cjs +50 -0
  47. package/dist/chrome-Q54OALOK.cjs +21 -0
  48. package/dist/{chrome-NHJ44WUN.js → chrome-Y3T7EIHG.js} +2 -2
  49. package/dist/chrome-ZNJ46OYW.js +21 -0
  50. package/dist/{chunk-D2OSPLYC.cjs → chunk-22SCR3EV.cjs} +2 -2
  51. package/dist/chunk-26G7YGOW.js +367 -0
  52. package/dist/{chunk-75EDROHL.cjs → chunk-2ESQR35E.cjs} +10 -10
  53. package/dist/{chunk-HKYZSUQ5.js → chunk-2IW5YFJ4.js} +4 -4
  54. package/dist/{chunk-JP3YHTQ2.cjs → chunk-3ICORF7M.cjs} +4 -4
  55. package/dist/{chunk-4256YRCO.cjs → chunk-3UC6DMFI.cjs} +30 -17
  56. package/dist/{chunk-6GUODJKM.cjs → chunk-3UHRCHKB.cjs} +23 -23
  57. package/dist/{chunk-HXJEGMGB.js → chunk-3ZOOH44N.js} +2 -2
  58. package/dist/{chunk-7RFJB75Y.js → chunk-44ZWOBTI.js} +9 -9
  59. package/dist/{chunk-CCVMREXI.js → chunk-4567QNRB.js} +32 -8
  60. package/dist/chunk-45CHNQM6.cjs +517 -0
  61. package/dist/{chunk-6NVAK6CK.js → chunk-4E7SHPNQ.js} +2 -2
  62. package/dist/{chunk-XGMI6IYB.cjs → chunk-4XFHP2SN.cjs} +7 -7
  63. package/dist/chunk-4XVLNOFA.js +360 -0
  64. package/dist/{chunk-D6GZBSOX.js → chunk-575PXZX7.js} +1 -1
  65. package/dist/{chunk-HJIXWGQZ.js → chunk-5A7ZL64N.js} +1 -1
  66. package/dist/{chunk-ROLA6EFO.cjs → chunk-5GCQ5UMV.cjs} +14 -14
  67. package/dist/{chunk-3DDL2E55.cjs → chunk-5SFV2NCY.cjs} +10 -10
  68. package/dist/chunk-5ZNYX4VH.cjs +71 -0
  69. package/dist/{chunk-PDHT7LQS.cjs → chunk-63ANVAOJ.cjs} +3 -3
  70. package/dist/{chunk-GWO66KBI.js → chunk-65LRPW5W.js} +1 -1
  71. package/dist/{chunk-IAGCRVJ3.js → chunk-6AYJCDTA.js} +14 -9
  72. package/dist/{chunk-A7HHCIDQ.js → chunk-6HF6XSCC.js} +2 -2
  73. package/dist/{chunk-47PHDKNW.cjs → chunk-6JWCGQJU.cjs} +6 -6
  74. package/dist/chunk-6OECOAK5.cjs +360 -0
  75. package/dist/{chunk-RBHANOYY.js → chunk-7DJJGKM6.js} +47 -3
  76. package/dist/{chunk-37M5UM6I.js → chunk-7IRQ7JEH.js} +1 -1
  77. package/dist/chunk-7MY4JHER.js +27 -0
  78. package/dist/{chunk-ZR46OJNZ.js → chunk-7PJKTSRN.js} +3 -3
  79. package/dist/{chunk-AC7DZ6SK.cjs → chunk-7PT646AL.cjs} +3 -3
  80. package/dist/{chunk-TKKN34TV.js → chunk-7WAUCLLQ.js} +3 -3
  81. package/dist/{chunk-DPSIGY6L.cjs → chunk-7XTUL7ZD.cjs} +9 -9
  82. package/dist/{chunk-GBMDFWJX.cjs → chunk-AE2ILW25.cjs} +13 -13
  83. package/dist/{chunk-BQ22N3TX.cjs → chunk-AOKXYGBQ.cjs} +27 -22
  84. package/dist/{chunk-REMGR23V.cjs → chunk-AQ5PVHOC.cjs} +7 -2
  85. package/dist/{chunk-AUYSIEVV.cjs → chunk-AZ47LKD5.cjs} +3 -3
  86. package/dist/chunk-B76FJKEJ.cjs +184 -0
  87. package/dist/{chunk-XV2HXRHX.js → chunk-BP37FVBM.js} +3 -3
  88. package/dist/{chunk-JIMSII7R.js → chunk-C46B72VK.js} +57 -10
  89. package/dist/{chunk-L4F7SUYL.js → chunk-C5QIQQ37.js} +3 -3
  90. package/dist/{chunk-AUFNACED.js → chunk-CCIDL4SA.js} +7094 -6126
  91. package/dist/{chunk-OV3PVUYN.js → chunk-CECH6QQP.js} +11 -11
  92. package/dist/{chunk-CH2J4PVE.cjs → chunk-CK4HAHVY.cjs} +13 -13
  93. package/dist/{chunk-Q2IL4DDI.cjs → chunk-CO2AADYU.cjs} +19 -14
  94. package/dist/{chunk-7JLT2VNW.cjs → chunk-CRTCZ4WL.cjs} +7533 -6565
  95. package/dist/{chunk-5JFTY3VU.js → chunk-CSTUTDTH.js} +2 -1
  96. package/dist/{chunk-DIZTWFVR.cjs → chunk-D546G7DA.cjs} +209 -55
  97. package/dist/{chunk-7HPWMALN.js → chunk-DGBPWODD.js} +1 -1
  98. package/dist/{chunk-RBZ7AFX7.cjs → chunk-DHUQZ53B.cjs} +2 -2
  99. package/dist/{chunk-U4C3HW6P.js → chunk-DNSD7DVJ.js} +2 -2
  100. package/dist/{chunk-SOLBYSLY.cjs → chunk-DSSCERHI.cjs} +2 -2
  101. package/dist/{chunk-OPNI6O7F.cjs → chunk-EA2MS25U.cjs} +4 -4
  102. package/dist/{chunk-E46DJH5S.js → chunk-EEHWALXA.js} +94 -3
  103. package/dist/{chunk-CFFE4VA3.js → chunk-EYHKL4QC.js} +1 -1
  104. package/dist/{chunk-FGT6KK6T.js → chunk-FBQJZKFX.js} +3 -3
  105. package/dist/{chunk-I24CWKKK.js → chunk-FFHSCM5M.js} +3 -3
  106. package/dist/{chunk-TXPSTCG7.cjs → chunk-GAOPJ5S3.cjs} +8 -8
  107. package/dist/{chunk-ARBEHFCG.js → chunk-GSDV75A5.js} +1 -1
  108. package/dist/{chunk-Z3XSSF7B.js → chunk-H426KOGY.js} +1 -1
  109. package/dist/{chunk-WRTXCQ3V.cjs → chunk-HC2Q6A3E.cjs} +858 -182
  110. package/dist/{chunk-IGMPWJ2I.cjs → chunk-HG3ZASBH.cjs} +8 -8
  111. package/dist/chunk-HK5A54AV.cjs +280 -0
  112. package/dist/{chunk-2HOLOHVK.js → chunk-HSWWM6AM.js} +136 -15
  113. package/dist/chunk-HTU4W3GB.js +183 -0
  114. package/dist/{chunk-5CMYEM3R.cjs → chunk-HVCIB4SW.cjs} +3 -3
  115. package/dist/chunk-HXHE2KAO.js +385 -0
  116. package/dist/{chunk-NMQ47RCG.js → chunk-HZWU6IO3.js} +5 -2
  117. package/dist/{chunk-ZPD2AO3U.js → chunk-I2ZK3AOD.js} +2 -2
  118. package/dist/{chunk-3UT7R3XV.js → chunk-IEPLQ47J.js} +61 -5
  119. package/dist/{chunk-3PXKRVCW.js → chunk-JB3JCYBJ.js} +7 -2
  120. package/dist/chunk-JCUHCH37.cjs +247 -0
  121. package/dist/{chunk-VBOFPU5M.cjs → chunk-JM3ZTQUK.cjs} +13 -9
  122. package/dist/{chunk-WZV6UVPY.js → chunk-JMJRFSNJ.js} +1 -1
  123. package/dist/{chunk-QKP772OZ.js → chunk-JPFRI4L4.js} +756 -80
  124. package/dist/{chunk-MOJ7ADW4.cjs → chunk-JV5HVCHU.cjs} +2 -2
  125. package/dist/{chunk-LN7D3EJZ.js → chunk-KA2U6MY2.js} +4 -3
  126. package/dist/{chunk-E26KKI46.cjs → chunk-KASXKDF2.cjs} +3 -1
  127. package/dist/chunk-KJ26T7GM.cjs +367 -0
  128. package/dist/chunk-KM7R5YPS.cjs +385 -0
  129. package/dist/{chunk-5F6ZKSHO.js → chunk-KMP6Y3LJ.js} +1 -1
  130. package/dist/chunk-KWXGDSYT.js +184 -0
  131. package/dist/{chunk-LDJQ5QHG.cjs → chunk-L46OUKW5.cjs} +15 -15
  132. package/dist/{chunk-Z4LIPMPM.js → chunk-L6OH44HL.js} +13 -9
  133. package/dist/chunk-LANGD5CO.js +280 -0
  134. package/dist/{chunk-CBFH2J3O.js → chunk-LEZEWKPA.js} +150 -7
  135. package/dist/{chunk-FQAVGSPW.js → chunk-M5DK524Z.js} +2 -2
  136. package/dist/{chunk-7LWQCE4Y.cjs → chunk-M7B7RRBK.cjs} +72 -25
  137. package/dist/{chunk-BWF4VDYE.js → chunk-MANJ67D3.js} +2 -2
  138. package/dist/{chunk-PHJO5YAL.cjs → chunk-MGNXABSU.cjs} +9 -9
  139. package/dist/{chunk-62RTC3XX.js → chunk-MMKZSJUN.js} +1 -1
  140. package/dist/{chunk-3KLSNNRW.cjs → chunk-MQQH4XQH.cjs} +4 -4
  141. package/dist/{chunk-HS4USDND.cjs → chunk-MZN6JBRZ.cjs} +2 -2
  142. package/dist/{chunk-AT7OWLY5.js → chunk-NB6M6ESM.js} +1 -1
  143. package/dist/{chunk-TQ33WBY5.cjs → chunk-NHWHEW7M.cjs} +2 -1
  144. package/dist/chunk-NQZH5CR2.cjs +468 -0
  145. package/dist/{chunk-2CGE7ZV3.cjs → chunk-NV6LCD2I.cjs} +119 -28
  146. package/dist/chunk-NVATU4V6.cjs +44 -0
  147. package/dist/{chunk-DLP436GI.js → chunk-NZ3ZWLUW.js} +2 -2
  148. package/dist/{chunk-IEXKKKOF.cjs → chunk-NZ7GCK7Y.cjs} +23 -23
  149. package/dist/{chunk-MQESBFBZ.cjs → chunk-NZQFKXM3.cjs} +21 -20
  150. package/dist/{chunk-QQ7PANOP.js → chunk-O5GI6SR3.js} +1 -1
  151. package/dist/{chunk-J5ADZN6V.cjs → chunk-OCATAKXV.cjs} +20 -20
  152. package/dist/{chunk-JYKPWK5O.js → chunk-OIGYWOL6.js} +1 -1
  153. package/dist/{chunk-O6TQP7U7.cjs → chunk-ONVYXTUT.cjs} +3 -3
  154. package/dist/{chunk-MPULXVC4.cjs → chunk-OV3T5MUH.cjs} +11 -11
  155. package/dist/{chunk-DMRXF5DU.js → chunk-P4FUTSVK.js} +3 -3
  156. package/dist/{chunk-MXVIDIC6.cjs → chunk-P6SLT2F4.cjs} +2 -2
  157. package/dist/{chunk-BL2UC7HC.js → chunk-PGFLPURU.js} +1 -1
  158. package/dist/{chunk-CWINVFRI.cjs → chunk-PIXQ2AVM.cjs} +17 -17
  159. package/dist/{chunk-MO4KP6XS.cjs → chunk-PNIAIOMZ.cjs} +5 -5
  160. package/dist/{chunk-HQWQZML5.cjs → chunk-PQBYFEBL.cjs} +2 -2
  161. package/dist/{chunk-UGFVM77J.cjs → chunk-PSAH4ZQB.cjs} +2 -2
  162. package/dist/{chunk-Y3M2DABP.js → chunk-PTTZI4QZ.js} +4 -4
  163. package/dist/{chunk-Q6AC3PHY.cjs → chunk-PY73W5MQ.cjs} +4 -4
  164. package/dist/{chunk-B5CGDNMR.js → chunk-PZZMIYII.js} +3 -3
  165. package/dist/{chunk-VRMZO6TB.js → chunk-Q3BS6FPM.js} +7 -6
  166. package/dist/chunk-QBYGMMDD.js +517 -0
  167. package/dist/{chunk-3LJJG5YY.cjs → chunk-QLZOMZO5.cjs} +4 -3
  168. package/dist/{chunk-3S563FNF.cjs → chunk-QQ64HEHP.cjs} +31 -31
  169. package/dist/{chunk-TBOLJDUG.js → chunk-QRQF3556.js} +12 -7
  170. package/dist/{chunk-ZZ63NW7A.cjs → chunk-RBXBH6EB.cjs} +17 -17
  171. package/dist/{chunk-PUD76XQT.cjs → chunk-RFUKZIJF.cjs} +5 -5
  172. package/dist/chunk-RS2E32YB.js +71 -0
  173. package/dist/{chunk-7MU7LWF3.cjs → chunk-S5JNQIGL.cjs} +5 -5
  174. package/dist/{chunk-BFQDQRDE.js → chunk-S5QKRA2V.js} +2 -2
  175. package/dist/{chunk-IKUMVBCW.cjs → chunk-SD3NTC7D.cjs} +48 -4
  176. package/dist/{chunk-PQLKJCIE.js → chunk-SDLY4X3G.js} +2 -2
  177. package/dist/{chunk-VKBIE6I6.js → chunk-SFFEKZGC.js} +2 -2
  178. package/dist/{chunk-TWQDAUZU.js → chunk-SHRLFX6F.js} +3 -1
  179. package/dist/{chunk-UEIXJG45.js → chunk-SNDDZG5H.js} +88 -72
  180. package/dist/{chunk-AOKCI722.cjs → chunk-SOVR7S3T.cjs} +2 -2
  181. package/dist/{chunk-M4KNC5BQ.js → chunk-SPQ7QIQ6.js} +1 -1
  182. package/dist/{chunk-QCHIDZBA.js → chunk-SRMGWMQO.js} +1 -1
  183. package/dist/{chunk-ZHJ7JGME.cjs → chunk-SVVP4UUZ.cjs} +11 -11
  184. package/dist/{chunk-CHI52KFR.cjs → chunk-SY2P3Z5W.cjs} +150 -7
  185. package/dist/chunk-SZD45IDG.js +468 -0
  186. package/dist/{chunk-VGEV44V2.cjs → chunk-TE4SYTWR.cjs} +189 -28
  187. package/dist/{chunk-YV63VW4K.js → chunk-TR6NECEZ.js} +1 -1
  188. package/dist/{chunk-GZ6DV2UG.js → chunk-TYBPTKFT.js} +1 -1
  189. package/dist/{chunk-5VHP6HDQ.js → chunk-U2QUMKCB.js} +1 -1
  190. package/dist/{chunk-6HH236FV.cjs → chunk-U6PLSPMD.cjs} +2 -2
  191. package/dist/{chunk-EZJHLOWP.js → chunk-UWZ4G3SQ.js} +20 -7
  192. package/dist/{chunk-UXLW45ZE.cjs → chunk-V3SZLWEQ.cjs} +25 -90
  193. package/dist/chunk-V4HGZSKQ.cjs +183 -0
  194. package/dist/{chunk-2QL6MNXG.js → chunk-V5ELP2XE.js} +6 -6
  195. package/dist/{chunk-N6O3XUZ2.cjs → chunk-VKOXFT4L.cjs} +2 -2
  196. package/dist/{chunk-J2K57QM7.cjs → chunk-VLGGMQUN.cjs} +6 -6
  197. package/dist/{chunk-HSCUPEA4.cjs → chunk-VQHSYAPZ.cjs} +11 -11
  198. package/dist/{chunk-DEQVRSV5.cjs → chunk-W5QLA6WP.cjs} +8 -8
  199. package/dist/chunk-WJYFLQ7G.cjs +27 -0
  200. package/dist/{chunk-MX75JYIY.js → chunk-WNJXIACY.js} +3 -3
  201. package/dist/{chunk-OHWMWKJQ.js → chunk-WPE2XHVX.js} +1 -1
  202. package/dist/{chunk-O64I2GYI.js → chunk-X3TI5TJJ.js} +1 -1
  203. package/dist/{chunk-46C73ZKK.cjs → chunk-X5P6QQOB.cjs} +66 -10
  204. package/dist/{chunk-TJNBASFD.cjs → chunk-X7XMITIL.cjs} +8 -8
  205. package/dist/{chunk-E6GFD7VR.cjs → chunk-XNIMSVS6.cjs} +11 -11
  206. package/dist/{chunk-WGLBC5AY.cjs → chunk-XW3XCK4E.cjs} +4 -4
  207. package/dist/{chunk-OM24WXEE.js → chunk-XZVDYC5U.js} +1 -1
  208. package/dist/{chunk-UWFG2R2I.cjs → chunk-Y5BDE24P.cjs} +33 -9
  209. package/dist/{chunk-GGLKUENP.js → chunk-YC5OBZQU.js} +161 -7
  210. package/dist/{chunk-JJ4KA7HK.cjs → chunk-YISPVAXO.cjs} +371 -250
  211. package/dist/{chunk-SWCQM52V.js → chunk-YQDI753V.js} +4 -4
  212. package/dist/{chunk-KNTUI4TZ.cjs → chunk-YWH55BWK.cjs} +9 -6
  213. package/dist/{chunk-ACDQGA4Z.js → chunk-YXM6SA7P.js} +7 -72
  214. package/dist/{chunk-3GUEUCZK.js → chunk-ZNGRLCFQ.js} +2 -0
  215. package/dist/{chunk-LQBONA55.cjs → chunk-ZNYZB7XY.cjs} +2 -0
  216. package/dist/{chunk-XIVFAD2L.js → chunk-ZPLCAXJW.js} +172 -11
  217. package/dist/chunk-ZUYYHKQA.js +44 -0
  218. package/dist/clear-QJXU25IF.cjs +12 -0
  219. package/dist/{clear-OFLFQ3MR.js → clear-Y5TO3RZA.js} +2 -2
  220. package/dist/communityInstaller-LXMVKVAV.cjs +22 -0
  221. package/dist/{communityInstaller-COB2KTOW.js → communityInstaller-RVL4STPS.js} +6 -6
  222. package/dist/completion-JX4T2ONW.cjs +17 -0
  223. package/dist/{completion-PT4VM2H2.js → completion-SE3XYG74.js} +5 -5
  224. package/dist/config-3224PRW4.cjs +21 -0
  225. package/dist/{config-R4O7GBTY.js → config-7KPHKFTP.js} +4 -3
  226. package/dist/{constants-HVCHVQAF.js → constants-EJFAWJQI.js} +1 -1
  227. package/dist/constants-MCCGUU5F.cjs +21 -0
  228. package/dist/{export-3PK3VFCE.js → export-BJVIDZC4.js} +5 -5
  229. package/dist/export-KU4557HK.cjs +15 -0
  230. package/dist/feature-K3LG5IJP.cjs +14 -0
  231. package/dist/feature-V4JF5TNJ.js +14 -0
  232. package/dist/features-5OJTLKS7.js +23 -0
  233. package/dist/features-VCBJQXCX.cjs +23 -0
  234. package/dist/feedback-D4437VE4.js +18 -0
  235. package/dist/feedback-VZPEHGFY.cjs +18 -0
  236. package/dist/go-X4E6BCD6.js +12 -0
  237. package/dist/go-XREVFS5I.cjs +12 -0
  238. package/dist/goal-4M3J6JS2.cjs +16 -0
  239. package/dist/goal-EI66BV7W.js +16 -0
  240. package/dist/help-GGFS7WHY.cjs +12 -0
  241. package/dist/{help-X3OAZ3CY.js → help-MLIROWKM.js} +2 -2
  242. package/dist/{history-YKFPHBJN.js → history-GQJ6RZD6.js} +2 -2
  243. package/dist/history-J4LUIOSI.cjs +14 -0
  244. package/dist/hooks-FSRIUS6A.cjs +18 -0
  245. package/dist/{hooks-7TA4PIIB.js → hooks-PPFHCF7T.js} +6 -6
  246. package/dist/i18n-CI6VFXL5.cjs +33 -0
  247. package/dist/{i18n-2KBUU7XL.js → i18n-Q7UZJRPL.js} +1 -1
  248. package/dist/ide-BUSVE54P.js +15 -0
  249. package/dist/ide-YR27BPGM.cjs +15 -0
  250. package/dist/{import-4CHYLS4K.js → import-3VBKI6BN.js} +3 -3
  251. package/dist/{import-I7T4ZHYL.cjs → import-C7S6UJMW.cjs} +3 -3
  252. package/dist/import-DBK4OCDF.cjs +10 -0
  253. package/dist/{import-JWPYKXCZ.js → import-U47DXCA7.js} +2 -2
  254. package/dist/index.cjs +267 -170
  255. package/dist/index.d.cts +2 -0
  256. package/dist/index.d.ts +2 -0
  257. package/dist/index.js +165 -68
  258. package/dist/init-OXTYS72D.cjs +10 -0
  259. package/dist/{init-262MWZV4.js → init-Q2O4R42R.js} +2 -2
  260. package/dist/{inputPrompt-YGBHDUEP.js → inputPrompt-3CFZDUBH.js} +2 -2
  261. package/dist/inputPrompt-JMACL4EB.cjs +90 -0
  262. package/dist/language-EK3M6UBV.cjs +22 -0
  263. package/dist/language-Q3RUGGOW.js +22 -0
  264. package/dist/learn-3DSX7DYG.cjs +23 -0
  265. package/dist/learn-OPOH5L43.js +23 -0
  266. package/dist/login-GST7MWXJ.cjs +27 -0
  267. package/dist/login-Q7DZKAX4.js +27 -0
  268. package/dist/logout-2G7OUK7I.cjs +24 -0
  269. package/dist/logout-FNBBL2UI.js +24 -0
  270. package/dist/{mcp-5O6PUL4G.js → mcp-AH3MMUBU.js} +7 -6
  271. package/dist/mcp-DW7R63IB.cjs +21 -0
  272. package/dist/{mcp-install-6XWXLFVY.js → mcp-install-222PCKSW.js} +9 -8
  273. package/dist/{mcp-install-P6DHES7V.cjs → mcp-install-IA4ZS2SV.cjs} +14 -13
  274. package/dist/memory-6NX3DAIY.cjs +10 -0
  275. package/dist/{memory-Q54CESNM.js → memory-VB46T5H3.js} +2 -2
  276. package/dist/model-64NAELFS.cjs +10 -0
  277. package/dist/{model-6AJ77PJG.js → model-SJJG64AM.js} +2 -2
  278. package/dist/new-DU5SOOOY.cjs +12 -0
  279. package/dist/{new-ZXHEWC2S.js → new-ERZ5C6CN.js} +2 -2
  280. package/dist/onboarding-2U2BV2KE.cjs +36 -0
  281. package/dist/{onboarding-JYNMK6NI.js → onboarding-ZQXMPSMJ.js} +14 -13
  282. package/dist/{permissions-YHJMVA6L.js → permissions-7ACNFK7A.js} +2 -2
  283. package/dist/permissions-GSNNV7RJ.cjs +10 -0
  284. package/dist/{quit-GWTNHQSP.js → quit-WY6T267G.js} +2 -2
  285. package/dist/quit-XIRE2KRE.cjs +10 -0
  286. package/dist/{registry-34GL6BNJ.js → registry-4DXUDKJN.js} +1 -1
  287. package/dist/{registry-V24W7YK6.cjs → registry-UEO3ETZ7.cjs} +21 -21
  288. package/dist/resume-RQZ3WXBP.cjs +17 -0
  289. package/dist/resume-XSXZMDMD.js +17 -0
  290. package/dist/{rpc-S3DGW6KV.js → rpc-XH7QLN4H.js} +251 -107
  291. package/dist/{rpc-NPS3PU4O.cjs → rpc-YF54T7JU.cjs} +347 -203
  292. package/dist/search-VXXFGZWU.cjs +21 -0
  293. package/dist/search-YAWGX7P7.js +21 -0
  294. package/dist/{sessions-IYAXMK23.js → sessions-NJYHJOEL.js} +2 -2
  295. package/dist/sessions-OSG3UJEZ.cjs +10 -0
  296. package/dist/settings-SO2UIGWV.cjs +42 -0
  297. package/dist/{settings-55BNW6BF.js → settings-ZXUQH3DO.js} +17 -8
  298. package/dist/setup-KG7EGKF5.js +30 -0
  299. package/dist/setup-RSOPCQ57.cjs +30 -0
  300. package/dist/share-WFAGZ5PY.js +17 -0
  301. package/dist/share-ZU3SGACF.cjs +17 -0
  302. package/dist/skills-KBVAQAD2.cjs +29 -0
  303. package/dist/{skills-VWOMV3CR.js → skills-NBTNDVAY.js} +8 -8
  304. package/dist/{skills-MVIZNHT4.js → skills-OB6RDW7D.js} +9 -9
  305. package/dist/{skills-GGMZOVIE.cjs → skills-ZROBG3RZ.cjs} +10 -10
  306. package/dist/{skills-install-QBA5RCV6.js → skills-install-BHTIEMKH.js} +7 -7
  307. package/dist/{skills-install-VTAMCNNY.cjs → skills-install-ILX6QVEF.cjs} +15 -15
  308. package/dist/skills-new-B45VQ2PP.cjs +18 -0
  309. package/dist/skills-new-YMRP2HNO.js +18 -0
  310. package/dist/slashCommands-53VYIBJU.js +105 -0
  311. package/dist/slashCommands-BG2RGGZ6.cjs +105 -0
  312. package/dist/status-CQ2IUOVK.cjs +24 -0
  313. package/dist/status-E7IGNVPC.js +24 -0
  314. package/dist/{sync-7OKF6636.js → sync-7C25MOT2.js} +6 -5
  315. package/dist/{sync-7BILIQHP.js → sync-OCJN4ZSO.js} +3 -3
  316. package/dist/sync-XRP46IVG.cjs +40 -0
  317. package/dist/sync-ZMFVE7T4.cjs +22 -0
  318. package/dist/{teammate-J6PHGL23.cjs → teammate-D77B6QRT.cjs} +9 -8
  319. package/dist/{teammate-GZQSCIMS.js → teammate-EZCMHOIL.js} +8 -7
  320. package/dist/templates-ARG2VRWW.cjs +11 -0
  321. package/dist/templates-UGVZV3KJ.js +11 -0
  322. package/dist/theme-KKRDE6P7.cjs +22 -0
  323. package/dist/theme-XF7XIWBQ.js +22 -0
  324. package/dist/ui/questionModal.cjs +6 -6
  325. package/dist/ui/questionModal.js +5 -5
  326. package/dist/{undo-SZEHLX7X.js → undo-GNUTFXCW.js} +2 -2
  327. package/dist/undo-U4KN7QQM.cjs +10 -0
  328. package/dist/usage-QSTNSDAO.js +24 -0
  329. package/dist/usage-YDEMQBNQ.cjs +24 -0
  330. package/package.json +7 -2
  331. package/dist/AgentRegistry-EGBDIUAK.cjs +0 -10
  332. package/dist/CommunitySkillsCache-2OIUV227.cjs +0 -8
  333. package/dist/LearnAdvisor-46FG2XIP.js +0 -9
  334. package/dist/LearnAdvisor-XBRDNAGH.cjs +0 -9
  335. package/dist/MemoryManager-34L4YOKA.cjs +0 -8
  336. package/dist/NVIDIAProvider-MVTL62PR.cjs +0 -14
  337. package/dist/PermissionManager-5OOJ7FAT.cjs +0 -11
  338. package/dist/ProviderFactory-C3YPXTDD.cjs +0 -11
  339. package/dist/SessionManager-WAPTFMDO.cjs +0 -10
  340. package/dist/SkillsRegistry-7AJP74GJ.cjs +0 -9
  341. package/dist/SubAgent-FDIH3DXB.js +0 -11
  342. package/dist/SubAgent-HVL2ICVZ.cjs +0 -11
  343. package/dist/SyncApiClient-VMBOLQ6H.cjs +0 -11
  344. package/dist/about-FCAX37YC.cjs +0 -14
  345. package/dist/actionExecutor-4YBMR3YH.cjs +0 -24
  346. package/dist/add-dir-7SS6KSH5.cjs +0 -11
  347. package/dist/agent-DMRUFU4M.cjs +0 -116
  348. package/dist/agent-WCJEYQJT.js +0 -116
  349. package/dist/agents-CHROO3VU.cjs +0 -17
  350. package/dist/agents-UVDUL65K.js +0 -17
  351. package/dist/agents-new-AUBWSOXP.js +0 -17
  352. package/dist/agents-new-Y562WC47.cjs +0 -17
  353. package/dist/autoSkill-YOLLFTP2.cjs +0 -20
  354. package/dist/automode-DBLKTTKD.cjs +0 -10
  355. package/dist/chrome-ATC4OO5I.cjs +0 -20
  356. package/dist/chrome-O62WXV7F.js +0 -20
  357. package/dist/chrome-XHJLCO4M.cjs +0 -50
  358. package/dist/chunk-6XVVIY54.cjs +0 -256
  359. package/dist/chunk-AU6JAGZJ.cjs +0 -231
  360. package/dist/chunk-VDWJMWDF.js +0 -256
  361. package/dist/clear-33TWQ2ES.cjs +0 -12
  362. package/dist/communityInstaller-TWMGPSYM.cjs +0 -22
  363. package/dist/completion-IIZMHXYP.cjs +0 -17
  364. package/dist/config-KL6WU7R2.cjs +0 -20
  365. package/dist/constants-RLMJ5D5P.cjs +0 -21
  366. package/dist/export-WLGNWEMJ.cjs +0 -15
  367. package/dist/feedback-G635NCLJ.js +0 -18
  368. package/dist/feedback-LLMK3TZH.cjs +0 -18
  369. package/dist/help-BAXLP2M2.cjs +0 -12
  370. package/dist/history-6HOJSEMT.cjs +0 -14
  371. package/dist/hooks-XVFU67T2.cjs +0 -18
  372. package/dist/i18n-MUJMKTFM.cjs +0 -33
  373. package/dist/ide-CCQ33PGC.cjs +0 -15
  374. package/dist/ide-VLVFBZ5F.js +0 -15
  375. package/dist/import-J46F54JY.cjs +0 -10
  376. package/dist/init-EE5Y7RBL.cjs +0 -10
  377. package/dist/inputPrompt-IIFKCX5Q.cjs +0 -90
  378. package/dist/language-CVLPB7OV.js +0 -21
  379. package/dist/language-ZTWFHUSV.cjs +0 -21
  380. package/dist/learn-PON7I5QS.js +0 -23
  381. package/dist/learn-XLRSVNA3.cjs +0 -23
  382. package/dist/login-223QTGBG.cjs +0 -26
  383. package/dist/login-6IKTBUBY.js +0 -26
  384. package/dist/logout-RN2AG6SI.js +0 -23
  385. package/dist/logout-U3M4FFX7.cjs +0 -23
  386. package/dist/mcp-NUQ76QQB.cjs +0 -20
  387. package/dist/memory-CYMDQ2YC.cjs +0 -10
  388. package/dist/model-IDRCKDML.cjs +0 -10
  389. package/dist/new-7LEWOUF2.cjs +0 -12
  390. package/dist/onboarding-FXX7YHSJ.cjs +0 -35
  391. package/dist/permissions-YBNSANIA.cjs +0 -10
  392. package/dist/quit-B43SJ6E4.cjs +0 -10
  393. package/dist/resume-DYVOQN5L.cjs +0 -16
  394. package/dist/resume-M25UQKOX.js +0 -16
  395. package/dist/search-CPX4PWHP.js +0 -20
  396. package/dist/search-VUF3M4N3.cjs +0 -20
  397. package/dist/sessions-JODKER5D.cjs +0 -10
  398. package/dist/settings-BKTS7OMC.cjs +0 -33
  399. package/dist/setup-IRC5HQG2.js +0 -29
  400. package/dist/setup-MMQ7TWOP.cjs +0 -29
  401. package/dist/share-6JRQECAH.cjs +0 -17
  402. package/dist/share-YM5MJKMO.js +0 -17
  403. package/dist/skills-LWSOKOSH.cjs +0 -29
  404. package/dist/skills-new-GPL46YV2.js +0 -18
  405. package/dist/skills-new-L5BEZN5V.cjs +0 -18
  406. package/dist/slashCommands-FBPCIWM5.cjs +0 -95
  407. package/dist/slashCommands-FCWY5DXW.js +0 -95
  408. package/dist/status-3B5SDZPL.js +0 -17
  409. package/dist/status-TTGRF6NC.cjs +0 -17
  410. package/dist/sync-77CXVVTK.cjs +0 -21
  411. package/dist/sync-EH4K5U3N.cjs +0 -40
  412. package/dist/theme-64BYGJ57.cjs +0 -21
  413. package/dist/theme-YJE6HEON.js +0 -21
  414. package/dist/undo-PRTEGL2J.cjs +0 -10
@@ -1,10 +1,14 @@
1
1
  import {
2
- NVIDIAProvider
3
- } from "./chunk-CCVMREXI.js";
2
+ NVIDIAProvider,
3
+ normalizeLLMUsage
4
+ } from "./chunk-4567QNRB.js";
4
5
  import {
5
6
  ApiError,
6
7
  classifyApiError
7
8
  } from "./chunk-FQVG6ZHF.js";
9
+ import {
10
+ isAwsBedrockProviderEnabled
11
+ } from "./chunk-LANGD5CO.js";
8
12
 
9
13
  // src/providers/OllamaProvider.ts
10
14
  var DEFAULT_TIMEOUT = 12e4;
@@ -182,14 +186,10 @@ var OllamaProvider = class {
182
186
  };
183
187
  });
184
188
  }
185
- let usage;
186
- if (data.prompt_eval_count !== void 0 || data.eval_count !== void 0) {
187
- usage = {
188
- promptTokens: data.prompt_eval_count ?? 0,
189
- completionTokens: data.eval_count ?? 0,
190
- totalTokens: (data.prompt_eval_count ?? 0) + (data.eval_count ?? 0)
191
- };
192
- }
189
+ const usage = normalizeLLMUsage({
190
+ prompt_tokens: data.prompt_eval_count,
191
+ completion_tokens: data.eval_count
192
+ });
193
193
  return {
194
194
  id: `ollama-${Date.now()}`,
195
195
  created: Math.floor(new Date(data.created_at).getTime() / 1e3),
@@ -812,6 +812,8 @@ async function refreshChatGPTAuth(auth) {
812
812
 
813
813
  // src/providers/OpenAIProvider.ts
814
814
  var OPENAI_MODELS = [
815
+ "gpt-5.5",
816
+ "gpt-5.5-pro",
815
817
  "gpt-5.4",
816
818
  "gpt-5.4-pro",
817
819
  "gpt-5.4-mini",
@@ -859,6 +861,11 @@ var OpenAIProvider = class {
859
861
  setModel(model) {
860
862
  this.model = model;
861
863
  }
864
+ getCapabilities() {
865
+ return {
866
+ nativeToolCalling: true
867
+ };
868
+ }
862
869
  async listModels() {
863
870
  return [...OPENAI_MODELS];
864
871
  }
@@ -885,7 +892,7 @@ var OpenAIProvider = class {
885
892
  messages: request.messages.map((msg) => {
886
893
  const mapped = {
887
894
  role: msg.role === "system" ? "system" : msg.role === "user" ? "user" : msg.role === "tool" ? "tool" : "assistant",
888
- content: msg.content
895
+ content: this.toChatCompletionContent(msg.content)
889
896
  };
890
897
  if (msg.role === "assistant" && msg.tool_calls?.length) {
891
898
  mapped.tool_calls = msg.tool_calls;
@@ -968,14 +975,7 @@ var OpenAIProvider = class {
968
975
  }
969
976
  }));
970
977
  }
971
- let usage;
972
- if (data.usage) {
973
- usage = {
974
- promptTokens: data.usage.prompt_tokens,
975
- completionTokens: data.usage.completion_tokens,
976
- totalTokens: data.usage.total_tokens
977
- };
978
- }
978
+ const usage = normalizeLLMUsage(data.usage);
979
979
  return {
980
980
  id: data.id,
981
981
  created: data.created,
@@ -995,7 +995,7 @@ var OpenAIProvider = class {
995
995
  stream: true,
996
996
  tool_choice: "auto",
997
997
  parallel_tool_calls: true,
998
- input: request.messages.flatMap((msg) => this.toResponsesInputItems(msg))
998
+ input: this.toResponsesInputItems(request.messages)
999
999
  };
1000
1000
  if (this.reasoningEffort && VALID_REASONING_EFFORTS.has(this.reasoningEffort)) {
1001
1001
  body.reasoning = {
@@ -1059,11 +1059,7 @@ var OpenAIProvider = class {
1059
1059
  const data = await this.parseCodexStream(response);
1060
1060
  const toolCalls = this.extractResponsesToolCalls(data.output);
1061
1061
  const content = this.extractResponsesContent(data);
1062
- const usage = data.usage ? {
1063
- promptTokens: data.usage.input_tokens ?? 0,
1064
- completionTokens: data.usage.output_tokens ?? 0,
1065
- totalTokens: data.usage.total_tokens ?? (data.usage.input_tokens ?? 0) + (data.usage.output_tokens ?? 0)
1066
- } : void 0;
1062
+ const usage = normalizeLLMUsage(data.usage);
1067
1063
  return {
1068
1064
  id: data.id,
1069
1065
  created: data.created_at ?? Math.floor(Date.now() / 1e3),
@@ -1115,13 +1111,42 @@ ${error.rawDetail}` : friendlyMessage,
1115
1111
  const text = await response.text();
1116
1112
  let currentEvent = "";
1117
1113
  let completedData = null;
1114
+ let streamedOutputText = "";
1115
+ const streamedOutputItems = /* @__PURE__ */ new Map();
1118
1116
  for (const line of text.split("\n")) {
1119
1117
  if (line.startsWith("event: ")) {
1120
1118
  currentEvent = line.slice(7).trim();
1121
1119
  continue;
1122
1120
  }
1123
- if (line.startsWith("data: ") && currentEvent === "response.completed") {
1124
- completedData = JSON.parse(line.slice(6));
1121
+ if (!line.startsWith("data: ")) {
1122
+ continue;
1123
+ }
1124
+ const dataLine = line.slice(6);
1125
+ const eventData = JSON.parse(dataLine);
1126
+ const eventType = this.getCodexStreamEventType(currentEvent, eventData);
1127
+ const eventRecord = eventData && typeof eventData === "object" ? eventData : {};
1128
+ if (eventType === "response.output_text.delta") {
1129
+ if (typeof eventRecord.delta === "string") {
1130
+ streamedOutputText += eventRecord.delta;
1131
+ }
1132
+ continue;
1133
+ }
1134
+ if (eventType === "response.output_text.done") {
1135
+ if (typeof eventRecord.text === "string" && eventRecord.text.trim()) {
1136
+ streamedOutputText = eventRecord.text;
1137
+ }
1138
+ continue;
1139
+ }
1140
+ if (eventType === "response.output_item.added" || eventType === "response.output_item.done") {
1141
+ this.captureStreamedOutputItem(eventData, streamedOutputItems);
1142
+ continue;
1143
+ }
1144
+ if (eventType === "response.function_call_arguments.done") {
1145
+ this.captureStreamedFunctionCallArguments(eventData, streamedOutputItems);
1146
+ continue;
1147
+ }
1148
+ if (eventType === "response.completed") {
1149
+ completedData = this.extractCompletedResponse(eventData);
1125
1150
  break;
1126
1151
  }
1127
1152
  }
@@ -1133,8 +1158,74 @@ ${error.rawDetail}` : friendlyMessage,
1133
1158
  false
1134
1159
  );
1135
1160
  }
1161
+ if ((!Array.isArray(completedData.output) || completedData.output.length === 0) && streamedOutputItems.size > 0) {
1162
+ completedData.output = [...streamedOutputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
1163
+ }
1164
+ if (!this.extractResponsesContent(completedData) && streamedOutputText.trim()) {
1165
+ completedData.output_text = streamedOutputText;
1166
+ }
1136
1167
  return completedData;
1137
1168
  }
1169
+ getCodexStreamEventType(currentEvent, eventData) {
1170
+ if (currentEvent) {
1171
+ return currentEvent;
1172
+ }
1173
+ if (eventData && typeof eventData === "object" && "type" in eventData) {
1174
+ const type = eventData.type;
1175
+ return typeof type === "string" ? type : "";
1176
+ }
1177
+ return "";
1178
+ }
1179
+ captureStreamedOutputItem(eventData, outputItems) {
1180
+ if (!eventData || typeof eventData !== "object") {
1181
+ return;
1182
+ }
1183
+ const event = eventData;
1184
+ if (!event.item || typeof event.output_index !== "number") {
1185
+ return;
1186
+ }
1187
+ const existing = outputItems.get(event.output_index);
1188
+ if (existing?.type === "function_call" && event.item.type === "function_call") {
1189
+ outputItems.set(event.output_index, {
1190
+ ...existing,
1191
+ ...event.item,
1192
+ arguments: event.item.arguments || existing.arguments
1193
+ });
1194
+ return;
1195
+ }
1196
+ outputItems.set(event.output_index, event.item);
1197
+ }
1198
+ captureStreamedFunctionCallArguments(eventData, outputItems) {
1199
+ if (!eventData || typeof eventData !== "object") {
1200
+ return;
1201
+ }
1202
+ const event = eventData;
1203
+ if (typeof event.output_index !== "number" || typeof event.name !== "string" || typeof event.arguments !== "string") {
1204
+ return;
1205
+ }
1206
+ const existing = outputItems.get(event.output_index);
1207
+ if (existing?.type === "function_call") {
1208
+ outputItems.set(event.output_index, {
1209
+ ...existing,
1210
+ name: event.name,
1211
+ arguments: event.arguments
1212
+ });
1213
+ return;
1214
+ }
1215
+ outputItems.set(event.output_index, {
1216
+ type: "function_call",
1217
+ id: event.item_id,
1218
+ call_id: event.item_id,
1219
+ name: event.name,
1220
+ arguments: event.arguments
1221
+ });
1222
+ }
1223
+ extractCompletedResponse(eventData) {
1224
+ if (eventData && typeof eventData === "object" && "response" in eventData && eventData.response) {
1225
+ return eventData.response;
1226
+ }
1227
+ return eventData;
1228
+ }
1138
1229
  async buildAuthHeaders() {
1139
1230
  if (this.authMode === "chatgpt") {
1140
1231
  if (!this.chatgptAuth?.accessToken || !this.chatgptAuth.accountId) {
@@ -1161,12 +1252,73 @@ ${error.rawDetail}` : friendlyMessage,
1161
1252
  }
1162
1253
  return (configBaseUrl || OPENAI_API_BASE_URL).replace(/\/$/, "");
1163
1254
  }
1164
- toResponsesInputItems(msg) {
1255
+ isContentPartsArray(content) {
1256
+ return Array.isArray(content);
1257
+ }
1258
+ toChatCompletionContent(content) {
1259
+ if (!this.isContentPartsArray(content)) {
1260
+ return content;
1261
+ }
1262
+ return content.map((part) => {
1263
+ if (part.type === "text") {
1264
+ return { type: "text", text: part.text };
1265
+ }
1266
+ if (part.type === "image_url") {
1267
+ return {
1268
+ type: "image_url",
1269
+ image_url: part.image_url
1270
+ };
1271
+ }
1272
+ return null;
1273
+ }).filter((part) => part !== null);
1274
+ }
1275
+ toResponsesMessageContent(role, content) {
1276
+ const textType = role === "assistant" ? "output_text" : "input_text";
1277
+ if (!this.isContentPartsArray(content)) {
1278
+ return [{ type: textType, text: content }];
1279
+ }
1280
+ const parts = [];
1281
+ for (const part of content) {
1282
+ if (part.type === "text") {
1283
+ parts.push({ type: textType, text: part.text });
1284
+ continue;
1285
+ }
1286
+ if (part.type === "image_url" && role !== "assistant") {
1287
+ parts.push({
1288
+ type: "input_image",
1289
+ image_url: part.image_url.url
1290
+ });
1291
+ }
1292
+ }
1293
+ return parts;
1294
+ }
1295
+ toResponsesInputItems(messages) {
1296
+ const assistantToolCallIds = /* @__PURE__ */ new Set();
1297
+ const toolOutputIds = /* @__PURE__ */ new Set();
1298
+ for (const msg of messages) {
1299
+ if (msg.role === "assistant" && msg.tool_calls?.length) {
1300
+ for (const toolCall of msg.tool_calls) {
1301
+ assistantToolCallIds.add(toolCall.id);
1302
+ }
1303
+ }
1304
+ if (msg.role === "tool" && msg.tool_call_id) {
1305
+ toolOutputIds.add(msg.tool_call_id);
1306
+ }
1307
+ }
1308
+ const matchedToolCallIds = new Set(
1309
+ [...assistantToolCallIds].filter((id) => toolOutputIds.has(id))
1310
+ );
1311
+ return messages.flatMap((msg) => this.toResponsesInputItemsForMessage(msg, matchedToolCallIds));
1312
+ }
1313
+ toResponsesInputItemsForMessage(msg, matchedToolCallIds) {
1165
1314
  const items = [];
1166
1315
  if (msg.role === "system") {
1167
1316
  return items;
1168
1317
  }
1169
1318
  if (msg.role === "tool" && msg.tool_call_id) {
1319
+ if (!matchedToolCallIds.has(msg.tool_call_id)) {
1320
+ return items;
1321
+ }
1170
1322
  items.push({
1171
1323
  type: "function_call_output",
1172
1324
  call_id: msg.tool_call_id,
@@ -1175,14 +1327,18 @@ ${error.rawDetail}` : friendlyMessage,
1175
1327
  return items;
1176
1328
  }
1177
1329
  if (msg.content) {
1330
+ const content = this.toResponsesMessageContent(msg.role, msg.content);
1178
1331
  items.push({
1179
1332
  type: "message",
1180
1333
  role: msg.role === "tool" ? "user" : msg.role,
1181
- content: [{ type: "input_text", text: msg.content }]
1334
+ content
1182
1335
  });
1183
1336
  }
1184
1337
  if (msg.role === "assistant" && msg.tool_calls?.length) {
1185
1338
  for (const toolCall of msg.tool_calls) {
1339
+ if (!matchedToolCallIds.has(toolCall.id)) {
1340
+ continue;
1341
+ }
1186
1342
  items.push({
1187
1343
  type: "function_call",
1188
1344
  call_id: toolCall.id,
@@ -1776,14 +1932,7 @@ var OpenRouterClient = class {
1776
1932
  };
1777
1933
  });
1778
1934
  }
1779
- let usage;
1780
- if (json?.usage) {
1781
- usage = {
1782
- promptTokens: json.usage.prompt_tokens ?? 0,
1783
- completionTokens: json.usage.completion_tokens ?? 0,
1784
- totalTokens: json.usage.total_tokens ?? 0
1785
- };
1786
- }
1935
+ const usage = normalizeLLMUsage(json?.usage);
1787
1936
  return {
1788
1937
  id: json.id ?? "autohand-local",
1789
1938
  created: json.created ?? Date.now(),
@@ -2338,14 +2487,7 @@ var LLMGatewayClient = class {
2338
2487
  };
2339
2488
  });
2340
2489
  }
2341
- let usage;
2342
- if (json?.usage) {
2343
- usage = {
2344
- promptTokens: json.usage.prompt_tokens ?? 0,
2345
- completionTokens: json.usage.completion_tokens ?? 0,
2346
- totalTokens: json.usage.total_tokens ?? 0
2347
- };
2348
- }
2490
+ const usage = normalizeLLMUsage(json?.usage);
2349
2491
  return {
2350
2492
  id: json.id ?? "llmgateway-response",
2351
2493
  created: json.created ?? Date.now(),
@@ -2817,14 +2959,7 @@ var AzureClient = class {
2817
2959
  };
2818
2960
  });
2819
2961
  }
2820
- let usage;
2821
- if (json?.usage) {
2822
- usage = {
2823
- promptTokens: json.usage.prompt_tokens ?? 0,
2824
- completionTokens: json.usage.completion_tokens ?? 0,
2825
- totalTokens: json.usage.total_tokens ?? 0
2826
- };
2827
- }
2962
+ const usage = normalizeLLMUsage(json?.usage);
2828
2963
  return {
2829
2964
  id: json.id ?? "autohand-azure",
2830
2965
  created: json.created ?? Date.now(),
@@ -3377,14 +3512,7 @@ var VertexAIProvider = class {
3377
3512
  };
3378
3513
  });
3379
3514
  }
3380
- let usage;
3381
- if (json?.usage) {
3382
- usage = {
3383
- promptTokens: json.usage.prompt_tokens ?? 0,
3384
- completionTokens: json.usage.completion_tokens ?? 0,
3385
- totalTokens: json.usage.total_tokens ?? 0
3386
- };
3387
- }
3515
+ const usage = normalizeLLMUsage(json?.usage);
3388
3516
  return {
3389
3517
  id: json.id ?? "vertexai-response",
3390
3518
  created: json.created ?? Date.now(),
@@ -3414,14 +3542,7 @@ var VertexAIProvider = class {
3414
3542
  }
3415
3543
  }));
3416
3544
  }
3417
- let usage;
3418
- if (json?.usage) {
3419
- usage = {
3420
- promptTokens: json.usage.input_tokens ?? 0,
3421
- completionTokens: json.usage.output_tokens ?? 0,
3422
- totalTokens: (json.usage.input_tokens ?? 0) + (json.usage.output_tokens ?? 0)
3423
- };
3424
- }
3545
+ const usage = normalizeLLMUsage(json?.usage);
3425
3546
  const stopReason = json?.stop_reason;
3426
3547
  let finishReason;
3427
3548
  if (stopReason === "end_turn" || stopReason === "stop_sequence") {
@@ -3756,14 +3877,7 @@ var XAIProvider = class {
3756
3877
  return parts.join("\n").trim();
3757
3878
  }
3758
3879
  mapXAIUsage(usage) {
3759
- if (!usage) return void 0;
3760
- const input = usage.input_tokens ?? 0;
3761
- const output = usage.output_tokens ?? 0;
3762
- return {
3763
- promptTokens: input,
3764
- completionTokens: output,
3765
- totalTokens: usage.total_tokens ?? input + output
3766
- };
3880
+ return normalizeLLMUsage(usage);
3767
3881
  }
3768
3882
  async parseXAIStream(response) {
3769
3883
  const text = await response.text();
@@ -4132,6 +4246,544 @@ var DeepSeekProvider = class {
4132
4246
  }
4133
4247
  };
4134
4248
 
4249
+ // src/providers/BedrockProvider.ts
4250
+ import {
4251
+ BedrockRuntimeClient,
4252
+ ConverseCommand
4253
+ } from "@aws-sdk/client-bedrock-runtime";
4254
+ import {
4255
+ BedrockClient,
4256
+ ListFoundationModelsCommand
4257
+ } from "@aws-sdk/client-bedrock";
4258
+ import { fromIni } from "@aws-sdk/credential-providers";
4259
+ var BEDROCK_DEFAULT_REGION = "us-east-1";
4260
+ var BEDROCK_DEFAULT_MODEL = "anthropic.claude-3-5-sonnet-20241022-v2:0";
4261
+ var BEDROCK_MODELS = [
4262
+ BEDROCK_DEFAULT_MODEL,
4263
+ "anthropic.claude-3-7-sonnet-20250219-v1:0",
4264
+ "anthropic.claude-sonnet-4-20250514-v1:0",
4265
+ "amazon.nova-pro-v1:0",
4266
+ "amazon.nova-lite-v1:0",
4267
+ "meta.llama3-1-70b-instruct-v1:0",
4268
+ "openai.gpt-oss-120b-1:0"
4269
+ ];
4270
+ function resolveBedrockRegion(region) {
4271
+ return region?.trim() || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || BEDROCK_DEFAULT_REGION;
4272
+ }
4273
+ function getBedrockRuntimeEndpoint(region) {
4274
+ return `https://bedrock-runtime.${region}.amazonaws.com`;
4275
+ }
4276
+ function getBedrockOpenAIEndpoint(_mode, region) {
4277
+ return `${getBedrockRuntimeEndpoint(region)}/openai/v1`;
4278
+ }
4279
+ function resolveBedrockEndpoint(mode, region, configuredEndpoint) {
4280
+ if (configuredEndpoint?.trim()) {
4281
+ return configuredEndpoint.replace(/\/+$/, "");
4282
+ }
4283
+ if (mode === "converse") {
4284
+ return getBedrockRuntimeEndpoint(region);
4285
+ }
4286
+ return getBedrockOpenAIEndpoint(mode, region);
4287
+ }
4288
+ function resolveBedrockAuthMode(mode, configured) {
4289
+ if (configured) return configured;
4290
+ return mode === "converse" ? "aws-credentials" : "bedrock-api-key";
4291
+ }
4292
+ function parseToolArguments(argumentsJson) {
4293
+ try {
4294
+ return JSON.parse(argumentsJson);
4295
+ } catch {
4296
+ return {};
4297
+ }
4298
+ }
4299
+ function toTextContent(content) {
4300
+ return content ? [{ text: content }] : [];
4301
+ }
4302
+ function toToolUseBlocks(toolCalls) {
4303
+ return toolCalls.map((toolCall) => ({
4304
+ toolUse: {
4305
+ toolUseId: toolCall.id,
4306
+ name: toolCall.function.name,
4307
+ input: parseToolArguments(toolCall.function.arguments)
4308
+ }
4309
+ }));
4310
+ }
4311
+ function toConverseMessage(message) {
4312
+ if (message.role === "system") {
4313
+ return null;
4314
+ }
4315
+ if (message.role === "tool") {
4316
+ return {
4317
+ role: "user",
4318
+ content: [
4319
+ {
4320
+ toolResult: {
4321
+ toolUseId: message.tool_call_id ?? message.name ?? "tool_result",
4322
+ content: [{ text: message.content }]
4323
+ }
4324
+ }
4325
+ ]
4326
+ };
4327
+ }
4328
+ if (message.role === "assistant") {
4329
+ const content = [
4330
+ ...toTextContent(message.content),
4331
+ ...message.tool_calls?.length ? toToolUseBlocks(message.tool_calls) : []
4332
+ ];
4333
+ return {
4334
+ role: "assistant",
4335
+ content: content.length > 0 ? content : [{ text: "" }]
4336
+ };
4337
+ }
4338
+ return {
4339
+ role: "user",
4340
+ content: toTextContent(message.content)
4341
+ };
4342
+ }
4343
+ function toOpenAIMessage(message) {
4344
+ const mapped = {
4345
+ role: message.role,
4346
+ content: message.role === "assistant" && message.tool_calls?.length ? message.content || null : message.content
4347
+ };
4348
+ if (message.name) mapped.name = message.name;
4349
+ if (message.role === "tool" && message.tool_call_id) {
4350
+ mapped.tool_call_id = message.tool_call_id;
4351
+ }
4352
+ if (message.role === "assistant" && message.tool_calls?.length) {
4353
+ mapped.tool_calls = message.tool_calls;
4354
+ }
4355
+ return mapped;
4356
+ }
4357
+ function toResponsesInputItem(message) {
4358
+ if (message.role === "tool" && message.tool_call_id) {
4359
+ return [
4360
+ {
4361
+ type: "function_call_output",
4362
+ call_id: message.tool_call_id,
4363
+ output: message.content
4364
+ }
4365
+ ];
4366
+ }
4367
+ if (message.role === "assistant" && message.tool_calls?.length) {
4368
+ return message.tool_calls.map((toolCall) => ({
4369
+ type: "function_call",
4370
+ call_id: toolCall.id,
4371
+ name: toolCall.function.name,
4372
+ arguments: toolCall.function.arguments
4373
+ }));
4374
+ }
4375
+ if (message.role === "system") {
4376
+ return [];
4377
+ }
4378
+ const contentType = message.role === "assistant" ? "output_text" : "input_text";
4379
+ return [
4380
+ {
4381
+ role: message.role,
4382
+ content: [{ type: contentType, text: message.content }]
4383
+ }
4384
+ ];
4385
+ }
4386
+ function toOpenAITools(tools) {
4387
+ return tools.map((tool) => ({
4388
+ type: "function",
4389
+ function: {
4390
+ name: tool.name,
4391
+ description: tool.description,
4392
+ parameters: tool.parameters ?? { type: "object", properties: {} }
4393
+ }
4394
+ }));
4395
+ }
4396
+ function toResponsesTools(tools) {
4397
+ return tools.map((tool) => ({
4398
+ type: "function",
4399
+ name: tool.name,
4400
+ description: tool.description,
4401
+ parameters: tool.parameters ?? { type: "object", properties: {} }
4402
+ }));
4403
+ }
4404
+ function toConverseTools(tools) {
4405
+ return tools.map((tool) => ({
4406
+ toolSpec: {
4407
+ name: tool.name,
4408
+ description: tool.description,
4409
+ inputSchema: {
4410
+ json: tool.parameters ?? { type: "object", properties: {} }
4411
+ }
4412
+ }
4413
+ }));
4414
+ }
4415
+ function normalizeStopReason(stopReason) {
4416
+ if (stopReason === "tool_use" || stopReason === "tool_calls") {
4417
+ return "tool_calls";
4418
+ }
4419
+ if (stopReason === "max_tokens" || stopReason === "length") {
4420
+ return "length";
4421
+ }
4422
+ if (stopReason === "content_filter") {
4423
+ return "content_filter";
4424
+ }
4425
+ return "stop";
4426
+ }
4427
+ function toolCallsFromConverseBlocks(blocks) {
4428
+ return blocks.filter(
4429
+ (block) => "toolUse" in block && Boolean(block.toolUse)
4430
+ ).map((block) => ({
4431
+ id: block.toolUse.toolUseId,
4432
+ type: "function",
4433
+ function: {
4434
+ name: block.toolUse.name,
4435
+ arguments: JSON.stringify(block.toolUse.input ?? {})
4436
+ }
4437
+ }));
4438
+ }
4439
+ function textFromConverseBlocks(blocks) {
4440
+ return blocks.filter((block) => "text" in block).map((block) => block.text).join("");
4441
+ }
4442
+ function isBedrockAwsError(error) {
4443
+ return error instanceof Error;
4444
+ }
4445
+ function classifyBedrockError(error) {
4446
+ if (!isBedrockAwsError(error)) {
4447
+ return new ApiError(String(error), "unknown", 0, true);
4448
+ }
4449
+ if (error.name === "AbortError") {
4450
+ return new ApiError("Request cancelled.", "cancelled", 0, false);
4451
+ }
4452
+ const status = error["$metadata"]?.httpStatusCode ?? 0;
4453
+ const message = error.message || error.name;
4454
+ const lower = `${error.name} ${message}`.toLowerCase();
4455
+ let code;
4456
+ if (lower.includes("credential") || lower.includes("signature") || lower.includes("unrecognizedclient") || lower.includes("expiredtoken")) {
4457
+ code = "auth_failed";
4458
+ } else if (lower.includes("accessdenied") || lower.includes("access denied") || lower.includes("not authorized") || lower.includes("model access")) {
4459
+ code = "access_denied";
4460
+ } else if (lower.includes("resourcenotfound") || lower.includes("model not found") || lower.includes("not found") || lower.includes("not available")) {
4461
+ code = "model_not_found";
4462
+ } else if (lower.includes("throttl") || lower.includes("quota") || lower.includes("toomanyrequests")) {
4463
+ code = "rate_limited";
4464
+ } else if (lower.includes("validation") || lower.includes("unsupported") || lower.includes("api mode")) {
4465
+ code = "invalid_request";
4466
+ } else if (lower.includes("network") || lower.includes("enotfound") || lower.includes("econn") || lower.includes("private endpoint")) {
4467
+ code = "network_error";
4468
+ }
4469
+ if (code) {
4470
+ const friendly = {
4471
+ auth_failed: "AWS Bedrock credentials were not found or were rejected. Configure AWS credentials, AWS_PROFILE, instance metadata, or choose Bedrock API key auth.",
4472
+ access_denied: "AWS Bedrock denied access. Enable model access in the AWS console and verify IAM permissions for this model.",
4473
+ model_not_found: "The selected Bedrock model is not available in this region. Check the model ID, inference profile, ARN, and region.",
4474
+ invalid_request: "Bedrock rejected the request. The selected model may not support this API mode or native tool use.",
4475
+ rate_limited: "AWS Bedrock throttled the request or quota was exceeded. Wait and retry, or request a quota increase.",
4476
+ network_error: "Unable to reach the AWS Bedrock endpoint. Check region, endpoint, private networking, and proxy settings.",
4477
+ timeout: "The AWS Bedrock request timed out.",
4478
+ cancelled: "Request cancelled.",
4479
+ context_overflow: "The conversation is too long for this Bedrock model.",
4480
+ payment_required: "AWS Bedrock billing or account setup is required.",
4481
+ server_error: "AWS Bedrock encountered a service error. Please try again later.",
4482
+ unknown: "AWS Bedrock returned an unexpected error."
4483
+ };
4484
+ return new ApiError(`${friendly[code]}
4485
+ ${message}`, code, status, code === "rate_limited" || code === "server_error", void 0, message);
4486
+ }
4487
+ return classifyApiError(status, message);
4488
+ }
4489
+ async function readErrorBody(response) {
4490
+ try {
4491
+ return await response.text();
4492
+ } catch {
4493
+ return "";
4494
+ }
4495
+ }
4496
+ var BedrockProvider = class {
4497
+ apiMode;
4498
+ authMode;
4499
+ region;
4500
+ endpoint;
4501
+ profile;
4502
+ apiKey;
4503
+ model;
4504
+ runtimeClient;
4505
+ modelClient;
4506
+ constructor(config) {
4507
+ this.apiMode = config.apiMode ?? "converse";
4508
+ this.authMode = resolveBedrockAuthMode(this.apiMode, config.authMode);
4509
+ this.region = resolveBedrockRegion(config.region);
4510
+ this.endpoint = resolveBedrockEndpoint(this.apiMode, this.region, config.endpoint);
4511
+ this.profile = config.profile;
4512
+ this.apiKey = config.apiKey;
4513
+ this.model = config.model || BEDROCK_DEFAULT_MODEL;
4514
+ }
4515
+ getName() {
4516
+ return "bedrock";
4517
+ }
4518
+ setModel(model) {
4519
+ this.model = model;
4520
+ }
4521
+ getCapabilities() {
4522
+ return { nativeToolCalling: true };
4523
+ }
4524
+ async listModels() {
4525
+ if (this.apiMode !== "converse") {
4526
+ return [...BEDROCK_MODELS];
4527
+ }
4528
+ try {
4529
+ const response = await this.getModelClient().send(
4530
+ new ListFoundationModelsCommand({})
4531
+ );
4532
+ const summaries = response.modelSummaries ?? [];
4533
+ const modelIds = summaries.map((summary) => summary.modelId).filter((modelId) => Boolean(modelId));
4534
+ return modelIds.length > 0 ? modelIds : [...BEDROCK_MODELS];
4535
+ } catch {
4536
+ return [...BEDROCK_MODELS];
4537
+ }
4538
+ }
4539
+ async isAvailable() {
4540
+ if (this.authMode === "bedrock-api-key") {
4541
+ return Boolean(this.apiKey);
4542
+ }
4543
+ try {
4544
+ await this.listModels();
4545
+ return true;
4546
+ } catch {
4547
+ return false;
4548
+ }
4549
+ }
4550
+ async complete(request) {
4551
+ if (!this.region) {
4552
+ throw new ApiError(
4553
+ "AWS Bedrock region is missing. Set bedrock.region, AWS_REGION, or AWS_DEFAULT_REGION.",
4554
+ "invalid_request",
4555
+ 0,
4556
+ false
4557
+ );
4558
+ }
4559
+ if (this.apiMode === "converse") {
4560
+ return this.completeWithConverse(request);
4561
+ }
4562
+ return this.completeWithOpenAICompatible(request);
4563
+ }
4564
+ getCredentials() {
4565
+ if (this.profile) {
4566
+ return fromIni({ profile: this.profile });
4567
+ }
4568
+ return void 0;
4569
+ }
4570
+ getRuntimeClient() {
4571
+ if (!this.runtimeClient) {
4572
+ this.runtimeClient = new BedrockRuntimeClient({
4573
+ region: this.region,
4574
+ endpoint: this.endpoint,
4575
+ credentials: this.getCredentials()
4576
+ });
4577
+ }
4578
+ return this.runtimeClient;
4579
+ }
4580
+ getModelClient() {
4581
+ if (!this.modelClient) {
4582
+ this.modelClient = new BedrockClient({
4583
+ region: this.region,
4584
+ credentials: this.getCredentials()
4585
+ });
4586
+ }
4587
+ return this.modelClient;
4588
+ }
4589
+ async completeWithConverse(request) {
4590
+ if (this.authMode === "bedrock-api-key") {
4591
+ throw new ApiError(
4592
+ "Bedrock Converse uses AWS credential-chain auth. Choose apiMode openai-chat/openai-responses to use Bedrock API keys.",
4593
+ "invalid_request",
4594
+ 0,
4595
+ false
4596
+ );
4597
+ }
4598
+ const contentMessages = request.messages.map(toConverseMessage).filter((message) => message !== null);
4599
+ const system = request.messages.filter((message) => message.role === "system" && message.content).map((message) => ({ text: message.content }));
4600
+ const body = {
4601
+ modelId: request.model ?? this.model,
4602
+ messages: contentMessages,
4603
+ inferenceConfig: {
4604
+ ...request.maxTokens !== void 0 && { maxTokens: request.maxTokens },
4605
+ ...request.temperature !== void 0 && { temperature: request.temperature }
4606
+ }
4607
+ };
4608
+ if (system.length > 0) {
4609
+ body.system = system;
4610
+ }
4611
+ if (request.tools?.length) {
4612
+ body.toolConfig = {
4613
+ tools: toConverseTools(request.tools),
4614
+ ...request.toolChoice && request.toolChoice !== "auto" ? { toolChoice: this.toConverseToolChoice(request.toolChoice) } : {}
4615
+ };
4616
+ }
4617
+ try {
4618
+ const data = await this.getRuntimeClient().send(
4619
+ new ConverseCommand(body)
4620
+ );
4621
+ const blocks = data.output?.message?.content ?? [];
4622
+ const toolCalls = toolCallsFromConverseBlocks(blocks);
4623
+ return {
4624
+ id: `bedrock-${Date.now()}`,
4625
+ created: Math.floor(Date.now() / 1e3),
4626
+ content: textFromConverseBlocks(blocks),
4627
+ ...toolCalls.length > 0 && { toolCalls },
4628
+ finishReason: normalizeStopReason(data.stopReason),
4629
+ usage: normalizeLLMUsage(data.usage),
4630
+ raw: data
4631
+ };
4632
+ } catch (error) {
4633
+ throw classifyBedrockError(error);
4634
+ }
4635
+ }
4636
+ toConverseToolChoice(toolChoice) {
4637
+ if (!toolChoice || toolChoice === "auto") return void 0;
4638
+ if (toolChoice === "none") return { auto: {} };
4639
+ if (toolChoice === "required") return { any: {} };
4640
+ return { tool: { name: toolChoice.function.name } };
4641
+ }
4642
+ async completeWithOpenAICompatible(request) {
4643
+ if (this.authMode !== "bedrock-api-key") {
4644
+ throw new ApiError(
4645
+ "Bedrock OpenAI-compatible modes require authMode bedrock-api-key and bedrock.apiKey.",
4646
+ "auth_failed",
4647
+ 0,
4648
+ false
4649
+ );
4650
+ }
4651
+ if (!this.apiKey) {
4652
+ throw new ApiError(
4653
+ "Bedrock API key is missing. Set bedrock.apiKey for OpenAI-compatible Bedrock modes.",
4654
+ "auth_failed",
4655
+ 0,
4656
+ false
4657
+ );
4658
+ }
4659
+ if (this.apiMode === "openai-chat") {
4660
+ return this.completeWithOpenAIChat(request);
4661
+ }
4662
+ return this.completeWithOpenAIResponses(request);
4663
+ }
4664
+ async completeWithOpenAIChat(request) {
4665
+ const body = {
4666
+ model: request.model ?? this.model,
4667
+ messages: request.messages.map(toOpenAIMessage),
4668
+ ...request.temperature !== void 0 && { temperature: request.temperature },
4669
+ ...request.maxTokens !== void 0 && { max_tokens: request.maxTokens }
4670
+ };
4671
+ if (request.tools?.length) {
4672
+ body.tools = toOpenAITools(request.tools);
4673
+ if (request.toolChoice) body.tool_choice = request.toolChoice;
4674
+ }
4675
+ const data = await this.fetchJson("/chat/completions", body, request.signal);
4676
+ const choice = data.choices?.[0];
4677
+ if (!choice?.message) {
4678
+ throw new ApiError(
4679
+ "Malformed Bedrock OpenAI chat response: missing choice message.",
4680
+ "invalid_request",
4681
+ 200,
4682
+ false,
4683
+ void 0,
4684
+ JSON.stringify(data)
4685
+ );
4686
+ }
4687
+ return {
4688
+ id: data.id ?? `bedrock-chat-${Date.now()}`,
4689
+ created: data.created ?? Math.floor(Date.now() / 1e3),
4690
+ content: choice.message.content ?? "",
4691
+ ...choice.message.tool_calls?.length && { toolCalls: choice.message.tool_calls },
4692
+ finishReason: normalizeStopReason(choice.finish_reason),
4693
+ usage: normalizeLLMUsage(data.usage),
4694
+ raw: data
4695
+ };
4696
+ }
4697
+ async completeWithOpenAIResponses(request) {
4698
+ const instructions = request.messages.filter((message) => message.role === "system").map((message) => message.content).join("\n\n");
4699
+ const body = {
4700
+ model: request.model ?? this.model,
4701
+ input: request.messages.flatMap(toResponsesInputItem),
4702
+ ...instructions && { instructions },
4703
+ ...request.maxTokens !== void 0 && { max_output_tokens: request.maxTokens }
4704
+ };
4705
+ if (request.tools?.length) {
4706
+ body.tools = toResponsesTools(request.tools);
4707
+ if (request.toolChoice) body.tool_choice = request.toolChoice;
4708
+ }
4709
+ const data = await this.fetchJson("/responses", body, request.signal);
4710
+ const functionCalls = (data.output ?? []).filter(
4711
+ (item) => item.type === "function_call" && typeof item.name === "string" && typeof item.arguments === "string"
4712
+ ).map((item) => ({
4713
+ id: item.call_id ?? item.id ?? `call_${Date.now()}`,
4714
+ type: "function",
4715
+ function: {
4716
+ name: item.name,
4717
+ arguments: item.arguments
4718
+ }
4719
+ }));
4720
+ return {
4721
+ id: data.id ?? `bedrock-responses-${Date.now()}`,
4722
+ created: data.created_at ?? Math.floor(Date.now() / 1e3),
4723
+ content: data.output_text ?? "",
4724
+ ...functionCalls.length > 0 && { toolCalls: functionCalls },
4725
+ finishReason: functionCalls.length > 0 ? "tool_calls" : "stop",
4726
+ usage: normalizeLLMUsage(data.usage),
4727
+ raw: data
4728
+ };
4729
+ }
4730
+ async fetchJson(path, body, signal) {
4731
+ let response;
4732
+ try {
4733
+ response = await fetch(`${this.endpoint}${path}`, {
4734
+ method: "POST",
4735
+ headers: {
4736
+ "Content-Type": "application/json",
4737
+ Authorization: `Bearer ${this.apiKey}`
4738
+ },
4739
+ body: JSON.stringify(body),
4740
+ signal
4741
+ });
4742
+ } catch (error) {
4743
+ const err = error;
4744
+ if (err.name === "AbortError" && signal?.aborted) {
4745
+ throw new ApiError("Request cancelled.", "cancelled", 0, false);
4746
+ }
4747
+ if (err.name === "AbortError") {
4748
+ throw new ApiError("The Bedrock request timed out.", "timeout", 0, true);
4749
+ }
4750
+ throw new ApiError(
4751
+ "Unable to connect to the Bedrock OpenAI-compatible endpoint. Check region, endpoint, private networking, and proxy settings.",
4752
+ "network_error",
4753
+ 0,
4754
+ true,
4755
+ void 0,
4756
+ err.message
4757
+ );
4758
+ }
4759
+ if (!response.ok) {
4760
+ const errorBody = await readErrorBody(response);
4761
+ const classified = classifyApiError(response.status, errorBody, response.headers);
4762
+ throw new ApiError(
4763
+ `AWS Bedrock request failed.
4764
+ ${classified.message}`,
4765
+ classified.code,
4766
+ classified.httpStatus,
4767
+ classified.retryable,
4768
+ classified.retryAfterMs,
4769
+ classified.rawDetail
4770
+ );
4771
+ }
4772
+ try {
4773
+ return await response.json();
4774
+ } catch (error) {
4775
+ throw new ApiError(
4776
+ "Malformed Bedrock response: response body was not valid JSON.",
4777
+ "invalid_request",
4778
+ response.status,
4779
+ false,
4780
+ void 0,
4781
+ error instanceof Error ? error.message : String(error)
4782
+ );
4783
+ }
4784
+ }
4785
+ };
4786
+
4135
4787
  // src/providers/ProviderFactory.ts
4136
4788
  var ProviderNotConfiguredError = class extends Error {
4137
4789
  constructor(providerName) {
@@ -4169,6 +4821,9 @@ var ProviderFactory = class {
4169
4821
  */
4170
4822
  static create(config) {
4171
4823
  const providerName = config.provider || "openrouter";
4824
+ if (providerName === "bedrock" && !isAwsBedrockProviderEnabled(config)) {
4825
+ return new UnconfiguredProvider("bedrock");
4826
+ }
4172
4827
  switch (providerName) {
4173
4828
  case "ollama":
4174
4829
  if (!config.ollama) {
@@ -4230,6 +4885,11 @@ var ProviderFactory = class {
4230
4885
  return new UnconfiguredProvider("deepseek");
4231
4886
  }
4232
4887
  return new DeepSeekProvider(config.deepseek, config.network);
4888
+ case "bedrock":
4889
+ if (!config.bedrock) {
4890
+ return new UnconfiguredProvider("bedrock");
4891
+ }
4892
+ return new BedrockProvider(config.bedrock);
4233
4893
  case "openrouter":
4234
4894
  default:
4235
4895
  if (!config.openrouter) {
@@ -4242,8 +4902,11 @@ var ProviderFactory = class {
4242
4902
  * Get all available provider names.
4243
4903
  * MLX is only included on Apple Silicon (macOS + arm64).
4244
4904
  */
4245
- static getProviderNames() {
4905
+ static getProviderNames(config) {
4246
4906
  const providers = ["zai", "xai", "vertexai", "nvidia", "openrouter", "openai", "ollama", "llmgateway", "llamacpp", "deepseek", "cerebras", "azure"];
4907
+ if (isAwsBedrockProviderEnabled(config)) {
4908
+ providers.splice(providers.indexOf("azure"), 0, "bedrock");
4909
+ }
4247
4910
  if (isMLXSupported()) {
4248
4911
  providers.push("mlx");
4249
4912
  }
@@ -4254,8 +4917,11 @@ var ProviderFactory = class {
4254
4917
  * Note: This checks if the name is a valid provider type, not if it's available on this platform.
4255
4918
  * MLX is always a valid provider name, but may not be available on non-Apple Silicon systems.
4256
4919
  */
4257
- static isValidProvider(name) {
4258
- const allProviders = ["openrouter", "ollama", "openai", "llamacpp", "mlx", "llmgateway", "azure", "zai", "vertexai", "xai", "cerebras", "nvidia", "deepseek"];
4920
+ static isValidProvider(name, config) {
4921
+ if (name === "bedrock" && !isAwsBedrockProviderEnabled(config)) {
4922
+ return false;
4923
+ }
4924
+ const allProviders = ["openrouter", "ollama", "openai", "llamacpp", "mlx", "llmgateway", "azure", "zai", "vertexai", "xai", "cerebras", "nvidia", "deepseek", "bedrock"];
4259
4925
  return allProviders.includes(name);
4260
4926
  }
4261
4927
  };
@@ -4277,6 +4943,11 @@ export {
4277
4943
  CEREBRAS_MODELS,
4278
4944
  DEEPSEEK_DEFAULT_BASE_URL,
4279
4945
  DEEPSEEK_MODELS,
4946
+ BEDROCK_DEFAULT_REGION,
4947
+ BEDROCK_DEFAULT_MODEL,
4948
+ BEDROCK_MODELS,
4949
+ resolveBedrockEndpoint,
4950
+ resolveBedrockAuthMode,
4280
4951
  ProviderNotConfiguredError,
4281
4952
  ProviderFactory
4282
4953
  };
@@ -4289,3 +4960,8 @@ export {
4289
4960
  * Google Cloud CLI authentication utilities
4290
4961
  * @license Apache-2.0
4291
4962
  */
4963
+ /**
4964
+ * @license
4965
+ * Copyright 2026 Autohand AI LLC
4966
+ * SPDX-License-Identifier: Apache-2.0
4967
+ */