@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.20
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 +4 -3
- package/dist/abort-signals-2GUraIGq.js +34 -0
- package/dist/agent-DTjnYFAN.js +6850 -0
- package/dist/anthropic-messages-5ODquUB-.js +14317 -0
- package/dist/{apiContracts-CHOiCbS_.js → apiContracts-DepyzMNr.js} +94 -81
- package/dist/{approval-BMXqnTYd.js → approval-Biq3NCWj.js} +19 -3
- package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DoHlIPkU.js} +2 -2
- package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-BU8DeV_G.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-BkzARjqu.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-B_dgnlXa.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-DMGAifk0.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DwTSK4lj.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-IRaOcC_u.js} +2 -2
- package/dist/assets/assets/channel-BXwM62E-.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-BvS46crW.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T--n96Xbj0.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-D3h_hFRi.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-Cj18feJl.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-DXsT43bg.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-Br7dX7yf.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-BcozAtPo.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-B8kgXgRq.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-Dn7UnsqE.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-BSJot0vi.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-Cpf1EfZK.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-Dnc36uZR.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-C9Ka5KSI.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-BV8_A7x3.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-C4Ne_31B.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-Dq9ModsA.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-1BWEjXP9.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-DREkvC_x.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-CWziP8nx.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DOoYmcvz.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-OoAtEico.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-B-pl2-iR.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-uKzNJSZ2.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-CEXY_Tzu.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-MKlRQo-g.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-c2qlCEVs.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-DTdqLA6J.js} +2 -2
- package/dist/assets/assets/{dist-B3JXhDWV.js → dist-4TUOlkyl.js} +2 -2
- package/dist/assets/assets/{dist-1-mhYUBH.js → dist-BzTxJnSR.js} +2 -2
- package/dist/assets/assets/{dist-XIZum9n5.js → dist-D9lacOpq.js} +2 -2
- package/dist/assets/assets/{dist-gfbb4ygy.js → dist-DCKskbBE.js} +2 -2
- package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DCc8tQ7G.js} +2 -2
- package/dist/assets/assets/{dist-Izr2SB3q.js → dist-DXlts_H5.js} +2 -2
- package/dist/assets/assets/{dist-DvgCCshF.js → dist-DvZCwSZ8.js} +2 -2
- package/dist/assets/assets/{dist-BabjcJ3j.js → dist-mQUN8X3n.js} +2 -2
- package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-qZHwVT1x.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-C89wxfCd.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-BMBgLOae.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-Bb04CRa4.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-DSyNf2MV.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-DXuTqLUd.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-sB7-pF_t.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-pWPBCmdT.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DronDRed.js} +2 -2
- package/dist/assets/assets/index-CBNQEGK3.css +1 -0
- package/dist/assets/assets/index-DdAdCxGc.js +155 -0
- package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-B375mT1i.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-9Hw3wWP7.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-CdPAuupk.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-hqmaHM9u.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-BdOHplX4.js} +2 -2
- package/dist/assets/assets/{line-BsXJZn93.js → line-BCSC3Bu2.js} +2 -2
- package/dist/assets/assets/{linear-BHYaD5T0.js → linear-D5ddQU3r.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-BaSUi_Ph.js} +4 -4
- package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-CUUsU9Ou.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-BtVkhvIZ.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CQ3OUDwI.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-DDnq-Kn3.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-BvOFTkQB.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-Bdwhl9jD.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-GHKoDEeT.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-Yk9rKkKW.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-Crr2QEwm.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CLrgwBog.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-zWReI6MC.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-CnVnlaHi.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-MJ68mMla.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-BYb-mTCH.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-DzONJsqQ.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-0vav9YWV.js} +2 -2
- package/dist/assets/assets/{src-gihY33R9.js → src-DZJUnjaM.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-B0M8THPh.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-5YJZCHIB.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-aJTRXiIU.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-us1LwUHo.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-BSLlcDre.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-DZ2SwLmk.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-BrmvO_6k.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-FKXSeKp5.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-DZ_vIMp2.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-CfLYNckm.js} +2 -2
- package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-CiS_BB3R.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-DBucwhQh.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +2 -2
- package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -0
- package/dist/assets/plugins/slots/approval.3e4ea6e4-CqQk6XG_.js +2 -0
- package/dist/assets/plugins/slots/artifacts.84980c32-DQlO5IFk.js +1 -0
- package/dist/assets/plugins/slots/autocompact.ec8f713f-B3KTYwW1.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.16ef5e25-CZRYQVIP.js +7 -0
- package/dist/assets/plugins/slots/codemode.5f359b9c-Bzl_K_vt.js +10 -0
- package/dist/assets/plugins/slots/domain.832848c8-CvnpuKCY.js +1 -0
- package/dist/assets/plugins/slots/edit.7c802139-kaxIknZ-.js +7 -0
- package/dist/assets/plugins/slots/files.364f16c9-wuB8gcQA.js +2 -0
- package/dist/assets/plugins/slots/grep.d8bf9f57-3FnU8p-d.js +1 -0
- package/dist/assets/plugins/slots/log.07fd59a4-C0PXQ0O1.js +4 -0
- package/dist/assets/plugins/slots/mcp.ea8b6aa2-D0CkHnIw.js +109 -0
- package/dist/assets/plugins/slots/profile.63bc3ae6-BSY3iYfJ.js +1 -0
- package/dist/assets/plugins/slots/prompts.9d9b47cc-xdCkNkoA.js +3 -0
- package/dist/assets/plugins/slots/read.926c024f-qqaxVlEX.js +1 -0
- package/dist/assets/plugins/slots/runner.5393fa6c-DfO2Z9HG.js +8 -0
- package/dist/assets/plugins/slots/skill.56c1cc07-CL_n-l4h.js +4 -0
- package/dist/assets/plugins/slots/vault.587549ba-DbG3F_on.js +1 -0
- package/dist/assets/pwa/pwa.js +12 -12
- package/dist/assets/pwa/sw.js +4 -4
- package/dist/{atomicJson-BJfPFSYF.js → atomicJson-DCIsEywH.js} +3 -3
- package/dist/azure-openai-config-COZUaRzM.js +55 -0
- package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
- package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-Bswjs1av.js} +1 -1
- package/dist/browser-BWf8OMfl.js +3 -0
- package/dist/childSession-Cf2-kH4O.js +22 -0
- package/dist/classifier-shared-IhSH9hhh.js +106 -0
- package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
- package/dist/{codemode-DbPu0yJN.js → codemode-CgVosRtU.js} +5 -2
- package/dist/contracts-CylyLZC8.js +19 -0
- package/dist/diagnostics-1lYFeSJe.js +131 -0
- package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
- package/dist/dist-Dvx5mlIR.js +50 -0
- package/dist/{domains-BNjGTOPj.js → domains-BqChtBLN.js} +90 -16
- package/dist/env-api-keys-Bow6MJe2.js +32 -0
- package/dist/error-body-CJk7jMUh.js +102 -0
- package/dist/esm-BKJy3O9-.js +1553 -0
- package/dist/{exports-BNZz2DNU.js → exports-C_dclnKs.js} +24 -9
- package/dist/{remoteMcp-CMqZldeA.js → exports-DERO0cQf.js} +1154 -175
- package/dist/{extensionFile-CXOa5G4C.js → extensionFile-Ds7RCpnb.js} +12 -2
- package/dist/github-copilot-headers-D1RedfLn.js +22 -0
- package/dist/google-generative-ai-DXTILNT0.js +328 -0
- package/dist/google-shared-e4JDCTVP.js +19588 -0
- package/dist/google-vertex-a1lzvJfq.js +374 -0
- package/dist/{harnessStore-BT706Ly6.js → harnessStore-BectazJQ.js} +4 -4
- package/dist/harnessStore-C0Zwvny8.js +1 -0
- package/dist/hash-Dt6RIbkn.js +16 -0
- package/dist/headers-CwtEVQvr.js +17 -0
- package/dist/help-Dpm82qDr.js +91 -0
- package/dist/{hubChannel-BHQyzcOo.js → hubChannel-COvmdWGO.js} +11 -28
- package/dist/hubRevisions-58pU2dW5.js +363 -0
- package/dist/identity-BgfHobJH.js +165 -0
- package/dist/index.edge-B0D_Lgbx.js +56 -0
- package/dist/index.edge-BLmsRNW8.js +57 -0
- package/dist/index.edge-COJJ_Dv2.js +937 -0
- package/dist/index.edge-ChYa2LU4.js +14 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/{index.edge-BgSx_gRO.js → index.edge-b0z7PQ6b.js} +10 -5
- package/dist/iso-BPQViXM8.js +10 -0
- package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-pQGjhAks.js} +124 -15
- package/dist/{majorModes-DbCfLZH3.js → majorModes-BrL4EtzH.js} +5 -14
- package/dist/majorModes-WXt22_km.js +1 -0
- package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-pbPBBuvs.js} +2 -2
- package/dist/migrations-5gbLIQIc.js +32 -0
- package/dist/mistral-conversations-CLwhVDjA.js +689 -0
- package/dist/models-Chzm15vC.js +1511 -0
- package/dist/node-BT4GsJQp.js +2479 -0
- package/dist/node-DytJOfYf.js +23 -0
- package/dist/notification-CINsJWDL.js +102 -0
- package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
- package/dist/openai-completions-CcNhAv8l.js +984 -0
- package/dist/openai-decisions-BsFjaAGw.js +142 -0
- package/dist/openai-kPrtlgjl.js +17357 -0
- package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
- package/dist/openai-responses-C5Gp2UOV.js +281 -0
- package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
- package/dist/openrouter-cost-CvC52g3b.js +30 -0
- package/dist/openrouter-images-BoHl8g8p.js +124 -0
- package/dist/photon_rs_bg.wasm +0 -0
- package/dist/pi-messages-BXfrZLC7.js +312 -0
- package/dist/piConfig-BDUpA6w0.js +127 -0
- package/dist/piSettings-tdui0CZI.js +1 -0
- package/dist/{platform-B4AAgwJ0.js → platform-yhQXrrM_.js} +1 -1
- package/dist/{platformFiles-C_bXo4Ig.js → platformFiles-DB3Cw1l_.js} +27 -2
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/{protocol-Xpm_mCNN.js → protocol-B6LbEIe6.js} +2 -2
- package/dist/provider-env-CxhHUFiF.js +38 -0
- package/dist/provider-retry-BUoezuw8.js +79 -0
- package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
- package/dist/sealedChannel-BeWNTWys.js +27 -0
- package/dist/{server-BZh1ZXz_.js → server-1O3JEYO0.js} +8 -19
- package/dist/server-B2G-c0hg.js +639 -0
- package/dist/{server-Dpgh8PDh.js → server-B8P-UkxF.js} +14 -5
- package/dist/server-BR9yl54i.js +2658 -0
- package/dist/{server-tvgQ99rv.js → server-BXFDsLgm.js} +371 -120
- package/dist/{server-BAAL9-NA.js → server-Bt6Zsqo8.js} +3 -10
- package/dist/server-CCwwnpH0.js +148 -0
- package/dist/{server-D4W7EdJY.js → server-Cgym-G0a.js} +16 -16
- package/dist/{server-DJAanjoI.js → server-Ci3ls6LL.js} +492 -103
- package/dist/{server-36iuA3MI.js → server-Ci_BGVwd.js} +3 -3
- package/dist/{server-A-_GFpPr.js → server-CyYesT-G.js} +10 -9
- package/dist/server-CzJjYgVk.js +295 -0
- package/dist/server-DFCXmDed.js +1806 -0
- package/dist/{server-BE6VqEiA.js → server-DL6UyXfJ.js} +19 -12
- package/dist/{server-D8ndq0wL.js → server-DPTp6GXS.js} +11 -9
- package/dist/server-DRcCuj6P.js +217 -0
- package/dist/server-Dgn4el5K.js +190 -0
- package/dist/server-DhkR6ugd.js +577 -0
- package/dist/server-GIQIpf33.js +489 -0
- package/dist/server-OerXqXJT.js +680 -0
- package/dist/server-Re1VNk9s.js +1517 -0
- package/dist/{server-Dt4y1rZD.js → server-V8W5mcGu.js} +6 -6
- package/dist/server-_0288DYR.js +935 -0
- package/dist/server-cStfn1Yv.js +505 -0
- package/dist/server-pY027myK.js +1057 -0
- package/dist/{build-2gFaVEfG.js → serverPlugin-OOfjB8tm.js} +3937 -3
- package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-DfwcUKO2.js} +551 -760
- package/dist/simple-options-CFzI5Pd_.js +156 -0
- package/dist/streaming-json-BWTHTwz-.js +858 -0
- package/dist/system-one-shared-CiIrx29d.js +132 -0
- package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
- package/dist/transform-messages-D77af7Bx.js +356 -0
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/typesafe-system-one-DGxeggJh.js +37 -0
- package/dist/uuid-B0QJx6Kr.js +31 -0
- package/dist/{validation-D77NZBrx.js → validation-DuOGOKEi.js} +2 -2
- package/dist/{value-Djvc2foV.js → value-DyVsxCwZ.js} +1 -1
- package/dist/vaultSettings-BFCRCBM3.js +328 -0
- package/dist/web-cN41ySs9.js +3 -0
- package/dist/worker.js +95189 -49865
- package/dist/workflow-BgwWq0nq.js +79 -0
- package/package.json +32 -22
- package/wrangler.jsonc +2 -2
- package/dist/assets/assets/channel-CMrEzemr.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
- package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
- package/dist/assets/assets/index-DZM68mTk.css +0 -1
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
- package/dist/contextProjection-DVP2Vc5j.js +0 -188
- package/dist/harnessStore-BiH9vSuD.js +0 -1
- package/dist/majorModes-BvWNqoHt.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/server-BZaPPoQp.js +0 -592
- package/dist/server-D75MWDhB.js +0 -118
- package/dist/server-r358hzQg.js +0 -280
- package/dist/serverPlugin-BOI6c6s5.js +0 -3393
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./platform-
|
|
4
|
-
import { a as globalPoConfigPath, i as
|
|
1
|
+
import { bn as getOrThrow, gn as nodeHost } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { i as readTextIfExists } from "./platformFiles-DB3Cw1l_.js";
|
|
3
|
+
import "./platform-yhQXrrM_.js";
|
|
4
|
+
import { a as configFromText, c as globalPoConfigPath, d as repositoryConfigFor, i as composeConfigLayers, l as layerFromText, o as defaultPoConfig, r as absentRepositoryLayer, s as globalPoConfigDirectory, t as readPoConfigSourcesAsync, u as mergeConfigLayers } from "./layeredConfig-pQGjhAks.js";
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
//#region ../../foundations/po-config/src/services/config/index.ts
|
|
@@ -25,6 +25,24 @@ async function readPoConfig(fs, repoRoot, context, options = {}) {
|
|
|
25
25
|
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(await readText$1(fs, repositoryPath, context), repositoryPath);
|
|
26
26
|
return mergeConfigLayers(globalConfig, repositoryConfig, environment);
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The two config files kept apart, with the merge alongside them.
|
|
30
|
+
*
|
|
31
|
+
* `repoRoot` is optional because the global file is complete on its own: a
|
|
32
|
+
* settings surface with no repository in view still has settings to show.
|
|
33
|
+
*/
|
|
34
|
+
async function readPoConfigLayers(fs, repoRoot, context, options = {}) {
|
|
35
|
+
const { homeDirectory, environment } = resolved(options);
|
|
36
|
+
const globalPath = globalPoConfigPath(homeDirectory, environment);
|
|
37
|
+
const repositoryPath = repoRoot === void 0 ? void 0 : repositoryConfigFor(repoRoot, homeDirectory, environment);
|
|
38
|
+
const globalText = await readText$1(fs, globalPath, context);
|
|
39
|
+
const repositoryText = await readText$1(fs, repositoryPath, context);
|
|
40
|
+
const globalLayer = layerFromText(globalPath, globalText);
|
|
41
|
+
const repositoryLayer = repositoryPath === void 0 ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);
|
|
42
|
+
const repositoryConfig = repositoryPath === void 0 ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);
|
|
43
|
+
const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);
|
|
44
|
+
return composeConfigLayers(globalLayer, repositoryLayer, effective);
|
|
45
|
+
}
|
|
28
46
|
const CACHE_DIRECTORY = "plugin-cache";
|
|
29
47
|
const PLUGIN_ID_SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
30
48
|
const NPM_PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
@@ -293,11 +311,27 @@ function catalogEntry(source, description, manifest, marketplace) {
|
|
|
293
311
|
function parseConfiguredRoots(source) {
|
|
294
312
|
if (source.value === void 0) return [];
|
|
295
313
|
const document = requireRecord$1(source.value, `plugins in ${source.filePath}`);
|
|
296
|
-
assertOnlyKeys$1(document, [
|
|
314
|
+
assertOnlyKeys$1(document, [
|
|
315
|
+
"roots",
|
|
316
|
+
"entries",
|
|
317
|
+
"standalone",
|
|
318
|
+
"disabled"
|
|
319
|
+
], `plugins in ${source.filePath}`);
|
|
297
320
|
if (document.roots === void 0) return [];
|
|
298
321
|
if (!Array.isArray(document.roots)) throw new Error(`plugins.roots in ${source.filePath} must be an array`);
|
|
299
322
|
return document.roots.map((root, index) => path.resolve(source.baseDirectory, requireString$1(root, `plugins.roots[${index}] in ${source.filePath}`)));
|
|
300
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* The plugin IDs one source lists under `plugins.standalone` (load in every session) or
|
|
326
|
+
* `plugins.disabled` (never load). Throws on the first invalid value.
|
|
327
|
+
*/
|
|
328
|
+
function parseConfiguredPluginList(source, key) {
|
|
329
|
+
if (source.value === void 0) return [];
|
|
330
|
+
const value = requireRecord$1(source.value, `plugins in ${source.filePath}`)[key];
|
|
331
|
+
if (value === void 0) return [];
|
|
332
|
+
if (!Array.isArray(value)) throw new Error(`plugins.${key} in ${source.filePath} must be an array`);
|
|
333
|
+
return value.map((name, index) => requireString$1(name, `plugins.${key}[${index}] in ${source.filePath}`));
|
|
334
|
+
}
|
|
301
335
|
/** Validates the configured `plugins.entries` of one source. Throws on the first invalid entry. */
|
|
302
336
|
function parseConfiguredEntries(source) {
|
|
303
337
|
if (source.value === void 0) return [];
|
|
@@ -592,16 +626,19 @@ function summarizeDomainSources(sources) {
|
|
|
592
626
|
baseDirectory: source.baseDirectory,
|
|
593
627
|
value: requireRecord(source.document, source.filePath).plugins
|
|
594
628
|
}));
|
|
629
|
+
const collect = (key) => [...new Set(catalogSources.flatMap((source) => parseConfiguredPluginList(source, key)))];
|
|
595
630
|
return {
|
|
596
631
|
aliases,
|
|
597
632
|
domains,
|
|
598
633
|
defaultDomains,
|
|
599
|
-
catalogSources
|
|
634
|
+
catalogSources,
|
|
635
|
+
standalone: collect("standalone"),
|
|
636
|
+
disabled: collect("disabled")
|
|
600
637
|
};
|
|
601
638
|
}
|
|
602
639
|
/** Joins the summary with its plugin catalog and checks the default domains exist. */
|
|
603
640
|
function completeDomainManifest(summary, plugins) {
|
|
604
|
-
const { aliases, domains, defaultDomains } = summary;
|
|
641
|
+
const { aliases, domains, defaultDomains, standalone, disabled } = summary;
|
|
605
642
|
if (defaultDomains) {
|
|
606
643
|
for (const name of expandDomainNames({
|
|
607
644
|
plugins,
|
|
@@ -613,37 +650,57 @@ function completeDomainManifest(summary, plugins) {
|
|
|
613
650
|
plugins,
|
|
614
651
|
domains,
|
|
615
652
|
aliases,
|
|
616
|
-
...defaultDomains ? { defaultDomains } : {}
|
|
653
|
+
...defaultDomains ? { defaultDomains } : {},
|
|
654
|
+
...standalone.length > 0 ? { standalone } : {},
|
|
655
|
+
...disabled.length > 0 ? { disabled } : {}
|
|
617
656
|
};
|
|
618
657
|
}
|
|
619
658
|
function domainNamesOf(manifest) {
|
|
620
659
|
return [.../* @__PURE__ */ new Set([...Object.keys(manifest.domains), ...Object.keys(manifest.aliases)])].sort();
|
|
621
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* Whether to include .claude/skills as shared fallbacks.
|
|
663
|
+
*
|
|
664
|
+
* Shared skills are included unless every selected domain opts out, so mixing a
|
|
665
|
+
* trimmed domain with an untrimmed one cannot strip the untrimmed one's skills.
|
|
666
|
+
*/
|
|
667
|
+
function sharedSkillsFor(manifest, domainNames) {
|
|
668
|
+
const expanded = expandDomainNames(manifest, domainNames);
|
|
669
|
+
if (expanded.length === 0) return true;
|
|
670
|
+
return expanded.some((name) => manifest.domains[name]?.sharedSkills !== false);
|
|
671
|
+
}
|
|
622
672
|
function missingPluginDirectoryMessage(directory) {
|
|
623
673
|
return `${MISSING_PLUGIN_DIRECTORY_ERROR}: ${directory}`;
|
|
624
674
|
}
|
|
625
|
-
/**
|
|
675
|
+
/**
|
|
676
|
+
* Plans named domain plugins, preserving each subset filter, then standalone plugins, then
|
|
677
|
+
* explicit directories. A disabled plugin is left out wherever it is named.
|
|
678
|
+
*/
|
|
626
679
|
function pluginEntrySteps(manifest, domainNames, explicitDirectories, homeDirectory) {
|
|
627
680
|
const steps = [];
|
|
628
681
|
const homePoDirectory = globalPoConfigDirectory(homeDirectory);
|
|
682
|
+
const disabled = new Set(manifest.disabled ?? []);
|
|
683
|
+
const entryFor = (pluginName, plugin) => ({
|
|
684
|
+
name: pluginName,
|
|
685
|
+
directory: pluginDirectoryForSource(plugin.source, homePoDirectory),
|
|
686
|
+
source: plugin.source,
|
|
687
|
+
...plugin.manifest ? { manifest: plugin.manifest } : {},
|
|
688
|
+
...plugin.manifest?.agentPluginSchema === SUPPORTED_AGENT_PLUGIN_SCHEMA ? { skillDiscovery: "direct-children" } : {}
|
|
689
|
+
});
|
|
629
690
|
for (const domainName of expandDomainNames(manifest, domainNames)) {
|
|
630
691
|
const domain = manifest.domains[domainName];
|
|
631
692
|
if (!domain) return [...steps, { error: `${UNKNOWN_DOMAIN_ERROR}: ${domainName}` }];
|
|
632
693
|
for (const selection of domain.plugins ?? []) {
|
|
633
694
|
const isSubset = typeof selection !== "string";
|
|
634
695
|
const pluginName = isSubset ? selection.name : selection;
|
|
696
|
+
if (disabled.has(pluginName)) continue;
|
|
635
697
|
const plugin = manifest.plugins.entries[pluginName];
|
|
636
698
|
if (!plugin) return [...steps, { error: `${UNKNOWN_PLUGIN_ERROR} "${pluginName}" referenced by domain "${domainName}"` }];
|
|
637
|
-
const directory = pluginDirectoryForSource(plugin.source, homePoDirectory);
|
|
638
699
|
steps.push({
|
|
639
700
|
mustBeDirectory: plugin.source.type === "local",
|
|
640
701
|
entry: {
|
|
641
|
-
|
|
642
|
-
directory,
|
|
702
|
+
...entryFor(pluginName, plugin),
|
|
643
703
|
domain: domainName,
|
|
644
|
-
source: plugin.source,
|
|
645
|
-
...plugin.manifest ? { manifest: plugin.manifest } : {},
|
|
646
|
-
...plugin.manifest?.agentPluginSchema === SUPPORTED_AGENT_PLUGIN_SCHEMA ? { skillDiscovery: "direct-children" } : {},
|
|
647
704
|
...isSubset && selection.skills ? { skills: selection.skills } : {},
|
|
648
705
|
...isSubset && selection.agents ? { agents: selection.agents } : {},
|
|
649
706
|
...isSubset && selection.hooks !== void 0 ? { hooks: selection.hooks } : {},
|
|
@@ -652,6 +709,14 @@ function pluginEntrySteps(manifest, domainNames, explicitDirectories, homeDirect
|
|
|
652
709
|
});
|
|
653
710
|
}
|
|
654
711
|
}
|
|
712
|
+
for (const pluginName of manifest.standalone ?? []) {
|
|
713
|
+
const plugin = manifest.plugins.entries[pluginName];
|
|
714
|
+
if (!plugin || disabled.has(pluginName)) continue;
|
|
715
|
+
steps.push({
|
|
716
|
+
mustBeDirectory: plugin.source.type === "local",
|
|
717
|
+
entry: entryFor(pluginName, plugin)
|
|
718
|
+
});
|
|
719
|
+
}
|
|
655
720
|
for (const configuredDirectory of explicitDirectories) {
|
|
656
721
|
const directory = path.resolve(configuredDirectory);
|
|
657
722
|
steps.push({
|
|
@@ -717,6 +782,15 @@ async function loadDomainsAsync(fs, repoRoot, context, homeDirectory = nodeHost.
|
|
|
717
782
|
async function listDomainNamesAsync(fs, repoRoot, context, homeDirectory) {
|
|
718
783
|
return domainNamesOf(await loadDomainsAsync(fs, repoRoot, context, homeDirectory));
|
|
719
784
|
}
|
|
785
|
+
/**
|
|
786
|
+
* Whether to include .claude/skills as shared fallbacks.
|
|
787
|
+
*
|
|
788
|
+
* Shared skills are included unless every selected domain opts out, so mixing a
|
|
789
|
+
* trimmed domain with an untrimmed one cannot strip the untrimmed one's skills.
|
|
790
|
+
*/
|
|
791
|
+
async function resolveSharedSkillsAsync(fs, repoRoot, domainNames, context, homeDirectory) {
|
|
792
|
+
return sharedSkillsFor(await loadDomainsAsync(fs, repoRoot, context, homeDirectory), domainNames);
|
|
793
|
+
}
|
|
720
794
|
/** Resolves named domain plugins while preserving each subset filter. */
|
|
721
795
|
async function resolvePluginEntriesAsync(fs, repoRoot, domainNames, explicitDirectories, context, homeDirectory = nodeHost.homeDirectory()) {
|
|
722
796
|
const manifest = await loadDomainsAsync(fs, repoRoot, context, homeDirectory);
|
|
@@ -733,4 +807,4 @@ async function resolvePluginEntriesAsync(fs, repoRoot, domainNames, explicitDire
|
|
|
733
807
|
return entries;
|
|
734
808
|
}
|
|
735
809
|
//#endregion
|
|
736
|
-
export {
|
|
810
|
+
export { defaultDomainsForMajorMode as a, pluginDirectoryForSource as c, resolveSharedSkillsAsync as i, readPoConfig as l, loadDomainsAsync as n, expandDomainNames as o, resolvePluginEntriesAsync as r, isRemotePluginSource as s, listDomainNamesAsync as t, readPoConfigLayers as u };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_018b33d3c6d4455b3921fdf11f2d0b63/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js
|
|
2
|
+
var __rewriteRelativeImportExtension = function(path, preserveJsx) {
|
|
3
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
5
|
+
});
|
|
6
|
+
return path;
|
|
7
|
+
};
|
|
8
|
+
const dynamicImport = (specifier) => import(__rewriteRelativeImportExtension(specifier));
|
|
9
|
+
const NODE_FS_SPECIFIER = "node:fs";
|
|
10
|
+
const NODE_OS_SPECIFIER = "node:os";
|
|
11
|
+
const NODE_PATH_SPECIFIER = "node:path";
|
|
12
|
+
if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) {
|
|
13
|
+
dynamicImport(NODE_FS_SPECIFIER).then((m) => {
|
|
14
|
+
m.existsSync;
|
|
15
|
+
});
|
|
16
|
+
dynamicImport(NODE_OS_SPECIFIER).then((m) => {
|
|
17
|
+
m.homedir;
|
|
18
|
+
});
|
|
19
|
+
dynamicImport(NODE_PATH_SPECIFIER).then((m) => {
|
|
20
|
+
m.join;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const ANTHROPIC_AUTH_TOKEN_ENV = "ANTHROPIC_AUTH_TOKEN";
|
|
24
|
+
const ANTHROPIC_OAUTH_TOKEN_ENV = "ANTHROPIC_OAUTH_TOKEN";
|
|
25
|
+
const ANTHROPIC_API_KEY_ENV = "ANTHROPIC_API_KEY";
|
|
26
|
+
const ANTHROPIC_FEDERATION_RULE_ID_ENV = "ANTHROPIC_FEDERATION_RULE_ID";
|
|
27
|
+
const ANTHROPIC_ORGANIZATION_ID_ENV = "ANTHROPIC_ORGANIZATION_ID";
|
|
28
|
+
const ANTHROPIC_SERVICE_ACCOUNT_ID_ENV = "ANTHROPIC_SERVICE_ACCOUNT_ID";
|
|
29
|
+
const ANTHROPIC_IDENTITY_TOKEN_FILE_ENV = "ANTHROPIC_IDENTITY_TOKEN_FILE";
|
|
30
|
+
const ANTHROPIC_WORKSPACE_ID_ENV = "ANTHROPIC_WORKSPACE_ID";
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ANTHROPIC_OAUTH_TOKEN_ENV as a, ANTHROPIC_WORKSPACE_ID_ENV as c, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV as i, ANTHROPIC_AUTH_TOKEN_ENV as n, ANTHROPIC_ORGANIZATION_ID_ENV as o, ANTHROPIC_FEDERATION_RULE_ID_ENV as r, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV as s, ANTHROPIC_API_KEY_ENV as t };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { c as ownedSlice } from "./identity-BgfHobJH.js";
|
|
2
|
+
//#region ../../../node_modules/.pnpm/@earendil-works+pi-ai@1.5.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_018b33d3c6d4455b3921fdf11f2d0b63/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js
|
|
3
|
+
const MAX_PROVIDER_ERROR_BODY_CHARS = 4e3;
|
|
4
|
+
function normalizeProviderError(error) {
|
|
5
|
+
if (!(error instanceof Error)) return {
|
|
6
|
+
message: safeJsonStringify(error),
|
|
7
|
+
messageCarriesBody: false
|
|
8
|
+
};
|
|
9
|
+
const sdkError = error;
|
|
10
|
+
const status = extractStatus(sdkError);
|
|
11
|
+
const body = extractBody(sdkError);
|
|
12
|
+
const messageCarriesBody = body === void 0 || error.message.includes(body);
|
|
13
|
+
return {
|
|
14
|
+
status,
|
|
15
|
+
body,
|
|
16
|
+
message: error.message,
|
|
17
|
+
messageCarriesBody
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Probe the HTTP status, first numeric hit wins, in SDK-field order:
|
|
22
|
+
* `statusCode` (Mistral) → `status` (`openai`, `@google/genai`) →
|
|
23
|
+
* `$metadata.httpStatusCode` (Bedrock) → `$response.statusCode` (Bedrock).
|
|
24
|
+
*/
|
|
25
|
+
function extractStatus(error) {
|
|
26
|
+
if (typeof error.statusCode === "number") return error.statusCode;
|
|
27
|
+
if (typeof error.status === "number") return error.status;
|
|
28
|
+
if (typeof error.$metadata?.httpStatusCode === "number") return error.$metadata.httpStatusCode;
|
|
29
|
+
if (typeof error.$response?.statusCode === "number") return error.$response.statusCode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Probe the raw body reason, first usable hit wins, in SDK-field order:
|
|
33
|
+
* `body` string (Mistral) → `error` parsed JSON body object (`openai` SDK's
|
|
34
|
+
* `this.error`) → `$response.body` (Bedrock). Empty objects and unread response
|
|
35
|
+
* streams are treated as no body so they do not surface as `"{}"` or serialized
|
|
36
|
+
* stream internals. The chosen body is truncated to the cap.
|
|
37
|
+
*/
|
|
38
|
+
function extractBody(error) {
|
|
39
|
+
const bodyText = pickBodyText(error);
|
|
40
|
+
if (bodyText === void 0) return void 0;
|
|
41
|
+
const trimmed = bodyText.trim();
|
|
42
|
+
if (trimmed.length === 0) return void 0;
|
|
43
|
+
return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);
|
|
44
|
+
}
|
|
45
|
+
function pickBodyText(error) {
|
|
46
|
+
if (typeof error.body === "string") return error.body;
|
|
47
|
+
if (isPlainNonEmptyObject(error.error)) return safeJsonStringify(error.error);
|
|
48
|
+
const responseBody = error.$response?.body;
|
|
49
|
+
if (typeof responseBody === "string") return responseBody;
|
|
50
|
+
if (isReadableStreamLike(responseBody)) return void 0;
|
|
51
|
+
if (isPlainNonEmptyObject(responseBody)) return safeJsonStringify(responseBody);
|
|
52
|
+
}
|
|
53
|
+
function isReadableStreamLike(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Only a PLAIN object counts as an HTTP body. SDK error fields can hold class
|
|
58
|
+
* instances instead of parsed bodies — AWS SDK v3's `$response.body` is an
|
|
59
|
+
* HTTP stream/response wrapper object, and stringifying one produced garbage
|
|
60
|
+
* like `{"_events":...}` as the "body", which then REPLACED `error.message`
|
|
61
|
+
* in the composed display string. `error.message` is where the SDK puts the
|
|
62
|
+
* real deserialized exception text ("Input is too long...", schema validation
|
|
63
|
+
* details, ...), so the one useful string was discarded for noise. A class
|
|
64
|
+
* instance yields no body, `messageCarriesBody` stays true, and the real
|
|
65
|
+
* message survives. Complements the `pipe` sniffing above: web
|
|
66
|
+
* ReadableStreams (pipeTo/pipeThrough, no `pipe`) and non-stream SDK wrapper
|
|
67
|
+
* classes fail the prototype check, while parsed JSON bodies (plain objects
|
|
68
|
+
* by construction) still pass.
|
|
69
|
+
*/
|
|
70
|
+
function isPlainNonEmptyObject(value) {
|
|
71
|
+
if (typeof value !== "object" || value === null) return false;
|
|
72
|
+
const proto = Object.getPrototypeOf(value);
|
|
73
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
74
|
+
return Object.keys(value).length > 0;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Compose a display string from a normalized error. When the message already
|
|
78
|
+
* carries the body (Anthropic / `@google/genai` happy path) or no body/status
|
|
79
|
+
* was extracted, the message is returned unchanged. Otherwise the status and
|
|
80
|
+
* body are surfaced, with an optional provider prefix.
|
|
81
|
+
*
|
|
82
|
+
* - no prefix: `"<status>: <body>"`
|
|
83
|
+
* - prefix: `"<prefix> (<status>): <body>"`
|
|
84
|
+
*/
|
|
85
|
+
function formatProviderError(norm, prefix) {
|
|
86
|
+
if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message;
|
|
87
|
+
return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;
|
|
88
|
+
}
|
|
89
|
+
function truncateErrorText(text, maxChars) {
|
|
90
|
+
if (text.length <= maxChars) return text;
|
|
91
|
+
return `${ownedSlice(text, 0, maxChars)}... [truncated ${text.length - maxChars} chars]`;
|
|
92
|
+
}
|
|
93
|
+
function safeJsonStringify(value) {
|
|
94
|
+
try {
|
|
95
|
+
const serialized = JSON.stringify(value);
|
|
96
|
+
return serialized === void 0 ? String(value) : serialized;
|
|
97
|
+
} catch {
|
|
98
|
+
return String(value);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { normalizeProviderError as n, truncateErrorText as r, formatProviderError as t };
|