@opencode/core 0.0.0-dev-20775 → 0.0.0-dev-20777

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 (470) hide show
  1. package/dist/agent.js +66 -66
  2. package/dist/aisdk-native.js +64 -64
  3. package/dist/aisdk.js +69 -69
  4. package/dist/app.js +7 -7
  5. package/dist/bus.js +52 -52
  6. package/dist/chunks/{location-f0q4wdtr.js → location-02609e96.js} +13 -13
  7. package/dist/chunks/{location-x46t862s.js → location-05p4mhbg.js} +6 -6
  8. package/dist/chunks/location-0gzjc7ft.js +253 -0
  9. package/dist/chunks/{location-cycet1pr.js → location-15xcwm9t.js} +1 -1
  10. package/dist/chunks/location-1fq0wp1e.js +26 -0
  11. package/dist/chunks/{location-jc2mtm7q.js → location-1g5f91mn.js} +29 -29
  12. package/dist/chunks/{location-hg7mrb4w.js → location-1gmkcf0p.js} +7 -7
  13. package/dist/chunks/{location-fwh2zgtw.js → location-1h8se44f.js} +10 -10
  14. package/dist/chunks/{location-g9ak4sjw.js → location-1ts7y3cx.js} +9 -9
  15. package/dist/chunks/{location-3bv3jwr8.js → location-1v74vwhm.js} +11 -11
  16. package/dist/chunks/{location-7taj1gp1.js → location-1v9scpnw.js} +17 -17
  17. package/dist/chunks/{location-x9q78qat.js → location-1z20pv40.js} +15 -15
  18. package/dist/chunks/{location-7r962cny.js → location-22tdpft4.js} +20 -20
  19. package/dist/chunks/{location-6x4f2nxf.js → location-24skg3e0.js} +22 -22
  20. package/dist/chunks/{location-vgbc38w6.js → location-257vwa0c.js} +17 -17
  21. package/dist/chunks/{location-4t6c5kv5.js → location-283v9wt3.js} +13 -13
  22. package/dist/chunks/{location-8e1vnns2.js → location-2a084xpy.js} +1 -1
  23. package/dist/chunks/{location-2sdrxmhf.js → location-2fpnaz5h.js} +19 -19
  24. package/dist/chunks/{location-rkxa6zgp.js → location-2jy94dam.js} +17 -17
  25. package/dist/chunks/{location-ted02x33.js → location-2kw5qtk9.js} +39 -39
  26. package/dist/chunks/{location-yern2px4.js → location-3jpnnrb4.js} +12 -12
  27. package/dist/chunks/{location-98bzyxjk.js → location-3pxsat6s.js} +21 -21
  28. package/dist/chunks/{location-95ee23zy.js → location-3qb0mese.js} +1 -1
  29. package/dist/chunks/{location-kvkh2tnc.js → location-42y5raaz.js} +12 -12
  30. package/dist/chunks/{location-e4w2kpmf.js → location-44rac60e.js} +12 -12
  31. package/dist/chunks/{location-qne3fa44.js → location-47jkzegy.js} +3 -3
  32. package/dist/chunks/{location-e6fsf12c.js → location-47r5a3mx.js} +8 -8
  33. package/dist/chunks/{location-dxnfbexj.js → location-4b5b0vhn.js} +6 -6
  34. package/dist/chunks/{location-dyjc66w4.js → location-4bar7sar.js} +28 -28
  35. package/dist/chunks/{location-aeqpwm0h.js → location-4pedpz6c.js} +11 -11
  36. package/dist/chunks/{location-2ccvkpx1.js → location-4ts7tf6z.js} +1 -1
  37. package/dist/chunks/{location-9jvk4y4z.js → location-4vvqa2vj.js} +76 -76
  38. package/dist/chunks/{location-6yz0wx8n.js → location-4xpgt2w9.js} +3 -3
  39. package/dist/chunks/{location-7cxwgp8h.js → location-4zxfccqq.js} +16 -16
  40. package/dist/chunks/{location-cek985gc.js → location-50pnv838.js} +17 -17
  41. package/dist/chunks/{location-sxzvkvgj.js → location-51f5btjf.js} +5 -5
  42. package/dist/chunks/{location-4y5nd1mc.js → location-57ehm7c4.js} +19 -19
  43. package/dist/chunks/{location-ychzzj24.js → location-5h0p9j5c.js} +4 -4
  44. package/dist/chunks/{location-aymppdes.js → location-5hps0jc8.js} +3 -3
  45. package/dist/chunks/{location-e3qxr5gk.js → location-5qd3pb7m.js} +2 -2
  46. package/dist/chunks/{location-bqgthy8n.js → location-6hcrkmvd.js} +7 -7
  47. package/dist/chunks/{location-wraxjda7.js → location-6qv3krp1.js} +7 -7
  48. package/dist/chunks/{location-pw009p93.js → location-6t1m34v8.js} +2 -2
  49. package/dist/chunks/{location-vc4tj14c.js → location-6tyzbyh4.js} +12 -12
  50. package/dist/chunks/{location-k8p89crg.js → location-6whpyrs3.js} +40 -40
  51. package/dist/chunks/{location-8sb414s3.js → location-6zztp22y.js} +42 -42
  52. package/dist/chunks/{location-wmvjtpcg.js → location-724avf7x.js} +15 -15
  53. package/dist/chunks/{location-gwfc688y.js → location-73gdyt7p.js} +8 -8
  54. package/dist/chunks/{location-9ay8cp4x.js → location-77392vks.js} +7 -7
  55. package/dist/chunks/{location-15z50455.js → location-7am7j62s.js} +7 -7
  56. package/dist/chunks/{location-y2072sec.js → location-7fyyg3d8.js} +13 -13
  57. package/dist/chunks/{location-8vd0j1f8.js → location-7wpc5jwh.js} +1 -1
  58. package/dist/chunks/{location-a1gpj94z.js → location-7yh4e7ss.js} +2 -2
  59. package/dist/chunks/{location-2rzygbsc.js → location-7z0vcwsq.js} +5 -5
  60. package/dist/chunks/{location-c9jygpac.js → location-7zz0tb2m.js} +316 -316
  61. package/dist/chunks/{location-hp2pwxv9.js → location-83vepgva.js} +18 -18
  62. package/dist/chunks/{location-z5xex4x1.js → location-8b345ry2.js} +6 -6
  63. package/dist/chunks/{location-0p1raf8m.js → location-8pfsh0gj.js} +21 -21
  64. package/dist/chunks/{location-qzrn5gaa.js → location-8snddydh.js} +1 -1
  65. package/dist/chunks/{location-c3k6pm0m.js → location-8y8dfhw6.js} +9 -9
  66. package/dist/chunks/{location-d1zydk9p.js → location-922xc4bs.js} +13 -13
  67. package/dist/chunks/{location-e9f9fkm3.js → location-9cwykwg4.js} +30 -30
  68. package/dist/chunks/{location-rhjbct0v.js → location-9t7a50xb.js} +3 -3
  69. package/dist/chunks/{location-2pnhn36q.js → location-a8bn8zg0.js} +20 -20
  70. package/dist/chunks/{location-x375nta7.js → location-ac3dnfkw.js} +5 -5
  71. package/dist/chunks/{location-x661k3y3.js → location-addxnjmp.js} +3 -3
  72. package/dist/chunks/{location-7jhf9c6g.js → location-agg46hj7.js} +7 -7
  73. package/dist/chunks/{location-ba07h9gm.js → location-arz7hw7x.js} +3 -3
  74. package/dist/chunks/{location-x1ayq2cp.js → location-asvfb1gz.js} +20 -20
  75. package/dist/chunks/{location-d9hw3rrm.js → location-b3e58hyc.js} +25 -25
  76. package/dist/chunks/{location-vkzh2jfz.js → location-b4m962yk.js} +20 -20
  77. package/dist/chunks/{location-f5ca9dwf.js → location-b69x7x7h.js} +2 -2
  78. package/dist/chunks/{location-1j6m9z8v.js → location-b8d9rq7p.js} +26 -26
  79. package/dist/chunks/{location-82ztv55b.js → location-bem8en1s.js} +14 -14
  80. package/dist/chunks/{location-qer0ttcg.js → location-bmq95mvw.js} +3 -3
  81. package/dist/chunks/{location-5tmy9zrn.js → location-by659cs7.js} +1 -1
  82. package/dist/chunks/{location-8snsr8xz.js → location-c00fv4ar.js} +13 -13
  83. package/dist/chunks/{location-rz5rekj6.js → location-c26ps2t9.js} +11 -11
  84. package/dist/chunks/{location-bhjqanaq.js → location-c5g770ce.js} +7 -7
  85. package/dist/chunks/{location-gy93zegn.js → location-ch3qpzfg.js} +8 -8
  86. package/dist/chunks/{location-5jjk48mt.js → location-cnwjz3s5.js} +22 -22
  87. package/dist/chunks/{location-vfjhn2wd.js → location-cp937pt4.js} +3 -3
  88. package/dist/chunks/{location-y7h48m45.js → location-crvcnxkj.js} +2 -2
  89. package/dist/chunks/{location-qccn18aw.js → location-cvmt8rk0.js} +14 -14
  90. package/dist/chunks/{location-5jx09pxm.js → location-das60bkc.js} +22 -22
  91. package/dist/chunks/{location-3g10c0nv.js → location-dc34mbvf.js} +1 -1
  92. package/dist/chunks/{location-rsxcvxxn.js → location-dhddhhrc.js} +9 -9
  93. package/dist/chunks/{location-ea95x05p.js → location-ds1wy84x.js} +13 -13
  94. package/dist/chunks/{location-1x11rq2a.js → location-dxj72tfx.js} +4 -4
  95. package/dist/chunks/{location-bah8gbxw.js → location-dzt4t18k.js} +5 -5
  96. package/dist/chunks/{location-bprjyzj4.js → location-eba7m2bv.js} +9 -9
  97. package/dist/chunks/{location-dv5jzpe1.js → location-ejfryj65.js} +2 -2
  98. package/dist/chunks/{location-21zr8p49.js → location-enppsyr8.js} +1 -1
  99. package/dist/chunks/{location-e66rkf12.js → location-ep4m400e.js} +16 -16
  100. package/dist/chunks/{location-a89e0tac.js → location-ermxvwhp.js} +3 -3
  101. package/dist/chunks/{location-mdp3e6p6.js → location-essarsw2.js} +24 -24
  102. package/dist/chunks/{location-hjkk9tvw.js → location-etvz4dq0.js} +17 -17
  103. package/dist/chunks/{location-gspcenjq.js → location-ey3qhexw.js} +5 -5
  104. package/dist/chunks/{location-j1qv9ecs.js → location-f2332hgj.js} +9 -9
  105. package/dist/chunks/{location-2rehhz5t.js → location-f2mw6jyj.js} +8 -8
  106. package/dist/chunks/{location-7bq79643.js → location-f4jsfm31.js} +28 -28
  107. package/dist/chunks/{location-75bh4ajr.js → location-ffa51ey5.js} +9 -9
  108. package/dist/chunks/{location-hhd5kg11.js → location-fgkdc7jh.js} +16 -16
  109. package/dist/chunks/{location-fwbpahwh.js → location-fsvxdad5.js} +2 -2
  110. package/dist/chunks/{location-gb9b0k6n.js → location-fyb3fekh.js} +11 -11
  111. package/dist/chunks/{location-830hjgb9.js → location-fzpqnkcj.js} +1 -1
  112. package/dist/chunks/{location-w6nf2t4d.js → location-g6z45s58.js} +9 -9
  113. package/dist/chunks/{location-xs9sm4qv.js → location-ge2jb4mz.js} +14 -14
  114. package/dist/chunks/{location-7p986w0g.js → location-geyqfexr.js} +9 -9
  115. package/dist/chunks/{location-rdxaq8bh.js → location-gy1mt2vm.js} +11 -11
  116. package/dist/chunks/{location-yda4wkbn.js → location-h2xnf45v.js} +15 -15
  117. package/dist/chunks/{location-tc14gx3q.js → location-h4ckqw4f.js} +9 -9
  118. package/dist/chunks/{location-x3g43msc.js → location-h72xck84.js} +22 -22
  119. package/dist/chunks/{location-exm7qxnh.js → location-h788nv4n.js} +16 -16
  120. package/dist/chunks/{location-a2eq7efn.js → location-hfpbvkxs.js} +14 -14
  121. package/dist/chunks/{location-rzs3gq0x.js → location-hpfvhvya.js} +7 -7
  122. package/dist/chunks/{location-1yhdpabq.js → location-hzfdd747.js} +10 -10
  123. package/dist/chunks/{location-kttg2wpw.js → location-j793y9ay.js} +37 -37
  124. package/dist/chunks/{location-eaezvagx.js → location-j8s9ab9g.js} +7 -7
  125. package/dist/chunks/{location-tsq3qyw6.js → location-j97mndf0.js} +6 -6
  126. package/dist/chunks/{location-mk1p5ebg.js → location-jph2mfn8.js} +10 -10
  127. package/dist/chunks/{location-cadbnk3n.js → location-k2v3a0tj.js} +16 -16
  128. package/dist/chunks/{location-966y4f2f.js → location-k58rqv26.js} +6 -6
  129. package/dist/chunks/{location-8a6ws7jr.js → location-k70p9jzb.js} +7 -7
  130. package/dist/chunks/{location-atrnmt3x.js → location-kf8rbkby.js} +22 -22
  131. package/dist/chunks/{location-6mkt9mm7.js → location-m46z4pcf.js} +302 -302
  132. package/dist/chunks/{location-9dpd9382.js → location-m55qy151.js} +8 -8
  133. package/dist/chunks/{location-wnbbbc1f.js → location-m9an57nd.js} +8 -8
  134. package/dist/chunks/{location-g9fnv454.js → location-mc5akg63.js} +30 -30
  135. package/dist/chunks/{location-33w4ejhs.js → location-mfqp6xfm.js} +7 -7
  136. package/dist/chunks/{location-c529yjm2.js → location-mn8ry2gg.js} +13 -13
  137. package/dist/chunks/{location-2btnaz5j.js → location-mq882t6m.js} +10 -10
  138. package/dist/chunks/{location-x4s254pk.js → location-mt66mygc.js} +9 -9
  139. package/dist/chunks/{location-0r16tc9t.js → location-mt74ad40.js} +6 -6
  140. package/dist/chunks/{location-46f7t24m.js → location-mw9b1c9f.js} +9 -9
  141. package/dist/chunks/{location-dq9pghd8.js → location-mye8z46x.js} +17 -17
  142. package/dist/chunks/{location-1ffbm2jk.js → location-n0kpyt58.js} +8 -8
  143. package/dist/chunks/{location-32vwv81y.js → location-n7yx15r7.js} +2 -2
  144. package/dist/chunks/{location-f3nmm34k.js → location-na7ss97r.js} +14 -14
  145. package/dist/chunks/{location-tgzbhyj9.js → location-np6bm2as.js} +3 -3
  146. package/dist/chunks/{location-85xxa1xb.js → location-nqxj0yn4.js} +1 -1
  147. package/dist/chunks/{location-3bnybhwv.js → location-nxpp2y2e.js} +9 -9
  148. package/dist/chunks/{location-3bc8czyk.js → location-nyqx1cb3.js} +3 -3
  149. package/dist/chunks/{location-ngkn9htn.js → location-p0cpcvwn.js} +13 -13
  150. package/dist/chunks/{location-rp0hxcbj.js → location-p3pp3bgs.js} +12 -12
  151. package/dist/chunks/{location-czfptnv9.js → location-pa8pe2x7.js} +3 -3
  152. package/dist/chunks/{location-rg98346q.js → location-pbavp9d4.js} +10 -10
  153. package/dist/chunks/{location-b0cjfwep.js → location-pjvjbv32.js} +10 -10
  154. package/dist/chunks/{location-1g96y08y.js → location-pnaxc6j9.js} +7 -7
  155. package/dist/chunks/{location-jhdf29st.js → location-pnzf6mjf.js} +1 -1
  156. package/dist/chunks/{location-qjskteme.js → location-ppc2pnsb.js} +4 -4
  157. package/dist/chunks/{location-cy5473yv.js → location-pqxmmrpw.js} +52 -52
  158. package/dist/chunks/{location-sx4ak346.js → location-py28mc1m.js} +8 -8
  159. package/dist/chunks/{location-8sze2n9a.js → location-py3kkmfq.js} +4 -4
  160. package/dist/chunks/{location-0j77ygfz.js → location-q0xm7vwc.js} +4 -4
  161. package/dist/chunks/{location-tprb9ykm.js → location-qa96c720.js} +7 -7
  162. package/dist/chunks/{location-3ra60fwk.js → location-qh3vb1tn.js} +8 -8
  163. package/dist/chunks/{location-w86wbf1j.js → location-qhqe7njz.js} +34 -34
  164. package/dist/chunks/{location-djszqvmq.js → location-qmqgtz8f.js} +7 -7
  165. package/dist/chunks/{location-e3bfyvz4.js → location-qmxh83kc.js} +45 -45
  166. package/dist/chunks/{location-kxg060tx.js → location-qr0pk10y.js} +19 -19
  167. package/dist/chunks/{location-7s5y6dw1.js → location-qww9nh48.js} +39 -39
  168. package/dist/chunks/{location-p0aj1n0s.js → location-qxp4d2xp.js} +15 -15
  169. package/dist/chunks/{location-nw13281a.js → location-r58s4v78.js} +7 -7
  170. package/dist/chunks/{location-6sqw58ss.js → location-r5atvkz9.js} +8 -8
  171. package/dist/chunks/{location-3k3te7za.js → location-rb6kc9en.js} +4 -4
  172. package/dist/chunks/{location-bfdarn04.js → location-rf5ebq4s.js} +22 -22
  173. package/dist/chunks/{location-3nchn6gg.js → location-rmg8r6ny.js} +8 -8
  174. package/dist/chunks/{location-6eebjgwm.js → location-rnffhph3.js} +1 -1
  175. package/dist/chunks/{location-qpg39g1v.js → location-s1rrpmaa.js} +23 -23
  176. package/dist/chunks/{location-s0828w64.js → location-sdq79vbt.js} +18 -18
  177. package/dist/chunks/{location-js51bcx5.js → location-sfe13qt9.js} +15 -15
  178. package/dist/chunks/{location-6jt2mj9c.js → location-smz349yv.js} +25 -25
  179. package/dist/chunks/{location-ntemkh0x.js → location-spvg49p3.js} +30 -30
  180. package/dist/chunks/{location-zc6x355b.js → location-sws9dtgm.js} +3 -3
  181. package/dist/chunks/{location-jfqtm2ew.js → location-t2fc4mz5.js} +3 -3
  182. package/dist/chunks/{location-8pxk0waf.js → location-t5z5wvj2.js} +4 -4
  183. package/dist/chunks/{location-s7ng95pt.js → location-t6wbbrfa.js} +24 -24
  184. package/dist/chunks/{location-qam56xsc.js → location-t7cpp3m0.js} +1 -1
  185. package/dist/chunks/{location-bf4gbvg4.js → location-t9ew0xaf.js} +7 -7
  186. package/dist/chunks/{location-v85wqnzs.js → location-t9xcwzrx.js} +13 -13
  187. package/dist/chunks/{location-ayk9da8a.js → location-ta6y1msd.js} +63 -63
  188. package/dist/chunks/{location-n21dbq43.js → location-thkbvcgx.js} +1 -1
  189. package/dist/chunks/{location-ax1c0hpd.js → location-tnr8ce74.js} +27 -27
  190. package/dist/chunks/{location-8tb93y3v.js → location-tz3m3brz.js} +4 -4
  191. package/dist/chunks/{location-dca2v3qb.js → location-v7yprycd.js} +8 -8
  192. package/dist/chunks/{location-756q5zcd.js → location-v8jdkmfs.js} +12 -12
  193. package/dist/chunks/{location-h12ndvyr.js → location-v9tbcfk2.js} +11 -11
  194. package/dist/chunks/{location-kpgz6ev9.js → location-vaskyz0h.js} +29 -29
  195. package/dist/chunks/{location-as7cf5zz.js → location-vn72gsba.js} +1 -1
  196. package/dist/chunks/{location-3msgmyha.js → location-w0nqy3aq.js} +5 -5
  197. package/dist/chunks/{location-9de4qsp2.js → location-wb7mg7fb.js} +6 -6
  198. package/dist/chunks/{location-eye44qas.js → location-wbt9zsn3.js} +7 -7
  199. package/dist/chunks/{location-da7cwfsq.js → location-wp8xfje7.js} +22 -22
  200. package/dist/chunks/{location-tkj00vfs.js → location-ws2bx7td.js} +1 -1
  201. package/dist/chunks/{location-nbrfrcy0.js → location-wt19589t.js} +2 -2
  202. package/dist/chunks/{location-rza1ksjw.js → location-x2tcbxjk.js} +26 -26
  203. package/dist/chunks/{location-d8q1c04z.js → location-xfgbrct6.js} +15 -15
  204. package/dist/chunks/{location-kjms2vrd.js → location-xn2v0njk.js} +9 -9
  205. package/dist/chunks/{location-z86epv9q.js → location-xpfnkknw.js} +28 -28
  206. package/dist/chunks/{location-a7jqre2k.js → location-xpg5nf0s.js} +28 -28
  207. package/dist/chunks/{location-gknjsggn.js → location-xpt096d7.js} +1 -1
  208. package/dist/chunks/{location-8tt02aa5.js → location-xs12am9p.js} +5 -5
  209. package/dist/chunks/{location-sejb9e2v.js → location-xvf4b5tc.js} +22 -22
  210. package/dist/chunks/{location-09asyzbj.js → location-y0hnatt9.js} +13 -13
  211. package/dist/chunks/{location-asbt5hc3.js → location-y4eq9c7t.js} +9 -9
  212. package/dist/chunks/{location-4nj4bn9q.js → location-y56ehv6b.js} +3 -3
  213. package/dist/chunks/{location-mjac82m3.js → location-y7rk29wk.js} +12 -12
  214. package/dist/chunks/{location-2d0zrvb9.js → location-ya99b1bg.js} +127 -127
  215. package/dist/chunks/{location-ayf7de5y.js → location-yb1pbjke.js} +23 -23
  216. package/dist/chunks/{location-19asy4jh.js → location-yjzd8xzf.js} +9 -9
  217. package/dist/chunks/{location-5dkn69vz.js → location-yrcj3v3g.js} +3 -3
  218. package/dist/chunks/{location-brwsd5y5.js → location-ywcwnstf.js} +10 -10
  219. package/dist/chunks/{location-69y7y1vt.js → location-yx4j6h9t.js} +75 -75
  220. package/dist/chunks/{location-wgrzeraf.js → location-z8nhrpf5.js} +17 -17
  221. package/dist/chunks/{location-2vs2nh1n.js → location-zcrspsvn.js} +3 -3
  222. package/dist/chunks/{location-ek753qrj.js → location-zdw14zwb.js} +8 -8
  223. package/dist/chunks/{location-r23aaksv.js → location-zg3gffzg.js} +1 -1
  224. package/dist/chunks/{location-b3f8fkhc.js → location-zyk1yjk8.js} +3 -3
  225. package/dist/chunks/{location-x45ymrje.js → location-zzz4tyg8.js} +25 -25
  226. package/dist/codemode/instructions.js +4 -4
  227. package/dist/command.js +66 -66
  228. package/dist/config/discovery.js +59 -59
  229. package/dist/config/normalize.js +72 -72
  230. package/dist/config/plugin/agent.js +87 -87
  231. package/dist/config/plugin/command.js +165 -165
  232. package/dist/config/plugin/compaction.js +117 -117
  233. package/dist/config/plugin/compatibility.js +103 -103
  234. package/dist/config/plugin/formatter.js +86 -86
  235. package/dist/config/plugin/image.js +85 -85
  236. package/dist/config/plugin/instruction.js +66 -66
  237. package/dist/config/plugin/location-watcher.js +85 -85
  238. package/dist/config/plugin/mcp.js +92 -92
  239. package/dist/config/plugin/policy.js +86 -86
  240. package/dist/config/plugin/provider.js +85 -85
  241. package/dist/config/plugin/reference.js +87 -87
  242. package/dist/config/plugin/shell.js +87 -87
  243. package/dist/config/plugin/skill-file.js +75 -75
  244. package/dist/config/plugin/skill.js +106 -106
  245. package/dist/config/plugin/snapshot.js +85 -85
  246. package/dist/config/plugin/source.js +88 -88
  247. package/dist/config/plugin/tool-output.js +86 -86
  248. package/dist/config/plugin/websearch.js +86 -86
  249. package/dist/config/plugin/worktree.js +87 -87
  250. package/dist/config/variable.js +2 -2
  251. package/dist/config.js +85 -85
  252. package/dist/credential.js +60 -60
  253. package/dist/database/database.js +51 -51
  254. package/dist/database/drizzle/effect-sqlite/driver.js +8 -8
  255. package/dist/database/drizzle/effect-sqlite/index.js +4 -4
  256. package/dist/database/drizzle/effect-sqlite/session.js +7 -7
  257. package/dist/database/drizzle/index.js +9 -9
  258. package/dist/database/drizzle/sqlite-core/effect/db.js +5 -5
  259. package/dist/database/drizzle/sqlite-core/effect/index.js +2 -2
  260. package/dist/database/drizzle/sqlite-core/effect/session.js +6 -6
  261. package/dist/database/drizzle.js +9 -9
  262. package/dist/database/migration.gen.js +39 -39
  263. package/dist/database/migration.js +41 -41
  264. package/dist/database/v1-migration.bun.js +9 -9
  265. package/dist/effect/app-node-builder.js +232 -232
  266. package/dist/environment/environment.js +67 -67
  267. package/dist/environment/index.js +69 -69
  268. package/dist/event-logger.js +9 -9
  269. package/dist/file-access.js +78 -78
  270. package/dist/file-mutation.js +68 -68
  271. package/dist/filesystem/location-watcher-policy.js +5 -5
  272. package/dist/filesystem/location-watcher.js +177 -177
  273. package/dist/filesystem/search.js +75 -75
  274. package/dist/filesystem/watcher-binding.js +3 -3
  275. package/dist/filesystem/watcher.js +8 -8
  276. package/dist/filesystem.js +78 -78
  277. package/dist/form.js +59 -59
  278. package/dist/formatter/builtins.js +3 -3
  279. package/dist/formatter.js +64 -64
  280. package/dist/generate.js +74 -74
  281. package/dist/git.js +2 -2
  282. package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +4 -4
  283. package/dist/github-copilot/copilot-provider.js +3 -3
  284. package/dist/github-copilot/models.js +74 -74
  285. package/dist/github-copilot/responses/openai-responses-language-model.js +7 -7
  286. package/dist/github-copilot/responses/openai-responses-prepare-tools.js +4 -4
  287. package/dist/image/photon.js +1 -1
  288. package/dist/image.js +5 -5
  289. package/dist/instance/service.js +5 -5
  290. package/dist/instance.js +307 -307
  291. package/dist/instruction-discovery.js +65 -65
  292. package/dist/instructions/builtins.js +64 -64
  293. package/dist/instructions/index.js +3 -3
  294. package/dist/integration/connection.js +3 -3
  295. package/dist/integration.js +64 -64
  296. package/dist/job.js +58 -58
  297. package/dist/kv.js +52 -52
  298. package/dist/location-activity.js +51 -51
  299. package/dist/location-lifecycle.js +81 -81
  300. package/dist/location-service-map.js +63 -63
  301. package/dist/location-services.js +306 -306
  302. package/dist/location.js +58 -58
  303. package/dist/managed-policy.js +7 -7
  304. package/dist/mcp/client.js +16 -16
  305. package/dist/mcp/index.js +81 -81
  306. package/dist/mcp/instructions.js +98 -98
  307. package/dist/mcp/oauth.js +13 -13
  308. package/dist/mcp/stdio.js +64 -64
  309. package/dist/modal/models.js +74 -74
  310. package/dist/model-resolver.js +73 -73
  311. package/dist/model.js +71 -71
  312. package/dist/models-dev.js +81 -81
  313. package/dist/permission/saved.js +62 -62
  314. package/dist/permission.js +89 -89
  315. package/dist/persistent-pty/index.js +70 -70
  316. package/dist/persistent-pty.js +56 -56
  317. package/dist/plugin/agent.js +59 -59
  318. package/dist/plugin/command.js +74 -74
  319. package/dist/plugin/hooks.js +5 -5
  320. package/dist/plugin/host.js +170 -170
  321. package/dist/plugin/identity.js +3 -3
  322. package/dist/plugin/instance.js +3 -3
  323. package/dist/plugin/internal.js +280 -280
  324. package/dist/plugin/mcp-codemode-defaults.js +3 -3
  325. package/dist/plugin/models-dev.js +70 -70
  326. package/dist/plugin/module.js +86 -86
  327. package/dist/plugin/optimize.js +3 -3
  328. package/dist/plugin/plan.js +76 -76
  329. package/dist/plugin/provider/amazon-bedrock.js +65 -65
  330. package/dist/plugin/provider/azure.js +86 -86
  331. package/dist/plugin/provider/chatgpt.js +67 -67
  332. package/dist/plugin/provider/cloudflare-ai-gateway.js +83 -83
  333. package/dist/plugin/provider/cloudflare-workers-ai.js +83 -83
  334. package/dist/plugin/provider/configured.js +82 -82
  335. package/dist/plugin/provider/digitalocean.js +67 -67
  336. package/dist/plugin/provider/github-copilot.js +69 -69
  337. package/dist/plugin/provider/gitlab.js +67 -67
  338. package/dist/plugin/provider/google-vertex.js +83 -83
  339. package/dist/plugin/provider/llmgateway.js +59 -59
  340. package/dist/plugin/provider/lmstudio.js +86 -86
  341. package/dist/plugin/provider/local.js +83 -83
  342. package/dist/plugin/provider/modal.js +67 -67
  343. package/dist/plugin/provider/ollama.js +86 -86
  344. package/dist/plugin/provider/openai.js +68 -68
  345. package/dist/plugin/provider/opencode.js +70 -70
  346. package/dist/plugin/provider/openrouter.js +66 -66
  347. package/dist/plugin/provider/poe.js +59 -59
  348. package/dist/plugin/provider/prompt-cache-key.js +65 -65
  349. package/dist/plugin/provider/sap-ai-core.js +65 -65
  350. package/dist/plugin/provider/snowflake-cortex.js +84 -84
  351. package/dist/plugin/provider/vercel.js +65 -65
  352. package/dist/plugin/provider/vllm.js +86 -86
  353. package/dist/plugin/provider/xai.js +66 -66
  354. package/dist/plugin/provider.js +121 -121
  355. package/dist/plugin/sdk.js +59 -59
  356. package/dist/plugin/service.js +3 -3
  357. package/dist/plugin/skill.js +100 -100
  358. package/dist/plugin/supervisor.js +298 -298
  359. package/dist/plugin/tool-input-repair.js +3 -3
  360. package/dist/plugin/update.js +3 -3
  361. package/dist/plugin/vcs/git.js +63 -63
  362. package/dist/plugin/vcs/hg.js +63 -63
  363. package/dist/plugin/verbosity.js +68 -68
  364. package/dist/plugin/warming.js +84 -84
  365. package/dist/plugin/websearch/exa.js +4 -4
  366. package/dist/plugin/websearch/firecrawl.js +7 -7
  367. package/dist/plugin/websearch/index.js +8 -8
  368. package/dist/plugin/websearch/mcp.js +5 -5
  369. package/dist/plugin/websearch/parallel.js +7 -7
  370. package/dist/plugin/websearch/tavily.js +6 -6
  371. package/dist/plugin/websearch/tinyfish.js +7 -7
  372. package/dist/plugin.js +179 -179
  373. package/dist/project.js +57 -57
  374. package/dist/provider.js +70 -70
  375. package/dist/pty.js +67 -67
  376. package/dist/reference/instructions.js +67 -67
  377. package/dist/reference.js +69 -69
  378. package/dist/repository-cache.js +60 -60
  379. package/dist/ripgrep.js +70 -70
  380. package/dist/rpc.js +63 -63
  381. package/dist/session/command.js +57 -57
  382. package/dist/session/compaction.js +101 -101
  383. package/dist/session/context.js +117 -117
  384. package/dist/session/diff.js +63 -63
  385. package/dist/session/environment.js +5 -5
  386. package/dist/session/error.js +6 -6
  387. package/dist/session/execution/restart.js +109 -109
  388. package/dist/session/execution.js +95 -95
  389. package/dist/session/generate.js +116 -116
  390. package/dist/session/history.js +8 -8
  391. package/dist/session/inbox.js +63 -63
  392. package/dist/session/info.js +2 -2
  393. package/dist/session/instruction-entry.js +57 -57
  394. package/dist/session/instruction-state.js +2 -2
  395. package/dist/session/instructions.js +71 -71
  396. package/dist/session/model-request.js +87 -87
  397. package/dist/session/model-transport.js +5 -5
  398. package/dist/session/move.js +98 -98
  399. package/dist/session/projector.js +62 -62
  400. package/dist/session/prompt.js +78 -78
  401. package/dist/session/provider-context.js +3 -3
  402. package/dist/session/revert.js +64 -64
  403. package/dist/session/runner/index.js +3 -3
  404. package/dist/session/runner/llm.js +181 -181
  405. package/dist/session/runner/model.js +69 -69
  406. package/dist/session/runner/publish-llm-event.js +84 -84
  407. package/dist/session/runner/retry.js +3 -3
  408. package/dist/session/runner/step.js +92 -92
  409. package/dist/session/runner/to-llm-message.js +2 -2
  410. package/dist/session/schema.js +5 -5
  411. package/dist/session/session.js +126 -126
  412. package/dist/session/shell.js +96 -96
  413. package/dist/session/skill.js +77 -77
  414. package/dist/session/stats.js +8 -8
  415. package/dist/session/store.js +63 -63
  416. package/dist/session/subagent-job.js +161 -161
  417. package/dist/session/title.js +120 -120
  418. package/dist/session/to-session-error.js +83 -83
  419. package/dist/session/transfer.js +103 -103
  420. package/dist/session.js +176 -176
  421. package/dist/shell/parse.js +4 -4
  422. package/dist/shell/select.js +8 -8
  423. package/dist/shell.js +99 -99
  424. package/dist/skill/discovery.js +5 -5
  425. package/dist/skill/instructions.js +81 -81
  426. package/dist/skill.js +84 -84
  427. package/dist/snapshot.js +68 -68
  428. package/dist/tool/mcp.js +97 -97
  429. package/dist/tool/plugin/edit.js +93 -93
  430. package/dist/tool/plugin/glob.js +96 -96
  431. package/dist/tool/plugin/grep.js +92 -92
  432. package/dist/tool/plugin/mcp-resource.js +89 -89
  433. package/dist/tool/plugin/opencode.js +83 -83
  434. package/dist/tool/plugin/patch.js +87 -87
  435. package/dist/tool/plugin/question.js +77 -77
  436. package/dist/tool/plugin/read.js +91 -91
  437. package/dist/tool/plugin/shell.js +169 -169
  438. package/dist/tool/plugin/skill.js +81 -81
  439. package/dist/tool/plugin/subagent.js +168 -168
  440. package/dist/tool/plugin/webfetch.js +85 -85
  441. package/dist/tool/plugin/websearch.js +87 -87
  442. package/dist/tool/plugin/write.js +95 -95
  443. package/dist/tool/read-filesystem.js +72 -72
  444. package/dist/tool-output.js +5 -5
  445. package/dist/tool.js +11 -11
  446. package/dist/v1/config/agent.js +6 -6
  447. package/dist/v1/config/command.js +3 -3
  448. package/dist/v1/config/error.js +3 -3
  449. package/dist/v1/config/mcp.js +3 -3
  450. package/dist/v1/config/migrate.js +66 -66
  451. package/dist/v1/config/permission.js +7 -7
  452. package/dist/v1/config/provider.js +3 -3
  453. package/dist/variant.js +68 -68
  454. package/dist/vcs.js +66 -66
  455. package/dist/websearch.js +64 -64
  456. package/dist/wellknown/plugin.js +56 -56
  457. package/dist/wellknown.js +63 -63
  458. package/dist/workspace/driver.js +7 -7
  459. package/dist/workspace.js +61 -61
  460. package/dist/worktree/git.js +5 -5
  461. package/dist/worktree/strategies.js +65 -65
  462. package/dist/worktree.js +71 -71
  463. package/package.json +8 -8
  464. package/dist/chunks/location-5t9rrsta.js +0 -26
  465. package/dist/chunks/location-hed9jrmp.js +0 -253
  466. /package/dist/chunks/{location-b564mtnb.js → location-08mjp3pt.js} +0 -0
  467. /package/dist/chunks/{location-fegk541e.js → location-0t098hqn.js} +0 -0
  468. /package/dist/chunks/{location-wfyw2gqh.js → location-3xqh13de.js} +0 -0
  469. /package/dist/chunks/{location-hekf1c5w.js → location-efgnm1d6.js} +0 -0
  470. /package/dist/chunks/{location-shfh3dfx.js → location-w0pdyb55.js} +0 -0
