@qwen-code/qwen-code 0.23.5-preview.0 → 0.24.0-nightly.20260917.f822124af5

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 (498) hide show
  1. package/bundled/goal-draft/SKILL.md +5 -5
  2. package/bundled/qc-helper/docs/configuration/auth.md +1 -0
  3. package/bundled/qc-helper/docs/configuration/model-providers.md +43 -14
  4. package/bundled/qc-helper/docs/configuration/settings.md +2 -1
  5. package/bundled/qc-helper/docs/extension/introduction.md +2 -0
  6. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  7. package/bundled/qc-helper/docs/features/goals.md +11 -11
  8. package/bundled/qc-helper/docs/features/hooks.md +8 -10
  9. package/bundled/qc-helper/docs/features/omni-fixed-policies-preset.json +242 -0
  10. package/bundled/qc-helper/docs/features/omni-media-policies.md +443 -0
  11. package/bundled/qc-helper/docs/overview.md +1 -1
  12. package/bundled/qc-helper/docs/quickstart.md +2 -3
  13. package/bundled/review/SKILL.md +1 -1
  14. package/bundled/workflow-authoring/SKILL.md +22 -7
  15. package/chunks/MaxSizedBox-4VDYUHUI.js +148 -0
  16. package/chunks/{StandaloneSessionPicker-V635V72I.js → StandaloneSessionPicker-SGMGJOH3.js} +115 -91
  17. package/chunks/acp-subagent-executor-EGAATYQA.js +164 -0
  18. package/chunks/{acpAgent-3DPWZTNC.js → acpAgent-2JQ2N2T5.js} +361 -229
  19. package/chunks/{agent-KIHGINKN.js → agent-QWNE3MPD.js} +59 -49
  20. package/chunks/agent-headless-GRSMZK5Z.js +104 -0
  21. package/chunks/{anthropicContentGenerator-4FGOM5LK.js → anthropicContentGenerator-INV24RMG.js} +30 -27
  22. package/chunks/{artifact-tool-MUTNH4NI.js → artifact-tool-3MWM6SN2.js} +11 -7
  23. package/chunks/{askUserQuestion-AKIRLVB5.js → askUserQuestion-YFFBB4K3.js} +6 -4
  24. package/chunks/bridge-R65BJ2YL.js +156 -0
  25. package/chunks/{build-5KWQBWEQ.js → build-5OQN7CDU.js} +1 -1
  26. package/chunks/caption-audio-UXXLI3JZ.js +443 -0
  27. package/chunks/caption-image-B7O4TUFP.js +247 -0
  28. package/chunks/{channel-management-service-RRILWSXX.js → channel-management-service-GRJG5R46.js} +1 -1
  29. package/chunks/channel-settings-store-TBLCDTV2.js +158 -0
  30. package/chunks/{channel-worker-group-3DUJFZJR.js → channel-worker-group-SCSKCSBJ.js} +4 -4
  31. package/chunks/{channel-worker-manager-E5UW2VLA.js → channel-worker-manager-AHCZCKON.js} +4 -4
  32. package/chunks/{channel-worker-supervisor-VN33GSEC.js → channel-worker-supervisor-BGUAVITB.js} +3 -3
  33. package/chunks/{chunk-5NUKK2DT.js → chunk-25FMWESU.js} +47 -8
  34. package/chunks/{chunk-VVI7MK3V.js → chunk-2A6RZKP2.js} +9 -7
  35. package/chunks/{chunk-3WWPEFMX.js → chunk-2FQM443D.js} +82 -4
  36. package/chunks/{chunk-D3KVGQUV.js → chunk-37XDTMFG.js} +4 -4
  37. package/chunks/{chunk-TDKUXSJO.js → chunk-3MW6PPA5.js} +1 -1
  38. package/chunks/{chunk-4LIPOIXS.js → chunk-3NHJLWOD.js} +1 -1
  39. package/chunks/{chunk-AQP3H22J.js → chunk-3ZGIRRAE.js} +1 -1
  40. package/chunks/{chunk-WSJI6ODG.js → chunk-422D2UIO.js} +210 -150
  41. package/chunks/chunk-43QUA4MC.js +135 -0
  42. package/chunks/{chunk-Q2SAQTEJ.js → chunk-4B7U3KQP.js} +1 -1
  43. package/chunks/{chunk-SFL6U7U7.js → chunk-4JFRCIMW.js} +2 -2
  44. package/chunks/{chunk-IVFTLUZD.js → chunk-4SZ2636R.js} +3 -3
  45. package/chunks/{chunk-6OTF7TTE.js → chunk-4VYTH6OF.js} +24 -1
  46. package/chunks/{chunk-7CLLH5TI.js → chunk-4YS7RMCB.js} +6 -4
  47. package/chunks/{chunk-BW2SMO6L.js → chunk-5FHOPPLZ.js} +1 -1
  48. package/chunks/{chunk-QIPLWW6Q.js → chunk-5MYQ66UF.js} +1 -1
  49. package/chunks/{chunk-TXTCM3TC.js → chunk-5VDOVBNG.js} +18 -14
  50. package/chunks/{chunk-L2A5VBDL.js → chunk-67ZCKSV6.js} +9 -9
  51. package/chunks/chunk-6C3D7BKK.js +153 -0
  52. package/chunks/{chunk-DC4ZNGH4.js → chunk-6DB6UHY3.js} +3 -3
  53. package/chunks/{chunk-AXPOOQAW.js → chunk-736AZVPL.js} +2 -2
  54. package/chunks/{chunk-M22WLKLI.js → chunk-77ORAIEF.js} +7 -7
  55. package/chunks/{chunk-BUQN5LTI.js → chunk-7PQ65Z5F.js} +2 -2
  56. package/chunks/{chunk-CXY6BICQ.js → chunk-A5EGR6ZS.js} +204 -120
  57. package/chunks/{chunk-VQDWCQOE.js → chunk-ANKISCKU.js} +1 -0
  58. package/chunks/{chunk-7D4CV7JH.js → chunk-APHDK7GV.js} +116 -4
  59. package/chunks/{chunk-B5TJK7B3.js → chunk-ARKOX7HM.js} +1 -1
  60. package/chunks/{chunk-NXUZFW3G.js → chunk-AUFTA63J.js} +1 -1
  61. package/chunks/{chunk-36SDZ2Q4.js → chunk-B3HGO6BB.js} +7 -5
  62. package/chunks/{chunk-6USYH3EU.js → chunk-B3XJFEEH.js} +5 -3
  63. package/chunks/{chunk-AEWCOE64.js → chunk-B5WYAQ4I.js} +2 -2
  64. package/chunks/{chunk-GSKX53AN.js → chunk-BA6AXQDA.js} +1 -1
  65. package/chunks/{chunk-Y2KJC55Y.js → chunk-BBHLWLIK.js} +4 -4
  66. package/chunks/chunk-BKVPLSEI.js +133 -0
  67. package/chunks/chunk-BQMSZSG6.js +21 -0
  68. package/chunks/{chunk-3LMDSCLU.js → chunk-C4FISGDN.js} +2 -2
  69. package/chunks/{chunk-SFHX5G2S.js → chunk-C4MMZVYX.js} +80 -15
  70. package/chunks/{chunk-4JFLRHNE.js → chunk-C4QWV63F.js} +1 -1
  71. package/chunks/{chunk-XFFRI3WM.js → chunk-CA63HYHU.js} +4 -2
  72. package/chunks/{chunk-FBY32737.js → chunk-CJNWKJFH.js} +4 -4
  73. package/chunks/{chunk-QT6Z2IBF.js → chunk-CYFQLCCG.js} +2 -2
  74. package/chunks/{chunk-X7AYIXC7.js → chunk-DJLCK66M.js} +5 -3
  75. package/chunks/chunk-DJYHML3Y.js +121 -0
  76. package/chunks/{chunk-MO4XID7S.js → chunk-DNDECZXY.js} +3 -3
  77. package/chunks/{chunk-H6L4NEAT.js → chunk-DQCGGSDO.js} +1 -1
  78. package/chunks/{chunk-347O2YZJ.js → chunk-DUWQ5Q6R.js} +115 -67
  79. package/chunks/{chunk-FEDFZBGR.js → chunk-E6A52AP2.js} +28 -17
  80. package/chunks/{chunk-TIGXX4PA.js → chunk-EKBQJ627.js} +2 -2
  81. package/chunks/{chunk-RSWBT7AZ.js → chunk-ERIBG3BX.js} +35 -551
  82. package/chunks/{chunk-PPJSG2PU.js → chunk-EVZT24AF.js} +6 -142
  83. package/chunks/{chunk-YZXSDPOQ.js → chunk-F7L4ZMKS.js} +84 -40
  84. package/chunks/{chunk-HX4WXX3H.js → chunk-FGAWVV4X.js} +101 -75
  85. package/chunks/chunk-FT3O44AZ.js +1635 -0
  86. package/chunks/chunk-FTKXJMQV.js +255 -0
  87. package/chunks/{chunk-5FK4MSHB.js → chunk-FWP5GZRY.js} +6 -4
  88. package/chunks/{chunk-TRZ22SG5.js → chunk-FXPP7VLM.js} +6 -4
  89. package/chunks/{chunk-INN5ORKX.js → chunk-G25IQMCV.js} +1 -1
  90. package/chunks/{chunk-OWUAZXXN.js → chunk-GHG4PQY2.js} +3 -3
  91. package/chunks/{chunk-FASYATAZ.js → chunk-GL5TRVMS.js} +1 -1
  92. package/chunks/{chunk-G45B3INR.js → chunk-GVTAFLWB.js} +2 -2
  93. package/chunks/{chunk-G6UUOCUT.js → chunk-GXNXX7A2.js} +7 -1
  94. package/chunks/{chunk-GI7SLDOI.js → chunk-HUUBCY33.js} +6 -6
  95. package/chunks/chunk-I7MIPRIQ.js +181 -0
  96. package/chunks/{chunk-NQ272MQG.js → chunk-IAKJXTGS.js} +7 -5
  97. package/chunks/{chunk-V4JJAVHQ.js → chunk-ID7XHHY5.js} +2 -2
  98. package/chunks/{chunk-IXO2OCIP.js → chunk-IIHFUREY.js} +12 -8
  99. package/chunks/{chunk-IZ2U57NY.js → chunk-IITTKFWM.js} +4 -2
  100. package/chunks/chunk-IVPSLX4P.js +578 -0
  101. package/chunks/{chunk-BTICBRPL.js → chunk-IWMYX5LB.js} +3 -3
  102. package/chunks/{chunk-UZSB57EV.js → chunk-JR2WFCQG.js} +29 -17
  103. package/chunks/{chunk-GJKP6XOB.js → chunk-JWV5GI77.js} +16 -19
  104. package/chunks/chunk-JYGESWZM.js +149 -0
  105. package/chunks/{chunk-KVC7HZWK.js → chunk-JYTJ5FCM.js} +1 -1
  106. package/chunks/{chunk-SOLRBF7L.js → chunk-JZUSFW64.js} +10 -10
  107. package/chunks/{chunk-CDDP4ONL.js → chunk-K2T5PKFS.js} +60 -134
  108. package/chunks/{chunk-EIBECN2J.js → chunk-K5VVDHDV.js} +5 -5
  109. package/chunks/{chunk-NKTMUPHJ.js → chunk-KDM4KSVG.js} +14 -4
  110. package/chunks/{chunk-3WILPKTJ.js → chunk-KKPIFWTZ.js} +11 -6
  111. package/chunks/{chunk-3HTUE6ZR.js → chunk-KPK6NQVR.js} +4 -4
  112. package/chunks/{chunk-CXONOVBN.js → chunk-KS6F6LZQ.js} +8 -6
  113. package/chunks/{chunk-D7JMO2GP.js → chunk-KSECLXYH.js} +1 -1
  114. package/chunks/chunk-KSEKRQJO.js +253 -0
  115. package/chunks/{chunk-KEM7MWS7.js → chunk-KWZ2DDOC.js} +765 -428
  116. package/chunks/{chunk-U4AASWUQ.js → chunk-L4GF4IK2.js} +3 -3
  117. package/chunks/{chunk-CQPM66MG.js → chunk-L7HFHYGB.js} +4 -4
  118. package/chunks/{chunk-DJXSOEFB.js → chunk-LAE6RY3L.js} +1 -1
  119. package/chunks/{chunk-WNQIJTOP.js → chunk-LDM3JQZF.js} +243 -17
  120. package/chunks/{chunk-KVQ3QL4K.js → chunk-LLTRNLK2.js} +3 -3
  121. package/chunks/{chunk-IKBEIDOH.js → chunk-LVXTBFWP.js} +13 -13
  122. package/chunks/{chunk-AKRSSKUT.js → chunk-LWALWKFU.js} +10 -10
  123. package/chunks/{chunk-WL36KHUQ.js → chunk-LWV4RLBT.js} +11 -9
  124. package/chunks/{chunk-3BZI5GDP.js → chunk-M5YIHMXP.js} +6 -4
  125. package/chunks/{chunk-6WXVEDT2.js → chunk-MC2RYJMU.js} +5 -3
  126. package/chunks/chunk-MNU36NGH.js +233 -0
  127. package/chunks/{chunk-ZMYKNKET.js → chunk-MQWZWHTY.js} +3 -3
  128. package/chunks/{chunk-M4U2LTD2.js → chunk-MS4SXNJ6.js} +1 -1
  129. package/chunks/{chunk-QHSOINX6.js → chunk-MZKXPQWL.js} +2 -2
  130. package/chunks/{chunk-36NRLIR6.js → chunk-NBLWUMYE.js} +13 -11
  131. package/chunks/{chunk-DRAX5YAI.js → chunk-NFC4WTY2.js} +6 -4
  132. package/chunks/chunk-NX6JUO42.js +102 -0
  133. package/chunks/chunk-O345BAI3.js +42 -0
  134. package/chunks/{chunk-YM6KUQ2S.js → chunk-O4A2B6V2.js} +3 -3
  135. package/chunks/chunk-O55EKI4S.js +7668 -0
  136. package/chunks/{chunk-3UGMLA4V.js → chunk-OA5H5PPQ.js} +10 -10
  137. package/chunks/{chunk-DX6JTDMR.js → chunk-OB57Y2WH.js} +1 -1
  138. package/chunks/{chunk-4QPVZA5J.js → chunk-OOSOAFCT.js} +3 -3
  139. package/chunks/{chunk-E2VSBAFA.js → chunk-OXBD7VUE.js} +5 -5
  140. package/chunks/{chunk-M23GFJ5B.js → chunk-OY5GQPMU.js} +1 -1
  141. package/chunks/chunk-PF3RVYRK.js +108 -0
  142. package/chunks/{chunk-XWJFDJZK.js → chunk-PJSZXERN.js} +1 -1
  143. package/chunks/{chunk-GSAOVDTH.js → chunk-POMFSBEC.js} +4 -4
  144. package/chunks/{chunk-EWNKP4V4.js → chunk-PPVM7YLS.js} +1 -1
  145. package/chunks/{chunk-WK6DEH3Q.js → chunk-PQQV3OBW.js} +6 -4
  146. package/chunks/{chunk-ZSTCM3MX.js → chunk-Q5N5NEVT.js} +1 -1
  147. package/chunks/{chunk-HYHSMTRA.js → chunk-QCTWNYL6.js} +4 -4
  148. package/chunks/{chunk-KFFCDLKV.js → chunk-QE36VXWP.js} +1 -1
  149. package/chunks/{chunk-3LLEB5CU.js → chunk-QG73VXTF.js} +2 -2
  150. package/chunks/{chunk-QMENOK5T.js → chunk-QJJN2VJY.js} +10 -8
  151. package/chunks/{chunk-XICCGDWF.js → chunk-QKYAXSNG.js} +2 -2
  152. package/chunks/{chunk-V545KI73.js → chunk-QPTE6BKL.js} +1 -1
  153. package/chunks/{chunk-2GP6BQ2J.js → chunk-RA6PKQVM.js} +2 -2
  154. package/chunks/{chunk-TPY6HW55.js → chunk-RFAX4WKE.js} +13 -7
  155. package/chunks/chunk-RSFNJ6UU.js +1252 -0
  156. package/chunks/{chunk-EDIDYZBT.js → chunk-RVT5L74D.js} +1 -1
  157. package/chunks/{chunk-FCPJXKDG.js → chunk-RXDTMGUH.js} +9 -9
  158. package/chunks/{chunk-P42KMMU6.js → chunk-RZZLNI74.js} +27 -25
  159. package/chunks/{chunk-ZFHKUQZ4.js → chunk-S2R4L34O.js} +12 -5
  160. package/chunks/chunk-S34QJ6IR.js +290 -0
  161. package/chunks/chunk-S5BHLTHK.js +190 -0
  162. package/chunks/{chunk-2XRE4KE4.js → chunk-S7BE3FMA.js} +1 -1
  163. package/chunks/{chunk-7O5PYQ3M.js → chunk-SBP43AO6.js} +1 -1
  164. package/chunks/chunk-SLHYLVRW.js +1377 -0
  165. package/chunks/{chunk-SSWTA7CH.js → chunk-SLV3GU2S.js} +12 -12
  166. package/chunks/chunk-SLVJ55G3.js +11397 -0
  167. package/chunks/{chunk-5VQR2DD7.js → chunk-SQRZJD25.js} +5 -3
  168. package/chunks/{chunk-K4XMAIRX.js → chunk-SRFYBJ4P.js} +14 -14
  169. package/chunks/{chunk-Y4NNIGYO.js → chunk-SSFOFDNL.js} +1 -1
  170. package/chunks/{chunk-NFXXBWSE.js → chunk-SU64336V.js} +2 -2
  171. package/chunks/{chunk-RRI764F7.js → chunk-SWHBXWVS.js} +45 -26
  172. package/chunks/{chunk-BHVF3R6B.js → chunk-TAMBGU42.js} +4 -4
  173. package/chunks/chunk-TFDCK56Y.js +154 -0
  174. package/chunks/{chunk-Q54O3EIA.js → chunk-TNTYSST7.js} +55 -33
  175. package/chunks/{chunk-JRHKM3YQ.js → chunk-TS4JJ7NN.js} +2 -2
  176. package/chunks/{chunk-VEXUA6DX.js → chunk-TWD6EZLA.js} +13 -11
  177. package/chunks/{chunk-WZWTY7SG.js → chunk-TZ4QKMPU.js} +6 -6
  178. package/chunks/{chunk-C4HBZQNH.js → chunk-U3MTHCJF.js} +1 -1
  179. package/chunks/{chunk-VU3XMZ5I.js → chunk-U3VIKF53.js} +3 -3
  180. package/chunks/{chunk-BHG3H6OZ.js → chunk-U4KO33OD.js} +1 -1
  181. package/chunks/{chunk-2C5TR6HN.js → chunk-UANUZBL2.js} +1 -1
  182. package/chunks/{chunk-Y53DG2HA.js → chunk-UIWUFHRJ.js} +1 -1
  183. package/chunks/{chunk-UQGRJTDK.js → chunk-UP3XL4VB.js} +3 -3
  184. package/chunks/{chunk-43Y26NPF.js → chunk-UR27ZXFZ.js} +3 -3
  185. package/chunks/{chunk-LO2UWNO5.js → chunk-UXC6MURF.js} +3 -3
  186. package/chunks/chunk-UXEI7POA.js +273 -0
  187. package/chunks/chunk-V2XJJTAB.js +228 -0
  188. package/chunks/chunk-VDNCKE2O.js +24 -0
  189. package/chunks/{chunk-YQQ2U7AS.js → chunk-VLBL6Q7X.js} +1 -1
  190. package/chunks/{chunk-HNFKYKHH.js → chunk-VNQTV5NC.js} +104 -26
  191. package/chunks/chunk-VPGRGNNH.js +578 -0
  192. package/chunks/{chunk-TKF4JINY.js → chunk-VVQ57VLE.js} +1 -1
  193. package/chunks/{chunk-AUX2FL5T.js → chunk-W2UTVLT2.js} +641 -11
  194. package/chunks/{chunk-SYMXYRM5.js → chunk-W7JWIIRC.js} +1 -1
  195. package/chunks/{chunk-WBSJ6VPZ.js → chunk-WDVSRQIQ.js} +3 -3
  196. package/chunks/{chunk-AZCTY64Z.js → chunk-WEUQIY3Q.js} +1 -1
  197. package/chunks/{chunk-FX6PZBOV.js → chunk-WHBL5HJF.js} +4 -4
  198. package/chunks/chunk-WL2V7PTE.js +78 -0
  199. package/chunks/{chunk-OSG23MR3.js → chunk-X3T5IOX6.js} +2 -2
  200. package/chunks/{chunk-OZEV3R3S.js → chunk-XYAB5R6E.js} +3 -3
  201. package/chunks/chunk-XZA32HII.js +19 -0
  202. package/chunks/{chunk-4FLUQWJ4.js → chunk-Y3Q5OK4D.js} +1 -1
  203. package/chunks/chunk-YDERQ7ZV.js +248 -0
  204. package/chunks/{chunk-QGEISOJ2.js → chunk-YKM7SY3N.js} +3 -3
  205. package/chunks/{chunk-HXUI5D4H.js → chunk-YRNAZIDX.js} +1 -1
  206. package/chunks/{chunk-MFDKHGTD.js → chunk-YRNLF4SV.js} +3 -1
  207. package/chunks/{chunk-3XBUCOWS.js → chunk-YSD6IY6F.js} +2 -2
  208. package/chunks/{chunk-CH2YDT6X.js → chunk-YVYK3JYU.js} +5 -3
  209. package/chunks/{chunk-YL3UJML3.js → chunk-YWDVNBGE.js} +4 -4
  210. package/chunks/{chunk-KAYC5FBN.js → chunk-Z3DLUFMT.js} +1595 -1399
  211. package/chunks/chunk-Z547XC3A.js +44 -0
  212. package/chunks/{chunk-B6RMK4ED.js → chunk-Z5UFM7P6.js} +9 -7
  213. package/chunks/chunk-ZAX2LW35.js +1330 -0
  214. package/chunks/{chunk-C3T6HPNM.js → chunk-ZGADNVME.js} +5 -5
  215. package/chunks/{chunk-M3JGHRMQ.js → chunk-ZJ7KIWG5.js} +1 -1
  216. package/chunks/{chunk-SYROIHU7.js → chunk-ZRQGTRHA.js} +4 -2
  217. package/chunks/{chunk-NCPFOLM2.js → chunk-ZTBP4SFC.js} +78 -18
  218. package/chunks/{chunk-ZAFYHRVY.js → chunk-ZYDMQCQP.js} +4 -274
  219. package/chunks/{chunk-YP2K3WOS.js → chunk-ZYLZNSBW.js} +7 -4
  220. package/chunks/clip-audio-SH4L7AEY.js +255 -0
  221. package/chunks/clip-image-BQRPECIS.js +239 -0
  222. package/chunks/clip-video-JIRMV5IH.js +277 -0
  223. package/chunks/{codex-subagent-executor-AEAIQZDC.js → codex-subagent-executor-BQZZ3Z4E.js} +92 -68
  224. package/chunks/config-3X4AXU45.js +21 -0
  225. package/chunks/config-T5RO4NJV.js +17 -0
  226. package/chunks/config-utils-65HZJG2Y.js +151 -0
  227. package/chunks/contextCommand-P2WZOTZP.js +144 -0
  228. package/chunks/convert-image-D52K2FFB.js +231 -0
  229. package/chunks/{core-runtime-ZI4RTOJQ.js → core-runtime-G7RWUDR5.js} +94 -67
  230. package/chunks/{create-sub-session-MSGNIM37.js → create-sub-session-6EDEANCD.js} +7 -5
  231. package/chunks/{create-sub-session-BBWFQARJ.js → create-sub-session-C6OHZMEI.js} +90 -66
  232. package/chunks/{cron-create-U2JJ5CCF.js → cron-create-GS7ORRO6.js} +8 -5
  233. package/chunks/{cron-delete-7DM4LJWD.js → cron-delete-3GGDNNXD.js} +8 -5
  234. package/chunks/{cron-list-VCUSZK2Y.js → cron-list-EX27DW4H.js} +8 -5
  235. package/chunks/{daemon-INCM4VBX.js → daemon-62G2N3ZH.js} +1 -1
  236. package/chunks/{daemon-git-worktree-guard-KECEMV6A.js → daemon-git-worktree-guard-Y5MRUXHR.js} +90 -66
  237. package/chunks/daemon-status-provider-ORUXPQJO.js +155 -0
  238. package/chunks/daemon-trust-policy-CG35YJC5.js +150 -0
  239. package/chunks/{daemon-trust-policy-monitor-546N5ZVL.js → daemon-trust-policy-monitor-PT2ZJL3A.js} +96 -72
  240. package/chunks/deferred-core-runtime-K74JXKVR.js +153 -0
  241. package/chunks/{display-image-QTHALY6N.js → display-image-L3A755PZ.js} +10 -7
  242. package/chunks/{dist-BNW423XT.js → dist-CXDHIHN4.js} +5 -0
  243. package/chunks/downsample-audio-LPDWX6GF.js +217 -0
  244. package/chunks/downsample-image-A5JEYIV5.js +249 -0
  245. package/chunks/downscale-video-4W5BX5KO.js +249 -0
  246. package/chunks/{earlyInputCapture-BXP7V2P3.js → earlyInputCapture-UJ3KFVZQ.js} +3 -2
  247. package/chunks/{edit-CMSQB7NP.js → edit-VBS2GF24.js} +68 -56
  248. package/chunks/{en-56QLKXS2.js → en-FCK6MBTI.js} +16 -0
  249. package/chunks/{enter-worktree-DA6A4XC5.js → enter-worktree-QK7DR5EF.js} +12 -9
  250. package/chunks/{enterPlanMode-UDPMNESD.js → enterPlanMode-WC33QFGB.js} +62 -51
  251. package/chunks/environment-HN47IXJZ.js +167 -0
  252. package/chunks/errors-JC3V3RJA.js +151 -0
  253. package/chunks/{exec-RPKEY6HP.js → exec-7CFNHYCV.js} +31 -9
  254. package/chunks/{exit-worktree-4H6Z2VQI.js → exit-worktree-62COYIHF.js} +14 -10
  255. package/chunks/exitPlanMode-7R7DYPUV.js +102 -0
  256. package/chunks/extract-audio-GSSZQV6G.js +229 -0
  257. package/chunks/extract-keyframes-Q6DRMQAJ.js +621 -0
  258. package/chunks/{fast-path-F2CYDDZ4.js → fast-path-WN7SASHV.js} +6 -6
  259. package/chunks/{fast-path-settings-N2VGRGDJ.js → fast-path-settings-ASPHHCAG.js} +2 -2
  260. package/chunks/ffmpeg-N4LIIVNR.js +21 -0
  261. package/chunks/{glob-Z2JMJKKN.js → glob-HHM36TVT.js} +63 -51
  262. package/chunks/{goal-tools-HXVVLGCV.js → goal-tools-JTF7S4FP.js} +59 -49
  263. package/chunks/{grep-H2I33VAO.js → grep-JB5DGQ3B.js} +13 -9
  264. package/chunks/handleAutoUpdate-GGFSWLAH.js +147 -0
  265. package/chunks/i18n-NYQWDZWJ.js +164 -0
  266. package/chunks/{image-gen-HIAZCB5T.js → image-gen-LX3C4V3R.js} +16 -11
  267. package/chunks/initializer-6IZ4SNMM.js +151 -0
  268. package/chunks/installationInfo-K4KMCK7Q.js +145 -0
  269. package/chunks/{keychain-token-storage-NQ5XWIPX.js → keychain-token-storage-ZZNRE6D4.js} +3 -2
  270. package/chunks/list-KAWCG4I6.js +154 -0
  271. package/chunks/{list-agents-EWDCEPIW.js → list-agents-HS6HH4DJ.js} +10 -7
  272. package/chunks/{llm-LSUBOJAR.js → llm-UAZU4HC5.js} +162 -135
  273. package/chunks/{llm-content-generator-MLIONRXE.js → llm-content-generator-M3MT4BP3.js} +11 -9
  274. package/chunks/loadedSettingsAdapter-XKUVLEYR.js +152 -0
  275. package/chunks/{loggingContentGenerator-TUPEXFMM.js → loggingContentGenerator-2WW2O46K.js} +74 -63
  276. package/chunks/{loop-wakeup-ZBVRI6VH.js → loop-wakeup-4B7OY3TV.js} +9 -6
  277. package/chunks/{ls-6ZB3BEIR.js → ls-EZ5PSWU2.js} +8 -5
  278. package/chunks/{lsp-M54FQARP.js → lsp-DYFFHKB3.js} +6 -3
  279. package/chunks/{managed-npm-update-WEA5XMFZ.js → managed-npm-update-VRSID5W3.js} +91 -67
  280. package/chunks/mcp-DQEPGE5B.js +148 -0
  281. package/chunks/memory-side-query-DRV7FXK4.js +221 -0
  282. package/chunks/model-call-collection-HXYIVZDO.js +171 -0
  283. package/chunks/model-configuration-5FJL5BJE.js +161 -0
  284. package/chunks/modelConfigUtils-UE3FDHG3.js +140 -0
  285. package/chunks/{monitor-CI7YE7MT.js → monitor-IRKGV3RU.js} +63 -51
  286. package/chunks/nonInteractiveCli-LF5DTTUJ.js +235 -0
  287. package/chunks/nonInteractiveToolExecutor-KGIGCNUC.js +101 -0
  288. package/chunks/{notebook-edit-3WCVRNGL.js → notebook-edit-E2NGGRVT.js} +63 -52
  289. package/chunks/ocr-image-Q4HYJ3U7.js +252 -0
  290. package/chunks/omni-EHZU5MVU.js +147 -0
  291. package/chunks/{openaiContentGenerator-OGILGUZE.js → openaiContentGenerator-VZ4QWOSU.js} +36 -31
  292. package/chunks/{openaiResponsesContentGenerator-NXOXUPFM.js → openaiResponsesContentGenerator-OQFPKE6V.js} +15 -12
  293. package/chunks/pidfile-OQREIPGE.js +151 -0
  294. package/chunks/{processUtils-O4II3RYH.js → processUtils-VFFEEP7L.js} +2 -2
  295. package/chunks/prompt-terminal-ledger-46ELXYOX.js +143 -0
  296. package/chunks/{qwenContentGenerator-I4LRYADV.js → qwenContentGenerator-H3CWSIV5.js} +70 -60
  297. package/chunks/{qwenOAuth2-3J66TOT5.js → qwenOAuth2-GD3UIYUP.js} +9 -8
  298. package/chunks/reactive-degrade-KRTLV22M.js +375 -0
  299. package/chunks/read-file-BSZJVJ4F.js +37 -0
  300. package/chunks/{read-mcp-resource-LPSWXVOD.js → read-mcp-resource-INJIV3UC.js} +8 -4
  301. package/chunks/recall-media-memory-tool-PEE2BWRY.js +198 -0
  302. package/chunks/{record-artifact-L3CFJOMA.js → record-artifact-KKW3AIMJ.js} +6 -4
  303. package/chunks/record-source-OZ7JQFJK.js +24 -0
  304. package/chunks/{report-findings-LY5HQY4K.js → report-findings-OZSLWYAS.js} +7 -5
  305. package/chunks/{request-shutdown-53SNYGVR.js → request-shutdown-NMWMWGNR.js} +12 -9
  306. package/chunks/resumeHistoryUtils-P33LLL4M.js +156 -0
  307. package/chunks/ripGrep-2FWQ6RU3.js +43 -0
  308. package/chunks/{run-qwen-serve-ZVEKGS7Y.js → run-qwen-serve-HMQ2QCS7.js} +85 -73
  309. package/chunks/runtime-5X746HBH.js +188 -0
  310. package/chunks/sandbox-5FENHQ3J.js +170 -0
  311. package/chunks/sandboxConfig-7V6K3L4N.js +138 -0
  312. package/chunks/scheduled-tasks-Z4YOCKQV.js +167 -0
  313. package/chunks/scheduler-64LTQG3P.js +160 -0
  314. package/chunks/{sdk-exporters-http-DR4G663K.js → sdk-exporters-http-SWXTEEVT.js} +3 -2
  315. package/chunks/{sdk-impl-SJR26MQF.js → sdk-impl-FK4JY6LX.js} +5 -4
  316. package/chunks/{send-message-DN76MXDX.js → send-message-SNCXOZA7.js} +16 -13
  317. package/chunks/serve-C56AM3HW.js +156 -0
  318. package/chunks/{server-UHMKPCAZ.js → server-5NPGYNJG.js} +2169 -529
  319. package/chunks/{session-ZLUK7E4P.js → session-JOY4PHTN.js} +152 -128
  320. package/chunks/session-attachments-root-765GPAJU.js +141 -0
  321. package/chunks/{session-pr-refresh-3OMTQWCZ.js → session-pr-refresh-JUKB3A7P.js} +95 -71
  322. package/chunks/{settings-P4DHIIUP.js → settings-P326ULSH.js} +95 -71
  323. package/chunks/{shell-IMFUVQQ5.js → shell-747O3UYW.js} +59 -49
  324. package/chunks/{skill-NB5RJGZW.js → skill-DOHHQC32.js} +22 -17
  325. package/chunks/skill-settings-RI5JR6ZG.js +164 -0
  326. package/chunks/spawnChannel-745P6IB6.js +152 -0
  327. package/chunks/standalone-update-JC4E4UEO.js +156 -0
  328. package/chunks/{start-opentui-ui-JKAIWGF7.js → start-opentui-ui-RC62XZUC.js} +1611 -800
  329. package/chunks/{startInteractiveUI-YRPOT6GH.js → startInteractiveUI-PIBA3ADH.js} +521 -374
  330. package/chunks/storage-VZECDJNX.js +17 -0
  331. package/chunks/{syntheticOutput-EX5L5GYI.js → syntheticOutput-SSXJ2NEY.js} +5 -3
  332. package/chunks/task-create-FD3EJI7F.js +30 -0
  333. package/chunks/{task-list-ZLJSMRFA.js → task-list-GA5GOR74.js} +9 -6
  334. package/chunks/{task-stop-MD7P6QGK.js → task-stop-3MXTDL7H.js} +6 -3
  335. package/chunks/{task-update-3LSYQDRW.js → task-update-YHFYE7L6.js} +16 -13
  336. package/chunks/{team-create-2XTBYRJF.js → team-create-PJYGG3AE.js} +62 -51
  337. package/chunks/{team-delete-RIDINW6I.js → team-delete-V2CROTI6.js} +9 -6
  338. package/chunks/{team-plan-approval-CFNWW7ZQ.js → team-plan-approval-B36IMXRL.js} +61 -50
  339. package/chunks/terminal-image-renderer-7OSAIRLS.js +156 -0
  340. package/chunks/theme-manager-PVMU3VN5.js +140 -0
  341. package/chunks/{todoWrite-XSTG2VT5.js → todoWrite-LT75PK2W.js} +8 -5
  342. package/chunks/tool-result-media-S6D7T7TZ.js +45 -0
  343. package/chunks/{tool-search-ZHTJU2MV.js → tool-search-MNRENFML.js} +43 -21
  344. package/chunks/total-session-admission-XOFLP43R.js +151 -0
  345. package/chunks/transcribe-audio-AJQZPNEV.js +30 -0
  346. package/chunks/trustedFolders-SBORXKH4.js +160 -0
  347. package/chunks/understand-video-segments-5TMRDQUB.js +438 -0
  348. package/chunks/{update-relaunch-LI7GRP36.js → update-relaunch-FVAD6CYB.js} +5 -5
  349. package/chunks/updateCheck-PK4QHA67.js +156 -0
  350. package/chunks/upload-cache-5YULQVZZ.js +17 -0
  351. package/chunks/upload-config-AZ63YJU2.js +25 -0
  352. package/chunks/useAutoAcceptIndicator-SPTOOUWR.js +158 -0
  353. package/chunks/{validateNonInterActiveAuth-YFPCYYNL.js → validateNonInterActiveAuth-XXHRLXWV.js} +144 -120
  354. package/chunks/{version-4MTL4JVU.js → version-AGTZHZNY.js} +1 -1
  355. package/chunks/{web-fetch-O6RG6ISB.js → web-fetch-KMXKLQKY.js} +27 -20
  356. package/chunks/{web-search-JHAXVEMD.js → web-search-OLBQWW2Y.js} +14 -11
  357. package/chunks/{web-shell-static-FFWCUUZS.js → web-shell-static-XSCCMXKQ.js} +3 -3
  358. package/chunks/{workflow-O7L6VDYU.js → workflow-2LC5ZV4Z.js} +214 -73
  359. package/chunks/workspace-providers-status-4IJHDGCM.js +154 -0
  360. package/chunks/{workspace-registration-store-7G4E7YPY.js → workspace-registration-store-M4LBEY5A.js} +1 -1
  361. package/chunks/workspace-registry-D4HQ3TWX.js +160 -0
  362. package/chunks/workspace-runtime-coordinator-ZG3IRRQ6.js +163 -0
  363. package/chunks/workspace-service-7ORHK4P4.js +165 -0
  364. package/chunks/workspace-skills-status-J43O7A5Q.js +151 -0
  365. package/chunks/{workspace-trust-reconciler-XEBW5FUL.js → workspace-trust-reconciler-7ZMDX27O.js} +99 -75
  366. package/chunks/write-file-MWN2PNMG.js +107 -0
  367. package/chunks/{zh-TW-S3YTQ4DS.js → zh-TW-SRB5QSER.js} +16 -0
  368. package/chunks/{zh-F76MZTL3.js → zh-UBQIFP4A.js} +16 -0
  369. package/chunks/{zoom-image-RDPRTP4B.js → zoom-image-H7MLEC2E.js} +18 -13
  370. package/cli.js +14 -14
  371. package/export-transcript-document.js +52 -52
  372. package/locales/en.js +18 -0
  373. package/locales/zh-TW.js +17 -0
  374. package/locales/zh.js +17 -0
  375. package/package.json +3 -3
  376. package/web-shell/assets/{abnfDiagram-VCTEODGH-RxykUDmi.js → abnfDiagram-VCTEODGH-L57MVQ_O.js} +1 -1
  377. package/web-shell/assets/{arc-CZpgGCJC.js → arc-Cdl4BCU9.js} +1 -1
  378. package/web-shell/assets/{architectureDiagram-5GKGNRK7-BHSMzNDT.js → architectureDiagram-5GKGNRK7-wLGfVuoB.js} +1 -1
  379. package/web-shell/assets/{blockDiagram-NRAW4CY4-Bn4mF9SZ.js → blockDiagram-NRAW4CY4-LXdTypiA.js} +1 -1
  380. package/web-shell/assets/{c4Diagram-UCG6FXSJ-CBM-Bj6t.js → c4Diagram-UCG6FXSJ-Ci95CJAD.js} +1 -1
  381. package/web-shell/assets/channel-DwdlDVan.js +1 -0
  382. package/web-shell/assets/{chunk-2Q5K7J3B-D5Fin58O.js → chunk-2Q5K7J3B-CTb0CG3P.js} +1 -1
  383. package/web-shell/assets/{chunk-5VM5RSS4-CY05weF7.js → chunk-5VM5RSS4-BIyA8dbi.js} +1 -1
  384. package/web-shell/assets/{chunk-F27PBJKO-3neZnj5Y.js → chunk-F27PBJKO-BlcPeoaN.js} +1 -1
  385. package/web-shell/assets/{chunk-G27WJ6UU-Cd7EU4BE.js → chunk-G27WJ6UU-KdH5H1ne.js} +1 -1
  386. package/web-shell/assets/{chunk-JWPE2WC7-DwK1mqFw.js → chunk-JWPE2WC7-DEh0r7ty.js} +1 -1
  387. package/web-shell/assets/{chunk-LCL6LL3I-Sl7vY22C.js → chunk-LCL6LL3I-DwD-l0mq.js} +1 -1
  388. package/web-shell/assets/{chunk-POPQ4Y6H-BXNzpbVg.js → chunk-POPQ4Y6H-D_ybAWGG.js} +1 -1
  389. package/web-shell/assets/{chunk-SVP7TREG-DjjButcp.js → chunk-SVP7TREG-Bk6Dq0yA.js} +1 -1
  390. package/web-shell/assets/{chunk-XXDRQBXY-DNOiCjOJ.js → chunk-XXDRQBXY-D4vL2YuW.js} +1 -1
  391. package/web-shell/assets/classDiagram-DTDB5LWJ-CIyD-qft.js +1 -0
  392. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CIyD-qft.js +1 -0
  393. package/web-shell/assets/{cose-bilkent-JH36ORCC-BUnker7a.js → cose-bilkent-JH36ORCC-BditfMcM.js} +1 -1
  394. package/web-shell/assets/{cynefin-OW5HDTMX-DcUgdWE5.js → cynefin-OW5HDTMX-DAlaYMkD.js} +1 -1
  395. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CvDKsZsL.js → cynefinDiagram-5FMLGOSQ-B9jOfS3X.js} +1 -1
  396. package/web-shell/assets/{dagre-3AP2YEHR-jpCmUbr1.js → dagre-3AP2YEHR-DO6EyeMX.js} +1 -1
  397. package/web-shell/assets/{diagram-S7CK7UJ4-DBe_bKE5.js → diagram-S7CK7UJ4-DIwGJ7mC.js} +1 -1
  398. package/web-shell/assets/{diagram-UQ7AKVKN-oXvPpDgs.js → diagram-UQ7AKVKN-DT5RqZBV.js} +1 -1
  399. package/web-shell/assets/{diagram-VSXAHHWV-BD7-_SGh.js → diagram-VSXAHHWV-DJBMayCs.js} +1 -1
  400. package/web-shell/assets/{diagram-VX7I27RA-DOJL0wub.js → diagram-VX7I27RA-BllSiq1w.js} +1 -1
  401. package/web-shell/assets/{diagram-Z3DM3KII-DRIiodDD.js → diagram-Z3DM3KII-Vw1NsAH3.js} +1 -1
  402. package/web-shell/assets/{ebnfDiagram-PWID7BFC-Db31Ulmb.js → ebnfDiagram-PWID7BFC-TY7loKI3.js} +1 -1
  403. package/web-shell/assets/{erDiagram-SSCWMZ5O-CVHhwI2_.js → erDiagram-SSCWMZ5O-BYrxi-FK.js} +1 -1
  404. package/web-shell/assets/{flowDiagram-A5DVABFB-DWOFy1FK.js → flowDiagram-A5DVABFB-BTQ4IRh-.js} +1 -1
  405. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C0sxQtPd.js → ganttDiagram-EL5Y4UJY-96GXN9_Z.js} +1 -1
  406. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CNituBYC.js → gitGraphDiagram-WWUBYQGX-BgIxQjuh.js} +1 -1
  407. package/web-shell/assets/{index-B15NlwB8.js → index-BvmsVGIg.js} +472 -465
  408. package/web-shell/assets/{index-BSrS0tQ6.css → index-D0aLpdAG.css} +2 -2
  409. package/web-shell/assets/{index-gm9tLk7h.js → index-SPar5CcF.js} +1 -1
  410. package/web-shell/assets/{infoDiagram-RXCK75RN-CxhJYtIR.js → infoDiagram-RXCK75RN-BlyUMpEA.js} +1 -1
  411. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-By2mchUy.js → ishikawaDiagram-5VMMS53U-94uLMZ3k.js} +1 -1
  412. package/web-shell/assets/{journeyDiagram-EYS64GPL-CVH-OweI.js → journeyDiagram-EYS64GPL-DbnJfG3S.js} +1 -1
  413. package/web-shell/assets/{kanban-definition-3QL26DDD-Cc9dQXLy.js → kanban-definition-3QL26DDD-gjWM2ioU.js} +1 -1
  414. package/web-shell/assets/{layout-C_60ysHw.js → layout-CmDpGoK-.js} +1 -1
  415. package/web-shell/assets/{linear-BvAVfqwu.js → linear-DksWgqn0.js} +1 -1
  416. package/web-shell/assets/{mermaid.core-C3CoBKAc.js → mermaid.core-DCpE5atR.js} +6 -6
  417. package/web-shell/assets/{mindmap-definition-FBJOCRG2-Cuu8Q8LM.js → mindmap-definition-FBJOCRG2-DanEOvck.js} +1 -1
  418. package/web-shell/assets/{pegDiagram-XKGWAZYB-DmAeyDO2.js → pegDiagram-XKGWAZYB-V2ee76OP.js} +1 -1
  419. package/web-shell/assets/{pieDiagram-E7YTZNPT-B7vbB_xv.js → pieDiagram-E7YTZNPT-CYvmbkkp.js} +1 -1
  420. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BqOBkRR7.js → quadrantDiagram-AXDQQJYC-BRkw6ha0.js} +1 -1
  421. package/web-shell/assets/{railroadDiagram-O6MQD6OU-sI06lZIu.js → railroadDiagram-O6MQD6OU-D_YmVT7T.js} +1 -1
  422. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Bg13d10S.js → requirementDiagram-EFPCY7ZU-DTF9UgWw.js} +1 -1
  423. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-WFOzZHrR.js → sankeyDiagram-P5KCCOFB-znmuOvtK.js} +1 -1
  424. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CCdRbA4E.js → sequenceDiagram-WJ2MYXX4-B8CE9gDr.js} +1 -1
  425. package/web-shell/assets/{sizeCapture-X5ZJPWSS-BH5F3bGg.js → sizeCapture-X5ZJPWSS-BqE_jooQ.js} +1 -1
  426. package/web-shell/assets/{stateDiagram-HBIQ2CUA-NwS2X3QB.js → stateDiagram-HBIQ2CUA-4AmlCOLW.js} +1 -1
  427. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DwExf4Jm.js +1 -0
  428. package/web-shell/assets/{swimlanes-XN3QIQJK-Bm38pM28.js → swimlanes-XN3QIQJK-B40gtZOq.js} +1 -1
  429. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-CXXUsHPj.js +8 -0
  430. package/web-shell/assets/{timeline-definition-24CTP7MA-Do-agLSo.js → timeline-definition-24CTP7MA-B23KIwTc.js} +1 -1
  431. package/web-shell/assets/{vennDiagram-4TSXK5OY-aggLfZzl.js → vennDiagram-4TSXK5OY-eyJpBjg6.js} +1 -1
  432. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D5JR3mXX.js → wardleyDiagram-VM6X3IG4-BBjaaHeP.js} +1 -1
  433. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DhtLDuXs.js → xychartDiagram-S5SC5T6Z-Cq3Bnvj4.js} +1 -1
  434. package/web-shell/index.html +2 -2
  435. package/chunks/MaxSizedBox-FCF6M53W.js +0 -124
  436. package/chunks/acp-subagent-executor-TND6W2O5.js +0 -140
  437. package/chunks/agent-headless-EJ4QOUSM.js +0 -94
  438. package/chunks/bridge-MUX5YJZT.js +0 -132
  439. package/chunks/channel-settings-store-7CBIRZER.js +0 -134
  440. package/chunks/chunk-FIJODK52.js +0 -154
  441. package/chunks/chunk-OALXNGUA.js +0 -2137
  442. package/chunks/chunk-PF7GAP6K.js +0 -16861
  443. package/chunks/config-utils-KX2YS725.js +0 -127
  444. package/chunks/contextCommand-RV6Y5LNJ.js +0 -120
  445. package/chunks/daemon-status-provider-NULJNAEV.js +0 -131
  446. package/chunks/daemon-trust-policy-S4KWGPV3.js +0 -126
  447. package/chunks/deferred-core-runtime-T23ZT443.js +0 -128
  448. package/chunks/environment-TSQJUTPV.js +0 -143
  449. package/chunks/errors-RIVYJS6T.js +0 -127
  450. package/chunks/exitPlanMode-BYBBFN2T.js +0 -92
  451. package/chunks/handleAutoUpdate-FZP45KOR.js +0 -123
  452. package/chunks/i18n-OTB62AKW.js +0 -140
  453. package/chunks/initializer-4JXZEC4B.js +0 -127
  454. package/chunks/installationInfo-2IJV5QKC.js +0 -121
  455. package/chunks/list-KQSQ4A5G.js +0 -130
  456. package/chunks/loadedSettingsAdapter-TZTTNRHI.js +0 -124
  457. package/chunks/mcp-TFDTUPIA.js +0 -124
  458. package/chunks/model-configuration-ZCAKKIOF.js +0 -137
  459. package/chunks/modelConfigUtils-J3ZPW7ZK.js +0 -116
  460. package/chunks/nonInteractiveCli-GPT3TVOK.js +0 -211
  461. package/chunks/pidfile-GBTBIGHF.js +0 -127
  462. package/chunks/prompt-terminal-ledger-ILIXZI3E.js +0 -119
  463. package/chunks/read-file-G4XKW2CS.js +0 -31
  464. package/chunks/record-source-2GSY5JD5.js +0 -22
  465. package/chunks/resumeHistoryUtils-YPJU4XFE.js +0 -132
  466. package/chunks/ripGrep-AAKMALLM.js +0 -39
  467. package/chunks/runtime-SJCRYNPA.js +0 -164
  468. package/chunks/sandbox-UIXL423Z.js +0 -146
  469. package/chunks/sandboxConfig-CY343YNJ.js +0 -114
  470. package/chunks/scheduled-tasks-5UGBEVNZ.js +0 -143
  471. package/chunks/scheduler-GCZYLZ2P.js +0 -136
  472. package/chunks/serve-2XXQLVK2.js +0 -132
  473. package/chunks/session-attachments-root-DHQM5IEZ.js +0 -117
  474. package/chunks/skill-settings-IXG5CTQO.js +0 -140
  475. package/chunks/spawnChannel-Q3YALTCJ.js +0 -128
  476. package/chunks/standalone-update-H5OJ7MM7.js +0 -132
  477. package/chunks/task-create-75HVPEAH.js +0 -28
  478. package/chunks/terminal-image-renderer-UDPJPGPQ.js +0 -132
  479. package/chunks/theme-manager-SK57EKMO.js +0 -116
  480. package/chunks/total-session-admission-UUZBDQCG.js +0 -127
  481. package/chunks/trustedFolders-4LDBLNTS.js +0 -136
  482. package/chunks/updateCheck-PKSSORPO.js +0 -132
  483. package/chunks/useAutoAcceptIndicator-I32UEQPI.js +0 -134
  484. package/chunks/workspace-providers-status-WRX6CJM4.js +0 -130
  485. package/chunks/workspace-registry-SXIMGT4D.js +0 -136
  486. package/chunks/workspace-runtime-coordinator-7DOEHXYT.js +0 -139
  487. package/chunks/workspace-service-HDXOZMYC.js +0 -141
  488. package/chunks/workspace-skills-status-VN4L37CA.js +0 -127
  489. package/chunks/write-file-LKX4ETIO.js +0 -97
  490. package/web-shell/assets/channel-DFYs_LlK.js +0 -1
  491. package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +0 -1
  492. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +0 -1
  493. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +0 -1
  494. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +0 -8
  495. package/chunks/{chunk-XAJZFGD2.js → chunk-PXXYQOZO.js} +8 -8
  496. package/chunks/{chunk-WVURIAEE.js → chunk-SVWWF5TZ.js} +3 -3
  497. package/chunks/{dist-G5UMXIGF.js → dist-I6D6XOWV.js} +1 -1
  498. package/chunks/{dist-UXVNLQHG.js → dist-VIKOMAGG.js} +3 -3
