@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.
Files changed (283) hide show
  1. package/README.md +4 -3
  2. package/dist/abort-signals-2GUraIGq.js +34 -0
  3. package/dist/agent-DZ-OKOHn.js +6850 -0
  4. package/dist/anthropic-messages-5ODquUB-.js +14317 -0
  5. package/dist/{apiContracts-CHOiCbS_.js → apiContracts-b33nSAAI.js} +18 -81
  6. package/dist/{approval-BMXqnTYd.js → approval-r3NnI1VC.js} +19 -3
  7. package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DWoXxu3S.js} +2 -2
  8. package/dist/artifactFiles-DLCReI0-.js +1 -0
  9. package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-XeNS0L9M.js} +2 -2
  10. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-B6ZW0nkR.js} +2 -2
  11. package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-bVR64sHO.js} +1 -1
  12. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-D7tZz3io.js} +2 -2
  13. package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DdwScfiX.js} +2 -2
  14. package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-DgSxZJCV.js} +2 -2
  15. package/dist/assets/assets/channel-TPcVvp_3.js +2 -0
  16. package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-D5TXC2SM.js} +2 -2
  17. package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T-BWhOSvo1.js} +2 -2
  18. package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-HkkBzLtZ.js} +2 -2
  19. package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-CBnjycLU.js} +2 -2
  20. package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-75lIIq8T.js} +2 -2
  21. package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-D8PpnXMk.js} +2 -2
  22. package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-CXRS2NIN.js} +2 -2
  23. package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-BocUqS94.js} +2 -2
  24. package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-CHf_ogYT.js} +2 -2
  25. package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-DrW1PaIv.js} +2 -2
  26. package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-CLoA7bFm.js} +2 -2
  27. package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-BmBsrj9I.js} +2 -2
  28. package/dist/assets/assets/chunk-XXDRQBXY-iFE4Tl8c.js +2 -0
  29. package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-DShE_cgv.js} +2 -2
  30. package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-B3oLvSXy.js} +2 -2
  31. package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-B14vKK7C.js} +2 -2
  32. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-Da8elIW2.js} +2 -2
  33. package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-Du4tGtiJ.js} +2 -2
  34. package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-Cyj6i_WI.js} +1 -1
  35. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DFWXwO7A.js} +2 -2
  36. package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-C1wB_cf-.js} +2 -2
  37. package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-MYCOBYl6.js} +2 -2
  38. package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-BFYbKUFf.js} +2 -2
  39. package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-6siqTpv_.js} +2 -2
  40. package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-CaBr9CoB.js} +2 -2
  41. package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-DAvmuDpc.js} +2 -2
  42. package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-CJnhgCpo.js} +2 -2
  43. package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-BQ4W1R18.js} +2 -2
  44. package/dist/assets/assets/{dist-DvgCCshF.js → dist-BnzFckPF.js} +2 -2
  45. package/dist/assets/assets/{dist-gfbb4ygy.js → dist-CFtBpcYL.js} +2 -2
  46. package/dist/assets/assets/{dist-BabjcJ3j.js → dist-CIQX1z4W.js} +2 -2
  47. package/dist/assets/assets/{dist-XIZum9n5.js → dist-ChHYoe9_.js} +2 -2
  48. package/dist/assets/assets/{dist-1-mhYUBH.js → dist-DKxZO8d9.js} +2 -2
  49. package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DL6z28wl.js} +2 -2
  50. package/dist/assets/assets/{dist-B3JXhDWV.js → dist-DNyn1p9Z.js} +2 -2
  51. package/dist/assets/assets/{dist-Izr2SB3q.js → dist-qYlLXIa8.js} +2 -2
  52. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-AUcqDTM3.js} +2 -2
  53. package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-aA10PEHJ.js} +2 -2
  54. package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-hhYiqA-x.js} +2 -2
  55. package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-BQZqbRo5.js} +1 -1
  56. package/dist/assets/assets/flowDiagram-IUGLLWBU-BuyysPYC.js +1 -0
  57. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-CLON1GpW.js} +2 -2
  58. package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-DbmvNwR2.js} +1 -1
  59. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DJVO0WlL.js} +2 -2
  60. package/dist/assets/assets/index-BiTVAj5E.js +155 -0
  61. package/dist/assets/assets/index-CBNQEGK3.css +1 -0
  62. package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-CAt3Nt3g.js} +1 -1
  63. package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-DTuqH-Zb.js} +2 -2
  64. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-BnWvdonT.js} +2 -2
  65. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-Btxtcgvl.js} +2 -2
  66. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-q7ek9o_H.js} +2 -2
  67. package/dist/assets/assets/{line-BsXJZn93.js → line-B7yLilmC.js} +2 -2
  68. package/dist/assets/assets/{linear-BHYaD5T0.js → linear-y8aSKEli.js} +2 -2
  69. package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-B4rH50nD.js} +4 -4
  70. package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-DnRVHTjE.js} +5 -5
  71. package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-DT9Afs2v.js} +2 -2
  72. package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CnqNbu4p.js} +1 -1
  73. package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-cvxdBBFq.js} +2 -2
  74. package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-etXMNsaL.js} +1 -1
  75. package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-CBN-R3_j.js} +2 -2
  76. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-C5jjVPIH.js} +2 -2
  77. package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-CAMd_mrV.js} +1 -1
  78. package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-DIs3auoe.js} +1 -1
  79. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CJXr1qWy.js} +1 -1
  80. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-DfwtykqI.js} +1 -1
  81. package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-B8beAhTs.js} +1 -1
  82. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-BDcQE-EL.js} +2 -2
  83. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-KJ4-QjZM.js} +2 -2
  84. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-VjIB-Ybr.js} +2 -2
  85. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-MfMuWq1M.js} +2 -2
  86. package/dist/assets/assets/{src-gihY33R9.js → src-BAxIj8GJ.js} +2 -2
  87. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-mHwLRRCY.js} +2 -2
  88. package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-PArlYoqV.js} +2 -2
  89. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-The09-5S.js +9 -0
  90. package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-B2nKiNFU.js} +2 -2
  91. package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-gU23_RuI.js} +1 -1
  92. package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-CiqoMvZa.js} +1 -1
  93. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-DpeoWpMK.js} +2 -2
  94. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-C31iGKvM.js} +2 -2
  95. package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-CIzHhzNw.js} +1 -1
  96. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-DIIkoezc.js} +2 -2
  97. package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-RFseiMZW.js} +2 -2
  98. package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-QiHL91kC.js} +2 -2
  99. package/dist/assets/bundle-asset-policy.json +1 -1
  100. package/dist/assets/index.html +2 -2
  101. package/dist/assets/plugins/assets/base-CKKRZ7-h.css +2 -0
  102. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  103. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  104. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  105. package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  106. package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  107. package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  108. package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  109. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  110. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  111. package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  112. package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  113. package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  114. package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  115. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  116. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  117. package/dist/assets/plugins/chunks/po-web-runtime-BJDT6Lbw.js +1 -0
  118. package/dist/assets/plugins/compositions.json +1 -0
  119. package/dist/assets/plugins/slots/approval.293d9a00-BXIhaPlQ.js +2 -0
  120. package/dist/assets/plugins/slots/artifacts.24567664-ZzR0gbvy.js +1 -0
  121. package/dist/assets/plugins/slots/author.0998a880-DAbA-7rb.js +93 -0
  122. package/dist/assets/plugins/slots/autocompact.dd97d013-IVq4Z6qm.js +1 -0
  123. package/dist/assets/plugins/slots/builtin-tools.36d7400b-CpCLjRRN.js +7 -0
  124. package/dist/assets/plugins/slots/codemode.8eaee717-VWt9PqsU.js +10 -0
  125. package/dist/assets/plugins/slots/domain.5e95fc37-5PIUBqDe.js +1 -0
  126. package/dist/assets/plugins/slots/edit.385c9aa9-DNAjPNG5.js +7 -0
  127. package/dist/assets/plugins/slots/files.daf34ed8-CQaTz0i1.js +2 -0
  128. package/dist/assets/plugins/slots/goal.77ec9930-B8EkarBq.js +1 -0
  129. package/dist/assets/plugins/slots/grep.02052cdc-CIRhO2gY.js +1 -0
  130. package/dist/assets/plugins/slots/help.ecd4c0f9-naMF9NN1.js +3 -0
  131. package/dist/assets/plugins/slots/log.a86eb6d0-D5__rAZJ.js +4 -0
  132. package/dist/assets/plugins/slots/mcp.974af249-DPNHn9XH.js +109 -0
  133. package/dist/assets/plugins/slots/plan.bafb8f68-C5GEpybF.js +3 -0
  134. package/dist/assets/plugins/slots/profile.48851a1d-yX6tzV3x.js +1 -0
  135. package/dist/assets/plugins/slots/prompts.723d7748-B7zpPeoF.js +3 -0
  136. package/dist/assets/plugins/slots/read.46bf6536-Cw5Z5z5T.js +1 -0
  137. package/dist/assets/plugins/slots/runner.53e9bd76-CiQR_FPX.js +8 -0
  138. package/dist/assets/plugins/slots/skill.086701a4-CL6h_F-x.js +4 -0
  139. package/dist/assets/plugins/slots/vault.ac9935c8-DKERQYg4.js +1 -0
  140. package/dist/assets/plugins/slots/voice.e85ca7f9-DEgb-U9m.js +1 -0
  141. package/dist/assets/pwa/pwa.js +12 -12
  142. package/dist/assets/pwa/sw.js +4 -4
  143. package/dist/{atomicJson-BJfPFSYF.js → atomicJson-C_7F2zD1.js} +2 -3
  144. package/dist/azure-openai-config-COZUaRzM.js +55 -0
  145. package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
  146. package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-B1mPDYlf.js} +1 -1
  147. package/dist/browser-BWf8OMfl.js +3 -0
  148. package/dist/childSession-Cf2-kH4O.js +22 -0
  149. package/dist/classifier-shared-IhSH9hhh.js +106 -0
  150. package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
  151. package/dist/{codemode-DbPu0yJN.js → codemode-DQFmrosw.js} +5 -2
  152. package/dist/contracts-DD3f1Lpn.js +19 -0
  153. package/dist/diagnostics-1lYFeSJe.js +131 -0
  154. package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
  155. package/dist/dist-Dvx5mlIR.js +50 -0
  156. package/dist/env-api-keys-Bow6MJe2.js +32 -0
  157. package/dist/error-body-CJk7jMUh.js +102 -0
  158. package/dist/esm-BKJy3O9-.js +1553 -0
  159. package/dist/exports-B0WMEXCP.js +34 -0
  160. package/dist/{remoteMcp-CMqZldeA.js → exports-D09VsUk-.js} +1153 -175
  161. package/dist/{exports-BNZz2DNU.js → exports-nV43ShA7.js} +25 -9
  162. package/dist/{extensionFile-CXOa5G4C.js → extensionFile-DNM4xsje.js} +26 -2
  163. package/dist/github-copilot-headers-D1RedfLn.js +22 -0
  164. package/dist/google-generative-ai-DXTILNT0.js +328 -0
  165. package/dist/google-shared-e4JDCTVP.js +19588 -0
  166. package/dist/google-vertex-a1lzvJfq.js +374 -0
  167. package/dist/{domains-BNjGTOPj.js → harnessState-Dwrk3lfv.js} +175 -16
  168. package/dist/{harnessStore-BT706Ly6.js → harnessStore-Z7yDLO45.js} +4 -5
  169. package/dist/hash-Dt6RIbkn.js +16 -0
  170. package/dist/headers-CwtEVQvr.js +17 -0
  171. package/dist/help-w6vVEZGL.js +101 -0
  172. package/dist/hubChannel-Cm-sxOvU.js +21 -0
  173. package/dist/hubRevisions-58pU2dW5.js +363 -0
  174. package/dist/identity-BgfHobJH.js +165 -0
  175. package/dist/index.edge-COJJ_Dv2.js +937 -0
  176. package/dist/index.edge-ChYa2LU4.js +14 -0
  177. package/dist/index.edge-ClLTmPFz.js +191 -0
  178. package/dist/index.edge-DyYmurS7.js +62 -0
  179. package/dist/index.edge-K0w5auwG.js +56 -0
  180. package/dist/index.edge-Xa5LLtxz.js +67 -0
  181. package/dist/iso-BPQViXM8.js +10 -0
  182. package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-CUkYUs1f.js} +193 -15
  183. package/dist/{majorModes-DbCfLZH3.js → majorModes-BB0PXgFn.js} +4 -14
  184. package/dist/majorModes-C7vtBs4D.js +1 -0
  185. package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-BtKzB6oK.js} +2 -2
  186. package/dist/migrations-5gbLIQIc.js +32 -0
  187. package/dist/mistral-conversations-CLwhVDjA.js +689 -0
  188. package/dist/modeDefinition-C3Zbrw48.js +44 -0
  189. package/dist/models-Chzm15vC.js +1511 -0
  190. package/dist/narration-CpRurWLO.js +127 -0
  191. package/dist/node-BT4GsJQp.js +2479 -0
  192. package/dist/node-DytJOfYf.js +23 -0
  193. package/dist/notification-kckG3leF.js +102 -0
  194. package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
  195. package/dist/openai-completions-CcNhAv8l.js +984 -0
  196. package/dist/openai-decisions-BsFjaAGw.js +142 -0
  197. package/dist/openai-kPrtlgjl.js +17357 -0
  198. package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
  199. package/dist/openai-responses-C5Gp2UOV.js +281 -0
  200. package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
  201. package/dist/openrouter-cost-CvC52g3b.js +30 -0
  202. package/dist/openrouter-images-BoHl8g8p.js +124 -0
  203. package/dist/{hubChannel-BHQyzcOo.js → packageApi-t1oCjNDU.js} +4 -41
  204. package/dist/photon_rs_bg.wasm +0 -0
  205. package/dist/pi-messages-BXfrZLC7.js +312 -0
  206. package/dist/piConfig-DQzlbPY4.js +126 -0
  207. package/dist/piSettings-Cf1QofNe.js +1 -0
  208. package/dist/platform-BIEiM4TG.js +113 -0
  209. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  210. package/dist/pluginProtocol-BqXXyI4z.js +80 -0
  211. package/dist/{protocol-Xpm_mCNN.js → protocol-DDL8geoS.js} +2 -2
  212. package/dist/provider-env-CxhHUFiF.js +38 -0
  213. package/dist/provider-retry-BUoezuw8.js +79 -0
  214. package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
  215. package/dist/sealedChannel-BeWNTWys.js +27 -0
  216. package/dist/server-AbXyhXlY.js +217 -0
  217. package/dist/server-B6dqQoh2.js +1518 -0
  218. package/dist/server-BIHo9TFu.js +505 -0
  219. package/dist/{server-BZh1ZXz_.js → server-BJ7DNzCp.js} +8 -19
  220. package/dist/server-BO-j_GbD.js +15106 -0
  221. package/dist/{server-D4W7EdJY.js → server-BQzAiMns.js} +16 -16
  222. package/dist/server-BR7SZtj7.js +3125 -0
  223. package/dist/{server-BE6VqEiA.js → server-BT2ORK83.js} +20 -12
  224. package/dist/server-BbSHYRnY.js +295 -0
  225. package/dist/server-BqoKlEGk.js +1806 -0
  226. package/dist/{server-tvgQ99rv.js → server-Busl0pQI.js} +370 -120
  227. package/dist/server-CIHM4jqu.js +1116 -0
  228. package/dist/server-CgWSSdvd.js +576 -0
  229. package/dist/{server-Dpgh8PDh.js → server-Co_UWKrR.js} +14 -5
  230. package/dist/{server-BAAL9-NA.js → server-CuEPb7u-.js} +3 -10
  231. package/dist/{server-Dt4y1rZD.js → server-D40q2Jpx.js} +47 -27
  232. package/dist/server-DCyf2Asb.js +679 -0
  233. package/dist/server-DH7PfLln.js +148 -0
  234. package/dist/server-DJ8bc89M.js +934 -0
  235. package/dist/server-DYdp0W9v.js +489 -0
  236. package/dist/server-DsdPEYGu.js +639 -0
  237. package/dist/server-DymH4Ucq.js +189 -0
  238. package/dist/server-IqECnUrb.js +834 -0
  239. package/dist/{server-36iuA3MI.js → server-KBgW77zh.js} +3 -3
  240. package/dist/server-RW_9R3R3.js +1522 -0
  241. package/dist/server-aUit8j6r.js +1028 -0
  242. package/dist/{server-DJAanjoI.js → server-gifRriZK.js} +491 -103
  243. package/dist/server-nkUlqnAL.js +2658 -0
  244. package/dist/server-oxyEbv1a.js +1256 -0
  245. package/dist/{server-D8ndq0wL.js → server-ub3s16Mc.js} +11 -9
  246. package/dist/{build-2gFaVEfG.js → serverPlugin-CELT6P0Q.js} +3946 -3
  247. package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-RQGvfm6E.js} +550 -760
  248. package/dist/simple-options-CFzI5Pd_.js +156 -0
  249. package/dist/streaming-json-BWTHTwz-.js +858 -0
  250. package/dist/system-one-shared-CiIrx29d.js +132 -0
  251. package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
  252. package/dist/transform-messages-D77af7Bx.js +356 -0
  253. package/dist/truncate-M3KbFyVj.js +89 -0
  254. package/dist/{server-A-_GFpPr.js → type-ASYnCGVW.js} +10 -1031
  255. package/dist/typesafe-system-one-DGxeggJh.js +37 -0
  256. package/dist/uuid-B0QJx6Kr.js +31 -0
  257. package/dist/{validation-D77NZBrx.js → validation-BJxVSAwx.js} +8 -3
  258. package/dist/{value-Djvc2foV.js → value-_W31So3B.js} +1 -1
  259. package/dist/vaultSettings-Di3n5YIg.js +328 -0
  260. package/dist/voiceTools-RMn4HvWo.js +246 -0
  261. package/dist/web-DCP7ELJj.js +3 -0
  262. package/dist/worker.js +95288 -49863
  263. package/dist/workflow-B7qx0Vv9.js +79 -0
  264. package/package.json +37 -22
  265. package/wrangler.jsonc +4 -2
  266. package/dist/assets/assets/channel-CMrEzemr.js +0 -2
  267. package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
  268. package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
  269. package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
  270. package/dist/assets/assets/index-DZM68mTk.css +0 -1
  271. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
  272. package/dist/contextProjection-DVP2Vc5j.js +0 -188
  273. package/dist/harnessState-gmzJcPGt.js +0 -88
  274. package/dist/harnessStore-BiH9vSuD.js +0 -1
  275. package/dist/index.edge-BgSx_gRO.js +0 -45
  276. package/dist/majorModes-BvWNqoHt.js +0 -1
  277. package/dist/piSettings-B6fsgIBA.js +0 -1
  278. package/dist/platform-B4AAgwJ0.js +0 -16
  279. package/dist/platformFiles-C_bXo4Ig.js +0 -39
  280. package/dist/server-BZaPPoQp.js +0 -592
  281. package/dist/server-D75MWDhB.js +0 -118
  282. package/dist/server-r358hzQg.js +0 -280
  283. package/dist/serverPlugin-BOI6c6s5.js +0 -3393
