@agimon-ai/po-cloudflare 0.0.2-alpha.20 → 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 (222) hide show
  1. package/dist/{agent-DTjnYFAN.js → agent-DZ-OKOHn.js} +1 -1
  2. package/dist/{apiContracts-DepyzMNr.js → apiContracts-b33nSAAI.js} +4 -80
  3. package/dist/{approval-Biq3NCWj.js → approval-r3NnI1VC.js} +2 -2
  4. package/dist/{approvalPrompt-DoHlIPkU.js → approvalPrompt-DWoXxu3S.js} +2 -2
  5. package/dist/artifactFiles-DLCReI0-.js +1 -0
  6. package/dist/assets/assets/{CodeEditorView-BU8DeV_G.js → CodeEditorView-XeNS0L9M.js} +2 -2
  7. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-BkzARjqu.js → abnfDiagram-WEYOIA3C-B6ZW0nkR.js} +2 -2
  8. package/dist/assets/assets/{architecture-WOLXFQ4H-B_dgnlXa.js → architecture-WOLXFQ4H-bVR64sHO.js} +1 -1
  9. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DMGAifk0.js → architectureDiagram-ZHVYKT53-D7tZz3io.js} +2 -2
  10. package/dist/assets/assets/{blockDiagram-RJAE7QA3-DwTSK4lj.js → blockDiagram-RJAE7QA3-DdwScfiX.js} +2 -2
  11. package/dist/assets/assets/{c4Diagram-XDPPPE54-IRaOcC_u.js → c4Diagram-XDPPPE54-DgSxZJCV.js} +2 -2
  12. package/dist/assets/assets/channel-TPcVvp_3.js +2 -0
  13. package/dist/assets/assets/{chunk-2E7WHVMD-BvS46crW.js → chunk-2E7WHVMD-D5TXC2SM.js} +2 -2
  14. package/dist/assets/assets/{chunk-4EMNKR2T--n96Xbj0.js → chunk-4EMNKR2T-BWhOSvo1.js} +2 -2
  15. package/dist/assets/assets/{chunk-55XCU76K-D3h_hFRi.js → chunk-55XCU76K-HkkBzLtZ.js} +2 -2
  16. package/dist/assets/assets/{chunk-7S6XSTFO-Cj18feJl.js → chunk-7S6XSTFO-CBnjycLU.js} +2 -2
  17. package/dist/assets/assets/{chunk-AQDTSKZB-DXsT43bg.js → chunk-AQDTSKZB-75lIIq8T.js} +2 -2
  18. package/dist/assets/assets/{chunk-DSNLSHJZ-Br7dX7yf.js → chunk-DSNLSHJZ-D8PpnXMk.js} +2 -2
  19. package/dist/assets/assets/{chunk-HAGFOTED-BcozAtPo.js → chunk-HAGFOTED-CXRS2NIN.js} +2 -2
  20. package/dist/assets/assets/{chunk-HNE4Q36P-B8kgXgRq.js → chunk-HNE4Q36P-BocUqS94.js} +2 -2
  21. package/dist/assets/assets/{chunk-NQOKRVIF-Dn7UnsqE.js → chunk-NQOKRVIF-CHf_ogYT.js} +2 -2
  22. package/dist/assets/assets/{chunk-UHW7PFBP-BSJot0vi.js → chunk-UHW7PFBP-DrW1PaIv.js} +2 -2
  23. package/dist/assets/assets/{chunk-VQ5W62QI-Cpf1EfZK.js → chunk-VQ5W62QI-CLoA7bFm.js} +2 -2
  24. package/dist/assets/assets/{chunk-WQQL4CDK-Dnc36uZR.js → chunk-WQQL4CDK-BmBsrj9I.js} +2 -2
  25. package/dist/assets/assets/chunk-XXDRQBXY-iFE4Tl8c.js +2 -0
  26. package/dist/assets/assets/{chunk-YZO67HFG-BV8_A7x3.js → chunk-YZO67HFG-DShE_cgv.js} +2 -2
  27. package/dist/assets/assets/{chunk-ZAUX2LTX-C4Ne_31B.js → chunk-ZAUX2LTX-B3oLvSXy.js} +2 -2
  28. package/dist/assets/assets/{chunk-ZCHMQSOR-Dq9ModsA.js → chunk-ZCHMQSOR-B14vKK7C.js} +2 -2
  29. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-1BWEjXP9.js → classDiagram-v2-4MYWR3UA-Da8elIW2.js} +2 -2
  30. package/dist/assets/assets/{cose-bilkent-JH36ORCC-DREkvC_x.js → cose-bilkent-JH36ORCC-Du4tGtiJ.js} +2 -2
  31. package/dist/assets/assets/{cynefin-EF2NZ3EQ-CWziP8nx.js → cynefin-EF2NZ3EQ-Cyj6i_WI.js} +1 -1
  32. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-DOoYmcvz.js → cynefinDiagram-WF24UDRP-DFWXwO7A.js} +2 -2
  33. package/dist/assets/assets/{dagre-NK4GIZVX-OoAtEico.js → dagre-NK4GIZVX-C1wB_cf-.js} +2 -2
  34. package/dist/assets/assets/{diagram-CBK3MWTC-B-pl2-iR.js → diagram-CBK3MWTC-MYCOBYl6.js} +2 -2
  35. package/dist/assets/assets/{diagram-I5XIIV2D-uKzNJSZ2.js → diagram-I5XIIV2D-BFYbKUFf.js} +2 -2
  36. package/dist/assets/assets/{diagram-ODIL2UCW-CEXY_Tzu.js → diagram-ODIL2UCW-6siqTpv_.js} +2 -2
  37. package/dist/assets/assets/{diagram-PFBEJUXE-MKlRQo-g.js → diagram-PFBEJUXE-CaBr9CoB.js} +2 -2
  38. package/dist/assets/assets/{diagram-RJA3I4VV-c2qlCEVs.js → diagram-RJA3I4VV-DAvmuDpc.js} +2 -2
  39. package/dist/assets/assets/{diagram-TYUNFSNR-DTdqLA6J.js → diagram-TYUNFSNR-CJnhgCpo.js} +2 -2
  40. package/dist/assets/assets/{dist-qZHwVT1x.js → dist-BQ4W1R18.js} +2 -2
  41. package/dist/assets/assets/{dist-DvZCwSZ8.js → dist-BnzFckPF.js} +2 -2
  42. package/dist/assets/assets/{dist-DCKskbBE.js → dist-CFtBpcYL.js} +2 -2
  43. package/dist/assets/assets/{dist-mQUN8X3n.js → dist-CIQX1z4W.js} +2 -2
  44. package/dist/assets/assets/{dist-D9lacOpq.js → dist-ChHYoe9_.js} +2 -2
  45. package/dist/assets/assets/{dist-BzTxJnSR.js → dist-DKxZO8d9.js} +2 -2
  46. package/dist/assets/assets/{dist-DCc8tQ7G.js → dist-DL6z28wl.js} +2 -2
  47. package/dist/assets/assets/{dist-4TUOlkyl.js → dist-DNyn1p9Z.js} +2 -2
  48. package/dist/assets/assets/{dist-DXlts_H5.js → dist-qYlLXIa8.js} +2 -2
  49. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-C89wxfCd.js → ebnfDiagram-V4P3TTPT-AUcqDTM3.js} +2 -2
  50. package/dist/assets/assets/{elk-QONTBCTQ-BMBgLOae.js → elk-QONTBCTQ-aA10PEHJ.js} +2 -2
  51. package/dist/assets/assets/{erDiagram-KYQIGQAA-Bb04CRa4.js → erDiagram-KYQIGQAA-hhYiqA-x.js} +2 -2
  52. package/dist/assets/assets/{eventmodeling-K75KTNOO-DSyNf2MV.js → eventmodeling-K75KTNOO-BQZqbRo5.js} +1 -1
  53. package/dist/assets/assets/flowDiagram-IUGLLWBU-BuyysPYC.js +1 -0
  54. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-sB7-pF_t.js → ganttDiagram-R7GPNTJY-CLON1GpW.js} +2 -2
  55. package/dist/assets/assets/{gitGraph-VSP46ZUC-pWPBCmdT.js → gitGraph-VSP46ZUC-DbmvNwR2.js} +1 -1
  56. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-DronDRed.js → gitGraphDiagram-PDYL7XHY-DJVO0WlL.js} +2 -2
  57. package/dist/assets/assets/index-BiTVAj5E.js +155 -0
  58. package/dist/assets/assets/{info-OHQRW6UA-B375mT1i.js → info-OHQRW6UA-CAt3Nt3g.js} +1 -1
  59. package/dist/assets/assets/{infoDiagram-MVDRKAX5-9Hw3wWP7.js → infoDiagram-MVDRKAX5-DTuqH-Zb.js} +2 -2
  60. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CdPAuupk.js → ishikawaDiagram-HPEHV2GE-BnWvdonT.js} +2 -2
  61. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-hqmaHM9u.js → journeyDiagram-BOSHW7O7-Btxtcgvl.js} +2 -2
  62. package/dist/assets/assets/{kanban-definition-FNSA4HC5-BdOHplX4.js → kanban-definition-FNSA4HC5-q7ek9o_H.js} +2 -2
  63. package/dist/assets/assets/{line-BCSC3Bu2.js → line-B7yLilmC.js} +2 -2
  64. package/dist/assets/assets/{linear-D5ddQU3r.js → linear-y8aSKEli.js} +2 -2
  65. package/dist/assets/assets/{mermaid-parser.core-BaSUi_Ph.js → mermaid-parser.core-B4rH50nD.js} +4 -4
  66. package/dist/assets/assets/{mermaid.core-CUUsU9Ou.js → mermaid.core-DnRVHTjE.js} +5 -5
  67. package/dist/assets/assets/{mindmap-definition-6OY57UG3-BtVkhvIZ.js → mindmap-definition-6OY57UG3-DT9Afs2v.js} +2 -2
  68. package/dist/assets/assets/{packet-JDAUHWVQ-CQ3OUDwI.js → packet-JDAUHWVQ-CnqNbu4p.js} +1 -1
  69. package/dist/assets/assets/{pegDiagram-ECIUJNBX-DDnq-Kn3.js → pegDiagram-ECIUJNBX-cvxdBBFq.js} +2 -2
  70. package/dist/assets/assets/{pie-XZMESJXO-BvOFTkQB.js → pie-XZMESJXO-etXMNsaL.js} +1 -1
  71. package/dist/assets/assets/{pieDiagram-GNMPY74T-Bdwhl9jD.js → pieDiagram-GNMPY74T-CBN-R3_j.js} +2 -2
  72. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-GHKoDEeT.js → quadrantDiagram-D57K4MC3-C5jjVPIH.js} +2 -2
  73. package/dist/assets/assets/{radar-ABXABTNO-Yk9rKkKW.js → radar-ABXABTNO-CAMd_mrV.js} +1 -1
  74. package/dist/assets/assets/{railroad-I3PHUGI6-Crr2QEwm.js → railroad-I3PHUGI6-DIs3auoe.js} +1 -1
  75. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-CLrgwBog.js → railroad-abnf-LNEFI6M7-CJXr1qWy.js} +1 -1
  76. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-zWReI6MC.js → railroad-ebnf-DWYD2UWJ-DfwtykqI.js} +1 -1
  77. package/dist/assets/assets/{railroad-peg-JR7BVNR7-CnVnlaHi.js → railroad-peg-JR7BVNR7-B8beAhTs.js} +1 -1
  78. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-MJ68mMla.js → railroadDiagram-Y72NRBL7-BDcQE-EL.js} +2 -2
  79. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-BYb-mTCH.js → requirementDiagram-EQYSW5RA-KJ4-QjZM.js} +2 -2
  80. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DzONJsqQ.js → sankeyDiagram-SY24JHO5-VjIB-Ybr.js} +2 -2
  81. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-0vav9YWV.js → sequenceDiagram-BLEHNHQU-MfMuWq1M.js} +2 -2
  82. package/dist/assets/assets/{src-DZJUnjaM.js → src-BAxIj8GJ.js} +2 -2
  83. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-B0M8THPh.js → stateDiagram-v2-A6IESKWZ-mHwLRRCY.js} +2 -2
  84. package/dist/assets/assets/{swimlanes-B3ENRKFQ-5YJZCHIB.js → swimlanes-B3ENRKFQ-PArlYoqV.js} +2 -2
  85. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-The09-5S.js +9 -0
  86. package/dist/assets/assets/{timeline-definition-JXYKGLGB-us1LwUHo.js → timeline-definition-JXYKGLGB-B2nKiNFU.js} +2 -2
  87. package/dist/assets/assets/{treeView-D4JQ5SDB-BSLlcDre.js → treeView-D4JQ5SDB-gU23_RuI.js} +1 -1
  88. package/dist/assets/assets/{treemap-SAJKECNS-DZ2SwLmk.js → treemap-SAJKECNS-CiqoMvZa.js} +1 -1
  89. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-BrmvO_6k.js → usecaseDiagram-WPOLBNNX-DpeoWpMK.js} +2 -2
  90. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-FKXSeKp5.js → vennDiagram-Q3Y3IDCW-C31iGKvM.js} +2 -2
  91. package/dist/assets/assets/{wardley-7MLQ67FV-DZ_vIMp2.js → wardley-7MLQ67FV-CIzHhzNw.js} +1 -1
  92. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CfLYNckm.js → wardleyDiagram-IVAIDKWA-DIIkoezc.js} +2 -2
  93. package/dist/assets/assets/{webpack-CiS_BB3R.js → webpack-RFseiMZW.js} +2 -2
  94. package/dist/assets/assets/{xychartDiagram-4URNHDU4-DBucwhQh.js → xychartDiagram-4URNHDU4-QiHL91kC.js} +2 -2
  95. package/dist/assets/bundle-asset-policy.json +1 -1
  96. package/dist/assets/index.html +1 -1
  97. package/dist/assets/plugins/assets/base-CKKRZ7-h.css +2 -0
  98. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  99. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  100. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  101. package/dist/assets/plugins/chunks/po-web-runtime-BJDT6Lbw.js +1 -0
  102. package/dist/assets/plugins/compositions.json +1 -1
  103. package/dist/assets/plugins/slots/approval.293d9a00-BXIhaPlQ.js +2 -0
  104. package/dist/assets/plugins/slots/artifacts.24567664-ZzR0gbvy.js +1 -0
  105. package/dist/assets/plugins/slots/author.0998a880-DAbA-7rb.js +93 -0
  106. package/dist/assets/plugins/slots/{autocompact.ec8f713f-B3KTYwW1.js → autocompact.dd97d013-IVq4Z6qm.js} +1 -1
  107. package/dist/assets/plugins/slots/builtin-tools.36d7400b-CpCLjRRN.js +7 -0
  108. package/dist/assets/plugins/slots/codemode.8eaee717-VWt9PqsU.js +10 -0
  109. package/dist/assets/plugins/slots/domain.5e95fc37-5PIUBqDe.js +1 -0
  110. package/dist/assets/plugins/slots/edit.385c9aa9-DNAjPNG5.js +7 -0
  111. package/dist/assets/plugins/slots/files.daf34ed8-CQaTz0i1.js +2 -0
  112. package/dist/assets/plugins/slots/goal.77ec9930-B8EkarBq.js +1 -0
  113. package/dist/assets/plugins/slots/grep.02052cdc-CIRhO2gY.js +1 -0
  114. package/dist/assets/plugins/slots/help.ecd4c0f9-naMF9NN1.js +3 -0
  115. package/dist/assets/plugins/slots/log.a86eb6d0-D5__rAZJ.js +4 -0
  116. package/dist/assets/plugins/slots/{mcp.ea8b6aa2-D0CkHnIw.js → mcp.974af249-DPNHn9XH.js} +10 -10
  117. package/dist/assets/plugins/slots/plan.bafb8f68-C5GEpybF.js +3 -0
  118. package/dist/assets/plugins/slots/{profile.63bc3ae6-BSY3iYfJ.js → profile.48851a1d-yX6tzV3x.js} +1 -1
  119. package/dist/assets/plugins/slots/prompts.723d7748-B7zpPeoF.js +3 -0
  120. package/dist/assets/plugins/slots/read.46bf6536-Cw5Z5z5T.js +1 -0
  121. package/dist/assets/plugins/slots/runner.53e9bd76-CiQR_FPX.js +8 -0
  122. package/dist/assets/plugins/slots/skill.086701a4-CL6h_F-x.js +4 -0
  123. package/dist/assets/plugins/slots/vault.ac9935c8-DKERQYg4.js +1 -0
  124. package/dist/assets/plugins/slots/voice.e85ca7f9-DEgb-U9m.js +1 -0
  125. package/dist/{atomicJson-DCIsEywH.js → atomicJson-C_7F2zD1.js} +2 -3
  126. package/dist/{backgroundWork-Bswjs1av.js → backgroundWork-B1mPDYlf.js} +1 -1
  127. package/dist/{codemode-CgVosRtU.js → codemode-DQFmrosw.js} +1 -1
  128. package/dist/{contracts-CylyLZC8.js → contracts-DD3f1Lpn.js} +1 -1
  129. package/dist/exports-B0WMEXCP.js +34 -0
  130. package/dist/{exports-DERO0cQf.js → exports-D09VsUk-.js} +6 -7
  131. package/dist/{exports-C_dclnKs.js → exports-nV43ShA7.js} +10 -9
  132. package/dist/{extensionFile-Ds7RCpnb.js → extensionFile-DNM4xsje.js} +16 -2
  133. package/dist/{domains-BqChtBLN.js → harnessState-Dwrk3lfv.js} +90 -5
  134. package/dist/{harnessStore-BectazJQ.js → harnessStore-Z7yDLO45.js} +4 -5
  135. package/dist/{help-Dpm82qDr.js → help-w6vVEZGL.js} +15 -5
  136. package/dist/hubChannel-Cm-sxOvU.js +21 -0
  137. package/dist/{index.edge-b0z7PQ6b.js → index.edge-DyYmurS7.js} +14 -2
  138. package/dist/{index.edge-B0D_Lgbx.js → index.edge-K0w5auwG.js} +2 -2
  139. package/dist/{index.edge-BLmsRNW8.js → index.edge-Xa5LLtxz.js} +13 -3
  140. package/dist/{layeredConfig-pQGjhAks.js → layeredConfig-CUkYUs1f.js} +74 -5
  141. package/dist/{majorModes-BrL4EtzH.js → majorModes-BB0PXgFn.js} +3 -4
  142. package/dist/majorModes-C7vtBs4D.js +1 -0
  143. package/dist/{mcpProjection-pbPBBuvs.js → mcpProjection-BtKzB6oK.js} +2 -2
  144. package/dist/modeDefinition-C3Zbrw48.js +44 -0
  145. package/dist/narration-CpRurWLO.js +127 -0
  146. package/dist/{notification-CINsJWDL.js → notification-kckG3leF.js} +2 -2
  147. package/dist/{hubChannel-COvmdWGO.js → packageApi-t1oCjNDU.js} +2 -22
  148. package/dist/{piConfig-BDUpA6w0.js → piConfig-DQzlbPY4.js} +4 -5
  149. package/dist/piSettings-Cf1QofNe.js +1 -0
  150. package/dist/platform-BIEiM4TG.js +113 -0
  151. package/dist/pluginProtocol-BqXXyI4z.js +80 -0
  152. package/dist/{protocol-B6LbEIe6.js → protocol-DDL8geoS.js} +2 -2
  153. package/dist/{server-DRcCuj6P.js → server-AbXyhXlY.js} +4 -4
  154. package/dist/{server-Re1VNk9s.js → server-B6dqQoh2.js} +7 -6
  155. package/dist/{server-cStfn1Yv.js → server-BIHo9TFu.js} +4 -4
  156. package/dist/{server-1O3JEYO0.js → server-BJ7DNzCp.js} +7 -7
  157. package/dist/server-BO-j_GbD.js +15106 -0
  158. package/dist/{server-Cgym-G0a.js → server-BQzAiMns.js} +11 -11
  159. package/dist/server-BR7SZtj7.js +3125 -0
  160. package/dist/{server-DL6UyXfJ.js → server-BT2ORK83.js} +9 -8
  161. package/dist/{server-CzJjYgVk.js → server-BbSHYRnY.js} +3 -3
  162. package/dist/{server-DFCXmDed.js → server-BqoKlEGk.js} +8 -8
  163. package/dist/{server-BXFDsLgm.js → server-Busl0pQI.js} +8 -9
  164. package/dist/server-CIHM4jqu.js +1116 -0
  165. package/dist/{server-DhkR6ugd.js → server-CgWSSdvd.js} +6 -7
  166. package/dist/{server-B8P-UkxF.js → server-Co_UWKrR.js} +5 -5
  167. package/dist/{server-Bt6Zsqo8.js → server-CuEPb7u-.js} +2 -2
  168. package/dist/{server-V8W5mcGu.js → server-D40q2Jpx.js} +47 -27
  169. package/dist/{server-OerXqXJT.js → server-DCyf2Asb.js} +3 -4
  170. package/dist/{server-CCwwnpH0.js → server-DH7PfLln.js} +5 -5
  171. package/dist/{server-_0288DYR.js → server-DJ8bc89M.js} +3 -4
  172. package/dist/{server-GIQIpf33.js → server-DYdp0W9v.js} +7 -7
  173. package/dist/{server-B2G-c0hg.js → server-DsdPEYGu.js} +5 -5
  174. package/dist/{server-Dgn4el5K.js → server-DymH4Ucq.js} +4 -5
  175. package/dist/{server-pY027myK.js → server-IqECnUrb.js} +13 -236
  176. package/dist/{server-Ci_BGVwd.js → server-KBgW77zh.js} +3 -3
  177. package/dist/server-RW_9R3R3.js +1522 -0
  178. package/dist/server-aUit8j6r.js +1028 -0
  179. package/dist/{server-Ci3ls6LL.js → server-gifRriZK.js} +10 -11
  180. package/dist/{server-BR9yl54i.js → server-nkUlqnAL.js} +10 -10
  181. package/dist/server-oxyEbv1a.js +1256 -0
  182. package/dist/{server-DPTp6GXS.js → server-ub3s16Mc.js} +4 -4
  183. package/dist/{serverPlugin-OOfjB8tm.js → serverPlugin-CELT6P0Q.js} +12 -3
  184. package/dist/{sessionConfig-DfwcUKO2.js → sessionConfig-RQGvfm6E.js} +9 -10
  185. package/dist/{server-CyYesT-G.js → type-ASYnCGVW.js} +9 -1031
  186. package/dist/{validation-DuOGOKEi.js → validation-BJxVSAwx.js} +8 -3
  187. package/dist/{value-DyVsxCwZ.js → value-_W31So3B.js} +1 -1
  188. package/dist/{vaultSettings-BFCRCBM3.js → vaultSettings-Di3n5YIg.js} +1 -1
  189. package/dist/voiceTools-RMn4HvWo.js +246 -0
  190. package/dist/web-DCP7ELJj.js +3 -0
  191. package/dist/worker.js +345 -244
  192. package/dist/{workflow-BgwWq0nq.js → workflow-B7qx0Vv9.js} +1 -1
  193. package/package.json +37 -32
  194. package/wrangler.jsonc +2 -0
  195. package/dist/assets/assets/channel-BXwM62E-.js +0 -2
  196. package/dist/assets/assets/chunk-XXDRQBXY-C9Ka5KSI.js +0 -2
  197. package/dist/assets/assets/flowDiagram-IUGLLWBU-DXuTqLUd.js +0 -1
  198. package/dist/assets/assets/index-DdAdCxGc.js +0 -155
  199. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-aJTRXiIU.js +0 -9
  200. package/dist/assets/plugins/assets/base-C3j1WCCq.css +0 -2
  201. package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +0 -1
  202. package/dist/assets/plugins/slots/approval.3e4ea6e4-CqQk6XG_.js +0 -2
  203. package/dist/assets/plugins/slots/artifacts.84980c32-DQlO5IFk.js +0 -1
  204. package/dist/assets/plugins/slots/builtin-tools.16ef5e25-CZRYQVIP.js +0 -7
  205. package/dist/assets/plugins/slots/codemode.5f359b9c-Bzl_K_vt.js +0 -10
  206. package/dist/assets/plugins/slots/domain.832848c8-CvnpuKCY.js +0 -1
  207. package/dist/assets/plugins/slots/edit.7c802139-kaxIknZ-.js +0 -7
  208. package/dist/assets/plugins/slots/files.364f16c9-wuB8gcQA.js +0 -2
  209. package/dist/assets/plugins/slots/grep.d8bf9f57-3FnU8p-d.js +0 -1
  210. package/dist/assets/plugins/slots/log.07fd59a4-C0PXQ0O1.js +0 -4
  211. package/dist/assets/plugins/slots/prompts.9d9b47cc-xdCkNkoA.js +0 -3
  212. package/dist/assets/plugins/slots/read.926c024f-qqaxVlEX.js +0 -1
  213. package/dist/assets/plugins/slots/runner.5393fa6c-DfO2Z9HG.js +0 -8
  214. package/dist/assets/plugins/slots/skill.56c1cc07-CL_n-l4h.js +0 -4
  215. package/dist/assets/plugins/slots/vault.587549ba-DbG3F_on.js +0 -1
  216. package/dist/harnessState-gmzJcPGt.js +0 -88
  217. package/dist/harnessStore-C0Zwvny8.js +0 -1
  218. package/dist/majorModes-WXt22_km.js +0 -1
  219. package/dist/piSettings-tdui0CZI.js +0 -1
  220. package/dist/platform-yhQXrrM_.js +0 -16
  221. package/dist/platformFiles-DB3Cw1l_.js +0 -64
  222. package/dist/web-cN41ySs9.js +0 -3