@@ -1,37 +1,28 @@
1
1
  import {
2
2
  Service83,
3
3
  node87
4
- } from "./location-5tmy9zrn.js";
4
+ } from "./location-by659cs7.js";
5
5
  import {
6
6
  shutdown2,
7
7
  create3
8
8
  } from "./location-rdw6cm16.js";
9
9
  import {
10
10
  key2
11
- } from "./location-x661k3y3.js";
11
+ } from "./location-addxnjmp.js";
12
12
  import {
13
13
  ID14,
14
- Service76,
15
- node80,
14
+ Service77,
15
+ node81,
16
16
  Event18
17
- } from "./location-2sdrxmhf.js";
17
+ } from "./location-2fpnaz5h.js";
18
18
  import {
19
19
  Service80,
20
20
  node84
21
- } from "./location-8vd0j1f8.js";
21
+ } from "./location-7wpc5jwh.js";
22
22
  import {
23
23
  __export
24
24
  } from "./location-9rqn6x4v.js";
25
25
 
26
- // src/aisdk-native.ts
27
- var exports_aisdk_native = {};
28
- __export(exports_aisdk_native, {
29
- AISDKNative: () => exports_aisdk_native,
30
- native: () => native2,
31
- rewrite: () => rewrite2
32
- });
33
- import { Effect as Effect2, Option as Option2, Schema as Schema2, Struct as Struct2 } from "effect";
34
-
35
26
  // src/provider.ts
