@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,109 +1,262 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-
|
|
1
|
+
import { Hn as BACKGROUND_CONTEXT, N as Record, Qn as readPoFs, V as String$1, Z as Literal, ht as Optional, ir as PO_SERVER_SCOPE_SERVICE, n as PO_HEADLESS_HOST_SERVICE, or as readPoServerScope, pt as _Object_, sr as requirePoServerScope, v as composeServerProviderOverrides, z as Union } from "./serverPlugin-CELT6P0Q.js";
|
|
2
|
+
import { A as modelInputSchema, D as prepareSecretAddition, E as readPoMcpRemoteServers, F as mcpToolApproval, M as normalizeMcpAppMetadata, N as createMcpApprovalState, O as writeSecrets, P as isDestructiveMcpTool, S as createMcpGlobalSettings, T as connectRemoteMcpServers, a as listManagedMcpServers, b as SERVER_COMMAND_DESCRIPTION, c as parseMcpServerAddition, d as handleSettings, f as isRecord, g as userConfigPath, h as serverNameOf, i as addMcpServer, j as isModelVisibleMcpTool, k as USER_MCP_SCOPE, m as json, p as isVaultUnavailable, s as mutateMcpServer, u as bodyOf, v as routes, w as PO_MCP_REMOTE_SERVERS_SERVICE, x as VAULT_UNAVAILABLE, y as MCP_FLOW_ID_PARAM } from "./exports-D09VsUk-.js";
|
|
3
|
+
import { s as readTextIfExists, u as writeFileAtomic } from "./platform-BIEiM4TG.js";
|
|
4
|
+
import { c as defineRoot, d as defineServerCommand, f as defineServerTool, h as defineServerPlugin, l as defineRoute, n as composeRootInjects, s as defineResource, t as composeRootHooks, u as defineRoutedContribution } from "./extensionFile-DNM4xsje.js";
|
|
5
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-DyYmurS7.js";
|
|
6
|
+
import { s as PO_VAULT_CONTRACT } from "./vaultSettings-Di3n5YIg.js";
|
|
7
|
+
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-DQFmrosw.js";
|
|
8
|
+
import { t as PO_HELP_WHEN } from "./help-w6vVEZGL.js";
|
|
9
|
+
//#region ../../default/po-mcp/src/services/mcpGlobalServers/index.ts
|
|
10
|
+
/** The parsed file, `undefined` when it does not exist, or `null` when it is not JSON. Any other read failure throws. */
|
|
11
|
+
async function readDocument(fs, filePath) {
|
|
12
|
+
const text = await readTextIfExists(fs, filePath, BACKGROUND_CONTEXT);
|
|
13
|
+
if (text === void 0) return { document: void 0 };
|
|
14
|
+
try {
|
|
15
|
+
return { document: JSON.parse(text) };
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const notJson = (fileLabel) => ({
|
|
21
|
+
ok: false,
|
|
22
|
+
status: 409,
|
|
23
|
+
error: `${fileLabel} isn't valid JSON, so Po left it alone.`
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* The personal server list over the host's own filesystem, so it runs wherever Po has a `po/fs`.
|
|
27
|
+
* It is the file half of the Node settings manager's global scope: the same checks and the same
|
|
28
|
+
* add, edit and remove rules, without repositories, plugins or any process to run.
|
|
29
|
+
*/
|
|
30
|
+
function createMcpGlobalServers(options) {
|
|
31
|
+
let writes = Promise.resolve();
|
|
32
|
+
const requireFs = () => {
|
|
33
|
+
const fs = options.fs();
|
|
34
|
+
if (!fs) throw new Error("MCP settings need the host filesystem.");
|
|
35
|
+
return fs;
|
|
36
|
+
};
|
|
37
|
+
const queued = (work) => {
|
|
38
|
+
const run = writes.then(work);
|
|
39
|
+
writes = run.catch(() => void 0);
|
|
40
|
+
return run;
|
|
41
|
+
};
|
|
42
|
+
const save = (fs, filePath, document) => writeFileAtomic(fs, filePath, `${JSON.stringify(document, null, 2)}\n`, BACKGROUND_CONTEXT);
|
|
43
|
+
return {
|
|
44
|
+
async list(filePath, fileLabel) {
|
|
45
|
+
const read = await readDocument(requireFs(), filePath);
|
|
46
|
+
if (read === null) return {
|
|
47
|
+
ok: false,
|
|
48
|
+
status: 409,
|
|
49
|
+
error: `${fileLabel} isn't valid JSON.`
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
ok: true,
|
|
53
|
+
value: listManagedMcpServers(read.document)
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
add(filePath, fileLabel, addition, secrets) {
|
|
57
|
+
return queued(async () => {
|
|
58
|
+
const fs = requireFs();
|
|
59
|
+
const read = await readDocument(fs, filePath);
|
|
60
|
+
if (read === null) return notJson(fileLabel);
|
|
61
|
+
const next = addMcpServer(read.document, addition, fileLabel);
|
|
62
|
+
if (!next.ok) return next;
|
|
63
|
+
let rollback;
|
|
64
|
+
if (secrets && secrets.writes.length > 0) {
|
|
65
|
+
const vault = options.vault();
|
|
66
|
+
if (!vault) throw new Error(VAULT_UNAVAILABLE);
|
|
67
|
+
rollback = await writeSecrets(vault, secrets.scope, secrets.writes);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
await save(fs, filePath, next.value);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
await rollback?.();
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
ok: true,
|
|
77
|
+
value: void 0
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
mutate(filePath, fileLabel, name, revision, addition) {
|
|
82
|
+
return queued(async () => {
|
|
83
|
+
const fs = requireFs();
|
|
84
|
+
const read = await readDocument(fs, filePath);
|
|
85
|
+
if (read === null) return notJson(fileLabel);
|
|
86
|
+
const next = mutateMcpServer(read.document, name, revision, addition);
|
|
87
|
+
if (!next.ok) return next;
|
|
88
|
+
await save(fs, filePath, next.value);
|
|
89
|
+
return {
|
|
90
|
+
ok: true,
|
|
91
|
+
value: addition ? "none" : "possible"
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region ../../default/po-mcp/src/services/mcpGlobalHubApi/index.ts
|
|
99
|
+
const USER_CONFIG_LABEL = "your personal MCP config";
|
|
100
|
+
const NO_HOME = "Po couldn't find your home directory on this hub.";
|
|
101
|
+
const REPOSITORY_UNAVAILABLE = "Repository MCP management is not available on this host. Manage your own servers instead.";
|
|
102
|
+
const LOCAL_UNAVAILABLE = "Local command servers cannot run on this host. Add a remote server by URL instead.";
|
|
103
|
+
const MUTATION_FIELDS = /* @__PURE__ */ new Set([
|
|
104
|
+
"scope",
|
|
105
|
+
"repositoryId",
|
|
106
|
+
"target",
|
|
107
|
+
"name",
|
|
108
|
+
"revision",
|
|
109
|
+
"entry",
|
|
110
|
+
"trusted"
|
|
111
|
+
]);
|
|
112
|
+
const REVISION = /^[a-f0-9]{64}$/u;
|
|
113
|
+
const AUTHORIZATION_FLOW_PREFIX = routes.readAuthorization.path.replace(`:${MCP_FLOW_ID_PARAM}`, "");
|
|
114
|
+
/** A server entry that runs a command, which a host without processes cannot start. */
|
|
115
|
+
function isLocalEntry(entry) {
|
|
116
|
+
return isRecord(entry) && "command" in entry;
|
|
117
|
+
}
|
|
118
|
+
async function handleAddServer(servers, request, context) {
|
|
119
|
+
const body = await bodyOf(request);
|
|
120
|
+
if (!body || body.scope !== "repository" && body.scope !== "global") return json({ error: "Choose where to add the server." }, 400);
|
|
121
|
+
if (body.scope === "repository") return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
122
|
+
if (isLocalEntry(body.entry)) return json({ error: LOCAL_UNAVAILABLE }, 501);
|
|
123
|
+
const addition = parseMcpServerAddition(body.name, body.entry, body.trusted);
|
|
124
|
+
if (!addition.ok) return json({ error: addition.error }, addition.status);
|
|
125
|
+
const prepared = prepareSecretAddition(addition.value, body.secretFields);
|
|
126
|
+
if (!prepared.ok) return json({ error: prepared.error }, prepared.status);
|
|
127
|
+
if (body.target !== void 0) return json({ error: "Choose this workspace or one of its plugins." }, 400);
|
|
128
|
+
const filePath = userConfigPath(context);
|
|
129
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
130
|
+
const { secrets } = prepared.value;
|
|
131
|
+
try {
|
|
132
|
+
const result = await servers.add(filePath, USER_CONFIG_LABEL, prepared.value.addition, secrets.length === 0 ? void 0 : {
|
|
133
|
+
scope: USER_MCP_SCOPE,
|
|
134
|
+
writes: secrets
|
|
135
|
+
});
|
|
136
|
+
return result.ok ? json({
|
|
137
|
+
scope: "global",
|
|
138
|
+
name: addition.value.name
|
|
139
|
+
}, 201) : json({ error: result.error }, result.status);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (isVaultUnavailable(error)) return json({ error: VAULT_UNAVAILABLE }, 503);
|
|
142
|
+
return json({ error: `Po couldn't save ${USER_CONFIG_LABEL}.` }, 500);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async function handleMutateServer(servers, request, context) {
|
|
146
|
+
const body = await bodyOf(request);
|
|
147
|
+
if (!body || Object.keys(body).some((key) => !MUTATION_FIELDS.has(key)) || body.scope !== "repository" && body.scope !== "global" || typeof body.revision !== "string" || !REVISION.test(body.revision)) return json({ error: "A saved scope, name and current revision are required." }, 400);
|
|
148
|
+
const name = serverNameOf(body.name);
|
|
149
|
+
if (!name) return json({ error: "A valid name is required." }, 400);
|
|
150
|
+
if (body.scope === "repository" || body.repositoryId !== void 0) return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
151
|
+
if (body.target !== void 0) return json({ error: "A saved scope, name and current revision are required." }, 400);
|
|
152
|
+
const editing = request.method === routes.editServer.method;
|
|
153
|
+
if (editing && isLocalEntry(body.entry)) return json({ error: LOCAL_UNAVAILABLE }, 501);
|
|
154
|
+
const parsed = editing ? parseMcpServerAddition(name, body.entry, body.trusted) : void 0;
|
|
155
|
+
if (parsed && !parsed.ok) return json({ error: parsed.error }, parsed.status);
|
|
156
|
+
if (!editing && body.entry !== void 0) return json({ error: "Remove does not accept an entry." }, 400);
|
|
157
|
+
const filePath = userConfigPath(context);
|
|
158
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
159
|
+
try {
|
|
160
|
+
const result = await servers.mutate(filePath, USER_CONFIG_LABEL, name, body.revision, parsed?.ok ? parsed.value : void 0);
|
|
161
|
+
if (!result.ok) return json({ error: result.error }, result.status);
|
|
162
|
+
return json({
|
|
163
|
+
scope: "global",
|
|
164
|
+
name,
|
|
165
|
+
credentialsPreserved: true,
|
|
166
|
+
liveSessionsChanged: false,
|
|
167
|
+
syncRequired: false,
|
|
168
|
+
shadowedDefinition: result.value
|
|
169
|
+
});
|
|
170
|
+
} catch {
|
|
171
|
+
return json({ error: `Po couldn't save ${USER_CONFIG_LABEL}.` }, 500);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async function handleGlobalServers(servers, context) {
|
|
175
|
+
const filePath = userConfigPath(context);
|
|
176
|
+
if (!filePath) return json({ error: NO_HOME }, 503);
|
|
177
|
+
try {
|
|
178
|
+
const result = await servers.list(filePath, USER_CONFIG_LABEL);
|
|
179
|
+
return result.ok ? json({ servers: result.value }) : json({ error: result.error }, result.status);
|
|
180
|
+
} catch {
|
|
181
|
+
return json({ error: `Po couldn't read ${USER_CONFIG_LABEL}.` }, 500);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** Catalogs, discovery and sign-in need a repository checkout and local processes; this host has neither. */
|
|
185
|
+
function isRepositoryRoute(request, path) {
|
|
186
|
+
const flow = request.method === routes.readAuthorization.method || request.method === routes.cancelAuthorization.method;
|
|
187
|
+
return [
|
|
188
|
+
routes.catalog,
|
|
189
|
+
routes.discover,
|
|
190
|
+
routes.authorize
|
|
191
|
+
].some((route) => request.method === route.method && path === route.path) || flow && path.startsWith(AUTHORIZATION_FLOW_PREFIX);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The hub's MCP settings API for a host that has a filesystem but no repository checkout and no processes:
|
|
195
|
+
* approval, and the person's own remote servers. A repository route, or a command server, is answered 501,
|
|
196
|
+
* so the settings page says what this host cannot do instead of showing an empty catalog.
|
|
197
|
+
*/
|
|
198
|
+
function createMcpGlobalHubApi(options) {
|
|
199
|
+
const servers = createMcpGlobalServers({
|
|
200
|
+
fs: options.fs,
|
|
201
|
+
vault: options.vault
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
basePath: "mcp",
|
|
205
|
+
start(context) {
|
|
206
|
+
return {
|
|
207
|
+
async fetch(request) {
|
|
208
|
+
const path = new URL(request.url).pathname;
|
|
209
|
+
if (request.method === routes.globalServers.method && path === routes.globalServers.path) return await handleGlobalServers(servers, context);
|
|
210
|
+
if ((request.method === routes.readSettings.method || request.method === routes.saveSettings.method) && path === routes.readSettings.path) return await handleSettings(options.settings, request, context);
|
|
211
|
+
if (request.method === routes.addServer.method && path === routes.addServer.path) return await handleAddServer(servers, request, context);
|
|
212
|
+
if ((request.method === routes.editServer.method || request.method === routes.removeServer.method) && path === routes.editServer.path) return await handleMutateServer(servers, request, context);
|
|
213
|
+
if (isRepositoryRoute(request, path)) return json({ error: REPOSITORY_UNAVAILABLE }, 501);
|
|
214
|
+
return json({ error: "Not found." }, 404);
|
|
215
|
+
},
|
|
216
|
+
close: () => void 0
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
8
222
|
//#region ../../default/po-mcp/src/extensions/(backend)/_lib/root.server.edge.ts
|
|
9
|
-
|
|
10
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Builds the hub MCP settings API at the global and workspace levels, reaching the vault through
|
|
225
|
+
* the server scope. The vault is resolved per request rather than injected, so a host without
|
|
226
|
+
* `po/vault` still mounts the API and answers 503 where a credential is needed.
|
|
227
|
+
*/
|
|
228
|
+
async function createMcpGlobalRoot(plugin) {
|
|
229
|
+
const settings = createMcpGlobalSettings(() => readPoFs(plugin.context));
|
|
230
|
+
if (plugin.host.scope === "session") return { value: {
|
|
231
|
+
hubApi: void 0,
|
|
232
|
+
settings
|
|
233
|
+
} };
|
|
234
|
+
let scope;
|
|
235
|
+
const fiber = plugin.context.inject([PO_SERVER_SCOPE_SERVICE], (injected) => {
|
|
236
|
+
scope = requirePoServerScope(injected);
|
|
237
|
+
return () => {
|
|
238
|
+
scope = void 0;
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
await fiber.await();
|
|
242
|
+
return {
|
|
243
|
+
value: {
|
|
244
|
+
hubApi: createMcpGlobalHubApi({
|
|
245
|
+
fs: () => readPoFs(plugin.context),
|
|
246
|
+
vault: () => scope?.resolve(PO_VAULT_CONTRACT),
|
|
247
|
+
settings
|
|
248
|
+
}),
|
|
249
|
+
settings
|
|
250
|
+
},
|
|
251
|
+
onDispose: async () => {
|
|
252
|
+
await fiber.dispose();
|
|
253
|
+
}
|
|
254
|
+
};
|
|
11
255
|
}
|
|
12
256
|
//#endregion
|
|
13
257
|
//#region ../../default/po-mcp/src/extensions/(backend)/root.server.ts
|
|
14
258
|
var root_server_default$1 = defineRoot(createMcpGlobalRoot);
|
|
15
259
|
//#endregion
|
|
16
|
-
//#region ../../core/po-core/src/schemas/help.ts
|
|
17
|
-
const PO_HELP_WHEN = {
|
|
18
|
-
state: { "minor-mode": "help" },
|
|
19
|
-
attribution: {
|
|
20
|
-
kind: "minor",
|
|
21
|
-
mode: "help"
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
defineServiceContract("po/package-health", { scope: "global" });
|
|
25
|
-
defineServiceContract("po/self-improve", { scope: "global" });
|
|
26
|
-
const MAX_SOURCE_LENGTH = 128;
|
|
27
|
-
const MAX_SKILL_NAME_LENGTH = 64;
|
|
28
|
-
const MAX_MODULE_URL_LENGTH = 4096;
|
|
29
|
-
const MAX_IDENTIFIER_LENGTH = 256;
|
|
30
|
-
const PoHelpSourceSchema = String$1({
|
|
31
|
-
minLength: 1,
|
|
32
|
-
maxLength: MAX_SOURCE_LENGTH,
|
|
33
|
-
pattern: "^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$"
|
|
34
|
-
});
|
|
35
|
-
const PoHelpSkillNameSchema = String$1({
|
|
36
|
-
minLength: 1,
|
|
37
|
-
maxLength: MAX_SKILL_NAME_LENGTH,
|
|
38
|
-
pattern: "^[a-z0-9][a-z0-9-]*$"
|
|
39
|
-
});
|
|
40
|
-
const PoHelpSkillDescriptorSchema = _Object_({
|
|
41
|
-
name: PoHelpSkillNameSchema,
|
|
42
|
-
description: String$1({
|
|
43
|
-
minLength: 1,
|
|
44
|
-
maxLength: 512
|
|
45
|
-
})
|
|
46
|
-
}, { additionalProperties: false });
|
|
47
|
-
_Object_({
|
|
48
|
-
source: PoHelpSourceSchema,
|
|
49
|
-
moduleUrl: String$1({
|
|
50
|
-
minLength: 1,
|
|
51
|
-
maxLength: MAX_MODULE_URL_LENGTH
|
|
52
|
-
}),
|
|
53
|
-
skills: _Array_(PoHelpSkillDescriptorSchema, {
|
|
54
|
-
minItems: 1,
|
|
55
|
-
maxItems: 64
|
|
56
|
-
})
|
|
57
|
-
}, { additionalProperties: false });
|
|
58
|
-
const GenerationSchema = String$1({
|
|
59
|
-
minLength: 1,
|
|
60
|
-
maxLength: MAX_IDENTIFIER_LENGTH
|
|
61
|
-
});
|
|
62
|
-
const PoHelpActivationSchema = Union([
|
|
63
|
-
Literal("inactive"),
|
|
64
|
-
Literal("activating"),
|
|
65
|
-
Literal("active"),
|
|
66
|
-
Literal("degraded")
|
|
67
|
-
]);
|
|
68
|
-
const PoHelpSkillSchema = _Object_({
|
|
69
|
-
source: PoHelpSourceSchema,
|
|
70
|
-
name: PoHelpSkillNameSchema,
|
|
71
|
-
description: String$1({
|
|
72
|
-
minLength: 1,
|
|
73
|
-
maxLength: 512
|
|
74
|
-
}),
|
|
75
|
-
filePath: String$1({
|
|
76
|
-
minLength: 1,
|
|
77
|
-
maxLength: MAX_MODULE_URL_LENGTH
|
|
78
|
-
}),
|
|
79
|
-
baseDir: String$1({
|
|
80
|
-
minLength: 1,
|
|
81
|
-
maxLength: MAX_MODULE_URL_LENGTH
|
|
82
|
-
})
|
|
83
|
-
}, { additionalProperties: false });
|
|
84
|
-
const PoHelpDiagnosticSchema = _Object_({
|
|
85
|
-
source: Optional(PoHelpSourceSchema),
|
|
86
|
-
code: String$1({
|
|
87
|
-
minLength: 1,
|
|
88
|
-
maxLength: 64,
|
|
89
|
-
pattern: "^[A-Z0-9_]+$"
|
|
90
|
-
}),
|
|
91
|
-
message: String$1({
|
|
92
|
-
minLength: 1,
|
|
93
|
-
maxLength: 512
|
|
94
|
-
})
|
|
95
|
-
}, { additionalProperties: false });
|
|
96
|
-
_Object_({
|
|
97
|
-
hostGeneration: GenerationSchema,
|
|
98
|
-
revision: Integer({ minimum: 0 }),
|
|
99
|
-
activation: PoHelpActivationSchema,
|
|
100
|
-
skills: _Array_(PoHelpSkillSchema, { maxItems: 64 }),
|
|
101
|
-
diagnostics: _Array_(PoHelpDiagnosticSchema, { maxItems: 64 })
|
|
102
|
-
}, { additionalProperties: false });
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region ../../default/po-mcp/src/constants/mcp.ts
|
|
105
|
-
const SERVER_COMMAND_DESCRIPTION = "Show MCP configuration or begin an authorization request.";
|
|
106
|
-
//#endregion
|
|
107
260
|
//#region ../../default/po-mcp/src/schemas/mcpTestServer.ts
|
|
108
261
|
const Name = String$1({ pattern: "^[A-Za-z0-9_-]{1,64}$" });
|
|
109
262
|
const McpTestServerInput = _Object_({
|
|
@@ -219,6 +372,11 @@ function tsType(value, depth = 0) {
|
|
|
219
372
|
function typed(tool) {
|
|
220
373
|
return tool.serverName !== "call" && !HIDDEN.has(tool.serverName) && !HIDDEN.has(tool.toolName);
|
|
221
374
|
}
|
|
375
|
+
/** Code mode keys approval by member path, so a name with a dot or whitespace cannot carry its own prompt. */
|
|
376
|
+
function approvalPath(tool) {
|
|
377
|
+
const part = /^[^.\s]+$/u;
|
|
378
|
+
return typed(tool) && part.test(tool.serverName) && part.test(tool.toolName) ? `${tool.serverName}.${tool.toolName}` : void 0;
|
|
379
|
+
}
|
|
222
380
|
function groupByServer(tools) {
|
|
223
381
|
const servers = /* @__PURE__ */ new Map();
|
|
224
382
|
for (const tool of tools.filter(typed)) {
|
|
@@ -311,17 +469,29 @@ function createMcpNamespace(sessionTools, sessionId) {
|
|
|
311
469
|
sessionTools.onChange(() => {
|
|
312
470
|
cached = void 0;
|
|
313
471
|
});
|
|
472
|
+
const visibleTools = () => sessionTools.snapshot().filter(isModelVisibleMcpTool);
|
|
473
|
+
const gated = (tool) => sessionTools.approval !== void 0 && isDestructiveMcpTool(tool.annotations);
|
|
314
474
|
return {
|
|
315
475
|
name: "mcp",
|
|
316
476
|
portable: true,
|
|
317
477
|
summary: "Session MCP tools by exact server and tool name: mcp.server.tool(args), or mcp.call(server, tool, args). Pass results to image() for images. Direct tools remain available for MCP Apps.",
|
|
318
478
|
get declarations() {
|
|
319
|
-
return cached ??= declarations(
|
|
479
|
+
return cached ??= declarations(visibleTools());
|
|
480
|
+
},
|
|
481
|
+
get approval() {
|
|
482
|
+
const state = sessionTools.approval;
|
|
483
|
+
if (state === void 0) return void 0;
|
|
484
|
+
const policies = {};
|
|
485
|
+
for (const tool of visibleTools()) {
|
|
486
|
+
const path = approvalPath(tool);
|
|
487
|
+
if (path !== void 0 && gated(tool)) policies[path] = mcpToolApproval(tool, state);
|
|
488
|
+
}
|
|
489
|
+
return policies;
|
|
320
490
|
},
|
|
321
491
|
bind(run) {
|
|
322
492
|
if (sessionId !== void 0 && run.sessionId !== sessionId) throw new Error("MCP namespace belongs to another session.");
|
|
323
493
|
const revision = sessionTools.runtimeRevision();
|
|
324
|
-
const tools =
|
|
494
|
+
const tools = visibleTools();
|
|
325
495
|
const catalog = /* @__PURE__ */ new Map();
|
|
326
496
|
for (const tool of tools) {
|
|
327
497
|
const server = catalog.get(tool.serverName) ?? /* @__PURE__ */ new Map();
|
|
@@ -329,11 +499,12 @@ function createMcpNamespace(sessionTools, sessionId) {
|
|
|
329
499
|
catalog.set(tool.serverName, server);
|
|
330
500
|
}
|
|
331
501
|
let wrappers;
|
|
332
|
-
const
|
|
502
|
+
const invoke = async (server, tool, args, approved) => {
|
|
333
503
|
run.signal.throwIfAborted();
|
|
334
504
|
const definition = catalog.get(server)?.get(tool);
|
|
335
505
|
if (!definition) throw new Error(`MCP tool ${server}/${tool} is not available in this session.`);
|
|
336
506
|
if (sessionTools.runtimeRevision() !== revision) throw new Error("MCP tools changed. Discover and retry in a new exec.");
|
|
507
|
+
if (!approved && gated(definition) && sessionTools.approval?.autoApproved() !== true) throw new Error(approvalPath(definition) === void 0 ? `MCP tool ${server}/${tool} changes data and its name cannot carry an approval prompt in code mode. Call its direct tool so the person can approve it.` : `MCP tool ${server}/${tool} changes data. Use mcp.${server}.${tool}(args) so the person can approve it.`);
|
|
337
508
|
const input = JSON.parse(JSON.stringify(args === void 0 ? {} : args));
|
|
338
509
|
const callArgs = record(input);
|
|
339
510
|
if (callArgs === void 0) throw new Error("MCP tool arguments must be an object.");
|
|
@@ -368,10 +539,11 @@ function createMcpNamespace(sessionTools, sessionId) {
|
|
|
368
539
|
}
|
|
369
540
|
};
|
|
370
541
|
const members = Object.create(null);
|
|
371
|
-
members.call =
|
|
542
|
+
members.call = (server, tool, args) => invoke(server, tool, args, false);
|
|
372
543
|
for (const tool of tools.filter(typed)) {
|
|
373
544
|
const server = members[tool.serverName] ??= Object.create(null);
|
|
374
|
-
|
|
545
|
+
const approved = approvalPath(tool) !== void 0;
|
|
546
|
+
server[tool.toolName] = (args) => invoke(tool.serverName, tool.toolName, args, approved);
|
|
375
547
|
}
|
|
376
548
|
return members;
|
|
377
549
|
}
|
|
@@ -380,17 +552,38 @@ function createMcpNamespace(sessionTools, sessionId) {
|
|
|
380
552
|
//#endregion
|
|
381
553
|
//#region ../../default/po-mcp/src/extensions/workspaces/sessions/(backend)/_lib/serverRoot.edge.ts
|
|
382
554
|
const NODE_ONLY = "Session-only MCP test servers need a Node host.";
|
|
555
|
+
const MAX_NOTICE_LENGTH = 300;
|
|
556
|
+
const describeError = (error) => (error instanceof Error ? error.message : String(error)).slice(0, MAX_NOTICE_LENGTH);
|
|
383
557
|
const createMcpServerRoot = (context) => {
|
|
384
558
|
let connection;
|
|
385
|
-
let
|
|
559
|
+
let serversStatus = "Remote MCP is off on this host.";
|
|
560
|
+
let approvalStatus;
|
|
561
|
+
const statusText = () => approvalStatus ? `${serversStatus}\n${approvalStatus}` : serversStatus;
|
|
386
562
|
const listeners = /* @__PURE__ */ new Set();
|
|
387
563
|
const changed = () => {
|
|
388
564
|
for (const listener of listeners) listener();
|
|
389
565
|
};
|
|
566
|
+
let savedAutoApprove = false;
|
|
567
|
+
const approvalListeners = /* @__PURE__ */ new Set();
|
|
568
|
+
const setSavedAutoApprove = (enabled) => {
|
|
569
|
+
if (savedAutoApprove === enabled) return;
|
|
570
|
+
savedAutoApprove = enabled;
|
|
571
|
+
for (const listener of approvalListeners) listener();
|
|
572
|
+
};
|
|
573
|
+
const approval = createMcpApprovalState({
|
|
574
|
+
globalAutoApprove: () => savedAutoApprove,
|
|
575
|
+
onGlobalChange: (listener) => {
|
|
576
|
+
approvalListeners.add(listener);
|
|
577
|
+
return () => {
|
|
578
|
+
approvalListeners.delete(listener);
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
});
|
|
390
582
|
const sessionTools = {
|
|
391
583
|
get generation() {
|
|
392
584
|
return connection?.sessionTools.generation ?? "remote:none";
|
|
393
585
|
},
|
|
586
|
+
approval,
|
|
394
587
|
runtimeRevision: () => connection?.sessionTools.runtimeRevision() ?? 0,
|
|
395
588
|
readAppResource: async () => {
|
|
396
589
|
throw new Error("MCP Apps are not available on this host.");
|
|
@@ -418,7 +611,7 @@ const createMcpServerRoot = (context) => {
|
|
|
418
611
|
async execute(_args, execution) {
|
|
419
612
|
await execution.client.notify({
|
|
420
613
|
title: "Po MCP",
|
|
421
|
-
body:
|
|
614
|
+
body: statusText(),
|
|
422
615
|
level: "info"
|
|
423
616
|
});
|
|
424
617
|
}
|
|
@@ -437,23 +630,80 @@ const createMcpServerRoot = (context) => {
|
|
|
437
630
|
const mountSession = (cordis) => {
|
|
438
631
|
cordis.inject([PO_MCP_REMOTE_SERVERS_SERVICE], (scoped) => {
|
|
439
632
|
const service = readPoMcpRemoteServers(scoped);
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
633
|
+
const serverScope = readPoServerScope(scoped);
|
|
634
|
+
const reads = /* @__PURE__ */ new Set();
|
|
635
|
+
let current = new AbortController();
|
|
636
|
+
let ended = false;
|
|
637
|
+
const readApproval = async (signal) => {
|
|
638
|
+
if (!service.loadAutoApprove) return;
|
|
639
|
+
try {
|
|
640
|
+
const enabled = await service.loadAutoApprove(signal);
|
|
641
|
+
if (signal.aborted) return;
|
|
642
|
+
setSavedAutoApprove(enabled === true);
|
|
643
|
+
approvalStatus = void 0;
|
|
644
|
+
} catch (error) {
|
|
645
|
+
if (signal.aborted) return;
|
|
646
|
+
setSavedAutoApprove(false);
|
|
647
|
+
approvalStatus = `Saved MCP approval could not load, so destructive tools ask: ${describeError(error)}`;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
const connectServers = async (signal) => {
|
|
651
|
+
try {
|
|
652
|
+
const connected = await connectRemoteMcpServers(service, signal, approval, () => serverScope?.resolve(PO_VAULT_CONTRACT));
|
|
653
|
+
if (signal.aborted) return await connected.close();
|
|
654
|
+
connection = connected;
|
|
655
|
+
const describe = () => {
|
|
656
|
+
const names = [...new Set(connected.sessionTools.snapshot().map((tool) => tool.serverName))];
|
|
657
|
+
serversStatus = [names.length ? `Connected: ${names.join(", ")}.` : "No remote MCP server is connected.", ...connected.failures.map((failure) => `${failure.name} failed: ${failure.message}`)].join("\n");
|
|
658
|
+
};
|
|
659
|
+
describe();
|
|
660
|
+
connected.sessionTools.onChange(() => {
|
|
661
|
+
if (connection !== connected) return;
|
|
662
|
+
describe();
|
|
663
|
+
changed();
|
|
664
|
+
});
|
|
665
|
+
changed();
|
|
666
|
+
return;
|
|
667
|
+
} catch (error) {
|
|
668
|
+
if (signal.aborted) return void 0;
|
|
669
|
+
serversStatus = `Remote MCP servers could not load: ${describeError(error)}`;
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
const refresh = () => {
|
|
674
|
+
current.abort();
|
|
675
|
+
current = new AbortController();
|
|
676
|
+
const { signal } = current;
|
|
677
|
+
setSavedAutoApprove(false);
|
|
678
|
+
approvalStatus = void 0;
|
|
679
|
+
const previous = connection;
|
|
680
|
+
connection = void 0;
|
|
681
|
+
serversStatus = previous ? "Remote MCP servers are reloading." : "Remote MCP servers are connecting.";
|
|
682
|
+
if (previous) changed();
|
|
683
|
+
const tracked = Promise.allSettled([
|
|
684
|
+
previous?.close(),
|
|
685
|
+
readApproval(signal),
|
|
686
|
+
connectServers(signal)
|
|
687
|
+
]).then(() => {
|
|
688
|
+
reads.delete(tracked);
|
|
689
|
+
});
|
|
690
|
+
reads.add(tracked);
|
|
691
|
+
return tracked;
|
|
692
|
+
};
|
|
693
|
+
const stopListening = service.onChange?.(() => {
|
|
694
|
+
if (!ended) refresh();
|
|
450
695
|
});
|
|
696
|
+
refresh();
|
|
451
697
|
return async () => {
|
|
452
|
-
|
|
453
|
-
|
|
698
|
+
ended = true;
|
|
699
|
+
stopListening?.();
|
|
700
|
+
current.abort();
|
|
701
|
+
await Promise.allSettled(reads);
|
|
454
702
|
const closing = connection;
|
|
455
703
|
connection = void 0;
|
|
456
|
-
|
|
704
|
+
serversStatus = "Remote MCP is off on this host.";
|
|
705
|
+
approvalStatus = void 0;
|
|
706
|
+
setSavedAutoApprove(false);
|
|
457
707
|
changed();
|
|
458
708
|
await closing?.close();
|
|
459
709
|
};
|