@@ -0,0 +1,1256 @@
1
+ import { G as Null, V as String$1, Z as Literal, ar as defineServiceContract, bt as _Array_, et as Boolean$1, ht as Optional, ir as PO_SERVER_SCOPE_SERVICE, pt as _Object_, sr as requirePoServerScope, un as HOST_SLOT_METADATA, v as composeServerProviderOverrides, z as Union } from "./serverPlugin-CELT6P0Q.js";
2
+ import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-b33nSAAI.js";
3
+ import { n as Check } from "./value-_W31So3B.js";
4
+ import { n as defineTool } from "./pluginContributions-Be9EnCAW.js";
5
+ import { c as defineRoot, h as defineServerPlugin, l as defineRoute, n as composeRootInjects, t as composeRootHooks, u as defineRoutedContribution } from "./extensionFile-DNM4xsje.js";
6
+ import { n as readPackageResource, t as packageResourcePath } from "./index.edge-DyYmurS7.js";
7
+ import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-DQFmrosw.js";
8
+ import { n as readPoPackageHealth, r as readPoSelfImprove, t as PO_HELP_WHEN } from "./help-w6vVEZGL.js";
9
+ import { t as defineMinorMode } from "./modeDefinition-C3Zbrw48.js";
10
+ import { t as serverMinorModes } from "./exports-B0WMEXCP.js";
11
+ //#region ../../minor/po-help/src/services/brainSimulation/index.ts
12
+ const brainSimulationContracts = {
13
+ workspace: defineServiceContract("help/brain-simulation", { scope: "workspace" }),
14
+ session: defineServiceContract("help/brain-simulation", { scope: "session" })
15
+ };
16
+ function createBrainSimulation(scopeId) {
17
+ let enabled = false;
18
+ let disposed = false;
19
+ const check = (signal) => {
20
+ signal?.throwIfAborted();
21
+ if (disposed) throw new Error("Brain simulation scope is disposed.");
22
+ };
23
+ return {
24
+ scopeId,
25
+ simulation(signal) {
26
+ check(signal);
27
+ return { enabled };
28
+ },
29
+ setSimulation(value, signal) {
30
+ check(signal);
31
+ if (typeof value?.enabled !== "boolean") throw new Error("Simulation enabled must be a boolean.");
32
+ enabled = value.enabled;
33
+ return { enabled };
34
+ },
35
+ dispose() {
36
+ disposed = true;
37
+ }
38
+ };
39
+ }
40
+ async function brainSimulationProvider(context) {
41
+ await context.inject([PO_SERVER_SCOPE_SERVICE], async (injected) => {
42
+ const scope = requirePoServerScope(injected);
43
+ if (scope.level === "global") throw new Error("Brain simulation requires a workspace or session.");
44
+ const state = createBrainSimulation(scope.snapshot().scope.id);
45
+ try {
46
+ const release = await scope.provide(brainSimulationContracts[scope.level], state);
47
+ return async () => {
48
+ state.dispose();
49
+ await release();
50
+ };
51
+ } catch (error) {
52
+ state.dispose();
53
+ throw error;
54
+ }
55
+ });
56
+ }
57
+ //#endregion
58
+ //#region ../../minor/po-help/src/extensions/workspaces/(backend)/root.server.ts
59
+ var root_server_default$1 = defineRoot((context) => ({
60
+ value: void 0,
61
+ services: context.host.scope === "workspace" ? [brainSimulationProvider] : []
62
+ }));
63
+ //#endregion
64
+ //#region ../../minor/po-help/src/types/brainGraph.ts
65
+ const BRAIN_GRAPH_KINDS = [
66
+ "backend",
67
+ "web",
68
+ "native"
69
+ ];
70
+ const CODEMODE_SERVICE = "po/codemode";
71
+ const PLUMBING_SERVICES = /* @__PURE__ */ new Set([
72
+ "po/server-scope",
73
+ "po/server-host",
74
+ "po/headless-host",
75
+ "po/global-services"
76
+ ]);
77
+ function graphOf(nodes, links) {
78
+ const linked = new Set([...links.values()].flatMap((link) => [link.source, link.target]));
79
+ return {
80
+ nodes: [...nodes.values()].filter((node) => linked.has(node.id)).sort((a, b) => a.id.localeCompare(b.id)),
81
+ links: [...links.values()].sort((a, b) => `${a.source}\0${a.target}`.localeCompare(`${b.source}\0${b.target}`))
82
+ };
83
+ }
84
+ /**
85
+ * Public services, services a code-mode contributor can call (every service a plugin that injects
86
+ * po/codemode resolves), and the plugins that consume them. Nodes collapse by name across scopes.
87
+ * A nested fiber is an intermediary, so its injections fold into the plugin that owns it; unowned
88
+ * fibers, unresolved injections and scope plumbing are left out.
89
+ */
90
+ function backendGraph(snapshot) {
91
+ const plugins = new Map(snapshot.consumers.flatMap((consumer) => consumer.owner.kind === "package" && consumer.owner.packageName ? [[consumer.id, {
92
+ name: consumer.owner.packageName,
93
+ origin: consumer.owner.origin
94
+ }]] : []));
95
+ const services = new Map(snapshot.services.map((service) => [service.id, service]));
96
+ const uses = snapshot.edges.flatMap((edge) => {
97
+ const plugin = plugins.get(edge.consumer);
98
+ const service = edge.service === null ? void 0 : services.get(edge.service);
99
+ return plugin && service && !PLUMBING_SERVICES.has(service.name) ? [{
100
+ plugin,
101
+ service
102
+ }] : [];
103
+ });
104
+ const contributors = new Set(uses.filter((use) => use.service.name === CODEMODE_SERVICE).map((use) => use.plugin.name));
105
+ const reachable = new Set(uses.filter((use) => contributors.has(use.plugin.name)).map((use) => use.service.name));
106
+ const nodes = /* @__PURE__ */ new Map();
107
+ const links = /* @__PURE__ */ new Map();
108
+ for (const { plugin, service } of uses) {
109
+ if (!service.public && !reachable.has(service.name)) continue;
110
+ const serviceId = `service:${service.name}`;
111
+ const previous = nodes.get(serviceId);
112
+ if (!previous || service.description && previous.detail.endsWith("No description.")) nodes.set(serviceId, {
113
+ id: serviceId,
114
+ label: service.name,
115
+ role: reachable.has(service.name) ? "codemode" : "public",
116
+ detail: `${service.public ? "Public" : "Private"} service${reachable.has(service.name) ? ", callable from code mode" : ""}. Provided by ${service.owner.packageName ?? service.owner.kind}. ${service.description ?? "No description."}`
117
+ });
118
+ const pluginId = `plugin:${plugin.name}`;
119
+ nodes.set(pluginId, {
120
+ id: pluginId,
121
+ label: plugin.name,
122
+ role: plugin.origin === "personal" ? "personal" : "plugin",
123
+ detail: `Plugin${contributors.has(plugin.name) ? " that contributes to code mode" : ""}.`
124
+ });
125
+ links.set(`${pluginId}\0${serviceId}`, {
126
+ source: pluginId,
127
+ target: serviceId,
128
+ label: "consumes"
129
+ });
130
+ }
131
+ return graphOf(nodes, links);
132
+ }
133
+ /** Each plugin and the slots it fills or declares, for one client host. */
134
+ function clientGraph(packages, target, hostSlots = {}) {
135
+ const hostDescriptions = new Map(Object.values(hostSlots).map((slot) => [slot.slot, slot.description]));
136
+ const nodes = /* @__PURE__ */ new Map();
137
+ const links = /* @__PURE__ */ new Map();
138
+ const slot = (name, description) => {
139
+ const id = `slot:${name}`;
140
+ if (!nodes.has(id) || description) nodes.set(id, {
141
+ id,
142
+ label: name,
143
+ role: "slot",
144
+ detail: `Slot. ${description ?? hostDescriptions.get(name) ?? "No description."}`
145
+ });
146
+ return id;
147
+ };
148
+ for (const pkg of packages) {
149
+ const metadata = target === "web" ? pkg.web : pkg.native;
150
+ if (!metadata || !pkg.owner.packageName) continue;
151
+ const pluginId = `plugin:${pkg.owner.packageName}`;
152
+ nodes.set(pluginId, {
153
+ id: pluginId,
154
+ label: pkg.owner.packageName,
155
+ role: pkg.owner.origin === "personal" ? "personal" : "plugin",
156
+ detail: `Plugin with a ${target} half.`
157
+ });
158
+ for (const declared of metadata.slots) {
159
+ const slotId = slot(declared.name, declared.description);
160
+ links.set(`${pluginId}\0${slotId}`, {
161
+ source: pluginId,
162
+ target: slotId,
163
+ label: "declares"
164
+ });
165
+ }
166
+ for (const fill of metadata.fills) {
167
+ if (fill.slot === null) continue;
168
+ const slotId = slot(fill.slot);
169
+ links.set(`${pluginId}\0${slotId}`, {
170
+ source: pluginId,
171
+ target: slotId,
172
+ label: "fills"
173
+ });
174
+ }
175
+ }
176
+ return graphOf(nodes, links);
177
+ }
178
+ /** One essential graph. Web prefers the exact browser mount inventory; native reads installed packages. */
179
+ function brainGraph(snapshot, kind, hostSlots) {
180
+ if (kind === "backend") return backendGraph(snapshot);
181
+ return clientGraph(kind === "web" ? snapshot.clientPackages ?? snapshot.packages : snapshot.packages, kind, hostSlots);
182
+ }
183
+ /** A node and its direct connections in one graph, or undefined when the graph lacks it. */
184
+ function brainNodeView(graph, kind, id) {
185
+ const byId = new Map(graph.nodes.map((node) => [node.id, node]));
186
+ const node = byId.get(id);
187
+ if (!node) return void 0;
188
+ return {
189
+ kind,
190
+ node,
191
+ links: graph.links.flatMap((link) => link.source === id ? [{
192
+ label: link.label,
193
+ direction: "out",
194
+ node: byId.get(link.target)
195
+ }] : link.target === id ? [{
196
+ label: link.label,
197
+ direction: "in",
198
+ node: byId.get(link.source)
199
+ }] : [])
200
+ };
201
+ }
202
+ //#endregion
203
+ //#region ../../minor/po-help/src/services/brain/index.ts
204
+ function createBrain(options) {
205
+ const services = (signal) => {
206
+ signal?.throwIfAborted();
207
+ options.assertActive?.();
208
+ return structuredClone(options.scope.snapshot());
209
+ };
210
+ return {
211
+ services,
212
+ slots(signal) {
213
+ const snapshot = services(signal);
214
+ const diagnostics = [...snapshot.diagnostics];
215
+ const packages = snapshot.clientPackages ?? snapshot.packages;
216
+ if (snapshot.clientPackages === void 0) diagnostics.push("Coverage gap: browser mount inventory unavailable; only matching server installations are described.");
217
+ const slots = /* @__PURE__ */ new Map();
218
+ const fills = /* @__PURE__ */ new Map();
219
+ const globalScope = snapshot.scopes.find((scope) => scope.level === "global");
220
+ if (globalScope) for (const declaration of Object.values(HOST_SLOT_METADATA)) slots.set(`host\0${declaration.slot}`, {
221
+ id: `host:${declaration.slot}`,
222
+ name: declaration.slot,
223
+ scope: globalScope,
224
+ owner: {
225
+ kind: "host",
226
+ packageName: null,
227
+ origin: "unknown"
228
+ },
229
+ description: declaration.description,
230
+ parent: "parent" in declaration ? declaration.parent : null,
231
+ kind: declaration.kind
232
+ });
233
+ for (const scope of [...snapshot.scopes].reverse()) for (const pkg of packages) {
234
+ if (pkg.scope.id !== scope.id) continue;
235
+ const name = pkg.owner.packageName ?? `${pkg.owner.kind}:${pkg.scope.id}`;
236
+ if (pkg.web === null) {
237
+ diagnostics.push(`${name}: web metadata unavailable.`);
238
+ continue;
239
+ }
240
+ diagnostics.push(...pkg.web.diagnostics.map((message) => `${name}: ${message}`));
241
+ for (const declaration of pkg.web.slots) {
242
+ if (declaration.scope !== scope.level) continue;
243
+ slots.set(`${name}\0${declaration.name}`, {
244
+ id: `${name}:${declaration.name}`,
245
+ name: declaration.name,
246
+ scope,
247
+ owner: pkg.owner,
248
+ description: declaration.description ?? null,
249
+ parent: declaration.parent ?? null,
250
+ kind: declaration.kind
251
+ });
252
+ }
253
+ for (const declaration of pkg.web.fills) {
254
+ if (declaration.scope !== scope.level) continue;
255
+ fills.set(`${name}\0${declaration.slot}\0${declaration.id}`, {
256
+ ...declaration,
257
+ scope,
258
+ owner: pkg.owner
259
+ });
260
+ }
261
+ }
262
+ const values = [...slots.values()];
263
+ for (const slot of values) {
264
+ const visited = /* @__PURE__ */ new Set([slot.name]);
265
+ let parent = slot.parent;
266
+ while (parent !== null) {
267
+ if (visited.has(parent)) {
268
+ diagnostics.push(`Slot ${slot.name}: parent cycle at ${parent}.`);
269
+ break;
270
+ }
271
+ visited.add(parent);
272
+ const next = values.find((candidate) => candidate.name === parent && candidate.owner.packageName === slot.owner.packageName) ?? values.find((candidate) => candidate.name === parent);
273
+ if (!next) {
274
+ diagnostics.push(`Slot ${slot.name}: missing parent ${parent}.`);
275
+ break;
276
+ }
277
+ parent = next.parent;
278
+ }
279
+ }
280
+ const result = {
281
+ scope: snapshot.scope,
282
+ scopes: snapshot.scopes,
283
+ slots: values,
284
+ fills: [...fills.values()],
285
+ diagnostics: [...new Set(diagnostics)]
286
+ };
287
+ return structuredClone(result);
288
+ }
289
+ };
290
+ }
291
+ const DECLARATIONS$1 = `type Scope = { id: string; level: 'global' | 'workspace' | 'session' };
292
+ type Owner = { kind: 'host' | 'package' | 'unknown'; packageName: string | null; origin: 'po' | 'personal' | 'unknown' };
293
+ interface WebMetadata { version: 1; slots: { name: string; scope: Scope['level']; description?: string; parent?: string; kind: 'data' | 'component' }[]; fills: { id: string; slot: string | null; scope: Scope['level']; placement: 'verified' | 'unverified' }[]; diagnostics: string[] }
294
+ interface PackageMetadata { scope: Scope; owner: Owner; web: WebMetadata | null; native?: WebMetadata | null }
295
+ interface ServicesSnapshot { scope: Scope; scopes: Scope[]; packages: PackageMetadata[]; clientPackages?: PackageMetadata[]; services: { id: string; name: string; scope: Scope; visibleFrom: Scope; owner: Owner; public: boolean; description: string | null }[]; consumers: { id: string; name: string; scope: Scope; owner: Owner }[]; edges: { consumer: string; service: string | null; name: string; status: 'resolved' | 'waiting' }[]; diagnostics: string[] }
296
+ interface SlotsSnapshot { scope: Scope; scopes: Scope[]; slots: { id: string; name: string; scope: Scope; owner: Owner; description: string | null; parent: string | null; kind: 'data' | 'component' }[]; fills: { id: string; slot: string | null; scope: Scope; owner: Owner; placement: 'verified' | 'unverified' }[]; diagnostics: string[] }
297
+ type GraphKind = 'backend' | 'web' | 'native';
298
+ type Role = 'public' | 'codemode' | 'plugin' | 'personal' | 'slot';
299
+ interface GraphNode { id: string; label: string; role: Role; detail: string }
300
+ /** backend: plugin -consumes-> service. web/native: plugin -fills|declares-> slot. */
301
+ interface Graph { kind: GraphKind; nodes: GraphNode[]; links: { source: string; target: string; label: string }[] }
302
+ interface NodeView { kind: GraphKind; node: GraphNode; links: { label: string; direction: 'out' | 'in'; node: GraphNode }[] }
303
+ declare const brain: {
304
+ /** The essential map the Brain page draws. Ids look like 'plugin:@scope/name', 'service:po/fs', 'slot:page'. */
305
+ graph(input?: { kind?: GraphKind }): Promise<Graph>;
306
+ /** One node and its direct links in every graph that has it, or only in kind. Empty when absent. */
307
+ node(input: { id: string; kind?: GraphKind }): Promise<NodeView[]>;
308
+ /** Raw snapshot with fibers, private services, waiting injections and diagnostics. */
309
+ services(): Promise<ServicesSnapshot>;
310
+ /** Raw web slot declarations, parent links and fill placements. */
311
+ slots(): Promise<SlotsSnapshot>;
312
+ };`;
313
+ function graphKind(value) {
314
+ if (value === void 0) return "backend";
315
+ if (BRAIN_GRAPH_KINDS.includes(value)) return value;
316
+ throw new Error(`kind must be one of ${BRAIN_GRAPH_KINDS.join(", ")}.`);
317
+ }
318
+ function input(value) {
319
+ if (value === void 0) return {};
320
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) return value;
321
+ throw new Error("Expected an options object.");
322
+ }
323
+ function createBrainNamespace(options) {
324
+ return {
325
+ name: "brain",
326
+ summary: "Explore the essential service and slot graphs (backend, web, native) and raw service and slot snapshots. Read-only, Help mode.",
327
+ declarations: DECLARATIONS$1,
328
+ bind(run) {
329
+ if (run.sessionId !== options.sessionId) throw new Error("The brain namespace belongs to another session.");
330
+ const check = () => {
331
+ run.signal.throwIfAborted();
332
+ options.assertActive();
333
+ };
334
+ return {
335
+ graph: async (options_) => {
336
+ check();
337
+ const kind = graphKind(input(options_).kind);
338
+ return {
339
+ kind,
340
+ ...brainGraph(options.service.services(run.signal), kind, HOST_SLOT_METADATA)
341
+ };
342
+ },
343
+ node: async (options_) => {
344
+ check();
345
+ const { id, kind } = input(options_);
346
+ if (typeof id !== "string" || !id.trim() || id.length > 1024) throw new Error("id must be a node id string.");
347
+ const snapshot = options.service.services(run.signal);
348
+ return (kind === void 0 ? BRAIN_GRAPH_KINDS : [graphKind(kind)]).flatMap((each) => {
349
+ const view = brainNodeView(brainGraph(snapshot, each, HOST_SLOT_METADATA), each, id);
350
+ return view ? [view] : [];
351
+ });
352
+ },
353
+ services: async () => {
354
+ check();
355
+ return options.service.services(run.signal);
356
+ },
357
+ slots: async () => {
358
+ check();
359
+ return options.service.slots(run.signal);
360
+ }
361
+ };
362
+ }
363
+ };
364
+ }
365
+ //#endregion
366
+ //#region ../../minor/po-help/src/constants/help.ts
367
+ const HELP_COMMAND_NAME = "po-help";
368
+ const HELP_COMMAND_DESCRIPTION = "Toggle Help guidance and read-only support diagnostics";
369
+ const HELP_MODE_ID = "help";
370
+ const HELP_PACKAGE_SOURCE = "@agimon-ai/po-help";
371
+ const HELP_SKILL = {
372
+ name: "help-how-to-help",
373
+ description: "Set up and debug Po agents using installed package guidance and scoped, read-only diagnostics. Diagnose missing capabilities before proposing authorized repairs."
374
+ };
375
+ const HELP_GUIDANCE = "Help mode is active. Read help-how-to-help, inspect the available diagnostics, and use the narrowest package guidance for the task. Diagnose before proposing changes. Help does not grant additional permissions.";
376
+ const HELP_STATUS_TOOL_NAME = "help_status";
377
+ const HELP_STATUS_TOOL_DESCRIPTION = "Inspect active Help skills, diagnostic tools, contributor ownership, and unavailable contributions in this session. Read-only; does not change selection or permissions.";
378
+ const HELP_CHATGPT_SKILL = {
379
+ name: "help-how-to-chatgpt-instructions",
380
+ description: "Print a paste-ready ChatGPT project instruction (at most 8,000 characters) that routes code-mode work through this session's MCP tools and condenses every AGENTS.md rule. Writes no files."
381
+ };
382
+ const HELP_CODEMODE_SKILL = {
383
+ name: "help-how-to-codemode-plugin",
384
+ description: "Add code-mode support to a Po package: contribute a namespace to exec and discover, replace the direct tool it supersedes, and ship the skill that teaches agents to use it."
385
+ };
386
+ const HELP_NATIVE_SKILL = {
387
+ name: "help-how-to-native-extension",
388
+ description: "Add or change a Po package's phone UI (.native files, native templates) so it mirrors the cockpit, passes the native build, and is approved and verified before it ships."
389
+ };
390
+ const HELP_DASHBOARD_SKILL = {
391
+ name: "help-how-to-dashboard-extension",
392
+ description: "Add plugin sections to Home and Workspace pages with dashboard-tiles on web and native. Choose global or workspace scope, supply tile presentation and navigation, and migrate legacy home-apps cards."
393
+ };
394
+ const HELP_SELF_IMPROVE_SKILL = {
395
+ name: "codemode-how-to-self-improve",
396
+ description: "Reload Po's own packages after you edit them, without restarting Po or reopening the session. Use in Help mode after changing a plugin's source or build, or after adding or removing a package."
397
+ };
398
+ const HELP_BRAIN_SKILL = {
399
+ name: "codemode-how-to-brain",
400
+ description: "Inspect scoped service ownership, declared dependencies and slot metadata in Help mode."
401
+ };
402
+ //#endregion
403
+ //#region ../../minor/po-help/src/schemas/diagnostics.ts
404
+ const helpStatusParameters = _Object_({}, { additionalProperties: false });
405
+ //#endregion
406
+ //#region ../../minor/po-help/src/services/helpStatus/index.ts
407
+ /** `packageFailures`: the host's failed global and workspace packages; they never degrade Help itself. */
408
+ function serverHelpStatus(snapshot, enabled, packageFailures = []) {
409
+ const entries = snapshot.capabilities.filter((entry) => entry.when?.state?.["minor-mode"] === HELP_MODE_ID);
410
+ const skills = entries.filter((entry) => entry.kind === "skill");
411
+ const tools = entries.filter((entry) => entry.kind === "tool");
412
+ const diagnostics = entries.filter((entry) => enabled && entry.reason && entry.reason !== "inactive").map((entry) => ({
413
+ source: entry.source,
414
+ code: `HELP_${entry.reason.replaceAll("-", "_").toUpperCase()}`
415
+ }));
416
+ const ready = snapshot.ready;
417
+ return {
418
+ activation: !enabled ? "inactive" : !ready ? "activating" : diagnostics.length ? "degraded" : "active",
419
+ ready,
420
+ revision: snapshot.revision,
421
+ counts: {
422
+ skills: ready ? skills.filter((entry) => entry.active && entry.discoverable).length : null,
423
+ tools: tools.filter((entry) => entry.active).length
424
+ },
425
+ skills: skills.slice(0, 128).map(({ name, source, active, discoverable, reason }) => ({
426
+ name,
427
+ source,
428
+ active: active && discoverable,
429
+ ...reason ? { reason } : {}
430
+ })),
431
+ tools: tools.slice(0, 128).map(({ name, source, active, reason }) => ({
432
+ name,
433
+ source,
434
+ active,
435
+ ...reason ? { reason } : {}
436
+ })),
437
+ diagnostics: diagnostics.slice(0, 128),
438
+ packages: enabled ? packageFailures.slice(-128) : [],
439
+ truncated: skills.length > 128 || tools.length > 128 || diagnostics.length > 128 || enabled && packageFailures.length > 128
440
+ };
441
+ }
442
+ function helpStatusDetail(report) {
443
+ return `${report.counts.skills ?? "pending"} Help skills, ${report.counts.tools} diagnostic tools${report.diagnostics.length ? " (diagnostics available)" : ""}`;
444
+ }
445
+ function createHelpStatusTool(inspect, authorize) {
446
+ return defineTool({
447
+ name: HELP_STATUS_TOOL_NAME,
448
+ description: HELP_STATUS_TOOL_DESCRIPTION,
449
+ parameters: helpStatusParameters,
450
+ when: PO_HELP_WHEN,
451
+ promptGuidelines: [HELP_GUIDANCE],
452
+ async execute(_input, execution) {
453
+ const signal = authorize(execution.signal);
454
+ const report = await inspect();
455
+ signal.throwIfAborted();
456
+ authorize(execution.signal);
457
+ return {
458
+ content: [{
459
+ type: "text",
460
+ text: JSON.stringify(report, null, 2)
461
+ }],
462
+ details: report
463
+ };
464
+ }
465
+ });
466
+ }
467
+ //#endregion
468
+ //#region ../../minor/po-help/src/services/selfImproveNamespace/index.ts
469
+ /** Finished operations kept for `operation(id)`; older ones are forgotten first. */
470
+ const MAX_OPERATIONS = 20;
471
+ const SCOPES = [
472
+ "session",
473
+ "workspace",
474
+ "global"
475
+ ];
476
+ const AXES = [
477
+ "majorMode",
478
+ "domains",
479
+ "profile"
480
+ ];
481
+ const OUTCOME_MESSAGE_TYPE = "po-help/self-improve";
482
+ /** One line the agent can pass on to the person without calling operation(). */
483
+ function describeOutcome(operation) {
484
+ const what = operation.axes ? `Refresh ${operation.operationId} (${operation.axes.join(", ")})` : `Reload ${operation.operationId} (${operation.scope} scope)`;
485
+ const tell = "Tell the person the outcome.";
486
+ if (operation.state === "failed") return `${what} failed, nothing changed: ${(operation.error ?? "unknown error").replace(/\.$/u, "")}. ${tell}`;
487
+ const result = operation.result;
488
+ const parts = [
489
+ result?.installed.length ? `installed ${result.installed.join(", ")}` : "",
490
+ result?.removed.length ? `removed ${result.removed.join(", ")}` : "",
491
+ result?.failed.length ? `failed ${result.failed.map((item) => `${item.packageName} (${item.reason})`).join(", ")}, which keep their previous build` : ""
492
+ ].filter(Boolean);
493
+ return `${what} ${operation.state}${parts.length ? `: ${parts.join("; ")}` : ""}. ${tell}`;
494
+ }
495
+ const DECLARATIONS = `type Scope = 'session' | 'workspace' | 'global';
496
+ type Axis = 'majorMode' | 'domains' | 'profile';
497
+ interface PackageFailure { scope: string; packageName: string; stage: string; reason: string; previous?: 'restored' | 'lost' | 'none'; at: string }
498
+ interface Operation {
499
+ operationId: string; scope: Scope; axes?: Axis[];
500
+ /** partial: applied, but some packages failed and keep their previous build when they had one. */
501
+ state: 'queued' | 'applied' | 'partial' | 'failed';
502
+ result?: { installed: string[]; removed: string[]; failed: { packageName: string; reason: string }[] };
503
+ error?: string;
504
+ /** Why the outcome follow-up could not reach you, when it did not. */
505
+ undelivered?: string;
506
+ }
507
+ declare const selfImprove: {
508
+ /** Packages whose current build failed to load or install, by scope. */
509
+ plugins(): Promise<{ failures: PackageFailure[] }>;
510
+ /** Queues a reload of one scope's packages from disk. When it finishes you get a follow-up message with the outcome; operation() returns it too. global needs confirm: true, after the person agreed. */
511
+ reload(input: { scope: Scope; confirm?: boolean }): Promise<Operation>;
512
+ /** Queues a re-apply of this session's current major mode, domains or profile (default: all three) after editing their config; reports its outcome like reload. */
513
+ refresh(input?: { axes?: Axis[] }): Promise<Operation>;
514
+ operation(operationId: string): Promise<Operation>;
515
+ };`;
516
+ function createSelfImproveNamespace(options) {
517
+ const operations = /* @__PURE__ */ new Map();
518
+ let next = 0;
519
+ const remember = (operation) => {
520
+ operations.set(operation.operationId, operation);
521
+ for (const id of operations.keys()) {
522
+ if (operations.size <= MAX_OPERATIONS) break;
523
+ if (operations.get(id)?.state !== "queued") operations.delete(id);
524
+ }
525
+ return operation;
526
+ };
527
+ const finish = (operation) => {
528
+ remember(operation);
529
+ Promise.resolve(options.admitMessage?.({
530
+ type: OUTCOME_MESSAGE_TYPE,
531
+ text: describeOutcome(operation),
532
+ display: true
533
+ }, "followUp")).catch((error) => {
534
+ remember({
535
+ ...operation,
536
+ undelivered: error instanceof Error ? error.message : String(error)
537
+ });
538
+ });
539
+ };
540
+ return {
541
+ name: "selfImprove",
542
+ summary: "Reload Po's own packages after editing them, or refresh this session's mode, domains and profile config, without restarting. Help mode, main agent only.",
543
+ declarations: DECLARATIONS,
544
+ bind(run) {
545
+ if (run.sessionId !== options.sessionId) throw new Error("The selfImprove namespace belongs to another session.");
546
+ const check = () => {
547
+ run.signal.throwIfAborted();
548
+ options.assertActive();
549
+ if (run.caller !== "main") throw new Error("Only the main agent may reload or refresh Po.");
550
+ };
551
+ return {
552
+ plugins: async () => {
553
+ check();
554
+ return { failures: JSON.parse(JSON.stringify(options.failures())) };
555
+ },
556
+ reload: async (input) => {
557
+ check();
558
+ const { scope, confirm } = input ?? {};
559
+ if (!SCOPES.includes(scope)) throw new Error("reload needs scope 'session', 'workspace' or 'global'.");
560
+ if (scope === "global" && confirm !== true) throw new Error("A global reload changes every session; ask the person, then pass confirm: true.");
561
+ const operationId = `reload-${String(++next)}`;
562
+ const queued = remember({
563
+ operationId,
564
+ scope,
565
+ state: "queued"
566
+ });
567
+ options.service.reload({
568
+ scope: queued.scope,
569
+ sessionId: options.sessionId
570
+ }).then((result) => finish({
571
+ ...queued,
572
+ state: result.failed.length === 0 ? "applied" : "partial",
573
+ result: JSON.parse(JSON.stringify(result))
574
+ }), (error) => finish({
575
+ ...queued,
576
+ state: "failed",
577
+ error: error instanceof Error ? error.message : String(error)
578
+ }));
579
+ return { ...queued };
580
+ },
581
+ refresh: async (input) => {
582
+ check();
583
+ const { axes = AXES } = input ?? {};
584
+ if (!Array.isArray(axes) || axes.length === 0 || !axes.every((axis) => AXES.includes(axis))) throw new Error("refresh axes are 'majorMode', 'domains' and 'profile'.");
585
+ const queued = remember({
586
+ operationId: `refresh-${String(++next)}`,
587
+ scope: "session",
588
+ axes: [...new Set(axes)],
589
+ state: "queued"
590
+ });
591
+ options.service.refresh({
592
+ sessionId: options.sessionId,
593
+ axes: queued.axes
594
+ }).then(() => finish({
595
+ ...queued,
596
+ state: "applied"
597
+ }), (error) => finish({
598
+ ...queued,
599
+ state: "failed",
600
+ error: error instanceof Error ? error.message : String(error)
601
+ }));
602
+ return JSON.parse(JSON.stringify(queued));
603
+ },
604
+ operation: async (operationId) => {
605
+ check();
606
+ const operation = typeof operationId === "string" ? operations.get(operationId) : void 0;
607
+ if (operation === void 0) throw new Error(`No operation '${String(operationId)}'.`);
608
+ return JSON.parse(JSON.stringify(operation));
609
+ }
610
+ };
611
+ }
612
+ };
613
+ }
614
+ //#endregion
615
+ //#region ../../minor/po-help/src/services/helpServerSession/index.ts
616
+ function createHelpServerSession(host, packageFailures = () => [], selfImprove, brain) {
617
+ let modeOwner;
618
+ let pending;
619
+ let failure;
620
+ let generation = 0;
621
+ let disposed = false;
622
+ const active = () => (host.context.selection.state?.["minor-mode"] ?? []).includes(HELP_MODE_ID);
623
+ const inspect = () => serverHelpStatus(host.inspectCapabilities(), active(), packageFailures());
624
+ const modeState = () => {
625
+ const report = inspect();
626
+ return {
627
+ activation: pending === true ? "activating" : active() ? "active" : "inactive",
628
+ condition: pending !== void 0 || !report.ready ? "queued" : failure ? "failed" : report.activation === "degraded" ? "degraded" : "ready",
629
+ ...pending !== void 0 ? { detail: "applying Help capabilities" } : failure ? { detail: failure } : active() ? { detail: helpStatusDetail(report) } : {},
630
+ actions: [{
631
+ id: "activate",
632
+ enabled: !active() && pending === void 0,
633
+ ...!active() && pending === void 0 ? {} : { disabledReason: "Help is active or changing." }
634
+ }, {
635
+ id: "deactivate",
636
+ enabled: active() || pending === true,
637
+ ...active() || pending === true ? {} : { disabledReason: "Help mode is not active." }
638
+ }]
639
+ };
640
+ };
641
+ const resources = [
642
+ {
643
+ when: PO_HELP_WHEN,
644
+ name: "po-help",
645
+ kind: "context",
646
+ read: () => HELP_GUIDANCE
647
+ },
648
+ {
649
+ when: PO_HELP_WHEN,
650
+ ...HELP_SKILL,
651
+ kind: "skill",
652
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-help/SKILL.md"),
653
+ read: async () => {
654
+ const text = await readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-help/SKILL.md");
655
+ if (!text.trim()) throw new Error("The installed Help skill is missing or unreadable.");
656
+ return text;
657
+ }
658
+ },
659
+ {
660
+ when: PO_HELP_WHEN,
661
+ ...HELP_CHATGPT_SKILL,
662
+ kind: "skill",
663
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-chatgpt-instructions/SKILL.md"),
664
+ read: async () => {
665
+ const text = await readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-chatgpt-instructions/SKILL.md");
666
+ if (!text.trim()) throw new Error("The installed ChatGPT instruction skill is missing or unreadable.");
667
+ return text;
668
+ }
669
+ },
670
+ {
671
+ when: PO_HELP_WHEN,
672
+ ...HELP_NATIVE_SKILL,
673
+ kind: "skill",
674
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-native-extension/SKILL.md"),
675
+ read: async () => {
676
+ const text = await readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-native-extension/SKILL.md");
677
+ if (!text.trim()) throw new Error("The installed native extension skill is missing or unreadable.");
678
+ return text;
679
+ }
680
+ },
681
+ {
682
+ when: PO_HELP_WHEN,
683
+ ...HELP_CODEMODE_SKILL,
684
+ kind: "skill",
685
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-codemode-plugin/SKILL.md"),
686
+ read: async () => {
687
+ const text = await readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-codemode-plugin/SKILL.md");
688
+ if (!text.trim()) throw new Error("The installed code-mode plugin skill is missing or unreadable.");
689
+ return text;
690
+ }
691
+ },
692
+ ...brain ? [{
693
+ when: PO_HELP_WHEN,
694
+ ...HELP_BRAIN_SKILL,
695
+ kind: "skill",
696
+ pinned: true,
697
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/codemode-how-to-brain/SKILL.md"),
698
+ read: () => readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/codemode-how-to-brain/SKILL.md")
699
+ }] : [],
700
+ ...selfImprove === void 0 ? [] : [{
701
+ when: PO_HELP_WHEN,
702
+ ...HELP_SELF_IMPROVE_SKILL,
703
+ kind: "skill",
704
+ pinned: true,
705
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/codemode-how-to-self-improve/SKILL.md"),
706
+ read: () => readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/codemode-how-to-self-improve/SKILL.md")
707
+ }],
708
+ {
709
+ when: PO_HELP_WHEN,
710
+ ...HELP_DASHBOARD_SKILL,
711
+ kind: "skill",
712
+ path: packageResourcePath("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-dashboard-extension/SKILL.md"),
713
+ read: async () => {
714
+ const text = await readPackageResource("bundle:///po-help/src/services/helpServerSession/index.ts", "src/prompts/help-how-to-dashboard-extension/SKILL.md");
715
+ if (!text.trim()) throw new Error("The installed dashboard extension skill is missing or unreadable.");
716
+ return text;
717
+ }
718
+ }
719
+ ];
720
+ const selectMode = async (enabled, signal) => {
721
+ if (disposed) throw new Error("Help runtime is disposed.");
722
+ signal?.throwIfAborted();
723
+ const operation = ++generation;
724
+ pending = enabled;
725
+ failure = void 0;
726
+ modeOwner?.publish();
727
+ try {
728
+ if (enabled) await resources[1].read(host.context);
729
+ signal?.throwIfAborted();
730
+ if (operation !== generation || disposed) throw new Error("Help activation was cancelled.");
731
+ const modes = (host.context.selection.state?.["minor-mode"] ?? []).filter((mode) => mode !== HELP_MODE_ID);
732
+ await host.changeSelection({
733
+ axis: "state",
734
+ key: "minor-mode",
735
+ values: enabled ? [...modes, HELP_MODE_ID] : modes
736
+ });
737
+ } catch (error) {
738
+ if (operation === generation) failure = (error instanceof Error ? error.message : String(error)).slice(0, 160);
739
+ throw error;
740
+ } finally {
741
+ if (operation === generation) {
742
+ pending = void 0;
743
+ modeOwner?.publish();
744
+ }
745
+ }
746
+ };
747
+ const command = {
748
+ name: HELP_COMMAND_NAME,
749
+ description: HELP_COMMAND_DESCRIPTION,
750
+ async execute(_args, execution) {
751
+ await selectMode(!(pending ?? active()));
752
+ await execution.client.notify({
753
+ title: "Po Help",
754
+ body: active() ? "Help mode activated." : "Help mode deactivated.",
755
+ level: "info"
756
+ });
757
+ }
758
+ };
759
+ modeOwner = defineMinorMode({
760
+ descriptor: {
761
+ source: HELP_PACKAGE_SOURCE,
762
+ id: HELP_MODE_ID,
763
+ label: "Help",
764
+ description: "Package guidance and read-only diagnostics for agent setup and debugging.",
765
+ order: 50,
766
+ actions: [{
767
+ id: "activate",
768
+ label: "Activate",
769
+ description: "Expose Help guidance and diagnostic tools.",
770
+ contexts: ["headless"],
771
+ parameters: []
772
+ }, {
773
+ id: "deactivate",
774
+ label: "Deactivate",
775
+ description: "Withdraw Help-only guidance and diagnostic tools.",
776
+ contexts: ["headless"],
777
+ parameters: []
778
+ }]
779
+ },
780
+ state: modeState,
781
+ async handleAction(_runtime, actionId, _argumentsValue, { signal }) {
782
+ if (actionId !== "activate" && actionId !== "deactivate") throw new Error(`Unknown Help mode action: ${actionId}`);
783
+ await selectMode(actionId === "activate", signal);
784
+ return { message: active() ? "Help mode activated." : "Help mode deactivated." };
785
+ }
786
+ }).createOwner(void 0);
787
+ const assertHelpActive = () => {
788
+ host.assertActive(HELP_PACKAGE_SOURCE);
789
+ if (disposed || !active()) throw new Error("Help mode is not active.");
790
+ };
791
+ const selfImproveService = (cordis) => {
792
+ cordis.inject([PO_CODEMODE_SERVICE], (scoped) => {
793
+ const codemode = readPoCodemode(scoped);
794
+ if (!codemode || !selfImprove) return void 0;
795
+ const namespace = createSelfImproveNamespace({
796
+ sessionId: host.context.sessionId,
797
+ service: selfImprove,
798
+ failures: packageFailures,
799
+ assertActive: assertHelpActive,
800
+ admitMessage: host.context.session.admitMessage?.bind(host.context.session)
801
+ });
802
+ const activity = host.registerActivity({
803
+ when: PO_HELP_WHEN,
804
+ name: "selfImprove",
805
+ start: () => {
806
+ const registration = codemode.register(HELP_PACKAGE_SOURCE, namespace);
807
+ return () => registration.dispose();
808
+ }
809
+ });
810
+ return () => activity.dispose();
811
+ });
812
+ };
813
+ const brainService = (cordis) => {
814
+ cordis.inject([PO_CODEMODE_SERVICE], (scoped) => {
815
+ const codemode = readPoCodemode(scoped);
816
+ if (!codemode || !brain) return void 0;
817
+ const namespace = createBrainNamespace({
818
+ sessionId: host.context.sessionId,
819
+ service: brain,
820
+ assertActive: assertHelpActive
821
+ });
822
+ const activity = host.registerActivity({
823
+ when: PO_HELP_WHEN,
824
+ name: "brain",
825
+ start: () => {
826
+ const registration = codemode.register(HELP_PACKAGE_SOURCE, namespace);
827
+ return () => registration.dispose();
828
+ }
829
+ });
830
+ return () => activity.dispose();
831
+ });
832
+ };
833
+ return {
834
+ services: [
835
+ serverMinorModes([modeOwner]),
836
+ ...selfImprove ? [selfImproveService] : [],
837
+ ...brain ? [brainService] : []
838
+ ],
839
+ resources,
840
+ commands: [command],
841
+ tools: [createHelpStatusTool(inspect, (signal) => {
842
+ signal?.throwIfAborted();
843
+ host.assertActive(HELP_PACKAGE_SOURCE);
844
+ if (disposed || !active()) throw new Error("Help mode is not active.");
845
+ return signal ?? new AbortController().signal;
846
+ })],
847
+ onDispose() {
848
+ disposed = true;
849
+ generation += 1;
850
+ }
851
+ };
852
+ }
853
+ //#endregion
854
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/_lib/runtime.server.ts
855
+ var runtime_server_default = (async ({ agent, context }) => {
856
+ if (!agent) return {};
857
+ let brain;
858
+ await context.inject([PO_SERVER_SCOPE_SERVICE], (injected) => {
859
+ let disposed = false;
860
+ brain = createBrain({
861
+ scope: requirePoServerScope(injected),
862
+ assertActive() {
863
+ if (disposed) throw new Error("Brain scope is disposed.");
864
+ }
865
+ });
866
+ return () => {
867
+ disposed = true;
868
+ brain = void 0;
869
+ };
870
+ }).await();
871
+ if (!brain) throw new Error("Brain scope is unavailable.");
872
+ return createHelpServerSession(agent, () => readPoPackageHealth(context)?.failures() ?? [], readPoSelfImprove(context), brain);
873
+ });
874
+ //#endregion
875
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/root.server.ts
876
+ var root_server_default = defineRoot(async (context) => {
877
+ const value = await runtime_server_default(context);
878
+ return {
879
+ value,
880
+ services: [brainSimulationProvider, ...value.services ?? []],
881
+ activities: value.activities,
882
+ onStart: value.onStart,
883
+ onStop: value.onStop,
884
+ onDispose: value.onDispose
885
+ };
886
+ });
887
+ //#endregion
888
+ //#region ../../minor/po-help/src/schemas/apiContracts.ts
889
+ const level = Union([
890
+ Literal("global"),
891
+ Literal("workspace"),
892
+ Literal("session")
893
+ ]);
894
+ const scope = _Object_({
895
+ id: String$1(),
896
+ level
897
+ });
898
+ const nullableString = Union([String$1(), Null()]);
899
+ const owner = _Object_({
900
+ kind: Union([
901
+ Literal("host"),
902
+ Literal("package"),
903
+ Literal("unknown")
904
+ ]),
905
+ packageName: nullableString,
906
+ origin: Union([
907
+ Literal("po"),
908
+ Literal("personal"),
909
+ Literal("unknown")
910
+ ])
911
+ });
912
+ const kind = Union([Literal("data"), Literal("component")]);
913
+ const placement = Union([Literal("verified"), Literal("unverified")]);
914
+ const web = _Object_({
915
+ version: Literal(1),
916
+ slots: _Array_(_Object_({
917
+ name: String$1(),
918
+ scope: level,
919
+ description: Optional(String$1()),
920
+ parent: Optional(String$1()),
921
+ kind
922
+ })),
923
+ fills: _Array_(_Object_({
924
+ id: String$1(),
925
+ slot: nullableString,
926
+ scope: level,
927
+ placement
928
+ })),
929
+ diagnostics: _Array_(String$1())
930
+ });
931
+ const base = {
932
+ scope,
933
+ scopes: _Array_(scope),
934
+ diagnostics: _Array_(String$1())
935
+ };
936
+ const services = _Object_({
937
+ ...base,
938
+ packages: _Array_(_Object_({
939
+ scope,
940
+ owner,
941
+ web: Union([web, Null()])
942
+ })),
943
+ clientPackages: Optional(_Array_(_Object_({
944
+ scope,
945
+ owner,
946
+ web: Union([web, Null()])
947
+ }))),
948
+ services: _Array_(_Object_({
949
+ id: String$1(),
950
+ name: String$1(),
951
+ scope,
952
+ visibleFrom: scope,
953
+ owner,
954
+ public: Boolean$1(),
955
+ description: nullableString
956
+ })),
957
+ consumers: _Array_(_Object_({
958
+ id: String$1(),
959
+ name: String$1(),
960
+ scope,
961
+ owner
962
+ })),
963
+ edges: _Array_(_Object_({
964
+ consumer: String$1(),
965
+ service: nullableString,
966
+ name: String$1(),
967
+ status: Union([Literal("resolved"), Literal("waiting")])
968
+ }))
969
+ });
970
+ const slots = _Object_({
971
+ ...base,
972
+ slots: _Array_(_Object_({
973
+ id: String$1(),
974
+ name: String$1(),
975
+ scope,
976
+ owner,
977
+ description: nullableString,
978
+ parent: nullableString,
979
+ kind
980
+ })),
981
+ fills: _Array_(_Object_({
982
+ id: String$1(),
983
+ slot: nullableString,
984
+ scope,
985
+ owner,
986
+ placement
987
+ }))
988
+ });
989
+ const brainSimulationSchema = _Object_({ enabled: Boolean$1() }, { additionalProperties: false });
990
+ defineApiContract({
991
+ version: 1,
992
+ sockets: [],
993
+ dynamic: [],
994
+ http: [...["workspace", "session"].flatMap((scope) => [{
995
+ id: `brain.${scope}.simulation`,
996
+ scope,
997
+ basePath: "brain",
998
+ path: "/simulation",
999
+ method: "GET",
1000
+ authentication: "owner",
1001
+ description: "Read this exact scope simulation toggle.",
1002
+ responses: jsonApiResponses(brainSimulationSchema)
1003
+ }, {
1004
+ id: `brain.${scope}.setSimulation`,
1005
+ scope,
1006
+ basePath: "brain",
1007
+ path: "/simulation",
1008
+ method: "PUT",
1009
+ authentication: "owner",
1010
+ description: "Set this exact scope simulation toggle without persistence or inheritance.",
1011
+ body: {
1012
+ required: true,
1013
+ contentType: "application/json",
1014
+ schema: brainSimulationSchema
1015
+ },
1016
+ responses: jsonApiResponses(brainSimulationSchema)
1017
+ }]), ...[
1018
+ "global",
1019
+ "workspace",
1020
+ "session"
1021
+ ].flatMap((scope) => [{
1022
+ id: `brain.${scope}.services`,
1023
+ scope,
1024
+ basePath: "brain",
1025
+ path: "/services",
1026
+ method: "GET",
1027
+ authentication: "owner",
1028
+ description: "Read this exact scope and its ancestry service graph.",
1029
+ responses: jsonApiResponses(services)
1030
+ }, {
1031
+ id: `brain.${scope}.slots`,
1032
+ scope,
1033
+ basePath: "brain",
1034
+ path: "/slots",
1035
+ method: "GET",
1036
+ authentication: "owner",
1037
+ description: "Read host slots and metadata from this exact admitted browser mount and its ancestry, with explicit coverage diagnostics for older hosts.",
1038
+ responses: jsonApiResponses(slots)
1039
+ }])]
1040
+ });
1041
+ //#endregion
1042
+ //#region ../../minor/po-help/src/types/apiRoutes.ts
1043
+ const brainRoutes = {
1044
+ simulation: {
1045
+ method: "GET",
1046
+ path: "/simulation",
1047
+ response: void 0
1048
+ },
1049
+ setSimulation: {
1050
+ method: "PUT",
1051
+ path: "/simulation",
1052
+ response: void 0
1053
+ },
1054
+ services: {
1055
+ method: "GET",
1056
+ path: "/services",
1057
+ response: void 0
1058
+ },
1059
+ slots: {
1060
+ method: "GET",
1061
+ path: "/slots",
1062
+ response: void 0
1063
+ }
1064
+ };
1065
+ //#endregion
1066
+ //#region ../../minor/po-help/src/services/brainApi/index.ts
1067
+ function createBrainApi(service, simulation) {
1068
+ return {
1069
+ basePath: "brain",
1070
+ start() {
1071
+ let closed = false;
1072
+ return {
1073
+ fetch(request) {
1074
+ request.signal.throwIfAborted();
1075
+ if (closed) throw new Error("Brain API is closed.");
1076
+ if (new URL(request.url).pathname === brainRoutes.simulation.path) {
1077
+ if (request.method !== "GET" && request.method !== "PUT") return new Response(null, { status: 405 });
1078
+ const state = simulation?.();
1079
+ if (!state) return new Response("Simulation is unavailable for this scope.", { status: 409 });
1080
+ if (request.method === "GET") return Response.json(state.simulation(request.signal));
1081
+ return (async () => {
1082
+ let body;
1083
+ try {
1084
+ body = await request.json();
1085
+ } catch {
1086
+ request.signal.throwIfAborted();
1087
+ if (closed) throw new Error("Brain API is closed.");
1088
+ return new Response("Invalid JSON body.", { status: 400 });
1089
+ }
1090
+ request.signal.throwIfAborted();
1091
+ if (closed) throw new Error("Brain API is closed.");
1092
+ if (simulation?.() !== state) throw new Error("Brain simulation scope is unavailable or disposed.");
1093
+ if (!Check(brainSimulationSchema, body)) return new Response("Expected {enabled:boolean}.", { status: 400 });
1094
+ return Response.json(state.setSimulation({ enabled: body.enabled }, request.signal));
1095
+ })();
1096
+ }
1097
+ if (request.method !== "GET") return new Response(null, { status: 405 });
1098
+ switch (new URL(request.url).pathname) {
1099
+ case brainRoutes.services.path: return Response.json(service.services(request.signal));
1100
+ case brainRoutes.slots.path: return Response.json(service.slots(request.signal));
1101
+ default: return new Response(null, { status: 404 });
1102
+ }
1103
+ },
1104
+ close() {
1105
+ closed = true;
1106
+ }
1107
+ };
1108
+ }
1109
+ };
1110
+ }
1111
+ /** Each routed mount reads its own scope, never a captured session or a parent API root. */
1112
+ function brainApiForScope(context) {
1113
+ let service;
1114
+ let readSimulation;
1115
+ context.context.inject([PO_SERVER_SCOPE_SERVICE], (injected) => {
1116
+ const scope = requirePoServerScope(injected);
1117
+ service = createBrain({ scope });
1118
+ readSimulation = () => {
1119
+ if (scope.level === "global") return void 0;
1120
+ const state = scope.resolve(brainSimulationContracts[scope.level]);
1121
+ return state?.scopeId === scope.snapshot().scope.id ? state : void 0;
1122
+ };
1123
+ return () => {
1124
+ service = void 0;
1125
+ readSimulation = void 0;
1126
+ };
1127
+ });
1128
+ return createBrainApi({
1129
+ services(signal) {
1130
+ if (!service) throw new Error("Brain scope is unavailable or disposed.");
1131
+ return service.services(signal);
1132
+ },
1133
+ slots(signal) {
1134
+ if (!service) throw new Error("Brain scope is unavailable or disposed.");
1135
+ return service.slots(signal);
1136
+ }
1137
+ }, () => {
1138
+ if (!service) throw new Error("Brain scope is unavailable or disposed.");
1139
+ return readSimulation?.();
1140
+ });
1141
+ }
1142
+ //#endregion
1143
+ //#region ../../minor/po-help/src/extensions/(backend)/api/brain/route.server.ts
1144
+ var route_server_default$2 = defineRoute(brainApiForScope);
1145
+ //#endregion
1146
+ //#region ../../minor/po-help/src/extensions/workspaces/(backend)/api/brain/route.server.ts
1147
+ var route_server_default$1 = defineRoute(brainApiForScope);
1148
+ //#endregion
1149
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/api/brain/route.server.ts
1150
+ var route_server_default = defineRoute(brainApiForScope);
1151
+ //#endregion
1152
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/command/po-help.server.ts
1153
+ var po_help_server_default$1 = defineRoutedContribution((context) => context.root.commands?.[0], { cardinality: "optional" });
1154
+ //#endregion
1155
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-brain.server.ts
1156
+ var codemode_how_to_brain_server_default = defineRoutedContribution((context) => context.root.resources?.find((resource) => resource.name === "codemode-how-to-brain"), { cardinality: "optional" });
1157
+ //#endregion
1158
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-self-improve.server.ts
1159
+ var codemode_how_to_self_improve_server_default = defineRoutedContribution((context) => context.root.resources?.find((resource) => resource.name === "codemode-how-to-self-improve"), { cardinality: "optional" });
1160
+ //#endregion
1161
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-develop-codemode-plugin.server.ts
1162
+ var po_develop_codemode_plugin_server_default = defineRoutedContribution((context) => context.root.resources?.[4], { cardinality: "optional" });
1163
+ //#endregion
1164
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-develop-dashboard-extension.server.ts
1165
+ var po_develop_dashboard_extension_server_default = defineRoutedContribution((context) => context.root.resources?.find((resource) => resource.name === "help-how-to-dashboard-extension"), { cardinality: "optional" });
1166
+ //#endregion
1167
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-develop-native-extension.server.ts
1168
+ var po_develop_native_extension_server_default = defineRoutedContribution((context) => context.root.resources?.[3], { cardinality: "optional" });
1169
+ //#endregion
1170
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-help.server.ts
1171
+ var po_help_server_default = defineRoutedContribution((context) => context.root.resources?.[0], { cardinality: "optional" });
1172
+ //#endregion
1173
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-use-chatgpt-instructions.server.ts
1174
+ var po_use_chatgpt_instructions_server_default = defineRoutedContribution((context) => context.root.resources?.[2], { cardinality: "optional" });
1175
+ //#endregion
1176
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/resource/po-use-help.server.ts
1177
+ var po_use_help_server_default = defineRoutedContribution((context) => context.root.resources?.[1], { cardinality: "optional" });
1178
+ //#endregion
1179
+ //#region ../../minor/po-help/src/extensions/workspaces/sessions/(backend)/tool/help_status.server.ts
1180
+ var help_status_server_default = defineRoutedContribution((context) => context.root.tools?.[0], { cardinality: "optional" });
1181
+ //#endregion
1182
+ //#region ../../minor/po-help/generated/server.ts
1183
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
1184
+ /* v8 ignore next -- generated normalization branch */
1185
+ const defined = (values) => values.filter((value) => value !== void 0);
1186
+ const via = (identity, value) => value === void 0 ? void 0 : {
1187
+ ...identity,
1188
+ ...value
1189
+ };
1190
+ const serverPlugin = defineServerPlugin({
1191
+ name: "@agimon-ai/po-help",
1192
+ providerOverrides: composeServerProviderOverrides(root_server_default$1, root_server_default),
1193
+ injects: composeRootInjects({
1194
+ workspace: [root_server_default$1],
1195
+ session: [root_server_default$1, root_server_default]
1196
+ }),
1197
+ global: (context) => ({ get api() {
1198
+ return [at(route_server_default$2, context)];
1199
+ } }),
1200
+ workspace: async (context) => {
1201
+ const scopeWorkspace = await context.scopeRoot("workspace", root_server_default$1, context);
1202
+ const contextWorkspace = {
1203
+ ...context,
1204
+ root: scopeWorkspace.value
1205
+ };
1206
+ return {
1207
+ ...composeRootHooks(scopeWorkspace),
1208
+ get api() {
1209
+ return [at(route_server_default$1, contextWorkspace)];
1210
+ },
1211
+ services: [...scopeWorkspace.services ?? []]
1212
+ };
1213
+ },
1214
+ session: async (context) => {
1215
+ const scopeWorkspace = await context.scopeRoot("workspace", root_server_default$1, context);
1216
+ const contextWorkspace = {
1217
+ ...context,
1218
+ root: scopeWorkspace.value
1219
+ };
1220
+ const scopeSession = await context.scopeRoot("session", root_server_default, contextWorkspace);
1221
+ const contextSession = {
1222
+ ...contextWorkspace,
1223
+ root: scopeSession.value
1224
+ };
1225
+ return {
1226
+ ...composeRootHooks(scopeWorkspace, scopeSession),
1227
+ get api() {
1228
+ return [at(route_server_default, contextSession)];
1229
+ },
1230
+ get commands() {
1231
+ return defined([via({ name: "po-help" }, at(po_help_server_default$1, contextSession))]);
1232
+ },
1233
+ get resources() {
1234
+ return defined([
1235
+ at(codemode_how_to_brain_server_default, contextSession),
1236
+ at(codemode_how_to_self_improve_server_default, contextSession),
1237
+ at(po_develop_codemode_plugin_server_default, contextSession),
1238
+ at(po_develop_dashboard_extension_server_default, contextSession),
1239
+ at(po_develop_native_extension_server_default, contextSession),
1240
+ at(po_help_server_default, contextSession),
1241
+ at(po_use_chatgpt_instructions_server_default, contextSession),
1242
+ at(po_use_help_server_default, contextSession)
1243
+ ]);
1244
+ },
1245
+ get tools() {
1246
+ return defined([via({ name: "help_status" }, at(help_status_server_default, contextSession))]);
1247
+ },
1248
+ services: [...scopeWorkspace.services ?? [], ...scopeSession.services ?? []],
1249
+ get activities() {
1250
+ return [...scopeWorkspace.activities ?? [], ...scopeSession.activities ?? []];
1251
+ }
1252
+ };
1253
+ }
1254
+ });
1255
+ //#endregion
1256
+ export { serverPlugin as default, serverPlugin };