@opencode/core 0.0.0-dev-20774 → 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.
- package/dist/agent.js +59 -59
- package/dist/aisdk-native.js +59 -59
- package/dist/aisdk.js +64 -64
- package/dist/app.js +9 -9
- package/dist/bus.js +52 -52
- package/dist/chunks/{location-00q60weh.js → location-02609e96.js} +16 -16
- package/dist/chunks/{location-1krkd5b8.js → location-05p4mhbg.js} +11 -11
- package/dist/chunks/location-0gzjc7ft.js +253 -0
- package/dist/chunks/{location-nvq72y7j.js → location-15xcwm9t.js} +1 -1
- package/dist/chunks/{location-rhraev7y.js → location-1acjjqhc.js} +3 -3
- package/dist/chunks/location-1fq0wp1e.js +26 -0
- package/dist/chunks/{location-n0ntqt9g.js → location-1g5f91mn.js} +41 -41
- package/dist/chunks/{location-rsc8qfyv.js → location-1gmkcf0p.js} +7 -7
- package/dist/chunks/{location-bm46emxx.js → location-1h8se44f.js} +13 -13
- package/dist/chunks/{location-xm77r8mk.js → location-1ts7y3cx.js} +9 -9
- package/dist/chunks/{location-farvs0j6.js → location-1v74vwhm.js} +13 -13
- package/dist/chunks/{location-5v2fwzy1.js → location-1v9scpnw.js} +37 -37
- package/dist/chunks/{location-jnra9z53.js → location-1z20pv40.js} +15 -15
- package/dist/chunks/{location-msn8sz9h.js → location-22tdpft4.js} +14 -14
- package/dist/chunks/{location-mcrt8a46.js → location-24skg3e0.js} +22 -22
- package/dist/chunks/{location-s1337sdb.js → location-257vwa0c.js} +23 -23
- package/dist/chunks/{location-g1bc2t46.js → location-283v9wt3.js} +26 -26
- package/dist/chunks/{location-63krnhgr.js → location-2a084xpy.js} +1 -1
- package/dist/chunks/{location-savccbnq.js → location-2fpnaz5h.js} +31 -31
- package/dist/chunks/{location-32yxbfvn.js → location-2jy94dam.js} +17 -17
- package/dist/chunks/{location-avjs8rwt.js → location-2kw5qtk9.js} +43 -43
- package/dist/chunks/{location-ma4d79jn.js → location-3jpnnrb4.js} +15 -15
- package/dist/chunks/{location-pkm68pcq.js → location-3pxsat6s.js} +17 -17
- package/dist/chunks/{location-fcrnmcwp.js → location-3qb0mese.js} +1 -1
- package/dist/chunks/{location-fcryy9bm.js → location-42y5raaz.js} +12 -12
- package/dist/chunks/{location-4yxknn6d.js → location-44rac60e.js} +12 -12
- package/dist/chunks/{location-0r3c1bmw.js → location-47jkzegy.js} +3 -3
- package/dist/chunks/{location-0m0pvxq1.js → location-47r5a3mx.js} +10 -10
- package/dist/chunks/{location-ssesc4qa.js → location-4b5b0vhn.js} +6 -6
- package/dist/chunks/{location-94t80y57.js → location-4bar7sar.js} +25 -25
- package/dist/chunks/{location-frz66pft.js → location-4pedpz6c.js} +11 -11
- package/dist/chunks/{location-tghtnfzz.js → location-4vvqa2vj.js} +89 -89
- package/dist/chunks/{location-1pxz8ven.js → location-4xpgt2w9.js} +3 -3
- package/dist/chunks/{location-djqvkhft.js → location-4zxfccqq.js} +21 -21
- package/dist/chunks/{location-1z0fzhfg.js → location-50pnv838.js} +24 -24
- package/dist/chunks/{location-fpq9acqp.js → location-51f5btjf.js} +5 -5
- package/dist/chunks/{location-brggcc39.js → location-57ehm7c4.js} +30 -30
- package/dist/chunks/{location-q9fmzgve.js → location-5h0p9j5c.js} +4 -4
- package/dist/chunks/{location-5nesw8k5.js → location-5hps0jc8.js} +18 -18
- package/dist/chunks/{location-frypca04.js → location-6hcrkmvd.js} +9 -9
- package/dist/chunks/{location-2j4zxht4.js → location-6qv3krp1.js} +16 -16
- package/dist/chunks/{location-ccyehgd0.js → location-6t1m34v8.js} +2 -2
- package/dist/chunks/{location-p1cpmwyf.js → location-6tyzbyh4.js} +16 -16
- package/dist/chunks/{location-taakedrx.js → location-6whpyrs3.js} +43 -43
- package/dist/chunks/{location-bkp7wwcv.js → location-6zztp22y.js} +42 -42
- package/dist/chunks/{location-hyzby332.js → location-724avf7x.js} +15 -15
- package/dist/chunks/{location-9mm32rc6.js → location-73gdyt7p.js} +14 -14
- package/dist/chunks/{location-2wcpgrf5.js → location-77392vks.js} +7 -7
- package/dist/chunks/{location-eapgentd.js → location-7am7j62s.js} +17 -17
- package/dist/chunks/{location-qp5zfzrm.js → location-7fyyg3d8.js} +11 -11
- package/dist/chunks/{location-w9w8c5s2.js → location-7wpc5jwh.js} +13 -13
- package/dist/chunks/{location-mhkvc446.js → location-7yh4e7ss.js} +2 -2
- package/dist/chunks/{location-0z2z9ezx.js → location-7z0vcwsq.js} +7 -7
- package/dist/chunks/{location-mxyxeq91.js → location-7zz0tb2m.js} +328 -328
- package/dist/chunks/{location-fw4jt8zs.js → location-83vepgva.js} +32 -32
- package/dist/chunks/{location-fgj24z8y.js → location-8b345ry2.js} +12 -12
- package/dist/chunks/{location-gseqh7y5.js → location-8pfsh0gj.js} +19 -19
- package/dist/chunks/{location-nc482bkw.js → location-8snddydh.js} +8 -8
- package/dist/chunks/{location-hpbkp3jv.js → location-8y8dfhw6.js} +9 -9
- package/dist/chunks/{location-n456zfcg.js → location-922xc4bs.js} +30 -30
- package/dist/chunks/{location-jkr4b8s0.js → location-9cwykwg4.js} +30 -30
- package/dist/chunks/{location-wv396vej.js → location-9t7a50xb.js} +5 -5
- package/dist/chunks/{location-v099rn53.js → location-ac3dnfkw.js} +5 -5
- package/dist/chunks/{location-db2wf4at.js → location-addxnjmp.js} +3 -3
- package/dist/chunks/{location-af8mc2ra.js → location-agg46hj7.js} +4 -4
- package/dist/chunks/{location-ss358qx3.js → location-arz7hw7x.js} +3 -3
- package/dist/chunks/{location-w89t5azj.js → location-asvfb1gz.js} +22 -22
- package/dist/chunks/{location-2kxzs1z5.js → location-b3e58hyc.js} +23 -23
- package/dist/chunks/{location-pfvarswz.js → location-b4m962yk.js} +19 -19
- package/dist/chunks/{location-7vgmnxtx.js → location-b69x7x7h.js} +4 -4
- package/dist/chunks/{location-eqj35hys.js → location-b8d9rq7p.js} +31 -31
- package/dist/chunks/{location-k09pycdv.js → location-bem8en1s.js} +16 -16
- package/dist/chunks/{location-pcj0rjsp.js → location-bmq95mvw.js} +5 -5
- package/dist/chunks/{location-510enc9r.js → location-by659cs7.js} +9 -9
- package/dist/chunks/{location-rq5t05qg.js → location-c00fv4ar.js} +18 -18
- package/dist/chunks/{location-ckhb8p3a.js → location-c26ps2t9.js} +11 -11
- package/dist/chunks/{location-h5z75e8b.js → location-c5g770ce.js} +7 -7
- package/dist/chunks/{location-geg4sp68.js → location-ch3qpzfg.js} +8 -8
- package/dist/chunks/{location-7ekcnbwa.js → location-cnwjz3s5.js} +17 -17
- package/dist/chunks/{location-44ak30pa.js → location-cp937pt4.js} +3 -3
- package/dist/chunks/{location-4bfey5n7.js → location-crvcnxkj.js} +4 -4
- package/dist/chunks/{location-20ketkdt.js → location-cvmt8rk0.js} +20 -20
- package/dist/chunks/{location-k6367mvk.js → location-das60bkc.js} +25 -25
- package/dist/chunks/{location-5tpw5fwb.js → location-dc34mbvf.js} +4 -4
- package/dist/chunks/{location-r3s6mbe4.js → location-dhddhhrc.js} +9 -9
- package/dist/chunks/{location-fag3n04b.js → location-ds1wy84x.js} +24 -24
- package/dist/chunks/{location-7fj5dwt0.js → location-dxj72tfx.js} +4 -4
- package/dist/chunks/{location-s111bhqz.js → location-dzt4t18k.js} +7 -7
- package/dist/chunks/{location-c4apb3t6.js → location-eba7m2bv.js} +14 -14
- package/dist/chunks/{location-bb98p2sm.js → location-efgnm1d6.js} +7 -7
- package/dist/chunks/{location-tzph5200.js → location-ejfryj65.js} +4 -4
- package/dist/chunks/{location-77xysqe6.js → location-enppsyr8.js} +5 -5
- package/dist/chunks/{location-gen3kpyr.js → location-ep4m400e.js} +19 -19
- package/dist/chunks/{location-86qzxe6p.js → location-ermxvwhp.js} +3 -3
- package/dist/chunks/{location-6penkyg2.js → location-essarsw2.js} +32 -32
- package/dist/chunks/{location-y1vh2ynk.js → location-etvz4dq0.js} +14 -14
- package/dist/chunks/{location-pddm9hjh.js → location-ey3qhexw.js} +5 -5
- package/dist/chunks/{location-7qkbpcez.js → location-f2332hgj.js} +9 -9
- package/dist/chunks/{location-1y9xp183.js → location-f2mw6jyj.js} +8 -8
- package/dist/chunks/{location-7ke8vxpx.js → location-f4jsfm31.js} +37 -37
- package/dist/chunks/{location-7dqw4kz8.js → location-fcrkznn8.js} +4 -4
- package/dist/chunks/{location-1qrp5yz4.js → location-ffa51ey5.js} +9 -9
- package/dist/chunks/{location-r4czyjgq.js → location-fgkdc7jh.js} +22 -22
- package/dist/chunks/{location-y9jy459z.js → location-fsvxdad5.js} +2 -2
- package/dist/chunks/{location-4gpcyrrc.js → location-fyb3fekh.js} +11 -11
- package/dist/chunks/{location-2ha1v7qw.js → location-fzpqnkcj.js} +1 -1
- package/dist/chunks/{location-q4vqpvdd.js → location-g6z45s58.js} +13 -13
- package/dist/chunks/{location-4c4k5wey.js → location-ge2jb4mz.js} +12 -12
- package/dist/chunks/{location-pw5zjs1v.js → location-geyqfexr.js} +9 -9
- package/dist/chunks/{location-q753jdth.js → location-gy1mt2vm.js} +21 -21
- package/dist/chunks/{location-jwbqxjt0.js → location-h2xnf45v.js} +11 -11
- package/dist/chunks/{location-dy2ggsev.js → location-h72xck84.js} +22 -22
- package/dist/chunks/{location-rpep4epa.js → location-h788nv4n.js} +19 -19
- package/dist/chunks/{location-dmqcgk4z.js → location-h7s7r6s9.js} +6 -5
- package/dist/chunks/{location-8xcxajtx.js → location-hfpbvkxs.js} +14 -14
- package/dist/chunks/{location-yvvvp4gn.js → location-hpfvhvya.js} +7 -7
- package/dist/chunks/{location-p9w1c4fh.js → location-hzfdd747.js} +12 -12
- package/dist/chunks/{location-0901hh4n.js → location-j793y9ay.js} +46 -46
- package/dist/chunks/{location-e8vwfchq.js → location-j8s9ab9g.js} +4 -4
- package/dist/chunks/{location-wmwmmf9p.js → location-j97mndf0.js} +11 -11
- package/dist/chunks/{location-jv7qrkz2.js → location-jph2mfn8.js} +20 -20
- package/dist/chunks/{location-9qap1kz0.js → location-k2v3a0tj.js} +19 -19
- package/dist/chunks/{location-gjbyz4wh.js → location-k58rqv26.js} +16 -16
- package/dist/chunks/{location-srq8z0b0.js → location-k70p9jzb.js} +7 -7
- package/dist/chunks/{location-3ng9c4h1.js → location-kf8rbkby.js} +25 -25
- package/dist/chunks/{location-swtxrcf0.js → location-m46z4pcf.js} +317 -317
- package/dist/chunks/{location-5qjvepv9.js → location-m55qy151.js} +8 -8
- package/dist/chunks/{location-z2q0v0ax.js → location-m9an57nd.js} +8 -8
- package/dist/chunks/{location-bgqmeeks.js → location-mc5akg63.js} +38 -38
- package/dist/chunks/{location-1ygqh575.js → location-mfqp6xfm.js} +4 -4
- package/dist/chunks/{location-4vygzm8z.js → location-mn8ry2gg.js} +15 -15
- package/dist/chunks/{location-wssyxk27.js → location-mq882t6m.js} +18 -18
- package/dist/chunks/{location-9f668h4q.js → location-mt66mygc.js} +9 -9
- package/dist/chunks/{location-wcab5d7q.js → location-mt74ad40.js} +6 -6
- package/dist/chunks/{location-rnnnfbw7.js → location-mw9b1c9f.js} +13 -13
- package/dist/chunks/{location-5a6870bg.js → location-mye8z46x.js} +19 -19
- package/dist/chunks/{location-6d5my1ea.js → location-n0kpyt58.js} +9 -9
- package/dist/chunks/{location-4gvf9rzc.js → location-n7yx15r7.js} +2 -2
- package/dist/chunks/{location-n2gztfrf.js → location-na7ss97r.js} +18 -18
- package/dist/chunks/{location-f7a9ata7.js → location-np6bm2as.js} +3 -3
- package/dist/chunks/{location-63db42yp.js → location-nqxj0yn4.js} +1 -1
- package/dist/chunks/{location-twanzasj.js → location-nxpp2y2e.js} +12 -12
- package/dist/chunks/{location-4n607a2z.js → location-nyqx1cb3.js} +3 -3
- package/dist/chunks/{location-4w5gk0mh.js → location-p0cpcvwn.js} +13 -13
- package/dist/chunks/{location-ch1g95xj.js → location-p3pp3bgs.js} +12 -12
- package/dist/chunks/{location-9hn6k4tm.js → location-pa8pe2x7.js} +7 -7
- package/dist/chunks/{location-bhhh305g.js → location-pbavp9d4.js} +17 -17
- package/dist/chunks/{location-f0rkppvs.js → location-pjvjbv32.js} +10 -10
- package/dist/chunks/{location-pedttwxr.js → location-pnaxc6j9.js} +7 -7
- package/dist/chunks/{location-7zt5x37y.js → location-pnzf6mjf.js} +1 -1
- package/dist/chunks/{location-smnkpcw6.js → location-ppc2pnsb.js} +4 -4
- package/dist/chunks/{location-296sdbys.js → location-pqxmmrpw.js} +58 -58
- package/dist/chunks/{location-p67zypcs.js → location-py28mc1m.js} +10 -10
- package/dist/chunks/{location-cfsekr6v.js → location-py3kkmfq.js} +1 -1
- package/dist/chunks/{location-ezy2bptn.js → location-qa96c720.js} +7 -7
- package/dist/chunks/{location-f9ergr2z.js → location-qh3vb1tn.js} +8 -8
- package/dist/chunks/{location-edjm0cp8.js → location-qhqe7njz.js} +37 -37
- package/dist/chunks/{location-djszqvmq.js → location-qmqgtz8f.js} +7 -7
- package/dist/chunks/{location-bfexnhf9.js → location-qmxh83kc.js} +54 -54
- package/dist/chunks/{location-d0n0cznh.js → location-qr0pk10y.js} +21 -21
- package/dist/chunks/{location-fn64ej17.js → location-qww9nh48.js} +48 -48
- package/dist/chunks/{location-sacwgt96.js → location-qxp4d2xp.js} +46 -46
- package/dist/chunks/{location-0eednbcc.js → location-r58s4v78.js} +10 -10
- package/dist/chunks/{location-d8ck81wr.js → location-r5atvkz9.js} +5 -5
- package/dist/chunks/{location-rj1g0c9z.js → location-rb6kc9en.js} +4 -4
- package/dist/chunks/{location-v6vf82bk.js → location-rf5ebq4s.js} +30 -30
- package/dist/chunks/{location-288wtq47.js → location-rmg8r6ny.js} +8 -8
- package/dist/chunks/{location-d41hc979.js → location-rnffhph3.js} +3 -3
- package/dist/chunks/{location-czbv8z0y.js → location-s1rrpmaa.js} +32 -32
- package/dist/chunks/{location-8fefh7g5.js → location-sdq79vbt.js} +19 -19
- package/dist/chunks/{location-yrwx0ryy.js → location-sfe13qt9.js} +18 -18
- package/dist/chunks/{location-33gaavb8.js → location-smz349yv.js} +26 -26
- package/dist/chunks/{location-rj26dvxy.js → location-spvg49p3.js} +32 -32
- package/dist/chunks/{location-x7x00081.js → location-sws9dtgm.js} +3 -3
- package/dist/chunks/{location-fqb2p7cx.js → location-t2fc4mz5.js} +3 -3
- package/dist/chunks/{location-6hjayvw0.js → location-t5z5wvj2.js} +4 -4
- package/dist/chunks/{location-8mc742af.js → location-t6wbbrfa.js} +26 -26
- package/dist/chunks/{location-bvjs27d2.js → location-t7cpp3m0.js} +1 -1
- package/dist/chunks/{location-r7srsjaq.js → location-t9ew0xaf.js} +7 -7
- package/dist/chunks/{location-cyhwh2m5.js → location-t9xcwzrx.js} +18 -18
- package/dist/chunks/{location-kfw6wn9j.js → location-ta6y1msd.js} +65 -65
- package/dist/chunks/{location-1hd2en9h.js → location-thkbvcgx.js} +1 -1
- package/dist/chunks/{location-q5z81sq7.js → location-tnr8ce74.js} +44 -44
- package/dist/chunks/{location-9k8v6d5w.js → location-tz3m3brz.js} +6 -6
- package/dist/chunks/{location-x5zkgxzc.js → location-v7yprycd.js} +8 -8
- package/dist/chunks/{location-368k0mgv.js → location-v8jdkmfs.js} +19 -19
- package/dist/chunks/{location-5psc1bef.js → location-v9tbcfk2.js} +15 -15
- package/dist/chunks/{location-1wg0848n.js → location-vaskyz0h.js} +17 -17
- package/dist/chunks/{location-pkqb68ka.js → location-vn72gsba.js} +1 -1
- package/dist/chunks/{location-czy5pfnh.js → location-w0nqy3aq.js} +7 -7
- package/dist/chunks/{location-jb2r3891.js → location-wb7mg7fb.js} +20 -20
- package/dist/chunks/{location-38phfjcn.js → location-wbt9zsn3.js} +7 -7
- package/dist/chunks/{location-89bv08xb.js → location-wp8xfje7.js} +23 -23
- package/dist/chunks/{location-w81mkxs7.js → location-ws2bx7td.js} +3 -3
- package/dist/chunks/{location-twfjgwa6.js → location-wt19589t.js} +2 -2
- package/dist/chunks/{location-zwdpfek5.js → location-x2tcbxjk.js} +29 -29
- package/dist/chunks/{location-bf3zn255.js → location-xfgbrct6.js} +11 -11
- package/dist/chunks/{location-g5w8qwbj.js → location-xfkkasph.js} +3 -3
- package/dist/chunks/{location-15a8baq2.js → location-xn2v0njk.js} +9 -9
- package/dist/chunks/{location-qw00nmad.js → location-xpfnkknw.js} +30 -30
- package/dist/chunks/{location-zajgawmg.js → location-xpg5nf0s.js} +28 -28
- package/dist/chunks/{location-syqhgwq0.js → location-xpt096d7.js} +3 -3
- package/dist/chunks/{location-cyhsea0k.js → location-xs12am9p.js} +7 -7
- package/dist/chunks/{location-m7er9qjp.js → location-xvf4b5tc.js} +25 -25
- package/dist/chunks/{location-36v99zb6.js → location-y0hnatt9.js} +13 -13
- package/dist/chunks/{location-qbjx7vtc.js → location-y4eq9c7t.js} +9 -9
- package/dist/chunks/{location-11dqjexa.js → location-y56ehv6b.js} +7 -7
- package/dist/chunks/{location-22e0sng0.js → location-y7rk29wk.js} +12 -12
- package/dist/chunks/{location-3ftqq3j8.js → location-ya99b1bg.js} +178 -178
- package/dist/chunks/{location-eb1krxtt.js → location-yb1pbjke.js} +20 -20
- package/dist/chunks/{location-m3971pjk.js → location-yjzd8xzf.js} +16 -16
- package/dist/chunks/{location-gw7cjrad.js → location-yrcj3v3g.js} +3 -3
- package/dist/chunks/{location-jp0p4yja.js → location-ywcwnstf.js} +28 -28
- package/dist/chunks/{location-1kexfm1y.js → location-yx4j6h9t.js} +81 -81
- package/dist/chunks/{location-y2zmc9zv.js → location-z8nhrpf5.js} +25 -25
- package/dist/chunks/{location-f73rjn58.js → location-zcrspsvn.js} +3 -3
- package/dist/chunks/{location-a0tnr6vv.js → location-zdw14zwb.js} +8 -8
- package/dist/chunks/{location-w7r147nf.js → location-zg3gffzg.js} +1 -1
- package/dist/chunks/{location-qygbw77c.js → location-zyk1yjk8.js} +3 -3
- package/dist/chunks/{location-a9568cjm.js → location-zzz4tyg8.js} +31 -31
- package/dist/codemode/instructions.js +4 -4
- package/dist/command.js +59 -59
- package/dist/config/discovery.js +55 -55
- package/dist/config/normalize.js +67 -67
- package/dist/config/plugin/agent.js +82 -82
- package/dist/config/plugin/command.js +163 -163
- package/dist/config/plugin/compaction.js +112 -112
- package/dist/config/plugin/compatibility.js +97 -97
- package/dist/config/plugin/formatter.js +81 -81
- package/dist/config/plugin/image.js +80 -80
- package/dist/config/plugin/instruction.js +60 -60
- package/dist/config/plugin/location-watcher.js +80 -80
- package/dist/config/plugin/mcp.js +90 -90
- package/dist/config/plugin/policy.js +81 -81
- package/dist/config/plugin/provider.js +80 -80
- package/dist/config/plugin/reference.js +81 -81
- package/dist/config/plugin/shell.js +82 -82
- package/dist/config/plugin/skill-file.js +70 -70
- package/dist/config/plugin/skill.js +100 -100
- package/dist/config/plugin/snapshot.js +80 -80
- package/dist/config/plugin/source.js +83 -83
- package/dist/config/plugin/tool-output.js +80 -80
- package/dist/config/plugin/websearch.js +81 -81
- package/dist/config/plugin/worktree.js +82 -82
- package/dist/config.js +86 -86
- package/dist/credential.js +62 -62
- package/dist/database/database.js +47 -47
- package/dist/database/drizzle/effect-sqlite/driver.js +6 -6
- package/dist/database/drizzle/effect-sqlite/index.js +4 -4
- package/dist/database/drizzle/effect-sqlite/session.js +5 -5
- package/dist/database/drizzle/index.js +7 -7
- package/dist/database/drizzle/sqlite-core/effect/db.js +3 -3
- package/dist/database/drizzle/sqlite-core/effect/index.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/session.js +4 -4
- package/dist/database/drizzle.js +7 -7
- package/dist/database/migration.gen.js +37 -37
- package/dist/database/migration.js +39 -39
- package/dist/database/v1-migration.bun.js +9 -9
- package/dist/effect/app-node-builder.js +231 -231
- package/dist/environment/environment.js +62 -62
- package/dist/environment/index.js +64 -64
- package/dist/event-logger.js +13 -13
- package/dist/file-access.js +73 -73
- package/dist/file-mutation.js +63 -63
- package/dist/filesystem/location-watcher-policy.js +5 -5
- package/dist/filesystem/location-watcher.js +173 -173
- package/dist/filesystem/search.js +66 -66
- package/dist/filesystem/watcher.js +13 -13
- package/dist/filesystem.js +65 -65
- package/dist/form.js +65 -65
- package/dist/formatter/builtins.js +3 -3
- package/dist/formatter.js +59 -59
- package/dist/generate.js +69 -69
- package/dist/git.js +7 -7
- package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +4 -4
- package/dist/github-copilot/copilot-provider.js +3 -3
- package/dist/github-copilot/models.js +69 -69
- package/dist/github-copilot/responses/openai-responses-language-model.js +6 -6
- package/dist/github-copilot/responses/openai-responses-prepare-tools.js +3 -3
- package/dist/image/photon.js +1 -1
- package/dist/image.js +5 -5
- package/dist/instance/service.js +5 -5
- package/dist/instance.js +300 -300
- package/dist/instruction-discovery.js +56 -56
- package/dist/instructions/builtins.js +60 -60
- package/dist/instructions/index.js +3 -3
- package/dist/integration/connection.js +3 -3
- package/dist/integration.js +63 -63
- package/dist/job.js +56 -56
- package/dist/kv.js +52 -52
- package/dist/location-activity.js +55 -55
- package/dist/location-lifecycle.js +72 -72
- package/dist/location-service-map.js +59 -59
- package/dist/location-services.js +297 -297
- package/dist/location.js +58 -58
- package/dist/managed-policy.js +7 -7
- package/dist/mcp/client.js +16 -16
- package/dist/mcp/index.js +69 -69
- package/dist/mcp/instructions.js +94 -94
- package/dist/mcp/oauth.js +13 -13
- package/dist/mcp/stdio.js +59 -59
- package/dist/modal/models.js +69 -69
- package/dist/model-resolver.js +68 -68
- package/dist/model.js +70 -70
- package/dist/models-dev.js +73 -73
- package/dist/permission/saved.js +58 -58
- package/dist/permission.js +84 -84
- package/dist/persistent-pty/index.js +56 -56
- package/dist/persistent-pty.js +50 -50
- package/dist/plugin/agent.js +54 -54
- package/dist/plugin/command.js +68 -68
- package/dist/plugin/hooks.js +5 -5
- package/dist/plugin/host.js +166 -166
- package/dist/plugin/identity.js +3 -3
- package/dist/plugin/instance.js +5 -5
- package/dist/plugin/internal.js +274 -274
- package/dist/plugin/mcp-codemode-defaults.js +3 -3
- package/dist/plugin/models-dev.js +66 -66
- package/dist/plugin/module.js +81 -81
- package/dist/plugin/optimize.js +2 -2
- package/dist/plugin/plan.js +71 -71
- package/dist/plugin/provider/amazon-bedrock.js +60 -60
- package/dist/plugin/provider/azure.js +81 -81
- package/dist/plugin/provider/chatgpt.js +62 -62
- package/dist/plugin/provider/cloudflare-ai-gateway.js +78 -78
- package/dist/plugin/provider/cloudflare-workers-ai.js +78 -78
- package/dist/plugin/provider/configured.js +77 -77
- package/dist/plugin/provider/digitalocean.js +62 -62
- package/dist/plugin/provider/github-copilot.js +64 -64
- package/dist/plugin/provider/gitlab.js +62 -62
- package/dist/plugin/provider/google-vertex.js +78 -78
- package/dist/plugin/provider/llmgateway.js +54 -54
- package/dist/plugin/provider/lmstudio.js +81 -81
- package/dist/plugin/provider/local.js +78 -78
- package/dist/plugin/provider/modal.js +62 -62
- package/dist/plugin/provider/ollama.js +81 -81
- package/dist/plugin/provider/openai.js +61 -61
- package/dist/plugin/provider/opencode.js +67 -67
- package/dist/plugin/provider/openrouter.js +61 -61
- package/dist/plugin/provider/poe.js +54 -54
- package/dist/plugin/provider/prompt-cache-key.js +60 -60
- package/dist/plugin/provider/sap-ai-core.js +60 -60
- package/dist/plugin/provider/snowflake-cortex.js +79 -79
- package/dist/plugin/provider/vercel.js +60 -60
- package/dist/plugin/provider/vllm.js +81 -81
- package/dist/plugin/provider/xai.js +61 -61
- package/dist/plugin/provider.js +114 -114
- package/dist/plugin/sdk.js +55 -55
- package/dist/plugin/service.js +3 -3
- package/dist/plugin/skill.js +98 -98
- package/dist/plugin/supervisor.js +290 -290
- package/dist/plugin/tool-input-repair.js +3 -3
- package/dist/plugin/update.js +5 -5
- package/dist/plugin/vcs/git.js +58 -58
- package/dist/plugin/vcs/hg.js +58 -58
- package/dist/plugin/verbosity.js +63 -63
- package/dist/plugin/warming.js +79 -79
- package/dist/plugin/websearch/exa.js +6 -6
- package/dist/plugin/websearch/firecrawl.js +7 -7
- package/dist/plugin/websearch/index.js +8 -8
- package/dist/plugin/websearch/mcp.js +3 -3
- package/dist/plugin/websearch/parallel.js +7 -7
- package/dist/plugin/websearch/tavily.js +4 -4
- package/dist/plugin/websearch/tinyfish.js +7 -7
- package/dist/plugin.js +172 -172
- package/dist/project.js +57 -57
- package/dist/provider.js +71 -71
- package/dist/pty.js +62 -62
- package/dist/reference/instructions.js +64 -64
- package/dist/reference.js +66 -66
- package/dist/repository-cache.js +58 -58
- package/dist/ripgrep.js +63 -63
- package/dist/rpc.js +59 -59
- package/dist/session/command.js +52 -52
- package/dist/session/compaction.js +97 -97
- package/dist/session/context.js +114 -114
- package/dist/session/diff.js +58 -58
- package/dist/session/environment.js +5 -5
- package/dist/session/error.js +4 -4
- package/dist/session/execution/restart.js +111 -111
- package/dist/session/execution.js +96 -96
- package/dist/session/generate.js +113 -113
- package/dist/session/history.js +6 -6
- package/dist/session/inbox.js +61 -61
- package/dist/session/info.js +2 -2
- package/dist/session/instruction-entry.js +55 -55
- package/dist/session/instruction-state.js +2 -2
- package/dist/session/instructions.js +67 -67
- package/dist/session/message-updater.js +3 -3
- package/dist/session/model-request.js +86 -86
- package/dist/session/model-transport.js +7 -7
- package/dist/session/move.js +97 -97
- package/dist/session/projector.js +58 -58
- package/dist/session/prompt.js +73 -73
- package/dist/session/provider-context.js +3 -3
- package/dist/session/revert.js +59 -59
- package/dist/session/run-coordinator.js +3 -3
- package/dist/session/runner/index.js +3 -3
- package/dist/session/runner/llm.js +176 -176
- package/dist/session/runner/model.js +68 -68
- package/dist/session/runner/publish-llm-event.js +81 -81
- package/dist/session/runner/retry.js +3 -3
- package/dist/session/runner/step.js +92 -92
- package/dist/session/runner/to-llm-message.js +2 -2
- package/dist/session/schema.js +5 -5
- package/dist/session/session.js +126 -126
- package/dist/session/shell.js +93 -93
- package/dist/session/skill.js +72 -72
- package/dist/session/stats.js +8 -8
- package/dist/session/store.js +61 -61
- package/dist/session/subagent-job.js +159 -159
- package/dist/session/system-prompt.js +3 -3
- package/dist/session/title.js +117 -117
- package/dist/session/to-session-error.js +80 -80
- package/dist/session/transfer.js +108 -108
- package/dist/session.js +170 -170
- package/dist/shell/parse.js +3 -3
- package/dist/shell/select.js +11 -11
- package/dist/shell.js +96 -96
- package/dist/skill/discovery.js +5 -5
- package/dist/skill/instructions.js +76 -76
- package/dist/skill.js +77 -77
- package/dist/snapshot.js +65 -65
- package/dist/tool/mcp.js +89 -89
- package/dist/tool/plugin/edit.js +84 -84
- package/dist/tool/plugin/glob.js +87 -87
- package/dist/tool/plugin/grep.js +87 -87
- package/dist/tool/plugin/mcp-resource.js +82 -82
- package/dist/tool/plugin/opencode.js +76 -76
- package/dist/tool/plugin/patch.js +84 -84
- package/dist/tool/plugin/question.js +74 -74
- package/dist/tool/plugin/read.js +87 -87
- package/dist/tool/plugin/shell.js +167 -167
- package/dist/tool/plugin/skill.js +80 -80
- package/dist/tool/plugin/subagent.js +168 -168
- package/dist/tool/plugin/webfetch.js +75 -75
- package/dist/tool/plugin/websearch.js +83 -83
- package/dist/tool/plugin/write.js +86 -86
- package/dist/tool/read-filesystem.js +66 -66
- package/dist/tool-output.js +5 -5
- package/dist/tool.js +9 -9
- package/dist/types/session/history.d.ts +32 -0
- package/dist/types/session/transfer.d.ts +19 -0
- package/dist/v1/config/command.js +3 -3
- package/dist/v1/config/mcp.js +3 -3
- package/dist/v1/config/migrate.js +61 -61
- package/dist/v1/config/plugin.js +3 -3
- package/dist/v1/config/provider.js +3 -3
- package/dist/variant.js +63 -63
- package/dist/vcs.js +59 -59
- package/dist/websearch.js +62 -62
- package/dist/wellknown/plugin.js +55 -55
- package/dist/wellknown.js +58 -58
- package/dist/workspace/driver.js +7 -7
- package/dist/workspace.js +57 -57
- package/dist/worktree/git.js +6 -6
- package/dist/worktree/strategies.js +60 -60
- package/dist/worktree.js +66 -66
- package/package.json +8 -8
- package/dist/chunks/location-350gfnr7.js +0 -26
- package/dist/chunks/location-xzkm26z5.js +0 -253
- /package/dist/chunks/{location-y8dg3yja.js → location-08mjp3pt.js} +0 -0
- /package/dist/chunks/{location-kerhshr9.js → location-0t098hqn.js} +0 -0
- /package/dist/chunks/{location-c0gy5km3.js → location-3xqh13de.js} +0 -0
- /package/dist/chunks/{location-5camtqdd.js → location-w0pdyb55.js} +0 -0
|
@@ -1,50 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./location-
|
|
2
|
+
Service83,
|
|
3
|
+
node87
|
|
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-
|
|
11
|
+
} from "./location-addxnjmp.js";
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./location-
|
|
13
|
+
ID14,
|
|
14
|
+
Service77,
|
|
15
|
+
node81,
|
|
16
|
+
Event18
|
|
17
|
+
} from "./location-2fpnaz5h.js";
|
|
18
18
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from "./location-
|
|
19
|
+
Service80,
|
|
20
|
+
node84
|
|
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, {
|
|
38
29
|
AISDK_PREFIX: () => AISDK_PREFIX2,
|
|
39
30
|
Compaction: () => Compaction3,
|
|
40
31
|
DEFAULT_TIMEOUT_MS: () => DEFAULT_TIMEOUT_MS3,
|
|
41
|
-
Event: () =>
|
|
42
|
-
ID: () =>
|
|
43
|
-
Info: () =>
|
|
32
|
+
Event: () => Event17,
|
|
33
|
+
ID: () => ID13,
|
|
34
|
+
Info: () => Info22,
|
|
44
35
|
LoadError: () => LoadError3,
|
|
45
36
|
Provider: () => exports_provider3,
|
|
46
|
-
Request: () =>
|
|
47
|
-
Service: () =>
|
|
37
|
+
Request: () => Request3,
|
|
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: () =>
|
|
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,8 +59,270 @@ 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";
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
324
|
+
import { Event as Event17 } from "@opencode/schema/provider";
|
|
325
|
+
var ID13 = Provider.ID;
|
|
73
326
|
var AISDK_PREFIX2 = "aisdk:";
|
|
74
327
|
var isAISDK2 = (value) => value?.startsWith(AISDK_PREFIX2) ?? false;
|
|
75
328
|
var aisdk2 = (value) => isAISDK2(value) ? value : `${AISDK_PREFIX2}${value}`;
|
|
@@ -80,12 +333,12 @@ function packageName2(value) {
|
|
|
80
333
|
return value;
|
|
81
334
|
return value.slice(AISDK_PREFIX2.length);
|
|
82
335
|
}
|
|
83
|
-
var JsonRecord =
|
|
84
|
-
var decodeJsonRecord =
|
|
336
|
+
var JsonRecord = Schema2.Record(Schema2.String, Schema2.Json);
|
|
337
|
+
var decodeJsonRecord = Schema2.decodeUnknownSync(JsonRecord);
|
|
85
338
|
|
|
86
|
-
class LoadError3 extends
|
|
87
|
-
package:
|
|
88
|
-
cause:
|
|
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 =
|
|
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*
|
|
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(
|
|
189
|
-
const entrypoint = yield*
|
|
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
|
|
451
|
+
return Struct2.omit(settings, CORE_KEYS);
|
|
199
452
|
}
|
|
200
453
|
function modelSettings2(settings) {
|
|
201
|
-
return settings &&
|
|
454
|
+
return settings && Struct2.omit(settings, PROVIDER_ONLY_KEYS);
|
|
202
455
|
}
|
|
203
|
-
var decodeTimeout =
|
|
456
|
+
var decodeTimeout = Schema2.decodeUnknownOption(HttpTimeout);
|
|
204
457
|
var DEFAULT_TIMEOUT_MS3 = 300000;
|
|
205
458
|
function timeout2(value) {
|
|
206
|
-
return
|
|
459
|
+
return Option2.getOrUndefined(decodeTimeout(value));
|
|
207
460
|
}
|
|
208
461
|
function timeouts2(settings) {
|
|
209
462
|
return {
|
|
@@ -237,13 +490,13 @@ function mergeHeaders2(base, overlay) {
|
|
|
237
490
|
return result;
|
|
238
491
|
}, new Map).values());
|
|
239
492
|
}
|
|
240
|
-
var
|
|
493
|
+
var Request3 = Provider.Request;
|
|
241
494
|
var Compaction3 = Provider.Compaction;
|
|
242
495
|
var Transport2 = Provider.Transport;
|
|
243
496
|
var Settings2 = Provider.Settings;
|
|
244
|
-
var
|
|
497
|
+
var Info22 = Provider.Info;
|
|
245
498
|
|
|
246
|
-
class
|
|
499
|
+
class Service76 extends Context.Service()("@opencode/Provider") {
|
|
247
500
|
}
|
|
248
501
|
var definitions = new WeakMap;
|
|
249
502
|
function index(providerID, models) {
|
|
@@ -256,10 +509,10 @@ function index(providerID, models) {
|
|
|
256
509
|
definitions.set(models, indexes);
|
|
257
510
|
return result;
|
|
258
511
|
}
|
|
259
|
-
var layer = Layer.effect(
|
|
260
|
-
const bus = yield*
|
|
261
|
-
const integrations = yield*
|
|
262
|
-
const location = yield*
|
|
512
|
+
var layer = Layer.effect(Service76, Effect2.gen(function* () {
|
|
513
|
+
const bus = yield* Service83;
|
|
514
|
+
const integrations = yield* Service77;
|
|
515
|
+
const location = yield* Service80;
|
|
263
516
|
const state = create3({
|
|
264
517
|
name: "provider",
|
|
265
518
|
initial: () => new Map,
|
|
@@ -270,7 +523,7 @@ var layer = Layer.effect(Service64, Effect.gen(function* () {
|
|
|
270
523
|
const current = records.get(id);
|
|
271
524
|
if (current)
|
|
272
525
|
return current;
|
|
273
|
-
const added = { provider:
|
|
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(Service64, Effect.gen(function* () {
|
|
|
338
591
|
},
|
|
339
592
|
notify: () => notify
|
|
340
593
|
});
|
|
341
|
-
yield*
|
|
594
|
+
yield* Effect2.addFinalizer(() => shutdown2(state.reload()));
|
|
342
595
|
let cached;
|
|
343
|
-
const snapshot =
|
|
596
|
+
const snapshot = Effect2.fn("Provider.snapshot")(function* () {
|
|
344
597
|
while (true) {
|
|
345
598
|
const revision = integrations.revision();
|
|
346
599
|
const records = state.get();
|
|
@@ -351,7 +604,7 @@ var layer = Layer.effect(Service64, Effect.gen(function* () {
|
|
|
351
604
|
const available = Array.from(records.values()).filter((record) => {
|
|
352
605
|
if (record.provider.activation === "disabled")
|
|
353
606
|
return false;
|
|
354
|
-
const integration = byID.get(record.provider.integrationID ??
|
|
607
|
+
const integration = byID.get(record.provider.integrationID ?? ID14.make(record.provider.id));
|
|
355
608
|
if (record.sourceConnection && key2(record.sourceConnection) !== key2(integration?.connections[0]))
|
|
356
609
|
return false;
|
|
357
610
|
if (record.provider.activation === "enabled")
|
|
@@ -368,7 +621,7 @@ var layer = Layer.effect(Service64, Effect.gen(function* () {
|
|
|
368
621
|
}
|
|
369
622
|
});
|
|
370
623
|
let published;
|
|
371
|
-
const notify =
|
|
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(Service64, Effect.gen(function* () {
|
|
|
377
630
|
location: { directory: location.directory, workspaceID: location.workspaceID }
|
|
378
631
|
});
|
|
379
632
|
});
|
|
380
|
-
yield* bus.subscribe([
|
|
381
|
-
return
|
|
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:
|
|
385
|
-
all:
|
|
386
|
-
available:
|
|
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
|
|
391
|
-
var importPackage =
|
|
392
|
-
const module = yield*
|
|
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
|
-
|
|
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, ID9, AISDK_PREFIX2, isAISDK2, aisdk2, packageName2, LoadError3, loadPackage2, nativeSettings2, modelSettings2, DEFAULT_TIMEOUT_MS3, timeout2, timeouts2, mergeOverlay2, mergeHeaders2, Request2, Compaction3, Transport2, Settings2, Info18, Service64, node68, exports_provider3, Event15 };
|
|
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 };
|