@caspian2026/agent-sdk 0.0.8 → 0.0.11
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-dtgh4te6.js → chunk-0ac6r0fw.js} +46 -45
- package/dist/{chunk-cfgha78n.js → chunk-0dm971mw.js} +2 -2
- package/dist/{chunk-0mej3p7q.js → chunk-0f5anjkb.js} +14 -14
- package/dist/{chunk-6g5qbbxk.js → chunk-0k9sft0s.js} +47 -46
- package/dist/chunk-0kgwksm1.js +57 -0
- package/dist/chunk-0vp3wfab.js +12 -0
- package/dist/{chunk-d9yghsfg.js → chunk-1etzkkxs.js} +1 -1
- package/dist/{chunk-a4npwxvb.js → chunk-1gz2wrhq.js} +46 -45
- package/dist/{chunk-25bwa70y.js → chunk-1pr4hr5x.js} +49 -48
- package/dist/{chunk-2f21meep.js → chunk-1v01c96r.js} +1 -1
- package/dist/{chunk-jvmybb06.js → chunk-1vhjn1j9.js} +46 -45
- package/dist/{chunk-69r3hm9b.js → chunk-1wr6ag3j.js} +13 -19
- package/dist/{chunk-83e71kz6.js → chunk-2072dpbx.js} +2 -2
- package/dist/{chunk-8hpq2659.js → chunk-24t2wjab.js} +1 -1
- package/dist/{chunk-q7e0106d.js → chunk-2589k4k0.js} +51 -56
- package/dist/{chunk-d7886r6a.js → chunk-26wtxbdc.js} +7774 -7774
- package/dist/{chunk-ahrhwpm9.js → chunk-28k13wc7.js} +2 -2
- package/dist/{chunk-vvjgdzhn.js → chunk-2cr43hzw.js} +55 -51
- package/dist/{chunk-mw1kpeg9.js → chunk-2sqhjnpn.js} +1909 -1377
- package/dist/chunk-2tfe2zs1.js +87 -0
- package/dist/{chunk-c11swzas.js → chunk-2vteceqh.js} +5 -5
- package/dist/{chunk-zmra45az.js → chunk-2z9rak9s.js} +47 -46
- package/dist/chunk-31bwdrm5.js +93 -0
- package/dist/{chunk-2xbyb015.js → chunk-38rkx4cj.js} +47 -46
- package/dist/{chunk-am3qcgzp.js → chunk-394djs3v.js} +56 -55
- package/dist/{chunk-15m49c67.js → chunk-3e28fvn0.js} +2 -2
- package/dist/{chunk-4hv90qcz.js → chunk-3mgywd32.js} +1 -1
- package/dist/{chunk-234668cb.js → chunk-3we6j8b4.js} +5 -5
- package/dist/{chunk-7rnqsng2.js → chunk-400r5gmq.js} +19 -19
- package/dist/{chunk-yc23zxmj.js → chunk-4057dtxd.js} +1 -1
- package/dist/{chunk-70eey1nh.js → chunk-40s88wdg.js} +2 -2
- package/dist/{chunk-8nfn89nz.js → chunk-41en0cc6.js} +9 -9
- package/dist/{chunk-t5vbqd9d.js → chunk-488spx13.js} +55 -54
- package/dist/{chunk-9v13f3gm.js → chunk-49bs7x5p.js} +558 -196
- package/dist/{chunk-0awwmrwr.js → chunk-4ayjwyqj.js} +2 -2
- package/dist/chunk-4d0g9n3q.js +92 -0
- package/dist/{chunk-denyma1s.js → chunk-4fh25m1z.js} +14 -12
- package/dist/chunk-4hgxxzdw.js +94 -0
- package/dist/{chunk-8g747a8x.js → chunk-4pbx3g7s.js} +1 -1
- package/dist/{chunk-fkhs3myp.js → chunk-4pj88fnc.js} +5 -3
- package/dist/{chunk-st73prx0.js → chunk-4re879ja.js} +47 -46
- package/dist/{chunk-pb92bj1h.js → chunk-50art2hr.js} +6 -6
- package/dist/{chunk-1nk93fqz.js → chunk-5cxjxxx8.js} +2 -7
- package/dist/{chunk-kek5v6ef.js → chunk-5pqq0nym.js} +3 -3
- package/dist/{chunk-nk82j7r2.js → chunk-6696fngv.js} +7 -7
- package/dist/{chunk-ya40p6vj.js → chunk-66dk94r4.js} +46 -45
- package/dist/{chunk-xrpstt41.js → chunk-67808qek.js} +4 -4
- package/dist/{chunk-zhk465tg.js → chunk-69841w77.js} +46 -45
- package/dist/{chunk-jgzxmtpf.js → chunk-6ebvysef.js} +52 -52
- package/dist/{chunk-bmbq6nt1.js → chunk-6wzg2hpc.js} +2 -2
- package/dist/{chunk-12k745vf.js → chunk-6zsxtysq.js} +3 -3
- package/dist/{chunk-qcnhb4cd.js → chunk-75qqeec8.js} +3 -3
- package/dist/{chunk-nvwwtq1w.js → chunk-765zdaq8.js} +49 -48
- package/dist/{chunk-zq6ezxh2.js → chunk-7ce8wn1f.js} +49 -45
- package/dist/{chunk-e7h4qxgw.js → chunk-7etkb4pr.js} +4 -4
- package/dist/{chunk-wha6v7za.js → chunk-7krg0dkt.js} +2 -2
- package/dist/{chunk-nqrc7pc4.js → chunk-7p2vw8qe.js} +29 -27
- package/dist/{chunk-q1ah9nbq.js → chunk-7t5ymv2m.js} +1 -1
- package/dist/{chunk-xz655xxa.js → chunk-7tphrzjj.js} +2 -2
- package/dist/{chunk-hzknr99c.js → chunk-83b2frat.js} +4 -4
- package/dist/{chunk-bxcfz5gy.js → chunk-87xg6yb4.js} +1 -1
- package/dist/{chunk-nrtksr2p.js → chunk-8b2y3x7a.js} +1 -1
- package/dist/{chunk-1cq2vrzq.js → chunk-8c907cv9.js} +4 -4
- package/dist/{chunk-88cekjja.js → chunk-8dzg4nr5.js} +47 -46
- package/dist/{chunk-2fxpd35d.js → chunk-8hn2xqjz.js} +2 -2
- package/dist/{chunk-3g1vqhyx.js → chunk-8kmna3cc.js} +17 -21
- package/dist/{chunk-1zhy5cbc.js → chunk-8r5eevap.js} +13 -13
- package/dist/{chunk-7n51wk9k.js → chunk-8vkv63c5.js} +2 -2
- package/dist/{chunk-268jd0rc.js → chunk-8w21adpe.js} +6 -4
- package/dist/{chunk-21gmrwhs.js → chunk-8w8d1k7b.js} +17 -21
- package/dist/{chunk-yzcjz0gg.js → chunk-90bqyqfd.js} +46 -45
- package/dist/{chunk-2xvc97x4.js → chunk-942yq6xx.js} +3 -3
- package/dist/{chunk-88xc4d7f.js → chunk-99ck62v1.js} +49 -48
- package/dist/chunk-9ewnsd7f.js +31 -0
- package/dist/{chunk-xwg327ys.js → chunk-9g29z3dv.js} +6 -6
- package/dist/{chunk-5a5w0ygx.js → chunk-9nj016rn.js} +2 -2
- package/dist/chunk-9nk34wee.js +441 -0
- package/dist/{chunk-2v4x8kaq.js → chunk-9z45660r.js} +51 -50
- package/dist/{chunk-s1tg295x.js → chunk-a3gq2vv4.js} +10 -8
- package/dist/{chunk-6p4cyhb3.js → chunk-a6d2q415.js} +2 -2
- package/dist/{chunk-0jtbeesf.js → chunk-akqsq8bn.js} +16 -20
- package/dist/{chunk-tff58196.js → chunk-aqq5qh2y.js} +48 -47
- package/dist/{chunk-dvcwahst.js → chunk-awdftfcf.js} +51 -50
- package/dist/{chunk-3zxswxtg.js → chunk-b3nkagky.js} +2 -2
- package/dist/{chunk-jgjqa49s.js → chunk-b56smerd.js} +3 -3
- package/dist/{chunk-enkdxqas.js → chunk-b5asw4tj.js} +6 -6
- package/dist/{chunk-1x0y4426.js → chunk-b8f5dz5b.js} +4 -4
- package/dist/{chunk-30smv00b.js → chunk-bayvqjm6.js} +47 -46
- package/dist/chunk-bgyb0z0p.js +96 -0
- package/dist/{chunk-3skj4gfg.js → chunk-bhabqhx1.js} +47 -46
- package/dist/{chunk-4140c8xy.js → chunk-bj85dnsy.js} +20 -24
- package/dist/{chunk-vdcm8hz6.js → chunk-bp4s0gry.js} +47 -46
- package/dist/{chunk-d00mfc1e.js → chunk-brng9f4q.js} +46 -45
- package/dist/{chunk-a3ws4gae.js → chunk-bvdzmdw4.js} +47 -46
- package/dist/{chunk-m87bhhqv.js → chunk-bzatg35k.js} +1 -1
- package/dist/{chunk-hxzt3r84.js → chunk-ca72efeb.js} +51 -50
- package/dist/{chunk-vajwapkf.js → chunk-cdact4jj.js} +17 -23
- package/dist/{chunk-s3hsqf80.js → chunk-cexw1jmv.js} +30 -81
- package/dist/chunk-cfyvkbe5.js +197 -0
- package/dist/{chunk-jj5wj46b.js → chunk-cjca0q27.js} +7 -7
- package/dist/{chunk-3hwa20vg.js → chunk-cs9aqzag.js} +49 -46
- package/dist/{chunk-1ax1znzj.js → chunk-cttezxcb.js} +24 -14
- package/dist/chunk-d2g976qe.js +1457 -0
- package/dist/{chunk-d6rypdxt.js → chunk-d7ws01qk.js} +1 -1
- package/dist/{chunk-xxw9a0bq.js → chunk-dhwr4fz4.js} +2 -2
- package/dist/{chunk-x2pvw7xw.js → chunk-dmyedkpw.js} +8 -8
- package/dist/{chunk-af868wet.js → chunk-dsqfe05n.js} +46 -45
- package/dist/{chunk-4r50c14n.js → chunk-e82vbky2.js} +46 -45
- package/dist/{chunk-vawgyev5.js → chunk-eba0b85f.js} +3 -3
- package/dist/{chunk-87e209aj.js → chunk-eqnfk1g0.js} +46 -45
- package/dist/chunk-erj5nc8b.js +92 -0
- package/dist/{chunk-ky39hkg1.js → chunk-eseq7djh.js} +9 -7
- package/dist/{chunk-vvsbvz2b.js → chunk-esrkw9v4.js} +2 -2
- package/dist/{chunk-jgpmpgx6.js → chunk-etdt1xz3.js} +1 -1
- package/dist/{chunk-w05jpkkr.js → chunk-ewbvcf88.js} +5 -9
- package/dist/chunk-ewhxddsa.js +445 -0
- package/dist/{chunk-jjh7m5sg.js → chunk-ey1pg5v8.js} +66 -77
- package/dist/{chunk-h02gcdx5.js → chunk-f1v8h236.js} +8 -8
- package/dist/chunk-f70fwxds.js +211 -0
- package/dist/{chunk-1dwvgrfc.js → chunk-f73trmvk.js} +46 -45
- package/dist/{chunk-xnv6kb39.js → chunk-fcww10dt.js} +22 -23
- package/dist/{chunk-15edybe0.js → chunk-fhprmgf4.js} +1 -1
- package/dist/{chunk-5awgsvrw.js → chunk-fnf4av18.js} +14 -6
- package/dist/{chunk-j4m8fd76.js → chunk-fy543pwf.js} +7 -11
- package/dist/chunk-fybanr7d.js +988 -0
- package/dist/chunk-g5epkvz2.js +331 -0
- package/dist/chunk-g5pe8dew.js +25 -0
- package/dist/chunk-g8183rkv.js +517 -0
- package/dist/{chunk-4g0nj78p.js → chunk-gbztsm42.js} +46 -45
- package/dist/{chunk-ga86yjm1.js → chunk-gdwdqewd.js} +3 -3
- package/dist/{chunk-kva79cra.js → chunk-ge57c9hg.js} +7 -5
- package/dist/{chunk-f2hbn5rk.js → chunk-ggq2y3tn.js} +100420 -57118
- package/dist/{chunk-w0gmf6bv.js → chunk-gpzkzg7v.js} +47 -46
- package/dist/{chunk-v0bykh19.js → chunk-gw1a82j8.js} +108 -102
- package/dist/chunk-gw1g065z.js +20 -0
- package/dist/{chunk-21jsjcfa.js → chunk-h4dnamt5.js} +46 -45
- package/dist/{chunk-hh3k5s1s.js → chunk-h5mkzk0z.js} +3 -3
- package/dist/chunk-h7dm24cc.js +108 -0
- package/dist/{chunk-wr3pd88n.js → chunk-hadww3nd.js} +40 -9
- package/dist/{chunk-8ywngxqt.js → chunk-hapvn84d.js} +10 -10
- package/dist/{chunk-gbte7d7h.js → chunk-hekf5s9q.js} +4 -2
- package/dist/{chunk-veap97he.js → chunk-hkgb5y9f.js} +46 -45
- package/dist/{chunk-23fkapww.js → chunk-hzceftr4.js} +2 -2
- package/dist/chunk-j2x6fp25.js +29 -0
- package/dist/{chunk-vsqwd13w.js → chunk-j30g8fd1.js} +17 -19
- package/dist/{chunk-yyf72f78.js → chunk-j35mw64g.js} +4 -2
- package/dist/{chunk-qq5d2s0d.js → chunk-j3awswy3.js} +46 -45
- package/dist/{chunk-dmqeqxfz.js → chunk-j513wqe9.js} +46 -45
- package/dist/{chunk-hya4c599.js → chunk-jkens34n.js} +46 -45
- package/dist/{chunk-s4zb3f1b.js → chunk-jperb6n2.js} +46 -45
- package/dist/{chunk-psnsve7m.js → chunk-jqmr6ag1.js} +49 -48
- package/dist/{chunk-q7jnesv8.js → chunk-jsj3fx0g.js} +5 -5
- package/dist/{chunk-w1sv7j01.js → chunk-jx6k8msx.js} +46 -45
- package/dist/{chunk-xw8pjerk.js → chunk-jyz65rfv.js} +48 -47
- package/dist/{chunk-1avzakfd.js → chunk-k5mckm5f.js} +3 -3
- package/dist/{chunk-zctfbr1v.js → chunk-k7cw1a8a.js} +1 -1
- package/dist/{chunk-m46xyqr6.js → chunk-k9z36r5q.js} +48 -47
- package/dist/{chunk-th4y838y.js → chunk-kamesdff.js} +51 -50
- package/dist/{chunk-y7we499r.js → chunk-kj4m0j4n.js} +8 -8
- package/dist/{chunk-tdbz9gbm.js → chunk-kjqyhxz7.js} +6 -6
- package/dist/{chunk-k0v0cz71.js → chunk-m25yfqc3.js} +46 -45
- package/dist/{chunk-4nspekjp.js → chunk-mcws22k3.js} +1 -28
- package/dist/chunk-mgpj5f7h.js +150 -0
- package/dist/{chunk-1ybvj5df.js → chunk-mmn62bh2.js} +47 -46
- package/dist/{chunk-jpc9zwsk.js → chunk-mq94v5vn.js} +3 -3
- package/dist/{chunk-a1bf2kh4.js → chunk-msvv7dpt.js} +46 -45
- package/dist/chunk-mtv83pq4.js +123 -0
- package/dist/chunk-n36xjgtj.js +95 -0
- package/dist/{chunk-twqzmqsn.js → chunk-n9d0gg9z.js} +31 -27
- package/dist/{chunk-cvm2tmwg.js → chunk-na63s9wn.js} +20 -24
- package/dist/{chunk-jtztm8f5.js → chunk-nebntwvd.js} +44 -43
- package/dist/{chunk-0ym2z0c7.js → chunk-nj02kck4.js} +1 -1
- 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-gnj7tyj6.js → chunk-nv7vcqme.js} +49 -48
- package/dist/{chunk-z19sd3bt.js → chunk-p4196wzm.js} +5 -5
- package/dist/{chunk-as5rvw4n.js → chunk-pbeee2kp.js} +17 -21
- package/dist/{chunk-va8drjmv.js → chunk-pcbm66ch.js} +48 -47
- package/dist/{chunk-phd1qfpc.js → chunk-pd2vy8hx.js} +5 -5
- package/dist/chunk-pe3n0w2t.js +91 -0
- package/dist/{chunk-bd5sqj86.js → chunk-peh3mj19.js} +11 -11
- package/dist/{chunk-mk1y74w7.js → chunk-pepgckn4.js} +17 -21
- package/dist/{chunk-wqvr37xp.js → chunk-pm67yj46.js} +15 -31
- package/dist/{chunk-qyqpb15f.js → chunk-pp8nrx40.js} +205 -261
- package/dist/{chunk-nx7c354z.js → chunk-pq5290db.js} +46 -45
- package/dist/{chunk-w4yn8cq7.js → chunk-psm26hv7.js} +8 -8
- package/dist/{chunk-hwn8vetn.js → chunk-pwpk3gm6.js} +10 -10
- package/dist/chunk-pzp8fj0a.js +123 -0
- package/dist/{chunk-x94btg29.js → chunk-q1j8ebyf.js} +17 -21
- package/dist/{chunk-87scz097.js → chunk-q2fn2p7y.js} +46 -45
- package/dist/chunk-q347821k.js +99 -0
- package/dist/{chunk-23jzrwsw.js → chunk-q6tdxy8v.js} +5 -5
- package/dist/{chunk-byb2mn1c.js → chunk-qb88vpgy.js} +118 -450
- package/dist/{chunk-eenq3avg.js → chunk-qcrpqjya.js} +1 -1
- package/dist/chunk-qehbwde1.js +90 -0
- package/dist/{chunk-ck0ap688.js → chunk-qkczt8cr.js} +4 -4
- package/dist/{chunk-c3d2cnz5.js → chunk-qmmxwh8x.js} +7 -7
- package/dist/{chunk-1a6ez1mg.js → chunk-qxmm3jbn.js} +51 -49
- package/dist/{chunk-njxgct8f.js → chunk-qywk2c7m.js} +46 -45
- package/dist/{chunk-rkg741k3.js → chunk-qz0xdht6.js} +14 -14
- package/dist/chunk-r0dpeqg0.js +468 -0
- package/dist/{chunk-6ksdp40n.js → chunk-r0m970pk.js} +1 -1
- package/dist/{chunk-fape0yfp.js → chunk-r5bf0h0t.js} +46 -45
- package/dist/{chunk-jcwkgtbp.js → chunk-r7xpsch7.js} +52 -90
- package/dist/{chunk-z9n0183s.js → chunk-rfq9kmsy.js} +9 -9
- package/dist/{chunk-xp61y5ba.js → chunk-rkv8bdtr.js} +2 -2
- package/dist/{chunk-5cem2v7n.js → chunk-rkvwts6v.js} +5 -5
- package/dist/{chunk-1vnd9s2j.js → chunk-rm4c8zd9.js} +57 -66
- package/dist/{chunk-e7efcp3k.js → chunk-rm9gb396.js} +257 -2857
- package/dist/{chunk-0m9w9esf.js → chunk-s213xmp8.js} +46 -45
- package/dist/{chunk-c42pqnxx.js → chunk-s3s0611n.js} +1 -1
- package/dist/{chunk-qdnxk7d7.js → chunk-scrk9jbt.js} +29 -30
- package/dist/{chunk-wayfjcwt.js → chunk-sdfvr9ps.js} +4 -4
- package/dist/{chunk-7mqab3z7.js → chunk-skp5w8bq.js} +1 -1
- package/dist/{chunk-76j2e9vy.js → chunk-snxp8mxj.js} +2 -2
- package/dist/{chunk-ad3v6mzw.js → chunk-tgmettzd.js} +12 -12
- package/dist/{chunk-cdj51xbj.js → chunk-tj6hejny.js} +46 -45
- package/dist/chunk-tn0xnp8a.js +124 -0
- package/dist/chunk-tpn6rh31.js +62 -0
- package/dist/{chunk-qsc98gbe.js → chunk-tq4vws6e.js} +2 -2
- package/dist/{chunk-ydcsbj4t.js → chunk-tzzzbb9d.js} +11 -9
- package/dist/chunk-v3s93bzd.js +34 -0
- package/dist/{chunk-4cp6193g.js → chunk-v4t6dyyh.js} +2 -2
- package/dist/{chunk-xfkfh5sd.js → chunk-v6fcbmqz.js} +1808 -1643
- package/dist/{chunk-k7g9gcr9.js → chunk-vc59jf3q.js} +64 -58
- package/dist/{chunk-gdhz1652.js → chunk-vdk9b74d.js} +27 -30
- package/dist/{chunk-tvzr9c8a.js → chunk-vf9c1649.js} +46 -45
- package/dist/{chunk-naybw0p0.js → chunk-vgk0nymz.js} +8 -8
- package/dist/{chunk-jh965sa0.js → chunk-vgzpbh28.js} +47 -46
- package/dist/{chunk-q87kegxh.js → chunk-vhxrn87v.js} +49 -48
- package/dist/chunk-vnzgpyrz.js +1534 -0
- package/dist/{chunk-r6kaak61.js → chunk-vqh6cjfx.js} +16 -20
- package/dist/{chunk-wbbykfdd.js → chunk-vz3pa5n6.js} +1 -1
- package/dist/{chunk-pwqm47kn.js → chunk-w1h5z2sy.js} +46 -45
- package/dist/{chunk-rm2vtv77.js → chunk-w2vvxj1f.js} +22 -25
- package/dist/{chunk-s7q42kp2.js → chunk-w5zezk61.js} +9 -9
- package/dist/{chunk-vrjbc8ap.js → chunk-wa8yn2p0.js} +1 -1
- package/dist/{chunk-a3wczqrp.js → chunk-wahqac7c.js} +37 -41
- package/dist/{chunk-qvd3hbqs.js → chunk-wc0np2zw.js} +5 -5
- package/dist/{chunk-2j3v2dgk.js → chunk-wcpmtszh.js} +47 -46
- package/dist/{chunk-jxfp3g9b.js → chunk-wdzjtdye.js} +4 -4
- package/dist/{chunk-0g5cy3wj.js → chunk-wgk9sxk7.js} +4 -4
- package/dist/{chunk-rc9x0raa.js → chunk-wmbpjx7v.js} +56 -55
- package/dist/chunk-wrsy4y58.js +93 -0
- package/dist/{chunk-rtmh0v4c.js → chunk-wskkym13.js} +6 -6
- package/dist/{chunk-bm5rc541.js → chunk-wt6v1zbe.js} +5 -5
- package/dist/{chunk-37p5p94r.js → chunk-wyj3wpjv.js} +55 -54
- package/dist/chunk-x7fdwq3d.js +33 -0
- package/dist/{chunk-6t5zvnrg.js → chunk-xdg2rpj3.js} +48 -46
- package/dist/{chunk-chsyvavm.js → chunk-xeb6075z.js} +1 -1
- package/dist/{chunk-23q4jpn2.js → chunk-xemw9d52.js} +3 -3
- package/dist/{chunk-n7pnyq43.js → chunk-xhfmdq1y.js} +16 -0
- package/dist/{chunk-jmkn11my.js → chunk-xmdny0m1.js} +20 -20
- package/dist/chunk-xswyz2es.js +118 -0
- package/dist/{chunk-67a4147x.js → chunk-xv5a2xbe.js} +1 -1
- package/dist/{chunk-1dgdjrm1.js → chunk-xx709m24.js} +4 -4
- package/dist/{chunk-qn8z4r79.js → chunk-y024419t.js} +50 -48
- package/dist/{chunk-dbwmzvfj.js → chunk-y1ps26mz.js} +46 -45
- package/dist/{chunk-4m9df5ef.js → chunk-y2r5e6kv.js} +17 -21
- package/dist/{chunk-k1crm94z.js → chunk-y41svpxw.js} +46 -45
- package/dist/{chunk-qjyg1dv7.js → chunk-ygwcq4vd.js} +6 -10
- package/dist/{chunk-fk8crdnk.js → chunk-ykv414dd.js} +48 -46
- package/dist/{chunk-g5pgham9.js → chunk-ynkzfhs1.js} +20 -14
- package/dist/{chunk-gvrjgq1n.js → chunk-yrqx3p9k.js} +16 -20
- package/dist/{chunk-c9dmpdss.js → chunk-ys17e80d.js} +46 -45
- package/dist/{chunk-97wgdsab.js → chunk-z16txqz0.js} +3 -3
- package/dist/{chunk-yvtzznds.js → chunk-z6wm96eh.js} +2 -2
- package/dist/{chunk-8ybw2s0h.js → chunk-zbb7qd0v.js} +4 -4
- package/dist/{chunk-030rqd3a.js → chunk-zjxv5g2n.js} +54 -53
- package/dist/{chunk-425w66ka.js → chunk-zmwgp2sh.js} +4 -4
- package/dist/cli.js +8 -8
- package/dist/gateway/index.js +430 -0
- package/dist/gateway/worker.js +482687 -0
- package/package.json +1 -1
- package/dist/chunk-11cz07kz.js +0 -93
- package/dist/chunk-1pbtp2z2.js +0 -92
- package/dist/chunk-25y2dtzf.js +0 -91
- package/dist/chunk-3hyj0zpy.js +0 -95
- package/dist/chunk-4kqjjakw.js +0 -73
- package/dist/chunk-4zwqbg7s.js +0 -87
- package/dist/chunk-5be33wja.js +0 -120
- package/dist/chunk-70mgxhkz.js +0 -369
- package/dist/chunk-7gmk09cq.js +0 -116
- package/dist/chunk-8dprcdra.js +0 -92
- package/dist/chunk-8xwx1xtg.js +0 -120
- package/dist/chunk-a579wjd2.js +0 -436
- package/dist/chunk-axqk3mxk.js +0 -116
- package/dist/chunk-c0ckmxr1.js +0 -86
- package/dist/chunk-c6t24y8q.js +0 -94
- package/dist/chunk-cfv996bs.js +0 -22
- package/dist/chunk-e5t5eefc.js +0 -62
- package/dist/chunk-eyph0250.js +0 -88
- package/dist/chunk-f825x57v.js +0 -91
- package/dist/chunk-h9xx5bj6.js +0 -91
- package/dist/chunk-j1dg659r.js +0 -89
- package/dist/chunk-jk8seqkk.js +0 -90
- package/dist/chunk-jzg4nddc.js +0 -92
- package/dist/chunk-k5vy0s3c.js +0 -93
- package/dist/chunk-ke820fjw.js +0 -91
- package/dist/chunk-kyzd4p8z.js +0 -111
- package/dist/chunk-njrt3tac.js +0 -640
- package/dist/chunk-pavb6a7w.js +0 -516
- package/dist/chunk-q268gpa0.js +0 -145
- package/dist/chunk-qvh1w3t7.js +0 -157
- package/dist/chunk-qy1es4jj.js +0 -95
- package/dist/chunk-qz2x630m.js +0 -49145
- package/dist/chunk-tw48evtr.js +0 -40
- package/dist/chunk-w0gfctyc.js +0 -117
- package/dist/chunk-y0fhjxef.js +0 -276
- package/dist/chunk-y275vgmw.js +0 -654
- package/dist/chunk-zq7pmdas.js +0 -1003
package/dist/chunk-njrt3tac.js
DELETED
|
@@ -1,640 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
getAnthropicApiKey,
|
|
4
|
-
getClaudeAIOAuthTokens,
|
|
5
|
-
getGlobalConfig,
|
|
6
|
-
hasProfileScope,
|
|
7
|
-
init_auth,
|
|
8
|
-
init_config,
|
|
9
|
-
saveApiKey,
|
|
10
|
-
saveGlobalConfig
|
|
11
|
-
} from "./chunk-e7efcp3k.js";
|
|
12
|
-
import {
|
|
13
|
-
init_lazySchema,
|
|
14
|
-
lazySchema
|
|
15
|
-
} from "./chunk-64c1avct.js";
|
|
16
|
-
import {
|
|
17
|
-
init_sleep,
|
|
18
|
-
sleep
|
|
19
|
-
} from "./chunk-8g5pe1gr.js";
|
|
20
|
-
import {
|
|
21
|
-
init_v4,
|
|
22
|
-
v4_default
|
|
23
|
-
} from "./chunk-8g747a8x.js";
|
|
24
|
-
import {
|
|
25
|
-
ALL_OAUTH_SCOPES,
|
|
26
|
-
CLAUDE_AI_INFERENCE_SCOPE,
|
|
27
|
-
CLAUDE_AI_OAUTH_SCOPES,
|
|
28
|
-
OAUTH_BETA_HEADER,
|
|
29
|
-
getOauthConfig,
|
|
30
|
-
init_oauth
|
|
31
|
-
} from "./chunk-s3hsqf80.js";
|
|
32
|
-
import {
|
|
33
|
-
init_analytics,
|
|
34
|
-
logEvent
|
|
35
|
-
} from "./chunk-x8d2ehd7.js";
|
|
36
|
-
import {
|
|
37
|
-
init_detectRepository,
|
|
38
|
-
parseGitHubRepository
|
|
39
|
-
} from "./chunk-15m49c67.js";
|
|
40
|
-
import {
|
|
41
|
-
init_log,
|
|
42
|
-
logError
|
|
43
|
-
} from "./chunk-1nk93fqz.js";
|
|
44
|
-
import {
|
|
45
|
-
errorMessage,
|
|
46
|
-
init_debug,
|
|
47
|
-
init_errors,
|
|
48
|
-
init_slowOperations,
|
|
49
|
-
jsonStringify,
|
|
50
|
-
logForDebugging,
|
|
51
|
-
toError
|
|
52
|
-
} from "./chunk-phd1qfpc.js";
|
|
53
|
-
import {
|
|
54
|
-
axios_default,
|
|
55
|
-
init_axios
|
|
56
|
-
} from "./chunk-55raexh7.js";
|
|
57
|
-
import {
|
|
58
|
-
__esm
|
|
59
|
-
} from "./chunk-qp2qdcda.js";
|
|
60
|
-
|
|
61
|
-
// src/services/oauth/getOauthProfile.ts
|
|
62
|
-
async function getOauthProfileFromApiKey() {
|
|
63
|
-
const config = getGlobalConfig();
|
|
64
|
-
const accountUuid = config.oauthAccount?.accountUuid;
|
|
65
|
-
const apiKey = getAnthropicApiKey();
|
|
66
|
-
if (!accountUuid || !apiKey) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const endpoint = `${getOauthConfig().BASE_API_URL}/api/claude_cli_profile`;
|
|
70
|
-
try {
|
|
71
|
-
const response = await axios_default.get(endpoint, {
|
|
72
|
-
headers: {
|
|
73
|
-
"x-api-key": apiKey,
|
|
74
|
-
"anthropic-beta": OAUTH_BETA_HEADER
|
|
75
|
-
},
|
|
76
|
-
params: {
|
|
77
|
-
account_uuid: accountUuid
|
|
78
|
-
},
|
|
79
|
-
timeout: 1e4
|
|
80
|
-
});
|
|
81
|
-
return response.data;
|
|
82
|
-
} catch (error) {
|
|
83
|
-
logError(error);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function getOauthProfileFromOauthToken(accessToken) {
|
|
87
|
-
const endpoint = `${getOauthConfig().BASE_API_URL}/api/oauth/profile`;
|
|
88
|
-
try {
|
|
89
|
-
const response = await axios_default.get(endpoint, {
|
|
90
|
-
headers: {
|
|
91
|
-
Authorization: `Bearer ${accessToken}`,
|
|
92
|
-
"Content-Type": "application/json"
|
|
93
|
-
},
|
|
94
|
-
timeout: 1e4
|
|
95
|
-
});
|
|
96
|
-
return response.data;
|
|
97
|
-
} catch (error) {
|
|
98
|
-
logError(error);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var init_getOauthProfile = __esm(() => {
|
|
102
|
-
init_axios();
|
|
103
|
-
init_oauth();
|
|
104
|
-
init_auth();
|
|
105
|
-
init_config();
|
|
106
|
-
init_log();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// src/services/oauth/client.ts
|
|
110
|
-
function shouldUseClaudeAIAuth(scopes) {
|
|
111
|
-
return Boolean(scopes?.includes(CLAUDE_AI_INFERENCE_SCOPE));
|
|
112
|
-
}
|
|
113
|
-
function parseScopes(scopeString) {
|
|
114
|
-
return scopeString?.split(" ").filter(Boolean) ?? [];
|
|
115
|
-
}
|
|
116
|
-
function buildAuthUrl({
|
|
117
|
-
codeChallenge,
|
|
118
|
-
state,
|
|
119
|
-
port,
|
|
120
|
-
isManual,
|
|
121
|
-
loginWithClaudeAi,
|
|
122
|
-
inferenceOnly,
|
|
123
|
-
orgUUID,
|
|
124
|
-
loginHint,
|
|
125
|
-
loginMethod
|
|
126
|
-
}) {
|
|
127
|
-
const authUrlBase = loginWithClaudeAi ? getOauthConfig().CLAUDE_AI_AUTHORIZE_URL : getOauthConfig().CONSOLE_AUTHORIZE_URL;
|
|
128
|
-
const authUrl = new URL(authUrlBase);
|
|
129
|
-
authUrl.searchParams.append("code", "true");
|
|
130
|
-
authUrl.searchParams.append("client_id", getOauthConfig().CLIENT_ID);
|
|
131
|
-
authUrl.searchParams.append("response_type", "code");
|
|
132
|
-
authUrl.searchParams.append("redirect_uri", isManual ? getOauthConfig().MANUAL_REDIRECT_URL : `http://localhost:${port}/callback`);
|
|
133
|
-
const scopesToUse = inferenceOnly ? [CLAUDE_AI_INFERENCE_SCOPE] : ALL_OAUTH_SCOPES;
|
|
134
|
-
authUrl.searchParams.append("scope", scopesToUse.join(" "));
|
|
135
|
-
authUrl.searchParams.append("code_challenge", codeChallenge);
|
|
136
|
-
authUrl.searchParams.append("code_challenge_method", "S256");
|
|
137
|
-
authUrl.searchParams.append("state", state);
|
|
138
|
-
if (orgUUID) {
|
|
139
|
-
authUrl.searchParams.append("orgUUID", orgUUID);
|
|
140
|
-
}
|
|
141
|
-
if (loginHint) {
|
|
142
|
-
authUrl.searchParams.append("login_hint", loginHint);
|
|
143
|
-
}
|
|
144
|
-
if (loginMethod) {
|
|
145
|
-
authUrl.searchParams.append("login_method", loginMethod);
|
|
146
|
-
}
|
|
147
|
-
return authUrl.toString();
|
|
148
|
-
}
|
|
149
|
-
async function exchangeCodeForTokens(authorizationCode, state, codeVerifier, port, useManualRedirect = false, expiresIn) {
|
|
150
|
-
const requestBody = {
|
|
151
|
-
grant_type: "authorization_code",
|
|
152
|
-
code: authorizationCode,
|
|
153
|
-
redirect_uri: useManualRedirect ? getOauthConfig().MANUAL_REDIRECT_URL : `http://localhost:${port}/callback`,
|
|
154
|
-
client_id: getOauthConfig().CLIENT_ID,
|
|
155
|
-
code_verifier: codeVerifier,
|
|
156
|
-
state
|
|
157
|
-
};
|
|
158
|
-
if (expiresIn !== undefined) {
|
|
159
|
-
requestBody.expires_in = expiresIn;
|
|
160
|
-
}
|
|
161
|
-
const response = await axios_default.post(getOauthConfig().TOKEN_URL, requestBody, {
|
|
162
|
-
headers: { "Content-Type": "application/json" },
|
|
163
|
-
timeout: 15000
|
|
164
|
-
});
|
|
165
|
-
if (response.status !== 200) {
|
|
166
|
-
throw new Error(response.status === 401 ? "Authentication failed: Invalid authorization code" : `Token exchange failed (${response.status}): ${response.statusText}`);
|
|
167
|
-
}
|
|
168
|
-
logEvent("tengu_oauth_token_exchange_success", {});
|
|
169
|
-
return response.data;
|
|
170
|
-
}
|
|
171
|
-
async function refreshOAuthToken(refreshToken, { scopes: requestedScopes } = {}) {
|
|
172
|
-
const requestBody = {
|
|
173
|
-
grant_type: "refresh_token",
|
|
174
|
-
refresh_token: refreshToken,
|
|
175
|
-
client_id: getOauthConfig().CLIENT_ID,
|
|
176
|
-
scope: ((requestedScopes?.length) ? requestedScopes : CLAUDE_AI_OAUTH_SCOPES).join(" ")
|
|
177
|
-
};
|
|
178
|
-
try {
|
|
179
|
-
const response = await axios_default.post(getOauthConfig().TOKEN_URL, requestBody, {
|
|
180
|
-
headers: { "Content-Type": "application/json" },
|
|
181
|
-
timeout: 15000
|
|
182
|
-
});
|
|
183
|
-
if (response.status !== 200) {
|
|
184
|
-
throw new Error(`Token refresh failed: ${response.statusText}`);
|
|
185
|
-
}
|
|
186
|
-
const data = response.data;
|
|
187
|
-
const {
|
|
188
|
-
access_token: accessToken,
|
|
189
|
-
refresh_token: newRefreshToken = refreshToken,
|
|
190
|
-
expires_in: expiresIn
|
|
191
|
-
} = data;
|
|
192
|
-
const expiresAt = Date.now() + expiresIn * 1000;
|
|
193
|
-
const scopes = parseScopes(data.scope);
|
|
194
|
-
logEvent("tengu_oauth_token_refresh_success", {});
|
|
195
|
-
const config = getGlobalConfig();
|
|
196
|
-
const existing = getClaudeAIOAuthTokens();
|
|
197
|
-
const haveProfileAlready = config.oauthAccount?.billingType !== undefined && config.oauthAccount?.accountCreatedAt !== undefined && config.oauthAccount?.subscriptionCreatedAt !== undefined && existing?.subscriptionType != null && existing?.rateLimitTier != null;
|
|
198
|
-
const profileInfo = haveProfileAlready ? null : await fetchProfileInfo(accessToken);
|
|
199
|
-
if (profileInfo && config.oauthAccount) {
|
|
200
|
-
const updates = {};
|
|
201
|
-
if (profileInfo.displayName !== undefined) {
|
|
202
|
-
updates.displayName = profileInfo.displayName;
|
|
203
|
-
}
|
|
204
|
-
if (typeof profileInfo.hasExtraUsageEnabled === "boolean") {
|
|
205
|
-
updates.hasExtraUsageEnabled = profileInfo.hasExtraUsageEnabled;
|
|
206
|
-
}
|
|
207
|
-
if (profileInfo.billingType !== null) {
|
|
208
|
-
updates.billingType = profileInfo.billingType;
|
|
209
|
-
}
|
|
210
|
-
if (profileInfo.accountCreatedAt !== undefined) {
|
|
211
|
-
updates.accountCreatedAt = profileInfo.accountCreatedAt;
|
|
212
|
-
}
|
|
213
|
-
if (profileInfo.subscriptionCreatedAt !== undefined) {
|
|
214
|
-
updates.subscriptionCreatedAt = profileInfo.subscriptionCreatedAt;
|
|
215
|
-
}
|
|
216
|
-
if (Object.keys(updates).length > 0) {
|
|
217
|
-
saveGlobalConfig((current) => ({
|
|
218
|
-
...current,
|
|
219
|
-
oauthAccount: current.oauthAccount ? { ...current.oauthAccount, ...updates } : current.oauthAccount
|
|
220
|
-
}));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return {
|
|
224
|
-
accessToken,
|
|
225
|
-
refreshToken: newRefreshToken,
|
|
226
|
-
expiresAt,
|
|
227
|
-
scopes,
|
|
228
|
-
subscriptionType: profileInfo?.subscriptionType ?? existing?.subscriptionType ?? null,
|
|
229
|
-
rateLimitTier: profileInfo?.rateLimitTier ?? existing?.rateLimitTier ?? null,
|
|
230
|
-
profile: profileInfo?.rawProfile,
|
|
231
|
-
tokenAccount: data.account ? {
|
|
232
|
-
uuid: data.account.uuid,
|
|
233
|
-
emailAddress: data.account.email_address,
|
|
234
|
-
organizationUuid: data.organization?.uuid
|
|
235
|
-
} : undefined
|
|
236
|
-
};
|
|
237
|
-
} catch (error) {
|
|
238
|
-
const responseBody = axios_default.isAxiosError(error) && error.response?.data ? JSON.stringify(error.response.data) : undefined;
|
|
239
|
-
logEvent("tengu_oauth_token_refresh_failure", {
|
|
240
|
-
error: error.message,
|
|
241
|
-
...responseBody && {
|
|
242
|
-
responseBody
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
throw error;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
async function fetchAndStoreUserRoles(accessToken) {
|
|
249
|
-
const response = await axios_default.get(getOauthConfig().ROLES_URL, {
|
|
250
|
-
headers: { Authorization: `Bearer ${accessToken}` }
|
|
251
|
-
});
|
|
252
|
-
if (response.status !== 200) {
|
|
253
|
-
throw new Error(`Failed to fetch user roles: ${response.statusText}`);
|
|
254
|
-
}
|
|
255
|
-
const data = response.data;
|
|
256
|
-
const config = getGlobalConfig();
|
|
257
|
-
if (!config.oauthAccount) {
|
|
258
|
-
throw new Error("OAuth account information not found in config");
|
|
259
|
-
}
|
|
260
|
-
saveGlobalConfig((current) => ({
|
|
261
|
-
...current,
|
|
262
|
-
oauthAccount: current.oauthAccount ? {
|
|
263
|
-
...current.oauthAccount,
|
|
264
|
-
organizationRole: data.organization_role,
|
|
265
|
-
workspaceRole: data.workspace_role,
|
|
266
|
-
organizationName: data.organization_name
|
|
267
|
-
} : current.oauthAccount
|
|
268
|
-
}));
|
|
269
|
-
logEvent("tengu_oauth_roles_stored", {
|
|
270
|
-
org_role: data.organization_role
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
async function createAndStoreApiKey(accessToken) {
|
|
274
|
-
try {
|
|
275
|
-
const response = await axios_default.post(getOauthConfig().API_KEY_URL, null, {
|
|
276
|
-
headers: { Authorization: `Bearer ${accessToken}` }
|
|
277
|
-
});
|
|
278
|
-
const apiKey = response.data?.raw_key;
|
|
279
|
-
if (apiKey) {
|
|
280
|
-
await saveApiKey(apiKey);
|
|
281
|
-
logEvent("tengu_oauth_api_key", {
|
|
282
|
-
status: "success",
|
|
283
|
-
statusCode: response.status
|
|
284
|
-
});
|
|
285
|
-
return apiKey;
|
|
286
|
-
}
|
|
287
|
-
return null;
|
|
288
|
-
} catch (error) {
|
|
289
|
-
logEvent("tengu_oauth_api_key", {
|
|
290
|
-
status: "failure",
|
|
291
|
-
error: error instanceof Error ? error.message : String(error)
|
|
292
|
-
});
|
|
293
|
-
throw error;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function isOAuthTokenExpired(expiresAt) {
|
|
297
|
-
if (expiresAt === null) {
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
const bufferTime = 5 * 60 * 1000;
|
|
301
|
-
const now = Date.now();
|
|
302
|
-
const expiresWithBuffer = now + bufferTime;
|
|
303
|
-
return expiresWithBuffer >= expiresAt;
|
|
304
|
-
}
|
|
305
|
-
async function fetchProfileInfo(accessToken) {
|
|
306
|
-
const profile = await getOauthProfileFromOauthToken(accessToken);
|
|
307
|
-
const orgType = profile?.organization?.organization_type;
|
|
308
|
-
let subscriptionType = null;
|
|
309
|
-
switch (orgType) {
|
|
310
|
-
case "claude_max":
|
|
311
|
-
subscriptionType = "max";
|
|
312
|
-
break;
|
|
313
|
-
case "claude_pro":
|
|
314
|
-
subscriptionType = "pro";
|
|
315
|
-
break;
|
|
316
|
-
case "claude_enterprise":
|
|
317
|
-
subscriptionType = "enterprise";
|
|
318
|
-
break;
|
|
319
|
-
case "claude_team":
|
|
320
|
-
subscriptionType = "team";
|
|
321
|
-
break;
|
|
322
|
-
default:
|
|
323
|
-
subscriptionType = null;
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
const result = {
|
|
327
|
-
subscriptionType,
|
|
328
|
-
rateLimitTier: profile?.organization?.rate_limit_tier ?? null,
|
|
329
|
-
hasExtraUsageEnabled: profile?.organization?.has_extra_usage_enabled ?? null,
|
|
330
|
-
billingType: profile?.organization?.billing_type ?? null
|
|
331
|
-
};
|
|
332
|
-
if (profile?.account?.display_name) {
|
|
333
|
-
result.displayName = profile.account.display_name;
|
|
334
|
-
}
|
|
335
|
-
if (profile?.account?.created_at) {
|
|
336
|
-
result.accountCreatedAt = profile.account.created_at;
|
|
337
|
-
}
|
|
338
|
-
if (profile?.organization?.subscription_created_at) {
|
|
339
|
-
result.subscriptionCreatedAt = profile.organization.subscription_created_at;
|
|
340
|
-
}
|
|
341
|
-
logEvent("tengu_oauth_profile_fetch_success", {});
|
|
342
|
-
return { ...result, rawProfile: profile };
|
|
343
|
-
}
|
|
344
|
-
async function getOrganizationUUID() {
|
|
345
|
-
const globalConfig = getGlobalConfig();
|
|
346
|
-
const orgUUID = globalConfig.oauthAccount?.organizationUuid;
|
|
347
|
-
if (orgUUID) {
|
|
348
|
-
return orgUUID;
|
|
349
|
-
}
|
|
350
|
-
const accessToken = getClaudeAIOAuthTokens()?.accessToken;
|
|
351
|
-
if (accessToken === undefined || !hasProfileScope()) {
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
const profile = await getOauthProfileFromOauthToken(accessToken);
|
|
355
|
-
const profileOrgUUID = profile?.organization?.uuid;
|
|
356
|
-
if (!profileOrgUUID) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
return profileOrgUUID;
|
|
360
|
-
}
|
|
361
|
-
function storeOAuthAccountInfo({
|
|
362
|
-
accountUuid,
|
|
363
|
-
emailAddress,
|
|
364
|
-
organizationUuid,
|
|
365
|
-
displayName,
|
|
366
|
-
hasExtraUsageEnabled,
|
|
367
|
-
billingType,
|
|
368
|
-
accountCreatedAt,
|
|
369
|
-
subscriptionCreatedAt
|
|
370
|
-
}) {
|
|
371
|
-
const accountInfo = {
|
|
372
|
-
accountUuid,
|
|
373
|
-
emailAddress,
|
|
374
|
-
organizationUuid,
|
|
375
|
-
hasExtraUsageEnabled,
|
|
376
|
-
billingType,
|
|
377
|
-
accountCreatedAt,
|
|
378
|
-
subscriptionCreatedAt
|
|
379
|
-
};
|
|
380
|
-
if (displayName) {
|
|
381
|
-
accountInfo.displayName = displayName;
|
|
382
|
-
}
|
|
383
|
-
saveGlobalConfig((current) => {
|
|
384
|
-
if (current.oauthAccount?.accountUuid === accountInfo.accountUuid && current.oauthAccount?.emailAddress === accountInfo.emailAddress && current.oauthAccount?.organizationUuid === accountInfo.organizationUuid && current.oauthAccount?.displayName === accountInfo.displayName && current.oauthAccount?.hasExtraUsageEnabled === accountInfo.hasExtraUsageEnabled && current.oauthAccount?.billingType === accountInfo.billingType && current.oauthAccount?.accountCreatedAt === accountInfo.accountCreatedAt && current.oauthAccount?.subscriptionCreatedAt === accountInfo.subscriptionCreatedAt) {
|
|
385
|
-
return current;
|
|
386
|
-
}
|
|
387
|
-
return { ...current, oauthAccount: accountInfo };
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
var init_client = __esm(() => {
|
|
391
|
-
init_axios();
|
|
392
|
-
init_analytics();
|
|
393
|
-
init_oauth();
|
|
394
|
-
init_auth();
|
|
395
|
-
init_config();
|
|
396
|
-
init_debug();
|
|
397
|
-
init_getOauthProfile();
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
// src/utils/teleport/api.ts
|
|
401
|
-
import { randomUUID } from "crypto";
|
|
402
|
-
function isTransientNetworkError(error) {
|
|
403
|
-
if (!axios_default.isAxiosError(error)) {
|
|
404
|
-
return false;
|
|
405
|
-
}
|
|
406
|
-
if (!error.response) {
|
|
407
|
-
return true;
|
|
408
|
-
}
|
|
409
|
-
if (error.response.status >= 500) {
|
|
410
|
-
return true;
|
|
411
|
-
}
|
|
412
|
-
return false;
|
|
413
|
-
}
|
|
414
|
-
async function axiosGetWithRetry(url, config) {
|
|
415
|
-
let lastError;
|
|
416
|
-
for (let attempt = 0;attempt <= MAX_TELEPORT_RETRIES; attempt++) {
|
|
417
|
-
try {
|
|
418
|
-
return await axios_default.get(url, config);
|
|
419
|
-
} catch (error) {
|
|
420
|
-
lastError = error;
|
|
421
|
-
if (!isTransientNetworkError(error)) {
|
|
422
|
-
throw error;
|
|
423
|
-
}
|
|
424
|
-
if (attempt >= MAX_TELEPORT_RETRIES) {
|
|
425
|
-
logForDebugging(`Teleport request failed after ${attempt + 1} attempts: ${errorMessage(error)}`);
|
|
426
|
-
throw error;
|
|
427
|
-
}
|
|
428
|
-
const delay = TELEPORT_RETRY_DELAYS[attempt] ?? 2000;
|
|
429
|
-
logForDebugging(`Teleport request failed (attempt ${attempt + 1}/${MAX_TELEPORT_RETRIES + 1}), retrying in ${delay}ms: ${errorMessage(error)}`);
|
|
430
|
-
await sleep(delay);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
throw lastError;
|
|
434
|
-
}
|
|
435
|
-
async function prepareApiRequest() {
|
|
436
|
-
const accessToken = getClaudeAIOAuthTokens()?.accessToken;
|
|
437
|
-
if (accessToken === undefined) {
|
|
438
|
-
throw new Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");
|
|
439
|
-
}
|
|
440
|
-
const orgUUID = await getOrganizationUUID();
|
|
441
|
-
if (!orgUUID) {
|
|
442
|
-
throw new Error("Unable to get organization UUID");
|
|
443
|
-
}
|
|
444
|
-
return { accessToken, orgUUID };
|
|
445
|
-
}
|
|
446
|
-
async function fetchCodeSessionsFromSessionsAPI() {
|
|
447
|
-
const { accessToken, orgUUID } = await prepareApiRequest();
|
|
448
|
-
const url = `${getOauthConfig().BASE_API_URL}/v1/sessions`;
|
|
449
|
-
try {
|
|
450
|
-
const headers = {
|
|
451
|
-
...getOAuthHeaders(accessToken),
|
|
452
|
-
"anthropic-beta": "ccr-byoc-2025-07-29",
|
|
453
|
-
"x-organization-uuid": orgUUID
|
|
454
|
-
};
|
|
455
|
-
const response = await axiosGetWithRetry(url, {
|
|
456
|
-
headers
|
|
457
|
-
});
|
|
458
|
-
if (response.status !== 200) {
|
|
459
|
-
throw new Error(`Failed to fetch code sessions: ${response.statusText}`);
|
|
460
|
-
}
|
|
461
|
-
const sessions = response.data.data.map((session) => {
|
|
462
|
-
const gitSource = session.session_context.sources.find((source) => source.type === "git_repository");
|
|
463
|
-
let repo = null;
|
|
464
|
-
if (gitSource?.url) {
|
|
465
|
-
const repoPath = parseGitHubRepository(gitSource.url);
|
|
466
|
-
if (repoPath) {
|
|
467
|
-
const [owner, name] = repoPath.split("/");
|
|
468
|
-
if (owner && name) {
|
|
469
|
-
repo = {
|
|
470
|
-
name,
|
|
471
|
-
owner: {
|
|
472
|
-
login: owner
|
|
473
|
-
},
|
|
474
|
-
default_branch: gitSource.revision || undefined
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return {
|
|
480
|
-
id: session.id,
|
|
481
|
-
title: session.title || "Untitled",
|
|
482
|
-
description: "",
|
|
483
|
-
status: session.session_status,
|
|
484
|
-
repo,
|
|
485
|
-
turns: [],
|
|
486
|
-
created_at: session.created_at,
|
|
487
|
-
updated_at: session.updated_at
|
|
488
|
-
};
|
|
489
|
-
});
|
|
490
|
-
return sessions;
|
|
491
|
-
} catch (error) {
|
|
492
|
-
const err = toError(error);
|
|
493
|
-
logError(err);
|
|
494
|
-
throw error;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function getOAuthHeaders(accessToken) {
|
|
498
|
-
return {
|
|
499
|
-
Authorization: `Bearer ${accessToken}`,
|
|
500
|
-
"Content-Type": "application/json",
|
|
501
|
-
"anthropic-version": "2023-06-01"
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
async function fetchSession(sessionId) {
|
|
505
|
-
const { accessToken, orgUUID } = await prepareApiRequest();
|
|
506
|
-
const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}`;
|
|
507
|
-
const headers = {
|
|
508
|
-
...getOAuthHeaders(accessToken),
|
|
509
|
-
"anthropic-beta": "ccr-byoc-2025-07-29",
|
|
510
|
-
"x-organization-uuid": orgUUID
|
|
511
|
-
};
|
|
512
|
-
const response = await axios_default.get(url, {
|
|
513
|
-
headers,
|
|
514
|
-
timeout: 15000,
|
|
515
|
-
validateStatus: (status) => status < 500
|
|
516
|
-
});
|
|
517
|
-
if (response.status !== 200) {
|
|
518
|
-
const errorData = response.data;
|
|
519
|
-
const apiMessage = errorData?.error?.message;
|
|
520
|
-
if (response.status === 404) {
|
|
521
|
-
throw new Error(`Session not found: ${sessionId}`);
|
|
522
|
-
}
|
|
523
|
-
if (response.status === 401) {
|
|
524
|
-
throw new Error("Session expired. Please run /login to sign in again.");
|
|
525
|
-
}
|
|
526
|
-
throw new Error(apiMessage || `Failed to fetch session: ${response.status} ${response.statusText}`);
|
|
527
|
-
}
|
|
528
|
-
return response.data;
|
|
529
|
-
}
|
|
530
|
-
function getBranchFromSession(session) {
|
|
531
|
-
const gitOutcome = session.session_context.outcomes?.find((outcome) => outcome.type === "git_repository");
|
|
532
|
-
return gitOutcome?.git_info?.branches[0];
|
|
533
|
-
}
|
|
534
|
-
async function sendEventToRemoteSession(sessionId, messageContent, opts) {
|
|
535
|
-
try {
|
|
536
|
-
const { accessToken, orgUUID } = await prepareApiRequest();
|
|
537
|
-
const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}/events`;
|
|
538
|
-
const headers = {
|
|
539
|
-
...getOAuthHeaders(accessToken),
|
|
540
|
-
"anthropic-beta": "ccr-byoc-2025-07-29",
|
|
541
|
-
"x-organization-uuid": orgUUID
|
|
542
|
-
};
|
|
543
|
-
const userEvent = {
|
|
544
|
-
uuid: opts?.uuid ?? randomUUID(),
|
|
545
|
-
session_id: sessionId,
|
|
546
|
-
type: "user",
|
|
547
|
-
parent_tool_use_id: null,
|
|
548
|
-
message: {
|
|
549
|
-
role: "user",
|
|
550
|
-
content: messageContent
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
const requestBody = {
|
|
554
|
-
events: [userEvent]
|
|
555
|
-
};
|
|
556
|
-
logForDebugging(`[sendEventToRemoteSession] Sending event to session ${sessionId}`);
|
|
557
|
-
const response = await axios_default.post(url, requestBody, {
|
|
558
|
-
headers,
|
|
559
|
-
validateStatus: (status) => status < 500,
|
|
560
|
-
timeout: 30000
|
|
561
|
-
});
|
|
562
|
-
if (response.status === 200 || response.status === 201) {
|
|
563
|
-
logForDebugging(`[sendEventToRemoteSession] Successfully sent event to session ${sessionId}`);
|
|
564
|
-
return true;
|
|
565
|
-
}
|
|
566
|
-
logForDebugging(`[sendEventToRemoteSession] Failed with status ${response.status}: ${jsonStringify(response.data)}`);
|
|
567
|
-
return false;
|
|
568
|
-
} catch (error) {
|
|
569
|
-
logForDebugging(`[sendEventToRemoteSession] Error: ${errorMessage(error)}`);
|
|
570
|
-
return false;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
async function updateSessionTitle(sessionId, title) {
|
|
574
|
-
try {
|
|
575
|
-
const { accessToken, orgUUID } = await prepareApiRequest();
|
|
576
|
-
const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}`;
|
|
577
|
-
const headers = {
|
|
578
|
-
...getOAuthHeaders(accessToken),
|
|
579
|
-
"anthropic-beta": "ccr-byoc-2025-07-29",
|
|
580
|
-
"x-organization-uuid": orgUUID
|
|
581
|
-
};
|
|
582
|
-
logForDebugging(`[updateSessionTitle] Updating title for session ${sessionId}: "${title}"`);
|
|
583
|
-
const response = await axios_default.patch(url, { title }, {
|
|
584
|
-
headers,
|
|
585
|
-
validateStatus: (status) => status < 500
|
|
586
|
-
});
|
|
587
|
-
if (response.status === 200) {
|
|
588
|
-
logForDebugging(`[updateSessionTitle] Successfully updated title for session ${sessionId}`);
|
|
589
|
-
return true;
|
|
590
|
-
}
|
|
591
|
-
logForDebugging(`[updateSessionTitle] Failed with status ${response.status}: ${jsonStringify(response.data)}`);
|
|
592
|
-
return false;
|
|
593
|
-
} catch (error) {
|
|
594
|
-
logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error)}`);
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
var TELEPORT_RETRY_DELAYS, MAX_TELEPORT_RETRIES, CodeSessionSchema;
|
|
599
|
-
var init_api = __esm(() => {
|
|
600
|
-
init_axios();
|
|
601
|
-
init_oauth();
|
|
602
|
-
init_client();
|
|
603
|
-
init_v4();
|
|
604
|
-
init_auth();
|
|
605
|
-
init_debug();
|
|
606
|
-
init_detectRepository();
|
|
607
|
-
init_errors();
|
|
608
|
-
init_lazySchema();
|
|
609
|
-
init_log();
|
|
610
|
-
init_sleep();
|
|
611
|
-
init_slowOperations();
|
|
612
|
-
TELEPORT_RETRY_DELAYS = [2000, 4000, 8000, 16000];
|
|
613
|
-
MAX_TELEPORT_RETRIES = TELEPORT_RETRY_DELAYS.length;
|
|
614
|
-
CodeSessionSchema = lazySchema(() => v4_default.object({
|
|
615
|
-
id: v4_default.string(),
|
|
616
|
-
title: v4_default.string(),
|
|
617
|
-
description: v4_default.string(),
|
|
618
|
-
status: v4_default.enum([
|
|
619
|
-
"idle",
|
|
620
|
-
"working",
|
|
621
|
-
"waiting",
|
|
622
|
-
"completed",
|
|
623
|
-
"archived",
|
|
624
|
-
"cancelled",
|
|
625
|
-
"rejected"
|
|
626
|
-
]),
|
|
627
|
-
repo: v4_default.object({
|
|
628
|
-
name: v4_default.string(),
|
|
629
|
-
owner: v4_default.object({
|
|
630
|
-
login: v4_default.string()
|
|
631
|
-
}),
|
|
632
|
-
default_branch: v4_default.string().optional()
|
|
633
|
-
}).nullable(),
|
|
634
|
-
turns: v4_default.array(v4_default.string()),
|
|
635
|
-
created_at: v4_default.string(),
|
|
636
|
-
updated_at: v4_default.string()
|
|
637
|
-
}));
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
export { getOauthProfileFromApiKey, getOauthProfileFromOauthToken, init_getOauthProfile, shouldUseClaudeAIAuth, parseScopes, buildAuthUrl, exchangeCodeForTokens, refreshOAuthToken, fetchAndStoreUserRoles, createAndStoreApiKey, isOAuthTokenExpired, fetchProfileInfo, getOrganizationUUID, storeOAuthAccountInfo, init_client, isTransientNetworkError, prepareApiRequest, fetchCodeSessionsFromSessionsAPI, getOAuthHeaders, fetchSession, getBranchFromSession, sendEventToRemoteSession, updateSessionTitle, init_api };
|