@caspian2026/agent-sdk 0.0.7 → 0.0.9
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/chunk-04h360ha.js +57 -0
- package/dist/{chunk-jmkn11my.js → chunk-04pw5akr.js} +20 -20
- package/dist/{chunk-cd7mmbch.js → chunk-0gpem3pk.js} +46 -45
- package/dist/{chunk-8572g6er.js → chunk-0txtpamh.js} +14 -14
- package/dist/{chunk-4m9df5ef.js → chunk-0v89r445.js} +17 -21
- package/dist/chunk-0vp3wfab.js +12 -0
- package/dist/{chunk-9acr8n74.js → chunk-1486qzk5.js} +6 -4
- package/dist/chunk-1efrnkxx.js +468 -0
- package/dist/chunk-1gaw18rz.js +93 -0
- package/dist/{chunk-ew7mrr5b.js → chunk-1hqb50ne.js} +13 -19
- package/dist/chunk-1hqvvvrt.js +96 -0
- package/dist/{chunk-bgfrg1s9.js → chunk-1hx5g6qy.js} +6 -10
- package/dist/{chunk-3g1vqhyx.js → chunk-1kmwf4vn.js} +17 -21
- package/dist/{chunk-naybw0p0.js → chunk-1nhnn2rg.js} +8 -8
- package/dist/{chunk-f42s8t42.js → chunk-1nvcmzj1.js} +66 -77
- package/dist/{chunk-2f21meep.js → chunk-1v01c96r.js} +1 -1
- package/dist/{chunk-spvdb8m2.js → chunk-1vp22nex.js} +2 -2
- package/dist/{chunk-fnny13es.js → chunk-1yfc1d48.js} +52 -90
- package/dist/{chunk-83e71kz6.js → chunk-2072dpbx.js} +2 -2
- package/dist/{chunk-7rnqsng2.js → chunk-22mfb6bp.js} +19 -19
- package/dist/{chunk-d7886r6a.js → chunk-26wtxbdc.js} +7774 -7774
- package/dist/{chunk-x94btg29.js → chunk-2m32xn94.js} +17 -21
- package/dist/{chunk-mw1kpeg9.js → chunk-2nrarbza.js} +1909 -1377
- package/dist/chunk-2vbash3m.js +331 -0
- package/dist/{chunk-c11swzas.js → chunk-2vteceqh.js} +5 -5
- package/dist/{chunk-h5k7m3dv.js → chunk-2y8x7xt7.js} +2 -2
- package/dist/{chunk-sc3r8ja1.js → chunk-2yxqz99n.js} +9 -9
- package/dist/{chunk-z15sw2rn.js → chunk-35nft36d.js} +205 -261
- package/dist/{chunk-73hc55wr.js → chunk-35z2vxep.js} +49 -48
- package/dist/{chunk-15m49c67.js → chunk-3e28fvn0.js} +2 -2
- package/dist/{chunk-82h5qtz0.js → chunk-3e4r5pmc.js} +3 -3
- package/dist/{chunk-4anwkx68.js → chunk-3fn3ysvs.js} +47 -46
- package/dist/{chunk-4hv90qcz.js → chunk-3mgywd32.js} +1 -1
- package/dist/{chunk-ncvr5h4e.js → chunk-3npsy4c4.js} +46 -45
- package/dist/{chunk-xz655xxa.js → chunk-3pzwd6qq.js} +2 -2
- package/dist/{chunk-70eey1nh.js → chunk-40s88wdg.js} +2 -2
- package/dist/{chunk-41dgt6cv.js → chunk-42a0nyrq.js} +47 -46
- package/dist/{chunk-a6e0hsgy.js → chunk-44t1xk05.js} +46 -45
- package/dist/{chunk-0awwmrwr.js → chunk-4ayjwyqj.js} +2 -2
- package/dist/{chunk-wmqazvaj.js → chunk-4myad919.js} +46 -45
- package/dist/{chunk-8g747a8x.js → chunk-4pbx3g7s.js} +1 -1
- package/dist/chunk-4vtvwg7e.js +99 -0
- package/dist/{chunk-qcnhb4cd.js → chunk-54wn2jdr.js} +3 -3
- package/dist/{chunk-1nk93fqz.js → chunk-5cxjxxx8.js} +2 -7
- package/dist/chunk-5m3m7hr5.js +108 -0
- package/dist/{chunk-v37jby04.js → chunk-5mrc0ps5.js} +37 -41
- package/dist/{chunk-d97v7nqz.js → chunk-5tw3gj5z.js} +47 -46
- package/dist/{chunk-savtj5a5.js → chunk-5zcygjb2.js} +46 -45
- package/dist/{chunk-mk1y74w7.js → chunk-65q3hqkw.js} +17 -21
- package/dist/{chunk-vajwapkf.js → chunk-67wms97m.js} +17 -23
- package/dist/chunk-6cfcqjty.js +441 -0
- package/dist/{chunk-2pn3hdmh.js → chunk-6hs0cptm.js} +56 -55
- package/dist/{chunk-bmbq6nt1.js → chunk-6wzg2hpc.js} +2 -2
- package/dist/chunk-72qa16xm.js +91 -0
- package/dist/chunk-7cdy4aj6.js +150 -0
- package/dist/chunk-7cje7scj.js +1534 -0
- package/dist/{chunk-e7h4qxgw.js → chunk-7etkb4pr.js} +4 -4
- package/dist/{chunk-1ax1znzj.js → chunk-7hrmxpha.js} +6 -6
- package/dist/{chunk-wha6v7za.js → chunk-7krg0dkt.js} +2 -2
- package/dist/{chunk-8g5qecvg.js → chunk-7skyagc2.js} +2 -2
- package/dist/{chunk-hzknr99c.js → chunk-83b2frat.js} +4 -4
- package/dist/{chunk-ze3z2k77.js → chunk-84cdy41j.js} +5 -5
- package/dist/{chunk-bxcfz5gy.js → chunk-87xg6yb4.js} +1 -1
- package/dist/{chunk-nrtksr2p.js → chunk-8b2y3x7a.js} +1 -1
- package/dist/{chunk-1xpvkabk.js → chunk-8ckwc9k8.js} +46 -45
- package/dist/{chunk-n5fmkn61.js → chunk-8jy18nx9.js} +1 -1
- package/dist/{chunk-9s832vcg.js → chunk-93vwm44t.js} +100422 -57117
- package/dist/{chunk-rsgwykdr.js → chunk-9957ffjc.js} +2 -2
- package/dist/{chunk-mnmnk0vk.js → chunk-9byfzaeq.js} +46 -45
- package/dist/chunk-9ewnsd7f.js +31 -0
- package/dist/{chunk-xwg327ys.js → chunk-9w114071.js} +6 -6
- package/dist/chunk-9wf3fc4t.js +29 -0
- package/dist/chunk-9z9teq7p.js +87 -0
- package/dist/{chunk-6p4cyhb3.js → chunk-a6d2q415.js} +2 -2
- package/dist/{chunk-reahw5sg.js → chunk-ay5fvc2r.js} +52 -52
- package/dist/{chunk-4sp1bd4k.js → chunk-ayx9aq2k.js} +47 -46
- package/dist/{chunk-xd7zbrwg.js → chunk-azv68vk1.js} +2 -2
- package/dist/chunk-b547q41s.js +92 -0
- package/dist/{chunk-jgjqa49s.js → chunk-b56smerd.js} +3 -3
- package/dist/{chunk-enkdxqas.js → chunk-b5asw4tj.js} +6 -6
- package/dist/{chunk-nk82j7r2.js → chunk-b6prbsae.js} +7 -7
- package/dist/{chunk-dxc3zg1a.js → chunk-b89ese8r.js} +46 -45
- package/dist/{chunk-094bjqmt.js → chunk-be77bcs8.js} +118 -450
- package/dist/{chunk-9y9mn19n.js → chunk-bf03a1w7.js} +48 -47
- package/dist/{chunk-hzzhz6bk.js → chunk-bjdknxqn.js} +46 -45
- package/dist/{chunk-m87bhhqv.js → chunk-bzatg35k.js} +1 -1
- package/dist/{chunk-d6da7ykp.js → chunk-c4d52460.js} +4 -4
- package/dist/{chunk-cc8k9def.js → chunk-c5zkrd7r.js} +47 -46
- package/dist/{chunk-4140c8xy.js → chunk-c6hsz5ey.js} +20 -24
- package/dist/{chunk-c5fx8078.js → chunk-cay13mxk.js} +15 -31
- package/dist/{chunk-s3hsqf80.js → chunk-cexw1jmv.js} +30 -81
- package/dist/{chunk-cvm2tmwg.js → chunk-ckh4f9ry.js} +20 -24
- package/dist/{chunk-xsqhh4xq.js → chunk-cr1dv2js.js} +50 -48
- package/dist/{chunk-z0gsswja.js → chunk-d8z7pyrb.js} +47 -46
- package/dist/chunk-dexkgxt4.js +211 -0
- package/dist/{chunk-xxw9a0bq.js → chunk-dhwr4fz4.js} +2 -2
- package/dist/{chunk-0ym2z0c7.js → chunk-dj7d67ya.js} +1 -1
- package/dist/chunk-djfq8ws0.js +124 -0
- package/dist/{chunk-x2pvw7xw.js → chunk-dmyedkpw.js} +8 -8
- package/dist/{chunk-6byf11g1.js → chunk-dngfdsm9.js} +108 -102
- package/dist/{chunk-ans094d6.js → chunk-dt3epnwj.js} +9 -9
- package/dist/{chunk-11kx8pnj.js → chunk-dz6zxh89.js} +46 -45
- package/dist/{chunk-q638kksz.js → chunk-e7ag583m.js} +47 -46
- package/dist/{chunk-m2dfsbma.js → chunk-ec6ga5ey.js} +51 -50
- package/dist/{chunk-3t8dtbbb.js → chunk-ecbh4n6q.js} +46 -45
- package/dist/{chunk-1zg9pbp1.js → chunk-ecv9kbtk.js} +11 -9
- package/dist/{chunk-vk664f7z.js → chunk-ecvy1ng2.js} +49 -48
- package/dist/{chunk-wwy9zctx.js → chunk-ef2m4xyz.js} +46 -45
- package/dist/{chunk-8k18jq72.js → chunk-etbb3dss.js} +49 -48
- package/dist/{chunk-jgpmpgx6.js → chunk-etdt1xz3.js} +1 -1
- package/dist/{chunk-eynn8t6t.js → chunk-ev7h351p.js} +4 -4
- package/dist/{chunk-vz0s7fkr.js → chunk-ey0n4emm.js} +46 -45
- package/dist/{chunk-18brvww1.js → chunk-f4tdn7yr.js} +46 -45
- package/dist/{chunk-3dx0vvc1.js → chunk-f4v7t54y.js} +11 -11
- package/dist/{chunk-3xfnvwtv.js → chunk-fesvrjhd.js} +10 -10
- package/dist/{chunk-gmkdyx42.js → chunk-frm7mphm.js} +7 -11
- package/dist/{chunk-tjbyte0q.js → chunk-frwznxnf.js} +3 -3
- package/dist/{chunk-2cszsr9h.js → chunk-ftsdm7y7.js} +54 -53
- package/dist/{chunk-qq0qy55j.js → chunk-g597bz1j.js} +47 -46
- package/dist/chunk-g5pe8dew.js +25 -0
- package/dist/{chunk-7d4bfm01.js → chunk-g78fetxa.js} +46 -45
- package/dist/{chunk-ga86yjm1.js → chunk-gdwdqewd.js} +3 -3
- package/dist/{chunk-qqamxvfj.js → chunk-ghwvqhx9.js} +51 -50
- package/dist/chunk-gkn3jgqn.js +123 -0
- package/dist/{chunk-d78b9d2h.js → chunk-grqhgr2b.js} +3 -3
- package/dist/chunk-grqkx44z.js +90 -0
- package/dist/{chunk-aag7s0gz.js → chunk-gzj94jgg.js} +46 -45
- package/dist/{chunk-zy38jrvg.js → chunk-h3vyya5n.js} +20 -14
- package/dist/{chunk-3t9qyd5r.js → chunk-h4xfadhf.js} +1 -1
- package/dist/chunk-h61d4awv.js +95 -0
- package/dist/{chunk-eps7cerv.js → chunk-hae34yd0.js} +5 -9
- package/dist/{chunk-twj38872.js → chunk-hb1gr101.js} +6 -6
- package/dist/{chunk-t9h8qebb.js → chunk-hg45r671.js} +2 -2
- package/dist/{chunk-m50f6mp5.js → chunk-hg6fwhj1.js} +1 -1
- package/dist/{chunk-nywvvkpj.js → chunk-hgmhngje.js} +4 -4
- package/dist/{chunk-a6pw83yd.js → chunk-hparkfvt.js} +55 -51
- package/dist/{chunk-xhv69ftg.js → chunk-hqjdgc6c.js} +2 -2
- package/dist/{chunk-cha6rd4k.js → chunk-hrhp26d7.js} +55 -54
- package/dist/{chunk-rymqz9ma.js → chunk-hzbr9543.js} +4 -4
- package/dist/{chunk-hjzjr1y9.js → chunk-j0gke393.js} +46 -45
- package/dist/{chunk-yyf72f78.js → chunk-j35mw64g.js} +4 -2
- package/dist/{chunk-425w66ka.js → chunk-j99ms5ep.js} +4 -4
- package/dist/{chunk-ey4j1s04.js → chunk-jgvmjwnx.js} +46 -45
- package/dist/{chunk-t4tgbhrc.js → chunk-jj4zs4gr.js} +46 -45
- package/dist/{chunk-3k65t0n1.js → chunk-jjz3hs34.js} +56 -55
- package/dist/{chunk-68d5h34m.js → chunk-jksf0ax9.js} +51 -49
- package/dist/{chunk-gdhz1652.js → chunk-jqfrz5g9.js} +27 -30
- package/dist/{chunk-q7jnesv8.js → chunk-jsj3fx0g.js} +5 -5
- package/dist/{chunk-vawgyev5.js → chunk-jtgyzqbq.js} +3 -3
- package/dist/{chunk-pxr88dvt.js → chunk-jwpp2bq2.js} +1808 -1643
- package/dist/{chunk-fqy0ymjy.js → chunk-jwwpfq76.js} +49 -45
- package/dist/{chunk-t7vh489d.js → chunk-jxp2j9t5.js} +46 -45
- package/dist/{chunk-zctfbr1v.js → chunk-k7cw1a8a.js} +1 -1
- package/dist/chunk-k8jpbz31.js +62 -0
- package/dist/{chunk-tdbz9gbm.js → chunk-kjqyhxz7.js} +6 -6
- package/dist/{chunk-yc23zxmj.js → chunk-kxrrtr3p.js} +1 -1
- package/dist/chunk-m70n19dz.js +93 -0
- package/dist/{chunk-4nspekjp.js → chunk-mcws22k3.js} +1 -28
- package/dist/{chunk-5ywh2en2.js → chunk-mewywsar.js} +46 -45
- package/dist/{chunk-d3csdgaj.js → chunk-mmhkcj7c.js} +64 -58
- package/dist/{chunk-rm2vtv77.js → chunk-msxggy37.js} +22 -25
- package/dist/{chunk-qp9svhcd.js → chunk-njw0haha.js} +10 -8
- package/dist/{chunk-5rv9c8yd.js → chunk-nrjtxhyr.js} +1 -1
- package/dist/{chunk-nqn45znr.js → chunk-ns7x6xam.js} +9 -9
- package/dist/{chunk-jaaxk89e.js → chunk-nsc89h0n.js} +2 -22
- package/dist/{chunk-z19sd3bt.js → chunk-p4196wzm.js} +5 -5
- package/dist/{chunk-1dgdjrm1.js → chunk-p791ydbm.js} +4 -4
- package/dist/{chunk-4wjdcrjp.js → chunk-p9ny0p2a.js} +13 -13
- package/dist/{chunk-phd1qfpc.js → chunk-pd2vy8hx.js} +5 -5
- package/dist/{chunk-sctapt27.js → chunk-pddf0719.js} +49 -48
- package/dist/{chunk-31k5zj46.js → chunk-pfarypfq.js} +48 -46
- package/dist/{chunk-w4yn8cq7.js → chunk-psm26hv7.js} +8 -8
- package/dist/{chunk-hwn8vetn.js → chunk-pwpk3gm6.js} +10 -10
- package/dist/{chunk-kdtvndzg.js → chunk-q14wrksq.js} +48 -47
- package/dist/{chunk-6zagvgdx.js → chunk-q4f1g9y6.js} +31 -27
- package/dist/{chunk-23jzrwsw.js → chunk-q6tdxy8v.js} +5 -5
- package/dist/chunk-q8hxwh48.js +445 -0
- package/dist/{chunk-eenq3avg.js → chunk-qcrpqjya.js} +1 -1
- package/dist/{chunk-e7efcp3k.js → chunk-qctsv1d7.js} +257 -2857
- package/dist/{chunk-ck0ap688.js → chunk-qkczt8cr.js} +4 -4
- package/dist/{chunk-f81dwk5k.js → chunk-qkp4ygnk.js} +2 -2
- package/dist/{chunk-x968ydc6.js → chunk-qqs58ywv.js} +7 -7
- package/dist/{chunk-c5sd36sr.js → chunk-qxjhw1dt.js} +29 -30
- package/dist/{chunk-rkg741k3.js → chunk-qz0xdht6.js} +14 -14
- package/dist/chunk-r3ehjkj5.js +123 -0
- package/dist/{chunk-n404hpdz.js → chunk-r5nd93kc.js} +1 -1
- package/dist/{chunk-8ezp9zbc.js → chunk-r6nnp8mj.js} +46 -45
- package/dist/{chunk-k0kvs7dv.js → chunk-r7684mmh.js} +5 -5
- package/dist/chunk-ratnrv9v.js +517 -0
- package/dist/{chunk-2s9vbdg2.js → chunk-rfbbcx5s.js} +46 -45
- package/dist/{chunk-z9n0183s.js → chunk-rfq9kmsy.js} +9 -9
- package/dist/{chunk-9s563c87.js → chunk-rhvn1rqs.js} +2 -2
- package/dist/{chunk-gvrjgq1n.js → chunk-rjq5nf1c.js} +16 -20
- package/dist/{chunk-xp61y5ba.js → chunk-rkv8bdtr.js} +2 -2
- package/dist/{chunk-cb2vt4h9.js → chunk-rmpaj37q.js} +48 -47
- package/dist/{chunk-gx13py0x.js → chunk-rn1s097c.js} +46 -45
- package/dist/{chunk-3zs49z47.js → chunk-rnxpvm3m.js} +1 -1
- package/dist/{chunk-2fr1hsfn.js → chunk-rpsqtvkx.js} +46 -45
- package/dist/{chunk-1fyvnmsg.js → chunk-rx4mcfg1.js} +55 -54
- package/dist/{chunk-qpj44gjs.js → chunk-rygxwjtc.js} +47 -46
- package/dist/{chunk-jpc9zwsk.js → chunk-rz94yg8c.js} +3 -3
- package/dist/{chunk-wgcacskp.js → chunk-s19b0bc7.js} +46 -45
- package/dist/{chunk-wayfjcwt.js → chunk-sdfvr9ps.js} +4 -4
- package/dist/{chunk-w83b25cn.js → chunk-sh2v9ywv.js} +5 -3
- package/dist/{chunk-1avzakfd.js → chunk-sjpqw47t.js} +3 -3
- package/dist/{chunk-7mqab3z7.js → chunk-skp5w8bq.js} +1 -1
- package/dist/{chunk-76j2e9vy.js → chunk-snxp8mxj.js} +2 -2
- package/dist/{chunk-vsqwd13w.js → chunk-ssb4wba6.js} +17 -19
- package/dist/{chunk-rztjnjhv.js → chunk-szzff973.js} +7 -5
- package/dist/{chunk-x3brs7xp.js → chunk-t1pygy19.js} +47 -46
- package/dist/{chunk-jf493266.js → chunk-t1s91wrk.js} +1 -1
- package/dist/{chunk-h6zzdk99.js → chunk-t3gmfcy7.js} +47 -46
- package/dist/{chunk-5vmrxh5r.js → chunk-t9eeyrkn.js} +48 -47
- package/dist/{chunk-0jtbeesf.js → chunk-tf859h88.js} +16 -20
- package/dist/{chunk-0wextpj6.js → chunk-thenr6b3.js} +14 -12
- package/dist/{chunk-79vr8d0q.js → chunk-thmtkfgj.js} +5 -5
- package/dist/chunk-tj7v47cp.js +20 -0
- package/dist/{chunk-68ereakd.js → chunk-tpk67mjc.js} +3 -3
- package/dist/chunk-trvc6jh7.js +92 -0
- package/dist/{chunk-hr9zwhyh.js → chunk-ttyfhx12.js} +524 -195
- package/dist/{chunk-fg8sh9td.js → chunk-txgbs4hp.js} +49 -48
- package/dist/{chunk-ze3cbhkf.js → chunk-ty1cyqr7.js} +49 -48
- package/dist/{chunk-r6kaak61.js → chunk-v0tgjdx0.js} +16 -20
- package/dist/chunk-v3s93bzd.js +34 -0
- package/dist/{chunk-4cp6193g.js → chunk-v4t6dyyh.js} +2 -2
- package/dist/{chunk-msh77ewm.js → chunk-v4wba09w.js} +46 -45
- package/dist/{chunk-9nf2vp4m.js → chunk-v5g8nf5h.js} +8 -8
- package/dist/{chunk-at1nwv1b.js → chunk-v6hbqcmr.js} +44 -43
- package/dist/{chunk-21gmrwhs.js → chunk-vajsk9ya.js} +17 -21
- package/dist/{chunk-8hpq2659.js → chunk-vbtm9g57.js} +1 -1
- package/dist/{chunk-5n83ds1r.js → chunk-vk3nb2xe.js} +51 -56
- package/dist/{chunk-sm4a1dhp.js → chunk-vmbht6ec.js} +12 -12
- package/dist/{chunk-as5rvw4n.js → chunk-vmp5rk8q.js} +17 -21
- package/dist/{chunk-02hqbd8r.js → chunk-vtmxgm1m.js} +4 -4
- package/dist/{chunk-prxcckgh.js → chunk-vw5jzpcm.js} +6 -6
- package/dist/{chunk-76fnknvb.js → chunk-vyz3v0qx.js} +5 -5
- package/dist/{chunk-067nrwpq.js → chunk-w3782jck.js} +51 -50
- package/dist/{chunk-fxjhzm1r.js → chunk-w3gnkyfc.js} +57 -66
- package/dist/chunk-w6mcmmt5.js +1457 -0
- package/dist/chunk-wa0xgm6m.js +988 -0
- package/dist/{chunk-vrjbc8ap.js → chunk-wa8yn2p0.js} +1 -1
- package/dist/{chunk-y93xtfqa.js → chunk-wg47eg7y.js} +46 -45
- package/dist/{chunk-y7we499r.js → chunk-wgd4n1q7.js} +8 -8
- package/dist/{chunk-0g5cy3wj.js → chunk-wgk9sxk7.js} +4 -4
- package/dist/{chunk-wr3pd88n.js → chunk-wkt2q02c.js} +40 -9
- package/dist/{chunk-w22nawab.js → chunk-wm1zm5xj.js} +4 -2
- package/dist/{chunk-yd45cbwe.js → chunk-wtpgjmjd.js} +49 -46
- package/dist/{chunk-zrg1tbjz.js → chunk-wxkrq9eb.js} +46 -45
- package/dist/{chunk-st5zy0wn.js → chunk-x2bnzvd6.js} +46 -45
- package/dist/{chunk-80ajr65m.js → chunk-x3jthbjq.js} +47 -46
- package/dist/chunk-x7fdwq3d.js +33 -0
- package/dist/{chunk-1myhsm69.js → chunk-xcrzgyce.js} +46 -45
- package/dist/{chunk-chsyvavm.js → chunk-xeb6075z.js} +1 -1
- package/dist/{chunk-9ky3xjag.js → chunk-xffb3dsw.js} +1 -1
- package/dist/{chunk-k3vwp17j.js → chunk-xgbd6ec5.js} +47 -46
- package/dist/{chunk-n7pnyq43.js → chunk-xhfmdq1y.js} +16 -0
- package/dist/{chunk-96dakveq.js → chunk-xhn4ptjn.js} +51 -50
- package/dist/{chunk-rkf6m79g.js → chunk-xs7zsmzk.js} +46 -45
- package/dist/chunk-xswyz2es.js +118 -0
- package/dist/{chunk-ky39hkg1.js → chunk-xtdm6ejq.js} +9 -7
- package/dist/{chunk-hh3k5s1s.js → chunk-xvk90wpt.js} +3 -3
- package/dist/{chunk-tcsh7s9s.js → chunk-xw99fqv1.js} +14 -6
- package/dist/{chunk-xnv6kb39.js → chunk-y32em34x.js} +22 -23
- package/dist/chunk-y5wfy524.js +94 -0
- package/dist/{chunk-avddtws1.js → chunk-ya9dxex0.js} +48 -46
- package/dist/{chunk-97wgdsab.js → chunk-z16txqz0.js} +3 -3
- package/dist/{chunk-yvtzznds.js → chunk-z6wm96eh.js} +2 -2
- package/dist/{chunk-b7h31fmf.js → chunk-zcgprbyy.js} +29 -27
- package/dist/chunk-zqbnw3n2.js +197 -0
- package/dist/{chunk-d6rypdxt.js → chunk-zxywawr7.js} +1 -1
- package/dist/{chunk-3j5mbnax.js → chunk-zyjkg76f.js} +7 -7
- package/dist/cli.js +8 -8
- package/dist/gateway/index.js +326 -0
- package/dist/gateway/worker.js +482241 -0
- package/package.json +1 -1
- package/dist/chunk-02f1t77x.js +0 -73
- package/dist/chunk-0y3ae4ty.js +0 -116
- package/dist/chunk-1h11d405.js +0 -117
- package/dist/chunk-238bwjt4.js +0 -92
- package/dist/chunk-2n868zv8.js +0 -89
- package/dist/chunk-6ye0jmx5.js +0 -91
- package/dist/chunk-74c00z2d.js +0 -90
- package/dist/chunk-8xwx1xtg.js +0 -120
- package/dist/chunk-99ze7d94.js +0 -93
- package/dist/chunk-a3ce0rwj.js +0 -654
- package/dist/chunk-cfv996bs.js +0 -22
- package/dist/chunk-czdrs0bx.js +0 -516
- package/dist/chunk-dms7egdz.js +0 -111
- package/dist/chunk-e5t5eefc.js +0 -62
- package/dist/chunk-eq4cfq5r.js +0 -145
- package/dist/chunk-fg6ezbz3.js +0 -95
- package/dist/chunk-h4c232ns.js +0 -91
- package/dist/chunk-hmdxn1qn.js +0 -92
- package/dist/chunk-k9bmm1hz.js +0 -1003
- package/dist/chunk-kjftjh83.js +0 -86
- package/dist/chunk-kjkac4wp.js +0 -88
- package/dist/chunk-mqj8zx52.js +0 -116
- package/dist/chunk-mrhpct12.js +0 -95
- package/dist/chunk-njrt3tac.js +0 -640
- package/dist/chunk-qvh1w3t7.js +0 -157
- package/dist/chunk-qz2x630m.js +0 -49145
- package/dist/chunk-r6bex8wg.js +0 -40
- package/dist/chunk-rm40kgv5.js +0 -91
- package/dist/chunk-v0krc430.js +0 -436
- package/dist/chunk-v2cdga08.js +0 -93
- package/dist/chunk-waewz1gq.js +0 -94
- package/dist/chunk-wdgdax51.js +0 -91
- package/dist/chunk-x50zdpbb.js +0 -120
- package/dist/chunk-y0fhjxef.js +0 -276
- package/dist/chunk-ychc8xwz.js +0 -92
- package/dist/chunk-ymq56dxr.js +0 -87
- package/dist/chunk-zt62qnf5.js +0 -369
package/dist/chunk-czdrs0bx.js
DELETED
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
OpenAI,
|
|
4
|
-
adaptOpenAIStreamToAnthropic,
|
|
5
|
-
anthropicMessagesToOpenAI,
|
|
6
|
-
anthropicToolChoiceToOpenAI,
|
|
7
|
-
anthropicToolsToOpenAI,
|
|
8
|
-
init_convertMessages,
|
|
9
|
-
init_convertTools,
|
|
10
|
-
init_openai,
|
|
11
|
-
init_streamAdapter
|
|
12
|
-
} from "./chunk-mw1kpeg9.js";
|
|
13
|
-
import {
|
|
14
|
-
addToTotalSessionCost,
|
|
15
|
-
createAssistantAPIErrorMessage,
|
|
16
|
-
extractDiscoveredToolNames,
|
|
17
|
-
getEmptyToolPermissionContext,
|
|
18
|
-
init_Tool,
|
|
19
|
-
init_api,
|
|
20
|
-
init_cost_tracker,
|
|
21
|
-
init_messages1 as init_messages,
|
|
22
|
-
init_toolSearch,
|
|
23
|
-
isToolSearchEnabled,
|
|
24
|
-
normalizeContentFromAPI,
|
|
25
|
-
normalizeMessagesForAPI,
|
|
26
|
-
toolMatchesName,
|
|
27
|
-
toolToAPISchema
|
|
28
|
-
} from "./chunk-9s832vcg.js";
|
|
29
|
-
import"./chunk-jpc9zwsk.js";
|
|
30
|
-
import"./chunk-hwfknpxv.js";
|
|
31
|
-
import"./chunk-4nspekjp.js";
|
|
32
|
-
import"./chunk-jzthz1bx.js";
|
|
33
|
-
import"./chunk-1gx78081.js";
|
|
34
|
-
import"./chunk-qcnhb4cd.js";
|
|
35
|
-
import"./chunk-sc3r8ja1.js";
|
|
36
|
-
import"./chunk-2gzv8nrw.js";
|
|
37
|
-
import"./chunk-ehtwnxpg.js";
|
|
38
|
-
import"./chunk-wr3pd88n.js";
|
|
39
|
-
import"./chunk-wayfjcwt.js";
|
|
40
|
-
import"./chunk-cgfdkzhb.js";
|
|
41
|
-
import"./chunk-bxcfz5gy.js";
|
|
42
|
-
import"./chunk-y0fhjxef.js";
|
|
43
|
-
import"./chunk-j5bth84e.js";
|
|
44
|
-
import"./chunk-nk82j7r2.js";
|
|
45
|
-
import"./chunk-68ffk5qa.js";
|
|
46
|
-
import"./chunk-ps49ymvj.js";
|
|
47
|
-
import"./chunk-p7vkh4wx.js";
|
|
48
|
-
import"./chunk-bmbq6nt1.js";
|
|
49
|
-
import {
|
|
50
|
-
TOOL_SEARCH_TOOL_NAME,
|
|
51
|
-
init_prompt,
|
|
52
|
-
isDeferredTool
|
|
53
|
-
} from "./chunk-yc23zxmj.js";
|
|
54
|
-
import"./chunk-njrt3tac.js";
|
|
55
|
-
import"./chunk-m87bhhqv.js";
|
|
56
|
-
import"./chunk-xwg327ys.js";
|
|
57
|
-
import"./chunk-xz655xxa.js";
|
|
58
|
-
import"./chunk-c11swzas.js";
|
|
59
|
-
import"./chunk-chsyvavm.js";
|
|
60
|
-
import"./chunk-5rv9c8yd.js";
|
|
61
|
-
import {
|
|
62
|
-
calculateUSDCost,
|
|
63
|
-
getModelMaxOutputTokens,
|
|
64
|
-
init_context,
|
|
65
|
-
init_modelCost
|
|
66
|
-
} from "./chunk-e7efcp3k.js";
|
|
67
|
-
import"./chunk-z19sd3bt.js";
|
|
68
|
-
import"./chunk-1ax1znzj.js";
|
|
69
|
-
import"./chunk-6nsd9606.js";
|
|
70
|
-
import"./chunk-xp61y5ba.js";
|
|
71
|
-
import"./chunk-64c1avct.js";
|
|
72
|
-
import {
|
|
73
|
-
getProxyFetchOptions,
|
|
74
|
-
init_proxy
|
|
75
|
-
} from "./chunk-wha6v7za.js";
|
|
76
|
-
import"./chunk-8g5pe1gr.js";
|
|
77
|
-
import"./chunk-4cp6193g.js";
|
|
78
|
-
import"./chunk-8g747a8x.js";
|
|
79
|
-
import"./chunk-d7886r6a.js";
|
|
80
|
-
import"./chunk-yvtzznds.js";
|
|
81
|
-
import"./chunk-4jm600zv.js";
|
|
82
|
-
import"./chunk-qz2x630m.js";
|
|
83
|
-
import"./chunk-2f21meep.js";
|
|
84
|
-
import"./chunk-nrtksr2p.js";
|
|
85
|
-
import"./chunk-3c25bcsw.js";
|
|
86
|
-
import"./chunk-s3hsqf80.js";
|
|
87
|
-
import"./chunk-yyf72f78.js";
|
|
88
|
-
import"./chunk-cdz5yb0r.js";
|
|
89
|
-
import"./chunk-c7jwbe76.js";
|
|
90
|
-
import"./chunk-0vkfrmqm.js";
|
|
91
|
-
import"./chunk-7sgtxrsc.js";
|
|
92
|
-
import"./chunk-0xjaqda8.js";
|
|
93
|
-
import"./chunk-x8d2ehd7.js";
|
|
94
|
-
import"./chunk-15m49c67.js";
|
|
95
|
-
import"./chunk-tdbz9gbm.js";
|
|
96
|
-
import"./chunk-0awwmrwr.js";
|
|
97
|
-
import"./chunk-qnfx3qtx.js";
|
|
98
|
-
import"./chunk-70eey1nh.js";
|
|
99
|
-
import"./chunk-1nk93fqz.js";
|
|
100
|
-
import"./chunk-s8kj6ajy.js";
|
|
101
|
-
import"./chunk-eenq3avg.js";
|
|
102
|
-
import"./chunk-7mqab3z7.js";
|
|
103
|
-
import"./chunk-5z28bqne.js";
|
|
104
|
-
import"./chunk-qajrkk97.js";
|
|
105
|
-
import {
|
|
106
|
-
init_debug,
|
|
107
|
-
logForDebugging
|
|
108
|
-
} from "./chunk-phd1qfpc.js";
|
|
109
|
-
import"./chunk-fbv4apne.js";
|
|
110
|
-
import {
|
|
111
|
-
init_envUtils,
|
|
112
|
-
isEnvDefinedFalsy,
|
|
113
|
-
isEnvTruthy
|
|
114
|
-
} from "./chunk-jaaxk89e.js";
|
|
115
|
-
import"./chunk-k8vp0atq.js";
|
|
116
|
-
import"./chunk-vf612n57.js";
|
|
117
|
-
import"./chunk-07069jq1.js";
|
|
118
|
-
import"./chunk-d4mdda98.js";
|
|
119
|
-
import"./chunk-55raexh7.js";
|
|
120
|
-
import"./chunk-v9smspw2.js";
|
|
121
|
-
import"./chunk-v1kzp02e.js";
|
|
122
|
-
import"./chunk-7wm5s02e.js";
|
|
123
|
-
import"./chunk-b0kf00ff.js";
|
|
124
|
-
import"./chunk-netzwgv1.js";
|
|
125
|
-
import {
|
|
126
|
-
__esm,
|
|
127
|
-
__require
|
|
128
|
-
} from "./chunk-qp2qdcda.js";
|
|
129
|
-
|
|
130
|
-
// src/services/api/openai/client.ts
|
|
131
|
-
function getOpenAIClient(options) {
|
|
132
|
-
if (cachedClient)
|
|
133
|
-
return cachedClient;
|
|
134
|
-
const apiKey = process.env.OPENAI_API_KEY || "";
|
|
135
|
-
const baseURL = process.env.OPENAI_BASE_URL;
|
|
136
|
-
const client = new OpenAI({
|
|
137
|
-
apiKey,
|
|
138
|
-
...baseURL && { baseURL },
|
|
139
|
-
maxRetries: options?.maxRetries ?? 0,
|
|
140
|
-
timeout: parseInt(process.env.API_TIMEOUT_MS || String(600 * 1000), 10),
|
|
141
|
-
dangerouslyAllowBrowser: true,
|
|
142
|
-
...process.env.OPENAI_ORG_ID && { organization: process.env.OPENAI_ORG_ID },
|
|
143
|
-
...process.env.OPENAI_PROJECT_ID && { project: process.env.OPENAI_PROJECT_ID },
|
|
144
|
-
fetchOptions: getProxyFetchOptions({ forAnthropicAPI: false }),
|
|
145
|
-
...options?.fetchOverride && { fetch: options.fetchOverride }
|
|
146
|
-
});
|
|
147
|
-
if (!options?.fetchOverride) {
|
|
148
|
-
cachedClient = client;
|
|
149
|
-
}
|
|
150
|
-
return client;
|
|
151
|
-
}
|
|
152
|
-
var cachedClient = null;
|
|
153
|
-
var init_client = __esm(() => {
|
|
154
|
-
init_openai();
|
|
155
|
-
init_proxy();
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// src/services/api/openai/modelMapping.ts
|
|
159
|
-
function getModelFamily(model) {
|
|
160
|
-
if (/haiku/i.test(model))
|
|
161
|
-
return "haiku";
|
|
162
|
-
if (/opus/i.test(model))
|
|
163
|
-
return "opus";
|
|
164
|
-
if (/sonnet/i.test(model))
|
|
165
|
-
return "sonnet";
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
function resolveOpenAIModel(anthropicModel) {
|
|
169
|
-
if (process.env.OPENAI_MODEL) {
|
|
170
|
-
return process.env.OPENAI_MODEL;
|
|
171
|
-
}
|
|
172
|
-
const cleanModel = anthropicModel.replace(/\[1m\]$/, "");
|
|
173
|
-
const family = getModelFamily(cleanModel);
|
|
174
|
-
if (family) {
|
|
175
|
-
const openaiEnvVar = `OPENAI_DEFAULT_${family.toUpperCase()}_MODEL`;
|
|
176
|
-
const openaiOverride = process.env[openaiEnvVar];
|
|
177
|
-
if (openaiOverride)
|
|
178
|
-
return openaiOverride;
|
|
179
|
-
const anthropicEnvVar = `ANTHROPIC_DEFAULT_${family.toUpperCase()}_MODEL`;
|
|
180
|
-
const anthropicOverride = process.env[anthropicEnvVar];
|
|
181
|
-
if (anthropicOverride)
|
|
182
|
-
return anthropicOverride;
|
|
183
|
-
}
|
|
184
|
-
return DEFAULT_MODEL_MAP[cleanModel] ?? cleanModel;
|
|
185
|
-
}
|
|
186
|
-
var DEFAULT_MODEL_MAP;
|
|
187
|
-
var init_modelMapping = __esm(() => {
|
|
188
|
-
DEFAULT_MODEL_MAP = {
|
|
189
|
-
"claude-sonnet-4-20250514": "gpt-4o",
|
|
190
|
-
"claude-sonnet-4-5-20250929": "gpt-4o",
|
|
191
|
-
"claude-sonnet-4-6": "gpt-4o",
|
|
192
|
-
"claude-opus-4-20250514": "o3",
|
|
193
|
-
"claude-opus-4-1-20250805": "o3",
|
|
194
|
-
"claude-opus-4-5-20251101": "o3",
|
|
195
|
-
"claude-opus-4-6": "o3",
|
|
196
|
-
"claude-haiku-4-5-20251001": "gpt-4o-mini",
|
|
197
|
-
"claude-3-5-haiku-20241022": "gpt-4o-mini",
|
|
198
|
-
"claude-3-7-sonnet-20250219": "gpt-4o",
|
|
199
|
-
"claude-3-5-sonnet-20241022": "gpt-4o"
|
|
200
|
-
};
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
// src/services/api/openai/index.ts
|
|
204
|
-
import { randomUUID } from "crypto";
|
|
205
|
-
function isOpenAIThinkingEnabled(model) {
|
|
206
|
-
if (isEnvDefinedFalsy(process.env.OPENAI_ENABLE_THINKING))
|
|
207
|
-
return false;
|
|
208
|
-
if (isEnvTruthy(process.env.OPENAI_ENABLE_THINKING))
|
|
209
|
-
return true;
|
|
210
|
-
const modelLower = model.toLowerCase();
|
|
211
|
-
return modelLower.includes("deepseek-reasoner") || modelLower.includes("deepseek-v3.2");
|
|
212
|
-
}
|
|
213
|
-
function buildOpenAIRequestBody(params) {
|
|
214
|
-
const { model, messages, tools, toolChoice, enableThinking, maxTokens, temperatureOverride } = params;
|
|
215
|
-
return {
|
|
216
|
-
model,
|
|
217
|
-
messages,
|
|
218
|
-
max_tokens: maxTokens,
|
|
219
|
-
...tools.length > 0 && {
|
|
220
|
-
tools,
|
|
221
|
-
...toolChoice && { tool_choice: toolChoice }
|
|
222
|
-
},
|
|
223
|
-
stream: true,
|
|
224
|
-
stream_options: { include_usage: true },
|
|
225
|
-
...enableThinking && {
|
|
226
|
-
thinking: { type: "enabled" },
|
|
227
|
-
enable_thinking: true,
|
|
228
|
-
chat_template_kwargs: { thinking: true }
|
|
229
|
-
},
|
|
230
|
-
...!enableThinking && temperatureOverride !== undefined && {
|
|
231
|
-
temperature: temperatureOverride
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
function assembleFinalAssistantOutputs(params) {
|
|
236
|
-
const { partialMessage, contentBlocks, tools, agentId, usage, stopReason, maxTokens } = params;
|
|
237
|
-
const outputs = [];
|
|
238
|
-
const allBlocks = Object.keys(contentBlocks).sort((a, b) => Number(a) - Number(b)).map((k) => contentBlocks[Number(k)]).filter(Boolean);
|
|
239
|
-
if (allBlocks.length > 0) {
|
|
240
|
-
outputs.push({
|
|
241
|
-
message: {
|
|
242
|
-
...partialMessage,
|
|
243
|
-
content: normalizeContentFromAPI(allBlocks, tools, agentId),
|
|
244
|
-
usage,
|
|
245
|
-
stop_reason: stopReason,
|
|
246
|
-
stop_sequence: null
|
|
247
|
-
},
|
|
248
|
-
requestId: undefined,
|
|
249
|
-
type: "assistant",
|
|
250
|
-
uuid: randomUUID(),
|
|
251
|
-
timestamp: new Date().toISOString()
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
if (stopReason === "max_tokens") {
|
|
255
|
-
outputs.push(createAssistantAPIErrorMessage({
|
|
256
|
-
content: `Output truncated: response exceeded the ${maxTokens} token limit. ` + `Set CLAUDE_CODE_MAX_OUTPUT_TOKENS to override.`,
|
|
257
|
-
apiError: "max_output_tokens",
|
|
258
|
-
error: "max_output_tokens"
|
|
259
|
-
}));
|
|
260
|
-
}
|
|
261
|
-
return outputs;
|
|
262
|
-
}
|
|
263
|
-
async function* queryModelOpenAI(messages, systemPrompt, tools, signal, options) {
|
|
264
|
-
try {
|
|
265
|
-
const openaiModel = resolveOpenAIModel(options.model);
|
|
266
|
-
const messagesForAPI = normalizeMessagesForAPI(messages, tools);
|
|
267
|
-
const useToolSearch = await isToolSearchEnabled(options.model, tools, options.getToolPermissionContext || (async () => getEmptyToolPermissionContext()), options.agents || [], options.querySource);
|
|
268
|
-
const deferredToolNames = new Set;
|
|
269
|
-
if (useToolSearch) {
|
|
270
|
-
for (const t of tools) {
|
|
271
|
-
if (isDeferredTool(t))
|
|
272
|
-
deferredToolNames.add(t.name);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
let filteredTools = tools;
|
|
276
|
-
if (useToolSearch && deferredToolNames.size > 0) {
|
|
277
|
-
const discoveredToolNames = extractDiscoveredToolNames(messages);
|
|
278
|
-
filteredTools = tools.filter((tool) => {
|
|
279
|
-
if (!deferredToolNames.has(tool.name))
|
|
280
|
-
return true;
|
|
281
|
-
if (toolMatchesName(tool, TOOL_SEARCH_TOOL_NAME))
|
|
282
|
-
return true;
|
|
283
|
-
return discoveredToolNames.has(tool.name);
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
const toolSchemas = await Promise.all(filteredTools.map((tool) => toolToAPISchema(tool, {
|
|
287
|
-
getToolPermissionContext: options.getToolPermissionContext,
|
|
288
|
-
tools,
|
|
289
|
-
agents: options.agents,
|
|
290
|
-
allowedAgentTypes: options.allowedAgentTypes,
|
|
291
|
-
model: options.model,
|
|
292
|
-
deferLoading: useToolSearch && deferredToolNames.has(tool.name)
|
|
293
|
-
})));
|
|
294
|
-
const standardTools = toolSchemas.filter((t) => {
|
|
295
|
-
const anyT = t;
|
|
296
|
-
return anyT.type !== "advisor_20260301" && anyT.type !== "computer_20250124";
|
|
297
|
-
});
|
|
298
|
-
const enableThinking = isOpenAIThinkingEnabled(openaiModel);
|
|
299
|
-
const openaiMessages = anthropicMessagesToOpenAI(messagesForAPI, systemPrompt, {
|
|
300
|
-
enableThinking
|
|
301
|
-
});
|
|
302
|
-
const openaiTools = anthropicToolsToOpenAI(standardTools);
|
|
303
|
-
const openaiToolChoice = anthropicToolChoiceToOpenAI(options.toolChoice);
|
|
304
|
-
if (useToolSearch) {
|
|
305
|
-
const includedDeferredTools = filteredTools.filter((t) => deferredToolNames.has(t.name)).length;
|
|
306
|
-
logForDebugging(`[OpenAI] Tool search enabled: ${includedDeferredTools}/${deferredToolNames.size} deferred tools included, total tools=${openaiTools.length}`);
|
|
307
|
-
} else {
|
|
308
|
-
logForDebugging(`[OpenAI] Tool search disabled, total tools=${openaiTools.length}`);
|
|
309
|
-
}
|
|
310
|
-
const { upperLimit } = getModelMaxOutputTokens(openaiModel);
|
|
311
|
-
const maxTokens = options.maxOutputTokensOverride ?? upperLimit;
|
|
312
|
-
const client = getOpenAIClient({
|
|
313
|
-
maxRetries: 0,
|
|
314
|
-
fetchOverride: options.fetchOverride,
|
|
315
|
-
source: options.querySource
|
|
316
|
-
});
|
|
317
|
-
const debugTimestamp = Date.now();
|
|
318
|
-
const debugRequestData = {
|
|
319
|
-
model: openaiModel,
|
|
320
|
-
systemPrompt_text: systemPrompt.join(`
|
|
321
|
-
|
|
322
|
-
`),
|
|
323
|
-
openai_messages_preview: openaiMessages.slice(0, 3).map((m) => ({
|
|
324
|
-
role: m.role,
|
|
325
|
-
content_preview: typeof m.content === "string" ? m.content.substring(0, 500) : JSON.stringify(m.content)?.substring(0, 500)
|
|
326
|
-
})),
|
|
327
|
-
tools_names: openaiTools.map((t) => t.function?.name ?? t.name)
|
|
328
|
-
};
|
|
329
|
-
logForDebugging(`[OpenAI] Calling model=${openaiModel}, messages=${openaiMessages.length}, tools=${openaiTools.length}, thinking=${enableThinking}`);
|
|
330
|
-
const requestBody = buildOpenAIRequestBody({
|
|
331
|
-
model: openaiModel,
|
|
332
|
-
messages: openaiMessages,
|
|
333
|
-
tools: openaiTools,
|
|
334
|
-
toolChoice: openaiToolChoice,
|
|
335
|
-
enableThinking,
|
|
336
|
-
maxTokens,
|
|
337
|
-
temperatureOverride: options.temperatureOverride
|
|
338
|
-
});
|
|
339
|
-
const stream = await client.chat.completions.create(requestBody, { signal });
|
|
340
|
-
const adaptedStream = adaptOpenAIStreamToAnthropic(stream, openaiModel);
|
|
341
|
-
const contentBlocks = {};
|
|
342
|
-
let partialMessage;
|
|
343
|
-
let stopReason = null;
|
|
344
|
-
let usage = {
|
|
345
|
-
input_tokens: 0,
|
|
346
|
-
output_tokens: 0,
|
|
347
|
-
cache_creation_input_tokens: 0,
|
|
348
|
-
cache_read_input_tokens: 0
|
|
349
|
-
};
|
|
350
|
-
let ttftMs = 0;
|
|
351
|
-
const start = Date.now();
|
|
352
|
-
for await (const event of adaptedStream) {
|
|
353
|
-
switch (event.type) {
|
|
354
|
-
case "message_start": {
|
|
355
|
-
partialMessage = event.message;
|
|
356
|
-
ttftMs = Date.now() - start;
|
|
357
|
-
if (event.message?.usage) {
|
|
358
|
-
usage = {
|
|
359
|
-
...usage,
|
|
360
|
-
...event.message.usage
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
case "content_block_start": {
|
|
366
|
-
const idx = event.index;
|
|
367
|
-
const cb = event.content_block;
|
|
368
|
-
if (cb.type === "tool_use") {
|
|
369
|
-
contentBlocks[idx] = { ...cb, input: "" };
|
|
370
|
-
} else if (cb.type === "text") {
|
|
371
|
-
contentBlocks[idx] = { ...cb, text: "" };
|
|
372
|
-
} else if (cb.type === "thinking") {
|
|
373
|
-
contentBlocks[idx] = { ...cb, thinking: "", signature: "" };
|
|
374
|
-
} else {
|
|
375
|
-
contentBlocks[idx] = { ...cb };
|
|
376
|
-
}
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
case "content_block_delta": {
|
|
380
|
-
const idx = event.index;
|
|
381
|
-
const delta = event.delta;
|
|
382
|
-
const block = contentBlocks[idx];
|
|
383
|
-
if (!block)
|
|
384
|
-
break;
|
|
385
|
-
if (delta.type === "text_delta") {
|
|
386
|
-
block.text = (block.text || "") + delta.text;
|
|
387
|
-
} else if (delta.type === "input_json_delta") {
|
|
388
|
-
block.input = (block.input || "") + delta.partial_json;
|
|
389
|
-
} else if (delta.type === "thinking_delta") {
|
|
390
|
-
block.thinking = (block.thinking || "") + delta.thinking;
|
|
391
|
-
} else if (delta.type === "signature_delta") {
|
|
392
|
-
block.signature = delta.signature;
|
|
393
|
-
}
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
case "content_block_stop": {
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
case "message_delta": {
|
|
400
|
-
const deltaUsage = event.usage;
|
|
401
|
-
if (deltaUsage) {
|
|
402
|
-
usage = { ...usage, ...deltaUsage };
|
|
403
|
-
}
|
|
404
|
-
if (event.delta?.stop_reason != null) {
|
|
405
|
-
stopReason = event.delta.stop_reason;
|
|
406
|
-
}
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
case "message_stop": {
|
|
410
|
-
if (partialMessage) {
|
|
411
|
-
for (const output of assembleFinalAssistantOutputs({
|
|
412
|
-
partialMessage,
|
|
413
|
-
contentBlocks,
|
|
414
|
-
tools,
|
|
415
|
-
agentId: options.agentId,
|
|
416
|
-
usage,
|
|
417
|
-
stopReason,
|
|
418
|
-
maxTokens
|
|
419
|
-
})) {
|
|
420
|
-
yield output;
|
|
421
|
-
}
|
|
422
|
-
partialMessage = null;
|
|
423
|
-
}
|
|
424
|
-
if (usage.input_tokens + usage.output_tokens > 0) {
|
|
425
|
-
const costUSD = calculateUSDCost(openaiModel, usage);
|
|
426
|
-
addToTotalSessionCost(costUSD, usage, options.model);
|
|
427
|
-
}
|
|
428
|
-
break;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
yield {
|
|
432
|
-
type: "stream_event",
|
|
433
|
-
event,
|
|
434
|
-
...event.type === "message_start" ? { ttftMs } : undefined
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
if (partialMessage) {
|
|
438
|
-
for (const output of assembleFinalAssistantOutputs({
|
|
439
|
-
partialMessage,
|
|
440
|
-
contentBlocks,
|
|
441
|
-
tools,
|
|
442
|
-
agentId: options.agentId,
|
|
443
|
-
usage,
|
|
444
|
-
stopReason,
|
|
445
|
-
maxTokens
|
|
446
|
-
})) {
|
|
447
|
-
yield output;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
try {
|
|
451
|
-
const { writeFileSync, mkdirSync } = await import("fs");
|
|
452
|
-
const { join } = await import("path");
|
|
453
|
-
const { tmpdir } = await import("os");
|
|
454
|
-
const debugDir = join(tmpdir(), "claude-code-debug");
|
|
455
|
-
mkdirSync(debugDir, { recursive: true });
|
|
456
|
-
const debugFile = join(debugDir, `openai-${debugTimestamp}.json`);
|
|
457
|
-
const allBlocks = Object.keys(contentBlocks).sort((a, b) => Number(a) - Number(b)).map((k) => contentBlocks[Number(k)]).filter(Boolean);
|
|
458
|
-
const debugPayload = {
|
|
459
|
-
timestamp: new Date(debugTimestamp).toISOString(),
|
|
460
|
-
model: openaiModel,
|
|
461
|
-
request: debugRequestData,
|
|
462
|
-
response: {
|
|
463
|
-
stop_reason: stopReason,
|
|
464
|
-
usage,
|
|
465
|
-
content_blocks: allBlocks.map((b) => {
|
|
466
|
-
if (b.type === "text")
|
|
467
|
-
return { type: "text", text: b.text };
|
|
468
|
-
if (b.type === "thinking")
|
|
469
|
-
return { type: "thinking", thinking_preview: b.thinking?.substring(0, 200) };
|
|
470
|
-
if (b.type === "tool_use")
|
|
471
|
-
return { type: "tool_use", name: b.name, input_preview: typeof b.input === "string" ? b.input.substring(0, 500) : b.input };
|
|
472
|
-
return { type: b.type };
|
|
473
|
-
}),
|
|
474
|
-
duration_ms: Date.now() - start
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
writeFileSync(debugFile, JSON.stringify(debugPayload, null, 2), "utf-8");
|
|
478
|
-
logForDebugging(`[DEBUG] OpenAI request+response dumped to ${debugFile}`);
|
|
479
|
-
} catch (e) {
|
|
480
|
-
logForDebugging(`[DEBUG] Failed to dump OpenAI debug file: ${e}`);
|
|
481
|
-
}
|
|
482
|
-
} catch (error) {
|
|
483
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
484
|
-
logForDebugging(`[OpenAI] Error: ${errorMessage}`, { level: "error" });
|
|
485
|
-
yield createAssistantAPIErrorMessage({
|
|
486
|
-
content: `API Error: ${errorMessage}`,
|
|
487
|
-
apiError: "api_error",
|
|
488
|
-
error: error instanceof Error ? error : new Error(String(error))
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
var init_openai2 = __esm(() => {
|
|
493
|
-
init_client();
|
|
494
|
-
init_convertMessages();
|
|
495
|
-
init_convertTools();
|
|
496
|
-
init_streamAdapter();
|
|
497
|
-
init_modelMapping();
|
|
498
|
-
init_messages();
|
|
499
|
-
init_api();
|
|
500
|
-
init_Tool();
|
|
501
|
-
init_debug();
|
|
502
|
-
init_cost_tracker();
|
|
503
|
-
init_modelCost();
|
|
504
|
-
init_envUtils();
|
|
505
|
-
init_context();
|
|
506
|
-
init_messages();
|
|
507
|
-
init_toolSearch();
|
|
508
|
-
init_prompt();
|
|
509
|
-
});
|
|
510
|
-
init_openai2();
|
|
511
|
-
|
|
512
|
-
export {
|
|
513
|
-
queryModelOpenAI,
|
|
514
|
-
isOpenAIThinkingEnabled,
|
|
515
|
-
buildOpenAIRequestBody
|
|
516
|
-
};
|
package/dist/chunk-dms7egdz.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
checkAndDisableBypassPermissionsIfNeeded,
|
|
4
|
-
init_bypassPermissionsKillswitch,
|
|
5
|
-
resetBypassPermissionsCheck
|
|
6
|
-
} from "./chunk-ymq56dxr.js";
|
|
7
|
-
import {
|
|
8
|
-
init_useMainLoopModel,
|
|
9
|
-
useMainLoopModel
|
|
10
|
-
} from "./chunk-9acr8n74.js";
|
|
11
|
-
import {
|
|
12
|
-
ConfigurableShortcutHint,
|
|
13
|
-
ConsoleOAuthFlow,
|
|
14
|
-
init_ConfigurableShortcutHint,
|
|
15
|
-
init_ConsoleOAuthFlow,
|
|
16
|
-
init_messages1 as init_messages,
|
|
17
|
-
init_policyLimits,
|
|
18
|
-
refreshPolicyLimits,
|
|
19
|
-
stripSignatureBlocks
|
|
20
|
-
} from "./chunk-9s832vcg.js";
|
|
21
|
-
import {
|
|
22
|
-
init_growthbook,
|
|
23
|
-
init_user,
|
|
24
|
-
refreshGrowthBookAfterAuthChange,
|
|
25
|
-
resetUserCache
|
|
26
|
-
} from "./chunk-e7efcp3k.js";
|
|
27
|
-
import {
|
|
28
|
-
Dialog,
|
|
29
|
-
ThemedText,
|
|
30
|
-
init_src
|
|
31
|
-
} from "./chunk-c7jwbe76.js";
|
|
32
|
-
import {
|
|
33
|
-
require_jsx_dev_runtime
|
|
34
|
-
} from "./chunk-7sgtxrsc.js";
|
|
35
|
-
import {
|
|
36
|
-
init_state,
|
|
37
|
-
resetCostState
|
|
38
|
-
} from "./chunk-k8vp0atq.js";
|
|
39
|
-
import {
|
|
40
|
-
__esm,
|
|
41
|
-
__toESM
|
|
42
|
-
} from "./chunk-qp2qdcda.js";
|
|
43
|
-
|
|
44
|
-
// src/commands/login/login.tsx
|
|
45
|
-
async function call(onDone, context) {
|
|
46
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Login, {
|
|
47
|
-
onDone: async (success) => {
|
|
48
|
-
context.onChangeAPIKey();
|
|
49
|
-
context.setMessages(stripSignatureBlocks);
|
|
50
|
-
if (success) {
|
|
51
|
-
resetCostState();
|
|
52
|
-
refreshRemoteManagedSettings();
|
|
53
|
-
refreshPolicyLimits();
|
|
54
|
-
resetUserCache();
|
|
55
|
-
refreshGrowthBookAfterAuthChange();
|
|
56
|
-
clearTrustedDeviceToken();
|
|
57
|
-
enrollTrustedDevice();
|
|
58
|
-
resetBypassPermissionsCheck();
|
|
59
|
-
const appState = context.getAppState();
|
|
60
|
-
checkAndDisableBypassPermissionsIfNeeded(appState.toolPermissionContext, context.setAppState);
|
|
61
|
-
if (false) {}
|
|
62
|
-
context.setAppState((prev) => ({
|
|
63
|
-
...prev,
|
|
64
|
-
authVersion: prev.authVersion + 1
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
onDone(success ? "Login successful" : "Login interrupted");
|
|
68
|
-
}
|
|
69
|
-
}, undefined, false, undefined, this);
|
|
70
|
-
}
|
|
71
|
-
function Login(props) {
|
|
72
|
-
const mainLoopModel = useMainLoopModel();
|
|
73
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
|
|
74
|
-
title: "Login",
|
|
75
|
-
onCancel: () => props.onDone(false, mainLoopModel),
|
|
76
|
-
color: "permission",
|
|
77
|
-
inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
78
|
-
children: [
|
|
79
|
-
"Press ",
|
|
80
|
-
exitState.keyName,
|
|
81
|
-
" again to exit"
|
|
82
|
-
]
|
|
83
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
|
|
84
|
-
action: "confirm:no",
|
|
85
|
-
context: "Confirmation",
|
|
86
|
-
fallback: "Esc",
|
|
87
|
-
description: "cancel"
|
|
88
|
-
}, undefined, false, undefined, this),
|
|
89
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConsoleOAuthFlow, {
|
|
90
|
-
onDone: () => props.onDone(true, mainLoopModel),
|
|
91
|
-
startingMessage: props.startingMessage
|
|
92
|
-
}, undefined, false, undefined, this)
|
|
93
|
-
}, undefined, false, undefined, this);
|
|
94
|
-
}
|
|
95
|
-
var jsx_dev_runtime, clearTrustedDeviceToken = () => {}, enrollTrustedDevice = async () => {}, refreshRemoteManagedSettings = async () => {};
|
|
96
|
-
var init_login = __esm(() => {
|
|
97
|
-
init_state();
|
|
98
|
-
init_ConfigurableShortcutHint();
|
|
99
|
-
init_ConsoleOAuthFlow();
|
|
100
|
-
init_src();
|
|
101
|
-
init_useMainLoopModel();
|
|
102
|
-
init_src();
|
|
103
|
-
init_growthbook();
|
|
104
|
-
init_policyLimits();
|
|
105
|
-
init_messages();
|
|
106
|
-
init_bypassPermissionsKillswitch();
|
|
107
|
-
init_user();
|
|
108
|
-
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
export { call, Login, init_login };
|
package/dist/chunk-e5t5eefc.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
init_client,
|
|
4
|
-
isOAuthTokenExpired
|
|
5
|
-
} from "./chunk-njrt3tac.js";
|
|
6
|
-
import {
|
|
7
|
-
getAuthHeaders,
|
|
8
|
-
getClaudeAIOAuthTokens,
|
|
9
|
-
getClaudeCodeUserAgent,
|
|
10
|
-
hasProfileScope,
|
|
11
|
-
init_auth,
|
|
12
|
-
init_http,
|
|
13
|
-
init_userAgent,
|
|
14
|
-
isClaudeAISubscriber
|
|
15
|
-
} from "./chunk-e7efcp3k.js";
|
|
16
|
-
import {
|
|
17
|
-
getOauthConfig,
|
|
18
|
-
init_oauth
|
|
19
|
-
} from "./chunk-s3hsqf80.js";
|
|
20
|
-
import {
|
|
21
|
-
axios_default,
|
|
22
|
-
init_axios
|
|
23
|
-
} from "./chunk-55raexh7.js";
|
|
24
|
-
import {
|
|
25
|
-
__esm
|
|
26
|
-
} from "./chunk-qp2qdcda.js";
|
|
27
|
-
|
|
28
|
-
// src/services/api/usage.ts
|
|
29
|
-
async function fetchUtilization() {
|
|
30
|
-
if (!isClaudeAISubscriber() || !hasProfileScope()) {
|
|
31
|
-
return {};
|
|
32
|
-
}
|
|
33
|
-
const tokens = getClaudeAIOAuthTokens();
|
|
34
|
-
if (tokens && isOAuthTokenExpired(tokens.expiresAt)) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
const authResult = getAuthHeaders();
|
|
38
|
-
if (authResult.error) {
|
|
39
|
-
throw new Error(`Auth error: ${authResult.error}`);
|
|
40
|
-
}
|
|
41
|
-
const headers = {
|
|
42
|
-
"Content-Type": "application/json",
|
|
43
|
-
"User-Agent": getClaudeCodeUserAgent(),
|
|
44
|
-
...authResult.headers
|
|
45
|
-
};
|
|
46
|
-
const url = `${getOauthConfig().BASE_API_URL}/api/oauth/usage`;
|
|
47
|
-
const response = await axios_default.get(url, {
|
|
48
|
-
headers,
|
|
49
|
-
timeout: 5000
|
|
50
|
-
});
|
|
51
|
-
return response.data;
|
|
52
|
-
}
|
|
53
|
-
var init_usage = __esm(() => {
|
|
54
|
-
init_axios();
|
|
55
|
-
init_oauth();
|
|
56
|
-
init_auth();
|
|
57
|
-
init_http();
|
|
58
|
-
init_userAgent();
|
|
59
|
-
init_client();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export { fetchUtilization, init_usage };
|