@@ -1,16 +1,27 @@
1
- import { B as requirePoFs, F as PO_SQLITE_SERVICE, G as PoHeadlessPromptAdmissionError, N as PO_FS_SERVICE, V as requirePoSqlite, X as isPoHeadlessPromptAdmissionError, _t as defineServiceContract, c as nodeHost, f as getOrThrow, gt as PO_SERVER_SCOPE_SERVICE, o as poHomeDirectory, ot as BACKGROUND_CONTEXT, q as PoSessionSetupError, rt as composeServerProviderOverrides, vt as requirePoServerScope } from "./serverPlugin-BOI6c6s5.js";
2
- import { C as Null, G as _Object_, Q as _Array_, _ as Union, k as Literal, q as Optional, y as String$1 } from "./build-2gFaVEfG.js";
3
- import { n as Check } from "./value-Djvc2foV.js";
4
- import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-CHOiCbS_.js";
5
- import { c as defineRoute, f as defineServerPlugin, i as defineHook, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, p as runCleanups, s as defineRoot, t as composeRootHooks } from "./extensionFile-CXOa5G4C.js";
6
- import { n as readPackageResource, t as packageResourcePath } from "./index.edge-BgSx_gRO.js";
7
- import { o as PO_PROFILE_IDENTITY_ENTRY_TYPE } from "./contextProjection-DVP2Vc5j.js";
8
- import "./platform-B4AAgwJ0.js";
9
- import "./piSettings-B6fsgIBA.js";
10
- import { a as loadProfilesAsync, c as inlineProfile, l as parseProfileBinding, o as buildPersonaPrompt, r as PO_CONFIG_SERVICE, s as loadProfiles } from "./sessionConfig-rBQgzXlT.js";
11
- import "./exports-BNZz2DNU.js";
12
- import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-DbPu0yJN.js";
1
+ import { G as Null, Hn as BACKGROUND_CONTEXT, Jn as PO_FS_SERVICE, S as PO_CONFIG_SERVICE, Sn as getOrThrow, V as String$1, Xn as PO_SQLITE_SERVICE, Z as Literal, a as PoHeadlessPromptAdmissionError, ar as defineServiceContract, bt as _Array_, gn as createSerialRunner, hn as poHomeDirectory, ht as Optional, ir as PO_SERVER_SCOPE_SERVICE, nr as requirePoSqlite, pt as _Object_, s as PoSessionSetupError, sr as requirePoServerScope, tr as requirePoFs, u as isPoHeadlessPromptAdmissionError, v as composeServerProviderOverrides, vn as nodeHost, z as Union } from "./serverPlugin-CELT6P0Q.js";
2
+ import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-b33nSAAI.js";
3
+ import { a as pathExists, l as removePath, u as writeFileAtomic } from "./platform-BIEiM4TG.js";
4
+ import "./piSettings-Cf1QofNe.js";
5
+ 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-RQGvfm6E.js";
6
+ import { n as Check } from "./value-_W31So3B.js";
7
+ import "./exports-nV43ShA7.js";
8
+ import { a as defineHook, c as defineRoot, g as runCleanups, h as defineServerPlugin, l as defineRoute, n as composeRootInjects, s as defineResource, t as composeRootHooks, u as defineRoutedContribution } from "./extensionFile-DNM4xsje.js";
9
+ import { n as readPackageResource, t as packageResourcePath } from "./index.edge-DyYmurS7.js";
10
+ import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-DQFmrosw.js";
13
11
  import path from "node:path";