36
27
  var exports_provider3 = {};
37
28
  __export(exports_provider3, {
@@ -40,11 +31,11 @@ __export(exports_provider3, {
40
31
  DEFAULT_TIMEOUT_MS: () => DEFAULT_TIMEOUT_MS3,
41
32
  Event: () => Event17,
42
33
  ID: () => ID13,
43
- Info: () => Info21,
34
+ Info: () => Info22,
44
35
  LoadError: () => LoadError3,
45
36
  Provider: () => exports_provider3,
46
37
  Request: () => Request3,
47
- Service: () => Service75,
38
+ Service: () => Service76,
48
39
  Settings: () => Settings2,
49
40
  Transport: () => Transport2,
50
41
  aisdk: () => aisdk2,
@@ -54,12 +45,12 @@ __export(exports_provider3, {
54
45
  mergeOverlay: () => mergeOverlay2,
55
46
  modelSettings: () => modelSettings2,
56
47
  nativeSettings: () => nativeSettings2,
57
- node: () => node79,
48
+ node: () => node80,
58
49
  packageName: () => packageName2,
59
50
  timeout: () => timeout2,
60
51
  timeouts: () => timeouts2
61
52
  });
62
- import { Context, Effect, Layer, Option, Schema, Stream, Struct } from "effect";
53
+ import { Context, Effect as Effect2, Layer, Option as Option2, Schema as Schema2, Stream, Struct as Struct2 } from "effect";
63
54
  import { Provider } from "@opencode/schema/provider";
64
55
  import { Model } from "@opencode/schema/model";
65
56
  import { makeLocationNode } from "@opencode/util/effect/app-node";
@@ -68,6 +59,268 @@ import { isRecord } from "@opencode/ai/utils/record";
68
59
  import { importModule, resolveModule } from "@opencode/util/runtime-import";
69
60
  import { Credential } from "@opencode/schema/credential";
70
61
  import { freeze } from "immer";
62
+
63
+ // src/aisdk-native.ts
64
+ var exports_aisdk_native = {};
65
+ __export(exports_aisdk_native, {
66
+ AISDKNative: () => exports_aisdk_native,
67
+ native: () => native2,
68
+ rewrite: () => rewrite2
69
+ });
70
+ import { Effect, Option, Schema, Struct } from "effect";
71
+ function rewrite2(target, input) {
72
+ if (input.specifier === undefined)
73
+ return;
74
+ const plain = resolve(input.specifier, input);
75
+ if (!plain)
76
+ return;
77
+ const settings = decode(target.settings ?? {});
78
+ const replacement = resolve(input.specifier, { ...input, settings }) ?? plain;
79
+ const translated = options(replacement, input.modelID, settings);
80
+ if (target.package !== undefined || replacement !== input.specifier)
81
+ target.package = replacement;
82
+ target.settings = target.settings === undefined ? undefined : {
83
+ ...translated.settings,
84
+ ...!NATIVE.has(input.specifier) && replacement === "@opencode/ai/providers/openai-compatible" ? { provider: input.canonical ?? input.providerID } : {}
85
+ };
86
+ target.headers = mergeHeaders2(translated.headers, target.headers);
87
+ target.body = mergeOverlay2(translated.body, target.body);
88
+ target.variants = target.variants?.map((variant) => {
89
+ const overlay = options(replacement, input.modelID, decode(variant.settings ?? {}));
90
+ const headers = mergeHeaders2(overlay.headers, variant.headers);
91
+ const body = mergeOverlay2(overlay.body, variant.body);
92
+ return {
93
+ id: variant.id,
94
+ ...variant.settings === undefined ? {} : { settings: overlay.settings },
95
+ ...headers === undefined ? {} : { headers },
96
+ ...body === undefined ? {} : { body }
97
+ };
98
+ });
99
+ }
100
+ var PACKAGES = {
101
+ "@ai-sdk/amazon-bedrock": "@opencode/ai/providers/amazon-bedrock",
102
+ "@ai-sdk/alibaba": "@opencode/ai/providers/alibaba/chat",
103
+ "@ai-sdk/anthropic": "@opencode/ai/providers/anthropic",
104
+ "@ai-sdk/azure": "@opencode/ai/providers/azure/responses",
105
+ "@ai-sdk/cerebras": "@opencode/ai/providers/cerebras",
106
+ "@ai-sdk/cohere": "@opencode/ai/providers/cohere",
107
+ "@ai-sdk/deepinfra": "@opencode/ai/providers/deepinfra",
108
+ "@ai-sdk/google": "@opencode/ai/providers/google",
109
+ "@ai-sdk/google-vertex": "@opencode/ai/providers/google-vertex",
110
+ "@ai-sdk/google-vertex/anthropic": "@opencode/ai/providers/google-vertex/messages",
111
+ "@ai-sdk/groq": "@opencode/ai/providers/groq",
112
+ "@ai-sdk/mistral": "@opencode/ai/providers/mistral",
113
+ "@ai-sdk/openai": "@opencode/ai/providers/openai",
114
+ "@ai-sdk/openai-compatible": "@opencode/ai/providers/openai-compatible",
115
+ "@ai-sdk/togetherai": "@opencode/ai/providers/togetherai",
116
+ "@ai-sdk/xai": "@opencode/ai/providers/xai",
117
+ "@ai-sdk/gateway": "@opencode/ai/providers/vercel-ai-gateway",
118
+ "@openrouter/ai-sdk-provider": "@opencode/ai/providers/openrouter",
119
+ "ai-gateway-provider": "@opencode/ai/providers/cloudflare-ai-gateway",
120
+ "venice-ai-sdk-provider": "@opencode/ai/providers/venice"
121
+ };
122
+ var protocols = (name) => ({
123
+ "@ai-sdk/openai-compatible": `@opencode/ai/providers/${name}/chat`,
124
+ "@ai-sdk/anthropic": `@opencode/ai/providers/${name}/messages`,
125
+ "@ai-sdk/openai": `@opencode/ai/providers/${name}/responses`
126
+ });
127
+ var HOSTS = {
128
+ alibaba: protocols("alibaba"),
129
+ "alibaba-cn": protocols("alibaba"),
130
+ "alibaba-coding-plan": protocols("alibaba"),
131
+ "alibaba-coding-plan-cn": protocols("alibaba"),
132
+ "alibaba-token-plan": protocols("alibaba"),
133
+ "alibaba-token-plan-cn": protocols("alibaba"),
134
+ baseten: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/baseten" },
135
+ "cloudflare-ai-gateway": {
136
+ "@ai-sdk/anthropic": "@opencode/ai/providers/cloudflare-ai-gateway",
137
+ "@ai-sdk/openai": "@opencode/ai/providers/cloudflare-ai-gateway",
138
+ "@ai-sdk/openai-compatible": "@opencode/ai/providers/cloudflare-ai-gateway",
139
+ "ai-gateway-provider": "@opencode/ai/providers/cloudflare-ai-gateway"
140
+ },
141
+ cohere: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/cohere/chat" },
142
+ "cloudflare-workers-ai": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/cloudflare-workers-ai" },
143
+ deepseek: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/deepseek" },
144
+ digitalocean: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/digitalocean" },
145
+ "fireworks-ai": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/fireworks" },
146
+ "google-vertex": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/google-vertex/chat" },
147
+ "kimi-for-coding": protocols("moonshot"),
148
+ meta: protocols("meta"),
149
+ minimax: protocols("minimax"),
150
+ "minimax-cn": protocols("minimax"),
151
+ "minimax-coding-plan": protocols("minimax"),
152
+ "minimax-cn-coding-plan": protocols("minimax"),
153
+ moonshotai: protocols("moonshot"),
154
+ "moonshotai-cn": protocols("moonshot"),
155
+ zai: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/zai/chat" },
156
+ "zai-coding-plan": protocols("zai-coding-plan"),
157
+ zhipuai: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/zai/chat" },
158
+ "zhipuai-coding-plan": protocols("zai-coding-plan")
159
+ };
160
+ var NATIVE = new Set([
161
+ ...Object.values(PACKAGES),
162
+ ...Object.values(HOSTS).flatMap((host) => Object.values(host)),
163
+ "@opencode/ai/providers/azure/chat",
164
+ "@opencode/ai/providers/amazon-bedrock/mantle",
165
+ "@opencode/ai/providers/amazon-bedrock/mantle/chat",
166
+ "@opencode/ai/providers/amazon-bedrock/mantle/responses"
167
+ ]);
168
+ function native2(npm, context) {
169
+ const host = HOSTS[context.providerID]?.[npm];
170
+ if (host)
171
+ return host;
172
+ if (npm === "@ai-sdk/amazon-bedrock/mantle")
173
+ return mantle(context.modelID);
174
+ if (npm === "@ai-sdk/azure" && azureChat(context))
175
+ return "@opencode/ai/providers/azure/chat";
176
+ return PACKAGES[npm];
177
+ }
178
+ var azureChat = (context) => context.shape === "completions" || context.settings?.useCompletionUrls === true;
179
+ var mantle = (modelID) => {
180
+ if (modelID === undefined)
181
+ return "@opencode/ai/providers/amazon-bedrock/mantle";
182
+ return `@opencode/ai/providers/amazon-bedrock/mantle/${modelID.includes("gpt-oss") ? "chat" : "responses"}`;
183
+ };
184
+ function resolve(specifier, context) {
185
+ const npm = packageName2(specifier);
186
+ if (isAISDK2(specifier) || npm in PACKAGES || npm in (HOSTS[context.providerID] ?? {}))
187
+ return native2(npm, context);
188
+ if (npm === "@opencode/ai/providers/amazon-bedrock/mantle")
189
+ return mantle(context.modelID);
190
+ if (npm === "@opencode/ai/providers/azure/responses" && azureChat(context))
191
+ return "@opencode/ai/providers/azure/chat";
192
+ return NATIVE.has(npm) ? npm : undefined;
193
+ }
194
+ function options(replacement, modelID, settings) {
195
+ const converse = replacement === "@opencode/ai/providers/amazon-bedrock" && modelID !== undefined;
196
+ const kept = Struct.omit(settings, ["headers", "extraBody", "useCompletionUrls", ...OPENROUTER_KEYS]);
197
+ const thinking = converse ? bedrockThinking(modelID, settings) : undefined;
198
+ return {
199
+ settings: {
200
+ ...replacement.startsWith("@opencode/ai/providers/amazon-bedrock") ? bedrockSettings(kept, converse) : kept,
201
+ ...thinking === undefined ? {} : { thinking }
202
+ },
203
+ ...settings.headers === undefined ? {} : { headers: settings.headers },
204
+ ...settings.extraBody === undefined ? {} : { body: settings.extraBody },
205
+ ...converse ? bedrockRequest(modelID, settings) : {},
206
+ ...replacement === "@opencode/ai/providers/openrouter" ? openRouterRequest(settings) : {}
207
+ };
208
+ }
209
+ var BEDROCK_KEYS = [
210
+ "bearerToken",
211
+ "endpoint",
212
+ "credentials",
213
+ "credentialProvider",
214
+ "accessKeyId",
215
+ "secretAccessKey",
216
+ "sessionToken"
217
+ ];
218
+ var CONVERSE_KEYS = ["additionalModelRequestFields", "reasoningConfig", "anthropicBeta", "serviceTier"];
219
+ function bedrockSettings(settings, converse) {
220
+ const region = settings.region ?? settings.credentials?.region;
221
+ const credentials = settings.credentials ?? settings;
222
+ const baseURL = settings.baseURL ?? settings.endpoint;
223
+ return {
224
+ ...Struct.omit(settings, converse ? [...BEDROCK_KEYS, ...CONVERSE_KEYS] : BEDROCK_KEYS),
225
+ ...baseURL === undefined ? {} : { baseURL: region === undefined ? baseURL : baseURL.replaceAll("${AWS_REGION}", region) },
226
+ ...settings.apiKey === undefined && settings.bearerToken !== undefined ? { apiKey: settings.bearerToken } : {},
227
+ ...credentials.accessKeyId === undefined || credentials.secretAccessKey === undefined ? {} : {
228
+ credentials: {
229
+ ...region === undefined ? {} : { region },
230
+ accessKeyId: credentials.accessKeyId,
231
+ secretAccessKey: credentials.secretAccessKey,
232
+ ...credentials.sessionToken === undefined ? {} : { sessionToken: credentials.sessionToken }
233
+ }
234
+ }
235
+ };
236
+ }
237
+ function bedrockThinking(modelID, settings) {
238
+ const reasoning = settings.reasoningConfig;
239
+ if (!modelID?.includes("anthropic") || reasoning?.type !== "enabled" || reasoning.budgetTokens === undefined)
240
+ return;
241
+ return { type: "enabled", budgetTokens: reasoning.budgetTokens };
242
+ }
243
+ function bedrockRequest(modelID, settings) {
244
+ const additional = settings.additionalModelRequestFields ?? {};
245
+ const reasoning = settings.reasoningConfig;
246
+ const anthropic = modelID?.includes("anthropic") ?? false;
247
+ const openai = modelID?.includes("openai.") ?? false;
248
+ const harmony = modelID?.includes("openai.gpt-oss") ?? false;
249
+ const effort = reasoning?.maxReasoningEffort;
250
+ const type = reasoning?.type;
251
+ const budget = reasoning?.budgetTokens;
252
+ const display = reasoning?.display;
253
+ const betas = settings.anthropicBeta ?? [];
254
+ const fields = mergeOverlay2(additional, {
255
+ ...betas.length > 0 ? { anthropic_beta: [...additional.anthropic_beta ?? [], ...betas] } : {},
256
+ ...anthropic && type === "adaptive" ? { thinking: { type: "adaptive", ...display === undefined ? {} : { display } } } : {},
257
+ ...anthropic && effort !== undefined ? { output_config: { ...additional.output_config, effort } } : {},
258
+ ...!anthropic && openai && harmony && effort !== undefined ? { reasoning_effort: effort } : {},
259
+ ...!anthropic && openai && !harmony && effort !== undefined ? { reasoning: { ...additional.reasoning, effort } } : {},
260
+ ...!anthropic && !openai && effort !== undefined ? {
261
+ reasoningConfig: {
262
+ ...type === undefined || type === "adaptive" ? {} : { type },
263
+ ...budget === undefined ? {} : { budgetTokens: budget },
264
+ maxReasoningEffort: effort
265
+ }
266
+ } : {}
267
+ });
268
+ const body = {
269
+ ...fields && Object.keys(fields).length > 0 ? { additionalModelRequestFields: fields } : {},
270
+ ...settings.serviceTier === undefined ? {} : { serviceTier: { type: settings.serviceTier } }
271
+ };
272
+ return Object.keys(body).length === 0 ? {} : { body };
273
+ }
274
+ var OPENROUTER_KEYS = ["appName", "appUrl", "api_keys", "compatibility"];
275
+ function openRouterRequest(settings) {
276
+ const headers = mergeHeaders2({
277
+ ...settings.appName === undefined ? {} : { "X-OpenRouter-Title": settings.appName },
278
+ ...settings.appUrl === undefined ? {} : { "HTTP-Referer": settings.appUrl },
279
+ ...settings.api_keys === undefined || Object.keys(settings.api_keys).length === 0 ? {} : { "X-Provider-API-Keys": JSON.stringify(settings.api_keys) }
280
+ }, settings.headers) ?? {};
281
+ return Object.keys(headers).length === 0 ? {} : { headers };
282
+ }
283
+ var lenient = (schema) => Schema.optional(Schema.UndefinedOr(schema).pipe(Schema.catchDecoding(() => Effect.succeed(Option.some(undefined)))));
284
+ var Credentials = Schema.Struct({
285
+ accessKeyId: Schema.String,
286
+ secretAccessKey: Schema.String,
287
+ sessionToken: lenient(Schema.String),
288
+ region: lenient(Schema.String)
289
+ });
290
+ var Legacy = Schema.StructWithRest(Schema.Struct({
291
+ apiKey: lenient(Schema.String),
292
+ baseURL: lenient(Schema.String),
293
+ headers: lenient(Schema.Record(Schema.String, Schema.String)),
294
+ extraBody: lenient(Schema.Record(Schema.String, Schema.Unknown)),
295
+ useCompletionUrls: lenient(Schema.Boolean),
296
+ auth: lenient(Schema.Literals(["bearer", "sigv4"])),
297
+ bearerToken: lenient(Schema.String),
298
+ endpoint: lenient(Schema.String),
299
+ region: lenient(Schema.String),
300
+ credentials: lenient(Credentials),
301
+ accessKeyId: lenient(Schema.String),
302
+ secretAccessKey: lenient(Schema.String),
303
+ sessionToken: lenient(Schema.String),
304
+ anthropicBeta: lenient(Schema.Array(Schema.String)),
305
+ serviceTier: lenient(Schema.String),
306
+ reasoningConfig: lenient(Schema.Struct({
307
+ type: lenient(Schema.String),
308
+ display: lenient(Schema.String),
309
+ maxReasoningEffort: lenient(Schema.String),
310
+ budgetTokens: lenient(Schema.Number)
311
+ })),
312
+ additionalModelRequestFields: lenient(Schema.StructWithRest(Schema.Struct({
313
+ anthropic_beta: lenient(Schema.Array(Schema.String)),
314
+ output_config: lenient(Schema.Record(Schema.String, Schema.Unknown)),
315
+ reasoning: lenient(Schema.Record(Schema.String, Schema.Unknown))
316
+ }), [Schema.Record(Schema.String, Schema.Unknown)])),
317
+ appName: lenient(Schema.String),
318
+ appUrl: lenient(Schema.String),
319
+ api_keys: lenient(Schema.Record(Schema.String, Schema.String))
320
+ }), [Schema.Record(Schema.String, Schema.Unknown)]);
321
+ var decode = Schema.decodeUnknownSync(Legacy);
322
+
323
+ // src/provider.ts
71
324
  import { Event as Event17 } from "@opencode/schema/provider";
72
325
  var ID13 = Provider.ID;
73
326
  var AISDK_PREFIX2 = "aisdk:";
@@ -80,12 +333,12 @@ function packageName2(value) {
80
333
  return value;
81
334
  return value.slice(AISDK_PREFIX2.length);
82
335
  }
83
- var JsonRecord = Schema.Record(Schema.String, Schema.Json);
84
- var decodeJsonRecord = Schema.decodeUnknownSync(JsonRecord);
336
+ var JsonRecord = Schema2.Record(Schema2.String, Schema2.Json);
337
+ var decodeJsonRecord = Schema2.decodeUnknownSync(JsonRecord);
85
338
 
86
- class LoadError3 extends Schema.TaggedError()("Provider.LoadError", {
87
- package: Schema.String,
88
- cause: Schema.Defect()
339
+ class LoadError3 extends Schema2.TaggedError()("Provider.LoadError", {
340
+ package: Schema2.String,
341
+ cause: Schema2.Defect()
89
342
  }) {
90
343
  }
91
344
  var packages = new Map;
@@ -161,12 +414,12 @@ var builtins = new Map([
161
414
  () => import("@opencode/ai/providers/zai-coding-plan/responses")
162
415
  ]
163
416
  ]);
164
- var loadPackage2 = Effect.fn("Provider.loadPackage")(function* (input, npm) {
417
+ var loadPackage2 = Effect2.fn("Provider.loadPackage")(function* (input, npm) {
165
418
  const specifier = packageName2(input);
166
419
  const builtin = builtins.get(specifier);
167
420
  if (builtin)
168
421
  return yield* importPackage(specifier, specifier, builtin);
169
- const resolved = yield* Effect.sync(() => {
422
+ const resolved = yield* Effect2.sync(() => {
170
423
  if (specifier.startsWith("file://") || specifier.startsWith("@opencode/ai/"))
171
424
  return specifier;
172
425
  try {
@@ -185,8 +438,8 @@ var loadPackage2 = Effect.fn("Provider.loadPackage")(function* (input, npm) {
185
438
  }
186
439
  const parts = specifier.split("/");
187
440
  const root = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0] ?? specifier;
188
- const installed = yield* npm.add(root).pipe(Effect.mapError((cause) => new LoadError3({ package: specifier, cause })));
189
- const entrypoint = yield* Effect.try({
441
+ const installed = yield* npm.add(root).pipe(Effect2.mapError((cause) => new LoadError3({ package: specifier, cause })));
442
+ const entrypoint = yield* Effect2.try({
190
443
  try: () => resolveModule(specifier, installed.directory),
191
444
  catch: (cause) => new LoadError3({ package: specifier, cause })
192
445
  });
@@ -195,15 +448,15 @@ var loadPackage2 = Effect.fn("Provider.loadPackage")(function* (input, npm) {
195
448
  var CORE_KEYS = ["chunkTimeout", "compaction", "fetch", "headerTimeout", "timeout", "transport"];
196
449
  var PROVIDER_ONLY_KEYS = ["chunkTimeout", "headerTimeout", "timeout", "transport"];
197
450
  function nativeSettings2(settings) {
198
- return Struct.omit(settings, CORE_KEYS);
451
+ return Struct2.omit(settings, CORE_KEYS);
199
452
  }
200
453
  function modelSettings2(settings) {
201
- return settings && Struct.omit(settings, PROVIDER_ONLY_KEYS);
454
+ return settings && Struct2.omit(settings, PROVIDER_ONLY_KEYS);
202
455
  }
203
- var decodeTimeout = Schema.decodeUnknownOption(HttpTimeout);
456
+ var decodeTimeout = Schema2.decodeUnknownOption(HttpTimeout);
204
457
  var DEFAULT_TIMEOUT_MS3 = 300000;
205
458
  function timeout2(value) {
206
- return Option.getOrUndefined(decodeTimeout(value));
459
+ return Option2.getOrUndefined(decodeTimeout(value));
207
460
  }
208
461
  function timeouts2(settings) {
209
462
  return {
@@ -241,9 +494,9 @@ var Request3 = Provider.Request;
241
494
  var Compaction3 = Provider.Compaction;
242
495
  var Transport2 = Provider.Transport;
243
496
  var Settings2 = Provider.Settings;
244
- var Info21 = Provider.Info;
497
+ var Info22 = Provider.Info;
245
498
 
246
- class Service75 extends Context.Service()("@opencode/Provider") {
499
+ class Service76 extends Context.Service()("@opencode/Provider") {
247
500
  }
248
501
  var definitions = new WeakMap;
249
502
  function index(providerID, models) {
@@ -256,9 +509,9 @@ function index(providerID, models) {
256
509
  definitions.set(models, indexes);
257
510
  return result;
258
511
  }
259
- var layer = Layer.effect(Service75, Effect.gen(function* () {
512
+ var layer = Layer.effect(Service76, Effect2.gen(function* () {
260
513
  const bus = yield* Service83;
261
- const integrations = yield* Service76;
514
+ const integrations = yield* Service77;
262
515
  const location = yield* Service80;
263
516
  const state = create3({
264
517
  name: "provider",
@@ -270,7 +523,7 @@ var layer = Layer.effect(Service75, Effect.gen(function* () {
270
523
  const current = records.get(id);
271
524
  if (current)
272
525
  return current;
273
- const added = { provider: Info21.empty(id), models: new Map };
526
+ const added = { provider: Info22.empty(id), models: new Map };
274
527
  records.set(id, added);
275
528
  maps.add(added.models);
276
529
  return added;
@@ -338,9 +591,9 @@ var layer = Layer.effect(Service75, Effect.gen(function* () {
338
591
  },
339
592
  notify: () => notify
340
593
  });
341
- yield* Effect.addFinalizer(() => shutdown2(state.reload()));
594
+ yield* Effect2.addFinalizer(() => shutdown2(state.reload()));
342
595
  let cached;
343
- const snapshot = Effect.fn("Provider.snapshot")(function* () {
596
+ const snapshot = Effect2.fn("Provider.snapshot")(function* () {
344
597
  while (true) {
345
598
  const revision = integrations.revision();
346
599
  const records = state.get();
@@ -368,7 +621,7 @@ var layer = Layer.effect(Service75, Effect.gen(function* () {
368
621
  }
369
622
  });
370
623
  let published;
371
- const notify = Effect.gen(function* () {
624
+ const notify = Effect2.gen(function* () {
372
625
  const value = yield* snapshot();
373
626
  if (value === published)
374
627
  return;
@@ -377,19 +630,19 @@ var layer = Layer.effect(Service75, Effect.gen(function* () {
377
630
  location: { directory: location.directory, workspaceID: location.workspaceID }
378
631
  });
379
632
  });
380
- yield* bus.subscribe([Event18.Updated, Credential.Event.Updated, Credential.Event.Switched]).pipe(Stream.runForEach(() => notify), Effect.forkScoped({ startImmediately: true }));
381
- return Service75.of({
633
+ yield* bus.subscribe([Event18.Updated, Credential.Event.Updated, Credential.Event.Switched]).pipe(Stream.runForEach(() => notify), Effect2.forkScoped({ startImmediately: true }));
634
+ return Service76.of({
382
635
  transform: state.transform,
383
636
  reload: state.reload,
384
- get: Effect.fn("Provider.get")((id) => Effect.sync(() => freeze(state.get().get(id)?.provider, true))),
385
- all: Effect.fn("Provider.all")(() => Effect.sync(() => Array.from(state.get().values(), (record) => freeze(record.provider, true)))),
386
- available: Effect.fn("Provider.available")(() => snapshot().pipe(Effect.map((value) => value.providers))),
637
+ get: Effect2.fn("Provider.get")((id) => Effect2.sync(() => freeze(state.get().get(id)?.provider, true))),
638
+ all: Effect2.fn("Provider.all")(() => Effect2.sync(() => Array.from(state.get().values(), (record) => freeze(record.provider, true)))),
639
+ available: Effect2.fn("Provider.available")(() => snapshot().pipe(Effect2.map((value) => value.providers))),
387
640
  snapshot
388
641
  });
389
642
  }));
390
- var node79 = makeLocationNode({ service: Service75, layer, deps: [node87, node80, node84] });
391
- var importPackage = Effect.fn("Provider.importPackage")(function* (specifier, entrypoint, load = () => importModule(entrypoint)) {
392
- const module = yield* Effect.tryPromise({
643
+ var node80 = makeLocationNode({ service: Service76, layer, deps: [node87, node81, node84] });
644
+ var importPackage = Effect2.fn("Provider.importPackage")(function* (specifier, entrypoint, load = () => importModule(entrypoint)) {
645
+ const module = yield* Effect2.tryPromise({
393
646
  try: () => {
394
647
  const existing = packages.get(entrypoint);
395
648
  if (existing)
@@ -409,257 +662,4 @@ var importPackage = Effect.fn("Provider.importPackage")(function* (specifier, en
409
662
  return module;
410
663
  });
411
664
 
412
- // src/aisdk-native.ts
413
- function rewrite2(target, input) {
414
- if (input.specifier === undefined)
415
- return;
416
- const plain = resolve(input.specifier, input);
417
- if (!plain)
418
- return;
419
- const settings = decode(target.settings ?? {});
420
- const replacement = resolve(input.specifier, { ...input, settings }) ?? plain;
421
- const translated = options(replacement, input.modelID, settings);
422
- if (target.package !== undefined || replacement !== input.specifier)
423
- target.package = replacement;
424
- target.settings = target.settings === undefined ? undefined : {
425
- ...translated.settings,
426
- ...!NATIVE.has(input.specifier) && replacement === "@opencode/ai/providers/openai-compatible" ? { provider: input.canonical ?? input.providerID } : {}
427
- };
428
- target.headers = mergeHeaders2(translated.headers, target.headers);
429
- target.body = mergeOverlay2(translated.body, target.body);
430
- target.variants = target.variants?.map((variant) => {
431
- const overlay = options(replacement, input.modelID, decode(variant.settings ?? {}));
432
- const headers = mergeHeaders2(overlay.headers, variant.headers);
433
- const body = mergeOverlay2(overlay.body, variant.body);
434
- return {
435
- id: variant.id,
436
- ...variant.settings === undefined ? {} : { settings: overlay.settings },
437
- ...headers === undefined ? {} : { headers },
438
- ...body === undefined ? {} : { body }
439
- };
440
- });
441
- }
442
- var PACKAGES = {
443
- "@ai-sdk/amazon-bedrock": "@opencode/ai/providers/amazon-bedrock",
444
- "@ai-sdk/alibaba": "@opencode/ai/providers/alibaba/chat",
445
- "@ai-sdk/anthropic": "@opencode/ai/providers/anthropic",
446
- "@ai-sdk/azure": "@opencode/ai/providers/azure/responses",
447
- "@ai-sdk/cerebras": "@opencode/ai/providers/cerebras",
448
- "@ai-sdk/cohere": "@opencode/ai/providers/cohere",
449
- "@ai-sdk/deepinfra": "@opencode/ai/providers/deepinfra",
450
- "@ai-sdk/google": "@opencode/ai/providers/google",
451
- "@ai-sdk/google-vertex": "@opencode/ai/providers/google-vertex",
452
- "@ai-sdk/google-vertex/anthropic": "@opencode/ai/providers/google-vertex/messages",
453
- "@ai-sdk/groq": "@opencode/ai/providers/groq",
454
- "@ai-sdk/mistral": "@opencode/ai/providers/mistral",
455
- "@ai-sdk/openai": "@opencode/ai/providers/openai",
456
- "@ai-sdk/openai-compatible": "@opencode/ai/providers/openai-compatible",
457
- "@ai-sdk/togetherai": "@opencode/ai/providers/togetherai",
458
- "@ai-sdk/xai": "@opencode/ai/providers/xai",
459
- "@ai-sdk/gateway": "@opencode/ai/providers/vercel-ai-gateway",
460
- "@openrouter/ai-sdk-provider": "@opencode/ai/providers/openrouter",
461
- "ai-gateway-provider": "@opencode/ai/providers/cloudflare-ai-gateway",
462
- "venice-ai-sdk-provider": "@opencode/ai/providers/venice"
463
- };
464
- var protocols = (name) => ({
465
- "@ai-sdk/openai-compatible": `@opencode/ai/providers/${name}/chat`,
466
- "@ai-sdk/anthropic": `@opencode/ai/providers/${name}/messages`,
467
- "@ai-sdk/openai": `@opencode/ai/providers/${name}/responses`
468
- });
469
- var HOSTS = {
470
- alibaba: protocols("alibaba"),
471
- "alibaba-cn": protocols("alibaba"),
472
- "alibaba-coding-plan": protocols("alibaba"),
473
- "alibaba-coding-plan-cn": protocols("alibaba"),
474
- "alibaba-token-plan": protocols("alibaba"),
475
- "alibaba-token-plan-cn": protocols("alibaba"),
476
- baseten: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/baseten" },
477
- "cloudflare-ai-gateway": {
478
- "@ai-sdk/anthropic": "@opencode/ai/providers/cloudflare-ai-gateway",
479
- "@ai-sdk/openai": "@opencode/ai/providers/cloudflare-ai-gateway",
480
- "@ai-sdk/openai-compatible": "@opencode/ai/providers/cloudflare-ai-gateway",
481
- "ai-gateway-provider": "@opencode/ai/providers/cloudflare-ai-gateway"
482
- },
483
- cohere: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/cohere/chat" },
484
- "cloudflare-workers-ai": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/cloudflare-workers-ai" },
485
- deepseek: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/deepseek" },
486
- digitalocean: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/digitalocean" },
487
- "fireworks-ai": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/fireworks" },
488
- "google-vertex": { "@ai-sdk/openai-compatible": "@opencode/ai/providers/google-vertex/chat" },
489
- "kimi-for-coding": protocols("moonshot"),
490
- meta: protocols("meta"),
491
- minimax: protocols("minimax"),
492
- "minimax-cn": protocols("minimax"),
493
- "minimax-coding-plan": protocols("minimax"),
494
- "minimax-cn-coding-plan": protocols("minimax"),
495
- moonshotai: protocols("moonshot"),
496
- "moonshotai-cn": protocols("moonshot"),
497
- zai: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/zai/chat" },
498
- "zai-coding-plan": protocols("zai-coding-plan"),
499
- zhipuai: { "@ai-sdk/openai-compatible": "@opencode/ai/providers/zai/chat" },
500
- "zhipuai-coding-plan": protocols("zai-coding-plan")
501
- };
502
- var NATIVE = new Set([
503
- ...Object.values(PACKAGES),
504
- ...Object.values(HOSTS).flatMap((host) => Object.values(host)),
505
- "@opencode/ai/providers/azure/chat",
506
- "@opencode/ai/providers/amazon-bedrock/mantle",
507
- "@opencode/ai/providers/amazon-bedrock/mantle/chat",
508
- "@opencode/ai/providers/amazon-bedrock/mantle/responses"
509
- ]);
510
- function native2(npm, context) {
511
- const host = HOSTS[context.providerID]?.[npm];
512
- if (host)
513
- return host;
514
- if (npm === "@ai-sdk/amazon-bedrock/mantle")
515
- return mantle(context.modelID);
516
- if (npm === "@ai-sdk/azure" && azureChat(context))
517
- return "@opencode/ai/providers/azure/chat";
518
- return PACKAGES[npm];
519
- }
520
- var azureChat = (context) => context.shape === "completions" || context.settings?.useCompletionUrls === true;
521
- var mantle = (modelID) => {
522
- if (modelID === undefined)
523
- return "@opencode/ai/providers/amazon-bedrock/mantle";
524
- return `@opencode/ai/providers/amazon-bedrock/mantle/${modelID.includes("gpt-oss") ? "chat" : "responses"}`;
525
- };
526
- function resolve(specifier, context) {
527
- const npm = packageName2(specifier);
528
- if (isAISDK2(specifier) || npm in PACKAGES || npm in (HOSTS[context.providerID] ?? {}))
529
- return native2(npm, context);
530
- if (npm === "@opencode/ai/providers/amazon-bedrock/mantle")
531
- return mantle(context.modelID);
532
- if (npm === "@opencode/ai/providers/azure/responses" && azureChat(context))
533
- return "@opencode/ai/providers/azure/chat";
534
- return NATIVE.has(npm) ? npm : undefined;
535
- }
536
- function options(replacement, modelID, settings) {
537
- const converse = replacement === "@opencode/ai/providers/amazon-bedrock" && modelID !== undefined;
538
- const kept = Struct2.omit(settings, ["headers", "extraBody", "useCompletionUrls", ...OPENROUTER_KEYS]);
539
- const thinking = converse ? bedrockThinking(modelID, settings) : undefined;
540
- return {
541
- settings: {
542
- ...replacement.startsWith("@opencode/ai/providers/amazon-bedrock") ? bedrockSettings(kept, converse) : kept,
543
- ...thinking === undefined ? {} : { thinking }
544
- },
545
- ...settings.headers === undefined ? {} : { headers: settings.headers },
546
- ...settings.extraBody === undefined ? {} : { body: settings.extraBody },
547
- ...converse ? bedrockRequest(modelID, settings) : {},
548
- ...replacement === "@opencode/ai/providers/openrouter" ? openRouterRequest(settings) : {}
549
- };
550
- }
551
- var BEDROCK_KEYS = [
552
- "bearerToken",
553
- "endpoint",
554
- "credentials",
555
- "credentialProvider",
556
- "accessKeyId",
557
- "secretAccessKey",
558
- "sessionToken"
559
- ];
560
- var CONVERSE_KEYS = ["additionalModelRequestFields", "reasoningConfig", "anthropicBeta", "serviceTier"];
561
- function bedrockSettings(settings, converse) {
562
- const region = settings.region ?? settings.credentials?.region;
563
- const credentials = settings.credentials ?? settings;
564
- const baseURL = settings.baseURL ?? settings.endpoint;
565
- return {
566
- ...Struct2.omit(settings, converse ? [...BEDROCK_KEYS, ...CONVERSE_KEYS] : BEDROCK_KEYS),
567
- ...baseURL === undefined ? {} : { baseURL: region === undefined ? baseURL : baseURL.replaceAll("${AWS_REGION}", region) },
568
- ...settings.apiKey === undefined && settings.bearerToken !== undefined ? { apiKey: settings.bearerToken } : {},
569
- ...credentials.accessKeyId === undefined || credentials.secretAccessKey === undefined ? {} : {
570
- credentials: {
571
- ...region === undefined ? {} : { region },
572
- accessKeyId: credentials.accessKeyId,
573
- secretAccessKey: credentials.secretAccessKey,
574
- ...credentials.sessionToken === undefined ? {} : { sessionToken: credentials.sessionToken }
575
- }
576
- }
577
- };
578
- }
579
- function bedrockThinking(modelID, settings) {
580
- const reasoning = settings.reasoningConfig;
581
- if (!modelID?.includes("anthropic") || reasoning?.type !== "enabled" || reasoning.budgetTokens === undefined)
582
- return;
583
- return { type: "enabled", budgetTokens: reasoning.budgetTokens };
584
- }
585
- function bedrockRequest(modelID, settings) {
586
- const additional = settings.additionalModelRequestFields ?? {};
587
- const reasoning = settings.reasoningConfig;
588
- const anthropic = modelID?.includes("anthropic") ?? false;
589
- const openai = modelID?.includes("openai.") ?? false;
590
- const harmony = modelID?.includes("openai.gpt-oss") ?? false;
591
- const effort = reasoning?.maxReasoningEffort;
592
- const type = reasoning?.type;
593
- const budget = reasoning?.budgetTokens;
594
- const display = reasoning?.display;
595
- const betas = settings.anthropicBeta ?? [];
596
- const fields = mergeOverlay2(additional, {
597
- ...betas.length > 0 ? { anthropic_beta: [...additional.anthropic_beta ?? [], ...betas] } : {},
598
- ...anthropic && type === "adaptive" ? { thinking: { type: "adaptive", ...display === undefined ? {} : { display } } } : {},
599
- ...anthropic && effort !== undefined ? { output_config: { ...additional.output_config, effort } } : {},
600
- ...!anthropic && openai && harmony && effort !== undefined ? { reasoning_effort: effort } : {},
601
- ...!anthropic && openai && !harmony && effort !== undefined ? { reasoning: { ...additional.reasoning, effort } } : {},
602
- ...!anthropic && !openai && effort !== undefined ? {
603
- reasoningConfig: {
604
- ...type === undefined || type === "adaptive" ? {} : { type },
605
- ...budget === undefined ? {} : { budgetTokens: budget },
606
- maxReasoningEffort: effort
607
- }
608
- } : {}
609
- });
610
- const body = {
611
- ...fields && Object.keys(fields).length > 0 ? { additionalModelRequestFields: fields } : {},
612
- ...settings.serviceTier === undefined ? {} : { serviceTier: { type: settings.serviceTier } }
613
- };
614
- return Object.keys(body).length === 0 ? {} : { body };
615
- }
616
- var OPENROUTER_KEYS = ["appName", "appUrl", "api_keys", "compatibility"];
617
- function openRouterRequest(settings) {
618
- const headers = mergeHeaders2({
619
- ...settings.appName === undefined ? {} : { "X-OpenRouter-Title": settings.appName },
620
- ...settings.appUrl === undefined ? {} : { "HTTP-Referer": settings.appUrl },
621
- ...settings.api_keys === undefined || Object.keys(settings.api_keys).length === 0 ? {} : { "X-Provider-API-Keys": JSON.stringify(settings.api_keys) }
622
- }, settings.headers) ?? {};
623
- return Object.keys(headers).length === 0 ? {} : { headers };
624
- }
625
- var lenient = (schema) => Schema2.optional(Schema2.UndefinedOr(schema).pipe(Schema2.catchDecoding(() => Effect2.succeed(Option2.some(undefined)))));
626
- var Credentials = Schema2.Struct({
627
- accessKeyId: Schema2.String,
628
- secretAccessKey: Schema2.String,
629
- sessionToken: lenient(Schema2.String),
630
- region: lenient(Schema2.String)
631
- });
632
- var Legacy = Schema2.StructWithRest(Schema2.Struct({
633
- apiKey: lenient(Schema2.String),
634
- baseURL: lenient(Schema2.String),
635
- headers: lenient(Schema2.Record(Schema2.String, Schema2.String)),
636
- extraBody: lenient(Schema2.Record(Schema2.String, Schema2.Unknown)),
637
- useCompletionUrls: lenient(Schema2.Boolean),
638
- auth: lenient(Schema2.Literals(["bearer", "sigv4"])),
639
- bearerToken: lenient(Schema2.String),
640
- endpoint: lenient(Schema2.String),
641
- region: lenient(Schema2.String),
642
- credentials: lenient(Credentials),
643
- accessKeyId: lenient(Schema2.String),
644
- secretAccessKey: lenient(Schema2.String),
645
- sessionToken: lenient(Schema2.String),
646
- anthropicBeta: lenient(Schema2.Array(Schema2.String)),
647
- serviceTier: lenient(Schema2.String),
648
- reasoningConfig: lenient(Schema2.Struct({
649
- type: lenient(Schema2.String),
650
- display: lenient(Schema2.String),
651
- maxReasoningEffort: lenient(Schema2.String),
652
- budgetTokens: lenient(Schema2.Number)
653
- })),
654
- additionalModelRequestFields: lenient(Schema2.StructWithRest(Schema2.Struct({
655
- anthropic_beta: lenient(Schema2.Array(Schema2.String)),
656
- output_config: lenient(Schema2.Record(Schema2.String, Schema2.Unknown)),
657
- reasoning: lenient(Schema2.Record(Schema2.String, Schema2.Unknown))
658
- }), [Schema2.Record(Schema2.String, Schema2.Unknown)])),
659
- appName: lenient(Schema2.String),
660
- appUrl: lenient(Schema2.String),
661
- api_keys: lenient(Schema2.Record(Schema2.String, Schema2.String))
662
- }), [Schema2.Record(Schema2.String, Schema2.Unknown)]);
663
- var decode = Schema2.decodeUnknownSync(Legacy);
664
-
665
- export { rewrite2, native2, exports_aisdk_native, ID13, AISDK_PREFIX2, isAISDK2, aisdk2, packageName2, LoadError3, loadPackage2, nativeSettings2, modelSettings2, DEFAULT_TIMEOUT_MS3, timeout2, timeouts2, mergeOverlay2, mergeHeaders2, Request3, Compaction3, Transport2, Settings2, Info21, Service75, node79, exports_provider3, Event17 };
665
+ export { ID13, AISDK_PREFIX2, isAISDK2, aisdk2, packageName2, LoadError3, loadPackage2, nativeSettings2, modelSettings2, DEFAULT_TIMEOUT_MS3, timeout2, timeouts2, mergeOverlay2, mergeHeaders2, Request3, Compaction3, Transport2, Settings2, Info22, Service76, node80, exports_provider3, Event17, rewrite2, native2, exports_aisdk_native };