@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.21
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-DZ-OKOHn.js +6850 -0
- package/dist/anthropic-messages-5ODquUB-.js +14317 -0
- package/dist/{apiContracts-CHOiCbS_.js → apiContracts-b33nSAAI.js} +18 -81
- package/dist/{approval-BMXqnTYd.js → approval-r3NnI1VC.js} +19 -3
- package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DWoXxu3S.js} +2 -2
- package/dist/artifactFiles-DLCReI0-.js +1 -0
- package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-XeNS0L9M.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-B6ZW0nkR.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-bVR64sHO.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-D7tZz3io.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DdwScfiX.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-DgSxZJCV.js} +2 -2
- package/dist/assets/assets/channel-TPcVvp_3.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-D5TXC2SM.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T-BWhOSvo1.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-HkkBzLtZ.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-CBnjycLU.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-75lIIq8T.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-D8PpnXMk.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-CXRS2NIN.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-BocUqS94.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-CHf_ogYT.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-DrW1PaIv.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-CLoA7bFm.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-BmBsrj9I.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-iFE4Tl8c.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-DShE_cgv.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-B3oLvSXy.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-B14vKK7C.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-Da8elIW2.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-Du4tGtiJ.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-Cyj6i_WI.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DFWXwO7A.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-C1wB_cf-.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-MYCOBYl6.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-BFYbKUFf.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-6siqTpv_.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-CaBr9CoB.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-DAvmuDpc.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-CJnhgCpo.js} +2 -2
- package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-BQ4W1R18.js} +2 -2
- package/dist/assets/assets/{dist-DvgCCshF.js → dist-BnzFckPF.js} +2 -2
- package/dist/assets/assets/{dist-gfbb4ygy.js → dist-CFtBpcYL.js} +2 -2
- package/dist/assets/assets/{dist-BabjcJ3j.js → dist-CIQX1z4W.js} +2 -2
- package/dist/assets/assets/{dist-XIZum9n5.js → dist-ChHYoe9_.js} +2 -2
- package/dist/assets/assets/{dist-1-mhYUBH.js → dist-DKxZO8d9.js} +2 -2
- package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DL6z28wl.js} +2 -2
- package/dist/assets/assets/{dist-B3JXhDWV.js → dist-DNyn1p9Z.js} +2 -2
- package/dist/assets/assets/{dist-Izr2SB3q.js → dist-qYlLXIa8.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-AUcqDTM3.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-aA10PEHJ.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-hhYiqA-x.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-BQZqbRo5.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-BuyysPYC.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-CLON1GpW.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-DbmvNwR2.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DJVO0WlL.js} +2 -2
- package/dist/assets/assets/index-BiTVAj5E.js +155 -0
- package/dist/assets/assets/index-CBNQEGK3.css +1 -0
- package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-CAt3Nt3g.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-DTuqH-Zb.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-BnWvdonT.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-Btxtcgvl.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-q7ek9o_H.js} +2 -2
- package/dist/assets/assets/{line-BsXJZn93.js → line-B7yLilmC.js} +2 -2
- package/dist/assets/assets/{linear-BHYaD5T0.js → linear-y8aSKEli.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-B4rH50nD.js} +4 -4
- package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-DnRVHTjE.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-DT9Afs2v.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CnqNbu4p.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-cvxdBBFq.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-etXMNsaL.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-CBN-R3_j.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-C5jjVPIH.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-CAMd_mrV.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-DIs3auoe.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CJXr1qWy.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-DfwtykqI.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-B8beAhTs.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-BDcQE-EL.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-KJ4-QjZM.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-VjIB-Ybr.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-MfMuWq1M.js} +2 -2
- package/dist/assets/assets/{src-gihY33R9.js → src-BAxIj8GJ.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-mHwLRRCY.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-PArlYoqV.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-The09-5S.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-B2nKiNFU.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-gU23_RuI.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-CiqoMvZa.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-DpeoWpMK.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-C31iGKvM.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-CIzHhzNw.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-DIIkoezc.js} +2 -2
- package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-RFseiMZW.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-QiHL91kC.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-CKKRZ7-h.css +2 -0
- package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -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/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-BJDT6Lbw.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -0
- package/dist/assets/plugins/slots/approval.293d9a00-BXIhaPlQ.js +2 -0
- package/dist/assets/plugins/slots/artifacts.24567664-ZzR0gbvy.js +1 -0
- package/dist/assets/plugins/slots/author.0998a880-DAbA-7rb.js +93 -0
- package/dist/assets/plugins/slots/autocompact.dd97d013-IVq4Z6qm.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.36d7400b-CpCLjRRN.js +7 -0
- package/dist/assets/plugins/slots/codemode.8eaee717-VWt9PqsU.js +10 -0
- package/dist/assets/plugins/slots/domain.5e95fc37-5PIUBqDe.js +1 -0
- package/dist/assets/plugins/slots/edit.385c9aa9-DNAjPNG5.js +7 -0
- package/dist/assets/plugins/slots/files.daf34ed8-CQaTz0i1.js +2 -0
- package/dist/assets/plugins/slots/goal.77ec9930-B8EkarBq.js +1 -0
- package/dist/assets/plugins/slots/grep.02052cdc-CIRhO2gY.js +1 -0
- package/dist/assets/plugins/slots/help.ecd4c0f9-naMF9NN1.js +3 -0
- package/dist/assets/plugins/slots/log.a86eb6d0-D5__rAZJ.js +4 -0
- package/dist/assets/plugins/slots/mcp.974af249-DPNHn9XH.js +109 -0
- package/dist/assets/plugins/slots/plan.bafb8f68-C5GEpybF.js +3 -0
- package/dist/assets/plugins/slots/profile.48851a1d-yX6tzV3x.js +1 -0
- package/dist/assets/plugins/slots/prompts.723d7748-B7zpPeoF.js +3 -0
- package/dist/assets/plugins/slots/read.46bf6536-Cw5Z5z5T.js +1 -0
- package/dist/assets/plugins/slots/runner.53e9bd76-CiQR_FPX.js +8 -0
- package/dist/assets/plugins/slots/skill.086701a4-CL6h_F-x.js +4 -0
- package/dist/assets/plugins/slots/vault.ac9935c8-DKERQYg4.js +1 -0
- package/dist/assets/plugins/slots/voice.e85ca7f9-DEgb-U9m.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-C_7F2zD1.js} +2 -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-B1mPDYlf.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-DQFmrosw.js} +5 -2
- package/dist/contracts-DD3f1Lpn.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/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-B0WMEXCP.js +34 -0
- package/dist/{remoteMcp-CMqZldeA.js → exports-D09VsUk-.js} +1153 -175
- package/dist/{exports-BNZz2DNU.js → exports-nV43ShA7.js} +25 -9
- package/dist/{extensionFile-CXOa5G4C.js → extensionFile-DNM4xsje.js} +26 -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/{domains-BNjGTOPj.js → harnessState-Dwrk3lfv.js} +175 -16
- package/dist/{harnessStore-BT706Ly6.js → harnessStore-Z7yDLO45.js} +4 -5
- package/dist/hash-Dt6RIbkn.js +16 -0
- package/dist/headers-CwtEVQvr.js +17 -0
- package/dist/help-w6vVEZGL.js +101 -0
- package/dist/hubChannel-Cm-sxOvU.js +21 -0
- package/dist/hubRevisions-58pU2dW5.js +363 -0
- package/dist/identity-BgfHobJH.js +165 -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-DyYmurS7.js +62 -0
- package/dist/index.edge-K0w5auwG.js +56 -0
- package/dist/index.edge-Xa5LLtxz.js +67 -0
- package/dist/iso-BPQViXM8.js +10 -0
- package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-CUkYUs1f.js} +193 -15
- package/dist/{majorModes-DbCfLZH3.js → majorModes-BB0PXgFn.js} +4 -14
- package/dist/majorModes-C7vtBs4D.js +1 -0
- package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-BtKzB6oK.js} +2 -2
- package/dist/migrations-5gbLIQIc.js +32 -0
- package/dist/mistral-conversations-CLwhVDjA.js +689 -0
- package/dist/modeDefinition-C3Zbrw48.js +44 -0
- package/dist/models-Chzm15vC.js +1511 -0
- package/dist/narration-CpRurWLO.js +127 -0
- package/dist/node-BT4GsJQp.js +2479 -0
- package/dist/node-DytJOfYf.js +23 -0
- package/dist/notification-kckG3leF.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/{hubChannel-BHQyzcOo.js → packageApi-t1oCjNDU.js} +4 -41
- package/dist/photon_rs_bg.wasm +0 -0
- package/dist/pi-messages-BXfrZLC7.js +312 -0
- package/dist/piConfig-DQzlbPY4.js +126 -0
- package/dist/piSettings-Cf1QofNe.js +1 -0
- package/dist/platform-BIEiM4TG.js +113 -0
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/pluginProtocol-BqXXyI4z.js +80 -0
- package/dist/{protocol-Xpm_mCNN.js → protocol-DDL8geoS.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-AbXyhXlY.js +217 -0
- package/dist/server-B6dqQoh2.js +1518 -0
- package/dist/server-BIHo9TFu.js +505 -0
- package/dist/{server-BZh1ZXz_.js → server-BJ7DNzCp.js} +8 -19
- package/dist/server-BO-j_GbD.js +15106 -0
- package/dist/{server-D4W7EdJY.js → server-BQzAiMns.js} +16 -16
- package/dist/server-BR7SZtj7.js +3125 -0
- package/dist/{server-BE6VqEiA.js → server-BT2ORK83.js} +20 -12
- package/dist/server-BbSHYRnY.js +295 -0
- package/dist/server-BqoKlEGk.js +1806 -0
- package/dist/{server-tvgQ99rv.js → server-Busl0pQI.js} +370 -120
- package/dist/server-CIHM4jqu.js +1116 -0
- package/dist/server-CgWSSdvd.js +576 -0
- package/dist/{server-Dpgh8PDh.js → server-Co_UWKrR.js} +14 -5
- package/dist/{server-BAAL9-NA.js → server-CuEPb7u-.js} +3 -10
- package/dist/{server-Dt4y1rZD.js → server-D40q2Jpx.js} +47 -27
- package/dist/server-DCyf2Asb.js +679 -0
- package/dist/server-DH7PfLln.js +148 -0
- package/dist/server-DJ8bc89M.js +934 -0
- package/dist/server-DYdp0W9v.js +489 -0
- package/dist/server-DsdPEYGu.js +639 -0
- package/dist/server-DymH4Ucq.js +189 -0
- package/dist/server-IqECnUrb.js +834 -0
- package/dist/{server-36iuA3MI.js → server-KBgW77zh.js} +3 -3
- package/dist/server-RW_9R3R3.js +1522 -0
- package/dist/server-aUit8j6r.js +1028 -0
- package/dist/{server-DJAanjoI.js → server-gifRriZK.js} +491 -103
- package/dist/server-nkUlqnAL.js +2658 -0
- package/dist/server-oxyEbv1a.js +1256 -0
- package/dist/{server-D8ndq0wL.js → server-ub3s16Mc.js} +11 -9
- package/dist/{build-2gFaVEfG.js → serverPlugin-CELT6P0Q.js} +3946 -3
- package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-RQGvfm6E.js} +550 -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/{server-A-_GFpPr.js → type-ASYnCGVW.js} +10 -1031
- package/dist/typesafe-system-one-DGxeggJh.js +37 -0
- package/dist/uuid-B0QJx6Kr.js +31 -0
- package/dist/{validation-D77NZBrx.js → validation-BJxVSAwx.js} +8 -3
- package/dist/{value-Djvc2foV.js → value-_W31So3B.js} +1 -1
- package/dist/vaultSettings-Di3n5YIg.js +328 -0
- package/dist/voiceTools-RMn4HvWo.js +246 -0
- package/dist/web-DCP7ELJj.js +3 -0
- package/dist/worker.js +95288 -49863
- package/dist/workflow-B7qx0Vv9.js +79 -0
- package/package.json +37 -22
- package/wrangler.jsonc +4 -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/harnessState-gmzJcPGt.js +0 -88
- package/dist/harnessStore-BiH9vSuD.js +0 -1
- package/dist/index.edge-BgSx_gRO.js +0 -45
- package/dist/majorModes-BvWNqoHt.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/platform-B4AAgwJ0.js +0 -16
- package/dist/platformFiles-C_bXo4Ig.js +0 -39
- 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,15 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./platform-
|
|
3
|
-
import "./atomicJson-
|
|
4
|
-
import "./layeredConfig-
|
|
5
|
-
import "./sessionConfig-
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
1
|
+
import { gn as createSerialRunner } from "./serverPlugin-CELT6P0Q.js";
|
|
2
|
+
import "./platform-BIEiM4TG.js";
|
|
3
|
+
import "./atomicJson-C_7F2zD1.js";
|
|
4
|
+
import "./layeredConfig-CUkYUs1f.js";
|
|
5
|
+
import "./sessionConfig-RQGvfm6E.js";
|
|
6
|
+
import "./harnessState-Dwrk3lfv.js";
|
|
7
|
+
import "./piConfig-DQzlbPY4.js";
|
|
8
|
+
import "./majorModes-BB0PXgFn.js";
|
|
9
|
+
import "./harnessStore-Z7yDLO45.js";
|
|
9
10
|
import "node:path";
|
|
11
|
+
//#region ../../foundations/po-config/src/services/init/templates.ts
|
|
12
|
+
/** Personal-only: a repository pin would override the layout the person picks during onboarding. */
|
|
13
|
+
const WEB_TEMPLATE_SEED = `# Default web layout, resolved against the installed web template packages.
|
|
14
|
+
web:
|
|
15
|
+
template: po-template-elegant
|
|
16
|
+
|
|
17
|
+
`;
|
|
10
18
|
({
|
|
11
19
|
"config.yaml": `projectTrust: ask
|
|
12
20
|
|
|
21
|
+
${WEB_TEMPLATE_SEED}
|
|
13
22
|
# Workspace declarations belong in the repository's .po/workspaces.yaml, not this personal file.
|
|
14
23
|
# Entries accept name, path (default .), alias, instructions and free-form metadata.
|
|
15
24
|
# Autonomous voice is opt-in and uses an explicitly configured Pi model.
|
|
@@ -123,6 +132,7 @@ layers:
|
|
|
123
132
|
llm:
|
|
124
133
|
packages:
|
|
125
134
|
- '@agimon-ai/po-model-guidance'
|
|
135
|
+
- '@agimon-ai/po-gateway'
|
|
126
136
|
source-control:
|
|
127
137
|
packages:
|
|
128
138
|
- '@agimon-ai/po-git'
|
|
@@ -146,6 +156,12 @@ majorMode:
|
|
|
146
156
|
copilot:
|
|
147
157
|
description: General-purpose coding mode with delegation, persistent tasks, supervised commands, and structured user feedback.
|
|
148
158
|
layers: [team, ask-user, task, sandbox, llm, source-control, design, image-gen, web-search, browser, coding, workflow, calendar]
|
|
159
|
+
assistant:
|
|
160
|
+
description: Everyday assistant with delegation, tasks, web research, browsing and calendar.
|
|
161
|
+
layers: [team, ask-user, task, llm, web-search, browser, calendar, workflow]
|
|
162
|
+
marketing:
|
|
163
|
+
description: Marketing work with research, browsing and image generation.
|
|
164
|
+
layers: [team, ask-user, task, llm, web-search, browser, image-gen, calendar, workflow]
|
|
149
165
|
examples:
|
|
150
166
|
description: Base mode for the repository's plugin and workflow examples.
|
|
151
167
|
layers: [workflow]
|
|
@@ -231,6 +247,6 @@ profiles:
|
|
|
231
247
|
# Po Pi concatenates profile.md, SOUL.md, then AGENTS.md for the persona.
|
|
232
248
|
# Select one with: po --profile writer
|
|
233
249
|
`
|
|
234
|
-
})["config.yaml"];
|
|
250
|
+
})["config.yaml"].replace(WEB_TEMPLATE_SEED, "");
|
|
235
251
|
createSerialRunner();
|
|
236
252
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as PO_SERVER_HOST_SERVICE, b as requirePoServerHost, ir as PO_SERVER_SCOPE_SERVICE, p as readPoHeadlessHost, rr as PO_SERVER_SCOPE_LEVELS, sr as requirePoServerScope } from "./serverPlugin-CELT6P0Q.js";
|
|
2
2
|
//#region ../../core/po-core/src/services/pluginLifecycle/index.ts
|
|
3
3
|
/** Runs ordered cleanup steps to completion before reporting their failures. */
|
|
4
4
|
async function runCleanups(steps, message) {
|
|
@@ -334,6 +334,20 @@ function defineRoutedContribution(file, _options) {
|
|
|
334
334
|
function defineResource(file) {
|
|
335
335
|
return file;
|
|
336
336
|
}
|
|
337
|
+
/** `tool-restriction/<name>.ts`. Declares one tool restriction. */
|
|
338
|
+
function defineToolRestriction(file) {
|
|
339
|
+
return file;
|
|
340
|
+
}
|
|
341
|
+
/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */
|
|
342
|
+
function defineTool(file) {
|
|
343
|
+
return typeof file === "function" ? (context) => ({
|
|
344
|
+
kind: "tool",
|
|
345
|
+
...file(context)
|
|
346
|
+
}) : {
|
|
347
|
+
kind: "tool",
|
|
348
|
+
...file
|
|
349
|
+
};
|
|
350
|
+
}
|
|
337
351
|
/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */
|
|
338
352
|
function defineServerTool(file) {
|
|
339
353
|
return file;
|
|
@@ -390,6 +404,16 @@ function composeRootHooks(...roots) {
|
|
|
390
404
|
function defineServerCommand(file) {
|
|
391
405
|
return file;
|
|
392
406
|
}
|
|
407
|
+
/** `command/<name>.ts`. Adds the discriminant the contribution array expects. */
|
|
408
|
+
function defineCommand(file) {
|
|
409
|
+
return typeof file === "function" ? (context) => ({
|
|
410
|
+
kind: "command",
|
|
411
|
+
...file(context)
|
|
412
|
+
}) : {
|
|
413
|
+
kind: "command",
|
|
414
|
+
...file
|
|
415
|
+
};
|
|
416
|
+
}
|
|
393
417
|
/** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */
|
|
394
418
|
function defineHook(file) {
|
|
395
419
|
return file;
|
|
@@ -406,4 +430,4 @@ function defineMethod(file) {
|
|
|
406
430
|
return file;
|
|
407
431
|
}
|
|
408
432
|
//#endregion
|
|
409
|
-
export {
|
|
433
|
+
export { defineHook as a, defineRoot as c, defineServerCommand as d, defineServerTool as f, runCleanups as g, defineServerPlugin as h, defineCommand as i, defineRoute as l, defineToolRestriction as m, composeRootInjects as n, defineMethod as o, defineTool as p, defineChannel as r, defineResource as s, composeRootHooks as t, defineRoutedContribution as u };
|
|
@@ -0,0 +1,22 @@
|
|
|
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/api/github-copilot-headers.js
|
|
2
|
+
function inferCopilotInitiator(messages) {
|
|
3
|
+
const last = messages[messages.length - 1];
|
|
4
|
+
return last && last.role !== "user" ? "agent" : "user";
|
|
5
|
+
}
|
|
6
|
+
function hasCopilotVisionInput(messages) {
|
|
7
|
+
return messages.some((msg) => {
|
|
8
|
+
if (msg.role === "user" && Array.isArray(msg.content)) return msg.content.some((c) => c.type === "image");
|
|
9
|
+
if (msg.role === "toolResult" && Array.isArray(msg.content)) return msg.content.some((c) => c.type === "image");
|
|
10
|
+
return false;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function buildCopilotDynamicHeaders(params) {
|
|
14
|
+
const headers = {
|
|
15
|
+
"X-Initiator": inferCopilotInitiator(params.messages),
|
|
16
|
+
"Openai-Intent": "conversation-edits"
|
|
17
|
+
};
|
|
18
|
+
if (params.hasImages) headers["Copilot-Vision-Request"] = "true";
|
|
19
|
+
return headers;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { hasCopilotVisionInput as n, buildCopilotDynamicHeaders as t };
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { d as collapseSystemMessages, g as getInitialSystemMessage, m as getCurrentTools, n as clampThinkingLevel, t as calculateCost } from "./models-Chzm15vC.js";
|
|
2
|
+
import { n as getIdentityHeaders, s as getSystemMessageText } from "./identity-BgfHobJH.js";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-CFzI5Pd_.js";
|
|
4
|
+
import { i as AssistantMessageEventStream } from "./diagnostics-1lYFeSJe.js";
|
|
5
|
+
import { n as providerHeadersToRecord } from "./headers-CwtEVQvr.js";
|
|
6
|
+
import { t as sanitizeSurrogates } from "./sanitize-unicode-C3Ec8oL6.js";
|
|
7
|
+
import { n as normalizeProviderError, t as formatProviderError } from "./error-body-CJk7jMUh.js";
|
|
8
|
+
import { a as mapStopReason, c as retainThoughtSignature, d as toGoogleSdkThinkingLevel, f as toGoogleThinkingLevel, i as isThinkingPart, l as retryGoogleRequest, m as GoogleGenAI, n as convertTools, o as resolveGoogleFunctionCallingMode, p as usesGoogleThinkingLevel, r as getDisabledGoogleThinkingConfig, s as resolveGoogleThinkingLevel, t as convertMessages, u as supportsGoogleStrictToolSampling } from "./google-shared-e4JDCTVP.js";
|
|
9
|
+
//#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/api/google-generative-ai.js
|
|
10
|
+
let toolCallCounter = 0;
|
|
11
|
+
const stream = (model, context, options) => {
|
|
12
|
+
const stream = new AssistantMessageEventStream();
|
|
13
|
+
const normalizedContext = collapseSystemMessages(context);
|
|
14
|
+
(async () => {
|
|
15
|
+
const output = {
|
|
16
|
+
role: "assistant",
|
|
17
|
+
content: [],
|
|
18
|
+
api: "google-generative-ai",
|
|
19
|
+
provider: model.provider,
|
|
20
|
+
model: model.id,
|
|
21
|
+
usage: {
|
|
22
|
+
input: 0,
|
|
23
|
+
output: 0,
|
|
24
|
+
cacheRead: 0,
|
|
25
|
+
cacheWrite: 0,
|
|
26
|
+
totalTokens: 0,
|
|
27
|
+
cost: {
|
|
28
|
+
input: 0,
|
|
29
|
+
output: 0,
|
|
30
|
+
cacheRead: 0,
|
|
31
|
+
cacheWrite: 0,
|
|
32
|
+
total: 0
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
stopReason: "pending",
|
|
36
|
+
timestamp: Date.now()
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
if (options?.fetch && options.fetch !== globalThis.fetch) throw new Error("Custom fetch is not supported by the Google Generative AI adapter");
|
|
40
|
+
const apiKey = options?.apiKey;
|
|
41
|
+
if (!apiKey) throw new Error(`No API key for provider: ${model.provider}`);
|
|
42
|
+
const client = createClient(model, apiKey, options?.headers, options?.identity);
|
|
43
|
+
let params = buildParams(model, normalizedContext, options);
|
|
44
|
+
const nextParams = await options?.onPayload?.(params, model);
|
|
45
|
+
if (nextParams !== void 0) params = nextParams;
|
|
46
|
+
const googleStream = await retryGoogleRequest(() => client.models.generateContentStream(params), options);
|
|
47
|
+
stream.push({
|
|
48
|
+
type: "start",
|
|
49
|
+
partial: output
|
|
50
|
+
});
|
|
51
|
+
let currentBlock = null;
|
|
52
|
+
const blocks = output.content;
|
|
53
|
+
const blockIndex = () => blocks.length - 1;
|
|
54
|
+
for await (const chunk of googleStream) {
|
|
55
|
+
await options?.onProviderStreamEvent?.(chunk, model);
|
|
56
|
+
output.responseId ||= chunk.responseId;
|
|
57
|
+
const candidate = chunk.candidates?.[0];
|
|
58
|
+
if (candidate?.content?.parts) for (const part of candidate.content.parts) {
|
|
59
|
+
if (part.text !== void 0) {
|
|
60
|
+
const isThinking = isThinkingPart(part);
|
|
61
|
+
if (!currentBlock || isThinking && currentBlock.type !== "thinking" || !isThinking && currentBlock.type !== "text") {
|
|
62
|
+
if (currentBlock) {
|
|
63
|
+
if (currentBlock.type === "text") stream.push({
|
|
64
|
+
type: "text_end",
|
|
65
|
+
contentIndex: blocks.length - 1,
|
|
66
|
+
content: currentBlock.text,
|
|
67
|
+
partial: output
|
|
68
|
+
});
|
|
69
|
+
else stream.push({
|
|
70
|
+
type: "thinking_end",
|
|
71
|
+
contentIndex: blockIndex(),
|
|
72
|
+
content: currentBlock.thinking,
|
|
73
|
+
partial: output
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (isThinking) {
|
|
77
|
+
currentBlock = {
|
|
78
|
+
type: "thinking",
|
|
79
|
+
thinking: "",
|
|
80
|
+
thinkingSignature: void 0
|
|
81
|
+
};
|
|
82
|
+
output.content.push(currentBlock);
|
|
83
|
+
stream.push({
|
|
84
|
+
type: "thinking_start",
|
|
85
|
+
contentIndex: blockIndex(),
|
|
86
|
+
partial: output
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
currentBlock = {
|
|
90
|
+
type: "text",
|
|
91
|
+
text: ""
|
|
92
|
+
};
|
|
93
|
+
output.content.push(currentBlock);
|
|
94
|
+
stream.push({
|
|
95
|
+
type: "text_start",
|
|
96
|
+
contentIndex: blockIndex(),
|
|
97
|
+
partial: output
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (currentBlock.type === "thinking") {
|
|
102
|
+
currentBlock.thinking += part.text;
|
|
103
|
+
currentBlock.thinkingSignature = retainThoughtSignature(currentBlock.thinkingSignature, part.thoughtSignature);
|
|
104
|
+
stream.push({
|
|
105
|
+
type: "thinking_delta",
|
|
106
|
+
contentIndex: blockIndex(),
|
|
107
|
+
delta: part.text,
|
|
108
|
+
partial: output
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
currentBlock.text += part.text;
|
|
112
|
+
currentBlock.textSignature = retainThoughtSignature(currentBlock.textSignature, part.thoughtSignature);
|
|
113
|
+
stream.push({
|
|
114
|
+
type: "text_delta",
|
|
115
|
+
contentIndex: blockIndex(),
|
|
116
|
+
delta: part.text,
|
|
117
|
+
partial: output
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (part.functionCall) {
|
|
122
|
+
if (currentBlock) {
|
|
123
|
+
if (currentBlock.type === "text") stream.push({
|
|
124
|
+
type: "text_end",
|
|
125
|
+
contentIndex: blockIndex(),
|
|
126
|
+
content: currentBlock.text,
|
|
127
|
+
partial: output
|
|
128
|
+
});
|
|
129
|
+
else stream.push({
|
|
130
|
+
type: "thinking_end",
|
|
131
|
+
contentIndex: blockIndex(),
|
|
132
|
+
content: currentBlock.thinking,
|
|
133
|
+
partial: output
|
|
134
|
+
});
|
|
135
|
+
currentBlock = null;
|
|
136
|
+
}
|
|
137
|
+
const providedId = part.functionCall.id;
|
|
138
|
+
const toolCall = {
|
|
139
|
+
type: "toolCall",
|
|
140
|
+
id: !providedId || output.content.some((b) => b.type === "toolCall" && b.id === providedId) ? `${part.functionCall.name}_${Date.now()}_${++toolCallCounter}` : providedId,
|
|
141
|
+
name: part.functionCall.name || "",
|
|
142
|
+
arguments: part.functionCall.args ?? {},
|
|
143
|
+
...part.thoughtSignature && { thoughtSignature: part.thoughtSignature }
|
|
144
|
+
};
|
|
145
|
+
output.content.push(toolCall);
|
|
146
|
+
stream.push({
|
|
147
|
+
type: "toolcall_start",
|
|
148
|
+
contentIndex: blockIndex(),
|
|
149
|
+
partial: output
|
|
150
|
+
});
|
|
151
|
+
stream.push({
|
|
152
|
+
type: "toolcall_delta",
|
|
153
|
+
contentIndex: blockIndex(),
|
|
154
|
+
delta: JSON.stringify(toolCall.arguments),
|
|
155
|
+
partial: output
|
|
156
|
+
});
|
|
157
|
+
stream.push({
|
|
158
|
+
type: "toolcall_end",
|
|
159
|
+
contentIndex: blockIndex(),
|
|
160
|
+
toolCall,
|
|
161
|
+
partial: output
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (candidate?.finishReason) {
|
|
166
|
+
output.rawStopReason = candidate.finishReason;
|
|
167
|
+
output.stopReason = mapStopReason(candidate.finishReason);
|
|
168
|
+
if (output.content.some((b) => b.type === "toolCall") && output.stopReason === "stop") output.stopReason = "toolUse";
|
|
169
|
+
}
|
|
170
|
+
if (chunk.usageMetadata) {
|
|
171
|
+
output.usage = {
|
|
172
|
+
input: (chunk.usageMetadata.promptTokenCount || 0) - (chunk.usageMetadata.cachedContentTokenCount || 0),
|
|
173
|
+
output: (chunk.usageMetadata.candidatesTokenCount || 0) + (chunk.usageMetadata.thoughtsTokenCount || 0),
|
|
174
|
+
cacheRead: chunk.usageMetadata.cachedContentTokenCount || 0,
|
|
175
|
+
cacheWrite: 0,
|
|
176
|
+
reasoning: chunk.usageMetadata.thoughtsTokenCount || 0,
|
|
177
|
+
totalTokens: chunk.usageMetadata.totalTokenCount || 0,
|
|
178
|
+
cost: {
|
|
179
|
+
input: 0,
|
|
180
|
+
output: 0,
|
|
181
|
+
cacheRead: 0,
|
|
182
|
+
cacheWrite: 0,
|
|
183
|
+
total: 0
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
calculateCost(model, output.usage);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (currentBlock) {
|
|
190
|
+
if (currentBlock.type === "text") stream.push({
|
|
191
|
+
type: "text_end",
|
|
192
|
+
contentIndex: blockIndex(),
|
|
193
|
+
content: currentBlock.text,
|
|
194
|
+
partial: output
|
|
195
|
+
});
|
|
196
|
+
else stream.push({
|
|
197
|
+
type: "thinking_end",
|
|
198
|
+
contentIndex: blockIndex(),
|
|
199
|
+
content: currentBlock.thinking,
|
|
200
|
+
partial: output
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (options?.signal?.aborted) throw new Error("Request was aborted");
|
|
204
|
+
if (output.stopReason === "pending") throw new Error("Google stream ended without a finish reason");
|
|
205
|
+
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
206
|
+
const errorMessage = output.rawStopReason ? `Provider stopped with: ${output.rawStopReason}` : "An unknown error occurred";
|
|
207
|
+
throw new Error(errorMessage);
|
|
208
|
+
}
|
|
209
|
+
stream.push({
|
|
210
|
+
type: "done",
|
|
211
|
+
reason: output.stopReason,
|
|
212
|
+
message: output
|
|
213
|
+
});
|
|
214
|
+
stream.end();
|
|
215
|
+
} catch (error) {
|
|
216
|
+
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
217
|
+
output.errorMessage = formatProviderError(normalizeProviderError(error));
|
|
218
|
+
stream.push({
|
|
219
|
+
type: "error",
|
|
220
|
+
reason: output.stopReason,
|
|
221
|
+
error: output
|
|
222
|
+
});
|
|
223
|
+
stream.end();
|
|
224
|
+
}
|
|
225
|
+
})();
|
|
226
|
+
return stream;
|
|
227
|
+
};
|
|
228
|
+
const streamSimple = (model, context, options) => {
|
|
229
|
+
const apiKey = options?.apiKey;
|
|
230
|
+
if (!apiKey) throw new Error(`No API key for provider: ${model.provider}`);
|
|
231
|
+
const base = {
|
|
232
|
+
...buildBaseOptions(model, context, options, apiKey),
|
|
233
|
+
toolChoice: options?.toolChoice
|
|
234
|
+
};
|
|
235
|
+
if (!options?.reasoning) return stream(model, context, {
|
|
236
|
+
...base,
|
|
237
|
+
thinking: { enabled: false }
|
|
238
|
+
});
|
|
239
|
+
const clampedReasoning = clampThinkingLevel(model, options.reasoning);
|
|
240
|
+
if (clampedReasoning === "off") return stream(model, context, {
|
|
241
|
+
...base,
|
|
242
|
+
thinking: { enabled: false }
|
|
243
|
+
});
|
|
244
|
+
const resolvedLevel = resolveGoogleThinkingLevel(model, clampedReasoning);
|
|
245
|
+
if (usesGoogleThinkingLevel(model)) return stream(model, context, {
|
|
246
|
+
...base,
|
|
247
|
+
thinking: {
|
|
248
|
+
enabled: true,
|
|
249
|
+
level: toGoogleThinkingLevel(resolvedLevel)
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
return stream(model, context, {
|
|
253
|
+
...base,
|
|
254
|
+
thinking: {
|
|
255
|
+
enabled: true,
|
|
256
|
+
budgetTokens: getGoogleBudget(model, resolvedLevel, options.thinkingBudgets)
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
function createClient(model, apiKey, optionsHeaders, identity) {
|
|
261
|
+
const httpOptions = {};
|
|
262
|
+
if (model.baseUrl) {
|
|
263
|
+
httpOptions.baseUrl = model.baseUrl;
|
|
264
|
+
httpOptions.apiVersion = "";
|
|
265
|
+
}
|
|
266
|
+
const headers = providerHeadersToRecord(getIdentityHeaders(model, identity), model.headers, optionsHeaders);
|
|
267
|
+
if (headers) httpOptions.headers = headers;
|
|
268
|
+
return new GoogleGenAI({
|
|
269
|
+
apiKey,
|
|
270
|
+
httpOptions: Object.keys(httpOptions).length > 0 ? httpOptions : void 0
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function buildParams(model, context, options = {}) {
|
|
274
|
+
const contents = convertMessages(model, context);
|
|
275
|
+
const initialSystemMessage = getInitialSystemMessage(context.messages);
|
|
276
|
+
const currentTools = getCurrentTools(context.messages);
|
|
277
|
+
const generationConfig = {};
|
|
278
|
+
if (options.temperature !== void 0) generationConfig.temperature = options.temperature;
|
|
279
|
+
if (options.maxTokens !== void 0) generationConfig.maxOutputTokens = options.maxTokens;
|
|
280
|
+
const supportsStrictMode = supportsGoogleStrictToolSampling(model.id);
|
|
281
|
+
const functionCallingMode = currentTools.length > 0 ? resolveGoogleFunctionCallingMode(currentTools, options.toolChoice, supportsStrictMode) : void 0;
|
|
282
|
+
const systemInstruction = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : "";
|
|
283
|
+
const config = {
|
|
284
|
+
...Object.keys(generationConfig).length > 0 && generationConfig,
|
|
285
|
+
...systemInstruction && { systemInstruction: sanitizeSurrogates(systemInstruction) },
|
|
286
|
+
...currentTools.length > 0 && { tools: convertTools(currentTools, false, supportsStrictMode) },
|
|
287
|
+
...functionCallingMode !== void 0 && { toolConfig: { functionCallingConfig: { mode: functionCallingMode } } }
|
|
288
|
+
};
|
|
289
|
+
if (options.thinking?.enabled && model.reasoning) {
|
|
290
|
+
const thinkingConfig = { includeThoughts: true };
|
|
291
|
+
if (options.thinking.level !== void 0) thinkingConfig.thinkingLevel = toGoogleSdkThinkingLevel(options.thinking.level);
|
|
292
|
+
else if (options.thinking.budgetTokens !== void 0) thinkingConfig.thinkingBudget = options.thinking.budgetTokens;
|
|
293
|
+
config.thinkingConfig = thinkingConfig;
|
|
294
|
+
} else if (model.reasoning && options.thinking && !options.thinking.enabled) config.thinkingConfig = getDisabledGoogleThinkingConfig(model);
|
|
295
|
+
if (options.signal) {
|
|
296
|
+
if (options.signal.aborted) throw new Error("Request aborted");
|
|
297
|
+
config.abortSignal = options.signal;
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
model: model.id,
|
|
301
|
+
contents,
|
|
302
|
+
config
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function getGoogleBudget(model, level, customBudgets) {
|
|
306
|
+
if (customBudgets?.[level] !== void 0) return customBudgets[level];
|
|
307
|
+
if (model.id.includes("2.5-pro")) return {
|
|
308
|
+
minimal: 128,
|
|
309
|
+
low: 2048,
|
|
310
|
+
medium: 8192,
|
|
311
|
+
high: 32768
|
|
312
|
+
}[level];
|
|
313
|
+
if (model.id.includes("2.5-flash-lite")) return {
|
|
314
|
+
minimal: 512,
|
|
315
|
+
low: 2048,
|
|
316
|
+
medium: 8192,
|
|
317
|
+
high: 24576
|
|
318
|
+
}[level];
|
|
319
|
+
if (model.id.includes("2.5-flash")) return {
|
|
320
|
+
minimal: 128,
|
|
321
|
+
low: 2048,
|
|
322
|
+
medium: 8192,
|
|
323
|
+
high: 24576
|
|
324
|
+
}[level];
|
|
325
|
+
return -1;
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
export { stream, streamSimple };
|