12
+ //#region ../../foundations/po-config/src/services/profiles/sync.edge.ts
13
+ function nodeOnly(name, asyncName) {
14
+ throw new Error(`${name} is Node-only; use ${asyncName} with a PoPlatform on the edge.`);
15
+ }
16
+ /** @deprecated Node-only sync shim; use loadProfilesAsync. Removed in M2. */
17
+ function loadProfiles(_repoRoot, _homeDirectory) {
18
+ return nodeOnly("loadProfiles", "loadProfilesAsync");
19
+ }
20
+ /** @deprecated Node-only sync shim; use buildPersonaPromptAsync. Removed in M2. */
21
+ function buildPersonaPrompt(_personaRoot, _personaDirectory) {
22
+ return nodeOnly("buildPersonaPrompt", "buildPersonaPromptAsync");
23
+ }
24
+ //#endregion
14
25
  //#region ../../foundations/po-profile/src/constants/profileMemory.ts
15
26
  const PROFILE_MEMORY_STORE_SERVICE = "po/profile-memory-store";
16
27
  const PROFILE_MEMORY_NAMESPACE_SOURCE = "@agimon-ai/po-profile/memory";
@@ -428,8 +439,12 @@ var root_server_default$1 = defineRoot(({ host }) => {
428
439
  services: [async (context) => {
429
440
  await context.inject([PO_SERVER_SCOPE_SERVICE], async (scoped) => {
430
441
  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);
442
+ const releaseSecrets = await scope.provide(defineServiceContract(PROFILE_SECRETS_SERVICE, { scope: host.scope }), secrets);
443
+ const releaseSources = await scope.provide(defineServiceContract(PROFILE_SOURCES_SERVICE, { scope: host.scope }), sources);
444
+ return async () => {
445
+ await releaseSources();
446
+ await releaseSecrets();
447
+ };
433
448
  });
434
449
  }, async (context) => {
435
450
  await context.inject([
@@ -744,6 +759,9 @@ const PROFILE_RUNTIME_SERVICE = "po/profile-runtime";
744
759
  //#region ../../foundations/po-profile/src/services/profileRuntime/index.ts
745
760
  const UNAVAILABLE = "Profile integration provider is unavailable";
746
761
  const INVALIDATED = "Profile operation was invalidated";
762
+ /** Vault namespace for secrets saved from the composer; po-vault's `VAULT_SECRETS_NAMESPACE` writes it. */
763
+ const VAULT_SECRETS_NAMESPACE = "secrets";
764
+ const ALIAS_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/u;
747
765
  /** A single selected profile and provider, owned by one session, not a provider registry. */
748
766
  var SessionProfileRuntime = class {
749
767
  options;
@@ -764,10 +782,14 @@ var SessionProfileRuntime = class {
764
782
  capture(profileName, generation) {
765
783
  const binding = profileName === void 0 ? void 0 : this.options.readBinding(profileName);
766
784
  const env = profileName === void 0 ? void 0 : this.options.readEnv?.(profileName);
785
+ const sourceSecrets = profileName === void 0 ? void 0 : this.options.readSecrets?.(profileName);
786
+ const secrets = sourceSecrets === void 0 ? void 0 : parseProfileVaultSecrets(sourceSecrets);
787
+ if (secrets && Object.keys(secrets).some((name) => binding?.secrets && Object.hasOwn(binding.secrets, name))) throw new Error("Profile secret aliases must be unique");
767
788
  return Object.freeze({
768
789
  ...profileName === void 0 ? {} : { profileName },
769
790
  ...binding === void 0 ? {} : { integration: parseProfileBinding(binding) },
770
791
  ...env === void 0 ? {} : { env: Object.freeze({ ...env }) },
792
+ ...secrets === void 0 ? {} : { secrets },
771
793
  generation,
772
794
  signal: this.controller.signal
773
795
  });
@@ -883,6 +905,11 @@ var SessionProfileRuntime = class {
883
905
  if (!reference.allowedOrigins.includes(request.origin)) throw new Error("Profile secret origin is not allowed");
884
906
  });
885
907
  }
908
+ resolveInputSecret(name, request) {
909
+ return this.resolveReference(name, request.signal, (reference) => {
910
+ 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");
911
+ });
912
+ }
886
913
  resolveProxySecret(signal) {
887
914
  const name = this.snapshot.integration?.browser?.proxySecret;
888
915
  if (name === void 0) return Promise.reject(/* @__PURE__ */ new Error("Profile proxy is not configured"));
@@ -890,26 +917,80 @@ var SessionProfileRuntime = class {
890
917
  if (!reference.purposes.includes("proxy")) throw new Error("Profile secret alias is unavailable");
891
918
  });
892
919
  }
920
+ /** Refresh only value-free aliases, never the selected provider or browser identity. */
921
+ currentBinding(snapshot) {
922
+ if (!snapshot.integration || snapshot.profileName === void 0) return void 0;
923
+ let current;
924
+ try {
925
+ current = parseProfileBinding(this.options.readBinding(snapshot.profileName));
926
+ } catch {
927
+ throw new Error(INVALIDATED);
928
+ }
929
+ const selected = snapshot.integration;
930
+ if (current.provider !== selected.provider || current.organizationId !== selected.organizationId || current.mailboxId !== selected.mailboxId || current.credentialRef !== selected.credentialRef) throw new Error(INVALIDATED);
931
+ return current;
932
+ }
893
933
  async resolveReference(name, requestSignal, authorize) {
894
934
  if (this.initializing) throw new Error("Profile secrets are unavailable during provider initialization");
895
935
  await this.ready();
896
936
  const snapshot = this.snapshot;
897
937
  const connection = this.connection;
898
- const reference = snapshot.integration?.secrets[name];
899
- if (!connection || !reference || !Object.hasOwn(snapshot.integration.secrets, name)) throw new Error("Profile secret alias is unavailable");
900
- authorize(reference);
938
+ const current = this.currentBinding(snapshot);
939
+ const vaultReference = snapshot.secrets && Object.hasOwn(snapshot.secrets, name) ? snapshot.secrets[name] : void 0;
940
+ const providerReference = current?.secrets && Object.hasOwn(current.secrets, name) ? current.secrets[name] : void 0;
941
+ if (vaultReference && providerReference) throw new Error("Profile secret aliases must be unique");
901
942
  const signal = requestSignal ? AbortSignal.any([snapshot.signal, requestSignal]) : snapshot.signal;
943
+ const saved = vaultReference || providerReference ? void 0 : await this.savedSecret(name, signal);
944
+ const reference = vaultReference ?? providerReference ?? saved?.reference;
945
+ if (!reference) throw new Error("Profile secret alias is unavailable");
946
+ authorize(reference);
902
947
  if (signal.aborted) throw new Error(INVALIDATED);
903
948
  let value;
904
949
  try {
905
- value = await connection.resolveSecret(reference, signal);
950
+ if (saved) value = saved.value;
951
+ else if (vaultReference) {
952
+ if (!this.options.readVault) throw new Error("Vault unavailable");
953
+ const { namespace, key, field } = vaultReference.vault;
954
+ const entry = await this.options.readVault(namespace, key, signal);
955
+ const selected = field === void 0 ? entry : typeof entry === "object" && entry !== null && !Array.isArray(entry) && Object.hasOwn(entry, field) ? entry[field] : void 0;
956
+ if (typeof selected !== "string") throw new Error("Vault field unavailable");
957
+ value = selected;
958
+ } else {
959
+ if (!connection || !providerReference) throw new Error("Provider unavailable");
960
+ value = await connection.resolveSecret(providerReference, signal);
961
+ }
906
962
  } catch {
907
963
  throw new Error("Profile secret resolution failed");
908
964
  }
909
965
  if (signal.aborted || this.snapshot !== snapshot || this.connection !== connection) throw new Error(INVALIDATED);
966
+ if (JSON.stringify(this.currentBinding(snapshot)?.secrets[name]) !== JSON.stringify(providerReference)) throw new Error(INVALIDATED);
910
967
  if (typeof value !== "string" || value.length === 0) throw new Error("Profile secret field is unavailable");
911
968
  return value;
912
969
  }
970
+ /** `secrets/<name>` as `{value, purposes, allowedOrigins?, allowedTargets?}`, checked like a profile alias. */
971
+ async savedSecret(name, signal) {
972
+ if (!this.options.readVault || !ALIAS_PATTERN.test(name)) return void 0;
973
+ try {
974
+ const entry = await this.options.readVault(VAULT_SECRETS_NAMESPACE, name, signal);
975
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return void 0;
976
+ const { value, ...delivery } = entry;
977
+ const vault = {
978
+ namespace: VAULT_SECRETS_NAMESPACE,
979
+ key: name,
980
+ field: "value"
981
+ };
982
+ const reference = parseProfileVaultSecrets({ [name]: {
983
+ ...delivery,
984
+ vault
985
+ } }, "Saved secret")[name];
986
+ return reference && {
987
+ reference,
988
+ value
989
+ };
990
+ } catch {
991
+ return;
992
+ }
993
+ }
913
994
  dispose() {
914
995
  if (this.disposal) return this.disposal;
915
996
  this.disposed = true;
@@ -1048,7 +1129,7 @@ function createProfileServerCommand(host, state, sources, lifetime) {
1048
1129
  if (signal.aborted) return;
1049
1130
  if (requested && !profiles.some(({ name }) => name === requested)) throw new Error(`Unknown profile: ${requested}`);
1050
1131
  const profile = requested || void 0;
1051
- if (profile === execution.selection.profile && host.inspectCapabilities().ready) return;
1132
+ if (profile !== void 0 && profile === execution.selection.profile && host.inspectCapabilities().ready) return;
1052
1133
  try {
1053
1134
  await host.changeSelection({
1054
1135
  axis: "profile",
@@ -1095,14 +1176,16 @@ function profileSessionState(context) {
1095
1176
  }
1096
1177
  //#endregion
1097
1178
  //#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/root.server.ts
1098
- var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1179
+ var root_server_default = defineRoot(async ({ agent, host, signal, context }) => {
1099
1180
  if (!agent) return { value: void 0 };
1100
1181
  const execution = agent.context;
1101
1182
  const scope = { workspaceId: host.context.workspaceId };
1102
1183
  const state = profileSessionState(context);
1103
- const homeDirectory = execution.environment.HOME ?? nodeHost.homeDirectory();
1104
- const readProfiles = () => loadProfiles(execution.repoRoot, homeDirectory);
1105
- const readProfile = (profileName) => findProfile(readProfiles(), readProfileSources(context, scope), profileName);
1184
+ const homeDirectory = host.context.homeDirectory ?? execution.environment.HOME;
1185
+ if (!homeDirectory) throw new Error("Profile session requires a host home directory.");
1186
+ const loadFiles = () => loadProfilesAsync(requirePoFs(context), execution.repoRoot, BACKGROUND_CONTEXT, homeDirectory);
1187
+ let files = await loadFiles();
1188
+ const readProfile = (profileName) => findProfile(files, readProfileSources(context, scope), profileName);
1106
1189
  const handoff = readInitialProfileOutcome(context);
1107
1190
  let publishOutcome;
1108
1191
  const applyHandoff = (selection, outcome) => {
@@ -1112,7 +1195,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1112
1195
  ...selection,
1113
1196
  profile: void 0
1114
1197
  };
1115
- if (mergeProfiles(readProfiles(), readProfileSources(context, scope)).some((profile) => profile.name === name)) return {
1198
+ if (mergeProfiles(files, readProfileSources(context, scope)).some((profile) => profile.name === name)) return {
1116
1199
  ...selection,
1117
1200
  profile: name
1118
1201
  };
@@ -1130,7 +1213,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1130
1213
  kind: "named",
1131
1214
  name: selection.profile
1132
1215
  };
1133
- const outcome = await resolveInitialProfile(await loadProfilesAsync(requirePoFs(context), execution.repoRoot, BACKGROUND_CONTEXT, homeDirectory), readProfileSources(context, scope), {
1216
+ const outcome = await resolveInitialProfile(files, readProfileSources(context, scope), {
1134
1217
  intent,
1135
1218
  scope,
1136
1219
  signal
@@ -1143,13 +1226,34 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1143
1226
  };
1144
1227
  };
1145
1228
  const unregisterResolver = agent.registerInitialSelectionResolver((selection) => handoff === void 0 ? resolveStartup(selection) : applyHandoff(selection, handoff));
1229
+ let vaultBinding;
1146
1230
  const runtime = createProfileRuntime({
1147
1231
  readBinding: (profileName) => readProfile(profileName).integration,
1148
- readEnv: (profileName) => readProfile(profileName).env
1232
+ readEnv: (profileName) => readProfile(profileName).env,
1233
+ readSecrets: (profileName) => readProfile(profileName).secrets,
1234
+ readVault: async (namespace, key, requestSignal) => {
1235
+ requestSignal.throwIfAborted();
1236
+ const binding = vaultBinding;
1237
+ if (!binding?.active) throw new Error("Profile vault is unavailable");
1238
+ const record = await binding.provider.get(namespace, key);
1239
+ requestSignal.throwIfAborted();
1240
+ if (!binding.active) throw new Error("Profile vault is unavailable");
1241
+ return record?.value;
1242
+ }
1149
1243
  });
1244
+ let selectedProfile;
1245
+ let personTimeZone;
1246
+ const publishTimeZone = () => personTimeZone?.setProfile(selectedProfile === void 0 ? void 0 : readProfile(selectedProfile).timezone);
1150
1247
  const unsubscribe = agent.subscribeSelection(async (selection, applied) => {
1151
1248
  try {
1152
- await runtime.select(selection.profile, { force: applied?.refresh?.includes("profile") === true });
1249
+ const force = applied?.refresh?.includes("profile") === true;
1250
+ if (force) {
1251
+ runtime.invalidate();
1252
+ files = await loadFiles();
1253
+ }
1254
+ await runtime.select(selection.profile, { force });
1255
+ selectedProfile = selection.profile;
1256
+ publishTimeZone();
1153
1257
  } catch (error) {
1154
1258
  throw new PoHeadlessPromptAdmissionError(error);
1155
1259
  }
@@ -1162,6 +1266,28 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1162
1266
  value: runtime,
1163
1267
  services: [
1164
1268
  createProfileRuntimePlugin(runtime),
1269
+ (serviceContext) => {
1270
+ serviceContext.inject(["po/vault"], (injected) => {
1271
+ const binding = {
1272
+ provider: injected.get("po/vault"),
1273
+ active: true
1274
+ };
1275
+ vaultBinding = binding;
1276
+ return () => {
1277
+ binding.active = false;
1278
+ if (vaultBinding === binding) vaultBinding = void 0;
1279
+ };
1280
+ });
1281
+ },
1282
+ (serviceContext) => {
1283
+ serviceContext.inject([PO_PERSON_TIME_ZONE_SERVICE], (injected) => {
1284
+ personTimeZone = readPoPersonTimeZone(injected);
1285
+ publishTimeZone();
1286
+ return () => {
1287
+ personTimeZone = void 0;
1288
+ };
1289
+ });
1290
+ },
1165
1291
  (serviceContext) => {
1166
1292
  if (handoff !== void 0) return;
1167
1293
  serviceContext.provide(PROFILE_INITIAL_OUTCOME_SERVICE, void 0);
@@ -1194,6 +1320,324 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
1194
1320
  };
1195
1321
  });
1196
1322
  //#endregion
1323
+ //#region ../../foundations/po-profile/src/constants/personaPresets.ts
1324
+ /** Starting personalities for a personal coordinator agent. `soul` becomes its SOUL.md. */
1325
+ const PERSONA_PRESETS = [
1326
+ {
1327
+ id: "focused",
1328
+ label: "Focused",
1329
+ description: "A precise coding partner that keeps work small and verified.",
1330
+ 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."
1331
+ },
1332
+ {
1333
+ id: "friendly",
1334
+ label: "Friendly",
1335
+ description: "A warm everyday assistant that explains things plainly.",
1336
+ 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."
1337
+ },
1338
+ {
1339
+ id: "creative",
1340
+ label: "Creative",
1341
+ description: "A marketing partner that offers fresh angles and options.",
1342
+ 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."
1343
+ },
1344
+ {
1345
+ id: "persuasive",
1346
+ label: "Persuasive",
1347
+ description: "A sales partner that frames value and drives to the next step.",
1348
+ 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."
1349
+ }
1350
+ ];
1351
+ //#endregion
1352
+ //#region ../../foundations/po-profile/src/schemas/apiContracts.ts
1353
+ const ProfileSelectionSchema = _Object_({ profile: Union([Null(), String$1({ minLength: 1 })]) }, { additionalProperties: false });
1354
+ const CreateProfileSchema = _Object_({
1355
+ alias: String$1({ pattern: "^[a-z0-9][a-z0-9-]{0,39}$" }),
1356
+ displayName: String$1({
1357
+ minLength: 1,
1358
+ maxLength: 80
1359
+ }),
1360
+ preset: Union(PERSONA_PRESETS.map(({ id }) => Literal(id))),
1361
+ note: Optional(String$1({ maxLength: 1e3 })),
1362
+ avatarPngBase64: Optional(String$1({
1363
+ minLength: 1,
1364
+ maxLength: 262144
1365
+ }))
1366
+ }, { additionalProperties: false });
1367
+ const CreatedProfileSchema = _Object_({ name: String$1() });
1368
+ const CurrentProfileSchema = _Object_({ profile: Union([Null(), String$1()]) });
1369
+ const ProfileCatalogSchema = _Object_({
1370
+ profiles: _Array_(_Object_({
1371
+ name: String$1(),
1372
+ identity: Optional(_Object_({
1373
+ name: Optional(String$1()),
1374
+ icon: Optional(String$1()),
1375
+ role: Optional(String$1()),
1376
+ contact: Optional(String$1())
1377
+ })),
1378
+ sourceId: String$1()
1379
+ })),
1380
+ readiness: Union([Literal("ready"), Literal("unavailable")])
1381
+ });
1382
+ defineApiContract({
1383
+ version: 1,
1384
+ http: [
1385
+ {
1386
+ id: "profile.create",
1387
+ scope: "global",
1388
+ basePath: "profile",
1389
+ path: "/profiles",
1390
+ method: "POST",
1391
+ authentication: "owner",
1392
+ 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.",
1393
+ body: {
1394
+ required: true,
1395
+ contentType: "application/json",
1396
+ schema: CreateProfileSchema
1397
+ },
1398
+ responses: {
1399
+ ...jsonApiResponses(CreatedProfileSchema),
1400
+ ...jsonApiResponses(CreatedProfileSchema, 201)
1401
+ }
1402
+ },
1403
+ {
1404
+ id: "profile.current",
1405
+ scope: "session",
1406
+ basePath: "profile",
1407
+ path: "/current",
1408
+ method: "GET",
1409
+ authentication: "owner",
1410
+ description: "Read the current session selection.",
1411
+ responses: jsonApiResponses(CurrentProfileSchema)
1412
+ },
1413
+ {
1414
+ id: "profile.launchProfiles",
1415
+ scope: "workspace",
1416
+ basePath: "profile",
1417
+ path: "/launch-profiles",
1418
+ method: "GET",
1419
+ authentication: "owner",
1420
+ 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.",
1421
+ responses: jsonApiResponses(ProfileCatalogSchema)
1422
+ },
1423
+ {
1424
+ id: "profile.profiles",
1425
+ scope: "session",
1426
+ basePath: "profile",
1427
+ path: "/profiles",
1428
+ method: "GET",
1429
+ authentication: "owner",
1430
+ description: "List profiles available to this session, as names and display data only. Waits up to ten seconds for plugin sources.",
1431
+ responses: jsonApiResponses(ProfileCatalogSchema)
1432
+ },
1433
+ {
1434
+ id: "profile.select",
1435
+ scope: "session",
1436
+ basePath: "profile",
1437
+ path: "/current",
1438
+ method: "PUT",
1439
+ authentication: "owner",
1440
+ description: "Apply a profile at the next tool boundary, or clear it with null. Success means application finished.",
1441
+ body: {
1442
+ required: true,
1443
+ contentType: "application/json",
1444
+ schema: ProfileSelectionSchema
1445
+ },
1446
+ responses: {
1447
+ ...jsonApiResponses(CurrentProfileSchema),
1448
+ "400": { description: "Invalid profile selection." },
1449
+ "404": { description: "Unknown profile." },
1450
+ "503": { description: "Sources or integration unavailable; never automatically replay this write." }
1451
+ }
1452
+ }
1453
+ ],
1454
+ sockets: [],
1455
+ dynamic: []
1456
+ });
1457
+ //#endregion
1458
+ //#region ../../foundations/po-profile/src/services/profileCreation/type.ts
1459
+ /** A refusal with the HTTP status that describes it. Messages never echo request values. */
1460
+ var ProfileCreationError = class extends Error {
1461
+ status;
1462
+ constructor(status, message) {
1463
+ super(message);
1464
+ this.status = status;
1465
+ this.name = "ProfileCreationError";
1466
+ }
1467
+ };
1468
+ //#endregion
1469
+ //#region ../../foundations/po-profile/src/services/profileCreation/index.ts
1470
+ const AGENTS_ROOT = "agents";
1471
+ const AVATAR_FILE = "avatar.png";
1472
+ const COORDINATOR_ROLE = "coordinator";
1473
+ const NOTES_HEADING = "## Notes from the person";
1474
+ const BASE64_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/;
1475
+ const DATA_URL_PREFIX = /^data:[a-z]+\/[a-z0-9.+-]+;base64,/i;
1476
+ const INVALID_AVATAR = "Avatar must be a PNG, JPEG, GIF or WebP image of at most 256 KiB";
1477
+ const startsWith = (bytes, offset, expected) => {
1478
+ const values = typeof expected === "string" ? Array.from({ length: expected.length }, (_, index) => expected.charCodeAt(index)) : expected;
1479
+ return bytes.length >= offset + values.length && values.every((value, index) => bytes[offset + index] === value);
1480
+ };
1481
+ /** Magic bytes, never the declared type. SVG has no entry: it executes script when the cockpit renders it. */
1482
+ const SIGNATURES = [
1483
+ {
1484
+ mime: "image/png",
1485
+ test: (bytes) => startsWith(bytes, 0, [
1486
+ 137,
1487
+ 80,
1488
+ 78,
1489
+ 71,
1490
+ 13,
1491
+ 10,
1492
+ 26,
1493
+ 10
1494
+ ])
1495
+ },
1496
+ {
1497
+ mime: "image/jpeg",
1498
+ test: (bytes) => startsWith(bytes, 0, [
1499
+ 255,
1500
+ 216,
1501
+ 255
1502
+ ])
1503
+ },
1504
+ {
1505
+ mime: "image/gif",
1506
+ test: (bytes) => startsWith(bytes, 0, "GIF8")
1507
+ },
1508
+ {
1509
+ mime: "image/webp",
1510
+ test: (bytes) => startsWith(bytes, 0, "RIFF") && startsWith(bytes, 8, "WEBP")
1511
+ }
1512
+ ];
1513
+ /** Decoded avatar bytes the profile loader will keep: an allowed image within its data URL bound. */
1514
+ function avatarBytes(encoded) {
1515
+ const base64 = encoded.replace(DATA_URL_PREFIX, "").replace(/\s/g, "");
1516
+ if (!BASE64_PATTERN.test(base64)) throw new ProfileCreationError(422, INVALID_AVATAR);
1517
+ let bytes;
1518
+ try {
1519
+ bytes = Uint8Array.from(atob(base64), (char) => char.charCodeAt(0));
1520
+ } catch {
1521
+ throw new ProfileCreationError(422, INVALID_AVATAR);
1522
+ }
1523
+ const mime = SIGNATURES.find((signature) => signature.test(bytes))?.mime;
1524
+ const dataUrlLength = `data:${mime};base64,`.length + Math.ceil(bytes.length / 3) * 4;
1525
+ if (!mime || dataUrlLength > 262144) throw new ProfileCreationError(422, INVALID_AVATAR);
1526
+ return bytes;
1527
+ }
1528
+ function profileMarkdown(displayName, hasAvatar) {
1529
+ return [
1530
+ "---",
1531
+ `name: ${JSON.stringify(displayName)}`,
1532
+ ...hasAvatar ? [`icon: ${AVATAR_FILE}`] : [],
1533
+ `role: ${COORDINATOR_ROLE}`,
1534
+ "---",
1535
+ ""
1536
+ ].join("\n");
1537
+ }
1538
+ function soulMarkdown(soul, note) {
1539
+ return note ? `${soul}\n\n${NOTES_HEADING}\n\n${note}\n` : `${soul}\n`;
1540
+ }
1541
+ /**
1542
+ * Creates `~/.po/agents/<alias>` from a preset and makes sure `~/.po/profiles.yaml` lists `agents`.
1543
+ * A coordinator this endpoint made earlier under that alias is rewritten with the new choices, so a person who
1544
+ * restarts onboarding can keep their agent's name; any other profile owning the alias still refuses.
1545
+ *
1546
+ * The profiles.yaml change is planned first, so an invalid file stops before anything is written, and committed
1547
+ * last against the text it was computed from: a concurrent edit removes the new persona again and refuses.
1548
+ */
1549
+ async function createPersonaProfile(dependencies, request) {
1550
+ const { fs, homeDirectory, context } = dependencies;
1551
+ const displayName = request.displayName.trim();
1552
+ if (!displayName) throw new ProfileCreationError(422, "Display name is required");
1553
+ const preset = PERSONA_PRESETS.find(({ id }) => id === request.preset);
1554
+ if (!preset) throw new ProfileCreationError(422, "Unknown persona preset");
1555
+ const avatar = request.avatarPngBase64 === void 0 ? void 0 : avatarBytes(request.avatarPngBase64);
1556
+ let plan;
1557
+ let profiles;
1558
+ try {
1559
+ plan = await planGlobalProfileRootAsync(fs, homeDirectory, AGENTS_ROOT, context);
1560
+ profiles = await loadProfilesAsync(fs, homeDirectory, context, homeDirectory);
1561
+ } catch {
1562
+ throw new ProfileCreationError(500, "Profile configuration is unavailable");
1563
+ }
1564
+ const personaDirectory = path.join(path.dirname(plan.filePath), AGENTS_ROOT, request.alias);
1565
+ const existing = profiles.find(({ name }) => name === request.alias);
1566
+ const updated = existing?.identity?.role === COORDINATOR_ROLE && path.resolve(existing.personaRoot, existing.persona) === personaDirectory;
1567
+ if (!updated && (existing || await pathExists(fs, personaDirectory, context))) throw new ProfileCreationError(409, "Profile alias is taken");
1568
+ try {
1569
+ if (avatar) await writeFileAtomic(fs, path.join(personaDirectory, AVATAR_FILE), avatar, context);
1570
+ await writeFileAtomic(fs, path.join(personaDirectory, "SOUL.md"), soulMarkdown(preset.soul, request.note?.trim()), context);
1571
+ await writeFileAtomic(fs, path.join(personaDirectory, "profile.md"), profileMarkdown(displayName, avatar !== void 0), context);
1572
+ await commitGlobalProfileRootAsync(fs, plan, context);
1573
+ } catch (error) {
1574
+ if (!updated) await removePath(fs, personaDirectory, context);
1575
+ if (error instanceof ProfileCatalogChangedError) throw new ProfileCreationError(409, "Profile configuration changed. Try again.");
1576
+ throw error;
1577
+ }
1578
+ return {
1579
+ name: request.alias,
1580
+ updated
1581
+ };
1582
+ }
1583
+ //#endregion
1584
+ //#region ../../foundations/po-profile/src/extensions/(backend)/api/profile/route.server.ts
1585
+ const PROFILES_PATH = "/profiles";
1586
+ /**
1587
+ * Creates a personal coordinator profile. Global mount only: workspaces and sessions already own `profile`.
1588
+ * Creations run one at a time, so two requests cannot both claim one alias.
1589
+ */
1590
+ var route_server_default$2 = defineRoutedContribution(({ context, host }) => {
1591
+ if (host.scope !== "global") return void 0;
1592
+ let fs;
1593
+ context.inject([PO_FS_SERVICE], (scoped) => {
1594
+ const bound = requirePoFs(scoped);
1595
+ fs = bound;
1596
+ return () => {
1597
+ if (fs === bound) fs = void 0;
1598
+ };
1599
+ });
1600
+ return {
1601
+ basePath: "profile",
1602
+ start: (api) => {
1603
+ const creations = createSerialRunner();
1604
+ const create = async (request) => {
1605
+ let body;
1606
+ try {
1607
+ body = await request.json();
1608
+ } catch {
1609
+ return Response.json({ error: "Invalid profile" }, { status: 400 });
1610
+ }
1611
+ if (!Check(CreateProfileSchema, body)) return Response.json({ error: "Invalid profile" }, { status: 400 });
1612
+ const homeDirectory = api.homeDirectory ?? host.context.homeDirectory;
1613
+ if (!fs || !homeDirectory) return Response.json({ error: "Profile storage unavailable" }, { status: 503 });
1614
+ try {
1615
+ const { name, updated } = await createPersonaProfile({
1616
+ fs,
1617
+ homeDirectory,
1618
+ context: BACKGROUND_CONTEXT
1619
+ }, body);
1620
+ return Response.json({ name }, { status: updated ? 200 : 201 });
1621
+ } catch (error) {
1622
+ if (error instanceof ProfileCreationError) return Response.json({ error: error.message }, { status: error.status });
1623
+ throw error;
1624
+ }
1625
+ };
1626
+ return {
1627
+ async fetch(request) {
1628
+ if (new URL(request.url).pathname !== PROFILES_PATH) return Response.json({ error: "Not found" }, { status: 404 });
1629
+ if (request.method !== "POST") return Response.json({ error: "Method not allowed" }, {
1630
+ status: 405,
1631
+ headers: { Allow: "POST" }
1632
+ });
1633
+ return creations(() => create(request));
1634
+ },
1635
+ close() {}
1636
+ };
1637
+ }
1638
+ };
1639
+ }, { cardinality: "optional" });
1640
+ //#endregion
1197
1641
  //#region ../../foundations/po-profile/src/services/launchProfiles/type.ts
1198
1642
  /** The source id every profile read from a `profiles.yaml` carries. */
1199
1643
  const FILE_PROFILE_SOURCE_ID = "files";
@@ -1274,80 +1718,6 @@ var route_server_default$1 = defineRoute(({ context, signal }) => ({
1274
1718
  })
1275
1719
  }));
1276
1720
  //#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
1721
  //#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/_lib/profileApi.ts
1352
1722
  /** Session roots may differ from the workspace launcher's root. Only display data leaves the host. */
1353
1723
  async function listSessionProfiles(input) {
@@ -1387,7 +1757,7 @@ async function selectSessionProfile(input, request) {
1387
1757
  }
1388
1758
  }
1389
1759
  signal.throwIfAborted();
1390
- if (profile !== agent.context.selection.profile || !agent.inspectCapabilities().ready) try {
1760
+ if (profile === void 0 || profile !== agent.context.selection.profile || !agent.inspectCapabilities().ready) try {
1391
1761
  await agent.changeSelection({
1392
1762
  axis: "profile",
1393
1763
  profile
@@ -1600,6 +1970,17 @@ function createProfileMemoryExtraction(options) {
1600
1970
  //#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/hook/agentSettled.server.ts
1601
1971
  var agentSettled_server_default = defineHook(({ root, context }) => {
1602
1972
  let extraction;
1973
+ let config;
1974
+ context.inject([PO_CONFIG_SERVICE], (scoped) => {
1975
+ const binding = scoped.get(PO_CONFIG_SERVICE);
1976
+ config = binding;
1977
+ return () => {
1978
+ if (config !== binding) return;
1979
+ config = void 0;
1980
+ extraction?.dispose();
1981
+ extraction = void 0;
1982
+ };
1983
+ });
1603
1984
  return {
1604
1985
  event: "agent_settled",
1605
1986
  handle(_event, execution) {
@@ -1607,7 +1988,7 @@ var agentSettled_server_default = defineHook(({ root, context }) => {
1607
1988
  extraction ??= createProfileMemoryExtraction({
1608
1989
  store: requireProfileMemoryStore(context),
1609
1990
  runtime: root,
1610
- automatic: () => context.get(PO_CONFIG_SERVICE)?.getSnapshot().settings.profileMemory?.automatic === true,
1991
+ automatic: () => config?.getSnapshot().settings.profileMemory?.automatic === true,
1611
1992
  onError: (error, failed) => failed.client.setStatus(EXTRACTION_STATUS_SOURCE, `Memory extraction failed: ${error instanceof Error ? error.message : String(error)}`)
1612
1993
  });
1613
1994
  extraction.settle(execution);
@@ -1683,8 +2064,15 @@ const serverPlugin = defineServerPlugin({
1683
2064
  }),
1684
2065
  global: async (context) => {
1685
2066
  const scopeGlobal = await context.scopeRoot("global", root_server_default$1, context);
2067
+ const contextGlobal = {
2068
+ ...context,
2069
+ root: scopeGlobal.value
2070
+ };
1686
2071
  return {
1687
2072
  ...composeRootHooks(scopeGlobal),
2073
+ get api() {
2074
+ return defined([at(route_server_default$2, contextGlobal)]);
2075
+ },
1688
2076
  services: [...scopeGlobal.services ?? []]
1689
2077
  };
1690
2078
  },