@@ -1,7 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
3
  import {
4
- DEFAULT_QWEN_MODEL,
5
4
  MODEL_GENERATION_CONFIG_FIELDS,
6
5
  PROVIDER_SOURCED_FIELDS,
7
6
  QWEN_OAUTH_MODELS,
@@ -12,13 +11,16 @@ import {
12
11
  normalize,
13
12
  parseModelReasoningCapabilities,
14
13
  tokenLimit
15
- } from "./chunk-GJKP6XOB.js";
14
+ } from "./chunk-JWV5GI77.js";
15
+ import {
16
+ DEFAULT_QWEN_MODEL
17
+ } from "./chunk-XZA32HII.js";
16
18
  import {
17
19
  AuthType
18
- } from "./chunk-7O5PYQ3M.js";
20
+ } from "./chunk-SBP43AO6.js";
19
21
  import {
20
22
  createDebugLogger
21
- } from "./chunk-ZAFYHRVY.js";
23
+ } from "./chunk-ZYDMQCQP.js";
22
24
  import {
23
25
  init_esbuild_shims
24
26
  } from "./chunk-5O2XNYP6.js";
@@ -46,6 +48,10 @@ var DEFAULT_MAX_RETRIES = 3;
46
48
  var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
47
49
  var DEFAULT_DASHSCOPE_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
