@bkm016/basalt 0.1.35 → 0.1.36
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 +1 -1
- package/chunk-082x3g29.js +3 -0
- package/chunk-0aaf270z.js +3 -0
- package/chunk-0dqv9x0y.js +51 -0
- package/chunk-0ns02fzq.js +2 -0
- package/chunk-0y13kfpt.js +5 -0
- package/chunk-1753m6xk.js +4179 -0
- package/chunk-24ae99b6.js +5 -0
- package/chunk-2cp8why4.js +2 -0
- package/chunk-3bdzn4h2.js +2 -0
- package/chunk-48m0w8xg.js +2 -0
- package/chunk-4pr7ykh0.js +2 -0
- package/chunk-4qtw5cga.js +12 -0
- package/chunk-4yqge35f.js +3 -0
- package/chunk-65rd9zn4.js +3 -0
- package/chunk-67ehvv4n.js +44 -0
- package/chunk-6wm62kte.js +18 -0
- package/chunk-6zkggkdm.js +13 -0
- package/chunk-78ferdza.js +3 -0
- package/chunk-794r8w6m.js +2 -0
- package/chunk-7azn0brs.js +7 -0
- package/chunk-7wh4n0yg.js +2 -0
- package/chunk-7z0wh161.js +25 -0
- package/chunk-95aqrqnh.js +2 -0
- package/chunk-a0zcps2d.js +2 -0
- package/chunk-a23pv6tv.js +3 -0
- package/chunk-adb2nbxk.js +2 -0
- package/chunk-as2ty5w5.js +3 -0
- package/chunk-b84y794v.js +3 -0
- package/chunk-bh80e336.js +3 -0
- package/chunk-c6azecvs.js +3 -0
- package/chunk-cc8h8mz9.js +2 -0
- package/chunk-cdb6caq7.js +3 -0
- package/chunk-cjdbsa9s.js +3 -0
- package/chunk-cnqgtmwm.js +10 -0
- package/chunk-cwn9vs1a.js +3 -0
- package/chunk-cxybp3fn.js +8 -0
- package/chunk-dea2htm4.js +2 -0
- package/chunk-e01wravf.js +12 -0
- package/chunk-f0pz8pvb.js +5 -0
- package/chunk-fvmrsrmq.js +3 -0
- package/chunk-fwdhn0gw.js +7 -0
- package/chunk-h7x8g57v.js +9 -0
- package/chunk-h8qhy3px.js +39 -0
- package/chunk-hsvchrh3.js +7 -0
- package/chunk-j1peg724.js +504 -0
- package/chunk-j2cse817.js +63 -0
- package/chunk-j3jzgw98.js +31 -0
- package/chunk-jmzdtefg.js +2 -0
- package/chunk-k0e6n6yy.js +3 -0
- package/chunk-mb2jqd5z.js +3 -0
- package/chunk-nbgtqpay.js +3 -0
- package/chunk-prfczhpq.js +10 -0
- package/chunk-pv25a7sw.js +2 -0
- package/chunk-q8m2x20d.js +286 -0
- package/chunk-qnkxeh37.js +3 -0
- package/chunk-qvfrv3rb.js +59 -0
- package/chunk-r14x07ez.js +2 -0
- package/chunk-r1kah65k.js +2 -0
- package/chunk-r6pt44wk.js +60 -0
- package/chunk-rhkw8ygf.js +3 -0
- package/chunk-rvqeb7gr.js +3 -0
- package/chunk-rwa7mfwa.js +2 -0
- package/chunk-sj46f002.js +2 -0
- package/chunk-sp89jja7.js +3 -0
- package/chunk-sss5x2ak.js +2 -0
- package/chunk-szn4y5mx.js +25 -0
- package/chunk-t05q9ksf.js +2 -0
- package/chunk-tb66q678.js +11 -0
- package/chunk-tej75y8n.js +2 -0
- package/chunk-tmfr2ym8.js +4 -0
- package/chunk-txwheg1n.js +2 -0
- package/chunk-ve6n38r4.js +16 -0
- package/chunk-vfa49qcy.js +3 -0
- package/chunk-wcy1r6vv.js +2 -0
- package/chunk-wj6am3ag.js +3 -0
- package/chunk-x0afp8wt.js +3 -0
- package/chunk-xe627eyp.js +20 -0
- package/chunk-y18ey7s9.js +8 -0
- package/chunk-y9r7tt53.js +3 -0
- package/chunk-yq20v3va.js +3 -0
- package/chunk-yyg4ygv7.js +2 -0
- package/chunk-z2zhr4e5.js +3 -0
- package/chunk-zdtg52xn.js +2 -0
- package/chunk-zrhdrkdb.js +5 -0
- package/compiled.js +9 -9
- package/package.json +1 -1
- package/ui-test-worker.js +33 -33
- package/web/chunk-0d0fwb7b.js +2 -0
- package/web/chunk-0d0fwb7b.js.br +0 -0
- package/web/chunk-0d0fwb7b.js.gz +0 -0
- package/web/chunk-0jm4zyrt.js +1 -0
- package/web/chunk-0jm4zyrt.js.br +0 -0
- package/web/chunk-0jm4zyrt.js.gz +0 -0
- package/web/chunk-0pp7dzx1.js +1 -0
- package/web/chunk-0pp7dzx1.js.br +0 -0
- package/web/chunk-0pp7dzx1.js.gz +0 -0
- package/web/chunk-0w73jp4n.js +1 -0
- package/web/chunk-0w73jp4n.js.br +0 -0
- package/web/chunk-0w73jp4n.js.gz +0 -0
- package/web/chunk-1416f30c.js +2 -0
- package/web/chunk-1416f30c.js.br +0 -0
- package/web/chunk-1416f30c.js.gz +0 -0
- package/web/chunk-18wyawez.js +30 -0
- package/web/chunk-18wyawez.js.br +0 -0
- package/web/chunk-18wyawez.js.gz +0 -0
- package/web/chunk-19ew9re5.js +1 -0
- package/web/chunk-19ew9re5.js.br +0 -0
- package/web/chunk-19ew9re5.js.gz +0 -0
- package/web/chunk-1mdtr9wk.js +8 -0
- package/web/chunk-1mdtr9wk.js.br +1 -0
- package/web/chunk-1mdtr9wk.js.gz +0 -0
- package/web/chunk-1p4egv85.js +1 -0
- package/web/chunk-1p4egv85.js.br +0 -0
- package/web/chunk-1p4egv85.js.gz +0 -0
- package/web/chunk-1x61dvvr.js +2 -0
- package/web/chunk-1x61dvvr.js.br +0 -0
- package/web/chunk-1x61dvvr.js.gz +0 -0
- package/web/chunk-241n0y1h.js +1 -0
- package/web/chunk-241n0y1h.js.br +0 -0
- package/web/chunk-241n0y1h.js.gz +0 -0
- package/web/chunk-26sgnzb2.js +1 -0
- package/web/chunk-26sgnzb2.js.br +0 -0
- package/web/chunk-26sgnzb2.js.gz +0 -0
- package/web/chunk-2p77pefd.js +1 -0
- package/web/chunk-2p77pefd.js.br +0 -0
- package/web/chunk-2p77pefd.js.gz +0 -0
- package/web/chunk-2ppe5znq.js +1 -0
- package/web/chunk-2ppe5znq.js.br +0 -0
- package/web/chunk-2ppe5znq.js.gz +0 -0
- package/web/chunk-2qzr943m.js +2 -0
- package/web/chunk-2qzr943m.js.br +0 -0
- package/web/chunk-2qzr943m.js.gz +0 -0
- package/web/chunk-32k44660.js +214 -0
- package/web/chunk-32k44660.js.br +0 -0
- package/web/chunk-32k44660.js.gz +0 -0
- package/web/chunk-33zb5a76.js +2 -0
- package/web/chunk-33zb5a76.js.br +0 -0
- package/web/chunk-33zb5a76.js.gz +0 -0
- package/web/chunk-38bzkv9k.js +7 -0
- package/web/chunk-38bzkv9k.js.br +0 -0
- package/web/chunk-38bzkv9k.js.gz +0 -0
- package/web/chunk-42ytz496.js +1 -0
- package/web/chunk-42ytz496.js.br +0 -0
- package/web/chunk-42ytz496.js.gz +0 -0
- package/web/chunk-4749rrqv.js +55 -0
- package/web/chunk-4749rrqv.js.br +0 -0
- package/web/chunk-4749rrqv.js.gz +0 -0
- package/web/chunk-4d57cnh5.js +40 -0
- package/web/chunk-4d57cnh5.js.br +0 -0
- package/web/chunk-4d57cnh5.js.gz +0 -0
- package/web/chunk-4gh3hcrc.js +1 -0
- package/web/chunk-4gh3hcrc.js.br +0 -0
- package/web/chunk-4gh3hcrc.js.gz +0 -0
- package/web/chunk-4hg08mj3.js +1 -0
- package/web/chunk-4hg08mj3.js.br +0 -0
- package/web/chunk-4hg08mj3.js.gz +0 -0
- package/web/chunk-4rra9tt7.js +78 -0
- package/web/chunk-4rra9tt7.js.br +0 -0
- package/web/chunk-4rra9tt7.js.gz +0 -0
- package/web/chunk-572kjbne.js +89 -0
- package/web/chunk-572kjbne.js.br +0 -0
- package/web/chunk-572kjbne.js.gz +0 -0
- package/web/chunk-5hqe3cct.js +98 -0
- package/web/chunk-5hqe3cct.js.br +0 -0
- package/web/chunk-5hqe3cct.js.gz +0 -0
- package/web/chunk-5k4vdcwk.js +24 -0
- package/web/chunk-5k4vdcwk.js.br +0 -0
- package/web/chunk-5k4vdcwk.js.gz +0 -0
- package/web/chunk-5z44jbdc.js +1 -0
- package/web/chunk-5z44jbdc.js.br +0 -0
- package/web/chunk-5z44jbdc.js.gz +0 -0
- package/web/chunk-600x58nm.js +1143 -0
- package/web/chunk-600x58nm.js.br +0 -0
- package/web/chunk-600x58nm.js.gz +0 -0
- package/web/chunk-61djfs0t.js +140 -0
- package/web/chunk-61djfs0t.js.br +0 -0
- package/web/chunk-61djfs0t.js.gz +0 -0
- package/web/chunk-6j4jdvtd.js +1 -0
- package/web/chunk-6j4jdvtd.js.br +0 -0
- package/web/chunk-6j4jdvtd.js.gz +0 -0
- package/web/chunk-74ymgabb.js +2 -0
- package/web/chunk-74ymgabb.js.br +0 -0
- package/web/chunk-74ymgabb.js.gz +0 -0
- package/web/chunk-768vchz5.js +169 -0
- package/web/chunk-768vchz5.js.br +0 -0
- package/web/chunk-768vchz5.js.gz +0 -0
- package/web/chunk-7f87paxe.js +36 -0
- package/web/chunk-7f87paxe.js.br +0 -0
- package/web/chunk-7f87paxe.js.gz +0 -0
- package/web/chunk-7ns0kj87.js +2 -0
- package/web/chunk-7ns0kj87.js.br +0 -0
- package/web/chunk-7ns0kj87.js.gz +0 -0
- package/web/chunk-7vpk9y00.js +1 -0
- package/web/chunk-7vpk9y00.js.br +0 -0
- package/web/chunk-7vpk9y00.js.gz +0 -0
- package/web/chunk-89mc1vj3.js +1 -0
- package/web/chunk-89mc1vj3.js.br +0 -0
- package/web/chunk-89mc1vj3.js.gz +0 -0
- package/web/chunk-8wgpesrk.js +139 -0
- package/web/chunk-8wgpesrk.js.br +0 -0
- package/web/chunk-8wgpesrk.js.gz +0 -0
- package/web/chunk-9nh1aeqs.js +303 -0
- package/web/chunk-9nh1aeqs.js.br +0 -0
- package/web/chunk-9nh1aeqs.js.gz +0 -0
- package/web/chunk-9pgq2ax4.js +1 -0
- package/web/chunk-9pgq2ax4.js.br +0 -0
- package/web/chunk-9pgq2ax4.js.gz +0 -0
- package/web/chunk-9tfs2dg1.js +1 -0
- package/web/chunk-9tfs2dg1.js.br +0 -0
- package/web/chunk-9tfs2dg1.js.gz +0 -0
- package/web/chunk-9wemd2wn.js +41 -0
- package/web/chunk-9wemd2wn.js.br +0 -0
- package/web/chunk-9wemd2wn.js.gz +0 -0
- package/web/chunk-9wsz2j8n.js +1 -0
- package/web/chunk-9wsz2j8n.js.br +0 -0
- package/web/chunk-9wsz2j8n.js.gz +0 -0
- package/web/chunk-9wzvqpre.js +2 -0
- package/web/chunk-9wzvqpre.js.br +0 -0
- package/web/chunk-9wzvqpre.js.gz +0 -0
- package/web/chunk-a48wgrb1.js +1 -0
- package/web/chunk-a48wgrb1.js.br +2 -0
- package/web/chunk-a48wgrb1.js.gz +0 -0
- package/web/chunk-a67d8w1k.js +14 -0
- package/web/chunk-a67d8w1k.js.br +0 -0
- package/web/chunk-a67d8w1k.js.gz +0 -0
- package/web/chunk-ah8e1y9j.js +4 -0
- package/web/chunk-ah8e1y9j.js.br +0 -0
- package/web/chunk-ah8e1y9j.js.gz +0 -0
- package/web/chunk-amsr9cg2.js +1 -0
- package/web/chunk-amsr9cg2.js.br +0 -0
- package/web/chunk-amsr9cg2.js.gz +0 -0
- package/web/chunk-aps2c5t2.js +16 -0
- package/web/chunk-aps2c5t2.js.br +0 -0
- package/web/chunk-aps2c5t2.js.gz +0 -0
- package/web/chunk-avfynf6y.js +1 -0
- package/web/chunk-avfynf6y.js.br +0 -0
- package/web/chunk-avfynf6y.js.gz +0 -0
- package/web/chunk-b5zrttcx.js +2 -0
- package/web/chunk-b5zrttcx.js.br +0 -0
- package/web/chunk-b5zrttcx.js.gz +0 -0
- package/web/chunk-bvvf024a.js +24 -0
- package/web/chunk-bvvf024a.js.br +0 -0
- package/web/chunk-bvvf024a.js.gz +0 -0
- package/web/chunk-by2dphx7.js +200 -0
- package/web/chunk-by2dphx7.js.br +0 -0
- package/web/chunk-by2dphx7.js.gz +0 -0
- package/web/chunk-c0sc2yy1.js +1 -0
- package/web/chunk-c0sc2yy1.js.br +0 -0
- package/web/chunk-c0sc2yy1.js.gz +0 -0
- package/web/chunk-c612n2pw.js +2 -0
- package/web/chunk-c612n2pw.js.br +0 -0
- package/web/chunk-c612n2pw.js.gz +0 -0
- package/web/chunk-c91rk85x.js +2 -0
- package/web/chunk-c91rk85x.js.br +0 -0
- package/web/chunk-c91rk85x.js.gz +0 -0
- package/web/chunk-catm30vp.js +2 -0
- package/web/chunk-catm30vp.js.br +0 -0
- package/web/chunk-catm30vp.js.gz +0 -0
- package/web/chunk-cbdxzddd.js +142 -0
- package/web/chunk-cbdxzddd.js.br +0 -0
- package/web/chunk-cbdxzddd.js.gz +0 -0
- package/web/chunk-cng693ts.js +2 -0
- package/web/chunk-cng693ts.js.br +0 -0
- package/web/chunk-cng693ts.js.gz +0 -0
- package/web/chunk-d5vcma5a.js +89 -0
- package/web/chunk-d5vcma5a.js.br +0 -0
- package/web/chunk-d5vcma5a.js.gz +0 -0
- package/web/chunk-d6d9cp71.js +1 -0
- package/web/chunk-d6d9cp71.js.br +2 -0
- package/web/chunk-d6d9cp71.js.gz +0 -0
- package/web/chunk-dsghhcew.js +1 -0
- package/web/chunk-dsghhcew.js.br +0 -0
- package/web/chunk-dsghhcew.js.gz +0 -0
- package/web/chunk-dt2e6evf.js +1 -0
- package/web/chunk-dt2e6evf.js.br +0 -0
- package/web/chunk-dt2e6evf.js.gz +0 -0
- package/web/chunk-dxrsmcah.js +1 -0
- package/web/chunk-dxrsmcah.js.br +0 -0
- package/web/chunk-dxrsmcah.js.gz +0 -0
- package/web/chunk-ent5zx24.js +1 -0
- package/web/chunk-ent5zx24.js.br +2 -0
- package/web/chunk-ent5zx24.js.gz +0 -0
- package/web/chunk-f4n1q3mf.js +1 -0
- package/web/chunk-f4n1q3mf.js.br +0 -0
- package/web/chunk-f4n1q3mf.js.gz +0 -0
- package/web/chunk-fdfrv6bc.js +1 -0
- package/web/chunk-fdfrv6bc.js.br +2 -0
- package/web/chunk-fdfrv6bc.js.gz +0 -0
- package/web/chunk-fh44xz70.js +1 -0
- package/web/chunk-fh44xz70.js.br +0 -0
- package/web/chunk-fh44xz70.js.gz +0 -0
- package/web/chunk-fkbp72gk.js +1 -0
- package/web/chunk-fkbp72gk.js.br +0 -0
- package/web/chunk-fkbp72gk.js.gz +0 -0
- package/web/chunk-fzkjgwzq.js +4 -0
- package/web/chunk-fzkjgwzq.js.br +0 -0
- package/web/chunk-fzkjgwzq.js.gz +0 -0
- package/web/chunk-gf2gznsb.js +38 -0
- package/web/chunk-gf2gznsb.js.br +0 -0
- package/web/chunk-gf2gznsb.js.gz +0 -0
- package/web/chunk-gne1ybac.js +2 -0
- package/web/chunk-gne1ybac.js.br +0 -0
- package/web/chunk-gne1ybac.js.gz +0 -0
- package/web/chunk-gws1fj71.js +106 -0
- package/web/chunk-gws1fj71.js.br +0 -0
- package/web/chunk-gws1fj71.js.gz +0 -0
- package/web/chunk-h4m88fg8.js +2 -0
- package/web/chunk-h4m88fg8.js.br +0 -0
- package/web/chunk-h4m88fg8.js.gz +0 -0
- package/web/chunk-h4vk09kd.js +2 -0
- package/web/chunk-h4vk09kd.js.br +0 -0
- package/web/chunk-h4vk09kd.js.gz +0 -0
- package/web/chunk-h6wzjfj2.js +34 -0
- package/web/chunk-h6wzjfj2.js.br +0 -0
- package/web/chunk-h6wzjfj2.js.gz +0 -0
- package/web/chunk-hajg1p0h.js +7 -0
- package/web/chunk-hajg1p0h.js.br +0 -0
- package/web/chunk-hajg1p0h.js.gz +0 -0
- package/web/chunk-hhmd6qrc.js +2 -0
- package/web/chunk-hhmd6qrc.js.br +0 -0
- package/web/chunk-hhmd6qrc.js.gz +0 -0
- package/web/chunk-hya0fh1r.js +1 -0
- package/web/chunk-hya0fh1r.js.br +0 -0
- package/web/chunk-hya0fh1r.js.gz +0 -0
- package/web/chunk-j469ky77.js +1 -0
- package/web/chunk-j469ky77.js.br +0 -0
- package/web/chunk-j469ky77.js.gz +0 -0
- package/web/chunk-j6ymcm3h.js +2 -0
- package/web/chunk-j6ymcm3h.js.br +0 -0
- package/web/chunk-j6ymcm3h.js.gz +0 -0
- package/web/chunk-j79z6bta.js +21 -0
- package/web/chunk-j79z6bta.js.br +0 -0
- package/web/chunk-j79z6bta.js.gz +0 -0
- package/web/chunk-jbxc5y3z.js +12 -0
- package/web/chunk-jbxc5y3z.js.br +0 -0
- package/web/chunk-jbxc5y3z.js.gz +0 -0
- package/web/chunk-jcc187d7.js +1 -0
- package/web/chunk-jcc187d7.js.br +0 -0
- package/web/chunk-jcc187d7.js.gz +0 -0
- package/web/chunk-jjvpdxhd.js +2 -0
- package/web/chunk-jjvpdxhd.js.br +0 -0
- package/web/chunk-jjvpdxhd.js.gz +0 -0
- package/web/chunk-jrh3mwmy.js +2 -0
- package/web/chunk-jrh3mwmy.js.br +0 -0
- package/web/chunk-jrh3mwmy.js.gz +0 -0
- package/web/chunk-jv3pgdp0.js +1 -0
- package/web/chunk-jv3pgdp0.js.br +2 -0
- package/web/chunk-jv3pgdp0.js.gz +0 -0
- package/web/chunk-ksxjhezb.js +1 -0
- package/web/chunk-ksxjhezb.js.br +0 -0
- package/web/chunk-ksxjhezb.js.gz +0 -0
- package/web/chunk-ktnd8t40.js +2 -0
- package/web/chunk-ktnd8t40.js.br +0 -0
- package/web/chunk-ktnd8t40.js.gz +0 -0
- package/web/chunk-mgwv3dp0.js +1 -0
- package/web/chunk-mgwv3dp0.js.br +0 -0
- package/web/chunk-mgwv3dp0.js.gz +0 -0
- package/web/chunk-mtjdfgjj.js +2 -0
- package/web/chunk-mtjdfgjj.js.br +0 -0
- package/web/chunk-mtjdfgjj.js.gz +0 -0
- package/web/chunk-mzkaanwd.js +2 -0
- package/web/chunk-mzkaanwd.js.br +0 -0
- package/web/chunk-mzkaanwd.js.gz +0 -0
- package/web/chunk-n22pg5xy.js +1 -0
- package/web/chunk-n22pg5xy.js.br +0 -0
- package/web/chunk-n22pg5xy.js.gz +0 -0
- package/web/chunk-n58ezsfb.js +2 -0
- package/web/chunk-n58ezsfb.js.br +0 -0
- package/web/chunk-n58ezsfb.js.gz +0 -0
- package/web/chunk-nhx74teq.js +3 -0
- package/web/chunk-nhx74teq.js.br +0 -0
- package/web/chunk-nhx74teq.js.gz +0 -0
- package/web/chunk-njjsgwfw.js +2 -0
- package/web/chunk-njjsgwfw.js.br +0 -0
- package/web/chunk-njjsgwfw.js.gz +0 -0
- package/web/chunk-nwhqcbnr.js +1 -0
- package/web/chunk-nwhqcbnr.js.br +0 -0
- package/web/chunk-nwhqcbnr.js.gz +0 -0
- package/web/chunk-pnghaajd.js +70 -0
- package/web/chunk-pnghaajd.js.br +0 -0
- package/web/chunk-pnghaajd.js.gz +0 -0
- package/web/chunk-pqfn8x7v.js +1 -0
- package/web/chunk-pqfn8x7v.js.br +0 -0
- package/web/chunk-pqfn8x7v.js.gz +0 -0
- package/web/chunk-ptk0jnyx.js +1 -0
- package/web/chunk-ptk0jnyx.js.br +0 -0
- package/web/chunk-ptk0jnyx.js.gz +0 -0
- package/web/chunk-pv7e5g4k.js +370 -0
- package/web/chunk-pv7e5g4k.js.br +0 -0
- package/web/chunk-pv7e5g4k.js.gz +0 -0
- package/web/chunk-pxnh5qgn.js +2 -0
- package/web/chunk-pxnh5qgn.js.br +0 -0
- package/web/chunk-pxnh5qgn.js.gz +0 -0
- package/web/chunk-q6eq5y2t.js +1 -0
- package/web/chunk-q6eq5y2t.js.br +2 -0
- package/web/chunk-q6eq5y2t.js.gz +0 -0
- package/web/chunk-qdwg9n1d.js +1 -0
- package/web/chunk-qdwg9n1d.js.br +0 -0
- package/web/chunk-qdwg9n1d.js.gz +0 -0
- package/web/chunk-qp42gtvd.js +1 -0
- package/web/chunk-qp42gtvd.js.br +0 -0
- package/web/chunk-qp42gtvd.js.gz +0 -0
- package/web/chunk-qzdw8vdp.js +1 -0
- package/web/chunk-qzdw8vdp.js.br +0 -0
- package/web/chunk-qzdw8vdp.js.gz +0 -0
- package/web/chunk-r571ywxq.js +1 -0
- package/web/chunk-r571ywxq.js.br +0 -0
- package/web/chunk-r571ywxq.js.gz +0 -0
- package/web/chunk-r9fx4cjw.js +1 -0
- package/web/chunk-r9fx4cjw.js.br +0 -0
- package/web/chunk-r9fx4cjw.js.gz +0 -0
- package/web/chunk-rhvq3c1c.js +1 -0
- package/web/chunk-rhvq3c1c.js.br +0 -0
- package/web/chunk-rhvq3c1c.js.gz +0 -0
- package/web/chunk-rjay9w1t.js +1 -0
- package/web/chunk-rjay9w1t.js.br +0 -0
- package/web/chunk-rjay9w1t.js.gz +0 -0
- package/web/chunk-rpvdnc3p.js +1 -0
- package/web/chunk-rpvdnc3p.js.br +0 -0
- package/web/chunk-rpvdnc3p.js.gz +0 -0
- package/web/chunk-rrfr4wyt.js +62 -0
- package/web/chunk-rrfr4wyt.js.br +0 -0
- package/web/chunk-rrfr4wyt.js.gz +0 -0
- package/web/chunk-rvngywg9.js +2 -0
- package/web/chunk-rvngywg9.js.br +0 -0
- package/web/chunk-rvngywg9.js.gz +0 -0
- package/web/chunk-rw7d025r.js +84 -0
- package/web/chunk-rw7d025r.js.br +0 -0
- package/web/chunk-rw7d025r.js.gz +0 -0
- package/web/chunk-s1g8acth.js +324 -0
- package/web/chunk-s1g8acth.js.br +0 -0
- package/web/chunk-s1g8acth.js.gz +0 -0
- package/web/chunk-s8572njv.js +2 -0
- package/web/chunk-s8572njv.js.br +1 -0
- package/web/chunk-s8572njv.js.gz +0 -0
- package/web/chunk-sb57e1m9.css +1 -0
- package/web/chunk-sb57e1m9.css.br +0 -0
- package/web/chunk-sb57e1m9.css.gz +0 -0
- package/web/chunk-sn3h5adt.js +2 -0
- package/web/chunk-sn3h5adt.js.br +0 -0
- package/web/chunk-sn3h5adt.js.gz +0 -0
- package/web/chunk-tb2v18q8.js +2 -0
- package/web/chunk-tb2v18q8.js.br +0 -0
- package/web/chunk-tb2v18q8.js.gz +0 -0
- package/web/chunk-tetbyky0.js +39 -0
- package/web/chunk-tetbyky0.js.br +0 -0
- package/web/chunk-tetbyky0.js.gz +0 -0
- package/web/chunk-tqvctvsv.js +1 -0
- package/web/chunk-tqvctvsv.js.br +0 -0
- package/web/chunk-tqvctvsv.js.gz +0 -0
- package/web/chunk-v9mj2pxz.js +1 -0
- package/web/chunk-v9mj2pxz.js.br +0 -0
- package/web/chunk-v9mj2pxz.js.gz +0 -0
- package/web/chunk-vkhah4nd.js +2 -0
- package/web/chunk-vkhah4nd.js.br +0 -0
- package/web/chunk-vkhah4nd.js.gz +0 -0
- package/web/chunk-vpnh7wmw.js +1 -0
- package/web/chunk-vpnh7wmw.js.br +0 -0
- package/web/chunk-vpnh7wmw.js.gz +0 -0
- package/web/chunk-w1qe2x5p.js +217 -0
- package/web/chunk-w1qe2x5p.js.br +0 -0
- package/web/chunk-w1qe2x5p.js.gz +0 -0
- package/web/chunk-werh47fw.js +99 -0
- package/web/chunk-werh47fw.js.br +0 -0
- package/web/chunk-werh47fw.js.gz +0 -0
- package/web/chunk-wfmf0dc8.js +1 -0
- package/web/chunk-wfmf0dc8.js.br +0 -0
- package/web/chunk-wfmf0dc8.js.gz +0 -0
- package/web/chunk-wna4vqp6.js +1 -0
- package/web/chunk-wna4vqp6.js.br +0 -0
- package/web/chunk-wna4vqp6.js.gz +0 -0
- package/web/chunk-wwhq09nf.js +1 -0
- package/web/chunk-wwhq09nf.js.br +0 -0
- package/web/chunk-wwhq09nf.js.gz +0 -0
- package/web/chunk-x6va53y6.js +291 -0
- package/web/chunk-x6va53y6.js.br +0 -0
- package/web/chunk-x6va53y6.js.gz +0 -0
- package/web/chunk-xefyzr9s.js +120 -0
- package/web/chunk-xefyzr9s.js.br +0 -0
- package/web/chunk-xefyzr9s.js.gz +0 -0
- package/web/chunk-xj1w9054.js +2 -0
- package/web/chunk-xj1w9054.js.br +0 -0
- package/web/chunk-xj1w9054.js.gz +0 -0
- package/web/chunk-xtb3xhxk.js +2 -0
- package/web/chunk-xtb3xhxk.js.br +2 -0
- package/web/chunk-xtb3xhxk.js.gz +0 -0
- package/web/chunk-y1eeptks.js +2 -0
- package/web/chunk-y1eeptks.js.br +0 -0
- package/web/chunk-y1eeptks.js.gz +0 -0
- package/web/chunk-y7z6zmvp.js +292 -0
- package/web/chunk-y7z6zmvp.js.br +0 -0
- package/web/chunk-y7z6zmvp.js.gz +0 -0
- package/web/chunk-yj8tkncg.js +7 -0
- package/web/chunk-yj8tkncg.js.br +0 -0
- package/web/chunk-yj8tkncg.js.gz +0 -0
- package/web/chunk-z0m2d74w.js +1 -0
- package/web/chunk-z0m2d74w.js.br +0 -0
- package/web/chunk-z0m2d74w.js.gz +0 -0
- package/web/chunk-z30kqv40.js +1 -0
- package/web/chunk-z30kqv40.js.br +0 -0
- package/web/chunk-z30kqv40.js.gz +0 -0
- package/web/chunk-z3a96d42.js +332 -0
- package/web/chunk-z3a96d42.js.br +0 -0
- package/web/chunk-z3a96d42.js.gz +0 -0
- package/web/index.html +1 -1
- package/web/index.html.br +0 -0
- package/web/index.html.gz +0 -0
- package/worker.js +1 -1
- package/chunk-10y5hvt2.js +0 -2
- package/chunk-22k2be3e.js +0 -13
- package/chunk-28hye007.js +0 -2
- package/chunk-2fmsw1c6.js +0 -5
- package/chunk-2h2mvrw2.js +0 -3
- package/chunk-2xj51v3m.js +0 -3
- package/chunk-3x0wm92n.js +0 -3
- package/chunk-4fgsqb1e.js +0 -2
- package/chunk-519eek65.js +0 -39
- package/chunk-5qa4dean.js +0 -2
- package/chunk-5x256mz8.js +0 -2
- package/chunk-6n01sefp.js +0 -8
- package/chunk-74xtmwpw.js +0 -2
- package/chunk-7mafj833.js +0 -3
- package/chunk-7v1sqn9k.js +0 -59
- package/chunk-8my52htr.js +0 -3
- package/chunk-8vh98e46.js +0 -2
- package/chunk-92mpgche.js +0 -2
- package/chunk-9vacevyf.js +0 -3
- package/chunk-9y44m27k.js +0 -5
- package/chunk-a5wv2shs.js +0 -3
- package/chunk-a78qhb4t.js +0 -5
- package/chunk-axsxx67j.js +0 -3
- package/chunk-b49fzzzn.js +0 -2
- package/chunk-bc8awbnt.js +0 -2
- package/chunk-crxs0n0r.js +0 -3
- package/chunk-csed8fsv.js +0 -3
- package/chunk-cspx3bz9.js +0 -2
- package/chunk-ctdtmwmd.js +0 -63
- package/chunk-d3xsmwbh.js +0 -25
- package/chunk-dvwgpsfz.js +0 -3
- package/chunk-dzd8k6bw.js +0 -3
- package/chunk-e2xqa46t.js +0 -2
- package/chunk-e41mpwx9.js +0 -9
- package/chunk-e5ccfgsk.js +0 -3
- package/chunk-e67wqhzh.js +0 -12
- package/chunk-emeb13nd.js +0 -25
- package/chunk-ers9s2c4.js +0 -31
- package/chunk-ezq0fnz6.js +0 -3
- package/chunk-ezqvx0hm.js +0 -2
- package/chunk-f10ca9ma.js +0 -12
- package/chunk-f72jhcp8.js +0 -2
- package/chunk-fjv41a8r.js +0 -4155
- package/chunk-gj0dhgbg.js +0 -3
- package/chunk-h0ggc6pv.js +0 -60
- package/chunk-hrt42rkh.js +0 -4
- package/chunk-j7m36g5w.js +0 -3
- package/chunk-jhn30hjp.js +0 -2
- package/chunk-ka41gq1g.js +0 -16
- package/chunk-kcp9byws.js +0 -2
- package/chunk-me72k64f.js +0 -7
- package/chunk-n4jemqf1.js +0 -2
- package/chunk-ndt4jvh1.js +0 -3
- package/chunk-pyxn4wqj.js +0 -3
- package/chunk-rajb3566.js +0 -2
- package/chunk-rbq2gsar.js +0 -3
- package/chunk-rd98e7kg.js +0 -10
- package/chunk-rm5dbbsg.js +0 -3
- package/chunk-rztw3tgx.js +0 -3
- package/chunk-s4mn41eh.js +0 -8
- package/chunk-s9p624fq.js +0 -44
- package/chunk-sawrte7v.js +0 -3
- package/chunk-sd8d792h.js +0 -51
- package/chunk-sgvmxx0d.js +0 -2
- package/chunk-sqbnt2t1.js +0 -3
- package/chunk-t2bvj735.js +0 -2
- package/chunk-t8tkamx6.js +0 -2
- package/chunk-tbehe5ky.js +0 -18
- package/chunk-tsha69rv.js +0 -7
- package/chunk-twqwer9t.js +0 -5
- package/chunk-vr2rtqeh.js +0 -2
- package/chunk-vr6eej6b.js +0 -3
- package/chunk-w41gswj8.js +0 -3
- package/chunk-x7tras0x.js +0 -498
- package/chunk-xakmebnm.js +0 -10
- package/chunk-xj453mny.js +0 -286
- package/chunk-xmrw19xj.js +0 -2
- package/chunk-xpj8fcjp.js +0 -20
- package/chunk-y218jsvc.js +0 -3
- package/chunk-y33fkh8m.js +0 -2
- package/chunk-z3h9ydyr.js +0 -11
- package/chunk-zc51vfhr.js +0 -2
- package/chunk-zm88mnds.js +0 -7
- package/chunk-zz9rj82y.js +0 -3
- package/web/chunk-0b5vh2pt.js +0 -2
- package/web/chunk-0b5vh2pt.js.br +0 -0
- package/web/chunk-0b5vh2pt.js.gz +0 -0
- package/web/chunk-0hkdqhkv.js +0 -1
- package/web/chunk-0hkdqhkv.js.br +0 -0
- package/web/chunk-0hkdqhkv.js.gz +0 -0
- package/web/chunk-0v7wrb32.js +0 -2
- package/web/chunk-0v7wrb32.js.br +0 -0
- package/web/chunk-0v7wrb32.js.gz +0 -0
- package/web/chunk-0x2fgw1m.js +0 -1
- package/web/chunk-0x2fgw1m.js.br +0 -0
- package/web/chunk-0x2fgw1m.js.gz +0 -0
- package/web/chunk-0xctxqvv.js +0 -2
- package/web/chunk-0xctxqvv.js.br +0 -0
- package/web/chunk-0xctxqvv.js.gz +0 -0
- package/web/chunk-0y9tf0rt.js +0 -89
- package/web/chunk-0y9tf0rt.js.br +0 -0
- package/web/chunk-0y9tf0rt.js.gz +0 -0
- package/web/chunk-0yrp0f6x.js +0 -1
- package/web/chunk-0yrp0f6x.js.br +0 -0
- package/web/chunk-0yrp0f6x.js.gz +0 -0
- package/web/chunk-10jk2pn9.js +0 -1
- package/web/chunk-10jk2pn9.js.br +0 -0
- package/web/chunk-10jk2pn9.js.gz +0 -0
- package/web/chunk-15ka35m9.js +0 -2
- package/web/chunk-15ka35m9.js.br +0 -0
- package/web/chunk-15ka35m9.js.gz +0 -0
- package/web/chunk-1700cges.js +0 -1
- package/web/chunk-1700cges.js.br +0 -0
- package/web/chunk-1700cges.js.gz +0 -0
- package/web/chunk-1apw6pnk.css +0 -1
- package/web/chunk-1apw6pnk.css.br +0 -0
- package/web/chunk-1apw6pnk.css.gz +0 -0
- package/web/chunk-1b005nqw.js +0 -139
- package/web/chunk-1b005nqw.js.br +0 -0
- package/web/chunk-1b005nqw.js.gz +0 -0
- package/web/chunk-1c9khgyt.js +0 -1
- package/web/chunk-1c9khgyt.js.br +0 -2
- package/web/chunk-1c9khgyt.js.gz +0 -0
- package/web/chunk-1pr20x9x.js +0 -1
- package/web/chunk-1pr20x9x.js.br +0 -0
- package/web/chunk-1pr20x9x.js.gz +0 -0
- package/web/chunk-1sjgdggk.js +0 -7
- package/web/chunk-1sjgdggk.js.br +0 -0
- package/web/chunk-1sjgdggk.js.gz +0 -0
- package/web/chunk-1tt5ympp.js +0 -1
- package/web/chunk-1tt5ympp.js.br +0 -0
- package/web/chunk-1tt5ympp.js.gz +0 -0
- package/web/chunk-29fpfs5q.js +0 -1142
- package/web/chunk-29fpfs5q.js.br +0 -0
- package/web/chunk-29fpfs5q.js.gz +0 -0
- package/web/chunk-2gr7vwnp.js +0 -24
- package/web/chunk-2gr7vwnp.js.br +0 -0
- package/web/chunk-2gr7vwnp.js.gz +0 -0
- package/web/chunk-2p84jch3.js +0 -1
- package/web/chunk-2p84jch3.js.br +0 -0
- package/web/chunk-2p84jch3.js.gz +0 -0
- package/web/chunk-2qs283mh.js +0 -2
- package/web/chunk-2qs283mh.js.br +0 -0
- package/web/chunk-2qs283mh.js.gz +0 -0
- package/web/chunk-3gf2d852.js +0 -1
- package/web/chunk-3gf2d852.js.br +0 -0
- package/web/chunk-3gf2d852.js.gz +0 -0
- package/web/chunk-3hswqkb0.js +0 -1
- package/web/chunk-3hswqkb0.js.br +0 -0
- package/web/chunk-3hswqkb0.js.gz +0 -0
- package/web/chunk-46yjp1x4.js +0 -2
- package/web/chunk-46yjp1x4.js.br +0 -0
- package/web/chunk-46yjp1x4.js.gz +0 -0
- package/web/chunk-4ezd1rkc.js +0 -84
- package/web/chunk-4ezd1rkc.js.br +0 -0
- package/web/chunk-4ezd1rkc.js.gz +0 -0
- package/web/chunk-4v9ar0sf.js +0 -142
- package/web/chunk-4v9ar0sf.js.br +0 -0
- package/web/chunk-4v9ar0sf.js.gz +0 -0
- package/web/chunk-51z88j1t.js +0 -21
- package/web/chunk-51z88j1t.js.br +0 -0
- package/web/chunk-51z88j1t.js.gz +0 -0
- package/web/chunk-5f5zcfga.js +0 -1
- package/web/chunk-5f5zcfga.js.br +0 -2
- package/web/chunk-5f5zcfga.js.gz +0 -0
- package/web/chunk-5n61r0rr.js +0 -36
- package/web/chunk-5n61r0rr.js.br +0 -0
- package/web/chunk-5n61r0rr.js.gz +0 -0
- package/web/chunk-5vcdeenv.js +0 -2
- package/web/chunk-5vcdeenv.js.br +0 -0
- package/web/chunk-5vcdeenv.js.gz +0 -0
- package/web/chunk-5y7ks8c3.js +0 -30
- package/web/chunk-5y7ks8c3.js.br +0 -0
- package/web/chunk-5y7ks8c3.js.gz +0 -0
- package/web/chunk-60v8qwec.js +0 -2
- package/web/chunk-60v8qwec.js.br +0 -0
- package/web/chunk-60v8qwec.js.gz +0 -0
- package/web/chunk-61m5t9wg.js +0 -200
- package/web/chunk-61m5t9wg.js.br +0 -0
- package/web/chunk-61m5t9wg.js.gz +0 -0
- package/web/chunk-669n37qf.js +0 -70
- package/web/chunk-669n37qf.js.br +0 -0
- package/web/chunk-669n37qf.js.gz +0 -0
- package/web/chunk-6kf1xwz9.js +0 -2
- package/web/chunk-6kf1xwz9.js.br +0 -0
- package/web/chunk-6kf1xwz9.js.gz +0 -0
- package/web/chunk-6rw72jmj.js +0 -2
- package/web/chunk-6rw72jmj.js.br +0 -0
- package/web/chunk-6rw72jmj.js.gz +0 -0
- package/web/chunk-6wyxxd9h.js +0 -2
- package/web/chunk-6wyxxd9h.js.br +0 -0
- package/web/chunk-6wyxxd9h.js.gz +0 -0
- package/web/chunk-77vj65dc.js +0 -1
- package/web/chunk-77vj65dc.js.br +0 -0
- package/web/chunk-77vj65dc.js.gz +0 -0
- package/web/chunk-8ktz0w1x.js +0 -120
- package/web/chunk-8ktz0w1x.js.br +0 -0
- package/web/chunk-8ktz0w1x.js.gz +0 -0
- package/web/chunk-8rcfpj02.js +0 -2
- package/web/chunk-8rcfpj02.js.br +0 -0
- package/web/chunk-8rcfpj02.js.gz +0 -0
- package/web/chunk-8x4s1c9g.js +0 -1
- package/web/chunk-8x4s1c9g.js.br +0 -2
- package/web/chunk-8x4s1c9g.js.gz +0 -0
- package/web/chunk-8zf4cywy.js +0 -1
- package/web/chunk-8zf4cywy.js.br +0 -0
- package/web/chunk-8zf4cywy.js.gz +0 -0
- package/web/chunk-a18y5dmf.js +0 -2
- package/web/chunk-a18y5dmf.js.br +0 -0
- package/web/chunk-a18y5dmf.js.gz +0 -0
- package/web/chunk-a36sfjyk.js +0 -1
- package/web/chunk-a36sfjyk.js.br +0 -0
- package/web/chunk-a36sfjyk.js.gz +0 -0
- package/web/chunk-aahzqxq7.js +0 -34
- package/web/chunk-aahzqxq7.js.br +0 -0
- package/web/chunk-aahzqxq7.js.gz +0 -0
- package/web/chunk-b2gtwatf.js +0 -370
- package/web/chunk-b2gtwatf.js.br +0 -0
- package/web/chunk-b2gtwatf.js.gz +0 -0
- package/web/chunk-bdp4y1zg.js +0 -1
- package/web/chunk-bdp4y1zg.js.br +0 -0
- package/web/chunk-bdp4y1zg.js.gz +0 -0
- package/web/chunk-be67vfx1.js +0 -1
- package/web/chunk-be67vfx1.js.br +0 -0
- package/web/chunk-be67vfx1.js.gz +0 -0
- package/web/chunk-bt6r78y9.js +0 -106
- package/web/chunk-bt6r78y9.js.br +0 -0
- package/web/chunk-bt6r78y9.js.gz +0 -0
- package/web/chunk-bvyjy17t.js +0 -14
- package/web/chunk-bvyjy17t.js.br +0 -0
- package/web/chunk-bvyjy17t.js.gz +0 -0
- package/web/chunk-c97th1x0.js +0 -1
- package/web/chunk-c97th1x0.js.br +0 -0
- package/web/chunk-c97th1x0.js.gz +0 -0
- package/web/chunk-cfkp7taw.js +0 -1
- package/web/chunk-cfkp7taw.js.br +0 -0
- package/web/chunk-cfkp7taw.js.gz +0 -0
- package/web/chunk-cvf9k1fy.js +0 -140
- package/web/chunk-cvf9k1fy.js.br +0 -0
- package/web/chunk-cvf9k1fy.js.gz +0 -0
- package/web/chunk-d33n9fsr.js +0 -1
- package/web/chunk-d33n9fsr.js.br +0 -1
- package/web/chunk-d33n9fsr.js.gz +0 -0
- package/web/chunk-e667nxc9.js +0 -1
- package/web/chunk-e667nxc9.js.br +0 -0
- package/web/chunk-e667nxc9.js.gz +0 -0
- package/web/chunk-eejjsqm1.js +0 -303
- package/web/chunk-eejjsqm1.js.br +0 -0
- package/web/chunk-eejjsqm1.js.gz +0 -0
- package/web/chunk-eg3qjy7a.js +0 -2
- package/web/chunk-eg3qjy7a.js.br +0 -0
- package/web/chunk-eg3qjy7a.js.gz +0 -0
- package/web/chunk-embvjvdj.js +0 -12
- package/web/chunk-embvjvdj.js.br +0 -0
- package/web/chunk-embvjvdj.js.gz +0 -0
- package/web/chunk-etjfr79m.js +0 -2
- package/web/chunk-etjfr79m.js.br +0 -0
- package/web/chunk-etjfr79m.js.gz +0 -0
- package/web/chunk-ez36gbz3.js +0 -7
- package/web/chunk-ez36gbz3.js.br +0 -0
- package/web/chunk-ez36gbz3.js.gz +0 -0
- package/web/chunk-f0vcm8mk.js +0 -214
- package/web/chunk-f0vcm8mk.js.br +0 -0
- package/web/chunk-f0vcm8mk.js.gz +0 -0
- package/web/chunk-f3t3ey83.js +0 -1
- package/web/chunk-f3t3ey83.js.br +0 -0
- package/web/chunk-f3t3ey83.js.gz +0 -0
- package/web/chunk-f84sngcq.js +0 -2
- package/web/chunk-f84sngcq.js.br +0 -0
- package/web/chunk-f84sngcq.js.gz +0 -0
- package/web/chunk-f97hz4v5.js +0 -99
- package/web/chunk-f97hz4v5.js.br +0 -0
- package/web/chunk-f97hz4v5.js.gz +0 -0
- package/web/chunk-fnkp6s0g.js +0 -1
- package/web/chunk-fnkp6s0g.js.br +0 -0
- package/web/chunk-fnkp6s0g.js.gz +0 -0
- package/web/chunk-fpdyzyn8.js +0 -16
- package/web/chunk-fpdyzyn8.js.br +0 -0
- package/web/chunk-fpdyzyn8.js.gz +0 -0
- package/web/chunk-g43z223a.js +0 -2
- package/web/chunk-g43z223a.js.br +0 -0
- package/web/chunk-g43z223a.js.gz +0 -0
- package/web/chunk-gcm82aj8.js +0 -1
- package/web/chunk-gcm82aj8.js.br +0 -0
- package/web/chunk-gcm82aj8.js.gz +0 -0
- package/web/chunk-gffb3p4z.js +0 -2
- package/web/chunk-gffb3p4z.js.br +0 -0
- package/web/chunk-gffb3p4z.js.gz +0 -0
- package/web/chunk-gnzg3krt.js +0 -1
- package/web/chunk-gnzg3krt.js.br +0 -0
- package/web/chunk-gnzg3krt.js.gz +0 -0
- package/web/chunk-grqtpfdp.js +0 -2
- package/web/chunk-grqtpfdp.js.br +0 -0
- package/web/chunk-grqtpfdp.js.gz +0 -0
- package/web/chunk-gsm8spf8.js +0 -1
- package/web/chunk-gsm8spf8.js.br +0 -0
- package/web/chunk-gsm8spf8.js.gz +0 -0
- package/web/chunk-h6ygrnd0.js +0 -38
- package/web/chunk-h6ygrnd0.js.br +0 -0
- package/web/chunk-h6ygrnd0.js.gz +0 -0
- package/web/chunk-h8n9w5th.js +0 -169
- package/web/chunk-h8n9w5th.js.br +0 -0
- package/web/chunk-h8n9w5th.js.gz +0 -0
- package/web/chunk-hmdvm5pp.js +0 -2
- package/web/chunk-hmdvm5pp.js.br +0 -0
- package/web/chunk-hmdvm5pp.js.gz +0 -0
- package/web/chunk-hrntwvx8.js +0 -1
- package/web/chunk-hrntwvx8.js.br +0 -0
- package/web/chunk-hrntwvx8.js.gz +0 -0
- package/web/chunk-hrys15jh.js +0 -324
- package/web/chunk-hrys15jh.js.br +0 -0
- package/web/chunk-hrys15jh.js.gz +0 -0
- package/web/chunk-j0ng7zdq.js +0 -41
- package/web/chunk-j0ng7zdq.js.br +0 -0
- package/web/chunk-j0ng7zdq.js.gz +0 -0
- package/web/chunk-j2t5ycte.js +0 -78
- package/web/chunk-j2t5ycte.js.br +0 -0
- package/web/chunk-j2t5ycte.js.gz +0 -0
- package/web/chunk-jkjd1y3p.js +0 -3
- package/web/chunk-jkjd1y3p.js.br +0 -0
- package/web/chunk-jkjd1y3p.js.gz +0 -0
- package/web/chunk-jweahmyy.js +0 -1
- package/web/chunk-jweahmyy.js.br +0 -0
- package/web/chunk-jweahmyy.js.gz +0 -0
- package/web/chunk-k56v8k7n.js +0 -4
- package/web/chunk-k56v8k7n.js.br +0 -0
- package/web/chunk-k56v8k7n.js.gz +0 -0
- package/web/chunk-k59sk88z.js +0 -7
- package/web/chunk-k59sk88z.js.br +0 -0
- package/web/chunk-k59sk88z.js.gz +0 -0
- package/web/chunk-k75a0fpt.js +0 -62
- package/web/chunk-k75a0fpt.js.br +0 -0
- package/web/chunk-k75a0fpt.js.gz +0 -0
- package/web/chunk-kfx9q7xv.js +0 -2
- package/web/chunk-kfx9q7xv.js.br +0 -0
- package/web/chunk-kfx9q7xv.js.gz +0 -0
- package/web/chunk-ksp1gg3v.js +0 -1
- package/web/chunk-ksp1gg3v.js.br +0 -0
- package/web/chunk-ksp1gg3v.js.gz +0 -0
- package/web/chunk-kxxp1mn4.js +0 -2
- package/web/chunk-kxxp1mn4.js.br +0 -0
- package/web/chunk-kxxp1mn4.js.gz +0 -0
- package/web/chunk-mapbxzsz.js +0 -1
- package/web/chunk-mapbxzsz.js.br +0 -0
- package/web/chunk-mapbxzsz.js.gz +0 -0
- package/web/chunk-msw43fnq.js +0 -2
- package/web/chunk-msw43fnq.js.br +0 -0
- package/web/chunk-msw43fnq.js.gz +0 -0
- package/web/chunk-mzzjg4sn.js +0 -2
- package/web/chunk-mzzjg4sn.js.br +0 -0
- package/web/chunk-mzzjg4sn.js.gz +0 -0
- package/web/chunk-n1bmcj13.js +0 -2
- package/web/chunk-n1bmcj13.js.br +0 -0
- package/web/chunk-n1bmcj13.js.gz +0 -0
- package/web/chunk-n5y4ar3e.js +0 -1
- package/web/chunk-n5y4ar3e.js.br +0 -0
- package/web/chunk-n5y4ar3e.js.gz +0 -0
- package/web/chunk-n9vszqw9.js +0 -1
- package/web/chunk-n9vszqw9.js.br +0 -0
- package/web/chunk-n9vszqw9.js.gz +0 -0
- package/web/chunk-nzzcmxq8.js +0 -1
- package/web/chunk-nzzcmxq8.js.br +0 -0
- package/web/chunk-nzzcmxq8.js.gz +0 -0
- package/web/chunk-p25eppk1.js +0 -1
- package/web/chunk-p25eppk1.js.br +0 -0
- package/web/chunk-p25eppk1.js.gz +0 -0
- package/web/chunk-p9352vpw.js +0 -1
- package/web/chunk-p9352vpw.js.br +0 -0
- package/web/chunk-p9352vpw.js.gz +0 -0
- package/web/chunk-pdvm4n6f.js +0 -1
- package/web/chunk-pdvm4n6f.js.br +0 -2
- package/web/chunk-pdvm4n6f.js.gz +0 -0
- package/web/chunk-pjm2t9da.js +0 -1
- package/web/chunk-pjm2t9da.js.br +0 -0
- package/web/chunk-pjm2t9da.js.gz +0 -0
- package/web/chunk-pka3qm06.js +0 -98
- package/web/chunk-pka3qm06.js.br +0 -0
- package/web/chunk-pka3qm06.js.gz +0 -0
- package/web/chunk-pkbcbta6.js +0 -1
- package/web/chunk-pkbcbta6.js.br +0 -0
- package/web/chunk-pkbcbta6.js.gz +0 -0
- package/web/chunk-pq4vn3zh.js +0 -1
- package/web/chunk-pq4vn3zh.js.br +0 -0
- package/web/chunk-pq4vn3zh.js.gz +0 -0
- package/web/chunk-prk9ks5j.js +0 -1
- package/web/chunk-prk9ks5j.js.br +0 -0
- package/web/chunk-prk9ks5j.js.gz +0 -0
- package/web/chunk-px68tdjm.js +0 -1
- package/web/chunk-px68tdjm.js.br +0 -2
- package/web/chunk-px68tdjm.js.gz +0 -0
- package/web/chunk-px8k5edz.js +0 -24
- package/web/chunk-px8k5edz.js.br +0 -0
- package/web/chunk-px8k5edz.js.gz +0 -0
- package/web/chunk-pz4g2bem.js +0 -292
- package/web/chunk-pz4g2bem.js.br +0 -0
- package/web/chunk-pz4g2bem.js.gz +0 -0
- package/web/chunk-q0gx75nf.js +0 -55
- package/web/chunk-q0gx75nf.js.br +0 -0
- package/web/chunk-q0gx75nf.js.gz +0 -0
- package/web/chunk-q9rpxfmm.js +0 -1
- package/web/chunk-q9rpxfmm.js.br +0 -0
- package/web/chunk-q9rpxfmm.js.gz +0 -0
- package/web/chunk-qpfhs1x0.js +0 -1
- package/web/chunk-qpfhs1x0.js.br +0 -0
- package/web/chunk-qpfhs1x0.js.gz +0 -0
- package/web/chunk-qredmg6m.js +0 -1
- package/web/chunk-qredmg6m.js.br +0 -0
- package/web/chunk-qredmg6m.js.gz +0 -0
- package/web/chunk-qtc9ar2m.js +0 -2
- package/web/chunk-qtc9ar2m.js.br +0 -0
- package/web/chunk-qtc9ar2m.js.gz +0 -0
- package/web/chunk-r5dsw56r.js +0 -1
- package/web/chunk-r5dsw56r.js.br +0 -0
- package/web/chunk-r5dsw56r.js.gz +0 -0
- package/web/chunk-rkaps675.js +0 -1
- package/web/chunk-rkaps675.js.br +0 -0
- package/web/chunk-rkaps675.js.gz +0 -0
- package/web/chunk-rp87pgcp.js +0 -40
- package/web/chunk-rp87pgcp.js.br +0 -0
- package/web/chunk-rp87pgcp.js.gz +0 -0
- package/web/chunk-rs1mtd35.js +0 -2
- package/web/chunk-rs1mtd35.js.br +0 -0
- package/web/chunk-rs1mtd35.js.gz +0 -0
- package/web/chunk-s31n33g5.js +0 -2
- package/web/chunk-s31n33g5.js.br +0 -0
- package/web/chunk-s31n33g5.js.gz +0 -0
- package/web/chunk-sbcyvn42.js +0 -1
- package/web/chunk-sbcyvn42.js.br +0 -0
- package/web/chunk-sbcyvn42.js.gz +0 -0
- package/web/chunk-sew9vfwy.js +0 -1
- package/web/chunk-sew9vfwy.js.br +0 -0
- package/web/chunk-sew9vfwy.js.gz +0 -0
- package/web/chunk-sgaw26nc.js +0 -2
- package/web/chunk-sgaw26nc.js.br +0 -0
- package/web/chunk-sgaw26nc.js.gz +0 -0
- package/web/chunk-t2ak4a9d.js +0 -1
- package/web/chunk-t2ak4a9d.js.br +0 -0
- package/web/chunk-t2ak4a9d.js.gz +0 -0
- package/web/chunk-ta0e3dk6.js +0 -2
- package/web/chunk-ta0e3dk6.js.br +0 -0
- package/web/chunk-ta0e3dk6.js.gz +0 -0
- package/web/chunk-tqax5mb6.js +0 -217
- package/web/chunk-tqax5mb6.js.br +0 -0
- package/web/chunk-tqax5mb6.js.gz +0 -0
- package/web/chunk-v1wxeq38.js +0 -2
- package/web/chunk-v1wxeq38.js.br +0 -0
- package/web/chunk-v1wxeq38.js.gz +0 -0
- package/web/chunk-v3kwg4zn.js +0 -2
- package/web/chunk-v3kwg4zn.js.br +0 -0
- package/web/chunk-v3kwg4zn.js.gz +0 -0
- package/web/chunk-vcpvhkxh.js +0 -39
- package/web/chunk-vcpvhkxh.js.br +0 -0
- package/web/chunk-vcpvhkxh.js.gz +0 -0
- package/web/chunk-vg9qv3aa.js +0 -1
- package/web/chunk-vg9qv3aa.js.br +0 -0
- package/web/chunk-vg9qv3aa.js.gz +0 -0
- package/web/chunk-vwxnt3nh.js +0 -1
- package/web/chunk-vwxnt3nh.js.br +0 -0
- package/web/chunk-vwxnt3nh.js.gz +0 -0
- package/web/chunk-w1xjqhwy.js +0 -1
- package/web/chunk-w1xjqhwy.js.br +0 -2
- package/web/chunk-w1xjqhwy.js.gz +0 -0
- package/web/chunk-w3nfxvzd.js +0 -1
- package/web/chunk-w3nfxvzd.js.br +0 -0
- package/web/chunk-w3nfxvzd.js.gz +0 -0
- package/web/chunk-w7h3x3ys.js +0 -1
- package/web/chunk-w7h3x3ys.js.br +0 -0
- package/web/chunk-w7h3x3ys.js.gz +0 -0
- package/web/chunk-wb0yn3r4.js +0 -8
- package/web/chunk-wb0yn3r4.js.br +0 -0
- package/web/chunk-wb0yn3r4.js.gz +0 -0
- package/web/chunk-wff6hqjf.js +0 -1
- package/web/chunk-wff6hqjf.js.br +0 -0
- package/web/chunk-wff6hqjf.js.gz +0 -0
- package/web/chunk-whj4e4sb.js +0 -89
- package/web/chunk-whj4e4sb.js.br +0 -0
- package/web/chunk-whj4e4sb.js.gz +0 -0
- package/web/chunk-wn3kdpj0.js +0 -1
- package/web/chunk-wn3kdpj0.js.br +0 -0
- package/web/chunk-wn3kdpj0.js.gz +0 -0
- package/web/chunk-wzq3qxpb.js +0 -1
- package/web/chunk-wzq3qxpb.js.br +0 -0
- package/web/chunk-wzq3qxpb.js.gz +0 -0
- package/web/chunk-x2tezwv1.js +0 -4
- package/web/chunk-x2tezwv1.js.br +0 -0
- package/web/chunk-x2tezwv1.js.gz +0 -0
- package/web/chunk-xmajh4qe.js +0 -2
- package/web/chunk-xmajh4qe.js.br +0 -0
- package/web/chunk-xmajh4qe.js.gz +0 -0
- package/web/chunk-xz7py7yx.js +0 -1
- package/web/chunk-xz7py7yx.js.br +0 -0
- package/web/chunk-xz7py7yx.js.gz +0 -0
- package/web/chunk-y4af9gsm.js +0 -291
- package/web/chunk-y4af9gsm.js.br +0 -0
- package/web/chunk-y4af9gsm.js.gz +0 -0
- package/web/chunk-y512gr5a.js +0 -332
- package/web/chunk-y512gr5a.js.br +0 -0
- package/web/chunk-y512gr5a.js.gz +0 -0
- package/web/chunk-ywg44m2b.js +0 -2
- package/web/chunk-ywg44m2b.js.br +0 -0
- package/web/chunk-ywg44m2b.js.gz +0 -0
- package/web/chunk-zhzp4fm1.js +0 -2
- package/web/chunk-zhzp4fm1.js.br +0 -0
- package/web/chunk-zhzp4fm1.js.gz +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A}from"./chunk-rhkw8ygf.js";import{ho,V}from"./chunk-0y13kfpt.js";import{o,e,wt,Sr,p,le,je,er,qo,ds,Go,Vo,Ko,Qo,Yo,Xo,Jo,Zo,pa,De,ms,Wn,hs,gs,ei,ti,tr,U,da,xr,rr,Hn,ri,N,ma,Ct,Se,vr,ni,ha,oi,M,zn,_r}from"./chunk-cwn9vs1a.js";import{nr,or}from"./chunk-78ferdza.js";import{ue}from"./chunk-x0afp8wt.js";import{ye}from"./chunk-0aaf270z.js";import{Ae,xe,Yr,re,Qn,Te}from"./chunk-yq20v3va.js";import{v}from"./chunk-fsekbhqb.js";import{J}from"./chunk-9nkb5q43.js";import{G,et,ve,me,pe,oe}from"./chunk-4qtw5cga.js";import{W,ze}from"./chunk-nbgtqpay.js";import{c,r}from"./chunk-bh80e336.js";var ya=r(function(de){var tl=de&&de.__extends||function(){var s=function(n,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var l in a)if(a.hasOwnProperty(l))i[l]=a[l]},s(n,t)};return function(n,t){s(n,t);function i(){this.constructor=n}n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(de,"__esModule",{value:!0});var Y=256,wi=function(){function s(n){if(n===void 0)n="=";this._paddingCharacter=n}return s.prototype.encodedLength=function(n){if(!this._paddingCharacter)return(n*8+5)/6|0;return(n+2)/3*4|0},s.prototype.encode=function(n){var t="",i=0;for(;i<n.length-2;i+=3){var a=n[i]<<16|n[i+1]<<8|n[i+2];t+=this._encodeByte(a>>>18&63),t+=this._encodeByte(a>>>12&63),t+=this._encodeByte(a>>>6&63),t+=this._encodeByte(a>>>0&63)}var l=n.length-i;if(l>0){var a=n[i]<<16|(l===2?n[i+1]<<8:0);if(t+=this._encodeByte(a>>>18&63),t+=this._encodeByte(a>>>12&63),l===2)t+=this._encodeByte(a>>>6&63);else t+=this._paddingCharacter||"";t+=this._paddingCharacter||""}return t},s.prototype.maxDecodedLength=function(n){if(!this._paddingCharacter)return(n*6+7)/8|0;return n/4*3|0},s.prototype.decodedLength=function(n){return this.maxDecodedLength(n.length-this._getPaddingLength(n))},s.prototype.decode=function(n){if(n.length===0)return new Uint8Array(0);var t=this._getPaddingLength(n),i=n.length-t,a=new Uint8Array(this.maxDecodedLength(i)),l=0,u=0,d=0,h=0,g=0,x=0,_=0;for(;u<i-4;u+=4)h=this._decodeChar(n.charCodeAt(u+0)),g=this._decodeChar(n.charCodeAt(u+1)),x=this._decodeChar(n.charCodeAt(u+2)),_=this._decodeChar(n.charCodeAt(u+3)),a[l++]=h<<2|g>>>4,a[l++]=g<<4|x>>>2,a[l++]=x<<6|_,d|=h&Y,d|=g&Y,d|=x&Y,d|=_&Y;if(u<i-1)h=this._decodeChar(n.charCodeAt(u)),g=this._decodeChar(n.charCodeAt(u+1)),a[l++]=h<<2|g>>>4,d|=h&Y,d|=g&Y;if(u<i-2)x=this._decodeChar(n.charCodeAt(u+2)),a[l++]=g<<4|x>>>2,d|=x&Y;if(u<i-3)_=this._decodeChar(n.charCodeAt(u+3)),a[l++]=x<<6|_,d|=_&Y;if(d!==0)throw Error("Base64Coder: incorrect characters for decoding");return a},s.prototype._encodeByte=function(n){var t=n;return t+=65,t+=25-n>>>8&6,t+=51-n>>>8&-75,t+=61-n>>>8&-15,t+=62-n>>>8&3,String.fromCharCode(t)},s.prototype._decodeChar=function(n){var t=Y;return t+=(42-n&n-44)>>>8&-Y+n-43+62,t+=(46-n&n-48)>>>8&-Y+n-47+63,t+=(47-n&n-58)>>>8&-Y+n-48+52,t+=(64-n&n-91)>>>8&-Y+n-65+0,t+=(96-n&n-123)>>>8&-Y+n-97+26,t},s.prototype._getPaddingLength=function(n){var t=0;if(this._paddingCharacter){for(var i=n.length-1;i>=0;i--){if(n[i]!==this._paddingCharacter)break;t++}if(n.length<4||t>2)throw Error("Base64Coder: incorrect padding")}return t},s}();de.Coder=wi;var Jt=new wi;function rl(s){return Jt.encode(s)}de.encode=rl;function nl(s){return Jt.decode(s)}de.decode=nl;var ga=function(s){tl(n,s);function n(){return s!==null&&s.apply(this,arguments)||this}return n.prototype._encodeByte=function(t){var i=t;return i+=65,i+=25-t>>>8&6,i+=51-t>>>8&-75,i+=61-t>>>8&-13,i+=62-t>>>8&49,String.fromCharCode(i)},n.prototype._decodeChar=function(t){var i=Y;return i+=(44-t&t-46)>>>8&-Y+t-45+62,i+=(94-t&t-96)>>>8&-Y+t-95+63,i+=(47-t&t-58)>>>8&-Y+t-48+52,i+=(64-t&t-91)>>>8&-Y+t-65+0,i+=(96-t&t-123)>>>8&-Y+t-97+26,i},n}(wi);de.URLSafeCoder=ga;var wa=new ga;function sl(s){return wa.encode(s)}de.encodeURLSafe=sl;function il(s){return wa.decode(s)}de.decodeURLSafe=il;de.encodedLength=function(s){return Jt.encodedLength(s)};de.maxDecodedLength=function(s){return Jt.maxDecodedLength(s)};de.decodedLength=function(s){return Jt.decodedLength(s)}});var ka=r(function(ba,Rn){(function(s,n){var t={};n(t);var i=t.default;for(var a in t)i[a]=t[a];if(typeof Rn==="object"&&typeof Rn.exports==="object")Rn.exports=i;else if(typeof define==="function"&&define.amd)define(function(){return i});else s.sha256=i})(ba,function(s){s.__esModule=!0,s.digestLength=32,s.blockSize=64;var n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function t(_,b,w,S,T){var k,R,y,P,C,O,q,L,K,H,D,_e,Qe;while(T>=64){k=b[0],R=b[1],y=b[2],P=b[3],C=b[4],O=b[5],q=b[6],L=b[7];for(H=0;H<16;H++)D=S+H*4,_[H]=(w[D]&255)<<24|(w[D+1]&255)<<16|(w[D+2]&255)<<8|w[D+3]&255;for(H=16;H<64;H++)K=_[H-2],_e=(K>>>17|K<<15)^(K>>>19|K<<13)^K>>>10,K=_[H-15],Qe=(K>>>7|K<<25)^(K>>>18|K<<14)^K>>>3,_[H]=(_e+_[H-7]|0)+(Qe+_[H-16]|0);for(H=0;H<64;H++)_e=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&O^~C&q)|0)+(L+(n[H]+_[H]|0)|0)|0,Qe=((k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10))+(k&R^k&y^R&y)|0,L=q,q=O,O=C,C=P+_e|0,P=y,y=R,R=k,k=_e+Qe|0;b[0]+=k,b[1]+=R,b[2]+=y,b[3]+=P,b[4]+=C,b[5]+=O,b[6]+=q,b[7]+=L,S+=64,T-=64}return S}var i=function(){function _(){this.digestLength=s.digestLength,this.blockSize=s.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return _.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},_.prototype.clean=function(){for(var b=0;b<this.buffer.length;b++)this.buffer[b]=0;for(var b=0;b<this.temp.length;b++)this.temp[b]=0;this.reset()},_.prototype.update=function(b,w){if(w===void 0)w=b.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var S=0;if(this.bytesHashed+=w,this.bufferLength>0){while(this.bufferLength<64&&w>0)this.buffer[this.bufferLength++]=b[S++],w--;if(this.bufferLength===64)t(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(w>=64)S=t(this.temp,this.state,b,S,w),w%=64;while(w>0)this.buffer[this.bufferLength++]=b[S++],w--;return this},_.prototype.finish=function(b){if(!this.finished){var w=this.bytesHashed,S=this.bufferLength,T=w/536870912|0,k=w<<3,R=w%64<56?64:128;this.buffer[S]=128;for(var y=S+1;y<R-8;y++)this.buffer[y]=0;this.buffer[R-8]=T>>>24&255,this.buffer[R-7]=T>>>16&255,this.buffer[R-6]=T>>>8&255,this.buffer[R-5]=T>>>0&255,this.buffer[R-4]=k>>>24&255,this.buffer[R-3]=k>>>16&255,this.buffer[R-2]=k>>>8&255,this.buffer[R-1]=k>>>0&255,t(this.temp,this.state,this.buffer,0,R),this.finished=!0}for(var y=0;y<8;y++)b[y*4+0]=this.state[y]>>>24&255,b[y*4+1]=this.state[y]>>>16&255,b[y*4+2]=this.state[y]>>>8&255,b[y*4+3]=this.state[y]>>>0&255;return this},_.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},_.prototype._saveState=function(b){for(var w=0;w<this.state.length;w++)b[w]=this.state[w]},_.prototype._restoreState=function(b,w){for(var S=0;S<this.state.length;S++)this.state[S]=b[S];this.bytesHashed=w,this.finished=!1,this.bufferLength=0},_}();s.Hash=i;var a=function(){function _(b){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var w=new Uint8Array(this.blockSize);if(b.length>this.blockSize)new i().update(b).finish(w).clean();else for(var S=0;S<b.length;S++)w[S]=b[S];for(var S=0;S<w.length;S++)w[S]^=54;this.inner.update(w);for(var S=0;S<w.length;S++)w[S]^=106;this.outer.update(w),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var S=0;S<w.length;S++)w[S]=0}return _.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},_.prototype.clean=function(){for(var b=0;b<this.istate.length;b++)this.ostate[b]=this.istate[b]=0;this.inner.clean(),this.outer.clean()},_.prototype.update=function(b){return this.inner.update(b),this},_.prototype.finish=function(b){if(this.outer.finished)this.outer.finish(b);else this.inner.finish(b),this.outer.update(b,this.digestLength).finish(b);return this},_.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},_}();s.HMAC=a;function l(_){var b=new i().update(_),w=b.digest();return b.clean(),w}s.hash=l,s.default=l;function u(_,b){var w=new a(_).update(b),S=w.digest();return w.clean(),S}s.hmac=u;function d(_,b,w,S){var T=S[0];if(T===0)throw Error("hkdf: cannot expand more");if(b.reset(),T>1)b.update(_);if(w)b.update(w);b.update(S),b.finish(_),S[0]++}var h=new Uint8Array(s.digestLength);function g(_,b,w,S){if(b===void 0)b=h;if(S===void 0)S=32;var T=new Uint8Array([1]),k=u(b,_),R=new a(k),y=new Uint8Array(R.digestLength),P=y.length,C=new Uint8Array(S);for(var O=0;O<S;O++){if(P===y.length)d(y,R,w,T),P=0;C[O]=y[P++]}return R.clean(),y.fill(0),T.fill(0),C}s.hkdf=g;function x(_,b,w,S){var T=new a(_),k=T.digestLength,R=new Uint8Array(4),y=new Uint8Array(k),P=new Uint8Array(k),C=new Uint8Array(S);for(var O=0;O*k<S;O++){var q=O+1;R[0]=q>>>24&255,R[1]=q>>>16&255,R[2]=q>>>8&255,R[3]=q>>>0&255,T.reset(),T.update(b),T.update(R),T.finish(P);for(var L=0;L<k;L++)y[L]=P[L];for(var L=2;L<=w;L++){T.reset(),T.update(P).finish(P);for(var K=0;K<k;K++)y[K]^=P[K]}for(var L=0;L<k&&O*k+L<S;L++)C[O*k+L]=y[L]}for(var O=0;O<k;O++)y[O]=P[O]=0;for(var O=0;O<4;O++)R[O]=0;return T.clean(),C}s.pbkdf2=x})});var xa=r(function(va){Object.defineProperty(va,"__esModule",{value:!0});va.timingSafeEqual=ol;function Sa(s,n=""){if(!s)throw Error(n)}function ol(s,n){if(s.byteLength!==n.byteLength)return!1;if(!(s instanceof DataView))s=new DataView(ArrayBuffer.isView(s)?s.buffer:s);if(!(n instanceof DataView))n=new DataView(ArrayBuffer.isView(n)?n.buffer:n);Sa(s instanceof DataView),Sa(n instanceof DataView);let t=s.byteLength,i=0,a=-1;while(++a<t)i|=s.getUint8(a)^n.getUint8(a);return i===0}});var Pa=r(function(Ia){Object.defineProperty(Ia,"__esModule",{value:!0});Ia.Webhook=Ia.WebhookVerificationError=void 0;var In=ya(),Aa=ka(),Ra=xa(),Ea=300;class yi extends Error{constructor(s){super(s);Object.setPrototypeOf(this,yi.prototype),this.name="ExtendableError",this.stack=Error(s).stack}}class We extends yi{constructor(s){super(s);Object.setPrototypeOf(this,We.prototype),this.name="WebhookVerificationError"}}Ia.WebhookVerificationError=We;class Gt{constructor(s,n){if((n===null||n===void 0?void 0:n.format)==="raw")if(s instanceof Uint8Array)this.key=s;else this.key=Uint8Array.from(s,(t)=>t.charCodeAt(0));else{if(typeof s!=="string")throw Error("Expected secret to be of type string");if(s.startsWith(Gt.prefix))s=s.substring(Gt.prefix.length);this.key=In.decode(s)}if(this.key.length===0)throw Error("Secret can't be empty.")}verify(s,n,t){var i;let a=(i=t===null||t===void 0?void 0:t.jsonParse)!==null&&i!==void 0?i:!0,l={};for(let S of Object.keys(n))l[S.toLowerCase()]=n[S];let u=l["webhook-id"],d=l["webhook-signature"],h=l["webhook-timestamp"];if(!d||!u||!h)throw new We("Missing required headers");let g=this.verifyTimestamp(h),_=this.sign(u,g,s).split(",")[1],b=d.split(" "),w=new globalThis.TextEncoder;for(let S of b){let[T,k]=S.split(",");if(T!=="v1")continue;if(Ra.timingSafeEqual(w.encode(k),w.encode(_))){let R=s.toString();if(R==="")return;if(a)return JSON.parse(R);else return}}throw new We("No matching signature found")}sign(s,n,t){if(typeof t==="string");else if(t.constructor.name==="Buffer")t=t.toString();else throw Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,a=Math.floor(n.getTime()/1000),l=i.encode(`${s}.${a}.${t}`);return`v1,${In.encode(Aa.hmac(this.key,l))}`}verifyTimestamp(s){let n=Math.floor(Date.now()/1000),t=parseInt(s,10);if(Number.isNaN(t))throw new We("Invalid Signature Headers");if(n-t>Ea)throw new We("Message timestamp too old");if(t>n+Ea)throw new We("Message timestamp too new");return new Date(t*1000)}}Ia.Webhook=Gt;Gt.prefix="whsec_"});var Re=(s,n)=>new Promise((t)=>{if(n?.aborted)return t();let i=()=>{clearTimeout(a),t()},a=setTimeout(()=>{n?.removeEventListener("abort",i),t()},s);n?.addEventListener("abort",i,{once:!0})});var ge="0.129.0";var ao=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function wc(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var yc=()=>{let s=wc();if(s==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ge,"X-Stainless-OS":io(Deno.build.os),"X-Stainless-Arch":so(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ge,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(s==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ge,"X-Stainless-OS":io(globalThis.process.platform??"unknown"),"X-Stainless-Arch":so(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let n=bc();if(n)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ge,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ge,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function bc(){if(typeof navigator>"u"||!navigator)return null;let s=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:n,pattern:t}of s){let i=t.exec(navigator.userAgent);if(i){let a=i[1]||0,l=i[2]||0,u=i[3]||0;return{browser:n,version:`${a}.${l}.${u}`}}}return null}var so=(s)=>{if(s==="x32")return"x32";if(s==="x86_64"||s==="x64")return"x64";if(s==="arm")return"arm";if(s==="aarch64"||s==="arm64")return"arm64";if(s)return`other:${s}`;return"unknown"},io=(s)=>{if(s=s.toLowerCase(),s.includes("ios"))return"iOS";if(s==="android")return"Android";if(s==="darwin")return"MacOS";if(s==="win32")return"Windows";if(s==="freebsd")return"FreeBSD";if(s==="openbsd")return"OpenBSD";if(s==="linux")return"Linux";if(s)return`Other:${s}`;return"Unknown"},oo,Lt=()=>oo??(oo=yc());var ln=new WeakMap,co=typeof globalThis.FinalizationRegistry==="function"?new globalThis.FinalizationRegistry((s)=>Ce(s)):null;function kc(s,n){return()=>s.removeEventListener("abort",n)}function lo(s,n,t){ln.set(s,kc(n,t))}function uo(s,n){if(ln.has(n))co?.register(s,n,n)}function Ce(s){let n=ln.get(s);if(n)ln.delete(s),co?.unregister(s),n()}function fo(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Ks(...s){let n=globalThis.ReadableStream;if(typeof n>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...s)}function un(s){let n=Symbol.asyncIterator in s?s[Symbol.asyncIterator]():s[Symbol.iterator]();return Ks({start(){},async pull(t){let{done:i,value:a}=await n.next();if(i)t.close();else t.enqueue(a)},async cancel(){await n.return?.()}})}function $t(s){if(s[Symbol.asyncIterator])return s;let n=s.getReader();return{async next(){try{let t=await n.read();if(t?.done)n.releaseLock();return t}catch(t){throw n.releaseLock(),t}},async return(){let t=n.cancel();return n.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function po(s){if(s===null||typeof s!=="object")return;if(s[Symbol.asyncIterator]){await s[Symbol.asyncIterator]().return?.();return}let n=s.getReader(),t=n.cancel();n.releaseLock(),await t}var mo=({headers:s,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});var zs="RFC3986",Vs=(s)=>String(s),Ys={RFC1738:(s)=>String(s).replace(/%20/g,"+"),RFC3986:Vs},_o="RFC1738";var dn=(s,n)=>(dn=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),dn(s,n)),Oe=(()=>{let s=[];for(let n=0;n<256;++n)s.push("%"+((n<16?"0":"")+n.toString(16)).toUpperCase());return s})();var Js=1024,go=(s,n,t,i,a)=>{if(s.length===0)return s;let l=s;if(typeof s==="symbol")l=Symbol.prototype.toString.call(s);else if(typeof s!=="string")l=String(s);if(t==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});let u="";for(let d=0;d<l.length;d+=Js){let h=l.length>=Js?l.slice(d,d+Js):l,g=[];for(let x=0;x<h.length;++x){let _=h.charCodeAt(x);if(_===45||_===46||_===95||_===126||_>=48&&_<=57||_>=65&&_<=90||_>=97&&_<=122||a===_o&&(_===40||_===41)){g[g.length]=h.charAt(x);continue}if(_<128){g[g.length]=Oe[_];continue}if(_<2048){g[g.length]=Oe[192|_>>6]+Oe[128|_&63];continue}if(_<55296||_>=57344){g[g.length]=Oe[224|_>>12]+Oe[128|_>>6&63]+Oe[128|_&63];continue}x+=1,_=65536+((_&1023)<<10|h.charCodeAt(x)&1023),g[g.length]=Oe[240|_>>18]+Oe[128|_>>12&63]+Oe[128|_>>6&63]+Oe[128|_&63]}u+=g.join("")}return u};function wo(s){if(!s||typeof s!=="object")return!1;return!!(s.constructor&&s.constructor.isBuffer&&s.constructor.isBuffer(s))}function Gs(s,n){if(De(s)){let t=[];for(let i=0;i<s.length;i+=1)t.push(n(s[i]));return t}return n(s)}var bo={brackets(s){return String(s)+"[]"},comma:"comma",indices(s,n){return String(s)+"["+n+"]"},repeat(s){return String(s)}},ko=function(s,n){Array.prototype.push.apply(s,De(n)?n:[n])},yo,Q={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:go,encodeValuesOnly:!1,format:zs,formatter:Vs,indices:!1,serializeDate(s){return(yo??(yo=Function.prototype.call.bind(Date.prototype.toISOString)))(s)},skipNulls:!1,strictNullHandling:!1};function xc(s){return typeof s==="string"||typeof s==="number"||typeof s==="boolean"||typeof s==="symbol"||typeof s==="bigint"}var Xs={};function So(s,n,t,i,a,l,u,d,h,g,x,_,b,w,S,T,k,R){let y=s,P=R,C=0,O=!1;while((P=P.get(Xs))!==void 0&&!O){let D=P.get(s);if(C+=1,typeof D<"u")if(D===C)throw RangeError("Cyclic object value");else O=!0;if(typeof P.get(Xs)>"u")C=0}if(typeof g==="function")y=g(n,y);else if(y instanceof Date)y=b?.(y);else if(t==="comma"&&De(y))y=Gs(y,function(D){if(D instanceof Date)return b?.(D);return D});if(y===null){if(l)return h&&!T?h(n,Q.encoder,k,"key",w):n;y=""}if(xc(y)||wo(y)){if(h){let D=T?n:h(n,Q.encoder,k,"key",w);return[S?.(D)+"="+S?.(h(y,Q.encoder,k,"value",w))]}return[S?.(n)+"="+S?.(String(y))]}let q=[];if(typeof y>"u")return q;let L;if(t==="comma"&&De(y)){if(T&&h)y=Gs(y,h);L=[{value:y.length>0?y.join(",")||null:void 0}]}else if(De(g))L=g;else{let D=Object.keys(y);L=x?D.sort(x):D}let K=d?String(n).replace(/\./g,"%2E"):String(n),H=i&&De(y)&&y.length===1?K+"[]":K;if(a&&De(y)&&y.length===0)return H+"[]";for(let D=0;D<L.length;++D){let _e=L[D],Qe=typeof _e==="object"&&typeof _e.value<"u"?_e.value:y[_e];if(u&&Qe===null)continue;let qs=_&&d?_e.replace(/\./g,"%2E"):_e,gc=De(y)?typeof t==="function"?t(H,qs):H:H+(_?"."+qs:"["+qs+"]");R.set(s,C);let no=new WeakMap;no.set(Xs,R),ko(q,So(Qe,gc,t,i,a,l,u,d,t==="comma"&&T&&De(y)?null:h,g,x,_,b,w,S,T,k,no))}return q}function Ec(s=Q){if(typeof s.allowEmptyArrays<"u"&&typeof s.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof s.encodeDotInKeys<"u"&&typeof s.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(s.encoder!==null&&typeof s.encoder<"u"&&typeof s.encoder!=="function")throw TypeError("Encoder has to be a function.");let n=s.charset||Q.charset;if(typeof s.charset<"u"&&s.charset!=="utf-8"&&s.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let t=zs;if(typeof s.format<"u"){if(!dn(Ys,s.format))throw TypeError("Unknown format option provided.");t=s.format}let i=Ys[t],a=Q.filter;if(typeof s.filter==="function"||De(s.filter))a=s.filter;let l;if(s.arrayFormat&&s.arrayFormat in bo)l=s.arrayFormat;else if("indices"in s)l=s.indices?"indices":"repeat";else l=Q.arrayFormat;if("commaRoundTrip"in s&&typeof s.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let u=typeof s.allowDots>"u"?!!s.encodeDotInKeys===!0?!0:Q.allowDots:!!s.allowDots;return{addQueryPrefix:typeof s.addQueryPrefix==="boolean"?s.addQueryPrefix:Q.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof s.allowEmptyArrays==="boolean"?!!s.allowEmptyArrays:Q.allowEmptyArrays,arrayFormat:l,charset:n,charsetSentinel:typeof s.charsetSentinel==="boolean"?s.charsetSentinel:Q.charsetSentinel,commaRoundTrip:!!s.commaRoundTrip,delimiter:typeof s.delimiter>"u"?Q.delimiter:s.delimiter,encode:typeof s.encode==="boolean"?s.encode:Q.encode,encodeDotInKeys:typeof s.encodeDotInKeys==="boolean"?s.encodeDotInKeys:Q.encodeDotInKeys,encoder:typeof s.encoder==="function"?s.encoder:Q.encoder,encodeValuesOnly:typeof s.encodeValuesOnly==="boolean"?s.encodeValuesOnly:Q.encodeValuesOnly,filter:a,format:t,formatter:i,serializeDate:typeof s.serializeDate==="function"?s.serializeDate:Q.serializeDate,skipNulls:typeof s.skipNulls==="boolean"?s.skipNulls:Q.skipNulls,sort:typeof s.sort==="function"?s.sort:null,strictNullHandling:typeof s.strictNullHandling==="boolean"?s.strictNullHandling:Q.strictNullHandling}}function vo(s,n={}){let t=s,i=Ec(n),a,l;if(typeof i.filter==="function")l=i.filter,t=l("",t);else if(De(i.filter))l=i.filter,a=l;let u=[];if(typeof t!=="object"||t===null)return"";let d=bo[i.arrayFormat],h=d==="comma"&&i.commaRoundTrip;if(!a)a=Object.keys(t);if(i.sort)a.sort(i.sort);let g=new WeakMap;for(let b=0;b<a.length;++b){let w=a[b];if(i.skipNulls&&t[w]===null)continue;ko(u,So(t[w],w,d,h,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,g))}let x=u.join(i.delimiter),_=i.addQueryPrefix===!0?"?":"";if(i.charsetSentinel)if(i.charset==="iso-8859-1")_+="utf8=%26%2310003%3B&";else _+="utf8=%E2%9C%93&";return x.length>0?_+x:""}function xo(s){return vo(s,{arrayFormat:"brackets"})}var Ao="urn:ietf:params:oauth:grant-type:jwt-bearer",Ro="refresh_token",hn="/v1/oauth/token",Ze="oauth-2025-04-20",Io="oidc-federation-2026-04-01",To=120,lt=30,Po=5,Eo=1048576;function fn(s){if(!s)return;let n;try{n=new URL(s)}catch(i){throw new F(`Invalid token endpoint base URL "${s}": ${i}`)}if(n.protocol==="https:")return;let t=n.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(n.protocol==="http:"&&(t==="localhost"||t==="127.0.0.1"||t==="::1"))return;throw new F(`Refusing to send credential over non-https token endpoint "${s}"`)}async function pn(s,n){let t=await Ic(s),i;try{i=JSON.parse(t)}catch{throw new F(`Token endpoint returned non-JSON response (status ${s.status})`,s.status,te(t),n)}if(!i.access_token)throw new F(`Token endpoint response missing access_token: ${JSON.stringify(te(i))}`,s.status,te(i),n);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new F(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,s.status,te(i),n);return i}var Qs=2000,Rc=new Set(["error","error_description","error_uri"]);function te(s){if(s==null)return s;if(typeof s==="string"){let n;try{n=JSON.parse(s)}catch{if(s.length<=Qs)return s;return s.slice(0,Qs)+`... <${s.length-Qs} more chars>`}return JSON.stringify(te(n))}if(typeof s==="object"&&!Array.isArray(s)){let n={};for(let[t,i]of Object.entries(s))if(Rc.has(t))n[t]=i;return n}return null}async function mn(s,n=(t)=>console.warn(`anthropic-sdk: ${t}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:t}=await import("./chunk-r14x07ez.js"),i=s,a;try{i=await t.promises.realpath(s),a=await t.promises.stat(i)}catch{return}let l=a.mode&511;if(l&18)throw new F(`Credentials file at ${i} is group/world-writable (mode 0o${l.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(l&36)throw new F(`Credentials file at ${i} is group/world-readable (mode 0o${l.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);if(typeof process.getuid==="function"&&a.uid!==process.getuid())n(`credentials file at ${i} is owned by uid ${a.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function _n(s,n){let{fs:t,path:i}=await import("./chunk-r14x07ez.js"),a=i.dirname(s);await t.promises.mkdir(a,{recursive:!0,mode:448});let l=`${s}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let u=await t.promises.open(l,"w",384);try{await u.writeFile(JSON.stringify(n,null,2)),await u.sync()}finally{await u.close()}await t.promises.rename(l,s)}catch(u){throw await t.promises.unlink(l).catch(()=>{}),u}try{let u=await t.promises.open(a,"r");try{await u.sync()}finally{await u.close()}}catch{}}async function Ic(s){if(!s.body)return"";let n=s.body.getReader(),t=[],i=0;for(;;){let{done:l,value:u}=await n.read();if(l)break;if(i+u.length>Eo){let d=Eo-i;if(d>0)t.push(u.subarray(0,d));await n.cancel();break}t.push(u),i+=u.length}let a;if(t.length===1)a=t[0];else{a=new Uint8Array(t.reduce((u,d)=>u+d.length,0));let l=0;for(let u of t)a.set(u,l),l+=u.length}return new TextDecoder("utf-8").decode(a)}class F extends p{constructor(s,n=null,t=null,i=null){super(s);this.statusCode=n,this.body=t,this.requestId=i}}function Ie(){return Math.floor(Date.now()/1000)}class Zs{constructor(s,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=s,this.onAdvisoryRefreshError=n}async getToken(){let s=this.nextForce;this.nextForce=!1;let n=this.cached;if(s||n==null)return(await this.refresh(s)).token;if(n.expiresAt==null)return n.token;let t=n.expiresAt-Ie();if(t>To)return n.token;if(t>lt)return this.backgroundRefresh(),n.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(s=!1){if(this.pendingRefresh&&!s)return this.pendingRefresh;return this.doRefresh(s)}backgroundRefresh(){if(this.pendingRefresh)return;if(Ie()-this.lastAdvisoryError<Po)return;this.doRefresh().catch((s)=>{this.lastAdvisoryError=Ie(),this.onAdvisoryRefreshError?.(s)})}doRefresh(s=!1){return this.pendingRefresh=this.provider(s?{forceRefresh:!0}:void 0).then((n)=>(this.cached=n,this.pendingRefresh=null,n),(n)=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}var Co=(s)=>{if(typeof globalThis.Buffer<"u"){let n=globalThis.Buffer.from(s,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}if(typeof atob<"u"){let n=atob(s),t=new Uint8Array(n.length);for(let i=0;i<n.length;i++)t[i]=n.charCodeAt(i);return t}throw new p("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined")};var gn=function(){let{crypto:s}=globalThis;if(s?.randomUUID)return gn=s.randomUUID.bind(s),s.randomUUID();let n=new Uint8Array(1),t=s?()=>s.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(i)=>(+i^t()&15>>+i/4).toString(16))};var wn="1.0",Tc=/^[A-Za-z0-9_.-]+$/;function Oo(s){if(!s)throw Error("profile name is empty");if(s==="."||s==="..")throw Error(`profile name "${s}" is not allowed`);if(s.includes("/")||s.includes("\\"))throw Error(`profile name "${s}" must not contain path separators`);if(!Tc.test(s))throw Error(`profile name "${s}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Mo=async(s)=>{var n,t;let i=await si();if(i===null)return null;let a=s??await Lo();if(a===null)return null;Oo(a);let{fs:l,path:u}=await import("./chunk-r14x07ez.js"),d=u.join(i,"configs",`${a}.json`),h;try{h=await l.promises.readFile(d,"utf-8")}catch(_){if(_?.code!=="ENOENT")throw Error(`failed to read config file ${d}: ${_}`);h=null}if(h===null){let _=U("ANTHROPIC_ORGANIZATION_ID"),b=U("ANTHROPIC_IDENTITY_TOKEN_FILE"),w=U("ANTHROPIC_FEDERATION_RULE_ID");if(w&&_)return{fromFile:!1,config:{organization_id:_,workspace_id:U("ANTHROPIC_WORKSPACE_ID"),base_url:U("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:w,service_account_id:U("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:b?{source:"file",path:b}:void 0,scope:U("ANTHROPIC_SCOPE")}}};return null}let g;try{g=JSON.parse(h)}catch(_){throw Error(`failed to parse config file ${d}: ${_}`)}if(!g.authentication)throw Error(`config file ${d} is missing "authentication"`);let x=g.authentication.type;if(x!=="oidc_federation"&&x!=="user_oauth")throw Error(`authentication.type "${x}" is not a known authentication type`);if(g.organization_id??(g.organization_id=U("ANTHROPIC_ORGANIZATION_ID")),g.workspace_id??(g.workspace_id=U("ANTHROPIC_WORKSPACE_ID")),g.base_url??(g.base_url=U("ANTHROPIC_BASE_URL")),(n=g.authentication).scope??(n.scope=U("ANTHROPIC_SCOPE")),g.authentication.type==="oidc_federation"){if(!g.authentication.identity_token){let _=U("ANTHROPIC_IDENTITY_TOKEN_FILE");if(_)g.authentication.identity_token={source:"file",path:_}}if(!g.authentication.federation_rule_id)g.authentication.federation_rule_id=U("ANTHROPIC_FEDERATION_RULE_ID")??"";(t=g.authentication).service_account_id??(t.service_account_id=U("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:g,fromFile:!0}};var No=async(s,n)=>{if(s?.authentication.credentials_path)return s.authentication.credentials_path;let t=await si();if(!t)return null;let i=n??await Lo();if(!i)return null;Oo(i);let{path:a}=await import("./chunk-r14x07ez.js");return a.join(t,"credentials",`${i}.json`)},si=async()=>{if(!Pc())return null;let{path:s}=await import("./chunk-r14x07ez.js"),n=U("ANTHROPIC_CONFIG_DIR");if(n)return n;if(Lt()["X-Stainless-OS"]==="Windows"){let l=U("APPDATA");if(l)return s.join(l,"Anthropic");let u=U("USERPROFILE");if(u)return s.join(u,"AppData","Roaming","Anthropic");return null}let i=U("XDG_CONFIG_HOME");if(i)return s.join(i,"anthropic");let a=U("HOME");if(a)return s.join(a,".config","anthropic");return null},Pc=()=>{let s=Lt()["X-Stainless-Runtime"];return s==="node"||s==="deno"},Lo=async()=>{let s=await si();if(!s)return null;let n=U("ANTHROPIC_PROFILE");if(n)return n;let{fs:t,path:i}=await import("./chunk-r14x07ez.js"),a=i.join(s,"active_config");try{return(await t.promises.readFile(a,"utf-8")).trim()||"default"}catch(l){if(l?.code!=="ENOENT")throw Error(`failed to read ${a}: ${l}`);return"default"}};function ii(s){if(!s)throw new p("Identity token file path is empty");return async()=>{let{fs:n}=await import("./chunk-r14x07ez.js"),t;try{t=await n.promises.readFile(s,"utf-8")}catch(a){throw new p(`Failed to read identity token file at ${s}: ${a}`)}let i=t.trim();if(!i)throw new p(`Identity token file at ${s} is empty`);return i}}function Fo(s){if(!s)throw new p("Identity token value is empty");return()=>s}function Do(s){return async()=>{fn(s.baseURL);let n=await s.identityTokenProvider();if(n.length>16384)throw new F(`Identity token is ${Math.ceil(n.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let t={grant_type:Ao,assertion:n,federation_rule_id:s.federationRuleId,organization_id:s.organizationId};if(s.serviceAccountId)t.service_account_id=s.serviceAccountId;if(s.workspaceId)t.workspace_id=s.workspaceId;let i=`${s.baseURL}${hn}`,a;try{a=await s.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Ze},${Io}`,"User-Agent":s.userAgent||`anthropic-sdk-typescript/${ge} oidcFederationProvider`},body:JSON.stringify(t)})}catch(h){throw new F(`Failed to reach token endpoint ${i}: ${h}`)}let l=a.headers.get("Request-Id");if(!a.ok){let h=await a.text().catch(()=>""),g=te(h),x="";if(a.status===401)x=` Ensure your federation rule matches your identity token. ${s.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new F(`Token exchange failed with status ${a.status}${l?` (request-id ${l})`:""}: ${g}${x}`,a.status,g,l)}let u=await pn(a,l),d=Number(u.expires_in);if(!Number.isFinite(d))throw new F(`Token endpoint response missing required fields: ${JSON.stringify(te(u))}`,a.status,te(u),l);return{token:u.access_token,expiresAt:Ie()+d}}}function Bo(s){return async(n)=>{let{fs:t}=await import("./chunk-r14x07ez.js");await mn(s.credentialsPath,s.onSafetyWarning);let i;try{i=await t.promises.readFile(s.credentialsPath,"utf-8")}catch(k){throw new F(`Credentials file not found at ${s.credentialsPath}: ${k}`)}let a;try{a=JSON.parse(i)}catch(k){throw new F(`Credentials file at ${s.credentialsPath} is not valid JSON: ${k}`)}let l=a.access_token;if(!l)throw new F(`Credentials file at ${s.credentialsPath} must include 'access_token'`);let u=a.expires_at;if(!n?.forceRefresh&&(u==null||Ie()<u-lt))return{token:l,expiresAt:u??null};let d=a.refresh_token;if(!s.clientId||!d)throw new F(`Access token at ${s.credentialsPath} has expired and no refresh is available (client_id ${s.clientId?"set":"empty"}, refresh_token ${d?"set":"empty"})`);fn(s.baseURL);let h={grant_type:Ro,refresh_token:d,client_id:s.clientId},g=`${s.baseURL}${hn}`,x;try{x=await s.fetch(g,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":Ze,"User-Agent":s.userAgent||`anthropic-sdk-typescript/${ge} userOAuthProvider`},body:JSON.stringify(h)})}catch(k){throw new F(`User OAuth refresh failed to reach token endpoint: ${k}`)}let _=x.headers.get("Request-Id");if(!x.ok){let k=await x.text().catch(()=>"");throw new F(`User OAuth refresh failed (HTTP ${x.status}): ${te(k)}`,x.status,te(k),_)}let b=await pn(x,_),w=Number(b.expires_in);if(!Number.isFinite(w))throw new F(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(te(b))}`,x.status,te(b),_);let S=Ie()+w,T=b.refresh_token||d;return await _n(s.credentialsPath,{...a,version:wn,type:"oauth_token",access_token:b.access_token,expires_at:S,refresh_token:T}),{token:b.access_token,expiresAt:S}}}function ai(s,n){let t=s.authentication.credentials_path??null,i=(s.base_url||n.baseURL).replace(/\/+$/,""),a=Cc(s,t,i,n),l={};if(s.workspace_id&&s.authentication.type==="user_oauth")l["anthropic-workspace-id"]=s.workspace_id;return{provider:a,extraHeaders:l,baseURL:s.base_url||void 0}}async function Uo(s,n){let t=await Mo(n);if(!t)return null;let{config:i,fromFile:a}=t,l=i.authentication.credentials_path||!a?i:{...i,authentication:{...i.authentication,credentials_path:await No(i,n)??void 0}};return ai(l,s)}function Cc(s,n,t,i){switch(s.authentication.type){case"oidc_federation":{let a=s.authentication,l=Oc(a);if(!l)throw new F("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!a.federation_rule_id)throw new F("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!s.organization_id)throw new F("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let u=Do({identityTokenProvider:l,federationRuleId:a.federation_rule_id,organizationId:s.organization_id,serviceAccountId:a.service_account_id,workspaceId:s.workspace_id,baseURL:t,fetch:i.fetch,userAgent:i.userAgent});if(n)return Mc(u,n,i.onCacheWriteError,i.onSafetyWarning);return u}case"user_oauth":{if(!n)throw new F("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return Bo({credentialsPath:n,clientId:s.authentication.client_id,baseURL:t,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let a=s.authentication.type;throw new F(`authentication.type "${a}" is not a known authentication type`)}}}function Oc(s){if(s.identity_token){let i=s.identity_token.source;if(i!=="file")throw new F(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!s.identity_token.path)throw new F('identity_token.source "file" requires a non-empty path');return ii(s.identity_token.path)}let n=U("ANTHROPIC_IDENTITY_TOKEN_FILE");if(n)return ii(n);let t=U("ANTHROPIC_IDENTITY_TOKEN");if(t)return Fo(t);return null}function Mc(s,n,t,i){return async(a)=>{let{fs:l}=await import("./chunk-r14x07ez.js");await mn(n,i);let u;try{let h=await l.promises.readFile(n,"utf-8");u=JSON.parse(h);let g=u?.access_token;if(g&&!a?.forceRefresh){let x=u?.expires_at;if(x==null||Ie()<x-lt)return{token:g,expiresAt:x??null}}}catch(h){if(h?.code!=="ENOENT"&&!(h instanceof SyntaxError))t?.(h)}let d=await s(a);try{await _n(n,{...u??{},version:wn,type:"oauth_token",access_token:d.token,expires_at:d.expiresAt})}catch(h){t?.(h)}return d}}var ae,ce,Ft=(()=>{class s{constructor(){ae.set(this,void 0),ce.set(this,void 0),o(this,ae,new Uint8Array,"f"),o(this,ce,null,"f")}decode(n){if(n==null)return[];let t=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==="string"?xr(n):n;o(this,ae,da([e(this,ae,"f"),t]),"f");let i=[],a;while((a=Nc(e(this,ae,"f"),e(this,ce,"f")))!=null){if(a.carriage&&e(this,ce,"f")==null){o(this,ce,a.index,"f");continue}if(e(this,ce,"f")!=null&&(a.index!==e(this,ce,"f")+1||a.carriage)){i.push(rr(e(this,ae,"f").subarray(0,e(this,ce,"f")-1))),o(this,ae,e(this,ae,"f").subarray(e(this,ce,"f")),"f"),o(this,ce,null,"f");continue}let l=e(this,ce,"f")!==null?a.preceding-1:a.preceding,u=rr(e(this,ae,"f").subarray(0,l));i.push(u),o(this,ae,e(this,ae,"f").subarray(a.index),"f"),o(this,ce,null,"f")}return i}flush(){if(!e(this,ae,"f").length)return[];return this.decode(`
|
|
3
|
+
`)}}return ae=new WeakMap,ce=new WeakMap,s.NEWLINE_CHARS=new Set([`
|
|
4
|
+
`,"\r"]),s.NEWLINE_REGEXP=/\r\n|[\n\r]/g,s})();function Nc(s,n){for(let a=n??0;a<s.length;a++){if(s[a]===10)return{preceding:a,index:a+1,carriage:!1};if(s[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}var Ht,Me=(()=>{class s{constructor(n,t,i){this.iterator=n,Ht.set(this,void 0),this.controller=t,o(this,Ht,i,"f")}static rawEvents(n,t=new AbortController){return ea(n,t)}static fromSSEResponse(n,t,i){let a=!1,l=i?N(i):console;async function*u(){if(a)throw new p("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let d=!1;try{for await(let h of ea(n,t)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(g){throw l.error("Could not parse message into JSON:",h.data),l.error("From chunk:",h.raw),g}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop"||h.event==="message"||h.event==="user.message"||h.event==="user.interrupt"||h.event==="user.tool_confirmation"||h.event==="user.custom_tool_result"||h.event==="user.tool_result"||h.event==="agent.message"||h.event==="agent.thinking"||h.event==="agent.tool_use"||h.event==="agent.tool_result"||h.event==="agent.mcp_tool_use"||h.event==="agent.mcp_tool_result"||h.event==="agent.custom_tool_use"||h.event==="agent.thread_context_compacted"||h.event==="session.status_running"||h.event==="session.status_idle"||h.event==="session.status_rescheduled"||h.event==="session.status_terminated"||h.event==="session.error"||h.event==="session.deleted"||h.event==="session.updated"||h.event==="span.model_request_start"||h.event==="span.model_request_end"||h.event==="span.outcome_evaluation_start"||h.event==="span.outcome_evaluation_ongoing"||h.event==="span.outcome_evaluation_end"||h.event==="user.define_outcome"||h.event==="agent.thread_message_received"||h.event==="agent.thread_message_sent"||h.event==="agent.session_thread_message_received"||h.event==="agent.session_thread_message_sent"||h.event==="session.thread_created"||h.event==="session.thread_status_created"||h.event==="session.thread_status_running"||h.event==="session.thread_status_idle"||h.event==="session.thread_status_rescheduled"||h.event==="session.thread_status_terminated"||h.event==="event_start"||h.event==="event_delta"||h.event==="system.message")try{yield JSON.parse(h.data)}catch(g){throw l.error("Could not parse message into JSON:",h.data),l.error("From chunk:",h.raw),g}if(h.event==="ping")continue;if(h.event==="error"){let g=ti(h.data)??h.data,x=g?.error?.type;throw new le(void 0,g,void 0,n.headers,x)}}d=!0}catch(h){if(wt(h))return;throw h}finally{if(!d)t.abort();Ce(t)}}return new s(u,t,i)}static fromReadableStream(n,t,i){let a=!1;async function*l(){let d=new Ft,h=$t(n);for await(let g of h)for(let x of d.decode(g))yield x;for(let g of d.flush())yield g}async function*u(){if(a)throw new p("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let d=!1;try{for await(let h of l()){if(d)continue;if(h)yield JSON.parse(h)}d=!0}catch(h){if(wt(h))return;throw h}finally{if(!d)t.abort();Ce(t)}}return new s(u,t,i)}[(Ht=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let n=[],t=[],i=this.iterator(),a=(l)=>({next:()=>{if(l.length===0){let u=i.next();n.push(u),t.push(u)}return l.shift()}});return[new s(()=>a(n),this.controller,e(this,Ht,"f")),new s(()=>a(t),this.controller,e(this,Ht,"f"))]}toReadableStream(){let n=this,t;return Ks({async start(){t=n[Symbol.asyncIterator]()},async pull(i){try{let{value:a,done:l}=await t.next();if(l)return i.close();let u=xr(JSON.stringify(a)+`
|
|
5
|
+
`);i.enqueue(u)}catch(a){i.error(a)}},async cancel(){await t.return?.()}})}}return s})();async function*ea(s,n){if(!s.body){if(n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new p("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new p("Attempted to iterate over a response with no body")}let t=new ta,i=new Ft,a=$t(s.body);for await(let l of a)for(let u of i.decode(l)){let d=t.decode(u);if(d)yield d}for(let l of i.flush()){let u=t.decode(l);if(u)yield u}}class ta{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(s){if(s.endsWith("\r"))s=s.substring(0,s.length-1);if(!s){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(`
|
|
6
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(s),s.startsWith(":"))return null;let[n,t,i]=Lc(s,":");if(i.startsWith(" "))i=i.substring(1);if(n==="event")this.event=i;else if(n==="data")this.data.push(i);return null}}function Lc(s,n){let t=s.indexOf(n);if(t!==-1)return[s.substring(0,t),n,s.substring(t+n.length)];return[s,"",""]}async function yn(s,n){let{response:t,requestLogID:i,retryOfRequestLogID:a,startTime:l}=n,u=await(async()=>{if(n.options.stream)return N(s).debug("response",t.status,t.url,t.headers,t.body),Me.fromSSEResponse(t,n.controller,s);if(t.status===204)return null;if(n.options.__binaryResponse)return t;let h=t.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){if(t.headers.get("content-length")==="0")return;let b=await t.json();return Dt(b,t)}return await t.text()})().finally(()=>{if(!n.options.stream&&!n.options.__binaryResponse)Ce(n.controller)});return Ct(N(s),`[${i}] response parsed`,{retryOfRequestLogID:a,url:t.url,status:t.status,body:u,durationMs:Date.now()-l}),u}function Dt(s,n){if(!s||typeof s!=="object"||Array.isArray(s))return s;return Object.defineProperties(s,{_request_id:{value:n.headers.get("request-id"),enumerable:!1},_workspace_id:{value:n.headers.get("anthropic-workspace-id"),enumerable:!1}})}var na=new WeakSet;function ci(s){return typeof s==="object"&&s!==null&&na.has(s)}function sa(s){let n=new Set;while(typeof s==="object"&&s!==null&&!n.has(s)){if(n.add(s),ci(s)||wt(s)||s instanceof er||s instanceof ds)return!0;s=s.cause}return!1}function li(s,n,t,i){return async(a,l={})=>{if(n.length===0)return s.call(void 0,a,l);let u=l.headers instanceof Headers?l.headers:new Headers(l.headers),d=await Fc(s,n,t,i)({...l,headers:u,url:typeof a==="string"?a:a instanceof URL?a.href:a.url});if(d.bodyUsed||d.body?.locked)throw new p("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return d}}function $c(s,n){let t=new WeakMap;return{options:s,logger:n?N(n):ma(),parse(i){if(s?.stream&&i.ok)return ra(i,s,n);let a=t.get(i);if(!a)a=ra(i,s,n),t.set(i,a);return a}}}async function ra(s,n,t){if(s.bodyUsed||s.body?.locked)throw new p("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(n?.stream&&s.ok)return Me.fromSSEResponse(s.clone(),new AbortController,t);if(s.status===204)return null;if(n?.__binaryResponse)return s;let a=s.headers.get("content-type")?.split(";")[0]?.trim();if(a?.includes("application/json")||a?.endsWith("+json")){if(s.headers.get("content-length")==="0")return;return Dt(await s.clone().json(),s)}return await s.clone().text()}function Fc(s,n,t,i){let a=async({url:u,...d})=>{try{return await s.call(void 0,u,d)}catch(h){let g=Sr(h);throw na.add(g),g}},l=$c(t,i);for(let u=n.length-1;u>=0;u--){let d=n[u],h=a;a=async(g)=>d(g,h,l)}return a}var Bt,bn=(()=>{class s extends Promise{constructor(n,t,i=yn){super((a)=>{a(null)});this.responsePromise=t,this.parseResponse=i,Bt.set(this,void 0),o(this,Bt,n,"f")}_thenUnwrap(n){return new s(e(this,Bt,"f"),this.responsePromise,async(t,i)=>Dt(n(await this.parseResponse(t,i),i),i.response))}asResponse(){return this.responsePromise.then((n)=>n.response)}async withResponse(){let[n,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((n)=>this.parseResponse(e(this,Bt,"f"),n));return this.parsedPromise}then(n,t){return this.parse().then(n,t)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}return Bt=new WeakMap,s})();var kn,ui=(()=>{class s{constructor(n,t,i,a){kn.set(this,void 0),o(this,kn,n,"f"),this.options=a,this.response=t,this.body=i}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let n=this.nextPageRequestOptions();if(!n)throw new p("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await e(this,kn,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;yield n;while(n.hasNextPage())n=await n.getNextPage(),yield n}async*[(kn=new WeakMap,Symbol.asyncIterator)](){for await(let n of this.iterPages())for(let t of n.getPaginatedItems())yield t}}return s})(),ia=(()=>{class s extends bn{constructor(n,t,i){super(n,t,async(a,l)=>new i(a,l.response,await yn(a,l),l.options))}async*[Symbol.asyncIterator](){let n=await this;for await(let t of n)yield t}}return s})();class Z extends ui{constructor(s,n,t,i){super(s,n,t,i);this.data=t.data||[],this.has_more=t.has_more||!1,this.first_id=t.first_id||null,this.last_id=t.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;if(!n)return null;return{...this.options,query:{...Wn(this.options.query),before_id:n}}}let s=this.last_id;if(!s)return null;return{...this.options,query:{...Wn(this.options.query),after_id:s}}}}class I extends ui{constructor(s,n,t,i){super(s,n,t,i);this.data=t.data||[],this.next_page=t.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let s=this.next_page;if(!s)return null;return{...this.options,query:{...Wn(this.options.query),page:s}}}}class di extends ui{constructor(s,n,t,i){super(s,n,t,i);this.data=t.data||[],this.next_page=t.next_page||null,this.prev_page=t.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let s=this.next_page;if(!s)return null;return{...this.options,query:{...Wn(this.options.query),page:s}}}}var fi=()=>{if(typeof File>"u"){let{process:s}=globalThis,n=typeof s?.versions?.node==="string"&&parseInt(s.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function tt(s,n,t){return fi(),new File(s,n??"",t)}function Wt(s,n){let t=typeof s==="object"&&s!==null&&(("name"in s)&&s.name&&String(s.name)||("url"in s)&&s.url&&String(s.url)||("filename"in s)&&s.filename&&String(s.filename)||("path"in s)&&s.path&&String(s.path))||"";return n?t.split(/[\\/]/).pop()||void 0:t}var pi=(s)=>s!=null&&typeof s==="object"&&typeof s[Symbol.asyncIterator]==="function";var we=async(s,n,t=!0)=>({...s,body:await Bc(s.body,n,t)}),oa=new WeakMap;function Dc(s){let n=typeof s==="function"?s:s.fetch,t=oa.get(n);if(t)return t;let i=(async()=>{try{let a="Response"in n?n.Response:(await n("data:,")).constructor,l=new FormData;if(l.toString()===await new a(l).text())return!1;return!0}catch{return!0}})();return oa.set(n,i),i}var Bc=async(s,n,t=!0)=>{if(!await Dc(n))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(s||{}).map(([a,l])=>hi(i,a,l,t))),i};var hi=async(s,n,t,i)=>{if(t===void 0)return;if(t==null)throw TypeError(`Received null for "${n}"; to pass null in FormData, you must use the string 'null'`);if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")s.append(n,String(t));else if(t instanceof Response){let a={},l=t.headers.get("Content-Type");if(l)a={type:l};s.append(n,tt([await t.blob()],Wt(t,i),a))}else if(pi(t))s.append(n,tt([await new Response(un(t)).blob()],Wt(t,i)));else if(t instanceof Blob){let l=typeof File<"u"&&t instanceof File?t.name:Wt(t,i);s.append(n,tt([t],l,{type:t.type}))}else if(Array.isArray(t))await Promise.all(t.map((a)=>hi(s,n+"[]",a,i)));else if(typeof t.then==="function")throw TypeError(`Received a Promise for "${n}"; await it first, e.g. \`await toFile(...)\``);else if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))throw TypeError(`Received ${t.constructor.name} for "${n}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);else if(typeof t==="object")await Promise.all(Object.entries(t).map(([a,l])=>hi(s,`${n}[${a}]`,l,i)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${t} instead`)};var aa=(s)=>s!=null&&typeof s==="object"&&typeof s.size==="number"&&typeof s.type==="string"&&typeof s.text==="function"&&typeof s.slice==="function"&&typeof s.arrayBuffer==="function",Wc=(s)=>s!=null&&typeof s==="object"&&typeof s.name==="string"&&typeof s.lastModified==="number"&&aa(s),Uc=(s)=>s!=null&&typeof s==="object"&&typeof s.url==="string"&&typeof s.blob==="function";async function _i(s,n,t){if(fi(),s=await s,n||(n=s instanceof File?s.name:Wt(s,!0)),Wc(s)){if(s instanceof File&&n==null&&t==null)return s;return tt([await s.arrayBuffer()],n??s.name,{type:s.type,lastModified:s.lastModified,...t})}if(Uc(s)){let a=await s.blob();return n||(n=new URL(s.url).pathname.split(/[\\/]/).pop()),tt(await mi(a),n,t)}let i=await mi(s);if(!t?.type){let a=i.find((l)=>typeof l==="object"&&("type"in l)&&l.type);if(typeof a==="string")t={...t,type:a}}return tt(i,n,t)}async function mi(s){let n=[];if(typeof s==="string"||ArrayBuffer.isView(s)||s instanceof ArrayBuffer)n.push(s);else if(aa(s))n.push(s instanceof Blob?s:await s.arrayBuffer());else if(pi(s))for await(let t of s)n.push(...await mi(t));else{let t=s?.constructor?.name;throw Error(`Unexpected data type: ${typeof s}${t?`; constructor: ${t}`:""}${jc(s)}`)}return n}function jc(s){if(typeof s!=="object"||s===null)return"";return`; props: [${Object.getOwnPropertyNames(s).map((t)=>`"${t}"`).join(", ")}]`}class E{constructor(s){this._client=s}}var ca=Symbol.for("brand.privateNullableHeaders");function*Kc(s){if(!s)return;if(ca in s){let{values:i,nulls:a}=s;yield*i.entries();for(let l of a)yield[l,null];return}let n=!1,t;if(s instanceof Headers)t=s.entries();else if(ms(s))t=s;else n=!0,t=Object.entries(s??{});for(let i of t){let a=i[0];if(typeof a!=="string")throw TypeError("expected header name to be a string");let l=ms(i[1])?i[1]:[i[1]],u=!1;for(let d of l){if(d===void 0)continue;if(n&&!u)u=!0,yield[a,Sn];yield[a,d]}}}var Sn=Symbol("clear"),zc=new Set(["x-stainless-helper"]),Vc=(s,n)=>{let t=s?s.split(",").map((i)=>i.trim()).filter(Boolean):[];for(let i of n.split(",").map((a)=>a.trim()))if(i&&!t.includes(i))t.push(i);return t.join(", ")},f=(s)=>{let n=new Headers,t=new Set;for(let i of s){let a=new Set;for(let[l,u]of Kc(i)){let d=l.toLowerCase();if(zc.has(d)){if(u===Sn)continue;if(u===null)n.delete(l),t.add(d);else n.set(l,Vc(n.get(l),u)),t.delete(d);continue}if(u===Sn||!a.has(d)){if(n.delete(l),a.add(d),u===Sn)continue}if(u===null)n.delete(l),t.add(d);else n.append(l,u),t.delete(d)}}return{[ca]:!0,values:n,nulls:t}};function _a(s){return s.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var fa=Object.freeze(Object.create(null)),Yc=(s=_a)=>function(t,...i){if(t.length===1)return t[0];let a=!1,l=[],u=t.reduce((x,_,b)=>{if(/[?#]/.test(_))a=!0;let w=i[b],S=(a?encodeURIComponent:s)(""+w);if(b!==i.length&&(w==null||typeof w==="object"&&w.toString===Object.getPrototypeOf(Object.getPrototypeOf(w.hasOwnProperty??fa)??fa)?.toString))S=w+"",l.push({start:x.length+_.length,length:S.length,error:`Value of type ${Object.prototype.toString.call(w).slice(8,-1)} is not a valid path parameter`});return x+_+(b===i.length?"":S)},""),d=u.split(/[?#]/,1)[0],h=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,g;while((g=h.exec(d))!==null)l.push({start:g.index,length:g[0].length,error:`Value "${g[0]}" can't be safely passed as a path parameter`});if(l.sort((x,_)=>x.start-_.start),l.length>0){let x=0,_=l.reduce((b,w)=>{let S=" ".repeat(w.start-x),T="^".repeat(w.length);return x=w.start+w.length,b+S+T},"");throw new p(`Path parameters result in path with invalid segments:
|
|
7
|
+
${l.map((b)=>b.error).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${u}
|
|
10
|
+
${_}`)}return u},m=Yc(_a);class Ut extends E{retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/deployment_runs/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",I,{query:a,...n,headers:f([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}class jt extends E{create(s,n){let{betas:t,workspace_id:i,...a}=s;return this._client.post("/v1/deployments?beta=true",{body:a,...n,headers:f([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/deployments/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}update(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/deployments/${s}?beta=true`,{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/deployments?beta=true",I,{query:a,...n,headers:f([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/deployments/${s}/archive?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}pause(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/deployments/${s}/pause?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}run(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/deployments/${s}/run?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}unpause(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/deployments/${s}/unpause?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}class qt extends E{create(s,n){let{betas:t,workspace_id:i,...a}=s;return this._client.post("/v1/dreams?beta=true",{body:a,...n,headers:f([{"anthropic-beta":[...t??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/dreams/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/dreams?beta=true",I,{query:a,...n,headers:f([{"anthropic-beta":[...t??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/dreams/${s}/archive?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}cancel(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/dreams/${s}/cancel?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var vn="x-stainless-helper",dt="x-stainless-helper-method";function xn(s){return{["x-stainless-helper"]:s}}var ut=Symbol("anthropic.sdk.stainlessHelper");function Kt(s){return typeof s==="object"&&s!==null&&ut in s}function gi(s,n){let t=new Set;if(s){for(let i of s)if(Kt(i))t.add(i[ut])}if(n)for(let i of n){if(Kt(i))t.add(i[ut]);let a=i.content;if(Array.isArray(a))for(let l of a){if(Kt(l))t.add(l[ut]);let u=l?.tool?.definition;if(Kt(u))t.add(u[ut])}}return Array.from(t)}function En(s,n){let t=gi(s,n);if(t.length===0)return{};return{["x-stainless-helper"]:t.join(", ")}}function An(s){if(Kt(s))return{["x-stainless-helper"]:s[ut]};return{}}class zt extends E{list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/files?beta=true",I,{query:a,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.delete(m`/v1/files/${s}?beta=true`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}download(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/files/${s}/content?beta=true`,{...t,headers:f([{Accept:"application/binary",...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers]),__binaryResponse:!0})}retrieveMetadata(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/files/${s}?beta=true`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}upload(s,n){let{betas:t,workspace_id:i,...a}=s;return this._client.post("/v1/files?beta=true",we({body:a,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},An(a.file),n?.headers])},this._client))}}class Vt extends E{retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/models/${s}?beta=true`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/models?beta=true",Z,{query:a,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}class Yt extends E{create(s,n){let{betas:t,workspace_id:i,...a}=s;return this._client.post("/v1/user_profiles?beta=true",{body:a,...n,headers:f([{"anthropic-beta":[...t??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/user_profiles/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}update(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/user_profiles/${s}?beta=true`,{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/user_profiles?beta=true",I,{query:a,...n,headers:f([{"anthropic-beta":[...t??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}createEnrollmentURL(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/user_profiles/${s}/enrollment_url?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var Ca=c(Pa(),1);class Xt extends E{parseUnverified(s){return JSON.parse(s)}unwrap(s,n){let t=n?.headers;if(t==null)throw Error("Webhook headers are required in order to verify the signature");let i=n.key===void 0?this._client.webhookKey:n.key;if(!i)throw Error("Webhook key must not be null or empty in order to unwrap");return new Ca.Webhook(i).verify(s,t),JSON.parse(s)}}class Qt extends E{list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/agents/${s}/versions?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var Tn=(()=>{class s extends E{constructor(){super(...arguments);this.versions=new Qt(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/agents?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l,...u}=t??{};return this._client.get(m`/v1/agents/${n}?beta=true`,{query:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/agents/${n}?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/agents?beta=true",I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/agents/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Versions=Qt,s})();function Ue(s,n){if(!s)return()=>{};if(s.aborted)return n.abort(),()=>{};let t=()=>n.abort();return s.addEventListener("abort",t),()=>s.removeEventListener("abort",t)}function Pn(s,{authToken:n,helper:t}){if(!n)throw new p(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(n)}`);let i=s,a=i._options.defaultHeaders,l=i._authState?.extraHeaders,u=l?Object.fromEntries(Object.entries(l).filter(([h])=>{let g=h.toLowerCase();return g!=="authorization"&&g!=="x-api-key"})):void 0,d=f([u,a,{[vn]:t}]);return s.withOptions({apiKey:null,authToken:n,baseURL:s.baseURL,credentials:void 0,defaultHeaders:d})}var ht,Cn,be,On,Mn,Nn,Zt,sr,ft,pt,Ln,mt,ir,hl=999,fl=1000,pl=60000,ml=300000,ar=(()=>{class s{constructor(n){ht.set(this,void 0),Cn.set(this,!1),be.set(this,void 0),On.set(this,void 0),Mn.set(this,void 0),Nn.set(this,void 0),Zt.set(this,void 0),sr.set(this,void 0),ft.set(this,void 0),this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.workerId=n.workerId??wl(),o(this,ht,Pn(n.client,{authToken:n.environmentKey,helper:"environments-work-poller"}),"f"),o(this,Mn,n.autoStop??!0,"f"),o(this,Nn,n.drain??!1,"f"),o(this,Zt,n.blockMs===void 0?hl:n.blockMs,"f"),o(this,sr,n.reclaimOlderThanMs??null,"f"),o(this,ft,n.requestOptions,"f"),o(this,be,new AbortController,"f"),o(this,On,Ue(n.signal,e(this,be,"f")),"f")}get signal(){return e(this,be,"f").signal}abort(){e(this,be,"f").abort()}async*[(ht=new WeakMap,Cn=new WeakMap,be=new WeakMap,On=new WeakMap,Mn=new WeakMap,Nn=new WeakMap,Zt=new WeakMap,sr=new WeakMap,ft=new WeakMap,Symbol.asyncIterator)](){if(e(this,Cn,"f"))throw new p("Cannot iterate over a consumed WorkPoller");o(this,Cn,!0,"f");let n=N(this.client);n.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let t=new gl(n,this.environmentId);try{let i=0;while(!e(this,be,"f").signal.aborted){let a;try{a=await e(this,ht,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...e(this,Zt,"f")!==null?{block_ms:e(this,Zt,"f")}:{},...e(this,sr,"f")!==null?{reclaim_older_than_ms:e(this,sr,"f")}:{}},{headers:f([e(this,ft,"f")?.headers]),signal:e(this,be,"f").signal})}catch(l){if(e(this,be,"f").signal.aborted)return;if(vr(l))throw n.error("poll failed permanently, stopping poller",{error:String(l)}),l;let u=oi(_l(i));n.warn("poll failed, backing off",{error:String(l),backoff_ms:u}),i++,await Re(u,e(this,be,"f").signal);continue}if(i=0,a==null){if(e(this,Nn,"f"))return;t.onEmptyPoll(),await Re(ha(1000,3000),e(this,be,"f").signal);continue}t.onClaim(),n.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:a.id,work_type:a.data.type});try{await e(this,ht,"f").beta.environments.work.ack(a.id,{environment_id:a.environment_id},{headers:f([e(this,ft,"f")?.headers]),signal:e(this,be,"f").signal})}catch(l){n.error("ack failed",{work_id:a.id,error:String(l)});continue}try{yield a}finally{if(e(this,Mn,"f"))try{await e(this,ht,"f").beta.environments.work.stop(a.id,{environment_id:a.environment_id},{headers:f([e(this,ft,"f")?.headers])})}catch(l){if(!Se(l,409))n.warn("stop failed",{work_id:a.id,error:String(l)})}}}}finally{e(this,On,"f").call(this)}}}return s})();function _l(s){return ni(s,fl,pl)}var gl=(()=>{class s{constructor(n,t){pt.set(this,void 0),Ln.set(this,void 0),mt.set(this,void 0),ir.set(this,0),o(this,pt,n,"f"),o(this,Ln,t,"f")}onEmptyPoll(){let n=Date.now(),t={component:"work-poller",environment_id:e(this,Ln,"f")};if(e(this,mt,"f")===void 0)o(this,mt,o(this,ir,n,"f"),"f"),e(this,pt,"f").info("idle; polling for work",t);else if(n-e(this,ir,"f")>=ml)o(this,ir,n,"f"),e(this,pt,"f").info(`still polling; idle for ${Math.round((n-e(this,mt,"f"))/1000)}s`,t);else e(this,pt,"f").debug("poll returned no work",t)}onClaim(){o(this,mt,void 0,"f")}}return pt=new WeakMap,Ln=new WeakMap,mt=new WeakMap,ir=new WeakMap,s})();function wl(){let n=globalThis.process?.env?.HOSTNAME;return n?`${n}-${gn()}`:gn()}var _t,qe,gt,Oa=(()=>{class s{constructor(){_t.set(this,[]),qe.set(this,[]),gt.set(this,!1)}push(n){if(e(this,gt,"f"))return!1;let t=e(this,qe,"f").shift();if(t)t({done:!1,value:n});else e(this,_t,"f").push(n);return!0}close(){if(e(this,gt,"f"))return;o(this,gt,!0,"f");while(e(this,qe,"f").length>0)e(this,qe,"f").shift()({done:!0,value:void 0})}next(n){if(e(this,_t,"f").length>0)return Promise.resolve({done:!1,value:e(this,_t,"f").shift()});if(e(this,gt,"f")||n?.aborted)return Promise.resolve({done:!0,value:void 0});return new Promise((t)=>{let i=(l)=>{n?.removeEventListener("abort",a),t(l)},a=()=>{let l=e(this,qe,"f").indexOf(i);if(l>=0)e(this,qe,"f").splice(l,1);t({done:!0,value:void 0})};e(this,qe,"f").push(i),n?.addEventListener("abort",a,{once:!0})})}tryShift(){return e(this,_t,"f").shift()}}return _t=new WeakMap,qe=new WeakMap,gt=new WeakMap,s})();function bi(s){return"name"in s?s.name:("mcp_server_name"in s)?s.mcp_server_name:s.type}function yl(s){return s instanceof M?s.content:`Error: ${s instanceof Error?s.message:String(s)}`}async function Ma(s,n,t){try{let i=s.parse?s.parse(n):n;return{content:await s.run(i,t),isError:!1}}catch(i){return{content:yl(i),isError:!0}}}var cr,$n,yt,rt,Pe,z,Fn,ee,Dn,lr,Bn,X,bt,he,kt,Ke,St,He,Un,ur,ke,jn,Na,La,$a,Fa,ki,Ha,qn,Kn,Si,Da,Ba;var Wa=500,bl=1e4,kl=120000,Sl=30000,vl=1000,xl=30000,El=300000,Al=60000;function Ua(s){return s.type==="session.status_idle"&&s.stop_reason?.type==="end_turn"}var Rl=(()=>{class s{constructor(n,t){cr.set(this,void 0),$n.set(this,void 0),yt.set(this,new Set),rt.set(this,!1),Pe.set(this,void 0),o(this,cr,n,"f"),o(this,$n,t,"f")}noteEvent(n){if(n.type==="user.tool_confirmation")return;if(Ua(n))this.arm();else this.disarm()}block(n){if(e(this,yt,"f").add(n),e(this,Pe,"f")!==void 0)o(this,rt,!0,"f"),clearTimeout(e(this,Pe,"f")),o(this,Pe,void 0,"f")}unblock(n){if(e(this,yt,"f").delete(n),e(this,yt,"f").size===0&&e(this,rt,"f"))this.arm()}arm(){if(e(this,cr,"f")<=0)return;if(e(this,yt,"f").size>0){o(this,rt,!0,"f");return}if(o(this,rt,!1,"f"),e(this,Pe,"f")!==void 0)clearTimeout(e(this,Pe,"f"));o(this,Pe,setTimeout(e(this,$n,"f"),e(this,cr,"f")),"f")}disarm(){if(o(this,rt,!1,"f"),e(this,Pe,"f")!==void 0)clearTimeout(e(this,Pe,"f")),o(this,Pe,void 0,"f")}}return cr=new WeakMap,$n=new WeakMap,yt=new WeakMap,rt=new WeakMap,Pe=new WeakMap,s})(),dr=(()=>{class s{constructor(n,t){z.add(this),Fn.set(this,!1),ee.set(this,void 0),Dn.set(this,void 0),lr.set(this,void 0),Bn.set(this,void 0),X.set(this,void 0),bt.set(this,new Set),he.set(this,new Set),kt.set(this,new Map),Ke.set(this,new Map),St.set(this,new Oa),He.set(this,0),Un.set(this,El),ur.set(this,null),ke.set(this,void 0),this.client=t.client,this.sessionId=n,this.tools=t.tools,this.maxIdleMs=t.maxIdleMs??Al,o(this,X,N(t.client),"f"),o(this,Bn,new Map(t.tools.map((i)=>[bi(i),i])),"f"),o(this,ee,new AbortController,"f"),o(this,Dn,Ue(t.signal,e(this,ee,"f")),"f"),o(this,lr,t.requestOptions,"f"),o(this,ke,new Rl(this.maxIdleMs,()=>{e(this,X,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),e(this,ee,"f").abort()}),"f")}get signal(){return e(this,ee,"f").signal}abort(){e(this,ee,"f").abort()}_setSendRetryWindow(n){o(this,Un,n,"f")}async*[(Fn=new WeakMap,ee=new WeakMap,Dn=new WeakMap,lr=new WeakMap,Bn=new WeakMap,X=new WeakMap,bt=new WeakMap,he=new WeakMap,kt=new WeakMap,Ke=new WeakMap,St=new WeakMap,He=new WeakMap,Un=new WeakMap,ur=new WeakMap,ke=new WeakMap,z=new WeakSet,Symbol.asyncIterator)](){if(e(this,Fn,"f"))throw new p("Cannot iterate over a consumed SessionToolRunner");o(this,Fn,!0,"f"),e(this,X,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let n=e(this,z,"m",Na).call(this).catch((t)=>{if(!e(this,ee,"f").signal.aborted)e(this,X,"f").error("stream loop failed",{error:String(t)});e(this,ee,"f").abort()});try{while(!0){let i=await e(this,St,"f").next(e(this,ee,"f").signal);if(i.done)break;yield i.value}await n;let t;while((t=e(this,St,"f").tryShift())!==void 0)yield t}finally{e(this,ee,"f").abort(),e(this,ke,"f").disarm(),await n;try{await e(this,z,"m",Ba).call(this)}catch(t){e(this,X,"f").warn("drain failed",{error:String(t)})}e(this,St,"f").close();for(let t of this.tools)try{await t.close?.()}catch(i){e(this,X,"f").warn("tool.close failed",{tool:bi(t),error:String(i)})}e(this,Dn,"f").call(this)}}}return jn=function(){return{...e(this,lr,"f"),headers:f([xn("session-tool-runner"),e(this,lr,"f")?.headers]),signal:e(this,ee,"f").signal}},Na=async function(){let t=e(this,ee,"f"),i=Wa;while(!t.signal.aborted){try{let a=await this.client.beta.sessions.events.stream(this.sessionId,{},e(this,z,"m",jn).call(this));await e(this,z,"m",La).call(this);for await(let l of a)if(i=Wa,await e(this,z,"m",Fa).call(this,l))return}catch(a){if(t.signal.throwIfAborted(),vr(a))throw e(this,X,"f").error("permanent stream failure, shutting down",{error:String(a)}),t.abort(),a;e(this,X,"f").warn("stream disconnected, reconnecting",{error:String(a),backoff_ms:i})}t.signal.throwIfAborted(),await Re(i,t.signal),i=Math.min(i*2,bl)}},La=async function(){let t=e(this,ee,"f"),i=[],a=!1;try{for await(let d of this.client.beta.sessions.events.list(this.sessionId,{limit:1000},e(this,z,"m",jn).call(this)))e(this,z,"m",$a).call(this,d,i),a=Ua(d)}catch(d){t.signal.throwIfAborted(),e(this,X,"f").warn("reconcile list failed",{error:String(d)});for(let h of i)e(this,bt,"f").delete(h.id);return}let l=i.filter((d)=>!e(this,he,"f").has(d.id));e(this,ke,"f").disarm();for(let d of l)await e(this,z,"m",ki).call(this,d);for(let d of[...e(this,Ke,"f").values()]){let h=e(this,kt,"f").get(d.id);if(h!==void 0)await e(this,z,"m",qn).call(this,d,h)}let u=l.filter((d)=>!e(this,he,"f").has(d.id)&&!e(this,Ke,"f").has(d.id));if(a&&u.length===0)e(this,ke,"f").arm();else e(this,ke,"f").disarm()},$a=function(t,i){if(t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"){if(e(this,bt,"f").add(t.id),!e(this,he,"f").has(t.id))i.push(t)}else if(t.type==="user.tool_result")e(this,he,"f").add(t.tool_use_id);else if(t.type==="user.custom_tool_result")e(this,he,"f").add(t.custom_tool_use_id);else if(t.type==="user.tool_confirmation"){if(!e(this,he,"f").has(t.tool_use_id))e(this,kt,"f").set(t.tool_use_id,t.result)}},Fa=async function(t){switch(e(this,ke,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":if(!e(this,bt,"f").has(t.id))e(this,bt,"f").add(t.id),await e(this,z,"m",ki).call(this,t);return!1;case"user.tool_confirmation":return await e(this,z,"m",Ha).call(this,t),!1;case"user.tool_result":return e(this,he,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return e(this,he,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return e(this,X,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),e(this,ee,"f").abort(),!0;default:return!1}},ki=async function(t){let i=t.evaluated_permission,a=i==="deny"?"deny":e(this,kt,"f").get(t.id);if(a===void 0){if(i===void 0||i==="allow")await e(this,z,"m",Si).call(this,t,void 0);else if(!e(this,Ke,"f").has(t.id))e(this,X,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),e(this,Ke,"f").set(t.id,t),e(this,ke,"f").block(t.id);return}await e(this,z,"m",qn).call(this,t,a)},Ha=async function(t){e(this,kt,"f").set(t.tool_use_id,t.result);let i=e(this,Ke,"f").get(t.tool_use_id);if(i===void 0)return;await e(this,z,"m",qn).call(this,i,t.result)},qn=async function(t,i){let a=e(this,Ke,"f").delete(t.id);if(i==="allow"){if(e(this,X,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),!a)e(this,ke,"f").block(t.id);try{await e(this,z,"m",Si).call(this,t,"allow")}finally{e(this,ke,"f").unblock(t.id)}return}if(a)e(this,ke,"f").unblock(t.id);e(this,he,"f").add(t.id),e(this,X,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),e(this,z,"m",Kn).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},Kn=function(t){e(this,St,"f").push(t)},Si=async function(t,i){var a,l;if(e(this,he,"f").has(t.id))return;e(this,X,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),o(this,He,(a=e(this,He,"f"),a++,a),"f");try{let u=e(this,Bn,"f").get(t.name);if(!u){e(this,X,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),e(this,z,"m",Kn).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:i});return}let d,h,g=new AbortController,x=Ue(e(this,ee,"f").signal,g),_=setTimeout(()=>g.abort(),kl);try{let S=await Ma(u,t.input,{toolUse:t,toolUseBlock:t,signal:g.signal});d=S.content,h=S.isError}finally{clearTimeout(_),x()}let b=Il(t,h,Tl(d)),w=await e(this,z,"m",Da).call(this,b,t.id);e(this,z,"m",Kn).call(this,{event:t,result:b,toolUseId:t.id,name:t.name,isError:h,posted:w,confirmation:i})}finally{if(o(this,He,(l=e(this,He,"f"),l--,l),"f"),e(this,He,"f")===0)e(this,ur,"f")?.call(this)}},Da=async function(t,i){let a=e(this,ee,"f"),l=Date.now(),u,d=0;while(!0){d++,a.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},e(this,z,"m",jn).call(this)),e(this,he,"f").add(i),!0}catch(h){if(u=h,vr(h))break;let g=e(this,Un,"f")-(Date.now()-l);if(g<=0)break;let x=Math.min(oi(ni(d-1,vl,xl)),g);e(this,X,"f").warn("tool result send failed; retrying",{tool_use_id:i,attempt:d,backoff_ms:x,error:String(h)}),await Re(x,a.signal)}}return e(this,X,"f").error("failed to send tool result",{tool_use_id:i,attempts:d,error:String(u)}),!1},Ba=async function(){if(e(this,He,"f")===0)return;if(await Promise.race([new Promise((t)=>o(this,ur,t,"f")),Re(Sl)]),o(this,ur,null,"f"),e(this,He,"f")>0)e(this,X,"f").warn("drain timeout exceeded")},s})();function Il(s,n,t){if(s.type==="agent.custom_tool_use")return{type:"user.custom_tool_result",custom_tool_use_id:s.id,is_error:n,content:t};return{type:"user.tool_result",tool_use_id:s.id,is_error:n,content:t}}function Tl(s){if(typeof s==="string")return[{type:"text",text:s||"(no output)"}];let n=s.map((t)=>{if(t.type==="text")return{type:"text",text:t.text||"(no output)"};if(t.type==="image"||t.type==="document")return t;if(t.type==="search_result")return{type:"search_result",source:t.source,title:t.title,content:t.content.map((i)=>({type:"text",text:i.text})),citations:{enabled:t.citations?.enabled??!1}};return{type:"text",text:JSON.stringify(t)}});return n.length>0?n:[{type:"text",text:"(no output)"}]}var Vn,hr,vi,fr,vt,ja=30000,Pl=90000,Cl="NO_HEARTBEAT";function Ol(s){return s.resources.some((n)=>n.type==="memory_store")}function Ml(s){if(!s)return null;let n;try{let i=s.replace(/-/g,"+").replace(/_/g,"/"),a=i.padEnd(Math.ceil(i.length/4)*4,"=");n=JSON.parse(rr(Co(a)))}catch{return null}if(n===null||typeof n!=="object"||Array.isArray(n))return null;let t=n.sessions_token;return typeof t==="string"&&t!==""?t:null}var xi=(()=>{class s{constructor(n){if(Vn.add(this),hr.set(this,void 0),n.unrestrictedPaths!==void 0)throw new p("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");if(this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.tools=n.tools,this.workdir=n.workdir??process.cwd(),this.maxFileBytes=n.maxFileBytes,this.maxIdleMs=n.maxIdleMs,n.memorySyncIntervalMs!=null)zn(n.memorySyncIntervalMs,"memorySyncIntervalMs");this.memorySyncIntervalMs=n.memorySyncIntervalMs,this.memorySyncDeletions=n.memorySyncDeletions??"enabled",this.workerId=n.workerId,this.requestOptions=n.requestOptions,o(this,hr,n.signal,"f")}async run(n){let{environmentId:t,environmentKey:i}=this;if(t===void 0||i===void 0)throw new p("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let a=n??e(this,hr,"f"),l=new ar({client:this.client,environmentId:t,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...a?{signal:a}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let u of l)try{await e(this,Vn,"m",vi).call(this,u,i,l.signal)}catch(d){if(l.signal?.aborted)throw d;N(this.client).error("work item failed",{work_id:u.id,error:String(d)})}}async handleItem(n){let t=n?.workId??U("ANTHROPIC_WORK_ID"),i=n?.environmentId??U("ANTHROPIC_ENVIRONMENT_ID"),a=n?.sessionId??U("ANTHROPIC_SESSION_ID"),l=(n?.environmentKey??this.environmentKey??U("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,u=n?.workSecret||U("ANTHROPIC_WORK_SECRET")||null;if(!t)throw new p("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new p("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!a)throw new p("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!l&&!u)throw new p("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let d={id:t,environment_id:i,secret:u,data:{type:"session",id:a}};await e(this,Vn,"m",vi).call(this,d,l,n?.signal??e(this,hr,"f"))}}return hr=new WeakMap,Vn=new WeakSet,vi=async function(t,i,a){let l=N(this.client),u=Ml(t.secret),d=u??i;if(d===void 0)throw new p("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");if(t.secret&&u===null)l.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:t.id});let h=Pn(this.client,{authToken:d,helper:"environments-worker"}),g=t.data.id,x=new AbortController,_=Ue(a,x),b=new Ll(x),w=await import("./chunk-ve6n38r4.js"),S,T,k=Fl(h,t,b,l,this.requestOptions,(C)=>{S=C,T?._setSendRetryWindow(C)}).catch((C)=>{if(!x.signal.aborted)l.error("heartbeat loop failed",{work_id:t.id,error:String(C)});x.abort()}),R=async()=>{},y,P=!1;try{if(t.data.type!=="session"){l.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let C=await h.beta.sessions.retrieve(g);if(u===null&&this.memorySyncIntervalMs!==null&&Ol(C))throw new w.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${g}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let O={workdir:this.workdir,client:h,session:C,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{R=await w.setupSkills(O)}catch(L){l.warn("skill setup failed",{session_id:g,work_id:t.id,error:String(L)})}if(u!==null&&this.memorySyncIntervalMs!==null)y=new w.SessionMemoryStores(h,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await y.download(C),O.allowedRoots=y.roots,O.readOnlyRoots=y.readOnlyRoots;else l.debug("memory stores disabled for this item",{work_id:t.id});let q=typeof this.tools==="function"?this.tools(O):this.tools??w.betaAgentToolset20260401(O);if(T=new dr(g,{client:h,tools:q,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:x.signal}),S!==void 0)T._setSendRetryWindow(S);for await(let L of T)if(y)await y.syncIfDue();P=!x.signal.aborted}finally{try{await R().catch((C)=>{l.warn("skill cleanup failed",{session_id:g,work_id:t.id,error:String(C)})})}finally{if(y){let C=w.MEMORY_FLUSH_TIMEOUT_MS;if(P){if(await qa(y.finish(),C))l.warn(`final memory sync cut off after ${C}ms; the flush that follows still uploads changed files`,{session_id:g,work_id:t.id})}let O=new AbortController;if(await qa(y.flushWrites(O.signal),C))O.abort(),l.warn(`memory flush cut off after ${C}ms; changed files it had not uploaded yet are not saved`,{session_id:g,work_id:t.id});await y.dispose().catch((L)=>{l.warn("memory store cleanup failed",{session_id:g,work_id:t.id,error:String(L)})})}}if(b.finish("runner_done"),_(),await k,b.lost)l.info("lease lost; released without stopping it",{session_id:g,work_id:t.id});else await Nl(h,t,l,this.requestOptions)}},s})();async function qa(s,n){let t;try{return await Promise.race([s.then(()=>!1,()=>!1),new Promise((i)=>{t=setTimeout(()=>i(!0),n)})])}finally{if(t!==void 0)clearTimeout(t)}}async function Nl(s,n,t,i){try{await s.beta.environments.work.stop(n.id,{environment_id:n.environment_id,force:!0},{...i,headers:f([i?.headers])})}catch(a){if(!Se(a,409))t.error("force-stop on exit failed",{work_id:n.id,error:String(a)})}}var Ll=(()=>{class s{constructor(n){fr.set(this,void 0),vt.set(this,void 0),o(this,fr,n,"f")}get signal(){return e(this,fr,"f").signal}finish(n){o(this,vt,e(this,vt,"f")??n,"f"),e(this,fr,"f").abort()}get lost(){return e(this,vt,"f")==="lease_lost"||e(this,vt,"f")==="assumed_lost"}}return fr=new WeakMap,vt=new WeakMap,s})();function $l(s){let n=s instanceof le?s.error:void 0;for(let t of["error","details","current_state"]){if(!gs(n))return{};n=n[t]}return gs(n)?n:{}}async function Fl(s,n,t,i,a,l){let u=ja,d=Pl,h=Date.now(),g=Cl,x=async()=>{let _=new AbortController,b=Ue(t.signal,_),w=setTimeout(()=>_.abort(),u);try{let S=await s.beta.environments.work.heartbeat(n.id,{environment_id:n.environment_id,expected_last_heartbeat:g},{...a,headers:f([a?.headers]),signal:_.signal});if(h=Date.now(),g=S.last_heartbeat,S.ttl_seconds>0)d=S.ttl_seconds*1000,u=Math.max(1000,Math.min(d/2,ja)),l?.(d);if(S.state==="stopping"||S.state==="stopped")i.info("heartbeat signals shutdown",{work_id:n.id,state:S.state}),t.finish("control_plane_stop");if(!S.lease_extended)i.warn("lease not extended, shutting down",{work_id:n.id}),t.finish("control_plane_stop")}catch(S){if(t.signal.throwIfAborted(),Se(S,412)){let T=$l(S);i.error("lease lost: heartbeat precondition failed",{work_id:n.id,server_state:T.state,server_ttl_seconds:T.ttl_seconds,server_last_heartbeat:T.last_heartbeat}),t.finish("lease_lost");return}if(vr(S))throw i.error("permanent heartbeat failure",{work_id:n.id,error:String(S)}),t.finish("heartbeat_rejected"),S;if(Date.now()-h>d){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:n.id,ttl_ms:d,error:String(S)}),t.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:n.id,error:String(S)})}finally{clearTimeout(w),b()}};await x();while(!t.signal.aborted)await Re(u,t.signal),t.signal.throwIfAborted(),await x()}var Yn=(()=>{class s extends E{retrieve(n,t,i){let{environment_id:a,betas:l,workspace_id:u}=t;return this._client.get(m`/v1/environments/${a}/work/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},i?.headers])})}update(n,t,i){let{environment_id:a,betas:l,workspace_id:u,...d}=t;return this._client.post(m`/v1/environments/${a}/work/${n}?beta=true`,{body:d,...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},i?.headers])})}list(n,t={},i){let{betas:a,...l}=t??{};return this._client.getAPIList(m`/v1/environments/${n}/work?beta=true`,I,{query:l,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(n,t,i){let{environment_id:a,betas:l}=t;return this._client.post(m`/v1/environments/${a}/work/${n}/ack?beta=true`,{...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(n,t,i){let{environment_id:a,desired_ttl_seconds:l,expected_last_heartbeat:u,betas:d}=t;return this._client.post(m`/v1/environments/${a}/work/${n}/heartbeat?beta=true`,{query:{desired_ttl_seconds:l,expected_last_heartbeat:u},...i,headers:f([{"anthropic-beta":[...d??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(n,t={},i){let{betas:a,"Anthropic-Worker-ID":l,...u}=t??{};return this._client.get(m`/v1/environments/${n}/work/poll?beta=true`,{query:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"Anthropic-Worker-ID":l}:void 0},i?.headers])})}stats(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/environments/${n}/work/stats?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}stop(n,t,i){let{environment_id:a,betas:l,workspace_id:u,...d}=t;return this._client.post(m`/v1/environments/${a}/work/${n}/stop?beta=true`,{body:d,...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},i?.headers])})}poller(n){return new ar({...n,client:this._client})}worker(n){return new xi({...n,client:this._client})}}return s.WorkPoller=ar,s.EnvironmentWorker=xi,s})();var Jn=(()=>{class s extends E{constructor(){super(...arguments);this.work=new Yn(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/environments?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/environments/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/environments/${n}?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/environments?beta=true",I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.delete(m`/v1/environments/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/environments/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Work=Yn,s})();class pr extends E{create(s,n,t){let{view:i,betas:a,workspace_id:l,...u}=n;return this._client.post(m`/v1/memory_stores/${s}/memories?beta=true`,{query:{view:i},body:u,...t,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}retrieve(s,n,t){let{memory_store_id:i,betas:a,workspace_id:l,...u}=n;return this._client.get(m`/v1/memory_stores/${i}/memories/${s}?beta=true`,{query:u,...t,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}update(s,n,t){let{memory_store_id:i,view:a,betas:l,workspace_id:u,...d}=n;return this._client.post(m`/v1/memory_stores/${i}/memories/${s}?beta=true`,{query:{view:a},body:d,...t,headers:f([{"anthropic-beta":[...l??[],"agent-memory-2026-07-22"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/memory_stores/${s}/memories?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(s,n,t){let{memory_store_id:i,expected_content_sha256:a,betas:l,workspace_id:u}=n;return this._client.delete(m`/v1/memory_stores/${i}/memories/${s}?beta=true`,{query:{expected_content_sha256:a},...t,headers:f([{"anthropic-beta":[...l??[],"agent-memory-2026-07-22"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},t?.headers])})}}class mr extends E{retrieve(s,n,t){let{memory_store_id:i,betas:a,workspace_id:l,...u}=n;return this._client.get(m`/v1/memory_stores/${i}/memory_versions/${s}?beta=true`,{query:u,...t,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/memory_stores/${s}/memory_versions?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}redact(s,n,t){let{memory_store_id:i,betas:a,workspace_id:l}=n;return this._client.post(m`/v1/memory_stores/${i}/memory_versions/${s}/redact?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}}var Gn=(()=>{class s extends E{constructor(){super(...arguments);this.memories=new pr(this._client),this.memoryVersions=new mr(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/memory_stores?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/memory_stores/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/memory_stores/${n}?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/memory_stores?beta=true",I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.delete(m`/v1/memory_stores/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/memory_stores/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Memories=pr,s.MemoryVersions=mr,s})();var Xn=(()=>{class s{constructor(n,t){this.iterator=n,this.controller=t}async*decoder(){let n=new Ft;for await(let t of this.iterator)for(let i of n.decode(t))yield JSON.parse(i);for(let t of n.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,t){if(!n.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new p("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new p("Attempted to iterate over a response with no body")}return new s($t(n.body),t)}}return s})();class gr extends E{create(s,n){let{betas:t,user_profile_id:i,workspace_id:a,...l}=s;return this._client.post("/v1/messages/batches?beta=true",{body:l,...n,headers:f([{"anthropic-beta":[...t??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-user-profile-id":i}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},n?.headers])})}retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/messages/batches/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Z,{query:a,...n,headers:f([{"anthropic-beta":[...t??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.delete(m`/v1/messages/batches/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}cancel(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.post(m`/v1/messages/batches/${s}/cancel?beta=true`,{...t,headers:f([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}async results(s,n={},t){let i=await this.retrieve(s,n,t);if(!i.results_url)throw new p(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:a,workspace_id:l}=n??{};return this._client.get(i.results_url,{...t,headers:f([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,d)=>Xn.fromResponse(d.response,d.controller))}}var Zn={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function Ka(s){return s?.output_format??s?.output_config?.format}function Ei(s,n,t){let i=Ka(n);if(!n||!("parse"in(i??{})))return{...s,content:s.content.map((a)=>{if(a.type==="text"){let l=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return t.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null};return Ai(s,n,t)}function Ai(s,n,t){let i=null,a=s.content.map((l)=>{if(l.type==="text"){let u=ql(n,l.text);if(i===null)i=u;let d=Object.defineProperty({...l},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(d,"parsed",{get(){return t.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return l});return{...s,content:a,parsed_output:i}}function ql(s,n){let t=Ka(s);if(t?.type!=="json_schema")return null;try{if("parse"in t)return t.parse(n);return JSON.parse(n)}catch(i){throw new p(`Failed to parse structured output: ${i}`)}}var Kl=(s)=>{let n=0,t=[];while(n<s.length){let i=s[n];if(i==="\\"){n++;continue}if(i==="{"){t.push({type:"brace",value:"{"}),n++;continue}if(i==="}"){t.push({type:"brace",value:"}"}),n++;continue}if(i==="["){t.push({type:"paren",value:"["}),n++;continue}if(i==="]"){t.push({type:"paren",value:"]"}),n++;continue}if(i===":"){t.push({type:"separator",value:":"}),n++;continue}if(i===","){t.push({type:"delimiter",value:","}),n++;continue}if(i==='"'){let d=n+1,h=d,g=!1;while(!0){if(h=s.indexOf('"',h),h===-1){g=!0;break}let x=0,_=h-1;while(_>=d&&s[_]==="\\")x++,_--;if(x%2===0)break;h++}if(g)n=s.length;else t.push({type:"string",value:s.slice(d,h)}),n=h+1;continue}if(i&&/\s/.test(i)){n++;continue}let l=/[0-9]/;if(i&&l.test(i)||i==="-"||i==="."){let d="";if(i==="-")d+=i,i=s[++n];while(i&&(l.test(i)||i==="."||i==="e"||i==="E"||(i==="-"||i==="+")&&(d[d.length-1]==="e"||d[d.length-1]==="E")))d+=i,i=s[++n];t.push({type:"number",value:d,unterminated:n===s.length});continue}let u=/[a-z]/i;if(i&&u.test(i)){let d="";while(i&&u.test(i)){if(n===s.length)break;d+=i,i=s[++n]}if(d=="true"||d=="false"||d==="null")t.push({type:"name",value:d});else{n++;continue}continue}n++}return t},zl=(s)=>{let n=[];for(let l of s)if(l.type==="brace"||l.type==="paren")if(l.value==="{"||l.value==="[")n.push(l.value);else n.pop();let t=n[n.length-1],i=s.length,a=/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/;while(i>0){let l=s[i-1];switch(l.type){case"separator":i--;continue;case"number":if(l.unterminated||!a.test(l.value)){i--;continue}break;case"string":let u=s[i-2];if(t==="{"&&(u?.type==="delimiter"||u?.type==="brace"&&u.value==="{")){i--;continue}break;case"delimiter":i--;break}break}return s.slice(0,i)},Vl=(s)=>{let n=[];if(s.map((t)=>{if(t.type==="brace")if(t.value==="{")n.push("}");else n.splice(n.lastIndexOf("}"),1);if(t.type==="paren")if(t.value==="[")n.push("]");else n.splice(n.lastIndexOf("]"),1)}),n.length>0)n.reverse().map((t)=>{if(t==="}")s.push({type:"brace",value:"}"});else if(t==="]")s.push({type:"paren",value:"]"})});return s},Yl=(s)=>{let n="";return s.map((t)=>{switch(t.type){case"string":n+='"'+t.value+'"';break;default:n+=t.value;break}}),n},za=(s)=>JSON.parse(Yl(Vl(zl(Kl(s)))));var Ve="__json_buf";function es(s,n){let t={};for(let l of Object.keys(s))if(l!=="input")t[l]=s[l];Object.defineProperty(t,Ve,{value:n,enumerable:!1,writable:!0});let i,a=!1;return Object.defineProperty(t,"input",{enumerable:!0,configurable:!0,get(){if(!a)i=n?za(n):{},a=!0;return i}}),t}var ne,Ye,xt,wr,ts,yr,br,rs,kr,Ne,Er,ns,ss,nt,is,os,as,Ar,Ri,Va,Rr,Ii,Ti,Pi,Ya,Ci;function Oi(s){return s.type==="tool_use"||s.type==="server_tool_use"||s.type==="mcp_tool_use"}var cs=(()=>{class s{constructor(n,t){ne.add(this),this.messages=[],this.receivedMessages=[],Ye.set(this,void 0),xt.set(this,null),this.controller=new AbortController,wr.set(this,void 0),ts.set(this,()=>{}),yr.set(this,()=>{}),br.set(this,void 0),rs.set(this,()=>{}),kr.set(this,()=>{}),Ne.set(this,{}),Er.set(this,!1),ns.set(this,!1),ss.set(this,!1),nt.set(this,!1),is.set(this,void 0),os.set(this,void 0),as.set(this,void 0),Ar.set(this,void 0),Rr.set(this,(i)=>{if(o(this,ns,!0,"f"),wt(i))i=new je;if(i instanceof je)return o(this,ss,!0,"f"),this._emit("abort",i);if(i instanceof p)return this._emit("error",i);if(i instanceof Error){let a=new p(i.message);return a.cause=i,this._emit("error",a)}return this._emit("error",new p(String(i)))}),o(this,wr,new Promise((i,a)=>{o(this,ts,i,"f"),o(this,yr,a,"f")}),"f"),o(this,br,new Promise((i,a)=>{o(this,rs,i,"f"),o(this,kr,a,"f")}),"f"),e(this,wr,"f").catch(()=>{}),e(this,br,"f").catch(()=>{}),o(this,xt,n,"f"),o(this,Ar,t?.logger??console,"f")}get response(){return e(this,is,"f")}get request_id(){return e(this,os,"f")}get workspace_id(){return e(this,as,"f")}async withResponse(){o(this,nt,!0,"f");let n=await e(this,wr,"f");if(!n)throw Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let t=new s(null);return t._run(()=>t._fromReadableStream(n)),t}static createMessage(n,t,i,{logger:a}={}){let l=new s(t,{logger:a});for(let u of t.messages)l._addMessageParam(u);return o(l,xt,{...t,stream:!0},"f"),l._run(()=>l._createMessage(n,{...t,stream:!0},{...i,headers:{...i?.headers,[dt]:"stream"}})),l}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},e(this,Rr,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,t=!0){if(this.receivedMessages.push(n),t)this._emit("message",n)}async _createMessage(n,t,i){let a=i?.signal,l;if(a){if(a.aborted)this.controller.abort();l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l)}try{e(this,ne,"m",Ii).call(this);let{response:u,data:d}=await n.create({...t,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(u);for await(let h of d)e(this,ne,"m",Ti).call(this,h);if(d.controller.signal?.aborted)throw new je;e(this,ne,"m",Pi).call(this)}finally{if(a&&l)a.removeEventListener("abort",l)}}_connected(n){if(this.ended)return;o(this,is,n,"f"),o(this,os,n?.headers.get("request-id"),"f"),o(this,as,n?.headers.get("anthropic-workspace-id"),"f"),e(this,ts,"f").call(this,n),this._emit("connect")}get ended(){return e(this,Er,"f")}get errored(){return e(this,ns,"f")}get aborted(){return e(this,ss,"f")}abort(){this.controller.abort()}on(n,t){return(e(this,Ne,"f")[n]||(e(this,Ne,"f")[n]=[])).push({listener:t}),this}off(n,t){let i=e(this,Ne,"f")[n];if(!i)return this;let a=i.findIndex((l)=>l.listener===t);if(a>=0)i.splice(a,1);return this}once(n,t){return(e(this,Ne,"f")[n]||(e(this,Ne,"f")[n]=[])).push({listener:t,once:!0}),this}emitted(n){return new Promise((t,i)=>{if(o(this,nt,!0,"f"),n!=="error")this.once("error",i);this.once(n,t)})}async done(){o(this,nt,!0,"f"),await e(this,br,"f")}get currentMessage(){return e(this,Ye,"f")}async finalMessage(){return await this.done(),e(this,ne,"m",Ri).call(this)}async finalText(){return await this.done(),e(this,ne,"m",Va).call(this)}_emit(n,...t){if(e(this,Er,"f"))return;if(n==="end")o(this,Er,!0,"f"),e(this,rs,"f").call(this);let i=e(this,Ne,"f")[n];if(i)e(this,Ne,"f")[n]=i.filter((a)=>!a.once),i.forEach(({listener:a})=>a(...t));if(n==="abort"){let a=t[0];if(!e(this,nt,"f")&&!i?.length)Promise.reject(a);e(this,yr,"f").call(this,a),e(this,kr,"f").call(this,a),this._emit("end");return}if(n==="error"){let a=t[0];if(!e(this,nt,"f")&&!i?.length)Promise.reject(a);e(this,yr,"f").call(this,a),e(this,kr,"f").call(this,a),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",e(this,ne,"m",Ri).call(this))}async _fromReadableStream(n,t){let i=t?.signal,a;if(i){if(i.aborted)this.controller.abort();a=this.controller.abort.bind(this.controller),i.addEventListener("abort",a)}try{e(this,ne,"m",Ii).call(this),this._connected(null);let l=Me.fromReadableStream(n,this.controller);for await(let u of l)e(this,ne,"m",Ti).call(this,u);if(l.controller.signal?.aborted)throw new je;e(this,ne,"m",Pi).call(this)}finally{if(i&&a)i.removeEventListener("abort",a)}}[(Ye=new WeakMap,xt=new WeakMap,wr=new WeakMap,ts=new WeakMap,yr=new WeakMap,br=new WeakMap,rs=new WeakMap,kr=new WeakMap,Ne=new WeakMap,Er=new WeakMap,ns=new WeakMap,ss=new WeakMap,nt=new WeakMap,is=new WeakMap,os=new WeakMap,as=new WeakMap,Ar=new WeakMap,Rr=new WeakMap,ne=new WeakSet,Ri=function(){if(this.receivedMessages.length===0)throw new p("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Va=function(){if(this.receivedMessages.length===0)throw new p("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((i)=>i.type==="text").map((i)=>i.text);if(t.length===0)throw new p("stream ended without producing a content block with type=text");return t.join(" ")},Ii=function(){if(this.ended)return;o(this,Ye,void 0,"f")},Ti=function(t){if(this.ended)return;let i=e(this,ne,"m",Ya).call(this,t);switch(this._emit("streamEvent",t,i),t.type){case"content_block_delta":{let a=i.content.at(-1);switch(t.delta.type){case"text_delta":{if(a.type==="text")this._emit("text",t.delta.text,a.text||"");break}case"citations_delta":{if(a.type==="text")this._emit("citation",t.delta.citation,a.citations??[]);break}case"input_json_delta":{if(Oi(a)&&e(this,Ne,"f").inputJson?.length){let l;try{l=a.input}catch(u){e(this,Rr,"f").call(this,e(this,ne,"m",Ci).call(this,a,u));break}this._emit("inputJson",t.delta.partial_json,l)}break}case"thinking_delta":{if(a.type==="thinking")this._emit("thinking",t.delta.thinking,a.thinking);break}case"signature_delta":{if(a.type==="thinking")this._emit("signature",a.signature);break}case"compaction_delta":{if(a.type==="compaction"&&a.content)this._emit("compaction",a.content);break}default:tr(t.delta)}break}case"message_stop":{this._addMessageParam(i),this._addMessage(Ei(i,e(this,xt,"f"),{logger:e(this,Ar,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{o(this,Ye,i,"f");break}case"content_block_start":case"message_delta":break}},Pi=function(){if(this.ended)throw new p("stream has ended, this shouldn't happen");let t=e(this,Ye,"f");if(!t)throw new p("request ended without sending any chunks");return o(this,Ye,void 0,"f"),Ei(t,e(this,xt,"f"),{logger:e(this,Ar,"f")})},Ya=function(t){let i=e(this,Ye,"f");if(t.type==="message_start"){if(i)throw new p(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!i)throw new p(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return i;case"message_delta":if(i.stop_reason=t.delta.stop_reason,i.stop_sequence=t.delta.stop_sequence,i.stop_details=t.delta.stop_details,i.usage.output_tokens=t.usage.output_tokens,t.delta.container!=null)i.container=t.delta.container;if(t.context_management!=null)i.context_management=t.context_management;if(t.input_transformations!=null)i.input_transformations=t.input_transformations;if(t.usage.input_tokens!=null)i.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)i.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)i.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)i.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.iterations!=null)i.usage.iterations=t.usage.iterations;if(t.usage.fallback_credit!=null)i.usage.fallback_credit=t.usage.fallback_credit;if(t.usage.output_tokens_details!=null)i.usage.output_tokens_details=t.usage.output_tokens_details;return i;case"content_block_start":if(i.content.push(t.content_block),t.content_block.type==="fallback")i.model=t.content_block.to.model;return i;case"content_block_delta":{let a=i.content.at(t.index);switch(t.delta.type){case"text_delta":{if(a?.type==="text")i.content[t.index]={...a,text:(a.text||"")+t.delta.text};break}case"citations_delta":{if(a?.type==="text")i.content[t.index]={...a,citations:[...a.citations??[],t.delta.citation]};break}case"input_json_delta":{if(a&&Oi(a)){let l=(a[Ve]||"")+t.delta.partial_json;i.content[t.index]=es(a,l)}break}case"thinking_delta":{if(a?.type==="thinking")i.content[t.index]={...a,thinking:a.thinking+t.delta.thinking};break}case"signature_delta":{if(a?.type==="thinking")i.content[t.index]={...a,signature:t.delta.signature};break}case"compaction_delta":{if(a?.type==="compaction"){let l={...a,content:t.delta.content};if("encrypted_content"in t.delta)l.encrypted_content=t.delta.encrypted_content;i.content[t.index]=l}break}default:tr(t.delta)}return i}case"content_block_stop":{let a=i.content.at(t.index);if(a&&Oi(a)&&Ve in a){let l;try{l=a.input}catch(u){l={},e(this,Rr,"f").call(this,e(this,ne,"m",Ci).call(this,a,u))}Object.defineProperty(a,"input",{value:l,enumerable:!0,configurable:!0,writable:!0})}return i}}},Ci=function(t,i){let a=t[Ve];return new p(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${a}`)},Symbol.asyncIterator)](){let n=[],t=[],i=!1;return this.on("streamEvent",(a)=>{let l=t.shift();if(l)l.resolve(a);else n.push(a)}),this.on("end",()=>{i=!0;for(let a of t)a.resolve(void 0);t.length=0}),this.on("abort",(a)=>{i=!0;for(let l of t)l.reject(a);t.length=0}),this.on("error",(a)=>{i=!0;for(let l of t)l.reject(a);t.length=0}),{next:async()=>{if(!n.length){if(i)return{value:void 0,done:!0};return new Promise((l,u)=>t.push({resolve:l,reject:u})).then((l)=>l?{value:l,done:!1}:{value:void 0,done:!0})}return{value:n.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Me(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return s})();var Be,ls,st,Et,fs,it,At,_s,Ja,ws,ys,Mi=(()=>{class s extends cs{constructor(n,t){super(n);Be.add(this),ls.set(this,void 0),st.set(this,0),Et.set(this,[]),fs.set(this,[]),it.set(this,void 0),At.set(this,[]),_s.set(this,!1),o(this,ls,t,"f")}get toolCalls(){return e(this,fs,"f")}static start(n,t,i,a){let l=new s({...t,stream:!0},a);for(let u of t.messages)l._addMessageParam(u);return l._run(()=>l._createMessage(n,{...t,stream:!0},{...i,headers:{...i?.headers,[dt]:"stream"}})),l}_emit(n,...t){var i;if(n!=="streamEvent"||this.ended){super._emit(n,...t);return}o(this,st,(i=e(this,st,"f"),i++,i),"f");let[a,l]=t,u=a.type==="content_block_stop"?l.content[a.index]:void 0,d=u?.type==="tool_use"?u:void 0;if(d)e(this,fs,"f").push(d);super._emit(n,...t),e(this,Be,"m",Ja).call(this,a,d),e(this,Be,"m",ws).call(this)}[(ls=new WeakMap,st=new WeakMap,Et=new WeakMap,fs=new WeakMap,it=new WeakMap,At=new WeakMap,_s=new WeakMap,Be=new WeakSet,Symbol.asyncIterator)](){let n=super[Symbol.asyncIterator](),t={handled:e(this,st,"f")};e(this,Et,"f").push(t);let i=!1;return{next:async()=>{if(i)i=!1,t.handled++,e(this,Be,"m",ws).call(this);try{let a=await n.next();if(i=!a.done,a.done)e(this,Be,"m",ys).call(this,t);return a}catch(a){throw e(this,Be,"m",ys).call(this,t),a}},return:async()=>{let a=n.return?.();return e(this,Be,"m",ys).call(this,t),await a??{value:void 0,done:!0}}}}}return Ja=function(t,i){if(e(this,_s,"f"))return;if(t.type==="content_block_start"&&t.content_block.type==="fallback"){o(this,_s,!0,"f"),o(this,it,void 0,"f");return}let a=t.type==="content_block_start"||t.type==="message_delta"&&t.delta.stop_reason==="tool_use";if(e(this,it,"f")&&a)e(this,At,"f").push({toolUse:e(this,it,"f"),event:e(this,st,"f")}),o(this,it,void 0,"f");if(i)o(this,it,i,"f")},ws=function(){if(this.errored||this.controller.signal.aborted)return;let t=Math.min(e(this,st,"f"),...e(this,Et,"f").map((i)=>i.handled));while(e(this,At,"f")[0]&&e(this,At,"f")[0].event<=t)e(this,ls,"f").call(this,e(this,At,"f").shift().toolUse)},ys=function(t){let i=e(this,Et,"f").indexOf(t);if(i>=0)e(this,Et,"f").splice(i,1),e(this,Be,"m",ws).call(this)},s})();var j,Rt,ot,B,se,ie,Je,Le,Ge,Ir,fe,$e,It,Tt,at,Ni,Ga,Li,$i,Tr,bs,Xa,Fi,Hi,Qa,Di,Wi=(()=>{class s{constructor(n,t,i){j.add(this),this.client=n,Rt.set(this,!1),ot.set(this,!1),B.set(this,void 0),se.set(this,void 0),ie.set(this,void 0),Je.set(this,void 0),Le.set(this,void 0),Ge.set(this,void 0),Ir.set(this,0),fe.set(this,{status:"idle"}),$e.set(this,void 0),It.set(this,null),Tt.set(this,new Map),at.set(this,[]),Za(t),Jl(t),ec(t),o(this,B,{params:{...t,messages:JSON.parse(JSON.stringify(t.messages))}},"f");let a=gi(t.tools,t.messages);o(this,se,{...i,headers:f([xn("BetaToolRunner"),a.length?{[vn]:a.join(", ")}:void 0,i?.headers])},"f"),o(this,Ge,_r(),"f")}async*[(Rt=new WeakMap,ot=new WeakMap,B=new WeakMap,se=new WeakMap,ie=new WeakMap,Je=new WeakMap,Le=new WeakMap,Ge=new WeakMap,Ir=new WeakMap,fe=new WeakMap,$e=new WeakMap,It=new WeakMap,Tt=new WeakMap,at=new WeakMap,j=new WeakSet,Symbol.asyncIterator)](){var n;if(e(this,Rt,"f"))throw new p("Cannot iterate over a consumed stream");o(this,Rt,!0,"f"),o(this,ot,!0,"f"),o(this,Le,void 0,"f");try{while(!0)try{if(e(this,B,"f").params.max_iterations&&e(this,Ir,"f")>=e(this,B,"f").params.max_iterations)break;if(e(this,j,"m",Qa).call(this),e(this,fe,"f").status==="scheduled"&&rc(e(this,It,"f"))!=="resume"){yield*e(this,j,"m",$i).call(this,e(this,fe,"f").config);continue}o(this,ot,!1,"f"),o(this,Le,void 0,"f"),o(this,Ir,(n=e(this,Ir,"f"),n++,n),"f"),o(this,ie,void 0,"f");let{max_iterations:t,runToolsEagerly:i,...a}=e(this,B,"f").params;if(yield*e(this,j,"m",Ni).call(this,a),!e(this,ot,"f")){let u=await e(this,ie,"f"),d=rc(u.stop_reason);o(this,It,u.stop_reason,"f"),e(this,B,"f").params.messages.push({role:u.role,content:Ql(u.content)});let{container:h}=e(this,B,"f").params;if(u.container){if(h==null)e(this,B,"f").params.container=u.container.id;else if(typeof h==="object"&&h.id==null)e(this,B,"f").params.container={...h,id:u.container.id}}if(d==="stop"){yield*e(this,j,"m",Fi).call(this);break}if(d==="resume")continue}else o(this,It,null,"f");let l=await e(this,j,"m",Hi).call(this,e(this,B,"f").params.messages.at(-1));if(l)e(this,B,"f").params.messages.push(l);else if(!e(this,ot,"f")){yield*e(this,j,"m",Fi).call(this);break}}finally{e(this,Je,"f")?.abort(),o(this,Je,void 0,"f")}if(await e(this,j,"m",Li).call(this),!e(this,ie,"f"))throw new p("ToolRunner concluded without a message from the server");e(this,Ge,"f").resolve(await e(this,ie,"f"))}catch(t){throw o(this,Rt,!1,"f"),e(this,Ge,"f").promise.catch(()=>{}),e(this,Ge,"f").reject(t),o(this,Ge,_r(),"f"),t}}setMessagesParams(n){let t=typeof n==="function"?n(e(this,B,"f").params):n;if(Za(t),ec(t),e(this,fe,"f").status!=="idle")Bi(t);if(e(this,fe,"f").status==="in_flight"&&t.messages!==e(this,B,"f").params.messages)throw new p("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead.");e(this,B,"f").params=t,o(this,ot,!0,"f"),o(this,Le,void 0,"f")}setRequestOptions(n){if(typeof n==="function")o(this,se,n(e(this,se,"f")),"f");else o(this,se,{...e(this,se,"f"),...n},"f")}async generateToolResponse(n=e(this,se,"f").signal){let t=await e(this,ie,"f")??this.params.messages.at(-1);if(!t)return null;return e(this,j,"m",Hi).call(this,t,n)}deferToolCall(n){let t=typeof n==="string"?n:n.id;if(e(this,$e,"f")&&!e(this,$e,"f").has(t))e(this,$e,"f").set(t,{status:"held"})}get deferredToolCalls(){let n=e(this,Je,"f"),t=e(this,$e,"f");if(!(n instanceof Mi)||!t)return[];return n.toolCalls.filter((i)=>t.get(i.id)?.status==="held")}done(){return e(this,Ge,"f").promise}async runUntilDone(){if(!e(this,Rt,"f"))for await(let n of this);return this.done()}get params(){return e(this,B,"f").params}pushMessages(...n){this.setMessagesParams((t)=>({...t,messages:[...t.messages,...n]}))}compactBeforeNextTurn(n){if(e(this,fe,"f").status==="in_flight")return;Bi(e(this,B,"f").params),o(this,fe,{status:"scheduled",config:n??{type:"summarize"}},"f")}addTools(...n){for(let t of n){if("name"in t)e(this,Tt,"f").set(t.name,"run"in t?t:null);e(this,at,"f").push({type:"addition",tool:t})}}removeTools(...n){for(let t of n){let i=typeof t==="string"?t:t.name;e(this,Tt,"f").set(i,null),e(this,at,"f").push({type:"removal",name:i})}}then(n,t){return this.runUntilDone().then(n,t)}}return Ni=async function*(t){if(await e(this,j,"m",Li).call(this),o(this,$e,void 0,"f"),t.stream)o(this,Je,e(this,B,"f").params.runToolsEagerly?e(this,j,"m",Ga).call(this,t):this.client.beta.messages.stream({...t},e(this,se,"f")),"f"),o(this,ie,e(this,Je,"f").finalMessage(),"f"),e(this,ie,"f").catch(()=>{}),yield e(this,Je,"f");else o(this,ie,this.client.beta.messages.create({...t,stream:!1},e(this,se,"f")),"f"),yield e(this,ie,"f")},Ga=function(t){let i=new Map;return o(this,$e,i,"f"),Mi.start(this.client.beta.messages,t,e(this,se,"f"),(a)=>{if(i.has(a.id))return;let l=nc(e(this,j,"m",Tr).call(this),e(this,j,"m",bs).call(this),a,e(this,se,"f"));l.catch(()=>{}),i.set(a.id,{status:"started",result:l})})},Li=async function(){let t=[...e(this,$e,"f")?.values()??[]].filter((i)=>i.status==="started");await Promise.allSettled(t.map((i)=>i.result))},$i=async function*(t){Bi(e(this,B,"f").params);let{max_iterations:i,runToolsEagerly:a,...l}=e(this,B,"f").params,u=Gl(l);o(this,fe,{status:"in_flight"},"f"),o(this,Le,void 0,"f");let d=e(this,ie,"f");try{yield*e(this,j,"m",Ni).call(this,{...u,compaction:t});let h=await e(this,ie,"f");if(h.content.some((g)=>g.type==="compaction"&&g.content))e(this,j,"m",Xa).call(this),e(this,B,"f").params.messages=[{role:h.role,content:h.content}];else N(this.client).warn("Compaction produced no summary; keeping the conversation as it is."),o(this,ie,d,"f")}finally{o(this,fe,{status:"idle"},"f")}},Tr=function(){let t=new Map;for(let i of e(this,B,"f").params.tools)if("run"in i)t.set(i.name,i);for(let[i,a]of e(this,Tt,"f"))if(a)t.set(i,a);else t.delete(i);return t},bs=function(){let t=new Set(e(this,j,"m",Tr).call(this).keys());for(let i of[...e(this,B,"f").params.messages,e(this,j,"m",Di).call(this)]){if(typeof i.content==="string")continue;for(let a of i.content)if(i.role==="system")tc(a,t);else if(i.role==="assistant"&&a.type==="compaction")for(let l of a.tool_changes??[])tc(l,t)}return t},Xa=function(){let t=e(this,j,"m",bs).call(this);for(let i of e(this,j,"m",Tr).call(this).keys())if(!t.has(i))e(this,Tt,"f").set(i,null)},Fi=async function*(){if(e(this,fe,"f").status!=="scheduled")return;let t=e(this,B,"f").params.messages.at(-1)?.content;if(Array.isArray(t)&&t.some((i)=>i.type==="tool_use")){N(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."),o(this,fe,{status:"idle"},"f");return}yield*e(this,j,"m",$i).call(this,e(this,fe,"f").config)},Hi=async function(t,i=e(this,se,"f").signal){if(e(this,Le,"f")!==void 0)return e(this,Le,"f");return o(this,Le,Xl(e(this,j,"m",Tr).call(this),e(this,j,"m",bs).call(this),t,{...e(this,se,"f"),signal:i},e(this,$e,"f")),"f"),e(this,Le,"f")},Qa=function(){if(e(this,It,"f")==="pause_turn"||e(this,at,"f").length===0)return;e(this,B,"f").params.messages.push(e(this,j,"m",Di).call(this)),o(this,at,[],"f")},Di=function(){let t=[];for(let i of e(this,at,"f")){if(i.type==="removal"){t.push({type:"tool_removal",tool:{type:"tool_reference",name:i.name}});continue}let a=i.tool;if("run"in i.tool){let{run:l,parse:u,close:d,...h}=i.tool;a=h}t.push({type:"tool_addition",tool:{type:"tool_definition",definition:a}})}return{role:"system",content:t}},s})();function Za(s){if("compaction"in s&&s.compaction!=null)throw new p("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead.")}function Jl(s){if("compactionControl"in s&&s.compactionControl!=null)throw new p("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted.")}function ec(s){if(s.runToolsEagerly&&!s.stream)throw TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole.")}function Bi(s){if(s.context_management?.edits?.some((n)=>n.type.startsWith("compact_")))throw new p("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first.")}function Gl(s){let{context_management:n,stop_sequences:t,output_format:i,...a}=s,l=({format:u,...d})=>d;if(a.tool_choice?.type==="any"||a.tool_choice?.type==="tool")delete a.tool_choice;if(a.output_config)a.output_config=l(a.output_config);if(Array.isArray(a.fallbacks))a.fallbacks=a.fallbacks.map((u)=>u.output_config?{...u,output_config:l(u.output_config)}:u);return a}async function Xl(s,n,t,i,a){if(!t||t.role!=="assistant"||!t.content||typeof t.content==="string")return null;let l=t.content.filter((d)=>d.type==="tool_use");if(l.length===0)return null;return{role:"user",content:await Promise.all(l.map((d)=>{let h=a?.get(d.id);if(h?.status==="started")return h.result;let g=nc(s,n,d,i);return a?.set(d.id,{status:"started",result:g}),g}))}}async function nc(s,n,t,i){let a=n.has(t.name)?s.get(t.name):void 0;if(!a)return Zl(t);try{let l=t.input;if("parse"in a&&a.parse)l=a.parse(l);let u=await a.run(l,{toolUse:t,toolUseBlock:t,signal:i?.signal});return{type:"tool_result",tool_use_id:t.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:t.id,content:l instanceof M?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}function Ql(s){return s}function Zl(s){return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0}}function tc(s,n){switch(s.type){case"tool_removal":case"tool_addition":eu(s,n);break}}function eu(s,n){let t=tu(s.tool);if(t===void 0)return;if(s.type==="tool_removal")n.delete(t);else n.add(t)}function tu(s){switch(s.type){case"tool_reference":return s.name;case"tool_definition":return"name"in s.definition?s.definition.name:void 0;default:return}}function rc(s){if(s===null)return"stop";switch(s){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return tr(s),"stop"}}var sc={},ru=["claude-mythos-preview","claude-opus-4-6"],ks=(()=>{class s extends E{constructor(){super(...arguments);this.batches=new gr(this._client)}create(n,t){let i=ic(n),{betas:a,user_profile_id:l,workspace_id:u,...d}=i;if(d.model in sc)console.warn(`The model '${d.model}' is deprecated and will reach end-of-life on ${sc[d.model]}
|
|
11
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(ru.includes(d.model)&&d.thinking&&d.thinking.type==="enabled")console.warn(`Using Claude with ${d.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let h=t?.timeout??this._client._options.timeout;if(!d.stream&&h==null){let x=Zn[d.model]??void 0;h=this._client.calculateNonstreamingTimeout(d.max_tokens,x)}let g=En(d.tools,d.messages);return this._client.post("/v1/messages?beta=true",{body:d,timeout:h??600000,...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-user-profile-id":l}:void 0,...u!=null?{"anthropic-workspace-id":u}:void 0},g,t?.headers]),stream:i.stream??!1})}parse(n,t){return t={...t,headers:f([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(n,t).then((i)=>Ai(i,n,{logger:this._client.logger??console}))}stream(n,t){return cs.createMessage(this,n,t)}countTokens(n,t){let i=ic(n),{betas:a,user_profile_id:l,workspace_id:u,...d}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:d,...t,headers:f([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString(),...l!=null?{"anthropic-user-profile-id":l}:void 0,...u!=null?{"anthropic-workspace-id":u}:void 0},t?.headers])})}toolRunner(n,t){return new Wi(this._client,n,t)}}return s.Batches=gr,s.BetaToolRunner=Wi,s.ToolError=M,s})();function ic(s){if(!s.output_format)return s;if(s.output_config?.format)throw new p("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:n,...t}=s;return{...t,output_config:{...s.output_config,format:n}}}class Pr extends E{retrieve(s,n){return this._client.get(m`/v1/organizations/api_keys/${s}?beta=true`,n)}update(s,n,t){return this._client.post(m`/v1/organizations/api_keys/${s}?beta=true`,{body:n,...t})}list(s={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",Z,{query:s,...n})}}class Cr extends E{retrieve(s){return this._client.get("/v1/organizations/compliance_settings?beta=true",s)}update(s,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:s,...n})}}class Or extends E{create(s,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:s,...n})}retrieve(s,n){return this._client.get(m`/v1/organizations/external_keys/${s}?beta=true`,n)}update(s,n,t){return this._client.post(m`/v1/organizations/external_keys/${s}?beta=true`,{body:n,...t})}list(s={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",I,{query:s,...n})}delete(s,n){return this._client.delete(m`/v1/organizations/external_keys/${s}?beta=true`,n)}validate(s,n){return this._client.post(m`/v1/organizations/external_keys/${s}/validate?beta=true`,n)}}class Mr extends E{create(s,n){return this._client.post("/v1/organizations/invites?beta=true",{body:s,...n})}retrieve(s,n){return this._client.get(m`/v1/organizations/invites/${s}?beta=true`,n)}list(s={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",Z,{query:s,...n})}delete(s,n){return this._client.delete(m`/v1/organizations/invites/${s}?beta=true`,n)}}class Nr extends E{list(s={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",I,{query:s,...n})}}class Lr extends E{retrieve(s,n){return this._client.get(m`/v1/organizations/users/${s}?beta=true`,n)}update(s,n,t){return this._client.post(m`/v1/organizations/users/${s}?beta=true`,{body:n,...t})}list(s={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",Z,{query:s,...n})}remove(s,n){return this._client.delete(m`/v1/organizations/users/${s}?beta=true`,n)}}class $r extends E{create(s,n){let{betas:t,...i}=s;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:i,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0},n?.headers])})}retrieve(s,n={},t){let{betas:i}=n??{};return this._client.get(m`/v1/organizations/federation_issuers/${s}?beta=true`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}update(s,n,t){let{betas:i,...a}=n;return this._client.post(m`/v1/organizations/federation_issuers/${s}?beta=true`,{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}list(s={},n){let{betas:t,...i}=s??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",I,{query:i,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0},n?.headers])})}archive(s,n={},t){let{betas:i}=n??{};return this._client.post(m`/v1/organizations/federation_issuers/${s}/archive?beta=true`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}}class Fr extends E{list(s,n={},t){let{betas:i,...a}=n??{};return this._client.getAPIList(m`/v1/organizations/federation_rules/${s}/workspaces?beta=true`,I,{query:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(s,n,t){let{betas:i,...a}=n;return this._client.post(m`/v1/organizations/federation_rules/${s}/workspaces?beta=true`,{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(s,n,t){let{federation_rule_id:i,betas:a}=n;return this._client.delete(m`/v1/organizations/federation_rules/${i}/workspaces/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var Ss=(()=>{class s extends E{constructor(){super(...arguments);this.workspaces=new Fr(this._client)}create(n,t){let{betas:i,...a}=n;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a}=t??{};return this._client.get(m`/v1/organizations/federation_rules/${n}?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}update(n,t,i){let{betas:a,...l}=t;return this._client.post(m`/v1/organizations/federation_rules/${n}?beta=true`,{body:l,...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}list(n={},t){let{betas:i,...a}=n??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",I,{query:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}archive(n,t={},i){let{betas:a}=t??{};return this._client.post(m`/v1/organizations/federation_rules/${n}/archive?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}return s.Workspaces=Fr,s})();var vs=(()=>{class s extends E{constructor(){super(...arguments);this.issuers=new $r(this._client),this.rules=new Ss(this._client)}}return s.Issuers=$r,s.Rules=Ss,s})();class Hr extends E{list(s,n={},t){let{betas:i,...a}=n??{};return this._client.getAPIList(m`/v1/organizations/service_accounts/${s}/workspaces?beta=true`,I,{query:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(s,n,t){let{betas:i,...a}=n;return this._client.post(m`/v1/organizations/service_accounts/${s}/workspaces?beta=true`,{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(s,n,t){let{service_account_id:i,betas:a}=n;return this._client.delete(m`/v1/organizations/service_accounts/${i}/workspaces/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var xs=(()=>{class s extends E{constructor(){super(...arguments);this.workspaces=new Hr(this._client)}create(n,t){let{betas:i,...a}=n;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a}=t??{};return this._client.get(m`/v1/organizations/service_accounts/${n}?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}update(n,t,i){let{betas:a,...l}=t;return this._client.post(m`/v1/organizations/service_accounts/${n}?beta=true`,{body:l,...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}list(n={},t){let{betas:i,...a}=n??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",I,{query:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}archive(n,t={},i){let{betas:a}=t??{};return this._client.post(m`/v1/organizations/service_accounts/${n}/archive?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}return s.Workspaces=Hr,s})();class Dr extends E{retrieve(s,n,t){let{workspace_id:i}=n;return this._client.get(m`/v1/organizations/workspaces/${i}/members/${s}?beta=true`,t)}update(s,n,t){let{workspace_id:i,...a}=n;return this._client.post(m`/v1/organizations/workspaces/${i}/members/${s}?beta=true`,{body:a,...t})}list(s,n={},t){return this._client.getAPIList(m`/v1/organizations/workspaces/${s}/members?beta=true`,Z,{query:n,...t})}add(s,n,t){return this._client.post(m`/v1/organizations/workspaces/${s}/members?beta=true`,{body:n,...t})}remove(s,n,t){let{workspace_id:i}=n;return this._client.delete(m`/v1/organizations/workspaces/${i}/members/${s}?beta=true`,t)}}class Br extends E{list(s,n={},t){return this._client.getAPIList(m`/v1/organizations/workspaces/${s}/rate_limits?beta=true`,I,{query:n,...t})}}class Wr extends E{retrieve(s,n,t){let{workspace_id:i,betas:a}=n;return this._client.get(m`/v1/organizations/workspaces/${i}/service_accounts/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}update(s,n,t){let{workspace_id:i,betas:a,...l}=n;return this._client.post(m`/v1/organizations/workspaces/${i}/service_accounts/${s}?beta=true`,{body:l,...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,...a}=n??{};return this._client.getAPIList(m`/v1/organizations/workspaces/${s}/service_accounts?beta=true`,I,{query:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(s,n,t){let{betas:i,...a}=n;return this._client.post(m`/v1/organizations/workspaces/${s}/service_accounts?beta=true`,{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(s,n,t){let{workspace_id:i,betas:a}=n;return this._client.delete(m`/v1/organizations/workspaces/${i}/service_accounts/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var Es=(()=>{class s extends E{constructor(){super(...arguments);this.rateLimits=new Br(this._client),this.members=new Dr(this._client),this.serviceAccounts=new Wr(this._client)}create(n,t){let{betas:i,...a}=n;return this._client.post("/v1/organizations/workspaces?beta=true",{body:a,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(n,t){return this._client.get(m`/v1/organizations/workspaces/${n}?beta=true`,t)}update(n,t,i){return this._client.post(m`/v1/organizations/workspaces/${n}?beta=true`,{body:t,...i})}list(n={},t){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",Z,{query:n,...t})}archive(n,t){return this._client.post(m`/v1/organizations/workspaces/${n}/archive?beta=true`,t)}}return s.RateLimits=Br,s.Members=Dr,s.ServiceAccounts=Wr,s})();var As=(()=>{class s extends E{constructor(){super(...arguments);this.apiKeys=new Pr(this._client),this.externalKeys=new Or(this._client),this.federation=new vs(this._client),this.invites=new Mr(this._client),this.serviceAccounts=new xs(this._client),this.users=new Lr(this._client),this.workspaces=new Es(this._client),this.rateLimits=new Nr(this._client),this.complianceSettings=new Cr(this._client)}retrieve(n){return this._client.get("/v1/organizations/me?beta=true",n)}}return s.APIKeys=Pr,s.ExternalKeys=Or,s.Federation=vs,s.Invites=Mr,s.ServiceAccounts=xs,s.Users=Lr,s.Workspaces=Es,s.RateLimits=Nr,s.ComplianceSettings=Cr,s})();var Rs=(()=>{class s extends E{list(n,t={},i){let{betas:a,workspace_id:l,...u}=t??{};return this._client.getAPIList(m`/v1/sessions/${n}/events?beta=true`,I,{query:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}send(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/sessions/${n}/events?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}stream(n,t={},i){let{betas:a,workspace_id:l,...u}=t??{};return this._client.get(m`/v1/sessions/${n}/events/stream?beta=true`,{query:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers]),stream:!0})}toolRunner(n,t){return new dr(n,{...t,client:this._client})}}return s.SessionToolRunner=dr,s})();class Ur extends E{retrieve(s,n,t){let{session_id:i,betas:a,workspace_id:l}=n;return this._client.get(m`/v1/sessions/${i}/resources/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}update(s,n,t){let{session_id:i,betas:a,workspace_id:l,...u}=n;return this._client.post(m`/v1/sessions/${i}/resources/${s}?beta=true`,{body:u,...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/sessions/${s}/resources?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(s,n,t){let{session_id:i,betas:a,workspace_id:l}=n;return this._client.delete(m`/v1/sessions/${i}/resources/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}add(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/sessions/${s}/resources?beta=true`,{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}class jr extends E{list(s,n,t){let{session_id:i,betas:a,workspace_id:l,...u}=n;return this._client.getAPIList(m`/v1/sessions/${i}/threads/${s}/events?beta=true`,I,{query:u,...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}stream(s,n,t){let{session_id:i,betas:a,workspace_id:l,...u}=n;return this._client.get(m`/v1/sessions/${i}/threads/${s}/stream?beta=true`,{query:u,...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers]),stream:!0})}}var Is=(()=>{class s extends E{constructor(){super(...arguments);this.events=new jr(this._client)}retrieve(n,t,i){let{session_id:a,betas:l,workspace_id:u}=t;return this._client.get(m`/v1/sessions/${a}/threads/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},i?.headers])})}list(n,t={},i){let{betas:a,workspace_id:l,...u}=t??{};return this._client.getAPIList(m`/v1/sessions/${n}/threads?beta=true`,I,{query:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}archive(n,t,i){let{session_id:a,betas:l,workspace_id:u}=t;return this._client.post(m`/v1/sessions/${a}/threads/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString(),...u!=null?{"anthropic-workspace-id":u}:void 0},i?.headers])})}}return s.Events=jr,s})();var Ts=(()=>{class s extends E{constructor(){super(...arguments);this.events=new Rs(this._client),this.resources=new Ur(this._client),this.threads=new Is(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/sessions?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/sessions/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/sessions/${n}?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/sessions?beta=true",di,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.delete(m`/v1/sessions/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/sessions/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Events=Rs,s.Resources=Ur,s.Threads=Is,s})();class qr extends E{create(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/skills/${s}/versions?beta=true`,we({body:l,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])},this._client,!1))}retrieve(s,n,t){let{skill_id:i,betas:a,workspace_id:l}=n;return this._client.get(m`/v1/skills/${i}/versions/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/skills/${s}/versions?beta=true`,I,{query:l,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(s,n,t){let{skill_id:i,betas:a,workspace_id:l}=n;return this._client.delete(m`/v1/skills/${i}/versions/${s}?beta=true`,{...t,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}download(s,n,t){let{skill_id:i,betas:a,workspace_id:l}=n;return this._client.get(m`/v1/skills/${i}/versions/${s}/content?beta=true`,{...t,headers:f([{Accept:"application/binary",...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers]),__binaryResponse:!0})}}var Ps=(()=>{class s extends E{constructor(){super(...arguments);this.versions=new qr(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/skills?beta=true",we({body:l,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])},this._client,!1))}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/skills/${n}?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/skills?beta=true",I,{query:l,...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.delete(m`/v1/skills/${n}?beta=true`,{...i,headers:f([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Versions=qr,s})();class Kr extends E{create(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/tunnels/${s}/certificates?beta=true`,{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(s,n,t){let{tunnel_id:i,betas:a,workspace_id:l}=n;return this._client.get(m`/v1/tunnels/${i}/certificates/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/tunnels/${s}/certificates?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(s,n,t){let{tunnel_id:i,betas:a,workspace_id:l}=n;return this._client.post(m`/v1/tunnels/${i}/certificates/${s}/archive?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}}var Cs=(()=>{class s extends E{constructor(){super(...arguments);this.certificates=new Kr(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/tunnels?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/tunnels/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/tunnels?beta=true",I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/tunnels/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}revealToken(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/tunnels/${n}/reveal_token?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}rotateToken(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/tunnels/${n}/rotate_token?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Certificates=Kr,s})();class zr extends E{create(s,n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post(m`/v1/vaults/${s}/credentials?beta=true`,{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(s,n,t){let{vault_id:i,betas:a,workspace_id:l}=n;return this._client.get(m`/v1/vaults/${i}/credentials/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}update(s,n,t){let{vault_id:i,betas:a,workspace_id:l,...u}=n;return this._client.post(m`/v1/vaults/${i}/credentials/${s}?beta=true`,{body:u,...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(s,n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList(m`/v1/vaults/${s}/credentials?beta=true`,I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(s,n,t){let{vault_id:i,betas:a,workspace_id:l}=n;return this._client.delete(m`/v1/vaults/${i}/credentials/${s}?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}archive(s,n,t){let{vault_id:i,betas:a,workspace_id:l}=n;return this._client.post(m`/v1/vaults/${i}/credentials/${s}/archive?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}mcpOAuthValidate(s,n,t){let{vault_id:i,betas:a,workspace_id:l}=n;return this._client.post(m`/v1/vaults/${i}/credentials/${s}/mcp_oauth_validate?beta=true`,{...t,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}}var Os=(()=>{class s extends E{constructor(){super(...arguments);this.credentials=new zr(this._client)}create(n,t){let{betas:i,workspace_id:a,...l}=n;return this._client.post("/v1/vaults?beta=true",{body:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.get(m`/v1/vaults/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(n,t,i){let{betas:a,workspace_id:l,...u}=t;return this._client.post(m`/v1/vaults/${n}?beta=true`,{body:u,...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(n={},t){let{betas:i,workspace_id:a,...l}=n??{};return this._client.getAPIList("/v1/vaults?beta=true",I,{query:l,...t,headers:f([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.delete(m`/v1/vaults/${n}?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}archive(n,t={},i){let{betas:a,workspace_id:l}=t??{};return this._client.post(m`/v1/vaults/${n}/archive?beta=true`,{...i,headers:f([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return s.Credentials=zr,s})();var Vr=(()=>{class s extends E{constructor(){super(...arguments);this.models=new Vt(this._client),this.messages=new ks(this._client),this.agents=new Tn(this._client),this.environments=new Jn(this._client),this.sessions=new Ts(this._client),this.deployments=new jt(this._client),this.deploymentRuns=new Ut(this._client),this.vaults=new Os(this._client),this.memoryStores=new Gn(this._client),this.files=new zt(this._client),this.skills=new Ps(this._client),this.webhooks=new Xt(this._client),this.userProfiles=new Yt(this._client),this.dreams=new qt(this._client),this.tunnels=new Cs(this._client),this.organization=new As(this._client)}}return s.Models=Vt,s.Messages=ks,s.Agents=Tn,s.Environments=Jn,s.Sessions=Ts,s.Deployments=jt,s.DeploymentRuns=Ut,s.Vaults=Os,s.MemoryStores=Gn,s.Files=zt,s.Skills=Ps,s.Webhooks=Xt,s.UserProfiles=Yt,s.Dreams=qt,s.Tunnels=Cs,s.Organization=As,s})();class Pt extends E{create(s,n){let{betas:t,workspace_id:i,...a}=s;return this._client.post("/v1/complete",{body:a,timeout:this._client._options.timeout??600000,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),stream:s.stream??!1})}}class Ot extends E{list(s={},n){let{workspace_id:t,...i}=s??{};return this._client.getAPIList("/v1/files",I,{query:i,...n,headers:f([{...t!=null?{"anthropic-workspace-id":t}:void 0},n?.headers])})}delete(s,n={},t){let{workspace_id:i}=n??{};return this._client.delete(m`/v1/files/${s}`,{...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}download(s,n={},t){let{workspace_id:i}=n??{};return this._client.get(m`/v1/files/${s}/content`,{...t,headers:f([{Accept:"application/binary",...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers]),__binaryResponse:!0})}retrieveMetadata(s,n={},t){let{workspace_id:i}=n??{};return this._client.get(m`/v1/files/${s}`,{...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}upload(s,n){let{workspace_id:t,...i}=s;return this._client.post("/v1/files",we({body:i,...n,headers:f([{...t!=null?{"anthropic-workspace-id":t}:void 0},An(i.file),n?.headers])},this._client))}}function oc(s){return s?.output_config?.format}function Ui(s,n,t){let i=oc(n);if(!n||!("parse"in(i??{})))return{...s,content:s.content.map((a)=>{if(a.type==="text")return Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return a}),parsed_output:null};return ji(s,n,t)}function ji(s,n,t){let i=null,a=s.content.map((l)=>{if(l.type==="text"){let u=Ou(n,l.text);if(i===null)i=u;return Object.defineProperty({...l},"parsed_output",{value:u,enumerable:!1})}return l});return{...s,content:a,parsed_output:i}}function Ou(s,n){let t=oc(s);if(t?.type!=="json_schema")return null;try{if("parse"in t)return t.parse(n);return JSON.parse(n)}catch(i){throw new p(`Failed to parse structured output: ${i}`)}}var Ee,Xe,Mt,Jr,Ms,Xr,Qr,Ns,Zr,Fe,en,Ls,$s,ct,Fs,Hs,Ds,tn,qi,ac,Ki,zi,Vi,Yi,cc;function Ji(s){return s.type==="tool_use"||s.type==="server_tool_use"}var lc=(()=>{class s{constructor(n,t){Ee.add(this),this.messages=[],this.receivedMessages=[],Xe.set(this,void 0),Mt.set(this,null),this.controller=new AbortController,Jr.set(this,void 0),Ms.set(this,()=>{}),Xr.set(this,()=>{}),Qr.set(this,void 0),Ns.set(this,()=>{}),Zr.set(this,()=>{}),Fe.set(this,{}),en.set(this,!1),Ls.set(this,!1),$s.set(this,!1),ct.set(this,!1),Fs.set(this,void 0),Hs.set(this,void 0),Ds.set(this,void 0),tn.set(this,void 0),Ki.set(this,(i)=>{if(o(this,Ls,!0,"f"),wt(i))i=new je;if(i instanceof je)return o(this,$s,!0,"f"),this._emit("abort",i);if(i instanceof p)return this._emit("error",i);if(i instanceof Error){let a=new p(i.message);return a.cause=i,this._emit("error",a)}return this._emit("error",new p(String(i)))}),o(this,Jr,new Promise((i,a)=>{o(this,Ms,i,"f"),o(this,Xr,a,"f")}),"f"),o(this,Qr,new Promise((i,a)=>{o(this,Ns,i,"f"),o(this,Zr,a,"f")}),"f"),e(this,Jr,"f").catch(()=>{}),e(this,Qr,"f").catch(()=>{}),o(this,Mt,n,"f"),o(this,tn,t?.logger??console,"f")}get response(){return e(this,Fs,"f")}get request_id(){return e(this,Hs,"f")}get workspace_id(){return e(this,Ds,"f")}async withResponse(){o(this,ct,!0,"f");let n=await e(this,Jr,"f");if(!n)throw Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let t=new s(null);return t._run(()=>t._fromReadableStream(n)),t}static createMessage(n,t,i,{logger:a}={}){let l=new s(t,{logger:a});for(let u of t.messages)l._addMessageParam(u);return o(l,Mt,{...t,stream:!0},"f"),l._run(()=>l._createMessage(n,{...t,stream:!0},{...i,headers:{...i?.headers,[dt]:"stream"}})),l}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},e(this,Ki,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,t=!0){if(this.receivedMessages.push(n),t)this._emit("message",n)}async _createMessage(n,t,i){let a=i?.signal,l;if(a){if(a.aborted)this.controller.abort();l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l)}try{e(this,Ee,"m",zi).call(this);let{response:u,data:d}=await n.create({...t,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(u);for await(let h of d)e(this,Ee,"m",Vi).call(this,h);if(d.controller.signal?.aborted)throw new je;e(this,Ee,"m",Yi).call(this)}finally{if(a&&l)a.removeEventListener("abort",l)}}_connected(n){if(this.ended)return;o(this,Fs,n,"f"),o(this,Hs,n?.headers.get("request-id"),"f"),o(this,Ds,n?.headers.get("anthropic-workspace-id"),"f"),e(this,Ms,"f").call(this,n),this._emit("connect")}get ended(){return e(this,en,"f")}get errored(){return e(this,Ls,"f")}get aborted(){return e(this,$s,"f")}abort(){this.controller.abort()}on(n,t){return(e(this,Fe,"f")[n]||(e(this,Fe,"f")[n]=[])).push({listener:t}),this}off(n,t){let i=e(this,Fe,"f")[n];if(!i)return this;let a=i.findIndex((l)=>l.listener===t);if(a>=0)i.splice(a,1);return this}once(n,t){return(e(this,Fe,"f")[n]||(e(this,Fe,"f")[n]=[])).push({listener:t,once:!0}),this}emitted(n){return new Promise((t,i)=>{if(o(this,ct,!0,"f"),n!=="error")this.once("error",i);this.once(n,t)})}async done(){o(this,ct,!0,"f"),await e(this,Qr,"f")}get currentMessage(){return e(this,Xe,"f")}async finalMessage(){return await this.done(),e(this,Ee,"m",qi).call(this)}async finalText(){return await this.done(),e(this,Ee,"m",ac).call(this)}_emit(n,...t){if(e(this,en,"f"))return;if(n==="end")o(this,en,!0,"f"),e(this,Ns,"f").call(this);let i=e(this,Fe,"f")[n];if(i)e(this,Fe,"f")[n]=i.filter((a)=>!a.once),i.forEach(({listener:a})=>a(...t));if(n==="abort"){let a=t[0];if(!e(this,ct,"f")&&!i?.length)Promise.reject(a);e(this,Xr,"f").call(this,a),e(this,Zr,"f").call(this,a),this._emit("end");return}if(n==="error"){let a=t[0];if(!e(this,ct,"f")&&!i?.length)Promise.reject(a);e(this,Xr,"f").call(this,a),e(this,Zr,"f").call(this,a),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",e(this,Ee,"m",qi).call(this))}async _fromReadableStream(n,t){let i=t?.signal,a;if(i){if(i.aborted)this.controller.abort();a=this.controller.abort.bind(this.controller),i.addEventListener("abort",a)}try{e(this,Ee,"m",zi).call(this),this._connected(null);let l=Me.fromReadableStream(n,this.controller);for await(let u of l)e(this,Ee,"m",Vi).call(this,u);if(l.controller.signal?.aborted)throw new je;e(this,Ee,"m",Yi).call(this)}finally{if(i&&a)i.removeEventListener("abort",a)}}[(Xe=new WeakMap,Mt=new WeakMap,Jr=new WeakMap,Ms=new WeakMap,Xr=new WeakMap,Qr=new WeakMap,Ns=new WeakMap,Zr=new WeakMap,Fe=new WeakMap,en=new WeakMap,Ls=new WeakMap,$s=new WeakMap,ct=new WeakMap,Fs=new WeakMap,Hs=new WeakMap,Ds=new WeakMap,tn=new WeakMap,Ki=new WeakMap,Ee=new WeakSet,qi=function(){if(this.receivedMessages.length===0)throw new p("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ac=function(){if(this.receivedMessages.length===0)throw new p("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((i)=>i.type==="text").map((i)=>i.text);if(t.length===0)throw new p("stream ended without producing a content block with type=text");return t.join(" ")},zi=function(){if(this.ended)return;o(this,Xe,void 0,"f")},Vi=function(t){if(this.ended)return;let i=e(this,Ee,"m",cc).call(this,t);switch(this._emit("streamEvent",t,i),t.type){case"content_block_delta":{let a=i.content.at(-1);switch(t.delta.type){case"text_delta":{if(a.type==="text")this._emit("text",t.delta.text,a.text||"");break}case"citations_delta":{if(a.type==="text")this._emit("citation",t.delta.citation,a.citations??[]);break}case"input_json_delta":{if(Ji(a)&&e(this,Fe,"f").inputJson?.length)this._emit("inputJson",t.delta.partial_json,a.input);break}case"thinking_delta":{if(a.type==="thinking")this._emit("thinking",t.delta.thinking,a.thinking);break}case"signature_delta":{if(a.type==="thinking")this._emit("signature",a.signature);break}default:tr(t.delta)}break}case"message_stop":{this._addMessageParam(i),this._addMessage(Ui(i,e(this,Mt,"f"),{logger:e(this,tn,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{o(this,Xe,i,"f");break}case"content_block_start":case"message_delta":break}},Yi=function(){if(this.ended)throw new p("stream has ended, this shouldn't happen");let t=e(this,Xe,"f");if(!t)throw new p("request ended without sending any chunks");return o(this,Xe,void 0,"f"),Ui(t,e(this,Mt,"f"),{logger:e(this,tn,"f")})},cc=function(t){let i=e(this,Xe,"f");if(t.type==="message_start"){if(i)throw new p(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!i)throw new p(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return i;case"message_delta":if(i.stop_reason=t.delta.stop_reason,i.stop_sequence=t.delta.stop_sequence,i.stop_details=t.delta.stop_details,i.usage.output_tokens=t.usage.output_tokens,t.delta.container!=null)i.container=t.delta.container;if(t.usage.input_tokens!=null)i.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)i.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)i.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)i.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.output_tokens_details!=null)i.usage.output_tokens_details=t.usage.output_tokens_details;return i;case"content_block_start":return i.content.push({...t.content_block}),i;case"content_block_delta":{let a=i.content.at(t.index);switch(t.delta.type){case"text_delta":{if(a?.type==="text")i.content[t.index]={...a,text:(a.text||"")+t.delta.text};break}case"citations_delta":{if(a?.type==="text")i.content[t.index]={...a,citations:[...a.citations??[],t.delta.citation]};break}case"input_json_delta":{if(a&&Ji(a)){let l=(a[Ve]||"")+t.delta.partial_json;i.content[t.index]=es(a,l)}break}case"thinking_delta":{if(a?.type==="thinking")i.content[t.index]={...a,thinking:a.thinking+t.delta.thinking};break}case"signature_delta":{if(a?.type==="thinking")i.content[t.index]={...a,signature:t.delta.signature};break}default:tr(t.delta)}return i}case"content_block_stop":{let a=i.content.at(t.index);if(a&&Ji(a)&&Ve in a)Object.defineProperty(a,"input",{value:a.input,enumerable:!0,configurable:!0,writable:!0});return i}}},Symbol.asyncIterator)](){let n=[],t=[],i=!1;return this.on("streamEvent",(a)=>{let l=t.shift();if(l)l.resolve(a);else n.push(a)}),this.on("end",()=>{i=!0;for(let a of t)a.resolve(void 0);t.length=0}),this.on("abort",(a)=>{i=!0;for(let l of t)l.reject(a);t.length=0}),this.on("error",(a)=>{i=!0;for(let l of t)l.reject(a);t.length=0}),{next:async()=>{if(!n.length){if(i)return{value:void 0,done:!0};return new Promise((l,u)=>t.push({resolve:l,reject:u})).then((l)=>l?{value:l,done:!1}:{value:void 0,done:!0})}return{value:n.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Me(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return s})();class rn extends E{create(s,n){let{user_profile_id:t,workspace_id:i,...a}=s;return this._client.post("/v1/messages/batches",{body:a,...n,headers:f([{...t!=null?{"anthropic-user-profile-id":t}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(s,n={},t){let{workspace_id:i}=n??{};return this._client.get(m`/v1/messages/batches/${s}`,{...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}list(s={},n){let{workspace_id:t,...i}=s??{};return this._client.getAPIList("/v1/messages/batches",Z,{query:i,...n,headers:f([{...t!=null?{"anthropic-workspace-id":t}:void 0},n?.headers])})}delete(s,n={},t){let{workspace_id:i}=n??{};return this._client.delete(m`/v1/messages/batches/${s}`,{...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}cancel(s,n={},t){let{workspace_id:i}=n??{};return this._client.post(m`/v1/messages/batches/${s}/cancel`,{...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}async results(s,n={},t){let i=await this.retrieve(s,n,t);if(!i.results_url)throw new p(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{workspace_id:a}=n??{};return this._client.get(i.results_url,{...t,headers:f([{Accept:"application/binary",...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((l,u)=>Xn.fromResponse(u.response,u.controller))}}var nn=(()=>{class s extends E{constructor(){super(...arguments);this.batches=new rn(this._client)}create(n,t){let{user_profile_id:i,workspace_id:a,...l}=n;if(l.model in uc)console.warn(`The model '${l.model}' is deprecated and will reach end-of-life on ${uc[l.model]}
|
|
12
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Nu.includes(l.model)&&l.thinking&&l.thinking.type==="enabled")console.warn(`Using Claude with ${l.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let u=t?.timeout??this._client._options.timeout;if(!l.stream&&u==null){let h=Zn[l.model]??void 0;u=this._client.calculateNonstreamingTimeout(l.max_tokens,h)}let d=En(l.tools,l.messages);return this._client.post("/v1/messages",{body:l,timeout:u??600000,...t,headers:f([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},d,t?.headers]),stream:n.stream??!1})}parse(n,t){return this.create(n,t).then((i)=>ji(i,n,{logger:this._client.logger??console}))}stream(n,t){return lc.createMessage(this,n,t,{logger:this._client.logger??console})}countTokens(n,t){let{user_profile_id:i,workspace_id:a,...l}=n;return this._client.post("/v1/messages/count_tokens",{body:l,...t,headers:f([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}return s.Batches=rn,s})(),uc={},Nu=["claude-mythos-preview","claude-opus-4-6"];class Nt extends E{retrieve(s,n={},t){let{betas:i,workspace_id:a}=n??{};return this._client.get(m`/v1/models/${s}`,{...t,headers:f([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s={},n){let{betas:t,workspace_id:i,...a}=s??{};return this._client.getAPIList("/v1/models",Z,{query:a,...n,headers:f([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}class sn extends E{create(s,n,t){let{workspace_id:i,...a}=n;return this._client.post(m`/v1/skills/${s}/versions`,we({body:a,...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])},this._client,!1))}retrieve(s,n,t){let{skill_id:i,workspace_id:a}=n;return this._client.get(m`/v1/skills/${i}/versions/${s}`,{...t,headers:f([{...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(s,n={},t){let{workspace_id:i,...a}=n??{};return this._client.getAPIList(m`/v1/skills/${s}/versions`,I,{query:a,...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}delete(s,n,t){let{skill_id:i,workspace_id:a}=n;return this._client.delete(m`/v1/skills/${i}/versions/${s}`,{...t,headers:f([{...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var on=(()=>{class s extends E{constructor(){super(...arguments);this.versions=new sn(this._client)}create(n,t){let{workspace_id:i,...a}=n;return this._client.post("/v1/skills",we({body:a,...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])},this._client,!1))}retrieve(n,t={},i){let{workspace_id:a}=t??{};return this._client.get(m`/v1/skills/${n}`,{...i,headers:f([{...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(n={},t){let{workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/skills",I,{query:a,...t,headers:f([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}delete(n,t={},i){let{workspace_id:a}=t??{};return this._client.delete(m`/v1/skills/${n}`,{...i,headers:f([{...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}return s.Versions=sn,s})();var Gi,Xi,Bs,dc,Fu="\\n\\nHuman:",Hu="\\n\\nAssistant:",Du=(()=>{class s{get credentials(){return this._authState.provider}constructor({baseURL:n=U("ANTHROPIC_BASE_URL"),apiKey:t,authToken:i,webhookKey:a=U("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...l}={}){if(Gi.add(this),this._requestAuthFlags=new WeakMap,Bs.set(this,void 0),t===void 0)t=l.profile!=null?null:U("ANTHROPIC_API_KEY")??null;if(i===void 0)i=l.profile!=null?null:U("ANTHROPIC_AUTH_TOKEN")??null;if(l.profile!=null&&(l.credentials!=null||l.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let u={apiKey:t,authToken:i,webhookKey:a,...l,baseURL:n||"https://api.anthropic.com"};if(!u.dangerouslyAllowBrowser&&ao())throw new p(`It looks like you're running in a browser-like environment.
|
|
13
|
+
|
|
14
|
+
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
15
|
+
If you understand the risks and have appropriate mitigations in place,
|
|
16
|
+
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
17
|
+
|
|
18
|
+
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
19
|
+
`);this.baseURL=u.baseURL,this._baseURLIsExplicit=l.__baseURLIsExplicit??!!n,this.timeout=u.timeout??Xi.DEFAULT_TIMEOUT,this.logger=u.logger??console,this.logLevel=Hn,this.logLevel=ri(u.logLevel,"ClientOptions.logLevel",N(this))??ri(U("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",N(this))??Hn,this.fetchOptions=u.fetchOptions,this.maxRetries=ei("maxRetries",u.maxRetries??2),this.fetch=u.fetch??fo(),o(this,Bs,mo,"f"),this.middleware=[...u.middleware??[]];let d=U("ANTHROPIC_CUSTOM_HEADERS");if(d){let g={};for(let x of d.split(`
|
|
20
|
+
`)){let _=x.indexOf(":");if(_>=0)g[x.substring(0,_).trim()]=x.substring(_+1).trim()}u.defaultHeaders={...g,...u.defaultHeaders}}let h=l.__auth;if(delete u.__auth,delete u.__baseURLIsExplicit,this._options=u,this.apiKey=typeof t==="string"?t:null,this.authToken=i,this.webhookKey=a,h){if(this._authState=h,!this._baseURLIsExplicit&&h.baseURL)this.baseURL=h.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let g=u.credentials??null;if(g)this._authState.provider=g,this._authState.tokenCache=this._makeTokenCache(g);else if(u.config!=null){let x=ai(u.config,this._credentialResolverOptions());this._authState.provider=x.provider,this._authState.tokenCache=this._makeTokenCache(x.provider),this._authState.extraHeaders=x.extraHeaders,this._applyCredentialBaseURL(x.baseURL)}else if(u.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(u.profile);else if(this._shouldResolveDefaultCredentials())this._authState.resolution=this._resolveDefaultCredentials()}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(n){if(!n)return;let t=n.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:(n)=>{N(this).debug("credential cache write failed (best-effort)",n)},onSafetyWarning:(n)=>{N(this).warn(n)}}}_credentialsFetch(){return li(this.fetch,this.middleware,void 0,this)}_makeTokenCache(n){return new Zs(n,(t)=>{N(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(n){let t="credentials"in n||"config"in n||"profile"in n,i="apiKey"in n||"authToken"in n||t,a={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...n,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in n?!0:this._baseURLIsExplicit};return new this.constructor(a)}async _resolveDefaultCredentials(n){try{let t=await Uo(this._credentialResolverOptions(),n);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(n!=null)throw new p(`Profile "${n}" could not be resolved (no <config_dir>/configs/${n}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:t}){if(n.get("x-api-key")||n.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&n.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&n.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(n){let t=this._requestAuthFlags.get(n);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(n,t);return t}async authHeaders(n){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(n).usedTokenCache=!0,f([{Authorization:`Bearer ${t}`}])}return f([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey==null)return;return f([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken==null)return;return f([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return xo(n)}getUserAgent(){return`Anthropic/JS ${ge}`}makeStatusError(n,t,i,a){return le.generate(n,t,i,a)}buildURL(n,t,i){let a=!e(this,Gi,"m",dc).call(this)&&i||this.baseURL,l=pa(n)?new URL(n):new URL(a+(a.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery(),d=Object.fromEntries(l.searchParams);if(!hs(u)||!hs(d))t={...d,...u,...t};if(typeof t==="object"&&t&&!Array.isArray(t))l.search=this.stringifyQuery(t);return l.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128000>600)throw new p("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(n){}async prepareRequest(n,{url:t,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let a=n.headers instanceof Headers?n.headers:new Headers(n.headers);for(let[u,d]of Object.entries(this._authState.extraHeaders))if(!a.has(u))a.set(u,d);let l=a.get("anthropic-beta")?.split(",").map((u)=>u.trim());if(!l?.includes(Ze))a.set("anthropic-beta",[...l??[],Ze].join(","));n.headers=a}}backendMiddleware(){return[]}get(n,t){return this.methodRequest("get",n,t)}post(n,t){return this.methodRequest("post",n,t)}patch(n,t){return this.methodRequest("patch",n,t)}put(n,t){return this.methodRequest("put",n,t)}delete(n,t){return this.methodRequest("delete",n,t)}methodRequest(n,t,i){return this.request(Promise.resolve(i).then((a)=>({method:n,path:t,...a})))}request(n,t=null){return new bn(this,this.makeRequest(n,t,void 0))}async makeRequest(n,t,i){let a=await n,l=ei("maxRetries",a.maxRetries??this.maxRetries);if(this.isStreamBody(a.body))l=0;if(t==null)t=l,this._requestAuthFlags.delete(a);await this.prepareOptions(a);let{req:u,url:d,timeout:h}=await this.buildRequest(a,{retryCount:l-t}),g="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),x=i===void 0?"":`, retryOf: ${i}`,_=Date.now();if(a.signal?.aborted)throw new je;let b=new AbortController,w=await this.fetchWithTimeout(d,u,h,b,a,{requestLogID:g,retryOfRequestLogID:i}).catch(Sr),S=Date.now();if(w instanceof globalThis.Error){Ce(b);let R=`retrying, ${t} attempts remaining`;if(a.signal?.aborted)throw new je;let y=wt(w)||/timed? ?out/i.test(String(w)+("cause"in w?String(w.cause):"")),P=this.middleware.length>0||!!a.middleware?.length||this.backendMiddleware().length>0;if(P&&!y&&!sa(w))throw N(this).info(`[${g}] middleware error (not retryable)`),Ct(N(this),`[${g}] middleware error (not retryable)`,{retryOfRequestLogID:i,url:d,durationMs:S-_,message:w.message}),w;if(t)return N(this).info(`[${g}] connection ${y?"timed out":"failed"} - ${R}`),Ct(N(this),`[${g}] connection ${y?"timed out":"failed"} (${R})`,{retryOfRequestLogID:i,url:d,durationMs:S-_,message:w.message}),this.retryRequest(a,t,i??g);if(N(this).info(`[${g}] connection ${y?"timed out":"failed"} - error; no more retries left`),Ct(N(this),`[${g}] connection ${y?"timed out":"failed"} (error; no more retries left)`,{retryOfRequestLogID:i,url:d,durationMs:S-_,message:w.message}),y)throw new qo;if(P&&!ci(w))throw w;throw new er({cause:w})}let T=[...w.headers.entries()].filter(([R])=>R==="request-id"||R==="anthropic-workspace-id").map(([R,y])=>", "+R+": "+JSON.stringify(y)).join(""),k=`[${g}${x}${T}] ${u.method} ${d} ${w.ok?"succeeded":"failed"} with status ${w.status} in ${S-_}ms`;if(!w.ok){let R=await this.shouldRetry(w,a);if(t&&R){let L=`retrying, ${t} attempts remaining`;return await po(w.body),Ce(b),N(this).info(`${k} - ${L}`),Ct(N(this),`[${g}] response error (${L})`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,durationMs:S-_}),this.retryRequest(a,t,i??g,w.headers)}let y=R?"error; no more retries left":"error; not retryable";N(this).info(`${k} - ${y}`);let P=await w.text().catch((L)=>Sr(L).message),C=ti(P),O=C?void 0:P;throw Ct(N(this),`[${g}] response error (${y})`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,message:O,durationMs:Date.now()-_}),Ce(b),this.makeStatusError(w.status,C,O,w.headers)}return N(this).info(k),Ct(N(this),`[${g}] response start`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,durationMs:S-_}),uo(w.body??w,b),{response:w,options:a,controller:b,requestLogID:g,retryOfRequestLogID:i,startTime:_}}getAPIList(n,t,i){return this.requestAPIList(t,i&&"then"in i?i.then((a)=>({method:"get",path:n,...a})):{method:"get",path:n,...i})}requestAPIList(n,t){let i=this.makeRequest(t,null,void 0);return new ia(this,i,n)}async fetchWithTimeout(n,t,i,a,l,u){let{signal:d,method:h,...g}=t||{},x=this._makeAbort(a);if(d)d.addEventListener("abort",x,{once:!0}),lo(a,d,x);let _=globalThis.ReadableStream&&g.body instanceof globalThis.ReadableStream||typeof g.body==="object"&&g.body!==null&&Symbol.asyncIterator in g.body,b={signal:a.signal,..._?{duplex:"half"}:{},method:"GET",...g};if(h)b.method=h.toUpperCase();let w=this.fetch,S=async(P,C)=>{let O=setTimeout(x,i);try{return await w.call(void 0,P,C)}finally{clearTimeout(O)}},T=l===void 0?S:async(P,C={})=>{let O=typeof P==="string"?P:P instanceof URL?P.href:P.url;if(C.headers=C.headers instanceof Headers?C.headers:new Headers(C.headers),await this.prepareRequest(C,{url:O,options:l}),u)Ct(N(this),`[${u.requestLogID}] sending request`,{retryOfRequestLogID:u.retryOfRequestLogID,method:C.method,url:O,options:l,headers:C.headers});return S(P,C)},k=l?.middleware,R=this.backendMiddleware(),y=k?.length||R.length?[...this.middleware,...k??[],...R]:this.middleware;return await li(T,y,l,this)(n,b)}async shouldRetry(n,t){let i=this._authFlags(t);if(n.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let a=n.headers.get("x-should-retry");if(a==="true")return!0;if(a==="false")return!1;if(n.status===408)return!0;if(n.status===409)return!0;if(n.status===429)return!0;if(n.status>=500)return!0;return!1}async retryRequest(n,t,i,a){let l,u=a?.get("retry-after-ms");if(u){let h=parseFloat(u);if(!Number.isNaN(h))l=h}let d=a?.get("retry-after");if(d&&!l){let h=parseFloat(d);if(!Number.isNaN(h))l=h*1000;else l=Date.parse(d)-Date.now()}if(l===void 0||!(l>0&&l<=2147483647)){let h=n.maxRetries??this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(t,h)}return await Re(l,n.signal??void 0),this.makeRequest(n,t-1,i)}calculateDefaultRetryTimeoutMillis(n,t){let l=t-n,u=Math.min(0.5*Math.pow(2,l),8),d=1-Math.random()*0.25;return u*d*1000}calculateNonstreamingTimeout(n,t){if(3600000*n/128000>600000||t!=null&&n>t)throw new p("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(n,{retryCount:t=0}={}){let i={...n},{method:a,path:l,query:u,defaultBaseURL:d}=i;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let h=this.buildURL(l,u,d);if("timeout"in i)ei("timeout",i.timeout);i.timeout=i.timeout??this.timeout;let{bodyHeaders:g,body:x}=this.buildBody({options:i}),_=await this.buildHeaders({options:n,method:a,bodyHeaders:g,retryCount:t,timeout:i.timeout});return{req:{method:a,headers:_,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&x instanceof globalThis.ReadableStream&&{duplex:"half"},...x&&{body:x},...this.fetchOptions??{},...i.fetchOptions??{}},url:h,timeout:i.timeout}}async buildHeaders({options:n,method:t,bodyHeaders:i,retryCount:a,timeout:l}){let u=f([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),"X-Stainless-Timeout":String(Math.trunc(l/1000)),...Lt(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,i,n.headers]);return this.validateHeaders(u),u.values}_makeAbort(n){return()=>n.abort()}buildBody({options:{body:n,headers:t}}){if(!n)return{bodyHeaders:void 0,body:void 0};let i=f([t]);if(ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n==="string"&&i.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:n};else if(this.isStreamBody(n))return{bodyHeaders:void 0,body:un(n)};else if(typeof n==="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(n)};else return e(this,Bs,"f").call(this,{body:n,headers:i})}isStreamBody(n){if(globalThis.ReadableStream&&n instanceof globalThis.ReadableStream)return!0;return typeof n==="object"&&n!==null&&((Symbol.asyncIterator in n)||(Symbol.iterator in n)&&("next"in n)&&typeof n.next==="function")}}return Xi=s,Bs=new WeakMap,Gi=new WeakSet,dc=function(){return this.baseURL!=="https://api.anthropic.com"},s.Anthropic=Xi,s.DEFAULT_TIMEOUT=600000,s.AnthropicError=p,s.APIError=le,s.APIConnectionError=er,s.APIConnectionTimeoutError=qo,s.APIUserAbortError=je,s.NotFoundError=Qo,s.ConflictError=Yo,s.RateLimitError=Jo,s.BadRequestError=Go,s.AuthenticationError=Vo,s.InternalServerError=Zo,s.PermissionDeniedError=Ko,s.UnprocessableEntityError=Xo,s.toFile=_i,s.HUMAN_PROMPT=Fu,s.AI_PROMPT=Hu,s})(),Ws=(()=>{class s extends Du{constructor(){super(...arguments);this.completions=new Pt(this),this.messages=new nn(this),this.models=new Nt(this),this.files=new Ot(this),this.skills=new on(this),this.beta=new Vr(this)}}return s.Completions=Pt,s.Messages=nn,s.Models=Nt,s.Files=Ot,s.Skills=on,s.Beta=Vr,s})();var Bu=function(s,n){if(typeof s==="string"&&/^\.\.?\//.test(s))return s.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,i,a,l,u){return i?n?".jsx":".js":a&&(!l||!u)?t:a+l+"."+u.toLowerCase()+"js"});return s},Wu=null,Uu=null,ju=null,Qi=(s)=>import(Bu(s)),qu="node:fs",Ku="node:os",zu="node:path";if(typeof process<"u"&&(process.versions?.node||process.versions?.bun))Qi(qu).then((s)=>{Wu=s.existsSync}),Qi(Ku).then((s)=>{Uu=s.homedir}),Qi(zu).then((s)=>{ju=s.join});var us="ANTHROPIC_AUTH_TOKEN",la="ANTHROPIC_OAUTH_TOKEN",ua="ANTHROPIC_API_KEY",$o="ANTHROPIC_FEDERATION_RULE_ID",jo="ANTHROPIC_ORGANIZATION_ID",Wo="ANTHROPIC_SERVICE_ACCOUNT_ID",Ho="ANTHROPIC_IDENTITY_TOKEN_FILE",zo="ANTHROPIC_WORKSPACE_ID";function hc(s,n){if(s)return s;if(A("PI_CACHE_RETENTION",n)==="long")return"long";return"short"}function Vu(s,n,t){let i=hc(n,t);if(i==="none")return{retention:i};let a=i==="long"&&cn(s).supportsLongCacheRetention?"1h":void 0;return{retention:i,cacheControl:{type:"ephemeral",...a&&{ttl:a}}}}var Yu="2.1.280",Ju=["Read","Write","Edit","Bash","Grep","Glob","AskUserQuestion","EnterPlanMode","ExitPlanMode","KillShell","NotebookEdit","Skill","Task","TaskOutput","TodoWrite","WebFetch","WebSearch"],Gu=new Map(Ju.map((s)=>[s.toLowerCase(),s])),ro=(s)=>Gu.get(s.toLowerCase())??s,Xu=(s,n)=>{if(n&&n.length>0){let t=s.toLowerCase(),i=n.find((a)=>a.name.toLowerCase()===t);if(i)return i.name}return s};function Qu(s){if(!s.some((a)=>a.type==="image"))return v(s.map((a)=>a.text).join(`
|
|
21
|
+
`));let t=s.map((a)=>{if(a.type==="text")return{type:"text",text:v(a.text)};return{type:"image",source:{type:"base64",media_type:a.mimeType,data:a.data}}});if(!t.some((a)=>a.type==="text"))t.unshift({type:"text",text:"(see attached image)"});return t}var Zu="fine-grained-tool-streaming-2025-05-14",ed="interleaved-thinking-2025-05-14",td="server-side-fallback-2026-07-01",rd="mid-conversation-output-config-2026-07-01",nd="thinking-binding-controls-2026-08-01",sd="inline-tools-2026-09-15",id={name:"__pi_deferred_placeholder__",description:"Reserved placeholder. Never available. Never call this.",input_schema:{type:"object",properties:{},required:[]},defer_loading:!0};function od(s){return(s.compat?.allowedFallbackModels?.length??0)>0}function cn(s){let n=s.provider==="openrouter"||s.baseUrl.includes("openrouter.ai");return{supportsEagerToolInputStreaming:s.compat?.supportsEagerToolInputStreaming??!0,supportsLongCacheRetention:s.compat?.supportsLongCacheRetention??!0,sendSessionAffinityHeaders:s.compat?.sendSessionAffinityHeaders??n,sessionAffinityFormat:s.compat?.sessionAffinityFormat??(n?"openrouter":void 0),supportsCacheControlOnTools:s.compat?.supportsCacheControlOnTools??!0,supportsTemperature:s.compat?.supportsTemperature??!0,allowEmptySignature:s.compat?.allowEmptySignature??!1,supportsStrictTools:s.compat?.supportsStrictTools??!1,supportsMidConvoSystemMessages:s.compat?.supportsMidConvoSystemMessages??!1,supportsMidConvoToolChanges:s.compat?.supportsMidConvoToolChanges??!1}}function ad(...s){let n={};for(let t of s)if(t)Object.assign(n,t);return n}function Zi(...s){return ad({"User-Agent":ue()},...s)}function eo(s,n){if(!s)return!1;let t=n.toLowerCase();for(let[i,a]of Object.entries(s))if(i.toLowerCase()===t&&a!==null&&a.trim().length>0)return!0;return!1}function fc(s,n){return!!s||eo(n,"authorization")||eo(n,"x-api-key")||eo(n,"cf-aig-authorization")}function pc(s,n,t){if(!fc(n,t))throw Error(`No API key for provider: ${s}`)}class an extends Ws{_shouldResolveDefaultCredentials(){return!1}}function mc(s,n,t,i){if(s.provider!=="anthropic"||fc(n,t))return;let a=A($o,i),l=A(jo,i),u=A(Ho,i);if(!a||!l||!u)return;return{organization_id:l,workspace_id:A(zo,i),authentication:{type:"oidc_federation",federation_rule_id:a,service_account_id:A(Wo,i),identity_token:{source:"file",path:u}}}}var Us,cd=new Set(["message_start","message_delta","message_stop","content_block_start","content_block_delta","content_block_stop"]);function _c(s){if(!s.event&&s.data.length===0)return null;let n={event:s.event,data:s.data.join(`
|
|
22
|
+
`),raw:[...s.raw]};return s.event=null,s.data=[],s.raw=[],n}function to(s,n){if(s==="")return _c(n);if(n.raw.push(s),s.startsWith(":"))return null;let t=s.indexOf(":"),i=t===-1?s:s.slice(0,t),a=t===-1?"":s.slice(t+1);if(a.startsWith(" "))a=a.slice(1);if(i==="event")n.event=a;else if(i==="data")n.data.push(a);return null}function ld(s){let n=s.indexOf("\r"),t=s.indexOf(`
|
|
23
|
+
`);if(n===-1)return t;if(t===-1)return n;return Math.min(n,t)}function js(s){let n=ld(s);if(n===-1)return null;let t=n+1;if(s[n]==="\r"&&s[t]===`
|
|
24
|
+
`)t+=1;return{line:s.slice(0,n),rest:s.slice(t)}}async function*ud(s,n){let t=s.getReader(),i=new TextDecoder,a={event:null,data:[],raw:[]},l="";try{while(!0){if(n?.aborted)throw Error("Request was aborted");let{value:h,done:g}=await t.read();if(g)break;l+=i.decode(h,{stream:!0});let x=js(l);while(x){l=x.rest;let _=to(x.line,a);if(_)yield _;x=js(l)}}l+=i.decode();let u=js(l);while(u){l=u.rest;let h=to(u.line,a);if(h)yield h;u=js(l)}if(l.length>0){let h=to(l,a);if(h)yield h}let d=_c(a);if(d)yield d}finally{t.releaseLock()}}async function*dd(s,n){if(!s.body)throw Error("Attempted to iterate over an Anthropic response with no body");let t=!1,i=!1;for await(let a of ud(s.body,n)){if(a.event==="error")throw Error(a.data);if(!cd.has(a.event??""))continue;try{let l=ho(a.data);if(l.type==="message_start")t=!0;else if(l.type==="message_stop")i=!0;yield l}catch(l){let u=l instanceof Error?l.message:String(l);throw Error(`Could not parse Anthropic SSE event ${a.event}: ${u}; data=${a.data}; raw=${a.raw.join("\\n")}`)}}if(t&&!i)throw Error("Anthropic stream ended before message_stop")}var Gr=(s,n,t)=>{let i=new W,a=pe(n,cn(s).supportsMidConvoSystemMessages),l=me(a.messages);return(async()=>{let u=s.compat?.supportsMidConvoEffort?t?.effort??"high":void 0,d={role:"assistant",content:[],api:s.api,provider:s.provider,model:s.id,...u===void 0?{}:{providerThinkingLevel:u},usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let h,g,x=s,_;if(t?.client)h=t.client,g=!1;else{let k=t?.apiKey,R=mc(s,k,t?.headers,t?.env);if(!R)pc(s.provider,k,t?.headers);let y;if(s.provider==="github-copilot"){let q=nr(a.messages);y=or({messages:a.messages,hasImages:q})}let C=hc(t?.cacheRetention,t?.env)==="none"?void 0:t?.sessionId,O=pd(s,k,t?.headers,t?.fetch,y,C,R);h=O.client,g=O.isOAuthToken}let b={...t?.signal?{signal:t.signal}:{},...t?.timeoutMs!==void 0?{timeout:t.timeoutMs}:{},maxRetries:0},w=!1,S;for(;;){t?.signal?.throwIfAborted();let k=_d(s,a,g,t,w),R=k.params,y=await t?.onPayload?.(R,s);if(y!==void 0)R={...y,stream:!0};try{S=await ye(()=>h.beta.messages.create(R,b).asResponse(),{maxRetries:t?.maxRetries,maxRetryDelayMs:t?.maxRetryDelayMs,signal:t?.signal});break}catch(P){if(t?.signal?.aborted||w||!k.hasPreferredStrictTools||!(P instanceof Ws.APIError)||P.status!==400||P.type!=="invalid_request_error"||!["The compiled grammar is too large","Too many strict tools (","Schemas contains too many parameters with union types ("].some((C)=>P.message.includes(C)))throw P;w=!0,ze(d,{type:"anthropic_strict_tools_fallback",timestamp:Date.now(),error:{message:P.message},details:{reason:"strict_tool_limits_exceeded"}})}}await t?.onResponse?.({status:S.status,headers:J(S.headers)},s),i.push({type:"start",partial:d});let T=d.content;for await(let k of dd(S,t?.signal))if(await t?.onProviderStreamEvent?.(k,s),k.type==="message_start"){d.responseId=k.message.id;let R=k.message.input_transformations;if(Array.isArray(R))_=R;let y=k.message.model;if(y!==s.id)d.responseModel=y;let P=y===s.id?void 0:s.compat?.allowedFallbackModels?.find((C)=>C.provider===s.provider&&C.model===y)?.cost;x=P?{...s,id:y,cost:P}:s,d.usage.input=k.message.usage.input_tokens||0,d.usage.output=k.message.usage.output_tokens||0,d.usage.cacheRead=k.message.usage.cache_read_input_tokens||0,d.usage.cacheWrite=k.message.usage.cache_creation_input_tokens||0,d.usage.cacheWrite1h=k.message.usage.cache_creation?.ephemeral_1h_input_tokens||0,d.usage.totalTokens=d.usage.input+d.usage.output+d.usage.cacheRead+d.usage.cacheWrite,oe(x,d.usage)}else if(k.type==="content_block_start"){if(k.content_block.type==="fallback"){if(d.content.length>0)throw Error("Anthropic performed an unsupported mid-output model fallback");continue}if(k.content_block.type==="text"){let R={type:"text",text:k.content_block.text??"",index:k.index};d.content.push(R),i.push({type:"text_start",contentIndex:d.content.length-1,partial:d})}else if(k.content_block.type==="thinking"){let R={type:"thinking",thinking:k.content_block.thinking??"",thinkingSignature:k.content_block.signature??"",index:k.index};d.content.push(R),i.push({type:"thinking_start",contentIndex:d.content.length-1,partial:d})}else if(k.content_block.type==="redacted_thinking"){let R={type:"thinking",thinking:"[Reasoning redacted]",thinkingSignature:k.content_block.data,redacted:!0,index:k.index};d.content.push(R),i.push({type:"thinking_start",contentIndex:d.content.length-1,partial:d})}else if(k.content_block.type==="tool_use"){let R={type:"toolCall",id:k.content_block.id,name:g?Xu(k.content_block.name,l):k.content_block.name,arguments:k.content_block.input??{},partialJson:"",index:k.index};d.content.push(R),i.push({type:"toolcall_start",contentIndex:d.content.length-1,partial:d})}}else if(k.type==="content_block_delta"){if(k.delta.type==="text_delta"){let R=T.findIndex((P)=>P.index===k.index),y=T[R];if(y&&y.type==="text")y.text+=k.delta.text,i.push({type:"text_delta",contentIndex:R,delta:k.delta.text,partial:d})}else if(k.delta.type==="thinking_delta"){let R=T.findIndex((P)=>P.index===k.index),y=T[R];if(y&&y.type==="thinking")y.thinking+=k.delta.thinking,i.push({type:"thinking_delta",contentIndex:R,delta:k.delta.thinking,partial:d})}else if(k.delta.type==="input_json_delta"){let R=T.findIndex((P)=>P.index===k.index),y=T[R];if(y&&y.type==="toolCall")y.partialJson+=k.delta.partial_json,y.arguments=V(y.partialJson),i.push({type:"toolcall_delta",contentIndex:R,delta:k.delta.partial_json,partial:d})}else if(k.delta.type==="signature_delta"){let R=T.findIndex((P)=>P.index===k.index),y=T[R];if(y&&y.type==="thinking")y.thinkingSignature=y.thinkingSignature||"",y.thinkingSignature+=k.delta.signature}}else if(k.type==="content_block_stop"){let R=T.findIndex((P)=>P.index===k.index),y=T[R];if(y){if(delete y.index,y.type==="text")i.push({type:"text_end",contentIndex:R,content:y.text,partial:d});else if(y.type==="thinking")i.push({type:"thinking_end",contentIndex:R,content:y.thinking,partial:d});else if(y.type==="toolCall")y.arguments=V(y.partialJson),delete y.partialJson,i.push({type:"toolcall_end",contentIndex:R,toolCall:y,partial:d})}}else if(k.type==="message_delta"){let R=k.input_transformations;if(Array.isArray(R))_=R;if(k.delta.stop_reason){d.rawStopReason=k.delta.stop_reason;let y=Rd(k.delta.stop_reason,k.delta.stop_details);if(d.stopReason=y.stopReason,y.errorMessage)d.errorMessage=y.errorMessage}if(k.usage){if(k.usage.input_tokens!=null)d.usage.input=k.usage.input_tokens;if(k.usage.output_tokens!=null)d.usage.output=k.usage.output_tokens;if(k.usage.cache_read_input_tokens!=null)d.usage.cacheRead=k.usage.cache_read_input_tokens;if(k.usage.cache_creation_input_tokens!=null)d.usage.cacheWrite=k.usage.cache_creation_input_tokens;let y=k.usage.cache_creation;if(y?.ephemeral_1h_input_tokens!=null)d.usage.cacheWrite1h=y.ephemeral_1h_input_tokens;let P=k.usage.output_tokens_details?.thinking_tokens;if(P!=null)d.usage.reasoning=P}d.usage.totalTokens=d.usage.input+d.usage.output+d.usage.cacheRead+d.usage.cacheWrite,oe(x,d.usage)}if(t?.signal?.aborted)throw Error("Request was aborted");if(d.stopReason==="pending")throw Error("Anthropic stream ended without a stop reason");if(d.stopReason==="aborted"||d.stopReason==="error")throw Error(d.errorMessage||"An unknown error occurred");if(_&&_.length>0)ze(d,{type:"anthropic_input_transformations",timestamp:Date.now(),details:{transformations:_.map((k)=>({type:k.type??void 0,path:k.path??void 0,reason:k.reason??void 0}))}});i.push({type:"done",reason:d.stopReason,message:d}),i.end()}catch(h){for(let g of d.content)delete g.index,delete g.partialJson;d.stopReason=t?.signal?.aborted?"aborted":"error",d.errorMessage=h instanceof Error?h.message:JSON.stringify(h),i.push({type:"error",reason:d.stopReason,error:d}),i.end()}})(),i};function hd(s,n){let t=n?s.thinkingLevelMap?.[n]:void 0;if(typeof t==="string")return t;switch(n){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}var ps=(s,n,t)=>{if(!mc(s,t?.apiKey,t?.headers,t?.env))pc(s.provider,t?.apiKey,t?.headers);let i={...re(s,n,t,t?.apiKey),toolChoice:t?.toolChoice};if(!t?.reasoning)return Gr(s,n,{...i,thinkingEnabled:!1});if(s.compat?.forceAdaptiveThinking===!0){let u=hd(s,t.reasoning);return Gr(s,n,{...i,thinkingEnabled:!0,effort:u})}let a=Qn(i.maxTokens,s.maxTokens,t.reasoning,t.thinkingBudgets),l=Yr(s,n,a.maxTokens);return Gr(s,n,{...i,maxTokens:l,thinkingEnabled:!0,thinkingBudgetTokens:Math.min(a.thinkingBudget,Math.max(0,l-1024))})};function fd(s){return s.includes("sk-ant-oat")}function pd(s,n,t,i,a,l,u){if(s.provider==="github-copilot")return{client:new an({apiKey:null,authToken:n??null,baseURL:s.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:Zi({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},s.headers,a,t)}),isOAuthToken:!1};if(n&&fd(n))return{client:new an({apiKey:null,authToken:n,baseURL:s.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:Zi({accept:"application/json","anthropic-dangerous-direct-browser-access":"true","user-agent":`claude-cli/${Yu}`,"x-app":"cli"},s.headers,t)}),isOAuthToken:!0};let d=cn(s),h={};if(l&&d.sendSessionAffinityHeaders){let _=d.sessionAffinityFormat==="openrouter"?"x-session-id":"x-session-affinity";h[_]=l}let g=Zi({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},h,s.headers,t);if(u){let _=JSON.stringify([s.baseUrl,u]);if(Us?.key!==_||Us.fetch!==i){let b=new an({apiKey:null,authToken:null,config:u,baseURL:s.baseUrl,dangerouslyAllowBrowser:!0,fetch:i});Us={key:_,fetch:i,client:b}}return{client:Us.client.withOptions({defaultHeaders:g}),isOAuthToken:!1}}return{client:new an({apiKey:n??null,authToken:null,baseURL:s.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:g}),isOAuthToken:!1}}function md(s,n,t,i,a){let l;for(let d of[s.headers,a?.headers])for(let[h,g]of Object.entries(d??{}))if(h.toLowerCase()==="anthropic-beta")l=g;if(l===null)return[];if(l!==void 0)return[...new Set(l.split(",").map((d)=>d.trim()).filter((d)=>d.length>0))];let u=[];if(t)u.push("claude-code-20250219","oauth-2025-04-20");if(Sd(s,n))u.push(Zu);if(s.reasoning&&a?.thinkingEnabled===!0&&(a.interleavedThinking??!0)&&s.compat?.forceAdaptiveThinking!==!0)u.push(ed);if(od(s))u.push(td);if(s.compat?.supportsMidConvoEffort===!0)u.push(rd,nd);if(i)u.push(sd);return[...new Set(u)]}function _d(s,n,t,i,a=!1){let{cacheControl:l}=Vu(s,i?.cacheRetention,i?.env),u=cn(s),d=ve(n.messages),h=d?G(d):"",g=Te(n.messages,s,gd),x=d?g.slice(1):g,_=!1,b=(O,q)=>{let L=Ad(O,t,u.supportsEagerToolInputStreaming,u.supportsStrictTools,q,a);if(L.some((K,H)=>{let D=O[H].constrainedSampling;return K.strict===!0&&D&&D.type==="json_schema"&&D.strict==="prefer"}))_=!0;return L},w=d?.toolsAdded??[],S=u.supportsMidConvoSystemMessages&&u.supportsMidConvoToolChanges&&w.length>0,T=yd(x,t,l,u.allowEmptySignature,s.compat?.supportsMidConvoEffort===!0?s.provider:void 0,S?b:void 0),k=i?.effort??"high",R=md(s,n,t,S,i),y={model:s.id,messages:s.compat?.supportsMidConvoEffort===!0?kd(T,k):T.messages,max_tokens:i?.maxTokens??s.maxTokens,stream:!0,...R.length>0?{betas:R}:{}};if(t){if(y.system=[{type:"text",text:"You are Claude Code, Anthropic's official CLI for Claude.",...l?{cache_control:l}:{}}],h)y.system.push({type:"text",text:v(h),...l?{cache_control:l}:{}})}else if(h)y.system=[{type:"text",text:v(h),...l?{cache_control:l}:{}}];if(i?.temperature!==void 0&&!i?.thinkingEnabled&&s.compat?.supportsMidConvoEffort!==!0&&u.supportsTemperature)y.temperature=i.temperature;let P=u.supportsCacheControlOnTools?l:void 0;if(S)y.tools=[...b(w,P),id];else{let O=me(n.messages);if(O.length>0)y.tools=b(O,P)}if(s.compat?.supportsMidConvoEffort===!0)y.thinking={type:"adaptive",display:i?.thinkingDisplay??"summarized",block_binding:{prefix_mismatch_behavior:"drop_block"}},y.output_config={effort:"high"};else if(s.reasoning){if(i?.thinkingEnabled){let O=i.thinkingDisplay??"summarized";if(s.compat?.forceAdaptiveThinking===!0){if(y.thinking={type:"adaptive",display:O},i.effort)y.output_config={effort:i.effort}}else y.thinking={type:"enabled",budget_tokens:i.thinkingBudgetTokens||1024,display:O}}else if(i?.thinkingEnabled===!1&&s.thinkingLevelMap?.off!==null)y.thinking={type:"disabled"}}if(i?.metadata){let O=i.metadata.user_id;if(typeof O==="string")y.metadata={user_id:O}}if(i?.toolChoice)if(typeof i.toolChoice==="string")y.tool_choice={type:i.toolChoice};else y.tool_choice=i.toolChoice;let C=s.compat?.allowedFallbackModels;if(C&&C.length>0)y.fallbacks=C.map((O)=>({model:O.model}));return{params:y,hasPreferredStrictTools:_}}function gd(s){return s.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)}function wd(s){return{type:"tool_result",tool_use_id:s.toolCallId,content:Qu(s.content),is_error:s.isError}}function yd(s,n,t,i=!1,a,l){let u=[],d=new Map,h=[],g=()=>{u.push(...h),h.length=0};for(let x=0;x<s.length;x++){let _=s[x];if(_.role==="system"){let b=et(_),w=[];if(b.length>0)w.push({type:"text",text:v(b)});if(l){let S=_.toolsAdded??[],T=new Set(S.map((k)=>k.name));for(let k of _.toolsRemoved??[]){if(T.has(k.name))continue;w.push({type:"tool_removal",tool:{type:"tool_reference",name:n?ro(k.name):k.name}})}for(let k of l(S))w.push({type:"tool_addition",tool:{type:"tool_definition",definition:k}})}if(w.length>0)h.push({role:"system",content:w})}else if(_.role==="user")if(typeof _.content==="string"){if(_.content.trim().length>0)u.push({role:"user",content:v(_.content)})}else{let w=_.content.map((S)=>{if(S.type==="text")return{type:"text",text:v(S.text)};else return{type:"image",source:{type:"base64",media_type:S.mimeType,data:S.data}}}).filter((S)=>{if(S.type==="text")return S.text.trim().length>0;return!0});if(w.length===0)continue;u.push({role:"user",content:w})}else if(_.role==="assistant"){g();let b=[];for(let S of _.content)if(S.type==="text"){if(S.text.trim().length===0)continue;b.push({type:"text",text:v(S.text)})}else if(S.type==="thinking"){if(S.redacted){b.push({type:"redacted_thinking",data:S.thinkingSignature});continue}let T=S.thinkingSignature,k=!!T&&T.trim().length>0;if(S.thinking.trim().length===0&&!k)continue;if(!k)b.push(i?{type:"thinking",thinking:v(S.thinking),signature:""}:{type:"text",text:v(S.thinking)});else b.push({type:"thinking",thinking:v(S.thinking),signature:T})}else if(S.type==="toolCall")b.push({type:"tool_use",id:S.id,name:n?ro(S.name):S.name,input:S.arguments??{}});if(b.length===0)continue;let w=u.length;if(u.push({role:"assistant",content:b}),a!==void 0&&_.api==="anthropic-messages"&&_.provider===a&&bd(_.providerThinkingLevel))d.set(w,_.providerThinkingLevel)}else if(_.role==="toolResult"){let b=[],w=x;while(w<s.length&&s[w].role==="toolResult")b.push(wd(s[w])),w++;x=w-1,u.push({role:"user",content:b})}}if(g(),t&&u.length>0){let x=u[u.length-1];if(x.role==="user"||x.role==="system"){if(Array.isArray(x.content)){let _=x.content[x.content.length-1];if(_&&(_.type==="text"||_.type==="image"||_.type==="tool_result"||_.type==="tool_addition"||_.type==="tool_removal"))_.cache_control=t}else if(typeof x.content==="string")x.content=[{type:"text",text:x.content,cache_control:t}]}}return{messages:u,assistantLevels:d}}function bd(s){return s==="low"||s==="medium"||s==="high"||s==="xhigh"||s==="max"}function kd(s,n){let t=[];for(let i=0;i<s.messages.length;i++){let a=s.assistantLevels.get(i);if(a!==void 0)t.push({role:"system",content:[],output_config:{effort:a}});t.push(s.messages[i])}return t.push({role:"system",content:[],output_config:{effort:n}}),t}function Sd(s,n){return me(n.messages).length>0&&!cn(s).supportsEagerToolInputStreaming}var vd=new Set(["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","maxItems","uniqueItems","minContains","maxContains","minProperties","maxProperties"]),xd=new Set(["date-time","time","date","duration","email","hostname","uri","ipv4","ipv6","uuid"]),Ed=(s,n)=>{if(vd.has(s))return!0;if(s==="minItems")return n!==0&&n!==1;if(s==="format")return typeof n!=="string"||!xd.has(n);return!1};function Ad(s,n,t,i,a,l=!1){if(!s)return[];return s.map((u,d)=>{let h=u.constrainedSampling,g=l&&h&&h.type==="json_schema"&&h.strict==="prefer"?void 0:xe(u,i,Ed),x=Ae(u,g),_=x,b={type:"object",properties:_.properties??{},required:_.required??[]},w=g===!0?{...x,...b}:b;return{name:n?ro(u.name):u.name,description:u.description,...t?{eager_input_streaming:!0}:{},...g===!0?{strict:!0}:{},input_schema:w,...a&&d===s.length-1?{cache_control:a}:{}}})}function Rd(s,n){switch(s){case"end_turn":return{stopReason:"stop"};case"max_tokens":return{stopReason:"length"};case"tool_use":return{stopReason:"toolUse"};case"refusal":return{stopReason:"error",errorMessage:n?.explanation||"The model refused to complete the request"};case"pause_turn":return{stopReason:"stop"};case"stop_sequence":return{stopReason:"stop"};case"sensitive":return{stopReason:"error",errorMessage:"Provider stopped with: sensitive"};default:throw Error(`Unhandled stop reason: ${s}`)}}
|
|
25
|
+
export{us,la,ua,$o,jo,Wo,Ho,zo,Gr,ps};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var A=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],I=["content-type","cache-control","allow"];function p(e){let r=e.path;if(!r?.startsWith("/api/")||/[\\\r\n#]/.test(r))throw Error("request path must start with /api/");let n=new URL(r,"http://basalt.internal");if(n.origin!=="http://basalt.internal"||!n.pathname.startsWith("/api/"))throw Error("request path must stay within /api/");let o=e.method??"GET";if(!A.includes(o))throw Error("Unsupported request method");if(e.body!==void 0&&(!e.body||typeof e.body!=="object"||Array.isArray(e.body)))throw Error("request body must be a JSON object");if(e.body!==void 0&&(o==="GET"||o==="HEAD"))throw Error("GET and HEAD requests cannot have a body");let s=e.timeoutMs??1e4;if(!Number.isSafeInteger(s)||s<1||s>60000)throw Error("timeoutMs must be an integer between 1 and 60000");return{url:n,method:o,timeoutMs:s}}function g(e){let r={};for(let n of I){let o=e.headers.get(n);if(o)r[n]=o.slice(0,500)}return r}async function M(e,r){let n=e.getReader();r(()=>n.cancel());let o=[],s=0,i=!1;while(!0){let t=await n.read();if(t.done)break;let d=20480-s;if(o.push(t.value.subarray(0,d)),s+=Math.min(t.value.length,d),t.value.length>d){i=!0,await n.cancel();break}}let u=new Uint8Array(s),c=0;for(let t of o)u.set(t,c),c+=t.length;return{text:new TextDecoder().decode(u,{stream:i}),truncated:i}}async function Vr(e,r,n){let{url:o,method:s,timeoutMs:i}=p(r),u=e.http;if(!u)throw Error("HTTP API is not attached; start the Basalt server first");let c=new AbortController,t=n?AbortSignal.any([n,c.signal]):c.signal;t.throwIfAborted();let d,b=()=>{d?.().catch(()=>{})},E=async()=>{let h=r.body!==void 0,a=await u.request(new Request(o.toString(),{method:s,headers:h?{"content-type":"application/json"}:void 0,body:h?JSON.stringify(r.body):void 0,signal:t}));if(t.aborted)throw await a.body?.cancel(),Error("API request cancelled");let m=a.body?await M(a.body,(T)=>{d=T}):{text:"",truncated:!1};return{status:a.status,headers:g(a),body:m.text,truncated:m.truncated}},f,l,y=new Promise((h,a)=>{if(l=()=>{a(Error("API request cancelled")),b()},t.addEventListener("abort",l,{once:!0}),t.aborted)l()}),w=new Promise((h,a)=>{f=setTimeout(()=>{a(Error(`API request timed out after ${i}ms`)),c.abort(),b()},i)});try{return await Promise.race([E(),y,w])}finally{if(clearTimeout(f),l)t.removeEventListener("abort",l)}}
|
|
3
|
+
export{Vr};
|