@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/abort-signals-2GUraIGq.js +34 -0
- package/dist/agent-DTjnYFAN.js +6850 -0
- package/dist/anthropic-messages-5ODquUB-.js +14317 -0
- package/dist/{apiContracts-CHOiCbS_.js → apiContracts-DepyzMNr.js} +94 -81
- package/dist/{approval-BMXqnTYd.js → approval-Biq3NCWj.js} +19 -3
- package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DoHlIPkU.js} +2 -2
- package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-BU8DeV_G.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-BkzARjqu.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-B_dgnlXa.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-DMGAifk0.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DwTSK4lj.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-IRaOcC_u.js} +2 -2
- package/dist/assets/assets/channel-BXwM62E-.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-BvS46crW.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T--n96Xbj0.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-D3h_hFRi.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-Cj18feJl.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-DXsT43bg.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-Br7dX7yf.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-BcozAtPo.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-B8kgXgRq.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-Dn7UnsqE.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-BSJot0vi.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-Cpf1EfZK.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-Dnc36uZR.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-C9Ka5KSI.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-BV8_A7x3.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-C4Ne_31B.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-Dq9ModsA.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-1BWEjXP9.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-DREkvC_x.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-CWziP8nx.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DOoYmcvz.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-OoAtEico.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-B-pl2-iR.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-uKzNJSZ2.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-CEXY_Tzu.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-MKlRQo-g.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-c2qlCEVs.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-DTdqLA6J.js} +2 -2
- package/dist/assets/assets/{dist-B3JXhDWV.js → dist-4TUOlkyl.js} +2 -2
- package/dist/assets/assets/{dist-1-mhYUBH.js → dist-BzTxJnSR.js} +2 -2
- package/dist/assets/assets/{dist-XIZum9n5.js → dist-D9lacOpq.js} +2 -2
- package/dist/assets/assets/{dist-gfbb4ygy.js → dist-DCKskbBE.js} +2 -2
- package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DCc8tQ7G.js} +2 -2
- package/dist/assets/assets/{dist-Izr2SB3q.js → dist-DXlts_H5.js} +2 -2
- package/dist/assets/assets/{dist-DvgCCshF.js → dist-DvZCwSZ8.js} +2 -2
- package/dist/assets/assets/{dist-BabjcJ3j.js → dist-mQUN8X3n.js} +2 -2
- package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-qZHwVT1x.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-C89wxfCd.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-BMBgLOae.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-Bb04CRa4.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-DSyNf2MV.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-DXuTqLUd.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-sB7-pF_t.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-pWPBCmdT.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DronDRed.js} +2 -2
- package/dist/assets/assets/index-CBNQEGK3.css +1 -0
- package/dist/assets/assets/index-DdAdCxGc.js +155 -0
- package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-B375mT1i.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-9Hw3wWP7.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-CdPAuupk.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-hqmaHM9u.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-BdOHplX4.js} +2 -2
- package/dist/assets/assets/{line-BsXJZn93.js → line-BCSC3Bu2.js} +2 -2
- package/dist/assets/assets/{linear-BHYaD5T0.js → linear-D5ddQU3r.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-BaSUi_Ph.js} +4 -4
- package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-CUUsU9Ou.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-BtVkhvIZ.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CQ3OUDwI.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-DDnq-Kn3.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-BvOFTkQB.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-Bdwhl9jD.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-GHKoDEeT.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-Yk9rKkKW.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-Crr2QEwm.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CLrgwBog.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-zWReI6MC.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-CnVnlaHi.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-MJ68mMla.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-BYb-mTCH.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-DzONJsqQ.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-0vav9YWV.js} +2 -2
- package/dist/assets/assets/{src-gihY33R9.js → src-DZJUnjaM.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-B0M8THPh.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-5YJZCHIB.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-aJTRXiIU.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-us1LwUHo.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-BSLlcDre.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-DZ2SwLmk.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-BrmvO_6k.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-FKXSeKp5.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-DZ_vIMp2.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-CfLYNckm.js} +2 -2
- package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-CiS_BB3R.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-DBucwhQh.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +2 -2
- package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -0
- package/dist/assets/plugins/slots/approval.3e4ea6e4-CqQk6XG_.js +2 -0
- package/dist/assets/plugins/slots/artifacts.84980c32-DQlO5IFk.js +1 -0
- package/dist/assets/plugins/slots/autocompact.ec8f713f-B3KTYwW1.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.16ef5e25-CZRYQVIP.js +7 -0
- package/dist/assets/plugins/slots/codemode.5f359b9c-Bzl_K_vt.js +10 -0
- package/dist/assets/plugins/slots/domain.832848c8-CvnpuKCY.js +1 -0
- package/dist/assets/plugins/slots/edit.7c802139-kaxIknZ-.js +7 -0
- package/dist/assets/plugins/slots/files.364f16c9-wuB8gcQA.js +2 -0
- package/dist/assets/plugins/slots/grep.d8bf9f57-3FnU8p-d.js +1 -0
- package/dist/assets/plugins/slots/log.07fd59a4-C0PXQ0O1.js +4 -0
- package/dist/assets/plugins/slots/mcp.ea8b6aa2-D0CkHnIw.js +109 -0
- package/dist/assets/plugins/slots/profile.63bc3ae6-BSY3iYfJ.js +1 -0
- package/dist/assets/plugins/slots/prompts.9d9b47cc-xdCkNkoA.js +3 -0
- package/dist/assets/plugins/slots/read.926c024f-qqaxVlEX.js +1 -0
- package/dist/assets/plugins/slots/runner.5393fa6c-DfO2Z9HG.js +8 -0
- package/dist/assets/plugins/slots/skill.56c1cc07-CL_n-l4h.js +4 -0
- package/dist/assets/plugins/slots/vault.587549ba-DbG3F_on.js +1 -0
- package/dist/assets/pwa/pwa.js +12 -12
- package/dist/assets/pwa/sw.js +4 -4
- package/dist/{atomicJson-BJfPFSYF.js → atomicJson-DCIsEywH.js} +3 -3
- package/dist/azure-openai-config-COZUaRzM.js +55 -0
- package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
- package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-Bswjs1av.js} +1 -1
- package/dist/browser-BWf8OMfl.js +3 -0
- package/dist/childSession-Cf2-kH4O.js +22 -0
- package/dist/classifier-shared-IhSH9hhh.js +106 -0
- package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
- package/dist/{codemode-DbPu0yJN.js → codemode-CgVosRtU.js} +5 -2
- package/dist/contracts-CylyLZC8.js +19 -0
- package/dist/diagnostics-1lYFeSJe.js +131 -0
- package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
- package/dist/dist-Dvx5mlIR.js +50 -0
- package/dist/{domains-BNjGTOPj.js → domains-BqChtBLN.js} +90 -16
- package/dist/env-api-keys-Bow6MJe2.js +32 -0
- package/dist/error-body-CJk7jMUh.js +102 -0
- package/dist/esm-BKJy3O9-.js +1553 -0
- package/dist/{exports-BNZz2DNU.js → exports-C_dclnKs.js} +24 -9
- package/dist/{remoteMcp-CMqZldeA.js → exports-DERO0cQf.js} +1154 -175
- package/dist/{extensionFile-CXOa5G4C.js → extensionFile-Ds7RCpnb.js} +12 -2
- package/dist/github-copilot-headers-D1RedfLn.js +22 -0
- package/dist/google-generative-ai-DXTILNT0.js +328 -0
- package/dist/google-shared-e4JDCTVP.js +19588 -0
- package/dist/google-vertex-a1lzvJfq.js +374 -0
- package/dist/{harnessStore-BT706Ly6.js → harnessStore-BectazJQ.js} +4 -4
- package/dist/harnessStore-C0Zwvny8.js +1 -0
- package/dist/hash-Dt6RIbkn.js +16 -0
- package/dist/headers-CwtEVQvr.js +17 -0
- package/dist/help-Dpm82qDr.js +91 -0
- package/dist/{hubChannel-BHQyzcOo.js → hubChannel-COvmdWGO.js} +11 -28
- package/dist/hubRevisions-58pU2dW5.js +363 -0
- package/dist/identity-BgfHobJH.js +165 -0
- package/dist/index.edge-B0D_Lgbx.js +56 -0
- package/dist/index.edge-BLmsRNW8.js +57 -0
- package/dist/index.edge-COJJ_Dv2.js +937 -0
- package/dist/index.edge-ChYa2LU4.js +14 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/{index.edge-BgSx_gRO.js → index.edge-b0z7PQ6b.js} +10 -5
- package/dist/iso-BPQViXM8.js +10 -0
- package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-pQGjhAks.js} +124 -15
- package/dist/{majorModes-DbCfLZH3.js → majorModes-BrL4EtzH.js} +5 -14
- package/dist/majorModes-WXt22_km.js +1 -0
- package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-pbPBBuvs.js} +2 -2
- package/dist/migrations-5gbLIQIc.js +32 -0
- package/dist/mistral-conversations-CLwhVDjA.js +689 -0
- package/dist/models-Chzm15vC.js +1511 -0
- package/dist/node-BT4GsJQp.js +2479 -0
- package/dist/node-DytJOfYf.js +23 -0
- package/dist/notification-CINsJWDL.js +102 -0
- package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
- package/dist/openai-completions-CcNhAv8l.js +984 -0
- package/dist/openai-decisions-BsFjaAGw.js +142 -0
- package/dist/openai-kPrtlgjl.js +17357 -0
- package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
- package/dist/openai-responses-C5Gp2UOV.js +281 -0
- package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
- package/dist/openrouter-cost-CvC52g3b.js +30 -0
- package/dist/openrouter-images-BoHl8g8p.js +124 -0
- package/dist/photon_rs_bg.wasm +0 -0
- package/dist/pi-messages-BXfrZLC7.js +312 -0
- package/dist/piConfig-BDUpA6w0.js +127 -0
- package/dist/piSettings-tdui0CZI.js +1 -0
- package/dist/{platform-B4AAgwJ0.js → platform-yhQXrrM_.js} +1 -1
- package/dist/{platformFiles-C_bXo4Ig.js → platformFiles-DB3Cw1l_.js} +27 -2
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/{protocol-Xpm_mCNN.js → protocol-B6LbEIe6.js} +2 -2
- package/dist/provider-env-CxhHUFiF.js +38 -0
- package/dist/provider-retry-BUoezuw8.js +79 -0
- package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
- package/dist/sealedChannel-BeWNTWys.js +27 -0
- package/dist/{server-BZh1ZXz_.js → server-1O3JEYO0.js} +8 -19
- package/dist/server-B2G-c0hg.js +639 -0
- package/dist/{server-Dpgh8PDh.js → server-B8P-UkxF.js} +14 -5
- package/dist/server-BR9yl54i.js +2658 -0
- package/dist/{server-tvgQ99rv.js → server-BXFDsLgm.js} +371 -120
- package/dist/{server-BAAL9-NA.js → server-Bt6Zsqo8.js} +3 -10
- package/dist/server-CCwwnpH0.js +148 -0
- package/dist/{server-D4W7EdJY.js → server-Cgym-G0a.js} +16 -16
- package/dist/{server-DJAanjoI.js → server-Ci3ls6LL.js} +492 -103
- package/dist/{server-36iuA3MI.js → server-Ci_BGVwd.js} +3 -3
- package/dist/{server-A-_GFpPr.js → server-CyYesT-G.js} +10 -9
- package/dist/server-CzJjYgVk.js +295 -0
- package/dist/server-DFCXmDed.js +1806 -0
- package/dist/{server-BE6VqEiA.js → server-DL6UyXfJ.js} +19 -12
- package/dist/{server-D8ndq0wL.js → server-DPTp6GXS.js} +11 -9
- package/dist/server-DRcCuj6P.js +217 -0
- package/dist/server-Dgn4el5K.js +190 -0
- package/dist/server-DhkR6ugd.js +577 -0
- package/dist/server-GIQIpf33.js +489 -0
- package/dist/server-OerXqXJT.js +680 -0
- package/dist/server-Re1VNk9s.js +1517 -0
- package/dist/{server-Dt4y1rZD.js → server-V8W5mcGu.js} +6 -6
- package/dist/server-_0288DYR.js +935 -0
- package/dist/server-cStfn1Yv.js +505 -0
- package/dist/server-pY027myK.js +1057 -0
- package/dist/{build-2gFaVEfG.js → serverPlugin-OOfjB8tm.js} +3937 -3
- package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-DfwcUKO2.js} +551 -760
- package/dist/simple-options-CFzI5Pd_.js +156 -0
- package/dist/streaming-json-BWTHTwz-.js +858 -0
- package/dist/system-one-shared-CiIrx29d.js +132 -0
- package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
- package/dist/transform-messages-D77af7Bx.js +356 -0
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/typesafe-system-one-DGxeggJh.js +37 -0
- package/dist/uuid-B0QJx6Kr.js +31 -0
- package/dist/{validation-D77NZBrx.js → validation-DuOGOKEi.js} +2 -2
- package/dist/{value-Djvc2foV.js → value-DyVsxCwZ.js} +1 -1
- package/dist/vaultSettings-BFCRCBM3.js +328 -0
- package/dist/web-cN41ySs9.js +3 -0
- package/dist/worker.js +95189 -49865
- package/dist/workflow-BgwWq0nq.js +79 -0
- package/package.json +32 -22
- package/wrangler.jsonc +2 -2
- package/dist/assets/assets/channel-CMrEzemr.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
- package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
- package/dist/assets/assets/index-DZM68mTk.css +0 -1
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
- package/dist/contextProjection-DVP2Vc5j.js +0 -188
- package/dist/harnessStore-BiH9vSuD.js +0 -1
- package/dist/majorModes-BvWNqoHt.js +0 -1
- package/dist/piSettings-B6fsgIBA.js +0 -1
- package/dist/server-BZaPPoQp.js +0 -592
- package/dist/server-D75MWDhB.js +0 -118
- package/dist/server-r358hzQg.js +0 -280
- package/dist/serverPlugin-BOI6c6s5.js +0 -3393
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import "./
|
|
12
|
-
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-DbPu0yJN.js";
|
|
1
|
+
import { $n as requirePoFs, B as String$1, Bn as BACKGROUND_CONTEXT, Jn as PO_SQLITE_SERVICE, Kn as PO_FS_SERVICE, R as Union, W as Null, X as Literal, _ as composeServerProviderOverrides, a as PoHeadlessPromptAdmissionError, ar as requirePoServerScope, bn as getOrThrow, er as requirePoSqlite, ft as _Object_, gn as nodeHost, mn as createSerialRunner, mt as Optional, nr as PO_SERVER_SCOPE_SERVICE, pn as poHomeDirectory, rr as defineServiceContract, s as PoSessionSetupError, u as isPoHeadlessPromptAdmissionError, x as PO_CONFIG_SERVICE, yt as _Array_ } from "./serverPlugin-OOfjB8tm.js";
|
|
2
|
+
import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-DepyzMNr.js";
|
|
3
|
+
import { n as pathExists, o as removePath, s as writeFileAtomic } from "./platformFiles-DB3Cw1l_.js";
|
|
4
|
+
import "./platform-yhQXrrM_.js";
|
|
5
|
+
import "./piSettings-tdui0CZI.js";
|
|
6
|
+
import { c as ProfileCatalogChangedError, d as planGlobalProfileRootAsync, f as inlineProfile, h as PO_PERSON_TIME_ZONE_SERVICE, l as commitGlobalProfileRootAsync, m as parseProfileVaultSecrets, p as parseProfileBinding, u as loadProfilesAsync, v as readPoPersonTimeZone, y as PO_PROFILE_IDENTITY_ENTRY_TYPE } from "./sessionConfig-DfwcUKO2.js";
|
|
7
|
+
import { n as Check } from "./value-DyVsxCwZ.js";
|
|
8
|
+
import "./exports-C_dclnKs.js";
|
|
9
|
+
import { c as defineRoute, i as defineHook, l as defineRoutedContribution, m as runCleanups, n as composeRootInjects, o as defineResource, p as defineServerPlugin, s as defineRoot, t as composeRootHooks } from "./extensionFile-Ds7RCpnb.js";
|
|
10
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-b0z7PQ6b.js";
|
|
11
|
+
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CgVosRtU.js";
|
|
13
12
|
import path from "node:path";
|
|
13
|
+
//#region ../../foundations/po-config/src/services/profiles/sync.edge.ts
|
|
14
|
+
function nodeOnly(name, asyncName) {
|
|
15
|
+
throw new Error(`${name} is Node-only; use ${asyncName} with a PoPlatform on the edge.`);
|
|
16
|
+
}
|
|
17
|
+
/** @deprecated Node-only sync shim; use loadProfilesAsync. Removed in M2. */
|
|
18
|
+
function loadProfiles(_repoRoot, _homeDirectory) {
|
|
19
|
+
return nodeOnly("loadProfiles", "loadProfilesAsync");
|
|
20
|
+
}
|
|
21
|
+
/** @deprecated Node-only sync shim; use buildPersonaPromptAsync. Removed in M2. */
|
|
22
|
+
function buildPersonaPrompt(_personaRoot, _personaDirectory) {
|
|
23
|
+
return nodeOnly("buildPersonaPrompt", "buildPersonaPromptAsync");
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
14
26
|
//#region ../../foundations/po-profile/src/constants/profileMemory.ts
|
|
15
27
|
const PROFILE_MEMORY_STORE_SERVICE = "po/profile-memory-store";
|
|
16
28
|
const PROFILE_MEMORY_NAMESPACE_SOURCE = "@agimon-ai/po-profile/memory";
|
|
@@ -428,8 +440,12 @@ var root_server_default$1 = defineRoot(({ host }) => {
|
|
|
428
440
|
services: [async (context) => {
|
|
429
441
|
await context.inject([PO_SERVER_SCOPE_SERVICE], async (scoped) => {
|
|
430
442
|
const scope = requirePoServerScope(scoped);
|
|
431
|
-
await scope.provide(defineServiceContract(PROFILE_SECRETS_SERVICE, { scope: host.scope }), secrets);
|
|
432
|
-
await scope.provide(defineServiceContract(PROFILE_SOURCES_SERVICE, { scope: host.scope }), sources);
|
|
443
|
+
const releaseSecrets = await scope.provide(defineServiceContract(PROFILE_SECRETS_SERVICE, { scope: host.scope }), secrets);
|
|
444
|
+
const releaseSources = await scope.provide(defineServiceContract(PROFILE_SOURCES_SERVICE, { scope: host.scope }), sources);
|
|
445
|
+
return async () => {
|
|
446
|
+
await releaseSources();
|
|
447
|
+
await releaseSecrets();
|
|
448
|
+
};
|
|
433
449
|
});
|
|
434
450
|
}, async (context) => {
|
|
435
451
|
await context.inject([
|
|
@@ -744,6 +760,9 @@ const PROFILE_RUNTIME_SERVICE = "po/profile-runtime";
|
|
|
744
760
|
//#region ../../foundations/po-profile/src/services/profileRuntime/index.ts
|
|
745
761
|
const UNAVAILABLE = "Profile integration provider is unavailable";
|
|
746
762
|
const INVALIDATED = "Profile operation was invalidated";
|
|
763
|
+
/** Vault namespace for secrets saved from the composer; po-vault's `VAULT_SECRETS_NAMESPACE` writes it. */
|
|
764
|
+
const VAULT_SECRETS_NAMESPACE = "secrets";
|
|
765
|
+
const ALIAS_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/u;
|
|
747
766
|
/** A single selected profile and provider, owned by one session, not a provider registry. */
|
|
748
767
|
var SessionProfileRuntime = class {
|
|
749
768
|
options;
|
|
@@ -764,10 +783,14 @@ var SessionProfileRuntime = class {
|
|
|
764
783
|
capture(profileName, generation) {
|
|
765
784
|
const binding = profileName === void 0 ? void 0 : this.options.readBinding(profileName);
|
|
766
785
|
const env = profileName === void 0 ? void 0 : this.options.readEnv?.(profileName);
|
|
786
|
+
const sourceSecrets = profileName === void 0 ? void 0 : this.options.readSecrets?.(profileName);
|
|
787
|
+
const secrets = sourceSecrets === void 0 ? void 0 : parseProfileVaultSecrets(sourceSecrets);
|
|
788
|
+
if (secrets && Object.keys(secrets).some((name) => binding?.secrets && Object.hasOwn(binding.secrets, name))) throw new Error("Profile secret aliases must be unique");
|
|
767
789
|
return Object.freeze({
|
|
768
790
|
...profileName === void 0 ? {} : { profileName },
|
|
769
791
|
...binding === void 0 ? {} : { integration: parseProfileBinding(binding) },
|
|
770
792
|
...env === void 0 ? {} : { env: Object.freeze({ ...env }) },
|
|
793
|
+
...secrets === void 0 ? {} : { secrets },
|
|
771
794
|
generation,
|
|
772
795
|
signal: this.controller.signal
|
|
773
796
|
});
|
|
@@ -883,6 +906,11 @@ var SessionProfileRuntime = class {
|
|
|
883
906
|
if (!reference.allowedOrigins.includes(request.origin)) throw new Error("Profile secret origin is not allowed");
|
|
884
907
|
});
|
|
885
908
|
}
|
|
909
|
+
resolveInputSecret(name, request) {
|
|
910
|
+
return this.resolveReference(name, request.signal, (reference) => {
|
|
911
|
+
if (!reference.purposes.includes("input") || !reference.allowedTargets || !Object.hasOwn(reference.allowedTargets, request.surface) || !reference.allowedTargets[request.surface]?.includes(request.target)) throw new Error("Profile secret input target is not allowed");
|
|
912
|
+
});
|
|
913
|
+
}
|
|
886
914
|
resolveProxySecret(signal) {
|
|
887
915
|
const name = this.snapshot.integration?.browser?.proxySecret;
|
|
888
916
|
if (name === void 0) return Promise.reject(/* @__PURE__ */ new Error("Profile proxy is not configured"));
|
|
@@ -890,26 +918,80 @@ var SessionProfileRuntime = class {
|
|
|
890
918
|
if (!reference.purposes.includes("proxy")) throw new Error("Profile secret alias is unavailable");
|
|
891
919
|
});
|
|
892
920
|
}
|
|
921
|
+
/** Refresh only value-free aliases, never the selected provider or browser identity. */
|
|
922
|
+
currentBinding(snapshot) {
|
|
923
|
+
if (!snapshot.integration || snapshot.profileName === void 0) return void 0;
|
|
924
|
+
let current;
|
|
925
|
+
try {
|
|
926
|
+
current = parseProfileBinding(this.options.readBinding(snapshot.profileName));
|
|
927
|
+
} catch {
|
|
928
|
+
throw new Error(INVALIDATED);
|
|
929
|
+
}
|
|
930
|
+
const selected = snapshot.integration;
|
|
931
|
+
if (current.provider !== selected.provider || current.organizationId !== selected.organizationId || current.mailboxId !== selected.mailboxId || current.credentialRef !== selected.credentialRef) throw new Error(INVALIDATED);
|
|
932
|
+
return current;
|
|
933
|
+
}
|
|
893
934
|
async resolveReference(name, requestSignal, authorize) {
|
|
894
935
|
if (this.initializing) throw new Error("Profile secrets are unavailable during provider initialization");
|
|
895
936
|
await this.ready();
|
|
896
937
|
const snapshot = this.snapshot;
|
|
897
938
|
const connection = this.connection;
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
|
|
939
|
+
const current = this.currentBinding(snapshot);
|
|
940
|
+
const vaultReference = snapshot.secrets && Object.hasOwn(snapshot.secrets, name) ? snapshot.secrets[name] : void 0;
|
|
941
|
+
const providerReference = current?.secrets && Object.hasOwn(current.secrets, name) ? current.secrets[name] : void 0;
|
|
942
|
+
if (vaultReference && providerReference) throw new Error("Profile secret aliases must be unique");
|
|
901
943
|
const signal = requestSignal ? AbortSignal.any([snapshot.signal, requestSignal]) : snapshot.signal;
|
|
944
|
+
const saved = vaultReference || providerReference ? void 0 : await this.savedSecret(name, signal);
|
|
945
|
+
const reference = vaultReference ?? providerReference ?? saved?.reference;
|
|
946
|
+
if (!reference) throw new Error("Profile secret alias is unavailable");
|
|
947
|
+
authorize(reference);
|
|
902
948
|
if (signal.aborted) throw new Error(INVALIDATED);
|
|
903
949
|
let value;
|
|
904
950
|
try {
|
|
905
|
-
value =
|
|
951
|
+
if (saved) value = saved.value;
|
|
952
|
+
else if (vaultReference) {
|
|
953
|
+
if (!this.options.readVault) throw new Error("Vault unavailable");
|
|
954
|
+
const { namespace, key, field } = vaultReference.vault;
|
|
955
|
+
const entry = await this.options.readVault(namespace, key, signal);
|
|
956
|
+
const selected = field === void 0 ? entry : typeof entry === "object" && entry !== null && !Array.isArray(entry) && Object.hasOwn(entry, field) ? entry[field] : void 0;
|
|
957
|
+
if (typeof selected !== "string") throw new Error("Vault field unavailable");
|
|
958
|
+
value = selected;
|
|
959
|
+
} else {
|
|
960
|
+
if (!connection || !providerReference) throw new Error("Provider unavailable");
|
|
961
|
+
value = await connection.resolveSecret(providerReference, signal);
|
|
962
|
+
}
|
|
906
963
|
} catch {
|
|
907
964
|
throw new Error("Profile secret resolution failed");
|
|
908
965
|
}
|
|
909
966
|
if (signal.aborted || this.snapshot !== snapshot || this.connection !== connection) throw new Error(INVALIDATED);
|
|
967
|
+
if (JSON.stringify(this.currentBinding(snapshot)?.secrets[name]) !== JSON.stringify(providerReference)) throw new Error(INVALIDATED);
|
|
910
968
|
if (typeof value !== "string" || value.length === 0) throw new Error("Profile secret field is unavailable");
|
|
911
969
|
return value;
|
|
912
970
|
}
|
|
971
|
+
/** `secrets/<name>` as `{value, purposes, allowedOrigins?, allowedTargets?}`, checked like a profile alias. */
|
|
972
|
+
async savedSecret(name, signal) {
|
|
973
|
+
if (!this.options.readVault || !ALIAS_PATTERN.test(name)) return void 0;
|
|
974
|
+
try {
|
|
975
|
+
const entry = await this.options.readVault(VAULT_SECRETS_NAMESPACE, name, signal);
|
|
976
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return void 0;
|
|
977
|
+
const { value, ...delivery } = entry;
|
|
978
|
+
const vault = {
|
|
979
|
+
namespace: VAULT_SECRETS_NAMESPACE,
|
|
980
|
+
key: name,
|
|
981
|
+
field: "value"
|
|
982
|
+
};
|
|
983
|
+
const reference = parseProfileVaultSecrets({ [name]: {
|
|
984
|
+
...delivery,
|
|
985
|
+
vault
|
|
986
|
+
} }, "Saved secret")[name];
|
|
987
|
+
return reference && {
|
|
988
|
+
reference,
|
|
989
|
+
value
|
|
990
|
+
};
|
|
991
|
+
} catch {
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
913
995
|
dispose() {
|
|
914
996
|
if (this.disposal) return this.disposal;
|
|
915
997
|
this.disposed = true;
|
|
@@ -1048,7 +1130,7 @@ function createProfileServerCommand(host, state, sources, lifetime) {
|
|
|
1048
1130
|
if (signal.aborted) return;
|
|
1049
1131
|
if (requested && !profiles.some(({ name }) => name === requested)) throw new Error(`Unknown profile: ${requested}`);
|
|
1050
1132
|
const profile = requested || void 0;
|
|
1051
|
-
if (profile === execution.selection.profile && host.inspectCapabilities().ready) return;
|
|
1133
|
+
if (profile !== void 0 && profile === execution.selection.profile && host.inspectCapabilities().ready) return;
|
|
1052
1134
|
try {
|
|
1053
1135
|
await host.changeSelection({
|
|
1054
1136
|
axis: "profile",
|
|
@@ -1095,14 +1177,16 @@ function profileSessionState(context) {
|
|
|
1095
1177
|
}
|
|
1096
1178
|
//#endregion
|
|
1097
1179
|
//#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/root.server.ts
|
|
1098
|
-
var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
1180
|
+
var root_server_default = defineRoot(async ({ agent, host, signal, context }) => {
|
|
1099
1181
|
if (!agent) return { value: void 0 };
|
|
1100
1182
|
const execution = agent.context;
|
|
1101
1183
|
const scope = { workspaceId: host.context.workspaceId };
|
|
1102
1184
|
const state = profileSessionState(context);
|
|
1103
|
-
const homeDirectory =
|
|
1104
|
-
|
|
1105
|
-
const
|
|
1185
|
+
const homeDirectory = host.context.homeDirectory ?? execution.environment.HOME;
|
|
1186
|
+
if (!homeDirectory) throw new Error("Profile session requires a host home directory.");
|
|
1187
|
+
const loadFiles = () => loadProfilesAsync(requirePoFs(context), execution.repoRoot, BACKGROUND_CONTEXT, homeDirectory);
|
|
1188
|
+
let files = await loadFiles();
|
|
1189
|
+
const readProfile = (profileName) => findProfile(files, readProfileSources(context, scope), profileName);
|
|
1106
1190
|
const handoff = readInitialProfileOutcome(context);
|
|
1107
1191
|
let publishOutcome;
|
|
1108
1192
|
const applyHandoff = (selection, outcome) => {
|
|
@@ -1112,7 +1196,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1112
1196
|
...selection,
|
|
1113
1197
|
profile: void 0
|
|
1114
1198
|
};
|
|
1115
|
-
if (mergeProfiles(
|
|
1199
|
+
if (mergeProfiles(files, readProfileSources(context, scope)).some((profile) => profile.name === name)) return {
|
|
1116
1200
|
...selection,
|
|
1117
1201
|
profile: name
|
|
1118
1202
|
};
|
|
@@ -1130,7 +1214,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1130
1214
|
kind: "named",
|
|
1131
1215
|
name: selection.profile
|
|
1132
1216
|
};
|
|
1133
|
-
const outcome = await resolveInitialProfile(
|
|
1217
|
+
const outcome = await resolveInitialProfile(files, readProfileSources(context, scope), {
|
|
1134
1218
|
intent,
|
|
1135
1219
|
scope,
|
|
1136
1220
|
signal
|
|
@@ -1143,13 +1227,34 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1143
1227
|
};
|
|
1144
1228
|
};
|
|
1145
1229
|
const unregisterResolver = agent.registerInitialSelectionResolver((selection) => handoff === void 0 ? resolveStartup(selection) : applyHandoff(selection, handoff));
|
|
1230
|
+
let vaultBinding;
|
|
1146
1231
|
const runtime = createProfileRuntime({
|
|
1147
1232
|
readBinding: (profileName) => readProfile(profileName).integration,
|
|
1148
|
-
readEnv: (profileName) => readProfile(profileName).env
|
|
1233
|
+
readEnv: (profileName) => readProfile(profileName).env,
|
|
1234
|
+
readSecrets: (profileName) => readProfile(profileName).secrets,
|
|
1235
|
+
readVault: async (namespace, key, requestSignal) => {
|
|
1236
|
+
requestSignal.throwIfAborted();
|
|
1237
|
+
const binding = vaultBinding;
|
|
1238
|
+
if (!binding?.active) throw new Error("Profile vault is unavailable");
|
|
1239
|
+
const record = await binding.provider.get(namespace, key);
|
|
1240
|
+
requestSignal.throwIfAborted();
|
|
1241
|
+
if (!binding.active) throw new Error("Profile vault is unavailable");
|
|
1242
|
+
return record?.value;
|
|
1243
|
+
}
|
|
1149
1244
|
});
|
|
1245
|
+
let selectedProfile;
|
|
1246
|
+
let personTimeZone;
|
|
1247
|
+
const publishTimeZone = () => personTimeZone?.setProfile(selectedProfile === void 0 ? void 0 : readProfile(selectedProfile).timezone);
|
|
1150
1248
|
const unsubscribe = agent.subscribeSelection(async (selection, applied) => {
|
|
1151
1249
|
try {
|
|
1152
|
-
|
|
1250
|
+
const force = applied?.refresh?.includes("profile") === true;
|
|
1251
|
+
if (force) {
|
|
1252
|
+
runtime.invalidate();
|
|
1253
|
+
files = await loadFiles();
|
|
1254
|
+
}
|
|
1255
|
+
await runtime.select(selection.profile, { force });
|
|
1256
|
+
selectedProfile = selection.profile;
|
|
1257
|
+
publishTimeZone();
|
|
1153
1258
|
} catch (error) {
|
|
1154
1259
|
throw new PoHeadlessPromptAdmissionError(error);
|
|
1155
1260
|
}
|
|
@@ -1162,6 +1267,28 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1162
1267
|
value: runtime,
|
|
1163
1268
|
services: [
|
|
1164
1269
|
createProfileRuntimePlugin(runtime),
|
|
1270
|
+
(serviceContext) => {
|
|
1271
|
+
serviceContext.inject(["po/vault"], (injected) => {
|
|
1272
|
+
const binding = {
|
|
1273
|
+
provider: injected.get("po/vault"),
|
|
1274
|
+
active: true
|
|
1275
|
+
};
|
|
1276
|
+
vaultBinding = binding;
|
|
1277
|
+
return () => {
|
|
1278
|
+
binding.active = false;
|
|
1279
|
+
if (vaultBinding === binding) vaultBinding = void 0;
|
|
1280
|
+
};
|
|
1281
|
+
});
|
|
1282
|
+
},
|
|
1283
|
+
(serviceContext) => {
|
|
1284
|
+
serviceContext.inject([PO_PERSON_TIME_ZONE_SERVICE], (injected) => {
|
|
1285
|
+
personTimeZone = readPoPersonTimeZone(injected);
|
|
1286
|
+
publishTimeZone();
|
|
1287
|
+
return () => {
|
|
1288
|
+
personTimeZone = void 0;
|
|
1289
|
+
};
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1165
1292
|
(serviceContext) => {
|
|
1166
1293
|
if (handoff !== void 0) return;
|
|
1167
1294
|
serviceContext.provide(PROFILE_INITIAL_OUTCOME_SERVICE, void 0);
|
|
@@ -1194,6 +1321,324 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1194
1321
|
};
|
|
1195
1322
|
});
|
|
1196
1323
|
//#endregion
|
|
1324
|
+
//#region ../../foundations/po-profile/src/constants/personaPresets.ts
|
|
1325
|
+
/** Starting personalities for a personal coordinator agent. `soul` becomes its SOUL.md. */
|
|
1326
|
+
const PERSONA_PRESETS = [
|
|
1327
|
+
{
|
|
1328
|
+
id: "focused",
|
|
1329
|
+
label: "Focused",
|
|
1330
|
+
description: "A precise coding partner that keeps work small and verified.",
|
|
1331
|
+
soul: "You are a focused engineering coordinator.\n\nKeep answers short and concrete. Prefer the smallest change that works, and verify it before calling it done.\n\nSplit larger work into clear tasks and hand them to sessions or subagents when that is faster."
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
id: "friendly",
|
|
1335
|
+
label: "Friendly",
|
|
1336
|
+
description: "A warm everyday assistant that explains things plainly.",
|
|
1337
|
+
soul: "You are a friendly personal assistant and coordinator.\n\nSpeak plainly and kindly. Ask one clear question when something is ambiguous, then get on with it.\n\nKeep track of what the person is juggling and offer to take the next step."
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
id: "creative",
|
|
1341
|
+
label: "Creative",
|
|
1342
|
+
description: "A marketing partner that offers fresh angles and options.",
|
|
1343
|
+
soul: "You are a creative marketing coordinator.\n\nOffer a few distinct angles before settling on one. Write in a lively, specific voice and avoid cliches.\n\nTie every idea back to the audience and the goal the person named."
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
id: "persuasive",
|
|
1347
|
+
label: "Persuasive",
|
|
1348
|
+
description: "A sales partner that frames value and drives to the next step.",
|
|
1349
|
+
soul: "You are a persuasive sales coordinator.\n\nLead with the value to the customer, back claims with evidence, and keep messages short.\n\nAlways propose a clear next step, and never promise what cannot be delivered."
|
|
1350
|
+
}
|
|
1351
|
+
];
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region ../../foundations/po-profile/src/schemas/apiContracts.ts
|
|
1354
|
+
const ProfileSelectionSchema = _Object_({ profile: Union([Null(), String$1({ minLength: 1 })]) }, { additionalProperties: false });
|
|
1355
|
+
const CreateProfileSchema = _Object_({
|
|
1356
|
+
alias: String$1({ pattern: "^[a-z0-9][a-z0-9-]{0,39}$" }),
|
|
1357
|
+
displayName: String$1({
|
|
1358
|
+
minLength: 1,
|
|
1359
|
+
maxLength: 80
|
|
1360
|
+
}),
|
|
1361
|
+
preset: Union(PERSONA_PRESETS.map(({ id }) => Literal(id))),
|
|
1362
|
+
note: Optional(String$1({ maxLength: 1e3 })),
|
|
1363
|
+
avatarPngBase64: Optional(String$1({
|
|
1364
|
+
minLength: 1,
|
|
1365
|
+
maxLength: 262144
|
|
1366
|
+
}))
|
|
1367
|
+
}, { additionalProperties: false });
|
|
1368
|
+
const CreatedProfileSchema = _Object_({ name: String$1() });
|
|
1369
|
+
const CurrentProfileSchema = _Object_({ profile: Union([Null(), String$1()]) });
|
|
1370
|
+
const ProfileCatalogSchema = _Object_({
|
|
1371
|
+
profiles: _Array_(_Object_({
|
|
1372
|
+
name: String$1(),
|
|
1373
|
+
identity: Optional(_Object_({
|
|
1374
|
+
name: Optional(String$1()),
|
|
1375
|
+
icon: Optional(String$1()),
|
|
1376
|
+
role: Optional(String$1()),
|
|
1377
|
+
contact: Optional(String$1())
|
|
1378
|
+
})),
|
|
1379
|
+
sourceId: String$1()
|
|
1380
|
+
})),
|
|
1381
|
+
readiness: Union([Literal("ready"), Literal("unavailable")])
|
|
1382
|
+
});
|
|
1383
|
+
defineApiContract({
|
|
1384
|
+
version: 1,
|
|
1385
|
+
http: [
|
|
1386
|
+
{
|
|
1387
|
+
id: "profile.create",
|
|
1388
|
+
scope: "global",
|
|
1389
|
+
basePath: "profile",
|
|
1390
|
+
path: "/profiles",
|
|
1391
|
+
method: "POST",
|
|
1392
|
+
authentication: "owner",
|
|
1393
|
+
description: "Create a personal coordinator profile under ~/.po/agents from a persona preset and list that root in ~/.po/profiles.yaml. Answers 200 when it rewrites a coordinator it made earlier under the same alias.",
|
|
1394
|
+
body: {
|
|
1395
|
+
required: true,
|
|
1396
|
+
contentType: "application/json",
|
|
1397
|
+
schema: CreateProfileSchema
|
|
1398
|
+
},
|
|
1399
|
+
responses: {
|
|
1400
|
+
...jsonApiResponses(CreatedProfileSchema),
|
|
1401
|
+
...jsonApiResponses(CreatedProfileSchema, 201)
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
id: "profile.current",
|
|
1406
|
+
scope: "session",
|
|
1407
|
+
basePath: "profile",
|
|
1408
|
+
path: "/current",
|
|
1409
|
+
method: "GET",
|
|
1410
|
+
authentication: "owner",
|
|
1411
|
+
description: "Read the current session selection.",
|
|
1412
|
+
responses: jsonApiResponses(CurrentProfileSchema)
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
id: "profile.launchProfiles",
|
|
1416
|
+
scope: "workspace",
|
|
1417
|
+
basePath: "profile",
|
|
1418
|
+
path: "/launch-profiles",
|
|
1419
|
+
method: "GET",
|
|
1420
|
+
authentication: "owner",
|
|
1421
|
+
description: "List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
1422
|
+
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
id: "profile.profiles",
|
|
1426
|
+
scope: "session",
|
|
1427
|
+
basePath: "profile",
|
|
1428
|
+
path: "/profiles",
|
|
1429
|
+
method: "GET",
|
|
1430
|
+
authentication: "owner",
|
|
1431
|
+
description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
1432
|
+
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
id: "profile.select",
|
|
1436
|
+
scope: "session",
|
|
1437
|
+
basePath: "profile",
|
|
1438
|
+
path: "/current",
|
|
1439
|
+
method: "PUT",
|
|
1440
|
+
authentication: "owner",
|
|
1441
|
+
description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
|
|
1442
|
+
body: {
|
|
1443
|
+
required: true,
|
|
1444
|
+
contentType: "application/json",
|
|
1445
|
+
schema: ProfileSelectionSchema
|
|
1446
|
+
},
|
|
1447
|
+
responses: {
|
|
1448
|
+
...jsonApiResponses(CurrentProfileSchema),
|
|
1449
|
+
"400": { description: "Invalid profile selection." },
|
|
1450
|
+
"404": { description: "Unknown profile." },
|
|
1451
|
+
"503": { description: "Sources or integration unavailable; never automatically replay this write." }
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
],
|
|
1455
|
+
sockets: [],
|
|
1456
|
+
dynamic: []
|
|
1457
|
+
});
|
|
1458
|
+
//#endregion
|
|
1459
|
+
//#region ../../foundations/po-profile/src/services/profileCreation/type.ts
|
|
1460
|
+
/** A refusal with the HTTP status that describes it. Messages never echo request values. */
|
|
1461
|
+
var ProfileCreationError = class extends Error {
|
|
1462
|
+
status;
|
|
1463
|
+
constructor(status, message) {
|
|
1464
|
+
super(message);
|
|
1465
|
+
this.status = status;
|
|
1466
|
+
this.name = "ProfileCreationError";
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region ../../foundations/po-profile/src/services/profileCreation/index.ts
|
|
1471
|
+
const AGENTS_ROOT = "agents";
|
|
1472
|
+
const AVATAR_FILE = "avatar.png";
|
|
1473
|
+
const COORDINATOR_ROLE = "coordinator";
|
|
1474
|
+
const NOTES_HEADING = "## Notes from the person";
|
|
1475
|
+
const BASE64_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
1476
|
+
const DATA_URL_PREFIX = /^data:[a-z]+\/[a-z0-9.+-]+;base64,/i;
|
|
1477
|
+
const INVALID_AVATAR = "Avatar must be a PNG, JPEG, GIF or WebP image of at most 256 KiB";
|
|
1478
|
+
const startsWith = (bytes, offset, expected) => {
|
|
1479
|
+
const values = typeof expected === "string" ? Array.from({ length: expected.length }, (_, index) => expected.charCodeAt(index)) : expected;
|
|
1480
|
+
return bytes.length >= offset + values.length && values.every((value, index) => bytes[offset + index] === value);
|
|
1481
|
+
};
|
|
1482
|
+
/** Magic bytes, never the declared type. SVG has no entry: it executes script when the cockpit renders it. */
|
|
1483
|
+
const SIGNATURES = [
|
|
1484
|
+
{
|
|
1485
|
+
mime: "image/png",
|
|
1486
|
+
test: (bytes) => startsWith(bytes, 0, [
|
|
1487
|
+
137,
|
|
1488
|
+
80,
|
|
1489
|
+
78,
|
|
1490
|
+
71,
|
|
1491
|
+
13,
|
|
1492
|
+
10,
|
|
1493
|
+
26,
|
|
1494
|
+
10
|
|
1495
|
+
])
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
mime: "image/jpeg",
|
|
1499
|
+
test: (bytes) => startsWith(bytes, 0, [
|
|
1500
|
+
255,
|
|
1501
|
+
216,
|
|
1502
|
+
255
|
|
1503
|
+
])
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
mime: "image/gif",
|
|
1507
|
+
test: (bytes) => startsWith(bytes, 0, "GIF8")
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
mime: "image/webp",
|
|
1511
|
+
test: (bytes) => startsWith(bytes, 0, "RIFF") && startsWith(bytes, 8, "WEBP")
|
|
1512
|
+
}
|
|
1513
|
+
];
|
|
1514
|
+
/** Decoded avatar bytes the profile loader will keep: an allowed image within its data URL bound. */
|
|
1515
|
+
function avatarBytes(encoded) {
|
|
1516
|
+
const base64 = encoded.replace(DATA_URL_PREFIX, "").replace(/\s/g, "");
|
|
1517
|
+
if (!BASE64_PATTERN.test(base64)) throw new ProfileCreationError(422, INVALID_AVATAR);
|
|
1518
|
+
let bytes;
|
|
1519
|
+
try {
|
|
1520
|
+
bytes = Uint8Array.from(atob(base64), (char) => char.charCodeAt(0));
|
|
1521
|
+
} catch {
|
|
1522
|
+
throw new ProfileCreationError(422, INVALID_AVATAR);
|
|
1523
|
+
}
|
|
1524
|
+
const mime = SIGNATURES.find((signature) => signature.test(bytes))?.mime;
|
|
1525
|
+
const dataUrlLength = `data:${mime};base64,`.length + Math.ceil(bytes.length / 3) * 4;
|
|
1526
|
+
if (!mime || dataUrlLength > 262144) throw new ProfileCreationError(422, INVALID_AVATAR);
|
|
1527
|
+
return bytes;
|
|
1528
|
+
}
|
|
1529
|
+
function profileMarkdown(displayName, hasAvatar) {
|
|
1530
|
+
return [
|
|
1531
|
+
"---",
|
|
1532
|
+
`name: ${JSON.stringify(displayName)}`,
|
|
1533
|
+
...hasAvatar ? [`icon: ${AVATAR_FILE}`] : [],
|
|
1534
|
+
`role: ${COORDINATOR_ROLE}`,
|
|
1535
|
+
"---",
|
|
1536
|
+
""
|
|
1537
|
+
].join("\n");
|
|
1538
|
+
}
|
|
1539
|
+
function soulMarkdown(soul, note) {
|
|
1540
|
+
return note ? `${soul}\n\n${NOTES_HEADING}\n\n${note}\n` : `${soul}\n`;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Creates `~/.po/agents/<alias>` from a preset and makes sure `~/.po/profiles.yaml` lists `agents`.
|
|
1544
|
+
* A coordinator this endpoint made earlier under that alias is rewritten with the new choices, so a person who
|
|
1545
|
+
* restarts onboarding can keep their agent's name; any other profile owning the alias still refuses.
|
|
1546
|
+
*
|
|
1547
|
+
* The profiles.yaml change is planned first, so an invalid file stops before anything is written, and committed
|
|
1548
|
+
* last against the text it was computed from: a concurrent edit removes the new persona again and refuses.
|
|
1549
|
+
*/
|
|
1550
|
+
async function createPersonaProfile(dependencies, request) {
|
|
1551
|
+
const { fs, homeDirectory, context } = dependencies;
|
|
1552
|
+
const displayName = request.displayName.trim();
|
|
1553
|
+
if (!displayName) throw new ProfileCreationError(422, "Display name is required");
|
|
1554
|
+
const preset = PERSONA_PRESETS.find(({ id }) => id === request.preset);
|
|
1555
|
+
if (!preset) throw new ProfileCreationError(422, "Unknown persona preset");
|
|
1556
|
+
const avatar = request.avatarPngBase64 === void 0 ? void 0 : avatarBytes(request.avatarPngBase64);
|
|
1557
|
+
let plan;
|
|
1558
|
+
let profiles;
|
|
1559
|
+
try {
|
|
1560
|
+
plan = await planGlobalProfileRootAsync(fs, homeDirectory, AGENTS_ROOT, context);
|
|
1561
|
+
profiles = await loadProfilesAsync(fs, homeDirectory, context, homeDirectory);
|
|
1562
|
+
} catch {
|
|
1563
|
+
throw new ProfileCreationError(500, "Profile configuration is unavailable");
|
|
1564
|
+
}
|
|
1565
|
+
const personaDirectory = path.join(path.dirname(plan.filePath), AGENTS_ROOT, request.alias);
|
|
1566
|
+
const existing = profiles.find(({ name }) => name === request.alias);
|
|
1567
|
+
const updated = existing?.identity?.role === COORDINATOR_ROLE && path.resolve(existing.personaRoot, existing.persona) === personaDirectory;
|
|
1568
|
+
if (!updated && (existing || await pathExists(fs, personaDirectory, context))) throw new ProfileCreationError(409, "Profile alias is taken");
|
|
1569
|
+
try {
|
|
1570
|
+
if (avatar) await writeFileAtomic(fs, path.join(personaDirectory, AVATAR_FILE), avatar, context);
|
|
1571
|
+
await writeFileAtomic(fs, path.join(personaDirectory, "SOUL.md"), soulMarkdown(preset.soul, request.note?.trim()), context);
|
|
1572
|
+
await writeFileAtomic(fs, path.join(personaDirectory, "profile.md"), profileMarkdown(displayName, avatar !== void 0), context);
|
|
1573
|
+
await commitGlobalProfileRootAsync(fs, plan, context);
|
|
1574
|
+
} catch (error) {
|
|
1575
|
+
if (!updated) await removePath(fs, personaDirectory, context);
|
|
1576
|
+
if (error instanceof ProfileCatalogChangedError) throw new ProfileCreationError(409, "Profile configuration changed. Try again.");
|
|
1577
|
+
throw error;
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
name: request.alias,
|
|
1581
|
+
updated
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
//#endregion
|
|
1585
|
+
//#region ../../foundations/po-profile/src/extensions/(backend)/api/profile/route.server.ts
|
|
1586
|
+
const PROFILES_PATH = "/profiles";
|
|
1587
|
+
/**
|
|
1588
|
+
* Creates a personal coordinator profile. Global mount only: workspaces and sessions already own `profile`.
|
|
1589
|
+
* Creations run one at a time, so two requests cannot both claim one alias.
|
|
1590
|
+
*/
|
|
1591
|
+
var route_server_default$2 = defineRoutedContribution(({ context, host }) => {
|
|
1592
|
+
if (host.scope !== "global") return void 0;
|
|
1593
|
+
let fs;
|
|
1594
|
+
context.inject([PO_FS_SERVICE], (scoped) => {
|
|
1595
|
+
const bound = requirePoFs(scoped);
|
|
1596
|
+
fs = bound;
|
|
1597
|
+
return () => {
|
|
1598
|
+
if (fs === bound) fs = void 0;
|
|
1599
|
+
};
|
|
1600
|
+
});
|
|
1601
|
+
return {
|
|
1602
|
+
basePath: "profile",
|
|
1603
|
+
start: (api) => {
|
|
1604
|
+
const creations = createSerialRunner();
|
|
1605
|
+
const create = async (request) => {
|
|
1606
|
+
let body;
|
|
1607
|
+
try {
|
|
1608
|
+
body = await request.json();
|
|
1609
|
+
} catch {
|
|
1610
|
+
return Response.json({ error: "Invalid profile" }, { status: 400 });
|
|
1611
|
+
}
|
|
1612
|
+
if (!Check(CreateProfileSchema, body)) return Response.json({ error: "Invalid profile" }, { status: 400 });
|
|
1613
|
+
const homeDirectory = api.homeDirectory ?? host.context.homeDirectory;
|
|
1614
|
+
if (!fs || !homeDirectory) return Response.json({ error: "Profile storage unavailable" }, { status: 503 });
|
|
1615
|
+
try {
|
|
1616
|
+
const { name, updated } = await createPersonaProfile({
|
|
1617
|
+
fs,
|
|
1618
|
+
homeDirectory,
|
|
1619
|
+
context: BACKGROUND_CONTEXT
|
|
1620
|
+
}, body);
|
|
1621
|
+
return Response.json({ name }, { status: updated ? 200 : 201 });
|
|
1622
|
+
} catch (error) {
|
|
1623
|
+
if (error instanceof ProfileCreationError) return Response.json({ error: error.message }, { status: error.status });
|
|
1624
|
+
throw error;
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
return {
|
|
1628
|
+
async fetch(request) {
|
|
1629
|
+
if (new URL(request.url).pathname !== PROFILES_PATH) return Response.json({ error: "Not found" }, { status: 404 });
|
|
1630
|
+
if (request.method !== "POST") return Response.json({ error: "Method not allowed" }, {
|
|
1631
|
+
status: 405,
|
|
1632
|
+
headers: { Allow: "POST" }
|
|
1633
|
+
});
|
|
1634
|
+
return creations(() => create(request));
|
|
1635
|
+
},
|
|
1636
|
+
close() {}
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
}, { cardinality: "optional" });
|
|
1641
|
+
//#endregion
|
|
1197
1642
|
//#region ../../foundations/po-profile/src/services/launchProfiles/type.ts
|
|
1198
1643
|
/** The source id every profile read from a `profiles.yaml` carries. */
|
|
1199
1644
|
const FILE_PROFILE_SOURCE_ID = "files";
|
|
@@ -1274,80 +1719,6 @@ var route_server_default$1 = defineRoute(({ context, signal }) => ({
|
|
|
1274
1719
|
})
|
|
1275
1720
|
}));
|
|
1276
1721
|
//#endregion
|
|
1277
|
-
//#region ../../foundations/po-profile/src/schemas/apiContracts.ts
|
|
1278
|
-
const ProfileSelectionSchema = _Object_({ profile: Union([Null(), String$1({ minLength: 1 })]) }, { additionalProperties: false });
|
|
1279
|
-
const CurrentProfileSchema = _Object_({ profile: Union([Null(), String$1()]) });
|
|
1280
|
-
const ProfileCatalogSchema = _Object_({
|
|
1281
|
-
profiles: _Array_(_Object_({
|
|
1282
|
-
name: String$1(),
|
|
1283
|
-
identity: Optional(_Object_({
|
|
1284
|
-
name: Optional(String$1()),
|
|
1285
|
-
icon: Optional(String$1()),
|
|
1286
|
-
role: Optional(String$1()),
|
|
1287
|
-
contact: Optional(String$1())
|
|
1288
|
-
})),
|
|
1289
|
-
sourceId: String$1()
|
|
1290
|
-
})),
|
|
1291
|
-
readiness: Union([Literal("ready"), Literal("unavailable")])
|
|
1292
|
-
});
|
|
1293
|
-
defineApiContract({
|
|
1294
|
-
version: 1,
|
|
1295
|
-
http: [
|
|
1296
|
-
{
|
|
1297
|
-
id: "profile.current",
|
|
1298
|
-
scope: "session",
|
|
1299
|
-
basePath: "profile",
|
|
1300
|
-
path: "/current",
|
|
1301
|
-
method: "GET",
|
|
1302
|
-
authentication: "owner",
|
|
1303
|
-
description: "Read the current session selection.",
|
|
1304
|
-
responses: jsonApiResponses(CurrentProfileSchema)
|
|
1305
|
-
},
|
|
1306
|
-
{
|
|
1307
|
-
id: "profile.launchProfiles",
|
|
1308
|
-
scope: "workspace",
|
|
1309
|
-
basePath: "profile",
|
|
1310
|
-
path: "/launch-profiles",
|
|
1311
|
-
method: "GET",
|
|
1312
|
-
authentication: "owner",
|
|
1313
|
-
description: "List the profiles a new session in this workspace can start with, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
1314
|
-
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
1315
|
-
},
|
|
1316
|
-
{
|
|
1317
|
-
id: "profile.profiles",
|
|
1318
|
-
scope: "session",
|
|
1319
|
-
basePath: "profile",
|
|
1320
|
-
path: "/profiles",
|
|
1321
|
-
method: "GET",
|
|
1322
|
-
authentication: "owner",
|
|
1323
|
-
description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
|
|
1324
|
-
responses: jsonApiResponses(ProfileCatalogSchema)
|
|
1325
|
-
},
|
|
1326
|
-
{
|
|
1327
|
-
id: "profile.select",
|
|
1328
|
-
scope: "session",
|
|
1329
|
-
basePath: "profile",
|
|
1330
|
-
path: "/current",
|
|
1331
|
-
method: "PUT",
|
|
1332
|
-
authentication: "owner",
|
|
1333
|
-
description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
|
|
1334
|
-
body: {
|
|
1335
|
-
required: true,
|
|
1336
|
-
contentType: "application/json",
|
|
1337
|
-
schema: ProfileSelectionSchema
|
|
1338
|
-
},
|
|
1339
|
-
responses: {
|
|
1340
|
-
...jsonApiResponses(CurrentProfileSchema),
|
|
1341
|
-
"400": { description: "Invalid profile selection." },
|
|
1342
|
-
"404": { description: "Unknown profile." },
|
|
1343
|
-
"503": { description: "Sources or integration unavailable; never automatically replay this write." }
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
],
|
|
1347
|
-
sockets: [],
|
|
1348
|
-
dynamic: []
|
|
1349
|
-
});
|
|
1350
|
-
//#endregion
|
|
1351
1722
|
//#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/_lib/profileApi.ts
|
|
1352
1723
|
/** Session roots may differ from the workspace launcher's root. Only display data leaves the host. */
|
|
1353
1724
|
async function listSessionProfiles(input) {
|
|
@@ -1387,7 +1758,7 @@ async function selectSessionProfile(input, request) {
|
|
|
1387
1758
|
}
|
|
1388
1759
|
}
|
|
1389
1760
|
signal.throwIfAborted();
|
|
1390
|
-
if (profile !== agent.context.selection.profile || !agent.inspectCapabilities().ready) try {
|
|
1761
|
+
if (profile === void 0 || profile !== agent.context.selection.profile || !agent.inspectCapabilities().ready) try {
|
|
1391
1762
|
await agent.changeSelection({
|
|
1392
1763
|
axis: "profile",
|
|
1393
1764
|
profile
|
|
@@ -1600,6 +1971,17 @@ function createProfileMemoryExtraction(options) {
|
|
|
1600
1971
|
//#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/hook/agentSettled.server.ts
|
|
1601
1972
|
var agentSettled_server_default = defineHook(({ root, context }) => {
|
|
1602
1973
|
let extraction;
|
|
1974
|
+
let config;
|
|
1975
|
+
context.inject([PO_CONFIG_SERVICE], (scoped) => {
|
|
1976
|
+
const binding = scoped.get(PO_CONFIG_SERVICE);
|
|
1977
|
+
config = binding;
|
|
1978
|
+
return () => {
|
|
1979
|
+
if (config !== binding) return;
|
|
1980
|
+
config = void 0;
|
|
1981
|
+
extraction?.dispose();
|
|
1982
|
+
extraction = void 0;
|
|
1983
|
+
};
|
|
1984
|
+
});
|
|
1603
1985
|
return {
|
|
1604
1986
|
event: "agent_settled",
|
|
1605
1987
|
handle(_event, execution) {
|
|
@@ -1607,7 +1989,7 @@ var agentSettled_server_default = defineHook(({ root, context }) => {
|
|
|
1607
1989
|
extraction ??= createProfileMemoryExtraction({
|
|
1608
1990
|
store: requireProfileMemoryStore(context),
|
|
1609
1991
|
runtime: root,
|
|
1610
|
-
automatic: () =>
|
|
1992
|
+
automatic: () => config?.getSnapshot().settings.profileMemory?.automatic === true,
|
|
1611
1993
|
onError: (error, failed) => failed.client.setStatus(EXTRACTION_STATUS_SOURCE, `Memory extraction failed: ${error instanceof Error ? error.message : String(error)}`)
|
|
1612
1994
|
});
|
|
1613
1995
|
extraction.settle(execution);
|
|
@@ -1683,8 +2065,15 @@ const serverPlugin = defineServerPlugin({
|
|
|
1683
2065
|
}),
|
|
1684
2066
|
global: async (context) => {
|
|
1685
2067
|
const scopeGlobal = await context.scopeRoot("global", root_server_default$1, context);
|
|
2068
|
+
const contextGlobal = {
|
|
2069
|
+
...context,
|
|
2070
|
+
root: scopeGlobal.value
|
|
2071
|
+
};
|
|
1686
2072
|
return {
|
|
1687
2073
|
...composeRootHooks(scopeGlobal),
|
|
2074
|
+
get api() {
|
|
2075
|
+
return defined([at(route_server_default$2, contextGlobal)]);
|
|
2076
|
+
},
|
|
1688
2077
|
services: [...scopeGlobal.services ?? []]
|
|
1689
2078
|
};
|
|
1690
2079
|
},
|