48
50
  var DASHSCOPE_PROXY_BASE_URL = process.env["DASHSCOPE_PROXY_BASE_URL"];
51
+ function normalizeOpenAiWireBaseUrl(baseUrl) {
52
+ return (baseUrl || DEFAULT_OPENAI_BASE_URL).replace(/\/v1\/?$/, "").replace(/\/$/, "");
53
+ }
54
+ __name(normalizeOpenAiWireBaseUrl, "normalizeOpenAiWireBaseUrl");
49
55
 
50
56
  // packages/core/src/models/image-generation-capability.ts
51
57
  init_esbuild_shims();
@@ -99,6 +105,71 @@ function resolveProviderProtocol(providerId, providerProtocol) {
99
105
  return validateAuthTypeKey(providerId);
100
106
  }
101
107
  __name(resolveProviderProtocol, "resolveProviderProtocol");
108
+ function resolveModelProtocol(providerId, model, providerProtocol) {
109
+ const protocol = resolveProviderProtocol(providerId, providerProtocol);
110
+ if (!protocol || model.wireApi === void 0) return protocol;
111
+ if (model.wireApi !== "chat-completions" && model.wireApi !== "responses") {
112
+ throw new Error(
113
+ `Invalid wireApi "${model.wireApi}" for provider "${providerId}". Expected "chat-completions" or "responses".`
114
+ );
115
+ }
116
+ if (protocol !== "openai" /* USE_OPENAI */ && protocol !== "openai-responses" /* USE_OPENAI_RESPONSES */) {
117
+ throw new Error(
118
+ `Provider "${providerId}" uses protocol "${protocol}"; wireApi is only supported for OpenAI-compatible models.`
119
+ );
120
+ }
121
+ return model.wireApi === "responses" ? "openai-responses" /* USE_OPENAI_RESPONSES */ : "openai" /* USE_OPENAI */;
122
+ }
123
+ __name(resolveModelProtocol, "resolveModelProtocol");
124
+ function tryResolveModelProtocol(providerId, model, providerProtocol) {
125
+ try {
126
+ return resolveModelProtocol(providerId, model, providerProtocol);
127
+ } catch {
128
+ return void 0;
129
+ }
130
+ }
131
+ __name(tryResolveModelProtocol, "tryResolveModelProtocol");
132
+ function validateModelProvidersConfig(modelProviders, providerProtocol) {
133
+ for (const providerId of /* @__PURE__ */ new Set([
134
+ ...Object.keys(modelProviders ?? {}),
135
+ ...Object.keys(providerProtocol ?? {})
136
+ ])) {
137
+ resolveProviderProtocol(providerId, providerProtocol);
138
+ const models = modelProviders?.[providerId];
139
+ if (!Array.isArray(models)) continue;
140
+ for (const model of models) {
141
+ resolveModelProtocol(providerId, model, providerProtocol);
142
+ }
143
+ }
144
+ }
145
+ __name(validateModelProvidersConfig, "validateModelProvidersConfig");
146
+ function resolveModelSelectionAuthType(authType, modelId, modelProviders, providerProtocol, baseUrl) {
147
+ if (!modelId || authType !== "openai" /* USE_OPENAI */ && authType !== "openai-responses" /* USE_OPENAI_RESPONSES */) {
148
+ return authType;
149
+ }
150
+ const candidates = [];
151
+ for (const [providerId, models] of Object.entries(modelProviders ?? {})) {
152
+ if (!Array.isArray(models)) continue;
153
+ for (const model of models) {
154
+ const protocol = resolveModelProtocol(
155
+ providerId,
156
+ model,
157
+ providerProtocol
158
+ );
159
+ if (model.id === modelId && (protocol === authType || (model.wireApi !== void 0 || resolveProviderProtocol(providerId, providerProtocol) === "openai-responses" /* USE_OPENAI_RESPONSES */) && (protocol === "openai" /* USE_OPENAI */ || protocol === "openai-responses" /* USE_OPENAI_RESPONSES */))) {
160
+ candidates.push({ model, authType: protocol });
161
+ }
162
+ }
163
+ }
164
+ const preferred = /* @__PURE__ */ __name((entries) => entries.find((entry) => entry.authType === authType) ?? entries[0], "preferred");
165
+ const exact = baseUrl === void 0 ? void 0 : preferred(
166
+ candidates.filter(
167
+ (entry) => (entry.model.baseUrl || null) === (baseUrl || null)
168
+ )
169
+ );
170
+ return (exact ?? preferred(candidates))?.authType ?? authType;
171
+ }
172
+ __name(resolveModelSelectionAuthType, "resolveModelSelectionAuthType");
102
173
  function shouldUseCanonicalModalities(modelId) {
103
174
  return /^minimax-m3/i.test(modelId.trim().toLowerCase());
104
175
  }
