@agimon-ai/po-cloudflare 0.0.2-alpha.7 → 0.0.2-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -241
- package/container/Dockerfile +27 -0
- package/dist/{BrowserWebSocketTransport-C2SC2VeJ.js → BrowserWebSocketTransport-B4heNdrp.js} +1 -1
- package/dist/{NodeWebSocketTransport-CKilJesa.js → NodeWebSocketTransport-BCiOXUEz.js} +2 -2
- package/dist/{abort-signals-Bkmp_euQ.js → abort-signals-C8CttjsR.js} +1 -1
- package/dist/agent-CEqvgRl6.js +3878 -0
- package/dist/{anthropic-messages-CkYm8M3V.js → anthropic-messages-DCLLLNuM.js} +292 -64
- package/dist/apiContracts-DaOpUHnu.js +1719 -0
- package/dist/{approval-CQ3ZuoTy.js → approval-DXPV7Vm5.js} +15 -2
- package/dist/{approvalPrompt-CylV3C84.js → approvalPrompt-CBaxjb_g.js} +1 -2
- package/dist/approvalSession-C9bg7tPo.js +132 -0
- package/dist/artifactFiles-5KwXIxYf.js +1 -0
- package/dist/artifactsApi-bg2wMYWg.js +200 -0
- package/dist/assets/assets/{CodeEditorView-D4q94XH-.js → CodeEditorView-CfrVwzvL.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-C85p4OYZ.js → abnfDiagram-WEYOIA3C-B80H4Cm4.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-Bt_NOdwE.js → architecture-WOLXFQ4H-Dr4hXaql.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DzH1GKMm.js → architectureDiagram-ZHVYKT53-DWyt7oXu.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-BmWU34j3.js → blockDiagram-RJAE7QA3-OxNTLdmi.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-BpGOdOuo.js → c4Diagram-XDPPPE54-B4YtcH0s.js} +2 -2
- package/dist/assets/assets/channel-bXj00dGj.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-AycP1cXU.js → chunk-2E7WHVMD-CD6FFMOX.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-DX-DrZzc.js → chunk-4EMNKR2T-CEIoX5oo.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-BdwnLWzI.js → chunk-55XCU76K-CD3t0IJi.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-D-RBAwAn.js → chunk-7S6XSTFO-Cyt75UCF.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB-CCxNNhKs.js → chunk-AQDTSKZB-DRtqYBj9.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-D2hGwWm1.js → chunk-DSNLSHJZ-C8Fx2F8s.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-BPi-cqGh.js → chunk-HAGFOTED-wOLWRRnd.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D-r1ChHT.js → chunk-HNE4Q36P-CurJg4Hf.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-RgmZCAdn.js → chunk-NQOKRVIF-Dzcc5nOG.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-B-Hul-rZ.js → chunk-UHW7PFBP-B_ULFf2h.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-D1zlXCt8.js → chunk-VQ5W62QI-DH0VY4_p.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-CtjIbVJn.js → chunk-WQQL4CDK-DNxfLyXM.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-B2bMWgN9.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-BQOgXG99.js → chunk-YZO67HFG-COuMUh9U.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-CsDDxmqv.js → chunk-ZAUX2LTX-BJrCnubF.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-deyEYMjx.js → chunk-ZCHMQSOR-D1lFKPtk.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-DVJHeFlq.js → classDiagram-v2-4MYWR3UA-DfZIbyVL.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-ipcN28Fw.js → cose-bilkent-JH36ORCC-CpGhv9_S.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-s9ZkPF55.js → cynefin-EF2NZ3EQ-Cxdc6nQl.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-Ksr2qjsS.js → cynefinDiagram-WF24UDRP-qoj0w3lp.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-2_Wl-XEW.js → dagre-NK4GIZVX-DL6QbNDS.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-C7PeyT7l.js → diagram-CBK3MWTC-CJB3jq1_.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-DPYzeKdj.js → diagram-I5XIIV2D-4cPOxCxF.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-DHw1cAmn.js → diagram-ODIL2UCW-BG3-jAxE.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-C2wA8i-1.js → diagram-PFBEJUXE-Bx8dFaXj.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-tM3moCIs.js → diagram-RJA3I4VV-CUUHND91.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-CInyJxF7.js → diagram-TYUNFSNR-BDMoN-kr.js} +2 -2
- package/dist/assets/assets/{dist-BDqjNLTC.js → dist-5AxNm-uy.js} +2 -2
- package/dist/assets/assets/{dist-hpZIQBl4.js → dist-9_Rmyj2I.js} +2 -2
- package/dist/assets/assets/{dist-DSLprmec.js → dist-BE3CLKv4.js} +2 -2
- package/dist/assets/assets/{dist-BASEd5LC.js → dist-BfNCu-7x.js} +2 -2
- package/dist/assets/assets/{dist-BuYBvf4F.js → dist-BjI0b36Z.js} +2 -2
- package/dist/assets/assets/{dist-DUS0U_ge.js → dist-CM7b5P9a.js} +2 -2
- package/dist/assets/assets/{dist-CeOy6PjJ.js → dist-Ccxb9U1G.js} +2 -2
- package/dist/assets/assets/{dist-ChXoRSS6.js → dist-CjCWP21A.js} +2 -2
- package/dist/assets/assets/{dist-07dRlnp1.js → dist-DSTAktnR.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-4nZgqaSt.js → ebnfDiagram-V4P3TTPT-BivOMXZb.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-nFh54c1Q.js → elk-QONTBCTQ-CrJ1Qpy_.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-CIQ0_IgZ.js → erDiagram-KYQIGQAA-w9Bqp4sV.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-Cw4BlbYP.js → eventmodeling-K75KTNOO-CBjFM3kV.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-C6Fnfgm0.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-C97qoUpX.js → ganttDiagram-R7GPNTJY-CsWtGaqD.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-B8HWVkEX.js → gitGraph-VSP46ZUC-DsBSV9_h.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-B4Js56_8.js → gitGraphDiagram-PDYL7XHY-D5GxuYHW.js} +2 -2
- package/dist/assets/assets/index-CNDyKUDF.css +1 -0
- package/dist/assets/assets/index-DWDYnZsq.js +256 -0
- package/dist/assets/assets/{info-OHQRW6UA-A4qythhA.js → info-OHQRW6UA-C7x5dSJu.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-BSNwG9yI.js → infoDiagram-MVDRKAX5-CwpI-uAa.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-D4gU-3RA.js → ishikawaDiagram-HPEHV2GE-DAa7J5G6.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CxxDrw7o.js → journeyDiagram-BOSHW7O7-BmiZnxE_.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DUxQv3v0.js → kanban-definition-FNSA4HC5-DUR_mA3L.js} +2 -2
- package/dist/assets/assets/{line-BKODXUmk.js → line-DHY49wSg.js} +2 -2
- package/dist/assets/assets/{linear-Cm5uyUun.js → linear-pTo-a9xT.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-CYst2kCg.js → mermaid-parser.core-DMg3hN3T.js} +4 -4
- package/dist/assets/assets/{mermaid.core-B4Qq8SMa.js → mermaid.core-DKtPCltA.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-CZFvUTIM.js → mindmap-definition-6OY57UG3-DwTkFbnV.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DZMlaiuy.js → packet-JDAUHWVQ-Tu9TrQ1x.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-BjM668dT.js → pegDiagram-ECIUJNBX-B7My4tsz.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-CmpJ6vb8.js → pie-XZMESJXO-QPQm5Gdx.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-BCA9DCDe.js → pieDiagram-GNMPY74T-Bv-zAD_z.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-CUnpC-Rl.js → quadrantDiagram-D57K4MC3-HTjoGQPd.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-C9x42-KP.js → radar-ABXABTNO-LDBlEoFo.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-CLvHKrsC.js → railroad-I3PHUGI6-Dy3_ymgZ.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-B0LGF3gx.js → railroad-abnf-LNEFI6M7-QLVvYs6e.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-SKnYapAj.js → railroad-ebnf-DWYD2UWJ-CFRlv9a8.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-wsUpPloN.js → railroad-peg-JR7BVNR7-BOlq3d9c.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-BYJtosKO.js → railroadDiagram-Y72NRBL7-Chg32HoU.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-YYdoWMnl.js → requirementDiagram-EQYSW5RA-VenIs_eg.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DtZyCTdM.js → sankeyDiagram-SY24JHO5-BdByqMKF.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-BPE8f413.js → sequenceDiagram-BLEHNHQU-D3Do4GJE.js} +2 -2
- package/dist/assets/assets/{src-BNTOLq2G.js → src-DmfN-DA-.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-9f8Ow4Fl.js → stateDiagram-v2-A6IESKWZ-CZkRbPlf.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-DdAEbxGp.js → swimlanes-B3ENRKFQ-DRTdF9AF.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-BYr_4JUb.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-DJNGd2mU.js → timeline-definition-JXYKGLGB-BVcuws_M.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-BHONoCCw.js → treeView-D4JQ5SDB-BLtOJGqO.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-pOaYkxq7.js → treemap-SAJKECNS-Dn3BWJ4v.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C3eDYL9v.js → usecaseDiagram-WPOLBNNX-CBExIKDY.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-CJi1xfsR.js → vennDiagram-Q3Y3IDCW-C6FIx2L4.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-CEy4w7Ir.js → wardley-7MLQ67FV-Cjj2xSBp.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-DfdLMMpN.js → wardleyDiagram-IVAIDKWA-sQPCBCFK.js} +2 -2
- package/dist/assets/assets/{webpack-v8XGbQTa.js → webpack-DDCA0aDL.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-Aw-Ix4uC.js → xychartDiagram-4URNHDU4-bZ4rifSw.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +8 -2
- package/dist/assets/mascot/cta-provider.png +0 -0
- package/dist/assets/mascot/cta-sign-in.png +0 -0
- package/dist/assets/plugins/assets/base-GzIOAd-t.css +2 -0
- package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
- package/dist/assets/plugins/assets/day-bottom-left-5um-x02r-5um-x02r.webp +0 -0
- package/dist/assets/plugins/assets/day-grain-CvEuNhlI-CvEuNhlI.webp +0 -0
- package/dist/assets/plugins/assets/day-right-C9W-XtjV-C9W-XtjV.webp +0 -0
- package/dist/assets/plugins/assets/day-top-left-B544Eq9J-B544Eq9J.webp +0 -0
- package/dist/assets/plugins/assets/night-bottom-left-N03ST5Uz-N03ST5Uz.webp +0 -0
- package/dist/assets/plugins/assets/night-grain-BY9q-tNN-BY9q-tNN.webp +0 -0
- package/dist/assets/plugins/assets/night-right-C6Denrqj-C6Denrqj.webp +0 -0
- package/dist/assets/plugins/assets/night-top-left-KOou6UxY-KOou6UxY.webp +0 -0
- package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
- package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
- package/dist/assets/plugins/chunks/po-web-runtime-D8FIos2q.js +1 -0
- package/dist/assets/plugins/chunks/schemas-DVQ8BvvP.js +55 -0
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/approval.09e72f36-DxS_uibk.js +2 -0
- package/dist/assets/plugins/slots/artifacts.50b639bb-Cp37TAkd.js +1 -0
- package/dist/assets/plugins/slots/author.ea449ace-Ds9Y-tjN.js +93 -0
- package/dist/assets/plugins/slots/autocompact.6f428144-CDZpN7I7.js +1 -0
- package/dist/assets/plugins/slots/backdrop-bamboo.6e4c928d-qbifuMc6.js +1 -0
- package/dist/assets/plugins/slots/browse.fa1f1a50-CVYvo1M5.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.75108f21-Cq1ljoL-.js +7 -0
- package/dist/assets/plugins/slots/calendar.d8b70190-BBjpOs1v.js +2 -0
- package/dist/assets/plugins/slots/codemode.c58fb583-DOR6OR7R.js +11 -0
- package/dist/assets/plugins/slots/domain.753f9f92-CJrXxig9.js +1 -0
- package/dist/assets/plugins/slots/edit.804fec90-BFF7_xN9.js +7 -0
- package/dist/assets/plugins/slots/files.66ffc636-CzOlZrRm.js +2 -0
- package/dist/assets/plugins/slots/goal.45dffa01-BtQBp3sw.js +1 -0
- package/dist/assets/plugins/slots/grep.98262cff-9bUDfjyT.js +1 -0
- package/dist/assets/plugins/slots/help.5fbd20f7-B4-y6gYK.js +3 -0
- package/dist/assets/plugins/slots/log.cb964209-BRPa3cVs.js +4 -0
- package/dist/assets/plugins/slots/mcp.82cc1ff5-CFtzPkPC.js +55 -0
- package/dist/assets/plugins/slots/plan.3852ba52-CH59Ff49.js +3 -0
- package/dist/assets/plugins/slots/profile.ab16dcec-0e9fWWyE.js +1 -0
- package/dist/assets/plugins/slots/prompts.ae48c07a-BTqYnBX5.js +38 -0
- package/dist/assets/plugins/slots/read.4560591a-C7fMXDEH.js +1 -0
- package/dist/assets/plugins/slots/runner.6e494d59-CqrpqhW9.js +9 -0
- package/dist/assets/plugins/slots/scaffold.d87a6ee0-9qY5gkYW.js +1 -0
- package/dist/assets/plugins/slots/session-mcp.2be84084-Cf0cqopp.js +2 -0
- package/dist/assets/plugins/slots/sessions.6f47cb4c-B1_eqPJQ.js +1 -0
- package/dist/assets/plugins/slots/skill.62a0a1b3-D-SKX8iw.js +4 -0
- package/dist/assets/plugins/slots/space.65a27e5a-fbLHc-DX.js +1 -0
- package/dist/assets/plugins/slots/subagents.8bb9992c-Cm_YMEnn.js +7 -0
- package/dist/assets/plugins/slots/template-advanced.59f3f98a-L0WOM4JT.js +1 -0
- package/dist/assets/plugins/slots/template-desktop.0f0b8491-By9BZlaL.js +7 -0
- package/dist/assets/plugins/slots/template-elegant.0e3b0acf-El05x7HK.js +1 -0
- package/dist/assets/plugins/slots/vault.3cbfcdc3-DpU_65Wy.js +1 -0
- package/dist/assets/plugins/slots/voice.a952113d-CvcuL__m.js +1 -0
- package/dist/assets/plugins/slots/web-search.65013836-NVh9fdvE.js +1 -0
- package/dist/assets/plugins/slots/workflows.cbc5c5c0-OLKSY9PE.js +16 -0
- package/dist/assets/pwa/pwa.js +12 -12
- package/dist/assets/pwa/sw.js +58 -4
- package/dist/{atomicJson-wczZBXQP.js → atomicJson-XYtxz032.js} +2 -3
- package/dist/{azure-openai-config-DHMgdIa-.js → azure-openai-config-S-quxzTC.js} +2 -2
- package/dist/{azure-openai-responses-CTgRdQ4m.js → azure-openai-responses-DdpV5zh7.js} +13 -13
- package/dist/backgroundWork-Bv0ib_lY.js +49 -0
- package/dist/{layeredConfig-xmTHGrw8.js → browser-DwY5dXHX.js} +21 -983
- package/dist/{browser-EJ5_ffnN.js → browser-IsHIcvFg.js} +1 -1
- package/dist/browser-ks_k-6KA.js +36 -0
- package/dist/calendarSetup-CI3AACVo.js +3892 -0
- package/dist/childProcess-Cv8rJuUf.js +32 -0
- package/dist/childSession-BrDCrNtL.js +25 -0
- package/dist/{classifier-shared-jXm-plIK.js → classifier-shared-DFprgrML.js} +5 -5
- package/dist/{cloudflare-workers-ai-system-one-B0wH6HU5.js → cloudflare-workers-ai-system-one-B0MD19yZ.js} +3 -3
- package/dist/{codemode-CFVDmyGm.js → codemode-LpcMFMYM.js} +1 -1
- package/dist/coerce-DM9YrILC.js +13 -0
- package/dist/config-DeWkdjj7.js +1372 -0
- package/dist/contextContributions-C1bsEJef.js +13 -0
- package/dist/contracts-CW8o6Xyi.js +19 -0
- package/dist/contracts-WRa9e98H.js +40 -0
- package/dist/cordisHost-_-jtkneB.js +25 -0
- package/dist/delegation-B2rBgv8A.js +100 -0
- package/dist/{diagnostics-DPTP-yrt.js → diagnostics-BY5LXbHJ.js} +2 -2
- package/dist/{dist-BVBi6VMV.js → dist-B2ArMqge.js} +1 -1
- package/dist/{server-Cg07O2W6.js → dist-C6IqjC-m.js} +1 -546
- package/dist/{dist-PDDFdqDX.js → dist-CDz5dYMj.js} +1 -1
- package/dist/{dist-Dvx5mlIR.js → dist-kgi2Ix1y.js} +16 -3
- package/dist/{emscripten-module.cloudflare-D4Bc9Ykz.js → emscripten-module.cloudflare-B4fhfquU.js} +1 -1
- package/dist/{env-api-keys-CAnjjnsR.js → env-api-keys-BgCPpU9t.js} +1 -1
- package/dist/{error-body-DQZRsyL5.js → error-body-CeumezyR.js} +26 -4
- package/dist/esm-BKJy3O9-.js +1553 -0
- package/dist/{remoteMcp-DqE2xFWS.js → exports-BEEgtkya.js} +1588 -714
- package/dist/{exports-LjvSY7Y6.js → exports-CBp_9dVk.js} +47 -28
- package/dist/exports-CRjRvvX0.js +34 -0
- package/dist/exports-Cg0wxflf.js +1 -0
- package/dist/exports-Ct56PRB9.js +46 -0
- package/dist/extensionFile-B940JOEn.js +121 -0
- package/dist/{factory-Cs8iaUtc.js → factory-BU0cZY0I.js} +1 -1
- package/dist/{github-copilot-headers-DpQQAh-s.js → github-copilot-headers-Cq9pnpl2.js} +1 -1
- package/dist/{google-generative-ai-BTTOo5RQ.js → google-generative-ai-DmbUlCGv.js} +9 -9
- package/dist/{google-shared-S7bqOccz.js → google-shared-Diz2uk39.js} +6 -6
- package/dist/{google-vertex-BcMU_DMb.js → google-vertex-CGCpI9Po.js} +10 -10
- package/dist/{domains-B6Ae4swm.js → harnessState-Df--jB5z.js} +162 -42
- package/dist/{harnessStore-Ccbia9_u.js → harnessStore-DInwiLYb.js} +4 -5
- package/dist/{hash-B3RRpLS2.js → hash-IQBoLxOB.js} +1 -1
- package/dist/{headers-BEuxFxDI.js → headers-Dkgiqogr.js} +1 -1
- package/dist/help-C9UGKetC.js +100 -0
- package/dist/home-kwZFHqOx.js +60 -0
- package/dist/http-BekstF5S.js +64 -0
- package/dist/hubChannel-Dldv3EEb.js +32 -0
- package/dist/hubRevisions-BPoC6quI.js +364 -0
- package/dist/{identity-BIeAyilV.js → identity-BzB1N-Sn.js} +3 -3
- package/dist/index.edge-BiVQ9LoZ.js +198 -0
- package/dist/index.edge-CSGx6QOL.js +56 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/index.edge-CzoLWbyl.js +238 -0
- package/dist/index.edge-D1biKw71.js +946 -0
- package/dist/index.edge-D2RirEwK.js +14 -0
- package/dist/iso-BGFmgtky.js +27 -0
- package/dist/{kysely-adapter-D51abb3q.js → kysely-adapter-D8KUrWxm.js} +1 -1
- package/dist/liquid.browser-1BcykmIN.js +4596 -0
- package/dist/manualTranscription-DN56fzgj.js +96 -0
- package/dist/{mcpProjection-BXiECnW0.js → mcpProjection-D2U50Pel.js} +1 -2
- package/dist/meta-CVgfTHQP.js +1030 -0
- package/dist/migrations-DJBPDwSR.js +32 -0
- package/dist/{mistral-conversations-DN8VSERk.js → mistral-conversations-Bv_m1MRF.js} +12 -12
- package/dist/modeDefinition-Di95_IiU.js +44 -0
- package/dist/{models-D6d73jcW.js → models-D50yN8Ag.js} +41 -46
- package/dist/{node-UuMT2C3q.js → node-B4kSjHeD.js} +2 -2
- package/dist/{node-DytJOfYf.js → node-CBLSc-YH.js} +1 -1
- package/dist/notification-DjxbNoMR.js +143 -0
- package/dist/{openai-bt3ZRBZv.js → openai-D6Q-l6hT.js} +187 -187
- package/dist/{openai-codex-responses-cL36x0ml.js → openai-codex-responses-BnoiTqYV.js} +21 -25
- package/dist/{openai-completions-BWsTNYyT.js → openai-completions-C68qs5rI.js} +26 -19
- package/dist/{openai-decisions-Dfn_KgQd.js → openai-decisions-BSxU_aoV.js} +3 -3
- package/dist/{openai-responses-aa0LoyCJ.js → openai-responses-D6hXen-k.js} +17 -15
- package/dist/{openai-responses-shared-H-jH5SlM.js → openai-responses-shared-BD8K7FAC.js} +7 -7
- package/dist/{openrouter-cost-D99Qqcs6.js → openrouter-cost-BPam8wyW.js} +1 -1
- package/dist/{openrouter-images-BpwVpALC.js → openrouter-images-DylXiHy7.js} +7 -7
- package/dist/{hubChannel-Dn5NMpvu.js → packageApi-DYkaxP59.js} +33 -42
- package/dist/photon_rs_bg.wasm +0 -0
- package/dist/{pi-messages-BHAIkYBj.js → pi-messages-DaIlYYlO.js} +6 -6
- package/dist/piConfig-5tRPD0ov.js +126 -0
- package/dist/piSettings-ekBG5OeF.js +1 -0
- package/dist/platform-CQahdzpG.js +138 -0
- package/dist/pluginCatalog-BAALyedS.js +30 -0
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/pluginProtocol-7_gVUeM9.js +1 -0
- package/dist/pluginProtocol-DVIfJnav.js +135 -0
- package/dist/portableConfig-0tnk9anb.js +49 -0
- package/dist/presetConfig-n-oiNd3h.js +541 -0
- package/dist/profileSources-D1rymC97.js +537 -0
- package/dist/{protocol-DUeE0Q8z.js → protocol-Cri0GpZR.js} +1 -2
- package/dist/{provider-env-DgfpjgTa.js → provider-env-DJb40UF7.js} +2 -2
- package/dist/{provider-retry-ChD-K2Gv.js → provider-retry-jpvs7ixx.js} +1 -1
- package/dist/{puppeteer-cloudflare-B-GHrPGO.js → puppeteer-cloudflare-D4l8smMS.js} +3 -3
- package/dist/{server-BWJmxCrm.js → readiness-Ydw5zrKy.js} +4 -169
- package/dist/{rolldown-runtime-B-lAHAz2.js → rolldown-runtime-DbVrKiKs.js} +1 -1
- package/dist/{sanitize-unicode-Dl4ROF7y.js → sanitize-unicode-B1ZFaEtf.js} +1 -1
- package/dist/scaffoldRegistry-CeFe3Pf0.js +1240 -0
- package/dist/{schemas-Vj8-rCR4.js → schemas-D2dRon18.js} +1901 -53
- package/dist/server-AKM07WcM.js +466 -0
- package/dist/server-B0tM5Ygf.js +1300 -0
- package/dist/server-B8-vStCx.js +1116 -0
- package/dist/server-BAbdiL38.js +15108 -0
- package/dist/server-BCZ_R3kX.js +3326 -0
- package/dist/server-BGKAeB3M.js +492 -0
- package/dist/server-BIQhg1jS.js +26985 -0
- package/dist/server-BcPD_6a2.js +1533 -0
- package/dist/server-BeoA0QB-.js +580 -0
- package/dist/server-BsgvOpBF.js +24 -0
- package/dist/server-BtnOqSB5.js +156 -0
- package/dist/server-C-HBjWRo.js +2800 -0
- package/dist/{server-CWg0m_wq.js → server-C0Lt6nTt.js} +269 -1062
- package/dist/server-C8NPfG1H.js +148 -0
- package/dist/server-CKkaxOc0.js +978 -0
- package/dist/server-CMaWF5UA.js +1379 -0
- package/dist/server-CQPI6jIa.js +295 -0
- package/dist/{server-BhYE7Vqk.js → server-CQmb0lYL.js} +114 -176
- package/dist/server-CWR34Vx6.js +1884 -0
- package/dist/server-CZiAy2v5.js +641 -0
- package/dist/server-Cjtr0oVJ.js +584 -0
- package/dist/server-CkJQJ3Oo.js +571 -0
- package/dist/server-ClQQGtsI.js +679 -0
- package/dist/server-Cy2FhGBm.js +1744 -0
- package/dist/server-D8yEblCB.js +24 -0
- package/dist/server-DF0YIUeI.js +9603 -0
- package/dist/server-DRFESCq1.js +1527 -0
- package/dist/{server-zkcrP99W.js → server-Df1defzp.js} +89 -87
- package/dist/server-DgZd_TuT.js +189 -0
- package/dist/server-Dkc9Kth2.js +1830 -0
- package/dist/server-DlRePYOB.js +343 -0
- package/dist/{server-BpPEzRes.js → server-_HZm8wEC.js} +654 -745
- package/dist/{server-yABhJa2K.js → server-_jWkMESg.js} +60 -39
- package/dist/server-lgV6liTt.js +140 -0
- package/dist/server-nHPXbRDA.js +742 -0
- package/dist/server-p7qANgrf.js +877 -0
- package/dist/server-vhmQi3co.js +112 -0
- package/dist/{server-SA0dsIJ2.js → server-w1aKMZOs.js} +3 -10
- package/dist/serverPlugin-4nI5J6Zt.js +39622 -0
- package/dist/session-resources-BvR3cwiH.js +10 -0
- package/dist/{sessionConfig-DgnPcGBu.js → sessionConfig-UMlgu98q.js} +926 -844
- package/dist/{simple-options-DWrW31_K.js → simple-options-Cp5p46f9.js} +13 -6
- package/dist/space-C3Wnli1l.js +92 -0
- package/dist/sse-XlzXs1es.js +151 -0
- package/dist/{streaming-json-t4rzNHEp.js → streaming-json-CZyrX_Ux.js} +6 -6
- package/dist/{system-one-shared-DLVLdzYL.js → system-one-shared-Du6bka0h.js} +3 -3
- package/dist/{notification-valMY1zH.js → telemetry-CrTcxeA5.js} +2 -93
- package/dist/{transform-messages-CjTSwW9q.js → transform-messages-CBj9g2mx.js} +3 -16
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/{server-BXjfQYeU.js → type-DppaYz6F.js} +955 -1187
- package/dist/type-yokaDI_F.js +7 -0
- package/dist/{typesafe-system-one-DBVcjcUQ.js → typesafe-system-one-C7YFgvrX.js} +3 -3
- package/dist/{uuid-mkNGilLv.js → uuid-BVI0BZsx.js} +1 -1
- package/dist/{validation-BLnxgJU_.js → validation-QWuk6kwJ.js} +79 -74
- package/dist/vaultSettings-Bq8wkbDv.js +292 -0
- package/dist/voiceTools-BdJyfzwB.js +246 -0
- package/dist/web-B2sdV-F2.js +4 -0
- package/dist/worker.js +97821 -72579
- package/dist/workflow-DTCt4n6k.js +171 -0
- package/dist/workflowServices-RlswfHWp.js +300 -0
- package/package.json +55 -25
- package/wrangler.jsonc +16 -3
- package/dist/apiContracts-sG5b90Qa.js +0 -4451
- package/dist/assets/assets/channel-BOT7In0s.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-Dp9-QbR6.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-B9D9uWwn.js +0 -1
- package/dist/assets/assets/index-BlPEYpuN.css +0 -1
- package/dist/assets/assets/index-DS9w_Q1B.js +0 -155
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-CyUKtW7v.js +0 -9
- package/dist/assets/plugins/assets/base-DyDpY0zD.css +0 -2
- package/dist/assets/plugins/chunks/po-web-runtime-4JiBsb_c.js +0 -1
- package/dist/assets/plugins/slots/approval.09e72f36-DwFz-UMh.js +0 -2
- package/dist/assets/plugins/slots/artifacts.50b639bb-CUtFC806.js +0 -1
- package/dist/assets/plugins/slots/builtin-tools.75108f21-B69GLfY_.js +0 -7
- package/dist/assets/plugins/slots/codemode.c58fb583-C0Gmb7_s.js +0 -9
- package/dist/assets/plugins/slots/domain.753f9f92-BTBYRLkE.js +0 -1
- package/dist/assets/plugins/slots/mcp.82cc1ff5-Ecacjn0a.js +0 -109
- package/dist/assets/plugins/slots/profile.ab16dcec-DIVXNHmh.js +0 -1
- package/dist/assets/plugins/slots/skill.62a0a1b3-BNr7DmPH.js +0 -4
- package/dist/backgroundWork-CSpsJ-Rg.js +0 -25
- package/dist/contextProjection-DDIQRgN4.js +0 -188
- package/dist/extensionFile-CacKVegY.js +0 -409
- package/dist/harnessState-gmzJcPGt.js +0 -88
- package/dist/harnessStore-Ch6hdYYe.js +0 -1
- package/dist/index.edge-BgSx_gRO.js +0 -45
- package/dist/majorModes-CCnwAjfF.js +0 -333
- package/dist/majorModes-DNQbxkpt.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/platform-Bs2_X_dK.js +0 -16
- package/dist/platformFiles-CCGujP9o.js +0 -39
- package/dist/server-5hLs7M43.js +0 -656
- package/dist/server-B3iqBHOP.js +0 -118
- package/dist/server-Dv0EKLwc.js +0 -108
- package/dist/server-Y5A21sJf.js +0 -591
- package/dist/server-a1K226XK.js +0 -279
- package/dist/serverPlugin-DUc4gGep.js +0 -7279
- package/dist/value-Bd477RDX.js +0 -2247
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as ToolCallArgumentsStream, r as parseJsonWithRepair } from "./streaming-json-
|
|
6
|
-
import { i as AssistantMessageEventStream, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
7
|
-
import { t as getProviderEnvValue } from "./provider-env-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-DbVrKiKs.js";
|
|
2
|
+
import { l as renderSystemMessageUpdate, n as getIdentityHeaders, s as getSystemMessageText } from "./identity-BzB1N-Sn.js";
|
|
3
|
+
import { n as buildBaseOptions, r as clampMaxTokensToContext, t as adjustMaxTokensForThinking } from "./simple-options-Cp5p46f9.js";
|
|
4
|
+
import { g as getInitialSystemMessage, m as getCurrentTools, t as calculateCost, v as resolveTranscript } from "./models-D50yN8Ag.js";
|
|
5
|
+
import { n as ToolCallArgumentsStream, r as parseJsonWithRepair } from "./streaming-json-CZyrX_Ux.js";
|
|
6
|
+
import { i as AssistantMessageEventStream, t as appendAssistantMessageDiagnostic } from "./diagnostics-BY5LXbHJ.js";
|
|
7
|
+
import { t as getProviderEnvValue } from "./provider-env-DJb40UF7.js";
|
|
8
|
+
import { t as registerSessionResourceCleanup } from "./session-resources-BvR3cwiH.js";
|
|
9
|
+
import { c as ANTHROPIC_WORKSPACE_ID_ENV, i as ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, o as ANTHROPIC_ORGANIZATION_ID_ENV, r as ANTHROPIC_FEDERATION_RULE_ID_ENV, s as ANTHROPIC_SERVICE_ACCOUNT_ID_ENV } from "./env-api-keys-BgCPpU9t.js";
|
|
10
|
+
import { i as withCauseDetail } from "./error-body-CeumezyR.js";
|
|
11
|
+
import { t as shortHash } from "./hash-IQBoLxOB.js";
|
|
12
|
+
import { t as headersToRecord } from "./headers-Dkgiqogr.js";
|
|
13
|
+
import { n as isOpenRouterModel, t as applyOpenRouterReportedCost } from "./openrouter-cost-BPam8wyW.js";
|
|
14
|
+
import { t as retryProviderRequest } from "./provider-retry-jpvs7ixx.js";
|
|
15
|
+
import { t as sanitizeSurrogates } from "./sanitize-unicode-B1ZFaEtf.js";
|
|
16
|
+
import { c as prefersJsonSchemaStrictSampling, n as transformMessages, s as getJsonSchemaToolParameters, t as splitErrorToolResultImages, u as resolveJsonSchemaStrictSampling } from "./transform-messages-CBj9g2mx.js";
|
|
17
|
+
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-Cq9pnpl2.js";
|
|
15
18
|
//#region ../../../node_modules/.pnpm/@anthropic-ai+sdk@0.129.0_zod@4.6.7/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
16
19
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
17
20
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -824,7 +827,7 @@ function redactSensitive(body) {
|
|
|
824
827
|
*/
|
|
825
828
|
async function checkCredentialsFileSafety(path, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) {
|
|
826
829
|
if (typeof process === "undefined" || process.platform === "win32") return;
|
|
827
|
-
const { fs } = await import("./node-
|
|
830
|
+
const { fs } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
828
831
|
let resolved = path;
|
|
829
832
|
let st;
|
|
830
833
|
try {
|
|
@@ -844,7 +847,7 @@ async function checkCredentialsFileSafety(path, onWarn = (m) => console.warn(`an
|
|
|
844
847
|
* Creates the parent directory with mode 0700 and the file with mode 0600.
|
|
845
848
|
*/
|
|
846
849
|
async function writeCredentialsFileAtomic(targetPath, data) {
|
|
847
|
-
const { fs, path } = await import("./node-
|
|
850
|
+
const { fs, path } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
848
851
|
const dir = path.dirname(targetPath);
|
|
849
852
|
await fs.promises.mkdir(dir, {
|
|
850
853
|
recursive: true,
|
|
@@ -1177,7 +1180,7 @@ const loadConfigWithSource = async (profile) => {
|
|
|
1177
1180
|
const profileName = profile ?? await getActiveProfileName();
|
|
1178
1181
|
if (profileName === null) return null;
|
|
1179
1182
|
validateProfileName(profileName);
|
|
1180
|
-
const { fs, path } = await import("./node-
|
|
1183
|
+
const { fs, path } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1181
1184
|
const configPath = path.join(rootConfigPath, "configs", `${profileName}.json`);
|
|
1182
1185
|
let configRaw;
|
|
1183
1186
|
try {
|
|
@@ -1254,12 +1257,12 @@ const getCredentialsPath = async (config, profile) => {
|
|
|
1254
1257
|
const profileName = profile ?? await getActiveProfileName();
|
|
1255
1258
|
if (!profileName) return null;
|
|
1256
1259
|
validateProfileName(profileName);
|
|
1257
|
-
const { path } = await import("./node-
|
|
1260
|
+
const { path } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1258
1261
|
return path.join(rootConfigPath, "credentials", `${profileName}.json`);
|
|
1259
1262
|
};
|
|
1260
1263
|
const getRootConfigPath = async () => {
|
|
1261
1264
|
if (!supportsLocalConfigFiles()) return null;
|
|
1262
|
-
const { path } = await import("./node-
|
|
1265
|
+
const { path } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1263
1266
|
const configDir = readEnv("ANTHROPIC_CONFIG_DIR");
|
|
1264
1267
|
if (configDir) return configDir;
|
|
1265
1268
|
if (getPlatformHeaders()["X-Stainless-OS"] === "Windows") {
|
|
@@ -1284,7 +1287,7 @@ const getActiveProfileName = async () => {
|
|
|
1284
1287
|
if (!rootConfigPath) return null;
|
|
1285
1288
|
const profileName = readEnv("ANTHROPIC_PROFILE");
|
|
1286
1289
|
if (profileName) return profileName;
|
|
1287
|
-
const { fs, path } = await import("./node-
|
|
1290
|
+
const { fs, path } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1288
1291
|
const filePath = path.join(rootConfigPath, "active_config");
|
|
1289
1292
|
try {
|
|
1290
1293
|
return (await fs.promises.readFile(filePath, "utf-8")).trim() || "default";
|
|
@@ -1302,7 +1305,7 @@ const getActiveProfileName = async () => {
|
|
|
1302
1305
|
function identityTokenFromFile(path) {
|
|
1303
1306
|
if (!path) throw new AnthropicError("Identity token file path is empty");
|
|
1304
1307
|
return async () => {
|
|
1305
|
-
const { fs } = await import("./node-
|
|
1308
|
+
const { fs } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1306
1309
|
let content;
|
|
1307
1310
|
try {
|
|
1308
1311
|
content = await fs.promises.readFile(path, "utf-8");
|
|
@@ -1390,7 +1393,7 @@ function oidcFederationProvider(config) {
|
|
|
1390
1393
|
*/
|
|
1391
1394
|
function userOAuthProvider(config) {
|
|
1392
1395
|
return async (opts) => {
|
|
1393
|
-
const { fs } = await import("./node-
|
|
1396
|
+
const { fs } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1394
1397
|
await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning);
|
|
1395
1398
|
let raw;
|
|
1396
1399
|
try {
|
|
@@ -1567,7 +1570,7 @@ function resolveIdentityTokenProvider(auth) {
|
|
|
1567
1570
|
*/
|
|
1568
1571
|
function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) {
|
|
1569
1572
|
return async (opts) => {
|
|
1570
|
-
const { fs } = await import("./node-
|
|
1573
|
+
const { fs } = await import("./node-CBLSc-YH.js").then((n) => n.i);
|
|
1571
1574
|
await checkCredentialsFileSafety(credentialsPath, onSafetyWarning);
|
|
1572
1575
|
let existing;
|
|
1573
1576
|
try {
|
|
@@ -3299,8 +3302,8 @@ var UserProfiles = class extends APIResource {
|
|
|
3299
3302
|
};
|
|
3300
3303
|
//#endregion
|
|
3301
3304
|
//#region ../../../node_modules/.pnpm/@stablelib+base64@1.0.1/node_modules/@stablelib/base64/lib/base64.js
|
|
3302
|
-
var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3303
|
-
var __extends =
|
|
3305
|
+
var require_base64 = /* @__PURE__ */ __commonJSMin(((exports, module, this$2) => {
|
|
3306
|
+
var __extends = this$2 && this$2.__extends || (function() {
|
|
3304
3307
|
var extendStatics = function(d, b) {
|
|
3305
3308
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
3306
3309
|
d.__proto__ = b;
|
|
@@ -3500,22 +3503,22 @@ var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3500
3503
|
}));
|
|
3501
3504
|
//#endregion
|
|
3502
3505
|
//#region ../../../node_modules/.pnpm/fast-sha256@1.3.0/node_modules/fast-sha256/sha256.js
|
|
3503
|
-
var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3506
|
+
var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
3504
3507
|
(function(root, factory) {
|
|
3505
|
-
var exports
|
|
3506
|
-
factory(exports
|
|
3507
|
-
var sha256 = exports
|
|
3508
|
-
for (var k in exports
|
|
3508
|
+
var exports = {};
|
|
3509
|
+
factory(exports);
|
|
3510
|
+
var sha256 = exports["default"];
|
|
3511
|
+
for (var k in exports) sha256[k] = exports[k];
|
|
3509
3512
|
if (typeof module === "object" && typeof module.exports === "object") module.exports = sha256;
|
|
3510
3513
|
else if (typeof define === "function" && define.amd) define(function() {
|
|
3511
3514
|
return sha256;
|
|
3512
3515
|
});
|
|
3513
3516
|
else root.sha256 = sha256;
|
|
3514
|
-
})(
|
|
3517
|
+
})(this$1, function(exports) {
|
|
3515
3518
|
"use strict";
|
|
3516
|
-
exports
|
|
3517
|
-
exports
|
|
3518
|
-
exports
|
|
3519
|
+
exports.__esModule = true;
|
|
3520
|
+
exports.digestLength = 32;
|
|
3521
|
+
exports.blockSize = 64;
|
|
3519
3522
|
var K = new Uint32Array([
|
|
3520
3523
|
1116352408,
|
|
3521
3524
|
1899447441,
|
|
@@ -3631,8 +3634,8 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3631
3634
|
}
|
|
3632
3635
|
var Hash = function() {
|
|
3633
3636
|
function Hash() {
|
|
3634
|
-
this.digestLength = exports
|
|
3635
|
-
this.blockSize = exports
|
|
3637
|
+
this.digestLength = exports.digestLength;
|
|
3638
|
+
this.blockSize = exports.blockSize;
|
|
3636
3639
|
this.state = /* @__PURE__ */ new Int32Array(8);
|
|
3637
3640
|
this.temp = /* @__PURE__ */ new Int32Array(64);
|
|
3638
3641
|
this.buffer = /* @__PURE__ */ new Uint8Array(128);
|
|
@@ -3729,7 +3732,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3729
3732
|
};
|
|
3730
3733
|
return Hash;
|
|
3731
3734
|
}();
|
|
3732
|
-
exports
|
|
3735
|
+
exports.Hash = Hash;
|
|
3733
3736
|
var HMAC = function() {
|
|
3734
3737
|
function HMAC(key) {
|
|
3735
3738
|
this.inner = new Hash();
|
|
@@ -3778,22 +3781,22 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3778
3781
|
};
|
|
3779
3782
|
return HMAC;
|
|
3780
3783
|
}();
|
|
3781
|
-
exports
|
|
3784
|
+
exports.HMAC = HMAC;
|
|
3782
3785
|
function hash(data) {
|
|
3783
3786
|
var h = new Hash().update(data);
|
|
3784
3787
|
var digest = h.digest();
|
|
3785
3788
|
h.clean();
|
|
3786
3789
|
return digest;
|
|
3787
3790
|
}
|
|
3788
|
-
exports
|
|
3789
|
-
exports
|
|
3791
|
+
exports.hash = hash;
|
|
3792
|
+
exports["default"] = hash;
|
|
3790
3793
|
function hmac(key, data) {
|
|
3791
3794
|
var h = new HMAC(key).update(data);
|
|
3792
3795
|
var digest = h.digest();
|
|
3793
3796
|
h.clean();
|
|
3794
3797
|
return digest;
|
|
3795
3798
|
}
|
|
3796
|
-
exports
|
|
3799
|
+
exports.hmac = hmac;
|
|
3797
3800
|
function fillBuffer(buffer, hmac, info, counter) {
|
|
3798
3801
|
var num = counter[0];
|
|
3799
3802
|
if (num === 0) throw new Error("hkdf: cannot expand more");
|
|
@@ -3804,7 +3807,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3804
3807
|
hmac.finish(buffer);
|
|
3805
3808
|
counter[0]++;
|
|
3806
3809
|
}
|
|
3807
|
-
var hkdfSalt = new Uint8Array(exports
|
|
3810
|
+
var hkdfSalt = new Uint8Array(exports.digestLength);
|
|
3808
3811
|
function hkdf(key, salt, info, length) {
|
|
3809
3812
|
if (salt === void 0) salt = hkdfSalt;
|
|
3810
3813
|
if (length === void 0) length = 32;
|
|
@@ -3825,7 +3828,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3825
3828
|
counter.fill(0);
|
|
3826
3829
|
return out;
|
|
3827
3830
|
}
|
|
3828
|
-
exports
|
|
3831
|
+
exports.hkdf = hkdf;
|
|
3829
3832
|
function pbkdf2(password, salt, iterations, dkLen) {
|
|
3830
3833
|
var prf = new HMAC(password);
|
|
3831
3834
|
var len = prf.digestLength;
|
|
@@ -3856,7 +3859,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3856
3859
|
prf.clean();
|
|
3857
3860
|
return dk;
|
|
3858
3861
|
}
|
|
3859
|
-
exports
|
|
3862
|
+
exports.pbkdf2 = pbkdf2;
|
|
3860
3863
|
});
|
|
3861
3864
|
}));
|
|
3862
3865
|
//#endregion
|
|
@@ -5457,7 +5460,7 @@ var EnvironmentWorker = /* @__PURE__ */ (() => {
|
|
|
5457
5460
|
const ctrl = new AbortController();
|
|
5458
5461
|
const detachExternal = linkAbort(externalSignal, ctrl);
|
|
5459
5462
|
const lease = new Lease(ctrl);
|
|
5460
|
-
const agentToolset = await import("./node-
|
|
5463
|
+
const agentToolset = await import("./node-B4kSjHeD.js");
|
|
5461
5464
|
let leaseTtlMs;
|
|
5462
5465
|
let runner;
|
|
5463
5466
|
const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => {
|
|
@@ -13237,7 +13240,53 @@ var Anthropic = /* @__PURE__ */ (() => {
|
|
|
13237
13240
|
return Anthropic;
|
|
13238
13241
|
})();
|
|
13239
13242
|
//#endregion
|
|
13240
|
-
//#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.
|
|
13243
|
+
//#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_2cda1eab05bf8d95071bf4a1067b9ed2/node_modules/@earendil-works/pi-ai/dist/api/strict-tool-limits.js
|
|
13244
|
+
/**
|
|
13245
|
+
* Claude rejects (on the Anthropic API and on Bedrock) a request whose strict tools exceed its limits with one of these
|
|
13246
|
+
* messages. Observed limits: 20 strict tools, and 16 optional or union-typed parameters across all strict tools.
|
|
13247
|
+
*/
|
|
13248
|
+
const STRICT_TOOL_LIMIT_ERROR_MESSAGES = [
|
|
13249
|
+
"The compiled grammar is too large",
|
|
13250
|
+
"Too many strict tools (",
|
|
13251
|
+
"Schemas contains too many parameters with union types ("
|
|
13252
|
+
];
|
|
13253
|
+
/** Returns true when a provider error message says the request's strict tools exceed the provider's limits. */
|
|
13254
|
+
function isStrictToolLimitErrorMessage(message) {
|
|
13255
|
+
return STRICT_TOOL_LIMIT_ERROR_MESSAGES.some((limitMessage) => message.includes(limitMessage));
|
|
13256
|
+
}
|
|
13257
|
+
/**
|
|
13258
|
+
* Sessions whose strict tools Claude rejected for exceeding its limits. Their later requests send `strict: "prefer"`
|
|
13259
|
+
* tools non-strict right away: the tool set rarely changes between turns, so trying strict again would only repeat
|
|
13260
|
+
* the rejection, and switching back to strict later would rewrite the tool definitions and miss the prompt cache.
|
|
13261
|
+
* Shared by the Anthropic and Bedrock providers, which run the same Claude limits.
|
|
13262
|
+
*/
|
|
13263
|
+
const sessionsOverStrictToolLimits = /* @__PURE__ */ new Set();
|
|
13264
|
+
const MAX_SESSIONS_OVER_STRICT_TOOL_LIMITS = 1e4;
|
|
13265
|
+
/**
|
|
13266
|
+
* Records that a session's strict tools exceeded Claude's limits; does nothing without a session. Keeps at most
|
|
13267
|
+
* `MAX_SESSIONS_OVER_STRICT_TOOL_LIMITS` sessions.
|
|
13268
|
+
*
|
|
13269
|
+
* Entries are normally freed by `cleanupSessionResources(sessionId)` when a session ends. The cap bounds memory for
|
|
13270
|
+
* library users that never call it; a dropped session just pays one more rejection.
|
|
13271
|
+
*/
|
|
13272
|
+
function markStrictToolLimitsExceeded(sessionId) {
|
|
13273
|
+
if (sessionId === void 0) return;
|
|
13274
|
+
sessionsOverStrictToolLimits.add(sessionId);
|
|
13275
|
+
if (sessionsOverStrictToolLimits.size > MAX_SESSIONS_OVER_STRICT_TOOL_LIMITS) {
|
|
13276
|
+
const oldest = sessionsOverStrictToolLimits.values().next().value;
|
|
13277
|
+
if (oldest !== void 0) sessionsOverStrictToolLimits.delete(oldest);
|
|
13278
|
+
}
|
|
13279
|
+
}
|
|
13280
|
+
/** Returns true when an earlier request of this session had its strict tools rejected for exceeding Claude's limits. */
|
|
13281
|
+
function hasExceededStrictToolLimits(sessionId) {
|
|
13282
|
+
return sessionId !== void 0 && sessionsOverStrictToolLimits.has(sessionId);
|
|
13283
|
+
}
|
|
13284
|
+
registerSessionResourceCleanup((sessionId) => {
|
|
13285
|
+
if (sessionId) sessionsOverStrictToolLimits.delete(sessionId);
|
|
13286
|
+
else sessionsOverStrictToolLimits.clear();
|
|
13287
|
+
});
|
|
13288
|
+
//#endregion
|
|
13289
|
+
//#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_2cda1eab05bf8d95071bf4a1067b9ed2/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js
|
|
13241
13290
|
var anthropic_messages_exports = /* @__PURE__ */ __exportAll({
|
|
13242
13291
|
stream: () => stream,
|
|
13243
13292
|
streamSimple: () => streamSimple
|
|
@@ -13263,7 +13312,7 @@ function getCacheControl(model, cacheRetention, env) {
|
|
|
13263
13312
|
}
|
|
13264
13313
|
};
|
|
13265
13314
|
}
|
|
13266
|
-
const claudeCodeVersion = "2.1.
|
|
13315
|
+
const claudeCodeVersion = "2.1.322";
|
|
13267
13316
|
const ccToolLookup = new Map([
|
|
13268
13317
|
"Read",
|
|
13269
13318
|
"Write",
|
|
@@ -13326,6 +13375,7 @@ const SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
|
13326
13375
|
const MID_CONVERSATION_OUTPUT_CONFIG_BETA = "mid-conversation-output-config-2026-07-01";
|
|
13327
13376
|
const THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01";
|
|
13328
13377
|
const INLINE_TOOLS_BETA = "inline-tools-2026-09-15";
|
|
13378
|
+
const MESSAGE_THREADS_BETA = "message-threads-2026-08-12";
|
|
13329
13379
|
/**
|
|
13330
13380
|
* Stable deferred tool declared whenever native tool changes are in use. Anthropic adds
|
|
13331
13381
|
* hidden prompt scaffolding for mid-conversation tool changes; declaring this placeholder
|
|
@@ -13358,9 +13408,164 @@ function getAnthropicCompat(model) {
|
|
|
13358
13408
|
allowEmptySignature: model.compat?.allowEmptySignature ?? false,
|
|
13359
13409
|
supportsStrictTools: model.compat?.supportsStrictTools ?? false,
|
|
13360
13410
|
supportsMidConvoSystemMessages: model.compat?.supportsMidConvoSystemMessages ?? false,
|
|
13361
|
-
supportsMidConvoToolChanges: model.compat?.supportsMidConvoToolChanges ?? false
|
|
13411
|
+
supportsMidConvoToolChanges: model.compat?.supportsMidConvoToolChanges ?? false,
|
|
13412
|
+
supportsMessageThreads: model.compat?.supportsMessageThreads ?? (model.provider === "anthropic" && model.baseUrl.includes("api.anthropic.com"))
|
|
13362
13413
|
};
|
|
13363
13414
|
}
|
|
13415
|
+
/** Per session: where the next request can continue, or "off" after the endpoint rejected threads. */
|
|
13416
|
+
const threadState = /* @__PURE__ */ new Map();
|
|
13417
|
+
const MAX_THREAD_STATE_ENTRIES = 1e4;
|
|
13418
|
+
/** Rejections of a `continue` that a new thread fixes: expired, raced, or a fixed setting changed. */
|
|
13419
|
+
const NEW_THREAD_ERRORS = /* @__PURE__ */ new Set([
|
|
13420
|
+
"thread_not_found",
|
|
13421
|
+
"thread_already_continued",
|
|
13422
|
+
"thread_continue_in_flight",
|
|
13423
|
+
"thread_fingerprint_mismatch"
|
|
13424
|
+
]);
|
|
13425
|
+
/**
|
|
13426
|
+
* Sets a session's thread state, keeping at most `MAX_THREAD_STATE_ENTRIES` sessions.
|
|
13427
|
+
*
|
|
13428
|
+
* State is normally freed by `cleanupSessionResources(sessionId)` when a session ends, as pi's
|
|
13429
|
+
* coding agent does. The cap bounds memory for library users that never call it, for example a
|
|
13430
|
+
* server passing a new `sessionId` per conversation. Dropping the least recently updated session
|
|
13431
|
+
* is cheap: its thread has most likely expired on the server already (after a few minutes idle),
|
|
13432
|
+
* and otherwise its next request just starts a new thread.
|
|
13433
|
+
*/
|
|
13434
|
+
function setThreadState(sessionId, value) {
|
|
13435
|
+
threadState.delete(sessionId);
|
|
13436
|
+
threadState.set(sessionId, value);
|
|
13437
|
+
if (threadState.size > MAX_THREAD_STATE_ENTRIES) {
|
|
13438
|
+
const oldest = threadState.keys().next().value;
|
|
13439
|
+
if (oldest !== void 0) threadState.delete(oldest);
|
|
13440
|
+
}
|
|
13441
|
+
}
|
|
13442
|
+
registerSessionResourceCleanup((sessionId) => {
|
|
13443
|
+
if (sessionId) threadState.delete(sessionId);
|
|
13444
|
+
else threadState.clear();
|
|
13445
|
+
});
|
|
13446
|
+
/**
|
|
13447
|
+
* Hash of everything a `continue` builds on: the settings that must stay the same within a thread
|
|
13448
|
+
* and the messages the server already holds.
|
|
13449
|
+
*
|
|
13450
|
+
* - Settings, as sent: the endpoint (a thread exists on one endpoint only), and the fixed request
|
|
13451
|
+
* fields. A `continue` omits `system` and `tools` and the server keeps the thread's own, so only
|
|
13452
|
+
* this check can notice a change to them, including their cache markers. The server rejects
|
|
13453
|
+
* changes to the other fields with `thread_fingerprint_mismatch`; checking them here saves that
|
|
13454
|
+
* rejected request. A fixed field missing here costs only that rejection, which also starts a
|
|
13455
|
+
* new thread.
|
|
13456
|
+
* - Messages, normalized so messages that mean the same to the API hash the same.
|
|
13457
|
+
*/
|
|
13458
|
+
function hashThreadPrefix(model, params, messages) {
|
|
13459
|
+
const { system, tools, thinking, output_config, tool_choice, betas, fallbacks } = params;
|
|
13460
|
+
const settings = JSON.stringify([
|
|
13461
|
+
model.provider,
|
|
13462
|
+
model.baseUrl,
|
|
13463
|
+
params.model,
|
|
13464
|
+
system,
|
|
13465
|
+
tools,
|
|
13466
|
+
thinking,
|
|
13467
|
+
output_config,
|
|
13468
|
+
tool_choice,
|
|
13469
|
+
betas,
|
|
13470
|
+
fallbacks
|
|
13471
|
+
]);
|
|
13472
|
+
const conversation = JSON.stringify(messages, (key, value) => {
|
|
13473
|
+
if (key === "cache_control") return void 0;
|
|
13474
|
+
if (key === "content" && typeof value === "string") return [{
|
|
13475
|
+
type: "text",
|
|
13476
|
+
text: value
|
|
13477
|
+
}];
|
|
13478
|
+
return value;
|
|
13479
|
+
});
|
|
13480
|
+
return shortHash(settings + conversation);
|
|
13481
|
+
}
|
|
13482
|
+
function createThreadRequest(sessionId, params) {
|
|
13483
|
+
return {
|
|
13484
|
+
sessionId,
|
|
13485
|
+
body: {
|
|
13486
|
+
...params,
|
|
13487
|
+
thread: { type: "create" }
|
|
13488
|
+
}
|
|
13489
|
+
};
|
|
13490
|
+
}
|
|
13491
|
+
function prepareThreadRequest(model, sessionId, params) {
|
|
13492
|
+
const state = threadState.get(sessionId);
|
|
13493
|
+
if (state === "off") return void 0;
|
|
13494
|
+
if (state !== void 0 && params.messages.length > state.prefixCount && hashThreadPrefix(model, params, params.messages.slice(0, state.prefixCount)) === state.prefixHash) {
|
|
13495
|
+
threadState.delete(sessionId);
|
|
13496
|
+
const { system: _system, tools: _tools, ...rest } = params;
|
|
13497
|
+
return {
|
|
13498
|
+
body: {
|
|
13499
|
+
...rest,
|
|
13500
|
+
messages: params.messages.slice(state.prefixCount),
|
|
13501
|
+
thread: {
|
|
13502
|
+
type: "continue",
|
|
13503
|
+
previous_message_id: state.replyId
|
|
13504
|
+
}
|
|
13505
|
+
},
|
|
13506
|
+
sessionId
|
|
13507
|
+
};
|
|
13508
|
+
}
|
|
13509
|
+
return createThreadRequest(sessionId, params);
|
|
13510
|
+
}
|
|
13511
|
+
/** The `error_code` Anthropic puts in `error.details` of thread rejections. */
|
|
13512
|
+
function getThreadErrorCode(error) {
|
|
13513
|
+
const code = error.error?.error?.details?.error_code;
|
|
13514
|
+
return typeof code === "string" ? code : void 0;
|
|
13515
|
+
}
|
|
13516
|
+
/**
|
|
13517
|
+
* Sends a thread request. A rejection about the thread (never a started stream) is resent once in
|
|
13518
|
+
* full: as a new thread when the old one can't be continued, or without `thread` when the endpoint
|
|
13519
|
+
* can't use threads, which also turns threads off for the session. Other errors are passed on.
|
|
13520
|
+
* Returns the response and the thread request that produced it, if any.
|
|
13521
|
+
*/
|
|
13522
|
+
async function sendThreadRequest(thread, params, send, output, signal) {
|
|
13523
|
+
try {
|
|
13524
|
+
return {
|
|
13525
|
+
response: await send(thread.body),
|
|
13526
|
+
thread
|
|
13527
|
+
};
|
|
13528
|
+
} catch (error) {
|
|
13529
|
+
if (signal?.aborted || !(error instanceof Anthropic.APIError)) throw error;
|
|
13530
|
+
const errorCode = getThreadErrorCode(error);
|
|
13531
|
+
const startNewThread = errorCode !== void 0 && NEW_THREAD_ERRORS.has(errorCode);
|
|
13532
|
+
const threadsUnsupported = errorCode === "thread_unsupported_request" || errorCode === void 0 && error.status === 400 && error.message.includes("thread");
|
|
13533
|
+
if (!startNewThread && !threadsUnsupported) throw error;
|
|
13534
|
+
appendAssistantMessageDiagnostic(output, {
|
|
13535
|
+
type: "anthropic_thread_fallback",
|
|
13536
|
+
timestamp: Date.now(),
|
|
13537
|
+
error: { message: error.message },
|
|
13538
|
+
details: { reason: errorCode ?? String(error.status) }
|
|
13539
|
+
});
|
|
13540
|
+
if (startNewThread) {
|
|
13541
|
+
const created = createThreadRequest(thread.sessionId, params);
|
|
13542
|
+
return {
|
|
13543
|
+
response: await send(created.body),
|
|
13544
|
+
thread: created
|
|
13545
|
+
};
|
|
13546
|
+
}
|
|
13547
|
+
const response = await send(params);
|
|
13548
|
+
setThreadState(thread.sessionId, "off");
|
|
13549
|
+
return {
|
|
13550
|
+
response,
|
|
13551
|
+
thread: void 0
|
|
13552
|
+
};
|
|
13553
|
+
}
|
|
13554
|
+
}
|
|
13555
|
+
/**
|
|
13556
|
+
* Records where the session's next request can continue: after `output`, the clean reply to the
|
|
13557
|
+
* thread request `thread`, whose full request was `params`.
|
|
13558
|
+
*/
|
|
13559
|
+
function recordThreadReply(model, thread, params, output, isOAuth, allowEmptySignature) {
|
|
13560
|
+
if (output.responseId === void 0 || output.responseModel !== void 0) return;
|
|
13561
|
+
const reply = convertMessages(transformMessages([output], model, normalizeToolCallId), isOAuth, void 0, allowEmptySignature).messages.filter((message) => message.role === "assistant");
|
|
13562
|
+
const prefix = [...params.messages, ...reply];
|
|
13563
|
+
setThreadState(thread.sessionId, {
|
|
13564
|
+
prefixCount: prefix.length,
|
|
13565
|
+
prefixHash: hashThreadPrefix(model, params, prefix),
|
|
13566
|
+
replyId: output.responseId
|
|
13567
|
+
});
|
|
13568
|
+
}
|
|
13364
13569
|
function mergeHeaders(...headerSources) {
|
|
13365
13570
|
const merged = {};
|
|
13366
13571
|
for (const headers of headerSources) if (headers) Object.assign(merged, headers);
|
|
@@ -13532,7 +13737,8 @@ async function* iterateAnthropicEvents(response, signal) {
|
|
|
13532
13737
|
}
|
|
13533
13738
|
const stream = (model, context, options) => {
|
|
13534
13739
|
const stream = new AssistantMessageEventStream();
|
|
13535
|
-
const
|
|
13740
|
+
const compat = getAnthropicCompat(model);
|
|
13741
|
+
const normalizedContext = resolveTranscript(context, compat.supportsMidConvoSystemMessages);
|
|
13536
13742
|
const currentTools = getCurrentTools(normalizedContext.messages);
|
|
13537
13743
|
(async () => {
|
|
13538
13744
|
const output = {
|
|
@@ -13563,6 +13769,8 @@ const stream = (model, context, options) => {
|
|
|
13563
13769
|
let isOAuth;
|
|
13564
13770
|
let usageModel = model;
|
|
13565
13771
|
let inputTransformations;
|
|
13772
|
+
const cacheSessionId = resolveCacheRetention(options?.cacheRetention, options?.env) === "none" ? void 0 : options?.sessionId;
|
|
13773
|
+
const threadSessionId = compat.supportsMessageThreads ? cacheSessionId : void 0;
|
|
13566
13774
|
if (options?.client) {
|
|
13567
13775
|
client = options.client;
|
|
13568
13776
|
isOAuth = false;
|
|
@@ -13578,7 +13786,6 @@ const stream = (model, context, options) => {
|
|
|
13578
13786
|
hasImages
|
|
13579
13787
|
});
|
|
13580
13788
|
}
|
|
13581
|
-
const cacheSessionId = resolveCacheRetention(options?.cacheRetention, options?.env) === "none" ? void 0 : options?.sessionId;
|
|
13582
13789
|
const created = createClient(model, apiKey, options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId, federation, options?.identity);
|
|
13583
13790
|
client = created.client;
|
|
13584
13791
|
isOAuth = created.isOAuthToken;
|
|
@@ -13588,28 +13795,41 @@ const stream = (model, context, options) => {
|
|
|
13588
13795
|
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
13589
13796
|
maxRetries: 0
|
|
13590
13797
|
};
|
|
13591
|
-
|
|
13798
|
+
const send = (body) => retryProviderRequest(() => client.beta.messages.create(body, requestOptions).asResponse(), {
|
|
13799
|
+
maxRetries: options?.maxRetries,
|
|
13800
|
+
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
13801
|
+
signal: options?.signal
|
|
13802
|
+
});
|
|
13803
|
+
let disablePreferredStrictTools = hasExceededStrictToolLimits(options?.sessionId);
|
|
13592
13804
|
let response;
|
|
13805
|
+
let params;
|
|
13806
|
+
let thread;
|
|
13593
13807
|
for (;;) {
|
|
13594
13808
|
options?.signal?.throwIfAborted();
|
|
13595
|
-
const built = buildParams(model, normalizedContext, isOAuth, options,
|
|
13809
|
+
const built = buildParams(model, normalizedContext, isOAuth, options, {
|
|
13810
|
+
disablePreferredStrictTools,
|
|
13811
|
+
messageThreads: threadSessionId !== void 0
|
|
13812
|
+
});
|
|
13596
13813
|
if (built.providerThinkingLevel) output.providerThinkingLevel = built.providerThinkingLevel;
|
|
13597
|
-
|
|
13814
|
+
params = built.params;
|
|
13598
13815
|
const nextParams = await options?.onPayload?.(params, model);
|
|
13599
13816
|
if (nextParams !== void 0) params = {
|
|
13600
13817
|
...nextParams,
|
|
13601
13818
|
stream: true
|
|
13602
13819
|
};
|
|
13820
|
+
const prepared = threadSessionId !== void 0 && options?.disableContinuation !== true ? prepareThreadRequest(model, threadSessionId, params) : void 0;
|
|
13603
13821
|
try {
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13608
|
-
|
|
13822
|
+
const sent = prepared ? await sendThreadRequest(prepared, params, send, output, options?.signal) : {
|
|
13823
|
+
response: await send(params),
|
|
13824
|
+
thread: void 0
|
|
13825
|
+
};
|
|
13826
|
+
response = sent.response;
|
|
13827
|
+
thread = sent.thread;
|
|
13609
13828
|
break;
|
|
13610
13829
|
} catch (error) {
|
|
13611
13830
|
if (options?.signal?.aborted || disablePreferredStrictTools || !built.hasPreferredStrictTools || !(error instanceof Anthropic.APIError) || error.status !== 400 || error.type !== "invalid_request_error" || !isStrictToolLimitErrorMessage(error.message)) throw error;
|
|
13612
13831
|
disablePreferredStrictTools = true;
|
|
13832
|
+
markStrictToolLimitsExceeded(options?.sessionId);
|
|
13613
13833
|
appendAssistantMessageDiagnostic(output, {
|
|
13614
13834
|
type: "anthropic_strict_tools_fallback",
|
|
13615
13835
|
timestamp: Date.now(),
|
|
@@ -13805,6 +14025,7 @@ const stream = (model, context, options) => {
|
|
|
13805
14025
|
if (options?.signal?.aborted) throw new Error("Request was aborted");
|
|
13806
14026
|
if (output.stopReason === "pending") throw new Error("Anthropic stream ended without a stop reason");
|
|
13807
14027
|
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error(output.errorMessage || "An unknown error occurred");
|
|
14028
|
+
if (thread) recordThreadReply(model, thread, params, output, isOAuth, compat.allowEmptySignature);
|
|
13808
14029
|
if (inputTransformations && inputTransformations.length > 0) appendAssistantMessageDiagnostic(output, {
|
|
13809
14030
|
type: "anthropic_input_transformations",
|
|
13810
14031
|
timestamp: Date.now(),
|
|
@@ -13822,7 +14043,7 @@ const stream = (model, context, options) => {
|
|
|
13822
14043
|
stream.end();
|
|
13823
14044
|
} catch (error) {
|
|
13824
14045
|
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
13825
|
-
output.errorMessage = error instanceof Error ? error
|
|
14046
|
+
output.errorMessage = error instanceof Error ? withCauseDetail(error) : JSON.stringify(error);
|
|
13826
14047
|
stream.push({
|
|
13827
14048
|
type: "error",
|
|
13828
14049
|
reason: output.stopReason,
|
|
@@ -13951,7 +14172,7 @@ function createClient(model, apiKey, optionsHeaders, fetch, dynamicHeaders, sess
|
|
|
13951
14172
|
isOAuthToken: false
|
|
13952
14173
|
};
|
|
13953
14174
|
}
|
|
13954
|
-
function getBetaFeatures(model, context, isOAuthToken, nativeToolChanges,
|
|
14175
|
+
function getBetaFeatures(model, context, options, { isOAuthToken, nativeToolChanges, messageThreads }) {
|
|
13955
14176
|
let configuredFeatures;
|
|
13956
14177
|
for (const headers of [model.headers, options?.headers]) for (const [name, value] of Object.entries(headers ?? {})) if (name.toLowerCase() === "anthropic-beta") configuredFeatures = value;
|
|
13957
14178
|
if (configuredFeatures === null) return [];
|
|
@@ -13963,9 +14184,10 @@ function getBetaFeatures(model, context, isOAuthToken, nativeToolChanges, option
|
|
|
13963
14184
|
if (shouldUseServerSideFallbackBeta(model)) features.push(SERVER_SIDE_FALLBACK_BETA);
|
|
13964
14185
|
if (model.compat?.supportsMidConvoEffort === true) features.push(MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA);
|
|
13965
14186
|
if (nativeToolChanges) features.push(INLINE_TOOLS_BETA);
|
|
14187
|
+
if (messageThreads) features.push(MESSAGE_THREADS_BETA);
|
|
13966
14188
|
return [...new Set(features)];
|
|
13967
14189
|
}
|
|
13968
|
-
function buildParams(model, context, isOAuthToken, options,
|
|
14190
|
+
function buildParams(model, context, isOAuthToken, options, flags) {
|
|
13969
14191
|
const { cacheControl } = getCacheControl(model, options?.cacheRetention, options?.env);
|
|
13970
14192
|
const compat = getAnthropicCompat(model);
|
|
13971
14193
|
const initialSystemMessage = getInitialSystemMessage(context.messages);
|
|
@@ -13974,7 +14196,7 @@ function buildParams(model, context, isOAuthToken, options, disablePreferredStri
|
|
|
13974
14196
|
const conversationMessages = initialSystemMessage ? transformedMessages.slice(1) : transformedMessages;
|
|
13975
14197
|
let hasPreferredStrictTools = false;
|
|
13976
14198
|
const convertToolDefinitions = (tools, toolCacheControl) => {
|
|
13977
|
-
const definitions = convertTools(tools, isOAuthToken, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl, disablePreferredStrictTools);
|
|
14199
|
+
const definitions = convertTools(tools, isOAuthToken, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl, flags.disablePreferredStrictTools);
|
|
13978
14200
|
if (definitions.some((definition, index) => definition.strict === true && prefersJsonSchemaStrictSampling(tools[index]))) hasPreferredStrictTools = true;
|
|
13979
14201
|
return definitions;
|
|
13980
14202
|
};
|
|
@@ -13984,7 +14206,11 @@ function buildParams(model, context, isOAuthToken, options, disablePreferredStri
|
|
|
13984
14206
|
const effortMessages = model.compat?.supportsMidConvoEffort === true && !thinkingDisabled;
|
|
13985
14207
|
const converted = convertMessages(conversationMessages, isOAuthToken, cacheControl, compat.allowEmptySignature, effortMessages ? model.provider : void 0, nativeToolChanges ? convertToolDefinitions : void 0);
|
|
13986
14208
|
const activeEffort = options?.effort ?? "high";
|
|
13987
|
-
const betaFeatures = getBetaFeatures(model, context,
|
|
14209
|
+
const betaFeatures = getBetaFeatures(model, context, options, {
|
|
14210
|
+
isOAuthToken,
|
|
14211
|
+
nativeToolChanges,
|
|
14212
|
+
messageThreads: flags.messageThreads
|
|
14213
|
+
});
|
|
13988
14214
|
const params = {
|
|
13989
14215
|
model: model.id,
|
|
13990
14216
|
messages: effortMessages ? insertThinkingLevelMessages(converted, activeEffort) : converted.messages,
|
|
@@ -14279,7 +14505,9 @@ function convertTools(tools, isOAuthToken, supportsEagerToolInputStreaming, supp
|
|
|
14279
14505
|
const legacyInputSchema = {
|
|
14280
14506
|
type: "object",
|
|
14281
14507
|
properties: schema.properties ?? {},
|
|
14282
|
-
required: schema.required ?? []
|
|
14508
|
+
required: schema.required ?? [],
|
|
14509
|
+
...schema.$defs === void 0 ? {} : { $defs: schema.$defs },
|
|
14510
|
+
...schema.definitions === void 0 ? {} : { definitions: schema.definitions }
|
|
14283
14511
|
};
|
|
14284
14512
|
const inputSchema = strict === true ? {
|
|
14285
14513
|
...parameters,
|