@bkm016/basalt 0.1.35 → 0.1.37
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-1jtnjzrz.js +3 -0
- package/chunk-1xam7mw7.js +2 -0
- package/chunk-2df7yf47.js +3 -0
- package/chunk-3a3ta83t.js +12 -0
- package/chunk-3bb12192.js +39 -0
- package/chunk-3j24he2c.js +25 -0
- package/chunk-3yyt010j.js +2 -0
- package/chunk-412mm63g.js +3 -0
- package/chunk-4hrkad68.js +2 -0
- package/chunk-4kw8vvae.js +3 -0
- package/chunk-5xj2kq5h.js +3 -0
- package/chunk-6hajdf5x.js +2 -0
- package/chunk-6rkwh4w5.js +3 -0
- package/chunk-792xwgne.js +2 -0
- package/chunk-7ygt906s.js +2 -0
- package/chunk-8bvjjs3r.js +3 -0
- package/chunk-8jf1kd0m.js +3 -0
- package/chunk-95npkaze.js +5 -0
- package/chunk-9yqn7drg.js +3 -0
- package/chunk-9zwy8ypg.js +117 -0
- package/chunk-ad5asgnr.js +2 -0
- package/chunk-akdav0ay.js +3 -0
- package/chunk-arzyd0f7.js +8 -0
- package/chunk-avrzwnbk.js +2 -0
- package/chunk-b3fwt4jy.js +2 -0
- package/chunk-b41a7yc5.js +7 -0
- package/chunk-be4p5qak.js +103 -0
- package/chunk-bkabw9yr.js +3 -0
- package/chunk-br7606yh.js +7 -0
- package/chunk-brgcdzj9.js +60 -0
- package/chunk-bvh3ccr2.js +3 -0
- package/chunk-c0htgv5v.js +3 -0
- package/chunk-ch8bhqmp.js +2 -0
- package/chunk-d2t7tx0d.js +16 -0
- package/chunk-d5qsqt4v.js +2 -0
- package/chunk-d5sxt7bc.js +13 -0
- package/chunk-dz8jyvp4.js +547 -0
- package/chunk-e431qjnf.js +3 -0
- package/chunk-e69h0e2f.js +2 -0
- package/chunk-e9rp422g.js +9 -0
- package/chunk-ebmmdfq3.js +2 -0
- package/chunk-etvf4tkk.js +3 -0
- package/chunk-ewr4r5yx.js +18 -0
- package/chunk-ezm2t479.js +11 -0
- package/chunk-f5prr1x7.js +59 -0
- package/chunk-fxs37w3f.js +10 -0
- package/chunk-g27efryh.js +20 -0
- package/chunk-g8zcrfzr.js +2 -0
- package/chunk-gde46g2m.js +2 -0
- package/chunk-gnf6jvxv.js +25 -0
- package/chunk-gswcr5j6.js +2 -0
- package/chunk-h22spg1q.js +3 -0
- package/chunk-h2br80f8.js +3 -0
- package/chunk-he09tqj5.js +2 -0
- package/chunk-hkx2cpc5.js +3 -0
- package/chunk-hnqtkgcq.js +3 -0
- package/chunk-hrxkr8a8.js +3 -0
- package/chunk-hwkmxr9a.js +5 -0
- package/chunk-j9jg8h44.js +2 -0
- package/chunk-jhgf0vpr.js +5 -0
- package/chunk-k3ndw7d4.js +3 -0
- package/chunk-k8mc2tn3.js +3 -0
- package/chunk-mbf7201c.js +5 -0
- package/chunk-mzhebc7e.js +7 -0
- package/chunk-n1c3t0nj.js +2 -0
- package/chunk-nmpqx2sh.js +3 -0
- package/chunk-p0dacr9z.js +12 -0
- package/chunk-q8gv26ze.js +3 -0
- package/chunk-qj6bf18b.js +3 -0
- package/chunk-rxq62z5t.js +3 -0
- package/chunk-s27309w7.js +3 -0
- package/chunk-sjwsj82f.js +10 -0
- package/chunk-sxrwwyp7.js +3 -0
- package/chunk-tadyy9xh.js +51 -0
- package/chunk-tb3tj3ct.js +2 -0
- package/chunk-vgvp6cpk.js +2 -0
- package/chunk-vj5p29fr.js +2 -0
- package/chunk-wbpt03pe.js +31 -0
- package/chunk-wgjt31wp.js +8 -0
- package/chunk-wk6vjpmj.js +3 -0
- package/chunk-x1spmnj8.js +2 -0
- package/chunk-x4anmcq9.js +4 -0
- package/chunk-xd5hf1rg.js +3178 -0
- package/chunk-xp5p6tsp.js +286 -0
- package/chunk-xpbt4cpe.js +2 -0
- package/chunk-yw2k2syh.js +3 -0
- package/chunk-z3x79jnt.js +3 -0
- package/chunk-zd569v9h.js +2 -0
- package/compiled.js +13 -13
- package/package.json +1 -1
- package/ui-test-worker.js +57 -57
- package/web/chunk-05b25kh6.js +332 -0
- package/web/chunk-05b25kh6.js.br +0 -0
- package/web/chunk-05b25kh6.js.gz +0 -0
- package/web/chunk-0g6z1xs1.js +2 -0
- package/web/chunk-0g6z1xs1.js.br +0 -0
- package/web/chunk-0g6z1xs1.js.gz +0 -0
- package/web/chunk-0kj45mje.js +2 -0
- package/web/chunk-0kj45mje.js.br +0 -0
- package/web/chunk-0kj45mje.js.gz +0 -0
- package/web/chunk-0wt52yw3.js +1 -0
- package/web/chunk-0wt52yw3.js.br +2 -0
- package/web/chunk-0wt52yw3.js.gz +0 -0
- package/web/chunk-0x9cf6bp.js +38 -0
- package/web/chunk-0x9cf6bp.js.br +0 -0
- package/web/chunk-0x9cf6bp.js.gz +0 -0
- package/web/chunk-0y2f60q6.js +1 -0
- package/web/chunk-0y2f60q6.js.br +0 -0
- package/web/chunk-0y2f60q6.js.gz +0 -0
- package/web/chunk-1axw7vb0.js +214 -0
- package/web/chunk-1axw7vb0.js.br +0 -0
- package/web/chunk-1axw7vb0.js.gz +0 -0
- package/web/chunk-1es5ak4r.js +1 -0
- package/web/chunk-1es5ak4r.js.br +0 -0
- package/web/chunk-1es5ak4r.js.gz +0 -0
- package/web/chunk-1mkzfr1m.js +2 -0
- package/web/chunk-1mkzfr1m.js.br +0 -0
- package/web/chunk-1mkzfr1m.js.gz +0 -0
- package/web/chunk-1v45hcve.js +1 -0
- package/web/chunk-1v45hcve.js.br +0 -0
- package/web/chunk-1v45hcve.js.gz +0 -0
- package/web/chunk-1vhk8j0c.js +1 -0
- package/web/chunk-1vhk8j0c.js.br +0 -0
- package/web/chunk-1vhk8j0c.js.gz +0 -0
- package/web/chunk-21jtjwe1.js +1 -0
- package/web/chunk-21jtjwe1.js.br +0 -0
- package/web/chunk-21jtjwe1.js.gz +0 -0
- package/web/chunk-26grg3rq.js +1144 -0
- package/web/chunk-26grg3rq.js.br +0 -0
- package/web/chunk-26grg3rq.js.gz +0 -0
- package/web/chunk-2nwvdqxm.js +1 -0
- package/web/chunk-2nwvdqxm.js.br +0 -0
- package/web/chunk-2nwvdqxm.js.gz +0 -0
- package/web/chunk-2vh05ags.js +2 -0
- package/web/chunk-2vh05ags.js.br +0 -0
- package/web/chunk-2vh05ags.js.gz +0 -0
- package/web/chunk-2wvgy7f4.js +1 -0
- package/web/chunk-2wvgy7f4.js.br +0 -0
- package/web/chunk-2wvgy7f4.js.gz +0 -0
- package/web/chunk-33bfatdr.js +4 -0
- package/web/chunk-33bfatdr.js.br +0 -0
- package/web/chunk-33bfatdr.js.gz +0 -0
- package/web/chunk-38xsaxws.js +1 -0
- package/web/chunk-38xsaxws.js.br +0 -0
- package/web/chunk-38xsaxws.js.gz +0 -0
- package/web/chunk-3av47wwa.js +7 -0
- package/web/chunk-3av47wwa.js.br +0 -0
- package/web/chunk-3av47wwa.js.gz +0 -0
- package/web/chunk-3rxgch48.js +1 -0
- package/web/chunk-3rxgch48.js.br +0 -0
- package/web/chunk-3rxgch48.js.gz +0 -0
- package/web/chunk-40j8gxty.js +303 -0
- package/web/chunk-40j8gxty.js.br +0 -0
- package/web/chunk-40j8gxty.js.gz +0 -0
- package/web/chunk-43kq2dk7.js +21 -0
- package/web/chunk-43kq2dk7.js.br +0 -0
- package/web/chunk-43kq2dk7.js.gz +0 -0
- package/web/chunk-4cw67sdz.js +78 -0
- package/web/chunk-4cw67sdz.js.br +0 -0
- package/web/chunk-4cw67sdz.js.gz +0 -0
- package/web/chunk-4k4c2se1.js +2 -0
- package/web/chunk-4k4c2se1.js.br +0 -0
- package/web/chunk-4k4c2se1.js.gz +0 -0
- package/web/chunk-50dr941q.js +55 -0
- package/web/chunk-50dr941q.js.br +0 -0
- package/web/chunk-50dr941q.js.gz +0 -0
- package/web/chunk-56hx6a5h.js +1 -0
- package/web/chunk-56hx6a5h.js.br +0 -0
- package/web/chunk-56hx6a5h.js.gz +0 -0
- package/web/chunk-5m1p98r5.js +2 -0
- package/web/chunk-5m1p98r5.js.br +0 -0
- package/web/chunk-5m1p98r5.js.gz +0 -0
- package/web/chunk-5m45mc2k.js +99 -0
- package/web/chunk-5m45mc2k.js.br +0 -0
- package/web/chunk-5m45mc2k.js.gz +0 -0
- package/web/chunk-6gfa17h5.js +1 -0
- package/web/chunk-6gfa17h5.js.br +0 -0
- package/web/chunk-6gfa17h5.js.gz +0 -0
- package/web/chunk-7e57me98.js +1 -0
- package/web/chunk-7e57me98.js.br +0 -0
- package/web/chunk-7e57me98.js.gz +0 -0
- package/web/chunk-7ht7dssg.js +1 -0
- package/web/chunk-7ht7dssg.js.br +0 -0
- package/web/chunk-7ht7dssg.js.gz +0 -0
- package/web/chunk-8jxg1srx.js +1 -0
- package/web/chunk-8jxg1srx.js.br +2 -0
- package/web/chunk-8jxg1srx.js.gz +0 -0
- package/web/chunk-8q9970dm.js +2 -0
- package/web/chunk-8q9970dm.js.br +0 -0
- package/web/chunk-8q9970dm.js.gz +0 -0
- package/web/chunk-8t1kh5r9.js +370 -0
- package/web/chunk-8t1kh5r9.js.br +0 -0
- package/web/chunk-8t1kh5r9.js.gz +0 -0
- package/web/chunk-8za5fkrq.js +1 -0
- package/web/chunk-8za5fkrq.js.br +0 -0
- package/web/chunk-8za5fkrq.js.gz +0 -0
- package/web/chunk-96dhr80q.js +8 -0
- package/web/chunk-96dhr80q.js.br +0 -0
- package/web/chunk-96dhr80q.js.gz +0 -0
- package/web/chunk-98y5p1r2.js +1 -0
- package/web/chunk-98y5p1r2.js.br +0 -0
- package/web/chunk-98y5p1r2.js.gz +0 -0
- package/web/chunk-9f77mxfz.js +98 -0
- package/web/chunk-9f77mxfz.js.br +0 -0
- package/web/chunk-9f77mxfz.js.gz +0 -0
- package/web/chunk-9g2fam83.js +2 -0
- package/web/chunk-9g2fam83.js.br +0 -0
- package/web/chunk-9g2fam83.js.gz +0 -0
- package/web/chunk-9we3a8ak.js +84 -0
- package/web/chunk-9we3a8ak.js.br +0 -0
- package/web/chunk-9we3a8ak.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-adfd0mhj.js +1 -0
- package/web/chunk-adfd0mhj.js.br +0 -0
- package/web/chunk-adfd0mhj.js.gz +0 -0
- package/web/chunk-aem9wyqq.js +30 -0
- package/web/chunk-aem9wyqq.js.br +0 -0
- package/web/chunk-aem9wyqq.js.gz +0 -0
- package/web/chunk-ajzrsqpp.js +1 -0
- package/web/chunk-ajzrsqpp.js.br +0 -0
- package/web/chunk-ajzrsqpp.js.gz +0 -0
- package/web/chunk-b4t33dft.js +7 -0
- package/web/chunk-b4t33dft.js.br +0 -0
- package/web/chunk-b4t33dft.js.gz +0 -0
- package/web/chunk-b86sddt6.js +1 -0
- package/web/chunk-b86sddt6.js.br +0 -0
- package/web/chunk-b86sddt6.js.gz +0 -0
- package/web/chunk-bt8ww8df.js +142 -0
- package/web/chunk-bt8ww8df.js.br +0 -0
- package/web/chunk-bt8ww8df.js.gz +0 -0
- package/web/chunk-c1tsq0ta.js +1 -0
- package/web/chunk-c1tsq0ta.js.br +0 -0
- package/web/chunk-c1tsq0ta.js.gz +0 -0
- package/web/chunk-ckkd4qn1.js +1 -0
- package/web/chunk-ckkd4qn1.js.br +0 -0
- package/web/chunk-ckkd4qn1.js.gz +0 -0
- package/web/chunk-cxh1ztpm.js +200 -0
- package/web/chunk-cxh1ztpm.js.br +0 -0
- package/web/chunk-cxh1ztpm.js.gz +0 -0
- package/web/chunk-db2pew8j.js +2 -0
- package/web/chunk-db2pew8j.js.br +0 -0
- package/web/chunk-db2pew8j.js.gz +0 -0
- package/web/chunk-dfv95z6w.js +1 -0
- package/web/chunk-dfv95z6w.js.br +0 -0
- package/web/chunk-dfv95z6w.js.gz +0 -0
- package/web/chunk-dk2jv3kv.js +2 -0
- package/web/chunk-dk2jv3kv.js.br +0 -0
- package/web/chunk-dk2jv3kv.js.gz +0 -0
- package/web/chunk-dk9efr2r.js +1 -0
- package/web/chunk-dk9efr2r.js.br +0 -0
- package/web/chunk-dk9efr2r.js.gz +0 -0
- package/web/chunk-dmn5rvmt.js +169 -0
- package/web/chunk-dmn5rvmt.js.br +0 -0
- package/web/chunk-dmn5rvmt.js.gz +0 -0
- package/web/chunk-dtzm3qsp.js +34 -0
- package/web/chunk-dtzm3qsp.js.br +0 -0
- package/web/chunk-dtzm3qsp.js.gz +0 -0
- package/web/chunk-e1j49cha.js +140 -0
- package/web/chunk-e1j49cha.js.br +0 -0
- package/web/chunk-e1j49cha.js.gz +0 -0
- package/web/chunk-e24ammbc.js +292 -0
- package/web/chunk-e24ammbc.js.br +0 -0
- package/web/chunk-e24ammbc.js.gz +0 -0
- package/web/chunk-ebvk893x.js +2 -0
- package/web/chunk-ebvk893x.js.br +0 -0
- package/web/chunk-ebvk893x.js.gz +0 -0
- package/web/chunk-ecv7r3t9.js +24 -0
- package/web/chunk-ecv7r3t9.js.br +0 -0
- package/web/chunk-ecv7r3t9.js.gz +0 -0
- package/web/chunk-etkhjrfg.js +1 -0
- package/web/chunk-etkhjrfg.js.br +0 -0
- package/web/chunk-etkhjrfg.js.gz +0 -0
- package/web/chunk-f3ennx3q.js +1 -0
- package/web/chunk-f3ennx3q.js.br +0 -0
- package/web/chunk-f3ennx3q.js.gz +0 -0
- package/web/chunk-f5wyg9zh.js +2 -0
- package/web/chunk-f5wyg9zh.js.br +0 -0
- package/web/chunk-f5wyg9zh.js.gz +0 -0
- package/web/chunk-f9rv8b13.js +1 -0
- package/web/chunk-f9rv8b13.js.br +0 -0
- package/web/chunk-f9rv8b13.js.gz +0 -0
- package/web/chunk-fpg6cdg9.js +1 -0
- package/web/chunk-fpg6cdg9.js.br +0 -0
- package/web/chunk-fpg6cdg9.js.gz +0 -0
- package/web/chunk-fq9kkd61.js +1 -0
- package/web/chunk-fq9kkd61.js.br +0 -0
- package/web/chunk-fq9kkd61.js.gz +0 -0
- package/web/chunk-fr9gd1pt.js +1 -0
- package/web/chunk-fr9gd1pt.js.br +0 -0
- package/web/chunk-fr9gd1pt.js.gz +0 -0
- package/web/chunk-fsfpgs2w.css +1 -0
- package/web/chunk-fsfpgs2w.css.br +0 -0
- package/web/chunk-fsfpgs2w.css.gz +0 -0
- package/web/chunk-ftggg1s9.js +324 -0
- package/web/chunk-ftggg1s9.js.br +0 -0
- package/web/chunk-ftggg1s9.js.gz +0 -0
- package/web/chunk-g337nkpz.js +2 -0
- package/web/chunk-g337nkpz.js.br +0 -0
- package/web/chunk-g337nkpz.js.gz +0 -0
- package/web/chunk-g52np0en.js +1 -0
- package/web/chunk-g52np0en.js.br +0 -0
- package/web/chunk-g52np0en.js.gz +0 -0
- package/web/chunk-gc6pdwjs.js +2 -0
- package/web/chunk-gc6pdwjs.js.br +0 -0
- package/web/chunk-gc6pdwjs.js.gz +0 -0
- package/web/chunk-gks3ybk7.js +291 -0
- package/web/chunk-gks3ybk7.js.br +0 -0
- package/web/chunk-gks3ybk7.js.gz +0 -0
- package/web/chunk-hr1t5hxj.js +1 -0
- package/web/chunk-hr1t5hxj.js.br +0 -0
- package/web/chunk-hr1t5hxj.js.gz +0 -0
- package/web/chunk-k67ze3zq.js +2 -0
- package/web/chunk-k67ze3zq.js.br +0 -0
- package/web/chunk-k67ze3zq.js.gz +0 -0
- package/web/chunk-kcrkppec.js +1 -0
- package/web/chunk-kcrkppec.js.br +0 -0
- package/web/chunk-kcrkppec.js.gz +0 -0
- package/web/chunk-kd2346aw.js +2 -0
- package/web/chunk-kd2346aw.js.br +0 -0
- package/web/chunk-kd2346aw.js.gz +0 -0
- package/web/chunk-kh93xybm.js +62 -0
- package/web/chunk-kh93xybm.js.br +0 -0
- package/web/chunk-kh93xybm.js.gz +0 -0
- package/web/chunk-m32tg04f.js +1 -0
- package/web/chunk-m32tg04f.js.br +0 -0
- package/web/chunk-m32tg04f.js.gz +0 -0
- package/web/chunk-mg98g3yx.js +106 -0
- package/web/chunk-mg98g3yx.js.br +0 -0
- package/web/chunk-mg98g3yx.js.gz +0 -0
- package/web/chunk-mqdvg55y.js +2 -0
- package/web/chunk-mqdvg55y.js.br +0 -0
- package/web/chunk-mqdvg55y.js.gz +0 -0
- package/web/chunk-mx1e3jgh.js +1 -0
- package/web/chunk-mx1e3jgh.js.br +0 -0
- package/web/chunk-mx1e3jgh.js.gz +0 -0
- package/web/chunk-myg415b8.js +1 -0
- package/web/chunk-myg415b8.js.br +0 -0
- package/web/chunk-myg415b8.js.gz +0 -0
- package/web/chunk-myn0rj98.js +2 -0
- package/web/chunk-myn0rj98.js.br +0 -0
- package/web/chunk-myn0rj98.js.gz +0 -0
- package/web/chunk-nvq8s71g.js +1 -0
- package/web/chunk-nvq8s71g.js.br +0 -0
- package/web/chunk-nvq8s71g.js.gz +0 -0
- package/web/chunk-pphtw0xj.js +7 -0
- package/web/chunk-pphtw0xj.js.br +0 -0
- package/web/chunk-pphtw0xj.js.gz +0 -0
- package/web/chunk-ptdh13r5.js +1 -0
- package/web/chunk-ptdh13r5.js.br +0 -0
- package/web/chunk-ptdh13r5.js.gz +0 -0
- package/web/chunk-q1gyt5y6.js +1 -0
- package/web/chunk-q1gyt5y6.js.br +0 -0
- package/web/chunk-q1gyt5y6.js.gz +0 -0
- package/web/chunk-q3v1563q.js +2 -0
- package/web/chunk-q3v1563q.js.br +0 -0
- package/web/chunk-q3v1563q.js.gz +0 -0
- package/web/chunk-q40c0y7d.js +24 -0
- package/web/chunk-q40c0y7d.js.br +0 -0
- package/web/chunk-q40c0y7d.js.gz +0 -0
- package/web/chunk-q6vt7t8d.js +2 -0
- package/web/chunk-q6vt7t8d.js.br +0 -0
- package/web/chunk-q6vt7t8d.js.gz +0 -0
- package/web/chunk-q7pyqxqn.js +89 -0
- package/web/chunk-q7pyqxqn.js.br +0 -0
- package/web/chunk-q7pyqxqn.js.gz +0 -0
- package/web/chunk-r5rt7t62.js +1 -0
- package/web/chunk-r5rt7t62.js.br +0 -0
- package/web/chunk-r5rt7t62.js.gz +0 -0
- package/web/chunk-ra8jt8jw.js +2 -0
- package/web/chunk-ra8jt8jw.js.br +0 -0
- package/web/chunk-ra8jt8jw.js.gz +0 -0
- package/web/chunk-rgh3x4h4.js +1 -0
- package/web/chunk-rgh3x4h4.js.br +0 -0
- package/web/chunk-rgh3x4h4.js.gz +0 -0
- package/web/chunk-rvcq48wy.js +1 -0
- package/web/chunk-rvcq48wy.js.br +0 -0
- package/web/chunk-rvcq48wy.js.gz +0 -0
- package/web/chunk-rvgx4jhr.js +1 -0
- package/web/chunk-rvgx4jhr.js.br +0 -0
- package/web/chunk-rvgx4jhr.js.gz +0 -0
- package/web/chunk-rxvvg771.js +1 -0
- package/web/chunk-rxvvg771.js.br +0 -0
- package/web/chunk-rxvvg771.js.gz +0 -0
- package/web/chunk-sfb3w9nf.js +1 -0
- package/web/chunk-sfb3w9nf.js.br +2 -0
- package/web/chunk-sfb3w9nf.js.gz +0 -0
- package/web/chunk-srwx1v8c.js +39 -0
- package/web/chunk-srwx1v8c.js.br +0 -0
- package/web/chunk-srwx1v8c.js.gz +0 -0
- package/web/chunk-t1et0w6s.js +2 -0
- package/web/chunk-t1et0w6s.js.br +0 -0
- package/web/chunk-t1et0w6s.js.gz +0 -0
- package/web/chunk-tm7c78hm.js +1 -0
- package/web/chunk-tm7c78hm.js.br +0 -0
- package/web/chunk-tm7c78hm.js.gz +0 -0
- package/web/chunk-tmrh8hv1.js +1 -0
- package/web/chunk-tmrh8hv1.js.br +0 -0
- package/web/chunk-tmrh8hv1.js.gz +0 -0
- package/web/chunk-tntwwpyh.js +2 -0
- package/web/chunk-tntwwpyh.js.br +0 -0
- package/web/chunk-tntwwpyh.js.gz +0 -0
- package/web/chunk-tyengwea.js +12 -0
- package/web/chunk-tyengwea.js.br +0 -0
- package/web/chunk-tyengwea.js.gz +0 -0
- package/web/chunk-v13gqed9.js +2 -0
- package/web/chunk-v13gqed9.js.br +0 -0
- package/web/chunk-v13gqed9.js.gz +0 -0
- package/web/chunk-v6srkjvx.js +41 -0
- package/web/chunk-v6srkjvx.js.br +0 -0
- package/web/chunk-v6srkjvx.js.gz +0 -0
- package/web/chunk-vyn5qg7j.js +1 -0
- package/web/chunk-vyn5qg7j.js.br +0 -0
- package/web/chunk-vyn5qg7j.js.gz +0 -0
- package/web/chunk-w8se91rf.js +2 -0
- package/web/chunk-w8se91rf.js.br +0 -0
- package/web/chunk-w8se91rf.js.gz +0 -0
- package/web/chunk-wc533d3w.js +4 -0
- package/web/chunk-wc533d3w.js.br +0 -0
- package/web/chunk-wc533d3w.js.gz +0 -0
- package/web/chunk-wdd9pasx.js +1 -0
- package/web/chunk-wdd9pasx.js.br +0 -0
- package/web/chunk-wdd9pasx.js.gz +0 -0
- package/web/chunk-we9q8a9q.js +2 -0
- package/web/chunk-we9q8a9q.js.br +0 -0
- package/web/chunk-we9q8a9q.js.gz +0 -0
- package/web/chunk-wjpdjzkt.js +36 -0
- package/web/chunk-wjpdjzkt.js.br +0 -0
- package/web/chunk-wjpdjzkt.js.gz +0 -0
- package/web/chunk-wwnzjj7x.js +2 -0
- package/web/chunk-wwnzjj7x.js.br +0 -0
- package/web/chunk-wwnzjj7x.js.gz +0 -0
- package/web/chunk-wypacndw.js +120 -0
- package/web/chunk-wypacndw.js.br +0 -0
- package/web/chunk-wypacndw.js.gz +0 -0
- package/web/chunk-x3p573sq.js +2 -0
- package/web/chunk-x3p573sq.js.br +0 -0
- package/web/chunk-x3p573sq.js.gz +0 -0
- package/web/chunk-x6zh7fcc.js +16 -0
- package/web/chunk-x6zh7fcc.js.br +0 -0
- package/web/chunk-x6zh7fcc.js.gz +0 -0
- package/web/chunk-x87bgw5s.js +89 -0
- package/web/chunk-x87bgw5s.js.br +0 -0
- package/web/chunk-x87bgw5s.js.gz +0 -0
- package/web/chunk-xevjmmdd.js +217 -0
- package/web/chunk-xevjmmdd.js.br +0 -0
- package/web/chunk-xevjmmdd.js.gz +0 -0
- package/web/chunk-xkqekh81.js +2 -0
- package/web/chunk-xkqekh81.js.br +0 -0
- package/web/chunk-xkqekh81.js.gz +0 -0
- package/web/chunk-xwjytx6p.js +139 -0
- package/web/chunk-xwjytx6p.js.br +0 -0
- package/web/chunk-xwjytx6p.js.gz +0 -0
- package/web/chunk-y0xvbh5g.js +1 -0
- package/web/chunk-y0xvbh5g.js.br +0 -0
- package/web/chunk-y0xvbh5g.js.gz +0 -0
- package/web/chunk-ya7gs2bv.js +1 -0
- package/web/chunk-ya7gs2bv.js.br +0 -0
- package/web/chunk-ya7gs2bv.js.gz +0 -0
- package/web/chunk-ybq42mr5.js +2 -0
- package/web/chunk-ybq42mr5.js.br +0 -0
- package/web/chunk-ybq42mr5.js.gz +0 -0
- package/web/chunk-yhzcc87m.js +3 -0
- package/web/chunk-yhzcc87m.js.br +0 -0
- package/web/chunk-yhzcc87m.js.gz +0 -0
- package/web/chunk-yphdbf42.js +70 -0
- package/web/chunk-yphdbf42.js.br +0 -0
- package/web/chunk-yphdbf42.js.gz +0 -0
- package/web/chunk-ythxsag5.js +40 -0
- package/web/chunk-ythxsag5.js.br +0 -0
- package/web/chunk-ythxsag5.js.gz +0 -0
- package/web/chunk-z0smmkfw.js +2 -0
- package/web/chunk-z0smmkfw.js.br +0 -0
- package/web/chunk-z0smmkfw.js.gz +0 -0
- package/web/chunk-zcjdarjr.js +1 -0
- package/web/chunk-zcjdarjr.js.br +0 -0
- package/web/chunk-zcjdarjr.js.gz +0 -0
- package/web/chunk-zmm3f9sr.js +1 -0
- package/web/chunk-zmm3f9sr.js.br +0 -0
- package/web/chunk-zmm3f9sr.js.gz +0 -0
- package/web/chunk-zxt6qh82.js +2 -0
- package/web/chunk-zxt6qh82.js.br +0 -0
- package/web/chunk-zxt6qh82.js.gz +0 -0
- package/web/explorer-ttd27vzr.png +0 -0
- package/web/finder-aynbqpvz.png +0 -0
- package/web/idea-c8rwk1e2.png +0 -0
- package/web/index.html +1 -1
- package/web/index.html.br +0 -0
- package/web/index.html.gz +0 -0
- package/web/sw.js +3 -1
- package/web/sw.js.br +0 -0
- package/web/sw.js.gz +0 -0
- package/web/vscode-33qgcrqp.png +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-9nkb5q43.js +0 -3
- 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-fsekbhqb.js +0 -3
- 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-tnay319j.js +0 -3
- 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{O}from"./chunk-s27309w7.js";import{Go,ne}from"./chunk-mbf7201c.js";import{s,e,Ut,$r,g,we,Je,Er,mi,Os,hi,fi,gi,yi,bi,wi,Si,xi,ja,qe,Ls,mo,Ds,Ns,vi,_i,Ar,K,Wa,jr,Tr,ho,Ei,G,Ha,Qt,Ce,Wr,Ai,qa,Ti,z,fo,Hr}from"./chunk-wk6vjpmj.js";import{kr,Pr}from"./chunk-8bvjjs3r.js";import{Se}from"./chunk-412mm63g.js";import{Te}from"./chunk-1jtnjzrz.js";import{De,Ie,wn,de,So,Ne}from"./chunk-k3ndw7d4.js";import{C}from"./chunk-bkabw9yr.js";import{ce}from"./chunk-5xj2kq5h.js";import{re,mt,Me,ve,xe,me}from"./chunk-3a3ta83t.js";import{J,nt}from"./chunk-h2br80f8.js";import{m,o}from"./chunk-k8mc2tn3.js";var fa=o(function(oe){var tl=oe&&oe.__extends||function(){var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var c in a)if(a.hasOwnProperty(c))i[c]=a[c]},n(r,t)};return function(r,t){n(r,t);function i(){this.constructor=r}r.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(oe,"__esModule",{value:!0});var j=256,Ri=function(){function n(r){if(r===void 0)r="=";this._paddingCharacter=r}return n.prototype.encodedLength=function(r){if(!this._paddingCharacter)return(r*8+5)/6|0;return(r+2)/3*4|0},n.prototype.encode=function(r){var t="",i=0;for(;i<r.length-2;i+=3){var a=r[i]<<16|r[i+1]<<8|r[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 c=r.length-i;if(c>0){var a=r[i]<<16|(c===2?r[i+1]<<8:0);if(t+=this._encodeByte(a>>>18&63),t+=this._encodeByte(a>>>12&63),c===2)t+=this._encodeByte(a>>>6&63);else t+=this._paddingCharacter||"";t+=this._paddingCharacter||""}return t},n.prototype.maxDecodedLength=function(r){if(!this._paddingCharacter)return(r*6+7)/8|0;return r/4*3|0},n.prototype.decodedLength=function(r){return this.maxDecodedLength(r.length-this._getPaddingLength(r))},n.prototype.decode=function(r){if(r.length===0)return new Uint8Array(0);var t=this._getPaddingLength(r),i=r.length-t,a=new Uint8Array(this.maxDecodedLength(i)),c=0,l=0,u=0,d=0,_=0,v=0,p=0;for(;l<i-4;l+=4)d=this._decodeChar(r.charCodeAt(l+0)),_=this._decodeChar(r.charCodeAt(l+1)),v=this._decodeChar(r.charCodeAt(l+2)),p=this._decodeChar(r.charCodeAt(l+3)),a[c++]=d<<2|_>>>4,a[c++]=_<<4|v>>>2,a[c++]=v<<6|p,u|=d&j,u|=_&j,u|=v&j,u|=p&j;if(l<i-1)d=this._decodeChar(r.charCodeAt(l)),_=this._decodeChar(r.charCodeAt(l+1)),a[c++]=d<<2|_>>>4,u|=d&j,u|=_&j;if(l<i-2)v=this._decodeChar(r.charCodeAt(l+2)),a[c++]=_<<4|v>>>2,u|=v&j;if(l<i-3)p=this._decodeChar(r.charCodeAt(l+3)),a[c++]=v<<6|p,u|=p&j;if(u!==0)throw Error("Base64Coder: incorrect characters for decoding");return a},n.prototype._encodeByte=function(r){var t=r;return t+=65,t+=25-r>>>8&6,t+=51-r>>>8&-75,t+=61-r>>>8&-15,t+=62-r>>>8&3,String.fromCharCode(t)},n.prototype._decodeChar=function(r){var t=j;return t+=(42-r&r-44)>>>8&-j+r-43+62,t+=(46-r&r-48)>>>8&-j+r-47+63,t+=(47-r&r-58)>>>8&-j+r-48+52,t+=(64-r&r-91)>>>8&-j+r-65+0,t+=(96-r&r-123)>>>8&-j+r-97+26,t},n.prototype._getPaddingLength=function(r){var t=0;if(this._paddingCharacter){for(var i=r.length-1;i>=0;i--){if(r[i]!==this._paddingCharacter)break;t++}if(r.length<4||t>2)throw Error("Base64Coder: incorrect padding")}return t},n}();oe.Coder=Ri;var Yt=new Ri;function rl(n){return Yt.encode(n)}oe.encode=rl;function nl(n){return Yt.decode(n)}oe.decode=nl;var da=function(n){tl(r,n);function r(){return n!==null&&n.apply(this,arguments)||this}return r.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)},r.prototype._decodeChar=function(t){var i=j;return i+=(44-t&t-46)>>>8&-j+t-45+62,i+=(94-t&t-96)>>>8&-j+t-95+63,i+=(47-t&t-58)>>>8&-j+t-48+52,i+=(64-t&t-91)>>>8&-j+t-65+0,i+=(96-t&t-123)>>>8&-j+t-97+26,i},r}(Ri);oe.URLSafeCoder=da;var ha=new da;function sl(n){return ha.encode(n)}oe.encodeURLSafe=sl;function il(n){return ha.decode(n)}oe.decodeURLSafe=il;oe.encodedLength=function(n){return Yt.encodedLength(n)};oe.maxDecodedLength=function(n){return Yt.maxDecodedLength(n)};oe.decodedLength=function(n){return Yt.decodedLength(n)}});var ma=o(function(pa,Rn){(function(n,r){var t={};r(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 n.sha256=i})(pa,function(n){n.__esModule=!0,n.digestLength=32,n.blockSize=64;var r=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(p,b,w,S,R){var k,E,y,I,T,P,B,M,W,L,F,ue,Xe;while(R>=64){k=b[0],E=b[1],y=b[2],I=b[3],T=b[4],P=b[5],B=b[6],M=b[7];for(L=0;L<16;L++)F=S+L*4,p[L]=(w[F]&255)<<24|(w[F+1]&255)<<16|(w[F+2]&255)<<8|w[F+3]&255;for(L=16;L<64;L++)W=p[L-2],ue=(W>>>17|W<<15)^(W>>>19|W<<13)^W>>>10,W=p[L-15],Xe=(W>>>7|W<<25)^(W>>>18|W<<14)^W>>>3,p[L]=(ue+p[L-7]|0)+(Xe+p[L-16]|0);for(L=0;L<64;L++)ue=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&P^~T&B)|0)+(M+(r[L]+p[L]|0)|0)|0,Xe=((k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10))+(k&E^k&y^E&y)|0,M=B,B=P,P=T,T=I+ue|0,I=y,y=E,E=k,k=ue+Xe|0;b[0]+=k,b[1]+=E,b[2]+=y,b[3]+=I,b[4]+=T,b[5]+=P,b[6]+=B,b[7]+=M,S+=64,R-=64}return S}var i=function(){function p(){this.digestLength=n.digestLength,this.blockSize=n.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 p.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},p.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()},p.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},p.prototype.finish=function(b){if(!this.finished){var w=this.bytesHashed,S=this.bufferLength,R=w/536870912|0,k=w<<3,E=w%64<56?64:128;this.buffer[S]=128;for(var y=S+1;y<E-8;y++)this.buffer[y]=0;this.buffer[E-8]=R>>>24&255,this.buffer[E-7]=R>>>16&255,this.buffer[E-6]=R>>>8&255,this.buffer[E-5]=R>>>0&255,this.buffer[E-4]=k>>>24&255,this.buffer[E-3]=k>>>16&255,this.buffer[E-2]=k>>>8&255,this.buffer[E-1]=k>>>0&255,t(this.temp,this.state,this.buffer,0,E),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},p.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},p.prototype._saveState=function(b){for(var w=0;w<this.state.length;w++)b[w]=this.state[w]},p.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},p}();n.Hash=i;var a=function(){function p(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 p.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},p.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()},p.prototype.update=function(b){return this.inner.update(b),this},p.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},p.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},p}();n.HMAC=a;function c(p){var b=new i().update(p),w=b.digest();return b.clean(),w}n.hash=c,n.default=c;function l(p,b){var w=new a(p).update(b),S=w.digest();return w.clean(),S}n.hmac=l;function u(p,b,w,S){var R=S[0];if(R===0)throw Error("hkdf: cannot expand more");if(b.reset(),R>1)b.update(p);if(w)b.update(w);b.update(S),b.finish(p),S[0]++}var d=new Uint8Array(n.digestLength);function _(p,b,w,S){if(b===void 0)b=d;if(S===void 0)S=32;var R=new Uint8Array([1]),k=l(b,p),E=new a(k),y=new Uint8Array(E.digestLength),I=y.length,T=new Uint8Array(S);for(var P=0;P<S;P++){if(I===y.length)u(y,E,w,R),I=0;T[P]=y[I++]}return E.clean(),y.fill(0),R.fill(0),T}n.hkdf=_;function v(p,b,w,S){var R=new a(p),k=R.digestLength,E=new Uint8Array(4),y=new Uint8Array(k),I=new Uint8Array(k),T=new Uint8Array(S);for(var P=0;P*k<S;P++){var B=P+1;E[0]=B>>>24&255,E[1]=B>>>16&255,E[2]=B>>>8&255,E[3]=B>>>0&255,R.reset(),R.update(b),R.update(E),R.finish(I);for(var M=0;M<k;M++)y[M]=I[M];for(var M=2;M<=w;M++){R.reset(),R.update(I).finish(I);for(var W=0;W<k;W++)y[W]^=I[W]}for(var M=0;M<k&&P*k+M<S;M++)T[P*k+M]=y[M]}for(var P=0;P<k;P++)y[P]=I[P]=0;for(var P=0;P<4;P++)E[P]=0;return R.clean(),T}n.pbkdf2=v})});var wa=o(function(ga){Object.defineProperty(ga,"__esModule",{value:!0});ga.timingSafeEqual=ol;function _a(n,r=""){if(!n)throw Error(r)}function ol(n,r){if(n.byteLength!==r.byteLength)return!1;if(!(n instanceof DataView))n=new DataView(ArrayBuffer.isView(n)?n.buffer:n);if(!(r instanceof DataView))r=new DataView(ArrayBuffer.isView(r)?r.buffer:r);_a(n instanceof DataView),_a(r instanceof DataView);let t=n.byteLength,i=0,a=-1;while(++a<t)i|=n.getUint8(a)^r.getUint8(a);return i===0}});var xa=o(function(Sa){Object.defineProperty(Sa,"__esModule",{value:!0});Sa.Webhook=Sa.WebhookVerificationError=void 0;var In=fa(),ba=ma(),ka=wa(),ya=300;class Ii extends Error{constructor(n){super(n);Object.setPrototypeOf(this,Ii.prototype),this.name="ExtendableError",this.stack=Error(n).stack}}class Be extends Ii{constructor(n){super(n);Object.setPrototypeOf(this,Be.prototype),this.name="WebhookVerificationError"}}Sa.WebhookVerificationError=Be;class Jt{constructor(n,r){if((r===null||r===void 0?void 0:r.format)==="raw")if(n instanceof Uint8Array)this.key=n;else this.key=Uint8Array.from(n,(t)=>t.charCodeAt(0));else{if(typeof n!=="string")throw Error("Expected secret to be of type string");if(n.startsWith(Jt.prefix))n=n.substring(Jt.prefix.length);this.key=In.decode(n)}if(this.key.length===0)throw Error("Secret can't be empty.")}verify(n,r,t){var i;let a=(i=t===null||t===void 0?void 0:t.jsonParse)!==null&&i!==void 0?i:!0,c={};for(let S of Object.keys(r))c[S.toLowerCase()]=r[S];let l=c["webhook-id"],u=c["webhook-signature"],d=c["webhook-timestamp"];if(!u||!l||!d)throw new Be("Missing required headers");let _=this.verifyTimestamp(d),p=this.sign(l,_,n).split(",")[1],b=u.split(" "),w=new globalThis.TextEncoder;for(let S of b){let[R,k]=S.split(",");if(R!=="v1")continue;if(ka.timingSafeEqual(w.encode(k),w.encode(p))){let E=n.toString();if(E==="")return;if(a)return JSON.parse(E);else return}}throw new Be("No matching signature found")}sign(n,r,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(r.getTime()/1000),c=i.encode(`${n}.${a}.${t}`);return`v1,${In.encode(ba.hmac(this.key,c))}`}verifyTimestamp(n){let r=Math.floor(Date.now()/1000),t=parseInt(n,10);if(Number.isNaN(t))throw new Be("Invalid Signature Headers");if(r-t>ya)throw new Be("Message timestamp too old");if(t>r+ya)throw new Be("Message timestamp too new");return new Date(t*1000)}}Sa.Webhook=Jt;Jt.prefix="whsec_"});var ye=(n,r)=>new Promise((t)=>{if(r?.aborted)return t();let i=()=>{clearTimeout(a),t()},a=setTimeout(()=>{r?.removeEventListener("abort",i),t()},n);r?.addEventListener("abort",i,{once:!0})});var he="0.129.0";var ko=()=>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 n=wc();if(n==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":he,"X-Stainless-OS":yo(Deno.build.os),"X-Stainless-Arch":wo(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":he,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(n==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":he,"X-Stainless-OS":yo(globalThis.process.platform??"unknown"),"X-Stainless-Arch":wo(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let r=bc();if(r)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":he,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${r.browser}`,"X-Stainless-Runtime-Version":r.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":he,"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 n=[{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:r,pattern:t}of n){let i=t.exec(navigator.userAgent);if(i){let a=i[1]||0,c=i[2]||0,l=i[3]||0;return{browser:r,version:`${a}.${c}.${l}`}}}return null}var wo=(n)=>{if(n==="x32")return"x32";if(n==="x86_64"||n==="x64")return"x64";if(n==="arm")return"arm";if(n==="aarch64"||n==="arm64")return"arm64";if(n)return`other:${n}`;return"unknown"},yo=(n)=>{if(n=n.toLowerCase(),n.includes("ios"))return"iOS";if(n==="android")return"Android";if(n==="darwin")return"MacOS";if(n==="win32")return"Windows";if(n==="freebsd")return"FreeBSD";if(n==="openbsd")return"OpenBSD";if(n==="linux")return"Linux";if(n)return`Other:${n}`;return"Unknown"},bo,Mt=()=>bo??(bo=yc());var an=new WeakMap,vo=typeof globalThis.FinalizationRegistry==="function"?new globalThis.FinalizationRegistry((n)=>Ee(n)):null;function kc(n,r){return()=>n.removeEventListener("abort",r)}function xo(n,r,t){an.set(n,kc(r,t))}function Eo(n,r){if(an.has(r))vo?.register(n,r,r)}function Ee(n){let r=an.get(n);if(r)an.delete(n),vo?.unregister(n),r()}function Ao(){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 Ws(...n){let r=globalThis.ReadableStream;if(typeof r>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new r(...n)}function cn(n){let r=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():n[Symbol.iterator]();return Ws({start(){},async pull(t){let{done:i,value:a}=await r.next();if(i)t.close();else t.enqueue(a)},async cancel(){await r.return?.()}})}function Nt(n){if(n[Symbol.asyncIterator])return n;let r=n.getReader();return{async next(){try{let t=await r.read();if(t?.done)r.releaseLock();return t}catch(t){throw r.releaseLock(),t}},async return(){let t=r.cancel();return r.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Ro(n){if(n===null||typeof n!=="object")return;if(n[Symbol.asyncIterator]){await n[Symbol.asyncIterator]().return?.();return}let r=n.getReader(),t=r.cancel();r.releaseLock(),await t}var Io=({headers:n,body:r})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(r)});var Us="RFC3986",js=(n)=>String(n),qs={RFC1738:(n)=>String(n).replace(/%20/g,"+"),RFC3986:js},To="RFC1738";var ln=(n,r)=>(ln=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),ln(n,r)),Ae=(()=>{let n=[];for(let r=0;r<256;++r)n.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return n})();var Ks=1024,Po=(n,r,t,i,a)=>{if(n.length===0)return n;let c=n;if(typeof n==="symbol")c=Symbol.prototype.toString.call(n);else if(typeof n!=="string")c=String(n);if(t==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});let l="";for(let u=0;u<c.length;u+=Ks){let d=c.length>=Ks?c.slice(u,u+Ks):c,_=[];for(let v=0;v<d.length;++v){let p=d.charCodeAt(v);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||a===To&&(p===40||p===41)){_[_.length]=d.charAt(v);continue}if(p<128){_[_.length]=Ae[p];continue}if(p<2048){_[_.length]=Ae[192|p>>6]+Ae[128|p&63];continue}if(p<55296||p>=57344){_[_.length]=Ae[224|p>>12]+Ae[128|p>>6&63]+Ae[128|p&63];continue}v+=1,p=65536+((p&1023)<<10|d.charCodeAt(v)&1023),_[_.length]=Ae[240|p>>18]+Ae[128|p>>12&63]+Ae[128|p>>6&63]+Ae[128|p&63]}l+=_.join("")}return l};function Co(n){if(!n||typeof n!=="object")return!1;return!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))}function zs(n,r){if(qe(n)){let t=[];for(let i=0;i<n.length;i+=1)t.push(r(n[i]));return t}return r(n)}var Mo={brackets(n){return String(n)+"[]"},comma:"comma",indices(n,r){return String(n)+"["+r+"]"},repeat(n){return String(n)}},No=function(n,r){Array.prototype.push.apply(n,qe(r)?r:[r])},Oo,V={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Po,encodeValuesOnly:!1,format:Us,formatter:js,indices:!1,serializeDate(n){return(Oo??(Oo=Function.prototype.call.bind(Date.prototype.toISOString)))(n)},skipNulls:!1,strictNullHandling:!1};function xc(n){return typeof n==="string"||typeof n==="number"||typeof n==="boolean"||typeof n==="symbol"||typeof n==="bigint"}var Vs={};function Lo(n,r,t,i,a,c,l,u,d,_,v,p,b,w,S,R,k,E){let y=n,I=E,T=0,P=!1;while((I=I.get(Vs))!==void 0&&!P){let F=I.get(n);if(T+=1,typeof F<"u")if(F===T)throw RangeError("Cyclic object value");else P=!0;if(typeof I.get(Vs)>"u")T=0}if(typeof _==="function")y=_(r,y);else if(y instanceof Date)y=b?.(y);else if(t==="comma"&&qe(y))y=zs(y,function(F){if(F instanceof Date)return b?.(F);return F});if(y===null){if(c)return d&&!R?d(r,V.encoder,k,"key",w):r;y=""}if(xc(y)||Co(y)){if(d){let F=R?r:d(r,V.encoder,k,"key",w);return[S?.(F)+"="+S?.(d(y,V.encoder,k,"value",w))]}return[S?.(r)+"="+S?.(String(y))]}let B=[];if(typeof y>"u")return B;let M;if(t==="comma"&&qe(y)){if(R&&d)y=zs(y,d);M=[{value:y.length>0?y.join(",")||null:void 0}]}else if(qe(_))M=_;else{let F=Object.keys(y);M=v?F.sort(v):F}let W=u?String(r).replace(/\./g,"%2E"):String(r),L=i&&qe(y)&&y.length===1?W+"[]":W;if(a&&qe(y)&&y.length===0)return L+"[]";for(let F=0;F<M.length;++F){let ue=M[F],Xe=typeof ue==="object"&&typeof ue.value<"u"?ue.value:y[ue];if(l&&Xe===null)continue;let Bs=p&&u?ue.replace(/\./g,"%2E"):ue,gc=qe(y)?typeof t==="function"?t(L,Bs):L:L+(p?"."+Bs:"["+Bs+"]");E.set(n,T);let go=new WeakMap;go.set(Vs,E),No(B,Lo(Xe,gc,t,i,a,c,l,u,t==="comma"&&R&&qe(y)?null:d,_,v,p,b,w,S,R,k,go))}return B}function Ec(n=V){if(typeof n.allowEmptyArrays<"u"&&typeof n.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof n.encodeDotInKeys<"u"&&typeof n.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(n.encoder!==null&&typeof n.encoder<"u"&&typeof n.encoder!=="function")throw TypeError("Encoder has to be a function.");let r=n.charset||V.charset;if(typeof n.charset<"u"&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let t=Us;if(typeof n.format<"u"){if(!ln(qs,n.format))throw TypeError("Unknown format option provided.");t=n.format}let i=qs[t],a=V.filter;if(typeof n.filter==="function"||qe(n.filter))a=n.filter;let c;if(n.arrayFormat&&n.arrayFormat in Mo)c=n.arrayFormat;else if("indices"in n)c=n.indices?"indices":"repeat";else c=V.arrayFormat;if("commaRoundTrip"in n&&typeof n.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let l=typeof n.allowDots>"u"?!!n.encodeDotInKeys===!0?!0:V.allowDots:!!n.allowDots;return{addQueryPrefix:typeof n.addQueryPrefix==="boolean"?n.addQueryPrefix:V.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof n.allowEmptyArrays==="boolean"?!!n.allowEmptyArrays:V.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof n.charsetSentinel==="boolean"?n.charsetSentinel:V.charsetSentinel,commaRoundTrip:!!n.commaRoundTrip,delimiter:typeof n.delimiter>"u"?V.delimiter:n.delimiter,encode:typeof n.encode==="boolean"?n.encode:V.encode,encodeDotInKeys:typeof n.encodeDotInKeys==="boolean"?n.encodeDotInKeys:V.encodeDotInKeys,encoder:typeof n.encoder==="function"?n.encoder:V.encoder,encodeValuesOnly:typeof n.encodeValuesOnly==="boolean"?n.encodeValuesOnly:V.encodeValuesOnly,filter:a,format:t,formatter:i,serializeDate:typeof n.serializeDate==="function"?n.serializeDate:V.serializeDate,skipNulls:typeof n.skipNulls==="boolean"?n.skipNulls:V.skipNulls,sort:typeof n.sort==="function"?n.sort:null,strictNullHandling:typeof n.strictNullHandling==="boolean"?n.strictNullHandling:V.strictNullHandling}}function $o(n,r={}){let t=n,i=Ec(r),a,c;if(typeof i.filter==="function")c=i.filter,t=c("",t);else if(qe(i.filter))c=i.filter,a=c;let l=[];if(typeof t!=="object"||t===null)return"";let u=Mo[i.arrayFormat],d=u==="comma"&&i.commaRoundTrip;if(!a)a=Object.keys(t);if(i.sort)a.sort(i.sort);let _=new WeakMap;for(let b=0;b<a.length;++b){let w=a[b];if(i.skipNulls&&t[w]===null)continue;No(l,Lo(t[w],w,u,d,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,_))}let v=l.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";if(i.charsetSentinel)if(i.charset==="iso-8859-1")p+="utf8=%26%2310003%3B&";else p+="utf8=%E2%9C%93&";return v.length>0?p+v:""}function Fo(n){return $o(n,{arrayFormat:"brackets"})}var Do="urn:ietf:params:oauth:grant-type:jwt-bearer",Bo="refresh_token",un="/v1/oauth/token",Qe="oauth-2025-04-20",Wo="oidc-federation-2026-04-01",Uo=120,ct=30,jo=5,Ho=1048576;function dn(n){if(!n)return;let r;try{r=new URL(n)}catch(i){throw new N(`Invalid token endpoint base URL "${n}": ${i}`)}if(r.protocol==="https:")return;let t=r.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(r.protocol==="http:"&&(t==="localhost"||t==="127.0.0.1"||t==="::1"))return;throw new N(`Refusing to send credential over non-https token endpoint "${n}"`)}async function hn(n,r){let t=await Ic(n),i;try{i=JSON.parse(t)}catch{throw new N(`Token endpoint returned non-JSON response (status ${n.status})`,n.status,Q(t),r)}if(!i.access_token)throw new N(`Token endpoint response missing access_token: ${JSON.stringify(Q(i))}`,n.status,Q(i),r);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new N(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,n.status,Q(i),r);return i}var Ys=2000,Rc=new Set(["error","error_description","error_uri"]);function Q(n){if(n==null)return n;if(typeof n==="string"){let r;try{r=JSON.parse(n)}catch{if(n.length<=Ys)return n;return n.slice(0,Ys)+`... <${n.length-Ys} more chars>`}return JSON.stringify(Q(r))}if(typeof n==="object"&&!Array.isArray(n)){let r={};for(let[t,i]of Object.entries(n))if(Rc.has(t))r[t]=i;return r}return null}async function pn(n,r=(t)=>console.warn(`anthropic-sdk: ${t}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:t}=await import("./chunk-tb3tj3ct.js"),i=n,a;try{i=await t.promises.realpath(n),a=await t.promises.stat(i)}catch{return}let c=a.mode&511;if(c&18)throw new N(`Credentials file at ${i} is group/world-writable (mode 0o${c.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(c&36)throw new N(`Credentials file at ${i} is group/world-readable (mode 0o${c.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);if(typeof process.getuid==="function"&&a.uid!==process.getuid())r(`credentials file at ${i} is owned by uid ${a.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function mn(n,r){let{fs:t,path:i}=await import("./chunk-tb3tj3ct.js"),a=i.dirname(n);await t.promises.mkdir(a,{recursive:!0,mode:448});let c=`${n}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let l=await t.promises.open(c,"w",384);try{await l.writeFile(JSON.stringify(r,null,2)),await l.sync()}finally{await l.close()}await t.promises.rename(c,n)}catch(l){throw await t.promises.unlink(c).catch(()=>{}),l}try{let l=await t.promises.open(a,"r");try{await l.sync()}finally{await l.close()}}catch{}}async function Ic(n){if(!n.body)return"";let r=n.body.getReader(),t=[],i=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(i+l.length>Ho){let u=Ho-i;if(u>0)t.push(l.subarray(0,u));await r.cancel();break}t.push(l),i+=l.length}let a;if(t.length===1)a=t[0];else{a=new Uint8Array(t.reduce((l,u)=>l+u.length,0));let c=0;for(let l of t)a.set(l,c),c+=l.length}return new TextDecoder("utf-8").decode(a)}class N extends g{constructor(n,r=null,t=null,i=null){super(n);this.statusCode=r,this.body=t,this.requestId=i}}function be(){return Math.floor(Date.now()/1000)}class Js{constructor(n,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=n,this.onAdvisoryRefreshError=r}async getToken(){let n=this.nextForce;this.nextForce=!1;let r=this.cached;if(n||r==null)return(await this.refresh(n)).token;if(r.expiresAt==null)return r.token;let t=r.expiresAt-be();if(t>Uo)return r.token;if(t>ct)return this.backgroundRefresh(),r.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(n=!1){if(this.pendingRefresh&&!n)return this.pendingRefresh;return this.doRefresh(n)}backgroundRefresh(){if(this.pendingRefresh)return;if(be()-this.lastAdvisoryError<jo)return;this.doRefresh().catch((n)=>{this.lastAdvisoryError=be(),this.onAdvisoryRefreshError?.(n)})}doRefresh(n=!1){return this.pendingRefresh=this.provider(n?{forceRefresh:!0}:void 0).then((r)=>(this.cached=r,this.pendingRefresh=null,r),(r)=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}var qo=(n)=>{if(typeof globalThis.Buffer<"u"){let r=globalThis.Buffer.from(n,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}if(typeof atob<"u"){let r=atob(n),t=new Uint8Array(r.length);for(let i=0;i<r.length;i++)t[i]=r.charCodeAt(i);return t}throw new g("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined")};var _n=function(){let{crypto:n}=globalThis;if(n?.randomUUID)return _n=n.randomUUID.bind(n),n.randomUUID();let r=new Uint8Array(1),t=n?()=>n.getRandomValues(r)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(i)=>(+i^t()&15>>+i/4).toString(16))};var gn="1.0",Tc=/^[A-Za-z0-9_.-]+$/;function Ko(n){if(!n)throw Error("profile name is empty");if(n==="."||n==="..")throw Error(`profile name "${n}" is not allowed`);if(n.includes("/")||n.includes("\\"))throw Error(`profile name "${n}" must not contain path separators`);if(!Tc.test(n))throw Error(`profile name "${n}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var zo=async(n)=>{var r,t;let i=await Gs();if(i===null)return null;let a=n??await Yo();if(a===null)return null;Ko(a);let{fs:c,path:l}=await import("./chunk-tb3tj3ct.js"),u=l.join(i,"configs",`${a}.json`),d;try{d=await c.promises.readFile(u,"utf-8")}catch(p){if(p?.code!=="ENOENT")throw Error(`failed to read config file ${u}: ${p}`);d=null}if(d===null){let p=K("ANTHROPIC_ORGANIZATION_ID"),b=K("ANTHROPIC_IDENTITY_TOKEN_FILE"),w=K("ANTHROPIC_FEDERATION_RULE_ID");if(w&&p)return{fromFile:!1,config:{organization_id:p,workspace_id:K("ANTHROPIC_WORKSPACE_ID"),base_url:K("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:w,service_account_id:K("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:b?{source:"file",path:b}:void 0,scope:K("ANTHROPIC_SCOPE")}}};return null}let _;try{_=JSON.parse(d)}catch(p){throw Error(`failed to parse config file ${u}: ${p}`)}if(!_.authentication)throw Error(`config file ${u} is missing "authentication"`);let v=_.authentication.type;if(v!=="oidc_federation"&&v!=="user_oauth")throw Error(`authentication.type "${v}" is not a known authentication type`);if(_.organization_id??(_.organization_id=K("ANTHROPIC_ORGANIZATION_ID")),_.workspace_id??(_.workspace_id=K("ANTHROPIC_WORKSPACE_ID")),_.base_url??(_.base_url=K("ANTHROPIC_BASE_URL")),(r=_.authentication).scope??(r.scope=K("ANTHROPIC_SCOPE")),_.authentication.type==="oidc_federation"){if(!_.authentication.identity_token){let p=K("ANTHROPIC_IDENTITY_TOKEN_FILE");if(p)_.authentication.identity_token={source:"file",path:p}}if(!_.authentication.federation_rule_id)_.authentication.federation_rule_id=K("ANTHROPIC_FEDERATION_RULE_ID")??"";(t=_.authentication).service_account_id??(t.service_account_id=K("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:_,fromFile:!0}};var Vo=async(n,r)=>{if(n?.authentication.credentials_path)return n.authentication.credentials_path;let t=await Gs();if(!t)return null;let i=r??await Yo();if(!i)return null;Ko(i);let{path:a}=await import("./chunk-tb3tj3ct.js");return a.join(t,"credentials",`${i}.json`)},Gs=async()=>{if(!Pc())return null;let{path:n}=await import("./chunk-tb3tj3ct.js"),r=K("ANTHROPIC_CONFIG_DIR");if(r)return r;if(Mt()["X-Stainless-OS"]==="Windows"){let c=K("APPDATA");if(c)return n.join(c,"Anthropic");let l=K("USERPROFILE");if(l)return n.join(l,"AppData","Roaming","Anthropic");return null}let i=K("XDG_CONFIG_HOME");if(i)return n.join(i,"anthropic");let a=K("HOME");if(a)return n.join(a,".config","anthropic");return null},Pc=()=>{let n=Mt()["X-Stainless-Runtime"];return n==="node"||n==="deno"},Yo=async()=>{let n=await Gs();if(!n)return null;let r=K("ANTHROPIC_PROFILE");if(r)return r;let{fs:t,path:i}=await import("./chunk-tb3tj3ct.js"),a=i.join(n,"active_config");try{return(await t.promises.readFile(a,"utf-8")).trim()||"default"}catch(c){if(c?.code!=="ENOENT")throw Error(`failed to read ${a}: ${c}`);return"default"}};function Xs(n){if(!n)throw new g("Identity token file path is empty");return async()=>{let{fs:r}=await import("./chunk-tb3tj3ct.js"),t;try{t=await r.promises.readFile(n,"utf-8")}catch(a){throw new g(`Failed to read identity token file at ${n}: ${a}`)}let i=t.trim();if(!i)throw new g(`Identity token file at ${n} is empty`);return i}}function Jo(n){if(!n)throw new g("Identity token value is empty");return()=>n}function Xo(n){return async()=>{dn(n.baseURL);let r=await n.identityTokenProvider();if(r.length>16384)throw new N(`Identity token is ${Math.ceil(r.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let t={grant_type:Do,assertion:r,federation_rule_id:n.federationRuleId,organization_id:n.organizationId};if(n.serviceAccountId)t.service_account_id=n.serviceAccountId;if(n.workspaceId)t.workspace_id=n.workspaceId;let i=`${n.baseURL}${un}`,a;try{a=await n.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Qe},${Wo}`,"User-Agent":n.userAgent||`anthropic-sdk-typescript/${he} oidcFederationProvider`},body:JSON.stringify(t)})}catch(d){throw new N(`Failed to reach token endpoint ${i}: ${d}`)}let c=a.headers.get("Request-Id");if(!a.ok){let d=await a.text().catch(()=>""),_=Q(d),v="";if(a.status===401)v=` Ensure your federation rule matches your identity token. ${n.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 N(`Token exchange failed with status ${a.status}${c?` (request-id ${c})`:""}: ${_}${v}`,a.status,_,c)}let l=await hn(a,c),u=Number(l.expires_in);if(!Number.isFinite(u))throw new N(`Token endpoint response missing required fields: ${JSON.stringify(Q(l))}`,a.status,Q(l),c);return{token:l.access_token,expiresAt:be()+u}}}function Qo(n){return async(r)=>{let{fs:t}=await import("./chunk-tb3tj3ct.js");await pn(n.credentialsPath,n.onSafetyWarning);let i;try{i=await t.promises.readFile(n.credentialsPath,"utf-8")}catch(k){throw new N(`Credentials file not found at ${n.credentialsPath}: ${k}`)}let a;try{a=JSON.parse(i)}catch(k){throw new N(`Credentials file at ${n.credentialsPath} is not valid JSON: ${k}`)}let c=a.access_token;if(!c)throw new N(`Credentials file at ${n.credentialsPath} must include 'access_token'`);let l=a.expires_at;if(!r?.forceRefresh&&(l==null||be()<l-ct))return{token:c,expiresAt:l??null};let u=a.refresh_token;if(!n.clientId||!u)throw new N(`Access token at ${n.credentialsPath} has expired and no refresh is available (client_id ${n.clientId?"set":"empty"}, refresh_token ${u?"set":"empty"})`);dn(n.baseURL);let d={grant_type:Bo,refresh_token:u,client_id:n.clientId},_=`${n.baseURL}${un}`,v;try{v=await n.fetch(_,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":Qe,"User-Agent":n.userAgent||`anthropic-sdk-typescript/${he} userOAuthProvider`},body:JSON.stringify(d)})}catch(k){throw new N(`User OAuth refresh failed to reach token endpoint: ${k}`)}let p=v.headers.get("Request-Id");if(!v.ok){let k=await v.text().catch(()=>"");throw new N(`User OAuth refresh failed (HTTP ${v.status}): ${Q(k)}`,v.status,Q(k),p)}let b=await hn(v,p),w=Number(b.expires_in);if(!Number.isFinite(w))throw new N(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Q(b))}`,v.status,Q(b),p);let S=be()+w,R=b.refresh_token||u;return await mn(n.credentialsPath,{...a,version:gn,type:"oauth_token",access_token:b.access_token,expires_at:S,refresh_token:R}),{token:b.access_token,expiresAt:S}}}function Qs(n,r){let t=n.authentication.credentials_path??null,i=(n.base_url||r.baseURL).replace(/\/+$/,""),a=Cc(n,t,i,r),c={};if(n.workspace_id&&n.authentication.type==="user_oauth")c["anthropic-workspace-id"]=n.workspace_id;return{provider:a,extraHeaders:c,baseURL:n.base_url||void 0}}async function Zo(n,r){let t=await zo(r);if(!t)return null;let{config:i,fromFile:a}=t,c=i.authentication.credentials_path||!a?i:{...i,authentication:{...i.authentication,credentials_path:await Vo(i,r)??void 0}};return Qs(c,n)}function Cc(n,r,t,i){switch(n.authentication.type){case"oidc_federation":{let a=n.authentication,c=Oc(a);if(!c)throw new N("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 N("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(!n.organization_id)throw new N("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let l=Xo({identityTokenProvider:c,federationRuleId:a.federation_rule_id,organizationId:n.organization_id,serviceAccountId:a.service_account_id,workspaceId:n.workspace_id,baseURL:t,fetch:i.fetch,userAgent:i.userAgent});if(r)return Mc(l,r,i.onCacheWriteError,i.onSafetyWarning);return l}case"user_oauth":{if(!r)throw new N("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return Qo({credentialsPath:r,clientId:n.authentication.client_id,baseURL:t,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let a=n.authentication.type;throw new N(`authentication.type "${a}" is not a known authentication type`)}}}function Oc(n){if(n.identity_token){let i=n.identity_token.source;if(i!=="file")throw new N(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!n.identity_token.path)throw new N('identity_token.source "file" requires a non-empty path');return Xs(n.identity_token.path)}let r=K("ANTHROPIC_IDENTITY_TOKEN_FILE");if(r)return Xs(r);let t=K("ANTHROPIC_IDENTITY_TOKEN");if(t)return Jo(t);return null}function Mc(n,r,t,i){return async(a)=>{let{fs:c}=await import("./chunk-tb3tj3ct.js");await pn(r,i);let l;try{let d=await c.promises.readFile(r,"utf-8");l=JSON.parse(d);let _=l?.access_token;if(_&&!a?.forceRefresh){let v=l?.expires_at;if(v==null||be()<v-ct)return{token:_,expiresAt:v??null}}}catch(d){if(d?.code!=="ENOENT"&&!(d instanceof SyntaxError))t?.(d)}let u=await n(a);try{await mn(r,{...l??{},version:gn,type:"oauth_token",access_token:u.token,expires_at:u.expiresAt})}catch(d){t?.(d)}return u}}var se,ie,Lt=(()=>{class n{constructor(){se.set(this,void 0),ie.set(this,void 0),s(this,se,new Uint8Array,"f"),s(this,ie,null,"f")}decode(r){if(r==null)return[];let t=r instanceof ArrayBuffer?new Uint8Array(r):typeof r==="string"?jr(r):r;s(this,se,Wa([e(this,se,"f"),t]),"f");let i=[],a;while((a=Nc(e(this,se,"f"),e(this,ie,"f")))!=null){if(a.carriage&&e(this,ie,"f")==null){s(this,ie,a.index,"f");continue}if(e(this,ie,"f")!=null&&(a.index!==e(this,ie,"f")+1||a.carriage)){i.push(Tr(e(this,se,"f").subarray(0,e(this,ie,"f")-1))),s(this,se,e(this,se,"f").subarray(e(this,ie,"f")),"f"),s(this,ie,null,"f");continue}let c=e(this,ie,"f")!==null?a.preceding-1:a.preceding,l=Tr(e(this,se,"f").subarray(0,c));i.push(l),s(this,se,e(this,se,"f").subarray(a.index),"f"),s(this,ie,null,"f")}return i}flush(){if(!e(this,se,"f").length)return[];return this.decode(`
|
|
3
|
+
`)}}return se=new WeakMap,ie=new WeakMap,n.NEWLINE_CHARS=new Set([`
|
|
4
|
+
`,"\r"]),n.NEWLINE_REGEXP=/\r\n|[\n\r]/g,n})();function Nc(n,r){for(let a=r??0;a<n.length;a++){if(n[a]===10)return{preceding:a,index:a+1,carriage:!1};if(n[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}var $t,Re=(()=>{class n{constructor(r,t,i){this.iterator=r,$t.set(this,void 0),this.controller=t,s(this,$t,i,"f")}static rawEvents(r,t=new AbortController){return ea(r,t)}static fromSSEResponse(r,t,i){let a=!1,c=i?G(i):console;async function*l(){if(a)throw new g("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let u=!1;try{for await(let d of ea(r,t)){if(d.event==="completion")try{yield JSON.parse(d.data)}catch(_){throw c.error("Could not parse message into JSON:",d.data),c.error("From chunk:",d.raw),_}if(d.event==="message_start"||d.event==="message_delta"||d.event==="message_stop"||d.event==="content_block_start"||d.event==="content_block_delta"||d.event==="content_block_stop"||d.event==="message"||d.event==="user.message"||d.event==="user.interrupt"||d.event==="user.tool_confirmation"||d.event==="user.custom_tool_result"||d.event==="user.tool_result"||d.event==="agent.message"||d.event==="agent.thinking"||d.event==="agent.tool_use"||d.event==="agent.tool_result"||d.event==="agent.mcp_tool_use"||d.event==="agent.mcp_tool_result"||d.event==="agent.custom_tool_use"||d.event==="agent.thread_context_compacted"||d.event==="session.status_running"||d.event==="session.status_idle"||d.event==="session.status_rescheduled"||d.event==="session.status_terminated"||d.event==="session.error"||d.event==="session.deleted"||d.event==="session.updated"||d.event==="span.model_request_start"||d.event==="span.model_request_end"||d.event==="span.outcome_evaluation_start"||d.event==="span.outcome_evaluation_ongoing"||d.event==="span.outcome_evaluation_end"||d.event==="user.define_outcome"||d.event==="agent.thread_message_received"||d.event==="agent.thread_message_sent"||d.event==="agent.session_thread_message_received"||d.event==="agent.session_thread_message_sent"||d.event==="session.thread_created"||d.event==="session.thread_status_created"||d.event==="session.thread_status_running"||d.event==="session.thread_status_idle"||d.event==="session.thread_status_rescheduled"||d.event==="session.thread_status_terminated"||d.event==="event_start"||d.event==="event_delta"||d.event==="system.message")try{yield JSON.parse(d.data)}catch(_){throw c.error("Could not parse message into JSON:",d.data),c.error("From chunk:",d.raw),_}if(d.event==="ping")continue;if(d.event==="error"){let _=_i(d.data)??d.data,v=_?.error?.type;throw new we(void 0,_,void 0,r.headers,v)}}u=!0}catch(d){if(Ut(d))return;throw d}finally{if(!u)t.abort();Ee(t)}}return new n(l,t,i)}static fromReadableStream(r,t,i){let a=!1;async function*c(){let u=new Lt,d=Nt(r);for await(let _ of d)for(let v of u.decode(_))yield v;for(let _ of u.flush())yield _}async function*l(){if(a)throw new g("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let u=!1;try{for await(let d of c()){if(u)continue;if(d)yield JSON.parse(d)}u=!0}catch(d){if(Ut(d))return;throw d}finally{if(!u)t.abort();Ee(t)}}return new n(l,t,i)}[($t=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let r=[],t=[],i=this.iterator(),a=(c)=>({next:()=>{if(c.length===0){let l=i.next();r.push(l),t.push(l)}return c.shift()}});return[new n(()=>a(r),this.controller,e(this,$t,"f")),new n(()=>a(t),this.controller,e(this,$t,"f"))]}toReadableStream(){let r=this,t;return Ws({async start(){t=r[Symbol.asyncIterator]()},async pull(i){try{let{value:a,done:c}=await t.next();if(c)return i.close();let l=jr(JSON.stringify(a)+`
|
|
5
|
+
`);i.enqueue(l)}catch(a){i.error(a)}},async cancel(){await t.return?.()}})}}return n})();async function*ea(n,r){if(!n.body){if(r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new g("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 g("Attempted to iterate over a response with no body")}let t=new ta,i=new Lt,a=Nt(n.body);for await(let c of a)for(let l of i.decode(c)){let u=t.decode(l);if(u)yield u}for(let c of i.flush()){let l=t.decode(c);if(l)yield l}}class ta{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(n){if(n.endsWith("\r"))n=n.substring(0,n.length-1);if(!n){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(n),n.startsWith(":"))return null;let[r,t,i]=Lc(n,":");if(i.startsWith(" "))i=i.substring(1);if(r==="event")this.event=i;else if(r==="data")this.data.push(i);return null}}function Lc(n,r){let t=n.indexOf(r);if(t!==-1)return[n.substring(0,t),r,n.substring(t+r.length)];return[n,"",""]}async function yn(n,r){let{response:t,requestLogID:i,retryOfRequestLogID:a,startTime:c}=r,l=await(async()=>{if(r.options.stream)return G(n).debug("response",t.status,t.url,t.headers,t.body),Re.fromSSEResponse(t,r.controller,n);if(t.status===204)return null;if(r.options.__binaryResponse)return t;let d=t.headers.get("content-type")?.split(";")[0]?.trim();if(d?.includes("application/json")||d?.endsWith("+json")){if(t.headers.get("content-length")==="0")return;let b=await t.json();return Ft(b,t)}return await t.text()})().finally(()=>{if(!r.options.stream&&!r.options.__binaryResponse)Ee(r.controller)});return Qt(G(n),`[${i}] response parsed`,{retryOfRequestLogID:a,url:t.url,status:t.status,body:l,durationMs:Date.now()-c}),l}function Ft(n,r){if(!n||typeof n!=="object"||Array.isArray(n))return n;return Object.defineProperties(n,{_request_id:{value:r.headers.get("request-id"),enumerable:!1},_workspace_id:{value:r.headers.get("anthropic-workspace-id"),enumerable:!1}})}var na=new WeakSet;function Zs(n){return typeof n==="object"&&n!==null&&na.has(n)}function sa(n){let r=new Set;while(typeof n==="object"&&n!==null&&!r.has(n)){if(r.add(n),Zs(n)||Ut(n)||n instanceof Er||n instanceof Os)return!0;n=n.cause}return!1}function ei(n,r,t,i){return async(a,c={})=>{if(r.length===0)return n.call(void 0,a,c);let l=c.headers instanceof Headers?c.headers:new Headers(c.headers),u=await Fc(n,r,t,i)({...c,headers:l,url:typeof a==="string"?a:a instanceof URL?a.href:a.url});if(u.bodyUsed||u.body?.locked)throw new g("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return u}}function $c(n,r){let t=new WeakMap;return{options:n,logger:r?G(r):Ha(),parse(i){if(n?.stream&&i.ok)return ra(i,n,r);let a=t.get(i);if(!a)a=ra(i,n,r),t.set(i,a);return a}}}async function ra(n,r,t){if(n.bodyUsed||n.body?.locked)throw new g("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(r?.stream&&n.ok)return Re.fromSSEResponse(n.clone(),new AbortController,t);if(n.status===204)return null;if(r?.__binaryResponse)return n;let a=n.headers.get("content-type")?.split(";")[0]?.trim();if(a?.includes("application/json")||a?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;return Ft(await n.clone().json(),n)}return await n.clone().text()}function Fc(n,r,t,i){let a=async({url:l,...u})=>{try{return await n.call(void 0,l,u)}catch(d){let _=$r(d);throw na.add(_),_}},c=$c(t,i);for(let l=r.length-1;l>=0;l--){let u=r[l],d=a;a=async(_)=>u(_,d,c)}return a}var Ht,bn=(()=>{class n extends Promise{constructor(r,t,i=yn){super((a)=>{a(null)});this.responsePromise=t,this.parseResponse=i,Ht.set(this,void 0),s(this,Ht,r,"f")}_thenUnwrap(r){return new n(e(this,Ht,"f"),this.responsePromise,async(t,i)=>Ft(r(await this.parseResponse(t,i),i),i.response))}asResponse(){return this.responsePromise.then((r)=>r.response)}async withResponse(){let[r,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:r,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((r)=>this.parseResponse(e(this,Ht,"f"),r));return this.parsedPromise}then(r,t){return this.parse().then(r,t)}catch(r){return this.parse().catch(r)}finally(r){return this.parse().finally(r)}}return Ht=new WeakMap,n})();var kn,ti=(()=>{class n{constructor(r,t,i,a){kn.set(this,void 0),s(this,kn,r,"f"),this.options=a,this.response=t,this.body=i}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let r=this.nextPageRequestOptions();if(!r)throw new g("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await e(this,kn,"f").requestAPIList(this.constructor,r)}async*iterPages(){let r=this;yield r;while(r.hasNextPage())r=await r.getNextPage(),yield r}async*[(kn=new WeakMap,Symbol.asyncIterator)](){for await(let r of this.iterPages())for(let t of r.getPaginatedItems())yield t}}return n})(),ia=(()=>{class n extends bn{constructor(r,t,i){super(r,t,async(a,c)=>new i(a,c.response,await yn(a,c),c.options))}async*[Symbol.asyncIterator](){let r=await this;for await(let t of r)yield t}}return n})();class Y extends ti{constructor(n,r,t,i){super(n,r,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 r=this.first_id;if(!r)return null;return{...this.options,query:{...mo(this.options.query),before_id:r}}}let n=this.last_id;if(!n)return null;return{...this.options,query:{...mo(this.options.query),after_id:n}}}}class A extends ti{constructor(n,r,t,i){super(n,r,t,i);this.data=t.data||[],this.next_page=t.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let n=this.next_page;if(!n)return null;return{...this.options,query:{...mo(this.options.query),page:n}}}}class ri extends ti{constructor(n,r,t,i){super(n,r,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 n=this.next_page;if(!n)return null;return{...this.options,query:{...mo(this.options.query),page:n}}}}var si=()=>{if(typeof File>"u"){let{process:n}=globalThis,r=typeof n?.versions?.node==="string"&&parseInt(n.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(r?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Ze(n,r,t){return si(),new File(n,r??"",t)}function Dt(n,r){let t=typeof n==="object"&&n!==null&&(("name"in n)&&n.name&&String(n.name)||("url"in n)&&n.url&&String(n.url)||("filename"in n)&&n.filename&&String(n.filename)||("path"in n)&&n.path&&String(n.path))||"";return r?t.split(/[\\/]/).pop()||void 0:t}var ii=(n)=>n!=null&&typeof n==="object"&&typeof n[Symbol.asyncIterator]==="function";var fe=async(n,r,t=!0)=>({...n,body:await Bc(n.body,r,t)}),oa=new WeakMap;function Dc(n){let r=typeof n==="function"?n:n.fetch,t=oa.get(r);if(t)return t;let i=(async()=>{try{let a="Response"in r?r.Response:(await r("data:,")).constructor,c=new FormData;if(c.toString()===await new a(c).text())return!1;return!0}catch{return!0}})();return oa.set(r,i),i}var Bc=async(n,r,t=!0)=>{if(!await Dc(r))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(n||{}).map(([a,c])=>ni(i,a,c,t))),i};var ni=async(n,r,t,i)=>{if(t===void 0)return;if(t==null)throw TypeError(`Received null for "${r}"; to pass null in FormData, you must use the string 'null'`);if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")n.append(r,String(t));else if(t instanceof Response){let a={},c=t.headers.get("Content-Type");if(c)a={type:c};n.append(r,Ze([await t.blob()],Dt(t,i),a))}else if(ii(t))n.append(r,Ze([await new Response(cn(t)).blob()],Dt(t,i)));else if(t instanceof Blob){let c=typeof File<"u"&&t instanceof File?t.name:Dt(t,i);n.append(r,Ze([t],c,{type:t.type}))}else if(Array.isArray(t))await Promise.all(t.map((a)=>ni(n,r+"[]",a,i)));else if(typeof t.then==="function")throw TypeError(`Received a Promise for "${r}"; await it first, e.g. \`await toFile(...)\``);else if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))throw TypeError(`Received ${t.constructor.name} for "${r}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);else if(typeof t==="object")await Promise.all(Object.entries(t).map(([a,c])=>ni(n,`${r}[${a}]`,c,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=(n)=>n!=null&&typeof n==="object"&&typeof n.size==="number"&&typeof n.type==="string"&&typeof n.text==="function"&&typeof n.slice==="function"&&typeof n.arrayBuffer==="function",Wc=(n)=>n!=null&&typeof n==="object"&&typeof n.name==="string"&&typeof n.lastModified==="number"&&aa(n),Uc=(n)=>n!=null&&typeof n==="object"&&typeof n.url==="string"&&typeof n.blob==="function";async function ai(n,r,t){if(si(),n=await n,r||(r=n instanceof File?n.name:Dt(n,!0)),Wc(n)){if(n instanceof File&&r==null&&t==null)return n;return Ze([await n.arrayBuffer()],r??n.name,{type:n.type,lastModified:n.lastModified,...t})}if(Uc(n)){let a=await n.blob();return r||(r=new URL(n.url).pathname.split(/[\\/]/).pop()),Ze(await oi(a),r,t)}let i=await oi(n);if(!t?.type){let a=i.find((c)=>typeof c==="object"&&("type"in c)&&c.type);if(typeof a==="string")t={...t,type:a}}return Ze(i,r,t)}async function oi(n){let r=[];if(typeof n==="string"||ArrayBuffer.isView(n)||n instanceof ArrayBuffer)r.push(n);else if(aa(n))r.push(n instanceof Blob?n:await n.arrayBuffer());else if(ii(n))for await(let t of n)r.push(...await oi(t));else{let t=n?.constructor?.name;throw Error(`Unexpected data type: ${typeof n}${t?`; constructor: ${t}`:""}${jc(n)}`)}return r}function jc(n){if(typeof n!=="object"||n===null)return"";return`; props: [${Object.getOwnPropertyNames(n).map((t)=>`"${t}"`).join(", ")}]`}class x{constructor(n){this._client=n}}var ca=Symbol.for("brand.privateNullableHeaders");function*Kc(n){if(!n)return;if(ca in n){let{values:i,nulls:a}=n;yield*i.entries();for(let c of a)yield[c,null];return}let r=!1,t;if(n instanceof Headers)t=n.entries();else if(Ls(n))t=n;else r=!0,t=Object.entries(n??{});for(let i of t){let a=i[0];if(typeof a!=="string")throw TypeError("expected header name to be a string");let c=Ls(i[1])?i[1]:[i[1]],l=!1;for(let u of c){if(u===void 0)continue;if(r&&!l)l=!0,yield[a,Sn];yield[a,u]}}}var Sn=Symbol("clear"),zc=new Set(["x-stainless-helper"]),Vc=(n,r)=>{let t=n?n.split(",").map((i)=>i.trim()).filter(Boolean):[];for(let i of r.split(",").map((a)=>a.trim()))if(i&&!t.includes(i))t.push(i);return t.join(", ")},h=(n)=>{let r=new Headers,t=new Set;for(let i of n){let a=new Set;for(let[c,l]of Kc(i)){let u=c.toLowerCase();if(zc.has(u)){if(l===Sn)continue;if(l===null)r.delete(c),t.add(u);else r.set(c,Vc(r.get(c),l)),t.delete(u);continue}if(l===Sn||!a.has(u)){if(r.delete(c),a.add(u),l===Sn)continue}if(l===null)r.delete(c),t.add(u);else r.append(c,l),t.delete(u)}}return{[ca]:!0,values:r,nulls:t}};function ua(n){return n.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var la=Object.freeze(Object.create(null)),Yc=(n=ua)=>function(t,...i){if(t.length===1)return t[0];let a=!1,c=[],l=t.reduce((v,p,b)=>{if(/[?#]/.test(p))a=!0;let w=i[b],S=(a?encodeURIComponent:n)(""+w);if(b!==i.length&&(w==null||typeof w==="object"&&w.toString===Object.getPrototypeOf(Object.getPrototypeOf(w.hasOwnProperty??la)??la)?.toString))S=w+"",c.push({start:v.length+p.length,length:S.length,error:`Value of type ${Object.prototype.toString.call(w).slice(8,-1)} is not a valid path parameter`});return v+p+(b===i.length?"":S)},""),u=l.split(/[?#]/,1)[0],d=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,_;while((_=d.exec(u))!==null)c.push({start:_.index,length:_[0].length,error:`Value "${_[0]}" can't be safely passed as a path parameter`});if(c.sort((v,p)=>v.start-p.start),c.length>0){let v=0,p=c.reduce((b,w)=>{let S=" ".repeat(w.start-v),R="^".repeat(w.length);return v=w.start+w.length,b+S+R},"");throw new g(`Path parameters result in path with invalid segments:
|
|
7
|
+
${c.map((b)=>b.error).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${l}
|
|
10
|
+
${p}`)}return l},f=Yc(ua);class Bt extends x{retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/deployment_runs/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",A,{query:a,...r,headers:h([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}}class Wt extends x{create(n,r){let{betas:t,workspace_id:i,...a}=n;return this._client.post("/v1/deployments?beta=true",{body:a,...r,headers:h([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/deployments/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}update(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/deployments/${n}?beta=true`,{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/deployments?beta=true",A,{query:a,...r,headers:h([{"anthropic-beta":[...t??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}archive(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/deployments/${n}/archive?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}pause(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/deployments/${n}/pause?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}run(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/deployments/${n}/run?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}unpause(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/deployments/${n}/unpause?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}class jt extends x{create(n,r){let{betas:t,workspace_id:i,...a}=n;return this._client.post("/v1/dreams?beta=true",{body:a,...r,headers:h([{"anthropic-beta":[...t??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/dreams/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/dreams?beta=true",A,{query:a,...r,headers:h([{"anthropic-beta":[...t??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}archive(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/dreams/${n}/archive?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}cancel(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/dreams/${n}/cancel?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var vn="x-stainless-helper",ut="x-stainless-helper-method";function xn(n){return{["x-stainless-helper"]:n}}var lt=Symbol("anthropic.sdk.stainlessHelper");function qt(n){return typeof n==="object"&&n!==null&< in n}function ki(n,r){let t=new Set;if(n){for(let i of n)if(qt(i))t.add(i[lt])}if(r)for(let i of r){if(qt(i))t.add(i[lt]);let a=i.content;if(Array.isArray(a))for(let c of a){if(qt(c))t.add(c[lt]);let l=c?.tool?.definition;if(qt(l))t.add(l[lt])}}return Array.from(t)}function En(n,r){let t=ki(n,r);if(t.length===0)return{};return{["x-stainless-helper"]:t.join(", ")}}function An(n){if(qt(n))return{["x-stainless-helper"]:n[lt]};return{}}class Kt extends x{list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/files?beta=true",A,{query:a,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}delete(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.delete(f`/v1/files/${n}?beta=true`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}download(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/files/${n}/content?beta=true`,{...t,headers:h([{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(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/files/${n}?beta=true`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}upload(n,r){let{betas:t,workspace_id:i,...a}=n;return this._client.post("/v1/files?beta=true",fe({body:a,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},An(a.file),r?.headers])},this._client))}}class zt extends x{retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/models/${n}?beta=true`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/models?beta=true",Y,{query:a,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}}class Vt extends x{create(n,r){let{betas:t,workspace_id:i,...a}=n;return this._client.post("/v1/user_profiles?beta=true",{body:a,...r,headers:h([{"anthropic-beta":[...t??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/user_profiles/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}update(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/user_profiles/${n}?beta=true`,{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/user_profiles?beta=true",A,{query:a,...r,headers:h([{"anthropic-beta":[...t??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}createEnrollmentURL(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/user_profiles/${n}/enrollment_url?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var Ea=m(xa(),1);class Gt extends x{parseUnverified(n){return JSON.parse(n)}unwrap(n,r){let t=r?.headers;if(t==null)throw Error("Webhook headers are required in order to verify the signature");let i=r.key===void 0?this._client.webhookKey:r.key;if(!i)throw Error("Webhook key must not be null or empty in order to unwrap");return new Ea.Webhook(i).verify(n,t),JSON.parse(n)}}class Xt extends x{list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/agents/${n}/versions?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var Tn=(()=>{class n extends x{constructor(){super(...arguments);this.versions=new Xt(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/agents?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c,...l}=t??{};return this._client.get(f`/v1/agents/${r}?beta=true`,{query:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}update(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/agents/${r}?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/agents?beta=true",A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/agents/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Versions=Xt,n})();function We(n,r){if(!n)return()=>{};if(n.aborted)return r.abort(),()=>{};let t=()=>r.abort();return n.addEventListener("abort",t),()=>n.removeEventListener("abort",t)}function Pn(n,{authToken:r,helper:t}){if(!r)throw new g(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(r)}`);let i=n,a=i._options.defaultHeaders,c=i._authState?.extraHeaders,l=c?Object.fromEntries(Object.entries(c).filter(([d])=>{let _=d.toLowerCase();return _!=="authorization"&&_!=="x-api-key"})):void 0,u=h([l,a,{[vn]:t}]);return n.withOptions({apiKey:null,authToken:r,baseURL:n.baseURL,credentials:void 0,defaultHeaders:u})}var dt,Cn,pe,On,Mn,Nn,Zt,er,ht,ft,Ln,pt,tr,hl=999,fl=1000,pl=60000,ml=300000,rr=(()=>{class n{constructor(r){dt.set(this,void 0),Cn.set(this,!1),pe.set(this,void 0),On.set(this,void 0),Mn.set(this,void 0),Nn.set(this,void 0),Zt.set(this,void 0),er.set(this,void 0),ht.set(this,void 0),this.client=r.client,this.environmentId=r.environmentId,this.environmentKey=r.environmentKey,this.workerId=r.workerId??wl(),s(this,dt,Pn(r.client,{authToken:r.environmentKey,helper:"environments-work-poller"}),"f"),s(this,Mn,r.autoStop??!0,"f"),s(this,Nn,r.drain??!1,"f"),s(this,Zt,r.blockMs===void 0?hl:r.blockMs,"f"),s(this,er,r.reclaimOlderThanMs??null,"f"),s(this,ht,r.requestOptions,"f"),s(this,pe,new AbortController,"f"),s(this,On,We(r.signal,e(this,pe,"f")),"f")}get signal(){return e(this,pe,"f").signal}abort(){e(this,pe,"f").abort()}async*[(dt=new WeakMap,Cn=new WeakMap,pe=new WeakMap,On=new WeakMap,Mn=new WeakMap,Nn=new WeakMap,Zt=new WeakMap,er=new WeakMap,ht=new WeakMap,Symbol.asyncIterator)](){if(e(this,Cn,"f"))throw new g("Cannot iterate over a consumed WorkPoller");s(this,Cn,!0,"f");let r=G(this.client);r.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let t=new gl(r,this.environmentId);try{let i=0;while(!e(this,pe,"f").signal.aborted){let a;try{a=await e(this,dt,"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,er,"f")!==null?{reclaim_older_than_ms:e(this,er,"f")}:{}},{headers:h([e(this,ht,"f")?.headers]),signal:e(this,pe,"f").signal})}catch(c){if(e(this,pe,"f").signal.aborted)return;if(Wr(c))throw r.error("poll failed permanently, stopping poller",{error:String(c)}),c;let l=Ti(_l(i));r.warn("poll failed, backing off",{error:String(c),backoff_ms:l}),i++,await ye(l,e(this,pe,"f").signal);continue}if(i=0,a==null){if(e(this,Nn,"f"))return;t.onEmptyPoll(),await ye(qa(1000,3000),e(this,pe,"f").signal);continue}t.onClaim(),r.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:a.id,work_type:a.data.type});try{await e(this,dt,"f").beta.environments.work.ack(a.id,{environment_id:a.environment_id},{headers:h([e(this,ht,"f")?.headers]),signal:e(this,pe,"f").signal})}catch(c){r.error("ack failed",{work_id:a.id,error:String(c)});continue}try{yield a}finally{if(e(this,Mn,"f"))try{await e(this,dt,"f").beta.environments.work.stop(a.id,{environment_id:a.environment_id},{headers:h([e(this,ht,"f")?.headers])})}catch(c){if(!Ce(c,409))r.warn("stop failed",{work_id:a.id,error:String(c)})}}}}finally{e(this,On,"f").call(this)}}}return n})();function _l(n){return Ai(n,fl,pl)}var gl=(()=>{class n{constructor(r,t){ft.set(this,void 0),Ln.set(this,void 0),pt.set(this,void 0),tr.set(this,0),s(this,ft,r,"f"),s(this,Ln,t,"f")}onEmptyPoll(){let r=Date.now(),t={component:"work-poller",environment_id:e(this,Ln,"f")};if(e(this,pt,"f")===void 0)s(this,pt,s(this,tr,r,"f"),"f"),e(this,ft,"f").info("idle; polling for work",t);else if(r-e(this,tr,"f")>=ml)s(this,tr,r,"f"),e(this,ft,"f").info(`still polling; idle for ${Math.round((r-e(this,pt,"f"))/1000)}s`,t);else e(this,ft,"f").debug("poll returned no work",t)}onClaim(){s(this,pt,void 0,"f")}}return ft=new WeakMap,Ln=new WeakMap,pt=new WeakMap,tr=new WeakMap,n})();function wl(){let r=globalThis.process?.env?.HOSTNAME;return r?`${r}-${_n()}`:_n()}var _t,Ue,gt,Aa=(()=>{class n{constructor(){_t.set(this,[]),Ue.set(this,[]),gt.set(this,!1)}push(r){if(e(this,gt,"f"))return!1;let t=e(this,Ue,"f").shift();if(t)t({done:!1,value:r});else e(this,_t,"f").push(r);return!0}close(){if(e(this,gt,"f"))return;s(this,gt,!0,"f");while(e(this,Ue,"f").length>0)e(this,Ue,"f").shift()({done:!0,value:void 0})}next(r){if(e(this,_t,"f").length>0)return Promise.resolve({done:!1,value:e(this,_t,"f").shift()});if(e(this,gt,"f")||r?.aborted)return Promise.resolve({done:!0,value:void 0});return new Promise((t)=>{let i=(c)=>{r?.removeEventListener("abort",a),t(c)},a=()=>{let c=e(this,Ue,"f").indexOf(i);if(c>=0)e(this,Ue,"f").splice(c,1);t({done:!0,value:void 0})};e(this,Ue,"f").push(i),r?.addEventListener("abort",a,{once:!0})})}tryShift(){return e(this,_t,"f").shift()}}return _t=new WeakMap,Ue=new WeakMap,gt=new WeakMap,n})();function Pi(n){return"name"in n?n.name:("mcp_server_name"in n)?n.mcp_server_name:n.type}function yl(n){return n instanceof z?n.content:`Error: ${n instanceof Error?n.message:String(n)}`}async function Ra(n,r,t){try{let i=n.parse?n.parse(r):r;return{content:await n.run(i,t),isError:!1}}catch(i){return{content:yl(i),isError:!0}}}var nr,$n,wt,et,ke,U,Fn,X,Hn,sr,Dn,q,yt,ae,bt,je,kt,Fe,Bn,ir,_e,Wn,Ia,Ta,Pa,Ca,Ci,Oa,Un,jn,Oi,Ma,Na;var La=500,bl=1e4,kl=120000,Sl=30000,vl=1000,xl=30000,El=300000,Al=60000;function Fa(n){return n.type==="session.status_idle"&&n.stop_reason?.type==="end_turn"}var Rl=(()=>{class n{constructor(r,t){nr.set(this,void 0),$n.set(this,void 0),wt.set(this,new Set),et.set(this,!1),ke.set(this,void 0),s(this,nr,r,"f"),s(this,$n,t,"f")}noteEvent(r){if(r.type==="user.tool_confirmation")return;if(Fa(r))this.arm();else this.disarm()}block(r){if(e(this,wt,"f").add(r),e(this,ke,"f")!==void 0)s(this,et,!0,"f"),clearTimeout(e(this,ke,"f")),s(this,ke,void 0,"f")}unblock(r){if(e(this,wt,"f").delete(r),e(this,wt,"f").size===0&&e(this,et,"f"))this.arm()}arm(){if(e(this,nr,"f")<=0)return;if(e(this,wt,"f").size>0){s(this,et,!0,"f");return}if(s(this,et,!1,"f"),e(this,ke,"f")!==void 0)clearTimeout(e(this,ke,"f"));s(this,ke,setTimeout(e(this,$n,"f"),e(this,nr,"f")),"f")}disarm(){if(s(this,et,!1,"f"),e(this,ke,"f")!==void 0)clearTimeout(e(this,ke,"f")),s(this,ke,void 0,"f")}}return nr=new WeakMap,$n=new WeakMap,wt=new WeakMap,et=new WeakMap,ke=new WeakMap,n})(),or=(()=>{class n{constructor(r,t){U.add(this),Fn.set(this,!1),X.set(this,void 0),Hn.set(this,void 0),sr.set(this,void 0),Dn.set(this,void 0),q.set(this,void 0),yt.set(this,new Set),ae.set(this,new Set),bt.set(this,new Map),je.set(this,new Map),kt.set(this,new Aa),Fe.set(this,0),Bn.set(this,El),ir.set(this,null),_e.set(this,void 0),this.client=t.client,this.sessionId=r,this.tools=t.tools,this.maxIdleMs=t.maxIdleMs??Al,s(this,q,G(t.client),"f"),s(this,Dn,new Map(t.tools.map((i)=>[Pi(i),i])),"f"),s(this,X,new AbortController,"f"),s(this,Hn,We(t.signal,e(this,X,"f")),"f"),s(this,sr,t.requestOptions,"f"),s(this,_e,new Rl(this.maxIdleMs,()=>{e(this,q,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),e(this,X,"f").abort()}),"f")}get signal(){return e(this,X,"f").signal}abort(){e(this,X,"f").abort()}_setSendRetryWindow(r){s(this,Bn,r,"f")}async*[(Fn=new WeakMap,X=new WeakMap,Hn=new WeakMap,sr=new WeakMap,Dn=new WeakMap,q=new WeakMap,yt=new WeakMap,ae=new WeakMap,bt=new WeakMap,je=new WeakMap,kt=new WeakMap,Fe=new WeakMap,Bn=new WeakMap,ir=new WeakMap,_e=new WeakMap,U=new WeakSet,Symbol.asyncIterator)](){if(e(this,Fn,"f"))throw new g("Cannot iterate over a consumed SessionToolRunner");s(this,Fn,!0,"f"),e(this,q,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let r=e(this,U,"m",Ia).call(this).catch((t)=>{if(!e(this,X,"f").signal.aborted)e(this,q,"f").error("stream loop failed",{error:String(t)});e(this,X,"f").abort()});try{while(!0){let i=await e(this,kt,"f").next(e(this,X,"f").signal);if(i.done)break;yield i.value}await r;let t;while((t=e(this,kt,"f").tryShift())!==void 0)yield t}finally{e(this,X,"f").abort(),e(this,_e,"f").disarm(),await r;try{await e(this,U,"m",Na).call(this)}catch(t){e(this,q,"f").warn("drain failed",{error:String(t)})}e(this,kt,"f").close();for(let t of this.tools)try{await t.close?.()}catch(i){e(this,q,"f").warn("tool.close failed",{tool:Pi(t),error:String(i)})}e(this,Hn,"f").call(this)}}}return Wn=function(){return{...e(this,sr,"f"),headers:h([xn("session-tool-runner"),e(this,sr,"f")?.headers]),signal:e(this,X,"f").signal}},Ia=async function(){let t=e(this,X,"f"),i=La;while(!t.signal.aborted){try{let a=await this.client.beta.sessions.events.stream(this.sessionId,{},e(this,U,"m",Wn).call(this));await e(this,U,"m",Ta).call(this);for await(let c of a)if(i=La,await e(this,U,"m",Ca).call(this,c))return}catch(a){if(t.signal.throwIfAborted(),Wr(a))throw e(this,q,"f").error("permanent stream failure, shutting down",{error:String(a)}),t.abort(),a;e(this,q,"f").warn("stream disconnected, reconnecting",{error:String(a),backoff_ms:i})}t.signal.throwIfAborted(),await ye(i,t.signal),i=Math.min(i*2,bl)}},Ta=async function(){let t=e(this,X,"f"),i=[],a=!1;try{for await(let u of this.client.beta.sessions.events.list(this.sessionId,{limit:1000},e(this,U,"m",Wn).call(this)))e(this,U,"m",Pa).call(this,u,i),a=Fa(u)}catch(u){t.signal.throwIfAborted(),e(this,q,"f").warn("reconcile list failed",{error:String(u)});for(let d of i)e(this,yt,"f").delete(d.id);return}let c=i.filter((u)=>!e(this,ae,"f").has(u.id));e(this,_e,"f").disarm();for(let u of c)await e(this,U,"m",Ci).call(this,u);for(let u of[...e(this,je,"f").values()]){let d=e(this,bt,"f").get(u.id);if(d!==void 0)await e(this,U,"m",Un).call(this,u,d)}let l=c.filter((u)=>!e(this,ae,"f").has(u.id)&&!e(this,je,"f").has(u.id));if(a&&l.length===0)e(this,_e,"f").arm();else e(this,_e,"f").disarm()},Pa=function(t,i){if(t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"){if(e(this,yt,"f").add(t.id),!e(this,ae,"f").has(t.id))i.push(t)}else if(t.type==="user.tool_result")e(this,ae,"f").add(t.tool_use_id);else if(t.type==="user.custom_tool_result")e(this,ae,"f").add(t.custom_tool_use_id);else if(t.type==="user.tool_confirmation"){if(!e(this,ae,"f").has(t.tool_use_id))e(this,bt,"f").set(t.tool_use_id,t.result)}},Ca=async function(t){switch(e(this,_e,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":if(!e(this,yt,"f").has(t.id))e(this,yt,"f").add(t.id),await e(this,U,"m",Ci).call(this,t);return!1;case"user.tool_confirmation":return await e(this,U,"m",Oa).call(this,t),!1;case"user.tool_result":return e(this,ae,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return e(this,ae,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return e(this,q,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),e(this,X,"f").abort(),!0;default:return!1}},Ci=async function(t){let i=t.evaluated_permission,a=i==="deny"?"deny":e(this,bt,"f").get(t.id);if(a===void 0){if(i===void 0||i==="allow")await e(this,U,"m",Oi).call(this,t,void 0);else if(!e(this,je,"f").has(t.id))e(this,q,"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,je,"f").set(t.id,t),e(this,_e,"f").block(t.id);return}await e(this,U,"m",Un).call(this,t,a)},Oa=async function(t){e(this,bt,"f").set(t.tool_use_id,t.result);let i=e(this,je,"f").get(t.tool_use_id);if(i===void 0)return;await e(this,U,"m",Un).call(this,i,t.result)},Un=async function(t,i){let a=e(this,je,"f").delete(t.id);if(i==="allow"){if(e(this,q,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),!a)e(this,_e,"f").block(t.id);try{await e(this,U,"m",Oi).call(this,t,"allow")}finally{e(this,_e,"f").unblock(t.id)}return}if(a)e(this,_e,"f").unblock(t.id);e(this,ae,"f").add(t.id),e(this,q,"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,U,"m",jn).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},jn=function(t){e(this,kt,"f").push(t)},Oi=async function(t,i){var a,c;if(e(this,ae,"f").has(t.id))return;e(this,q,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),s(this,Fe,(a=e(this,Fe,"f"),a++,a),"f");try{let l=e(this,Dn,"f").get(t.name);if(!l){e(this,q,"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,U,"m",jn).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:i});return}let u,d,_=new AbortController,v=We(e(this,X,"f").signal,_),p=setTimeout(()=>_.abort(),kl);try{let S=await Ra(l,t.input,{toolUse:t,toolUseBlock:t,signal:_.signal});u=S.content,d=S.isError}finally{clearTimeout(p),v()}let b=Il(t,d,Tl(u)),w=await e(this,U,"m",Ma).call(this,b,t.id);e(this,U,"m",jn).call(this,{event:t,result:b,toolUseId:t.id,name:t.name,isError:d,posted:w,confirmation:i})}finally{if(s(this,Fe,(c=e(this,Fe,"f"),c--,c),"f"),e(this,Fe,"f")===0)e(this,ir,"f")?.call(this)}},Ma=async function(t,i){let a=e(this,X,"f"),c=Date.now(),l,u=0;while(!0){u++,a.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},e(this,U,"m",Wn).call(this)),e(this,ae,"f").add(i),!0}catch(d){if(l=d,Wr(d))break;let _=e(this,Bn,"f")-(Date.now()-c);if(_<=0)break;let v=Math.min(Ti(Ai(u-1,vl,xl)),_);e(this,q,"f").warn("tool result send failed; retrying",{tool_use_id:i,attempt:u,backoff_ms:v,error:String(d)}),await ye(v,a.signal)}}return e(this,q,"f").error("failed to send tool result",{tool_use_id:i,attempts:u,error:String(l)}),!1},Na=async function(){if(e(this,Fe,"f")===0)return;if(await Promise.race([new Promise((t)=>s(this,ir,t,"f")),ye(Sl)]),s(this,ir,null,"f"),e(this,Fe,"f")>0)e(this,q,"f").warn("drain timeout exceeded")},n})();function Il(n,r,t){if(n.type==="agent.custom_tool_use")return{type:"user.custom_tool_result",custom_tool_use_id:n.id,is_error:r,content:t};return{type:"user.tool_result",tool_use_id:n.id,is_error:r,content:t}}function Tl(n){if(typeof n==="string")return[{type:"text",text:n||"(no output)"}];let r=n.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 r.length>0?r:[{type:"text",text:"(no output)"}]}var qn,ar,Mi,cr,St,Da=30000,Pl=90000,Cl="NO_HEARTBEAT";function Ol(n){return n.resources.some((r)=>r.type==="memory_store")}function Ml(n){if(!n)return null;let r;try{let i=n.replace(/-/g,"+").replace(/_/g,"/"),a=i.padEnd(Math.ceil(i.length/4)*4,"=");r=JSON.parse(Tr(qo(a)))}catch{return null}if(r===null||typeof r!=="object"||Array.isArray(r))return null;let t=r.sessions_token;return typeof t==="string"&&t!==""?t:null}var Ni=(()=>{class n{constructor(r){if(qn.add(this),ar.set(this,void 0),r.unrestrictedPaths!==void 0)throw new g("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=r.client,this.environmentId=r.environmentId,this.environmentKey=r.environmentKey,this.tools=r.tools,this.workdir=r.workdir??process.cwd(),this.maxFileBytes=r.maxFileBytes,this.maxIdleMs=r.maxIdleMs,r.memorySyncIntervalMs!=null)fo(r.memorySyncIntervalMs,"memorySyncIntervalMs");this.memorySyncIntervalMs=r.memorySyncIntervalMs,this.memorySyncDeletions=r.memorySyncDeletions??"enabled",this.workerId=r.workerId,this.requestOptions=r.requestOptions,s(this,ar,r.signal,"f")}async run(r){let{environmentId:t,environmentKey:i}=this;if(t===void 0||i===void 0)throw new g("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let a=r??e(this,ar,"f"),c=new rr({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 l of c)try{await e(this,qn,"m",Mi).call(this,l,i,c.signal)}catch(u){if(c.signal?.aborted)throw u;G(this.client).error("work item failed",{work_id:l.id,error:String(u)})}}async handleItem(r){let t=r?.workId??K("ANTHROPIC_WORK_ID"),i=r?.environmentId??K("ANTHROPIC_ENVIRONMENT_ID"),a=r?.sessionId??K("ANTHROPIC_SESSION_ID"),c=(r?.environmentKey??this.environmentKey??K("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,l=r?.workSecret||K("ANTHROPIC_WORK_SECRET")||null;if(!t)throw new g("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new g("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!a)throw new g("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!c&&!l)throw new g("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let u={id:t,environment_id:i,secret:l,data:{type:"session",id:a}};await e(this,qn,"m",Mi).call(this,u,c,r?.signal??e(this,ar,"f"))}}return ar=new WeakMap,qn=new WeakSet,Mi=async function(t,i,a){let c=G(this.client),l=Ml(t.secret),u=l??i;if(u===void 0)throw new g("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&&l===null)c.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 d=Pn(this.client,{authToken:u,helper:"environments-worker"}),_=t.data.id,v=new AbortController,p=We(a,v),b=new Ll(v),w=await import("./chunk-d2t7tx0d.js"),S,R,k=Fl(d,t,b,c,this.requestOptions,(T)=>{S=T,R?._setSendRetryWindow(T)}).catch((T)=>{if(!v.signal.aborted)c.error("heartbeat loop failed",{work_id:t.id,error:String(T)});v.abort()}),E=async()=>{},y,I=!1;try{if(t.data.type!=="session"){c.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let T=await d.beta.sessions.retrieve(_);if(l===null&&this.memorySyncIntervalMs!==null&&Ol(T))throw new w.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${_}); 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 P={workdir:this.workdir,client:d,session:T,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{E=await w.setupSkills(P)}catch(M){c.warn("skill setup failed",{session_id:_,work_id:t.id,error:String(M)})}if(l!==null&&this.memorySyncIntervalMs!==null)y=new w.SessionMemoryStores(d,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await y.download(T),P.allowedRoots=y.roots,P.readOnlyRoots=y.readOnlyRoots;else c.debug("memory stores disabled for this item",{work_id:t.id});let B=typeof this.tools==="function"?this.tools(P):this.tools??w.betaAgentToolset20260401(P);if(R=new or(_,{client:d,tools:B,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:v.signal}),S!==void 0)R._setSendRetryWindow(S);for await(let M of R)if(y)await y.syncIfDue();I=!v.signal.aborted}finally{try{await E().catch((T)=>{c.warn("skill cleanup failed",{session_id:_,work_id:t.id,error:String(T)})})}finally{if(y){let T=w.MEMORY_FLUSH_TIMEOUT_MS;if(I){if(await Ba(y.finish(),T))c.warn(`final memory sync cut off after ${T}ms; the flush that follows still uploads changed files`,{session_id:_,work_id:t.id})}let P=new AbortController;if(await Ba(y.flushWrites(P.signal),T))P.abort(),c.warn(`memory flush cut off after ${T}ms; changed files it had not uploaded yet are not saved`,{session_id:_,work_id:t.id});await y.dispose().catch((M)=>{c.warn("memory store cleanup failed",{session_id:_,work_id:t.id,error:String(M)})})}}if(b.finish("runner_done"),p(),await k,b.lost)c.info("lease lost; released without stopping it",{session_id:_,work_id:t.id});else await Nl(d,t,c,this.requestOptions)}},n})();async function Ba(n,r){let t;try{return await Promise.race([n.then(()=>!1,()=>!1),new Promise((i)=>{t=setTimeout(()=>i(!0),r)})])}finally{if(t!==void 0)clearTimeout(t)}}async function Nl(n,r,t,i){try{await n.beta.environments.work.stop(r.id,{environment_id:r.environment_id,force:!0},{...i,headers:h([i?.headers])})}catch(a){if(!Ce(a,409))t.error("force-stop on exit failed",{work_id:r.id,error:String(a)})}}var Ll=(()=>{class n{constructor(r){cr.set(this,void 0),St.set(this,void 0),s(this,cr,r,"f")}get signal(){return e(this,cr,"f").signal}finish(r){s(this,St,e(this,St,"f")??r,"f"),e(this,cr,"f").abort()}get lost(){return e(this,St,"f")==="lease_lost"||e(this,St,"f")==="assumed_lost"}}return cr=new WeakMap,St=new WeakMap,n})();function $l(n){let r=n instanceof we?n.error:void 0;for(let t of["error","details","current_state"]){if(!Ns(r))return{};r=r[t]}return Ns(r)?r:{}}async function Fl(n,r,t,i,a,c){let l=Da,u=Pl,d=Date.now(),_=Cl,v=async()=>{let p=new AbortController,b=We(t.signal,p),w=setTimeout(()=>p.abort(),l);try{let S=await n.beta.environments.work.heartbeat(r.id,{environment_id:r.environment_id,expected_last_heartbeat:_},{...a,headers:h([a?.headers]),signal:p.signal});if(d=Date.now(),_=S.last_heartbeat,S.ttl_seconds>0)u=S.ttl_seconds*1000,l=Math.max(1000,Math.min(u/2,Da)),c?.(u);if(S.state==="stopping"||S.state==="stopped")i.info("heartbeat signals shutdown",{work_id:r.id,state:S.state}),t.finish("control_plane_stop");if(!S.lease_extended)i.warn("lease not extended, shutting down",{work_id:r.id}),t.finish("control_plane_stop")}catch(S){if(t.signal.throwIfAborted(),Ce(S,412)){let R=$l(S);i.error("lease lost: heartbeat precondition failed",{work_id:r.id,server_state:R.state,server_ttl_seconds:R.ttl_seconds,server_last_heartbeat:R.last_heartbeat}),t.finish("lease_lost");return}if(Wr(S))throw i.error("permanent heartbeat failure",{work_id:r.id,error:String(S)}),t.finish("heartbeat_rejected"),S;if(Date.now()-d>u){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:r.id,ttl_ms:u,error:String(S)}),t.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:r.id,error:String(S)})}finally{clearTimeout(w),b()}};await v();while(!t.signal.aborted)await ye(l,t.signal),t.signal.throwIfAborted(),await v()}var Kn=(()=>{class n extends x{retrieve(r,t,i){let{environment_id:a,betas:c,workspace_id:l}=t;return this._client.get(f`/v1/environments/${a}/work/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}update(r,t,i){let{environment_id:a,betas:c,workspace_id:l,...u}=t;return this._client.post(f`/v1/environments/${a}/work/${r}?beta=true`,{body:u,...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(r,t={},i){let{betas:a,...c}=t??{};return this._client.getAPIList(f`/v1/environments/${r}/work?beta=true`,A,{query:c,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(r,t,i){let{environment_id:a,betas:c}=t;return this._client.post(f`/v1/environments/${a}/work/${r}/ack?beta=true`,{...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(r,t,i){let{environment_id:a,desired_ttl_seconds:c,expected_last_heartbeat:l,betas:u}=t;return this._client.post(f`/v1/environments/${a}/work/${r}/heartbeat?beta=true`,{query:{desired_ttl_seconds:c,expected_last_heartbeat:l},...i,headers:h([{"anthropic-beta":[...u??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(r,t={},i){let{betas:a,"Anthropic-Worker-ID":c,...l}=t??{};return this._client.get(f`/v1/environments/${r}/work/poll?beta=true`,{query:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"Anthropic-Worker-ID":c}:void 0},i?.headers])})}stats(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/environments/${r}/work/stats?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}stop(r,t,i){let{environment_id:a,betas:c,workspace_id:l,...u}=t;return this._client.post(f`/v1/environments/${a}/work/${r}/stop?beta=true`,{body:u,...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}poller(r){return new rr({...r,client:this._client})}worker(r){return new Ni({...r,client:this._client})}}return n.WorkPoller=rr,n.EnvironmentWorker=Ni,n})();var zn=(()=>{class n extends x{constructor(){super(...arguments);this.work=new Kn(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/environments?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/environments/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}update(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/environments/${r}?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/environments?beta=true",A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.delete(f`/v1/environments/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/environments/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Work=Kn,n})();class lr extends x{create(n,r,t){let{view:i,betas:a,workspace_id:c,...l}=r;return this._client.post(f`/v1/memory_stores/${n}/memories?beta=true`,{query:{view:i},body:l,...t,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}retrieve(n,r,t){let{memory_store_id:i,betas:a,workspace_id:c,...l}=r;return this._client.get(f`/v1/memory_stores/${i}/memories/${n}?beta=true`,{query:l,...t,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}update(n,r,t){let{memory_store_id:i,view:a,betas:c,workspace_id:l,...u}=r;return this._client.post(f`/v1/memory_stores/${i}/memories/${n}?beta=true`,{query:{view:a},body:u,...t,headers:h([{"anthropic-beta":[...c??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/memory_stores/${n}/memories?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,r,t){let{memory_store_id:i,expected_content_sha256:a,betas:c,workspace_id:l}=r;return this._client.delete(f`/v1/memory_stores/${i}/memories/${n}?beta=true`,{query:{expected_content_sha256:a},...t,headers:h([{"anthropic-beta":[...c??[],"agent-memory-2026-07-22"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}}class ur extends x{retrieve(n,r,t){let{memory_store_id:i,betas:a,workspace_id:c,...l}=r;return this._client.get(f`/v1/memory_stores/${i}/memory_versions/${n}?beta=true`,{query:l,...t,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/memory_stores/${n}/memory_versions?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}redact(n,r,t){let{memory_store_id:i,betas:a,workspace_id:c}=r;return this._client.post(f`/v1/memory_stores/${i}/memory_versions/${n}/redact?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}}var Vn=(()=>{class n extends x{constructor(){super(...arguments);this.memories=new lr(this._client),this.memoryVersions=new ur(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/memory_stores?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/memory_stores/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}update(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/memory_stores/${r}?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/memory_stores?beta=true",A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.delete(f`/v1/memory_stores/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/memory_stores/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Memories=lr,n.MemoryVersions=ur,n})();var Yn=(()=>{class n{constructor(r,t){this.iterator=r,this.controller=t}async*decoder(){let r=new Lt;for await(let t of this.iterator)for(let i of r.decode(t))yield JSON.parse(i);for(let t of r.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(r,t){if(!r.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new g("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 g("Attempted to iterate over a response with no body")}return new n(Nt(r.body),t)}}return n})();class dr extends x{create(n,r){let{betas:t,user_profile_id:i,workspace_id:a,...c}=n;return this._client.post("/v1/messages/batches?beta=true",{body:c,...r,headers:h([{"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},r?.headers])})}retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/messages/batches/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Y,{query:a,...r,headers:h([{"anthropic-beta":[...t??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}delete(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.delete(f`/v1/messages/batches/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}cancel(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.post(f`/v1/messages/batches/${n}/cancel?beta=true`,{...t,headers:h([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}async results(n,r={},t){let i=await this.retrieve(n,r,t);if(!i.results_url)throw new g(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:a,workspace_id:c}=r??{};return this._client.get(i.results_url,{...t,headers:h([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((l,u)=>Yn.fromResponse(u.response,u.controller))}}var Jn={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function Ua(n){return n?.output_format??n?.output_config?.format}function Li(n,r,t){let i=Ua(r);if(!r||!("parse"in(i??{})))return{...n,content:n.content.map((a)=>{if(a.type==="text"){let c=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(c,"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 $i(n,r,t)}function $i(n,r,t){let i=null,a=n.content.map((c)=>{if(c.type==="text"){let l=ql(r,c.text);if(i===null)i=l;let u=Object.defineProperty({...c},"parsed_output",{value:l,enumerable:!1});return Object.defineProperty(u,"parsed",{get(){return t.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),l},enumerable:!1})}return c});return{...n,content:a,parsed_output:i}}function ql(n,r){let t=Ua(n);if(t?.type!=="json_schema")return null;try{if("parse"in t)return t.parse(r);return JSON.parse(r)}catch(i){throw new g(`Failed to parse structured output: ${i}`)}}var Kl=(n)=>{let r=0,t=[];while(r<n.length){let i=n[r];if(i==="\\"){r++;continue}if(i==="{"){t.push({type:"brace",value:"{"}),r++;continue}if(i==="}"){t.push({type:"brace",value:"}"}),r++;continue}if(i==="["){t.push({type:"paren",value:"["}),r++;continue}if(i==="]"){t.push({type:"paren",value:"]"}),r++;continue}if(i===":"){t.push({type:"separator",value:":"}),r++;continue}if(i===","){t.push({type:"delimiter",value:","}),r++;continue}if(i==='"'){let u=r+1,d=u,_=!1;while(!0){if(d=n.indexOf('"',d),d===-1){_=!0;break}let v=0,p=d-1;while(p>=u&&n[p]==="\\")v++,p--;if(v%2===0)break;d++}if(_)r=n.length;else t.push({type:"string",value:n.slice(u,d)}),r=d+1;continue}if(i&&/\s/.test(i)){r++;continue}let c=/[0-9]/;if(i&&c.test(i)||i==="-"||i==="."){let u="";if(i==="-")u+=i,i=n[++r];while(i&&(c.test(i)||i==="."||i==="e"||i==="E"||(i==="-"||i==="+")&&(u[u.length-1]==="e"||u[u.length-1]==="E")))u+=i,i=n[++r];t.push({type:"number",value:u,unterminated:r===n.length});continue}let l=/[a-z]/i;if(i&&l.test(i)){let u="";while(i&&l.test(i)){if(r===n.length)break;u+=i,i=n[++r]}if(u=="true"||u=="false"||u==="null")t.push({type:"name",value:u});else{r++;continue}continue}r++}return t},zl=(n)=>{let r=[];for(let c of n)if(c.type==="brace"||c.type==="paren")if(c.value==="{"||c.value==="[")r.push(c.value);else r.pop();let t=r[r.length-1],i=n.length,a=/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/;while(i>0){let c=n[i-1];switch(c.type){case"separator":i--;continue;case"number":if(c.unterminated||!a.test(c.value)){i--;continue}break;case"string":let l=n[i-2];if(t==="{"&&(l?.type==="delimiter"||l?.type==="brace"&&l.value==="{")){i--;continue}break;case"delimiter":i--;break}break}return n.slice(0,i)},Vl=(n)=>{let r=[];if(n.map((t)=>{if(t.type==="brace")if(t.value==="{")r.push("}");else r.splice(r.lastIndexOf("}"),1);if(t.type==="paren")if(t.value==="[")r.push("]");else r.splice(r.lastIndexOf("]"),1)}),r.length>0)r.reverse().map((t)=>{if(t==="}")n.push({type:"brace",value:"}"});else if(t==="]")n.push({type:"paren",value:"]"})});return n},Yl=(n)=>{let r="";return n.map((t)=>{switch(t.type){case"string":r+='"'+t.value+'"';break;default:r+=t.value;break}}),r},Ka=(n)=>JSON.parse(Yl(Vl(zl(Kl(n)))));var Ke="__json_buf";function Gn(n,r){let t={};for(let c of Object.keys(n))if(c!=="input")t[c]=n[c];Object.defineProperty(t,Ke,{value:r,enumerable:!1,writable:!0});let i,a=!1;return Object.defineProperty(t,"input",{enumerable:!0,configurable:!0,get(){if(!a)i=r?Ka(r):{},a=!0;return i}}),t}var Z,ze,vt,hr,Xn,fr,pr,Qn,mr,Pe,_r,Zn,es,tt,ts,rs,ns,gr,Fi,Va,wr,Hi,Di,Bi,Ya,Wi;function Ui(n){return n.type==="tool_use"||n.type==="server_tool_use"||n.type==="mcp_tool_use"}var ss=(()=>{class n{constructor(r,t){Z.add(this),this.messages=[],this.receivedMessages=[],ze.set(this,void 0),vt.set(this,null),this.controller=new AbortController,hr.set(this,void 0),Xn.set(this,()=>{}),fr.set(this,()=>{}),pr.set(this,void 0),Qn.set(this,()=>{}),mr.set(this,()=>{}),Pe.set(this,{}),_r.set(this,!1),Zn.set(this,!1),es.set(this,!1),tt.set(this,!1),ts.set(this,void 0),rs.set(this,void 0),ns.set(this,void 0),gr.set(this,void 0),wr.set(this,(i)=>{if(s(this,Zn,!0,"f"),Ut(i))i=new Je;if(i instanceof Je)return s(this,es,!0,"f"),this._emit("abort",i);if(i instanceof g)return this._emit("error",i);if(i instanceof Error){let a=new g(i.message);return a.cause=i,this._emit("error",a)}return this._emit("error",new g(String(i)))}),s(this,hr,new Promise((i,a)=>{s(this,Xn,i,"f"),s(this,fr,a,"f")}),"f"),s(this,pr,new Promise((i,a)=>{s(this,Qn,i,"f"),s(this,mr,a,"f")}),"f"),e(this,hr,"f").catch(()=>{}),e(this,pr,"f").catch(()=>{}),s(this,vt,r,"f"),s(this,gr,t?.logger??console,"f")}get response(){return e(this,ts,"f")}get request_id(){return e(this,rs,"f")}get workspace_id(){return e(this,ns,"f")}async withResponse(){s(this,tt,!0,"f");let r=await e(this,hr,"f");if(!r)throw Error("Could not resolve a `Response` object");return{data:this,response:r,request_id:r.headers.get("request-id"),workspace_id:r.headers.get("anthropic-workspace-id")}}static fromReadableStream(r){let t=new n(null);return t._run(()=>t._fromReadableStream(r)),t}static createMessage(r,t,i,{logger:a}={}){let c=new n(t,{logger:a});for(let l of t.messages)c._addMessageParam(l);return s(c,vt,{...t,stream:!0},"f"),c._run(()=>c._createMessage(r,{...t,stream:!0},{...i,headers:{...i?.headers,[ut]:"stream"}})),c}_run(r){r().then(()=>{this._emitFinal(),this._emit("end")},e(this,wr,"f"))}_addMessageParam(r){this.messages.push(r)}_addMessage(r,t=!0){if(this.receivedMessages.push(r),t)this._emit("message",r)}async _createMessage(r,t,i){let a=i?.signal,c;if(a){if(a.aborted)this.controller.abort();c=this.controller.abort.bind(this.controller),a.addEventListener("abort",c)}try{e(this,Z,"m",Hi).call(this);let{response:l,data:u}=await r.create({...t,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(l);for await(let d of u)e(this,Z,"m",Di).call(this,d);if(u.controller.signal?.aborted)throw new Je;e(this,Z,"m",Bi).call(this)}finally{if(a&&c)a.removeEventListener("abort",c)}}_connected(r){if(this.ended)return;s(this,ts,r,"f"),s(this,rs,r?.headers.get("request-id"),"f"),s(this,ns,r?.headers.get("anthropic-workspace-id"),"f"),e(this,Xn,"f").call(this,r),this._emit("connect")}get ended(){return e(this,_r,"f")}get errored(){return e(this,Zn,"f")}get aborted(){return e(this,es,"f")}abort(){this.controller.abort()}on(r,t){return(e(this,Pe,"f")[r]||(e(this,Pe,"f")[r]=[])).push({listener:t}),this}off(r,t){let i=e(this,Pe,"f")[r];if(!i)return this;let a=i.findIndex((c)=>c.listener===t);if(a>=0)i.splice(a,1);return this}once(r,t){return(e(this,Pe,"f")[r]||(e(this,Pe,"f")[r]=[])).push({listener:t,once:!0}),this}emitted(r){return new Promise((t,i)=>{if(s(this,tt,!0,"f"),r!=="error")this.once("error",i);this.once(r,t)})}async done(){s(this,tt,!0,"f"),await e(this,pr,"f")}get currentMessage(){return e(this,ze,"f")}async finalMessage(){return await this.done(),e(this,Z,"m",Fi).call(this)}async finalText(){return await this.done(),e(this,Z,"m",Va).call(this)}_emit(r,...t){if(e(this,_r,"f"))return;if(r==="end")s(this,_r,!0,"f"),e(this,Qn,"f").call(this);let i=e(this,Pe,"f")[r];if(i)e(this,Pe,"f")[r]=i.filter((a)=>!a.once),i.forEach(({listener:a})=>a(...t));if(r==="abort"){let a=t[0];if(!e(this,tt,"f")&&!i?.length)Promise.reject(a);e(this,fr,"f").call(this,a),e(this,mr,"f").call(this,a),this._emit("end");return}if(r==="error"){let a=t[0];if(!e(this,tt,"f")&&!i?.length)Promise.reject(a);e(this,fr,"f").call(this,a),e(this,mr,"f").call(this,a),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",e(this,Z,"m",Fi).call(this))}async _fromReadableStream(r,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,Z,"m",Hi).call(this),this._connected(null);let c=Re.fromReadableStream(r,this.controller);for await(let l of c)e(this,Z,"m",Di).call(this,l);if(c.controller.signal?.aborted)throw new Je;e(this,Z,"m",Bi).call(this)}finally{if(i&&a)i.removeEventListener("abort",a)}}[(ze=new WeakMap,vt=new WeakMap,hr=new WeakMap,Xn=new WeakMap,fr=new WeakMap,pr=new WeakMap,Qn=new WeakMap,mr=new WeakMap,Pe=new WeakMap,_r=new WeakMap,Zn=new WeakMap,es=new WeakMap,tt=new WeakMap,ts=new WeakMap,rs=new WeakMap,ns=new WeakMap,gr=new WeakMap,wr=new WeakMap,Z=new WeakSet,Fi=function(){if(this.receivedMessages.length===0)throw new g("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Va=function(){if(this.receivedMessages.length===0)throw new g("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 g("stream ended without producing a content block with type=text");return t.join(" ")},Hi=function(){if(this.ended)return;s(this,ze,void 0,"f")},Di=function(t){if(this.ended)return;let i=e(this,Z,"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(Ui(a)&&e(this,Pe,"f").inputJson?.length){let c;try{c=a.input}catch(l){e(this,wr,"f").call(this,e(this,Z,"m",Wi).call(this,a,l));break}this._emit("inputJson",t.delta.partial_json,c)}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:Ar(t.delta)}break}case"message_stop":{this._addMessageParam(i),this._addMessage(Li(i,e(this,vt,"f"),{logger:e(this,gr,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{s(this,ze,i,"f");break}case"content_block_start":case"message_delta":break}},Bi=function(){if(this.ended)throw new g("stream has ended, this shouldn't happen");let t=e(this,ze,"f");if(!t)throw new g("request ended without sending any chunks");return s(this,ze,void 0,"f"),Li(t,e(this,vt,"f"),{logger:e(this,gr,"f")})},Ya=function(t){let i=e(this,ze,"f");if(t.type==="message_start"){if(i)throw new g(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!i)throw new g(`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&&Ui(a)){let c=(a[Ke]||"")+t.delta.partial_json;i.content[t.index]=Gn(a,c)}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 c={...a,content:t.delta.content};if("encrypted_content"in t.delta)c.encrypted_content=t.delta.encrypted_content;i.content[t.index]=c}break}default:Ar(t.delta)}return i}case"content_block_stop":{let a=i.content.at(t.index);if(a&&Ui(a)&&Ke in a){let c;try{c=a.input}catch(l){c={},e(this,wr,"f").call(this,e(this,Z,"m",Wi).call(this,a,l))}Object.defineProperty(a,"input",{value:c,enumerable:!0,configurable:!0,writable:!0})}return i}}},Wi=function(t,i){let a=t[Ke];return new g(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${a}`)},Symbol.asyncIterator)](){let r=[],t=[],i=!1;return this.on("streamEvent",(a)=>{let c=t.shift();if(c)c.resolve(a);else r.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 c of t)c.reject(a);t.length=0}),this.on("error",(a)=>{i=!0;for(let c of t)c.reject(a);t.length=0}),{next:async()=>{if(!r.length){if(i)return{value:void 0,done:!0};return new Promise((c,l)=>t.push({resolve:c,reject:l})).then((c)=>c?{value:c,done:!1}:{value:void 0,done:!0})}return{value:r.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Re(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return n})();var He,is,rt,xt,os,st,Et,as,Ja,cs,ls,ji=(()=>{class n extends ss{constructor(r,t){super(r);He.add(this),is.set(this,void 0),rt.set(this,0),xt.set(this,[]),os.set(this,[]),st.set(this,void 0),Et.set(this,[]),as.set(this,!1),s(this,is,t,"f")}get toolCalls(){return e(this,os,"f")}static start(r,t,i,a){let c=new n({...t,stream:!0},a);for(let l of t.messages)c._addMessageParam(l);return c._run(()=>c._createMessage(r,{...t,stream:!0},{...i,headers:{...i?.headers,[ut]:"stream"}})),c}_emit(r,...t){var i;if(r!=="streamEvent"||this.ended){super._emit(r,...t);return}s(this,rt,(i=e(this,rt,"f"),i++,i),"f");let[a,c]=t,l=a.type==="content_block_stop"?c.content[a.index]:void 0,u=l?.type==="tool_use"?l:void 0;if(u)e(this,os,"f").push(u);super._emit(r,...t),e(this,He,"m",Ja).call(this,a,u),e(this,He,"m",cs).call(this)}[(is=new WeakMap,rt=new WeakMap,xt=new WeakMap,os=new WeakMap,st=new WeakMap,Et=new WeakMap,as=new WeakMap,He=new WeakSet,Symbol.asyncIterator)](){let r=super[Symbol.asyncIterator](),t={handled:e(this,rt,"f")};e(this,xt,"f").push(t);let i=!1;return{next:async()=>{if(i)i=!1,t.handled++,e(this,He,"m",cs).call(this);try{let a=await r.next();if(i=!a.done,a.done)e(this,He,"m",ls).call(this,t);return a}catch(a){throw e(this,He,"m",ls).call(this,t),a}},return:async()=>{let a=r.return?.();return e(this,He,"m",ls).call(this,t),await a??{value:void 0,done:!0}}}}}return Ja=function(t,i){if(e(this,as,"f"))return;if(t.type==="content_block_start"&&t.content_block.type==="fallback"){s(this,as,!0,"f"),s(this,st,void 0,"f");return}let a=t.type==="content_block_start"||t.type==="message_delta"&&t.delta.stop_reason==="tool_use";if(e(this,st,"f")&&a)e(this,Et,"f").push({toolUse:e(this,st,"f"),event:e(this,rt,"f")}),s(this,st,void 0,"f");if(i)s(this,st,i,"f")},cs=function(){if(this.errored||this.controller.signal.aborted)return;let t=Math.min(e(this,rt,"f"),...e(this,xt,"f").map((i)=>i.handled));while(e(this,Et,"f")[0]&&e(this,Et,"f")[0].event<=t)e(this,is,"f").call(this,e(this,Et,"f").shift().toolUse)},ls=function(t){let i=e(this,xt,"f").indexOf(t);if(i>=0)e(this,xt,"f").splice(i,1),e(this,He,"m",cs).call(this)},n})();var D,At,it,H,ee,te,Ve,Oe,Ye,yr,le,Le,Rt,It,ot,qi,Ga,Ki,zi,br,us,Xa,Vi,Yi,Qa,Ji,Xi=(()=>{class n{constructor(r,t,i){D.add(this),this.client=r,At.set(this,!1),it.set(this,!1),H.set(this,void 0),ee.set(this,void 0),te.set(this,void 0),Ve.set(this,void 0),Oe.set(this,void 0),Ye.set(this,void 0),yr.set(this,0),le.set(this,{status:"idle"}),Le.set(this,void 0),Rt.set(this,null),It.set(this,new Map),ot.set(this,[]),Za(t),Jl(t),ec(t),s(this,H,{params:{...t,messages:JSON.parse(JSON.stringify(t.messages))}},"f");let a=ki(t.tools,t.messages);s(this,ee,{...i,headers:h([xn("BetaToolRunner"),a.length?{[vn]:a.join(", ")}:void 0,i?.headers])},"f"),s(this,Ye,Hr(),"f")}async*[(At=new WeakMap,it=new WeakMap,H=new WeakMap,ee=new WeakMap,te=new WeakMap,Ve=new WeakMap,Oe=new WeakMap,Ye=new WeakMap,yr=new WeakMap,le=new WeakMap,Le=new WeakMap,Rt=new WeakMap,It=new WeakMap,ot=new WeakMap,D=new WeakSet,Symbol.asyncIterator)](){var r;if(e(this,At,"f"))throw new g("Cannot iterate over a consumed stream");s(this,At,!0,"f"),s(this,it,!0,"f"),s(this,Oe,void 0,"f");try{while(!0)try{if(e(this,H,"f").params.max_iterations&&e(this,yr,"f")>=e(this,H,"f").params.max_iterations)break;if(e(this,D,"m",Qa).call(this),e(this,le,"f").status==="scheduled"&&rc(e(this,Rt,"f"))!=="resume"){yield*e(this,D,"m",zi).call(this,e(this,le,"f").config);continue}s(this,it,!1,"f"),s(this,Oe,void 0,"f"),s(this,yr,(r=e(this,yr,"f"),r++,r),"f"),s(this,te,void 0,"f");let{max_iterations:t,runToolsEagerly:i,...a}=e(this,H,"f").params;if(yield*e(this,D,"m",qi).call(this,a),!e(this,it,"f")){let l=await e(this,te,"f"),u=rc(l.stop_reason);s(this,Rt,l.stop_reason,"f"),e(this,H,"f").params.messages.push({role:l.role,content:Ql(l.content)});let{container:d}=e(this,H,"f").params;if(l.container){if(d==null)e(this,H,"f").params.container=l.container.id;else if(typeof d==="object"&&d.id==null)e(this,H,"f").params.container={...d,id:l.container.id}}if(u==="stop"){yield*e(this,D,"m",Vi).call(this);break}if(u==="resume")continue}else s(this,Rt,null,"f");let c=await e(this,D,"m",Yi).call(this,e(this,H,"f").params.messages.at(-1));if(c)e(this,H,"f").params.messages.push(c);else if(!e(this,it,"f")){yield*e(this,D,"m",Vi).call(this);break}}finally{e(this,Ve,"f")?.abort(),s(this,Ve,void 0,"f")}if(await e(this,D,"m",Ki).call(this),!e(this,te,"f"))throw new g("ToolRunner concluded without a message from the server");e(this,Ye,"f").resolve(await e(this,te,"f"))}catch(t){throw s(this,At,!1,"f"),e(this,Ye,"f").promise.catch(()=>{}),e(this,Ye,"f").reject(t),s(this,Ye,Hr(),"f"),t}}setMessagesParams(r){let t=typeof r==="function"?r(e(this,H,"f").params):r;if(Za(t),ec(t),e(this,le,"f").status!=="idle")Gi(t);if(e(this,le,"f").status==="in_flight"&&t.messages!==e(this,H,"f").params.messages)throw new g("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,H,"f").params=t,s(this,it,!0,"f"),s(this,Oe,void 0,"f")}setRequestOptions(r){if(typeof r==="function")s(this,ee,r(e(this,ee,"f")),"f");else s(this,ee,{...e(this,ee,"f"),...r},"f")}async generateToolResponse(r=e(this,ee,"f").signal){let t=await e(this,te,"f")??this.params.messages.at(-1);if(!t)return null;return e(this,D,"m",Yi).call(this,t,r)}deferToolCall(r){let t=typeof r==="string"?r:r.id;if(e(this,Le,"f")&&!e(this,Le,"f").has(t))e(this,Le,"f").set(t,{status:"held"})}get deferredToolCalls(){let r=e(this,Ve,"f"),t=e(this,Le,"f");if(!(r instanceof ji)||!t)return[];return r.toolCalls.filter((i)=>t.get(i.id)?.status==="held")}done(){return e(this,Ye,"f").promise}async runUntilDone(){if(!e(this,At,"f"))for await(let r of this);return this.done()}get params(){return e(this,H,"f").params}pushMessages(...r){this.setMessagesParams((t)=>({...t,messages:[...t.messages,...r]}))}compactBeforeNextTurn(r){if(e(this,le,"f").status==="in_flight")return;Gi(e(this,H,"f").params),s(this,le,{status:"scheduled",config:r??{type:"summarize"}},"f")}addTools(...r){for(let t of r){if("name"in t)e(this,It,"f").set(t.name,"run"in t?t:null);e(this,ot,"f").push({type:"addition",tool:t})}}removeTools(...r){for(let t of r){let i=typeof t==="string"?t:t.name;e(this,It,"f").set(i,null),e(this,ot,"f").push({type:"removal",name:i})}}then(r,t){return this.runUntilDone().then(r,t)}}return qi=async function*(t){if(await e(this,D,"m",Ki).call(this),s(this,Le,void 0,"f"),t.stream)s(this,Ve,e(this,H,"f").params.runToolsEagerly?e(this,D,"m",Ga).call(this,t):this.client.beta.messages.stream({...t},e(this,ee,"f")),"f"),s(this,te,e(this,Ve,"f").finalMessage(),"f"),e(this,te,"f").catch(()=>{}),yield e(this,Ve,"f");else s(this,te,this.client.beta.messages.create({...t,stream:!1},e(this,ee,"f")),"f"),yield e(this,te,"f")},Ga=function(t){let i=new Map;return s(this,Le,i,"f"),ji.start(this.client.beta.messages,t,e(this,ee,"f"),(a)=>{if(i.has(a.id))return;let c=nc(e(this,D,"m",br).call(this),e(this,D,"m",us).call(this),a,e(this,ee,"f"));c.catch(()=>{}),i.set(a.id,{status:"started",result:c})})},Ki=async function(){let t=[...e(this,Le,"f")?.values()??[]].filter((i)=>i.status==="started");await Promise.allSettled(t.map((i)=>i.result))},zi=async function*(t){Gi(e(this,H,"f").params);let{max_iterations:i,runToolsEagerly:a,...c}=e(this,H,"f").params,l=Gl(c);s(this,le,{status:"in_flight"},"f"),s(this,Oe,void 0,"f");let u=e(this,te,"f");try{yield*e(this,D,"m",qi).call(this,{...l,compaction:t});let d=await e(this,te,"f");if(d.content.some((_)=>_.type==="compaction"&&_.content))e(this,D,"m",Xa).call(this),e(this,H,"f").params.messages=[{role:d.role,content:d.content}];else G(this.client).warn("Compaction produced no summary; keeping the conversation as it is."),s(this,te,u,"f")}finally{s(this,le,{status:"idle"},"f")}},br=function(){let t=new Map;for(let i of e(this,H,"f").params.tools)if("run"in i)t.set(i.name,i);for(let[i,a]of e(this,It,"f"))if(a)t.set(i,a);else t.delete(i);return t},us=function(){let t=new Set(e(this,D,"m",br).call(this).keys());for(let i of[...e(this,H,"f").params.messages,e(this,D,"m",Ji).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 c of a.tool_changes??[])tc(c,t)}return t},Xa=function(){let t=e(this,D,"m",us).call(this);for(let i of e(this,D,"m",br).call(this).keys())if(!t.has(i))e(this,It,"f").set(i,null)},Vi=async function*(){if(e(this,le,"f").status!=="scheduled")return;let t=e(this,H,"f").params.messages.at(-1)?.content;if(Array.isArray(t)&&t.some((i)=>i.type==="tool_use")){G(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."),s(this,le,{status:"idle"},"f");return}yield*e(this,D,"m",zi).call(this,e(this,le,"f").config)},Yi=async function(t,i=e(this,ee,"f").signal){if(e(this,Oe,"f")!==void 0)return e(this,Oe,"f");return s(this,Oe,Xl(e(this,D,"m",br).call(this),e(this,D,"m",us).call(this),t,{...e(this,ee,"f"),signal:i},e(this,Le,"f")),"f"),e(this,Oe,"f")},Qa=function(){if(e(this,Rt,"f")==="pause_turn"||e(this,ot,"f").length===0)return;e(this,H,"f").params.messages.push(e(this,D,"m",Ji).call(this)),s(this,ot,[],"f")},Ji=function(){let t=[];for(let i of e(this,ot,"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:c,parse:l,close:u,...d}=i.tool;a=d}t.push({type:"tool_addition",tool:{type:"tool_definition",definition:a}})}return{role:"system",content:t}},n})();function Za(n){if("compaction"in n&&n.compaction!=null)throw new g("`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(n){if("compactionControl"in n&&n.compactionControl!=null)throw new g("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted.")}function ec(n){if(n.runToolsEagerly&&!n.stream)throw TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole.")}function Gi(n){if(n.context_management?.edits?.some((r)=>r.type.startsWith("compact_")))throw new g("`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(n){let{context_management:r,stop_sequences:t,output_format:i,...a}=n,c=({format:l,...u})=>u;if(a.tool_choice?.type==="any"||a.tool_choice?.type==="tool")delete a.tool_choice;if(a.output_config)a.output_config=c(a.output_config);if(Array.isArray(a.fallbacks))a.fallbacks=a.fallbacks.map((l)=>l.output_config?{...l,output_config:c(l.output_config)}:l);return a}async function Xl(n,r,t,i,a){if(!t||t.role!=="assistant"||!t.content||typeof t.content==="string")return null;let c=t.content.filter((u)=>u.type==="tool_use");if(c.length===0)return null;return{role:"user",content:await Promise.all(c.map((u)=>{let d=a?.get(u.id);if(d?.status==="started")return d.result;let _=nc(n,r,u,i);return a?.set(u.id,{status:"started",result:_}),_}))}}async function nc(n,r,t,i){let a=r.has(t.name)?n.get(t.name):void 0;if(!a)return Zl(t);try{let c=t.input;if("parse"in a&&a.parse)c=a.parse(c);let l=await a.run(c,{toolUse:t,toolUseBlock:t,signal:i?.signal});return{type:"tool_result",tool_use_id:t.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:t.id,content:c instanceof z?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}function Ql(n){return n}function Zl(n){return{type:"tool_result",tool_use_id:n.id,content:`Error: Tool '${n.name}' not found`,is_error:!0}}function tc(n,r){switch(n.type){case"tool_removal":case"tool_addition":eu(n,r);break}}function eu(n,r){let t=tu(n.tool);if(t===void 0)return;if(n.type==="tool_removal")r.delete(t);else r.add(t)}function tu(n){switch(n.type){case"tool_reference":return n.name;case"tool_definition":return"name"in n.definition?n.definition.name:void 0;default:return}}function rc(n){if(n===null)return"stop";switch(n){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 Ar(n),"stop"}}var sc={},ru=["claude-mythos-preview","claude-opus-4-6"],ds=(()=>{class n extends x{constructor(){super(...arguments);this.batches=new dr(this._client)}create(r,t){let i=ic(r),{betas:a,user_profile_id:c,workspace_id:l,...u}=i;if(u.model in sc)console.warn(`The model '${u.model}' is deprecated and will reach end-of-life on ${sc[u.model]}
|
|
11
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(ru.includes(u.model)&&u.thinking&&u.thinking.type==="enabled")console.warn(`Using Claude with ${u.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 d=t?.timeout??this._client._options.timeout;if(!u.stream&&d==null){let v=Jn[u.model]??void 0;d=this._client.calculateNonstreamingTimeout(u.max_tokens,v)}let _=En(u.tools,u.messages);return this._client.post("/v1/messages?beta=true",{body:u,timeout:d??600000,...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-user-profile-id":c}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},_,t?.headers]),stream:i.stream??!1})}parse(r,t){return t={...t,headers:h([{"anthropic-beta":[...r.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(r,t).then((i)=>$i(i,r,{logger:this._client.logger??console}))}stream(r,t){return ss.createMessage(this,r,t)}countTokens(r,t){let i=ic(r),{betas:a,user_profile_id:c,workspace_id:l,...u}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:u,...t,headers:h([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString(),...c!=null?{"anthropic-user-profile-id":c}:void 0,...l!=null?{"anthropic-workspace-id":l}:void 0},t?.headers])})}toolRunner(r,t){return new Xi(this._client,r,t)}}return n.Batches=dr,n.BetaToolRunner=Xi,n.ToolError=z,n})();function ic(n){if(!n.output_format)return n;if(n.output_config?.format)throw new g("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:r,...t}=n;return{...t,output_config:{...n.output_config,format:r}}}class Sr extends x{retrieve(n,r){return this._client.get(f`/v1/organizations/api_keys/${n}?beta=true`,r)}update(n,r,t){return this._client.post(f`/v1/organizations/api_keys/${n}?beta=true`,{body:r,...t})}list(n={},r){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",Y,{query:n,...r})}}class vr extends x{retrieve(n){return this._client.get("/v1/organizations/compliance_settings?beta=true",n)}update(n,r){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:n,...r})}}class xr extends x{create(n,r){return this._client.post("/v1/organizations/external_keys?beta=true",{body:n,...r})}retrieve(n,r){return this._client.get(f`/v1/organizations/external_keys/${n}?beta=true`,r)}update(n,r,t){return this._client.post(f`/v1/organizations/external_keys/${n}?beta=true`,{body:r,...t})}list(n={},r){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",A,{query:n,...r})}delete(n,r){return this._client.delete(f`/v1/organizations/external_keys/${n}?beta=true`,r)}validate(n,r){return this._client.post(f`/v1/organizations/external_keys/${n}/validate?beta=true`,r)}}class Rr extends x{create(n,r){return this._client.post("/v1/organizations/invites?beta=true",{body:n,...r})}retrieve(n,r){return this._client.get(f`/v1/organizations/invites/${n}?beta=true`,r)}list(n={},r){return this._client.getAPIList("/v1/organizations/invites?beta=true",Y,{query:n,...r})}delete(n,r){return this._client.delete(f`/v1/organizations/invites/${n}?beta=true`,r)}}class Ir extends x{list(n={},r){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",A,{query:n,...r})}}class Cr extends x{retrieve(n,r){return this._client.get(f`/v1/organizations/users/${n}?beta=true`,r)}update(n,r,t){return this._client.post(f`/v1/organizations/users/${n}?beta=true`,{body:r,...t})}list(n={},r){return this._client.getAPIList("/v1/organizations/users?beta=true",Y,{query:n,...r})}remove(n,r){return this._client.delete(f`/v1/organizations/users/${n}?beta=true`,r)}}class Or extends x{create(n,r){let{betas:t,...i}=n;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:i,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0},r?.headers])})}retrieve(n,r={},t){let{betas:i}=r??{};return this._client.get(f`/v1/organizations/federation_issuers/${n}?beta=true`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}update(n,r,t){let{betas:i,...a}=r;return this._client.post(f`/v1/organizations/federation_issuers/${n}?beta=true`,{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}list(n={},r){let{betas:t,...i}=n??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",A,{query:i,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0},r?.headers])})}archive(n,r={},t){let{betas:i}=r??{};return this._client.post(f`/v1/organizations/federation_issuers/${n}/archive?beta=true`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}}class Mr extends x{list(n,r={},t){let{betas:i,...a}=r??{};return this._client.getAPIList(f`/v1/organizations/federation_rules/${n}/workspaces?beta=true`,A,{query:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(n,r,t){let{betas:i,...a}=r;return this._client.post(f`/v1/organizations/federation_rules/${n}/workspaces?beta=true`,{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(n,r,t){let{federation_rule_id:i,betas:a}=r;return this._client.delete(f`/v1/organizations/federation_rules/${i}/workspaces/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var hs=(()=>{class n extends x{constructor(){super(...arguments);this.workspaces=new Mr(this._client)}create(r,t){let{betas:i,...a}=r;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a}=t??{};return this._client.get(f`/v1/organizations/federation_rules/${r}?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}update(r,t,i){let{betas:a,...c}=t;return this._client.post(f`/v1/organizations/federation_rules/${r}?beta=true`,{body:c,...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}list(r={},t){let{betas:i,...a}=r??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",A,{query:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}archive(r,t={},i){let{betas:a}=t??{};return this._client.post(f`/v1/organizations/federation_rules/${r}/archive?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}return n.Workspaces=Mr,n})();var fs=(()=>{class n extends x{constructor(){super(...arguments);this.issuers=new Or(this._client),this.rules=new hs(this._client)}}return n.Issuers=Or,n.Rules=hs,n})();class Nr extends x{list(n,r={},t){let{betas:i,...a}=r??{};return this._client.getAPIList(f`/v1/organizations/service_accounts/${n}/workspaces?beta=true`,A,{query:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(n,r,t){let{betas:i,...a}=r;return this._client.post(f`/v1/organizations/service_accounts/${n}/workspaces?beta=true`,{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(n,r,t){let{service_account_id:i,betas:a}=r;return this._client.delete(f`/v1/organizations/service_accounts/${i}/workspaces/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var ps=(()=>{class n extends x{constructor(){super(...arguments);this.workspaces=new Nr(this._client)}create(r,t){let{betas:i,...a}=r;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a}=t??{};return this._client.get(f`/v1/organizations/service_accounts/${r}?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}update(r,t,i){let{betas:a,...c}=t;return this._client.post(f`/v1/organizations/service_accounts/${r}?beta=true`,{body:c,...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}list(r={},t){let{betas:i,...a}=r??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",A,{query:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}archive(r,t={},i){let{betas:a}=t??{};return this._client.post(f`/v1/organizations/service_accounts/${r}/archive?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}return n.Workspaces=Nr,n})();class Lr extends x{retrieve(n,r,t){let{workspace_id:i}=r;return this._client.get(f`/v1/organizations/workspaces/${i}/members/${n}?beta=true`,t)}update(n,r,t){let{workspace_id:i,...a}=r;return this._client.post(f`/v1/organizations/workspaces/${i}/members/${n}?beta=true`,{body:a,...t})}list(n,r={},t){return this._client.getAPIList(f`/v1/organizations/workspaces/${n}/members?beta=true`,Y,{query:r,...t})}add(n,r,t){return this._client.post(f`/v1/organizations/workspaces/${n}/members?beta=true`,{body:r,...t})}remove(n,r,t){let{workspace_id:i}=r;return this._client.delete(f`/v1/organizations/workspaces/${i}/members/${n}?beta=true`,t)}}class Fr extends x{list(n,r={},t){return this._client.getAPIList(f`/v1/organizations/workspaces/${n}/rate_limits?beta=true`,A,{query:r,...t})}}class Dr extends x{retrieve(n,r,t){let{workspace_id:i,betas:a}=r;return this._client.get(f`/v1/organizations/workspaces/${i}/service_accounts/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}update(n,r,t){let{workspace_id:i,betas:a,...c}=r;return this._client.post(f`/v1/organizations/workspaces/${i}/service_accounts/${n}?beta=true`,{body:c,...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,...a}=r??{};return this._client.getAPIList(f`/v1/organizations/workspaces/${n}/service_accounts?beta=true`,A,{query:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}add(n,r,t){let{betas:i,...a}=r;return this._client.post(f`/v1/organizations/workspaces/${n}/service_accounts?beta=true`,{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}remove(n,r,t){let{workspace_id:i,betas:a}=r;return this._client.delete(f`/v1/organizations/workspaces/${i}/service_accounts/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},t?.headers])})}}var ms=(()=>{class n extends x{constructor(){super(...arguments);this.rateLimits=new Fr(this._client),this.members=new Lr(this._client),this.serviceAccounts=new Dr(this._client)}create(r,t){let{betas:i,...a}=r;return this._client.post("/v1/organizations/workspaces?beta=true",{body:a,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},t?.headers])})}retrieve(r,t){return this._client.get(f`/v1/organizations/workspaces/${r}?beta=true`,t)}update(r,t,i){return this._client.post(f`/v1/organizations/workspaces/${r}?beta=true`,{body:t,...i})}list(r={},t){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",Y,{query:r,...t})}archive(r,t){return this._client.post(f`/v1/organizations/workspaces/${r}/archive?beta=true`,t)}}return n.RateLimits=Fr,n.Members=Lr,n.ServiceAccounts=Dr,n})();var _s=(()=>{class n extends x{constructor(){super(...arguments);this.apiKeys=new Sr(this._client),this.externalKeys=new xr(this._client),this.federation=new fs(this._client),this.invites=new Rr(this._client),this.serviceAccounts=new ps(this._client),this.users=new Cr(this._client),this.workspaces=new ms(this._client),this.rateLimits=new Ir(this._client),this.complianceSettings=new vr(this._client)}retrieve(r){return this._client.get("/v1/organizations/me?beta=true",r)}}return n.APIKeys=Sr,n.ExternalKeys=xr,n.Federation=fs,n.Invites=Rr,n.ServiceAccounts=ps,n.Users=Cr,n.Workspaces=ms,n.RateLimits=Ir,n.ComplianceSettings=vr,n})();var gs=(()=>{class n extends x{list(r,t={},i){let{betas:a,workspace_id:c,...l}=t??{};return this._client.getAPIList(f`/v1/sessions/${r}/events?beta=true`,A,{query:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}send(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/sessions/${r}/events?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}stream(r,t={},i){let{betas:a,workspace_id:c,...l}=t??{};return this._client.get(f`/v1/sessions/${r}/events/stream?beta=true`,{query:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers]),stream:!0})}toolRunner(r,t){return new or(r,{...t,client:this._client})}}return n.SessionToolRunner=or,n})();class Br extends x{retrieve(n,r,t){let{session_id:i,betas:a,workspace_id:c}=r;return this._client.get(f`/v1/sessions/${i}/resources/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}update(n,r,t){let{session_id:i,betas:a,workspace_id:c,...l}=r;return this._client.post(f`/v1/sessions/${i}/resources/${n}?beta=true`,{body:l,...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/sessions/${n}/resources?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,r,t){let{session_id:i,betas:a,workspace_id:c}=r;return this._client.delete(f`/v1/sessions/${i}/resources/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}add(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/sessions/${n}/resources?beta=true`,{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}class Ur extends x{list(n,r,t){let{session_id:i,betas:a,workspace_id:c,...l}=r;return this._client.getAPIList(f`/v1/sessions/${i}/threads/${n}/events?beta=true`,A,{query:l,...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}stream(n,r,t){let{session_id:i,betas:a,workspace_id:c,...l}=r;return this._client.get(f`/v1/sessions/${i}/threads/${n}/stream?beta=true`,{query:l,...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers]),stream:!0})}}var ws=(()=>{class n extends x{constructor(){super(...arguments);this.events=new Ur(this._client)}retrieve(r,t,i){let{session_id:a,betas:c,workspace_id:l}=t;return this._client.get(f`/v1/sessions/${a}/threads/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}list(r,t={},i){let{betas:a,workspace_id:c,...l}=t??{};return this._client.getAPIList(f`/v1/sessions/${r}/threads?beta=true`,A,{query:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}archive(r,t,i){let{session_id:a,betas:c,workspace_id:l}=t;return this._client.post(f`/v1/sessions/${a}/threads/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString(),...l!=null?{"anthropic-workspace-id":l}:void 0},i?.headers])})}}return n.Events=Ur,n})();var ys=(()=>{class n extends x{constructor(){super(...arguments);this.events=new gs(this._client),this.resources=new Br(this._client),this.threads=new ws(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/sessions?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/sessions/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}update(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/sessions/${r}?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/sessions?beta=true",ri,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.delete(f`/v1/sessions/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/sessions/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Events=gs,n.Resources=Br,n.Threads=ws,n})();class qr extends x{create(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/skills/${n}/versions?beta=true`,fe({body:c,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])},this._client,!1))}retrieve(n,r,t){let{skill_id:i,betas:a,workspace_id:c}=r;return this._client.get(f`/v1/skills/${i}/versions/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/skills/${n}/versions?beta=true`,A,{query:c,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,r,t){let{skill_id:i,betas:a,workspace_id:c}=r;return this._client.delete(f`/v1/skills/${i}/versions/${n}?beta=true`,{...t,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}download(n,r,t){let{skill_id:i,betas:a,workspace_id:c}=r;return this._client.get(f`/v1/skills/${i}/versions/${n}/content?beta=true`,{...t,headers:h([{Accept:"application/binary",...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers]),__binaryResponse:!0})}}var bs=(()=>{class n extends x{constructor(){super(...arguments);this.versions=new qr(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/skills?beta=true",fe({body:c,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])},this._client,!1))}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/skills/${r}?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/skills?beta=true",A,{query:c,...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.delete(f`/v1/skills/${r}?beta=true`,{...i,headers:h([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0,...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Versions=qr,n})();class Kr extends x{create(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/tunnels/${n}/certificates?beta=true`,{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,r,t){let{tunnel_id:i,betas:a,workspace_id:c}=r;return this._client.get(f`/v1/tunnels/${i}/certificates/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/tunnels/${n}/certificates?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(n,r,t){let{tunnel_id:i,betas:a,workspace_id:c}=r;return this._client.post(f`/v1/tunnels/${i}/certificates/${n}/archive?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}}var ks=(()=>{class n extends x{constructor(){super(...arguments);this.certificates=new Kr(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/tunnels?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/tunnels/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/tunnels?beta=true",A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/tunnels/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}revealToken(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/tunnels/${r}/reveal_token?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}rotateToken(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/tunnels/${r}/rotate_token?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"mcp-tunnels-2026-06-22"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Certificates=Kr,n})();class zr extends x{create(n,r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post(f`/v1/vaults/${n}/credentials?beta=true`,{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(n,r,t){let{vault_id:i,betas:a,workspace_id:c}=r;return this._client.get(f`/v1/vaults/${i}/credentials/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}update(n,r,t){let{vault_id:i,betas:a,workspace_id:c,...l}=r;return this._client.post(f`/v1/vaults/${i}/credentials/${n}?beta=true`,{body:l,...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}list(n,r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList(f`/v1/vaults/${n}/credentials?beta=true`,A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(n,r,t){let{vault_id:i,betas:a,workspace_id:c}=r;return this._client.delete(f`/v1/vaults/${i}/credentials/${n}?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}archive(n,r,t){let{vault_id:i,betas:a,workspace_id:c}=r;return this._client.post(f`/v1/vaults/${i}/credentials/${n}/archive?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}mcpOAuthValidate(n,r,t){let{vault_id:i,betas:a,workspace_id:c}=r;return this._client.post(f`/v1/vaults/${i}/credentials/${n}/mcp_oauth_validate?beta=true`,{...t,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},t?.headers])})}}var Ss=(()=>{class n extends x{constructor(){super(...arguments);this.credentials=new zr(this._client)}create(r,t){let{betas:i,workspace_id:a,...c}=r;return this._client.post("/v1/vaults?beta=true",{body:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}retrieve(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.get(f`/v1/vaults/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}update(r,t,i){let{betas:a,workspace_id:c,...l}=t;return this._client.post(f`/v1/vaults/${r}?beta=true`,{body:l,...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}list(r={},t){let{betas:i,workspace_id:a,...c}=r??{};return this._client.getAPIList("/v1/vaults?beta=true",A,{query:c,...t,headers:h([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}delete(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.delete(f`/v1/vaults/${r}?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}archive(r,t={},i){let{betas:a,workspace_id:c}=t??{};return this._client.post(f`/v1/vaults/${r}/archive?beta=true`,{...i,headers:h([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString(),...c!=null?{"anthropic-workspace-id":c}:void 0},i?.headers])})}}return n.Credentials=zr,n})();var Vr=(()=>{class n extends x{constructor(){super(...arguments);this.models=new zt(this._client),this.messages=new ds(this._client),this.agents=new Tn(this._client),this.environments=new zn(this._client),this.sessions=new ys(this._client),this.deployments=new Wt(this._client),this.deploymentRuns=new Bt(this._client),this.vaults=new Ss(this._client),this.memoryStores=new Vn(this._client),this.files=new Kt(this._client),this.skills=new bs(this._client),this.webhooks=new Gt(this._client),this.userProfiles=new Vt(this._client),this.dreams=new jt(this._client),this.tunnels=new ks(this._client),this.organization=new _s(this._client)}}return n.Models=zt,n.Messages=ds,n.Agents=Tn,n.Environments=zn,n.Sessions=ys,n.Deployments=Wt,n.DeploymentRuns=Bt,n.Vaults=Ss,n.MemoryStores=Vn,n.Files=Kt,n.Skills=bs,n.Webhooks=Gt,n.UserProfiles=Vt,n.Dreams=jt,n.Tunnels=ks,n.Organization=_s,n})();class Tt extends x{create(n,r){let{betas:t,workspace_id:i,...a}=n;return this._client.post("/v1/complete",{body:a,timeout:this._client._options.timeout??600000,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),stream:n.stream??!1})}}class Pt extends x{list(n={},r){let{workspace_id:t,...i}=n??{};return this._client.getAPIList("/v1/files",A,{query:i,...r,headers:h([{...t!=null?{"anthropic-workspace-id":t}:void 0},r?.headers])})}delete(n,r={},t){let{workspace_id:i}=r??{};return this._client.delete(f`/v1/files/${n}`,{...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}download(n,r={},t){let{workspace_id:i}=r??{};return this._client.get(f`/v1/files/${n}/content`,{...t,headers:h([{Accept:"application/binary",...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers]),__binaryResponse:!0})}retrieveMetadata(n,r={},t){let{workspace_id:i}=r??{};return this._client.get(f`/v1/files/${n}`,{...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}upload(n,r){let{workspace_id:t,...i}=n;return this._client.post("/v1/files",fe({body:i,...r,headers:h([{...t!=null?{"anthropic-workspace-id":t}:void 0},An(i.file),r?.headers])},this._client))}}function oc(n){return n?.output_config?.format}function Qi(n,r,t){let i=oc(r);if(!r||!("parse"in(i??{})))return{...n,content:n.content.map((a)=>{if(a.type==="text")return Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return a}),parsed_output:null};return Zi(n,r,t)}function Zi(n,r,t){let i=null,a=n.content.map((c)=>{if(c.type==="text"){let l=Ou(r,c.text);if(i===null)i=l;return Object.defineProperty({...c},"parsed_output",{value:l,enumerable:!1})}return c});return{...n,content:a,parsed_output:i}}function Ou(n,r){let t=oc(n);if(t?.type!=="json_schema")return null;try{if("parse"in t)return t.parse(r);return JSON.parse(r)}catch(i){throw new g(`Failed to parse structured output: ${i}`)}}var ge,Ge,Ct,Yr,vs,Jr,Gr,xs,Xr,$e,Qr,Es,As,at,Rs,Ts,Ps,Zr,eo,ac,to,ro,no,so,cc;function io(n){return n.type==="tool_use"||n.type==="server_tool_use"}var lc=(()=>{class n{constructor(r,t){ge.add(this),this.messages=[],this.receivedMessages=[],Ge.set(this,void 0),Ct.set(this,null),this.controller=new AbortController,Yr.set(this,void 0),vs.set(this,()=>{}),Jr.set(this,()=>{}),Gr.set(this,void 0),xs.set(this,()=>{}),Xr.set(this,()=>{}),$e.set(this,{}),Qr.set(this,!1),Es.set(this,!1),As.set(this,!1),at.set(this,!1),Rs.set(this,void 0),Ts.set(this,void 0),Ps.set(this,void 0),Zr.set(this,void 0),to.set(this,(i)=>{if(s(this,Es,!0,"f"),Ut(i))i=new Je;if(i instanceof Je)return s(this,As,!0,"f"),this._emit("abort",i);if(i instanceof g)return this._emit("error",i);if(i instanceof Error){let a=new g(i.message);return a.cause=i,this._emit("error",a)}return this._emit("error",new g(String(i)))}),s(this,Yr,new Promise((i,a)=>{s(this,vs,i,"f"),s(this,Jr,a,"f")}),"f"),s(this,Gr,new Promise((i,a)=>{s(this,xs,i,"f"),s(this,Xr,a,"f")}),"f"),e(this,Yr,"f").catch(()=>{}),e(this,Gr,"f").catch(()=>{}),s(this,Ct,r,"f"),s(this,Zr,t?.logger??console,"f")}get response(){return e(this,Rs,"f")}get request_id(){return e(this,Ts,"f")}get workspace_id(){return e(this,Ps,"f")}async withResponse(){s(this,at,!0,"f");let r=await e(this,Yr,"f");if(!r)throw Error("Could not resolve a `Response` object");return{data:this,response:r,request_id:r.headers.get("request-id"),workspace_id:r.headers.get("anthropic-workspace-id")}}static fromReadableStream(r){let t=new n(null);return t._run(()=>t._fromReadableStream(r)),t}static createMessage(r,t,i,{logger:a}={}){let c=new n(t,{logger:a});for(let l of t.messages)c._addMessageParam(l);return s(c,Ct,{...t,stream:!0},"f"),c._run(()=>c._createMessage(r,{...t,stream:!0},{...i,headers:{...i?.headers,[ut]:"stream"}})),c}_run(r){r().then(()=>{this._emitFinal(),this._emit("end")},e(this,to,"f"))}_addMessageParam(r){this.messages.push(r)}_addMessage(r,t=!0){if(this.receivedMessages.push(r),t)this._emit("message",r)}async _createMessage(r,t,i){let a=i?.signal,c;if(a){if(a.aborted)this.controller.abort();c=this.controller.abort.bind(this.controller),a.addEventListener("abort",c)}try{e(this,ge,"m",ro).call(this);let{response:l,data:u}=await r.create({...t,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(l);for await(let d of u)e(this,ge,"m",no).call(this,d);if(u.controller.signal?.aborted)throw new Je;e(this,ge,"m",so).call(this)}finally{if(a&&c)a.removeEventListener("abort",c)}}_connected(r){if(this.ended)return;s(this,Rs,r,"f"),s(this,Ts,r?.headers.get("request-id"),"f"),s(this,Ps,r?.headers.get("anthropic-workspace-id"),"f"),e(this,vs,"f").call(this,r),this._emit("connect")}get ended(){return e(this,Qr,"f")}get errored(){return e(this,Es,"f")}get aborted(){return e(this,As,"f")}abort(){this.controller.abort()}on(r,t){return(e(this,$e,"f")[r]||(e(this,$e,"f")[r]=[])).push({listener:t}),this}off(r,t){let i=e(this,$e,"f")[r];if(!i)return this;let a=i.findIndex((c)=>c.listener===t);if(a>=0)i.splice(a,1);return this}once(r,t){return(e(this,$e,"f")[r]||(e(this,$e,"f")[r]=[])).push({listener:t,once:!0}),this}emitted(r){return new Promise((t,i)=>{if(s(this,at,!0,"f"),r!=="error")this.once("error",i);this.once(r,t)})}async done(){s(this,at,!0,"f"),await e(this,Gr,"f")}get currentMessage(){return e(this,Ge,"f")}async finalMessage(){return await this.done(),e(this,ge,"m",eo).call(this)}async finalText(){return await this.done(),e(this,ge,"m",ac).call(this)}_emit(r,...t){if(e(this,Qr,"f"))return;if(r==="end")s(this,Qr,!0,"f"),e(this,xs,"f").call(this);let i=e(this,$e,"f")[r];if(i)e(this,$e,"f")[r]=i.filter((a)=>!a.once),i.forEach(({listener:a})=>a(...t));if(r==="abort"){let a=t[0];if(!e(this,at,"f")&&!i?.length)Promise.reject(a);e(this,Jr,"f").call(this,a),e(this,Xr,"f").call(this,a),this._emit("end");return}if(r==="error"){let a=t[0];if(!e(this,at,"f")&&!i?.length)Promise.reject(a);e(this,Jr,"f").call(this,a),e(this,Xr,"f").call(this,a),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",e(this,ge,"m",eo).call(this))}async _fromReadableStream(r,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,ge,"m",ro).call(this),this._connected(null);let c=Re.fromReadableStream(r,this.controller);for await(let l of c)e(this,ge,"m",no).call(this,l);if(c.controller.signal?.aborted)throw new Je;e(this,ge,"m",so).call(this)}finally{if(i&&a)i.removeEventListener("abort",a)}}[(Ge=new WeakMap,Ct=new WeakMap,Yr=new WeakMap,vs=new WeakMap,Jr=new WeakMap,Gr=new WeakMap,xs=new WeakMap,Xr=new WeakMap,$e=new WeakMap,Qr=new WeakMap,Es=new WeakMap,As=new WeakMap,at=new WeakMap,Rs=new WeakMap,Ts=new WeakMap,Ps=new WeakMap,Zr=new WeakMap,to=new WeakMap,ge=new WeakSet,eo=function(){if(this.receivedMessages.length===0)throw new g("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ac=function(){if(this.receivedMessages.length===0)throw new g("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 g("stream ended without producing a content block with type=text");return t.join(" ")},ro=function(){if(this.ended)return;s(this,Ge,void 0,"f")},no=function(t){if(this.ended)return;let i=e(this,ge,"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(io(a)&&e(this,$e,"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:Ar(t.delta)}break}case"message_stop":{this._addMessageParam(i),this._addMessage(Qi(i,e(this,Ct,"f"),{logger:e(this,Zr,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{s(this,Ge,i,"f");break}case"content_block_start":case"message_delta":break}},so=function(){if(this.ended)throw new g("stream has ended, this shouldn't happen");let t=e(this,Ge,"f");if(!t)throw new g("request ended without sending any chunks");return s(this,Ge,void 0,"f"),Qi(t,e(this,Ct,"f"),{logger:e(this,Zr,"f")})},cc=function(t){let i=e(this,Ge,"f");if(t.type==="message_start"){if(i)throw new g(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!i)throw new g(`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&&io(a)){let c=(a[Ke]||"")+t.delta.partial_json;i.content[t.index]=Gn(a,c)}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:Ar(t.delta)}return i}case"content_block_stop":{let a=i.content.at(t.index);if(a&&io(a)&&Ke in a)Object.defineProperty(a,"input",{value:a.input,enumerable:!0,configurable:!0,writable:!0});return i}}},Symbol.asyncIterator)](){let r=[],t=[],i=!1;return this.on("streamEvent",(a)=>{let c=t.shift();if(c)c.resolve(a);else r.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 c of t)c.reject(a);t.length=0}),this.on("error",(a)=>{i=!0;for(let c of t)c.reject(a);t.length=0}),{next:async()=>{if(!r.length){if(i)return{value:void 0,done:!0};return new Promise((c,l)=>t.push({resolve:c,reject:l})).then((c)=>c?{value:c,done:!1}:{value:void 0,done:!0})}return{value:r.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Re(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return n})();class en extends x{create(n,r){let{user_profile_id:t,workspace_id:i,...a}=n;return this._client.post("/v1/messages/batches",{body:a,...r,headers:h([{...t!=null?{"anthropic-user-profile-id":t}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}retrieve(n,r={},t){let{workspace_id:i}=r??{};return this._client.get(f`/v1/messages/batches/${n}`,{...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}list(n={},r){let{workspace_id:t,...i}=n??{};return this._client.getAPIList("/v1/messages/batches",Y,{query:i,...r,headers:h([{...t!=null?{"anthropic-workspace-id":t}:void 0},r?.headers])})}delete(n,r={},t){let{workspace_id:i}=r??{};return this._client.delete(f`/v1/messages/batches/${n}`,{...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}cancel(n,r={},t){let{workspace_id:i}=r??{};return this._client.post(f`/v1/messages/batches/${n}/cancel`,{...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}async results(n,r={},t){let i=await this.retrieve(n,r,t);if(!i.results_url)throw new g(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{workspace_id:a}=r??{};return this._client.get(i.results_url,{...t,headers:h([{Accept:"application/binary",...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Yn.fromResponse(l.response,l.controller))}}var tn=(()=>{class n extends x{constructor(){super(...arguments);this.batches=new en(this._client)}create(r,t){let{user_profile_id:i,workspace_id:a,...c}=r;if(c.model in uc)console.warn(`The model '${c.model}' is deprecated and will reach end-of-life on ${uc[c.model]}
|
|
12
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Nu.includes(c.model)&&c.thinking&&c.thinking.type==="enabled")console.warn(`Using Claude with ${c.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 l=t?.timeout??this._client._options.timeout;if(!c.stream&&l==null){let d=Jn[c.model]??void 0;l=this._client.calculateNonstreamingTimeout(c.max_tokens,d)}let u=En(c.tools,c.messages);return this._client.post("/v1/messages",{body:c,timeout:l??600000,...t,headers:h([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},u,t?.headers]),stream:r.stream??!1})}parse(r,t){return this.create(r,t).then((i)=>Zi(i,r,{logger:this._client.logger??console}))}stream(r,t){return lc.createMessage(this,r,t,{logger:this._client.logger??console})}countTokens(r,t){let{user_profile_id:i,workspace_id:a,...c}=r;return this._client.post("/v1/messages/count_tokens",{body:c,...t,headers:h([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}return n.Batches=en,n})(),uc={},Nu=["claude-mythos-preview","claude-opus-4-6"];class Ot extends x{retrieve(n,r={},t){let{betas:i,workspace_id:a}=r??{};return this._client.get(f`/v1/models/${n}`,{...t,headers:h([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n={},r){let{betas:t,workspace_id:i,...a}=n??{};return this._client.getAPIList("/v1/models",Y,{query:a,...r,headers:h([{...t?.toString()!=null?{"anthropic-beta":t?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}}class rn extends x{create(n,r,t){let{workspace_id:i,...a}=r;return this._client.post(f`/v1/skills/${n}/versions`,fe({body:a,...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])},this._client,!1))}retrieve(n,r,t){let{skill_id:i,workspace_id:a}=r;return this._client.get(f`/v1/skills/${i}/versions/${n}`,{...t,headers:h([{...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}list(n,r={},t){let{workspace_id:i,...a}=r??{};return this._client.getAPIList(f`/v1/skills/${n}/versions`,A,{query:a,...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}delete(n,r,t){let{skill_id:i,workspace_id:a}=r;return this._client.delete(f`/v1/skills/${i}/versions/${n}`,{...t,headers:h([{...a!=null?{"anthropic-workspace-id":a}:void 0},t?.headers])})}}var nn=(()=>{class n extends x{constructor(){super(...arguments);this.versions=new rn(this._client)}create(r,t){let{workspace_id:i,...a}=r;return this._client.post("/v1/skills",fe({body:a,...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])},this._client,!1))}retrieve(r,t={},i){let{workspace_id:a}=t??{};return this._client.get(f`/v1/skills/${r}`,{...i,headers:h([{...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(r={},t){let{workspace_id:i,...a}=r??{};return this._client.getAPIList("/v1/skills",A,{query:a,...t,headers:h([{...i!=null?{"anthropic-workspace-id":i}:void 0},t?.headers])})}delete(r,t={},i){let{workspace_id:a}=t??{};return this._client.delete(f`/v1/skills/${r}`,{...i,headers:h([{...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}return n.Versions=rn,n})();var oo,ao,Cs,dc,Fu="\\n\\nHuman:",Hu="\\n\\nAssistant:",Du=(()=>{class n{get credentials(){return this._authState.provider}constructor({baseURL:r=K("ANTHROPIC_BASE_URL"),apiKey:t,authToken:i,webhookKey:a=K("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...c}={}){if(oo.add(this),this._requestAuthFlags=new WeakMap,Cs.set(this,void 0),t===void 0)t=c.profile!=null?null:K("ANTHROPIC_API_KEY")??null;if(i===void 0)i=c.profile!=null?null:K("ANTHROPIC_AUTH_TOKEN")??null;if(c.profile!=null&&(c.credentials!=null||c.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let l={apiKey:t,authToken:i,webhookKey:a,...c,baseURL:r||"https://api.anthropic.com"};if(!l.dangerouslyAllowBrowser&&ko())throw new g(`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=l.baseURL,this._baseURLIsExplicit=c.__baseURLIsExplicit??!!r,this.timeout=l.timeout??ao.DEFAULT_TIMEOUT,this.logger=l.logger??console,this.logLevel=ho,this.logLevel=Ei(l.logLevel,"ClientOptions.logLevel",G(this))??Ei(K("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",G(this))??ho,this.fetchOptions=l.fetchOptions,this.maxRetries=vi("maxRetries",l.maxRetries??2),this.fetch=l.fetch??Ao(),s(this,Cs,Io,"f"),this.middleware=[...l.middleware??[]];let u=K("ANTHROPIC_CUSTOM_HEADERS");if(u){let _={};for(let v of u.split(`
|
|
20
|
+
`)){let p=v.indexOf(":");if(p>=0)_[v.substring(0,p).trim()]=v.substring(p+1).trim()}l.defaultHeaders={..._,...l.defaultHeaders}}let d=c.__auth;if(delete l.__auth,delete l.__baseURLIsExplicit,this._options=l,this.apiKey=typeof t==="string"?t:null,this.authToken=i,this.webhookKey=a,d){if(this._authState=d,!this._baseURLIsExplicit&&d.baseURL)this.baseURL=d.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let _=l.credentials??null;if(_)this._authState.provider=_,this._authState.tokenCache=this._makeTokenCache(_);else if(l.config!=null){let v=Qs(l.config,this._credentialResolverOptions());this._authState.provider=v.provider,this._authState.tokenCache=this._makeTokenCache(v.provider),this._authState.extraHeaders=v.extraHeaders,this._applyCredentialBaseURL(v.baseURL)}else if(l.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(l.profile);else if(this._shouldResolveDefaultCredentials())this._authState.resolution=this._resolveDefaultCredentials()}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(r){if(!r)return;let t=r.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:(r)=>{G(this).debug("credential cache write failed (best-effort)",r)},onSafetyWarning:(r)=>{G(this).warn(r)}}}_credentialsFetch(){return ei(this.fetch,this.middleware,void 0,this)}_makeTokenCache(r){return new Js(r,(t)=>{G(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(r){let t="credentials"in r||"config"in r||"profile"in r,i="apiKey"in r||"authToken"in r||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}:{},...r,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in r?!0:this._baseURLIsExplicit};return new this.constructor(a)}async _resolveDefaultCredentials(r){try{let t=await Zo(this._credentialResolverOptions(),r);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(r!=null)throw new g(`Profile "${r}" could not be resolved (no <config_dir>/configs/${r}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:r,nulls:t}){if(r.get("x-api-key")||r.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&r.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&r.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(r){let t=this._requestAuthFlags.get(r);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(r,t);return t}async authHeaders(r){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(r).usedTokenCache=!0,h([{Authorization:`Bearer ${t}`}])}return h([await this.apiKeyAuth(r),await this.bearerAuth(r)])}async apiKeyAuth(r){if(this.apiKey==null)return;return h([{"X-Api-Key":this.apiKey}])}async bearerAuth(r){if(this.authToken==null)return;return h([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(r){return Fo(r)}getUserAgent(){return`Anthropic/JS ${he}`}makeStatusError(r,t,i,a){return we.generate(r,t,i,a)}buildURL(r,t,i){let a=!e(this,oo,"m",dc).call(this)&&i||this.baseURL,c=ja(r)?new URL(r):new URL(a+(a.endsWith("/")&&r.startsWith("/")?r.slice(1):r)),l=this.defaultQuery(),u=Object.fromEntries(c.searchParams);if(!Ds(l)||!Ds(u))t={...u,...l,...t};if(typeof t==="object"&&t&&!Array.isArray(t))c.search=this.stringifyQuery(t);return c.toString()}_calculateNonstreamingTimeout(r){if(3600*r/128000>600)throw new g("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(r){}async prepareRequest(r,{url:t,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let a=r.headers instanceof Headers?r.headers:new Headers(r.headers);for(let[l,u]of Object.entries(this._authState.extraHeaders))if(!a.has(l))a.set(l,u);let c=a.get("anthropic-beta")?.split(",").map((l)=>l.trim());if(!c?.includes(Qe))a.set("anthropic-beta",[...c??[],Qe].join(","));r.headers=a}}backendMiddleware(){return[]}get(r,t){return this.methodRequest("get",r,t)}post(r,t){return this.methodRequest("post",r,t)}patch(r,t){return this.methodRequest("patch",r,t)}put(r,t){return this.methodRequest("put",r,t)}delete(r,t){return this.methodRequest("delete",r,t)}methodRequest(r,t,i){return this.request(Promise.resolve(i).then((a)=>({method:r,path:t,...a})))}request(r,t=null){return new bn(this,this.makeRequest(r,t,void 0))}async makeRequest(r,t,i){let a=await r,c=vi("maxRetries",a.maxRetries??this.maxRetries);if(this.isStreamBody(a.body))c=0;if(t==null)t=c,this._requestAuthFlags.delete(a);await this.prepareOptions(a);let{req:l,url:u,timeout:d}=await this.buildRequest(a,{retryCount:c-t}),_="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),v=i===void 0?"":`, retryOf: ${i}`,p=Date.now();if(a.signal?.aborted)throw new Je;let b=new AbortController,w=await this.fetchWithTimeout(u,l,d,b,a,{requestLogID:_,retryOfRequestLogID:i}).catch($r),S=Date.now();if(w instanceof globalThis.Error){Ee(b);let E=`retrying, ${t} attempts remaining`;if(a.signal?.aborted)throw new Je;let y=Ut(w)||/timed? ?out/i.test(String(w)+("cause"in w?String(w.cause):"")),I=this.middleware.length>0||!!a.middleware?.length||this.backendMiddleware().length>0;if(I&&!y&&!sa(w))throw G(this).info(`[${_}] middleware error (not retryable)`),Qt(G(this),`[${_}] middleware error (not retryable)`,{retryOfRequestLogID:i,url:u,durationMs:S-p,message:w.message}),w;if(t)return G(this).info(`[${_}] connection ${y?"timed out":"failed"} - ${E}`),Qt(G(this),`[${_}] connection ${y?"timed out":"failed"} (${E})`,{retryOfRequestLogID:i,url:u,durationMs:S-p,message:w.message}),this.retryRequest(a,t,i??_);if(G(this).info(`[${_}] connection ${y?"timed out":"failed"} - error; no more retries left`),Qt(G(this),`[${_}] connection ${y?"timed out":"failed"} (error; no more retries left)`,{retryOfRequestLogID:i,url:u,durationMs:S-p,message:w.message}),y)throw new mi;if(I&&!Zs(w))throw w;throw new Er({cause:w})}let R=[...w.headers.entries()].filter(([E])=>E==="request-id"||E==="anthropic-workspace-id").map(([E,y])=>", "+E+": "+JSON.stringify(y)).join(""),k=`[${_}${v}${R}] ${l.method} ${u} ${w.ok?"succeeded":"failed"} with status ${w.status} in ${S-p}ms`;if(!w.ok){let E=await this.shouldRetry(w,a);if(t&&E){let M=`retrying, ${t} attempts remaining`;return await Ro(w.body),Ee(b),G(this).info(`${k} - ${M}`),Qt(G(this),`[${_}] response error (${M})`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,durationMs:S-p}),this.retryRequest(a,t,i??_,w.headers)}let y=E?"error; no more retries left":"error; not retryable";G(this).info(`${k} - ${y}`);let I=await w.text().catch((M)=>$r(M).message),T=_i(I),P=T?void 0:I;throw Qt(G(this),`[${_}] response error (${y})`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,message:P,durationMs:Date.now()-p}),Ee(b),this.makeStatusError(w.status,T,P,w.headers)}return G(this).info(k),Qt(G(this),`[${_}] response start`,{retryOfRequestLogID:i,url:w.url,status:w.status,headers:w.headers,durationMs:S-p}),Eo(w.body??w,b),{response:w,options:a,controller:b,requestLogID:_,retryOfRequestLogID:i,startTime:p}}getAPIList(r,t,i){return this.requestAPIList(t,i&&"then"in i?i.then((a)=>({method:"get",path:r,...a})):{method:"get",path:r,...i})}requestAPIList(r,t){let i=this.makeRequest(t,null,void 0);return new ia(this,i,r)}async fetchWithTimeout(r,t,i,a,c,l){let{signal:u,method:d,..._}=t||{},v=this._makeAbort(a);if(u)u.addEventListener("abort",v,{once:!0}),xo(a,u,v);let p=globalThis.ReadableStream&&_.body instanceof globalThis.ReadableStream||typeof _.body==="object"&&_.body!==null&&Symbol.asyncIterator in _.body,b={signal:a.signal,...p?{duplex:"half"}:{},method:"GET",..._};if(d)b.method=d.toUpperCase();let w=this.fetch,S=async(I,T)=>{let P=setTimeout(v,i);try{return await w.call(void 0,I,T)}finally{clearTimeout(P)}},R=c===void 0?S:async(I,T={})=>{let P=typeof I==="string"?I:I instanceof URL?I.href:I.url;if(T.headers=T.headers instanceof Headers?T.headers:new Headers(T.headers),await this.prepareRequest(T,{url:P,options:c}),l)Qt(G(this),`[${l.requestLogID}] sending request`,{retryOfRequestLogID:l.retryOfRequestLogID,method:T.method,url:P,options:c,headers:T.headers});return S(I,T)},k=c?.middleware,E=this.backendMiddleware(),y=k?.length||E.length?[...this.middleware,...k??[],...E]:this.middleware;return await ei(R,y,c,this)(r,b)}async shouldRetry(r,t){let i=this._authFlags(t);if(r.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let a=r.headers.get("x-should-retry");if(a==="true")return!0;if(a==="false")return!1;if(r.status===408)return!0;if(r.status===409)return!0;if(r.status===429)return!0;if(r.status>=500)return!0;return!1}async retryRequest(r,t,i,a){let c,l=a?.get("retry-after-ms");if(l){let d=parseFloat(l);if(!Number.isNaN(d))c=d}let u=a?.get("retry-after");if(u&&!c){let d=parseFloat(u);if(!Number.isNaN(d))c=d*1000;else c=Date.parse(u)-Date.now()}if(c===void 0||!(c>0&&c<=2147483647)){let d=r.maxRetries??this.maxRetries;c=this.calculateDefaultRetryTimeoutMillis(t,d)}return await ye(c,r.signal??void 0),this.makeRequest(r,t-1,i)}calculateDefaultRetryTimeoutMillis(r,t){let c=t-r,l=Math.min(0.5*Math.pow(2,c),8),u=1-Math.random()*0.25;return l*u*1000}calculateNonstreamingTimeout(r,t){if(3600000*r/128000>600000||t!=null&&r>t)throw new g("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(r,{retryCount:t=0}={}){let i={...r},{method:a,path:c,query:l,defaultBaseURL:u}=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 d=this.buildURL(c,l,u);if("timeout"in i)vi("timeout",i.timeout);i.timeout=i.timeout??this.timeout;let{bodyHeaders:_,body:v}=this.buildBody({options:i}),p=await this.buildHeaders({options:r,method:a,bodyHeaders:_,retryCount:t,timeout:i.timeout});return{req:{method:a,headers:p,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&v instanceof globalThis.ReadableStream&&{duplex:"half"},...v&&{body:v},...this.fetchOptions??{},...i.fetchOptions??{}},url:d,timeout:i.timeout}}async buildHeaders({options:r,method:t,bodyHeaders:i,retryCount:a,timeout:c}){let l=h([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),"X-Stainless-Timeout":String(Math.trunc(c/1000)),...Mt(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(r),this._options.defaultHeaders,i,r.headers]);return this.validateHeaders(l),l.values}_makeAbort(r){return()=>r.abort()}buildBody({options:{body:r,headers:t}}){if(!r)return{bodyHeaders:void 0,body:void 0};let i=h([t]);if(ArrayBuffer.isView(r)||r instanceof ArrayBuffer||r instanceof DataView||typeof r==="string"&&i.values.has("content-type")||globalThis.Blob&&r instanceof globalThis.Blob||r instanceof FormData||r instanceof URLSearchParams||globalThis.ReadableStream&&r instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:r};else if(this.isStreamBody(r))return{bodyHeaders:void 0,body:cn(r)};else if(typeof r==="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(r)};else return e(this,Cs,"f").call(this,{body:r,headers:i})}isStreamBody(r){if(globalThis.ReadableStream&&r instanceof globalThis.ReadableStream)return!0;return typeof r==="object"&&r!==null&&((Symbol.asyncIterator in r)||(Symbol.iterator in r)&&("next"in r)&&typeof r.next==="function")}}return ao=n,Cs=new WeakMap,oo=new WeakSet,dc=function(){return this.baseURL!=="https://api.anthropic.com"},n.Anthropic=ao,n.DEFAULT_TIMEOUT=600000,n.AnthropicError=g,n.APIError=we,n.APIConnectionError=Er,n.APIConnectionTimeoutError=mi,n.APIUserAbortError=Je,n.NotFoundError=yi,n.ConflictError=bi,n.RateLimitError=Si,n.BadRequestError=hi,n.AuthenticationError=fi,n.InternalServerError=xi,n.PermissionDeniedError=gi,n.UnprocessableEntityError=wi,n.toFile=ai,n.HUMAN_PROMPT=Fu,n.AI_PROMPT=Hu,n})(),$s=(()=>{class n extends Du{constructor(){super(...arguments);this.completions=new Tt(this),this.messages=new tn(this),this.models=new Ot(this),this.files=new Pt(this),this.skills=new nn(this),this.beta=new Vr(this)}}return n.Completions=Tt,n.Messages=tn,n.Models=Ot,n.Files=Pt,n.Skills=nn,n.Beta=Vr,n})();var Bu=function(n,r){if(typeof n==="string"&&/^\.\.?\//.test(n))return n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,i,a,c,l){return i?r?".jsx":".js":a&&(!c||!l)?t:a+c+"."+l.toLowerCase()+"js"});return n},Wu=null,Uu=null,ju=null,co=(n)=>import(Bu(n)),qu="node:fs",Ku="node:os",zu="node:path";if(typeof process<"u"&&(process.versions?.node||process.versions?.bun))co(qu).then((n)=>{Wu=n.existsSync}),co(Ku).then((n)=>{Uu=n.homedir}),co(zu).then((n)=>{ju=n.join});var Is="ANTHROPIC_AUTH_TOKEN",za="ANTHROPIC_OAUTH_TOKEN",$a="ANTHROPIC_API_KEY",ci="ANTHROPIC_FEDERATION_RULE_ID",li="ANTHROPIC_ORGANIZATION_ID",ui="ANTHROPIC_SERVICE_ACCOUNT_ID",pi="ANTHROPIC_IDENTITY_TOKEN_FILE",di="ANTHROPIC_WORKSPACE_ID";function hc(n,r){if(n)return n;if(O("PI_CACHE_RETENTION",r)==="long")return"long";return"short"}function Vu(n,r,t){let i=hc(r,t);if(i==="none")return{retention:i};let a=i==="long"&&on(n).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((n)=>[n.toLowerCase(),n])),_o=(n)=>Gu.get(n.toLowerCase())??n,Xu=(n,r)=>{if(r&&r.length>0){let t=n.toLowerCase(),i=r.find((a)=>a.name.toLowerCase()===t);if(i)return i.name}return n};function Qu(n){if(!n.some((a)=>a.type==="image"))return C(n.map((a)=>a.text).join(`
|
|
21
|
+
`));let t=n.map((a)=>{if(a.type==="text")return{type:"text",text:C(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(n){return(n.compat?.allowedFallbackModels?.length??0)>0}function on(n){let r=n.provider==="openrouter"||n.baseUrl.includes("openrouter.ai");return{supportsEagerToolInputStreaming:n.compat?.supportsEagerToolInputStreaming??!0,supportsLongCacheRetention:n.compat?.supportsLongCacheRetention??!0,sendSessionAffinityHeaders:n.compat?.sendSessionAffinityHeaders??r,sessionAffinityFormat:n.compat?.sessionAffinityFormat??(r?"openrouter":void 0),supportsCacheControlOnTools:n.compat?.supportsCacheControlOnTools??!0,supportsTemperature:n.compat?.supportsTemperature??!0,allowEmptySignature:n.compat?.allowEmptySignature??!1,supportsStrictTools:n.compat?.supportsStrictTools??!1,supportsMidConvoSystemMessages:n.compat?.supportsMidConvoSystemMessages??!1,supportsMidConvoToolChanges:n.compat?.supportsMidConvoToolChanges??!1}}function ad(...n){let r={};for(let t of n)if(t)Object.assign(r,t);return r}function lo(...n){return ad({"User-Agent":Se()},...n)}function uo(n,r){if(!n)return!1;let t=r.toLowerCase();for(let[i,a]of Object.entries(n))if(i.toLowerCase()===t&&a!==null&&a.trim().length>0)return!0;return!1}function fc(n,r){return!!n||uo(r,"authorization")||uo(r,"x-api-key")||uo(r,"cf-aig-authorization")}function pc(n,r,t){if(!fc(r,t))throw Error(`No API key for provider: ${n}`)}class sn extends $s{_shouldResolveDefaultCredentials(){return!1}}function mc(n,r,t,i){if(n.provider!=="anthropic"||fc(r,t))return;let a=O(ci,i),c=O(li,i),l=O(pi,i);if(!a||!c||!l)return;return{organization_id:c,workspace_id:O(di,i),authentication:{type:"oidc_federation",federation_rule_id:a,service_account_id:O(ui,i),identity_token:{source:"file",path:l}}}}var Fs,cd=new Set(["message_start","message_delta","message_stop","content_block_start","content_block_delta","content_block_stop"]);function _c(n){if(!n.event&&n.data.length===0)return null;let r={event:n.event,data:n.data.join(`
|
|
22
|
+
`),raw:[...n.raw]};return n.event=null,n.data=[],n.raw=[],r}function po(n,r){if(n==="")return _c(r);if(r.raw.push(n),n.startsWith(":"))return null;let t=n.indexOf(":"),i=t===-1?n:n.slice(0,t),a=t===-1?"":n.slice(t+1);if(a.startsWith(" "))a=a.slice(1);if(i==="event")r.event=a;else if(i==="data")r.data.push(a);return null}function ld(n){let r=n.indexOf("\r"),t=n.indexOf(`
|
|
23
|
+
`);if(r===-1)return t;if(t===-1)return r;return Math.min(r,t)}function Hs(n){let r=ld(n);if(r===-1)return null;let t=r+1;if(n[r]==="\r"&&n[t]===`
|
|
24
|
+
`)t+=1;return{line:n.slice(0,r),rest:n.slice(t)}}async function*ud(n,r){let t=n.getReader(),i=new TextDecoder,a={event:null,data:[],raw:[]},c="";try{while(!0){if(r?.aborted)throw Error("Request was aborted");let{value:d,done:_}=await t.read();if(_)break;c+=i.decode(d,{stream:!0});let v=Hs(c);while(v){c=v.rest;let p=po(v.line,a);if(p)yield p;v=Hs(c)}}c+=i.decode();let l=Hs(c);while(l){c=l.rest;let d=po(l.line,a);if(d)yield d;l=Hs(c)}if(c.length>0){let d=po(c,a);if(d)yield d}let u=_c(a);if(u)yield u}finally{t.releaseLock()}}async function*dd(n,r){if(!n.body)throw Error("Attempted to iterate over an Anthropic response with no body");let t=!1,i=!1;for await(let a of ud(n.body,r)){if(a.event==="error")throw Error(a.data);if(!cd.has(a.event??""))continue;try{let c=Go(a.data);if(c.type==="message_start")t=!0;else if(c.type==="message_stop")i=!0;yield c}catch(c){let l=c instanceof Error?c.message:String(c);throw Error(`Could not parse Anthropic SSE event ${a.event}: ${l}; data=${a.data}; raw=${a.raw.join("\\n")}`)}}if(t&&!i)throw Error("Anthropic stream ended before message_stop")}var fn=(n,r,t)=>{let i=new J,a=xe(r,on(n).supportsMidConvoSystemMessages),c=ve(a.messages);return(async()=>{let l=n.compat?.supportsMidConvoEffort?t?.effort??"high":void 0,u={role:"assistant",content:[],api:n.api,provider:n.provider,model:n.id,...l===void 0?{}:{providerThinkingLevel:l},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 d,_,v=n,p;if(t?.client)d=t.client,_=!1;else{let k=t?.apiKey,E=mc(n,k,t?.headers,t?.env);if(!E)pc(n.provider,k,t?.headers);let y;if(n.provider==="github-copilot"){let B=kr(a.messages);y=Pr({messages:a.messages,hasImages:B})}let T=hc(t?.cacheRetention,t?.env)==="none"?void 0:t?.sessionId,P=pd(n,k,t?.headers,t?.fetch,y,T,E);d=P.client,_=P.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(n,a,_,t,w),E=k.params,y=await t?.onPayload?.(E,n);if(y!==void 0)E={...y,stream:!0};try{S=await Te(()=>d.beta.messages.create(E,b).asResponse(),{maxRetries:t?.maxRetries,maxRetryDelayMs:t?.maxRetryDelayMs,signal:t?.signal});break}catch(I){if(t?.signal?.aborted||w||!k.hasPreferredStrictTools||!(I instanceof $s.APIError)||I.status!==400||I.type!=="invalid_request_error"||!["The compiled grammar is too large","Too many strict tools (","Schemas contains too many parameters with union types ("].some((T)=>I.message.includes(T)))throw I;w=!0,nt(u,{type:"anthropic_strict_tools_fallback",timestamp:Date.now(),error:{message:I.message},details:{reason:"strict_tool_limits_exceeded"}})}}await t?.onResponse?.({status:S.status,headers:ce(S.headers)},n),i.push({type:"start",partial:u});let R=u.content;for await(let k of dd(S,t?.signal))if(await t?.onProviderStreamEvent?.(k,n),k.type==="message_start"){u.responseId=k.message.id;let E=k.message.input_transformations;if(Array.isArray(E))p=E;let y=k.message.model;if(y!==n.id)u.responseModel=y;let I=y===n.id?void 0:n.compat?.allowedFallbackModels?.find((T)=>T.provider===n.provider&&T.model===y)?.cost;v=I?{...n,id:y,cost:I}:n,u.usage.input=k.message.usage.input_tokens||0,u.usage.output=k.message.usage.output_tokens||0,u.usage.cacheRead=k.message.usage.cache_read_input_tokens||0,u.usage.cacheWrite=k.message.usage.cache_creation_input_tokens||0,u.usage.cacheWrite1h=k.message.usage.cache_creation?.ephemeral_1h_input_tokens||0,u.usage.totalTokens=u.usage.input+u.usage.output+u.usage.cacheRead+u.usage.cacheWrite,me(v,u.usage)}else if(k.type==="content_block_start"){if(k.content_block.type==="fallback"){if(u.content.length>0)throw Error("Anthropic performed an unsupported mid-output model fallback");continue}if(k.content_block.type==="text"){let E={type:"text",text:k.content_block.text??"",index:k.index};u.content.push(E),i.push({type:"text_start",contentIndex:u.content.length-1,partial:u})}else if(k.content_block.type==="thinking"){let E={type:"thinking",thinking:k.content_block.thinking??"",thinkingSignature:k.content_block.signature??"",index:k.index};u.content.push(E),i.push({type:"thinking_start",contentIndex:u.content.length-1,partial:u})}else if(k.content_block.type==="redacted_thinking"){let E={type:"thinking",thinking:"[Reasoning redacted]",thinkingSignature:k.content_block.data,redacted:!0,index:k.index};u.content.push(E),i.push({type:"thinking_start",contentIndex:u.content.length-1,partial:u})}else if(k.content_block.type==="tool_use"){let E={type:"toolCall",id:k.content_block.id,name:_?Xu(k.content_block.name,c):k.content_block.name,arguments:k.content_block.input??{},partialJson:"",index:k.index};u.content.push(E),i.push({type:"toolcall_start",contentIndex:u.content.length-1,partial:u})}}else if(k.type==="content_block_delta"){if(k.delta.type==="text_delta"){let E=R.findIndex((I)=>I.index===k.index),y=R[E];if(y&&y.type==="text")y.text+=k.delta.text,i.push({type:"text_delta",contentIndex:E,delta:k.delta.text,partial:u})}else if(k.delta.type==="thinking_delta"){let E=R.findIndex((I)=>I.index===k.index),y=R[E];if(y&&y.type==="thinking")y.thinking+=k.delta.thinking,i.push({type:"thinking_delta",contentIndex:E,delta:k.delta.thinking,partial:u})}else if(k.delta.type==="input_json_delta"){let E=R.findIndex((I)=>I.index===k.index),y=R[E];if(y&&y.type==="toolCall")y.partialJson+=k.delta.partial_json,y.arguments=ne(y.partialJson),i.push({type:"toolcall_delta",contentIndex:E,delta:k.delta.partial_json,partial:u})}else if(k.delta.type==="signature_delta"){let E=R.findIndex((I)=>I.index===k.index),y=R[E];if(y&&y.type==="thinking")y.thinkingSignature=y.thinkingSignature||"",y.thinkingSignature+=k.delta.signature}}else if(k.type==="content_block_stop"){let E=R.findIndex((I)=>I.index===k.index),y=R[E];if(y){if(delete y.index,y.type==="text")i.push({type:"text_end",contentIndex:E,content:y.text,partial:u});else if(y.type==="thinking")i.push({type:"thinking_end",contentIndex:E,content:y.thinking,partial:u});else if(y.type==="toolCall")y.arguments=ne(y.partialJson),delete y.partialJson,i.push({type:"toolcall_end",contentIndex:E,toolCall:y,partial:u})}}else if(k.type==="message_delta"){let E=k.input_transformations;if(Array.isArray(E))p=E;if(k.delta.stop_reason){u.rawStopReason=k.delta.stop_reason;let y=Rd(k.delta.stop_reason,k.delta.stop_details);if(u.stopReason=y.stopReason,y.errorMessage)u.errorMessage=y.errorMessage}if(k.usage){if(k.usage.input_tokens!=null)u.usage.input=k.usage.input_tokens;if(k.usage.output_tokens!=null)u.usage.output=k.usage.output_tokens;if(k.usage.cache_read_input_tokens!=null)u.usage.cacheRead=k.usage.cache_read_input_tokens;if(k.usage.cache_creation_input_tokens!=null)u.usage.cacheWrite=k.usage.cache_creation_input_tokens;let y=k.usage.cache_creation;if(y?.ephemeral_1h_input_tokens!=null)u.usage.cacheWrite1h=y.ephemeral_1h_input_tokens;let I=k.usage.output_tokens_details?.thinking_tokens;if(I!=null)u.usage.reasoning=I}u.usage.totalTokens=u.usage.input+u.usage.output+u.usage.cacheRead+u.usage.cacheWrite,me(v,u.usage)}if(t?.signal?.aborted)throw Error("Request was aborted");if(u.stopReason==="pending")throw Error("Anthropic stream ended without a stop reason");if(u.stopReason==="aborted"||u.stopReason==="error")throw Error(u.errorMessage||"An unknown error occurred");if(p&&p.length>0)nt(u,{type:"anthropic_input_transformations",timestamp:Date.now(),details:{transformations:p.map((k)=>({type:k.type??void 0,path:k.path??void 0,reason:k.reason??void 0}))}});i.push({type:"done",reason:u.stopReason,message:u}),i.end()}catch(d){for(let _ of u.content)delete _.index,delete _.partialJson;u.stopReason=t?.signal?.aborted?"aborted":"error",u.errorMessage=d instanceof Error?d.message:JSON.stringify(d),i.push({type:"error",reason:u.stopReason,error:u}),i.end()}})(),i};function hd(n,r){let t=r?n.thinkingLevelMap?.[r]:void 0;if(typeof t==="string")return t;switch(r){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}var Ms=(n,r,t)=>{if(!mc(n,t?.apiKey,t?.headers,t?.env))pc(n.provider,t?.apiKey,t?.headers);let i={...de(n,r,t,t?.apiKey),toolChoice:t?.toolChoice};if(!t?.reasoning)return fn(n,r,{...i,thinkingEnabled:!1});if(n.compat?.forceAdaptiveThinking===!0){let l=hd(n,t.reasoning);return fn(n,r,{...i,thinkingEnabled:!0,effort:l})}let a=So(i.maxTokens,n.maxTokens,t.reasoning,t.thinkingBudgets),c=wn(n,r,a.maxTokens);return fn(n,r,{...i,maxTokens:c,thinkingEnabled:!0,thinkingBudgetTokens:Math.min(a.thinkingBudget,Math.max(0,c-1024))})};function fd(n){return n.includes("sk-ant-oat")}function pd(n,r,t,i,a,c,l){if(n.provider==="github-copilot")return{client:new sn({apiKey:null,authToken:r??null,baseURL:n.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:lo({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},n.headers,a,t)}),isOAuthToken:!1};if(r&&fd(r))return{client:new sn({apiKey:null,authToken:r,baseURL:n.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:lo({accept:"application/json","anthropic-dangerous-direct-browser-access":"true","user-agent":`claude-cli/${Yu}`,"x-app":"cli"},n.headers,t)}),isOAuthToken:!0};let u=on(n),d={};if(c&&u.sendSessionAffinityHeaders){let p=u.sessionAffinityFormat==="openrouter"?"x-session-id":"x-session-affinity";d[p]=c}let _=lo({accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},d,n.headers,t);if(l){let p=JSON.stringify([n.baseUrl,l]);if(Fs?.key!==p||Fs.fetch!==i){let b=new sn({apiKey:null,authToken:null,config:l,baseURL:n.baseUrl,dangerouslyAllowBrowser:!0,fetch:i});Fs={key:p,fetch:i,client:b}}return{client:Fs.client.withOptions({defaultHeaders:_}),isOAuthToken:!1}}return{client:new sn({apiKey:r??null,authToken:null,baseURL:n.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:_}),isOAuthToken:!1}}function md(n,r,t,i,a){let c;for(let u of[n.headers,a?.headers])for(let[d,_]of Object.entries(u??{}))if(d.toLowerCase()==="anthropic-beta")c=_;if(c===null)return[];if(c!==void 0)return[...new Set(c.split(",").map((u)=>u.trim()).filter((u)=>u.length>0))];let l=[];if(t)l.push("claude-code-20250219","oauth-2025-04-20");if(Sd(n,r))l.push(Zu);if(n.reasoning&&a?.thinkingEnabled===!0&&(a.interleavedThinking??!0)&&n.compat?.forceAdaptiveThinking!==!0)l.push(ed);if(od(n))l.push(td);if(n.compat?.supportsMidConvoEffort===!0)l.push(rd,nd);if(i)l.push(sd);return[...new Set(l)]}function _d(n,r,t,i,a=!1){let{cacheControl:c}=Vu(n,i?.cacheRetention,i?.env),l=on(n),u=Me(r.messages),d=u?re(u):"",_=Ne(r.messages,n,gd),v=u?_.slice(1):_,p=!1,b=(P,B)=>{let M=Ad(P,t,l.supportsEagerToolInputStreaming,l.supportsStrictTools,B,a);if(M.some((W,L)=>{let F=P[L].constrainedSampling;return W.strict===!0&&F&&F.type==="json_schema"&&F.strict==="prefer"}))p=!0;return M},w=u?.toolsAdded??[],S=l.supportsMidConvoSystemMessages&&l.supportsMidConvoToolChanges&&w.length>0,R=yd(v,t,c,l.allowEmptySignature,n.compat?.supportsMidConvoEffort===!0?n.provider:void 0,S?b:void 0),k=i?.effort??"high",E=md(n,r,t,S,i),y={model:n.id,messages:n.compat?.supportsMidConvoEffort===!0?kd(R,k):R.messages,max_tokens:i?.maxTokens??n.maxTokens,stream:!0,...E.length>0?{betas:E}:{}};if(t){if(y.system=[{type:"text",text:"You are Claude Code, Anthropic's official CLI for Claude.",...c?{cache_control:c}:{}}],d)y.system.push({type:"text",text:C(d),...c?{cache_control:c}:{}})}else if(d)y.system=[{type:"text",text:C(d),...c?{cache_control:c}:{}}];if(i?.temperature!==void 0&&!i?.thinkingEnabled&&n.compat?.supportsMidConvoEffort!==!0&&l.supportsTemperature)y.temperature=i.temperature;let I=l.supportsCacheControlOnTools?c:void 0;if(S)y.tools=[...b(w,I),id];else{let P=ve(r.messages);if(P.length>0)y.tools=b(P,I)}if(n.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(n.reasoning){if(i?.thinkingEnabled){let P=i.thinkingDisplay??"summarized";if(n.compat?.forceAdaptiveThinking===!0){if(y.thinking={type:"adaptive",display:P},i.effort)y.output_config={effort:i.effort}}else y.thinking={type:"enabled",budget_tokens:i.thinkingBudgetTokens||1024,display:P}}else if(i?.thinkingEnabled===!1&&n.thinkingLevelMap?.off!==null)y.thinking={type:"disabled"}}if(i?.metadata){let P=i.metadata.user_id;if(typeof P==="string")y.metadata={user_id:P}}if(i?.toolChoice)if(typeof i.toolChoice==="string")y.tool_choice={type:i.toolChoice};else y.tool_choice=i.toolChoice;let T=n.compat?.allowedFallbackModels;if(T&&T.length>0)y.fallbacks=T.map((P)=>({model:P.model}));return{params:y,hasPreferredStrictTools:p}}function gd(n){return n.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)}function wd(n){return{type:"tool_result",tool_use_id:n.toolCallId,content:Qu(n.content),is_error:n.isError}}function yd(n,r,t,i=!1,a,c){let l=[],u=new Map,d=[],_=()=>{l.push(...d),d.length=0};for(let v=0;v<n.length;v++){let p=n[v];if(p.role==="system"){let b=mt(p),w=[];if(b.length>0)w.push({type:"text",text:C(b)});if(c){let S=p.toolsAdded??[],R=new Set(S.map((k)=>k.name));for(let k of p.toolsRemoved??[]){if(R.has(k.name))continue;w.push({type:"tool_removal",tool:{type:"tool_reference",name:r?_o(k.name):k.name}})}for(let k of c(S))w.push({type:"tool_addition",tool:{type:"tool_definition",definition:k}})}if(w.length>0)d.push({role:"system",content:w})}else if(p.role==="user")if(typeof p.content==="string"){if(p.content.trim().length>0)l.push({role:"user",content:C(p.content)})}else{let w=p.content.map((S)=>{if(S.type==="text")return{type:"text",text:C(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;l.push({role:"user",content:w})}else if(p.role==="assistant"){_();let b=[];for(let S of p.content)if(S.type==="text"){if(S.text.trim().length===0)continue;b.push({type:"text",text:C(S.text)})}else if(S.type==="thinking"){if(S.redacted){b.push({type:"redacted_thinking",data:S.thinkingSignature});continue}let R=S.thinkingSignature,k=!!R&&R.trim().length>0;if(S.thinking.trim().length===0&&!k)continue;if(!k)b.push(i?{type:"thinking",thinking:C(S.thinking),signature:""}:{type:"text",text:C(S.thinking)});else b.push({type:"thinking",thinking:C(S.thinking),signature:R})}else if(S.type==="toolCall")b.push({type:"tool_use",id:S.id,name:r?_o(S.name):S.name,input:S.arguments??{}});if(b.length===0)continue;let w=l.length;if(l.push({role:"assistant",content:b}),a!==void 0&&p.api==="anthropic-messages"&&p.provider===a&&bd(p.providerThinkingLevel))u.set(w,p.providerThinkingLevel)}else if(p.role==="toolResult"){let b=[],w=v;while(w<n.length&&n[w].role==="toolResult")b.push(wd(n[w])),w++;v=w-1,l.push({role:"user",content:b})}}if(_(),t&&l.length>0){let v=l[l.length-1];if(v.role==="user"||v.role==="system"){if(Array.isArray(v.content)){let p=v.content[v.content.length-1];if(p&&(p.type==="text"||p.type==="image"||p.type==="tool_result"||p.type==="tool_addition"||p.type==="tool_removal"))p.cache_control=t}else if(typeof v.content==="string")v.content=[{type:"text",text:v.content,cache_control:t}]}}return{messages:l,assistantLevels:u}}function bd(n){return n==="low"||n==="medium"||n==="high"||n==="xhigh"||n==="max"}function kd(n,r){let t=[];for(let i=0;i<n.messages.length;i++){let a=n.assistantLevels.get(i);if(a!==void 0)t.push({role:"system",content:[],output_config:{effort:a}});t.push(n.messages[i])}return t.push({role:"system",content:[],output_config:{effort:r}}),t}function Sd(n,r){return ve(r.messages).length>0&&!on(n).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=(n,r)=>{if(vd.has(n))return!0;if(n==="minItems")return r!==0&&r!==1;if(n==="format")return typeof r!=="string"||!xd.has(r);return!1};function Ad(n,r,t,i,a,c=!1){if(!n)return[];return n.map((l,u)=>{let d=l.constrainedSampling,_=c&&d&&d.type==="json_schema"&&d.strict==="prefer"?void 0:Ie(l,i,Ed),v=De(l,_),p=v,b={type:"object",properties:p.properties??{},required:p.required??[]},w=_===!0?{...v,...b}:b;return{name:r?_o(l.name):l.name,description:l.description,...t?{eager_input_streaming:!0}:{},..._===!0?{strict:!0}:{},input_schema:w,...a&&u===n.length-1?{cache_control:a}:{}}})}function Rd(n,r){switch(n){case"end_turn":return{stopReason:"stop"};case"max_tokens":return{stopReason:"length"};case"tool_use":return{stopReason:"toolUse"};case"refusal":return{stopReason:"error",errorMessage:r?.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: ${n}`)}}
|
|
25
|
+
export{Is,za,$a,ci,li,ui,pi,di,fn,Ms};
|