@@ -127,6 +198,7 @@ var ModelRegistry = class _ModelRegistry {
127
198
  }
128
199
  }
129
200
  constructor(modelProvidersConfig, providerProtocolConfig) {
201
+ validateModelProvidersConfig(modelProvidersConfig, providerProtocolConfig);
130
202
  this.modelsByAuthType = /* @__PURE__ */ new Map();
131
203
  this.providerProtocolConfig = providerProtocolConfig ?? {};
132
204
  this.modelProvidersConfig = modelProvidersConfig;
@@ -147,13 +219,22 @@ var ModelRegistry = class _ModelRegistry {
147
219
  this.providerProtocolConfig
148
220
  );
149
221
  if (!protocol) {
150
- const knownProtocols = Object.values(AuthType).join(", ");
222
+ const knownProtocols = Object.values(AuthType).filter((value) => value !== "openai-responses" /* USE_OPENAI_RESPONSES */).join(", ");
151
223
  const mapped = Object.hasOwn(this.providerProtocolConfig, providerId) ? this.providerProtocolConfig[providerId] : void 0;
152
224
  const message = mapped !== void 0 ? `Provider "${providerId}" maps to "${mapped}" via providerProtocol, which is not a known protocol (${knownProtocols}); skipping.` : `Provider "${providerId}" in modelProviders is not a built-in protocol (${knownProtocols}) and has no providerProtocol mapping; skipping. Add providerProtocol["${providerId}"] to route it to an SDK protocol.`;
153
225
  debugLogger.warn(message);
154
226
  continue;
155
227
  }
156
228
  if (protocol === "qwen-oauth" /* QWEN_OAUTH */) {
229
+ if (Array.isArray(models)) {
230
+ for (const model of models) {
231
+ resolveModelProtocol(
232
+ providerId,
233
+ model,
234
+ this.providerProtocolConfig
235
+ );
236
+ }
237
+ }
157
238
  continue;
158
239
  }
159
240
  this.registerAuthTypeModels(protocol, models, providerId);
@@ -172,20 +253,25 @@ var ModelRegistry = class _ModelRegistry {
172
253
  );
173
254
  return;
174
255
  }
175
- const modelMap = this.modelsByAuthType.get(authType) ?? /* @__PURE__ */ new Map();
176
256
  const providerLabel = providerId && providerId !== authType ? ` (provider "${providerId}")` : "";
177
257
  for (const config of models) {
258
+ const modelAuthType = resolveModelProtocol(
259
+ providerId ?? authType,
260
+ config,
261
+ providerId ? this.providerProtocolConfig : void 0
262
+ );
263
+ const modelMap = this.modelsByAuthType.get(modelAuthType) ?? /* @__PURE__ */ new Map();
178
264
  const key = modelRegistryKey(config.id, config.baseUrl);
179
265
  if (modelMap.has(key)) {
180
266
  debugLogger.warn(
181
- `Duplicate model id "${config.id}"${config.baseUrl ? ` with baseUrl "${config.baseUrl}"` : ""} for protocol "${authType}"${providerLabel}. Using the first registered config.`
267
+ `Duplicate model id "${config.id}"${config.baseUrl ? ` with baseUrl "${config.baseUrl}"` : ""} for protocol "${modelAuthType}"${providerLabel}. Using the first registered config.`
182
268
  );
183
269
  continue;
184
270
  }
185
- const resolved = this.resolveModelConfig(config, authType);
271
+ const resolved = this.resolveModelConfig(config, modelAuthType);
186
272
  modelMap.set(key, resolved);
273
+ this.modelsByAuthType.set(modelAuthType, modelMap);
187
274
  }
188
- this.modelsByAuthType.set(authType, modelMap);
189
275
  }
190
276
  /**
191
277
  * Get all models for a specific authType.
@@ -410,8 +496,14 @@ var ModelsConfig = class _ModelsConfig {
410
496
  };
411
497
  this.generationConfigSources = options.generationConfigSources || {};
412
498
  this.authTypeWasExplicitlyProvided = options.initialAuthType !== void 0;
413
- this.currentAuthType = options.initialAuthType;
414
499
  const initialModelId = this._generationConfig.model;
500
+ this.currentAuthType = options.initialAuthType ? resolveModelSelectionAuthType(
501
+ options.initialAuthType,
502
+ this.generationConfigSources["model"]?.kind === "default" ? void 0 : initialModelId,
503
+ options.modelProvidersConfig,
504
+ options.providerProtocolConfig,
505
+ options.initialRegistryBaseUrl
506
+ ) : void 0;
415
507
  if (this.currentAuthType && initialModelId) {
416
508
  const initialModel = this.modelRegistry.getModel(
417
509
  this.currentAuthType,
@@ -581,6 +673,11 @@ var ModelsConfig = class _ModelsConfig {
581
673
  await this.switchModel(this.currentAuthType, newModel);
582
674
  return;
583
675
  }
676
+ const siblingWire = this.currentAuthType === "openai" /* USE_OPENAI */ ? "openai-responses" /* USE_OPENAI_RESPONSES */ : this.currentAuthType === "openai-responses" /* USE_OPENAI_RESPONSES */ ? "openai" /* USE_OPENAI */ : void 0;
677
+ if (siblingWire && this.modelRegistry.hasModel(siblingWire, newModel)) {
678
+ await this.switchModel(siblingWire, newModel);
679
+ return;
680
+ }
584
681
  const rollbackSnapshot = this.createStateSnapshotForRollback();
585
682
  try {
586
683
  this.strictModelProviderSelection = false;
@@ -665,12 +762,18 @@ var ModelsConfig = class _ModelsConfig {
665
762
  );
666
763
  }
667
764
  const previousModelId = rollbackSnapshot.generationConfig.model || "";
