@claudiolabs/claudin 1.1.39 → 1.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/App-1.1.40-eb4xn79h.mjs +1 -0
- package/dist/chunks/ApproveApiKey-1.1.40-s12f36rk.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-1.1.40-08yczhe8.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-1.1.40-xw7040fw.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-1.1.40-ejq4fmn7.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-1.1.40-n8xq1ghm.mjs +1 -0
- package/dist/chunks/DiffDialog-1.1.40-2ykfyp2y.mjs +6 -0
- package/dist/chunks/Doctor-1.1.40-5q8gn92n.mjs +1 -0
- package/dist/chunks/ExplorerDialog-1.1.40-qbvaevt6.mjs +6 -0
- package/dist/chunks/ITermBackend-1.1.40-tbt91h1c.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-1.1.40-bx3xnmmr.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-1.1.40-kg7st12w.mjs +1 -0
- package/dist/chunks/MigrationDialog-1.1.40-d7hcx55h.mjs +1 -0
- package/dist/chunks/Onboarding-1.1.40-mwq5eg90.mjs +1 -0
- package/dist/chunks/ProviderManager-1.1.40-z85fnyyw.mjs +1 -0
- package/dist/chunks/REPL-1.1.40-h9ccg2t4.mjs +1 -0
- package/dist/chunks/ResumeConversation-1.1.40-0ghfz7ak.mjs +1 -0
- package/dist/chunks/TeleportProgress-1.1.40-39n922s2.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-1.1.40-shkd3dr0.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-1.1.40-5e4necay.mjs +1 -0
- package/dist/chunks/TmuxBackend-1.1.40-kfzg6nqe.mjs +9 -0
- package/dist/chunks/ToolSearchTool-1.1.40-x1k41dnq.mjs +1 -0
- package/dist/chunks/TrustDialog-1.1.40-3r59c8nw.mjs +1 -0
- package/dist/chunks/activeProvider-1.1.40-8ywrwcaw.mjs +1 -0
- package/dist/chunks/add-dir-1.1.40-4etvgznk.mjs +1 -0
- package/dist/chunks/agentTypes-1.1.40-0jgkahp3.mjs +1 -0
- package/dist/chunks/agents-1.1.40-aa2gqrkq.mjs +110 -0
- package/dist/chunks/agents-1.1.40-v0vqxazw.mjs +3 -0
- package/dist/chunks/api-1.1.40-dwsbnjc3.mjs +1 -0
- package/dist/chunks/asciicast-1.1.40-y0e6w0q6.mjs +1 -0
- package/dist/chunks/auth-1.1.40-43w4cqf5.mjs +1 -0
- package/dist/chunks/auth-1.1.40-jhdwprg7.mjs +1 -0
- package/dist/chunks/autoMode-1.1.40-gy1w9r7y.mjs +52 -0
- package/dist/chunks/autoModeSetup-1.1.40-8jjzstby.mjs +44 -0
- package/dist/chunks/autoUpdater-1.1.40-q7a2hm0c.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-1.1.40-pnakm6fp.mjs +1 -0
- package/dist/chunks/branch-1.1.40-1aq0shtd.mjs +4 -0
- package/dist/chunks/bridge-1.1.40-jngt6dkf.mjs +2 -0
- package/dist/chunks/bridgeConfig-1.1.40-6zjr3dgb.mjs +1 -0
- package/dist/chunks/bridgeEnabled-1.1.40-5ra4n5cw.mjs +1 -0
- package/dist/chunks/bridgeMain-1.1.40-q22hv9eb.mjs +64 -0
- package/dist/chunks/bridgePointer-1.1.40-8nvycyyd.mjs +1 -0
- package/dist/chunks/btw-1.1.40-vqdnk39f.mjs +1 -0
- package/dist/chunks/buddy-1.1.40-wkym7yqv.mjs +3 -0
- package/dist/chunks/cache-probe-1.1.40-5ac1ane9.mjs +21 -0
- package/dist/chunks/cacheStats-1.1.40-dc4nspga.mjs +4 -0
- package/dist/chunks/caches-1.1.40-9ej2vasg.mjs +1 -0
- package/dist/chunks/cd-1.1.40-d5jhbgzp.mjs +3 -0
- package/dist/chunks/claudeDesktop-1.1.40-2wmbzv9t.mjs +1 -0
- package/dist/chunks/claudemd-1.1.40-5bw0jeka.mjs +1 -0
- package/dist/chunks/clear-1.1.40-3gpjnsv0.mjs +1 -0
- package/dist/chunks/clearTerminal-1.1.40-ny8kqt7d.mjs +1 -0
- package/dist/chunks/cli-1.1.40-0507kdps.mjs +2 -0
- package/dist/chunks/cli-1.1.40-05q41dcq.mjs +63 -0
- package/dist/chunks/cli-1.1.40-0a9nnbar.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0hb84ejd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0p3na6a1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0vdhw7mm.mjs +3 -0
- package/dist/chunks/cli-1.1.40-0z5szwzt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-13ccwz6g.mjs +2 -0
- package/dist/chunks/cli-1.1.40-13e9gynq.mjs +16 -0
- package/dist/chunks/cli-1.1.40-14x4xtjy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1a4pn4ww.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1pe6rcmh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1r9pwsgr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1z293953.mjs +2 -0
- package/dist/chunks/cli-1.1.40-202jxgqx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-25wt0y2a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2e8t1hzy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2j20ecjm.mjs +11 -0
- package/dist/chunks/cli-1.1.40-2ndseghs.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2ted9r2b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2z1ppytd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-390v6b8q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-3e58725b.mjs +3 -0
- package/dist/chunks/cli-1.1.40-3hqepe0h.mjs +34 -0
- package/dist/chunks/cli-1.1.40-3m4n20em.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4a1p6q3b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4d4b7cw2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4d6gye21.mjs +2 -0
- package/dist/chunks/cli-1.1.40-586jg9as.mjs +4 -0
- package/dist/chunks/cli-1.1.40-5m7tntdx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-5szxfmd7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-5x38x6mx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-66c2dzxw.mjs +8 -0
- package/dist/chunks/cli-1.1.40-6bv738vq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-6evbnv5e.mjs +4 -0
- package/dist/chunks/cli-1.1.40-6gc7p5by.mjs +2 -0
- package/dist/chunks/cli-1.1.40-6v8d2hq7.mjs +18 -0
- package/dist/chunks/cli-1.1.40-718chdj8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-75jka1rb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-77d85srw.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7mtszf6q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7p7pbsj7.mjs +3 -0
- package/dist/chunks/cli-1.1.40-7sp5dtqz.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7xegymwp.mjs +3 -0
- package/dist/chunks/cli-1.1.40-88vceqkj.mjs +6 -0
- package/dist/chunks/cli-1.1.40-8dzrhmwv.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8j3wdrn6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8jkb2pk8.mjs +3 -0
- package/dist/chunks/cli-1.1.40-8tkx8d1m.mjs +50 -0
- package/dist/chunks/cli-1.1.40-8x5yey3y.mjs +20 -0
- package/dist/chunks/cli-1.1.40-8xvdt1py.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8zhx2a4q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-904bkcqe.mjs +2 -0
- package/dist/chunks/cli-1.1.40-9bqkn2xd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-9ktcep8b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a8ztxtkt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a94m02ck.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a9t3gajj.mjs +2 -0
- package/dist/chunks/cli-1.1.40-aaec6y8n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-aknkj6rt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-asmc6tcr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-b37e0jb8.mjs +6 -0
- package/dist/chunks/cli-1.1.40-bdt7jzc8.mjs +12 -0
- package/dist/chunks/cli-1.1.40-beywxqng.mjs +2 -0
- package/dist/chunks/cli-1.1.40-bh7z7ek2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-bkxrf16s.mjs +2 -0
- package/dist/chunks/cli-1.1.40-cacr2bwg.mjs +135 -0
- package/dist/chunks/cli-1.1.40-cjmpr9fj.mjs +6 -0
- package/dist/chunks/cli-1.1.40-cjtb9y6z.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ckjrbh6b.mjs +60 -0
- package/dist/chunks/cli-1.1.40-cr76k9c5.mjs +2 -0
- package/dist/chunks/cli-1.1.40-cy642er2.mjs +5 -0
- package/dist/chunks/cli-1.1.40-czkgycwy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-d94fysd2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-dbt9wvcg.mjs +133 -0
- package/dist/chunks/cli-1.1.40-dcgb31te.mjs +2 -0
- package/dist/chunks/cli-1.1.40-dsncefwy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-e6xs2c7n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-evm7c2fk.mjs +2 -0
- package/dist/chunks/cli-1.1.40-f4906zck.mjs +3 -0
- package/dist/chunks/cli-1.1.40-fewramj2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-fjbq162e.mjs +24 -0
- package/dist/chunks/cli-1.1.40-fn6qzvk2.mjs +17 -0
- package/dist/chunks/cli-1.1.40-fqcnge4w.mjs +4 -0
- package/dist/chunks/cli-1.1.40-fwxd22jm.mjs +2 -0
- package/dist/chunks/cli-1.1.40-g1vnzwpn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-gk34ey8n.mjs +24 -0
- package/dist/chunks/cli-1.1.40-gv0xj4g0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-gym1gqwr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h2t9z1xa.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h5r5wmqv.mjs +3 -0
- package/dist/chunks/cli-1.1.40-h6v9p00b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h87wvfsr.mjs +24 -0
- package/dist/chunks/cli-1.1.40-h9vf8tb3.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hdf9qdf0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hf5jtfgb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hfe06y9j.mjs +250 -0
- package/dist/chunks/cli-1.1.40-hn5j9ca8.mjs +3 -0
- package/dist/chunks/cli-1.1.40-j3mmbyn6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-j822dmk0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-jc0pv06v.mjs +2 -0
- package/dist/chunks/cli-1.1.40-jdhz6qrn.mjs +4 -0
- package/dist/chunks/cli-1.1.40-jdyqkhjm.mjs +15 -0
- package/dist/chunks/cli-1.1.40-jxt31ej7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-k3z93zzh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-k9ms1jzt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kafpmwa6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kcs8jb1x.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kn1916j7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-knp59dzj.mjs +25 -0
- package/dist/chunks/cli-1.1.40-ksaxg9vb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kvhhhzww.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m0j9t9he.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m0km8bx0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m3m3zyes.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m4hyy4k1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-mtj9edbn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-mtqb5txt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-n9wve56a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ncvv73yk.mjs +2 -0
- package/dist/chunks/cli-1.1.40-nj4dbcsq.mjs +5 -0
- package/dist/chunks/cli-1.1.40-nvwa39p8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p0d9ms1q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p1ezfj24.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p3jhg1v9.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p6sasq8k.mjs +2 -0
- package/dist/chunks/cli-1.1.40-pmw99nnn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ptbes5dy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qbqaea7j.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qj79t43w.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qrryep7k.mjs +2 -0
- package/dist/chunks/cli-1.1.40-r0e1tymb.mjs +4 -0
- package/dist/chunks/cli-1.1.40-rcfj1etg.mjs +2 -0
- package/dist/chunks/cli-1.1.40-rq9y2zd8.mjs +4 -0
- package/dist/chunks/cli-1.1.40-rwbr7d1h.mjs +2 -0
- package/dist/chunks/cli-1.1.40-s5zzvtq2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sa2ca2mh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sh39fzfc.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sjmpb8kv.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sw6avn9f.mjs +15 -0
- package/dist/chunks/cli-1.1.40-swnje8x1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-t3fwj4bx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-t6s30nmj.mjs +10 -0
- package/dist/chunks/cli-1.1.40-tb7zgp10.mjs +2 -0
- package/dist/chunks/cli-1.1.40-tbjmztnt.mjs +7 -0
- package/dist/chunks/cli-1.1.40-test5hfq.mjs +9 -0
- package/dist/chunks/cli-1.1.40-tjxcmknk.mjs +10 -0
- package/dist/chunks/cli-1.1.40-tpcjtjay.mjs +2 -0
- package/dist/chunks/cli-1.1.40-vemj3v7n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-vjrn2xbp.mjs +39 -0
- package/dist/chunks/cli-1.1.40-vnckyxj2.mjs +6 -0
- package/dist/chunks/cli-1.1.40-vzsswgmp.mjs +2 -0
- package/dist/chunks/cli-1.1.40-wgmkydqq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-wh51ya47.mjs +5524 -0
- package/dist/chunks/cli-1.1.40-wwtg9jyr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-x07axsvg.mjs +3 -0
- package/dist/chunks/cli-1.1.40-x0em3hsa.mjs +42 -0
- package/dist/chunks/cli-1.1.40-x155sz4a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-x8fyash9.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xjt6qe30.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xrdf30ff.mjs +4 -0
- package/dist/chunks/cli-1.1.40-xsx6q1wa.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xty2k2d8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xvw930pn.mjs +4 -0
- package/dist/chunks/cli-1.1.40-xxr2978q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xz65jcaq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-yb9c5882.mjs +6 -0
- package/dist/chunks/cli-1.1.40-ycdfy6nf.mjs +15 -0
- package/dist/chunks/cli-1.1.40-yggza6ab.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ypd0pmm1.mjs +9 -0
- package/dist/chunks/cli-1.1.40-yxch4yjw.mjs +2 -0
- package/dist/chunks/cli-1.1.40-yyx9dq0t.mjs +2 -0
- package/dist/chunks/cli-1.1.40-z2y2xwz9.mjs +21 -0
- package/dist/chunks/cli-1.1.40-z3hcyy04.mjs +25 -0
- package/dist/chunks/cli-1.1.40-z4zyefya.mjs +10 -0
- package/dist/chunks/cli-1.1.40-zc4hs061.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zjd4syvr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zn2yvg4w.mjs +7 -0
- package/dist/chunks/cli-1.1.40-zwpz8d3c.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zx6c6dj7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zxgbpq09.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zz1e7ypt.mjs +2 -0
- package/dist/chunks/client-1.1.40-7wf4ewe0.mjs +1 -0
- package/dist/chunks/color-1.1.40-v7cj369z.mjs +1 -0
- package/dist/chunks/compact-1.1.40-9frgndw1.mjs +2 -0
- package/dist/chunks/config-1.1.40-hpmvve33.mjs +1 -0
- package/dist/chunks/config-1.1.40-vyqe5y0b.mjs +1 -0
- package/dist/chunks/constants-1.1.40-ddn3fezq.mjs +1 -0
- package/dist/chunks/context-1.1.40-v3bm6v6h.mjs +1 -0
- package/dist/chunks/context-noninteractive-1.1.40-grk3112n.mjs +1 -0
- package/dist/chunks/conversation-1.1.40-18fff5dm.mjs +1 -0
- package/dist/chunks/copilotHeaders-1.1.40-8mws1sed.mjs +1 -0
- package/dist/chunks/copy-1.1.40-0j7zfq2m.mjs +9 -0
- package/dist/chunks/cost-1.1.40-haa10e3n.mjs +1 -0
- package/dist/chunks/createSession-1.1.40-m1yre1z2.mjs +1 -0
- package/dist/chunks/debug-1.1.40-jb16xf0z.mjs +1 -0
- package/dist/chunks/defaultActionDeps-1.1.40-6jxq6wj1.mjs +1458 -0
- package/dist/chunks/desktop-1.1.40-78kvtn3w.mjs +2 -0
- package/dist/chunks/detectRepository-1.1.40-bfsfnrg0.mjs +1 -0
- package/dist/chunks/detection-1.1.40-ynqhwygh.mjs +1 -0
- package/dist/chunks/diff-1.1.40-ry5r3hxm.mjs +1 -0
- package/dist/chunks/doctor-1.1.40-3jq6vt4j.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-1.1.40-xkn6p433.mjs +1 -0
- package/dist/chunks/earlyInput-1.1.40-cgnyfxrr.mjs +1 -0
- package/dist/chunks/effort-1.1.40-x92e5y73.mjs +13 -0
- package/dist/chunks/engine-1.1.40-xfhy56h0.mjs +1 -0
- package/dist/chunks/envUtils-1.1.40-x04vk5d2.mjs +1 -0
- package/dist/chunks/errors-1.1.40-5rmm9jgq.mjs +1 -0
- package/dist/chunks/exampleCommands-1.1.40-0bqsxh7q.mjs +1 -0
- package/dist/chunks/execFileNoThrow-1.1.40-ckxrp2ds.mjs +1 -0
- package/dist/chunks/exit-1.1.40-3z02mbj5.mjs +1 -0
- package/dist/chunks/explorer-1.1.40-wd802dbj.mjs +1 -0
- package/dist/chunks/export-1.1.40-jfwshttx.mjs +2 -0
- package/dist/chunks/fast-1.1.40-60ervp24.mjs +1 -0
- package/dist/chunks/feedback-1.1.40-prjs4btg.mjs +16 -0
- package/dist/chunks/git-1.1.40-j53g8ee0.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-1.1.40-mcem604d.mjs +1 -0
- package/dist/chunks/goal-1.1.40-g8esr771.mjs +4 -0
- package/dist/chunks/headless-1.1.40-vr772edq.mjs +2 -0
- package/dist/chunks/heapdump-1.1.40-8rmhv3eq.mjs +6 -0
- package/dist/chunks/help-1.1.40-x9vde04q.mjs +1 -0
- package/dist/chunks/hooks-1.1.40-gm4rps4s.mjs +79 -0
- package/dist/chunks/hooks-1.1.40-wb0fy1tx.mjs +1 -0
- package/dist/chunks/ide-1.1.40-ymf3dffe.mjs +3 -0
- package/dist/chunks/image-processor-napi-1.1.40-kk0nhrm1.mjs +1 -0
- package/dist/chunks/import-1.1.40-8q1yygwm.mjs +260 -0
- package/dist/chunks/inboundAttachments-1.1.40-gdzw0a60.mjs +1 -0
- package/dist/chunks/index-1.1.40-1036v870.mjs +1 -0
- package/dist/chunks/index-1.1.40-2pnxjnrq.mjs +9 -0
- package/dist/chunks/index-1.1.40-3dg7neyn.mjs +1 -0
- package/dist/chunks/index-1.1.40-3wmvffnj.mjs +1 -0
- package/dist/chunks/index-1.1.40-6h7p7965.mjs +5 -0
- package/dist/chunks/index-1.1.40-7m7py5an.mjs +1 -0
- package/dist/chunks/index-1.1.40-7thhkf50.mjs +1 -0
- package/dist/chunks/index-1.1.40-7zb9nwfm.mjs +1 -0
- package/dist/chunks/index-1.1.40-a4nq3a6p.mjs +23 -0
- package/dist/chunks/index-1.1.40-agp7ccgc.mjs +2 -0
- package/dist/chunks/index-1.1.40-ce1vrpmy.mjs +1 -0
- package/dist/chunks/index-1.1.40-d7gm1zpq.mjs +1 -0
- package/dist/chunks/index-1.1.40-e5mrxhrw.mjs +9 -0
- package/dist/chunks/index-1.1.40-hqxrsc3k.mjs +30 -0
- package/dist/chunks/index-1.1.40-hyjbaxfp.mjs +1 -0
- package/dist/chunks/index-1.1.40-kxj8bd6n.mjs +1 -0
- package/dist/chunks/index-1.1.40-m8hvmnp3.mjs +2 -0
- package/dist/chunks/index-1.1.40-re5y6sqg.mjs +1 -0
- package/dist/chunks/index-1.1.40-rxqg2zmw.mjs +1 -0
- package/dist/chunks/index-1.1.40-scsfdxb9.mjs +1 -0
- package/dist/chunks/index-1.1.40-sebq5zf0.mjs +1 -0
- package/dist/chunks/index-1.1.40-sw11xm4f.mjs +1 -0
- package/dist/chunks/index-1.1.40-wm4s6wvy.mjs +1 -0
- package/dist/chunks/init-1.1.40-t57rwm04.mjs +2 -0
- package/dist/chunks/initReplBridge-1.1.40-mjwfh9qk.mjs +1 -0
- package/dist/chunks/ink-1.1.40-9d6z3zms.mjs +1 -0
- package/dist/chunks/insights-1.1.40-a9638asy.mjs +870 -0
- package/dist/chunks/install-1.1.40-zxccztd6.mjs +1 -0
- package/dist/chunks/install-github-app-1.1.40-zf5bv85a.mjs +149 -0
- package/dist/chunks/install-slack-app-1.1.40-5zhc4ky1.mjs +1 -0
- package/dist/chunks/interactiveHelpers-1.1.40-8b699chw.mjs +1 -0
- package/dist/chunks/latestVersionCache-1.1.40-pf10bcf1.mjs +1 -0
- package/dist/chunks/loadAgentsDir-1.1.40-2phb1zja.mjs +1 -0
- package/dist/chunks/loadPluginHooks-1.1.40-nyy8edra.mjs +1 -0
- package/dist/chunks/log-1.1.40-bd06efpx.mjs +1 -0
- package/dist/chunks/main-1.1.40-jsd88fnb.mjs +1 -0
- package/dist/chunks/managedEnv-1.1.40-5bct44v9.mjs +1 -0
- package/dist/chunks/mcp-1.1.40-gwsy9z99.mjs +17 -0
- package/dist/chunks/mcp-1.1.40-ne4zhaas.mjs +4 -0
- package/dist/chunks/mcp-1.1.40-w28yghrq.mjs +1 -0
- package/dist/chunks/mcpb-1.1.40-rmczagzm.mjs +1 -0
- package/dist/chunks/memory-1.1.40-bw1f5kas.mjs +128 -0
- package/dist/chunks/model-1.1.40-abq8e5vn.mjs +1 -0
- package/dist/chunks/model-1.1.40-mchqmvyj.mjs +2 -0
- package/dist/chunks/new-1.1.40-52px2j2q.mjs +1 -0
- package/dist/chunks/node-1.1.40-9cewz2cq.mjs +1 -0
- package/dist/chunks/node-1.1.40-feq5eqhb.mjs +15 -0
- package/dist/chunks/oauth-1.1.40-g2ddff91.mjs +1 -0
- package/dist/chunks/openaiShim-1.1.40-1f1x96vz.mjs +14 -0
- package/dist/chunks/output-style-1.1.40-57gexey1.mjs +1 -0
- package/dist/chunks/package-V72LKFNW-1.1.40-fsxygmx4.mjs +1 -0
- package/dist/chunks/permissions-1.1.40-a3gt3a6r.mjs +1 -0
- package/dist/chunks/permissions-1.1.40-tk64h5pw.mjs +3 -0
- package/dist/chunks/plan-1.1.40-qktxc0xv.mjs +1 -0
- package/dist/chunks/plist-1.1.40-syaedef6.mjs +1 -0
- package/dist/chunks/plugin-1.1.40-40707xv2.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-1.1.40-0s8z5pda.mjs +1 -0
- package/dist/chunks/plugins-1.1.40-36g7cedj.mjs +9 -0
- package/dist/chunks/preActionHook-1.1.40-xs0mts7r.mjs +2 -0
- package/dist/chunks/print-1.1.40-n8tbgpmb.mjs +57 -0
- package/dist/chunks/process-1.1.40-2d6jw6ja.mjs +1 -0
- package/dist/chunks/processBashCommand-1.1.40-9wg7776s.mjs +1 -0
- package/dist/chunks/processSlashCommand-1.1.40-xt635hzb.mjs +9 -0
- package/dist/chunks/prompt-1.1.40-384zryvv.mjs +1 -0
- package/dist/chunks/prompt-1.1.40-fafe7d93.mjs +1 -0
- package/dist/chunks/prompts-1.1.40-dkjt46vt.mjs +1 -0
- package/dist/chunks/provider-1.1.40-jdhrf16x.mjs +2 -0
- package/dist/chunks/providerProfiles-1.1.40-bw1gvrwa.mjs +1 -0
- package/dist/chunks/providerValidation-1.1.40-grkw6t7j.mjs +6 -0
- package/dist/chunks/registerSubcommands-1.1.40-829pxw1w.mjs +26 -0
- package/dist/chunks/registry-1.1.40-gcsbpq05.mjs +1 -0
- package/dist/chunks/release-notes-1.1.40-7k7w7byk.mjs +5 -0
- package/dist/chunks/reload-plugins-1.1.40-0hnncx1c.mjs +2 -0
- package/dist/chunks/remote-env-1.1.40-8yjn1yy1.mjs +1 -0
- package/dist/chunks/rename-1.1.40-k97agc44.mjs +1 -0
- package/dist/chunks/replLauncher-1.1.40-t07rfxt3.mjs +1 -0
- package/dist/chunks/resume-1.1.40-aztvxhw1.mjs +2 -0
- package/dist/chunks/rewind-1.1.40-qqcys5j3.mjs +1 -0
- package/dist/chunks/rootOptions-1.1.40-1phbx46q.mjs +1 -0
- package/dist/chunks/runWorkflowHeadless-1.1.40-4zdbvgxr.mjs +10 -0
- package/dist/chunks/sandbox-adapter-1.1.40-w8261442.mjs +1 -0
- package/dist/chunks/sandbox-toggle-1.1.40-3jcyaq2m.mjs +1 -0
- package/dist/chunks/session-1.1.40-t3q2q12k.mjs +2 -0
- package/dist/chunks/sessionStorage-1.1.40-k9kv0fc5.mjs +1 -0
- package/dist/chunks/settings-1.1.40-xk0psj3p.mjs +1 -0
- package/dist/chunks/setup-1.1.40-k28y0vhd.mjs +12 -0
- package/dist/chunks/sinks-1.1.40-jmrhph0p.mjs +1 -0
- package/dist/chunks/skills-1.1.40-p548yntr.mjs +1 -0
- package/dist/chunks/startupProfiler-1.1.40-r0r0td60.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-1.1.40-9k4m0y14.mjs +1 -0
- package/dist/chunks/state-1.1.40-48n6bztp.mjs +1 -0
- package/dist/chunks/stats-1.1.40-7b8de2xc.mjs +1 -0
- package/dist/chunks/status-1.1.40-y6f9m60d.mjs +1 -0
- package/dist/chunks/stickers-1.1.40-6861rtwc.mjs +1 -0
- package/dist/chunks/subprocessEnv-1.1.40-j8teh9py.mjs +1 -0
- package/dist/chunks/tasks-1.1.40-z0pdc2v6.mjs +1 -0
- package/dist/chunks/teamHelpers-1.1.40-dg7kse00.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-1.1.40-h0ps5f8m.mjs +1 -0
- package/dist/chunks/teleport-1.1.40-968xt0kq.mjs +1 -0
- package/dist/chunks/terminalSetup-1.1.40-tyj663fm.mjs +1 -0
- package/dist/chunks/theme-1.1.40-pt3gmfb7.mjs +1 -0
- package/dist/chunks/toolPool-1.1.40-7evty87j.mjs +1 -0
- package/dist/chunks/toolSearch-1.1.40-js92r1j0.mjs +1 -0
- package/dist/chunks/tools-1.1.40-3xs7vby7.mjs +1 -0
- package/dist/chunks/turndown.cjs-1.1.40-r64pb7jc.mjs +69 -0
- package/dist/chunks/types-1.1.40-106z8mxc.mjs +1 -0
- package/dist/chunks/update-1.1.40-t843j2px.mjs +72 -0
- package/dist/chunks/upload-1.1.40-mq50976a.mjs +7 -0
- package/dist/chunks/upstreamproxy-1.1.40-8sq5v7b7.mjs +14 -0
- package/dist/chunks/usage-1.1.40-m5z82r48.mjs +1 -0
- package/dist/chunks/util-1.1.40-wt30k81w.mjs +1 -0
- package/dist/chunks/utils-1.1.40-59bpagj3.mjs +1 -0
- package/dist/chunks/vim-1.1.40-4kra5190.mjs +1 -0
- package/dist/chunks/watchLoop-1.1.40-2vzyqrvn.mjs +13 -0
- package/dist/chunks/wiki-1.1.40-c29899s1.mjs +132 -0
- package/dist/chunks/workflows-1.1.40-heqcwgty.mjs +1 -0
- package/dist/chunks/worktree-1.1.40-mw6zf174.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-1.1.40-2wrpxrjt.mjs +1 -0
- package/dist/chunks/wrapper-1.1.40-07rbayqn.mjs +7 -0
- package/dist/cli.mjs +2 -2
- package/package.json +9 -9
- package/dist/chunks/App-1.1.39-k3pzg19w.mjs +0 -1
- package/dist/chunks/ApproveApiKey-1.1.39-bycvt1g5.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-1.1.39-4j00w97q.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-1.1.39-38wypq07.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-1.1.39-edm7rsre.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-1.1.39-my209qf5.mjs +0 -1
- package/dist/chunks/DiffDialog-1.1.39-dt5qmt50.mjs +0 -6
- package/dist/chunks/Doctor-1.1.39-kv2tpcs1.mjs +0 -1
- package/dist/chunks/ExplorerDialog-1.1.39-d5t22ss6.mjs +0 -6
- package/dist/chunks/ITermBackend-1.1.39-z3zx6y4m.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-1.1.39-nwstppyf.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-1.1.39-pfjzxc4p.mjs +0 -1
- package/dist/chunks/MigrationDialog-1.1.39-3mpd0tbf.mjs +0 -1
- package/dist/chunks/Onboarding-1.1.39-r5976zwt.mjs +0 -1
- package/dist/chunks/ProviderManager-1.1.39-dzacd3pt.mjs +0 -1
- package/dist/chunks/REPL-1.1.39-ww7zvk7k.mjs +0 -1
- package/dist/chunks/ResumeConversation-1.1.39-mdn16ej3.mjs +0 -1
- package/dist/chunks/TeleportProgress-1.1.39-tnhzkmtn.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-1.1.39-vz4td3jg.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-1.1.39-rfjygmym.mjs +0 -1
- package/dist/chunks/TmuxBackend-1.1.39-vbqywsj7.mjs +0 -9
- package/dist/chunks/ToolSearchTool-1.1.39-bb46mna1.mjs +0 -1
- package/dist/chunks/TrustDialog-1.1.39-b57dgsm7.mjs +0 -1
- package/dist/chunks/activeProvider-1.1.39-jgfyp0cs.mjs +0 -1
- package/dist/chunks/add-dir-1.1.39-1wp8d118.mjs +0 -1
- package/dist/chunks/agentTypes-1.1.39-0x20gy8e.mjs +0 -1
- package/dist/chunks/agents-1.1.39-b3k5kxn7.mjs +0 -110
- package/dist/chunks/agents-1.1.39-nt8wcmtp.mjs +0 -3
- package/dist/chunks/api-1.1.39-tn9g67g0.mjs +0 -1
- package/dist/chunks/asciicast-1.1.39-22byg1gm.mjs +0 -1
- package/dist/chunks/auth-1.1.39-1x1eer36.mjs +0 -1
- package/dist/chunks/auth-1.1.39-vz0zkq99.mjs +0 -1
- package/dist/chunks/autoMode-1.1.39-sjezrxh7.mjs +0 -52
- package/dist/chunks/autoModeSetup-1.1.39-e6gvda2k.mjs +0 -44
- package/dist/chunks/autoUpdater-1.1.39-cz95xv2n.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-1.1.39-vsn9w5k2.mjs +0 -1
- package/dist/chunks/branch-1.1.39-e0ww5bkp.mjs +0 -4
- package/dist/chunks/bridge-1.1.39-k5vb0mmb.mjs +0 -2
- package/dist/chunks/bridgeConfig-1.1.39-6czf6nvj.mjs +0 -1
- package/dist/chunks/bridgeEnabled-1.1.39-crv4d7xn.mjs +0 -1
- package/dist/chunks/bridgeMain-1.1.39-488k7mc8.mjs +0 -64
- package/dist/chunks/bridgePointer-1.1.39-xb9s18xx.mjs +0 -1
- package/dist/chunks/btw-1.1.39-n1psbg89.mjs +0 -1
- package/dist/chunks/buddy-1.1.39-ms13d421.mjs +0 -3
- package/dist/chunks/cache-probe-1.1.39-j0aybz93.mjs +0 -21
- package/dist/chunks/cacheStats-1.1.39-dg202ye5.mjs +0 -4
- package/dist/chunks/caches-1.1.39-v3nps0e9.mjs +0 -1
- package/dist/chunks/cd-1.1.39-awhhtq1z.mjs +0 -3
- package/dist/chunks/claudeDesktop-1.1.39-azj9es6w.mjs +0 -1
- package/dist/chunks/claudemd-1.1.39-7a02xhkm.mjs +0 -1
- package/dist/chunks/clear-1.1.39-k197h5f0.mjs +0 -1
- package/dist/chunks/clearTerminal-1.1.39-twgf5kky.mjs +0 -1
- package/dist/chunks/cli-1.1.39-01qgb22d.mjs +0 -4
- package/dist/chunks/cli-1.1.39-07d1v3y9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0k9p4g5p.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0mtb82ww.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0rsjfyh1.mjs +0 -9
- package/dist/chunks/cli-1.1.39-0s0eqwsn.mjs +0 -2
- package/dist/chunks/cli-1.1.39-10wrcybe.mjs +0 -2
- package/dist/chunks/cli-1.1.39-111vm2e1.mjs +0 -24
- package/dist/chunks/cli-1.1.39-14jxs3k5.mjs +0 -3
- package/dist/chunks/cli-1.1.39-15jr1t97.mjs +0 -2
- package/dist/chunks/cli-1.1.39-17mj2gq0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1es853x9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1m7bzjpd.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1mpe0mv2.mjs +0 -17
- package/dist/chunks/cli-1.1.39-1q43eavk.mjs +0 -4
- package/dist/chunks/cli-1.1.39-1r1cbvk8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1tcqp8ky.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1wg6zvk6.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1yysfg6y.mjs +0 -2
- package/dist/chunks/cli-1.1.39-212q1ba2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-24z9gjkg.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2gzgjcxr.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2hgsp1ry.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2k0w4c3v.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2vf0yc3g.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2x3kj4gh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2xmkpvn8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-31e9rw45.mjs +0 -2
- package/dist/chunks/cli-1.1.39-3g0p54p8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-3mghgnn1.mjs +0 -24
- package/dist/chunks/cli-1.1.39-3yy2wxqa.mjs +0 -24
- package/dist/chunks/cli-1.1.39-4bdssx8e.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4he45b53.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4p4c56cn.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4w5sz267.mjs +0 -2
- package/dist/chunks/cli-1.1.39-52k1fj82.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5gdtmek1.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5ge6mqxz.mjs +0 -63
- package/dist/chunks/cli-1.1.39-5h7tfgqc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5r6zjkfz.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5t4113gt.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5xkhxv1a.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5yxt37n7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5zc15zgx.mjs +0 -2
- package/dist/chunks/cli-1.1.39-6pkc868v.mjs +0 -2
- package/dist/chunks/cli-1.1.39-6y7dsvjs.mjs +0 -2
- package/dist/chunks/cli-1.1.39-70t1q2pm.mjs +0 -2
- package/dist/chunks/cli-1.1.39-75gxbxsn.mjs +0 -7
- package/dist/chunks/cli-1.1.39-7ck7pqh0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7d9k8cma.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7hm6zgk1.mjs +0 -15
- package/dist/chunks/cli-1.1.39-7jhstkb2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7kjnzaa8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7tchegvs.mjs +0 -5
- package/dist/chunks/cli-1.1.39-7tgaawmj.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7xc1qp70.mjs +0 -2
- package/dist/chunks/cli-1.1.39-89e5xfsc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8e62hz1p.mjs +0 -3
- package/dist/chunks/cli-1.1.39-8gscnd8w.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8jw8s604.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8k3rh435.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8xf0xfkw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-905jk7a7.mjs +0 -133
- package/dist/chunks/cli-1.1.39-9afxesb0.mjs +0 -3
- package/dist/chunks/cli-1.1.39-9bh2t20k.mjs +0 -3
- package/dist/chunks/cli-1.1.39-9dfw3wt9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-9j9vfcg0.mjs +0 -10
- package/dist/chunks/cli-1.1.39-9qsdqnm7.mjs +0 -6
- package/dist/chunks/cli-1.1.39-9yg363zk.mjs +0 -2
- package/dist/chunks/cli-1.1.39-a1rc9y55.mjs +0 -3
- package/dist/chunks/cli-1.1.39-a40ak4sd.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ay2p31kb.mjs +0 -39
- package/dist/chunks/cli-1.1.39-b1gewbgs.mjs +0 -2
- package/dist/chunks/cli-1.1.39-b314axe0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-b3geta93.mjs +0 -21
- package/dist/chunks/cli-1.1.39-bd66bjj3.mjs +0 -2
- package/dist/chunks/cli-1.1.39-brzpjtja.mjs +0 -2
- package/dist/chunks/cli-1.1.39-c4c832m5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-c6mm3w1n.mjs +0 -135
- package/dist/chunks/cli-1.1.39-c86mbrv2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-chveh83h.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cjc01sak.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ck0k3rxx.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ckty7bt1.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cq5nwqfw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cvbzp08c.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cyx7zw76.mjs +0 -50
- package/dist/chunks/cli-1.1.39-czh4aj72.mjs +0 -4
- package/dist/chunks/cli-1.1.39-d25xsy5x.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dfrms96j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-djtdv45d.mjs +0 -4
- package/dist/chunks/cli-1.1.39-dm5rqr07.mjs +0 -8
- package/dist/chunks/cli-1.1.39-dvfdgp8r.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dwfknzds.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dwgjp6zp.mjs +0 -2
- package/dist/chunks/cli-1.1.39-e4p7vgrg.mjs +0 -2
- package/dist/chunks/cli-1.1.39-e98w7pr4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-en8a3nq6.mjs +0 -11
- package/dist/chunks/cli-1.1.39-epktaska.mjs +0 -3
- package/dist/chunks/cli-1.1.39-esp4w3m4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-evs7a20p.mjs +0 -9
- package/dist/chunks/cli-1.1.39-eyp8d7vv.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f0wf0m0n.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f1schffw.mjs +0 -25
- package/dist/chunks/cli-1.1.39-f2qc1x1n.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f5azyvet.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fka8qdkr.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fm08hbtj.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fqsaf1st.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g751n1kp.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g7mbr2ky.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g9rcf6cw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ghja51c5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-gnkk8fs7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-gtm67f9z.mjs +0 -2
- package/dist/chunks/cli-1.1.39-h06axtf8.mjs +0 -4
- package/dist/chunks/cli-1.1.39-h8ahn5vw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-h90nz8dv.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ha8fn1m0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-hgm87yas.mjs +0 -10
- package/dist/chunks/cli-1.1.39-j6nvja1z.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jmh4b6db.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jncrq8d3.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jq1a84j4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-k8n2ksgh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-kcq7gw24.mjs +0 -60
- package/dist/chunks/cli-1.1.39-kfztpa2h.mjs +0 -2
- package/dist/chunks/cli-1.1.39-kkgyntg1.mjs +0 -7
- package/dist/chunks/cli-1.1.39-kw258d7x.mjs +0 -4
- package/dist/chunks/cli-1.1.39-mhv15208.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ms0zz1pq.mjs +0 -2
- package/dist/chunks/cli-1.1.39-mtdpf384.mjs +0 -2
- package/dist/chunks/cli-1.1.39-n8j5q839.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nc39g50q.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nde8mxzw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ne2jz4j1.mjs +0 -12
- package/dist/chunks/cli-1.1.39-nhgqks5q.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nk9xnj41.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nkv70wmc.mjs +0 -10
- package/dist/chunks/cli-1.1.39-nmm4w3bh.mjs +0 -16
- package/dist/chunks/cli-1.1.39-nnc7eg6p.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nsgjkze0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nxv718fh.mjs +0 -3
- package/dist/chunks/cli-1.1.39-p2sg5g92.mjs +0 -250
- package/dist/chunks/cli-1.1.39-pc9dgxhx.mjs +0 -5
- package/dist/chunks/cli-1.1.39-q8q90rxq.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rfkva6dd.mjs +0 -42
- package/dist/chunks/cli-1.1.39-rhqy2d5w.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rjxm15hw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rp6sehng.mjs +0 -3
- package/dist/chunks/cli-1.1.39-rprv5zq8.mjs +0 -25
- package/dist/chunks/cli-1.1.39-rqs6bqnm.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rxpy9zgc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-s4g9xyv5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-srjkdp3j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-swktejeb.mjs +0 -2
- package/dist/chunks/cli-1.1.39-t2jqv0s9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-t4a22cet.mjs +0 -6
- package/dist/chunks/cli-1.1.39-tc87f2ta.mjs +0 -2
- package/dist/chunks/cli-1.1.39-tjpdjpp5.mjs +0 -15
- package/dist/chunks/cli-1.1.39-tveshzdb.mjs +0 -2
- package/dist/chunks/cli-1.1.39-v92y62n9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-vh86jjp2.mjs +0 -4
- package/dist/chunks/cli-1.1.39-vhqah8m7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-vtt2tmb9.mjs +0 -18
- package/dist/chunks/cli-1.1.39-wdctfdbb.mjs +0 -4
- package/dist/chunks/cli-1.1.39-whzghgxz.mjs +0 -2
- package/dist/chunks/cli-1.1.39-x6jkg8mf.mjs +0 -20
- package/dist/chunks/cli-1.1.39-xg4cr6x8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-xm6k98xf.mjs +0 -2
- package/dist/chunks/cli-1.1.39-xyddt40c.mjs +0 -2
- package/dist/chunks/cli-1.1.39-y341qw3m.mjs +0 -2
- package/dist/chunks/cli-1.1.39-yjwk9mw8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ypma7nx9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ytvr80fj.mjs +0 -15
- package/dist/chunks/cli-1.1.39-yyqx9zb5.mjs +0 -5522
- package/dist/chunks/cli-1.1.39-z1akavz2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-z21b507j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-z6fepfnh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-zc1b8zf6.mjs +0 -2
- package/dist/chunks/cli-1.1.39-zdsdsv4h.mjs +0 -3
- package/dist/chunks/cli-1.1.39-zfb5hcs0.mjs +0 -34
- package/dist/chunks/client-1.1.39-zrdzybfj.mjs +0 -1
- package/dist/chunks/color-1.1.39-qsgg6xt0.mjs +0 -1
- package/dist/chunks/compact-1.1.39-ye5nj18m.mjs +0 -2
- package/dist/chunks/config-1.1.39-cfgcj726.mjs +0 -1
- package/dist/chunks/config-1.1.39-nsgxmahr.mjs +0 -1
- package/dist/chunks/constants-1.1.39-s4anaxa3.mjs +0 -1
- package/dist/chunks/context-1.1.39-a93qe83k.mjs +0 -1
- package/dist/chunks/context-noninteractive-1.1.39-2428zhce.mjs +0 -1
- package/dist/chunks/conversation-1.1.39-x581tx1z.mjs +0 -1
- package/dist/chunks/copilotHeaders-1.1.39-bnzefwe6.mjs +0 -1
- package/dist/chunks/copy-1.1.39-tqab4hm1.mjs +0 -9
- package/dist/chunks/cost-1.1.39-ak71khd3.mjs +0 -1
- package/dist/chunks/createSession-1.1.39-yv7a37ye.mjs +0 -1
- package/dist/chunks/debug-1.1.39-50dvjcn3.mjs +0 -1
- package/dist/chunks/defaultActionDeps-1.1.39-483fm6xk.mjs +0 -1458
- package/dist/chunks/desktop-1.1.39-hbx627a1.mjs +0 -2
- package/dist/chunks/detectRepository-1.1.39-nq1yyp24.mjs +0 -1
- package/dist/chunks/detection-1.1.39-myz8dcyc.mjs +0 -1
- package/dist/chunks/diff-1.1.39-zwwd0sxq.mjs +0 -1
- package/dist/chunks/doctor-1.1.39-bw8w0sdj.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-1.1.39-x9azkqjy.mjs +0 -1
- package/dist/chunks/earlyInput-1.1.39-3wtxyym8.mjs +0 -1
- package/dist/chunks/effort-1.1.39-4r28x4kv.mjs +0 -13
- package/dist/chunks/engine-1.1.39-jjwgtndr.mjs +0 -1
- package/dist/chunks/envUtils-1.1.39-azqd5ff8.mjs +0 -1
- package/dist/chunks/errors-1.1.39-z6wpc1z1.mjs +0 -1
- package/dist/chunks/exampleCommands-1.1.39-fhwx5xxp.mjs +0 -1
- package/dist/chunks/execFileNoThrow-1.1.39-raa250pr.mjs +0 -1
- package/dist/chunks/exit-1.1.39-vwjekv6v.mjs +0 -1
- package/dist/chunks/explorer-1.1.39-rs5cjdex.mjs +0 -1
- package/dist/chunks/export-1.1.39-eg5q8fpq.mjs +0 -2
- package/dist/chunks/fast-1.1.39-j8zrdcv9.mjs +0 -1
- package/dist/chunks/feedback-1.1.39-tt17q1d1.mjs +0 -16
- package/dist/chunks/git-1.1.39-hf1cm8nf.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-1.1.39-yb2392an.mjs +0 -1
- package/dist/chunks/goal-1.1.39-6q6twvx9.mjs +0 -4
- package/dist/chunks/headless-1.1.39-e745sf98.mjs +0 -2
- package/dist/chunks/heapdump-1.1.39-1mf2vt2g.mjs +0 -6
- package/dist/chunks/help-1.1.39-szdr1nvx.mjs +0 -1
- package/dist/chunks/hooks-1.1.39-5pws6gsg.mjs +0 -79
- package/dist/chunks/hooks-1.1.39-6tz18s8r.mjs +0 -1
- package/dist/chunks/ide-1.1.39-nk0vmfg1.mjs +0 -3
- package/dist/chunks/image-processor-napi-1.1.39-rx4ypf8k.mjs +0 -1
- package/dist/chunks/import-1.1.39-eyddkf9v.mjs +0 -260
- package/dist/chunks/inboundAttachments-1.1.39-g0fjztwj.mjs +0 -1
- package/dist/chunks/index-1.1.39-1wfhz9pz.mjs +0 -1
- package/dist/chunks/index-1.1.39-27vjd0t1.mjs +0 -1
- package/dist/chunks/index-1.1.39-3mp0kdhv.mjs +0 -1
- package/dist/chunks/index-1.1.39-aj2fb3nf.mjs +0 -30
- package/dist/chunks/index-1.1.39-ajb8kk03.mjs +0 -1
- package/dist/chunks/index-1.1.39-bznxqgpz.mjs +0 -1
- package/dist/chunks/index-1.1.39-cf96agzw.mjs +0 -2
- package/dist/chunks/index-1.1.39-d4j661cs.mjs +0 -1
- package/dist/chunks/index-1.1.39-dapcfrje.mjs +0 -1
- package/dist/chunks/index-1.1.39-e9fjpss8.mjs +0 -1
- package/dist/chunks/index-1.1.39-eg0vw6jg.mjs +0 -1
- package/dist/chunks/index-1.1.39-eqm0e7bk.mjs +0 -1
- package/dist/chunks/index-1.1.39-frzv879p.mjs +0 -23
- package/dist/chunks/index-1.1.39-fthy3yb2.mjs +0 -1
- package/dist/chunks/index-1.1.39-h7tvkmm7.mjs +0 -9
- package/dist/chunks/index-1.1.39-hn7czx81.mjs +0 -5
- package/dist/chunks/index-1.1.39-jeg0xvtv.mjs +0 -1
- package/dist/chunks/index-1.1.39-qh6j97r3.mjs +0 -2
- package/dist/chunks/index-1.1.39-szfdrv3c.mjs +0 -9
- package/dist/chunks/index-1.1.39-t358fdhx.mjs +0 -1
- package/dist/chunks/index-1.1.39-w73ez3fh.mjs +0 -1
- package/dist/chunks/index-1.1.39-xcj56xfg.mjs +0 -1
- package/dist/chunks/index-1.1.39-zy7eyf9r.mjs +0 -1
- package/dist/chunks/init-1.1.39-fm3907f2.mjs +0 -2
- package/dist/chunks/initReplBridge-1.1.39-76qw9tbk.mjs +0 -1
- package/dist/chunks/ink-1.1.39-f9cyw022.mjs +0 -1
- package/dist/chunks/insights-1.1.39-ee2ra979.mjs +0 -870
- package/dist/chunks/install-1.1.39-1hv4f4fk.mjs +0 -1
- package/dist/chunks/install-github-app-1.1.39-tg2jfpvx.mjs +0 -149
- package/dist/chunks/install-slack-app-1.1.39-69fgekh2.mjs +0 -1
- package/dist/chunks/interactiveHelpers-1.1.39-5caf0pb7.mjs +0 -1
- package/dist/chunks/latestVersionCache-1.1.39-31bygz1b.mjs +0 -1
- package/dist/chunks/loadAgentsDir-1.1.39-1jtdv1bq.mjs +0 -1
- package/dist/chunks/loadPluginHooks-1.1.39-4xw48447.mjs +0 -1
- package/dist/chunks/log-1.1.39-50bfm8j0.mjs +0 -1
- package/dist/chunks/main-1.1.39-f3n951kv.mjs +0 -1
- package/dist/chunks/managedEnv-1.1.39-bwtexcjv.mjs +0 -1
- package/dist/chunks/mcp-1.1.39-15sz3hsq.mjs +0 -1
- package/dist/chunks/mcp-1.1.39-h4h304ze.mjs +0 -4
- package/dist/chunks/mcp-1.1.39-rdsgsc15.mjs +0 -17
- package/dist/chunks/mcpb-1.1.39-5qywjc26.mjs +0 -1
- package/dist/chunks/memory-1.1.39-8edv180p.mjs +0 -128
- package/dist/chunks/model-1.1.39-95b780x9.mjs +0 -2
- package/dist/chunks/model-1.1.39-a5xmtpbv.mjs +0 -1
- package/dist/chunks/new-1.1.39-9476r8p1.mjs +0 -1
- package/dist/chunks/node-1.1.39-pqhskkn0.mjs +0 -15
- package/dist/chunks/node-1.1.39-xgvdgvgj.mjs +0 -1
- package/dist/chunks/oauth-1.1.39-5h69g0mf.mjs +0 -1
- package/dist/chunks/openaiShim-1.1.39-jnp9fkcv.mjs +0 -14
- package/dist/chunks/output-style-1.1.39-e5qsw51y.mjs +0 -1
- package/dist/chunks/package-V72LKFNW-1.1.39-0gcw2fkh.mjs +0 -1
- package/dist/chunks/permissions-1.1.39-0m2h5ctr.mjs +0 -3
- package/dist/chunks/permissions-1.1.39-djt32qkn.mjs +0 -1
- package/dist/chunks/plan-1.1.39-qcq9a7rg.mjs +0 -1
- package/dist/chunks/plist-1.1.39-esb4db3e.mjs +0 -1
- package/dist/chunks/plugin-1.1.39-xztkvc83.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-1.1.39-pzynd625.mjs +0 -1
- package/dist/chunks/plugins-1.1.39-2vnnwfwq.mjs +0 -9
- package/dist/chunks/preActionHook-1.1.39-w6ay049g.mjs +0 -2
- package/dist/chunks/print-1.1.39-m20hre3d.mjs +0 -57
- package/dist/chunks/process-1.1.39-7pp4m6p6.mjs +0 -1
- package/dist/chunks/processBashCommand-1.1.39-z8xyxzeb.mjs +0 -1
- package/dist/chunks/processSlashCommand-1.1.39-025rdqc4.mjs +0 -9
- package/dist/chunks/prompt-1.1.39-8cves1th.mjs +0 -1
- package/dist/chunks/prompt-1.1.39-vys3tszv.mjs +0 -1
- package/dist/chunks/prompts-1.1.39-agk5ys12.mjs +0 -1
- package/dist/chunks/provider-1.1.39-ezn3013z.mjs +0 -2
- package/dist/chunks/providerProfiles-1.1.39-c20aqfkp.mjs +0 -1
- package/dist/chunks/providerValidation-1.1.39-5bwc03ac.mjs +0 -6
- package/dist/chunks/registerSubcommands-1.1.39-tg42q4mt.mjs +0 -26
- package/dist/chunks/registry-1.1.39-69kg9048.mjs +0 -1
- package/dist/chunks/release-notes-1.1.39-vm602996.mjs +0 -5
- package/dist/chunks/reload-plugins-1.1.39-hq5jb4fe.mjs +0 -2
- package/dist/chunks/remote-env-1.1.39-b742xwt8.mjs +0 -1
- package/dist/chunks/rename-1.1.39-37583s4r.mjs +0 -1
- package/dist/chunks/replLauncher-1.1.39-x7vm725e.mjs +0 -1
- package/dist/chunks/resume-1.1.39-7x78pwef.mjs +0 -2
- package/dist/chunks/rewind-1.1.39-36y4s8ng.mjs +0 -1
- package/dist/chunks/rootOptions-1.1.39-ns1nx8k9.mjs +0 -1
- package/dist/chunks/runWorkflowHeadless-1.1.39-8p1cbkrx.mjs +0 -10
- package/dist/chunks/sandbox-adapter-1.1.39-bt6cm9af.mjs +0 -1
- package/dist/chunks/sandbox-toggle-1.1.39-a3p74qsk.mjs +0 -1
- package/dist/chunks/session-1.1.39-qgpx4589.mjs +0 -2
- package/dist/chunks/sessionStorage-1.1.39-fp105vvb.mjs +0 -1
- package/dist/chunks/settings-1.1.39-qe258cgb.mjs +0 -1
- package/dist/chunks/setup-1.1.39-4zjv96k3.mjs +0 -12
- package/dist/chunks/sinks-1.1.39-6xx75cg6.mjs +0 -1
- package/dist/chunks/skills-1.1.39-2d5tfynf.mjs +0 -1
- package/dist/chunks/startupProfiler-1.1.39-jcvdrk17.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-1.1.39-43maz2ha.mjs +0 -1
- package/dist/chunks/state-1.1.39-4sbpam9q.mjs +0 -1
- package/dist/chunks/stats-1.1.39-8p35mm3v.mjs +0 -1
- package/dist/chunks/status-1.1.39-1qcsfp99.mjs +0 -1
- package/dist/chunks/stickers-1.1.39-hppwbrtb.mjs +0 -1
- package/dist/chunks/subprocessEnv-1.1.39-hp2bbefp.mjs +0 -1
- package/dist/chunks/tasks-1.1.39-qs8xddg1.mjs +0 -1
- package/dist/chunks/teamHelpers-1.1.39-qnvqd2j1.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-1.1.39-pr2vnqzw.mjs +0 -1
- package/dist/chunks/teleport-1.1.39-zt8tze77.mjs +0 -1
- package/dist/chunks/terminalSetup-1.1.39-715qq4cf.mjs +0 -1
- package/dist/chunks/theme-1.1.39-gnxdfpcb.mjs +0 -1
- package/dist/chunks/toolPool-1.1.39-77884kvy.mjs +0 -1
- package/dist/chunks/toolSearch-1.1.39-b2k8yjaz.mjs +0 -1
- package/dist/chunks/tools-1.1.39-7nbe7hrf.mjs +0 -1
- package/dist/chunks/turndown.cjs-1.1.39-h0gz7em7.mjs +0 -69
- package/dist/chunks/types-1.1.39-jcqnbyss.mjs +0 -1
- package/dist/chunks/update-1.1.39-1w75psfh.mjs +0 -72
- package/dist/chunks/upload-1.1.39-z8ymn737.mjs +0 -7
- package/dist/chunks/upstreamproxy-1.1.39-j1d74feb.mjs +0 -14
- package/dist/chunks/usage-1.1.39-s31k5fep.mjs +0 -1
- package/dist/chunks/util-1.1.39-ad8sk0dp.mjs +0 -1
- package/dist/chunks/utils-1.1.39-ya8kcrhm.mjs +0 -1
- package/dist/chunks/vim-1.1.39-b6pfmpbz.mjs +0 -1
- package/dist/chunks/watchLoop-1.1.39-h3bxe3p9.mjs +0 -13
- package/dist/chunks/wiki-1.1.39-5aj4xh5m.mjs +0 -132
- package/dist/chunks/workflows-1.1.39-f31ham8r.mjs +0 -1
- package/dist/chunks/worktree-1.1.39-sf55cdqj.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-1.1.39-4ja3es46.mjs +0 -1
- package/dist/chunks/wrapper-1.1.39-r1fj52tb.mjs +0 -7
- /package/dist/chunks/{cli-1.1.39-avfsydnr.mjs → cli-1.1.40-1y2tz88m.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-hn5s43sr.mjs → cli-1.1.40-3xg2bc7f.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-jsnryd3j.mjs → cli-1.1.40-8vgr1z6h.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-z8ts6axr.mjs → cli-1.1.40-jxfk62k7.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-erbg35qn.mjs → cli-1.1.40-x18jz9h5.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-qnem4654.mjs → cli-1.1.40-ys83fnw1.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Nqa as M}from"./cli-1.1.40-jxfk62k7.mjs";function G(q){if(q===null||typeof q!=="object"||Array.isArray(q))return null;return q}function W(q){return typeof q==="string"&&q.length>0?q:null}function T(q){return typeof q==="boolean"?q:null}function g(q){if(!Array.isArray(q))return null;let z=[];for(let A of q){if(typeof A!=="string")return null;z.push(A)}return z}function F(q){let z=G(q);if(!z)return null;let A={};for(let[C,B]of Object.entries(z))if(typeof B==="string")A[C]=B;else if(typeof B==="number"||typeof B==="boolean")A[C]=String(B);return A}function k(q,...z){let A=q;for(let C of z){let B=G(A);if(!B)return;A=B[C]}return A}var O=()=>{};import{cpSync as X,existsSync as Q,mkdirSync as Y,readFileSync as Z,readdirSync as _,statSync as U,writeFileSync as $}from"fs";import{dirname as j}from"path";function b(q){try{return G(JSON.parse(Z(q,"utf8")))}catch{return null}}function x(q,z){$(q,JSON.stringify(z,null,2),{encoding:"utf8"})}function N(q){Y(q,{recursive:!0})}function D(q,z){if(!Q(q))return!1;if(!U(q).isDirectory())return!1;return N(j(z)),X(q,z,{recursive:!0,force:!1,errorOnExist:!1,dereference:!0}),!0}function p(q,z){let A=[],C=(B,H)=>{let I;try{I=_(B)}catch{return}for(let E of I.sort()){let J=`${B}/${E}`,K=H?`${H}/${E}`:E,L;try{L=U(J).isDirectory()}catch{continue}if(L)C(J,K);else if(z.some((V)=>E.endsWith(V)))A.push(K)}};if(!Q(q))return A;return C(q,""),A}var R=M(()=>{O()});
|
|
2
|
+
export{G as Xe,W as Ye,T as Ze,g as _e,F as $e,k as af,O as bf,b as cf,x as df,N as ef,D as ff,p as gf,R as hf};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Cqa as x,Eqa as y,Iqa as C}from"./cli-1.1.40-fn6qzvk2.mjs";import{Lqa as k}from"./cli-1.1.40-jxfk62k7.mjs";var MF=k((n)=>{var K=x(),b=C(),w=y(),f=(F)=>F[K.SMITHY_CONTEXT_KEY]||(F[K.SMITHY_CONTEXT_KEY]={}),h=(F,J)=>{if(!J||J.length===0)return F;let G=[];for(let L of J)for(let Q of F)if(Q.schemeId.split("#")[1]===L)G.push(Q);for(let L of F)if(!G.find(({schemeId:Q})=>Q===L.schemeId))G.push(L);return G};function v(F){let J=new Map;for(let G of F)J.set(G.schemeId,G);return J}var j=(F,J)=>(G,L)=>async(Q)=>{let V=F.httpAuthSchemeProvider(await J.httpAuthSchemeParametersProvider(F,L,Q.input)),W=F.authSchemePreference?await F.authSchemePreference():[],Z=h(V,W),Y=v(F.httpAuthSchemes),U=w.getSmithyContext(L),$=[];for(let X of Z){let B=Y.get(X.schemeId);if(!B){$.push(`HttpAuthScheme \`${X.schemeId}\` was not enabled for this service.`);continue}let D=B.identityProvider(await J.identityProviderConfigProvider(F));if(!D){$.push(`HttpAuthScheme \`${X.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:N={},signingProperties:R={}}=X.propertiesExtractor?.(F,L)||{};X.identityProperties=Object.assign(X.identityProperties||{},N),X.signingProperties=Object.assign(X.signingProperties||{},R),U.selectedHttpAuthScheme={httpAuthOption:X,identity:await D(X.identityProperties),signer:B.signer};break}if(!U.selectedHttpAuthScheme)throw Error($.join(`
|
|
2
|
+
`));return G(Q)},H={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},P=(F,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:G})=>({applyToStack:(L)=>{L.addRelativeTo(j(F,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:G}),H)}}),M={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},l=(F,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:G})=>({applyToStack:(L)=>{L.addRelativeTo(j(F,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:G}),M)}}),m=(F)=>(J)=>{throw J},u=(F,J)=>{},O=(F)=>(J,G)=>async(L)=>{if(!b.HttpRequest.isInstance(L.request))return J(L);let V=w.getSmithyContext(G).selectedHttpAuthScheme;if(!V)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:W={}},identity:Z,signer:Y}=V,U=await J({...L,request:await Y.sign(L.request,Z,W)}).catch((Y.errorHandler||m)(W));return(Y.successHandler||u)(U.response,W),U},I={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},c=(F)=>({applyToStack:(J)=>{J.addRelativeTo(O(),I)}}),a=(F)=>{if(typeof F==="function")return F;let J=Promise.resolve(F);return()=>J},d=async(F,J,G,L=(V)=>V,...Q)=>{let V=new F(G);return V=L(V)??V,await J.send(V,...Q)};function g(F,J,G,L,Q){return async function*(W,Z,...Y){let U=Z,$=W.startingToken??U[G],X=!0,B;while(X){if(U[G]=$,Q)U[Q]=U[Q]??W.pageSize;if(W.client instanceof F)B=await d(J,W.client,Z,W.withCommand,...Y);else throw Error(`Invalid client, expected instance of ${F.name}`);yield B;let D=$;$=p(B,L),X=!!($&&(!W.stopOnSameToken||$!==D))}return}}var p=(F,J)=>{let G=F,L=J.split(".");for(let Q of L){if(!G||typeof G!=="object")return;G=G[Q]}return G};function s(F,J,G){if(!F.__smithy_context)F.__smithy_context={features:{}};else if(!F.__smithy_context.features)F.__smithy_context.features={};F.__smithy_context.features[J]=G}class E{authSchemes=new Map;constructor(F){for(let J in F){let G=F[J];if(G!==void 0)this.authSchemes.set(J,G)}}getIdentityProvider(F){return this.authSchemes.get(F)}}class _{async sign(F,J,G){if(!G)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!G.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!G.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!J.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let L=b.HttpRequest.clone(F);if(G.in===K.HttpApiKeyAuthLocation.QUERY)L.query[G.name]=J.apiKey;else if(G.in===K.HttpApiKeyAuthLocation.HEADER)L.headers[G.name]=G.scheme?`${G.scheme} ${J.apiKey}`:J.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+G.in+"`");return L}}class z{async sign(F,J,G){let L=b.HttpRequest.clone(F);if(!J.token)throw Error("request could not be signed with `token` since the `token` is not defined");return L.headers.Authorization=`Bearer ${J.token}`,L}}class A{async sign(F,J,G){return F}}var q=(F)=>function(G){return S(G)&&G.expiration.getTime()-Date.now()<F},T=300000,r=q(T),S=(F)=>F.expiration!==void 0,o=(F,J,G)=>{if(F===void 0)return;let L=typeof F!=="function"?async()=>Promise.resolve(F):F,Q,V,W,Z=!1,Y=async(U)=>{if(!V)V=L(U);try{Q=await V,W=!0,Z=!1}finally{V=void 0}return Q};if(J===void 0)return async(U)=>{if(!W||U?.forceRefresh)Q=await Y(U);return Q};return async(U)=>{if(!W||U?.forceRefresh)Q=await Y(U);if(Z)return Q;if(!G(Q))return Z=!0,Q;if(J(Q))return await Y(U),Q;return Q}};n.requestBuilder=b.requestBuilder;n.DefaultIdentityProviderConfig=E;n.EXPIRATION_MS=T;n.HttpApiKeyAuthSigner=_;n.HttpBearerAuthSigner=z;n.NoAuthSigner=A;n.createIsIdentityExpiredFunction=q;n.createPaginator=g;n.doesIdentityRequireRefresh=S;n.getHttpAuthSchemeEndpointRuleSetPlugin=P;n.getHttpAuthSchemePlugin=l;n.getHttpSigningPlugin=c;n.getSmithyContext=f;n.httpAuthSchemeEndpointRuleSetMiddlewareOptions=H;n.httpAuthSchemeMiddleware=j;n.httpAuthSchemeMiddlewareOptions=M;n.httpSigningMiddleware=O;n.httpSigningMiddlewareOptions=I;n.isIdentityExpired=r;n.memoizeIdentityProvider=o;n.normalizeProvider=a;n.setFeature=s});
|
|
3
|
+
export{MF as n8};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{Jqa as w5,Lqa as b$,Nqa as T,Oqa as SZ}from"./cli-1.1.40-jxfk62k7.mjs";function q(X,Z,$,J,z){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?X!==Z||!z:!Z.has(X))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?z.call(X,$):z?z.value=$:Z.set(X,$),$}function Q(X,Z,$,J){if($==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?X!==Z||!J:!Z.has(X))throw TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?J:$==="a"?J.call(X):J?J.value:Z.get(X)}var YZ=()=>{};function TZ(X){return typeof X==="object"&&X!==null&&(("name"in X)&&X.name==="AbortError"||("message"in X)&&String(X.message).includes("FetchRequestCanceledException"))}var pZ=(X)=>{if(X instanceof Error)return X;if(typeof X==="object"&&X!==null){try{let Z=Object.prototype.toString.call(X);if(Z==="[object Error]"||Z==="[object DOMException]"){let $=Error(X.message,X.cause?{cause:X.cause}:{});if(X.stack)$.stack=X.stack;if(X.cause&&!$.cause)$.cause=X.cause;if(X.name)$.name=X.name;return $}}catch{}try{return Error(JSON.stringify(X))}catch{}}return Error(X)};var iZ=()=>{};var F,_,s,IZ,I0,Q$,f0,y0,k0,h0,b0,g0,v0,_0;var u=T(()=>{iZ();F=(()=>{class X extends Error{}return X})();_=class _ extends F{constructor(X,Z,$,J,z){super(`${_.makeMessage(X,Z,$)}`);this.status=X,this.headers=J,this.requestID=J?.get("request-id"),this.workspaceID=J?.get("anthropic-workspace-id"),this.error=Z,this.type=z??null}static makeMessage(X,Z,$){let J=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):$;if(X&&J)return`${X} ${J}`;if(X)return`${X} status code (no body)`;if(J)return J;return"(no status code or body)"}static generate(X,Z,$,J){if(!X||!J)return new IZ({message:$,cause:pZ(Z)});let z=Z,Y=z?.error?.type;if(X===400)return new f0(X,z,$,J,Y);if(X===401)return new y0(X,z,$,J,Y);if(X===403)return new k0(X,z,$,J,Y);if(X===404)return new h0(X,z,$,J,Y);if(X===409)return new b0(X,z,$,J,Y);if(X===422)return new g0(X,z,$,J,Y);if(X===429)return new v0(X,z,$,J,Y);if(X>=500)return new _0(X,z,$,J,Y);return new _(X,z,$,J,Y)}};s=class s extends _{constructor({message:X}={}){super(void 0,void 0,X||"Request was aborted.",void 0)}};IZ=class IZ extends _{constructor({message:X,cause:Z}){super(void 0,void 0,X||"Connection error.",void 0);if(Z)this.cause=Z}};I0=class I0 extends IZ{constructor({message:X}={}){super({message:X??"Request timed out."})}};Q$=class Q$ extends F{constructor(X,{cause:Z}={}){super(X??"Retryable error.");if(Z!==void 0)this.cause=Z}};f0=class f0 extends _{};y0=class y0 extends _{};k0=class k0 extends _{};h0=class h0 extends _{};b0=class b0 extends _{};g0=class g0 extends _{};v0=class v0 extends _{};_0=class _0 extends _{}});var J0;var K$=T(()=>{J0=(()=>{class X extends Error{constructor(Z){let $=typeof Z==="string"?Z:Z.map((J)=>{if(J.type==="text")return J.text;return`[${J.type}]`}).join(" ");super($);this.name="ToolError",this.content=Z}}return X})()});function N6(X,Z){if(!(X>=V6))throw new F(`${Z} must be at least ${V6}ms (got ${X}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var U2=15000,V6=5000;var W6=T(()=>{u()});function _X(){let X,Z;return{promise:new Promise((J,z)=>{X=J,Z=z}),resolve:X,reject:Z}}var G6=()=>{};function m0(X){if(typeof X!=="object")return{};return X??{}}function uX(X){if(!X)return!0;for(let Z in X)return!1;return!0}function q6(X,Z){return Object.prototype.hasOwnProperty.call(X,Z)}function cX(X){return X!=null&&typeof X==="object"&&!Array.isArray(X)}function kZ(X){}var y7,U6=(X)=>{return y7.test(X)},e=(X)=>(e=Array.isArray,e(X)),mX,V$=(X,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new F(`${X} must be an integer`);if(Z<0)throw new F(`${X} must be a positive integer`);return Z},N$=(X)=>{try{return JSON.parse(X)}catch(Z){return}};var $Z=T(()=>{u();y7=/^[a-z][a-z0-9+.-]*:/i,mX=e});var MZ=(X,Z)=>new Promise(($)=>{if(Z?.aborted)return $();let J=()=>{clearTimeout(z),$()},z=setTimeout(()=>{Z?.removeEventListener("abort",J),$()},X);Z?.addEventListener("abort",J,{once:!0})});var z0=()=>{};var UZ="0.128.0";var u0=()=>{};function k7(){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"}function b7(){if(typeof navigator>"u"||!navigator)return null;let X=[{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:Z,pattern:$}of X){let J=$.exec(navigator.userAgent);if(J){let z=J[1]||0,Y=J[2]||0,K=J[3]||0;return{browser:Z,version:`${z}.${Y}.${K}`}}}return null}var T6=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},h7=()=>{let X=k7();if(X==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":UZ,"X-Stainless-OS":O6(Deno.build.os),"X-Stainless-Arch":B6(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":UZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(X==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":UZ,"X-Stainless-OS":O6(globalThis.process.platform??"unknown"),"X-Stainless-Arch":B6(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=b7();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":UZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":UZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},B6=(X)=>{if(X==="x32")return"x32";if(X==="x86_64"||X==="x64")return"x64";if(X==="arm")return"arm";if(X==="aarch64"||X==="arm64")return"arm64";if(X)return`other:${X}`;return"unknown"},O6=(X)=>{if(X=X.toLowerCase(),X.includes("ios"))return"iOS";if(X==="android")return"Android";if(X==="darwin")return"MacOS";if(X==="win32")return"Windows";if(X==="freebsd")return"FreeBSD";if(X==="openbsd")return"OpenBSD";if(X==="linux")return"Linux";if(X)return`Other:${X}`;return"Unknown"},C6,c0=()=>{return C6??(C6=h7())};var W$=T(()=>{u0()});function g7(X,Z){return()=>X.removeEventListener("abort",Z)}function x6(X,Z,$){G$.set(X,g7(Z,$))}function H6(X,Z){if(G$.has(Z))M6?.register(X,Z,Z)}function FZ(X){let Z=G$.get(X);if(Z)G$.delete(X),M6?.unregister(X),Z()}var G$,M6;var U$=T(()=>{G$=new WeakMap,M6=typeof globalThis.FinalizationRegistry==="function"?new globalThis.FinalizationRegistry((X)=>FZ(X)):null});function F6(){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 dX(...X){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...X)}function q$(X){let Z=Symbol.asyncIterator in X?X[Symbol.asyncIterator]():X[Symbol.iterator]();return dX({start(){},async pull($){let{done:J,value:z}=await Z.next();if(J)$.close();else $.enqueue(z)},async cancel(){await Z.return?.()}})}function d0(X){if(X[Symbol.asyncIterator])return X;let Z=X.getReader();return{async next(){try{let $=await Z.read();if($?.done)Z.releaseLock();return $}catch($){throw Z.releaseLock(),$}},async return(){let $=Z.cancel();return Z.releaseLock(),await $,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function A6(X){if(X===null||typeof X!=="object")return;if(X[Symbol.asyncIterator]){await X[Symbol.asyncIterator]().return?.();return}let Z=X.getReader(),$=Z.cancel();Z.releaseLock(),await $}var Y0=()=>{};var S6=({headers:X,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};var E6=()=>{};var lX="RFC3986",pX=(X)=>String(X),iX,L6="RFC1738";var nX=T(()=>{iX={RFC1738:(X)=>String(X).replace(/%20/g,"+"),RFC3986:pX}});function R6(X){if(!X||typeof X!=="object")return!1;return!!(X.constructor&&X.constructor.isBuffer&&X.constructor.isBuffer(X))}function rX(X,Z){if(e(X)){let $=[];for(let J=0;J<X.length;J+=1)$.push(Z(X[J]));return $}return Z(X)}var B$=(X,Z)=>(B$=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),B$(X,Z)),AZ,aX=1024,j6=(X,Z,$,J,z)=>{if(X.length===0)return X;let Y=X;if(typeof X==="symbol")Y=Symbol.prototype.toString.call(X);else if(typeof X!=="string")Y=String(X);if($==="iso-8859-1")return escape(Y).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});let K="";for(let N=0;N<Y.length;N+=aX){let W=Y.length>=aX?Y.slice(N,N+aX):Y,U=[];for(let x=0;x<W.length;++x){let B=W.charCodeAt(x);if(B===45||B===46||B===95||B===126||B>=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||z===L6&&(B===40||B===41)){U[U.length]=W.charAt(x);continue}if(B<128){U[U.length]=AZ[B];continue}if(B<2048){U[U.length]=AZ[192|B>>6]+AZ[128|B&63];continue}if(B<55296||B>=57344){U[U.length]=AZ[224|B>>12]+AZ[128|B>>6&63]+AZ[128|B&63];continue}x+=1,B=65536+((B&1023)<<10|W.charCodeAt(x)&1023),U[U.length]=AZ[240|B>>18]+AZ[128|B>>12&63]+AZ[128|B>>6&63]+AZ[128|B&63]}K+=U.join("")}return K};var D6=T(()=>{nX();$Z();AZ=(()=>{let X=[];for(let Z=0;Z<256;++Z)X.push("%"+((Z<16?"0":"")+Z.toString(16)).toUpperCase());return X})()});function m7(X){return typeof X==="string"||typeof X==="number"||typeof X==="boolean"||typeof X==="symbol"||typeof X==="bigint"}function f6(X,Z,$,J,z,Y,K,N,W,U,x,B,C,O,H,P,j,R){let A=X,k=R,E=0,I=!1;while((k=k.get(tX))!==void 0&&!I){let d=k.get(X);if(E+=1,typeof d<"u")if(d===E)throw RangeError("Cyclic object value");else I=!0;if(typeof k.get(tX)>"u")E=0}if(typeof U==="function")A=U(Z,A);else if(A instanceof Date)A=C?.(A);else if($==="comma"&&e(A))A=rX(A,function(d){if(d instanceof Date)return C?.(d);return d});if(A===null){if(Y)return W&&!P?W(Z,a.encoder,j,"key",O):Z;A=""}if(m7(A)||R6(A)){if(W){let d=P?Z:W(Z,a.encoder,j,"key",O);return[H?.(d)+"="+H?.(W(A,a.encoder,j,"value",O))]}return[H?.(Z)+"="+H?.(String(A))]}let t=[];if(typeof A>"u")return t;let b;if($==="comma"&&e(A)){if(P&&W)A=rX(A,W);b=[{value:A.length>0?A.join(",")||null:void 0}]}else if(e(U))b=U;else{let d=Object.keys(A);b=x?d.sort(x):d}let p=N?String(Z).replace(/\./g,"%2E"):String(Z),m=J&&e(A)&&A.length===1?p+"[]":p;if(z&&e(A)&&A.length===0)return m+"[]";for(let d=0;d<b.length;++d){let GZ=b[d],lZ=typeof GZ==="object"&&typeof GZ.value<"u"?GZ.value:A[GZ];if(K&&lZ===null)continue;let vX=B&&N?GZ.replace(/\./g,"%2E"):GZ,I7=e(A)?typeof $==="function"?$(m,vX):m:m+(B?"."+vX:"["+vX+"]");R.set(X,E);let K6=new WeakMap;K6.set(tX,R),I6(t,f6(lZ,I7,$,J,z,Y,K,N,$==="comma"&&P&&e(A)?null:W,U,x,B,C,O,H,P,j,K6))}return t}function u7(X=a){if(typeof X.allowEmptyArrays<"u"&&typeof X.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof X.encodeDotInKeys<"u"&&typeof X.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(X.encoder!==null&&typeof X.encoder<"u"&&typeof X.encoder!=="function")throw TypeError("Encoder has to be a function.");let Z=X.charset||a.charset;if(typeof X.charset<"u"&&X.charset!=="utf-8"&&X.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let $=lX;if(typeof X.format<"u"){if(!B$(iX,X.format))throw TypeError("Unknown format option provided.");$=X.format}let J=iX[$],z=a.filter;if(typeof X.filter==="function"||e(X.filter))z=X.filter;let Y;if(X.arrayFormat&&X.arrayFormat in P6)Y=X.arrayFormat;else if("indices"in X)Y=X.indices?"indices":"repeat";else Y=a.arrayFormat;if("commaRoundTrip"in X&&typeof X.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let K=typeof X.allowDots>"u"?!!X.encodeDotInKeys===!0?!0:a.allowDots:!!X.allowDots;return{addQueryPrefix:typeof X.addQueryPrefix==="boolean"?X.addQueryPrefix:a.addQueryPrefix,allowDots:K,allowEmptyArrays:typeof X.allowEmptyArrays==="boolean"?!!X.allowEmptyArrays:a.allowEmptyArrays,arrayFormat:Y,charset:Z,charsetSentinel:typeof X.charsetSentinel==="boolean"?X.charsetSentinel:a.charsetSentinel,commaRoundTrip:!!X.commaRoundTrip,delimiter:typeof X.delimiter>"u"?a.delimiter:X.delimiter,encode:typeof X.encode==="boolean"?X.encode:a.encode,encodeDotInKeys:typeof X.encodeDotInKeys==="boolean"?X.encodeDotInKeys:a.encodeDotInKeys,encoder:typeof X.encoder==="function"?X.encoder:a.encoder,encodeValuesOnly:typeof X.encodeValuesOnly==="boolean"?X.encodeValuesOnly:a.encodeValuesOnly,filter:z,format:$,formatter:J,serializeDate:typeof X.serializeDate==="function"?X.serializeDate:a.serializeDate,skipNulls:typeof X.skipNulls==="boolean"?X.skipNulls:a.skipNulls,sort:typeof X.sort==="function"?X.sort:null,strictNullHandling:typeof X.strictNullHandling==="boolean"?X.strictNullHandling:a.strictNullHandling}}function y6(X,Z={}){let $=X,J=u7(Z),z,Y;if(typeof J.filter==="function")Y=J.filter,$=Y("",$);else if(e(J.filter))Y=J.filter,z=Y;let K=[];if(typeof $!=="object"||$===null)return"";let N=P6[J.arrayFormat],W=N==="comma"&&J.commaRoundTrip;if(!z)z=Object.keys($);if(J.sort)z.sort(J.sort);let U=new WeakMap;for(let C=0;C<z.length;++C){let O=z[C];if(J.skipNulls&&$[O]===null)continue;I6(K,f6($[O],O,N,W,J.allowEmptyArrays,J.strictNullHandling,J.skipNulls,J.encodeDotInKeys,J.encode?J.encoder:null,J.filter,J.sort,J.allowDots,J.serializeDate,J.format,J.formatter,J.encodeValuesOnly,J.charset,U))}let x=K.join(J.delimiter),B=J.addQueryPrefix===!0?"?":"";if(J.charsetSentinel)if(J.charset==="iso-8859-1")B+="utf8=%26%2310003%3B&";else B+="utf8=%E2%9C%93&";return x.length>0?B+x:""}var P6,I6=function(X,Z){Array.prototype.push.apply(X,e(Z)?Z:[Z])},w6,a,tX;var k6=T(()=>{D6();nX();$Z();P6={brackets(X){return String(X)+"[]"},comma:"comma",indices(X,Z){return String(X)+"["+Z+"]"},repeat(X){return String(X)}},a={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:j6,encodeValuesOnly:!1,format:lX,formatter:pX,indices:!1,serializeDate(X){return(w6??(w6=Function.prototype.call.bind(Date.prototype.toISOString)))(X)},skipNulls:!1,strictNullHandling:!1};tX={}});function h6(X){return y6(X,{arrayFormat:"brackets"})}var oX=T(()=>{k6()});function C$(X){if(!X)return;let Z;try{Z=new URL(X)}catch(J){throw new g(`Invalid token endpoint base URL "${X}": ${J}`)}if(Z.protocol==="https:")return;let $=Z.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(Z.protocol==="http:"&&($==="localhost"||$==="127.0.0.1"||$==="::1"))return;throw new g(`Refusing to send credential over non-https token endpoint "${X}"`)}async function T$(X,Z){let $=await l7(X),J;try{J=JSON.parse($)}catch{throw new g(`Token endpoint returned non-JSON response (status ${X.status})`,X.status,XZ($),Z)}if(!J.access_token)throw new g(`Token endpoint response missing access_token: ${JSON.stringify(XZ(J))}`,X.status,XZ(J),Z);if(J.token_type&&J.token_type.toLowerCase()!=="bearer")throw new g(`Token endpoint response: unsupported token_type "${J.token_type}" (want Bearer)`,X.status,XZ(J),Z);return J}function XZ(X){if(X==null)return X;if(typeof X==="string"){let Z;try{Z=JSON.parse(X)}catch{if(X.length<=sX)return X;return X.slice(0,sX)+`... <${X.length-sX} more chars>`}return JSON.stringify(XZ(Z))}if(typeof X==="object"&&!Array.isArray(X)){let Z={};for(let[$,J]of Object.entries(X))if(d7.has($))Z[$]=J;return Z}return null}async function M$(X,Z=($)=>console.warn(`anthropic-sdk: ${$}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:$}=await import("./node-1.1.40-9cewz2cq.mjs"),J=X,z;try{J=await $.promises.realpath(X),z=await $.promises.stat(J)}catch{return}let Y=z.mode&511;if(Y&18)throw new g(`Credentials file at ${J} is group/world-writable (mode 0o${Y.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${J}\`.`);if(Y&36)throw new g(`Credentials file at ${J} is group/world-readable (mode 0o${Y.toString(8)}); run \`chmod 600 ${J}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())Z(`credentials file at ${J} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function x$(X,Z){let{fs:$,path:J}=await import("./node-1.1.40-9cewz2cq.mjs"),z=J.dirname(X);await $.promises.mkdir(z,{recursive:!0,mode:448});let Y=`${X}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let K=await $.promises.open(Y,"w",384);try{await K.writeFile(JSON.stringify(Z,null,2)),await K.sync()}finally{await K.close()}await $.promises.rename(Y,X)}catch(K){throw await $.promises.unlink(Y).catch(()=>{}),K}try{let K=await $.promises.open(z,"r");try{await K.sync()}finally{await K.close()}}catch{}}async function l7(X){if(!X.body)return"";let Z=X.body.getReader(),$=[],J=0;for(;;){let{done:Y,value:K}=await Z.read();if(Y)break;if(J+K.length>b6){let N=b6-J;if(N>0)$.push(K.subarray(0,N));await Z.cancel();break}$.push(K),J+=K.length}let z;if($.length===1)z=$[0];else{z=new Uint8Array($.reduce((K,N)=>K+N.length,0));let Y=0;for(let K of $)z.set(K,Y),Y+=K.length}return new TextDecoder("utf-8").decode(z)}var g6="urn:ietf:params:oauth:grant-type:jwt-bearer",v6="refresh_token",O$="/v1/oauth/token",nZ="oauth-2025-04-20",_6="oidc-federation-2026-04-01",m6=120,Q0=30,u6=5,b6=1048576,sX=2000,d7,g;var K0=T(()=>{u();d7=new Set(["error","error_description","error_uri"]);g=class g extends F{constructor(X,Z=null,$=null,J=null){super(X);this.statusCode=Z,this.body=$,this.requestId=J}}});function xZ(){return Math.floor(Date.now()/1000)}var l0=()=>{};class eX{constructor(X,Z){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=X,this.onAdvisoryRefreshError=Z}async getToken(){let X=this.nextForce;this.nextForce=!1;let Z=this.cached;if(X||Z==null)return(await this.refresh(X)).token;if(Z.expiresAt==null)return Z.token;let $=Z.expiresAt-xZ();if($>m6)return Z.token;if($>Q0)return this.backgroundRefresh(),Z.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(X=!1){if(this.pendingRefresh&&!X)return this.pendingRefresh;return this.doRefresh(X)}backgroundRefresh(){if(this.pendingRefresh)return;if(xZ()-this.lastAdvisoryError<u6)return;this.doRefresh().catch((X)=>{this.lastAdvisoryError=xZ(),this.onAdvisoryRefreshError?.(X)})}doRefresh(X=!1){return this.pendingRefresh=this.provider(X?{forceRefresh:!0}:void 0).then((Z)=>{return this.cached=Z,this.pendingRefresh=null,Z},(Z)=>{throw this.pendingRefresh=null,Z}),this.pendingRefresh}}var c6=T(()=>{K0();l0()});var y=(X)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[X]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(X)?.trim()||void 0;return};var V0=()=>{};function p6(X){let Z=0;for(let z of X)Z+=z.length;let $=new Uint8Array(Z),J=0;for(let z of X)$.set(z,J),J+=z.length;return $}function p0(X){let Z;return(d6??(Z=new globalThis.TextEncoder,d6=Z.encode.bind(Z)))(X)}function i0(X){let Z;return(l6??(Z=new globalThis.TextDecoder,l6=Z.decode.bind(Z)))(X)}var d6,l6;var H$=()=>{};var i6=(X)=>{if(typeof globalThis.Buffer<"u"){let Z=globalThis.Buffer.from(X,"base64");return new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength)}if(typeof atob<"u"){let Z=atob(X),$=new Uint8Array(Z.length);for(let J=0;J<Z.length;J++)$[J]=Z.charCodeAt(J);return $}throw new F("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined")};var Z1=T(()=>{u()});function N0(){}function F$(X,Z,$){if(!Z||A$[X]>A$[$])return N0;else return Z[X].bind(Z)}function X1(X,Z){let $=n6.get(X);if($&&$[0]===Z)return $[1];let J={error:F$("error",X,Z),warn:F$("warn",X,Z),info:F$("info",X,Z),debug:F$("debug",X,Z)};return n6.set(X,[Z,J]),J}function h(X){let Z=X.logger,$=X.logLevel??"off";if(!Z)return p7;return X1(Z,$)}function r6(){let X=y("ANTHROPIC_LOG");if(!$1||X!==a6)a6=X,$1=X1(console,S$(X,"process.env['ANTHROPIC_LOG']",X1(console,n0))??n0);return $1}function EZ(X,Z,$){if(X.debug===N0)return;X.debug(Z,i7($))}var n0="warn",A$,S$=(X,Z,$)=>{if(!X)return;if(q6(A$,X))return X;$.warn(`${Z} was set to ${JSON.stringify(X)}, expected one of ${JSON.stringify(Object.keys(A$))}`);return},p7,n6,a6,$1,i7=(X)=>{if(X.options)X.options={...X.options},delete X.options.headers;if(X.headers)X.headers=Object.fromEntries((X.headers instanceof Headers?[...X.headers]:Object.entries(X.headers)).map(([Z,$])=>[Z,Z.toLowerCase()==="authorization"||Z.toLowerCase()==="api-key"||Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":$]));if("retryOfRequestLogID"in X){if(X.retryOfRequestLogID)X.retryOf=X.retryOfRequestLogID;delete X.retryOfRequestLogID}return X};var LZ=T(()=>{$Z();V0();A$={off:0,error:200,warn:300,info:400,debug:500};p7={error:N0,warn:N0,info:N0,debug:N0},n6=new WeakMap});var E$=function(){let{crypto:X}=globalThis;if(X?.randomUUID)return E$=X.randomUUID.bind(X),X.randomUUID();let Z=new Uint8Array(1),$=X?()=>X.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(J)=>(+J^$()&15>>+J/4).toString(16))};var J1=()=>{};var t6=T(()=>{$Z();Z1();V0();LZ();J1();z0();oX()});function o6(X){if(!X)throw Error("profile name is empty");if(X==="."||X==="..")throw Error(`profile name "${X}" is not allowed`);if(X.includes("/")||X.includes("\\"))throw Error(`profile name "${X}" must not contain path separators`);if(!n7.test(X))throw Error(`profile name "${X}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var L$="1.0",n7,s6=async(X)=>{var Z,$;let J=await z1();if(J===null)return null;let z=X??await Z9();if(z===null)return null;o6(z);let{fs:Y,path:K}=await import("./node-1.1.40-9cewz2cq.mjs"),N=K.join(J,"configs",`${z}.json`),W;try{W=await Y.promises.readFile(N,"utf-8")}catch(B){if(B?.code!=="ENOENT")throw Error(`failed to read config file ${N}: ${B}`);W=null}if(W===null){let B=y("ANTHROPIC_ORGANIZATION_ID"),C=y("ANTHROPIC_IDENTITY_TOKEN_FILE"),O=y("ANTHROPIC_FEDERATION_RULE_ID");if(O&&B)return{fromFile:!1,config:{organization_id:B,workspace_id:y("ANTHROPIC_WORKSPACE_ID"),base_url:y("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:O,service_account_id:y("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:C?{source:"file",path:C}:void 0,scope:y("ANTHROPIC_SCOPE")}}};return null}let U;try{U=JSON.parse(W)}catch(B){throw Error(`failed to parse config file ${N}: ${B}`)}if(!U.authentication)throw Error(`config file ${N} is missing "authentication"`);let x=U.authentication.type;if(x!=="oidc_federation"&&x!=="user_oauth")throw Error(`authentication.type "${x}" is not a known authentication type`);if(U.organization_id??(U.organization_id=y("ANTHROPIC_ORGANIZATION_ID")),U.workspace_id??(U.workspace_id=y("ANTHROPIC_WORKSPACE_ID")),U.base_url??(U.base_url=y("ANTHROPIC_BASE_URL")),(Z=U.authentication).scope??(Z.scope=y("ANTHROPIC_SCOPE")),U.authentication.type==="oidc_federation"){if(!U.authentication.identity_token){let B=y("ANTHROPIC_IDENTITY_TOKEN_FILE");if(B)U.authentication.identity_token={source:"file",path:B}}if(!U.authentication.federation_rule_id)U.authentication.federation_rule_id=y("ANTHROPIC_FEDERATION_RULE_ID")??"";($=U.authentication).service_account_id??($.service_account_id=y("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:U,fromFile:!0}},e6=async(X,Z)=>{if(X?.authentication.credentials_path)return X.authentication.credentials_path;let $=await z1();if(!$)return null;let J=Z??await Z9();if(!J)return null;o6(J);let{path:z}=await import("./node-1.1.40-9cewz2cq.mjs");return z.join($,"credentials",`${J}.json`)},z1=async()=>{if(!a7())return null;let{path:X}=await import("./node-1.1.40-9cewz2cq.mjs"),Z=y("ANTHROPIC_CONFIG_DIR");if(Z)return Z;if(c0()["X-Stainless-OS"]==="Windows"){let Y=y("APPDATA");if(Y)return X.join(Y,"Anthropic");let K=y("USERPROFILE");if(K)return X.join(K,"AppData","Roaming","Anthropic");return null}let J=y("XDG_CONFIG_HOME");if(J)return X.join(J,"anthropic");let z=y("HOME");if(z)return X.join(z,".config","anthropic");return null},a7=()=>{let X=c0()["X-Stainless-Runtime"];return X==="node"||X==="deno"},Z9=async()=>{let X=await z1();if(!X)return null;let Z=y("ANTHROPIC_PROFILE");if(Z)return Z;let{fs:$,path:J}=await import("./node-1.1.40-9cewz2cq.mjs"),z=J.join(X,"active_config");try{return(await $.promises.readFile(z,"utf-8")).trim()||"default"}catch(Y){if(Y?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Y}`);return"default"}};var Y1=T(()=>{W$();t6();n7=/^[A-Za-z0-9_.-]+$/});function Q1(X){if(!X)throw new F("Identity token file path is empty");return async()=>{let{fs:Z}=await import("./node-1.1.40-9cewz2cq.mjs"),$;try{$=await Z.promises.readFile(X,"utf-8")}catch(z){throw new F(`Failed to read identity token file at ${X}: ${z}`)}let J=$.trim();if(!J)throw new F(`Identity token file at ${X} is empty`);return J}}function $9(X){if(!X)throw new F("Identity token value is empty");return()=>X}var X9=T(()=>{u()});function J9(X){return async()=>{C$(X.baseURL);let Z=await X.identityTokenProvider();if(Z.length>16384)throw new g(`Identity token is ${Math.ceil(Z.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let $={grant_type:g6,assertion:Z,federation_rule_id:X.federationRuleId,organization_id:X.organizationId};if(X.serviceAccountId)$.service_account_id=X.serviceAccountId;if(X.workspaceId)$.workspace_id=X.workspaceId;let J=`${X.baseURL}${O$}`,z;try{z=await X.fetch(J,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${nZ},${_6}`,"User-Agent":X.userAgent||`anthropic-sdk-typescript/${UZ} oidcFederationProvider`},body:JSON.stringify($)})}catch(W){throw new g(`Failed to reach token endpoint ${J}: ${W}`)}let Y=z.headers.get("Request-Id");if(!z.ok){let W=await z.text().catch(()=>""),U=XZ(W),x="";if(z.status===401)x=` Ensure your federation rule matches your identity token. ${X.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 g(`Token exchange failed with status ${z.status}${Y?` (request-id ${Y})`:""}: ${U}${x}`,z.status,U,Y)}let K=await T$(z,Y),N=Number(K.expires_in);if(!Number.isFinite(N))throw new g(`Token endpoint response missing required fields: ${JSON.stringify(XZ(K))}`,z.status,XZ(K),Y);return{token:K.access_token,expiresAt:xZ()+N}}}var z9=T(()=>{K0();l0();u0()});function Y9(X){return async(Z)=>{let{fs:$}=await import("./node-1.1.40-9cewz2cq.mjs");await M$(X.credentialsPath,X.onSafetyWarning);let J;try{J=await $.promises.readFile(X.credentialsPath,"utf-8")}catch(j){throw new g(`Credentials file not found at ${X.credentialsPath}: ${j}`)}let z;try{z=JSON.parse(J)}catch(j){throw new g(`Credentials file at ${X.credentialsPath} is not valid JSON: ${j}`)}let Y=z.access_token;if(!Y)throw new g(`Credentials file at ${X.credentialsPath} must include 'access_token'`);let K=z.expires_at;if(!Z?.forceRefresh&&(K==null||xZ()<K-Q0))return{token:Y,expiresAt:K??null};let N=z.refresh_token;if(!X.clientId||!N)throw new g(`Access token at ${X.credentialsPath} has expired and no refresh is available (client_id ${X.clientId?"set":"empty"}, refresh_token ${N?"set":"empty"})`);C$(X.baseURL);let W={grant_type:v6,refresh_token:N,client_id:X.clientId},U=`${X.baseURL}${O$}`,x;try{x=await X.fetch(U,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":nZ,"User-Agent":X.userAgent||`anthropic-sdk-typescript/${UZ} userOAuthProvider`},body:JSON.stringify(W)})}catch(j){throw new g(`User OAuth refresh failed to reach token endpoint: ${j}`)}let B=x.headers.get("Request-Id");if(!x.ok){let j=await x.text().catch(()=>"");throw new g(`User OAuth refresh failed (HTTP ${x.status}): ${XZ(j)}`,x.status,XZ(j),B)}let C=await T$(x,B),O=Number(C.expires_in);if(!Number.isFinite(O))throw new g(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(XZ(C))}`,x.status,XZ(C),B);let H=xZ()+O,P=C.refresh_token||N;return await x$(X.credentialsPath,{...z,version:L$,type:"oauth_token",access_token:C.access_token,expires_at:H,refresh_token:P}),{token:C.access_token,expiresAt:H}}}var Q9=T(()=>{Y1();K0();l0();u0()});function K1(X,Z){let $=X.authentication.credentials_path??null,J=(X.base_url||Z.baseURL).replace(/\/+$/,""),z=r7(X,$,J,Z),Y={};if(X.workspace_id&&X.authentication.type==="user_oauth")Y["anthropic-workspace-id"]=X.workspace_id;return{provider:z,extraHeaders:Y,baseURL:X.base_url||void 0}}async function K9(X,Z){let $=await s6(Z);if(!$)return null;let{config:J,fromFile:z}=$,Y=J.authentication.credentials_path||!z?J:{...J,authentication:{...J.authentication,credentials_path:await e6(J,Z)??void 0}};return K1(Y,X)}function r7(X,Z,$,J){switch(X.authentication.type){case"oidc_federation":{let z=X.authentication,Y=t7(z);if(!Y)throw new g("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new g("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(!X.organization_id)throw new g("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let K=J9({identityTokenProvider:Y,federationRuleId:z.federation_rule_id,organizationId:X.organization_id,serviceAccountId:z.service_account_id,workspaceId:X.workspace_id,baseURL:$,fetch:J.fetch,userAgent:J.userAgent});if(Z)return o7(K,Z,J.onCacheWriteError,J.onSafetyWarning);return K}case"user_oauth":{if(!Z)throw new g("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return Y9({credentialsPath:Z,clientId:X.authentication.client_id,baseURL:$,fetch:J.fetch,userAgent:J.userAgent,onSafetyWarning:J.onSafetyWarning})}default:{let z=X.authentication.type;throw new g(`authentication.type "${z}" is not a known authentication type`)}}}function t7(X){if(X.identity_token){let J=X.identity_token.source;if(J!=="file")throw new g(`identity_token.source "${J}" is not supported by this SDK version (only "file")`);if(!X.identity_token.path)throw new g('identity_token.source "file" requires a non-empty path');return Q1(X.identity_token.path)}let Z=y("ANTHROPIC_IDENTITY_TOKEN_FILE");if(Z)return Q1(Z);let $=y("ANTHROPIC_IDENTITY_TOKEN");if($)return $9($);return null}function o7(X,Z,$,J){return async(z)=>{let{fs:Y}=await import("./node-1.1.40-9cewz2cq.mjs");await M$(Z,J);let K;try{let W=await Y.promises.readFile(Z,"utf-8");K=JSON.parse(W);let U=K?.access_token;if(U&&!z?.forceRefresh){let x=K?.expires_at;if(x==null||xZ()<x-Q0)return{token:U,expiresAt:x??null}}}catch(W){if(W?.code!=="ENOENT"&&!(W instanceof SyntaxError))$?.(W)}let N=await X(z);try{await x$(Z,{...K??{},version:L$,type:"oauth_token",access_token:N.token,expires_at:N.expiresAt})}catch(W){$?.(W)}return N}}var V9=T(()=>{V0();Y1();K0();l0();X9();z9();Q9()});function s7(X,Z){for(let z=Z??0;z<X.length;z++){if(X[z]===10)return{preceding:z,index:z+1,carriage:!1};if(X[z]===13)return{preceding:z,index:z+1,carriage:!0}}return null}function N9(X){for(let J=0;J<X.length-1;J++){if(X[J]===10&&X[J+1]===10)return J+2;if(X[J]===13&&X[J+1]===13)return J+2;if(X[J]===13&&X[J+1]===10&&J+3<X.length&&X[J+2]===13&&X[J+3]===10)return J+4}return-1}var QZ,KZ,a0;var V1=T(()=>{YZ();H$();a0=(()=>{class X{constructor(){QZ.set(this,void 0),KZ.set(this,void 0),q(this,QZ,new Uint8Array,"f"),q(this,KZ,null,"f")}decode(Z){if(Z==null)return[];let $=Z instanceof ArrayBuffer?new Uint8Array(Z):typeof Z==="string"?p0(Z):Z;q(this,QZ,p6([Q(this,QZ,"f"),$]),"f");let J=[],z;while((z=s7(Q(this,QZ,"f"),Q(this,KZ,"f")))!=null){if(z.carriage&&Q(this,KZ,"f")==null){q(this,KZ,z.index,"f");continue}if(Q(this,KZ,"f")!=null&&(z.index!==Q(this,KZ,"f")+1||z.carriage)){J.push(i0(Q(this,QZ,"f").subarray(0,Q(this,KZ,"f")-1))),q(this,QZ,Q(this,QZ,"f").subarray(Q(this,KZ,"f")),"f"),q(this,KZ,null,"f");continue}let Y=Q(this,KZ,"f")!==null?z.preceding-1:z.preceding,K=i0(Q(this,QZ,"f").subarray(0,Y));J.push(K),q(this,QZ,Q(this,QZ,"f").subarray(z.index),"f"),q(this,KZ,null,"f")}return J}flush(){if(!Q(this,QZ,"f").length)return[];return this.decode(`
|
|
2
|
+
`)}}return QZ=new WeakMap,KZ=new WeakMap,X.NEWLINE_CHARS=new Set([`
|
|
3
|
+
`,"\r"]),X.NEWLINE_REGEXP=/\r\n|[\n\r]/g,X})()});async function*W9(X,Z){if(!X.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new F("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 F("Attempted to iterate over a response with no body")}let $=new G9,J=new a0,z=d0(X.body);for await(let Y of e7(z))for(let K of J.decode(Y)){let N=$.decode(K);if(N)yield N}for(let Y of J.flush()){let K=$.decode(Y);if(K)yield K}}async function*e7(X){let Z=new Uint8Array;for await(let $ of X){if($==null)continue;let J=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?p0($):$,z=new Uint8Array(Z.length+J.length);z.set(Z),z.set(J,Z.length),Z=z;let Y;while((Y=N9(Z))!==-1)yield Z.subarray(0,Y),Z=Z.subarray(Y)}if(Z.length>0)yield Z}class G9{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(X){if(X.endsWith("\r"))X=X.substring(0,X.length-1);if(!X){if(!this.event&&!this.data.length)return null;let z={event:this.event,data:this.data.join(`
|
|
4
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],z}if(this.chunks.push(X),X.startsWith(":"))return null;let[Z,$,J]=Z5(X,":");if(J.startsWith(" "))J=J.substring(1);if(Z==="event")this.event=J;else if(Z==="data")this.data.push(J);return null}}function Z5(X,Z){let $=X.indexOf(Z);if($!==-1)return[X.substring(0,$),Z,X.substring($+Z.length)];return[X,"",""]}var r0,jZ;var j$=T(()=>{YZ();u();Y0();V1();Y0();iZ();$Z();H$();LZ();u();U$();jZ=(()=>{class X{constructor(Z,$,J){this.iterator=Z,r0.set(this,void 0),this.controller=$,q(this,r0,J,"f")}static rawEvents(Z,$=new AbortController){return W9(Z,$)}static fromSSEResponse(Z,$,J){let z=!1,Y=J?h(J):console;async function*K(){if(z)throw new F("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let N=!1;try{for await(let W of W9(Z,$)){if(W.event==="completion")try{yield JSON.parse(W.data)}catch(U){throw Y.error("Could not parse message into JSON:",W.data),Y.error("From chunk:",W.raw),U}if(W.event==="message_start"||W.event==="message_delta"||W.event==="message_stop"||W.event==="content_block_start"||W.event==="content_block_delta"||W.event==="content_block_stop"||W.event==="message"||W.event==="user.message"||W.event==="user.interrupt"||W.event==="user.tool_confirmation"||W.event==="user.custom_tool_result"||W.event==="user.tool_result"||W.event==="agent.message"||W.event==="agent.thinking"||W.event==="agent.tool_use"||W.event==="agent.tool_result"||W.event==="agent.mcp_tool_use"||W.event==="agent.mcp_tool_result"||W.event==="agent.custom_tool_use"||W.event==="agent.thread_context_compacted"||W.event==="session.status_running"||W.event==="session.status_idle"||W.event==="session.status_rescheduled"||W.event==="session.status_terminated"||W.event==="session.error"||W.event==="session.deleted"||W.event==="session.updated"||W.event==="span.model_request_start"||W.event==="span.model_request_end"||W.event==="span.outcome_evaluation_start"||W.event==="span.outcome_evaluation_ongoing"||W.event==="span.outcome_evaluation_end"||W.event==="user.define_outcome"||W.event==="agent.thread_message_received"||W.event==="agent.thread_message_sent"||W.event==="agent.session_thread_message_received"||W.event==="agent.session_thread_message_sent"||W.event==="session.thread_created"||W.event==="session.thread_status_created"||W.event==="session.thread_status_running"||W.event==="session.thread_status_idle"||W.event==="session.thread_status_rescheduled"||W.event==="session.thread_status_terminated"||W.event==="event_start"||W.event==="event_delta"||W.event==="system.message")try{yield JSON.parse(W.data)}catch(U){throw Y.error("Could not parse message into JSON:",W.data),Y.error("From chunk:",W.raw),U}if(W.event==="ping")continue;if(W.event==="error"){let U=N$(W.data)??W.data,x=U?.error?.type;throw new _(void 0,U,void 0,Z.headers,x)}}N=!0}catch(W){if(TZ(W))return;throw W}finally{if(!N)$.abort();FZ($)}}return new X(K,$,J)}static fromReadableStream(Z,$,J){let z=!1;async function*Y(){let N=new a0,W=d0(Z);for await(let U of W)for(let x of N.decode(U))yield x;for(let U of N.flush())yield U}async function*K(){if(z)throw new F("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let N=!1;try{for await(let W of Y()){if(N)continue;if(W)yield JSON.parse(W)}N=!0}catch(W){if(TZ(W))return;throw W}finally{if(!N)$.abort();FZ($)}}return new X(K,$,J)}[(r0=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let Z=[],$=[],J=this.iterator(),z=(Y)=>{return{next:()=>{if(Y.length===0){let K=J.next();Z.push(K),$.push(K)}return Y.shift()}}};return[new X(()=>z(Z),this.controller,Q(this,r0,"f")),new X(()=>z($),this.controller,Q(this,r0,"f"))]}toReadableStream(){let Z=this,$;return dX({async start(){$=Z[Symbol.asyncIterator]()},async pull(J){try{let{value:z,done:Y}=await $.next();if(Y)return J.close();let K=p0(JSON.stringify(z)+`
|
|
5
|
+
`);J.enqueue(K)}catch(z){J.error(z)}},async cancel(){await $.return?.()}})}}return X})()});async function R$(X,Z){let{response:$,requestLogID:J,retryOfRequestLogID:z,startTime:Y}=Z,K=await(async()=>{if(Z.options.stream)return h(X).debug("response",$.status,$.url,$.headers,$.body),jZ.fromSSEResponse($,Z.controller,X);if($.status===204)return null;if(Z.options.__binaryResponse)return $;let W=$.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if($.headers.get("content-length")==="0")return;let C=await $.json();return t0(C,$)}return await $.text()})().finally(()=>{if(!Z.options.stream&&!Z.options.__binaryResponse)FZ(Z.controller)});return EZ(h(X),`[${J}] response parsed`,{retryOfRequestLogID:z,url:$.url,status:$.status,body:K,durationMs:Date.now()-Y}),K}function t0(X,Z){if(!X||typeof X!=="object"||Array.isArray(X))return X;return Object.defineProperties(X,{_request_id:{value:Z.headers.get("request-id"),enumerable:!1},_workspace_id:{value:Z.headers.get("anthropic-workspace-id"),enumerable:!1}})}var D$=T(()=>{j$();LZ();U$()});function N1(X){return typeof X==="object"&&X!==null&&q9.has(X)}function B9(X){let Z=new Set;while(typeof X==="object"&&X!==null&&!Z.has(X)){if(Z.add(X),N1(X)||TZ(X)||X instanceof IZ||X instanceof Q$)return!0;X=X.cause}return!1}function W1(X,Z,$,J){return async(z,Y={})=>{if(Z.length===0)return X.call(void 0,z,Y);let K=Y.headers instanceof Headers?Y.headers:new Headers(Y.headers),N=await X5(X,Z,$,J)({...Y,headers:K,url:typeof z==="string"?z:z instanceof URL?z.href:z.url});if(N.bodyUsed||N.body?.locked)throw new F("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return N}}function $5(X,Z){let $=new WeakMap;return{options:X,logger:Z?h(Z):r6(),parse(J){if(X?.stream&&J.ok)return U9(J,X,Z);let z=$.get(J);if(!z)z=U9(J,X,Z),$.set(J,z);return z}}}async function U9(X,Z,$){if(X.bodyUsed||X.body?.locked)throw new F("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(Z?.stream&&X.ok)return jZ.fromSSEResponse(X.clone(),new AbortController,$);if(X.status===204)return null;if(Z?.__binaryResponse)return X;let z=X.headers.get("content-type")?.split(";")[0]?.trim();if(z?.includes("application/json")||z?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;return t0(await X.clone().json(),X)}return await X.clone().text()}function X5(X,Z,$,J){let z=async({url:K,...N})=>{try{return await X.call(void 0,K,N)}catch(W){let U=pZ(W);throw q9.add(U),U}},Y=$5($,J);for(let K=Z.length-1;K>=0;K--){let N=Z[K],W=z;z=async(U)=>N(U,W,Y)}return z}var q9;var O9=T(()=>{iZ();D$();LZ();u();j$();q9=new WeakSet});var o0,w$;var G1=T(()=>{YZ();D$();w$=(()=>{class X extends Promise{constructor(Z,$,J=R$){super((z)=>{z(null)});this.responsePromise=$,this.parseResponse=J,o0.set(this,void 0),q(this,o0,Z,"f")}_thenUnwrap(Z){return new X(Q(this,o0,"f"),this.responsePromise,async($,J)=>t0(Z(await this.parseResponse($,J),J),J.response))}asResponse(){return this.responsePromise.then((Z)=>Z.response)}async withResponse(){let[Z,$]=await Promise.all([this.parse(),this.asResponse()]);return{data:Z,response:$,request_id:$.headers.get("request-id"),workspace_id:$.headers.get("anthropic-workspace-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((Z)=>this.parseResponse(Q(this,o0,"f"),Z));return this.parsedPromise}then(Z,$){return this.parse().then(Z,$)}catch(Z){return this.parse().catch(Z)}finally(Z){return this.parse().finally(Z)}}return o0=new WeakMap,X})()});var P$,U1,C9,r,S,q1;var w=T(()=>{YZ();u();D$();G1();$Z();U1=(()=>{class X{constructor(Z,$,J,z){P$.set(this,void 0),q(this,P$,Z,"f"),this.options=z,this.response=$,this.body=J}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let Z=this.nextPageRequestOptions();if(!Z)throw new F("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Q(this,P$,"f").requestAPIList(this.constructor,Z)}async*iterPages(){let Z=this;yield Z;while(Z.hasNextPage())Z=await Z.getNextPage(),yield Z}async*[(P$=new WeakMap,Symbol.asyncIterator)](){for await(let Z of this.iterPages())for(let $ of Z.getPaginatedItems())yield $}}return X})(),C9=(()=>{class X extends w${constructor(Z,$,J){super(Z,$,async(z,Y)=>new J(z,Y.response,await R$(z,Y),Y.options))}async*[Symbol.asyncIterator](){let Z=await this;for await(let $ of Z)yield $}}return X})();r=class r extends U1{constructor(X,Z,$,J){super(X,Z,$,J);this.data=$.data||[],this.has_more=$.has_more||!1,this.first_id=$.first_id||null,this.last_id=$.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 Z=this.first_id;if(!Z)return null;return{...this.options,query:{...m0(this.options.query),before_id:Z}}}let X=this.last_id;if(!X)return null;return{...this.options,query:{...m0(this.options.query),after_id:X}}}};S=class S extends U1{constructor(X,Z,$,J){super(X,Z,$,J);this.data=$.data||[],this.next_page=$.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let X=this.next_page;if(!X)return null;return{...this.options,query:{...m0(this.options.query),page:X}}}};q1=class q1 extends U1{constructor(X,Z,$,J){super(X,Z,$,J);this.data=$.data||[],this.next_page=$.next_page||null,this.prev_page=$.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let X=this.next_page;if(!X)return null;return{...this.options,query:{...m0(this.options.query),page:X}}}}});function aZ(X,Z,$){return O1(),new File(X,Z??"unknown_file",$)}function s0(X,Z){let $=typeof X==="object"&&X!==null&&(("name"in X)&&X.name&&String(X.name)||("url"in X)&&X.url&&String(X.url)||("filename"in X)&&X.filename&&String(X.filename)||("path"in X)&&X.path&&String(X.path))||"";return Z?$.split(/[\\/]/).pop()||void 0:$}function z5(X){let Z=typeof X==="function"?X:X.fetch,$=T9.get(Z);if($)return $;let J=(async()=>{try{let z="Response"in Z?Z.Response:(await Z("data:,")).constructor,Y=new FormData;if(Y.toString()===await new z(Y).text())return!1;return!0}catch{return!0}})();return T9.set(Z,J),J}var O1=()=>{if(typeof File>"u"){let{process:X}=globalThis,Z=typeof X?.versions?.node==="string"&&parseInt(X.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(Z?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},C1=(X)=>X!=null&&typeof X==="object"&&typeof X[Symbol.asyncIterator]==="function",qZ=async(X,Z,$=!0)=>{return{...X,body:await Y5(X.body,Z,$)}},T9,Y5=async(X,Z,$=!0)=>{if(!await z5(Z))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let J=new FormData;return await Promise.all(Object.entries(X||{}).map(([z,Y])=>B1(J,z,Y,$))),J},B1=async(X,Z,$,J)=>{if($===void 0)return;if($==null)throw TypeError(`Received null for "${Z}"; to pass null in FormData, you must use the string 'null'`);if(typeof $==="string"||typeof $==="number"||typeof $==="boolean")X.append(Z,String($));else if($ instanceof Response){let z={},Y=$.headers.get("Content-Type");if(Y)z={type:Y};X.append(Z,aZ([await $.blob()],s0($,J),z))}else if(C1($))X.append(Z,aZ([await new Response(q$($)).blob()],s0($,J)));else if($ instanceof Blob)X.append(Z,aZ([$],s0($,J)||void 0,{type:$.type}));else if(Array.isArray($))await Promise.all($.map((z)=>B1(X,Z+"[]",z,J)));else if(typeof $.then==="function")throw TypeError(`Received a Promise for "${Z}"; await it first, e.g. \`await toFile(...)\``);else if($ instanceof ArrayBuffer||ArrayBuffer.isView($))throw TypeError(`Received ${$.constructor.name} for "${Z}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);else if(typeof $==="object")await Promise.all(Object.entries($).map(([z,Y])=>B1(X,`${Z}[${z}]`,Y,J)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${$} instead`)};var fZ=T(()=>{Y0();T9=new WeakMap});async function M1(X,Z,$){if(O1(),X=await X,Z||(Z=s0(X,!0)),Q5(X)){if(X instanceof File&&Z==null&&$==null)return X;return aZ([await X.arrayBuffer()],Z??X.name,{type:X.type,lastModified:X.lastModified,...$})}if(K5(X)){let z=await X.blob();return Z||(Z=new URL(X.url).pathname.split(/[\\/]/).pop()),aZ(await T1(z),Z,$)}let J=await T1(X);if(!$?.type){let z=J.find((Y)=>typeof Y==="object"&&("type"in Y)&&Y.type);if(typeof z==="string")$={...$,type:z}}return aZ(J,Z,$)}async function T1(X){let Z=[];if(typeof X==="string"||ArrayBuffer.isView(X)||X instanceof ArrayBuffer)Z.push(X);else if(M9(X))Z.push(X instanceof Blob?X:await X.arrayBuffer());else if(C1(X))for await(let $ of X)Z.push(...await T1($));else{let $=X?.constructor?.name;throw Error(`Unexpected data type: ${typeof X}${$?`; constructor: ${$}`:""}${V5(X)}`)}return Z}function V5(X){if(typeof X!=="object"||X===null)return"";return`; props: [${Object.getOwnPropertyNames(X).map(($)=>`"${$}"`).join(", ")}]`}var M9=(X)=>X!=null&&typeof X==="object"&&typeof X.size==="number"&&typeof X.type==="string"&&typeof X.text==="function"&&typeof X.slice==="function"&&typeof X.arrayBuffer==="function",Q5=(X)=>X!=null&&typeof X==="object"&&typeof X.name==="string"&&typeof X.lastModified==="number"&&M9(X),K5=(X)=>X!=null&&typeof X==="object"&&typeof X.url==="string"&&typeof X.blob==="function";var x9=T(()=>{fZ();fZ()});var H9=T(()=>{x9()});var F9=()=>{};class M{constructor(X){this._client=X}}var L=()=>{};function*W5(X){if(!X)return;if(A9 in X){let{values:J,nulls:z}=X;yield*J.entries();for(let Y of z)yield[Y,null];return}let Z=!1,$;if(X instanceof Headers)$=X.entries();else if(mX(X))$=X;else Z=!0,$=Object.entries(X??{});for(let J of $){let z=J[0];if(typeof z!=="string")throw TypeError("expected header name to be a string");let Y=mX(J[1])?J[1]:[J[1]],K=!1;for(let N of Y){if(N===void 0)continue;if(Z&&!K)K=!0,yield[z,I$];yield[z,N]}}}var A9,I$,G5,U5=(X,Z)=>{let $=X?X.split(",").map((J)=>J.trim()).filter(Boolean):[];for(let J of Z.split(",").map((z)=>z.trim()))if(J&&!$.includes(J))$.push(J);return $.join(", ")},V=(X)=>{let Z=new Headers,$=new Set;for(let J of X){let z=new Set;for(let[Y,K]of W5(J)){let N=Y.toLowerCase();if(G5.has(N)){if(K===I$)continue;if(K===null)Z.delete(Y),$.add(N);else Z.set(Y,U5(Z.get(Y),K)),$.delete(N);continue}if(K===I$||!z.has(N)){if(Z.delete(Y),z.add(N),K===I$)continue}if(K===null)Z.delete(Y),$.add(N);else Z.append(Y,K),$.delete(N)}}return{[A9]:!0,values:Z,nulls:$}};var D=T(()=>{$Z();A9=Symbol.for("brand.privateNullableHeaders");I$=Symbol("clear"),G5=new Set(["x-stainless-helper"])});function E9(X){return X.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var S9,q5=(X=E9)=>function($,...J){if($.length===1)return $[0];let z=!1,Y=[],K=$.reduce((x,B,C)=>{if(/[?#]/.test(B))z=!0;let O=J[C],H=(z?encodeURIComponent:X)(""+O);if(C!==J.length&&(O==null||typeof O==="object"&&O.toString===Object.getPrototypeOf(Object.getPrototypeOf(O.hasOwnProperty??S9)??S9)?.toString))H=O+"",Y.push({start:x.length+B.length,length:H.length,error:`Value of type ${Object.prototype.toString.call(O).slice(8,-1)} is not a valid path parameter`});return x+B+(C===J.length?"":H)},""),N=K.split(/[?#]/,1)[0],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,U;while((U=W.exec(N))!==null)Y.push({start:U.index,length:U[0].length,error:`Value "${U[0]}" can't be safely passed as a path parameter`});if(Y.sort((x,B)=>x.start-B.start),Y.length>0){let x=0,B=Y.reduce((C,O)=>{let H=" ".repeat(O.start-x),P="^".repeat(O.length);return x=O.start+O.length,C+H+P},"");throw new F(`Path parameters result in path with invalid segments:
|
|
6
|
+
${Y.map((C)=>C.error).join(`
|
|
7
|
+
`)}
|
|
8
|
+
${K}
|
|
9
|
+
${B}`)}return K},G;var f=T(()=>{u();S9=Object.freeze(Object.create(null)),G=q5(E9)});var e0;var x1=T(()=>{L();w();D();f();e0=class e0 extends M{retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/deployment_runs/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",S,{query:z,...Z,headers:V([{"anthropic-beta":[...$??[],"managed-agents-2026-04-01"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}}});var Z8;var H1=T(()=>{L();w();D();f();Z8=class Z8 extends M{create(X,Z){let{betas:$,workspace_id:J,...z}=X;return this._client.post("/v1/deployments?beta=true",{body:z,...Z,headers:V([{"anthropic-beta":[...$??[],"managed-agents-2026-04-01"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/deployments/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}update(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/deployments/${X}?beta=true`,{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/deployments?beta=true",S,{query:z,...Z,headers:V([{"anthropic-beta":[...$??[],"managed-agents-2026-04-01"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}archive(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/deployments/${X}/archive?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}pause(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/deployments/${X}/pause?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}run(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/deployments/${X}/run?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}unpause(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/deployments/${X}/unpause?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});var $8;var F1=T(()=>{L();w();D();f();$8=class $8 extends M{create(X,Z){let{betas:$,workspace_id:J,...z}=X;return this._client.post("/v1/dreams?beta=true",{body:z,...Z,headers:V([{"anthropic-beta":[...$??[],"dreaming-2026-04-21"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/dreams/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"dreaming-2026-04-21"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/dreams?beta=true",S,{query:z,...Z,headers:V([{"anthropic-beta":[...$??[],"dreaming-2026-04-21"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}archive(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/dreams/${X}/archive?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"dreaming-2026-04-21"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}cancel(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/dreams/${X}/cancel?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"dreaming-2026-04-21"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});function J8(X){return{["x-stainless-helper"]:X}}function X8(X){return typeof X==="object"&&X!==null&&W0 in X}function A1(X,Z){let $=new Set;if(X){for(let J of X)if(X8(J))$.add(J[W0])}if(Z)for(let J of Z){if(X8(J))$.add(J[W0]);let z=J.content;if(Array.isArray(z))for(let Y of z){if(X8(Y))$.add(Y[W0]);let K=Y?.tool?.definition;if(X8(K))$.add(K[W0])}}return Array.from($)}function k$(X,Z){let $=A1(X,Z);if($.length===0)return{};return{["x-stainless-helper"]:$.join(", ")}}function h$(X){if(X8(X))return{["x-stainless-helper"]:X[W0]};return{}}var f$="x-stainless-helper",y$="x-stainless-helper-method",W0;var RZ=T(()=>{W0=Symbol("anthropic.sdk.stainlessHelper")});var z8;var S1=T(()=>{L();w();D();RZ();fZ();f();z8=class z8 extends M{list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/files?beta=true",S,{query:z,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}delete(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.delete(G`/v1/files/${X}?beta=true`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}download(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/files/${X}/content?beta=true`,{...$,headers:V([{Accept:"application/binary",...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers]),__binaryResponse:!0})}retrieveMetadata(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/files/${X}?beta=true`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}upload(X,Z){let{betas:$,workspace_id:J,...z}=X;return this._client.post("/v1/files?beta=true",qZ({body:z,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},h$(z.file),Z?.headers])},this._client))}}});var Y8;var E1=T(()=>{L();w();D();f();Y8=class Y8 extends M{retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/models/${X}?beta=true`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/models?beta=true",r,{query:z,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}}});var Q8;var L1=T(()=>{L();w();D();f();Q8=class Q8 extends M{create(X,Z){let{betas:$,workspace_id:J,...z}=X;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:V([{"anthropic-beta":[...$??[],"user-profiles-2026-08-18"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/user_profiles/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"user-profiles-2026-08-18"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}update(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/user_profiles/${X}?beta=true`,{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"user-profiles-2026-08-18"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/user_profiles?beta=true",S,{query:z,...Z,headers:V([{"anthropic-beta":[...$??[],"user-profiles-2026-08-18"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}createEnrollmentURL(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/user_profiles/${X}/enrollment_url?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"user-profiles-2026-08-18"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});var D9=b$((j9)=>{Object.defineProperty(j9,"__esModule",{value:!0});j9.timingSafeEqual=void 0;function L9(X,Z=""){if(!X)throw Error(Z)}function H5(X,Z){if(X.byteLength!==Z.byteLength)return!1;if(!(X instanceof DataView))X=new DataView(ArrayBuffer.isView(X)?X.buffer:X);if(!(Z instanceof DataView))Z=new DataView(ArrayBuffer.isView(Z)?Z.buffer:Z);L9(X instanceof DataView),L9(Z instanceof DataView);let $=X.byteLength,J=0,z=-1;while(++z<$)J|=X.getUint8(z)^Z.getUint8(z);return J===0}j9.timingSafeEqual=H5});var I9=b$((VZ)=>{var F5=VZ&&VZ.__extends||function(){var X=function(Z,$){return X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,z){J.__proto__=z}||function(J,z){for(var Y in z)if(z.hasOwnProperty(Y))J[Y]=z[Y]},X(Z,$)};return function(Z,$){X(Z,$);function J(){this.constructor=Z}Z.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(VZ,"__esModule",{value:!0});var i=256,j1=function(){function X(Z){if(Z===void 0)Z="=";this._paddingCharacter=Z}return X.prototype.encodedLength=function(Z){if(!this._paddingCharacter)return(Z*8+5)/6|0;return(Z+2)/3*4|0},X.prototype.encode=function(Z){var $="",J=0;for(;J<Z.length-2;J+=3){var z=Z[J]<<16|Z[J+1]<<8|Z[J+2];$+=this._encodeByte(z>>>18&63),$+=this._encodeByte(z>>>12&63),$+=this._encodeByte(z>>>6&63),$+=this._encodeByte(z>>>0&63)}var Y=Z.length-J;if(Y>0){var z=Z[J]<<16|(Y===2?Z[J+1]<<8:0);if($+=this._encodeByte(z>>>18&63),$+=this._encodeByte(z>>>12&63),Y===2)$+=this._encodeByte(z>>>6&63);else $+=this._paddingCharacter||"";$+=this._paddingCharacter||""}return $},X.prototype.maxDecodedLength=function(Z){if(!this._paddingCharacter)return(Z*6+7)/8|0;return Z/4*3|0},X.prototype.decodedLength=function(Z){return this.maxDecodedLength(Z.length-this._getPaddingLength(Z))},X.prototype.decode=function(Z){if(Z.length===0)return new Uint8Array(0);var $=this._getPaddingLength(Z),J=Z.length-$,z=new Uint8Array(this.maxDecodedLength(J)),Y=0,K=0,N=0,W=0,U=0,x=0,B=0;for(;K<J-4;K+=4)W=this._decodeChar(Z.charCodeAt(K+0)),U=this._decodeChar(Z.charCodeAt(K+1)),x=this._decodeChar(Z.charCodeAt(K+2)),B=this._decodeChar(Z.charCodeAt(K+3)),z[Y++]=W<<2|U>>>4,z[Y++]=U<<4|x>>>2,z[Y++]=x<<6|B,N|=W&i,N|=U&i,N|=x&i,N|=B&i;if(K<J-1)W=this._decodeChar(Z.charCodeAt(K)),U=this._decodeChar(Z.charCodeAt(K+1)),z[Y++]=W<<2|U>>>4,N|=W&i,N|=U&i;if(K<J-2)x=this._decodeChar(Z.charCodeAt(K+2)),z[Y++]=U<<4|x>>>2,N|=x&i;if(K<J-3)B=this._decodeChar(Z.charCodeAt(K+3)),z[Y++]=x<<6|B,N|=B&i;if(N!==0)throw Error("Base64Coder: incorrect characters for decoding");return z},X.prototype._encodeByte=function(Z){var $=Z;return $+=65,$+=25-Z>>>8&6,$+=51-Z>>>8&-75,$+=61-Z>>>8&-15,$+=62-Z>>>8&3,String.fromCharCode($)},X.prototype._decodeChar=function(Z){var $=i;return $+=(42-Z&Z-44)>>>8&-i+Z-43+62,$+=(46-Z&Z-48)>>>8&-i+Z-47+63,$+=(47-Z&Z-58)>>>8&-i+Z-48+52,$+=(64-Z&Z-91)>>>8&-i+Z-65+0,$+=(96-Z&Z-123)>>>8&-i+Z-97+26,$},X.prototype._getPaddingLength=function(Z){var $=0;if(this._paddingCharacter){for(var J=Z.length-1;J>=0;J--){if(Z[J]!==this._paddingCharacter)break;$++}if(Z.length<4||$>2)throw Error("Base64Coder: incorrect padding")}return $},X}();VZ.Coder=j1;var K8=new j1;function A5(X){return K8.encode(X)}VZ.encode=A5;function S5(X){return K8.decode(X)}VZ.decode=S5;var w9=function(X){F5(Z,X);function Z(){return X!==null&&X.apply(this,arguments)||this}return Z.prototype._encodeByte=function($){var J=$;return J+=65,J+=25-$>>>8&6,J+=51-$>>>8&-75,J+=61-$>>>8&-13,J+=62-$>>>8&49,String.fromCharCode(J)},Z.prototype._decodeChar=function($){var J=i;return J+=(44-$&$-46)>>>8&-i+$-45+62,J+=(94-$&$-96)>>>8&-i+$-95+63,J+=(47-$&$-58)>>>8&-i+$-48+52,J+=(64-$&$-91)>>>8&-i+$-65+0,J+=(96-$&$-123)>>>8&-i+$-97+26,J},Z}(j1);VZ.URLSafeCoder=w9;var P9=new w9;function E5(X){return P9.encode(X)}VZ.encodeURLSafe=E5;function L5(X){return P9.decode(X)}VZ.decodeURLSafe=L5;VZ.encodedLength=function(X){return K8.encodedLength(X)};VZ.maxDecodedLength=function(X){return K8.maxDecodedLength(X)};VZ.decodedLength=function(X){return K8.decodedLength(X)}});var y9=b$((f9,g$)=>{(function(X,Z){var $={};Z($);var J=$.default;for(var z in $)J[z]=$[z];if(typeof g$==="object"&&typeof g$.exports==="object")g$.exports=J;else if(typeof define==="function"&&define.amd)define(function(){return J});else X.sha256=J})(f9,function(X){X.__esModule=!0,X.digestLength=32,X.blockSize=64;var Z=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 $(B,C,O,H,P){var j,R,A,k,E,I,t,b,p,m,d,GZ,lZ;while(P>=64){j=C[0],R=C[1],A=C[2],k=C[3],E=C[4],I=C[5],t=C[6],b=C[7];for(m=0;m<16;m++)d=H+m*4,B[m]=(O[d]&255)<<24|(O[d+1]&255)<<16|(O[d+2]&255)<<8|O[d+3]&255;for(m=16;m<64;m++)p=B[m-2],GZ=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,p=B[m-15],lZ=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,B[m]=(GZ+B[m-7]|0)+(lZ+B[m-16]|0);for(m=0;m<64;m++)GZ=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&I^~E&t)|0)+(b+(Z[m]+B[m]|0)|0)|0,lZ=((j>>>2|j<<30)^(j>>>13|j<<19)^(j>>>22|j<<10))+(j&R^j&A^R&A)|0,b=t,t=I,I=E,E=k+GZ|0,k=A,A=R,R=j,j=GZ+lZ|0;C[0]+=j,C[1]+=R,C[2]+=A,C[3]+=k,C[4]+=E,C[5]+=I,C[6]+=t,C[7]+=b,H+=64,P-=64}return H}var J=function(){function B(){this.digestLength=X.digestLength,this.blockSize=X.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 B.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},B.prototype.clean=function(){for(var C=0;C<this.buffer.length;C++)this.buffer[C]=0;for(var C=0;C<this.temp.length;C++)this.temp[C]=0;this.reset()},B.prototype.update=function(C,O){if(O===void 0)O=C.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var H=0;if(this.bytesHashed+=O,this.bufferLength>0){while(this.bufferLength<64&&O>0)this.buffer[this.bufferLength++]=C[H++],O--;if(this.bufferLength===64)$(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(O>=64)H=$(this.temp,this.state,C,H,O),O%=64;while(O>0)this.buffer[this.bufferLength++]=C[H++],O--;return this},B.prototype.finish=function(C){if(!this.finished){var O=this.bytesHashed,H=this.bufferLength,P=O/536870912|0,j=O<<3,R=O%64<56?64:128;this.buffer[H]=128;for(var A=H+1;A<R-8;A++)this.buffer[A]=0;this.buffer[R-8]=P>>>24&255,this.buffer[R-7]=P>>>16&255,this.buffer[R-6]=P>>>8&255,this.buffer[R-5]=P>>>0&255,this.buffer[R-4]=j>>>24&255,this.buffer[R-3]=j>>>16&255,this.buffer[R-2]=j>>>8&255,this.buffer[R-1]=j>>>0&255,$(this.temp,this.state,this.buffer,0,R),this.finished=!0}for(var A=0;A<8;A++)C[A*4+0]=this.state[A]>>>24&255,C[A*4+1]=this.state[A]>>>16&255,C[A*4+2]=this.state[A]>>>8&255,C[A*4+3]=this.state[A]>>>0&255;return this},B.prototype.digest=function(){var C=new Uint8Array(this.digestLength);return this.finish(C),C},B.prototype._saveState=function(C){for(var O=0;O<this.state.length;O++)C[O]=this.state[O]},B.prototype._restoreState=function(C,O){for(var H=0;H<this.state.length;H++)this.state[H]=C[H];this.bytesHashed=O,this.finished=!1,this.bufferLength=0},B}();X.Hash=J;var z=function(){function B(C){this.inner=new J,this.outer=new J,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var O=new Uint8Array(this.blockSize);if(C.length>this.blockSize)new J().update(C).finish(O).clean();else for(var H=0;H<C.length;H++)O[H]=C[H];for(var H=0;H<O.length;H++)O[H]^=54;this.inner.update(O);for(var H=0;H<O.length;H++)O[H]^=106;this.outer.update(O),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var H=0;H<O.length;H++)O[H]=0}return B.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},B.prototype.clean=function(){for(var C=0;C<this.istate.length;C++)this.ostate[C]=this.istate[C]=0;this.inner.clean(),this.outer.clean()},B.prototype.update=function(C){return this.inner.update(C),this},B.prototype.finish=function(C){if(this.outer.finished)this.outer.finish(C);else this.inner.finish(C),this.outer.update(C,this.digestLength).finish(C);return this},B.prototype.digest=function(){var C=new Uint8Array(this.digestLength);return this.finish(C),C},B}();X.HMAC=z;function Y(B){var C=new J().update(B),O=C.digest();return C.clean(),O}X.hash=Y,X.default=Y;function K(B,C){var O=new z(B).update(C),H=O.digest();return O.clean(),H}X.hmac=K;function N(B,C,O,H){var P=H[0];if(P===0)throw Error("hkdf: cannot expand more");if(C.reset(),P>1)C.update(B);if(O)C.update(O);C.update(H),C.finish(B),H[0]++}var W=new Uint8Array(X.digestLength);function U(B,C,O,H){if(C===void 0)C=W;if(H===void 0)H=32;var P=new Uint8Array([1]),j=K(C,B),R=new z(j),A=new Uint8Array(R.digestLength),k=A.length,E=new Uint8Array(H);for(var I=0;I<H;I++){if(k===A.length)N(A,R,O,P),k=0;E[I]=A[k++]}return R.clean(),A.fill(0),P.fill(0),E}X.hkdf=U;function x(B,C,O,H){var P=new z(B),j=P.digestLength,R=new Uint8Array(4),A=new Uint8Array(j),k=new Uint8Array(j),E=new Uint8Array(H);for(var I=0;I*j<H;I++){var t=I+1;R[0]=t>>>24&255,R[1]=t>>>16&255,R[2]=t>>>8&255,R[3]=t>>>0&255,P.reset(),P.update(C),P.update(R),P.finish(k);for(var b=0;b<j;b++)A[b]=k[b];for(var b=2;b<=O;b++){P.reset(),P.update(k).finish(k);for(var p=0;p<j;p++)A[p]^=k[p]}for(var b=0;b<j&&I*j+b<H;b++)E[I*j+b]=A[b]}for(var I=0;I<j;I++)A[I]=k[I]=0;for(var I=0;I<4;I++)R[I]=0;return P.clean(),E}X.pbkdf2=x})});var v9=b$((b9)=>{Object.defineProperty(b9,"__esModule",{value:!0});b9.Webhook=b9.WebhookVerificationError=void 0;var j5=D9(),k9=I9(),R5=y9(),h9=300;class R1 extends Error{constructor(X){super(X);Object.setPrototypeOf(this,R1.prototype),this.name="ExtendableError",this.stack=Error(X).stack}}class hZ extends R1{constructor(X){super(X);Object.setPrototypeOf(this,hZ.prototype),this.name="WebhookVerificationError"}}b9.WebhookVerificationError=hZ;class V8{constructor(X,Z){if(!X)throw Error("Secret can't be empty.");if((Z===null||Z===void 0?void 0:Z.format)==="raw")if(X instanceof Uint8Array)this.key=X;else this.key=Uint8Array.from(X,($)=>$.charCodeAt(0));else{if(typeof X!=="string")throw Error("Expected secret to be of type string");if(X.startsWith(V8.prefix))X=X.substring(V8.prefix.length);this.key=k9.decode(X)}}verify(X,Z){let $={};for(let B of Object.keys(Z))$[B.toLowerCase()]=Z[B];let J=$["webhook-id"],z=$["webhook-signature"],Y=$["webhook-timestamp"];if(!z||!J||!Y)throw new hZ("Missing required headers");let K=this.verifyTimestamp(Y),W=this.sign(J,K,X).split(",")[1],U=z.split(" "),x=new globalThis.TextEncoder;for(let B of U){let[C,O]=B.split(",");if(C!=="v1")continue;if((0,j5.timingSafeEqual)(x.encode(O),x.encode(W)))return JSON.parse(X.toString())}throw new hZ("No matching signature found")}sign(X,Z,$){if(typeof $==="string");else if($.constructor.name==="Buffer")$=$.toString();else throw Error("Expected payload to be of type string or Buffer.");let J=new TextEncoder,z=Math.floor(Z.getTime()/1000),Y=J.encode(`${X}.${z}.${$}`);return`v1,${k9.encode(R5.hmac(this.key,Y))}`}verifyTimestamp(X){let Z=Math.floor(Date.now()/1000),$=parseInt(X,10);if(isNaN($))throw new hZ("Invalid Signature Headers");if(Z-$>h9)throw new hZ("Message timestamp too old");if($>Z+h9)throw new hZ("Message timestamp too new");return new Date($*1000)}}b9.Webhook=V8;V8.prefix="whsec_"});var _9,N8;var D1=T(()=>{L();_9=w5(v9(),1);N8=class N8 extends M{parseUnverified(X){return JSON.parse(X)}unwrap(X,Z){let $=Z?.headers;if($==null)throw Error("Webhook headers are required in order to verify the signature");let J=Z.key===void 0?this._client.webhookKey:Z.key;if(!J)throw Error("Webhook key must not be null or empty in order to unwrap");return new _9.Webhook(J).verify(X,$),JSON.parse(X)}}});var W8;var w1=T(()=>{L();w();D();f();W8=class W8 extends M{list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/agents/${X}/versions?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});var v$;var P1=T(()=>{L();w1();w1();w();D();f();v$=(()=>{class X extends M{constructor(){super(...arguments);this.versions=new W8(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/agents?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y,...K}=$??{};return this._client.get(G`/v1/agents/${Z}?beta=true`,{query:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/agents/${Z}?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/agents?beta=true",S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/agents/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Versions=W8,X})()});function bZ(X,Z){if(!X)return()=>{};if(X.aborted)return Z.abort(),()=>{};let $=()=>Z.abort();return X.addEventListener("abort",$),()=>X.removeEventListener("abort",$)}var _$=()=>{};function gZ(X,Z){return X instanceof _&&X.status===Z}function y5(X){return X instanceof _&&typeof X.status==="number"&&X.status>=400&&X.status<500}function rZ(X){return y5(X)&&!gZ(X,408)&&!gZ(X,409)&&!gZ(X,429)}function m$(X,Z,$){return Math.min(Z*2**X,$)}function m9(X,Z){return X+Math.random()*(Z-X)}function u$(X){return X*(1-Math.random()*0.25)}var c$=T(()=>{u()});function d$(X,{authToken:Z,helper:$}){if(!Z)throw new F(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(Z)}`);let J=X,z=J._options.defaultHeaders,Y=J._authState?.extraHeaders,K=Y?Object.fromEntries(Object.entries(Y).filter(([W])=>{let U=W.toLowerCase();return U!=="authorization"&&U!=="x-api-key"})):void 0,N=V([K,z,{[f$]:$}]);return X.withOptions({apiKey:null,authToken:Z,baseURL:X.baseURL,credentials:void 0,defaultHeaders:N})}var I1=T(()=>{u();D();RZ()});function v5(X){return m$(X,h5,b5)}function m5(){let Z=globalThis.process?.env?.HOSTNAME;return Z?`${Z}-${E$()}`:E$()}var G0,l$,BZ,p$,i$,n$,G8,U8,U0,q0,a$,B0,q8,k5=999,h5=1000,b5=60000,g5=300000,B8,_5;var f1=T(()=>{YZ();u();LZ();z0();J1();_$();D();c$();I1();B8=(()=>{class X{constructor(Z){G0.set(this,void 0),l$.set(this,!1),BZ.set(this,void 0),p$.set(this,void 0),i$.set(this,void 0),n$.set(this,void 0),G8.set(this,void 0),U8.set(this,void 0),U0.set(this,void 0),this.client=Z.client,this.environmentId=Z.environmentId,this.environmentKey=Z.environmentKey,this.workerId=Z.workerId??m5(),q(this,G0,d$(Z.client,{authToken:Z.environmentKey,helper:"environments-work-poller"}),"f"),q(this,i$,Z.autoStop??!0,"f"),q(this,n$,Z.drain??!1,"f"),q(this,G8,Z.blockMs===void 0?k5:Z.blockMs,"f"),q(this,U8,Z.reclaimOlderThanMs??null,"f"),q(this,U0,Z.requestOptions,"f"),q(this,BZ,new AbortController,"f"),q(this,p$,bZ(Z.signal,Q(this,BZ,"f")),"f")}get signal(){return Q(this,BZ,"f").signal}abort(){Q(this,BZ,"f").abort()}async*[(G0=new WeakMap,l$=new WeakMap,BZ=new WeakMap,p$=new WeakMap,i$=new WeakMap,n$=new WeakMap,G8=new WeakMap,U8=new WeakMap,U0=new WeakMap,Symbol.asyncIterator)](){if(Q(this,l$,"f"))throw new F("Cannot iterate over a consumed WorkPoller");q(this,l$,!0,"f");let Z=h(this.client);Z.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let $=new _5(Z,this.environmentId);try{let J=0;while(!Q(this,BZ,"f").signal.aborted){let z;try{z=await Q(this,G0,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...Q(this,G8,"f")!==null?{block_ms:Q(this,G8,"f")}:{},...Q(this,U8,"f")!==null?{reclaim_older_than_ms:Q(this,U8,"f")}:{}},{headers:V([Q(this,U0,"f")?.headers]),signal:Q(this,BZ,"f").signal})}catch(Y){if(Q(this,BZ,"f").signal.aborted)return;if(rZ(Y))throw Z.error("poll failed permanently, stopping poller",{error:String(Y)}),Y;let K=u$(v5(J));Z.warn("poll failed, backing off",{error:String(Y),backoff_ms:K}),J++,await MZ(K,Q(this,BZ,"f").signal);continue}if(J=0,z==null){if(Q(this,n$,"f"))return;$.onEmptyPoll(),await MZ(m9(1000,3000),Q(this,BZ,"f").signal);continue}$.onClaim(),Z.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:z.id,work_type:z.data.type});try{await Q(this,G0,"f").beta.environments.work.ack(z.id,{environment_id:z.environment_id},{headers:V([Q(this,U0,"f")?.headers]),signal:Q(this,BZ,"f").signal})}catch(Y){Z.error("ack failed",{work_id:z.id,error:String(Y)});continue}try{yield z}finally{if(Q(this,i$,"f"))try{await Q(this,G0,"f").beta.environments.work.stop(z.id,{environment_id:z.environment_id},{headers:V([Q(this,U0,"f")?.headers])})}catch(Y){if(!gZ(Y,409))Z.warn("stop failed",{work_id:z.id,error:String(Y)})}}}}finally{Q(this,p$,"f").call(this)}}}return X})();_5=(()=>{class X{constructor(Z,$){q0.set(this,void 0),a$.set(this,void 0),B0.set(this,void 0),q8.set(this,0),q(this,q0,Z,"f"),q(this,a$,$,"f")}onEmptyPoll(){let Z=Date.now(),$={component:"work-poller",environment_id:Q(this,a$,"f")};if(Q(this,B0,"f")===void 0)q(this,B0,q(this,q8,Z,"f"),"f"),Q(this,q0,"f").info("idle; polling for work",$);else if(Z-Q(this,q8,"f")>=g5)q(this,q8,Z,"f"),Q(this,q0,"f").info(`still polling; idle for ${Math.round((Z-Q(this,B0,"f"))/1000)}s`,$);else Q(this,q0,"f").debug("poll returned no work",$)}onClaim(){q(this,B0,void 0,"f")}}return q0=new WeakMap,a$=new WeakMap,B0=new WeakMap,q8=new WeakMap,X})()});var O0,vZ,C0,u9;var c9=T(()=>{YZ();u9=(()=>{class X{constructor(){O0.set(this,[]),vZ.set(this,[]),C0.set(this,!1)}push(Z){if(Q(this,C0,"f"))return!1;let $=Q(this,vZ,"f").shift();if($)$({done:!1,value:Z});else Q(this,O0,"f").push(Z);return!0}close(){if(Q(this,C0,"f"))return;q(this,C0,!0,"f");while(Q(this,vZ,"f").length>0)Q(this,vZ,"f").shift()({done:!0,value:void 0})}next(Z){if(Q(this,O0,"f").length>0)return Promise.resolve({done:!1,value:Q(this,O0,"f").shift()});if(Q(this,C0,"f")||Z?.aborted)return Promise.resolve({done:!0,value:void 0});return new Promise(($)=>{let J=(Y)=>{Z?.removeEventListener("abort",z),$(Y)},z=()=>{let Y=Q(this,vZ,"f").indexOf(J);if(Y>=0)Q(this,vZ,"f").splice(Y,1);$({done:!0,value:void 0})};Q(this,vZ,"f").push(J),Z?.addEventListener("abort",z,{once:!0})})}tryShift(){return Q(this,O0,"f").shift()}}return O0=new WeakMap,vZ=new WeakMap,C0=new WeakMap,X})()});function y1(X){return"name"in X?X.name:("mcp_server_name"in X)?X.mcp_server_name:X.type}function u5(X){return X instanceof J0?X.content:`Error: ${X instanceof Error?X.message:String(X)}`}async function d9(X,Z,$){try{let J=X.parse?X.parse(Z):Z;return{content:await X.run(J,$),isError:!1}}catch(J){return{content:u5(J),isError:!0}}}var l9=T(()=>{K$()});function e9(X){return X.type==="session.status_idle"&&X.stop_reason?.type==="end_turn"}function t5(X,Z,$){if(X.type==="agent.custom_tool_use")return{type:"user.custom_tool_result",custom_tool_use_id:X.id,is_error:Z,content:$};return{type:"user.tool_result",tool_use_id:X.id,is_error:Z,content:$}}function o5(X){if(typeof X==="string")return[{type:"text",text:X||"(no output)"}];let Z=X.map(($)=>{if($.type==="text")return{type:"text",text:$.text||"(no output)"};if($.type==="image"||$.type==="document")return $;if($.type==="search_result")return{type:"search_result",source:$.source,title:$.title,content:$.content.map((J)=>({type:"text",text:J.text})),citations:{enabled:$.citations?.enabled??!1}};return{type:"text",text:JSON.stringify($)}});return Z.length>0?Z:[{type:"text",text:"(no output)"}]}var O8,r$,T0,tZ,HZ,c,t$,o,o$,C8,$X,n,x0,NZ,H0,_Z,M0,yZ,XX,T8,OZ,s$,o9,p9,i9,n9,k1,a9,e$,ZX,h1,r9,s9,t9=500,c5=1e4,d5=120000,l5=30000,p5=1000,i5=30000,n5=300000,a5=60000,r5,M8;var b1=T(()=>{YZ();u();LZ();z0();c$();_$();c9();D();RZ();l9();r5=(()=>{class X{constructor(Z,$){O8.set(this,void 0),r$.set(this,void 0),T0.set(this,new Set),tZ.set(this,!1),HZ.set(this,void 0),q(this,O8,Z,"f"),q(this,r$,$,"f")}noteEvent(Z){if(Z.type==="user.tool_confirmation")return;if(e9(Z))this.arm();else this.disarm()}block(Z){if(Q(this,T0,"f").add(Z),Q(this,HZ,"f")!==void 0)q(this,tZ,!0,"f"),clearTimeout(Q(this,HZ,"f")),q(this,HZ,void 0,"f")}unblock(Z){if(Q(this,T0,"f").delete(Z),Q(this,T0,"f").size===0&&Q(this,tZ,"f"))this.arm()}arm(){if(Q(this,O8,"f")<=0)return;if(Q(this,T0,"f").size>0){q(this,tZ,!0,"f");return}if(q(this,tZ,!1,"f"),Q(this,HZ,"f")!==void 0)clearTimeout(Q(this,HZ,"f"));q(this,HZ,setTimeout(Q(this,r$,"f"),Q(this,O8,"f")),"f")}disarm(){if(q(this,tZ,!1,"f"),Q(this,HZ,"f")!==void 0)clearTimeout(Q(this,HZ,"f")),q(this,HZ,void 0,"f")}}return O8=new WeakMap,r$=new WeakMap,T0=new WeakMap,tZ=new WeakMap,HZ=new WeakMap,X})(),M8=(()=>{class X{constructor(Z,$){c.add(this),t$.set(this,!1),o.set(this,void 0),o$.set(this,void 0),C8.set(this,void 0),$X.set(this,void 0),n.set(this,void 0),x0.set(this,new Set),NZ.set(this,new Set),H0.set(this,new Map),_Z.set(this,new Map),M0.set(this,new u9),yZ.set(this,0),XX.set(this,n5),T8.set(this,null),OZ.set(this,void 0),this.client=$.client,this.sessionId=Z,this.tools=$.tools,this.maxIdleMs=$.maxIdleMs??a5,q(this,n,h($.client),"f"),q(this,$X,new Map($.tools.map((J)=>[y1(J),J])),"f"),q(this,o,new AbortController,"f"),q(this,o$,bZ($.signal,Q(this,o,"f")),"f"),q(this,C8,$.requestOptions,"f"),q(this,OZ,new r5(this.maxIdleMs,()=>{Q(this,n,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),Q(this,o,"f").abort()}),"f")}get signal(){return Q(this,o,"f").signal}abort(){Q(this,o,"f").abort()}_setSendRetryWindow(Z){q(this,XX,Z,"f")}async*[(t$=new WeakMap,o=new WeakMap,o$=new WeakMap,C8=new WeakMap,$X=new WeakMap,n=new WeakMap,x0=new WeakMap,NZ=new WeakMap,H0=new WeakMap,_Z=new WeakMap,M0=new WeakMap,yZ=new WeakMap,XX=new WeakMap,T8=new WeakMap,OZ=new WeakMap,c=new WeakSet,Symbol.asyncIterator)](){if(Q(this,t$,"f"))throw new F("Cannot iterate over a consumed SessionToolRunner");q(this,t$,!0,"f"),Q(this,n,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let Z=Q(this,c,"m",o9).call(this).catch(($)=>{if(!Q(this,o,"f").signal.aborted)Q(this,n,"f").error("stream loop failed",{error:String($)});Q(this,o,"f").abort()});try{while(!0){let J=await Q(this,M0,"f").next(Q(this,o,"f").signal);if(J.done)break;yield J.value}await Z;let $;while(($=Q(this,M0,"f").tryShift())!==void 0)yield $}finally{Q(this,o,"f").abort(),Q(this,OZ,"f").disarm(),await Z;try{await Q(this,c,"m",s9).call(this)}catch($){Q(this,n,"f").warn("drain failed",{error:String($)})}Q(this,M0,"f").close();for(let $ of this.tools)try{await $.close?.()}catch(J){Q(this,n,"f").warn("tool.close failed",{tool:y1($),error:String(J)})}Q(this,o$,"f").call(this)}}}return X})();s$=function(){return{...Q(this,C8,"f"),headers:V([J8("session-tool-runner"),Q(this,C8,"f")?.headers]),signal:Q(this,o,"f").signal}},o9=async function(){let Z=Q(this,o,"f"),$=t9;while(!Z.signal.aborted){try{let J=await this.client.beta.sessions.events.stream(this.sessionId,{},Q(this,c,"m",s$).call(this));await Q(this,c,"m",p9).call(this);for await(let z of J)if($=t9,await Q(this,c,"m",n9).call(this,z))return}catch(J){if(Z.signal.throwIfAborted(),rZ(J))throw Q(this,n,"f").error("permanent stream failure, shutting down",{error:String(J)}),Z.abort(),J;Q(this,n,"f").warn("stream disconnected, reconnecting",{error:String(J),backoff_ms:$})}Z.signal.throwIfAborted(),await MZ($,Z.signal),$=Math.min($*2,c5)}},p9=async function(){let Z=Q(this,o,"f"),$=[],J=!1;try{for await(let K of this.client.beta.sessions.events.list(this.sessionId,{limit:1000},Q(this,c,"m",s$).call(this)))Q(this,c,"m",i9).call(this,K,$),J=e9(K)}catch(K){Z.signal.throwIfAborted(),Q(this,n,"f").warn("reconcile list failed",{error:String(K)});for(let N of $)Q(this,x0,"f").delete(N.id);return}let z=$.filter((K)=>!Q(this,NZ,"f").has(K.id));Q(this,OZ,"f").disarm();for(let K of z)await Q(this,c,"m",k1).call(this,K);for(let K of[...Q(this,_Z,"f").values()]){let N=Q(this,H0,"f").get(K.id);if(N!==void 0)await Q(this,c,"m",e$).call(this,K,N)}let Y=z.filter((K)=>!Q(this,NZ,"f").has(K.id)&&!Q(this,_Z,"f").has(K.id));if(J&&Y.length===0)Q(this,OZ,"f").arm();else Q(this,OZ,"f").disarm()},i9=function(Z,$){if(Z.type==="agent.tool_use"||Z.type==="agent.custom_tool_use"){if(Q(this,x0,"f").add(Z.id),!Q(this,NZ,"f").has(Z.id))$.push(Z)}else if(Z.type==="user.tool_result")Q(this,NZ,"f").add(Z.tool_use_id);else if(Z.type==="user.custom_tool_result")Q(this,NZ,"f").add(Z.custom_tool_use_id);else if(Z.type==="user.tool_confirmation"){if(!Q(this,NZ,"f").has(Z.tool_use_id))Q(this,H0,"f").set(Z.tool_use_id,Z.result)}},n9=async function(Z){switch(Q(this,OZ,"f").noteEvent(Z),Z.type){case"agent.tool_use":case"agent.custom_tool_use":if(!Q(this,x0,"f").has(Z.id))Q(this,x0,"f").add(Z.id),await Q(this,c,"m",k1).call(this,Z);return!1;case"user.tool_confirmation":return await Q(this,c,"m",a9).call(this,Z),!1;case"user.tool_result":return Q(this,NZ,"f").add(Z.tool_use_id),!1;case"user.custom_tool_result":return Q(this,NZ,"f").add(Z.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return Q(this,n,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),Q(this,o,"f").abort(),!0;default:return!1}},k1=async function(Z){let $=Z.evaluated_permission,J=$==="deny"?"deny":Q(this,H0,"f").get(Z.id);if(J===void 0){if($===void 0||$==="allow")await Q(this,c,"m",h1).call(this,Z,void 0);else if(!Q(this,_Z,"f").has(Z.id))Q(this,n,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:Z.name,tool_use_id:Z.id}),Q(this,_Z,"f").set(Z.id,Z),Q(this,OZ,"f").block(Z.id);return}await Q(this,c,"m",e$).call(this,Z,J)},a9=async function(Z){Q(this,H0,"f").set(Z.tool_use_id,Z.result);let $=Q(this,_Z,"f").get(Z.tool_use_id);if($===void 0)return;await Q(this,c,"m",e$).call(this,$,Z.result)},e$=async function(Z,$){let J=Q(this,_Z,"f").delete(Z.id);if($==="allow"){if(Q(this,n,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:Z.name,tool_use_id:Z.id}),!J)Q(this,OZ,"f").block(Z.id);try{await Q(this,c,"m",h1).call(this,Z,"allow")}finally{Q(this,OZ,"f").unblock(Z.id)}return}if(J)Q(this,OZ,"f").unblock(Z.id);Q(this,NZ,"f").add(Z.id),Q(this,n,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:Z.name,tool_use_id:Z.id}),Q(this,c,"m",ZX).call(this,{event:Z,toolUseId:Z.id,name:Z.name,isError:!1,posted:!1,confirmation:"deny"})},ZX=function(Z){Q(this,M0,"f").push(Z)},h1=async function(Z,$){var J,z;if(Q(this,NZ,"f").has(Z.id))return;Q(this,n,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:Z.name,tool_use_id:Z.id}),q(this,yZ,(J=Q(this,yZ,"f"),J++,J),"f");try{let Y=Q(this,$X,"f").get(Z.name);if(!Y){Q(this,n,"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:Z.name,tool_use_id:Z.id}),Q(this,c,"m",ZX).call(this,{event:Z,toolUseId:Z.id,name:Z.name,isError:!1,posted:!1,confirmation:$});return}let K,N,W=new AbortController,U=bZ(Q(this,o,"f").signal,W),x=setTimeout(()=>W.abort(),d5);try{let O=await d9(Y,Z.input,{toolUse:Z,toolUseBlock:Z,signal:W.signal});K=O.content,N=O.isError}finally{clearTimeout(x),U()}let B=t5(Z,N,o5(K)),C=await Q(this,c,"m",r9).call(this,B,Z.id);Q(this,c,"m",ZX).call(this,{event:Z,result:B,toolUseId:Z.id,name:Z.name,isError:N,posted:C,confirmation:$})}finally{if(q(this,yZ,(z=Q(this,yZ,"f"),z--,z),"f"),Q(this,yZ,"f")===0)Q(this,T8,"f")?.call(this)}},r9=async function(Z,$){let J=Q(this,o,"f"),z=Date.now(),Y,K=0;while(!0){K++,J.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[Z]},Q(this,c,"m",s$).call(this)),Q(this,NZ,"f").add($),!0}catch(N){if(Y=N,rZ(N))break;let W=Q(this,XX,"f")-(Date.now()-z);if(W<=0)break;let U=Math.min(u$(m$(K-1,p5,i5)),W);Q(this,n,"f").warn("tool result send failed; retrying",{tool_use_id:$,attempt:K,backoff_ms:U,error:String(N)}),await MZ(U,J.signal)}}return Q(this,n,"f").error("failed to send tool result",{tool_use_id:$,attempts:K,error:String(Y)}),!1},s9=async function(){if(Q(this,yZ,"f")===0)return;if(await Promise.race([new Promise((Z)=>q(this,T8,Z,"f")),MZ(l5)]),q(this,T8,null,"f"),Q(this,yZ,"f")>0)Q(this,n,"f").warn("drain timeout exceeded")}});function ZJ(X){return X.resources.some((Z)=>Z.type==="memory_store")}function $J(X){if(!X)return null;let Z;try{let J=X.replace(/-/g,"+").replace(/_/g,"/"),z=J.padEnd(Math.ceil(J.length/4)*4,"=");Z=JSON.parse(i0(i6(z)))}catch{return null}if(Z===null||typeof Z!=="object"||Array.isArray(Z))return null;let $=Z.sessions_token;return typeof $==="string"&&$!==""?$:null}async function $7(X,Z){let $;try{return await Promise.race([X.then(()=>!1,()=>!1),new Promise((J)=>{$=setTimeout(()=>J(!0),Z)})])}finally{if($!==void 0)clearTimeout($)}}async function XJ(X,Z,$,J){try{await X.beta.environments.work.stop(Z.id,{environment_id:Z.environment_id,force:!0},{...J,headers:V([J?.headers])})}catch(z){if(!gZ(z,409))$.error("force-stop on exit failed",{work_id:Z.id,error:String(z)})}}function zJ(X){let Z=X instanceof _?X.error:void 0;for(let $ of["error","details","current_state"]){if(!cX(Z))return{};Z=Z[$]}return cX(Z)?Z:{}}async function YJ(X,Z,$,J,z,Y){let K=Z7,N=s5,W=Date.now(),U=e5,x=async()=>{let B=new AbortController,C=bZ($.signal,B),O=setTimeout(()=>B.abort(),K);try{let H=await X.beta.environments.work.heartbeat(Z.id,{environment_id:Z.environment_id,expected_last_heartbeat:U},{...z,headers:V([z?.headers]),signal:B.signal});if(W=Date.now(),U=H.last_heartbeat,H.ttl_seconds>0)N=H.ttl_seconds*1000,K=Math.max(1000,Math.min(N/2,Z7)),Y?.(N);if(H.state==="stopping"||H.state==="stopped")J.info("heartbeat signals shutdown",{work_id:Z.id,state:H.state}),$.finish("control_plane_stop");if(!H.lease_extended)J.warn("lease not extended, shutting down",{work_id:Z.id}),$.finish("control_plane_stop")}catch(H){if($.signal.throwIfAborted(),gZ(H,412)){let P=zJ(H);J.error("lease lost: heartbeat precondition failed",{work_id:Z.id,server_state:P.state,server_ttl_seconds:P.ttl_seconds,server_last_heartbeat:P.last_heartbeat}),$.finish("lease_lost");return}if(rZ(H))throw J.error("permanent heartbeat failure",{work_id:Z.id,error:String(H)}),$.finish("heartbeat_rejected"),H;if(Date.now()-W>N){J.error("lease assumed lost: no successful heartbeat in ttl",{work_id:Z.id,ttl_ms:N,error:String(H)}),$.finish("assumed_lost");return}J.warn("transient heartbeat failure",{work_id:Z.id,error:String(H)})}finally{clearTimeout(O),C()}};await x();while(!$.signal.aborted)await MZ(K,$.signal),$.signal.throwIfAborted(),await x()}var JX,x8,g1,H8,F0,Z7=30000,s5=90000,e5="NO_HEARTBEAT",v1,JJ;var X7=T(()=>{YZ();u();LZ();Z1();H$();V0();z0();c$();_$();$Z();D();b1();f1();I1();W6();v1=(()=>{class X{constructor(Z){if(JX.add(this),x8.set(this,void 0),Z.unrestrictedPaths!==void 0)throw new F("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=Z.client,this.environmentId=Z.environmentId,this.environmentKey=Z.environmentKey,this.tools=Z.tools,this.workdir=Z.workdir??process.cwd(),this.maxFileBytes=Z.maxFileBytes,this.maxIdleMs=Z.maxIdleMs,Z.memorySyncIntervalMs!=null)N6(Z.memorySyncIntervalMs,"memorySyncIntervalMs");this.memorySyncIntervalMs=Z.memorySyncIntervalMs,this.memorySyncDeletions=Z.memorySyncDeletions??"enabled",this.workerId=Z.workerId,this.requestOptions=Z.requestOptions,q(this,x8,Z.signal,"f")}async run(Z){let{environmentId:$,environmentKey:J}=this;if($===void 0||J===void 0)throw new F("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let z=Z??Q(this,x8,"f"),Y=new B8({client:this.client,environmentId:$,environmentKey:J,...this.workerId!==void 0?{workerId:this.workerId}:{},...z?{signal:z}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let K of Y)try{await Q(this,JX,"m",g1).call(this,K,J,Y.signal)}catch(N){if(Y.signal?.aborted)throw N;h(this.client).error("work item failed",{work_id:K.id,error:String(N)})}}async handleItem(Z){let $=Z?.workId??y("ANTHROPIC_WORK_ID"),J=Z?.environmentId??y("ANTHROPIC_ENVIRONMENT_ID"),z=Z?.sessionId??y("ANTHROPIC_SESSION_ID"),Y=(Z?.environmentKey??this.environmentKey??y("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,K=Z?.workSecret||y("ANTHROPIC_WORK_SECRET")||null;if(!$)throw new F("handleItem: workId is required — pass it or set ANTHROPIC_WORK_ID");if(!J)throw new F("handleItem: environmentId is required — pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!z)throw new F("handleItem: sessionId is required — pass it or set ANTHROPIC_SESSION_ID");if(!Y&&!K)throw new F("handleItem: environmentKey is required when there is no work secret — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let N={id:$,environment_id:J,secret:K,data:{type:"session",id:z}};await Q(this,JX,"m",g1).call(this,N,Y,Z?.signal??Q(this,x8,"f"))}}return x8=new WeakMap,JX=new WeakSet,g1=async function($,J,z){let Y=h(this.client),K=$J($.secret),N=K??J;if(N===void 0)throw new F("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($.secret&&K===null)Y.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:$.id});let W=d$(this.client,{authToken:N,helper:"environments-worker"}),U=$.data.id,x=new AbortController,B=bZ(z,x),C=new JJ(x),O=await import("./node-1.1.40-feq5eqhb.mjs"),H,P,j=YJ(W,$,C,Y,this.requestOptions,(E)=>{H=E,P?._setSendRetryWindow(E)}).catch((E)=>{if(!x.signal.aborted)Y.error("heartbeat loop failed",{work_id:$.id,error:String(E)});x.abort()}),R=async()=>{},A,k=!1;try{if($.data.type!=="session"){Y.debug("skipping non-session work item",{work_id:$.id,type:$.data.type});return}let E=await W.beta.sessions.retrieve(U);if(K===null&&this.memorySyncIntervalMs!==null&&ZJ(E))throw new O.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${$.id}, session_id=${U}); 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 I={workdir:this.workdir,client:W,session:E,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{R=await O.setupSkills(I)}catch(b){Y.warn("skill setup failed",{session_id:U,work_id:$.id,error:String(b)})}if(K!==null&&this.memorySyncIntervalMs!==null)A=new O.SessionMemoryStores(W,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await A.download(E),I.allowedRoots=A.roots,I.readOnlyRoots=A.readOnlyRoots;else Y.debug("memory stores disabled for this item",{work_id:$.id});let t=typeof this.tools==="function"?this.tools(I):this.tools??O.betaAgentToolset20260401(I);if(P=new M8(U,{client:W,tools:t,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:x.signal}),H!==void 0)P._setSendRetryWindow(H);for await(let b of P)if(A)await A.syncIfDue();k=!x.signal.aborted}finally{try{await R().catch((E)=>{Y.warn("skill cleanup failed",{session_id:U,work_id:$.id,error:String(E)})})}finally{if(A){let E=O.MEMORY_FLUSH_TIMEOUT_MS;if(k){if(await $7(A.finish(),E))Y.warn(`final memory sync cut off after ${E}ms; the flush that follows still uploads changed files`,{session_id:U,work_id:$.id})}let I=new AbortController;if(await $7(A.flushWrites(I.signal),E))I.abort(),Y.warn(`memory flush cut off after ${E}ms; changed files it had not uploaded yet are not saved`,{session_id:U,work_id:$.id});await A.dispose().catch((b)=>{Y.warn("memory store cleanup failed",{session_id:U,work_id:$.id,error:String(b)})})}}if(C.finish("runner_done"),B(),await j,C.lost)Y.info("lease lost; released without stopping it",{session_id:U,work_id:$.id});else await XJ(W,$,Y,this.requestOptions)}},X})();JJ=(()=>{class X{constructor(Z){H8.set(this,void 0),F0.set(this,void 0),q(this,H8,Z,"f")}get signal(){return Q(this,H8,"f").signal}finish(Z){q(this,F0,Q(this,F0,"f")??Z,"f"),Q(this,H8,"f").abort()}get lost(){return Q(this,F0,"f")==="lease_lost"||Q(this,F0,"f")==="assumed_lost"}}return H8=new WeakMap,F0=new WeakMap,X})()});var zX;var _1=T(()=>{L();w();D();f();f1();X7();zX=(()=>{class X extends M{retrieve(Z,$,J){let{environment_id:z,betas:Y,workspace_id:K}=$;return this._client.get(G`/v1/environments/${z}/work/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},J?.headers])})}update(Z,$,J){let{environment_id:z,betas:Y,workspace_id:K,...N}=$;return this._client.post(G`/v1/environments/${z}/work/${Z}?beta=true`,{body:N,...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},J?.headers])})}list(Z,$={},J){let{betas:z,...Y}=$??{};return this._client.getAPIList(G`/v1/environments/${Z}/work?beta=true`,S,{query:Y,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},J?.headers])})}ack(Z,$,J){let{environment_id:z,betas:Y}=$;return this._client.post(G`/v1/environments/${z}/work/${Z}/ack?beta=true`,{...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString()},J?.headers])})}heartbeat(Z,$,J){let{environment_id:z,desired_ttl_seconds:Y,expected_last_heartbeat:K,betas:N}=$;return this._client.post(G`/v1/environments/${z}/work/${Z}/heartbeat?beta=true`,{query:{desired_ttl_seconds:Y,expected_last_heartbeat:K},...J,headers:V([{"anthropic-beta":[...N??[],"managed-agents-2026-04-01"].toString()},J?.headers])})}poll(Z,$={},J){let{betas:z,"Anthropic-Worker-ID":Y,...K}=$??{};return this._client.get(G`/v1/environments/${Z}/work/poll?beta=true`,{query:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"Anthropic-Worker-ID":Y}:void 0},J?.headers])})}stats(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/environments/${Z}/work/stats?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}stop(Z,$,J){let{environment_id:z,betas:Y,workspace_id:K,...N}=$;return this._client.post(G`/v1/environments/${z}/work/${Z}/stop?beta=true`,{body:N,...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},J?.headers])})}poller(Z){return new B8({...Z,client:this._client})}worker(Z){return new v1({...Z,client:this._client})}}return X.WorkPoller=B8,X.EnvironmentWorker=v1,X})()});var YX;var m1=T(()=>{L();_1();_1();w();D();f();YX=(()=>{class X extends M{constructor(){super(...arguments);this.work=new zX(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/environments?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/environments/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/environments/${Z}?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/environments?beta=true",S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.delete(G`/v1/environments/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/environments/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Work=zX,X})()});var F8;var u1=T(()=>{L();w();D();f();F8=class F8 extends M{create(X,Z,$){let{view:J,betas:z,workspace_id:Y,...K}=Z;return this._client.post(G`/v1/memory_stores/${X}/memories?beta=true`,{query:{view:J},body:K,...$,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}retrieve(X,Z,$){let{memory_store_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.get(G`/v1/memory_stores/${J}/memories/${X}?beta=true`,{query:K,...$,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}update(X,Z,$){let{memory_store_id:J,view:z,betas:Y,workspace_id:K,...N}=Z;return this._client.post(G`/v1/memory_stores/${J}/memories/${X}?beta=true`,{query:{view:z},body:N,...$,headers:V([{"anthropic-beta":[...Y??[],"agent-memory-2026-07-22"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/memory_stores/${X}/memories?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"agent-memory-2026-07-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(X,Z,$){let{memory_store_id:J,expected_content_sha256:z,betas:Y,workspace_id:K}=Z;return this._client.delete(G`/v1/memory_stores/${J}/memories/${X}?beta=true`,{query:{expected_content_sha256:z},...$,headers:V([{"anthropic-beta":[...Y??[],"agent-memory-2026-07-22"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},$?.headers])})}}});var A8;var c1=T(()=>{L();w();D();f();A8=class A8 extends M{retrieve(X,Z,$){let{memory_store_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.get(G`/v1/memory_stores/${J}/memory_versions/${X}?beta=true`,{query:K,...$,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/memory_stores/${X}/memory_versions?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"agent-memory-2026-07-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}redact(X,Z,$){let{memory_store_id:J,betas:z,workspace_id:Y}=Z;return this._client.post(G`/v1/memory_stores/${J}/memory_versions/${X}/redact?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}}});var QX;var d1=T(()=>{L();u1();u1();c1();c1();w();D();f();QX=(()=>{class X extends M{constructor(){super(...arguments);this.memories=new F8(this._client),this.memoryVersions=new A8(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/memory_stores?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"agent-memory-2026-07-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/memory_stores/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/memory_stores/${Z}?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/memory_stores?beta=true",S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"agent-memory-2026-07-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.delete(G`/v1/memory_stores/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/memory_stores/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"agent-memory-2026-07-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Memories=F8,X.MemoryVersions=A8,X})()});var A0=T(()=>{u()});var KX;var l1=T(()=>{u();Y0();V1();KX=(()=>{class X{constructor(Z,$){this.iterator=Z,this.controller=$}async*decoder(){let Z=new a0;for await(let $ of this.iterator)for(let J of Z.decode($))yield JSON.parse(J);for(let $ of Z.flush())yield JSON.parse($)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(Z,$){if(!Z.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new F("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 F("Attempted to iterate over a response with no body")}return new X(d0(Z.body),$)}}return X})()});var S8;var p1=T(()=>{L();w();D();l1();A0();f();S8=class S8 extends M{create(X,Z){let{betas:$,user_profile_id:J,workspace_id:z,...Y}=X;return this._client.post("/v1/messages/batches?beta=true",{body:Y,...Z,headers:V([{"anthropic-beta":[...$??[],"message-batches-2024-09-24"].toString(),...J!=null?{"anthropic-user-profile-id":J}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/messages/batches/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/messages/batches?beta=true",r,{query:z,...Z,headers:V([{"anthropic-beta":[...$??[],"message-batches-2024-09-24"].toString(),...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}delete(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.delete(G`/v1/messages/batches/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}cancel(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.post(G`/v1/messages/batches/${X}/cancel?beta=true`,{...$,headers:V([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}async results(X,Z={},$){let J=await this.retrieve(X,Z,$);if(!J.results_url)throw new F(`No batch \`results_url\`; Has it finished processing? ${J.processing_status} - ${J.id}`);let{betas:z,workspace_id:Y}=Z??{};return this._client.get(J.results_url,{...$,headers:V([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((K,N)=>KX.fromResponse(N.response,N.controller))}}});var VX;var i1=T(()=>{VX={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function J7(X){return X?.output_format??X?.output_config?.format}function n1(X,Z,$){let J=J7(Z);if(!Z||!("parse"in(J??{})))return{...X,content:X.content.map((z)=>{if(z.type==="text"){let Y=Object.defineProperty({...z},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return $.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return z}),parsed_output:null};return a1(X,Z,$)}function a1(X,Z,$){let J=null,z=X.content.map((Y)=>{if(Y.type==="text"){let K=UJ(Z,Y.text);if(J===null)J=K;let N=Object.defineProperty({...Y},"parsed_output",{value:K,enumerable:!1});return Object.defineProperty(N,"parsed",{get(){return $.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),K},enumerable:!1})}return Y});return{...X,content:z,parsed_output:J}}function UJ(X,Z){let $=J7(X);if($?.type!=="json_schema")return null;try{if("parse"in $)return $.parse(Z);return JSON.parse(Z)}catch(J){throw new F(`Failed to parse structured output: ${J}`)}}var r1=T(()=>{u()});var t1=T(()=>{j$()});var qJ=(X)=>{let Z=0,$=[];while(Z<X.length){let J=X[Z];if(J==="\\"){Z++;continue}if(J==="{"){$.push({type:"brace",value:"{"}),Z++;continue}if(J==="}"){$.push({type:"brace",value:"}"}),Z++;continue}if(J==="["){$.push({type:"paren",value:"["}),Z++;continue}if(J==="]"){$.push({type:"paren",value:"]"}),Z++;continue}if(J===":"){$.push({type:"separator",value:":"}),Z++;continue}if(J===","){$.push({type:"delimiter",value:","}),Z++;continue}if(J==='"'){let N="",W=!1;J=X[++Z];while(J!=='"'){if(Z===X.length){W=!0;break}if(J==="\\"){if(Z++,Z===X.length){W=!0;break}N+=J+X[Z],J=X[++Z]}else N+=J,J=X[++Z]}if(J=X[++Z],!W)$.push({type:"string",value:N});continue}if(J&&/\s/.test(J)){Z++;continue}let Y=/[0-9]/;if(J&&Y.test(J)||J==="-"||J==="."){let N="";if(J==="-")N+=J,J=X[++Z];while(J&&(Y.test(J)||J==="."||J==="e"||J==="E"||(J==="-"||J==="+")&&(N[N.length-1]==="e"||N[N.length-1]==="E")))N+=J,J=X[++Z];$.push({type:"number",value:N});continue}let K=/[a-z]/i;if(J&&K.test(J)){let N="";while(J&&K.test(J)){if(Z===X.length)break;N+=J,J=X[++Z]}if(N=="true"||N=="false"||N==="null")$.push({type:"name",value:N});else{Z++;continue}continue}Z++}return $},S0=(X)=>{if(X.length===0)return X;let Z=X[X.length-1];switch(Z.type){case"separator":return X=X.slice(0,X.length-1),S0(X);break;case"number":let $=Z.value[Z.value.length-1];if($==="."||$==="-"||$==="+"||$==="e"||$==="E")return X=X.slice(0,X.length-1),S0(X);case"string":let J=X[X.length-2];if(J?.type==="delimiter")return X=X.slice(0,X.length-1),S0(X);else if(J?.type==="brace"&&J.value==="{")return X=X.slice(0,X.length-1),S0(X);break;case"delimiter":return X=X.slice(0,X.length-1),S0(X);break}return X},BJ=(X)=>{let Z=[];if(X.map(($)=>{if($.type==="brace")if($.value==="{")Z.push("}");else Z.splice(Z.lastIndexOf("}"),1);if($.type==="paren")if($.value==="[")Z.push("]");else Z.splice(Z.lastIndexOf("]"),1)}),Z.length>0)Z.reverse().map(($)=>{if($==="}")X.push({type:"brace",value:"}"});else if($==="]")X.push({type:"paren",value:"]"})});return X},OJ=(X)=>{let Z="";return X.map(($)=>{switch($.type){case"string":Z+='"'+$.value+'"';break;default:Z+=$.value;break}}),Z},z7=(X)=>JSON.parse(OJ(BJ(S0(qJ(X)))));var Y7=()=>{};function NX(X,Z){let $={};for(let Y of Object.keys(X))if(Y!=="input")$[Y]=X[Y];Object.defineProperty($,mZ,{value:Z,enumerable:!1,writable:!0});let J,z=!1;return Object.defineProperty($,"input",{enumerable:!0,configurable:!0,get(){if(!z)J=Z?z7(Z):{},z=!0;return J}}),$}var mZ="__json_buf";var o1=T(()=>{Y7()});function J4(X){return X.type==="tool_use"||X.type==="server_tool_use"||X.type==="mcp_tool_use"}var JZ,uZ,E0,E8,WX,L8,j8,GX,R8,DZ,D8,UX,qX,oZ,BX,OX,CX,w8,s1,Q7,P8,e1,Z4,$4,K7,X4,V7;var N7=T(()=>{YZ();RZ();A0();iZ();$Z();t1();r1();o1();V7=(()=>{class X{constructor(Z,$){JZ.add(this),this.messages=[],this.receivedMessages=[],uZ.set(this,void 0),E0.set(this,null),this.controller=new AbortController,E8.set(this,void 0),WX.set(this,()=>{}),L8.set(this,()=>{}),j8.set(this,void 0),GX.set(this,()=>{}),R8.set(this,()=>{}),DZ.set(this,{}),D8.set(this,!1),UX.set(this,!1),qX.set(this,!1),oZ.set(this,!1),BX.set(this,void 0),OX.set(this,void 0),CX.set(this,void 0),w8.set(this,void 0),P8.set(this,(J)=>{if(q(this,UX,!0,"f"),TZ(J))J=new s;if(J instanceof s)return q(this,qX,!0,"f"),this._emit("abort",J);if(J instanceof F)return this._emit("error",J);if(J instanceof Error){let z=new F(J.message);return z.cause=J,this._emit("error",z)}return this._emit("error",new F(String(J)))}),q(this,E8,new Promise((J,z)=>{q(this,WX,J,"f"),q(this,L8,z,"f")}),"f"),q(this,j8,new Promise((J,z)=>{q(this,GX,J,"f"),q(this,R8,z,"f")}),"f"),Q(this,E8,"f").catch(()=>{}),Q(this,j8,"f").catch(()=>{}),q(this,E0,Z,"f"),q(this,w8,$?.logger??console,"f")}get response(){return Q(this,BX,"f")}get request_id(){return Q(this,OX,"f")}get workspace_id(){return Q(this,CX,"f")}async withResponse(){q(this,oZ,!0,"f");let Z=await Q(this,E8,"f");if(!Z)throw Error("Could not resolve a `Response` object");return{data:this,response:Z,request_id:Z.headers.get("request-id"),workspace_id:Z.headers.get("anthropic-workspace-id")}}static fromReadableStream(Z){let $=new X(null);return $._run(()=>$._fromReadableStream(Z)),$}static createMessage(Z,$,J,{logger:z}={}){let Y=new X($,{logger:z});for(let K of $.messages)Y._addMessageParam(K);return q(Y,E0,{...$,stream:!0},"f"),Y._run(()=>Y._createMessage(Z,{...$,stream:!0},{...J,headers:{...J?.headers,[y$]:"stream"}})),Y}_run(Z){Z().then(()=>{this._emitFinal(),this._emit("end")},Q(this,P8,"f"))}_addMessageParam(Z){this.messages.push(Z)}_addMessage(Z,$=!0){if(this.receivedMessages.push(Z),$)this._emit("message",Z)}async _createMessage(Z,$,J){let z=J?.signal,Y;if(z){if(z.aborted)this.controller.abort();Y=this.controller.abort.bind(this.controller),z.addEventListener("abort",Y)}try{Q(this,JZ,"m",e1).call(this);let{response:K,data:N}=await Z.create({...$,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(K);for await(let W of N)Q(this,JZ,"m",Z4).call(this,W);if(N.controller.signal?.aborted)throw new s;Q(this,JZ,"m",$4).call(this)}finally{if(z&&Y)z.removeEventListener("abort",Y)}}_connected(Z){if(this.ended)return;q(this,BX,Z,"f"),q(this,OX,Z?.headers.get("request-id"),"f"),q(this,CX,Z?.headers.get("anthropic-workspace-id"),"f"),Q(this,WX,"f").call(this,Z),this._emit("connect")}get ended(){return Q(this,D8,"f")}get errored(){return Q(this,UX,"f")}get aborted(){return Q(this,qX,"f")}abort(){this.controller.abort()}on(Z,$){return(Q(this,DZ,"f")[Z]||(Q(this,DZ,"f")[Z]=[])).push({listener:$}),this}off(Z,$){let J=Q(this,DZ,"f")[Z];if(!J)return this;let z=J.findIndex((Y)=>Y.listener===$);if(z>=0)J.splice(z,1);return this}once(Z,$){return(Q(this,DZ,"f")[Z]||(Q(this,DZ,"f")[Z]=[])).push({listener:$,once:!0}),this}emitted(Z){return new Promise(($,J)=>{if(q(this,oZ,!0,"f"),Z!=="error")this.once("error",J);this.once(Z,$)})}async done(){q(this,oZ,!0,"f"),await Q(this,j8,"f")}get currentMessage(){return Q(this,uZ,"f")}async finalMessage(){return await this.done(),Q(this,JZ,"m",s1).call(this)}async finalText(){return await this.done(),Q(this,JZ,"m",Q7).call(this)}_emit(Z,...$){if(Q(this,D8,"f"))return;if(Z==="end")q(this,D8,!0,"f"),Q(this,GX,"f").call(this);let J=Q(this,DZ,"f")[Z];if(J)Q(this,DZ,"f")[Z]=J.filter((z)=>!z.once),J.forEach(({listener:z})=>z(...$));if(Z==="abort"){let z=$[0];if(!Q(this,oZ,"f")&&!J?.length)Promise.reject(z);Q(this,L8,"f").call(this,z),Q(this,R8,"f").call(this,z),this._emit("end");return}if(Z==="error"){let z=$[0];if(!Q(this,oZ,"f")&&!J?.length)Promise.reject(z);Q(this,L8,"f").call(this,z),Q(this,R8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",Q(this,JZ,"m",s1).call(this))}async _fromReadableStream(Z,$){let J=$?.signal,z;if(J){if(J.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),J.addEventListener("abort",z)}try{Q(this,JZ,"m",e1).call(this),this._connected(null);let Y=jZ.fromReadableStream(Z,this.controller);for await(let K of Y)Q(this,JZ,"m",Z4).call(this,K);if(Y.controller.signal?.aborted)throw new s;Q(this,JZ,"m",$4).call(this)}finally{if(J&&z)J.removeEventListener("abort",z)}}[(uZ=new WeakMap,E0=new WeakMap,E8=new WeakMap,WX=new WeakMap,L8=new WeakMap,j8=new WeakMap,GX=new WeakMap,R8=new WeakMap,DZ=new WeakMap,D8=new WeakMap,UX=new WeakMap,qX=new WeakMap,oZ=new WeakMap,BX=new WeakMap,OX=new WeakMap,CX=new WeakMap,w8=new WeakMap,P8=new WeakMap,JZ=new WeakSet,s1=function(){if(this.receivedMessages.length===0)throw new F("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Q7=function(){if(this.receivedMessages.length===0)throw new F("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((J)=>J.type==="text").map((J)=>J.text);if($.length===0)throw new F("stream ended without producing a content block with type=text");return $.join(" ")},e1=function(){if(this.ended)return;q(this,uZ,void 0,"f")},Z4=function($){if(this.ended)return;let J=Q(this,JZ,"m",K7).call(this,$);switch(this._emit("streamEvent",$,J),$.type){case"content_block_delta":{let z=J.content.at(-1);switch($.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",$.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",$.delta.citation,z.citations??[]);break}case"input_json_delta":{if(J4(z)&&Q(this,DZ,"f").inputJson?.length){let Y;try{Y=z.input}catch(K){Q(this,P8,"f").call(this,Q(this,JZ,"m",X4).call(this,z,K));break}this._emit("inputJson",$.delta.partial_json,Y)}break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",$.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}case"compaction_delta":{if(z.type==="compaction"&&z.content)this._emit("compaction",z.content);break}default:kZ($.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(n1(J,Q(this,E0,"f"),{logger:Q(this,w8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{q(this,uZ,J,"f");break}case"content_block_start":case"message_delta":break}},$4=function(){if(this.ended)throw new F("stream has ended, this shouldn't happen");let $=Q(this,uZ,"f");if(!$)throw new F("request ended without sending any chunks");return q(this,uZ,void 0,"f"),n1($,Q(this,E0,"f"),{logger:Q(this,w8,"f")})},K7=function($){let J=Q(this,uZ,"f");if($.type==="message_start"){if(J)throw new F(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!J)throw new F(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return J;case"message_delta":if(J.stop_reason=$.delta.stop_reason,J.stop_sequence=$.delta.stop_sequence,J.stop_details=$.delta.stop_details,J.usage.output_tokens=$.usage.output_tokens,$.delta.container!=null)J.container=$.delta.container;if($.context_management!=null)J.context_management=$.context_management;if($.input_transformations!=null)J.input_transformations=$.input_transformations;if($.usage.input_tokens!=null)J.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)J.usage.server_tool_use=$.usage.server_tool_use;if($.usage.iterations!=null)J.usage.iterations=$.usage.iterations;if($.usage.fallback_credit!=null)J.usage.fallback_credit=$.usage.fallback_credit;if($.usage.output_tokens_details!=null)J.usage.output_tokens_details=$.usage.output_tokens_details;return J;case"content_block_start":if(J.content.push($.content_block),$.content_block.type==="fallback")J.model=$.content_block.to.model;return J;case"content_block_delta":{let z=J.content.at($.index);switch($.delta.type){case"text_delta":{if(z?.type==="text")J.content[$.index]={...z,text:(z.text||"")+$.delta.text};break}case"citations_delta":{if(z?.type==="text")J.content[$.index]={...z,citations:[...z.citations??[],$.delta.citation]};break}case"input_json_delta":{if(z&&J4(z)){let Y=(z[mZ]||"")+$.delta.partial_json;J.content[$.index]=NX(z,Y)}break}case"thinking_delta":{if(z?.type==="thinking")J.content[$.index]={...z,thinking:z.thinking+$.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")J.content[$.index]={...z,signature:$.delta.signature};break}case"compaction_delta":{if(z?.type==="compaction"){let Y={...z,content:$.delta.content};if("encrypted_content"in $.delta)Y.encrypted_content=$.delta.encrypted_content;J.content[$.index]=Y}break}default:kZ($.delta)}return J}case"content_block_stop":{let z=J.content.at($.index);if(z&&J4(z)&&mZ in z){let Y;try{Y=z.input}catch(K){Y={},Q(this,P8,"f").call(this,Q(this,JZ,"m",X4).call(this,z,K))}Object.defineProperty(z,"input",{value:Y,enumerable:!0,configurable:!0,writable:!0})}return J}}},X4=function($,J){let z=$[mZ];return new F(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${J}. JSON: ${z}`)},Symbol.asyncIterator)](){let Z=[],$=[],J=!1;return this.on("streamEvent",(z)=>{let Y=$.shift();if(Y)Y.resolve(z);else Z.push(z)}),this.on("end",()=>{J=!0;for(let z of $)z.resolve(void 0);$.length=0}),this.on("abort",(z)=>{J=!0;for(let Y of $)Y.reject(z);$.length=0}),this.on("error",(z)=>{J=!0;for(let Y of $)Y.reject(z);$.length=0}),{next:async()=>{if(!Z.length){if(J)return{value:void 0,done:!0};return new Promise((Y,K)=>$.push({resolve:Y,reject:K})).then((Y)=>Y?{value:Y,done:!1}:{value:void 0,done:!0})}return{value:Z.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new jZ(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return X})()});var W7=1e5,G7=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
10
|
+
1. Task Overview
|
|
11
|
+
The user's core request and success criteria
|
|
12
|
+
Any clarifications or constraints they specified
|
|
13
|
+
2. Current State
|
|
14
|
+
What has been completed so far
|
|
15
|
+
Files created, modified, or analyzed (with paths if relevant)
|
|
16
|
+
Key outputs or artifacts produced
|
|
17
|
+
3. Important Discoveries
|
|
18
|
+
Technical constraints or requirements uncovered
|
|
19
|
+
Decisions made and their rationale
|
|
20
|
+
Errors encountered and how they were resolved
|
|
21
|
+
What approaches were tried that didn't work (and why)
|
|
22
|
+
4. Next Steps
|
|
23
|
+
Specific actions needed to complete the task
|
|
24
|
+
Any blockers or open questions to resolve
|
|
25
|
+
Priority order if multiple steps remain
|
|
26
|
+
5. Context to Preserve
|
|
27
|
+
User preferences or style requirements
|
|
28
|
+
Domain-specific details that aren't obvious
|
|
29
|
+
Any promises made to the user
|
|
30
|
+
Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
|
|
31
|
+
Wrap your summary in <summary></summary> tags.`;var U7=()=>{};function O7(X){if("compaction"in X&&X.compaction!=null)throw new F("`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 G4(X){if(X.context_management?.edits?.some((Z)=>Z.type.startsWith("compact_")))throw new F("`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 CJ(X){let{context_management:Z,stop_sequences:$,output_format:J,...z}=X,Y=({format:K,...N})=>N;if(z.tool_choice?.type==="any"||z.tool_choice?.type==="tool")delete z.tool_choice;if(z.output_config)z.output_config=Y(z.output_config);if(Array.isArray(z.fallbacks))z.fallbacks=z.fallbacks.map((K)=>K.output_config?{...K,output_config:Y(K.output_config)}:K);return z}async function TJ(X,Z,$,J){if(!$||$.role!=="assistant"||!$.content||typeof $.content==="string")return null;let z=$.content.filter((K)=>K.type==="tool_use");if(z.length===0)return null;return{role:"user",content:await Promise.all(z.map(async(K)=>{let N=Z.has(K.name)?X.get(K.name):void 0;if(!N)return MJ(K);try{let W=K.input;if("parse"in N&&N.parse)W=N.parse(W);let U=await N.run(W,{toolUse:K,toolUseBlock:K,signal:J?.signal});return{type:"tool_result",tool_use_id:K.id,content:U}}catch(W){return{type:"tool_result",tool_use_id:K.id,content:W instanceof J0?W.content:`Error: ${W instanceof Error?W.message:String(W)}`,is_error:!0}}}))}}function C7(X){return X}function MJ(X){return{type:"tool_result",tool_use_id:X.id,content:`Error: Tool '${X.name}' not found`,is_error:!0}}function T7(X,Z){switch(X.type){case"tool_removal":case"tool_addition":xJ(X,Z);break}}function xJ(X,Z){let $=HJ(X.tool);if($===void 0)return;if(X.type==="tool_removal")Z.delete($);else Z.add($)}function HJ(X){switch(X.type){case"tool_reference":return X.name;case"tool_definition":return"name"in X.definition?X.definition.name:void 0;default:return}}function M7(X){if(X===null)return"stop";switch(X){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 kZ(X),"stop"}}var l,L0,sZ,v,zZ,ZZ,eZ,wZ,cZ,I8,WZ,Z0,j0,$0,q7,z4,Y4,TX,Q4,K4,V4,N4,B7,W4,U4;var x7=T(()=>{YZ();K$();u();D();G6();$Z();LZ();U7();RZ();U4=(()=>{class X{constructor(Z,$,J){l.add(this),this.client=Z,L0.set(this,!1),sZ.set(this,!1),v.set(this,void 0),zZ.set(this,void 0),ZZ.set(this,void 0),eZ.set(this,void 0),wZ.set(this,void 0),cZ.set(this,void 0),I8.set(this,0),WZ.set(this,{status:"idle"}),Z0.set(this,null),j0.set(this,new Map),$0.set(this,[]),O7($),q(this,v,{params:{...$,messages:JSON.parse(JSON.stringify($.messages))}},"f");let z=A1($.tools,$.messages);if(q(this,zZ,{...J,headers:V([J8("BetaToolRunner"),z.length?{[f$]:z.join(", ")}:void 0,J?.headers])},"f"),q(this,cZ,_X(),"f"),$.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(L0=new WeakMap,sZ=new WeakMap,v=new WeakMap,zZ=new WeakMap,ZZ=new WeakMap,eZ=new WeakMap,wZ=new WeakMap,cZ=new WeakMap,I8=new WeakMap,WZ=new WeakMap,Z0=new WeakMap,j0=new WeakMap,$0=new WeakMap,l=new WeakSet,q7=async function(){let $=Q(this,v,"f").params.compactionControl;if(!$||!$.enabled)return!1;let J=0;if(Q(this,ZZ,"f")!==void 0)try{let U=await Q(this,ZZ,"f");J=U.usage.input_tokens+(U.usage.cache_creation_input_tokens??0)+(U.usage.cache_read_input_tokens??0)+U.usage.output_tokens}catch{return!1}let z=$.contextTokenThreshold??W7;if(J<z)return!1;let Y=$.model??Q(this,v,"f").params.model,K=$.summaryPrompt??G7,N=Q(this,v,"f").params.messages;if(N[N.length-1].role==="assistant"){let U=N[N.length-1];if(Array.isArray(U.content)){let x=U.content.filter((B)=>B.type!=="tool_use");if(x.length===0)N.pop();else U.content=x}}let W=await this.client.beta.messages.create({model:Y,messages:[...N,{role:"user",content:[{type:"text",text:K}]}],max_tokens:Q(this,v,"f").params.max_tokens},{signal:Q(this,zZ,"f").signal,headers:V([Q(this,zZ,"f").headers,J8("compaction")])});if(W.content[0]?.type!=="text")throw new F("Expected text response for compaction");return Q(this,l,"m",K4).call(this),q(this,Z0,null,"f"),Q(this,v,"f").params.messages=[{role:"user",content:C7(W.content)}],!0},Symbol.asyncIterator)](){var Z;if(Q(this,L0,"f"))throw new F("Cannot iterate over a consumed stream");q(this,L0,!0,"f"),q(this,sZ,!0,"f"),q(this,wZ,void 0,"f");try{while(!0)try{if(Q(this,v,"f").params.max_iterations&&Q(this,I8,"f")>=Q(this,v,"f").params.max_iterations)break;if(Q(this,l,"m",B7).call(this),Q(this,WZ,"f").status==="scheduled"&&M7(Q(this,Z0,"f"))!=="resume"){yield*Q(this,l,"m",Y4).call(this,Q(this,WZ,"f").config);continue}q(this,sZ,!1,"f"),q(this,wZ,void 0,"f"),q(this,I8,(Z=Q(this,I8,"f"),Z++,Z),"f"),q(this,ZZ,void 0,"f");let{max_iterations:$,compactionControl:J,...z}=Q(this,v,"f").params;if(yield*Q(this,l,"m",z4).call(this,z),!await Q(this,l,"m",q7).call(this)){if(!Q(this,sZ,"f")){let N=await Q(this,ZZ,"f"),W=M7(N.stop_reason);q(this,Z0,N.stop_reason,"f"),Q(this,v,"f").params.messages.push({role:N.role,content:C7(N.content)});let{container:U}=Q(this,v,"f").params;if(N.container){if(U==null)Q(this,v,"f").params.container=N.container.id;else if(typeof U==="object"&&U.id==null)Q(this,v,"f").params.container={...U,id:N.container.id}}if(W==="stop"){yield*Q(this,l,"m",V4).call(this);break}if(W==="resume")continue}else q(this,Z0,null,"f");let K=await Q(this,l,"m",N4).call(this,Q(this,v,"f").params.messages.at(-1));if(K)Q(this,v,"f").params.messages.push(K);else if(!Q(this,sZ,"f")){yield*Q(this,l,"m",V4).call(this);break}}}finally{Q(this,eZ,"f")?.abort(),q(this,eZ,void 0,"f")}if(!Q(this,ZZ,"f"))throw new F("ToolRunner concluded without a message from the server");Q(this,cZ,"f").resolve(await Q(this,ZZ,"f"))}catch($){throw q(this,L0,!1,"f"),Q(this,cZ,"f").promise.catch(()=>{}),Q(this,cZ,"f").reject($),q(this,cZ,_X(),"f"),$}}setMessagesParams(Z){let $=typeof Z==="function"?Z(Q(this,v,"f").params):Z;if(O7($),Q(this,WZ,"f").status!=="idle")G4($);if(Q(this,WZ,"f").status==="in_flight"&&$.messages!==Q(this,v,"f").params.messages)throw new F("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.");Q(this,v,"f").params=$,q(this,sZ,!0,"f"),q(this,wZ,void 0,"f")}setRequestOptions(Z){if(typeof Z==="function")q(this,zZ,Z(Q(this,zZ,"f")),"f");else q(this,zZ,{...Q(this,zZ,"f"),...Z},"f")}async generateToolResponse(Z=Q(this,zZ,"f").signal){let $=await Q(this,ZZ,"f")??this.params.messages.at(-1);if(!$)return null;return Q(this,l,"m",N4).call(this,$,Z)}done(){return Q(this,cZ,"f").promise}async runUntilDone(){if(!Q(this,L0,"f"))for await(let Z of this);return this.done()}get params(){return Q(this,v,"f").params}pushMessages(...Z){this.setMessagesParams(($)=>({...$,messages:[...$.messages,...Z]}))}compactBeforeNextTurn(Z){if(Q(this,WZ,"f").status==="in_flight")return;G4(Q(this,v,"f").params),q(this,WZ,{status:"scheduled",config:Z??{type:"summarize"}},"f")}addTools(...Z){for(let $ of Z){if("name"in $)Q(this,j0,"f").set($.name,"run"in $?$:null);Q(this,$0,"f").push({type:"addition",tool:$})}}removeTools(...Z){for(let $ of Z){let J=typeof $==="string"?$:$.name;Q(this,j0,"f").set(J,null),Q(this,$0,"f").push({type:"removal",name:J})}}then(Z,$){return this.runUntilDone().then(Z,$)}}return z4=async function*($){if($.stream)q(this,eZ,this.client.beta.messages.stream({...$},Q(this,zZ,"f")),"f"),q(this,ZZ,Q(this,eZ,"f").finalMessage(),"f"),Q(this,ZZ,"f").catch(()=>{}),yield Q(this,eZ,"f");else q(this,ZZ,this.client.beta.messages.create({...$,stream:!1},Q(this,zZ,"f")),"f"),yield Q(this,ZZ,"f")},Y4=async function*($){G4(Q(this,v,"f").params);let{max_iterations:J,compactionControl:z,...Y}=Q(this,v,"f").params,K=CJ(Y);q(this,WZ,{status:"in_flight"},"f"),q(this,wZ,void 0,"f");let N=Q(this,ZZ,"f");try{yield*Q(this,l,"m",z4).call(this,{...K,compaction:$});let W=await Q(this,ZZ,"f");if(W.content.some((U)=>U.type==="compaction"&&U.content))Q(this,l,"m",K4).call(this),Q(this,v,"f").params.messages=[{role:W.role,content:W.content}];else h(this.client).warn("Compaction produced no summary; keeping the conversation as it is."),q(this,ZZ,N,"f")}finally{q(this,WZ,{status:"idle"},"f")}},TX=function(){let $=new Map;for(let J of Q(this,v,"f").params.tools)if("run"in J)$.set(J.name,J);for(let[J,z]of Q(this,j0,"f"))if(z)$.set(J,z);else $.delete(J);return $},Q4=function(){let $=new Set(Q(this,l,"m",TX).call(this).keys());for(let J of[...Q(this,v,"f").params.messages,Q(this,l,"m",W4).call(this)]){if(typeof J.content==="string")continue;for(let z of J.content)if(J.role==="system")T7(z,$);else if(J.role==="assistant"&&z.type==="compaction")for(let Y of z.tool_changes??[])T7(Y,$)}return $},K4=function(){let $=Q(this,l,"m",Q4).call(this);for(let J of Q(this,l,"m",TX).call(this).keys())if(!$.has(J))Q(this,j0,"f").set(J,null)},V4=async function*(){if(Q(this,WZ,"f").status!=="scheduled")return;let $=Q(this,v,"f").params.messages.at(-1)?.content;if(Array.isArray($)&&$.some((J)=>J.type==="tool_use")){h(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."),q(this,WZ,{status:"idle"},"f");return}yield*Q(this,l,"m",Y4).call(this,Q(this,WZ,"f").config)},N4=async function($,J=Q(this,zZ,"f").signal){if(Q(this,wZ,"f")!==void 0)return Q(this,wZ,"f");return q(this,wZ,TJ(Q(this,l,"m",TX).call(this),Q(this,l,"m",Q4).call(this),$,{...Q(this,zZ,"f"),signal:J}),"f"),Q(this,wZ,"f")},B7=function(){if(Q(this,Z0,"f")==="pause_turn"||Q(this,$0,"f").length===0)return;Q(this,v,"f").params.messages.push(Q(this,l,"m",W4).call(this)),q(this,$0,[],"f")},W4=function(){let $=[];for(let J of Q(this,$0,"f")){if(J.type==="removal"){$.push({type:"tool_removal",tool:{type:"tool_reference",name:J.name}});continue}let z=J.tool;if("run"in J.tool){let{run:Y,parse:K,close:N,...W}=J.tool;z=W}$.push({type:"tool_addition",tool:{type:"tool_definition",definition:z}})}return{role:"system",content:$}},X})()});function F7(X){if(!X.output_format)return X;if(X.output_config?.format)throw new F("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:Z,...$}=X;return{...$,output_config:{...X.output_config,format:Z}}}var H7,FJ,MX;var q4=T(()=>{A0();p1();L();i1();D();RZ();r1();N7();x7();K$();p1();H7={},FJ=["claude-mythos-preview","claude-opus-4-6"],MX=(()=>{class X extends M{constructor(){super(...arguments);this.batches=new S8(this._client)}create(Z,$){let J=F7(Z),{betas:z,user_profile_id:Y,workspace_id:K,...N}=J;if(N.model in H7)console.warn(`The model '${N.model}' is deprecated and will reach end-of-life on ${H7[N.model]}
|
|
32
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(FJ.includes(N.model)&&N.thinking&&N.thinking.type==="enabled")console.warn(`Using Claude with ${N.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 W=$?.timeout??this._client._options.timeout;if(!N.stream&&W==null){let x=VX[N.model]??void 0;W=this._client.calculateNonstreamingTimeout(N.max_tokens,x)}let U=k$(N.tools,N.messages);return this._client.post("/v1/messages?beta=true",{body:N,timeout:W??600000,...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-user-profile-id":Y}:void 0,...K!=null?{"anthropic-workspace-id":K}:void 0},U,$?.headers]),stream:J.stream??!1})}parse(Z,$){return $={...$,headers:V([{"anthropic-beta":[...Z.betas??[],"structured-outputs-2025-12-15"].toString()},$?.headers])},this.create(Z,$).then((J)=>a1(J,Z,{logger:this._client.logger??console}))}stream(Z,$){return V7.createMessage(this,Z,$)}countTokens(Z,$){let J=F7(Z),{betas:z,user_profile_id:Y,workspace_id:K,...N}=J;return this._client.post("/v1/messages/count_tokens?beta=true",{body:N,...$,headers:V([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString(),...Y!=null?{"anthropic-user-profile-id":Y}:void 0,...K!=null?{"anthropic-workspace-id":K}:void 0},$?.headers])})}toolRunner(Z,$){return new U4(this._client,Z,$)}}return X.Batches=S8,X.BetaToolRunner=U4,X.ToolError=J0,X})()});var f8;var B4=T(()=>{L();w();f();f8=class f8 extends M{retrieve(X,Z){return this._client.get(G`/v1/organizations/api_keys/${X}?beta=true`,Z)}update(X,Z,$){return this._client.post(G`/v1/organizations/api_keys/${X}?beta=true`,{body:Z,...$})}list(X={},Z){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",r,{query:X,...Z})}}});var y8;var O4=T(()=>{L();y8=class y8 extends M{retrieve(X){return this._client.get("/v1/organizations/compliance_settings?beta=true",X)}update(X,Z){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:X,...Z})}}});var k8;var C4=T(()=>{L();w();f();k8=class k8 extends M{create(X,Z){return this._client.post("/v1/organizations/external_keys?beta=true",{body:X,...Z})}retrieve(X,Z){return this._client.get(G`/v1/organizations/external_keys/${X}?beta=true`,Z)}update(X,Z,$){return this._client.post(G`/v1/organizations/external_keys/${X}?beta=true`,{body:Z,...$})}list(X={},Z){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",S,{query:X,...Z})}delete(X,Z){return this._client.delete(G`/v1/organizations/external_keys/${X}?beta=true`,Z)}validate(X,Z){return this._client.post(G`/v1/organizations/external_keys/${X}/validate?beta=true`,Z)}}});var h8;var T4=T(()=>{L();w();f();h8=class h8 extends M{create(X,Z){return this._client.post("/v1/organizations/invites?beta=true",{body:X,...Z})}retrieve(X,Z){return this._client.get(G`/v1/organizations/invites/${X}?beta=true`,Z)}list(X={},Z){return this._client.getAPIList("/v1/organizations/invites?beta=true",r,{query:X,...Z})}delete(X,Z){return this._client.delete(G`/v1/organizations/invites/${X}?beta=true`,Z)}}});var b8;var M4=T(()=>{L();w();b8=class b8 extends M{list(X={},Z){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",S,{query:X,...Z})}}});var g8;var x4=T(()=>{L();w();f();g8=class g8 extends M{retrieve(X,Z){return this._client.get(G`/v1/organizations/users/${X}?beta=true`,Z)}update(X,Z,$){return this._client.post(G`/v1/organizations/users/${X}?beta=true`,{body:Z,...$})}list(X={},Z){return this._client.getAPIList("/v1/organizations/users?beta=true",r,{query:X,...Z})}remove(X,Z){return this._client.delete(G`/v1/organizations/users/${X}?beta=true`,Z)}}});var v8;var H4=T(()=>{L();w();D();f();v8=class v8 extends M{create(X,Z){let{betas:$,...J}=X;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:J,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{betas:J}=Z??{};return this._client.get(G`/v1/organizations/federation_issuers/${X}?beta=true`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}update(X,Z,$){let{betas:J,...z}=Z;return this._client.post(G`/v1/organizations/federation_issuers/${X}?beta=true`,{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}list(X={},Z){let{betas:$,...J}=X??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",S,{query:J,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0},Z?.headers])})}archive(X,Z={},$){let{betas:J}=Z??{};return this._client.post(G`/v1/organizations/federation_issuers/${X}/archive?beta=true`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}}});var _8;var F4=T(()=>{L();w();D();f();_8=class _8 extends M{list(X,Z={},$){let{betas:J,...z}=Z??{};return this._client.getAPIList(G`/v1/organizations/federation_rules/${X}/workspaces?beta=true`,S,{query:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}add(X,Z,$){let{betas:J,...z}=Z;return this._client.post(G`/v1/organizations/federation_rules/${X}/workspaces?beta=true`,{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}remove(X,Z,$){let{federation_rule_id:J,betas:z}=Z;return this._client.delete(G`/v1/organizations/federation_rules/${J}/workspaces/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},$?.headers])})}}});var xX;var A4=T(()=>{L();F4();F4();w();D();f();xX=(()=>{class X extends M{constructor(){super(...arguments);this.workspaces=new _8(this._client)}create(Z,$){let{betas:J,...z}=Z;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z}=$??{};return this._client.get(G`/v1/organizations/federation_rules/${Z}?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,...Y}=$;return this._client.post(G`/v1/organizations/federation_rules/${Z}?beta=true`,{body:Y,...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}list(Z={},$){let{betas:J,...z}=Z??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",S,{query:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}archive(Z,$={},J){let{betas:z}=$??{};return this._client.post(G`/v1/organizations/federation_rules/${Z}/archive?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}}return X.Workspaces=_8,X})()});var HX;var S4=T(()=>{L();H4();H4();A4();A4();HX=(()=>{class X extends M{constructor(){super(...arguments);this.issuers=new v8(this._client),this.rules=new xX(this._client)}}return X.Issuers=v8,X.Rules=xX,X})()});var m8;var E4=T(()=>{L();w();D();f();m8=class m8 extends M{list(X,Z={},$){let{betas:J,...z}=Z??{};return this._client.getAPIList(G`/v1/organizations/service_accounts/${X}/workspaces?beta=true`,S,{query:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}add(X,Z,$){let{betas:J,...z}=Z;return this._client.post(G`/v1/organizations/service_accounts/${X}/workspaces?beta=true`,{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}remove(X,Z,$){let{service_account_id:J,betas:z}=Z;return this._client.delete(G`/v1/organizations/service_accounts/${J}/workspaces/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},$?.headers])})}}});var FX;var L4=T(()=>{L();E4();E4();w();D();f();FX=(()=>{class X extends M{constructor(){super(...arguments);this.workspaces=new m8(this._client)}create(Z,$){let{betas:J,...z}=Z;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z}=$??{};return this._client.get(G`/v1/organizations/service_accounts/${Z}?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,...Y}=$;return this._client.post(G`/v1/organizations/service_accounts/${Z}?beta=true`,{body:Y,...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}list(Z={},$){let{betas:J,...z}=Z??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",S,{query:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}archive(Z,$={},J){let{betas:z}=$??{};return this._client.post(G`/v1/organizations/service_accounts/${Z}/archive?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},J?.headers])})}}return X.Workspaces=m8,X})()});var u8;var j4=T(()=>{L();w();f();u8=class u8 extends M{retrieve(X,Z,$){let{workspace_id:J}=Z;return this._client.get(G`/v1/organizations/workspaces/${J}/members/${X}?beta=true`,$)}update(X,Z,$){let{workspace_id:J,...z}=Z;return this._client.post(G`/v1/organizations/workspaces/${J}/members/${X}?beta=true`,{body:z,...$})}list(X,Z={},$){return this._client.getAPIList(G`/v1/organizations/workspaces/${X}/members?beta=true`,r,{query:Z,...$})}add(X,Z,$){return this._client.post(G`/v1/organizations/workspaces/${X}/members?beta=true`,{body:Z,...$})}remove(X,Z,$){let{workspace_id:J}=Z;return this._client.delete(G`/v1/organizations/workspaces/${J}/members/${X}?beta=true`,$)}}});var c8;var R4=T(()=>{L();w();f();c8=class c8 extends M{list(X,Z={},$){return this._client.getAPIList(G`/v1/organizations/workspaces/${X}/rate_limits?beta=true`,S,{query:Z,...$})}}});var d8;var D4=T(()=>{L();w();D();f();d8=class d8 extends M{retrieve(X,Z,$){let{workspace_id:J,betas:z}=Z;return this._client.get(G`/v1/organizations/workspaces/${J}/service_accounts/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},$?.headers])})}update(X,Z,$){let{workspace_id:J,betas:z,...Y}=Z;return this._client.post(G`/v1/organizations/workspaces/${J}/service_accounts/${X}?beta=true`,{body:Y,...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,...z}=Z??{};return this._client.getAPIList(G`/v1/organizations/workspaces/${X}/service_accounts?beta=true`,S,{query:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}add(X,Z,$){let{betas:J,...z}=Z;return this._client.post(G`/v1/organizations/workspaces/${X}/service_accounts?beta=true`,{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}remove(X,Z,$){let{workspace_id:J,betas:z}=Z;return this._client.delete(G`/v1/organizations/workspaces/${J}/service_accounts/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},$?.headers])})}}});var AX;var w4=T(()=>{L();j4();j4();R4();R4();D4();D4();w();D();f();AX=(()=>{class X extends M{constructor(){super(...arguments);this.rateLimits=new c8(this._client),this.members=new u8(this._client),this.serviceAccounts=new d8(this._client)}create(Z,$){let{betas:J,...z}=Z;return this._client.post("/v1/organizations/workspaces?beta=true",{body:z,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},$?.headers])})}retrieve(Z,$){return this._client.get(G`/v1/organizations/workspaces/${Z}?beta=true`,$)}update(Z,$,J){return this._client.post(G`/v1/organizations/workspaces/${Z}?beta=true`,{body:$,...J})}list(Z={},$){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",r,{query:Z,...$})}archive(Z,$){return this._client.post(G`/v1/organizations/workspaces/${Z}/archive?beta=true`,$)}}return X.RateLimits=c8,X.Members=u8,X.ServiceAccounts=d8,X})()});var SX;var P4=T(()=>{L();B4();B4();O4();O4();C4();C4();T4();T4();M4();M4();x4();x4();S4();S4();L4();L4();w4();w4();SX=(()=>{class X extends M{constructor(){super(...arguments);this.apiKeys=new f8(this._client),this.externalKeys=new k8(this._client),this.federation=new HX(this._client),this.invites=new h8(this._client),this.serviceAccounts=new FX(this._client),this.users=new g8(this._client),this.workspaces=new AX(this._client),this.rateLimits=new b8(this._client),this.complianceSettings=new y8(this._client)}retrieve(Z){return this._client.get("/v1/organizations/me?beta=true",Z)}}return X.APIKeys=f8,X.ExternalKeys=k8,X.Federation=HX,X.Invites=h8,X.ServiceAccounts=FX,X.Users=g8,X.Workspaces=AX,X.RateLimits=b8,X.ComplianceSettings=y8,X})()});var EX;var I4=T(()=>{L();w();D();f();b1();EX=(()=>{class X extends M{list(Z,$={},J){let{betas:z,workspace_id:Y,...K}=$??{};return this._client.getAPIList(G`/v1/sessions/${Z}/events?beta=true`,S,{query:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}send(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/sessions/${Z}/events?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}stream(Z,$={},J){let{betas:z,workspace_id:Y,...K}=$??{};return this._client.get(G`/v1/sessions/${Z}/events/stream?beta=true`,{query:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers]),stream:!0})}toolRunner(Z,$){return new M8(Z,{...$,client:this._client})}}return X.SessionToolRunner=M8,X})()});var l8;var f4=T(()=>{L();w();D();f();l8=class l8 extends M{retrieve(X,Z,$){let{session_id:J,betas:z,workspace_id:Y}=Z;return this._client.get(G`/v1/sessions/${J}/resources/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}update(X,Z,$){let{session_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.post(G`/v1/sessions/${J}/resources/${X}?beta=true`,{body:K,...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/sessions/${X}/resources?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(X,Z,$){let{session_id:J,betas:z,workspace_id:Y}=Z;return this._client.delete(G`/v1/sessions/${J}/resources/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}add(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/sessions/${X}/resources?beta=true`,{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});var p8;var y4=T(()=>{L();w();D();f();p8=class p8 extends M{list(X,Z,$){let{session_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.getAPIList(G`/v1/sessions/${J}/threads/${X}/events?beta=true`,S,{query:K,...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}stream(X,Z,$){let{session_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.get(G`/v1/sessions/${J}/threads/${X}/stream?beta=true`,{query:K,...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers]),stream:!0})}}});var LX;var k4=T(()=>{L();y4();y4();w();D();f();LX=(()=>{class X extends M{constructor(){super(...arguments);this.events=new p8(this._client)}retrieve(Z,$,J){let{session_id:z,betas:Y,workspace_id:K}=$;return this._client.get(G`/v1/sessions/${z}/threads/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},J?.headers])})}list(Z,$={},J){let{betas:z,workspace_id:Y,...K}=$??{};return this._client.getAPIList(G`/v1/sessions/${Z}/threads?beta=true`,S,{query:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}archive(Z,$,J){let{session_id:z,betas:Y,workspace_id:K}=$;return this._client.post(G`/v1/sessions/${z}/threads/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...Y??[],"managed-agents-2026-04-01"].toString(),...K!=null?{"anthropic-workspace-id":K}:void 0},J?.headers])})}}return X.Events=p8,X})()});var jX;var h4=T(()=>{L();I4();I4();f4();f4();k4();k4();w();D();f();jX=(()=>{class X extends M{constructor(){super(...arguments);this.events=new EX(this._client),this.resources=new l8(this._client),this.threads=new LX(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/sessions?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/sessions/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/sessions/${Z}?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/sessions?beta=true",q1,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.delete(G`/v1/sessions/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/sessions/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Events=EX,X.Resources=l8,X.Threads=LX,X})()});var i8;var b4=T(()=>{L();w();D();fZ();f();i8=class i8 extends M{create(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/skills/${X}/versions?beta=true`,qZ({body:Y,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])},this._client,!1))}retrieve(X,Z,$){let{skill_id:J,betas:z,workspace_id:Y}=Z;return this._client.get(G`/v1/skills/${J}/versions/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/skills/${X}/versions?beta=true`,S,{query:Y,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(X,Z,$){let{skill_id:J,betas:z,workspace_id:Y}=Z;return this._client.delete(G`/v1/skills/${J}/versions/${X}?beta=true`,{...$,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}download(X,Z,$){let{skill_id:J,betas:z,workspace_id:Y}=Z;return this._client.get(G`/v1/skills/${J}/versions/${X}/content?beta=true`,{...$,headers:V([{Accept:"application/binary",...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers]),__binaryResponse:!0})}}});var RX;var g4=T(()=>{L();b4();b4();w();D();fZ();f();RX=(()=>{class X extends M{constructor(){super(...arguments);this.versions=new i8(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/skills?beta=true",qZ({body:Y,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])},this._client,!1))}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/skills/${Z}?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/skills?beta=true",S,{query:Y,...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.delete(G`/v1/skills/${Z}?beta=true`,{...J,headers:V([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0,...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Versions=i8,X})()});var n8;var v4=T(()=>{L();w();D();f();n8=class n8 extends M{create(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/tunnels/${X}/certificates?beta=true`,{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"mcp-tunnels-2026-06-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(X,Z,$){let{tunnel_id:J,betas:z,workspace_id:Y}=Z;return this._client.get(G`/v1/tunnels/${J}/certificates/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/tunnels/${X}/certificates?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"mcp-tunnels-2026-06-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}archive(X,Z,$){let{tunnel_id:J,betas:z,workspace_id:Y}=Z;return this._client.post(G`/v1/tunnels/${J}/certificates/${X}/archive?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}}});var DX;var _4=T(()=>{L();v4();v4();w();D();f();DX=(()=>{class X extends M{constructor(){super(...arguments);this.certificates=new n8(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/tunnels?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"mcp-tunnels-2026-06-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/tunnels/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/tunnels?beta=true",S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"mcp-tunnels-2026-06-22"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/tunnels/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}revealToken(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/tunnels/${Z}/reveal_token?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}rotateToken(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/tunnels/${Z}/rotate_token?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"mcp-tunnels-2026-06-22"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Certificates=n8,X})()});var a8;var m4=T(()=>{L();w();D();f();a8=class a8 extends M{create(X,Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post(G`/v1/vaults/${X}/credentials?beta=true`,{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(X,Z,$){let{vault_id:J,betas:z,workspace_id:Y}=Z;return this._client.get(G`/v1/vaults/${J}/credentials/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}update(X,Z,$){let{vault_id:J,betas:z,workspace_id:Y,...K}=Z;return this._client.post(G`/v1/vaults/${J}/credentials/${X}?beta=true`,{body:K,...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}list(X,Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList(G`/v1/vaults/${X}/credentials?beta=true`,S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(X,Z,$){let{vault_id:J,betas:z,workspace_id:Y}=Z;return this._client.delete(G`/v1/vaults/${J}/credentials/${X}?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}archive(X,Z,$){let{vault_id:J,betas:z,workspace_id:Y}=Z;return this._client.post(G`/v1/vaults/${J}/credentials/${X}/archive?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}mcpOAuthValidate(X,Z,$){let{vault_id:J,betas:z,workspace_id:Y}=Z;return this._client.post(G`/v1/vaults/${J}/credentials/${X}/mcp_oauth_validate?beta=true`,{...$,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},$?.headers])})}}});var wX;var u4=T(()=>{L();m4();m4();w();D();f();wX=(()=>{class X extends M{constructor(){super(...arguments);this.credentials=new a8(this._client)}create(Z,$){let{betas:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/vaults?beta=true",{body:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}retrieve(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.get(G`/v1/vaults/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}update(Z,$,J){let{betas:z,workspace_id:Y,...K}=$;return this._client.post(G`/v1/vaults/${Z}?beta=true`,{body:K,...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}list(Z={},$){let{betas:J,workspace_id:z,...Y}=Z??{};return this._client.getAPIList("/v1/vaults?beta=true",S,{query:Y,...$,headers:V([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString(),...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}delete(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.delete(G`/v1/vaults/${Z}?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}archive(Z,$={},J){let{betas:z,workspace_id:Y}=$??{};return this._client.post(G`/v1/vaults/${Z}/archive?beta=true`,{...J,headers:V([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString(),...Y!=null?{"anthropic-workspace-id":Y}:void 0},J?.headers])})}}return X.Credentials=a8,X})()});var r8;var c4=T(()=>{L();x1();x1();H1();H1();F1();F1();S1();S1();E1();E1();L1();L1();D1();D1();P1();P1();m1();m1();d1();d1();q4();q4();P4();P4();h4();h4();g4();g4();_4();_4();u4();u4();r8=(()=>{class X extends M{constructor(){super(...arguments);this.models=new Y8(this._client),this.messages=new MX(this._client),this.agents=new v$(this._client),this.environments=new YX(this._client),this.sessions=new jX(this._client),this.deployments=new Z8(this._client),this.deploymentRuns=new e0(this._client),this.vaults=new wX(this._client),this.memoryStores=new QX(this._client),this.files=new z8(this._client),this.skills=new RX(this._client),this.webhooks=new N8(this._client),this.userProfiles=new Q8(this._client),this.dreams=new $8(this._client),this.tunnels=new DX(this._client),this.organization=new SX(this._client)}}return X.Models=Y8,X.Messages=MX,X.Agents=v$,X.Environments=YX,X.Sessions=jX,X.Deployments=Z8,X.DeploymentRuns=e0,X.Vaults=wX,X.MemoryStores=QX,X.Files=z8,X.Skills=RX,X.Webhooks=N8,X.UserProfiles=Q8,X.Dreams=$8,X.Tunnels=DX,X.Organization=SX,X})()});var R0;var d4=T(()=>{L();D();R0=class R0 extends M{create(X,Z){let{betas:$,workspace_id:J,...z}=X;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers]),stream:X.stream??!1})}}});var D0;var l4=T(()=>{L();w();D();RZ();fZ();f();D0=class D0 extends M{list(X={},Z){let{workspace_id:$,...J}=X??{};return this._client.getAPIList("/v1/files",S,{query:J,...Z,headers:V([{...$!=null?{"anthropic-workspace-id":$}:void 0},Z?.headers])})}delete(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.delete(G`/v1/files/${X}`,{...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}download(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.get(G`/v1/files/${X}/content`,{...$,headers:V([{Accept:"application/binary",...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers]),__binaryResponse:!0})}retrieveMetadata(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.get(G`/v1/files/${X}`,{...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}upload(X,Z){let{workspace_id:$,...J}=X;return this._client.post("/v1/files",qZ({body:J,...Z,headers:V([{...$!=null?{"anthropic-workspace-id":$}:void 0},h$(J.file),Z?.headers])},this._client))}}});function A7(X){return X?.output_config?.format}function p4(X,Z,$){let J=A7(Z);if(!Z||!("parse"in(J??{})))return{...X,content:X.content.map((z)=>{if(z.type==="text")return Object.defineProperty({...z},"parsed_output",{value:null,enumerable:!1});return z}),parsed_output:null};return i4(X,Z,$)}function i4(X,Z,$){let J=null,z=X.content.map((Y)=>{if(Y.type==="text"){let K=oJ(Z,Y.text);if(J===null)J=K;return Object.defineProperty({...Y},"parsed_output",{value:K,enumerable:!1})}return Y});return{...X,content:z,parsed_output:J}}function oJ(X,Z){let $=A7(X);if($?.type!=="json_schema")return null;try{if("parse"in $)return $.parse(Z);return JSON.parse(Z)}catch(J){throw new F(`Failed to parse structured output: ${J}`)}}var n4=T(()=>{u()});function e4(X){return X.type==="tool_use"||X.type==="server_tool_use"}var CZ,dZ,w0,t8,PX,o8,s8,IX,e8,PZ,Z$,fX,yX,X0,kX,hX,bX,$$,a4,S7,r4,t4,o4,s4,E7,L7;var j7=T(()=>{YZ();RZ();iZ();$Z();A0();t1();n4();o1();L7=(()=>{class X{constructor(Z,$){CZ.add(this),this.messages=[],this.receivedMessages=[],dZ.set(this,void 0),w0.set(this,null),this.controller=new AbortController,t8.set(this,void 0),PX.set(this,()=>{}),o8.set(this,()=>{}),s8.set(this,void 0),IX.set(this,()=>{}),e8.set(this,()=>{}),PZ.set(this,{}),Z$.set(this,!1),fX.set(this,!1),yX.set(this,!1),X0.set(this,!1),kX.set(this,void 0),hX.set(this,void 0),bX.set(this,void 0),$$.set(this,void 0),r4.set(this,(J)=>{if(q(this,fX,!0,"f"),TZ(J))J=new s;if(J instanceof s)return q(this,yX,!0,"f"),this._emit("abort",J);if(J instanceof F)return this._emit("error",J);if(J instanceof Error){let z=new F(J.message);return z.cause=J,this._emit("error",z)}return this._emit("error",new F(String(J)))}),q(this,t8,new Promise((J,z)=>{q(this,PX,J,"f"),q(this,o8,z,"f")}),"f"),q(this,s8,new Promise((J,z)=>{q(this,IX,J,"f"),q(this,e8,z,"f")}),"f"),Q(this,t8,"f").catch(()=>{}),Q(this,s8,"f").catch(()=>{}),q(this,w0,Z,"f"),q(this,$$,$?.logger??console,"f")}get response(){return Q(this,kX,"f")}get request_id(){return Q(this,hX,"f")}get workspace_id(){return Q(this,bX,"f")}async withResponse(){q(this,X0,!0,"f");let Z=await Q(this,t8,"f");if(!Z)throw Error("Could not resolve a `Response` object");return{data:this,response:Z,request_id:Z.headers.get("request-id"),workspace_id:Z.headers.get("anthropic-workspace-id")}}static fromReadableStream(Z){let $=new X(null);return $._run(()=>$._fromReadableStream(Z)),$}static createMessage(Z,$,J,{logger:z}={}){let Y=new X($,{logger:z});for(let K of $.messages)Y._addMessageParam(K);return q(Y,w0,{...$,stream:!0},"f"),Y._run(()=>Y._createMessage(Z,{...$,stream:!0},{...J,headers:{...J?.headers,[y$]:"stream"}})),Y}_run(Z){Z().then(()=>{this._emitFinal(),this._emit("end")},Q(this,r4,"f"))}_addMessageParam(Z){this.messages.push(Z)}_addMessage(Z,$=!0){if(this.receivedMessages.push(Z),$)this._emit("message",Z)}async _createMessage(Z,$,J){let z=J?.signal,Y;if(z){if(z.aborted)this.controller.abort();Y=this.controller.abort.bind(this.controller),z.addEventListener("abort",Y)}try{Q(this,CZ,"m",t4).call(this);let{response:K,data:N}=await Z.create({...$,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(K);for await(let W of N)Q(this,CZ,"m",o4).call(this,W);if(N.controller.signal?.aborted)throw new s;Q(this,CZ,"m",s4).call(this)}finally{if(z&&Y)z.removeEventListener("abort",Y)}}_connected(Z){if(this.ended)return;q(this,kX,Z,"f"),q(this,hX,Z?.headers.get("request-id"),"f"),q(this,bX,Z?.headers.get("anthropic-workspace-id"),"f"),Q(this,PX,"f").call(this,Z),this._emit("connect")}get ended(){return Q(this,Z$,"f")}get errored(){return Q(this,fX,"f")}get aborted(){return Q(this,yX,"f")}abort(){this.controller.abort()}on(Z,$){return(Q(this,PZ,"f")[Z]||(Q(this,PZ,"f")[Z]=[])).push({listener:$}),this}off(Z,$){let J=Q(this,PZ,"f")[Z];if(!J)return this;let z=J.findIndex((Y)=>Y.listener===$);if(z>=0)J.splice(z,1);return this}once(Z,$){return(Q(this,PZ,"f")[Z]||(Q(this,PZ,"f")[Z]=[])).push({listener:$,once:!0}),this}emitted(Z){return new Promise(($,J)=>{if(q(this,X0,!0,"f"),Z!=="error")this.once("error",J);this.once(Z,$)})}async done(){q(this,X0,!0,"f"),await Q(this,s8,"f")}get currentMessage(){return Q(this,dZ,"f")}async finalMessage(){return await this.done(),Q(this,CZ,"m",a4).call(this)}async finalText(){return await this.done(),Q(this,CZ,"m",S7).call(this)}_emit(Z,...$){if(Q(this,Z$,"f"))return;if(Z==="end")q(this,Z$,!0,"f"),Q(this,IX,"f").call(this);let J=Q(this,PZ,"f")[Z];if(J)Q(this,PZ,"f")[Z]=J.filter((z)=>!z.once),J.forEach(({listener:z})=>z(...$));if(Z==="abort"){let z=$[0];if(!Q(this,X0,"f")&&!J?.length)Promise.reject(z);Q(this,o8,"f").call(this,z),Q(this,e8,"f").call(this,z),this._emit("end");return}if(Z==="error"){let z=$[0];if(!Q(this,X0,"f")&&!J?.length)Promise.reject(z);Q(this,o8,"f").call(this,z),Q(this,e8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",Q(this,CZ,"m",a4).call(this))}async _fromReadableStream(Z,$){let J=$?.signal,z;if(J){if(J.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),J.addEventListener("abort",z)}try{Q(this,CZ,"m",t4).call(this),this._connected(null);let Y=jZ.fromReadableStream(Z,this.controller);for await(let K of Y)Q(this,CZ,"m",o4).call(this,K);if(Y.controller.signal?.aborted)throw new s;Q(this,CZ,"m",s4).call(this)}finally{if(J&&z)J.removeEventListener("abort",z)}}[(dZ=new WeakMap,w0=new WeakMap,t8=new WeakMap,PX=new WeakMap,o8=new WeakMap,s8=new WeakMap,IX=new WeakMap,e8=new WeakMap,PZ=new WeakMap,Z$=new WeakMap,fX=new WeakMap,yX=new WeakMap,X0=new WeakMap,kX=new WeakMap,hX=new WeakMap,bX=new WeakMap,$$=new WeakMap,r4=new WeakMap,CZ=new WeakSet,a4=function(){if(this.receivedMessages.length===0)throw new F("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},S7=function(){if(this.receivedMessages.length===0)throw new F("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((J)=>J.type==="text").map((J)=>J.text);if($.length===0)throw new F("stream ended without producing a content block with type=text");return $.join(" ")},t4=function(){if(this.ended)return;q(this,dZ,void 0,"f")},o4=function($){if(this.ended)return;let J=Q(this,CZ,"m",E7).call(this,$);switch(this._emit("streamEvent",$,J),$.type){case"content_block_delta":{let z=J.content.at(-1);switch($.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",$.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",$.delta.citation,z.citations??[]);break}case"input_json_delta":{if(e4(z)&&Q(this,PZ,"f").inputJson?.length)this._emit("inputJson",$.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",$.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:kZ($.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(p4(J,Q(this,w0,"f"),{logger:Q(this,$$,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{q(this,dZ,J,"f");break}case"content_block_start":case"message_delta":break}},s4=function(){if(this.ended)throw new F("stream has ended, this shouldn't happen");let $=Q(this,dZ,"f");if(!$)throw new F("request ended without sending any chunks");return q(this,dZ,void 0,"f"),p4($,Q(this,w0,"f"),{logger:Q(this,$$,"f")})},E7=function($){let J=Q(this,dZ,"f");if($.type==="message_start"){if(J)throw new F(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!J)throw new F(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return J;case"message_delta":if(J.stop_reason=$.delta.stop_reason,J.stop_sequence=$.delta.stop_sequence,J.stop_details=$.delta.stop_details,J.usage.output_tokens=$.usage.output_tokens,$.delta.container!=null)J.container=$.delta.container;if($.usage.input_tokens!=null)J.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)J.usage.server_tool_use=$.usage.server_tool_use;if($.usage.output_tokens_details!=null)J.usage.output_tokens_details=$.usage.output_tokens_details;return J;case"content_block_start":return J.content.push({...$.content_block}),J;case"content_block_delta":{let z=J.content.at($.index);switch($.delta.type){case"text_delta":{if(z?.type==="text")J.content[$.index]={...z,text:(z.text||"")+$.delta.text};break}case"citations_delta":{if(z?.type==="text")J.content[$.index]={...z,citations:[...z.citations??[],$.delta.citation]};break}case"input_json_delta":{if(z&&e4(z)){let Y=(z[mZ]||"")+$.delta.partial_json;J.content[$.index]=NX(z,Y)}break}case"thinking_delta":{if(z?.type==="thinking")J.content[$.index]={...z,thinking:z.thinking+$.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")J.content[$.index]={...z,signature:$.delta.signature};break}default:kZ($.delta)}return J}case"content_block_stop":{let z=J.content.at($.index);if(z&&e4(z)&&mZ in z)Object.defineProperty(z,"input",{value:z.input,enumerable:!0,configurable:!0,writable:!0});return J}}},Symbol.asyncIterator)](){let Z=[],$=[],J=!1;return this.on("streamEvent",(z)=>{let Y=$.shift();if(Y)Y.resolve(z);else Z.push(z)}),this.on("end",()=>{J=!0;for(let z of $)z.resolve(void 0);$.length=0}),this.on("abort",(z)=>{J=!0;for(let Y of $)Y.reject(z);$.length=0}),this.on("error",(z)=>{J=!0;for(let Y of $)Y.reject(z);$.length=0}),{next:async()=>{if(!Z.length){if(J)return{value:void 0,done:!0};return new Promise((Y,K)=>$.push({resolve:Y,reject:K})).then((Y)=>Y?{value:Y,done:!1}:{value:void 0,done:!0})}return{value:Z.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new jZ(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return X})()});var X$;var Z6=T(()=>{L();w();D();l1();A0();f();X$=class X$ extends M{create(X,Z){let{user_profile_id:$,workspace_id:J,...z}=X;return this._client.post("/v1/messages/batches",{body:z,...Z,headers:V([{...$!=null?{"anthropic-user-profile-id":$}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}retrieve(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.get(G`/v1/messages/batches/${X}`,{...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}list(X={},Z){let{workspace_id:$,...J}=X??{};return this._client.getAPIList("/v1/messages/batches",r,{query:J,...Z,headers:V([{...$!=null?{"anthropic-workspace-id":$}:void 0},Z?.headers])})}delete(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.delete(G`/v1/messages/batches/${X}`,{...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}cancel(X,Z={},$){let{workspace_id:J}=Z??{};return this._client.post(G`/v1/messages/batches/${X}/cancel`,{...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}async results(X,Z={},$){let J=await this.retrieve(X,Z,$);if(!J.results_url)throw new F(`No batch \`results_url\`; Has it finished processing? ${J.processing_status} - ${J.id}`);let{workspace_id:z}=Z??{};return this._client.get(J.results_url,{...$,headers:V([{Accept:"application/binary",...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Y,K)=>KX.fromResponse(K.response,K.controller))}}});var J$,R7,eJ;var $6=T(()=>{L();D();RZ();j7();n4();Z6();Z6();i1();J$=(()=>{class X extends M{constructor(){super(...arguments);this.batches=new X$(this._client)}create(Z,$){let{user_profile_id:J,workspace_id:z,...Y}=Z;if(Y.model in R7)console.warn(`The model '${Y.model}' is deprecated and will reach end-of-life on ${R7[Y.model]}
|
|
33
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(eJ.includes(Y.model)&&Y.thinking&&Y.thinking.type==="enabled")console.warn(`Using Claude with ${Y.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 K=$?.timeout??this._client._options.timeout;if(!Y.stream&&K==null){let W=VX[Y.model]??void 0;K=this._client.calculateNonstreamingTimeout(Y.max_tokens,W)}let N=k$(Y.tools,Y.messages);return this._client.post("/v1/messages",{body:Y,timeout:K??600000,...$,headers:V([{...J!=null?{"anthropic-user-profile-id":J}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},N,$?.headers]),stream:Z.stream??!1})}parse(Z,$){return this.create(Z,$).then((J)=>i4(J,Z,{logger:this._client.logger??console}))}stream(Z,$){return L7.createMessage(this,Z,$,{logger:this._client.logger??console})}countTokens(Z,$){let{user_profile_id:J,workspace_id:z,...Y}=Z;return this._client.post("/v1/messages/count_tokens",{body:Y,...$,headers:V([{...J!=null?{"anthropic-user-profile-id":J}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}return X.Batches=X$,X})(),R7={},eJ=["claude-mythos-preview","claude-opus-4-6"]});var P0;var X6=T(()=>{L();w();D();f();P0=class P0 extends M{retrieve(X,Z={},$){let{betas:J,workspace_id:z}=Z??{};return this._client.get(G`/v1/models/${X}`,{...$,headers:V([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0,...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X={},Z){let{betas:$,workspace_id:J,...z}=X??{};return this._client.getAPIList("/v1/models",r,{query:z,...Z,headers:V([{...$?.toString()!=null?{"anthropic-beta":$?.toString()}:void 0,...J!=null?{"anthropic-workspace-id":J}:void 0},Z?.headers])})}}});var z$;var J6=T(()=>{L();w();D();fZ();f();z$=class z$ extends M{create(X,Z,$){let{workspace_id:J,...z}=Z;return this._client.post(G`/v1/skills/${X}/versions`,qZ({body:z,...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])},this._client,!1))}retrieve(X,Z,$){let{skill_id:J,workspace_id:z}=Z;return this._client.get(G`/v1/skills/${J}/versions/${X}`,{...$,headers:V([{...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}list(X,Z={},$){let{workspace_id:J,...z}=Z??{};return this._client.getAPIList(G`/v1/skills/${X}/versions`,S,{query:z,...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}delete(X,Z,$){let{skill_id:J,workspace_id:z}=Z;return this._client.delete(G`/v1/skills/${J}/versions/${X}`,{...$,headers:V([{...z!=null?{"anthropic-workspace-id":z}:void 0},$?.headers])})}}});var Y$;var z6=T(()=>{L();J6();J6();w();D();fZ();f();Y$=(()=>{class X extends M{constructor(){super(...arguments);this.versions=new z$(this._client)}create(Z,$){let{workspace_id:J,...z}=Z;return this._client.post("/v1/skills",qZ({body:z,...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])},this._client,!1))}retrieve(Z,$={},J){let{workspace_id:z}=$??{};return this._client.get(G`/v1/skills/${Z}`,{...J,headers:V([{...z!=null?{"anthropic-workspace-id":z}:void 0},J?.headers])})}list(Z={},$){let{workspace_id:J,...z}=Z??{};return this._client.getAPIList("/v1/skills",S,{query:z,...$,headers:V([{...J!=null?{"anthropic-workspace-id":J}:void 0},$?.headers])})}delete(Z,$={},J){let{workspace_id:z}=$??{};return this._client.delete(G`/v1/skills/${Z}`,{...J,headers:V([{...z!=null?{"anthropic-workspace-id":z}:void 0},J?.headers])})}}return X.Versions=z$,X})()});var D7=T(()=>{c4();d4();l4();$6();X6();z6();F9()});var Y6,Q6,gX,w7,X2="\\n\\nHuman:",J2="\\n\\nAssistant:",z2,Y2;var P7=T(()=>{YZ();$Z();z0();iZ();W$();U$();Y0();E6();oX();u0();u();K0();c6();V9();O9();w();H9();D7();G1();d4();l4();X6();c4();$6();z6();W$();D();V0();LZ();$Z();z2=(()=>{class X{get credentials(){return this._authState.provider}constructor({baseURL:Z=y("ANTHROPIC_BASE_URL"),apiKey:$,authToken:J,webhookKey:z=y("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...Y}={}){if(Y6.add(this),this._requestAuthFlags=new WeakMap,gX.set(this,void 0),$===void 0)$=Y.profile!=null?null:y("ANTHROPIC_API_KEY")??null;if(J===void 0)J=Y.profile!=null?null:y("ANTHROPIC_AUTH_TOKEN")??null;if(Y.profile!=null&&(Y.credentials!=null||Y.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let K={apiKey:$,authToken:J,webhookKey:z,...Y,baseURL:Z||"https://api.anthropic.com"};if(!K.dangerouslyAllowBrowser&&T6())throw new F(`It looks like you're running in a browser-like environment.
|
|
34
|
+
|
|
35
|
+
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
36
|
+
If you understand the risks and have appropriate mitigations in place,
|
|
37
|
+
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
38
|
+
|
|
39
|
+
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
40
|
+
`);this.baseURL=K.baseURL,this._baseURLIsExplicit=Y.__baseURLIsExplicit??!!Z,this.timeout=K.timeout??Q6.DEFAULT_TIMEOUT,this.logger=K.logger??console,this.logLevel=n0,this.logLevel=S$(K.logLevel,"ClientOptions.logLevel",h(this))??S$(y("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",h(this))??n0,this.fetchOptions=K.fetchOptions,this.maxRetries=V$("maxRetries",K.maxRetries??2),this.fetch=K.fetch??F6(),q(this,gX,S6,"f"),this.middleware=[...K.middleware??[]];let N=y("ANTHROPIC_CUSTOM_HEADERS");if(N){let U={};for(let x of N.split(`
|
|
41
|
+
`)){let B=x.indexOf(":");if(B>=0)U[x.substring(0,B).trim()]=x.substring(B+1).trim()}K.defaultHeaders={...U,...K.defaultHeaders}}let W=Y.__auth;if(delete K.__auth,delete K.__baseURLIsExplicit,this._options=K,this.apiKey=typeof $==="string"?$:null,this.authToken=J,this.webhookKey=z,W){if(this._authState=W,!this._baseURLIsExplicit&&W.baseURL)this.baseURL=W.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let U=K.credentials??null;if(U)this._authState.provider=U,this._authState.tokenCache=this._makeTokenCache(U);else if(K.config!=null){let x=K1(K.config,this._credentialResolverOptions());this._authState.provider=x.provider,this._authState.tokenCache=this._makeTokenCache(x.provider),this._authState.extraHeaders=x.extraHeaders,this._applyCredentialBaseURL(x.baseURL)}else if(K.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(K.profile);else if(this._shouldResolveDefaultCredentials())this._authState.resolution=this._resolveDefaultCredentials()}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(Z){if(!Z)return;let $=Z.replace(/\/+$/,"");if(this._authState.baseURL=$,!this._baseURLIsExplicit)this.baseURL=$}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:(Z)=>{h(this).debug("credential cache write failed (best-effort)",Z)},onSafetyWarning:(Z)=>{h(this).warn(Z)}}}_credentialsFetch(){return W1(this.fetch,this.middleware,void 0,this)}_makeTokenCache(Z){return new eX(Z,($)=>{h(this).debug("advisory token refresh failed; serving cached token",$)})}withOptions(Z){let $="credentials"in Z||"config"in Z||"profile"in Z,J="apiKey"in Z||"authToken"in Z||$,z={...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,...$?{credentials:void 0,config:void 0,profile:void 0}:{},...Z,__auth:J?void 0:this._authState,__baseURLIsExplicit:"baseURL"in Z?!0:this._baseURLIsExplicit};return new this.constructor(z)}async _resolveDefaultCredentials(Z){try{let $=await K9(this._credentialResolverOptions(),Z);if($)this._authState.provider=$.provider,this._authState.tokenCache=this._makeTokenCache($.provider),this._authState.extraHeaders=$.extraHeaders,this._applyCredentialBaseURL($.baseURL);else if(Z!=null)throw new F(`Profile "${Z}" could not be resolved (no <config_dir>/configs/${Z}.json found).`)}catch($){this._authState.error=$}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:Z,nulls:$}){if(Z.get("x-api-key")||Z.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&Z.get("x-api-key"))return;if($.has("x-api-key"))return;if(this.authToken&&Z.get("authorization"))return;if($.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(Z){let $=this._requestAuthFlags.get(Z);if(!$)$={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(Z,$);return $}async authHeaders(Z){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let $=await this._authState.tokenCache.getToken();return this._authFlags(Z).usedTokenCache=!0,V([{Authorization:`Bearer ${$}`}])}return V([await this.apiKeyAuth(Z),await this.bearerAuth(Z)])}async apiKeyAuth(Z){if(this.apiKey==null)return;return V([{"X-Api-Key":this.apiKey}])}async bearerAuth(Z){if(this.authToken==null)return;return V([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(Z){return h6(Z)}getUserAgent(){return`Anthropic/JS ${UZ}`}makeStatusError(Z,$,J,z){return _.generate(Z,$,J,z)}buildURL(Z,$,J){let z=!Q(this,Y6,"m",w7).call(this)&&J||this.baseURL,Y=U6(Z)?new URL(Z):new URL(z+(z.endsWith("/")&&Z.startsWith("/")?Z.slice(1):Z)),K=this.defaultQuery(),N=Object.fromEntries(Y.searchParams);if(!uX(K)||!uX(N))$={...N,...K,...$};if(typeof $==="object"&&$&&!Array.isArray($))Y.search=this.stringifyQuery($);return Y.toString()}_calculateNonstreamingTimeout(Z){if(3600*Z/128000>600)throw new F("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(Z){}async prepareRequest(Z,{url:$,options:J}){if(this._authState.tokenCache&&this.apiKey==null){let z=Z.headers instanceof Headers?Z.headers:new Headers(Z.headers);for(let[K,N]of Object.entries(this._authState.extraHeaders))if(!z.has(K))z.set(K,N);let Y=z.get("anthropic-beta")?.split(",").map((K)=>K.trim());if(!Y?.includes(nZ))z.set("anthropic-beta",[...Y??[],nZ].join(","));Z.headers=z}}backendMiddleware(){return[]}get(Z,$){return this.methodRequest("get",Z,$)}post(Z,$){return this.methodRequest("post",Z,$)}patch(Z,$){return this.methodRequest("patch",Z,$)}put(Z,$){return this.methodRequest("put",Z,$)}delete(Z,$){return this.methodRequest("delete",Z,$)}methodRequest(Z,$,J){return this.request(Promise.resolve(J).then((z)=>{return{method:Z,path:$,...z}}))}request(Z,$=null){return new w$(this,this.makeRequest(Z,$,void 0))}async makeRequest(Z,$,J){let z=await Z,Y=V$("maxRetries",z.maxRetries??this.maxRetries);if(this.isStreamBody(z.body))Y=0;if($==null)$=Y,this._requestAuthFlags.delete(z);await this.prepareOptions(z);let{req:K,url:N,timeout:W}=await this.buildRequest(z,{retryCount:Y-$}),U="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),x=J===void 0?"":`, retryOf: ${J}`,B=Date.now();if(z.signal?.aborted)throw new s;let C=new AbortController,O=await this.fetchWithTimeout(N,K,W,C,z,{requestLogID:U,retryOfRequestLogID:J}).catch(pZ),H=Date.now();if(O instanceof globalThis.Error){FZ(C);let R=`retrying, ${$} attempts remaining`;if(z.signal?.aborted)throw new s;let A=TZ(O)||/timed? ?out/i.test(String(O)+("cause"in O?String(O.cause):"")),k=this.middleware.length>0||!!z.middleware?.length||this.backendMiddleware().length>0;if(k&&!A&&!B9(O))throw h(this).info(`[${U}] middleware error (not retryable)`),EZ(h(this),`[${U}] middleware error (not retryable)`,{retryOfRequestLogID:J,url:N,durationMs:H-B,message:O.message}),O;if($)return h(this).info(`[${U}] connection ${A?"timed out":"failed"} - ${R}`),EZ(h(this),`[${U}] connection ${A?"timed out":"failed"} (${R})`,{retryOfRequestLogID:J,url:N,durationMs:H-B,message:O.message}),this.retryRequest(z,$,J??U);if(h(this).info(`[${U}] connection ${A?"timed out":"failed"} - error; no more retries left`),EZ(h(this),`[${U}] connection ${A?"timed out":"failed"} (error; no more retries left)`,{retryOfRequestLogID:J,url:N,durationMs:H-B,message:O.message}),A)throw new I0;if(k&&!N1(O))throw O;throw new IZ({cause:O})}let P=[...O.headers.entries()].filter(([R])=>R==="request-id"||R==="anthropic-workspace-id").map(([R,A])=>", "+R+": "+JSON.stringify(A)).join(""),j=`[${U}${x}${P}] ${K.method} ${N} ${O.ok?"succeeded":"failed"} with status ${O.status} in ${H-B}ms`;if(!O.ok){let R=await this.shouldRetry(O,z);if($&&R){let b=`retrying, ${$} attempts remaining`;return await A6(O.body),FZ(C),h(this).info(`${j} - ${b}`),EZ(h(this),`[${U}] response error (${b})`,{retryOfRequestLogID:J,url:O.url,status:O.status,headers:O.headers,durationMs:H-B}),this.retryRequest(z,$,J??U,O.headers)}let A=R?"error; no more retries left":"error; not retryable";h(this).info(`${j} - ${A}`);let k=await O.text().catch((b)=>pZ(b).message),E=N$(k),I=E?void 0:k;throw EZ(h(this),`[${U}] response error (${A})`,{retryOfRequestLogID:J,url:O.url,status:O.status,headers:O.headers,message:I,durationMs:Date.now()-B}),FZ(C),this.makeStatusError(O.status,E,I,O.headers)}return h(this).info(j),EZ(h(this),`[${U}] response start`,{retryOfRequestLogID:J,url:O.url,status:O.status,headers:O.headers,durationMs:H-B}),H6(O.body??O,C),{response:O,options:z,controller:C,requestLogID:U,retryOfRequestLogID:J,startTime:B}}getAPIList(Z,$,J){return this.requestAPIList($,J&&"then"in J?J.then((z)=>({method:"get",path:Z,...z})):{method:"get",path:Z,...J})}requestAPIList(Z,$){let J=this.makeRequest($,null,void 0);return new C9(this,J,Z)}async fetchWithTimeout(Z,$,J,z,Y,K){let{signal:N,method:W,...U}=$||{},x=this._makeAbort(z);if(N)N.addEventListener("abort",x,{once:!0}),x6(z,N,x);let B=globalThis.ReadableStream&&U.body instanceof globalThis.ReadableStream||typeof U.body==="object"&&U.body!==null&&Symbol.asyncIterator in U.body,C={signal:z.signal,...B?{duplex:"half"}:{},method:"GET",...U};if(W)C.method=W.toUpperCase();let O=this.fetch,H=async(k,E)=>{let I=setTimeout(x,J);try{return await O.call(void 0,k,E)}finally{clearTimeout(I)}},P=Y===void 0?H:async(k,E={})=>{let I=typeof k==="string"?k:k instanceof URL?k.href:k.url;if(E.headers=E.headers instanceof Headers?E.headers:new Headers(E.headers),await this.prepareRequest(E,{url:I,options:Y}),K)EZ(h(this),`[${K.requestLogID}] sending request`,{retryOfRequestLogID:K.retryOfRequestLogID,method:E.method,url:I,options:Y,headers:E.headers});return H(k,E)},j=Y?.middleware,R=this.backendMiddleware(),A=j?.length||R.length?[...this.middleware,...j??[],...R]:this.middleware;return await W1(P,A,Y,this)(Z,C)}async shouldRetry(Z,$){let J=this._authFlags($);if(Z.status===401&&this._authState.tokenCache&&J.usedTokenCache&&!J.didRefreshFor401)return J.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let z=Z.headers.get("x-should-retry");if(z==="true")return!0;if(z==="false")return!1;if(Z.status===408)return!0;if(Z.status===409)return!0;if(Z.status===429)return!0;if(Z.status>=500)return!0;return!1}async retryRequest(Z,$,J,z){let Y,K=z?.get("retry-after-ms");if(K){let W=parseFloat(K);if(!Number.isNaN(W))Y=W}let N=z?.get("retry-after");if(N&&!Y){let W=parseFloat(N);if(!Number.isNaN(W))Y=W*1000;else Y=Date.parse(N)-Date.now()}if(Y===void 0||!(Y>0&&Y<=2147483647)){let W=Z.maxRetries??this.maxRetries;Y=this.calculateDefaultRetryTimeoutMillis($,W)}return await MZ(Y,Z.signal??void 0),this.makeRequest(Z,$-1,J)}calculateDefaultRetryTimeoutMillis(Z,$){let Y=$-Z,K=Math.min(0.5*Math.pow(2,Y),8),N=1-Math.random()*0.25;return K*N*1000}calculateNonstreamingTimeout(Z,$){if(3600000*Z/128000>600000||$!=null&&Z>$)throw new F("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(Z,{retryCount:$=0}={}){let J={...Z},{method:z,path:Y,query:K,defaultBaseURL:N}=J;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 W=this.buildURL(Y,K,N);if("timeout"in J)V$("timeout",J.timeout);J.timeout=J.timeout??this.timeout;let{bodyHeaders:U,body:x}=this.buildBody({options:J}),B=await this.buildHeaders({options:Z,method:z,bodyHeaders:U,retryCount:$});return{req:{method:z,headers:B,...J.signal&&{signal:J.signal},...globalThis.ReadableStream&&x instanceof globalThis.ReadableStream&&{duplex:"half"},...x&&{body:x},...this.fetchOptions??{},...J.fetchOptions??{}},url:W,timeout:J.timeout}}async buildHeaders({options:Z,method:$,bodyHeaders:J,retryCount:z}){let Y=V([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...Z.timeout?{"X-Stainless-Timeout":String(Math.trunc(Z.timeout/1000))}:{},...c0(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(Z),this._options.defaultHeaders,J,Z.headers]);return this.validateHeaders(Y),Y.values}_makeAbort(Z){return()=>Z.abort()}buildBody({options:{body:Z,headers:$}}){if(!Z)return{bodyHeaders:void 0,body:void 0};let J=V([$]);if(ArrayBuffer.isView(Z)||Z instanceof ArrayBuffer||Z instanceof DataView||typeof Z==="string"&&J.values.has("content-type")||globalThis.Blob&&Z instanceof globalThis.Blob||Z instanceof FormData||Z instanceof URLSearchParams||globalThis.ReadableStream&&Z instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:Z};else if(this.isStreamBody(Z))return{bodyHeaders:void 0,body:q$(Z)};else if(typeof Z==="object"&&J.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(Z)};else return Q(this,gX,"f").call(this,{body:Z,headers:J})}isStreamBody(Z){if(globalThis.ReadableStream&&Z instanceof globalThis.ReadableStream)return!0;return typeof Z==="object"&&Z!==null&&((Symbol.asyncIterator in Z)||(Symbol.iterator in Z)&&("next"in Z)&&typeof Z.next==="function")}}return Q6=X,gX=new WeakMap,Y6=new WeakSet,w7=function(){return this.baseURL!=="https://api.anthropic.com"},X.Anthropic=Q6,X.HUMAN_PROMPT=X2,X.AI_PROMPT=J2,X.DEFAULT_TIMEOUT=600000,X.AnthropicError=F,X.APIError=_,X.APIConnectionError=IZ,X.APIConnectionTimeoutError=I0,X.APIUserAbortError=s,X.NotFoundError=h0,X.ConflictError=b0,X.RateLimitError=v0,X.BadRequestError=f0,X.AuthenticationError=y0,X.InternalServerError=_0,X.PermissionDeniedError=k0,X.UnprocessableEntityError=g0,X.toFile=M1,X})(),Y2=(()=>{class X extends z2{constructor(){super(...arguments);this.completions=new R0(this),this.messages=new J$(this),this.models=new P0(this),this.files=new D0(this),this.skills=new Y$(this),this.beta=new r8(this)}}return X.Completions=R0,X.Messages=J$,X.Models=P0,X.Files=D0,X.Skills=Y$,X.Beta=r8,X})()});var Q2=T(()=>{P7();u()});
|
|
42
|
+
export{q as _pa,Q as $pa,YZ as aqa,F as bqa,_ as cqa,s as dqa,IZ as eqa,I0 as fqa,y0 as gqa,h0 as hqa,u as iqa,p0 as jqa,i0 as kqa,H$ as lqa,h as mqa,LZ as nqa,gZ as oqa,c$ as pqa,J0 as qqa,K$ as rqa,U2 as sqa,V6 as tqa,N6 as uqa,W6 as vqa,_X as wqa,G6 as xqa,A0 as yqa,Y2 as zqa,Q2 as Aqa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ci as W,ii as i}from"./cli-1.1.40-fqcnge4w.mjs";import{Cj as _,Dj as P,HB as M,HP as l,IB as p,Jq as $,Lq as D,ND as U,PD as S,Wi as Z,Wu as B,Xi as v,Xu as A,YM as j,ZM as C,ZS as G,aN as E,aT as s,bT as R,cT as f,cv as K,dT as y,dv as m,eT as r,fP as b,gP as o,oC as N,pC as g,sH as V,vN as h,xH as d,yN as L,zN as n,zP as x}from"./cli-1.1.40-wh51ya47.mjs";import{d9 as Y,i9 as k}from"./cli-1.1.40-5x38x6mx.mjs";import{A_ as Q,B_ as u,G$ as I,z$ as X}from"./cli-1.1.40-hfe06y9j.mjs";import{tpa as O,vka as J,zpa as T}from"./cli-1.1.40-5m7tntdx.mjs";import{Nqa as F,Oqa as w}from"./cli-1.1.40-jxfk62k7.mjs";function jq(H=new Set){let z=H.size>0;if(y.cache.clear?.(),f.cache.clear?.(),R.cache.clear?.(),Z.cache.clear?.(),W(),x(),!z)B();if(M("main"),J(null),b(),E(),G("session_start"),U(),Q.clear(),_(),!z)V();if(Y(),$(),!z)N();O(H),X(),j(),K(),L(),import("./utils-1.1.40-59bpagj3.mjs").then(({clearWebFetchCache:q})=>q()),import("./ToolSearchTool-1.1.40-x1k41dnq.mjs").then(({clearToolSearchDescriptionCache:q})=>q()),import("./loadAgentsDir-1.1.40-2phb1zja.mjs").then(({clearAgentDefinitionsCache:q})=>q()),import("./prompt-1.1.40-fafe7d93.mjs").then(({clearPromptCache:q})=>q())}var c=F(()=>{T();l();v();r();i();d();g();A();p();P();o();m();C();h();D();s();k();I();u();S();n()});
|
|
2
|
+
export{jq as Ph,c as Qh};
|