@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
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { Hn as BACKGROUND_CONTEXT, Sn as getOrThrow, mn as piAgentDirectory, tr as requirePoFs, vn as nodeHost } from "./serverPlugin-CELT6P0Q.js";
|
|
2
|
+
import "./platform-BIEiM4TG.js";
|
|
3
|
+
import "./piSettings-Cf1QofNe.js";
|
|
4
|
+
import "./approvalPrompt-DWoXxu3S.js";
|
|
5
|
+
import { n as defineApiRoutes, t as apiResponse } from "./hubRevisions-58pU2dW5.js";
|
|
6
|
+
import { d as defineServerCommand, h as defineServerPlugin, l as defineRoute, s as defineResource } from "./extensionFile-DNM4xsje.js";
|
|
7
|
+
import { n as readPackageResource } from "./index.edge-DyYmurS7.js";
|
|
8
|
+
import "./browser-BWf8OMfl.js";
|
|
9
|
+
import { t as Hono } from "./dist-B-vqs6tA.js";
|
|
10
|
+
import { t as PO_HELP_WHEN } from "./help-w6vVEZGL.js";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
//#region ../../default/po-prompt/src/constants/promptStore.ts
|
|
13
|
+
const PROMPTS_DIR = "prompts";
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../../default/po-prompt/src/constants/savedPromptDocument.ts
|
|
16
|
+
const DESCRIPTION_KEY = "description:";
|
|
17
|
+
const NAME_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
|
|
18
|
+
const PROMPT_NAME_RULE = "lowercase letters, digits and dashes, starting with a letter or digit";
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../../default/po-prompt/src/services/savedPromptDocument/index.ts
|
|
21
|
+
/**
|
|
22
|
+
* The saved prompt document format.
|
|
23
|
+
*
|
|
24
|
+
* DESIGN PATTERNS:
|
|
25
|
+
* - A saved prompt is an ordinary Pi prompt template: YAML frontmatter with a
|
|
26
|
+
* description, then the prompt body verbatim. Reusing that format is why
|
|
27
|
+
* `/<name>` works on the next start without this package registering anything.
|
|
28
|
+
* - Pure string handling. The store owns paths and the filesystem.
|
|
29
|
+
*
|
|
30
|
+
* AVOID:
|
|
31
|
+
* - A richer frontmatter surface. Anything this package invents here stops
|
|
32
|
+
* being a plain template that Pi can already read.
|
|
33
|
+
*/
|
|
34
|
+
/** Keeps the picker's second column to one readable line. */
|
|
35
|
+
/** Filename and slash command in one, so the name has to be safe as both. */
|
|
36
|
+
/** Tokens Pi's template engine substitutes when the prompt is invoked. */
|
|
37
|
+
/** The pattern a saved prompt name must match, for user-facing messages. */
|
|
38
|
+
function isValidPromptName(name) {
|
|
39
|
+
return name.length <= 64 && NAME_PATTERN.test(name);
|
|
40
|
+
}
|
|
41
|
+
/** The first non-empty line, shortened for the picker's description column. */
|
|
42
|
+
function describePrompt(text) {
|
|
43
|
+
const firstLine = text.split("\n").map((line) => line.trim()).find((line) => line.length > 0);
|
|
44
|
+
if (!firstLine) return "";
|
|
45
|
+
if (firstLine.length <= 80) return firstLine;
|
|
46
|
+
return `${firstLine.slice(0, 79).trimEnd()}…`;
|
|
47
|
+
}
|
|
48
|
+
/** Quotes the description so a colon or a quote cannot break the frontmatter. */
|
|
49
|
+
function quoteDescription(description) {
|
|
50
|
+
return `"${description.replaceAll(/\s+/gu, " ").trim().replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}"`;
|
|
51
|
+
}
|
|
52
|
+
function unquoteDescription(value) {
|
|
53
|
+
const trimmed = value.trim();
|
|
54
|
+
if (!trimmed.startsWith("\"") || !trimmed.endsWith("\"") || trimmed.length < 2) return trimmed;
|
|
55
|
+
return trimmed.slice(1, -1).replaceAll("\\\"", "\"").replaceAll("\\\\", "\\");
|
|
56
|
+
}
|
|
57
|
+
function buildPromptDocument(prompt) {
|
|
58
|
+
const body = prompt.text.endsWith("\n") ? prompt.text : `${prompt.text}\n`;
|
|
59
|
+
const description = prompt.description.trim();
|
|
60
|
+
if (!description) return body;
|
|
61
|
+
return [
|
|
62
|
+
"---",
|
|
63
|
+
`description: ${quoteDescription(description)}`,
|
|
64
|
+
"---",
|
|
65
|
+
body
|
|
66
|
+
].join("\n");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Splits a template back into its description and body.
|
|
70
|
+
*
|
|
71
|
+
* A document without frontmatter, or with frontmatter this package did not
|
|
72
|
+
* write, is still a usable prompt: the whole file becomes the body and the
|
|
73
|
+
* description falls back to the first line.
|
|
74
|
+
*/
|
|
75
|
+
function parsePromptDocument(name, content) {
|
|
76
|
+
const normalized = content.replaceAll("\r\n", "\n");
|
|
77
|
+
if (!normalized.startsWith(`---\n`)) return {
|
|
78
|
+
name,
|
|
79
|
+
description: describePrompt(normalized),
|
|
80
|
+
text: normalized.trim()
|
|
81
|
+
};
|
|
82
|
+
const closing = normalized.indexOf(`\n---\n`, 3);
|
|
83
|
+
if (closing === -1) return {
|
|
84
|
+
name,
|
|
85
|
+
description: describePrompt(normalized),
|
|
86
|
+
text: normalized.trim()
|
|
87
|
+
};
|
|
88
|
+
const frontmatter = normalized.slice(4, closing);
|
|
89
|
+
const body = normalized.slice(closing + 3 + 2).trim();
|
|
90
|
+
const descriptionLine = frontmatter.split("\n").find((line) => line.trimStart().startsWith(DESCRIPTION_KEY));
|
|
91
|
+
return {
|
|
92
|
+
name,
|
|
93
|
+
description: descriptionLine ? unquoteDescription(descriptionLine.trimStart().slice(12)) : describePrompt(body),
|
|
94
|
+
text: body
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region ../../default/po-prompt/src/services/fileSystemPromptStore/index.ts
|
|
99
|
+
/**
|
|
100
|
+
* Saved prompts as Pi prompt templates, on whatever filesystem the host admitted.
|
|
101
|
+
*
|
|
102
|
+
* DESIGN PATTERNS:
|
|
103
|
+
* - The only implementation of the store port that the server graph imports. It
|
|
104
|
+
* reaches files through an injected `FileSystem`, never `node:fs`, so the same
|
|
105
|
+
* code runs on Node and in a Worker. The Node entry wraps it in
|
|
106
|
+
* src/services/promptStore.
|
|
107
|
+
* - The environment and the home directory are arguments with no default: this
|
|
108
|
+
* module never reads the process.
|
|
109
|
+
* - Private modes go through `nodeHost`, which applies them on Node and skips
|
|
110
|
+
* them on the edge, where there is no other account to protect against.
|
|
111
|
+
*
|
|
112
|
+
* AVOID:
|
|
113
|
+
* - Turning a read fault into an empty library. Only a missing directory or
|
|
114
|
+
* template is absent; anything else is reported.
|
|
115
|
+
*/
|
|
116
|
+
/** A name holds no readable template when the open fails in one of these ways. */
|
|
117
|
+
const ABSENT = /* @__PURE__ */ new Set([
|
|
118
|
+
"not_found",
|
|
119
|
+
"is_directory",
|
|
120
|
+
"invalid"
|
|
121
|
+
]);
|
|
122
|
+
/** `<agentDir>/prompts`, honouring the override Pi itself reads. */
|
|
123
|
+
function promptsDirectory(environment, homeDirectory) {
|
|
124
|
+
return path.join(piAgentDirectory(environment, homeDirectory), PROMPTS_DIR);
|
|
125
|
+
}
|
|
126
|
+
function createFileSystemSavedPromptStore({ fs, directory }) {
|
|
127
|
+
const filePath = (name) => path.join(directory, `${name}.md`);
|
|
128
|
+
return {
|
|
129
|
+
async list() {
|
|
130
|
+
const listing = await fs.listDir(directory, BACKGROUND_CONTEXT);
|
|
131
|
+
if (!listing.ok && listing.error.code === "not_found") return [];
|
|
132
|
+
const prompts = [];
|
|
133
|
+
const names = getOrThrow(listing).map((entry) => entry.name);
|
|
134
|
+
for (const entry of names.filter((name) => name.endsWith(".md")).sort()) {
|
|
135
|
+
const read = await fs.readTextFile(path.join(directory, entry), BACKGROUND_CONTEXT);
|
|
136
|
+
if (!read.ok && (read.error.code === "not_found" || read.error.code === "is_directory")) continue;
|
|
137
|
+
prompts.push(parsePromptDocument(entry.slice(0, -3), getOrThrow(read)));
|
|
138
|
+
}
|
|
139
|
+
return prompts;
|
|
140
|
+
},
|
|
141
|
+
async has(name) {
|
|
142
|
+
const opened = await fs.openBinaryReader(filePath(name), {}, BACKGROUND_CONTEXT);
|
|
143
|
+
if (!opened.ok && ABSENT.has(opened.error.code)) return false;
|
|
144
|
+
await getOrThrow(opened).close(BACKGROUND_CONTEXT);
|
|
145
|
+
return true;
|
|
146
|
+
},
|
|
147
|
+
async save(prompt) {
|
|
148
|
+
if (!getOrThrow(await fs.exists(directory, BACKGROUND_CONTEXT))) {
|
|
149
|
+
getOrThrow(await fs.createDir(directory, { recursive: true }, BACKGROUND_CONTEXT));
|
|
150
|
+
await nodeHost.setMode(directory, 448);
|
|
151
|
+
}
|
|
152
|
+
const target = filePath(prompt.name);
|
|
153
|
+
const temporary = `${target}.tmp`;
|
|
154
|
+
try {
|
|
155
|
+
getOrThrow(await fs.writeFile(temporary, "", BACKGROUND_CONTEXT));
|
|
156
|
+
await nodeHost.setMode(temporary, 384);
|
|
157
|
+
getOrThrow(await fs.writeFile(temporary, buildPromptDocument(prompt), BACKGROUND_CONTEXT));
|
|
158
|
+
getOrThrow(await fs.renameFile(temporary, target, BACKGROUND_CONTEXT));
|
|
159
|
+
} catch (error) {
|
|
160
|
+
await fs.remove(temporary, { force: true }, BACKGROUND_CONTEXT);
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
name: prompt.name,
|
|
165
|
+
path: target
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
async remove(name) {
|
|
169
|
+
const removed = await fs.remove(filePath(name), {}, BACKGROUND_CONTEXT);
|
|
170
|
+
if (!removed.ok && removed.error.code === "not_found") return false;
|
|
171
|
+
getOrThrow(removed);
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The store for one mounted package, built from what its host admitted: the
|
|
178
|
+
* `po/fs` filesystem, the environment and the home directory.
|
|
179
|
+
*
|
|
180
|
+
* It opens on first use, so a host that lacks one of them still mounts the
|
|
181
|
+
* package and reports the missing capability where it is needed. An absent
|
|
182
|
+
* environment or home is refused rather than replaced by the process's own,
|
|
183
|
+
* which would send the prompts to a directory the host never chose.
|
|
184
|
+
*/
|
|
185
|
+
function hostPromptStore({ context, host }) {
|
|
186
|
+
let store;
|
|
187
|
+
const open = () => {
|
|
188
|
+
if (store) return store;
|
|
189
|
+
const { environment, homeDirectory } = host.context;
|
|
190
|
+
if (environment === void 0 || homeDirectory === void 0) throw new Error("Saved prompts need the host-admitted environment and home directory.");
|
|
191
|
+
store = createFileSystemSavedPromptStore({
|
|
192
|
+
fs: requirePoFs(context),
|
|
193
|
+
directory: promptsDirectory(environment, homeDirectory)
|
|
194
|
+
});
|
|
195
|
+
return store;
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
list: async () => open().list(),
|
|
199
|
+
has: async (name) => open().has(name),
|
|
200
|
+
save: async (prompt) => open().save(prompt),
|
|
201
|
+
remove: async (name) => open().remove(name)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region ../../default/po-prompt/src/constants/promptsApi.ts
|
|
206
|
+
const NAME_PARAM = "name";
|
|
207
|
+
const STATUS = {
|
|
208
|
+
badRequest: 400,
|
|
209
|
+
notFound: 404,
|
|
210
|
+
tooLarge: 413,
|
|
211
|
+
failed: 500
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region ../../default/po-prompt/src/constants/webPrompts.ts
|
|
215
|
+
const API_BASE_PATH = "prompts";
|
|
216
|
+
const PROMPTS_PATH = "/prompts";
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../core/po-core/src/constants/nativeHost.ts
|
|
219
|
+
/**
|
|
220
|
+
* The only modules a native composition may import at runtime.
|
|
221
|
+
*
|
|
222
|
+
* Defined once here. The CLI native build marks exactly these as external and
|
|
223
|
+
* fails on any other bare import, and the po-native shell builds a frozen module
|
|
224
|
+
* map whose keys must equal this list plus the Unistyles component paths.
|
|
225
|
+
*/
|
|
226
|
+
/** Bare specifiers the shell provides to every native composition. */
|
|
227
|
+
const NATIVE_HOST_MODULES = [
|
|
228
|
+
"react",
|
|
229
|
+
"react/jsx-runtime",
|
|
230
|
+
"react/jsx-dev-runtime",
|
|
231
|
+
"react-native",
|
|
232
|
+
"react-native-unistyles",
|
|
233
|
+
"@tanstack/store",
|
|
234
|
+
"@agimon-ai/po-core/native",
|
|
235
|
+
"@agimon-ai/po-native-components",
|
|
236
|
+
"@agimon-ai/po-native-components/shell",
|
|
237
|
+
"@gorhom/bottom-sheet",
|
|
238
|
+
"expo-symbols",
|
|
239
|
+
"expo-haptics",
|
|
240
|
+
"expo-clipboard",
|
|
241
|
+
"@expo/vector-icons/MaterialIcons",
|
|
242
|
+
"@shopify/flash-list",
|
|
243
|
+
"@react-native-segmented-control/segmented-control",
|
|
244
|
+
"react-native-safe-area-context"
|
|
245
|
+
];
|
|
246
|
+
/** Prefix of the component imports the Unistyles Babel plugin generates. */
|
|
247
|
+
const NATIVE_UNISTYLES_COMPONENT_PREFIX = "react-native-unistyles/components/native/";
|
|
248
|
+
/**
|
|
249
|
+
* Every component under `components/native/` in react-native-unistyles 3.5.2. The Babel plugin can emit
|
|
250
|
+
* all of them, including `NativeText` and `NativeView` for the `unstable_Native*` aliases.
|
|
251
|
+
*/
|
|
252
|
+
const NATIVE_UNISTYLES_COMPONENTS = [
|
|
253
|
+
"ActivityIndicator",
|
|
254
|
+
"Animated",
|
|
255
|
+
"FlatList",
|
|
256
|
+
"Image",
|
|
257
|
+
"ImageBackground",
|
|
258
|
+
"KeyboardAvoidingView",
|
|
259
|
+
"NativeText",
|
|
260
|
+
"NativeView",
|
|
261
|
+
"Pressable",
|
|
262
|
+
"RefreshControl",
|
|
263
|
+
"SafeAreaView",
|
|
264
|
+
"ScrollView",
|
|
265
|
+
"SectionList",
|
|
266
|
+
"Switch",
|
|
267
|
+
"Text",
|
|
268
|
+
"TextInput",
|
|
269
|
+
"TouchableHighlight",
|
|
270
|
+
"TouchableOpacity",
|
|
271
|
+
"View",
|
|
272
|
+
"VirtualizedList"
|
|
273
|
+
];
|
|
274
|
+
[...NATIVE_HOST_MODULES, ...NATIVE_UNISTYLES_COMPONENTS.map((name) => `${NATIVE_UNISTYLES_COMPONENT_PREFIX}${name}`)];
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region ../../default/po-prompt/src/types/apiRoutes.ts
|
|
277
|
+
/**
|
|
278
|
+
* This package's routes, as data.
|
|
279
|
+
*
|
|
280
|
+
* No scope and no base path. The build reads both off
|
|
281
|
+
* `src/extensions/(backend)/api/prompts/`, so the mount is stated once, by the
|
|
282
|
+
* folder that creates it. This package stated it three times before: a
|
|
283
|
+
* constant, and the literal `prompts` twice more inside a URL builder that also
|
|
284
|
+
* decided, on its own, whether a call was global or session scoped.
|
|
285
|
+
*
|
|
286
|
+
* The Hono app registers these paths and the browser addresses them, so a path
|
|
287
|
+
* cannot move on one side alone.
|
|
288
|
+
*
|
|
289
|
+
* `:name` is Hono's own parameter syntax, because the app registers `path`
|
|
290
|
+
* verbatim, and the client fills it from `params` on the call.
|
|
291
|
+
*/
|
|
292
|
+
var apiRoutes_default = defineApiRoutes({
|
|
293
|
+
list: {
|
|
294
|
+
method: "GET",
|
|
295
|
+
path: PROMPTS_PATH,
|
|
296
|
+
response: /* @__PURE__ */ apiResponse()
|
|
297
|
+
},
|
|
298
|
+
save: {
|
|
299
|
+
method: "PUT",
|
|
300
|
+
path: `${PROMPTS_PATH}/:${NAME_PARAM}`,
|
|
301
|
+
response: /* @__PURE__ */ apiResponse()
|
|
302
|
+
},
|
|
303
|
+
/** The same path as `save`; the method is the whole of the difference. */
|
|
304
|
+
remove: {
|
|
305
|
+
method: "DELETE",
|
|
306
|
+
path: `${PROMPTS_PATH}/:${NAME_PARAM}`
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region ../../default/po-prompt/src/services/promptsApi/index.ts
|
|
311
|
+
function toView(prompt) {
|
|
312
|
+
return {
|
|
313
|
+
name: prompt.name,
|
|
314
|
+
description: prompt.description,
|
|
315
|
+
text: prompt.text
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function failureMessage(error) {
|
|
319
|
+
return error instanceof Error ? error.message : "The prompt library could not complete that request.";
|
|
320
|
+
}
|
|
321
|
+
/** Reads `{ text }` out of a request body, or the reason it is unusable. */
|
|
322
|
+
async function readText(request) {
|
|
323
|
+
let payload;
|
|
324
|
+
try {
|
|
325
|
+
payload = await request.json();
|
|
326
|
+
} catch {
|
|
327
|
+
return { error: "The request body must be JSON." };
|
|
328
|
+
}
|
|
329
|
+
const text = payload?.text;
|
|
330
|
+
if (typeof text !== "string" || text.trim().length === 0) return { error: "A non-empty text is required." };
|
|
331
|
+
if (Buffer.byteLength(text, "utf8") > 65536) return { error: "That prompt is too large to save." };
|
|
332
|
+
return { text };
|
|
333
|
+
}
|
|
334
|
+
function createPromptHubApi({ store }) {
|
|
335
|
+
const app = new Hono();
|
|
336
|
+
app.get(apiRoutes_default.list.path, async (context) => {
|
|
337
|
+
try {
|
|
338
|
+
const prompts = await store.list();
|
|
339
|
+
return context.json({ prompts: prompts.map(toView) });
|
|
340
|
+
} catch (error) {
|
|
341
|
+
return context.json({ error: failureMessage(error) }, STATUS.failed);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
app.put(apiRoutes_default.save.path, async (context) => {
|
|
345
|
+
const name = context.req.param(NAME_PARAM);
|
|
346
|
+
if (!isValidPromptName(name)) return context.json({ error: `"${name}" is not a usable prompt name. Use ${PROMPT_NAME_RULE}.` }, STATUS.badRequest);
|
|
347
|
+
const body = await readText(context.req.raw);
|
|
348
|
+
if ("error" in body) {
|
|
349
|
+
const status = body.error.includes("too large") ? STATUS.tooLarge : STATUS.badRequest;
|
|
350
|
+
return context.json({ error: body.error }, status);
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
const replaced = await store.has(name);
|
|
354
|
+
const prompt = {
|
|
355
|
+
name,
|
|
356
|
+
description: describePrompt(body.text),
|
|
357
|
+
text: body.text
|
|
358
|
+
};
|
|
359
|
+
await store.save(prompt);
|
|
360
|
+
return context.json({
|
|
361
|
+
prompt: toView(prompt),
|
|
362
|
+
replaced
|
|
363
|
+
});
|
|
364
|
+
} catch (error) {
|
|
365
|
+
return context.json({ error: failureMessage(error) }, STATUS.failed);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
app.delete(apiRoutes_default.remove.path, async (context) => {
|
|
369
|
+
const name = context.req.param(NAME_PARAM);
|
|
370
|
+
if (!isValidPromptName(name)) return context.json({ error: `"${name}" is not a usable prompt name.` }, STATUS.badRequest);
|
|
371
|
+
try {
|
|
372
|
+
if (!await store.remove(name)) return context.json({ error: `No saved prompt is named "${name}".` }, STATUS.notFound);
|
|
373
|
+
return context.json({ name });
|
|
374
|
+
} catch (error) {
|
|
375
|
+
return context.json({ error: failureMessage(error) }, STATUS.failed);
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
return app;
|
|
379
|
+
}
|
|
380
|
+
/** What a host mounts under this package's base path, answering from `store`. */
|
|
381
|
+
function createPromptApi(store) {
|
|
382
|
+
return {
|
|
383
|
+
basePath: API_BASE_PATH,
|
|
384
|
+
start(_context) {
|
|
385
|
+
const app = createPromptHubApi({ store });
|
|
386
|
+
return {
|
|
387
|
+
fetch: (request) => app.fetch(request),
|
|
388
|
+
close: () => void 0
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region ../../default/po-prompt/src/extensions/(backend)/api/prompts/route.server.ts
|
|
395
|
+
/**
|
|
396
|
+
* Mounts this package's HTTP API at `prompts`, which the folder names.
|
|
397
|
+
*
|
|
398
|
+
* The folder is the declaration: the build reads the base path off it and hands
|
|
399
|
+
* the browser a client bound to the same segment, so the mount is stated once
|
|
400
|
+
* rather than in a constant, a URL builder and a story stub that were each free
|
|
401
|
+
* to drift.
|
|
402
|
+
*
|
|
403
|
+
* The API answers from the filesystem, environment and home the host admitted,
|
|
404
|
+
* so the same route runs on the Node hub and inside a Worker.
|
|
405
|
+
*/
|
|
406
|
+
var route_server_default = defineRoute((plugin) => createPromptApi(hostPromptStore(plugin)));
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../../default/po-prompt/src/constants/prompts.ts
|
|
409
|
+
const COMMAND_NAME = "prompts";
|
|
410
|
+
const SERVER_COMMAND_DESCRIPTION = "List saved prompts or run one by name.";
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region ../../default/po-prompt/src/services/serverPrompts/index.ts
|
|
413
|
+
function createServerPromptCommand(store) {
|
|
414
|
+
return {
|
|
415
|
+
name: COMMAND_NAME,
|
|
416
|
+
description: SERVER_COMMAND_DESCRIPTION,
|
|
417
|
+
async execute(args, execution) {
|
|
418
|
+
const prompts = await store.list();
|
|
419
|
+
const requested = args.trim();
|
|
420
|
+
if (!requested) {
|
|
421
|
+
await execution.client.notify({
|
|
422
|
+
title: "Po prompts",
|
|
423
|
+
body: prompts.map((prompt) => `/${prompt.name}: ${prompt.description}`).join("\n") || "(no saved prompts)",
|
|
424
|
+
level: "info"
|
|
425
|
+
});
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const prompt = prompts.find((candidate) => candidate.name === requested);
|
|
429
|
+
if (!prompt) {
|
|
430
|
+
await execution.client.notify({
|
|
431
|
+
body: `Saved prompt not found: ${requested}`,
|
|
432
|
+
level: "warning"
|
|
433
|
+
});
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
await execution.session.prompt(prompt.text);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region ../../default/po-prompt/src/extensions/workspaces/sessions/(backend)/command/prompts.server.ts
|
|
442
|
+
var prompts_server_default$1 = defineServerCommand((plugin) => createServerPromptCommand(hostPromptStore(plugin)));
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region ../../default/po-prompt/src/extensions/workspaces/sessions/(backend)/resource/help-how-to-prompt.server.ts
|
|
445
|
+
var help_how_to_prompt_server_default = defineResource({
|
|
446
|
+
name: "help-how-to-prompt",
|
|
447
|
+
when: PO_HELP_WHEN,
|
|
448
|
+
kind: "skill",
|
|
449
|
+
read: () => readPackageResource("bundle:///po-prompt/src/extensions/workspaces/sessions/(backend)/resource/help-how-to-prompt.server.ts", "src/prompts/help-how-to-prompt/SKILL.md")
|
|
450
|
+
});
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region ../../default/po-prompt/src/extensions/workspaces/sessions/(backend)/resource/prompts.server.ts
|
|
453
|
+
var prompts_server_default = defineResource((plugin) => {
|
|
454
|
+
const store = hostPromptStore(plugin);
|
|
455
|
+
return {
|
|
456
|
+
name: "po/prompts",
|
|
457
|
+
kind: "prompt",
|
|
458
|
+
read: async () => JSON.stringify(await store.list(), null, 2)
|
|
459
|
+
};
|
|
460
|
+
});
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region ../../default/po-prompt/generated/server.ts
|
|
463
|
+
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
464
|
+
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
465
|
+
...identity,
|
|
466
|
+
...value
|
|
467
|
+
};
|
|
468
|
+
const serverPlugin = defineServerPlugin({
|
|
469
|
+
name: "@agimon-ai/po-prompt",
|
|
470
|
+
global: (context) => ({ get api() {
|
|
471
|
+
return [at(route_server_default, context)];
|
|
472
|
+
} }),
|
|
473
|
+
workspace: (context) => ({ get api() {
|
|
474
|
+
return [at(route_server_default, context)];
|
|
475
|
+
} }),
|
|
476
|
+
session: (context) => ({
|
|
477
|
+
get api() {
|
|
478
|
+
return [at(route_server_default, context)];
|
|
479
|
+
},
|
|
480
|
+
get commands() {
|
|
481
|
+
return [via({ name: "prompts" }, at(prompts_server_default$1, context))];
|
|
482
|
+
},
|
|
483
|
+
get resources() {
|
|
484
|
+
return [at(help_how_to_prompt_server_default, context), at(prompts_server_default, context)];
|
|
485
|
+
}
|
|
486
|
+
})
|
|
487
|
+
});
|
|
488
|
+
//#endregion
|
|
489
|
+
export { serverPlugin as default, serverPlugin };
|