668
- const previousModel = !isAuthTypeChange && previousModelId ? this.modelRegistry.getModel(
669
- authType,
765
+ const previousAuthType = rollbackSnapshot.currentAuthType;
766
+ const previousModel = previousAuthType && previousModelId ? this.modelRegistry.getModel(
767
+ previousAuthType,
670
768
  previousModelId,
671
769
  rollbackSnapshot.currentRegistryBaseUrl
672
- ) ?? this.modelRegistry.getModel(authType, previousModelId) : void 0;
673
- const canReusePreviousApiKey = authType !== "qwen-oauth" /* QWEN_OAUTH */ && !isAuthTypeChange && !!rollbackSnapshot.generationConfig.apiKey && !!model.envKey && previousModel?.envKey === model.envKey && previousModel.baseUrl === model.baseUrl;
770
+ ) ?? this.modelRegistry.getModel(previousAuthType, previousModelId) : void 0;
771
+ const sharesOpenAICredentials = (authType === "openai" /* USE_OPENAI */ || authType === "openai-responses" /* USE_OPENAI_RESPONSES */) && (previousAuthType === "openai" /* USE_OPENAI */ || previousAuthType === "openai-responses" /* USE_OPENAI_RESPONSES */);
772
+ const sameEndpoint = /* @__PURE__ */ __name((a, b) => a === b || isAuthTypeChange && sharesOpenAICredentials && normalizeOpenAiWireBaseUrl(a) === normalizeOpenAiWireBaseUrl(b), "sameEndpoint");
773
+ const canReusePreviousApiKey = authType !== "qwen-oauth" /* QWEN_OAUTH */ && (!isAuthTypeChange || sharesOpenAICredentials && sameEndpoint(
774
+ rollbackSnapshot.generationConfig.baseUrl,
775
+ model.baseUrl
776
+ )) && !!rollbackSnapshot.generationConfig.apiKey && !!model.envKey && previousModel !== void 0 && previousModel.envKey === model.envKey && sameEndpoint(previousModel.baseUrl, model.baseUrl);
674
777
  const previousApiKey = canReusePreviousApiKey ? rollbackSnapshot.generationConfig.apiKey : void 0;
675
778
  const previousApiKeySource = canReusePreviousApiKey ? rollbackSnapshot.generationConfigSources["apiKey"] : void 0;
676
779
  this.applyResolvedModelDefaults(model);
