claude-code-best 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -75
- package/dist/chunk-03hxwxzh.js +344 -0
- package/dist/chunk-07069jq1.js +30 -0
- package/dist/{chunk-kq098bkj.js → chunk-08g51x43.js} +254 -320
- package/dist/{chunk-7tqhx6dr.js → chunk-093r60b7.js} +109 -213
- package/dist/{chunk-ahjgghpe.js → chunk-0aya4737.js} +1 -1
- package/dist/{chunk-b4mnbry0.js → chunk-0fsdxz74.js} +4 -4
- package/dist/chunk-0jzdwbdc.js +14 -0
- package/dist/chunk-0mbxeb5q.js +406 -0
- package/dist/chunk-0pryepme.js +66 -0
- package/dist/chunk-0qsm7jac.js +169 -0
- package/dist/{chunk-1cbn5kxf.js → chunk-0rpb2bdp.js} +3 -2
- package/dist/chunk-0se7sxd4.js +38 -0
- package/dist/{chunk-3m7ge6tj.js → chunk-0xnepnph.js} +14 -12
- package/dist/{chunk-q7tvkc86.js → chunk-0zsam7pn.js} +10 -115
- package/dist/{chunk-44fpr6jq.js → chunk-168xb8v1.js} +4 -2
- package/dist/{chunk-bj0rvnjw.js → chunk-19h3a9pw.js} +40 -30
- package/dist/chunk-19wjkpe7.js +115 -0
- package/dist/{chunk-wsqhnjj3.js → chunk-1atfzck5.js} +24 -24
- package/dist/{chunk-0e1xsncc.js → chunk-1cwdhk7a.js} +1 -1
- package/dist/{chunk-c8jv6rtj.js → chunk-1hq59w8z.js} +78 -69
- package/dist/chunk-1qzk963z.js +108 -0
- package/dist/{chunk-fk06pejm.js → chunk-1rrmvwjn.js} +9 -9
- package/dist/{chunk-d18z9pna.js → chunk-1thgdca1.js} +2 -2
- package/dist/chunk-1tjnmcw7.js +68 -0
- package/dist/chunk-1xj83yc8.js +219 -0
- package/dist/chunk-21j2jfen.js +435 -0
- package/dist/{chunk-wc6wwwyb.js → chunk-21z7acxh.js} +3 -3
- package/dist/chunk-22gbbc5x.js +313 -0
- package/dist/chunk-238g70xa.js +1 -1
- package/dist/{chunk-vpb723tx.js → chunk-23ad5t92.js} +5 -5
- package/dist/{chunk-vbbf707n.js → chunk-24r3gfks.js} +39 -29
- package/dist/chunk-24sahbec.js +71 -0
- package/dist/chunk-28az45r7.js +112 -0
- package/dist/{chunk-9g827w4j.js → chunk-2q39ej51.js} +6 -6
- package/dist/chunk-2qwgfjcj.js +5370 -0
- package/dist/{chunk-0cpnzx7t.js → chunk-2rgvd09y.js} +118 -151
- package/dist/chunk-2wq8q15s.js +475 -0
- package/dist/{chunk-bqq4zamw.js → chunk-2ys5wcxk.js} +3 -3
- package/dist/{chunk-t24ytdcw.js → chunk-31nce7eh.js} +12 -10
- package/dist/chunk-31q6p2ke.js +123 -0
- package/dist/chunk-3394wc12.js +1024 -0
- package/dist/{chunk-33khw5gy.js → chunk-365zvqv3.js} +7 -7
- package/dist/{chunk-9g2ncq68.js → chunk-36gkb95k.js} +124 -128
- package/dist/{chunk-khdjg2v9.js → chunk-37y42ayh.js} +39 -29
- package/dist/chunk-3816xd5p.js +195 -0
- package/dist/chunk-3a6bynts.js +656 -0
- package/dist/{chunk-qvd0k5dn.js → chunk-3avfhw6x.js} +190 -348
- package/dist/{chunk-660kcy7p.js → chunk-3b25ycrx.js} +14 -8
- package/dist/chunk-3b4xhwhp.js +113 -0
- package/dist/chunk-3fjzvf0e.js +128 -0
- package/dist/chunk-3fvc0a79.js +67 -0
- package/dist/chunk-3g50kcwk.js +513 -0
- package/dist/chunk-3jnmy0nd.js +114 -0
- package/dist/chunk-3jzsxj3v.js +310 -0
- package/dist/{chunk-frbv3xqa.js → chunk-3mpfxbab.js} +2 -2
- package/dist/{chunk-aqa7w38f.js → chunk-3v03e2kz.js} +5 -5
- package/dist/chunk-3x5hdd5g.js +1030 -0
- package/dist/{chunk-mecs0gpc.js → chunk-3xv7rjsy.js} +14 -11
- package/dist/{chunk-j3215c49.js → chunk-3ygnhge8.js} +232 -372
- package/dist/chunk-42x5tjk2.js +42 -0
- package/dist/chunk-430tvx8d.js +110 -0
- package/dist/{chunk-dh6c8y1j.js → chunk-43h8sw5x.js} +3 -3
- package/dist/chunk-44d150tz.js +1175 -0
- package/dist/chunk-45dj834r.js +115 -0
- package/dist/{chunk-yhd82045.js → chunk-46fcr28b.js} +30 -9
- package/dist/{chunk-wm2f2f1z.js → chunk-474y75ga.js} +2 -2
- package/dist/{chunk-6fkwz9yk.js → chunk-478rpnqm.js} +8 -8
- package/dist/{chunk-83z0wrnz.js → chunk-47j9e6m2.js} +2 -2
- package/dist/chunk-47wqjw88.js +112 -0
- package/dist/{chunk-v4t6dyyh.js → chunk-4cp6193g.js} +2 -2
- package/dist/chunk-4h102wt5.js +65 -0
- package/dist/{chunk-3mgywd32.js → chunk-4hv90qcz.js} +1 -1
- package/dist/chunk-4k2270je.js +295 -0
- package/dist/{chunk-2wcbcdky.js → chunk-4k842par.js} +5 -5
- package/dist/chunk-4nspekjp.js +69 -0
- package/dist/chunk-4pjqtps4.js +151 -0
- package/dist/chunk-4sehjy27.js +112 -0
- package/dist/{chunk-pgnnrm2v.js → chunk-4t86n23n.js} +21 -17
- package/dist/{chunk-2de1vaxf.js → chunk-4whfjn78.js} +68 -78
- package/dist/{chunk-41mpwc8h.js → chunk-53c9gb9c.js} +19 -15
- package/dist/chunk-53kt8caz.js +122 -0
- package/dist/chunk-5a6ahhvy.js +594 -0
- package/dist/{chunk-12pv5fez.js → chunk-5gbqknz6.js} +10 -8
- package/dist/{chunk-hfzj1m07.js → chunk-5kkvfgzs.js} +14 -5
- package/dist/{chunk-4ycz58wj.js → chunk-5pxygepg.js} +68 -8
- package/dist/{chunk-2w8633e3.js → chunk-5rgbq3kf.js} +61 -100
- package/dist/{chunk-ggqx30m9.js → chunk-5z28bqne.js} +23 -311
- package/dist/{chunk-7ejt5gqq.js → chunk-5z8w2q5k.js} +65 -48
- package/dist/chunk-60k6v40t.js +70 -0
- package/dist/{chunk-p7g7pf3f.js → chunk-61ahbn23.js} +8 -6
- package/dist/{chunk-rmbp2das.js → chunk-64pp4hsr.js} +21 -19
- package/dist/{chunk-0sb5scxx.js → chunk-652wnf1z.js} +5 -5
- package/dist/{chunk-q25bjaev.js → chunk-677as3nh.js} +2 -2
- package/dist/{chunk-xs0hwvpa.js → chunk-68pfxvxt.js} +14 -9
- package/dist/{chunk-epmheefa.js → chunk-69hys77v.js} +8 -8
- package/dist/{chunk-427m88ms.js → chunk-6p1cptq5.js} +9 -9
- package/dist/{chunk-0nqrscrr.js → chunk-6p3mtny2.js} +5 -5
- package/dist/{chunk-v1mgv1et.js → chunk-6p4cyhb3.js} +4 -3
- package/dist/{chunk-m17y8b22.js → chunk-6rxz872v.js} +39 -29
- package/dist/chunk-6sjxvthw.js +106 -0
- package/dist/{chunk-6mz58s8p.js → chunk-6xana182.js} +18 -14
- package/dist/{chunk-vaebptnz.js → chunk-6zn3fm1k.js} +39 -29
- package/dist/chunk-704jkbsp.js +183 -0
- package/dist/chunk-71sf47by.js +154 -0
- package/dist/chunk-73a5g713.js +78 -0
- package/dist/chunk-78p7h20f.js +259 -0
- package/dist/chunk-7a3b1d4s.js +75 -0
- package/dist/{chunk-fpf4cgbt.js → chunk-7bfach0x.js} +9 -9
- package/dist/{chunk-ckcagq32.js → chunk-7gqf9wej.js} +5 -5
- package/dist/{chunk-sa7nc0vv.js → chunk-7y25wk51.js} +1 -1
- package/dist/{chunk-vyd8jzde.js → chunk-81v55vtd.js} +96 -85
- package/dist/{chunk-dv1wfr85.js → chunk-8225arm6.js} +5 -4
- package/dist/chunk-86715d2d.js +186 -0
- package/dist/chunk-8ah9easf.js +365 -0
- package/dist/{chunk-rwexx5ns.js → chunk-8baq1s87.js} +1 -3
- package/dist/chunk-8fy8hx84.js +386 -0
- package/dist/{chunk-4pbx3g7s.js → chunk-8g747a8x.js} +1 -1
- package/dist/{chunk-xyqr1cww.js → chunk-8me0yq6v.js} +12 -12
- package/dist/{chunk-sdj9b9wh.js → chunk-8pn8tvgg.js} +9 -154
- package/dist/chunk-8qxyxgkb.js +161 -0
- package/dist/{chunk-ecsw41df.js → chunk-8xs4yp9x.js} +85 -77
- package/dist/{chunk-24x87knx.js → chunk-9000dg9h.js} +1327 -2882
- package/dist/{chunk-bmvb57qb.js → chunk-905d2hee.js} +5 -5
- package/dist/chunk-90qsc60s.js +378 -0
- package/dist/chunk-92x6xgex.js +265 -0
- package/dist/{chunk-jknt3rxg.js → chunk-9ctg4x6c.js} +7 -9
- package/dist/chunk-9e4z7dx7.js +389 -0
- package/dist/chunk-9hy6ejmp.js +151 -0
- package/dist/chunk-9jvggd30.js +173 -0
- package/dist/{chunk-z9tgzh90.js → chunk-9m729tsn.js} +46 -35
- package/dist/chunk-9r90d3jt.js +121 -0
- package/dist/chunk-9rx2m3cb.js +124 -0
- package/dist/chunk-9sr2etaw.js +110 -0
- package/dist/chunk-9z8hzgve.js +68 -0
- package/dist/{chunk-yxnwsp4f.js → chunk-9zy607vw.js} +8 -6
- package/dist/chunk-a0bz6g5e.js +63 -0
- package/dist/chunk-a136cvvz.js +27 -0
- package/dist/{chunk-n5t9m8h9.js → chunk-a1bjde7d.js} +7 -7
- package/dist/{chunk-mvss16tj.js → chunk-a2aj2mtb.js} +414 -636
- package/dist/{chunk-8hsyagr8.js → chunk-a3sfy6as.js} +1 -1
- package/dist/{chunk-8hq5kk3y.js → chunk-a4twdmhf.js} +3 -2
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-aegyxcne.js +111 -0
- package/dist/chunk-aj1dcvrh.js +131 -0
- package/dist/{chunk-1yabrspp.js → chunk-amxm6996.js} +2 -2
- package/dist/{chunk-t6h4wf3k.js → chunk-ar39mr9c.js} +11 -11
- package/dist/{chunk-r6b58y3x.js → chunk-ase86y73.js} +1 -3
- package/dist/chunk-asfxrz4f.js +94 -0
- package/dist/chunk-axj46c2c.js +196 -0
- package/dist/{chunk-m5eb5pt2.js → chunk-ayz6f38j.js} +6 -6
- package/dist/{chunk-5b7119h5.js → chunk-b00zd850.js} +8 -6
- package/dist/chunk-b2abjkf7.js +126 -0
- package/dist/{chunk-8bedvdm1.js → chunk-b81hd3m6.js} +1 -1
- package/dist/chunk-bcfd2zw7.js +20 -0
- package/dist/{chunk-n5516f5q.js → chunk-bd8zk9tn.js} +4 -4
- package/dist/chunk-bhdt6k7w.js +15 -0
- package/dist/{chunk-jy35mvy3.js → chunk-bmjmrk76.js} +7 -7
- package/dist/chunk-bqaqz1j1.js +126 -0
- package/dist/chunk-bsbmmfyt.js +17 -0
- package/dist/{chunk-snvypj85.js → chunk-bt64sq5y.js} +3 -2
- package/dist/{chunk-zq9xa1xe.js → chunk-bwevztsj.js} +109 -141
- package/dist/{chunk-vyc0rjyx.js → chunk-bwg7582d.js} +1 -1
- package/dist/{chunk-3be7ka25.js → chunk-bxcfz5gy.js} +1 -1
- package/dist/chunk-c2mn2fyg.js +1406 -0
- package/dist/chunk-c2tw0dep.js +1811 -0
- package/dist/{chunk-402jrnj6.js → chunk-c5bngssh.js} +8 -8
- package/dist/chunk-c6sjhj89.js +1284 -0
- package/dist/chunk-cb2hpe6k.js +443 -0
- package/dist/{chunk-91r0z5qq.js → chunk-ccr1s7qs.js} +1152 -1771
- package/dist/chunk-cewqh6rb.js +111 -0
- package/dist/{chunk-k9a8jemz.js → chunk-cg01f3ez.js} +7 -7
- package/dist/{chunk-f64npa3b.js → chunk-chsyvavm.js} +704 -4
- package/dist/{chunk-z8nbjar4.js → chunk-cmcbatgz.js} +7 -5
- package/dist/chunk-cnsj3vq2.js +35 -0
- package/dist/{chunk-rj86xm6z.js → chunk-cpwe0yw7.js} +1 -1
- package/dist/chunk-cqjmxeqv.js +269 -0
- package/dist/{chunk-qpm1tmzz.js → chunk-crefny3c.js} +125 -193
- package/dist/{chunk-ks0m9njy.js → chunk-d2jekryq.js} +8 -8
- package/dist/chunk-d4mdda98.js +94 -0
- package/dist/{chunk-26wtxbdc.js → chunk-d7886r6a.js} +6928 -6928
- package/dist/chunk-dfkgpfaj.js +135 -0
- package/dist/{chunk-9mfbqw9k.js → chunk-dm3n2qgd.js} +4 -4
- package/dist/chunk-dnj95atq.js +66 -0
- package/dist/{chunk-vjc1svpc.js → chunk-dqgzpb0q.js} +87 -77
- package/dist/chunk-drenq3c7.js +383 -0
- package/dist/chunk-drkm8yx2.js +34 -0
- package/dist/{chunk-ra8fbt9p.js → chunk-dvjzq9x9.js} +543 -874
- package/dist/{chunk-w7h2yphx.js → chunk-dwekpr47.js} +2 -2
- package/dist/{chunk-49k5ktrj.js → chunk-e18dg1md.js} +31 -16
- package/dist/chunk-e396ak46.js +111 -0
- package/dist/{chunk-r55r29js.js → chunk-e3c32vwa.js} +191 -276
- package/dist/chunk-e3m7kqkb.js +1185 -0
- package/dist/{chunk-9cc60ae5.js → chunk-ea9m4e0k.js} +79 -70
- package/dist/chunk-ecsa9nd5.js +63 -0
- package/dist/{chunk-cmdsbsb6.js → chunk-edzkkadh.js} +2 -2
- package/dist/chunk-ek1jasqg.js +142 -0
- package/dist/chunk-ep0hwv07.js +126 -0
- package/dist/{chunk-cs6y2pc9.js → chunk-ergam9ft.js} +5 -5
- package/dist/{chunk-ptwn7qw7.js → chunk-f2k8b4nd.js} +38 -10
- package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +8 -1
- package/dist/{chunk-s84smrx4.js → chunk-f32cksgw.js} +155 -190
- package/dist/{chunk-vzqrbsd1.js → chunk-f69rgsm2.js} +5 -5
- package/dist/{chunk-f3bapa1x.js → chunk-f6rbj3gz.js} +12 -7
- package/dist/chunk-f7n3xete.js +113 -0
- package/dist/chunk-fbest4vx.js +109 -0
- package/dist/{chunk-v0wa5ref.js → chunk-fdtcb8qr.js} +13 -555
- package/dist/chunk-feh2j8m2.js +136 -0
- package/dist/chunk-feyzykye.js +10 -0
- package/dist/chunk-fkkysfev.js +158 -0
- package/dist/chunk-fn510gqw.js +216 -0
- package/dist/{chunk-ch53fgm5.js → chunk-ft9qsa01.js} +13 -11
- package/dist/chunk-fw0ckaxh.js +109 -0
- package/dist/{chunk-kd97kxjn.js → chunk-fz0ch109.js} +3 -2
- package/dist/{chunk-ks0dm6t3.js → chunk-fzn524wa.js} +17 -71
- package/dist/chunk-g1k68z1b.js +15 -0
- package/dist/{chunk-9t1x831d.js → chunk-g5nb4xhz.js} +86 -74
- package/dist/chunk-g82mdy27.js +429 -0
- package/dist/{chunk-68qevppc.js → chunk-g8sz060e.js} +82 -72
- package/dist/chunk-g9f19ttm.js +15 -0
- package/dist/{chunk-zz21rvr7.js → chunk-gdqxtdh4.js} +9 -6
- package/dist/chunk-get9fk3h.js +74 -0
- package/dist/{chunk-4x5ym4h2.js → chunk-gf6qjt7j.js} +130 -16
- package/dist/{chunk-bq6x1ehp.js → chunk-gpz0ddyz.js} +8 -8
- package/dist/{chunk-mwp7sj0q.js → chunk-gs5eeqmc.js} +110336 -114801
- package/dist/{chunk-qqfa0dqg.js → chunk-h4b85amj.js} +20 -32
- package/dist/{chunk-j4c8s7tn.js → chunk-h5zv78zq.js} +9 -6
- package/dist/{chunk-cgn27dqf.js → chunk-ha5d5zfj.js} +3 -3
- package/dist/{chunk-crr52hf4.js → chunk-han7cwc0.js} +14 -12
- package/dist/{chunk-dnyeb288.js → chunk-hbv0tk35.js} +74 -106
- package/dist/{chunk-nxsh6de2.js → chunk-hcgkak1j.js} +20 -125
- package/dist/{chunk-224x480q.js → chunk-hd1p4hrd.js} +8 -6
- package/dist/{chunk-tjaqa99q.js → chunk-hezj20qy.js} +3 -3
- package/dist/{chunk-z7pr85qw.js → chunk-hfdyez7b.js} +3 -3
- package/dist/chunk-hh7hqa2c.js +272 -0
- package/dist/chunk-hk4a2sks.js +83 -0
- package/dist/{chunk-5zh1fbrj.js → chunk-hq85v2s7.js} +3 -3
- package/dist/chunk-hr06142m.js +117 -0
- package/dist/chunk-j1b3r6v6.js +66 -0
- package/dist/{chunk-v8xem37v.js → chunk-j2fgn3kq.js} +8 -6
- package/dist/chunk-j2wgj22c.js +441 -0
- package/dist/{chunk-9gbamk79.js → chunk-j5bth84e.js} +5 -1
- package/dist/{chunk-vratq94g.js → chunk-j9gxwbe3.js} +1 -1
- package/dist/{chunk-cettj572.js → chunk-ja87jt56.js} +7 -131
- package/dist/{chunk-3r24h7t6.js → chunk-jaaxk89e.js} +1 -1
- package/dist/{chunk-f4jcw0ea.js → chunk-jaew3662.js} +18 -14
- package/dist/{chunk-e1ge9n4d.js → chunk-jb2nh0m0.js} +2 -2
- package/dist/{chunk-f9b4wb89.js → chunk-jb4fc073.js} +84 -75
- package/dist/chunk-jba8f3hz.js +108 -0
- package/dist/{chunk-er9vzjac.js → chunk-jbt0jgtc.js} +16 -14
- package/dist/{chunk-v399mzxk.js → chunk-jf0p00fz.js} +2 -2
- package/dist/{chunk-vygf94dw.js → chunk-jg4ge4de.js} +78 -69
- package/dist/chunk-jkvy2cmt.js +346 -0
- package/dist/{chunk-80qg1pzv.js → chunk-jmdy5vdy.js} +11 -9
- package/dist/{chunk-dqh7e4mt.js → chunk-jn08nxj8.js} +52 -42
- package/dist/{chunk-av73dywf.js → chunk-jna2tcvj.js} +8 -8
- package/dist/chunk-jwh384j5.js +126 -0
- package/dist/chunk-jwx2scxy.js +222 -0
- package/dist/{chunk-41xeh3t9.js → chunk-jy6c07wa.js} +4 -4
- package/dist/{chunk-ctmt7xh1.js → chunk-jy77nthd.js} +740 -907
- package/dist/{chunk-hzttn8j7.js → chunk-jyjpaqbt.js} +139 -135
- package/dist/chunk-jztjnw31.js +147 -0
- package/dist/chunk-k0jhzcwg.js +2540 -0
- package/dist/{chunk-myzwt5yw.js → chunk-k0kwfqr8.js} +9 -15
- package/dist/{chunk-bqfnp99q.js → chunk-k3s4yk22.js} +1 -1
- package/dist/{chunk-1dyeexvn.js → chunk-kd3mmsd2.js} +4 -4
- package/dist/{chunk-x51h62jq.js → chunk-ke78h68m.js} +78 -69
- package/dist/{chunk-1xkekb9y.js → chunk-kfd89dsd.js} +5 -3
- package/dist/chunk-ksvvwa9w.js +111 -0
- package/dist/{chunk-jy35z4n0.js → chunk-m1z5td19.js} +9 -9
- package/dist/{chunk-jafes477.js → chunk-m2bcpk8j.js} +4 -3
- package/dist/{chunk-n6fbyke9.js → chunk-m2mzpskw.js} +3 -3
- package/dist/{chunk-s2dmn3yg.js → chunk-m47q5mxt.js} +5 -5
- package/dist/{chunk-s7qj2hg5.js → chunk-m8vyp6rw.js} +2 -2
- package/dist/chunk-mm4m13ng.js +881 -0
- package/dist/{chunk-ghr4s9g6.js → chunk-mq1qrwhq.js} +79 -70
- package/dist/{chunk-45e9mkyr.js → chunk-mqqw60br.js} +43 -83
- package/dist/chunk-mtcdknc8.js +2842 -0
- package/dist/{chunk-cvge4pvp.js → chunk-mzd6frw6.js} +2 -2
- package/dist/{chunk-n2874aq5.js → chunk-n1neft0d.js} +13 -7
- package/dist/{chunk-bcrxtdcy.js → chunk-n2mysxn1.js} +40 -30
- package/dist/chunk-n4wkxbq0.js +365 -0
- package/dist/chunk-n57dw6h9.js +128 -0
- package/dist/chunk-n5wf3b82.js +118 -0
- package/dist/{chunk-zgrg0wk3.js → chunk-n7ce94nd.js} +27 -67
- package/dist/{chunk-me2ef6g4.js → chunk-n8mpqdje.js} +1 -1
- package/dist/{chunk-g5sg6y9q.js → chunk-na2e0dfj.js} +82 -72
- package/dist/chunk-netzwgv1.js +154 -0
- package/dist/{chunk-xszk7n10.js → chunk-nh3cd07f.js} +1 -1
- package/dist/{chunk-5tx8dsy0.js → chunk-npjsp3z3.js} +10493 -18453
- package/dist/{chunk-5hva0tsg.js → chunk-p2yv7m0g.js} +6 -6
- package/dist/chunk-p4rmbc1e.js +409 -0
- package/dist/chunk-p7jdncj4.js +122 -0
- package/dist/{chunk-zk2wsm7d.js → chunk-p7vkh4wx.js} +2 -2
- package/dist/{chunk-da4ve9t5.js → chunk-p8crqj70.js} +10 -10
- package/dist/{chunk-hy3g1nv8.js → chunk-prw4xz5q.js} +9 -7
- package/dist/{chunk-zsfxha74.js → chunk-pshjyzq4.js} +8 -7
- package/dist/{chunk-684kdqez.js → chunk-q08sb44h.js} +203 -304
- package/dist/{chunk-n7158r58.js → chunk-q78bgdtk.js} +79 -70
- package/dist/{chunk-e5pntxye.js → chunk-q7tpyeb3.js} +6 -4
- package/dist/{chunk-7ymfj7m3.js → chunk-q82r31er.js} +1 -1
- package/dist/chunk-qajrkk97.js +298 -0
- package/dist/chunk-qbrsmra3.js +23 -0
- package/dist/chunk-qhfn4vgv.js +66 -0
- package/dist/{chunk-d7mx1phm.js → chunk-qndzvkdx.js} +61 -103
- package/dist/{chunk-35y0r56v.js → chunk-qtfc6wdh.js} +1 -4
- package/dist/{chunk-v9y80148.js → chunk-qwcnwn5t.js} +100 -191
- package/dist/chunk-qwehvedn.js +440 -0
- package/dist/{chunk-2cgdr2n7.js → chunk-qwk9fq7r.js} +78 -69
- package/dist/chunk-qy75c2vm.js +70 -0
- package/dist/{chunk-rryx19hp.js → chunk-r2k2jy0y.js} +2 -2
- package/dist/chunk-r47p0ff0.js +61 -0
- package/dist/{chunk-t3bf8hcf.js → chunk-r5tk54yt.js} +2 -2
- package/dist/{chunk-bt9krt49.js → chunk-r8q993g6.js} +38 -32
- package/dist/{chunk-veb0gkcf.js → chunk-ra2rykps.js} +78 -69
- package/dist/{chunk-gbcqdr0x.js → chunk-rav5xp8h.js} +1 -1
- package/dist/chunk-rbe0tcn9.js +120 -0
- package/dist/chunk-rd5cfz3k.js +68 -0
- package/dist/{chunk-cenpqc2t.js → chunk-rdvaan98.js} +8 -6
- package/dist/{chunk-dr4qq42x.js → chunk-rgbbtszq.js} +9 -9
- package/dist/chunk-rjsb9s3q.js +206 -0
- package/dist/{chunk-fdwa7gem.js → chunk-rkak3kjw.js} +7 -7
- package/dist/{chunk-a6s8wnhe.js → chunk-rnam0xc5.js} +4 -4
- package/dist/chunk-rqkqbppr.js +112 -0
- package/dist/{chunk-ye18m1zb.js → chunk-rqvqqrpg.js} +38 -8
- package/dist/{chunk-rw466wqn.js → chunk-rvkvehat.js} +5284 -3093
- package/dist/chunk-s1baskk7.js +14 -0
- package/dist/{chunk-jt0pha6y.js → chunk-s5gnvx67.js} +227 -198
- package/dist/chunk-s7dtt7tw.js +109 -0
- package/dist/chunk-s9ftt1fh.js +135 -0
- package/dist/chunk-sc6sy490.js +240 -0
- package/dist/chunk-sh9er84d.js +1073 -0
- package/dist/{chunk-faycqscv.js → chunk-sk9xag9g.js} +2 -2
- package/dist/{chunk-zpc0kwkb.js → chunk-t0g8wbcq.js} +7 -7
- package/dist/chunk-tbgm1v8n.js +146 -0
- package/dist/{chunk-35b0ek0j.js → chunk-tcdv4gp8.js} +13 -9
- package/dist/{chunk-mt25echc.js → chunk-tezak8rx.js} +1 -1
- package/dist/chunk-thk6yn51.js +154 -0
- package/dist/{chunk-s2gm9vfk.js → chunk-tkf24yhv.js} +7 -7
- package/dist/{chunk-6td4c2eq.js → chunk-tkrjcekq.js} +54 -72
- package/dist/{chunk-9rcbyag3.js → chunk-tmdbrszg.js} +2 -2
- package/dist/chunk-tw2g1yhq.js +118 -0
- package/dist/chunk-twzjxwhf.js +182 -0
- package/dist/{chunk-m94pnhfa.js → chunk-v4e4f711.js} +39 -29
- package/dist/{chunk-b51jjfh5.js → chunk-v5k7zmqm.js} +43 -32
- package/dist/chunk-var1et7e.js +66 -0
- package/dist/chunk-vd11xbz3.js +304 -0
- package/dist/{chunk-hqmz36b3.js → chunk-vf612n57.js} +21 -101
- package/dist/chunk-vfhqj46w.js +144 -0
- package/dist/chunk-vkxx8ymr.js +2377 -0
- package/dist/{chunk-n9x557ea.js → chunk-vs094cby.js} +2332 -4220
- package/dist/{chunk-dxc7begm.js → chunk-vtb8z6as.js} +14 -10
- package/dist/{chunk-x51mdzqq.js → chunk-vzd3cjy9.js} +3 -3
- package/dist/chunk-w2es9743.js +439 -0
- package/dist/{chunk-8z039kef.js → chunk-w92b262y.js} +53 -54
- package/dist/chunk-wa1dpga1.js +236 -0
- package/dist/{chunk-qf2v384j.js → chunk-wbmacbfb.js} +9 -7
- package/dist/{chunk-ryj80g9p.js → chunk-wbn46nb4.js} +136 -178
- package/dist/{chunk-t9z6njcr.js → chunk-wtycm8km.js} +9 -9
- package/dist/{chunk-q6rax9kh.js → chunk-wymtgh88.js} +5 -5
- package/dist/{chunk-pa7saazk.js → chunk-x0aj8rh8.js} +28 -56
- package/dist/{chunk-1szr63w0.js → chunk-x69w7xr7.js} +86 -74
- package/dist/{chunk-k5gdea6r.js → chunk-x6qmm22r.js} +84 -75
- package/dist/{chunk-zrse3zpz.js → chunk-xbprynsc.js} +18 -46
- package/dist/chunk-xc0v11v6.js +914 -0
- package/dist/chunk-xed18bb5.js +233 -0
- package/dist/{chunk-gjyc3293.js → chunk-xj76qk4z.js} +288 -499
- package/dist/chunk-xmd9eezd.js +83 -0
- package/dist/chunk-xrzrbw0f.js +142 -0
- package/dist/{chunk-fzxg8v1y.js → chunk-xycy3c8q.js} +15 -12
- package/dist/chunk-y0m0rd5v.js +140 -0
- package/dist/chunk-y2vtmzre.js +137 -0
- package/dist/{chunk-vybkxr18.js → chunk-y5z1cjbk.js} +42 -32
- package/dist/chunk-y60q54ph.js +111 -0
- package/dist/{chunk-d7vv2ydf.js → chunk-y78t50v0.js} +2 -2
- package/dist/{chunk-xkr7as9h.js → chunk-y9bgt2k1.js} +13 -9
- package/dist/chunk-ycwdzwz5.js +233 -0
- package/dist/chunk-yfyc2y1v.js +136 -0
- package/dist/chunk-yg6gtf9j.js +152 -0
- package/dist/{chunk-kyer92r4.js → chunk-yk8vcecd.js} +33 -5
- package/dist/{chunk-hkn7tzgv.js → chunk-ym5r3jnk.js} +1 -1
- package/dist/chunk-yr6gqw17.js +132 -0
- package/dist/chunk-yw62vhjz.js +445 -0
- package/dist/{chunk-athjeyrt.js → chunk-yw79dz62.js} +4 -4
- package/dist/{chunk-5mrhhmas.js → chunk-yx64nmbh.js} +8 -5
- package/dist/chunk-yy232vtj.js +84 -0
- package/dist/chunk-z1bs6d7k.js +24 -0
- package/dist/chunk-z4mgvsdj.js +456 -0
- package/dist/chunk-z6e5jp2w.js +119 -0
- package/dist/{chunk-t7cbhqd2.js → chunk-z6zt2ns7.js} +111 -123
- package/dist/chunk-z735r3p2.js +114 -0
- package/dist/{chunk-rjz6btwk.js → chunk-z7ssqvt6.js} +4972 -4638
- package/dist/{chunk-bpts9jbq.js → chunk-z8nv1ah0.js} +39 -31
- package/dist/chunk-z9mbssbe.js +128 -0
- package/dist/chunk-zdctabq6.js +264 -0
- package/dist/{chunk-ve60fbtd.js → chunk-ze6zvkg6.js} +2 -2
- package/dist/{chunk-t0rgmccj.js → chunk-zejm280k.js} +1 -1
- package/dist/{chunk-krstc7m7.js → chunk-zfapazzd.js} +15 -11
- package/dist/{chunk-2j0j79p0.js → chunk-zg4ae27v.js} +8 -8
- package/dist/chunk-zqxe8qnw.js +3590 -0
- package/dist/{chunk-q6dpqj3z.js → chunk-zs2ddzfv.js} +10 -7
- package/dist/chunk-zy80g72r.js +512 -0
- package/dist/{chunk-g3t0act8.js → chunk-zzm33q8x.js} +1 -1
- package/dist/{chunk-s8fzxy94.js → chunk-zzzc1ead.js} +17 -13
- package/dist/cli.js +63 -11
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/package.json +8 -5
- package/scripts/postinstall.cjs +319 -0
- package/dist/chunk-0291smg3.js +0 -42
- package/dist/chunk-04g2ty3v.js +0 -104
- package/dist/chunk-069x95ne.js +0 -764
- package/dist/chunk-06x02eab.js +0 -655
- package/dist/chunk-09pjmga5.js +0 -713
- package/dist/chunk-0g90je6r.js +0 -145
- package/dist/chunk-0paqc2yw.js +0 -15
- package/dist/chunk-0rddv9vb.js +0 -328
- package/dist/chunk-162w6yv3.js +0 -756
- package/dist/chunk-1gjbaa3n.js +0 -128
- package/dist/chunk-23wg4mnt.js +0 -404
- package/dist/chunk-2gbjtg7c.js +0 -102
- package/dist/chunk-2v1q0ezq.js +0 -102
- package/dist/chunk-37n7jkxe.js +0 -436
- package/dist/chunk-38svjnh4.js +0 -158
- package/dist/chunk-3bg1089y.js +0 -616
- package/dist/chunk-3d8ck5ne.js +0 -112
- package/dist/chunk-3g6rf9sz.js +0 -106
- package/dist/chunk-3x3rr2n5.js +0 -57
- package/dist/chunk-4f6q3d38.js +0 -117
- package/dist/chunk-4h57km3m.js +0 -74
- package/dist/chunk-4kyh2618.js +0 -99
- package/dist/chunk-4w9vc9vc.js +0 -119
- package/dist/chunk-53hqpp5z.js +0 -208
- package/dist/chunk-5deqy8r0.js +0 -143
- package/dist/chunk-5m2rmc2k.js +0 -128
- package/dist/chunk-5wp9pkpt.js +0 -539
- package/dist/chunk-5ym9f6w3.js +0 -263
- package/dist/chunk-6f938733.js +0 -1027
- package/dist/chunk-6nenxecd.js +0 -115
- package/dist/chunk-6rja0h86.js +0 -1593
- package/dist/chunk-70q6dp4d.js +0 -96
- package/dist/chunk-7bn0wzs3.js +0 -1493
- package/dist/chunk-7e2e0bfm.js +0 -65
- package/dist/chunk-7ywadnax.js +0 -490
- package/dist/chunk-7z33j54s.js +0 -142
- package/dist/chunk-8yvfkzyh.js +0 -58
- package/dist/chunk-9abpx1kv.js +0 -2833
- package/dist/chunk-9ks2nswb.js +0 -114
- package/dist/chunk-9wrds5tr.js +0 -109
- package/dist/chunk-ab2twken.js +0 -102
- package/dist/chunk-abncjeag.js +0 -97
- package/dist/chunk-am6w4x6y.js +0 -103
- package/dist/chunk-b1xt9jqg.js +0 -28
- package/dist/chunk-b73bd7db.js +0 -496
- package/dist/chunk-bc7nvynh.js +0 -195
- package/dist/chunk-br17dhef.js +0 -103
- package/dist/chunk-c3k0sdey.js +0 -281
- package/dist/chunk-c909bmyv.js +0 -103
- package/dist/chunk-cftsv9w4.js +0 -129
- package/dist/chunk-cj1a7npk.js +0 -99
- package/dist/chunk-cpma9zs5.js +0 -335
- package/dist/chunk-cyscs4k5.js +0 -1330
- package/dist/chunk-czr7y063.js +0 -348
- package/dist/chunk-d93sndem.js +0 -372
- package/dist/chunk-ddz8xbpd.js +0 -481
- package/dist/chunk-dkhqx4hk.js +0 -84
- package/dist/chunk-dsrharmv.js +0 -359
- package/dist/chunk-eqmy5d05.js +0 -56
- package/dist/chunk-f2crxw2c.js +0 -5400
- package/dist/chunk-f8zga40p.js +0 -234
- package/dist/chunk-fbgm2ym6.js +0 -990
- package/dist/chunk-fcbbsswe.js +0 -119
- package/dist/chunk-fda654nt.js +0 -6121
- package/dist/chunk-ffmv9ezj.js +0 -104
- package/dist/chunk-fmjte7md.js +0 -38
- package/dist/chunk-fqtwqxxc.js +0 -293
- package/dist/chunk-g8k85nkd.js +0 -802
- package/dist/chunk-ge4ak7dj.js +0 -127
- package/dist/chunk-gpqemecy.js +0 -126
- package/dist/chunk-h19p6s3b.js +0 -131
- package/dist/chunk-j0sk1rct.js +0 -998
- package/dist/chunk-j1wfpa1a.js +0 -70
- package/dist/chunk-j829fx31.js +0 -3458
- package/dist/chunk-jqctzrvd.js +0 -722
- package/dist/chunk-jx817w05.js +0 -11
- package/dist/chunk-ka6sab33.js +0 -174
- package/dist/chunk-krjsvmwp.js +0 -101
- package/dist/chunk-kvpe50pm.js +0 -311
- package/dist/chunk-mez504fj.js +0 -113
- package/dist/chunk-mj6wbrae.js +0 -105
- package/dist/chunk-n0k8xrey.js +0 -319
- package/dist/chunk-n0pg2kpe.js +0 -122
- package/dist/chunk-n4qtqkp0.js +0 -295
- package/dist/chunk-n9meha2m.js +0 -73
- package/dist/chunk-ndk7q5n3.js +0 -169
- package/dist/chunk-ng6n9t4h.js +0 -56
- package/dist/chunk-p3pz13x2.js +0 -1933
- package/dist/chunk-p9ez6zgq.js +0 -2656
- package/dist/chunk-ph750kx1.js +0 -550
- package/dist/chunk-pxb99zqs.js +0 -117
- package/dist/chunk-q1yqc5n3.js +0 -100
- package/dist/chunk-q5b91nhh.js +0 -40
- package/dist/chunk-qtfqk0jr.js +0 -131
- package/dist/chunk-qzfmdh1t.js +0 -388
- package/dist/chunk-r3cv0j9n.js +0 -456
- package/dist/chunk-rx0pbgym.js +0 -97
- package/dist/chunk-s624rd5j.js +0 -531
- package/dist/chunk-satndwqj.js +0 -285
- package/dist/chunk-ssrxnkd1.js +0 -109
- package/dist/chunk-t2pgctqx.js +0 -106
- package/dist/chunk-t7sgwf31.js +0 -644
- package/dist/chunk-tth904tj.js +0 -53
- package/dist/chunk-typpbjhy.js +0 -128
- package/dist/chunk-vp6nrhdq.js +0 -102
- package/dist/chunk-vtjm53nt.js +0 -432
- package/dist/chunk-w412n7tq.js +0 -469
- package/dist/chunk-w4153rky.js +0 -1885
- package/dist/chunk-wdgv15as.js +0 -212
- package/dist/chunk-wgn9kydv.js +0 -58
- package/dist/chunk-whknbrk0.js +0 -184
- package/dist/chunk-x1k8e1xc.js +0 -56
- package/dist/chunk-x45xx6sc.js +0 -105
- package/dist/chunk-x4xvqbe5.js +0 -1166
- package/dist/chunk-x8b7vft8.js +0 -132
- package/dist/chunk-xaycc8qe.js +0 -44
- package/dist/chunk-xd4785ks.js +0 -73
- package/dist/chunk-xjxgmxhq.js +0 -463
- package/dist/chunk-xx2x3tz9.js +0 -166
- package/dist/chunk-y2j23eem.js +0 -101
- package/dist/chunk-y83j09wv.js +0 -123
- package/dist/chunk-yh8460pb.js +0 -119
- package/dist/chunk-z6nhchdb.js +0 -60
- package/dist/chunk-zbt73sj7.js +0 -192
- package/dist/chunk-zmwaatmq.js +0 -118
- package/dist/chunk-zvdg9tex.js +0 -135
- package/dist/chunk-zwa780cx.js +0 -584
- package/dist/{chunk-whvdag1y.js → chunk-3bfs3x0h.js} +9 -9
- package/dist/{chunk-27xc1csx.js → chunk-dggvswz1.js} +3 -3
|
@@ -0,0 +1,1024 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
init_SSETransport,
|
|
4
|
+
parseSSEFrames
|
|
5
|
+
} from "./chunk-cb2hpe6k.js";
|
|
6
|
+
import {
|
|
7
|
+
createAssistantAPIErrorMessage,
|
|
8
|
+
init_api,
|
|
9
|
+
init_messages1 as init_messages,
|
|
10
|
+
normalizeContentFromAPI,
|
|
11
|
+
normalizeMessagesForAPI,
|
|
12
|
+
toolToAPISchema
|
|
13
|
+
} from "./chunk-gs5eeqmc.js";
|
|
14
|
+
import"./chunk-4nspekjp.js";
|
|
15
|
+
import"./chunk-43h8sw5x.js";
|
|
16
|
+
import"./chunk-zejm280k.js";
|
|
17
|
+
import"./chunk-var1et7e.js";
|
|
18
|
+
import"./chunk-ehtwnxpg.js";
|
|
19
|
+
import"./chunk-m2mzpskw.js";
|
|
20
|
+
import"./chunk-365zvqv3.js";
|
|
21
|
+
import"./chunk-rqvqqrpg.js";
|
|
22
|
+
import"./chunk-5gbqknz6.js";
|
|
23
|
+
import"./chunk-2gzv8nrw.js";
|
|
24
|
+
import"./chunk-cgfdkzhb.js";
|
|
25
|
+
import"./chunk-bxcfz5gy.js";
|
|
26
|
+
import"./chunk-jbt0jgtc.js";
|
|
27
|
+
import"./chunk-ha5d5zfj.js";
|
|
28
|
+
import"./chunk-28az45r7.js";
|
|
29
|
+
import"./chunk-bhdt6k7w.js";
|
|
30
|
+
import"./chunk-f6rbj3gz.js";
|
|
31
|
+
import"./chunk-axj46c2c.js";
|
|
32
|
+
import"./chunk-5pxygepg.js";
|
|
33
|
+
import"./chunk-j5bth84e.js";
|
|
34
|
+
import"./chunk-qndzvkdx.js";
|
|
35
|
+
import"./chunk-5kkvfgzs.js";
|
|
36
|
+
import"./chunk-0jzdwbdc.js";
|
|
37
|
+
import"./chunk-ps49ymvj.js";
|
|
38
|
+
import"./chunk-p7vkh4wx.js";
|
|
39
|
+
import"./chunk-cmcbatgz.js";
|
|
40
|
+
import"./chunk-3b25ycrx.js";
|
|
41
|
+
import"./chunk-yx64nmbh.js";
|
|
42
|
+
import"./chunk-cpwe0yw7.js";
|
|
43
|
+
import"./chunk-y78t50v0.js";
|
|
44
|
+
import"./chunk-4jm600zv.js";
|
|
45
|
+
import"./chunk-n8mpqdje.js";
|
|
46
|
+
import"./chunk-31nce7eh.js";
|
|
47
|
+
import"./chunk-rdvaan98.js";
|
|
48
|
+
import"./chunk-mx28h61f.js";
|
|
49
|
+
import"./chunk-f2k8b4nd.js";
|
|
50
|
+
import"./chunk-sk9xag9g.js";
|
|
51
|
+
import"./chunk-0fsdxz74.js";
|
|
52
|
+
import"./chunk-2qwgfjcj.js";
|
|
53
|
+
import"./chunk-chsyvavm.js";
|
|
54
|
+
import"./chunk-w92b262y.js";
|
|
55
|
+
import"./chunk-a2aj2mtb.js";
|
|
56
|
+
import {
|
|
57
|
+
init_json,
|
|
58
|
+
safeParseJSON
|
|
59
|
+
} from "./chunk-905d2hee.js";
|
|
60
|
+
import"./chunk-rkak3kjw.js";
|
|
61
|
+
import {
|
|
62
|
+
getProxyFetchOptions,
|
|
63
|
+
init_proxy
|
|
64
|
+
} from "./chunk-p2yv7m0g.js";
|
|
65
|
+
import"./chunk-1cwdhk7a.js";
|
|
66
|
+
import"./chunk-j9gxwbe3.js";
|
|
67
|
+
import"./chunk-64c1avct.js";
|
|
68
|
+
import"./chunk-qbrsmra3.js";
|
|
69
|
+
import"./chunk-hezj20qy.js";
|
|
70
|
+
import"./chunk-8g5pe1gr.js";
|
|
71
|
+
import"./chunk-4cp6193g.js";
|
|
72
|
+
import"./chunk-8g747a8x.js";
|
|
73
|
+
import"./chunk-d7886r6a.js";
|
|
74
|
+
import"./chunk-f5ma3nh5.js";
|
|
75
|
+
import"./chunk-qz2x630m.js";
|
|
76
|
+
import"./chunk-mzd6frw6.js";
|
|
77
|
+
import"./chunk-r2k2jy0y.js";
|
|
78
|
+
import"./chunk-3c25bcsw.js";
|
|
79
|
+
import"./chunk-2q39ej51.js";
|
|
80
|
+
import"./chunk-q82r31er.js";
|
|
81
|
+
import"./chunk-p2816w9z.js";
|
|
82
|
+
import"./chunk-v9smspw2.js";
|
|
83
|
+
import"./chunk-v1kzp02e.js";
|
|
84
|
+
import"./chunk-z4mgvsdj.js";
|
|
85
|
+
import"./chunk-crmjpsqe.js";
|
|
86
|
+
import"./chunk-rvkvehat.js";
|
|
87
|
+
import"./chunk-g338npwr.js";
|
|
88
|
+
import"./chunk-f2mhrmww.js";
|
|
89
|
+
import"./chunk-0vkfrmqm.js";
|
|
90
|
+
import"./chunk-0xjaqda8.js";
|
|
91
|
+
import"./chunk-21z7acxh.js";
|
|
92
|
+
import"./chunk-rgbbtszq.js";
|
|
93
|
+
import"./chunk-1thgdca1.js";
|
|
94
|
+
import"./chunk-qnfx3qtx.js";
|
|
95
|
+
import"./chunk-yw79dz62.js";
|
|
96
|
+
import"./chunk-b81hd3m6.js";
|
|
97
|
+
import"./chunk-61ahbn23.js";
|
|
98
|
+
import"./chunk-8tnsngw2.js";
|
|
99
|
+
import"./chunk-edzkkadh.js";
|
|
100
|
+
import"./chunk-bwg7582d.js";
|
|
101
|
+
import"./chunk-5z28bqne.js";
|
|
102
|
+
import"./chunk-qajrkk97.js";
|
|
103
|
+
import {
|
|
104
|
+
init_debug,
|
|
105
|
+
logForDebugging
|
|
106
|
+
} from "./chunk-hcgkak1j.js";
|
|
107
|
+
import"./chunk-fbv4apne.js";
|
|
108
|
+
import {
|
|
109
|
+
errorMessage,
|
|
110
|
+
init_errors
|
|
111
|
+
} from "./chunk-z6e5jp2w.js";
|
|
112
|
+
import"./chunk-jaaxk89e.js";
|
|
113
|
+
import"./chunk-h4b85amj.js";
|
|
114
|
+
import"./chunk-07069jq1.js";
|
|
115
|
+
import"./chunk-vf612n57.js";
|
|
116
|
+
import"./chunk-d4mdda98.js";
|
|
117
|
+
import"./chunk-7wm5s02e.js";
|
|
118
|
+
import"./chunk-4g3v8y12.js";
|
|
119
|
+
import"./chunk-7739pg2c.js";
|
|
120
|
+
import"./chunk-nh3cd07f.js";
|
|
121
|
+
import"./chunk-8pn8tvgg.js";
|
|
122
|
+
import"./chunk-netzwgv1.js";
|
|
123
|
+
import {
|
|
124
|
+
__esm
|
|
125
|
+
} from "./chunk-qp2qdcda.js";
|
|
126
|
+
|
|
127
|
+
// src/services/api/gemini/client.ts
|
|
128
|
+
function getGeminiBaseUrl() {
|
|
129
|
+
return (process.env.GEMINI_BASE_URL || DEFAULT_GEMINI_BASE_URL).replace(/\/+$/, "");
|
|
130
|
+
}
|
|
131
|
+
function getGeminiModelPath(model) {
|
|
132
|
+
const normalized = model.replace(/^\/+/, "");
|
|
133
|
+
return normalized.startsWith("models/") ? normalized : `models/${normalized}`;
|
|
134
|
+
}
|
|
135
|
+
async function* streamGeminiGenerateContent(params) {
|
|
136
|
+
const fetchImpl = params.fetchOverride ?? fetch;
|
|
137
|
+
const url = `${getGeminiBaseUrl()}/${getGeminiModelPath(params.model)}:streamGenerateContent?alt=sse`;
|
|
138
|
+
const response = await fetchImpl(url, {
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: {
|
|
141
|
+
"Content-Type": "application/json",
|
|
142
|
+
"x-goog-api-key": process.env.GEMINI_API_KEY || ""
|
|
143
|
+
},
|
|
144
|
+
body: JSON.stringify(params.body),
|
|
145
|
+
signal: params.signal,
|
|
146
|
+
...getProxyFetchOptions({ forAnthropicAPI: false })
|
|
147
|
+
});
|
|
148
|
+
if (!response.ok) {
|
|
149
|
+
const body = await response.text();
|
|
150
|
+
throw new Error(`Gemini API request failed (${response.status} ${response.statusText}): ${body || "empty response body"}`);
|
|
151
|
+
}
|
|
152
|
+
if (!response.body) {
|
|
153
|
+
throw new Error("Gemini API returned no response body");
|
|
154
|
+
}
|
|
155
|
+
const reader = response.body.getReader();
|
|
156
|
+
const decoder = new TextDecoder;
|
|
157
|
+
let buffer = "";
|
|
158
|
+
try {
|
|
159
|
+
while (true) {
|
|
160
|
+
const { done, value } = await reader.read();
|
|
161
|
+
if (done)
|
|
162
|
+
break;
|
|
163
|
+
buffer += decoder.decode(value, STREAM_DECODE_OPTS);
|
|
164
|
+
const { frames: frames2, remaining } = parseSSEFrames(buffer);
|
|
165
|
+
buffer = remaining;
|
|
166
|
+
for (const frame of frames2) {
|
|
167
|
+
if (!frame.data || frame.data === "[DONE]")
|
|
168
|
+
continue;
|
|
169
|
+
try {
|
|
170
|
+
yield JSON.parse(frame.data);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
throw new Error(`Failed to parse Gemini SSE payload: ${errorMessage(error)}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
buffer += decoder.decode();
|
|
177
|
+
const { frames } = parseSSEFrames(buffer);
|
|
178
|
+
for (const frame of frames) {
|
|
179
|
+
if (!frame.data || frame.data === "[DONE]")
|
|
180
|
+
continue;
|
|
181
|
+
try {
|
|
182
|
+
yield JSON.parse(frame.data);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
throw new Error(`Failed to parse trailing Gemini SSE payload: ${errorMessage(error)}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} finally {
|
|
188
|
+
reader.releaseLock();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta", STREAM_DECODE_OPTS;
|
|
192
|
+
var init_client = __esm(() => {
|
|
193
|
+
init_SSETransport();
|
|
194
|
+
init_errors();
|
|
195
|
+
init_proxy();
|
|
196
|
+
STREAM_DECODE_OPTS = { stream: true };
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// src/services/api/gemini/types.ts
|
|
200
|
+
var GEMINI_THOUGHT_SIGNATURE_FIELD = "_geminiThoughtSignature";
|
|
201
|
+
var init_types = () => {};
|
|
202
|
+
|
|
203
|
+
// src/services/api/gemini/convertMessages.ts
|
|
204
|
+
function anthropicMessagesToGemini(messages, systemPrompt) {
|
|
205
|
+
const contents = [];
|
|
206
|
+
const toolNamesById = new Map;
|
|
207
|
+
for (const msg of messages) {
|
|
208
|
+
if (msg.type === "assistant") {
|
|
209
|
+
const content = convertInternalAssistantMessage(msg);
|
|
210
|
+
if (content.parts.length > 0) {
|
|
211
|
+
contents.push(content);
|
|
212
|
+
}
|
|
213
|
+
const assistantContent = msg.message.content;
|
|
214
|
+
if (Array.isArray(assistantContent)) {
|
|
215
|
+
for (const block of assistantContent) {
|
|
216
|
+
if (typeof block !== "string" && block.type === "tool_use") {
|
|
217
|
+
toolNamesById.set(block.id, block.name);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
if (msg.type === "user") {
|
|
224
|
+
const content = convertInternalUserMessage(msg, toolNamesById);
|
|
225
|
+
if (content.parts.length > 0) {
|
|
226
|
+
contents.push(content);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const systemText = systemPromptToText(systemPrompt);
|
|
231
|
+
return {
|
|
232
|
+
contents,
|
|
233
|
+
...systemText ? {
|
|
234
|
+
systemInstruction: {
|
|
235
|
+
parts: [{ text: systemText }]
|
|
236
|
+
}
|
|
237
|
+
} : {}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function systemPromptToText(systemPrompt) {
|
|
241
|
+
if (!systemPrompt || systemPrompt.length === 0)
|
|
242
|
+
return "";
|
|
243
|
+
return systemPrompt.filter(Boolean).join(`
|
|
244
|
+
|
|
245
|
+
`);
|
|
246
|
+
}
|
|
247
|
+
function convertInternalUserMessage(msg, toolNamesById) {
|
|
248
|
+
const content = msg.message.content;
|
|
249
|
+
if (typeof content === "string") {
|
|
250
|
+
return {
|
|
251
|
+
role: "user",
|
|
252
|
+
parts: createTextGeminiParts(content)
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (!Array.isArray(content)) {
|
|
256
|
+
return { role: "user", parts: [] };
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
role: "user",
|
|
260
|
+
parts: content.flatMap((block) => convertUserContentBlockToGeminiParts(block, toolNamesById))
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function convertUserContentBlockToGeminiParts(block, toolNamesById) {
|
|
264
|
+
if (typeof block === "string") {
|
|
265
|
+
return createTextGeminiParts(block);
|
|
266
|
+
}
|
|
267
|
+
if (block.type === "text") {
|
|
268
|
+
return createTextGeminiParts(block.text);
|
|
269
|
+
}
|
|
270
|
+
if (block.type === "tool_result") {
|
|
271
|
+
const toolResult = block;
|
|
272
|
+
return [
|
|
273
|
+
{
|
|
274
|
+
functionResponse: {
|
|
275
|
+
name: toolNamesById.get(toolResult.tool_use_id) ?? toolResult.tool_use_id,
|
|
276
|
+
response: toolResultToResponseObject(toolResult)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
];
|
|
280
|
+
}
|
|
281
|
+
if (block.type === "image") {
|
|
282
|
+
const source = block.source;
|
|
283
|
+
if (source?.type === "base64" && typeof source.data === "string") {
|
|
284
|
+
const mediaType = source.media_type || "image/png";
|
|
285
|
+
return [
|
|
286
|
+
{
|
|
287
|
+
inlineData: {
|
|
288
|
+
mimeType: mediaType,
|
|
289
|
+
data: source.data
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
if (source?.type === "url" && typeof source.url === "string") {
|
|
295
|
+
return createTextGeminiParts(`[image: ${source.url}]`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return [];
|
|
299
|
+
}
|
|
300
|
+
function convertInternalAssistantMessage(msg) {
|
|
301
|
+
const content = msg.message.content;
|
|
302
|
+
if (typeof content === "string") {
|
|
303
|
+
return {
|
|
304
|
+
role: "model",
|
|
305
|
+
parts: createTextGeminiParts(content)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
if (!Array.isArray(content)) {
|
|
309
|
+
return { role: "model", parts: [] };
|
|
310
|
+
}
|
|
311
|
+
const parts = [];
|
|
312
|
+
for (const block of content) {
|
|
313
|
+
if (typeof block === "string") {
|
|
314
|
+
parts.push(...createTextGeminiParts(block));
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (block.type === "text") {
|
|
318
|
+
parts.push(...createTextGeminiParts(block.text, getGeminiThoughtSignature(block)));
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (block.type === "thinking") {
|
|
322
|
+
const thinkingPart = createThinkingGeminiPart(block.thinking, block.signature);
|
|
323
|
+
if (thinkingPart) {
|
|
324
|
+
parts.push(thinkingPart);
|
|
325
|
+
}
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (block.type === "tool_use") {
|
|
329
|
+
const toolUse = block;
|
|
330
|
+
parts.push({
|
|
331
|
+
functionCall: {
|
|
332
|
+
name: toolUse.name,
|
|
333
|
+
args: normalizeToolUseInput(toolUse.input)
|
|
334
|
+
},
|
|
335
|
+
...getGeminiThoughtSignature(block) && {
|
|
336
|
+
thoughtSignature: getGeminiThoughtSignature(block)
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return { role: "model", parts };
|
|
342
|
+
}
|
|
343
|
+
function createTextGeminiParts(value, thoughtSignature) {
|
|
344
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
345
|
+
return [];
|
|
346
|
+
}
|
|
347
|
+
return [
|
|
348
|
+
{
|
|
349
|
+
text: value,
|
|
350
|
+
...thoughtSignature && { thoughtSignature }
|
|
351
|
+
}
|
|
352
|
+
];
|
|
353
|
+
}
|
|
354
|
+
function createThinkingGeminiPart(value, thoughtSignature) {
|
|
355
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
text: value,
|
|
360
|
+
thought: true,
|
|
361
|
+
...thoughtSignature && { thoughtSignature }
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function normalizeToolUseInput(input) {
|
|
365
|
+
if (typeof input === "string") {
|
|
366
|
+
const parsed = safeParseJSON(input);
|
|
367
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
368
|
+
return parsed;
|
|
369
|
+
}
|
|
370
|
+
return parsed === null ? {} : { value: parsed };
|
|
371
|
+
}
|
|
372
|
+
if (input && typeof input === "object" && !Array.isArray(input)) {
|
|
373
|
+
return input;
|
|
374
|
+
}
|
|
375
|
+
return input === undefined ? {} : { value: input };
|
|
376
|
+
}
|
|
377
|
+
function toolResultToResponseObject(block) {
|
|
378
|
+
const result = normalizeToolResultContent(block.content);
|
|
379
|
+
if (result && typeof result === "object" && !Array.isArray(result)) {
|
|
380
|
+
return block.is_error ? { ...result, is_error: true } : result;
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
result,
|
|
384
|
+
...block.is_error ? { is_error: true } : {}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
function normalizeToolResultContent(content) {
|
|
388
|
+
if (typeof content === "string") {
|
|
389
|
+
const parsed = safeParseJSON(content);
|
|
390
|
+
return parsed ?? content;
|
|
391
|
+
}
|
|
392
|
+
if (Array.isArray(content)) {
|
|
393
|
+
const text = content.map((part) => {
|
|
394
|
+
if (typeof part === "string")
|
|
395
|
+
return part;
|
|
396
|
+
if (part && typeof part === "object" && "text" in part && typeof part.text === "string") {
|
|
397
|
+
return part.text;
|
|
398
|
+
}
|
|
399
|
+
return "";
|
|
400
|
+
}).filter(Boolean).join(`
|
|
401
|
+
`);
|
|
402
|
+
const parsed = safeParseJSON(text);
|
|
403
|
+
return parsed ?? text;
|
|
404
|
+
}
|
|
405
|
+
return content ?? "";
|
|
406
|
+
}
|
|
407
|
+
function getGeminiThoughtSignature(block) {
|
|
408
|
+
const signature = block[GEMINI_THOUGHT_SIGNATURE_FIELD];
|
|
409
|
+
return typeof signature === "string" && signature.length > 0 ? signature : undefined;
|
|
410
|
+
}
|
|
411
|
+
var init_convertMessages = __esm(() => {
|
|
412
|
+
init_json();
|
|
413
|
+
init_types();
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
// src/services/api/gemini/convertTools.ts
|
|
417
|
+
function normalizeGeminiJsonSchemaType(value) {
|
|
418
|
+
if (typeof value === "string") {
|
|
419
|
+
return GEMINI_JSON_SCHEMA_TYPES.has(value) ? value : undefined;
|
|
420
|
+
}
|
|
421
|
+
if (Array.isArray(value)) {
|
|
422
|
+
const normalized = value.filter((item) => typeof item === "string" && GEMINI_JSON_SCHEMA_TYPES.has(item));
|
|
423
|
+
const unique = Array.from(new Set(normalized));
|
|
424
|
+
if (unique.length === 0)
|
|
425
|
+
return;
|
|
426
|
+
return unique.length === 1 ? unique[0] : unique;
|
|
427
|
+
}
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
function inferGeminiJsonSchemaTypeFromValue(value) {
|
|
431
|
+
if (value === null)
|
|
432
|
+
return "null";
|
|
433
|
+
if (Array.isArray(value))
|
|
434
|
+
return "array";
|
|
435
|
+
if (typeof value === "string")
|
|
436
|
+
return "string";
|
|
437
|
+
if (typeof value === "boolean")
|
|
438
|
+
return "boolean";
|
|
439
|
+
if (typeof value === "number") {
|
|
440
|
+
return Number.isInteger(value) ? "integer" : "number";
|
|
441
|
+
}
|
|
442
|
+
if (typeof value === "object")
|
|
443
|
+
return "object";
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
function inferGeminiJsonSchemaTypeFromEnum(values) {
|
|
447
|
+
const inferred = values.map(inferGeminiJsonSchemaTypeFromValue).filter((value) => value !== undefined);
|
|
448
|
+
const unique = Array.from(new Set(inferred));
|
|
449
|
+
if (unique.length === 0)
|
|
450
|
+
return;
|
|
451
|
+
return unique.length === 1 ? unique[0] : unique;
|
|
452
|
+
}
|
|
453
|
+
function addNullToGeminiJsonSchemaType(value) {
|
|
454
|
+
if (value === undefined)
|
|
455
|
+
return ["null"];
|
|
456
|
+
if (Array.isArray(value)) {
|
|
457
|
+
return value.includes("null") ? value : [...value, "null"];
|
|
458
|
+
}
|
|
459
|
+
return value === "null" ? value : [value, "null"];
|
|
460
|
+
}
|
|
461
|
+
function sanitizeGeminiJsonSchemaProperties(value) {
|
|
462
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const sanitizedEntries = Object.entries(value).map(([key, schema]) => [key, sanitizeGeminiJsonSchema(schema)]).filter(([, schema]) => Object.keys(schema).length > 0);
|
|
466
|
+
if (sanitizedEntries.length === 0) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
return Object.fromEntries(sanitizedEntries);
|
|
470
|
+
}
|
|
471
|
+
function sanitizeGeminiJsonSchemaArray(value) {
|
|
472
|
+
if (!Array.isArray(value))
|
|
473
|
+
return;
|
|
474
|
+
const sanitized = value.map((item) => sanitizeGeminiJsonSchema(item)).filter((item) => Object.keys(item).length > 0);
|
|
475
|
+
return sanitized.length > 0 ? sanitized : undefined;
|
|
476
|
+
}
|
|
477
|
+
function sanitizeGeminiJsonSchema(schema) {
|
|
478
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
479
|
+
return {};
|
|
480
|
+
}
|
|
481
|
+
const source = schema;
|
|
482
|
+
const result = {};
|
|
483
|
+
let type = normalizeGeminiJsonSchemaType(source.type);
|
|
484
|
+
if (source.const !== undefined) {
|
|
485
|
+
result.enum = [source.const];
|
|
486
|
+
type = type ?? inferGeminiJsonSchemaTypeFromValue(source.const);
|
|
487
|
+
} else if (Array.isArray(source.enum) && source.enum.length > 0) {
|
|
488
|
+
result.enum = source.enum;
|
|
489
|
+
type = type ?? inferGeminiJsonSchemaTypeFromEnum(source.enum);
|
|
490
|
+
}
|
|
491
|
+
if (!type) {
|
|
492
|
+
if (source.properties && typeof source.properties === "object") {
|
|
493
|
+
type = "object";
|
|
494
|
+
} else if (source.items !== undefined || source.prefixItems !== undefined) {
|
|
495
|
+
type = "array";
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (source.nullable === true) {
|
|
499
|
+
type = addNullToGeminiJsonSchemaType(type);
|
|
500
|
+
}
|
|
501
|
+
if (type) {
|
|
502
|
+
result.type = type;
|
|
503
|
+
}
|
|
504
|
+
if (typeof source.title === "string") {
|
|
505
|
+
result.title = source.title;
|
|
506
|
+
}
|
|
507
|
+
if (typeof source.description === "string") {
|
|
508
|
+
result.description = source.description;
|
|
509
|
+
}
|
|
510
|
+
if (typeof source.format === "string") {
|
|
511
|
+
result.format = source.format;
|
|
512
|
+
}
|
|
513
|
+
if (typeof source.pattern === "string") {
|
|
514
|
+
result.pattern = source.pattern;
|
|
515
|
+
}
|
|
516
|
+
if (typeof source.minimum === "number") {
|
|
517
|
+
result.minimum = source.minimum;
|
|
518
|
+
} else if (typeof source.exclusiveMinimum === "number") {
|
|
519
|
+
result.minimum = source.exclusiveMinimum;
|
|
520
|
+
}
|
|
521
|
+
if (typeof source.maximum === "number") {
|
|
522
|
+
result.maximum = source.maximum;
|
|
523
|
+
} else if (typeof source.exclusiveMaximum === "number") {
|
|
524
|
+
result.maximum = source.exclusiveMaximum;
|
|
525
|
+
}
|
|
526
|
+
if (typeof source.minItems === "number") {
|
|
527
|
+
result.minItems = source.minItems;
|
|
528
|
+
}
|
|
529
|
+
if (typeof source.maxItems === "number") {
|
|
530
|
+
result.maxItems = source.maxItems;
|
|
531
|
+
}
|
|
532
|
+
if (typeof source.minLength === "number") {
|
|
533
|
+
result.minLength = source.minLength;
|
|
534
|
+
}
|
|
535
|
+
if (typeof source.maxLength === "number") {
|
|
536
|
+
result.maxLength = source.maxLength;
|
|
537
|
+
}
|
|
538
|
+
if (typeof source.minProperties === "number") {
|
|
539
|
+
result.minProperties = source.minProperties;
|
|
540
|
+
}
|
|
541
|
+
if (typeof source.maxProperties === "number") {
|
|
542
|
+
result.maxProperties = source.maxProperties;
|
|
543
|
+
}
|
|
544
|
+
const properties = sanitizeGeminiJsonSchemaProperties(source.properties);
|
|
545
|
+
if (properties) {
|
|
546
|
+
result.properties = properties;
|
|
547
|
+
result.propertyOrdering = Object.keys(properties);
|
|
548
|
+
}
|
|
549
|
+
if (Array.isArray(source.required)) {
|
|
550
|
+
const required = source.required.filter((item) => typeof item === "string");
|
|
551
|
+
if (required.length > 0) {
|
|
552
|
+
result.required = required;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
if (typeof source.additionalProperties === "boolean") {
|
|
556
|
+
result.additionalProperties = source.additionalProperties;
|
|
557
|
+
} else {
|
|
558
|
+
const additionalProperties = sanitizeGeminiJsonSchema(source.additionalProperties);
|
|
559
|
+
if (Object.keys(additionalProperties).length > 0) {
|
|
560
|
+
result.additionalProperties = additionalProperties;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const items = sanitizeGeminiJsonSchema(source.items);
|
|
564
|
+
if (Object.keys(items).length > 0) {
|
|
565
|
+
result.items = items;
|
|
566
|
+
}
|
|
567
|
+
const prefixItems = sanitizeGeminiJsonSchemaArray(source.prefixItems);
|
|
568
|
+
if (prefixItems) {
|
|
569
|
+
result.prefixItems = prefixItems;
|
|
570
|
+
}
|
|
571
|
+
const anyOf = sanitizeGeminiJsonSchemaArray(source.anyOf ?? source.oneOf);
|
|
572
|
+
if (anyOf) {
|
|
573
|
+
result.anyOf = anyOf;
|
|
574
|
+
}
|
|
575
|
+
return result;
|
|
576
|
+
}
|
|
577
|
+
function sanitizeGeminiFunctionParameters(schema) {
|
|
578
|
+
const sanitized = sanitizeGeminiJsonSchema(schema);
|
|
579
|
+
if (Object.keys(sanitized).length > 0) {
|
|
580
|
+
return sanitized;
|
|
581
|
+
}
|
|
582
|
+
return {
|
|
583
|
+
type: "object",
|
|
584
|
+
properties: {}
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function anthropicToolsToGemini(tools) {
|
|
588
|
+
const functionDeclarations = tools.filter((tool) => {
|
|
589
|
+
return tool.type === "custom" || !("type" in tool) || tool.type !== "server";
|
|
590
|
+
}).map((tool) => {
|
|
591
|
+
const anyTool = tool;
|
|
592
|
+
const name = anyTool.name || "";
|
|
593
|
+
const description = anyTool.description || "";
|
|
594
|
+
const inputSchema = anyTool.input_schema ?? {
|
|
595
|
+
type: "object",
|
|
596
|
+
properties: {}
|
|
597
|
+
};
|
|
598
|
+
return {
|
|
599
|
+
name,
|
|
600
|
+
description,
|
|
601
|
+
parametersJsonSchema: sanitizeGeminiFunctionParameters(inputSchema)
|
|
602
|
+
};
|
|
603
|
+
});
|
|
604
|
+
return functionDeclarations.length > 0 ? [{ functionDeclarations }] : [];
|
|
605
|
+
}
|
|
606
|
+
function anthropicToolChoiceToGemini(toolChoice) {
|
|
607
|
+
if (!toolChoice || typeof toolChoice !== "object")
|
|
608
|
+
return;
|
|
609
|
+
const tc = toolChoice;
|
|
610
|
+
const type = tc.type;
|
|
611
|
+
switch (type) {
|
|
612
|
+
case "auto":
|
|
613
|
+
return { mode: "AUTO" };
|
|
614
|
+
case "any":
|
|
615
|
+
return { mode: "ANY" };
|
|
616
|
+
case "tool":
|
|
617
|
+
return {
|
|
618
|
+
mode: "ANY",
|
|
619
|
+
allowedFunctionNames: typeof tc.name === "string" ? [tc.name] : undefined
|
|
620
|
+
};
|
|
621
|
+
default:
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
var GEMINI_JSON_SCHEMA_TYPES;
|
|
626
|
+
var init_convertTools = __esm(() => {
|
|
627
|
+
GEMINI_JSON_SCHEMA_TYPES = new Set([
|
|
628
|
+
"string",
|
|
629
|
+
"number",
|
|
630
|
+
"integer",
|
|
631
|
+
"boolean",
|
|
632
|
+
"object",
|
|
633
|
+
"array",
|
|
634
|
+
"null"
|
|
635
|
+
]);
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
// src/services/api/gemini/modelMapping.ts
|
|
639
|
+
function getModelFamily(model) {
|
|
640
|
+
if (/haiku/i.test(model))
|
|
641
|
+
return "haiku";
|
|
642
|
+
if (/opus/i.test(model))
|
|
643
|
+
return "opus";
|
|
644
|
+
if (/sonnet/i.test(model))
|
|
645
|
+
return "sonnet";
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
function resolveGeminiModel(anthropicModel) {
|
|
649
|
+
if (process.env.GEMINI_MODEL) {
|
|
650
|
+
return process.env.GEMINI_MODEL;
|
|
651
|
+
}
|
|
652
|
+
const cleanModel = anthropicModel.replace(/\[1m\]$/i, "");
|
|
653
|
+
const family = getModelFamily(cleanModel);
|
|
654
|
+
if (!family) {
|
|
655
|
+
return cleanModel;
|
|
656
|
+
}
|
|
657
|
+
const geminiEnvVar = `GEMINI_DEFAULT_${family.toUpperCase()}_MODEL`;
|
|
658
|
+
const geminiModel = process.env[geminiEnvVar];
|
|
659
|
+
if (geminiModel) {
|
|
660
|
+
return geminiModel;
|
|
661
|
+
}
|
|
662
|
+
const sharedEnvVar = `ANTHROPIC_DEFAULT_${family.toUpperCase()}_MODEL`;
|
|
663
|
+
const resolvedModel = process.env[sharedEnvVar];
|
|
664
|
+
if (resolvedModel) {
|
|
665
|
+
return resolvedModel;
|
|
666
|
+
}
|
|
667
|
+
throw new Error(`Gemini provider requires GEMINI_MODEL or ${geminiEnvVar} (or ${sharedEnvVar} for backward compatibility) to be configured.`);
|
|
668
|
+
}
|
|
669
|
+
var init_modelMapping = () => {};
|
|
670
|
+
|
|
671
|
+
// src/services/api/gemini/streamAdapter.ts
|
|
672
|
+
import { randomUUID } from "crypto";
|
|
673
|
+
async function* adaptGeminiStreamToAnthropic(stream, model) {
|
|
674
|
+
const messageId = `msg_${randomUUID().replace(/-/g, "").slice(0, 24)}`;
|
|
675
|
+
let started = false;
|
|
676
|
+
let stopped = false;
|
|
677
|
+
let nextContentIndex = 0;
|
|
678
|
+
let openTextLikeBlock = null;
|
|
679
|
+
let sawToolUse = false;
|
|
680
|
+
let finishReason;
|
|
681
|
+
let inputTokens = 0;
|
|
682
|
+
let outputTokens = 0;
|
|
683
|
+
for await (const chunk of stream) {
|
|
684
|
+
const usage = chunk.usageMetadata;
|
|
685
|
+
if (usage) {
|
|
686
|
+
inputTokens = usage.promptTokenCount ?? inputTokens;
|
|
687
|
+
outputTokens = (usage.candidatesTokenCount ?? 0) + (usage.thoughtsTokenCount ?? 0);
|
|
688
|
+
}
|
|
689
|
+
if (!started) {
|
|
690
|
+
started = true;
|
|
691
|
+
yield {
|
|
692
|
+
type: "message_start",
|
|
693
|
+
message: {
|
|
694
|
+
id: messageId,
|
|
695
|
+
type: "message",
|
|
696
|
+
role: "assistant",
|
|
697
|
+
content: [],
|
|
698
|
+
model,
|
|
699
|
+
stop_reason: null,
|
|
700
|
+
stop_sequence: null,
|
|
701
|
+
usage: {
|
|
702
|
+
input_tokens: inputTokens,
|
|
703
|
+
output_tokens: 0,
|
|
704
|
+
cache_creation_input_tokens: 0,
|
|
705
|
+
cache_read_input_tokens: 0
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
const candidate = chunk.candidates?.[0];
|
|
711
|
+
const parts = candidate?.content?.parts ?? [];
|
|
712
|
+
for (const part of parts) {
|
|
713
|
+
if (part.functionCall) {
|
|
714
|
+
if (openTextLikeBlock) {
|
|
715
|
+
yield {
|
|
716
|
+
type: "content_block_stop",
|
|
717
|
+
index: openTextLikeBlock.index
|
|
718
|
+
};
|
|
719
|
+
openTextLikeBlock = null;
|
|
720
|
+
}
|
|
721
|
+
sawToolUse = true;
|
|
722
|
+
const toolIndex = nextContentIndex++;
|
|
723
|
+
const toolId = `toolu_${randomUUID().replace(/-/g, "").slice(0, 24)}`;
|
|
724
|
+
yield {
|
|
725
|
+
type: "content_block_start",
|
|
726
|
+
index: toolIndex,
|
|
727
|
+
content_block: {
|
|
728
|
+
type: "tool_use",
|
|
729
|
+
id: toolId,
|
|
730
|
+
name: part.functionCall.name || "",
|
|
731
|
+
input: {}
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
if (part.thoughtSignature) {
|
|
735
|
+
yield {
|
|
736
|
+
type: "content_block_delta",
|
|
737
|
+
index: toolIndex,
|
|
738
|
+
delta: {
|
|
739
|
+
type: "signature_delta",
|
|
740
|
+
signature: part.thoughtSignature
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
if (part.functionCall.args && Object.keys(part.functionCall.args).length > 0) {
|
|
745
|
+
yield {
|
|
746
|
+
type: "content_block_delta",
|
|
747
|
+
index: toolIndex,
|
|
748
|
+
delta: {
|
|
749
|
+
type: "input_json_delta",
|
|
750
|
+
partial_json: JSON.stringify(part.functionCall.args)
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
yield {
|
|
755
|
+
type: "content_block_stop",
|
|
756
|
+
index: toolIndex
|
|
757
|
+
};
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
const textLikeType = getTextLikeBlockType(part);
|
|
761
|
+
if (textLikeType) {
|
|
762
|
+
if (!openTextLikeBlock || openTextLikeBlock.type !== textLikeType) {
|
|
763
|
+
if (openTextLikeBlock) {
|
|
764
|
+
yield {
|
|
765
|
+
type: "content_block_stop",
|
|
766
|
+
index: openTextLikeBlock.index
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
openTextLikeBlock = {
|
|
770
|
+
index: nextContentIndex++,
|
|
771
|
+
type: textLikeType
|
|
772
|
+
};
|
|
773
|
+
yield {
|
|
774
|
+
type: "content_block_start",
|
|
775
|
+
index: openTextLikeBlock.index,
|
|
776
|
+
content_block: textLikeType === "thinking" ? {
|
|
777
|
+
type: "thinking",
|
|
778
|
+
thinking: "",
|
|
779
|
+
signature: ""
|
|
780
|
+
} : {
|
|
781
|
+
type: "text",
|
|
782
|
+
text: ""
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
if (part.text) {
|
|
787
|
+
yield {
|
|
788
|
+
type: "content_block_delta",
|
|
789
|
+
index: openTextLikeBlock.index,
|
|
790
|
+
delta: textLikeType === "thinking" ? {
|
|
791
|
+
type: "thinking_delta",
|
|
792
|
+
thinking: part.text
|
|
793
|
+
} : {
|
|
794
|
+
type: "text_delta",
|
|
795
|
+
text: part.text
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
if (part.thoughtSignature) {
|
|
800
|
+
yield {
|
|
801
|
+
type: "content_block_delta",
|
|
802
|
+
index: openTextLikeBlock.index,
|
|
803
|
+
delta: {
|
|
804
|
+
type: "signature_delta",
|
|
805
|
+
signature: part.thoughtSignature
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (part.thoughtSignature && openTextLikeBlock) {
|
|
812
|
+
yield {
|
|
813
|
+
type: "content_block_delta",
|
|
814
|
+
index: openTextLikeBlock.index,
|
|
815
|
+
delta: {
|
|
816
|
+
type: "signature_delta",
|
|
817
|
+
signature: part.thoughtSignature
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
if (candidate?.finishReason) {
|
|
823
|
+
finishReason = candidate.finishReason;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (!started) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (openTextLikeBlock) {
|
|
830
|
+
yield {
|
|
831
|
+
type: "content_block_stop",
|
|
832
|
+
index: openTextLikeBlock.index
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
if (!stopped) {
|
|
836
|
+
yield {
|
|
837
|
+
type: "message_delta",
|
|
838
|
+
delta: {
|
|
839
|
+
stop_reason: mapGeminiFinishReason(finishReason, sawToolUse),
|
|
840
|
+
stop_sequence: null
|
|
841
|
+
},
|
|
842
|
+
usage: {
|
|
843
|
+
output_tokens: outputTokens
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
yield {
|
|
847
|
+
type: "message_stop"
|
|
848
|
+
};
|
|
849
|
+
stopped = true;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
function getTextLikeBlockType(part) {
|
|
853
|
+
if (typeof part.text !== "string") {
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
return part.thought ? "thinking" : "text";
|
|
857
|
+
}
|
|
858
|
+
function mapGeminiFinishReason(reason, sawToolUse) {
|
|
859
|
+
switch (reason) {
|
|
860
|
+
case "MAX_TOKENS":
|
|
861
|
+
return "max_tokens";
|
|
862
|
+
case "STOP":
|
|
863
|
+
case "FINISH_REASON_UNSPECIFIED":
|
|
864
|
+
case "SAFETY":
|
|
865
|
+
case "RECITATION":
|
|
866
|
+
case "BLOCKLIST":
|
|
867
|
+
case "PROHIBITED_CONTENT":
|
|
868
|
+
case "SPII":
|
|
869
|
+
case "MALFORMED_FUNCTION_CALL":
|
|
870
|
+
default:
|
|
871
|
+
return sawToolUse ? "tool_use" : "end_turn";
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
var init_streamAdapter = () => {};
|
|
875
|
+
|
|
876
|
+
// src/services/api/gemini/index.ts
|
|
877
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
878
|
+
async function* queryModelGemini(messages, systemPrompt, tools, signal, options, thinkingConfig) {
|
|
879
|
+
try {
|
|
880
|
+
const geminiModel = resolveGeminiModel(options.model);
|
|
881
|
+
const messagesForAPI = normalizeMessagesForAPI(messages, tools);
|
|
882
|
+
const toolSchemas = await Promise.all(tools.map((tool) => toolToAPISchema(tool, {
|
|
883
|
+
getToolPermissionContext: options.getToolPermissionContext,
|
|
884
|
+
tools,
|
|
885
|
+
agents: options.agents,
|
|
886
|
+
allowedAgentTypes: options.allowedAgentTypes,
|
|
887
|
+
model: options.model
|
|
888
|
+
})));
|
|
889
|
+
const standardTools = toolSchemas.filter((t) => {
|
|
890
|
+
const anyTool = t;
|
|
891
|
+
return anyTool.type !== "advisor_20260301" && anyTool.type !== "computer_20250124";
|
|
892
|
+
});
|
|
893
|
+
const { contents, systemInstruction } = anthropicMessagesToGemini(messagesForAPI, systemPrompt);
|
|
894
|
+
const geminiTools = anthropicToolsToGemini(standardTools);
|
|
895
|
+
const toolChoice = anthropicToolChoiceToGemini(options.toolChoice);
|
|
896
|
+
const stream = streamGeminiGenerateContent({
|
|
897
|
+
model: geminiModel,
|
|
898
|
+
signal,
|
|
899
|
+
fetchOverride: options.fetchOverride,
|
|
900
|
+
body: {
|
|
901
|
+
contents,
|
|
902
|
+
...systemInstruction && { systemInstruction },
|
|
903
|
+
...geminiTools.length > 0 && { tools: geminiTools },
|
|
904
|
+
...toolChoice && {
|
|
905
|
+
toolConfig: {
|
|
906
|
+
functionCallingConfig: toolChoice
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
generationConfig: {
|
|
910
|
+
...options.temperatureOverride !== undefined && {
|
|
911
|
+
temperature: options.temperatureOverride
|
|
912
|
+
},
|
|
913
|
+
...thinkingConfig.type !== "disabled" && {
|
|
914
|
+
thinkingConfig: {
|
|
915
|
+
includeThoughts: true,
|
|
916
|
+
...thinkingConfig.type === "enabled" && {
|
|
917
|
+
thinkingBudget: thinkingConfig.budgetTokens
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
logForDebugging(`[Gemini] Calling model=${geminiModel}, messages=${contents.length}, tools=${geminiTools.length}`);
|
|
925
|
+
const adaptedStream = adaptGeminiStreamToAnthropic(stream, geminiModel);
|
|
926
|
+
const contentBlocks = {};
|
|
927
|
+
let partialMessage = undefined;
|
|
928
|
+
let ttftMs = 0;
|
|
929
|
+
const start = Date.now();
|
|
930
|
+
for await (const event of adaptedStream) {
|
|
931
|
+
switch (event.type) {
|
|
932
|
+
case "message_start":
|
|
933
|
+
partialMessage = event.message;
|
|
934
|
+
ttftMs = Date.now() - start;
|
|
935
|
+
break;
|
|
936
|
+
case "content_block_start": {
|
|
937
|
+
const idx = event.index;
|
|
938
|
+
const cb = event.content_block;
|
|
939
|
+
if (cb.type === "tool_use") {
|
|
940
|
+
contentBlocks[idx] = { ...cb, input: "" };
|
|
941
|
+
} else if (cb.type === "text") {
|
|
942
|
+
contentBlocks[idx] = { ...cb, text: "" };
|
|
943
|
+
} else if (cb.type === "thinking") {
|
|
944
|
+
contentBlocks[idx] = { ...cb, thinking: "", signature: "" };
|
|
945
|
+
} else {
|
|
946
|
+
contentBlocks[idx] = { ...cb };
|
|
947
|
+
}
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
case "content_block_delta": {
|
|
951
|
+
const idx = event.index;
|
|
952
|
+
const delta = event.delta;
|
|
953
|
+
const block = contentBlocks[idx];
|
|
954
|
+
if (!block)
|
|
955
|
+
break;
|
|
956
|
+
if (delta.type === "text_delta") {
|
|
957
|
+
block.text = (block.text || "") + delta.text;
|
|
958
|
+
} else if (delta.type === "input_json_delta") {
|
|
959
|
+
block.input = (block.input || "") + delta.partial_json;
|
|
960
|
+
} else if (delta.type === "thinking_delta") {
|
|
961
|
+
block.thinking = (block.thinking || "") + delta.thinking;
|
|
962
|
+
} else if (delta.type === "signature_delta") {
|
|
963
|
+
if (block.type === "thinking") {
|
|
964
|
+
block.signature = delta.signature;
|
|
965
|
+
} else {
|
|
966
|
+
block[GEMINI_THOUGHT_SIGNATURE_FIELD] = delta.signature;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
break;
|
|
970
|
+
}
|
|
971
|
+
case "content_block_stop": {
|
|
972
|
+
const idx = event.index;
|
|
973
|
+
const block = contentBlocks[idx];
|
|
974
|
+
if (!block || !partialMessage)
|
|
975
|
+
break;
|
|
976
|
+
const message = {
|
|
977
|
+
message: {
|
|
978
|
+
...partialMessage,
|
|
979
|
+
content: normalizeContentFromAPI([block], tools, options.agentId)
|
|
980
|
+
},
|
|
981
|
+
requestId: undefined,
|
|
982
|
+
type: "assistant",
|
|
983
|
+
uuid: randomUUID2(),
|
|
984
|
+
timestamp: new Date().toISOString()
|
|
985
|
+
};
|
|
986
|
+
yield message;
|
|
987
|
+
break;
|
|
988
|
+
}
|
|
989
|
+
case "message_delta":
|
|
990
|
+
case "message_stop":
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
yield {
|
|
994
|
+
type: "stream_event",
|
|
995
|
+
event,
|
|
996
|
+
...event.type === "message_start" ? { ttftMs } : undefined
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
} catch (error) {
|
|
1000
|
+
const errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
1001
|
+
logForDebugging(`[Gemini] Error: ${errorMessage2}`, { level: "error" });
|
|
1002
|
+
yield createAssistantAPIErrorMessage({
|
|
1003
|
+
content: `API Error: ${errorMessage2}`,
|
|
1004
|
+
apiError: "api_error",
|
|
1005
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
var init_gemini = __esm(() => {
|
|
1010
|
+
init_api();
|
|
1011
|
+
init_debug();
|
|
1012
|
+
init_messages();
|
|
1013
|
+
init_client();
|
|
1014
|
+
init_convertMessages();
|
|
1015
|
+
init_convertTools();
|
|
1016
|
+
init_modelMapping();
|
|
1017
|
+
init_streamAdapter();
|
|
1018
|
+
init_types();
|
|
1019
|
+
});
|
|
1020
|
+
init_gemini();
|
|
1021
|
+
|
|
1022
|
+
export {
|
|
1023
|
+
queryModelGemini
|
|
1024
|
+
};
|