@@ -1027,7 +1130,13 @@ var ModelsConfig = class _ModelsConfig {
1027
1130
  syncAfterAuthRefresh(authType, modelId, providerBaseUrlOverride) {
1028
1131
  const previousAuthType = this.currentAuthType;
1029
1132
  const providerBaseUrl = providerBaseUrlOverride ?? (previousAuthType === authType && this.currentRegistryBaseUrl !== void 0 ? this.currentRegistryBaseUrl : this.generationConfigSources["baseUrl"]?.kind === "modelProviders" ? this._generationConfig.baseUrl : void 0);
1133
+ const wasRegistered = (authType === "openai" /* USE_OPENAI */ || authType === "openai-responses" /* USE_OPENAI_RESPONSES */) && previousAuthType === authType && this.currentRegistryBaseUrl !== void 0 && modelId === this._generationConfig.model;
1030
1134
  const resolved = modelId ? this.modelRegistry.getModel(authType, modelId, providerBaseUrl) ?? this.modelRegistry.getModel(authType, modelId) : void 0;
1135
+ if (wasRegistered && !resolved) {
1136
+ throw new Error(
1137
+ `Model '${modelId}' is no longer configured for authType '${authType}'. Select an available model.`
1138
+ );
1139
+ }
1031
1140
  if (resolved?.imageOnly || resolved?.voiceOnly) {
1032
1141
  throw new Error(
1033
1142
  `${resolved.imageOnly ? "Image" : "Voice"}-only model '${modelId}' cannot be used as the primary model`
@@ -1328,393 +1437,112 @@ var ModelsConfig = class _ModelsConfig {
1328
1437
 
1329
1438
  // packages/core/src/providers/install.ts
1330
1439
  init_esbuild_shims();
1331
- var DENY_ENV_KEYS = /* @__PURE__ */ new Set([
1332
- "NODE_OPTIONS",
1333
- "NODE_PATH",
1334
- "LD_PRELOAD",
1335
- "LD_LIBRARY_PATH",
1336
- "DYLD_INSERT_LIBRARIES",
1337
- "DYLD_LIBRARY_PATH",
1338
- "PATH",
1339
- "HOME",
1340
- "TMPDIR",
1341
- "TMP",
1342
- // Windows temp redirect
1343
- "TEMP"
1344
- // Windows temp redirect
1345
- ]);
1346
- function isSameModelIdentity(a, b) {
1347
- return a.id === b.id && (a.baseUrl ?? "") === (b.baseUrl ?? "");
1440
+ import { isDeepStrictEqual } from "node:util";
1441
+
1442
+ // packages/core/src/providers/provider-config.ts
1443
+ init_esbuild_shims();
1444
+ import { createHash } from "node:crypto";
1445
+ function resolveEnvKey(config, inputs) {
1446
+ const protocol = inputs.protocol ?? config.protocol;
1447
+ const key = typeof config.envKey === "function" ? config.envKey(protocol, inputs.baseUrl) : config.envKey;
1448
+ return config.id === "custom-openai-compatible" && inputs.advancedConfig?.purpose ? `${key}_${inputs.advancedConfig.purpose.toUpperCase()}` : key;
1348
1449
  }
1349
- __name(isSameModelIdentity, "isSameModelIdentity");
1350
- function applyModelProvidersPatch(existingModelProviders, patch) {
1351
- const existingModels = existingModelProviders[patch.authType] ?? [];
1352
- let updatedModels = patch.models;
1353
- if (patch.mergeStrategy === "append") {
1354
- updatedModels = [...existingModels, ...patch.models];
1355
- } else {
1356
- const ownsModel = patch.ownsModel;
1357
- const preservedModels = existingModels.filter((model) => {
1358
- if (ownsModel) {
1359
- return !ownsModel(model);
1360
- }
1361
- return !patch.models.some(
1362
- (newModel) => isSameModelIdentity(newModel, model)
1363
- );
1364
- });
1365
- updatedModels = patch.mergeStrategy === "replace-owned" ? [...preservedModels, ...patch.models] : [...patch.models, ...preservedModels];
1450
+ __name(resolveEnvKey, "resolveEnvKey");
1451
+ function resolveModelNamePrefix(config, baseUrl) {
1452
+ return typeof config.modelNamePrefix === "function" ? config.modelNamePrefix(baseUrl) : config.modelNamePrefix;
1453
+ }
1454
+ __name(resolveModelNamePrefix, "resolveModelNamePrefix");
1455
+ function resolveOwnsModel(config) {
1456
+ if (config.ownsModel) return config.ownsModel;
1457
+ if (typeof config.envKey !== "string" || typeof config.modelNamePrefix !== "string") {
1458
+ return void 0;
1366
1459
  }
1367
- return {
1368
- ...existingModelProviders,
1369
- [patch.authType]: updatedModels
1370
- };
1460
+ const envKey = config.envKey;
1461
+ const prefix = config.modelNamePrefix;
1462
+ if (!prefix) return (model) => model.envKey === envKey;
1463
+ const namePrefix = `[${prefix}] `;
1464
+ return (model) => model.envKey === envKey && typeof model.name === "string" && model.name.startsWith(namePrefix);
1371
1465
  }
1372
- __name(applyModelProvidersPatch, "applyModelProvidersPatch");
1373
- var ProviderInstallError = class extends Error {
1374
- static {
1375
- __name(this, "ProviderInstallError");
1466
+ __name(resolveOwnsModel, "resolveOwnsModel");
1467
+ function buildGenerationConfig(spec, protocol) {
1468
+ const parts = {};
1469
+ let hasAny = false;
1470
+ if (spec.enableThinking) {
1471
+ if (protocol === "openai-responses" /* USE_OPENAI_RESPONSES */) {
1472
+ parts.reasoning = { effort: "medium" };
1473
+ } else {
1474
+ parts.extra_body = { enable_thinking: true };
1475
+ }
1476
+ hasAny = true;
1376
1477
  }
1377
- step;
1378
- authType;
1379
- constructor(message, step, authType, options) {
1380
- super(message, options);
1381
- this.name = "ProviderInstallError";
1382
- this.step = step;
1383
- this.authType = authType;
1478
+ if (spec.thinkingMandatory) {
1479
+ parts.thinkingMandatory = true;
1480
+ hasAny = true;
1384
1481
  }
1385
- };
1386
- async function applyProviderInstallPlan(plan, options) {
1387
- const {
1388
- settings,
1389
- reloadModelProviders,
1390
- syncAuthState,
1391
- refreshAuth,
1392
- doRefreshAuth = true
1393
- } = options;
1394
- const serviceOnly = (plan.modelProviders ?? []).flatMap(
1395
- (patch) => patch.models
1396
- );
1397
- const preserveSelection = serviceOnly.length > 0 && serviceOnly.every((model) => model.imageOnly || model.voiceOnly);
1398
- const previousEnvValues = /* @__PURE__ */ new Map();
1399
- const previousRuntimeProviders = {
1400
- ...settings.getModelProviders()
1401
- };
1402
- for (const patch of plan.modelProviders ?? []) {
1403
- const existingModels = previousRuntimeProviders[patch.authType] ?? [];
1404
- const changesRole = existingModels.some(
1405
- (existing) => patch.models.some(
1406
- (model) => (isSameModelIdentity(existing, model) || existing.id === model.id && patch.ownsModel?.(existing) && (preserveSelection || patch.mergeStrategy !== "append")) && (Boolean(existing.imageOnly) !== Boolean(model.imageOnly) || Boolean(existing.voiceOnly) !== Boolean(model.voiceOnly) || isImageGenerationCapable(existing) && !isImageGenerationCapable(model))
1407
- )
1408
- );
1409
- const removesConversation = preserveSelection && existingModels.some(
1410
- (existing) => !existing.imageOnly && !existing.voiceOnly && (patch.ownsModel?.(existing) ?? patch.models.some((model) => isSameModelIdentity(existing, model)))
1411
- );
1412
- const removesService = !preserveSelection && patch.mergeStrategy !== "append" && existingModels.some(
1413
- (existing) => (existing.imageOnly || existing.voiceOnly) && patch.ownsModel?.(existing) && !patch.models.some((model) => model.id === existing.id)
1414
- );
1415
- if (changesRole || removesConversation || removesService) {
1416
- throw new ProviderInstallError(
1417
- removesConversation ? "This install would remove existing conversation models. Include them in the provider selection, or add the service model with Custom Provider." : removesService ? "This install would remove existing service models. Include them in the provider selection, or add the conversation model with Custom Provider." : "This install would replace a model configured for another purpose. Use a different model ID or endpoint.",
1418
- "modelPurpose",
1419
- plan.authType
1420
- );
1421
- }
1482
+ if (spec.contextWindowSize) {
1483
+ parts.contextWindowSize = spec.contextWindowSize;
1484
+ hasAny = true;
1422
1485
  }
1423
- const voiceIds = new Set(
1424
- [
1425
- ...Object.values(previousRuntimeProviders).flatMap(
1426
- (models) => Array.isArray(models) ? models : []
1427
- ),
1428
- ...serviceOnly
1429
- ].filter((model) => model?.voiceOnly).map((model) => model.id)
1430
- );
1431
- const selectedVoice = settings.getValue("voiceModel");
1432
- if (typeof selectedVoice === "string" && selectedVoice)
1433
- voiceIds.add(selectedVoice);
1434
- const changedVoiceIds = [...voiceIds].filter(
1435
- (id) => plan.modelProviders?.some(
1436
- (patch) => patch.models.some((model) => model.id === id)
1437
- )
1438
- );
1439
- if (changedVoiceIds.length) {
1440
- let prospective = previousRuntimeProviders;
1441
- for (const patch of plan.modelProviders ?? []) {
1442
- prospective = applyModelProvidersPatch(prospective, patch);
1443
- }
1444
- const configured = new ModelsConfig({
1445
- modelProvidersConfig: prospective,
1446
- providerProtocolConfig: settings.getValue("providerProtocol")
1447
- }).getAllConfiguredModels();
1448
- if (changedVoiceIds.some(
1449
- (id) => configured.filter((entry) => entry.id === id).length > 1
1450
- )) {
1451
- throw new ProviderInstallError(
1452
- "A voice model with this ID is already configured at another endpoint. Edit that model or use a different model ID.",
1453
- "modelPurpose",
1454
- plan.authType
1455
- );
1486
+ if (spec.modalities && Object.values(spec.modalities).some(Boolean)) {
1487
+ parts.modalities = spec.modalities;
1488
+ hasAny = true;
1489
+ }
1490
+ return hasAny ? parts : void 0;
1491
+ }
1492
+ __name(buildGenerationConfig, "buildGenerationConfig");
1493
+ function buildAdvancedGenerationConfig(advCfg, protocol) {
1494
+ const cfg = {};
1495
+ let hasAny = false;
1496
+ if (advCfg?.enableThinking) {
1497
+ if (protocol === "openai-responses" /* USE_OPENAI_RESPONSES */) {
1498
+ cfg.reasoning = { effort: "medium" };
1499
+ } else {
1500
+ cfg.extra_body = { enable_thinking: true };
1456
1501
  }
1502
+ hasAny = true;
1457
1503
  }
1458
- let currentStep = "init";
1459
- try {
1460
- currentStep = "backup";
1461
- settings.backup?.();
1462
- currentStep = "env";
1463
- const shadowedEnvKeys = [];
1464
- for (const [key, value] of Object.entries(plan.env ?? {})) {
1465
- if (DENY_ENV_KEYS.has(key.toUpperCase())) {
1466
- throw new Error(
1467
- `Install plan must not set reserved environment variable: ${key}`
1468
- );
1469
- }
1470
- const previous = process.env[key];
1471
- if (previous !== void 0 && previous !== "" && previous !== value) {
1472
- shadowedEnvKeys.push(key);
1473
- }
1474
- previousEnvValues.set(key, previous);
1475
- settings.setValue(`env.${key}`, value);
1476
- process.env[key] = value;
1477
- }
1478
- if (shadowedEnvKeys.length > 0) {
1479
- console.error(
1480
- `[auth] Warning: ${shadowedEnvKeys.join(", ")} ${shadowedEnvKeys.length === 1 ? "is" : "are"} also set in your shell environment or .env file. The shell/file value will take priority on restart. To ensure your new key is used, update or remove the variable from your shell profile or .env file.`
1481
- );
1482
- }
1483
- currentStep = "modelProviders";
1484
- let updatedModelProviders = {
1485
- ...previousRuntimeProviders
1486
- };
1487
- for (const patch of plan.modelProviders ?? []) {
1488
- updatedModelProviders = applyModelProvidersPatch(
1489
- updatedModelProviders,
1490
- preserveSelection ? {
1491
- ...patch,
1492
- mergeStrategy: "replace-owned",
1493
- ownsModel: /* @__PURE__ */ __name((existing) => (patch.ownsModel?.(existing) ?? false) || patch.models.some(
1494
- (model) => isSameModelIdentity(existing, model)
1495
- ), "ownsModel")
1496
- } : patch
1497
- );
1498
- settings.setValue(
1499
- `modelProviders.${patch.authType}`,
1500
- updatedModelProviders[patch.authType] ?? []
1501
- );
1502
- }
1503
- const effectiveProviders = settings.getModelProviders();
1504
- for (const patch of plan.modelProviders ?? []) {
1505
- if (patch.models.some(
1506
- (model) => !effectiveProviders[patch.authType]?.some(
1507
- (effective) => isSameModelIdentity(model, effective)
1508
- )
1509
- )) {
1510
- throw new ProviderInstallError(
1511
- "A higher-precedence settings scope overrides the installed models. Update the scope that owns this provider.",
1512
- "modelProviders",
1513
- plan.authType
1514
- );
1515
- }
1516
- }
1517
- currentStep = "authType";
1518
- if (!preserveSelection) {
1519
- settings.setValue("security.auth.selectedType", plan.authType);
1520
- }
1521
- currentStep = "legacyCredentials";
1522
- if (plan.legacyCredentials?.apiKey != null) {
1523
- settings.setValue("security.auth.apiKey", plan.legacyCredentials.apiKey);
1524
- }
1525
- if (plan.legacyCredentials?.baseUrl != null) {
1526
- settings.setValue(
1527
- "security.auth.baseUrl",
1528
- plan.legacyCredentials.baseUrl
1529
- );
1530
- }
1531
- currentStep = "modelSelection";
1532
- let effectiveModelSelection = preserveSelection ? void 0 : plan.modelSelection;
1533
- if (effectiveModelSelection?.modelId) {
1534
- const currentModelId = settings.getValue("model.name");
1535
- const currentBaseUrl = settings.getValue("model.baseUrl");
1536
- const planOffersCurrentModel = typeof currentModelId === "string" && currentModelId.length > 0 && (plan.modelProviders ?? []).some(
1537
- (patch) => patch.models.some(
1538
- (model) => currentBaseUrl === "" || currentBaseUrl === void 0 ? model.id === currentModelId : isSameModelIdentity(
1539
- { id: currentModelId, baseUrl: currentBaseUrl },
1540
- model
1541
- )
1542
- )
1543
- );
1544
- if (planOffersCurrentModel) {
1545
- effectiveModelSelection = void 0;
1546
- }
1547
- }
1548
- if (effectiveModelSelection?.modelId) {
1549
- settings.setValue("model.name", effectiveModelSelection.modelId);
1550
- if (effectiveModelSelection.baseUrl) {
1551
- settings.setValue("model.baseUrl", effectiveModelSelection.baseUrl);
1552
- } else {
1553
- settings.setValue("model.baseUrl", "");
1554
- }
1555
- }
1556
- currentStep = "providerState";
1557
- for (const [key, entries] of Object.entries(plan.providerState ?? {})) {
1558
- for (const [field, value] of Object.entries(entries)) {
1559
- settings.setValue(`${key}.${field}`, value);
1560
- }
1561
- }
1562
- currentStep = "persist";
1563
- settings.persist();
1564
- currentStep = "reloadModelProviders";
1565
- updatedModelProviders = settings.getModelProviders();
1566
- reloadModelProviders?.(updatedModelProviders);
1567
- if (effectiveModelSelection?.modelId) {
1568
- currentStep = "syncAuthState";
1569
- syncAuthState?.(
1570
- plan.authType,
1571
- effectiveModelSelection.modelId,
1572
- effectiveModelSelection.baseUrl
1573
- );
1574
- }
1575
- if (!preserveSelection && doRefreshAuth && refreshAuth) {
1576
- currentStep = "refreshAuth";
1577
- await refreshAuth(plan.authType);
1578
- }
1579
- currentStep = "cleanupBackup";
1580
- settings.cleanupBackup?.();
1581
- return { updatedModelProviders };
1582
- } catch (error) {
1583
- try {
1584
- settings.restore?.();
1585
- } catch (restoreErr) {
1586
- console.error(
1587
- "[applyProviderInstallPlan] settings.restore failed during rollback:",
1588
- restoreErr
1589
- );
1590
- }
1591
- try {
1592
- for (const [key, prev] of previousEnvValues) {
1593
- if (prev === void 0) {
1594
- delete process.env[key];
1595
- } else {
1596
- process.env[key] = prev;
1597
- }
1598
- }
1599
- } catch (envErr) {
1600
- console.error("[applyProviderInstallPlan] env rollback failed:", envErr);
1601
- }
1602
- try {
1603
- reloadModelProviders?.(previousRuntimeProviders);
1604
- } catch (reloadErr) {
1605
- console.error(
1606
- "[applyProviderInstallPlan] reloadModelProviders failed during rollback:",
1607
- reloadErr
1608
- );
1609
- }
1610
- const errMsg = error instanceof Error ? error.message : String(error);
1611
- throw new ProviderInstallError(errMsg, currentStep, plan.authType, {
1612
- cause: error instanceof Error ? error : void 0
1613
- });
1614
- }
1615
- }
1616
- __name(applyProviderInstallPlan, "applyProviderInstallPlan");
1617
-
1618
- // packages/core/src/providers/provider-config.ts
1619
- init_esbuild_shims();
1620
- import { createHash } from "node:crypto";
1621
- function resolveEnvKey(config, inputs) {
1622
- const protocol = inputs.protocol ?? config.protocol;
1623
- const key = typeof config.envKey === "function" ? config.envKey(protocol, inputs.baseUrl) : config.envKey;
1624
- return config.id === "custom-openai-compatible" && inputs.advancedConfig?.purpose ? `${key}_${inputs.advancedConfig.purpose.toUpperCase()}` : key;
1625
- }
1626
- __name(resolveEnvKey, "resolveEnvKey");
1627
- function resolveModelNamePrefix(config, baseUrl) {
1628
- return typeof config.modelNamePrefix === "function" ? config.modelNamePrefix(baseUrl) : config.modelNamePrefix;
1629
- }
1630
- __name(resolveModelNamePrefix, "resolveModelNamePrefix");
1631
- function resolveOwnsModel(config) {
1632
- if (config.ownsModel) return config.ownsModel;
1633
- if (typeof config.envKey !== "string" || typeof config.modelNamePrefix !== "string") {
1634
- return void 0;
1635
- }
1636
- const envKey = config.envKey;
1637
- const prefix = config.modelNamePrefix;
1638
- if (!prefix) return (model) => model.envKey === envKey;
1639
- const namePrefix = `[${prefix}] `;
1640
- return (model) => model.envKey === envKey && typeof model.name === "string" && model.name.startsWith(namePrefix);
1641
- }
1642
- __name(resolveOwnsModel, "resolveOwnsModel");
1643
- function buildGenerationConfig(spec) {
1644
- const parts = {};
1645
- let hasAny = false;
1646
- if (spec.enableThinking) {
1647
- parts.extra_body = { enable_thinking: true };
1648
- hasAny = true;
1649
- }
1650
- if (spec.thinkingMandatory) {
1651
- parts.thinkingMandatory = true;
1652
- hasAny = true;
1653
- }
1654
- if (spec.contextWindowSize) {
1655
- parts.contextWindowSize = spec.contextWindowSize;
1656
- hasAny = true;
1657
- }
1658
- if (spec.modalities && Object.values(spec.modalities).some(Boolean)) {
1659
- parts.modalities = spec.modalities;
1660
- hasAny = true;
1661
- }
1662
- return hasAny ? parts : void 0;
1663
- }
1664
- __name(buildGenerationConfig, "buildGenerationConfig");
1665
- function buildAdvancedGenerationConfig(advCfg, protocol) {
1666
- const cfg = {};
1667
- let hasAny = false;
1668
- if (advCfg?.enableThinking) {
1669
- if (protocol === "openai-responses" /* USE_OPENAI_RESPONSES */) {
1670
- cfg.reasoning = { effort: "medium" };
1671
- } else {
1672
- cfg.extra_body = { enable_thinking: true };
1673
- }
1674
- hasAny = true;
1675
- }
1676
- if (advCfg?.multimodal && Object.values(advCfg.multimodal).some(Boolean)) {
1677
- cfg.modalities = advCfg.multimodal;
1678
- hasAny = true;
1679
- }
1680
- if (advCfg?.contextWindowSize && advCfg.contextWindowSize > 0) {
1681
- cfg.contextWindowSize = advCfg.contextWindowSize;
1682
- hasAny = true;
1683
- }
1684
- if (advCfg?.maxTokens && advCfg.maxTokens > 0) {
1685
- cfg.samplingParams = { max_tokens: advCfg.maxTokens };
1686
- hasAny = true;
1687
- }
1688
- return hasAny ? cfg : void 0;
1689
- }
1690
- __name(buildAdvancedGenerationConfig, "buildAdvancedGenerationConfig");
1691
- function specToModelConfig(spec, prefix, baseUrl, envKey) {
1692
- const genConfig = buildGenerationConfig(spec);
1693
- return {
1694
- id: spec.id,
1695
- name: prefix ? `[${prefix}] ${spec.id}` : spec.id,
1696
- ...spec.description ? { description: spec.description } : {},
1697
- ...spec.capabilities ? { capabilities: spec.capabilities } : {},
1698
- baseUrl,
1699
- envKey,
1700
- ...spec.supportsImageGeneration ? { supportsImageGeneration: true } : {},
1701
- ...spec.imageOnly ? { imageOnly: true } : {},
1702
- ...genConfig ? { generationConfig: genConfig } : {}
1703
- };
1704
- }
1705
- __name(specToModelConfig, "specToModelConfig");
1706
- function applyProviderCustomHeaders(models, config) {
1707
- if (!config.customHeaders) return models;
1708
- return models.map((model) => {
1709
- const existing = model.generationConfig ?? {};
1710
- return {
1711
- ...model,
1712
- generationConfig: {
1713
- ...existing,
1714
- customHeaders: {
1715
- ...config.customHeaders,
1716
- ...existing.customHeaders
1717
- }
1504
+ if (advCfg?.multimodal && Object.values(advCfg.multimodal).some(Boolean)) {
1505
+ cfg.modalities = advCfg.multimodal;
1506
+ hasAny = true;
1507
+ }
1508
+ if (advCfg?.contextWindowSize && advCfg.contextWindowSize > 0) {
1509
+ cfg.contextWindowSize = advCfg.contextWindowSize;
1510
+ hasAny = true;
1511
+ }
1512
+ if (advCfg?.maxTokens && advCfg.maxTokens > 0) {
1513
+ cfg.samplingParams = { max_tokens: advCfg.maxTokens };
1514
+ hasAny = true;
1515
+ }
1516
+ return hasAny ? cfg : void 0;
1517
+ }
1518
+ __name(buildAdvancedGenerationConfig, "buildAdvancedGenerationConfig");
1519
+ function specToModelConfig(spec, prefix, baseUrl, envKey, protocol) {
1520
+ const genConfig = buildGenerationConfig(spec, protocol);
1521
+ return {
1522
+ id: spec.id,
1523
+ name: prefix ? `[${prefix}] ${spec.id}` : spec.id,
1524
+ ...spec.description ? { description: spec.description } : {},
1525
+ ...spec.capabilities ? { capabilities: spec.capabilities } : {},
1526
+ baseUrl,
1527
+ envKey,
1528
+ ...spec.supportsImageGeneration ? { supportsImageGeneration: true } : {},
1529
+ ...spec.imageOnly ? { imageOnly: true } : {},
1530
+ ...genConfig ? { generationConfig: genConfig } : {}
1531
+ };
1532
+ }
1533
+ __name(specToModelConfig, "specToModelConfig");
1534
+ function applyProviderCustomHeaders(models, config) {
1535
+ if (!config.customHeaders) return models;
1536
+ return models.map((model) => {
1537
+ const existing = model.generationConfig ?? {};
1538
+ return {
1539
+ ...model,
1540
+ generationConfig: {
1541
+ ...existing,
1542
+ customHeaders: {
1543
+ ...config.customHeaders,
1544
+ ...existing.customHeaders
1545
+ }
1718
1546
  }
1719
1547
  };
1720
1548
  });
@@ -1723,11 +1551,14 @@ __name(applyProviderCustomHeaders, "applyProviderCustomHeaders");
1723
1551
  function buildModelConfigs(config, inputs) {
1724
1552
  const envKey = resolveEnvKey(config, inputs);
1725
1553
  const prefix = resolveModelNamePrefix(config, inputs.baseUrl);
1726
- const protocol = inputs.protocol ?? config.protocol;
1554
+ const protocol = resolveModelProtocol(
1555
+ inputs.protocol ?? config.protocol,
1556
+ inputs
1557
+ );
1727
1558
  let models;
1728
1559
  if (config.models && !config.modelsEditable) {
1729
1560
  models = config.models.map(
1730
- (spec) => specToModelConfig(spec, prefix, inputs.baseUrl, envKey)
1561
+ (spec) => specToModelConfig(spec, prefix, inputs.baseUrl, envKey, protocol)
1731
1562
  );
1732
1563
  } else if (config.models && config.modelsEditable) {
1733
1564
  const specMap = new Map(config.models.map((s) => [s.id.toLowerCase(), s]));
@@ -1738,7 +1569,8 @@ function buildModelConfigs(config, inputs) {
1738
1569
  { ...spec, id },
1739
1570
  prefix,
1740
1571
  inputs.baseUrl,
1741
- envKey
1572
+ envKey,
1573
+ protocol
1742
1574
  );
1743
1575
  }
1744
1576
  const genConfig = buildAdvancedGenerationConfig(
@@ -1795,11 +1627,52 @@ function resolveProviderState(config, baseUrl, models) {
1795
1627
  return void 0;
1796
1628
  }
1797
1629
  __name(resolveProviderState, "resolveProviderState");
1798
- function buildInstallPlan(config, inputs, existingModels = []) {
1799
- const protocol = inputs.protocol ?? config.protocol;
1630
+ function retireProviderState(config) {
1631
+ const key = resolveMetadataKey(config);
1632
+ return key ? { [`${PROVIDER_METADATA_NS}.${key}`]: { version: void 0 } } : void 0;
1633
+ }
1634
+ __name(retireProviderState, "retireProviderState");
1635
+ function buildInstallPlan(config, inputs, existingModels = [], selection) {
1636
+ const inputProtocol = inputs.protocol ?? config.protocol;
1637
+ const protocol = resolveModelProtocol(inputProtocol, inputs);
1638
+ const isOpenAI = protocol === "openai" /* USE_OPENAI */ || protocol === "openai-responses" /* USE_OPENAI_RESPONSES */;
1639
+ const savedProtocol = isOpenAI ? "openai" /* USE_OPENAI */ : protocol;
1640
+ const wireApi = inputs.wireApi ?? (inputProtocol === "openai-responses" /* USE_OPENAI_RESPONSES */ ? "responses" : void 0);
1641
+ if (inputProtocol === "openai-responses" /* USE_OPENAI_RESPONSES */) {
1642
+ inputs = { ...inputs, protocol: savedProtocol, wireApi };
1643
+ }
1800
1644
  let envKey = resolveEnvKey(config, inputs);
1801
1645
  const providerOwns = resolveOwnsModel(config);
1802
- let models = inputs.prebuiltModels ?? buildModelConfigs(config, inputs);
1646
+ const builtModels = inputs.prebuiltModels ?? buildModelConfigs(config, inputs);
1647
+ const preserveSavedApis = isOpenAI && !config.protocolOptions && wireApi === void 0;
1648
+ let models = wireApi ? builtModels.map(
1649
+ (model) => model.wireApi === void 0 ? { ...model, wireApi } : model
1650
+ ) : builtModels;
1651
+ if (preserveSavedApis && existingModels.length) {
1652
+ const responsesModels = inputs.prebuiltModels ?? buildModelConfigs(config, {
1653
+ ...inputs,
1654
+ wireApi: "responses"
1655
+ });
1656
+ models = builtModels.flatMap((model, index) => {
1657
+ if (model.wireApi !== void 0) return [model];
1658
+ const saved = existingModels.filter(
1659
+ (entry) => providerOwns?.(entry) && entry.id === model.id && entry.baseUrl === model.baseUrl && tryResolveModelProtocol(savedProtocol, entry) !== void 0
1660
+ );
1661
+ if (!saved.length) return [model];
1662
+ const seen = /* @__PURE__ */ new Set();
1663
+ return saved.flatMap((entry) => {
1664
+ const route = resolveModelProtocol(savedProtocol, entry);
1665
+ if (seen.has(route)) return [];
1666
+ seen.add(route);
1667
+ return [
1668
+ {
1669
+ ...route === "openai-responses" /* USE_OPENAI_RESPONSES */ ? responsesModels[index] : model,
1670
+ ...entry.wireApi !== void 0 ? { wireApi: entry.wireApi } : {}
1671
+ }
1672
+ ];
1673
+ });
1674
+ });
1675
+ }
1803
1676
  const providerState = resolveProviderState(config, inputs.baseUrl, models);
1804
1677
  if (config.id === "custom-openai-compatible" && existingModels?.some(
1805
1678
  (entry) => providerOwns?.(entry) && (entry.imageOnly || entry.voiceOnly) && models.some((model) => model.id === entry.id) && typeof entry.baseUrl === "string" && entry.baseUrl !== inputs.baseUrl && resolveEnvKey(config, { ...inputs, baseUrl: entry.baseUrl }) === envKey
@@ -1813,7 +1686,7 @@ function buildInstallPlan(config, inputs, existingModels = []) {
1813
1686
  if (existingModels?.length && !inputs.advancedConfig?.purpose) {
1814
1687
  models = models.map((model) => {
1815
1688
  const existing = existingModels.find(
1816
- (entry) => providerOwns?.(entry) && entry.id === model.id && entry.baseUrl === model.baseUrl
1689
+ (entry) => (providerOwns?.(entry) || config.mergeModelsByIdentity) && entry.id === model.id && entry.baseUrl === model.baseUrl && tryResolveModelProtocol(savedProtocol, entry) === resolveModelProtocol(savedProtocol, model)
1817
1690
  );
1818
1691
  if (!existing) return model;
1819
1692
  const preservedGeneration = { ...existing.generationConfig };
@@ -1878,23 +1751,40 @@ function buildInstallPlan(config, inputs, existingModels = []) {
1878
1751
  ...existing?.supportsImageGeneration ? { supportsImageGeneration: true } : {},
1879
1752
  ...existing?.imageOnly ? { imageOnly: true } : {},
1880
1753
  ...existing?.voiceOnly ? { voiceOnly: true } : {},
1881
- ...(existing?.imageOnly || existing?.voiceOnly) && existing.envKey ? { envKey: existing.envKey } : {}
1754
+ ...existing.envKey ? { envKey: existing.envKey } : {}
1882
1755
  };
1883
1756
  });
1884
1757
  }
1885
- if (models.length > 0 && models.every((model) => model.imageOnly || model.voiceOnly)) {
1886
- const keys = new Set(models.map((model) => model.envKey));
1887
- if (keys.size > 1) {
1758
+ if (models.length > 0) {
1759
+ const conversation = models.filter(
1760
+ (model) => !model.imageOnly && !model.voiceOnly
1761
+ );
1762
+ const credentialModels = conversation.length ? conversation : models;
1763
+ const keys = new Set(credentialModels.map((model) => model.envKey));
1764
+ if (keys.size > 1 && inputs.apiKey) {
1888
1765
  throw new Error(
1889
- "Reconnect image and voice models separately to preserve their independent API keys."
1766
+ "Reconnect models with different credential references separately to preserve their independent API keys."
1890
1767
  );
1891
1768
  }
1892
- if (keys.size === 1 && models[0]?.envKey) envKey = models[0].envKey;
1769
+ if (credentialModels[0]?.envKey) envKey = credentialModels[0].envKey;
1893
1770
  }
1894
1771
  const ownsModel = config.mergeModelsByIdentity ? void 0 : resolveOwnsModel(config);
1895
- const firstModel = models.find(
1896
- (model) => !model.imageOnly && !model.voiceOnly
1897
- );
1772
+ for (const model of models) {
1773
+ const modelProtocol = resolveModelProtocol(savedProtocol, model);
1774
+ if (model.voiceOnly && modelProtocol !== "openai" /* USE_OPENAI */) {
1775
+ throw new ProviderInstallError(
1776
+ "Voice transcription requires the OpenAI Chat Completions API.",
1777
+ "modelPurpose",
1778
+ protocol
1779
+ );
1780
+ }
1781
+ }
1782
+ const selectedModels = preserveSavedApis && selection?.id ? models.filter(
1783
+ (model) => !model.imageOnly && !model.voiceOnly && model.id === selection.id && (!selection.baseUrl || model.baseUrl === selection.baseUrl)
1784
+ ) : [];
1785
+ const firstModel = selectedModels.find(
1786
+ (model) => resolveModelProtocol(savedProtocol, model) === selection?.authType
1787
+ ) ?? selectedModels[0] ?? models.find((model) => !model.imageOnly && !model.voiceOnly);
1898
1788
  if (models.length === 0) {
1899
1789
  throw new Error(
1900
1790
  `No models configured for provider "${config.id}". Check model list or provider configuration.`
@@ -1907,18 +1797,23 @@ function buildInstallPlan(config, inputs, existingModels = []) {
1907
1797
  };
1908
1798
  return {
1909
1799
  providerId: config.id,
1910
- authType: protocol,
1800
+ authType: firstModel ? resolveModelProtocol(savedProtocol, firstModel) : savedProtocol,
1911
1801
  env: { [envKey]: inputs.apiKey },
1912
1802
  ...modelSelection ? { modelSelection } : {},
1913
1803
  modelProviders: [
1914
1804
  {
1915
- authType: protocol,
1805
+ authType: savedProtocol,
1916
1806
  models,
1917
1807
  mergeStrategy: "prepend-and-remove-owned",
1918
1808
  ...ownsModel ? { ownsModel } : {}
1919
1809
  }
1920
1810
  ],
1921
- providerState
1811
+ // The drift check (findAllPendingUpdates) rebuilds the reference version
1812
+ // from the provider's own protocol template, which never stamps `wireApi`, so
1813
+ // any stamped install — on either wire — records nothing. Skipping alone
1814
+ // would let a version from an earlier default-route install survive, so
1815
+ // the retire shape deletes it instead.
1816
+ providerState: models.every((model) => model.wireApi === void 0) && protocol === config.protocol ? providerState : retireProviderState(config)
1922
1817
  };
1923
1818
  }
1924
1819
  __name(buildInstallPlan, "buildInstallPlan");
@@ -1969,25 +1864,62 @@ function isProviderModelConfig(value) {
1969
1864
  return typeof value === "object" && value !== null && typeof value.id === "string";
1970
1865
  }
1971
1866
  __name(isProviderModelConfig, "isProviderModelConfig");
1972
- function findExistingProviderModels(config, modelProviders) {
1973
- const ownsModel = resolveOwnsModel(config);
1974
- if (!ownsModel || !modelProviders) return void 0;
1975
- const protocols = config.protocolOptions?.length ? config.protocolOptions : [config.protocol];
1976
- for (const protocol of protocols) {
1977
- const raw = modelProviders[protocol];
1867
+ function getModelsForProviderProtocol(modelProviders, protocol, providerProtocol) {
1868
+ const canonicalProtocol = protocol === "openai-responses" /* USE_OPENAI_RESPONSES */ ? "openai" /* USE_OPENAI */ : protocol;
1869
+ const result = [];
1870
+ for (const [providerId, raw] of Object.entries(modelProviders ?? {})) {
1978
1871
  if (!Array.isArray(raw)) continue;
1979
- const models = raw.filter(
1980
- (m) => isProviderModelConfig(m) && ownsModel(m)
1981
- );
1982
- if (models.length > 0) return { protocol, models };
1983
- }
1984
- return void 0;
1985
- }
1872
+ for (const model of raw) {
1873
+ if (!isProviderModelConfig(model)) continue;
1874
+ const effective = tryResolveModelProtocol(
1875
+ providerId,
1876
+ model,
1877
+ providerProtocol
1878
+ );
1879
+ if (effective !== canonicalProtocol && !(canonicalProtocol === "openai" /* USE_OPENAI */ && effective === "openai-responses" /* USE_OPENAI_RESPONSES */))
1880
+ continue;
1881
+ result.push(
1882
+ effective === "openai-responses" /* USE_OPENAI_RESPONSES */ ? { ...model, wireApi: "responses" } : canonicalProtocol === "openai" /* USE_OPENAI */ && providerId !== canonicalProtocol ? { ...model, wireApi: "chat-completions" } : model
1883
+ );
1884
+ }
1885
+ }
1886
+ return result;
1887
+ }
1888
+ __name(getModelsForProviderProtocol, "getModelsForProviderProtocol");
1889
+ function findExistingProviderModels(config, modelProviders, mapping, selection) {
1890
+ const ownsModel = resolveOwnsModel(config);
1891
+ if (!ownsModel || !modelProviders) return void 0;
1892
+ const protocols = config.protocolOptions?.length ? config.protocolOptions : [config.protocol];
1893
+ for (const providerProtocol of protocols) {
1894
+ const models = getModelsForProviderProtocol(
1895
+ modelProviders,
1896
+ providerProtocol,
1897
+ mapping
1898
+ ).filter(ownsModel);
1899
+ if (!models.length) continue;
1900
+ const selectedModels = selection?.id ? models.filter(
1901
+ (model) => model.id === selection.id && (!selection.baseUrl || model.baseUrl === selection.baseUrl)
1902
+ ) : [];
1903
+ const selected = selectedModels.find(
1904
+ (model) => resolveModelProtocol(providerProtocol, model) === selection?.authType
1905
+ ) ?? selectedModels[0] ?? models[0];
1906
+ const protocol = resolveModelProtocol(providerProtocol, selected);
1907
+ return {
1908
+ protocol,
1909
+ models: models.filter(
1910
+ (model) => resolveModelProtocol(providerProtocol, model) === protocol
1911
+ )
1912
+ };
1913
+ }
1914
+ return void 0;
1915
+ }
1986
1916
  __name(findExistingProviderModels, "findExistingProviderModels");
1987
- function shouldShowStep(config, step) {
1917
+ function shouldShowStep(config, step, protocol = config.protocol) {
1988
1918
  switch (step) {
1989
1919
  case "protocol":
1990
1920
  return Array.isArray(config.protocolOptions) && config.protocolOptions.length > 1;
1921
+ case "wireApi":
1922
+ return Boolean(config.protocolOptions?.length) && (protocol === "openai" /* USE_OPENAI */ || protocol === "openai-responses" /* USE_OPENAI_RESPONSES */);
1991
1923
  case "baseUrl":
1992
1924
  return config.baseUrl === void 0 || Array.isArray(config.baseUrl);
1993
1925
  case "apiKey":
@@ -2052,6 +1984,406 @@ function buildProviderTemplate(config, baseUrl) {
2052
1984
  }
2053
1985
  __name(buildProviderTemplate, "buildProviderTemplate");
2054
1986
 
1987
+ // packages/core/src/providers/install.ts
1988
+ var DENY_ENV_KEYS = /* @__PURE__ */ new Set([
1989
+ "NODE_OPTIONS",
1990
+ "NODE_PATH",
1991
+ "LD_PRELOAD",
1992
+ "LD_LIBRARY_PATH",
1993
+ "DYLD_INSERT_LIBRARIES",
1994
+ "DYLD_LIBRARY_PATH",
1995
+ "PATH",
1996
+ "HOME",
1997
+ "TMPDIR",
1998
+ "TMP",
1999
+ // Windows temp redirect
2000
+ "TEMP"
2001
+ // Windows temp redirect
2002
+ ]);
2003
+ function isSameModelIdentity(a, b) {
2004
+ return a.id === b.id && (a.baseUrl ?? "") === (b.baseUrl ?? "");
2005
+ }
2006
+ __name(isSameModelIdentity, "isSameModelIdentity");
2007
+ function applyModelProvidersPatch(existingModelProviders, patch, mapping) {
2008
+ if (patch.authType === "openai" /* USE_OPENAI */ && resolveProviderProtocol(patch.authType, mapping) === "openai-responses" /* USE_OPENAI_RESPONSES */) {
2009
+ patch = {
2010
+ ...patch,
2011
+ models: patch.models.map((model) => ({
2012
+ ...model,
2013
+ wireApi: model.wireApi ?? "chat-completions"
2014
+ }))
2015
+ };
2016
+ }
2017
+ const existingModels = existingModelProviders[patch.authType] ?? [];
2018
+ let updatedModels = patch.models;
2019
+ if (patch.mergeStrategy === "append") {
2020
+ updatedModels = [...existingModels, ...patch.models];
2021
+ } else {
2022
+ const ownsModel = patch.ownsModel;
2023
+ const preservedModels = existingModels.filter((model) => {
2024
+ if (ownsModel) {
2025
+ return !ownsModel(model) || !patch.models.some(
2026
+ (newModel) => resolveModelProtocol(patch.authType, newModel) === tryResolveModelProtocol(patch.authType, model, mapping)
2027
+ );
2028
+ }
2029
+ return !patch.models.some(
2030
+ (newModel) => isSameModelIdentity(newModel, model) && resolveModelProtocol(patch.authType, newModel) === tryResolveModelProtocol(patch.authType, model, mapping)
2031
+ );
2032
+ });
2033
+ updatedModels = patch.mergeStrategy === "replace-owned" ? [...preservedModels, ...patch.models] : [...patch.models, ...preservedModels];
2034
+ }
2035
+ return {
2036
+ ...existingModelProviders,
2037
+ [patch.authType]: updatedModels
2038
+ };
2039
+ }
2040
+ __name(applyModelProvidersPatch, "applyModelProvidersPatch");
2041
+ var ProviderInstallError = class extends Error {
2042
+ static {
2043
+ __name(this, "ProviderInstallError");
2044
+ }
2045
+ step;
2046
+ authType;
2047
+ constructor(message, step, authType, options) {
2048
+ super(message, options);
2049
+ this.name = "ProviderInstallError";
2050
+ this.step = step;
2051
+ this.authType = authType;
2052
+ }
2053
+ };
2054
+ async function applyProviderInstallPlan(plan, options) {
2055
+ const {
2056
+ settings,
2057
+ reloadModelProviders,
2058
+ syncAuthState,
2059
+ refreshAuth,
2060
+ doRefreshAuth = true
2061
+ } = options;
2062
+ const selectedAuthType = settings.getValue("security.auth.selectedType");
2063
+ const mapping = settings.getValue("providerProtocol");
2064
+ const serviceOnly = (plan.modelProviders ?? []).flatMap(
2065
+ (patch) => patch.models
2066
+ );
2067
+ const preserveSelection = serviceOnly.length > 0 && serviceOnly.every((model) => model.imageOnly || model.voiceOnly);
2068
+ const previousEnvValues = /* @__PURE__ */ new Map();
2069
+ const previousRuntimeProviders = {
2070
+ ...settings.getModelProviders()
2071
+ };
2072
+ const writeContext = settings.getModelProvidersForWrite?.();
2073
+ const writeMapping = writeContext ? writeContext.providerProtocol : mapping;
2074
+ for (const [providerId, models] of Object.entries(
2075
+ writeContext?.modelProviders ?? {}
2076
+ )) {
2077
+ if (!Array.isArray(models)) continue;
2078
+ if (providerId !== "openai-responses" /* USE_OPENAI_RESPONSES */ && resolveProviderProtocol(providerId, writeMapping) !== "openai-responses" /* USE_OPENAI_RESPONSES */)
2079
+ continue;
2080
+ const overwritten = models.filter(
2081
+ (existing) => plan.modelProviders?.some(
2082
+ (patch) => patch.authType === "openai" /* USE_OPENAI */ && patch.models.some(
2083
+ (model) => isSameModelIdentity(existing, model) && tryResolveModelProtocol(providerId, existing, writeMapping) === resolveModelProtocol(patch.authType, model)
2084
+ )
2085
+ )
2086
+ );
2087
+ if (overwritten.length && (writeContext?.shadowedProviders.includes(providerId) || overwritten.some(
2088
+ (model) => tryResolveModelProtocol(providerId, model, writeMapping) !== tryResolveModelProtocol(providerId, model, mapping)
2089
+ ))) {
2090
+ throw new ProviderInstallError(
2091
+ "A higher-precedence settings scope overrides this released provider declaration. Reconfigure it in the owning scope without that override.",
2092
+ "modelProviders",
2093
+ plan.authType
2094
+ );
2095
+ }
2096
+ }
2097
+ for (const patch of plan.modelProviders ?? []) {
2098
+ const existingModels = getModelsForProviderProtocol(
2099
+ previousRuntimeProviders,
2100
+ patch.authType,
2101
+ mapping
2102
+ );
2103
+ const ownBucketModels = previousRuntimeProviders[patch.authType] ?? [];
2104
+ const changesRole = existingModels.some(
2105
+ (existing) => patch.models.some(
2106
+ (model) => (isSameModelIdentity(existing, model) || existing.id === model.id && patch.ownsModel?.(existing) && (preserveSelection || patch.mergeStrategy !== "append")) && (Boolean(existing.imageOnly) !== Boolean(model.imageOnly) || Boolean(existing.voiceOnly) !== Boolean(model.voiceOnly) || isImageGenerationCapable(existing) && !isImageGenerationCapable(model))
2107
+ )
2108
+ );
2109
+ const removesConversation = preserveSelection && ownBucketModels.some(
2110
+ (existing) => !existing.imageOnly && !existing.voiceOnly && (patch.ownsModel?.(existing) ?? patch.models.some((model) => isSameModelIdentity(existing, model)))
2111
+ );
2112
+ const removesService = !preserveSelection && patch.mergeStrategy !== "append" && ownBucketModels.some(
2113
+ (existing) => (existing.imageOnly || existing.voiceOnly) && patch.ownsModel?.(existing) && !patch.models.some((model) => model.id === existing.id)
2114
+ );
2115
+ if (changesRole || removesConversation || removesService) {
2116
+ throw new ProviderInstallError(
2117
+ removesConversation ? "This install would remove existing conversation models. Include them in the provider selection, or add the service model with Custom Provider." : removesService ? "This install would remove existing service models. Include them in the provider selection, or add the conversation model with Custom Provider." : "This install would replace a model configured for another purpose. Use a different model ID or endpoint.",
2118
+ "modelPurpose",
2119
+ plan.authType
2120
+ );
2121
+ }
2122
+ }
2123
+ const voiceIds = new Set(
2124
+ [
2125
+ ...Object.values(previousRuntimeProviders).flatMap(
2126
+ (models) => Array.isArray(models) ? models : []
2127
+ ),
2128
+ ...serviceOnly
2129
+ ].filter((model) => model?.voiceOnly).map((model) => model.id)
2130
+ );
2131
+ const selectedVoice = settings.getValue("voiceModel");
2132
+ if (typeof selectedVoice === "string" && selectedVoice)
2133
+ voiceIds.add(selectedVoice);
2134
+ const changedVoiceIds = [...voiceIds].filter(
2135
+ (id) => plan.modelProviders?.some(
2136
+ (patch) => patch.models.some((model) => model.id === id)
2137
+ )
2138
+ );
2139
+ if (changedVoiceIds.length) {
2140
+ let prospective = previousRuntimeProviders;
2141
+ for (const patch of plan.modelProviders ?? []) {
2142
+ prospective = applyModelProvidersPatch(prospective, patch, mapping);
2143
+ }
2144
+ const configured = new ModelsConfig({
2145
+ modelProvidersConfig: Object.fromEntries(
2146
+ Object.entries(prospective).map(([providerId, models]) => [
2147
+ providerId,
2148
+ Array.isArray(models) ? models.filter(
2149
+ (model) => tryResolveModelProtocol(providerId, model, mapping) !== void 0
2150
+ ) : models
2151
+ ])
2152
+ ),
2153
+ providerProtocolConfig: mapping
2154
+ }).getAllConfiguredModels();
2155
+ if (changedVoiceIds.some(
2156
+ (id) => configured.filter((entry) => entry.id === id).length > 1
2157
+ )) {
2158
+ throw new ProviderInstallError(
2159
+ "A voice model with this ID is already configured at another endpoint. Edit that model or use a different model ID.",
2160
+ "modelPurpose",
2161
+ plan.authType
2162
+ );
2163
+ }
2164
+ }
2165
+ const previousModelId = settings.getValue("model.name");
2166
+ const previousBaseUrl = settings.getValue("model.baseUrl");
2167
+ let currentStep = "init";
2168
+ try {
2169
+ currentStep = "backup";
2170
+ settings.backup?.();
2171
+ currentStep = "env";
2172
+ const shadowedEnvKeys = [];
2173
+ for (const [key, value] of Object.entries(plan.env ?? {})) {
2174
+ if (DENY_ENV_KEYS.has(key.toUpperCase())) {
2175
+ throw new Error(
2176
+ `Install plan must not set reserved environment variable: ${key}`
2177
+ );
2178
+ }
2179
+ const previous = process.env[key];
2180
+ if (previous !== void 0 && previous !== "" && previous !== value) {
2181
+ shadowedEnvKeys.push(key);
2182
+ }
2183
+ previousEnvValues.set(key, previous);
2184
+ settings.setValue(`env.${key}`, value);
2185
+ process.env[key] = value;
2186
+ }
2187
+ if (shadowedEnvKeys.length > 0) {
2188
+ console.error(
2189
+ `[auth] Warning: ${shadowedEnvKeys.join(", ")} ${shadowedEnvKeys.length === 1 ? "is" : "are"} also set in your shell environment or .env file. The shell/file value will take priority on restart. To ensure your new key is used, update or remove the variable from your shell profile or .env file.`
2190
+ );
2191
+ }
2192
+ currentStep = "modelProviders";
2193
+ let updatedModelProviders = {
2194
+ ...previousRuntimeProviders
2195
+ };
2196
+ for (const patch of plan.modelProviders ?? []) {
2197
+ updatedModelProviders = applyModelProvidersPatch(
2198
+ updatedModelProviders,
2199
+ preserveSelection ? {
2200
+ ...patch,
2201
+ mergeStrategy: "replace-owned",
2202
+ ownsModel: /* @__PURE__ */ __name((existing) => (patch.ownsModel?.(existing) ?? false) || patch.models.some(
2203
+ (model) => isSameModelIdentity(existing, model)
2204
+ ), "ownsModel")
2205
+ } : patch,
2206
+ mapping
2207
+ );
2208
+ settings.setValue(
2209
+ `modelProviders.${patch.authType}`,
2210
+ updatedModelProviders[patch.authType] ?? []
2211
+ );
2212
+ if (patch.authType !== "openai" /* USE_OPENAI */) continue;
2213
+ const ownProviders = settings.getModelProvidersForWrite?.().modelProviders ?? settings.getModelProviders();
2214
+ for (const [providerId, models] of Object.entries(ownProviders)) {
2215
+ if (providerId === patch.authType || !Array.isArray(models)) continue;
2216
+ if (providerId.includes(".")) continue;
2217
+ if (providerId !== "openai-responses" /* USE_OPENAI_RESPONSES */ && resolveProviderProtocol(providerId, writeMapping) !== "openai-responses" /* USE_OPENAI_RESPONSES */)
2218
+ continue;
2219
+ const remaining = models.filter(
2220
+ (existing) => !patch.models.some(
2221
+ (model) => isSameModelIdentity(existing, model) && tryResolveModelProtocol(providerId, existing, writeMapping) === resolveModelProtocol(patch.authType, model)
2222
+ )
2223
+ );
2224
+ if (remaining.length !== models.length)
2225
+ settings.setValue(`modelProviders.${providerId}`, remaining);
2226
+ }
2227
+ }
2228
+ const effectiveProviders = settings.getModelProviders();
2229
+ for (const patch of plan.modelProviders ?? []) {
2230
+ const effectiveModels = getModelsForProviderProtocol(
2231
+ effectiveProviders,
2232
+ patch.authType,
2233
+ mapping
2234
+ );
2235
+ const expectedModels = getModelsForProviderProtocol(
2236
+ { [patch.authType]: patch.models },
2237
+ patch.authType
2238
+ );
2239
+ const ownProviders = settings.getModelProvidersForWrite?.().modelProviders;
2240
+ const installedModels = ownProviders ? getModelsForProviderProtocol(
2241
+ { [patch.authType]: ownProviders[patch.authType] ?? [] },
2242
+ patch.authType,
2243
+ mapping
2244
+ ) : expectedModels;
2245
+ if (expectedModels.some((model) => {
2246
+ const winner = effectiveModels.find(
2247
+ (effective) => isSameModelIdentity(model, effective) && resolveModelProtocol(patch.authType, model) === resolveModelProtocol(patch.authType, effective)
2248
+ );
2249
+ const installed = installedModels.find(
2250
+ (entry) => isSameModelIdentity(model, entry) && resolveModelProtocol(patch.authType, model) === resolveModelProtocol(patch.authType, entry)
2251
+ );
2252
+ return !winner || !installed || !isDeepStrictEqual(
2253
+ JSON.parse(JSON.stringify({ ...installed, wireApi: void 0 })),
2254
+ JSON.parse(JSON.stringify({ ...winner, wireApi: void 0 }))
2255
+ );
2256
+ })) {
2257
+ throw new ProviderInstallError(
2258
+ "A higher-precedence settings scope overrides the installed models. Update the scope that owns this provider.",
2259
+ "modelProviders",
2260
+ plan.authType
2261
+ );
2262
+ }
2263
+ }
2264
+ currentStep = "authType";
2265
+ if (!preserveSelection) {
2266
+ settings.setValue("security.auth.selectedType", plan.authType);
2267
+ }
2268
+ currentStep = "legacyCredentials";
2269
+ if (plan.legacyCredentials?.apiKey != null) {
2270
+ settings.setValue("security.auth.apiKey", plan.legacyCredentials.apiKey);
2271
+ }
2272
+ if (plan.legacyCredentials?.baseUrl != null) {
2273
+ settings.setValue(
2274
+ "security.auth.baseUrl",
2275
+ plan.legacyCredentials.baseUrl
2276
+ );
2277
+ }
2278
+ currentStep = "modelSelection";
2279
+ let effectiveModelSelection = preserveSelection ? void 0 : plan.modelSelection;
2280
+ let routeResyncSelection;
2281
+ if (effectiveModelSelection?.modelId) {
2282
+ const currentModelId = settings.getValue("model.name");
2283
+ const currentBaseUrl = settings.getValue("model.baseUrl");
2284
+ const planOffersCurrentModel = typeof currentModelId === "string" && currentModelId.length > 0 && (plan.modelProviders ?? []).some(
2285
+ (patch) => patch.models.some(
2286
+ (model) => resolveModelProtocol(patch.authType, model) === plan.authType && (currentBaseUrl === "" || currentBaseUrl === void 0 ? model.id === currentModelId : isSameModelIdentity(
2287
+ { id: currentModelId, baseUrl: currentBaseUrl },
2288
+ model
2289
+ ))
2290
+ )
2291
+ );
2292
+ if (planOffersCurrentModel) {
2293
+ effectiveModelSelection = void 0;
2294
+ let previousAuthType;
2295
+ if ((plan.authType === "openai" /* USE_OPENAI */ || plan.authType === "openai-responses" /* USE_OPENAI_RESPONSES */) && typeof selectedAuthType === "string") {
2296
+ try {
2297
+ previousAuthType = resolveModelSelectionAuthType(
2298
+ selectedAuthType,
2299
+ typeof previousModelId === "string" ? previousModelId : void 0,
2300
+ previousRuntimeProviders,
2301
+ settings.getValue("providerProtocol"),
2302
+ typeof previousBaseUrl === "string" ? previousBaseUrl : void 0
2303
+ );
2304
+ } catch {
2305
+ previousAuthType = void 0;
2306
+ }
2307
+ }
2308
+ if (previousAuthType !== void 0 && previousAuthType !== plan.authType) {
2309
+ routeResyncSelection = {
2310
+ modelId: currentModelId,
2311
+ ...currentBaseUrl ? { baseUrl: currentBaseUrl } : {}
2312
+ };
2313
+ }
2314
+ }
2315
+ }
2316
+ if (effectiveModelSelection?.modelId) {
2317
+ settings.setValue("model.name", effectiveModelSelection.modelId);
2318
+ if (effectiveModelSelection.baseUrl) {
2319
+ settings.setValue("model.baseUrl", effectiveModelSelection.baseUrl);
2320
+ } else {
2321
+ settings.setValue("model.baseUrl", "");
2322
+ }
2323
+ }
2324
+ currentStep = "providerState";
2325
+ for (const [key, entries] of Object.entries(plan.providerState ?? {})) {
2326
+ for (const [field, value] of Object.entries(entries)) {
2327
+ settings.setValue(`${key}.${field}`, value);
2328
+ }
2329
+ }
2330
+ currentStep = "persist";
2331
+ settings.persist();
2332
+ currentStep = "reloadModelProviders";
2333
+ updatedModelProviders = settings.getModelProviders();
2334
+ reloadModelProviders?.(updatedModelProviders);
2335
+ const syncSelection = effectiveModelSelection?.modelId ? effectiveModelSelection : routeResyncSelection;
2336
+ if (syncSelection) {
2337
+ currentStep = "syncAuthState";
2338
+ syncAuthState?.(
2339
+ plan.authType,
2340
+ syncSelection.modelId,
2341
+ syncSelection.baseUrl
2342
+ );
2343
+ }
2344
+ if (!preserveSelection && doRefreshAuth && refreshAuth) {
2345
+ currentStep = "refreshAuth";
2346
+ await refreshAuth(plan.authType);
2347
+ }
2348
+ currentStep = "cleanupBackup";
2349
+ settings.cleanupBackup?.();
2350
+ return { updatedModelProviders };
2351
+ } catch (error) {
2352
+ try {
2353
+ settings.restore?.();
2354
+ } catch (restoreErr) {
2355
+ console.error(
2356
+ "[applyProviderInstallPlan] settings.restore failed during rollback:",
2357
+ restoreErr
2358
+ );
2359
+ }
2360
+ try {
2361
+ for (const [key, prev] of previousEnvValues) {
2362
+ if (prev === void 0) {
2363
+ delete process.env[key];
2364
+ } else {
2365
+ process.env[key] = prev;
2366
+ }
2367
+ }
2368
+ } catch (envErr) {
2369
+ console.error("[applyProviderInstallPlan] env rollback failed:", envErr);
2370
+ }
2371
+ try {
2372
+ reloadModelProviders?.(previousRuntimeProviders);
2373
+ } catch (reloadErr) {
2374
+ console.error(
2375
+ "[applyProviderInstallPlan] reloadModelProviders failed during rollback:",
2376
+ reloadErr
2377
+ );
2378
+ }
2379
+ const errMsg = error instanceof Error ? error.message : String(error);
2380
+ throw new ProviderInstallError(errMsg, currentStep, plan.authType, {
2381
+ cause: error instanceof Error ? error : void 0
2382
+ });
2383
+ }
2384
+ }
2385
+ __name(applyProviderInstallPlan, "applyProviderInstallPlan");
2386
+
2055
2387
  // packages/core/src/providers/all-providers.ts
2056
2388
  init_esbuild_shims();
2057
2389
 
@@ -3014,7 +3346,6 @@ var customProvider = {
3014
3346
  protocol: "openai" /* USE_OPENAI */,
3015
3347
  protocolOptions: [
3016
3348
  "openai" /* USE_OPENAI */,
3017
- "openai-responses" /* USE_OPENAI_RESPONSES */,
3018
3349
  "anthropic" /* USE_ANTHROPIC */,
3019
3350
  "gemini" /* USE_GEMINI */
3020
3351
  ],
@@ -3475,6 +3806,7 @@ export {
3475
3806
  DEFAULT_MAX_RETRIES,
3476
3807
  DEFAULT_DASHSCOPE_BASE_URL,
3477
3808
  DASHSCOPE_PROXY_BASE_URL,
3809
+ normalizeOpenAiWireBaseUrl,
3478
3810
  isOpenRouterHostname,
3479
3811
  isImageGenerationCapable,
3480
3812
  RUNTIME_SNAPSHOT_PREFIX,
@@ -3491,6 +3823,7 @@ export {
3491
3823
  getDefaultBaseUrlForProtocol,
3492
3824
  resolveBaseUrl,
3493
3825
  getDefaultModelIds,
3826
+ getModelsForProviderProtocol,
3494
3827
  findExistingProviderModels,
3495
3828
  shouldShowStep,
3496
3829
  providerMatchesCredentials,
@@ -3514,7 +3847,11 @@ export {
3514
3847
  expandDynamicHeaders,
3515
3848
  buildSessionIdHeaders,
3516
3849
  buildSessionAwareFetch,
3517
- resolveProviderProtocol
3850
+ resolveProviderProtocol,
3851
+ resolveModelProtocol,
3852
+ tryResolveModelProtocol,
3853
+ validateModelProvidersConfig,
3854
+ resolveModelSelectionAuthType
3518
3855
  };
3519
3856
  /**
3520
3857
  * @license