@agimon-ai/po-cloudflare 0.0.2-alpha.63 → 0.0.2-alpha.65

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 (195) hide show
  1. package/README.md +13 -0
  2. package/dist/apiContracts-DJaPCL9K.js +1718 -0
  3. package/dist/assets/assets/{CodeEditorView-CNdPF2Z8.js → CodeEditorView-DCPiFMz0.js} +2 -2
  4. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-BpEuH9tc.js → abnfDiagram-WEYOIA3C-DvAn-mWR.js} +2 -2
  5. package/dist/assets/assets/{architecture-WOLXFQ4H-CO9IcYuJ.js → architecture-WOLXFQ4H-BqoJNuHs.js} +1 -1
  6. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-B94avglc.js → architectureDiagram-ZHVYKT53-CVHMywJ0.js} +2 -2
  7. package/dist/assets/assets/{blockDiagram-RJAE7QA3-Dyj_IG8P.js → blockDiagram-RJAE7QA3-DlsJidFa.js} +2 -2
  8. package/dist/assets/assets/{c4Diagram-XDPPPE54-kCCb9Nvu.js → c4Diagram-XDPPPE54-BHce68EW.js} +2 -2
  9. package/dist/assets/assets/channel-Ap-eWmi8.js +2 -0
  10. package/dist/assets/assets/{chunk-2E7WHVMD-aabTbQRn.js → chunk-2E7WHVMD-D_cQybka.js} +2 -2
  11. package/dist/assets/assets/{chunk-4EMNKR2T-BfyoxA4A.js → chunk-4EMNKR2T-BPsgK3fl.js} +2 -2
  12. package/dist/assets/assets/{chunk-55XCU76K-Cb2-H5PY.js → chunk-55XCU76K-wJdwF-ak.js} +2 -2
  13. package/dist/assets/assets/{chunk-7S6XSTFO-DF4Vz0iS.js → chunk-7S6XSTFO-6vky_tIo.js} +2 -2
  14. package/dist/assets/assets/{chunk-AQDTSKZB-DYfgedyG.js → chunk-AQDTSKZB-DV4T_fhG.js} +2 -2
  15. package/dist/assets/assets/{chunk-DSNLSHJZ-ELMVWOH-.js → chunk-DSNLSHJZ-DplgTMnZ.js} +2 -2
  16. package/dist/assets/assets/{chunk-HAGFOTED-BfFyqWkw.js → chunk-HAGFOTED-7zyD_n7s.js} +2 -2
  17. package/dist/assets/assets/{chunk-HNE4Q36P-brfLLH1k.js → chunk-HNE4Q36P-DkCRzBV4.js} +2 -2
  18. package/dist/assets/assets/{chunk-NQOKRVIF-BPeBTdMj.js → chunk-NQOKRVIF-CfibfHnN.js} +2 -2
  19. package/dist/assets/assets/{chunk-UHW7PFBP-Pm1hUsoy.js → chunk-UHW7PFBP-upUKARYM.js} +2 -2
  20. package/dist/assets/assets/{chunk-VQ5W62QI-DNrJHI3b.js → chunk-VQ5W62QI-C_ecpJb8.js} +2 -2
  21. package/dist/assets/assets/{chunk-WQQL4CDK-Bn-i8xPd.js → chunk-WQQL4CDK-CeXUpwQM.js} +2 -2
  22. package/dist/assets/assets/chunk-XXDRQBXY-8r37jA9N.js +2 -0
  23. package/dist/assets/assets/{chunk-YZO67HFG-Bm3Y2k41.js → chunk-YZO67HFG-BpqIL-Ls.js} +2 -2
  24. package/dist/assets/assets/{chunk-ZAUX2LTX-wKlSN4SY.js → chunk-ZAUX2LTX-Dz426n5U.js} +2 -2
  25. package/dist/assets/assets/{chunk-ZCHMQSOR-vvsZwzKx.js → chunk-ZCHMQSOR-CIpB7Y-4.js} +2 -2
  26. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-B4fv93fc.js → classDiagram-v2-4MYWR3UA-DMxuBYZx.js} +2 -2
  27. package/dist/assets/assets/{cose-bilkent-JH36ORCC-CakncvlM.js → cose-bilkent-JH36ORCC-CigtEMLF.js} +2 -2
  28. package/dist/assets/assets/{cynefin-EF2NZ3EQ-BmPuG-jp.js → cynefin-EF2NZ3EQ-DGBPQh16.js} +1 -1
  29. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-w05E3pMy.js → cynefinDiagram-WF24UDRP-DcfS5ZDx.js} +2 -2
  30. package/dist/assets/assets/{dagre-NK4GIZVX-DtBjSPFH.js → dagre-NK4GIZVX-wsXb1I9z.js} +2 -2
  31. package/dist/assets/assets/{diagram-CBK3MWTC-BFSVYioV.js → diagram-CBK3MWTC-CzTmlPcK.js} +2 -2
  32. package/dist/assets/assets/{diagram-I5XIIV2D-BDvStF0J.js → diagram-I5XIIV2D-nkyhW5J1.js} +2 -2
  33. package/dist/assets/assets/{diagram-ODIL2UCW-DARMBHRQ.js → diagram-ODIL2UCW-BvtWnLV3.js} +2 -2
  34. package/dist/assets/assets/{diagram-PFBEJUXE-Pj4fyqwM.js → diagram-PFBEJUXE-B2rIQWPh.js} +2 -2
  35. package/dist/assets/assets/{diagram-RJA3I4VV-BaKg3wpn.js → diagram-RJA3I4VV-CUWBJbOc.js} +2 -2
  36. package/dist/assets/assets/{diagram-TYUNFSNR-CefzxlNs.js → diagram-TYUNFSNR-c2ARj311.js} +2 -2
  37. package/dist/assets/assets/{dist-CGCZs-fG.js → dist-B3hH1eZX.js} +2 -2
  38. package/dist/assets/assets/{dist-B9ZDItnO.js → dist-BW3XPokz.js} +2 -2
  39. package/dist/assets/assets/{dist-CxVXLY-8.js → dist-BlXRD5M4.js} +2 -2
  40. package/dist/assets/assets/{dist-D5maITN-.js → dist-CMoF8H7E.js} +2 -2
  41. package/dist/assets/assets/{dist-DtehQ6Vh.js → dist-Dfkdofpi.js} +2 -2
  42. package/dist/assets/assets/{dist-Cghv4o0_.js → dist-Dw4HtLSB.js} +2 -2
  43. package/dist/assets/assets/{dist-CHFfGcfR.js → dist-DxWeTfiW.js} +2 -2
  44. package/dist/assets/assets/{dist-DEWrC__B.js → dist-DzmxmkBm.js} +2 -2
  45. package/dist/assets/assets/{dist-EAEtfW9R.js → dist-MmbuKmS6.js} +2 -2
  46. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-YewZYnYk.js → ebnfDiagram-V4P3TTPT-D2FtafnO.js} +2 -2
  47. package/dist/assets/assets/{elk-QONTBCTQ-dVpXxU0t.js → elk-QONTBCTQ-9GgR0loF.js} +2 -2
  48. package/dist/assets/assets/{erDiagram-KYQIGQAA-DppuSwGu.js → erDiagram-KYQIGQAA-hPOFBkMc.js} +2 -2
  49. package/dist/assets/assets/{eventmodeling-K75KTNOO-CjOlr5k9.js → eventmodeling-K75KTNOO-DbCljd97.js} +1 -1
  50. package/dist/assets/assets/flowDiagram-IUGLLWBU-BOXtwLDS.js +1 -0
  51. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-BiP9tCoR.js → ganttDiagram-R7GPNTJY-DTPU42MP.js} +2 -2
  52. package/dist/assets/assets/{gitGraph-VSP46ZUC-D_37KmzW.js → gitGraph-VSP46ZUC-DWoY6mrF.js} +1 -1
  53. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BpPyCOnT.js → gitGraphDiagram-PDYL7XHY-Bi2qpLCf.js} +2 -2
  54. package/dist/assets/assets/{index-Dus9Cw5p.js → index-YQoqmzQi.js} +99 -99
  55. package/dist/assets/assets/{info-OHQRW6UA-BzB_vPCs.js → info-OHQRW6UA-CxmA89Um.js} +1 -1
  56. package/dist/assets/assets/{infoDiagram-MVDRKAX5-H2O0q8Pc.js → infoDiagram-MVDRKAX5-DG6zh8w9.js} +2 -2
  57. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CxgN92Oj.js → ishikawaDiagram-HPEHV2GE-DzAbnA7B.js} +2 -2
  58. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-Cgi2OOJn.js → journeyDiagram-BOSHW7O7-YYiol7F_.js} +2 -2
  59. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DfNFv9yJ.js → kanban-definition-FNSA4HC5-DIPzWHrz.js} +2 -2
  60. package/dist/assets/assets/{line-BsuG8Uxt.js → line-tjEUMDgi.js} +2 -2
  61. package/dist/assets/assets/{linear-5ygNOtpj.js → linear-7audwIjN.js} +2 -2
  62. package/dist/assets/assets/{mermaid-parser.core-BQKUlQNj.js → mermaid-parser.core-CmvVG-Kz.js} +4 -4
  63. package/dist/assets/assets/{mermaid.core-mIsoHdG8.js → mermaid.core-hQYozWmu.js} +5 -5
  64. package/dist/assets/assets/{mindmap-definition-6OY57UG3-CwRI3Joj.js → mindmap-definition-6OY57UG3-BVbfcswc.js} +2 -2
  65. package/dist/assets/assets/{packet-JDAUHWVQ-DA3pnTHc.js → packet-JDAUHWVQ-B4A9IN6X.js} +1 -1
  66. package/dist/assets/assets/{pegDiagram-ECIUJNBX-CDCKGOxK.js → pegDiagram-ECIUJNBX-2dO0C5HH.js} +2 -2
  67. package/dist/assets/assets/{pie-XZMESJXO-BLhJFhYu.js → pie-XZMESJXO-BBjP-9YP.js} +1 -1
  68. package/dist/assets/assets/{pieDiagram-GNMPY74T-DYR-R-dX.js → pieDiagram-GNMPY74T-D5ItxqLc.js} +2 -2
  69. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-Bc1eK1F-.js → quadrantDiagram-D57K4MC3-CI1YWHP7.js} +2 -2
  70. package/dist/assets/assets/{radar-ABXABTNO-EtUBQBSs.js → radar-ABXABTNO-CmHsnvEo.js} +1 -1
  71. package/dist/assets/assets/{railroad-I3PHUGI6-B21qPap-.js → railroad-I3PHUGI6-mjtQGyyx.js} +1 -1
  72. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-BIiwJieY.js → railroad-abnf-LNEFI6M7-NG6xDLZE.js} +1 -1
  73. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-DqZK9K0J.js → railroad-ebnf-DWYD2UWJ-CHrVa-Zc.js} +1 -1
  74. package/dist/assets/assets/{railroad-peg-JR7BVNR7-CIQgGVCU.js → railroad-peg-JR7BVNR7-Cv7HZwu9.js} +1 -1
  75. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-BD_lzGk4.js → railroadDiagram-Y72NRBL7-CcshEAzq.js} +2 -2
  76. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-aDbnnoHS.js → requirementDiagram-EQYSW5RA-BpQjrts5.js} +2 -2
  77. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DDdGARNy.js → sankeyDiagram-SY24JHO5-BxFpWJee.js} +2 -2
  78. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-BIH_jN1c.js → sequenceDiagram-BLEHNHQU-Cy3TRU8x.js} +2 -2
  79. package/dist/assets/assets/{src-BaA7Sf5p.js → src-DF-UIMkB.js} +2 -2
  80. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-C-dVVPfs.js → stateDiagram-v2-A6IESKWZ-s71XLmzi.js} +2 -2
  81. package/dist/assets/assets/{swimlanes-B3ENRKFQ-Bw5IOyh7.js → swimlanes-B3ENRKFQ-DKQYe1bi.js} +2 -2
  82. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-CU40DD4r.js +9 -0
  83. package/dist/assets/assets/{timeline-definition-JXYKGLGB-By_uqQTe.js → timeline-definition-JXYKGLGB-BwNjdfal.js} +2 -2
  84. package/dist/assets/assets/{treeView-D4JQ5SDB-BZU7wRHU.js → treeView-D4JQ5SDB-Cjkm0YOs.js} +1 -1
  85. package/dist/assets/assets/{treemap-SAJKECNS-N8z3Rl5u.js → treemap-SAJKECNS-BQB0_ADt.js} +1 -1
  86. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-CuUha2nb.js → usecaseDiagram-WPOLBNNX-D9pYNVr2.js} +2 -2
  87. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-g3YaAylz.js → vennDiagram-Q3Y3IDCW-C1SkdaXK.js} +2 -2
  88. package/dist/assets/assets/{wardley-7MLQ67FV-BvmZvcdT.js → wardley-7MLQ67FV-v20Tmto3.js} +1 -1
  89. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CvNsC8vq.js → wardleyDiagram-IVAIDKWA-B8KE2Hk0.js} +2 -2
  90. package/dist/assets/assets/{webpack-mxF5RTCn.js → webpack-B3ZM4qOq.js} +2 -2
  91. package/dist/assets/assets/{xychartDiagram-4URNHDU4-vCSk0HHw.js → xychartDiagram-4URNHDU4-ChUhHjre.js} +2 -2
  92. package/dist/assets/bundle-asset-policy.json +1 -1
  93. package/dist/assets/index.html +1 -1
  94. package/dist/assets/plugins/assets/base-BsvoTtxC.css +2 -0
  95. package/dist/assets/plugins/chunks/po-web-runtime-CvG4NhrB.js +1 -0
  96. package/dist/assets/plugins/compositions.json +1 -1
  97. package/dist/assets/plugins/slots/approval.3e4ea6e4-DwMsvPDz.js +2 -0
  98. package/dist/assets/plugins/slots/artifacts.84980c32-DfGb6O5G.js +1 -0
  99. package/dist/assets/plugins/slots/author.06c1e9f2-QrVToNMd.js +93 -0
  100. package/dist/assets/plugins/slots/{autocompact.f08b6833-BLrybOV_.js → autocompact.ec8f713f-DIdbFapd.js} +1 -1
  101. package/dist/assets/plugins/slots/backdrop-bamboo.1a4d85e9-B1G6K9CK.js +1 -0
  102. package/dist/assets/plugins/slots/browse.61a8907a-CKrFQDRg.js +1 -0
  103. package/dist/assets/plugins/slots/builtin-tools.16ef5e25-W9iELs37.js +7 -0
  104. package/dist/assets/plugins/slots/calendar.d337fc49-DxroQPly.js +2 -0
  105. package/dist/assets/plugins/slots/codemode.5f359b9c-DFt74pdx.js +11 -0
  106. package/dist/assets/plugins/slots/domain.832848c8-CBDMKDks.js +1 -0
  107. package/dist/assets/plugins/slots/edit.7c802139-B_QPWRzK.js +7 -0
  108. package/dist/assets/plugins/slots/files.364f16c9-C1f4VBzl.js +2 -0
  109. package/dist/assets/plugins/slots/goal.a97b169d-DU4ht2C8.js +1 -0
  110. package/dist/assets/plugins/slots/grep.d8bf9f57-ChGw5JO1.js +1 -0
  111. package/dist/assets/plugins/slots/help.5c78c071-DALSrZXs.js +3 -0
  112. package/dist/assets/plugins/slots/log.07fd59a4-BcFCYlUV.js +4 -0
  113. package/dist/assets/plugins/slots/mcp.ea8b6aa2-COaym6fu.js +55 -0
  114. package/dist/assets/plugins/slots/plan.7b30f8d8-hTYh_1Kg.js +3 -0
  115. package/dist/assets/plugins/slots/{profile.1b4aeee4-NbT6f8xl.js → profile.63bc3ae6-Bn7rVzpr.js} +1 -1
  116. package/dist/assets/plugins/slots/{prompts.a5509377-D8btnu7Y.js → prompts.9d9b47cc-3uAA96m2.js} +21 -21
  117. package/dist/assets/plugins/slots/read.926c024f-XUSHcxSg.js +1 -0
  118. package/dist/assets/plugins/slots/runner.5393fa6c-DT-J4VL1.js +9 -0
  119. package/dist/assets/plugins/slots/scaffold.686222eb-B-7FczEB.js +1 -0
  120. package/dist/assets/plugins/slots/sessions.8e378a3b-BDTdY51Z.js +1 -0
  121. package/dist/assets/plugins/slots/skill.56c1cc07-BEUpjVIo.js +4 -0
  122. package/dist/assets/plugins/slots/space.056e8bbc-CglHDuG2.js +1 -0
  123. package/dist/assets/plugins/slots/subagents.31fc045b-B6vCI4Xz.js +7 -0
  124. package/dist/assets/plugins/slots/template-advanced.9e8350fe-C3VQwE2u.js +1 -0
  125. package/dist/assets/plugins/slots/template-desktop.69a46f62-vM3Sa_ep.js +7 -0
  126. package/dist/assets/plugins/slots/template-elegant.381f6acb-G5sH-z6o.js +1 -0
  127. package/dist/assets/plugins/slots/vault.587549ba-DdmDyvt7.js +1 -0
  128. package/dist/assets/plugins/slots/voice.9c687181-Cw1sBfTJ.js +1 -0
  129. package/dist/assets/plugins/slots/web-search.f6292793-BhOP7UMO.js +1 -0
  130. package/dist/assets/plugins/slots/workflows.8a13baad-C-a6A__u.js +16 -0
  131. package/dist/{exports-AlTWtgSx.js → exports-DjnLP10c.js} +1 -1
  132. package/dist/{index.edge-B0YYwNF0.js → index.edge-CSOYqxQ2.js} +2 -1
  133. package/dist/{server-KzfsJGF8.js → server-B2u9qXaW.js} +1 -2
  134. package/dist/{server-CCqvf6yh.js → server-BVg0GcD1.js} +1 -2
  135. package/dist/{server-DeBXj3re.js → server-BajwJsx0.js} +2 -3
  136. package/dist/{server-rIQkmCUx.js → server-CFLUZq0Z.js} +1 -1
  137. package/dist/{server-DSe28Ebi.js → server-CGUm_4c6.js} +1 -1
  138. package/dist/{server-CR3v0zcN.js → server-CeRiFgZ2.js} +4 -4
  139. package/dist/{server-DNtprCHS.js → server-CkBvJEiI.js} +2 -2
  140. package/dist/{server-D97tm0wK.js → server-CvIcjkmj.js} +2 -4
  141. package/dist/{server-bO3F28gq.js → server-D-r3Z8RX.js} +1 -2
  142. package/dist/{server-B7FH93rx.js → server-D9QpT9sF.js} +1 -2
  143. package/dist/{server-D1_V9Vmd.js → server-DEGY0gok.js} +1 -2
  144. package/dist/{server-B7ow4_os.js → server-DOI9mJ00.js} +1 -1
  145. package/dist/{server-B_g35a-5.js → server-DXi7uymP.js} +1 -2
  146. package/dist/{server-1LZR9ZRX.js → server-DaIqzqsZ.js} +1 -2
  147. package/dist/{server-CqsGbX44.js → server-DduaHIqM.js} +2 -4
  148. package/dist/{server-COD1HYtb.js → server-DlBR6wqk.js} +1 -2
  149. package/dist/{server-SR4ElcIH.js → server-DpuKPbyY.js} +1 -1
  150. package/dist/{server-38vPt49q.js → server-amd015lr.js} +1 -2
  151. package/dist/server-c93sCvo3.js +466 -0
  152. package/dist/{server-Nb7tgHv2.js → server-ibKVoyfO.js} +1 -2
  153. package/dist/{server-3HPXqwI6.js → server-nLOnbiIi.js} +1 -2
  154. package/dist/{server-DhuzpcVR.js → server-o7qfd_Rg.js} +25 -2
  155. package/dist/{server-D_0XHzYJ.js → server-uOcc0AcK.js} +3 -3
  156. package/dist/{type-CfRhJrke.js → type-CMoUqYFA.js} +32 -1
  157. package/dist/worker.js +405 -139
  158. package/package.json +48 -43
  159. package/dist/apiContracts-C5xYJZfw.js +0 -561
  160. package/dist/assets/assets/channel-BDLbYxu3.js +0 -2
  161. package/dist/assets/assets/chunk-XXDRQBXY-D9IZWvba.js +0 -2
  162. package/dist/assets/assets/flowDiagram-IUGLLWBU-9R5zxYVV.js +0 -1
  163. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-coH9laQJ.js +0 -9
  164. package/dist/assets/plugins/assets/base-ByEdw6HI.css +0 -2
  165. package/dist/assets/plugins/chunks/po-web-runtime-DZvTbTGl.js +0 -1
  166. package/dist/assets/plugins/slots/approval.72ae703a-MJpYBBW3.js +0 -2
  167. package/dist/assets/plugins/slots/artifacts.77a5ce89-BqGpkxIz.js +0 -1
  168. package/dist/assets/plugins/slots/author.1714bd0b-vpvWaIsO.js +0 -93
  169. package/dist/assets/plugins/slots/backdrop-bamboo.8ee8a555-Djii7v-K.js +0 -1
  170. package/dist/assets/plugins/slots/browse.59782354-BCYYZIGg.js +0 -1
  171. package/dist/assets/plugins/slots/builtin-tools.abc3edcc-QrPdFMQO.js +0 -7
  172. package/dist/assets/plugins/slots/calendar.d83ca386-BsY3VUmV.js +0 -2
  173. package/dist/assets/plugins/slots/codemode.c68822dc-BUQr5ZVr.js +0 -11
  174. package/dist/assets/plugins/slots/domain.d3fc60b5-CG6iqO2H.js +0 -1
  175. package/dist/assets/plugins/slots/edit.2aa43041-Bkj7M18J.js +0 -7
  176. package/dist/assets/plugins/slots/files.c1e584ee-CxGGfZ7q.js +0 -2
  177. package/dist/assets/plugins/slots/goal.0d58b5cd-B93fwx0M.js +0 -1
  178. package/dist/assets/plugins/slots/grep.b067b8cb-BH487fbj.js +0 -1
  179. package/dist/assets/plugins/slots/help.e5f29767-Cc-1UAi2.js +0 -3
  180. package/dist/assets/plugins/slots/log.24faf8a0-BmKGSUhs.js +0 -4
  181. package/dist/assets/plugins/slots/mcp.a6805ffa-B1pF9U1U.js +0 -55
  182. package/dist/assets/plugins/slots/plan.cf1a06d8-Bp6s-HU-.js +0 -3
  183. package/dist/assets/plugins/slots/read.a43eeb4a-D8J587IR.js +0 -1
  184. package/dist/assets/plugins/slots/runner.03b699da-kZzobG85.js +0 -9
  185. package/dist/assets/plugins/slots/scaffold.f3763f9c-DSiG8h1F.js +0 -1
  186. package/dist/assets/plugins/slots/sessions.dc7ce5f8-Pqp4CAW1.js +0 -1
  187. package/dist/assets/plugins/slots/skill.2b6ba429-BPCu7SmU.js +0 -4
  188. package/dist/assets/plugins/slots/space.a8901278-DmJaW-f6.js +0 -1
  189. package/dist/assets/plugins/slots/subagents.6f67a972-9xrGKpLe.js +0 -7
  190. package/dist/assets/plugins/slots/vault.593b32bd-BOhqzgok.js +0 -1
  191. package/dist/assets/plugins/slots/voice.fa8f3d31-PQ3c795m.js +0 -1
  192. package/dist/assets/plugins/slots/workflows.41d5eec7-DACCrvVZ.js +0 -16
  193. package/dist/help-BQL0GO15.js +0 -1
  194. package/dist/presets-JqH9Fwy9.js +0 -1
  195. package/dist/sessionApiContracts-BDVrjHG1.js +0 -1157
@@ -1,9 +0,0 @@
1
- import{Er as e,F as t,Fn as n,Ht as r,I as i,J as a,K as o,L as s,M as c,Mr as l,Or as u,P as d,Qr as f,S as p,Tr as m,W as h,Wr as g,_,a as v,ar as y,c as b,ct as x,d as S,dn as C,dr as w,en as ee,et as T,f as E,g as D,gr as te,h as ne,in as O,kn as re,lr as k,mr as ie,n as ae,nr as A,o as oe,qr as se,qt as ce,s as j,u as le,v as M,vr as N,zr as P}from"../chunks/po-web-runtime-DZvTbTGl.js";var ue=`/runners start`,F={command:'exec "${SHELL:-/bin/bash}" -l',name:`shell`,interactive:!0};function I(e,t){let n=t.trim()===``?{}:{cwd:t};return e.trim()===``?{...F,...n}:{command:e,...n,preferInteractive:!0}}function L(e){return/\s/u.test(e)?`"${e}"`:e}function R(e){let t=e.cwd?.trim()??``,n=e.name?.trim()??``;return[ue,...n===``?[]:[`name=${L(n)}`],...t===``?[]:[`cwd=${L(t)}`],...e.interactive===!0?[`interactive=true`]:e.preferInteractive===!0?[`interactive=prefer`]:[],`--`,e.command.trim()].join(` `)}var z=`runner_runs`,B=`/runners stop`,V=P({runs:[],stopRequested:[]});function H(e,t=Date.now()){return e.state===`running`&&t-Date.parse(e.startedAt)>3e3}var U={subscribe(e){let t,n=()=>{clearTimeout(t);let r=Date.now(),i=1/0;for(let e of Object.values(V.store.state))if(e)for(let t of e.runs){if(t.state!==`running`)continue;let e=Date.parse(t.startedAt)+3001;e>r&&(i=Math.min(i,e))}Number.isFinite(i)&&(t=setTimeout(()=>{e(),n()},Math.min(i-r,2147483647)))},r=V.store.subscribe(()=>{e(),n()});return n(),()=>{r.unsubscribe(),clearTimeout(t)}},isActive(e){return V.select(V.store.state,e).runs.some(e=>H(e))}};function W(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G(e,t,n){e(t,{type:`prompt`,message:`${B} ${n}`}),V.update(t,e=>({...e,stopRequested:[...e.stopRequested.filter(e=>e!==n),n]}))}function K(e,t,n){e(t,{type:`prompt`,message:R(n)})}var q=V.channel({channel:z,parse(e){if(!W(e)||!Array.isArray(e.runs))return null;let t=e.startFailure;return{runs:e.runs.filter(W),...typeof e.sessionDirectory==`string`?{sessionDirectory:e.sessionDirectory}:{},...W(t)&&typeof t.id==`string`&&typeof t.message==`string`?{startFailure:{id:t.id,message:t.message}}:{}}},reduce(e,t){let n=new Set(t.runs.filter(e=>e.state===`running`).map(e=>e.id));return{...t,stopRequested:e.stopRequested.filter(e=>n.has(e))}}});function de(e,t){let n=Date.parse(e);if(Number.isNaN(n))return`unknown`;let r=Math.max(0,Math.floor((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.floor(r/60);if(i<60)return`${i}m`;let a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function fe(e,t,n,r={}){let i=e.split(`
2
- `);i.length>0&&i[i.length-1]===``&&i.pop(),r.dropPartialTail===!0&&i.length>0&&i.pop();let a=[...i,...t],o=a.slice(-n);return{lines:o,hidden:a.length-o.length}}function pe(e,t){let n=Math.max(1,e-t+1);return Array.from({length:t},(e,t)=>n+t)}function me(e,t,n){return e&&!t&&n}function he(e,t){return e===``||e===t?t===void 0?`session directory`:t.split(`/`).pop()??t:t!==void 0&&e.startsWith(`${t}/`)?e.slice(t.length+1):e}function ge(e,t,n){let r=new Set([...e,t]);return r.delete(``),n!==void 0&&r.delete(n),[...r]}function _e(e){return e===void 0?{tone:`neutral`,label:`gone`}:e.state===`running`?{tone:`running`,label:`running`}:e.exit===void 0||e.exit.reason===`stopped`?{tone:`neutral`,label:`stopped`}:e.exit.reason===`completed`&&(e.exit.code===0||e.exit.code===null)?{tone:`ok`,label:`done`}:{tone:`error`,label:e.exit.reason.replace(`_`,` `)}}function ve({command:e,onCommandChange:t,cwd:n,onCwdChange:r,sessionDirectory:i,folders:o,problem:s,onLaunch:c,defaultFolderOpen:l=!1}){let[u,d]=_(l),[f,m]=_(``),g=he(n,i),v=e=>{r(e),m(``),d(!1)},x=[{value:``,title:`Session directory`,subtitle:i??`Where this session started`},...ge(o,n,i).map(e=>({value:e,title:he(e,i),subtitle:e}))];return b(`div`,{className:`flex shrink-0 flex-col gap-1.5 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:[b(`div`,{className:`flex flex-wrap items-center gap-2 sm:flex-nowrap`,children:[b(`span`,{className:`relative flex min-w-0 flex-1 basis-full items-center sm:basis-auto`,children:[j(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute left-3 font-mono text-base text-po-faint`,children:`$`}),j(p,{size:`lg`,"data-testid":`runners-panel-command`,"aria-label":`Command to run`,value:e,placeholder:`a command, like pnpm dev`,autoComplete:`off`,spellCheck:!1,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c()},className:`w-full pl-7 font-mono`})]}),b(a,{open:u,onOpenChange:d,children:[j(T,{asChild:!0,children:b(O,{variant:`outline`,size:`lg`,"data-testid":`runners-panel-cwd`,"aria-label":`Runs in ${g}`,"aria-invalid":s!==void 0||void 0,title:n===``?i:n,className:`max-w-56 gap-1.5 px-3 font-mono ${s===void 0?``:`border-po-red`}`,children:[j(N,{className:`h-3.5 w-3.5 shrink-0 text-po-faint`}),j(`span`,{className:`truncate`,children:g}),j(re,{className:`size-3.5 shrink-0 opacity-60`})]})}),j(h,{side:`bottom`,align:`start`,title:`Runs in`,items:x,value:[n],onSelect:v,footer:b(`span`,{className:`relative flex items-center px-3 py-2`,children:[j(N,{className:`pointer-events-none absolute left-5.5 h-3.5 w-3.5 text-po-faint`}),j(p,{"data-testid":`runners-panel-cwd-path`,"aria-label":`Another folder`,value:f,placeholder:`another folder, like packages/web`,spellCheck:!1,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f.trim()!==``&&v(f.trim())},className:`w-full pl-8 font-mono`})]})})]}),j(O,{variant:`primary`,size:`lg`,"data-testid":`runners-panel-run`,onClick:c,children:e.trim()===``?`Open shell`:`Run`})]}),s===void 0?j(`span`,{className:`text-sm text-po-dim`,children:`Runs in its own terminal and keeps going after Po's turn ends. Leave it empty for a plain shell.`}):b(`span`,{role:`alert`,"data-testid":`runners-panel-problem`,className:`flex items-center gap-1.5 text-sm text-po-red`,children:[j(y,{className:`size-3.5 shrink-0`}),s]})]})}var J=`runId`,ye=`screen`,be=`append`,Y={lines:`lines`,grep:`grep`,ignoreCase:`ignoreCase`,contextLines:`contextLines`,from:`from`,generation:`generation`},xe={log:{method:`GET`,path:`/runners/:${J}/log`,query:[Y.lines,Y.grep,Y.ignoreCase,Y.contextLines],response:void 0},logStream:{method:`GET`,path:`/runners/:${J}/log/stream`,query:[Y.from],stream:!0},screenStream:{method:`GET`,path:`/runners/:${J}/screen/stream`,query:[Y.from],stream:!0},logRead:{method:`GET`,path:`/runners/:${J}/log/read`,query:[Y.from],response:void 0},screenRead:{method:`GET`,path:`/runners/:${J}/screen/read`,query:[Y.from,Y.generation],response:void 0},input:{method:`POST`,path:`/runners/:${J}/screen/input`}},X=m(xe,{scopes:[`session`],basePath:`runner`,transport:(e,t)=>ae.fetch(e,t),sessionAddress:f});function Se(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}var Ce=5,we=500;function Te(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ee(e,t,n,r){let i=n,a=0,o=!1,s,c,l=()=>{if(o)return;let n=new EventSource(X.session(e).screenStream.url({params:{[J]:t},query:{[Y.from]:i}}));s=n,n.addEventListener(ye,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!Te(t)||typeof t.chunk!=`string`)return;let s=t;typeof s.offset==`number`&&(i=s.offset),a=0,s.ended===!0&&(o=!0,n.close()),r.onEvent(s)}),n.addEventListener(`error`,()=>{n.close(),!o&&(a+=1,a>Ce?r.onLost():c=setTimeout(l,we*2**(a-1)))})};return l(),{close:()=>{o=!0,c!==void 0&&clearTimeout(c),s?.close()}}}async function De(e,t,n){let r={text:n};return(await X.session(e).input({params:{[J]:t},body:r})).ok}var Oe=`The cockpit hub is unreachable.`;function ke(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Ae(e,t,n={},r){let i=await X.session(e).log({params:{[J]:t},query:{[Y.lines]:n.lines,[Y.grep]:n.grep===``?void 0:n.grep,[Y.ignoreCase]:n.ignoreCase===!0||void 0,[Y.contextLines]:n.contextLines},...r===void 0?{}:{signal:r}});return i.ok?!ke(i.data)||typeof i.data.text!=`string`?{error:`The hub answered ${String(i.status)}.`}:{slice:i.data}:i.status===0?{error:r?.aborted===!0?``:Oe}:{error:i.error===``?`The hub answered ${String(i.status)}.`:i.error}}var je=5,Me=500,Ne=2e3;function Pe(e,t,n,r){let i=n,a=0,o=!1,s=!1,c,l,u=new AbortController,d=new TextDecoder,f=``,p=e=>{o||(typeof e.offset==`number`&&(i=e.offset),e.ended===!0&&(o=!0,c?.close()),r.onEvent(e))},m=async()=>{if(o)return;let n=Ne;try{let r=await X.session(e).logRead({params:{[J]:t},query:{[Y.from]:i},signal:u.signal});if(o||!r.ok)return;let a=r.data;a.reset&&(d=new TextDecoder,f=``),f+=d.decode(Se(a.chunk),{stream:!a.ended});let s=f.split(`
3
- `);f=s.pop()??``,a.ended&&f!==``&&(s.push(f),f=``),p({lines:s,offset:a.offset,ended:a.ended}),a.hasMore&&(n=0)}catch{}finally{o||(l=setTimeout(()=>void m(),n))}},h=()=>{if(o)return;let n;try{n=new EventSource(X.session(e).logStream.url({params:{[J]:t},query:{[Y.from]:i}}))}catch{m();return}c=n,n.addEventListener(`open`,()=>{s=!0}),n.addEventListener(be,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!ke(t)||!Array.isArray(t.lines))return;let n=t;s=!0,a=0,p(n)}),n.addEventListener(`error`,()=>{n.close(),!o&&(a+=1,!s||a>je?m():l=setTimeout(h,Me*2**(a-1)))})};return h(),{close:()=>{o=!0,l!==void 0&&clearTimeout(l),c?.close(),u.abort()}}}var Fe=`runner-log-`,Ie=2e3,Le=2,Re=200,ze=24,Z=1024,Be=Z*Z;function Ve(e){let t=e.id;return{id:`${Fe}${t}`,label:`log · ${e.name}`,panel:e=>j(Ge,{...e,runId:t})}}function He(e){return e<Z?`${e} B`:e<Be?`${(e/Z).toFixed(1)} KB`:`${(e/Be).toFixed(1)} MB`}function Ue(e,t,n){return t===``?!1:n?e.toLowerCase().includes(t.toLowerCase()):e.includes(t)}function We({number:e,line:t,matched:n,dimmed:r}){return b(`div`,{"data-testid":`runner-log-row`,"data-matched":n,className:`flex min-w-0 gap-2`,children:[e===void 0?null:j(`span`,{className:`w-12 shrink-0 select-none text-right font-mono text-sm leading-relaxed text-po-faint`,children:e}),j(`span`,{"aria-hidden":!0,className:`w-4 shrink-0 select-none font-mono text-sm leading-relaxed ${n?`text-po-yellow`:`text-po-faint`}`,children:n?`>>`:``}),j(k,{line:t,className:`min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-sm leading-relaxed ${r?`text-po-dim`:`text-po-text`}`})]})}function Ge({sessionId:e,runId:t,sendSessionFrame:n,onTerminal:i}){let{runs:a,stopRequested:o}=v(V.store,t=>V.select(t,e)),s=a.find(e=>e.id===t),[c,l]=_(``),[u,d]=_(``),[f,m]=_(!1),[h,g]=_(Le),[y,C]=_(!0),[w,ee]=_(void 0),[T,te]=_(void 0),[k,ie]=_([]),[ae,A]=_(0),[se,ce]=_(void 0),[M,N]=_(!0),[P,ue]=_(!1),F=D(null),I=D(null),L=u!==``,R=me(y,L,w?.running===!0);E(()=>{let e=setTimeout(()=>d(c),Re);return()=>clearTimeout(e)},[c]);let z=le(n=>{e!==null&&Ae(e,t,L?{grep:u,ignoreCase:f,contextLines:h}:{},n).then(e=>{n.aborted||(`error`in e?e.error!==``&&ce(e.error):(ce(void 0),ie([]),A(0),ee(e.slice),te(e.slice.completeBytes)))})},[e,t,L,u,f,h]);E(()=>{let e=new AbortController;return z(e.signal),()=>e.abort()},[z]),E(()=>{if(!R||e===null||T===void 0)return;let n=Pe(e,t,T,{onEvent:e=>{e.lines.length>0&&ie(t=>[...t,...e.lines].slice(-2e3)),typeof e.offset==`number`&&A(e.offset),e.ended===!0&&C(!1)}});return()=>n.close()},[R,e,t,T]);let B=w!==void 0&&w.exists&&w.completeBytes<w.fileSize,H=fe(w?.text??``,k,Ie,{dropPartialTail:R&&B}),U=ne(()=>w===void 0?[]:L?w.lineNumbers??[]:pe(w.totalLines+k.length-(R&&B?1:0),H.lines.length),[w,L,k.length,R,B,H.lines.length]);E(()=>{R&&M&&F.current?.scrollIntoView({block:`end`})},[R,M,H.lines.length]);let W=()=>{let e=I.current;e!==null&&N(e.scrollHeight-e.scrollTop-e.clientHeight<=ze)},K=_e(s),q=s!==void 0&&o.includes(s.id);return b(`div`,{"data-testid":`runner-log-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[b(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:h-11 sm:flex-nowrap sm:gap-2.5 sm:px-[26px] sm:py-0`,children:[j(`span`,{"data-testid":`runner-log-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:s?.name??t}),j(r,{tone:K.tone,size:`md`,"data-testid":`runner-log-state`,children:K.label}),s?b(oe,{children:[j(Ke,{run:s}),j(`span`,{className:`shrink-0 text-sm text-po-dim`,children:`pid ${String(s.pid)} · ${s.backend}${s.interactive?` · tty`:``}`})]}):j(`span`,{"data-testid":`runner-log-gone`,className:`text-sm text-po-dim`,children:`no longer listed; its log stays readable`}),j(`span`,{className:`min-w-0 flex-1`}),i?j(O,{variant:`outline`,size:`sm`,"data-testid":`runner-log-terminal`,onClick:i,children:`Back to terminal`}):null,s!==void 0&&s.state===`running`&&e!==null?j(O,{variant:q?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-log-stop`,disabled:q,title:q?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(n,e,s.id),children:q?`Stopping…`:`Stop`}):null]}),s?j(`div`,{className:`shrink-0 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:b(`div`,{className:`flex items-start gap-2 rounded-md bg-po-deep px-3 py-2`,children:[b(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[b(`span`,{"data-testid":`runner-log-command`,title:P?void 0:`${s.command}\nin ${s.cwd}`,className:`font-mono text-base text-po-hi ${P?`break-all`:`truncate`}`,children:[b(`span`,{"aria-hidden":!0,className:`select-none text-po-faint`,children:[`$`,` `]}),s.command]}),P?b(`span`,{className:`break-all font-mono text-sm text-po-dim`,children:[`in `,s.cwd]}):null]}),j(`button`,{type:`button`,"data-testid":`runner-log-command-toggle`,"aria-expanded":P,"aria-label":P?`Collapse command`:`Expand command`,className:`flex size-6 shrink-0 items-center justify-center rounded text-po-faint hover:text-po-hi`,onClick:()=>ue(e=>!e),children:j(re,{className:`size-4 transition-transform ${P?`rotate-180`:``}`})})]})}):null,b(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:flex-nowrap sm:gap-2.5 sm:px-[26px]`,children:[b(`span`,{className:`relative flex min-w-0 flex-1 items-center sm:w-72 sm:flex-none`,children:[j(x,{className:`pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-po-faint`}),j(p,{size:`md`,"data-testid":`runner-log-search`,value:c,placeholder:`Search output`,onChange:e=>l(e.target.value),className:`w-full pl-8`})]}),j(O,{variant:f?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-ignore-case`,"aria-pressed":f,title:`match regardless of case`,onClick:()=>m(e=>!e),children:f?`Any case`:`Match case`}),j(O,{variant:h>0&&L?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-context`,disabled:!L,title:`lines of context kept either side of a match`,onClick:()=>g(e=>e===0?Le:0),children:`± ${String(h)} lines`}),j(`span`,{className:`min-w-0 flex-1`}),b(`span`,{"data-testid":`runner-log-stats`,className:`min-w-0 basis-full truncate text-sm text-po-dim sm:basis-auto`,children:[w===void 0?`reading…`:L?`${String(w.lineCount)} matching of ${w.totalLines.toLocaleString(`en-US`)} lines`:`${R?`tailing`:`showing`} last ${String(H.lines.length)} of ${(w.totalLines+(R?k.length:0)).toLocaleString(`en-US`)} lines`,H.hidden>0?` · ${H.hidden.toLocaleString(`en-US`)} older hidden`:``]}),j(O,{variant:R?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-follow`,"aria-pressed":R,disabled:L||w?.running!==!0,title:L?`a filtered view is a snapshot; clear the query to follow`:`follow the log as it grows`,onClick:()=>C(e=>!e),children:L?`Paused while searching`:R?`Following`:`Follow`})]}),b(`div`,{className:`relative min-h-0 flex-1`,children:[b(`div`,{ref:I,onScroll:W,"data-testid":`runner-log-body`,className:`h-full overflow-auto bg-po-deep px-3 py-3 sm:px-[26px]`,children:[se===void 0?w===void 0?j(`p`,{"data-testid":`runner-log-reading`,className:`text-sm text-po-dim`,children:`reading…`}):w.exists===!1?j(`p`,{className:`text-sm text-po-dim`,children:`This runner has not printed anything yet.`}):H.lines.length===0?j(`p`,{className:`text-sm text-po-dim`,children:L?`Nothing matched.`:`The log is empty.`}):H.lines.map((e,t)=>{let n=U[t],r=U[t-1],i=r!==void 0&&n!==void 0&&n-r>1;return b(S,{children:[i?j(`div`,{"data-testid":`runner-log-gap`,"aria-hidden":!0,className:`select-none py-0.5 pl-14 text-sm leading-relaxed text-po-faint`,children:`⋯`}):null,j(We,{number:n,line:e,matched:L&&Ue(e,u,f),dimmed:L&&!Ue(e,u,f)})]},n??`row-${String(t)}`)}):j(`p`,{"data-testid":`runner-log-error`,className:`text-sm text-po-red`,children:se}),j(`div`,{ref:F})]}),R&&!M?j(O,{variant:`subtle`,size:`sm`,"data-testid":`runner-log-jump`,title:`scroll back to the newest lines and keep following`,onClick:()=>{N(!0),F.current?.scrollIntoView({block:`end`})},className:`absolute bottom-3 right-3`,children:`Jump to latest`}):null]}),b(`div`,{className:`flex h-8 shrink-0 items-center gap-2.5 border-t border-po-border-soft px-3 sm:px-[26px]`,children:[j(`span`,{"data-testid":`runner-log-path`,className:`min-w-0 flex-1 truncate font-mono text-sm text-po-dim`,children:s?.logPath??w?.path??``}),w===void 0?null:j(`span`,{className:`shrink-0 text-sm text-po-dim`,children:He(Math.max(w.fileSize,ae))})]})]})}function Ke({run:e}){let t=D(null),[n]=_(Date.now);return E(()=>{if(e.exit||e.state!==`running`)return;let n=()=>{let n=t.current?.firstChild;n&&(n.nodeValue=de(e.startedAt,Date.now()))};n();let r=setInterval(n,1e3);return()=>clearInterval(r)},[e.startedAt,e.state,e.exit]),j(`span`,{ref:t,className:`shrink-0 text-sm text-po-dim`,children:de(e.startedAt,e.exit?Date.parse(e.exit.finishedAt):n)})}var qe=30;function Je({sessionId:e,runId:t,sendSessionFrame:n,openTransientTab:i,onSearch:a}){let{runs:o,stopRequested:s}=v(V.store,t=>V.select(t,e)),c=o.find(e=>e.id===t),[l,u]=_(!1),[d,f]=_(!1),[p,m]=_(!1),h=D(null),g=D([]),y=D(void 0);E(()=>{if(e===null||!p)return;let n=Ee(e,t,0,{onEvent:e=>{e.chunk!==``&&h.current?.write(Se(e.chunk)),e.ended===!0&&u(!0)},onLost:()=>f(!0)});return()=>n.close()},[e,t,p]),E(()=>()=>{y.current!==void 0&&clearTimeout(y.current)},[]);let S=n=>{e!==null&&(g.current.push(n),y.current===void 0&&(y.current=setTimeout(()=>{let n=g.current.join(``);g.current=[],y.current=void 0,n!==``&&De(e,t,n)},qe)))},C=c?.state===`running`&&!l,w=s.includes(t);return b(`div`,{"data-testid":`runner-shell-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[b(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-b border-po-border-soft px-3 py-2 sm:flex-nowrap sm:gap-2.5 sm:px-[26px] sm:py-1.5`,children:[j(`span`,{"data-testid":`runner-shell-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:c?.name??t}),j(r,{tone:C?`running`:`neutral`,size:`md`,"data-testid":`runner-shell-state`,children:C?`Running`:`Ended`}),c?j(`span`,{className:`min-w-0 truncate font-mono text-sm text-po-dim`,children:c.command}):null,j(`span`,{className:`min-w-0 flex-1`}),d?j(`span`,{"data-testid":`runner-shell-lost`,className:`shrink-0 text-sm text-po-red`,children:`The connection to this terminal dropped. Reopen the runner to attach again.`}):null,c?b(O,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-search`,title:`search everything this runner has printed`,onClick:()=>a?a():i(Ve(c)),className:`gap-1.5`,children:[j(x,{className:`h-3.5 w-3.5`}),`Search output`]}):null,C?j(O,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-interrupt`,title:`send ctrl-c`,onClick:()=>S(``),children:`Ctrl-C`}):null,C&&e!==null?j(O,{variant:w?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-shell-stop`,disabled:w,title:w?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(n,e,t),children:w?`Stopping…`:`Stop`}):null]}),b(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-po-deep px-3 py-2 sm:px-[26px]`,children:[j(ee,{ref:h,"data-testid":`runner-shell-terminal`,onData:e=>S(e),onReady:()=>m(!0)}),p?null:j(`p`,{"data-testid":`runner-shell-reading`,className:`text-sm text-po-dim`,children:`attaching…`})]}),j(`div`,{className:`flex h-8 shrink-0 items-center border-t border-po-border-soft px-3 sm:px-[26px]`,children:j(`span`,{className:`min-w-0 flex-1 truncate text-sm text-po-dim`,children:C?`Typing goes straight to ${c?.name??`the runner`}. Ctrl-C stops what is running.`:`This runner has ended. Its output stays searchable.`})})]})}var Ye=3e4,Xe=`runner-runs`;function Ze(){return{id:Xe,label:`runners`,panel:Qe}}function Qe(e){let{sessionId:t,sendSessionFrame:n}=e,r=v(V.store,e=>V.select(e,t)),i=r.runs.filter(e=>e.state===`running`),[a,o]=_(``),[s,c]=_(``),[l,u]=_(void 0),[d,f]=_(void 0),p=D(null),m=D(``),h=D(void 0),g=i.find(e=>e.id===l)??i[0],y=()=>{t!==null&&(p.current=new Set(r.runs.map(e=>e.id)),clearTimeout(h.current),h.current=setTimeout(()=>{p.current=null},Ye),K(n,t,I(a,s)),m.current=a,o(``))};E(()=>{let e=p.current;if(e===null)return;let t=r.runs.find(t=>t.state===`running`&&!e.has(t.id));t&&(p.current=null,clearTimeout(h.current),u(t.id))},[r.runs]);let x=r.startFailure?.id;return E(()=>{x!==void 0&&p.current!==null&&(p.current=null,clearTimeout(h.current),o(m.current))},[x]),E(()=>()=>clearTimeout(h.current),[]),b(`div`,{"data-testid":`runners-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[b(`div`,{className:`flex h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft px-3 sm:px-[26px]`,children:[j(`span`,{className:`text-lg font-semibold text-po-hi`,children:`Runners`}),j(`span`,{"data-testid":`runners-panel-count`,className:`text-sm text-po-dim`,children:i.length===0?`Nothing running`:`${String(i.length)} running`})]}),t===null?null:j(ve,{command:a,onCommandChange:o,cwd:s,onCwdChange:c,folders:i.map(e=>e.cwd),...r.sessionDirectory===void 0?{}:{sessionDirectory:r.sessionDirectory},...r.startFailure===void 0?{}:{problem:r.startFailure.message},onLaunch:y}),g===void 0?j(w,{"data-testid":`runners-panel-empty`,className:`px-4 py-8`,title:`Nothing running yet`,description:t===null?`Open a session to start a runner.`:`Type a command above, like pnpm dev, and it opens here as a live terminal.`}):b(oe,{children:[j(`div`,{"data-testid":`runners-panel-picker`,className:`flex shrink-0 flex-wrap gap-1.5 px-3 pt-3 sm:px-[26px]`,children:i.map(e=>b(O,{variant:e===g?`subtle`:`ghost`,size:`sm`,"data-testid":`runners-panel-pick-${e.id}`,"aria-pressed":e===g,title:e.command,onClick:()=>u(e.id),className:`gap-1.5 ${e===g?`text-po-hi`:``}`,children:[j(A,{tone:`yellow`,pulse:!0}),e.name]},e.id))}),j(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col border-t border-po-border-soft`,children:g.interactive&&d!==g.id?j(Je,{...e,runId:g.id,onSearch:()=>f(g.id)},g.id):j(Ge,{...e,runId:g.id,...g.interactive?{onTerminal:()=>f(void 0)}:{}},g.id)})]})]})}var $e=e({keys:`r l`,icon:o,activeSource:U,transientTab:Ze,order:20}),et=u(q),tt=5;function nt(e){for(let t=e.length-1;t>=0;--t){let n=C(e[t]??``).map(e=>e.text).join(``).trim();if(n.length>0)return n}}function rt(e,t,n){let[r,i]=_(void 0);return E(()=>{if(!n||e===null)return;let r=!0,a,o=new AbortController;return Ae(e,t,{lines:tt},o.signal).then(n=>{if(!r||`error`in n)return;let o=nt(n.slice.text.split(`
4
- `));o!==void 0&&i({runId:t,text:o}),n.slice.running&&(a=Pe(e,t,n.slice.completeBytes,{onEvent:e=>{let n=nt(e.lines);r&&n!==void 0&&i({runId:t,text:n})}}))}),()=>{r=!1,o.abort(),a?.close()}},[e,t,n]),n&&r?.runId===t?r.text:void 0}function it({sessionId:e,sendSessionFrame:t,openTransientTab:n}){let r=v(V.store,t=>V.select(t,e)),i=()=>r.runs.filter(e=>H(e)).length;M(U.subscribe,i,i);let a=r.runs.filter(e=>H(e));return a.length===0?b(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[j(`p`,{"data-testid":`activity-summary-runners`,className:`text-sm text-po-dim`,children:`Idle`}),e===null?null:b(O,{variant:`link`,size:`sm`,"data-testid":`activity-runner-launch`,className:`h-auto gap-1 px-0 text-po-green`,onClick:()=>n(Ze()),children:[`Launch a runner`,j(c,{"aria-hidden":!0,className:`size-3.5`})]})]}):j(`div`,{"data-testid":`activity-runner-runs`,className:`flex flex-col gap-0.5`,children:a.map(i=>j(at,{run:i,stopRequested:r.stopRequested.includes(i.id),sessionId:e,sendSessionFrame:t,openTransientTab:n},i.id))})}function at({run:e,stopRequested:t,sessionId:n,sendSessionFrame:r,openTransientTab:i}){let a=rt(n,e.id,e.state===`running`);return b(O,{variant:`ghost`,size:`card`,"data-testid":`activity-runner-${e.id}`,"data-runner-tone":`running`,title:`open this runner's log`,onClick:()=>{n!==null&&i(Ve(e))},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:[b(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[j(A,{tone:`yellow`,pulse:!0}),j(`span`,{className:`min-w-0 flex-1 truncate text-left text-base font-semibold text-po-hi`,children:e.name}),b(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[j(Ke,{run:e}),e.interactive?` · tty`:``]}),n===null?null:j(O,{asChild:!0,variant:t?`outline`:`danger-outline`,size:`xs`,"data-testid":`activity-runner-stop-${e.id}`,"data-stopping":t,title:t?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,className:`px-1.5`,children:j(`span`,{role:`button`,tabIndex:t?-1:0,"aria-disabled":t,onClick:i=>{i.stopPropagation(),t||G(r,n,e.id)},onKeyDown:i=>{(i.key===`Enter`||i.key===` `)&&(i.preventDefault(),i.stopPropagation(),t||G(r,n,e.id))},children:t?`stopping…`:`stop`})})]}),j(`span`,{"data-testid":`activity-runner-detail-${e.id}`,"data-detail":a===void 0?`command`:`tail`,className:`truncate pl-3 text-left text-sm text-po-dim`,children:a??e.command})]})}var ot=l({component:it}),st=`…`,ct=` … `,lt=160,ut=12,Q=1024,dt=Q*Q,ft=/(?<![\w.-])(?:\/Users|\/home)\/[^/\s]+(?=\/|\s|$)/g;function pt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mt(e){if(!pt(e))return{};let t={};return typeof e.id==`string`&&(t.id=e.id),typeof e.runner==`string`&&(t.runner=e.runner),(typeof e.exitCode==`number`||e.exitCode===null)&&(t.exitCode=e.exitCode),typeof e.logPath==`string`&&(t.logPath=e.logPath),typeof e.fileSize==`number`&&(t.fileSize=e.fileSize),typeof e.lines==`number`&&(t.lines=e.lines),e.timedOut===!0&&(t.timedOut=!0),e.promoted===!0&&(t.promoted=!0),typeof e.reason==`string`&&(t.reason=e.reason),typeof e.tail==`string`&&(t.tail=e.tail),typeof e.tailLines==`number`&&(t.tailLines=e.tailLines),typeof e.sequenceId==`string`&&(t.sequenceId=e.sequenceId,Array.isArray(e.stages)&&(t.stages=e.stages.flatMap(e=>!pt(e)||!Number.isInteger(e.index)||Number(e.index)<0||typeof e.state!=`string`?[]:[{index:Number(e.index),state:e.state,...typeof e.logPath==`string`?{logPath:e.logPath}:{}}]))),t}function ht(e){return e.replace(ft,`~`)}function gt(e){let t=e.split(`
5
- `).map(e=>e.trim()).filter(e=>e.length>0),n=t[0]??``;return t.length>1?`${n} ${st} +${t.length-1} lines`:n}function _t(e,t=lt){if(e.length<=t)return e;let n=t-3,r=Math.ceil(n/2),i=e.slice(0,r),a=e.slice(e.length-(n-r)),o=i.lastIndexOf(` `);o>i.length/2&&(i=i.slice(0,o));let s=a.indexOf(` `);return s>=0&&s<a.length/2&&(a=a.slice(s+1)),`${i}${ct}${a}`}function vt(e){return typeof e==`string`?e:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e.join(`
6
-
7
- `):``}function yt(e){let t=vt(e);if(t.length===0)return``;let n=Array.isArray(e)?vt(e[0]):t,r=Array.isArray(e)&&e.length>1?` ${st} +${e.length-1} commands`:``;return _t(`${ht(gt(n))}${r}`)}function bt(e){let t=[];return e.background===!0&&t.push(`bg`),e.interactive===!0&&t.push(`tty`),typeof e.timeout==`number`&&t.push(`${e.timeout}s`),typeof e.name==`string`&&e.name.length>0&&t.push(e.name),t}function xt(e){return e<Q?`${e} B`:e<dt?`${(e/Q).toFixed(1)} KB`:`${(e/dt).toFixed(1)} MB`}function St(e){let t=[];return e.lines!==void 0&&t.push(`${e.lines.toLocaleString(`en-US`)} lines`),e.fileSize!==void 0&&t.push(xt(e.fileSize)),e.runner!==void 0&&t.push(e.runner),t.join(` · `)}function Ct(e,t){let n=e.split(`
8
- `);for(;n.length>0&&n[n.length-1]?.trim()===``;)n.pop();return n.length<=t?n:n.slice(-t)}function wt(e){let t=mt(e.details),n=(t.stages??[]).flatMap(e=>e.logPath===void 0?[]:[`stage ${e.index+1} · ${e.state} · ${e.logPath}`]);if(e.isPartial)return{lines:[...n,...Ct(e.output,ut)],status:{glyph:`◐`,tone:`running`,text:`running`},hidden:0};if(e.isError){let r=Ct(t.sequenceId===void 0?e.output:t.tail??e.output,2**53-1),i=[...n,...e.expanded?r:r.slice(-12)],a=St(t);return{lines:i,status:{glyph:`✗`,tone:`error`,text:a.length>0?a:`failed`},hidden:Math.max(0,r.length+n.length-i.length)}}if(t.promoted===!0)return{lines:n,status:{glyph:`●`,tone:`background`,text:`${t.runner??t.id??`runner`}${t.id===void 0?``:` · ${t.id}`} · background`},hidden:0};let r=Ct(t.tail??(t.sequenceId===void 0?``:e.output),2**53-1),i=[...n,...e.expanded?r:r.slice(-12)],a=t.exitCode!==void 0&&t.exitCode!==null,o=t.timedOut===!0||a&&t.exitCode!==0,s=[];t.timedOut===!0?s.push(`timed out`):o&&s.push(`exit ${t.exitCode}`);let c=St(t);c.length>0&&s.push(c);let l=s.length>0?s.join(` · `):o?`failed`:i.length===0?`done`:``;return{lines:i,status:l.length>0?{glyph:o?`✗`:`✓`,tone:o?`error`:`ok`,text:l}:null,hidden:Math.max(0,r.length+n.length-i.length)}}function Tt(e){if(e===void 0)return{tone:`info`,badge:`In background`};if(e.exit===void 0)return{tone:`running`,badge:`In background`};let{reason:t,code:n}=e.exit,r=n===null?``:` · exit ${n}`;return t===`completed`?{tone:`ok`,badge:`Completed${r}`}:t===`stopped`?{tone:`neutral`,badge:`Stopped`}:{tone:`error`,badge:`Failed${r}`}}var Et={running:`running`,ok:`ok`,error:`error`,background:`info`};function Dt({sessionId:e,args:r,result:a,output:o,running:c,isError:l,sendSessionFrame:u,openTransientTab:f}){let p=mt(a?.details),m=p.sequenceId===void 0?p.id:void 0,h=p.promoted===!0?m:void 0,g=v(V.store,t=>m===void 0?void 0:V.select(t,e).runs.find(e=>e.id===m)),_=v(V.store,t=>h!==void 0&&V.select(t,e).stopRequested.includes(h)),y=vt(r.command),x=yt(r.command),S=bt(r),C=e!==null&&h!==void 0&&g!==void 0&&g.exit===void 0,w=h===void 0?void 0:Tt(g);return j(d,{tone:w?.tone??n({running:c,isError:l}),expandable:!0,children:({expanded:n})=>{let r=wt({details:a?.details,output:o,expanded:!0,isPartial:c,isError:l});return b(oe,{children:[b(i,{title:`bash`,...w?{badge:w.badge}:{},children:[b(`span`,{"data-testid":`tool-call-bash`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[j(`span`,{className:`min-w-0 flex-1 truncate font-mono text-po-text`,children:x}),S.length>0?b(`span`,{className:`hidden shrink-0 text-po-dim sm:inline`,children:[`· `,S.join(` · `)]}):null]}),g!==void 0&&e!==null?b(O,{variant:`outline`,size:`xs`,"data-testid":`tool-result-bash-open-log`,title:`open this runner's full log`,onClick:e=>{e.stopPropagation(),f(Ve(g))},className:`shrink-0 gap-1 px-1.5 `,children:[j(ie,{className:`h-2.5 w-2.5`}),`log`]}):null,C?j(O,{size:`xs`,variant:_?`outline`:`danger-outline`,disabled:_,"data-testid":`tool-result-bash-stop`,"data-stopping":_,title:_?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:t=>{t.stopPropagation(),e!==null&&h!==void 0&&G(u,e,h)},className:`shrink-0 px-1.5 `,children:_?`stopping…`:`stop`}):null]}),n?b(t,{"data-testid":`tool-result-bash`,className:`flex flex-col gap-2`,children:[y.length>0?j(ce,{"data-testid":`tool-result-bash-command`,grammar:`shell`,text:y,className:`max-h-40 overflow-auto text-po-text`}):null,r.lines.length>0?j(te,{"data-testid":`tool-result-bash-output`,text:r.lines.join(`
9
- `),className:`max-h-96 overflow-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere] border-po-border-soft border-t pt-2 font-mono text-po-dim`}):null,r.status?j(s,{"data-testid":`tool-result-bash-status`,tone:Et[r.status.tone],glyph:r.status.glyph,className:`min-w-0`,children:j(`span`,{className:`break-words`,children:r.status.text})}):null,p.sequenceId===void 0&&p.logPath!==void 0?b(`span`,{"data-testid":`tool-result-bash-log`,className:`min-w-0 break-all text-po-dim`,children:[`full log · `,j(`span`,{className:`text-po-dim`,children:p.logPath})]}):null]}):null]})}})}var Ot=g({message:Dt}),$=(e,t)=>t===void 0?void 0:{...e,...t},kt=se({id:`runner`,packageName:`@agimon-ai/po-runner`,session:{get activityGroups(){return[$({name:`runners`},$e)]},get channels(){return[$({channel:`runner_runs`},et)]},get fills(){return[$({slot:`activity.runners`,id:`runners`},ot)]},get toolRenderers(){return[$({tools:[`bash`]},Ot)]}}});export{kt as webPlugin};
@@ -1 +0,0 @@
1
- import{At as e,Br as t,Ct as n,D as r,Dt as i,Et as a,Gt as o,Ir as s,Jn as c,Ot as l,Qn as u,Qr as d,St as f,Tr as p,Tt as m,Xn as h,Yn as g,Zn as _,_ as v,an as y,c as b,dr as x,er as S,f as C,gt as w,in as T,jn as E,kt as D,n as O,o as k,qn as ee,qr as A,s as j,u as M,vr as N,vt as P}from"../chunks/po-web-runtime-DZvTbTGl.js";var F=p({listSets:{method:`GET`,path:`/sets`,response:void 0},setEnabled:{method:`PUT`,path:`/sets/enabled`,response:void 0},removeSet:{method:`DELETE`,path:`/sets`,query:[`id`,`scope`],response:void 0}},{scopes:[`host`,`workspace`,`session`],basePath:`scaffolds`,transport:(e,t)=>O.fetch(e,t),sessionAddress:d});async function I(e,t){let n=await e.json().catch(()=>void 0);if(!e.ok)throw Error(typeof n?.error==`string`?n.error:t);return n}var L=e=>e?F.workspace(e):F.host;async function R(e,t){return I(await e(L(t).listSets.url()),`Po could not read your template sets.`)}async function z(e,t,n){let r=L(n).setEnabled;return I(await e(r.url(),{method:r.spec.method,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),`Po could not change this template set.`)}async function B(e,t,n){let r=L(n).removeSet;return I(await e(r.url({query:{id:t.id,...t.scope?{scope:t.scope}:{}}}),{method:r.spec.method}),`Po could not remove this template set.`)}function V(e,t){switch(e){case`builtin`:return{label:`Built in`,tone:`neutral`};case`plugin`:return{label:`Plugin`,tone:`blue`};case`host`:return t===`org`?{label:`Your org`,tone:`cyan`}:{label:`This computer`,tone:`magenta`};case`personal`:return{label:`Yours`,tone:`magenta`};case`workspace`:return{label:`This repository`,tone:`magenta`}}}var H=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function U({set:e,host:t}){let n=V(e.origin,t);return b(k,{children:[j(w,{tone:n.tone,children:n.label}),e.overrides?b(w,{children:[`Replaces `,V(e.overrides,t).label.toLowerCase()]}):null,e.error?j(w,{tone:`red`,children:`Can't be read`}):null]})}function W(e){let t=e.templates.filter(e=>e.kind===`boilerplate`).length,n=e.templates.length-t,r=e.origin===`plugin`&&e.owner?` from ${e.owner}`:``;return`${H(t,`starter`)}, ${H(n,`feature`)}${r}`}function G(e){let t=e.variablesSchema,n=new Set(Array.isArray(t.required)?t.required.map(String):[]);return Object.keys(t.properties??{}).map(e=>({name:e,required:n.has(e)})).sort((e,t)=>Number(t.required)-Number(e.required))}function K({set:e,scope:t,label:n,checked:r=e.enabled,busy:i,onToggle:a}){return j(o,{"aria-label":n,checked:r&&!e.error,disabled:i!==void 0||!!e.error,onCheckedChange:n=>a?.(e.id,n,t)})}function q(e,t){return e.personal?{scope:`personal`,label:`Agents can use ${t.label} in your sessions`}:{scope:e.scope,label:`Agents can use ${t.label}`}}function J({set:e,host:t}){return e.origin===`personal`?j(k,{children:`Saved by you`}):e.origin===`host`&&t===`org`?j(k,{children:`Saved for your org`}):e.path?j(`span`,{className:`font-mono break-all`,children:e.path}):e.owner?j(`span`,{className:`font-mono`,children:e.owner}):j(k,{children:`Ships with Po`})}function Y(e){let{sets:t,busy:r}=e;return t.length===0?j(x,{title:`No template sets yet`,description:`Ask Po in Help mode to save one, and it appears here.`,className:`py-12`}):j(P,{asChild:!0,children:j(`ul`,{"aria-label":`Template sets`,children:t.map(t=>j(f,{asChild:!0,children:b(`li`,{"data-testid":`scaffold-set-${t.id}`,"aria-busy":r===t.id,children:[b(m,{children:[b(a,{className:`flex flex-wrap items-center gap-2`,children:[t.label,j(U,{set:t,host:e.host})]}),t.description?j(n,{children:t.description}):null,t.error?j(n,{className:`text-po-red first-letter:normal-case`,children:t.error}):j(n,{children:W(t)})]}),b(`div`,{className:`flex items-center gap-2`,children:[j(K,{set:t,busy:r,onToggle:e.onToggle,...q(e,t)}),j(T,{variant:`ghost`,size:`icon`,"aria-label":`Open ${t.label}`,onClick:()=>e.onOpen?.(t.id),children:j(E,{className:`size-3.5`})})]})]})},t.id))})})}function X(t){let{set:o,scope:s,busy:c,host:u}=t,d=o.origin===s||t.personal===!0&&o.origin===`personal`;return b(`div`,{className:`flex flex-col gap-5`,children:[j(`div`,{children:b(T,{variant:`ghost`,size:`sm`,onClick:t.onBack,children:[j(r,{className:`size-3.5`}),`All template sets`]})}),b(i,{children:[b(D,{children:[b(e,{className:`flex flex-wrap items-center gap-2`,children:[o.label,j(U,{set:o,host:u})]}),o.description?j(l,{children:o.description}):null]}),b(P,{children:[t.personal?b(k,{children:[o.origin===`personal`||u!==`org`?null:b(f,{children:[b(m,{children:[j(a,{children:`On for everyone in your org`}),j(n,{children:`Your org's choice. Anyone in the org can change it.`})]}),j(K,{set:o,scope:`host`,label:`Everyone in your org can use ${o.label}`,checked:o.hostEnabled??o.enabled,busy:c,onToggle:t.onToggle})]}),b(f,{children:[b(m,{children:[j(a,{children:`On in your sessions`}),j(n,{children:o.origin===`personal`?`Only you see this set.`:`Only you. Overrides your org's choice.`})]}),j(K,{set:o,scope:`personal`,label:`Agents can use ${o.label} in your sessions`,busy:c,onToggle:t.onToggle})]})]}):b(f,{children:[b(m,{children:[j(a,{children:`Agents can use this set`}),j(n,{children:s===`workspace`?`Applies to sessions in this repository, even if the set is off on this computer.`:`Applies to every repository that has not chosen otherwise.`})]}),j(K,{set:o,scope:s,label:`Agents can use ${o.label}`,busy:c,onToggle:t.onToggle})]}),b(f,{children:[b(m,{children:[j(a,{children:`Source`}),j(n,{className:`first-letter:normal-case`,children:j(J,{set:o,host:u})})]}),d?b(T,{variant:`danger-outline`,size:`sm`,disabled:c!==void 0,onClick:()=>t.onAskRemove?.(o.id),children:[j(y,{className:`size-3.5`}),`Remove set`]}):null]})]}),o.error?j(`p`,{role:`alert`,className:`text-sm text-po-red`,children:o.error}):null]}),o.templates.length>0?b(i,{children:[b(D,{children:[j(e,{children:`Templates`}),j(l,{children:`What an agent can start or add with this set, and what it asks for.`})]}),j(P,{asChild:!0,children:j(`ul`,{"aria-label":`Templates in ${o.label}`,children:o.templates.map(e=>j(f,{asChild:!0,children:j(`li`,{children:b(m,{children:[b(a,{className:`flex flex-wrap items-center gap-2`,children:[j(`span`,{className:`font-mono`,children:e.name}),j(w,{tone:e.kind===`boilerplate`?`teal`:`violet`,children:e.kind===`boilerplate`?`Starter`:`Feature`})]}),e.description?j(n,{children:e.description}):null,G(e).length>0?j(n,{className:`flex flex-wrap gap-1.5`,children:G(e).map(e=>b(`span`,{className:`font-mono`,children:[e.name,e.required?``:`?`]},e.name))}):null]})})},`${e.kind}:${e.name}`))})})]}):null,o.files&&o.files.length>0?b(i,{children:[j(D,{children:j(e,{children:`Files`})}),j(P,{asChild:!0,children:j(`ul`,{"aria-label":`Files in ${o.label}`,children:o.files.map(e=>j(f,{asChild:!0,className:`py-2`,children:j(`li`,{className:`font-mono text-sm break-all text-po-text`,children:e})},e))})})]}):null]})}function Z(e){let{sets:t,error:n,selected:r,confirming:i,busy:a}=e,o=r===void 0?void 0:t?.find(e=>e.id===r),s=i===void 0?void 0:t?.find(e=>e.id===i);return b(`div`,{"data-testid":`scaffold-library`,className:`flex flex-col gap-3`,children:[n?j(`p`,{role:`alert`,className:`text-sm text-po-red`,children:n}):null,t===void 0?j(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Loading template sets…`}):o?j(X,{...e,set:o}):j(Y,{...e,sets:t}),j(ee,{open:s!==void 0,onOpenChange:t=>t?void 0:e.onCancelRemove?.(),children:b(g,{children:[j(u,{children:b(S,{children:[`Remove `,s?.label,`?`]})}),j(c,{children:j(h,{children:s?.origin===`personal`?`Its files are deleted. Your sessions stop offering it at once.`:s?.origin===`host`&&e.host===`org`?`Its files are deleted for everyone in your org. Agents stop offering it at once.`:b(k,{children:[`Its folder `,j(`span`,{className:`font-mono`,children:s?.path}),` and every file in it are deleted. Agents stop offering it at once.`]})})}),b(_,{children:[j(T,{onClick:e.onCancelRemove,children:`Keep set`}),j(T,{variant:`danger-outline`,disabled:a!==void 0,onClick:()=>s?e.onConfirmRemove?.(s.id):void 0,children:`Remove set`})]})]})})]})}var Q=(e,t)=>e instanceof Error?e.message:t;function $({request:e,requestWithStepUp:t,repositoryId:n}){let[r,i]=v(),[a,o]=v(n?`workspace`:`host`),[s,c]=v({}),[l,u]=v(),[d,f]=v(),[p,m]=v(),[h,g]=v(),_=M(async()=>{try{let t=await R(e,n);i(t.sets),o(t.scope),c({host:t.host,personal:t.personal}),u(void 0)}catch(e){i(e=>e??[]),u(Q(e,`Po could not read your template sets.`))}},[e,n]);C(()=>{_()},[_]);let y=async(e,t,n)=>{m(e);try{i((await t()).sets),u(void 0)}catch(e){await _(),u(Q(e,n))}finally{m(void 0)}};return j(Z,{scope:a,...s.host?{host:s.host}:{},personal:s.personal===!0,sets:r,error:l,selected:d,busy:p,confirming:h,onOpen:f,onBack:()=>f(void 0),onToggle:(e,r,i)=>void y(e,()=>z(t,{id:e,enabled:r,scope:i},n),`Po could not change this template set.`),onAskRemove:g,onCancelRemove:()=>g(void 0),onConfirmRemove:e=>{let i=r?.find(t=>t.id===e)?.origin===`personal`;g(void 0),f(void 0),y(e,()=>B(t,{id:e,...i?{scope:`personal`}:{}},n),`Po could not remove this template set.`)}})}var te=t({label:`Scaffolds`,detail:`The template sets agents use to start projects, documents and plugins, and which of them they may use.`,order:140,icon:N,component:({request:e,requestWithStepUp:t})=>j($,{request:e,requestWithStepUp:t})}),ne=s({label:`Scaffolds`,detail:`The template sets this repository's sessions see. A choice here overrides this computer's, for this repository only.`,order:120,icon:N,component:({repository:e,request:t,requestWithStepUp:n})=>e?j($,{request:t,requestWithStepUp:n,repositoryId:e.id},e.id):null}),re=(e,t)=>t===void 0?void 0:{...e,...t},ie=A({id:`scaffold`,packageName:`@agimon-ai/po-scaffold`,host:{get settingsPanels(){return[re({id:`scaffolds`},te)]}},workspace:{get repositorySettingsPanel(){return ne}}});export{ie as webPlugin};
@@ -1 +0,0 @@
1
- import{B as e,G as t,H as n,Jn as r,Kr as i,Mr as a,Nr as o,Qn as s,Xn as c,Yn as l,Zn as u,_ as d,c as f,er as p,f as m,ht as h,in as g,nn as _,nr as v,qn as y,qr as b,s as x}from"../chunks/po-web-runtime-DZvTbTGl.js";function S(e,t){return e.flatMap(e=>{try{let n=e.localSessionId?.(t.from)??t.from,r=e.localSessionId?.(t.to)??t.to;return n!==t.from||(e.qualifySessionId?.(t.from)??t.from)===t.from?[{runtime:e,from:n,to:r}]:[]}catch{return[]}}).at(-1)}async function C(e,t){let n=S(e,t);if(!n)return`Po is not connected. Your text is kept; try again.`;try{await n.runtime.invokeServerMethod({mount:{scope:`host`},service:`sessions`,method:`sendToSession`,input:{from:n.from,to:n.to,text:t.text}});return}catch(e){return e instanceof Error&&e.message!==``?e.message:`The message was not delivered.`}}var w=o(void 0),T=o([]);function E(e){return T.update(t=>[...t,e]),()=>T.update(t=>t.filter(t=>t!==e))}function D(e){w.update(()=>({text:e}))}function O(e){let t=()=>{let t=w.store.state;t&&(w.reset(),e(t))},n=w.store.subscribe(t);return t(),()=>n.unsubscribe()}function k(e){return C(T.store.state,e)}function A({takeComposerDraft:t,listSessions:r}){return!t||!r?null:f(n,{role:`menuitem`,density:`compact`,"data-testid":`composer-menu-send-to-session`,className:`w-full text-po-text hover:bg-po-tint-blue`,onClick:()=>D(t()),children:[x(h,{"aria-hidden":!0,className:`h-3 w-3 shrink-0`}),x(e,{density:`compact`,children:`Send to session…`})]})}var j=a({component:A}),M={running:`green`,waiting:`magenta`,idle:`neutral`};function N({open:e,sessions:n,to:i,text:a,error:o,sending:d,onPick:m,onTextChange:b,onCancel:S,onSend:C}){let w=n.find(e=>e.id===i);return x(y,{open:e,onOpenChange:e=>e?void 0:S(),children:f(l,{width:`md`,"data-testid":`send-to-session-dialog`,children:[x(s,{children:x(p,{children:`Send to session`})}),f(r,{className:`flex flex-col gap-3`,children:[x(c,{children:`It reaches that session right away, in its current turn, as a message from you.`}),n.length===0?x(`p`,{className:`text-sm text-po-dim`,children:`No other session is running. Open one, then send.`}):x(t,{label:`Sessions`,items:n.map(e=>({value:e.id,title:e.name,subtitle:e.detail,lead:x(v,{tone:M[e.state],size:`md`})})),value:i===void 0?[]:[i],filterable:!0,filterPlaceholder:`Search sessions`,onSelect:m,className:`max-h-56 rounded-md border border-po-border`}),x(_,{"aria-label":`Message`,rows:3,value:a,"data-testid":`send-to-session-text`,onChange:e=>b(e.currentTarget.value)}),o===``?null:x(`p`,{role:`alert`,className:`text-sm text-po-red`,children:o}),f(u,{children:[x(g,{variant:`outline`,size:`md`,onClick:S,children:`Cancel`}),f(g,{variant:`primary`,size:`md`,className:`gap-1.5`,"data-testid":`send-to-session-send`,disabled:w===void 0||a.trim()===``||d,onClick:C,children:[x(h,{"aria-hidden":!0,className:`size-3.5`}),w===void 0?`Send`:`Send to ${w.name}`]})]})]})]})})}function P({sessionId:e,listSessions:t,appendComposerDraft:n}){let[r,i]=d(!1),[a,o]=d([]),[s,c]=d(void 0),[l,u]=d(``),[f,p]=d(``),[h,g]=d(!1);if(m(()=>O(e=>{o(t?.()??[]),c(void 0),u(e.text),p(``),i(!0)}),[t]),!r||e===null)return null;let _=()=>{h||(n(l),i(!1))},v=async()=>{if(s===void 0)return;g(!0);let t=await k({from:e,to:s,text:l.trim()});g(!1),t===void 0?i(!1):p(t)};return x(N,{open:!0,sessions:a,to:s,text:l,error:f,sending:h,onPick:c,onTextChange:u,onCancel:_,onSend:()=>void v()})}var F=a({component:P}),I=i(E),L=(e,t)=>t===void 0?void 0:{...e,...t},R=b({id:`sessions`,packageName:`@agimon-ai/po-session`,session:{get fills(){return[L({slot:`composer-menu`,id:`send-to-session`},j),L({slot:`overlay`,id:`send-to-session-dialog`},F)]},get start(){return I}}});export{R as webPlugin};
@@ -1,4 +0,0 @@
1
- import{F as e,Fn as t,I as n,L as r,P as i,Wr as a,_ as o,c as s,in as c,j as l,o as u,qr as d,s as f}from"../chunks/po-web-runtime-DZvTbTGl.js";function p(e,t){return e===null?t:e.content.flatMap(e=>{let t=typeof e==`object`&&e?e:{};return t.type===`text`&&typeof t.text==`string`?[t.text]:[]}).join(`
2
- `)}function m(e){return typeof e.name==`string`?e.name:``}function h(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``).trim()}function g(e,t=12){let n=e.split(`
3
- `);if(n.length<=t)return{text:e,hidden:0};let r=n.slice(0,t).map(e=>e.trimStart().startsWith("```")),i=r.filter(Boolean).length%2==1?r.lastIndexOf(!0):t;return i<=0?{text:e,hidden:0}:{text:n.slice(0,i).join(`
4
- `).trimEnd(),hidden:n.length-i}}function _(e){let t=typeof e.query==`string`?e.query.trim():``;return t.length>0?t:void 0}function v(e,t){let n;try{n=JSON.parse(p(e,t))}catch{return[]}return Array.isArray(n)?n.flatMap(e=>{let t=typeof e==`object`&&e?e:{};return typeof t.name==`string`?[{name:t.name,description:typeof t.description==`string`?t.description:``}]:[]}):[]}function y({body:t}){let[n,r]=o(!1),i=g(t),a=n||i.hidden===0;return s(e,{"data-testid":`tool-result-load_skill`,className:`flex flex-col gap-2`,children:[f(l,{text:a?t:i.text}),a?null:s(`span`,{className:`flex items-center gap-2`,children:[s(`span`,{className:`text-sm text-po-dim`,children:[i.hidden,` more lines`]}),f(c,{variant:`ghost`,size:`sm`,onClick:()=>r(!0),children:`Show more`})]})]})}function b({args:a,result:o,output:c,running:l,isError:d}){let g=m(a),_=o===null||d?``:h(p(o,c));return f(i,{tone:t({running:l,isError:d}),expandable:!0,children:({expanded:t})=>s(u,{children:[f(n,{title:`load_skill`,children:f(`span`,{"data-testid":`tool-call-load_skill`,className:`flex min-w-0 flex-1 items-center gap-2`,children:f(`span`,{className:`truncate text-po-text`,children:g})})}),t?d?f(e,{"data-testid":`tool-result-load_skill`,className:`flex flex-col`,children:f(`span`,{className:`whitespace-pre-wrap break-words text-po-red`,children:p(o,c)})}):o===null?l?f(e,{"data-testid":`tool-result-load_skill`,children:f(r,{tone:`running`,children:`running`})}):null:_.length===0?null:f(y,{body:_}):null]})})}var x=a({message:b});function S({args:a,result:o,output:c,running:l,isError:d}){let m=_(a),h=o===null||d?[]:v(o,c),g=o===null||d?void 0:`${h.length} ${h.length===1?`skill`:`skills`}`;return f(i,{tone:t({running:l,isError:d}),expandable:!0,children:({expanded:t})=>s(u,{children:[f(n,{title:`search_skills`,children:s(`span`,{"data-testid":`tool-call-search_skills`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[m===void 0?f(`span`,{className:`truncate text-po-dim`,children:`all skills`}):f(`span`,{className:`truncate text-po-text`,children:m}),g===void 0?null:s(`span`,{className:`shrink-0 text-po-faint`,children:[`· `,g]})]})}),t?d?f(e,{"data-testid":`tool-result-search_skills`,className:`flex flex-col`,children:f(`span`,{className:`whitespace-pre-wrap break-words text-po-red`,children:p(o,c)})}):o===null?l?f(e,{"data-testid":`tool-result-search_skills`,children:f(r,{tone:`running`,children:`running`})}):null:h.length===0?f(e,{"data-testid":`tool-result-search_skills`,children:f(`span`,{className:`text-po-dim`,children:`No skills match.`})}):f(e,{"data-testid":`tool-result-search_skills`,className:`flex flex-col gap-2`,children:h.map(e=>s(`span`,{className:`flex flex-col`,children:[f(`span`,{className:`font-semibold text-po-hi`,children:e.name}),e.description.length>0?f(`span`,{className:`text-sm text-po-dim`,children:e.description}):null]},e.name))}):null]})})}var C=a({message:S}),w=(e,t)=>t===void 0?void 0:{...e,...t},T=d({id:`skill`,packageName:`@agimon-ai/po-skill`,session:{get toolRenderers(){return[w({tools:[`load_skill`]},x),w({tools:[`search_skills`]},C)]}}});export{T as webPlugin};
@@ -1 +0,0 @@
1
- import{An as e,Kn as t,Mr as n,N as r,Qr as i,Tr as a,_ as o,_n as s,c,dr as l,f as u,hr as d,in as f,jr as p,n as m,pr as h,qr as g,s as _,u as v,vr as y}from"../chunks/po-web-runtime-DZvTbTGl.js";var b=26214400,x=134217728,S=3e3,C=a({spaces:{method:`GET`,path:`/spaces`,response:void 0},list:{method:`GET`,path:`/`,query:[`space`],response:void 0},preview:{method:`GET`,path:`/preview`,query:[`space`,`path`],response:void 0},content:{method:`GET`,path:`/content`,query:[`space`,`path`],raw:!0}},{scopes:[`host`,`workspace`,`session`],basePath:`space`,transport:(e,t)=>m.fetch(e,t),sessionAddress:i});async function w(e){let t=await C.host.spaces({signal:e});if(!t.ok)throw Error(t.error||`Spaces could not be loaded.`);return t.data.spaces}async function T(e,t){let n=await C.host.list({query:{space:e},signal:t});if(!n.ok)throw Error(n.error||`Files could not be loaded.`);return n.data}async function E(e,t,n){let r=await C.host.preview({query:{space:e,path:t},signal:n});if(!r.ok)throw Error(r.error||`This file could not be read.`);return r.data}async function D(t,n,r){let i={space:t,path:n},a=await C.host.content({query:i,signal:r});if(a.ok)return a.response.blob();if(a.status!==413)throw Error(a.error||`This file could not be loaded.`);return e(async(e,t)=>{let n=await C.host.content({query:i,headers:e,signal:t});if(!n.ok)throw Error(n.error||`This file could not be loaded.`);return n.response},b,x,r)}async function O(e,t,n){let r=s(t,n),i=await D(e,r,new AbortController().signal);if(!i.type.startsWith(`image/`))throw Error(`This file is not an image.`);let a=URL.createObjectURL(i);return{url:a,dispose:()=>URL.revokeObjectURL(a),path:r}}function k(e,t){return`space:${e}/${t}`}var A={id:`personal`,label:`Personal`};function j({spaces:e,space:n,onSpaceChange:r,items:i,loading:a,error:s,now:u,onRetry:f,onOpen:p,path:m,preview:g,previewError:v,media:y,loadImage:b}){let[x,S]=o(`tree`),[C,w]=o(``),[T,E]=o(!1),[D,O]=o(t),[A,j]=o(`modified`),[M,N]=o(`desc`),[P,F]=o(new Set),I=e.find(e=>e.id===n)?.label??`Space`;return c(`main`,{className:`flex h-full min-h-0 flex-col bg-po-bg text-po-text`,children:[_(`h1`,{className:`shrink-0 border-b border-po-border px-4 py-3 text-2xl font-semibold text-po-hi`,children:`Space`}),c(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[_(`div`,{className:`flex min-h-0 flex-1 flex-col border-b border-po-border md:max-w-sm md:border-r md:border-b-0`,children:_(h,{label:I,emptyDescription:`Files you move here from a session are kept for every session.`,locations:e.map(e=>({value:e.id,label:e.label})),items:i,loading:a,error:s,onRetry:f,now:u,layout:x,onLayoutChange:S,query:C,onQueryChange:w,searchOpen:T,onSearchOpenChange:E,filters:{...D,location:n},onFiltersChange:({location:e,...t})=>{O(t),e!==n&&r(e)},sort:A,direction:M,onSortChange:(e,t)=>{j(e),N(t)},expanded:P,onToggleFolder:e=>F(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),openPath:m,onOpen:p})}),m?_(d,{source:I,path:m,preview:g,error:v,media:y,loadImage:b,documentPath:k(n,m)}):_(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:_(l,{title:`Ready when you need them`,description:`Choose a file to preview it. Files in a space are available in every session.`})})]})]})}function M({space:e,path:t,revision:n}){let[i,a]=o(),s=`${e}:${t}:${n}`;u(()=>{let n=new AbortController,r;return D(e,t,n.signal).then(e=>{n.signal.aborted||(r=URL.createObjectURL(e),a({source:s,url:r,mimeType:e.type}))}).catch(e=>{n.signal.aborted||a({source:s,error:e instanceof Error?e.message:String(e)})}),()=>{n.abort(),r!==void 0&&URL.revokeObjectURL(r)}},[e,t,s]);let c=i?.source===s?i:void 0;return c?.url?_(r,{src:c.url,path:t,contentType:c.mimeType}):_(`p`,{role:c?.error?`alert`:`status`,className:c?.error?`text-sm text-po-red`:`text-sm text-po-dim`,children:c?.error??`Loading media...`})}function N({space:e,path:t}){let[n,r]=o(),i=`${e}:${t}`;u(()=>{let n=new AbortController;return E(e,t,n.signal).then(e=>{n.signal.aborted||r({key:i,preview:e})}).catch(e=>{n.signal.aborted||r({key:i,error:e instanceof Error?e.message:String(e)})}),()=>n.abort()},[e,t,i]);let a=v(n=>O(e,t,n).then(t=>({...t,path:k(e,t.path)})),[e,t]),s=n?.key===i?n:void 0;return _(d,{source:e===A.id?A.label:e,path:t,preview:s?.preview,error:s?.error,loadImage:a,documentPath:k(e,t),media:_(M,{space:e,path:t,revision:`tab`})})}function P(){let[e,t]=o([A]),[n,r]=o(A.id),[i,a]=o(()=>({space:A.id,items:[],now:Date.now(),loaded:!1})),[s,c]=o(0),[l,d]=o(),f=i.space===n?i.items:[],p=f.find(e=>e.path===l),m=p?`${p.modifiedAt}:${p.size}`:i.loaded?`missing`:`initial`,[h,g]=o(),y=`${n}:${l}:${m}`;u(()=>{let e=new AbortController,r=!1,i=async()=>{if(!(document.visibilityState===`hidden`||r)){r=!0;try{let[r,i]=await Promise.all([w(e.signal),T(n,e.signal)]);if(e.signal.aborted)return;t(r),a({space:n,items:i.items,loaded:!0,now:Date.now(),error:i.error})}catch(t){e.signal.aborted||a(e=>({...e,items:e.space===n?e.items:[],space:n,loaded:!0,error:t instanceof Error?t.message:String(t)}))}finally{r=!1}}};i();let o=setInterval(()=>void i(),S),s=()=>void i();return document.addEventListener(`visibilitychange`,s),()=>{e.abort(),clearInterval(o),document.removeEventListener(`visibilitychange`,s)}},[s,n]),u(()=>{if(!l||m===`missing`)return;let e=new AbortController;return E(n,l,e.signal).then(t=>{e.signal.aborted||g({key:y,preview:t})}).catch(t=>{e.signal.aborted||g({key:y,error:t instanceof Error?t.message:String(t)})}),()=>e.abort()},[n,l,m,y]);let b=v(e=>O(n,l??``,e).then(e=>({...e,path:k(n,e.path)})),[n,l]),x=h?.key===y?h:void 0;return _(j,{spaces:e,space:n,onSpaceChange:e=>{r(e),d(void 0)},items:f,now:i.now,error:i.space===n?i.error:void 0,loading:!i.loaded||i.space!==n,onRetry:()=>c(e=>e+1),onOpen:e=>d(e.path),path:l,preview:x?.preview,previewError:m===`missing`?`This file no longer exists.`:x?.error,loadImage:b,media:l?_(M,{space:n,path:l,revision:m}):void 0})}var F=/^[a-z][a-z0-9-]{0,39}$/u,I=`artifact:host/`,L=`space:`;function R(e){let t=e.trim().replace(/^@/u,``),n,r;if(t.startsWith(I))n=`personal`,r=t.slice(14);else if(t.startsWith(L)){let e=t.slice(6),i=e.indexOf(`/`);if(i<0)return;n=e.slice(0,i),r=e.slice(i+1)}else return;if(!(!F.test(n)||r.includes(`\\`)||/[\u0000-\u001f\u007f]/u.test(r))&&!r.split(`/`).some(e=>e===``||e===`.`||e===`..`))return{space:n,path:r}}function z(e,t){return`space:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}var B=p({subscribe:()=>()=>void 0,fingerprint:()=>``,resolve(e,t){let n=R(t);if(n)return{id:z(n.space,n.path),label:n.path.split(`/`).at(-1)??n.path,panel:()=>_(N,{space:n.space,path:n.path})}}}),V=n({slot:`page`,id:`space`,component:P});function H({openPage:e,activePageId:t}){let n=t===`space`;return _(`div`,{className:`px-3 pt-1 group-data-[rail=desktop]/rail:p-0 group-data-[rail=elegant]/rail:p-0`,children:c(f,{variant:`ghost`,size:`lg`,"data-testid":`space-open`,"aria-current":n?`page`:void 0,onClick:()=>e?.(`space`),className:n?`w-full justify-start gap-2.5 border border-po-edge-green bg-po-tint-green px-2 text-po-hi group-data-[rail=elegant]/rail:h-9 group-data-[rail=elegant]/rail:border-0 group-data-[rail=elegant]/rail:gap-3 group-data-[rail=elegant]/rail:text-base group-data-[rail=elegant]/rail:rounded-lg group-data-[rail=elegant]/rail:bg-po-panel group-data-[rail=elegant]/rail:px-2.5 group-data-[rail=elegant]/rail:font-medium group-data-[rail=desktop]/rail:h-auto group-data-[rail=desktop]/rail:gap-3 group-data-[rail=desktop]/rail:rounded-xl group-data-[rail=desktop]/rail:border-0 group-data-[rail=desktop]/rail:px-3 group-data-[rail=desktop]/rail:py-2 group-data-[rail=desktop]/rail:text-base group-data-[rail=desktop]/rail:font-medium group-data-[rail=desktop]/rail:text-po-hi group-data-[rail=desktop]/rail:bg-po-rail`:`w-full justify-start gap-2.5 border border-transparent px-2 text-po-text group-data-[rail=elegant]/rail:h-9 group-data-[rail=elegant]/rail:border-0 group-data-[rail=elegant]/rail:gap-3 group-data-[rail=elegant]/rail:text-base group-data-[rail=elegant]/rail:rounded-lg group-data-[rail=elegant]/rail:px-2.5 group-data-[rail=elegant]/rail:font-medium group-data-[rail=elegant]/rail:hover:bg-po-panel/50 group-data-[rail=desktop]/rail:h-auto group-data-[rail=desktop]/rail:gap-3 group-data-[rail=desktop]/rail:rounded-xl group-data-[rail=desktop]/rail:border-0 group-data-[rail=desktop]/rail:px-3 group-data-[rail=desktop]/rail:py-2 group-data-[rail=desktop]/rail:text-base group-data-[rail=desktop]/rail:font-medium group-data-[rail=desktop]/rail:text-po-hi group-data-[rail=desktop]/rail:hover:bg-po-rail`,children:[_(`span`,{className:`contents group-data-[rail=desktop]/rail:grid group-data-[rail=desktop]/rail:size-8 group-data-[rail=desktop]/rail:shrink-0 group-data-[rail=desktop]/rail:place-items-center group-data-[rail=desktop]/rail:rounded-lg group-data-[rail=desktop]/rail:bg-po-rail`,children:_(y,{"aria-hidden":`true`,className:n?`size-5 text-po-green group-data-[rail=elegant]/rail:size-4 group-data-[rail=desktop]/rail:size-4`:`size-5 text-po-dim group-data-[rail=elegant]/rail:size-4 group-data-[rail=desktop]/rail:size-4`})}),`Space`]})})}var U=n({slot:`rail`,id:`space`,component:H}),W=(e,t)=>t===void 0?void 0:{...e,...t},G=g({id:`space`,packageName:`@agimon-ai/po-space`,host:{get fileLinks(){return B},get fills(){return[W({slot:`page`,id:`space`},V),W({slot:`rail`,id:`space`},U)]}}});export{G as webPlugin};
@@ -1,7 +0,0 @@
1
- import{$n as e,Er as t,F as n,Fn as r,Hr as i,Ht as a,I as o,It as s,L as c,Lt as l,M as u,Mr as d,Mt as f,Or as p,P as m,Pr as h,Pt as g,Qn as _,Qr as v,S as y,U as b,Ur as x,Vr as S,Wr as ee,Xn as te,Yn as ne,Zn as re,Zr as ie,_ as C,a as w,c as T,cr as E,dt as ae,er as oe,f as D,ft as se,g as ce,gt as O,ht as le,in as k,ir as ue,jt as A,kn as j,kr as M,mt as de,n as N,nn as fe,nr as P,o as F,on as I,or as L,p as pe,pn as me,pt as he,qn as ge,qr as _e,rr as ve,s as R,sr as ye,st as be,ut as xe,w as Se,zr as Ce}from"../chunks/po-web-runtime-DZvTbTGl.js";var we={id:`team`,label:`Team`,detail:`subagent defaults for new sessions, used only where agent frontmatter is unset. existing overrides still apply.`,order:50,fields:[{id:`model`,label:`default model`,keyPath:[`subagents`,`model`],placeholder:`inherit existing defaults`,detail:`model used when the agent frontmatter does not set one.`,models:!0},{id:`thinking`,label:`default thinking`,keyPath:[`subagents`,`thinking`],placeholder:`inherit`,detail:`thinking level used when the agent frontmatter does not set one. off disables thinking by default.`,options:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]},{id:`fallbackModels`,label:`fallback models`,keyPath:[`subagents`,`fallbackModels`],placeholder:`provider/model:thinking, provider/model`,detail:`comma-separated model specs, tried in order. each may include a :thinking suffix.`},{id:`excludeTools`,label:`excluded tools`,keyPath:[`subagents`,`excludeTools`],placeholder:`tool-one, tool-two`,detail:`comma-separated tool names added to the layer exclusions. existing restrictions still apply.`}].map(e=>({id:e.id,label:e.label,kind:e.models===!0||e.options!==void 0?`select`:`text`,keyPath:e.keyPath,detail:e.detail,placeholder:e.placeholder,...e.models===!0?{optionsFrom:`models`}:{},...e.options===void 0?{}:{options:e.options.map(e=>({value:e,label:e}))}}))},Te=S({...we,icon:I}),Ee=d({data:{version:1,label:`Team`,source:`subagent_runs`,destination:`agents`,icon:I}}),De=S({...we,icon:I}),Oe=`subagent_runs`,ke=`subagent_catalog`;function z(e,t){return ie(v(e),`team`,t)}function B(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function V(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Ae(e){return B(e)&&typeof e.name==`string`&&typeof e.description==`string`&&typeof e.filePath==`string`&&[`project`,`user`,`plugin`].includes(String(e.source))&&(e.packageName===void 0||typeof e.packageName==`string`)&&(e.model===void 0||typeof e.model==`string`)&&V(e.fallbackModels)&&V(e.tools)&&V(e.skills)&&V(e.extensions)&&(e.defaultContext===`fresh`||e.defaultContext===`fork`)}async function je(e,t){let n=await N.fetch(z(e,`/catalog`),{signal:t,cache:`no-store`}),r=await n.json();if(!n.ok)throw Error(B(r)&&typeof r.error==`string`?r.error:`Agent catalog could not be loaded (${n.status}).`);if(!B(r)||typeof r.cwd!=`string`||!Array.isArray(r.agents)||!r.agents.every(Ae)||!V(r.models))throw Error(`The server returned an invalid agent catalog.`);return{cwd:r.cwd,agents:r.agents,models:r.models}}async function Me(e,t){let n=await N.fetch(z(e,`/run`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(B(r)&&typeof r.error==`string`?r.error:`Agent could not be launched (${n.status}).`);if(!B(r)||typeof r.runId!=`string`||r.runId===``)throw Error(`The server returned an invalid run ID.`);return r.runId}function Ne(e){return e===`delivered`||e===`failed`||e===`pending`}async function Pe(e,t,n){let r=await N.fetch(z(e,`/steer`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({runId:t,message:n})}),i=await r.json();if(!r.ok)throw Error(B(i)&&typeof i.error==`string`?i.error:`Guidance could not be sent (${r.status}).`);if(!B(i)||!Ne(i.state)||typeof i.message!=`string`)throw Error(`The server returned an invalid steer result.`);return{state:i.state,message:i.message}}async function Fe(e,t){let n=await N.fetch(z(e,`/stop`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({runId:t})}),r=await n.json();if(!n.ok)throw Error(B(r)&&typeof r.error==`string`?r.error:`The run could not be stopped (${n.status}).`)}var H=Ce({cwd:``,agents:[],models:[],warning:void 0,loading:!1,requestId:0,open:!1,filter:``,task:``,selected:void 0,inspected:void 0,launch:void 0});function Ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Le(e,t=``){H.update(e,e=>({...e,open:!0,task:t}))}function Re(e,t){e.sessionId!==null&&(Le(e.sessionId,e.item.content),e.openTransientTab(t()))}function ze(e){H.update(e,e=>({...e,open:!1,task:``,launch:void 0}))}function Be(e){let t=new AbortController,n=H.select(H.store.state,e).requestId+1;H.update(e,e=>({...e,requestId:n,loading:!0,warning:void 0}));let r=()=>!t.signal.aborted&&H.store.state[e]?.requestId===n;return je(e,t.signal).then(t=>{r()&&Ve.apply(e,t)}).catch(t=>{r()&&H.update(e,e=>({...e,warning:t instanceof Error?t.message:String(t)}))}).finally(()=>{r()&&H.update(e,e=>({...e,loading:!1}))}),()=>{r()&&H.update(e,e=>({...e,loading:!1})),t.abort()}}var Ve=H.channel({channel:ke,parse(e){if(!Ie(e)||typeof e.cwd!=`string`||!Array.isArray(e.agents))return null;let t=Array.isArray(e.models)?e.models.filter(e=>typeof e==`string`):[];return{cwd:e.cwd,agents:e.agents.filter(Ie),models:t,...typeof e.warning==`string`?{warning:e.warning}:{}}},reduce(e,t){let n=new Set(t.agents.map(e=>e.name));return{...e,cwd:t.cwd,agents:t.agents,models:t.models,warning:t.warning,selected:e.selected!==void 0&&n.has(e.selected)?e.selected:void 0,inspected:e.inspected!==void 0&&n.has(e.inspected)?e.inspected:void 0,launch:e.launch!==void 0&&n.has(e.launch.agent)?e.launch:void 0}}}),He=6e4,Ue=60*He;function We(e){if(e<He)return`<1m`;if(e<Ue)return`${Math.floor(e/He)}m`;let t=Math.floor(e/Ue),n=Math.floor(e%Ue/He);return`${t}h ${String(n).padStart(2,`0`)}m`}function Ge(e){let t=/^\/(?:Users|home)\/[^/]+/u.exec(e);return t?`~${e.slice(t[0].length)}`:e}function Ke(e){return U(e).name}function qe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=e.identity?.split(`-`)[0];return!e.identity||!t?{name:e.agent,role:``,seed:e.agent}:{name:qe(t),role:e.agent,seed:e.identity}}var Je=i({slot:`subagents.run-actions`}),Ye=new Set([`done`,`failed`,`stopped`]);function W(e){return Ye.has(e.state)}var G=Ce({runs:[],dismissed:[],stopRequested:[],openRunId:void 0,pendingLaunch:void 0,autoOpenRunId:void 0});function Xe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ze(e,t){return e.filter(e=>e!==t)}function Qe(e){return e.runs.filter(t=>!e.dismissed.includes(t.runId)).sort((e,t)=>Number(W(e))-Number(W(t)))}function $e(e){return Qe(e).filter(e=>e.state===`queued`||e.state===`running`)}async function et(e,t){G.update(e,e=>({...e,stopRequested:[...Ze(e.stopRequested,t),t]}));try{await Fe(e,t)}catch(n){throw G.update(e,e=>({...e,stopRequested:Ze(e.stopRequested,t)})),n}}function tt(e,t){G.update(e,e=>({...e,dismissed:[...Ze(e.dismissed,t),t],openRunId:e.openRunId===t?void 0:e.openRunId}))}function nt(e,t){G.update(e,e=>({...e,pendingLaunch:{agent:t,knownRunIds:e.runs.map(e=>e.runId)}}))}function rt(e){G.update(e,e=>({...e,pendingLaunch:void 0}))}function it(e){G.update(e,e=>({...e,autoOpenRunId:void 0}))}function at(e,t){G.update(e,e=>({...e,openRunId:t}))}var ot=G.channel({channel:Oe,parse(e){return!Xe(e)||!Array.isArray(e.runs)?null:{runs:e.runs.filter(Xe)}},reduce(e,{runs:t}){let n=new Map(t.map(e=>[e.runId,e])),r=e.stopRequested.filter(e=>{let t=n.get(e);return t!==void 0&&!W(t)}),i=e.dismissed.filter(e=>n.has(e)),a=e.pendingLaunch===void 0?void 0:t.find(t=>t.agent===e.pendingLaunch?.agent&&!e.pendingLaunch.knownRunIds.includes(t.runId));return{...e,runs:t,stopRequested:r,dismissed:i,pendingLaunch:a===void 0?e.pendingLaunch:void 0,autoOpenRunId:a===void 0?e.autoOpenRunId:a.runId}}});function st(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.filter(e=>[e.name,e.source,e.packageName??``,e.description,...e.tools].some(e=>e.toLowerCase().includes(n)))}function ct(e,t){let n=new Set,r=[];for(let i of[e.model??``,...e.fallbackModels,...t])i===``||n.has(i)||(n.add(i),r.push(i));return r}var lt={project:`Project`,user:`User`,plugin:`Package`};function ut({label:e,value:t,onChange:n,options:r,disabled:i}){return T(xe,{disabled:i,value:t,onValueChange:n,children:[R(he,{"aria-label":e,className:`h-9 w-full`,children:R(de,{})}),R(ae,{children:r.map(([e,t])=>R(se,{value:e,children:t},e))})]})}function dt({agents:e,models:t,initialSearch:n=``,initialSelected:r,initialTask:i=``,initialFork:a,loading:o=!1,warning:s,cwd:c=``,catalogNote:l,runNote:u,onClose:d,onLaunch:f,onSource:p}){let[m,h]=C(n),[g,v]=C(`all`),[b,x]=C(r),[S,ee]=C(i),[ie,w]=C(a===void 0?void 0:a?`fork`:`fresh`),[E,ae]=C(`default`),[D,se]=C(!1),le=ce(!1),[ue,A]=C(),j=st(e,m).filter(e=>g===`all`||e.source===g),M=b===void 0?j[0]:j.find(e=>e.name===b),de=ie??M?.defaultContext??`fresh`,N=e=>{x(e.name),w(e.defaultContext),ae(`default`),A(void 0)},P=async()=>{if(!(!M||o||le.current)){le.current=!0,se(!0),A(void 0);try{await f({agent:M.name,task:S,fork:de===`fork`,...E==="default"?{}:{model:E}})}catch(e){A(e instanceof Error?e.message:String(e))}finally{le.current=!1,se(!1)}}},I=E==="default"?M?.model??`Runtime default`:E,L=de===`fresh`?`Fresh context`:`This conversation`;return T(ne,{"data-testid":`launch-dialog`,className:`w-6xl`,"aria-describedby":`launcher-description`,children:[R(_,{dismissible:!0,closeLabel:`Close new agent run`,className:`p-6 sm:px-6`,children:T(`div`,{className:`space-y-1`,children:[R(oe,{children:`New agent run`}),R(te,{id:`launcher-description`,children:`Choose an agent, review its setup, then give it a task.`})]})}),T(`div`,{className:`grid min-h-0 overflow-y-auto md:grid-cols-3`,children:[T(`aside`,{"aria-label":`Agent catalog`,onKeyDown:e=>{if(!(D||e.target.getAttribute(`role`)===`combobox`)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=j.findIndex(e=>e.name===M?.name),n=j[(t+(e.key===`ArrowDown`?1:-1)+j.length)%j.length];n&&N(n)}if(e.target.tagName!==`INPUT`&&(e.key===`f`&&w(`fork`),e.key===`i`)){let t=e.currentTarget.parentElement?.querySelector(`details`);t&&(t.open=!t.open)}}},className:`flex flex-col gap-3 border-b border-po-border p-5 md:border-r md:border-b-0`,children:[R(y,{autoFocus:!0,"data-testid":`catalog-filter`,disabled:D,"aria-label":`Find an agent`,placeholder:`Find an agent…`,value:m,onChange:e=>h(e.target.value)}),R(ut,{disabled:D,label:`Source filter`,value:g,onChange:v,options:[[`all`,`All sources`],[`project`,`Project`],[`user`,`User`],[`plugin`,`Package`]]}),T(`div`,{className:`flex flex-col gap-1 py-2`,children:[o?R(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Loading agents…`}):null,s?R(`p`,{role:`alert`,className:`text-sm text-po-red`,children:s}):null,j.map(e=>T(k,{variant:`ghost`,size:`card`,"aria-pressed":M?.name===e.name,className:M?.name===e.name?`border-l-4 border-po-green bg-po-selected/15`:`border-l-4 border-transparent`,disabled:D,onClick:()=>{N(e)},children:[R(`span`,{className:`font-semibold text-po-hi`,children:e.name}),R(`span`,{className:`text-sm text-po-dim`,children:e.description.split(`.`)[0]}),T(`span`,{className:`text-sm text-po-dim`,children:[lt[e.source],` · `,e.model??`Default model`]})]},e.name)),j.length===0&&!o?T(`div`,{className:`space-y-3 py-6`,children:[R(`p`,{className:`text-base text-po-hi`,children:`No matching agents`}),R(`p`,{className:`text-sm text-po-dim`,children:`Try another name or source.`}),R(k,{onClick:()=>{h(``),v(`all`)},children:`Clear filters`})]}):null]}),T(`p`,{className:`mt-auto text-sm text-po-dim`,children:[j.length,` agents`,l?` · ${l}`:``]})]}),R(`section`,{className:`space-y-5 p-6 md:col-span-2`,"aria-label":`Agent definition and run`,children:M?T(F,{children:[T(`div`,{className:`space-y-2`,children:[R(`p`,{className:`text-sm text-po-dim`,children:`Agent definition`}),T(`div`,{className:`flex items-center gap-3`,children:[R(`h2`,{className:`text-2xl font-semibold text-po-hi`,children:M.name}),R(O,{children:lt[M.source]})]}),R(`p`,{className:`text-base text-po-text`,children:M.description}),R(`p`,{className:`break-all font-mono text-sm text-po-dim`,children:p?.(M)?R(`button`,{type:`button`,className:`text-left text-po-green underline`,onClick:p(M),children:M.filePath}):M.filePath}),M.packageName?R(`p`,{className:`text-sm text-po-dim`,children:M.packageName}):null,T(`details`,{className:`text-base text-po-text`,children:[R(`summary`,{className:`cursor-pointer text-po-green`,children:`View instructions`}),R(`p`,{className:`mt-2 whitespace-pre-wrap rounded-md bg-po-deep p-3 text-sm`,children:p?.(M)?R(k,{variant:`link`,onClick:p(M),children:`Open source instructions`}):`Instructions stay in the source definition. File viewing is not available in this host.`})]})]}),R(`dl`,{className:`grid gap-x-6 gap-y-3 text-base sm:grid-cols-2`,children:[[`Model`,M.model??`Runtime default`],[`Tools`,M.tools.length?M.tools.join(` · `):`All session tools (not narrowed)`],[`Fallback models`,M.fallbackModels.join(` · `)||`None specified`],[`Skills`,M.skills.join(` · `)||`None specified`],[`Default context`,M.defaultContext===`fresh`?`Fresh`:`This conversation`],[`Extensions`,M.extensions.join(` · `)||`None specified`]].map(([e,t])=>T(`div`,{className:`space-y-1`,children:[R(`dt`,{className:`text-sm text-po-dim`,children:e}),R(`dd`,{className:`break-words text-po-text`,children:t})]},e))}),T(`div`,{className:`space-y-3 border-t border-po-border pt-4`,children:[R(`h3`,{className:`text-lg font-semibold text-po-hi`,children:`This run`}),T(`label`,{className:`flex flex-col gap-1 text-base text-po-text`,children:[`Task`,R(fe,{"data-testid":`launch-task`,disabled:D,placeholder:`What should the agent do? Leave empty to use its own prompt.`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),P())},rows:3,value:S,onChange:e=>{ee(e.target.value),A(void 0)}})]}),T(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[T(`div`,{className:`space-y-1`,children:[R(`p`,{className:`text-base text-po-text`,children:`Context`}),R(ut,{disabled:D,label:`Context`,value:de,onChange:w,options:[[`fresh`,`Fresh context`],[`fork`,`This conversation`]]}),R(`p`,{className:`text-sm text-po-dim`,children:`Start clean, or include this conversation.`})]}),T(`div`,{className:`space-y-1`,children:[R(`p`,{className:`text-base text-po-text`,children:`Model override`}),R(ut,{disabled:D,label:`Model override`,value:E,onChange:ae,options:[[`default`,`Use agent default`],...ct(M,t).map(e=>[e,e])]}),R(`p`,{className:`text-sm text-po-dim`,children:`Changes apply only to this run.`})]})]})]})]}):R(`p`,{className:`py-12 text-base text-po-dim`,children:`Choose an agent to review its definition. Clear the filters if no agents match.`})})]}),T(re,{variant:`bar`,className:`gap-3 p-4 sm:px-6 sm:py-4`,children:[T(`div`,{className:`min-w-0 flex-1 space-y-1 text-sm text-po-dim`,children:[R(`p`,{className:`break-words`,children:M?`${M.name} · ${L} · ${I}`:`No agent selected`}),R(`p`,{role:`status`,children:u??`Enter starts the run · Shift+Enter for a new line${c?` · ${c}`:``}`}),ue?R(`p`,{role:`alert`,className:`text-po-red`,children:ue}):null]}),R(k,{"data-testid":`launch-cancel`,onClick:d,children:`Cancel`}),R(k,{"data-testid":`launch-submit`,variant:`primary`,disabled:!M||D||o,onClick:()=>void P(),children:D?`Starting…`:`Start run`})]})]})}function ft({sessionId:e,agent:t,agents:n,loading:r,warning:i,onSource:a,cwd:o,models:s,fork:c,initialTask:l,onClose:u,onLaunched:d}){return R(ge,{open:!0,onOpenChange:e=>{e||u()},children:R(dt,{agents:n??(t?[t]:[]),models:s,initialSelected:t?.name,initialTask:l,initialFork:c,loading:r,warning:i,cwd:o,onSource:a,onClose:u,onLaunch:async t=>{nt(e,t.agent);try{await Me(e,t),d()}catch(t){throw rt(e),t}}})})}function pt({sessionId:e,onClose:t,onSource:n}){let r=w(H.store,t=>H.select(t,e));return R(ft,{sessionId:e,agents:r.agents,agent:r.agents.find(e=>e.name===(r.launch?.agent??r.selected)),cwd:r.cwd,models:r.models,fork:r.launch?.fork,initialTask:r.task,loading:r.loading,warning:r.warning,onSource:n,onClose:t,onLaunched:t})}var mt={queued:{label:`QUEUED`,tone:`neutral`},running:{label:`RUNNING`,tone:`running`},done:{label:`DONE`,tone:`ok`},failed:{label:`FAILED`,tone:`error`},stopped:{label:`STOPPED`,tone:`neutral`}};function ht(e,t){let n=e.endedAt??(e.state===`running`||e.state===`queued`?t:e.lastUpdate);return We(Math.max(0,n-e.startedAt))}function gt({run:e}){let t=ce(null),[n]=C(Date.now);return D(()=>{let n,r=()=>{let i=t.current?.firstChild,a=Date.now();i&&(i.nodeValue=ht(e,a)),!W(e)&&e.endedAt===void 0&&(n=setTimeout(r,6e4-Math.max(0,a-e.startedAt)%6e4))};return r(),()=>clearTimeout(n)},[e]),R(`span`,{ref:t,children:ht(e,n)})}function _t({sessionId:e,run:t,stopping:n}){let[r,i]=C(),a=(e,t)=>{e.stopPropagation(),t()},o=()=>{i(void 0),et(e,t.runId).catch(e=>i(e instanceof Error?e.message:String(e)))};return W(t)?R(k,{variant:`outline`,size:`xs`,"data-testid":`run-clear-${t.runId}`,title:`clear this run from the grid`,onClick:n=>a(n,()=>tt(e,t.runId)),children:`clear`}):T(F,{children:[r?R(`span`,{role:`alert`,"data-testid":`run-stop-error-${t.runId}`,title:r,className:`min-w-0 truncate text-sm text-po-red`,children:r}):null,R(k,{variant:n?`outline`:`danger-outline`,size:`xs`,"data-testid":`run-stop-${t.runId}`,"data-stopping":n,disabled:n,title:n?`stop requested; the run reports its own final state`:`ask the runtime to stop this run`,onClick:e=>a(e,o),children:n?`stopping…`:`stop`})]})}var K=`Not reported`,vt={done:`This run has finished. Start a new run from Agents.`,failed:`This run failed. Start a new run from Agents.`,stopped:`This run was stopped. Start a new run from Agents.`};function q({label:e,children:t}){return T(`div`,{className:`flex gap-3`,children:[R(`span`,{className:`w-24 shrink-0 text-sm text-po-dim`,children:e}),R(`div`,{className:`min-w-0 flex-1 break-words text-base text-po-text`,children:t})]})}function yt({run:e}){let t=[e?.toolCount===void 0?void 0:`${e.toolCount} tools`,e?.tokens===void 0?void 0:`${e.tokens.toLocaleString()} tokens`].filter(Boolean).join(` · `);return T(F,{children:[T(q,{label:`Agent`,children:[R(`span`,{className:`font-semibold text-po-hi`,children:e?.agent??K}),e?.agentDescription?R(`p`,{className:`text-po-dim`,children:e.agentDescription}):null,e?.agentFilePath?R(`p`,{className:`font-mono text-sm text-po-dim`,children:e.agentFilePath}):null]}),T(q,{label:`Model`,children:[e?.model??K,e?.model&&e.modelSource===`configured`?R(`span`,{className:`text-po-dim`,children:` · configured, not confirmed by the runtime`}):null]}),R(q,{label:`Thinking`,children:R(`span`,{className:`capitalize`,children:e?.thinking??K})}),R(q,{label:`Prompt`,children:e?.promptWithheld?R(`span`,{className:`text-po-dim`,children:`Withheld: this task was marked sensitive.`}):R(`pre`,{className:`max-h-40 overflow-y-auto rounded-md bg-po-deep px-3 py-2 font-sans whitespace-pre-wrap break-words`,children:e?.task||K})}),e?.taskRef?R(q,{label:`Task`,children:R(O,{tone:`violet`,size:`xs`,className:`rounded-sm bg-po-violet/10`,children:e.taskRef})}):null,R(q,{label:`Folder`,children:R(`span`,{className:`font-mono text-sm`,children:e?.cwd?Ge(e.cwd):K})}),R(q,{label:`Usage`,children:R(`span`,{className:`text-po-dim`,children:t||K})})]})}function bt({run:t,gone:n,elapsed:r,stopControl:i,thread:o,canSteer:s,stopping:c,guidance:l,sending:u,error:d,notice:f,onGuidanceChange:p,onSubmit:m,initialInfoOpen:h=!1}){let[g,_]=C(h),v=pe(),y=t?mt[t.state]:void 0,b={variant:`outline`,size:`md`,className:`min-w-0 max-w-full gap-2`,"aria-expanded":g,"aria-controls":v,onClick:()=>_(e=>!e)},x=t&&W(t)?vt[t.state]:t?.canSteer===!1&&!n?`This runtime does not take guidance while it runs.`:`Guidance is unavailable for this run.`;return T(`div`,{"data-testid":`agent-thread-panel`,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-po-bg`,children:[T(`div`,{"data-testid":`agent-thread-header`,className:`flex h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft bg-po-rail px-[26px]`,children:[t?R(e,{name:U(t).name,seed:U(t).seed,size:`sm`}):null,R(`span`,{"data-testid":`agent-thread-agent`,className:`min-w-0 shrink truncate text-base font-semibold text-po-hi`,children:t?Ke(t):`Agent run`}),t&&U(t).role?R(`span`,{className:`min-w-0 shrink truncate text-sm text-po-dim`,children:U(t).role}):null,y?R(a,{tone:y.tone,"data-testid":`agent-thread-state`,className:`shrink-0`,children:c&&t&&!W(t)?`STOPPING…`:y.label}):null,R(`span`,{className:`min-w-0 flex-1 truncate text-sm text-po-dim`,children:r}),i]}),n?R(`div`,{"data-testid":`agent-thread-gone`,className:`shrink-0 border-b border-po-border-soft px-[26px] py-2 text-sm text-po-dim`,children:`This run is no longer listed. Its thread stays readable.`}):null,R(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:o}),R(`section`,{id:v,"aria-label":`Run info`,"data-testid":`run-info`,hidden:!g,className:`mx-[26px] mb-2 flex max-h-[40vh] shrink-0 flex-col gap-3 overflow-y-auto rounded-lg border border-po-border bg-po-panel px-4 py-3`,children:R(yt,{run:t})}),s?R(`form`,{"data-testid":`agent-steer-composer`,className:`shrink-0 px-[26px] pt-2 pb-2`,onSubmit:e=>{e.preventDefault(),m()},children:T(`div`,{className:`rounded-lg border border-po-border bg-po-panel transition-colors focus-within:border-po-blue/60`,children:[R(fe,{variant:`bare`,"data-testid":`agent-steer-input`,"aria-label":`Steering guidance`,rows:2,value:l,readOnly:u,disabled:c,placeholder:c?`Stopping, guidance paused`:`Guide this agent · it reads this at its next step`,className:`w-full px-4 pt-3 text-lg leading-relaxed`,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),d?R(`p`,{role:`alert`,"data-testid":`agent-steer-error`,className:`px-4 pt-1 text-sm text-po-red`,children:d}):null,T(`div`,{className:`flex items-center gap-3 px-4 pt-1 pb-3`,children:[R(`span`,{className:`min-w-0 flex-1`}),R(`span`,{role:`status`,"data-testid":`agent-steer-hint`,title:f,className:`min-w-0 truncate text-sm text-po-dim`,children:f??`Shift + Enter for a new line`}),T(k,{"data-testid":`agent-steer-submit`,type:`submit`,variant:`primary`,size:`lg`,className:`shrink-0 gap-2`,disabled:c||u||l.trim()===``,children:[R(le,{className:`size-4`}),u?`Sending…`:`Send`]})]})]})}):R(`div`,{"data-testid":`agent-thread-end`,className:`shrink-0 px-[26px] pt-3 pb-2 text-sm text-po-dim`,children:x}),T(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 px-[26px] pb-4`,children:[T(k,{...b,"data-testid":`run-chip-agent`,children:[R(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-po-magenta`}),R(`span`,{className:`truncate`,children:t?.agent??`Agent`}),R(j,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]}),T(k,{...b,"data-testid":`run-chip-model`,children:[R(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-po-green`}),R(`span`,{className:`truncate`,children:t?.model?t.model.split(`/`).pop()??t.model:`Model not reported`}),t?.thinking?R(`span`,{className:`shrink-0 text-po-dim`,children:t.thinking}):null,R(j,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]}),T(k,{...b,"data-testid":`run-chip-prompt`,children:[R(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-po-blue`}),`Prompt`,R(j,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]})]})]})}var xt=`subagents-run-`;function St(e){let t=e.runId;return{id:`${xt}${t}`,label:Ke(e),panel:e=>R(Ct,{...e,runId:t},`${e.sessionId}:${t}`)}}function Ct({sessionId:e,runId:t,renderThread:n}){let{runs:r,stopRequested:i}=w(G.store,t=>G.select(t,e)),a=r.find(e=>e.runId===t),[o,s]=C(a);a!==void 0&&a!==o&&s(a);let c=a??o,l=a===void 0,[u,d]=C(``),[f,p]=C(!1),[m,h]=C(),[g,_]=C(),v=e!==null&&a!==void 0&&!W(a),y=i.includes(t),b=v&&a.canSteer!==!1,x=async()=>{let n=u.trim();if(b&&!y&&n&&!f){p(!0),h(void 0),_(void 0);try{let r=await Pe(e,t,n);if(r.state===`failed`){h(r.message);return}d(``),r.state===`pending`&&_(r.message)}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}};return R(bt,{run:c,gone:l,elapsed:c?R(gt,{run:l?{...c,endedAt:c.endedAt??c.lastUpdate}:c}):void 0,stopControl:v?R(_t,{sessionId:e,run:a,stopping:y}):void 0,thread:n(t),canSteer:b,stopping:y,guidance:u,sending:f,error:m,notice:g,onGuidanceChange:d,onSubmit:()=>void x()})}var wt=`subagents-fleet`,Tt=8;function Et({run:e}){let t=e.task.split(`
2
- `).find(e=>e.trim()!==``)??``;return e.taskRef?T(`div`,{className:`flex items-center gap-2 px-3 pb-2.5`,children:[T(O,{tone:`violet`,size:`xs`,className:`shrink-0 rounded-sm bg-po-violet/10`,children:[`TASK `,e.taskRef]}),R(`span`,{"data-testid":`run-work`,className:`min-w-0 truncate text-base text-po-hi`,children:t})]}):T(`div`,{className:`flex items-center gap-2 px-3 pb-2.5`,children:[R(`span`,{className:`shrink-0 text-base font-medium text-po-dim`,children:`Prompt`}),R(`span`,{"data-testid":`run-work`,className:`min-w-0 truncate text-base text-po-dim`,children:t})]})}function Dt({sessionId:e,run:t,stopping:n,onOpenThread:r,onOpenDetail:i}){let[a,o]=C();return T(F,{children:[a?R(`span`,{role:`alert`,"data-testid":`run-menu-stop-error-${t.runId}`,title:a,className:`min-w-0 truncate text-sm text-po-red`,children:a}):null,T(ve,{children:[R(E,{asChild:!0,children:R(k,{variant:`ghost`,size:`icon`,"data-testid":`run-menu-${t.runId}`,title:`what this run can do`,"aria-label":`run actions`,onClick:e=>e.stopPropagation(),children:R(Se,{className:`h-3 w-3`})})}),T(ue,{"data-testid":`run-menu-content-${t.runId}`,children:[R(L,{"data-testid":`run-open-${t.runId}`,onSelect:r,children:`open thread`}),R(L,{"data-testid":`run-detail-${t.runId}`,onSelect:i,children:`details`}),R(ye,{}),W(t)?R(L,{"data-testid":`run-clear-${t.runId}`,onSelect:()=>tt(e,t.runId),children:`clear from the grid`}):R(L,{variant:`destructive`,"data-testid":`run-stop-${t.runId}`,"data-stopping":n,disabled:n,onSelect:()=>{o(void 0),et(e,t.runId).catch(e=>o(e instanceof Error?e.message:String(e)))},children:n?`stopping…`:`stop`})]})]})]})}function Ot({sessionId:t,run:n,stopping:r,renderThread:i,onOpenThread:o,onOpenDetail:s}){let c=mt[n.state],l=U(n);return R(b,{asChild:!0,className:me(`flex h-[280px] min-w-0 flex-col text-left transition-colors outline-none hover:border-po-blue/50 focus-within:border-po-blue`,be[c.tone]),children:T(`div`,{"data-testid":`run-card-${n.runId}`,"data-run-state":n.state,children:[T(`div`,{role:`button`,tabIndex:0,"data-testid":`run-open-card-${n.runId}`,className:`flex min-h-0 flex-1 cursor-pointer flex-col outline-none`,title:`open this run's own thread in a tab`,onClick:o,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},children:[T(`div`,{className:`flex items-center gap-2 px-3 pt-2.5 pb-1.5`,children:[R(e,{name:l.name,seed:l.seed,size:`sm`}),R(`span`,{"data-testid":`run-agent`,className:`truncate text-base font-semibold text-po-hi`,children:l.name}),l.role?R(`span`,{className:`truncate text-sm text-po-dim`,children:l.role}):null,R(`span`,{className:`min-w-0 flex-1`}),R(`span`,{className:`shrink-0 text-sm text-po-dim`,children:R(gt,{run:n})}),R(a,{tone:c.tone,"data-testid":`run-state`,children:c.label})]}),R(Et,{run:n}),R(`div`,{"data-testid":`run-stream`,className:`pointer-events-none flex min-h-0 flex-1 flex-col overflow-hidden border-t border-po-border-soft bg-po-deep`,children:i(n.runId,{limit:Tt,compact:!0})}),n.state===`failed`&&n.error?R(`span`,{"data-testid":`run-error`,className:`truncate border-t border-po-border-soft px-3 py-1.5 text-sm text-po-red`,children:n.error}):null]}),T(`div`,{className:`flex shrink-0 items-center gap-3 border-t border-po-border-soft px-3 py-1.5`,children:[T(`span`,{className:`truncate text-sm text-po-dim`,children:[n.toolCount===void 0?`—`:`${n.toolCount} tools`,n.tokens===void 0?``:` · ${n.tokens.toLocaleString()} tk`,n.model?` · ${n.model.split(`/`).pop()??n.model}`:``]}),R(`span`,{className:`min-w-0 flex-1`}),R(Dt,{sessionId:t,run:n,stopping:r,onOpenThread:o,onOpenDetail:s})]})]})})}function J({label:e,value:t,tone:n=`text-po-dim`}){return T(`div`,{className:`flex gap-2.5`,children:[R(`span`,{className:`w-11 shrink-0 text-sm text-po-dim`,children:e}),R(`span`,{className:`min-w-0 break-words text-base ${n}`,children:t})]})}function kt({label:e,text:t,testId:n,tone:r}){return T(`div`,{className:`flex flex-col gap-1 rounded-md border border-po-border bg-po-deep px-3 py-2.5`,children:[R(`span`,{className:`text-base font-medium text-po-dim`,children:e}),R(`pre`,{"data-testid":n,className:`overflow-x-auto whitespace-pre-wrap break-words text-base leading-relaxed ${r??`text-po-text`}`,children:t})]})}function At({sessionId:e,run:t,stopping:n,renderSlot:r,onClose:i}){let o=mt[t.state];return R(A,{open:!0,onOpenChange:e=>{e||i()},children:T(g,{"data-testid":`run-sheet`,"aria-describedby":void 0,children:[T(s,{closeLabel:`close the run detail`,children:[R(l,{"data-testid":`sheet-agent`,children:Ke(t)}),R(a,{tone:o.tone,children:o.label}),R(`span`,{className:`min-w-0 flex-1`}),R(`span`,{className:`text-sm text-po-dim`,children:R(gt,{run:t})}),r(Je.slot),R(_t,{sessionId:e,run:t,stopping:n})]}),T(f,{children:[T(`div`,{className:`flex flex-col gap-1.5`,children:[R(J,{label:`run`,value:t.runId}),t.taskRef?R(J,{label:`task`,value:t.taskRef,tone:`text-po-violet`}):null,R(J,{label:`model`,value:t.model??`the runtime default`}),R(J,{label:`cwd`,value:Ge(t.cwd)}),R(J,{label:`work`,value:`${t.toolCount===void 0?`no`:String(t.toolCount)} tools${t.tokens===void 0?``:` · ${t.tokens.toLocaleString()} tk`}`})]}),R(kt,{label:`PROMPT FROM THE MAIN AGENT`,testId:`sheet-task`,text:t.task||`(no prompt recorded)`}),t.summary?R(kt,{label:`REPORT`,testId:`sheet-summary`,text:t.summary}):null,t.error?R(kt,{label:`FAILURE`,testId:`sheet-error`,text:t.error,tone:`text-po-red`}):null]})]})})}function jt({sessionId:e,renderSlot:t,renderThread:n,openTransientTab:r,fileTabFor:i}){let a=w(G.store,t=>Qe(G.select(t,e))),{openRunId:o,stopRequested:s,autoOpenRunId:c}=w(G.store,t=>G.select(t,e)),l=w(H.store,t=>H.select(t,e));D(()=>{if(e!==null&&l.open)return Be(e)},[e,l.open]),D(()=>{if(c===void 0||e===null)return;let t=a.find(e=>e.runId===c);t&&r(St(t)),it(e)},[c,a,e,r]);let u=o===void 0?void 0:a.find(e=>e.runId===o),d=e=>s.includes(e.runId),f=a.filter(e=>e.state===`running`||e.state===`queued`).length,p=a.filter(e=>e.state===`done`).length,m=a.filter(e=>e.state===`failed`||e.state===`stopped`).length;return T(`div`,{"data-testid":`subagents-panel`,className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[T(`div`,{className:`@container flex min-w-0 flex-1 flex-col overflow-y-auto px-3 py-3 sm:px-[26px] sm:py-[18px]`,children:[T(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 pb-3`,children:[R(`span`,{className:`text-lg font-semibold text-po-hi`,children:`Agents · this session`}),R(`span`,{className:`hidden min-w-0 flex-1 sm:block`}),R(`span`,{"data-testid":`subagents-tally`,className:`order-3 w-full text-sm text-po-dim sm:order-none sm:w-auto`,children:a.length===0?`no runs yet`:`${f} running · ${p} done · ${m} failed`}),R(k,{variant:`primary`,className:`ml-auto sm:ml-0`,"data-testid":`subagents-launch`,title:`pick an agent from the catalog and launch it`,onClick:()=>{e!==null&&(at(e,void 0),Le(e))},children:`New agent run`})]}),a.length===0?T(`div`,{"data-testid":`subagents-empty`,className:`text-base text-po-dim`,children:[R(`p`,{children:`No runs yet`}),R(`p`,{children:`Start an agent run to get help with your work.`}),R(`p`,{className:`py-32 text-center text-sm`,children:`Agent runs will appear here once you start one.`})]}):T(F,{children:[R(`div`,{"data-testid":`subagents-grid`,className:`grid grid-cols-1 gap-4 @2xl:grid-cols-2`,children:e===null?null:a.map(t=>R(Ot,{sessionId:e,run:t,stopping:d(t),renderThread:n,onOpenThread:()=>{ze(e),r(St(t))},onOpenDetail:()=>{ze(e),at(e,t.runId)}},t.runId))}),R(`span`,{className:`pt-3 text-sm text-po-dim`,children:`click a card to open the run's thread · the card menu holds details, stop and clear · finished runs leave the grid after 10m`})]})]}),e!==null&&l.open?R(pt,{sessionId:e,onClose:()=>ze(e),onSource:t=>{let n=i(t.filePath);return n?()=>{ze(e),r(n)}:void 0}}):null,u&&e!==null?R(At,{sessionId:e,run:u,stopping:d(u),renderSlot:t,onClose:()=>at(e,void 0)}):null]})}function Y(){return{id:wt,label:`Agents`,panel:jt}}var Mt=M({label:`Launch Agent`,detail:`Choose an agent, review the task, then launch it.`,kinds:[`work-item`],order:10,run:e=>Re(e,Y)}),Nt=t({keys:`a r`,icon:I,statusKey:`po-team-agents`,activeSource:{subscribe(e){let t=G.store.subscribe(e);return()=>t.unsubscribe()},isActive(e){return $e(G.select(G.store.state,e)).some(e=>!W(e))}},transientTab:Y,order:10}),Pt=p(Ve),Ft=p(ot),It={queued:`waiting`,running:`running`,done:`done`,failed:`failed`,stopped:`done`};function Lt(e){return e.state===`failed`&&e.error?e.error:e.summary?e.summary.split(`
3
- `).find(e=>e.trim()!==``)??``:e.currentTool??e.tail.at(-1)??(e.state===`running`?``:e.state)}function Rt({sessionId:t,openTransientTab:n}){let r=w(G.store,e=>$e(G.select(e,t)));return r.length===0?T(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[R(`p`,{"data-testid":`activity-summary-agents`,className:`text-sm text-po-dim`,children:`Idle`}),T(k,{variant:`link`,size:`sm`,"data-testid":`activity-agents-launch`,className:`h-auto gap-1 px-0 text-sm text-po-green`,onClick:()=>{t!==null&&(Le(t),n(Y()))},children:[`Launch an agent`,R(u,{"aria-hidden":!0,className:`size-3.5`})]})]}):R(`div`,{"data-testid":`activity-agent-runs`,className:`flex flex-col gap-0.5`,children:r.map(r=>{let i=U(r),a=Lt(r);return R(k,{variant:`ghost`,size:`card`,"data-testid":`activity-run-${r.runId}`,"data-run-state":r.state,title:`open this run's conversation`,onClick:()=>{t!==null&&n(St(r))},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:T(`span`,{className:`flex min-w-0 items-center gap-2`,children:[R(e,{name:i.name,seed:i.seed,state:It[r.state],size:`sm`}),T(`span`,{className:`flex min-w-0 flex-1 flex-col text-left`,children:[T(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[R(`span`,{className:`truncate text-base font-semibold text-po-hi`,children:i.name}),i.role?R(`span`,{className:`truncate text-sm text-po-dim`,children:i.role}):null]}),a?R(`span`,{className:`truncate text-sm ${r.state===`failed`?`text-po-red`:`text-po-dim`}`,children:a}):null]}),T(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[R(gt,{run:r}),r.toolCount===void 0?``:` · ${r.toolCount} tools`]})]})},r.runId)})})}var zt=d({component:Rt}),Bt={key:`a`,label:`agents`,detail:`subagent resources and runs`},Vt=h({path:[Bt,{key:`l`,label:`launch`,detail:`pick an agent and launch it`}],run:e=>{e.sessionId!==null&&Le(e.sessionId),e.openTransientTab(Y())}}),Ht=h({path:[Bt,{key:`r`,label:`runs`,detail:`runs in this session`}],run:e=>e.openTransientTab(Y())}),Ut=x({description:`Render an action beside the stop control in a subagent run detail sheet, using that run's props.`}),Wt=72,Gt=`…`;function X(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Z(e){return typeof e==`string`?e:``}function Kt(e){switch(e.action){case`agents`:return Z(e.name);case`run`:{let t=Array.isArray(e.requests)?e.requests:[],n=t.map(e=>X(e)?Z(e.agent):``).filter(Boolean),r=`${t.length} agent${t.length===1?``:`s`}`;return n.length>0?`${r} · ${n.join(`, `)}`:r}case`status`:return e.id?`run`:`fleet`;default:return``}}function qt(e){let t=e.split(`
4
- `);for(;t.length>0&&t.at(-1)?.trim()===``;)t.pop();return t.length===1&&t[0]===``?[]:t}function Jt(e,t){let n=qt(e);if(t.isPartial)return{lines:n.slice(-12),glyph:`running`,hidden:0};let r=t.expanded?n:n.slice(0,12),i=n.length-r.length;return t.isError?{lines:r,glyph:`failed`,hidden:i}:i>0?{lines:r,glyph:`more`,hidden:i}:r.length===0?{lines:r,glyph:`done`,hidden:0}:{lines:r,glyph:`none`,hidden:0}}function Q(e){let t=e.replace(/\s+/g,` `).trim();return t.length>Wt?`${t.slice(0,71)}${Gt}`:t}function Yt(e){return Array.isArray(e)?e.filter(X):[]}function Xt(e){return e.filter(e=>typeof e==`string`&&e.trim()!==``).join(` · `)}function Zt(e){if(e===`failed`||e===`error`)return`failed`;if(e===`running`||e===`starting`)return`running`;if(e===`queued`)return`waiting`;if(e===`complete`||e===`completed`||e===`stopped`)return`done`}function Qt(e){return e===`failed`||e===`error`?`error`:e===`complete`||e===`completed`?`ok`:e===`running`||e===`starting`?`running`:`idle`}function $t(e,t){return e===0?`no ${t}s`:`${e} ${t}${e===1?``:`s`}`}function en(e){let t=Yt(e).map((e,t)=>({key:`${Z(e.name)}-${t}`,label:Z(e.name),seed:Z(e.name),detail:Q(Z(e.description)),state:Z(e.source),tone:`idle`}));return{kind:`agents`,rows:t,summary:$t(t.length,`agent`),tone:`idle`}}function tn(e){let t=Yt(e).map((e,t)=>{let n=Z(e.runId);return{key:n||`${Z(e.agent)}-${t}`,label:Z(e.agent),seed:Z(e.agent),avatar:n?`running`:`failed`,detail:Q(Z(n?e.task:e.error))||(n?``:`unknown error`),state:n?`started`:`failed`,tone:n?`ok`:`error`}}),n=t.filter(e=>e.state===`started`).length,r=t.length-n;return{kind:`run`,rows:t,summary:r===0?`${n} started`:`${n} started · ${r} failed`,tone:r===0?`ok`:`error`}}function nn(e){let t=Yt(e).map((e,t)=>{let n=Z(e.status)||`starting`,r=U({agent:Z(e.agent),identity:Z(e.identity)||void 0});return{key:Z(e.runId)||`run-${t}`,label:r.name,seed:r.seed,avatar:Zt(n),detail:Q(Xt([r.role,e.currentTool,e.activityState,e.attentionReason,e.error])),state:n,tone:Qt(n)}});return{kind:`fleet`,rows:t,summary:$t(t.length,`run`),tone:`idle`}}function rn(e){let t=Z(e.runId),n=X(e.status)?e.status:void 0,r=n?Z(n.state):``;if(!r)return{kind:`status`,rows:[],summary:`no status yet`,tone:`idle`};let i=U({agent:Z(n?.agent),identity:Z(n?.identity)||void 0});return{kind:`status`,rows:[{key:t,label:i.name,seed:i.seed,avatar:Zt(r),detail:Q(Xt([i.role,n?.activityState,n?.summary,n?.error])),state:r,tone:Qt(r)}],summary:``,tone:Qt(r)}}function an(e,t){return{kind:`control`,rows:[],summary:e,tone:t}}function on(e){if(!X(e)||e.partial===!0)return null;if(Array.isArray(e.agents))return en(e.agents);if(Array.isArray(e.outcomes))return tn(e.outcomes);if(X(e.spawn)&&Array.isArray(e.spawn.outcomes))return tn(e.spawn.outcomes);if(Array.isArray(e.runs))return nn(e.runs);if(Array.isArray(e.fleet))return nn(e.fleet);if(X(e.control))return an(`stop requested`,`ok`);if(X(e.steer)){let t=Z(e.steer.state);return an(`steer ${t}${e.steer.message?`: ${Q(Z(e.steer.message))}`:``}`,t===`failed`?`error`:`ok`)}return typeof e.runId==`string`?rn(e):null}function sn(e,t){let n=Z(e.action),r=X(t)?Z(t.toName).trim():``;switch(n){case`send`:case`ask`:return{action:n,target:r||Z(e.to),message:Q(Z(e.message))};case`reply`:return{action:n,target:Z(e.requestId),message:Q(Z(e.message))};default:return{action:n,target:``,message:``}}}function cn(e){return X(e)?e.delivered===!0?{outcome:`delivered`,who:Z(e.to),reply:``}:e.state===`queued`?{outcome:`queued`,who:Z(e.to),reply:``}:typeof e.reply==`string`?{outcome:`answered`,who:Z(e.from),reply:e.reply}:typeof e.requestId==`string`&&typeof e.to==`string`?{outcome:`replied`,who:e.to,reply:``}:{outcome:`none`,who:``,reply:``}:{outcome:`none`,who:``,reply:``}}function ln(e){return X(e)?Z(e.sender):``}var un={delivered:{tone:`neutral`,glyph:`✓`,text:`Delivered`},queued:{tone:`running`,glyph:void 0,text:`Queued, not yet confirmed`},replied:{tone:`neutral`,glyph:`✓`,text:`Replied`}},dn={ask:`Asked`,send:`Message`,reply:`Reply`};function fn({name:t,chip:n,state:r,testId:i,children:a}){return T(`div`,{"data-testid":i,className:`flex items-start gap-2`,children:[R(e,{name:t,size:`sm`,...r?{state:r}:{}}),T(`div`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[T(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[R(`span`,{className:`truncate font-semibold text-po-hi`,children:t}),n]}),a]})]})}function pn({args:t,result:i,output:a,running:s,isError:l}){let u=sn(t,i?.details),d=Jt(a,{expanded:!1,isPartial:s,isError:l}),f=s||l?{outcome:`none`,who:``,reply:``}:cn(i?.details),p=f.outcome===`none`||f.outcome===`answered`?null:un[f.outcome],h=typeof t.message==`string`?t.message.trim():``,g=u.action===`reply`?f.who:u.target,_=ln(i?.details),v=dn[u.action];return R(m,{tone:r({running:s,isError:l}),expandable:d.glyph===`more`,children:({expanded:t})=>{let r=t?Jt(a,{expanded:!0,isPartial:s,isError:l}):d;return T(F,{children:[R(o,{title:`intercom`,children:T(`span`,{"data-testid":`tool-call-intercom`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[R(`span`,{className:`text-po-hi`,children:u.action}),g?T(`span`,{className:`shrink-0 text-po-cyan`,children:[`→ `,g]}):null]})}),T(n,{"data-testid":`tool-result-intercom`,className:`flex flex-col gap-3`,children:[h&&!l?T(`div`,{"data-testid":`intercom-outgoing`,className:`flex flex-col items-end gap-1`,children:[T(`div`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[v?R(O,{tone:`neutral`,size:`xs`,children:v}):null,_?T(F,{children:[R(e,{name:_,size:`sm`}),R(`span`,{className:`truncate font-semibold text-po-hi`,children:_})]}):null]}),R(`p`,{className:`max-w-xl rounded-lg bg-po-tint-green px-3 py-2 text-base break-words whitespace-pre-wrap text-po-hi`,children:h}),p?R(c,{tone:p.tone,glyph:p.glyph,children:p.text}):null,s&&u.action!==`ask`?R(c,{tone:`running`,children:`Sending`}):null]}):null,s&&h&&u.action===`ask`?R(fn,{testId:`intercom-replying`,name:g||`reply`,state:`running`,chip:R(`span`,{className:`text-po-dim`,children:`is replying`}),children:T(`div`,{role:`status`,"aria-label":`${g||`The recipient`} is replying`,className:`flex items-center gap-1.5 rounded-lg bg-po-rail px-3 py-3`,children:[R(P,{tone:`muted`,size:`md`,pulse:!0}),R(P,{tone:`muted`,size:`md`,pulse:!0}),R(P,{tone:`muted`,size:`md`,pulse:!0})]})}):null,f.outcome===`answered`?R(fn,{testId:`intercom-incoming`,name:f.who,chip:R(O,{tone:`green`,size:`xs`,children:`Replied`}),children:R(`p`,{className:`max-w-xl rounded-lg bg-po-rail px-3 py-2 text-base break-words whitespace-pre-wrap text-po-hi`,children:f.reply})}):null,l?R(`p`,{role:`alert`,className:`text-base break-words text-po-red`,children:r.lines.join(`
5
- `)||`Failed`}):null,!h&&!l&&r.lines.length>0?R(`p`,{className:`${t?`whitespace-pre-wrap break-words`:`truncate`} text-po-dim`,children:r.lines.join(`
6
- `)}):null,r.glyph===`more`?T(c,{expands:!0,children:[r.hidden,` more line(s)`]}):null]})]})}})}var mn=ee({message:pn}),hn={running:{tone:`running`,text:`Running`},failed:{tone:`error`,text:`Failed`},done:{tone:`ok`,text:`Done`}},gn={ok:`ok`,error:`error`,running:`running`,idle:`neutral`},_n={ok:`ok`,error:`error`,running:`running`,idle:`ok`};function vn({row:t}){return T(`li`,{"data-testid":`tool-result-subagent-row`,className:`flex items-center gap-3 rounded-md px-2 py-1.5`,children:[R(e,{name:t.label,seed:t.seed,state:t.avatar}),T(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[R(`span`,{className:`truncate text-base font-semibold text-po-hi`,children:t.label}),t.detail?R(`span`,{className:`truncate text-sm text-po-dim`,children:t.detail}):null]}),t.state?R(a,{tone:gn[t.tone],size:`md`,className:gn[t.tone]===`neutral`?`bg-po-rail`:void 0,children:t.state}):null]})}function yn({args:e,result:t,output:i,running:a,isError:s,openTransientTab:l}){let d=typeof e.action==`string`?e.action:``,f=Kt(e),p=a||s?null:on(t?.details),h=p?Math.max(0,p.rows.length-8):0,g=p?null:Jt(i,{expanded:!1,isPartial:a,isError:s});return R(m,{tone:r({running:a,isError:s}),expandable:p?h>0:g?.glyph===`more`,children:({expanded:e})=>{let t=p||!g?null:e?Jt(i,{expanded:!0,isPartial:a,isError:s}):g,r=!t||t.glyph===`none`||t.glyph===`more`?null:hn[t.glyph],m=p?e?p.rows:p.rows.slice(0,8):[];return T(F,{children:[R(o,{title:`subagent`,children:T(`span`,{"data-testid":`tool-call-subagent`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[R(`span`,{className:`text-po-dim`,children:d}),f?R(`span`,{className:`min-w-0 truncate text-po-dim`,children:f}):null]})}),T(n,{"data-testid":`tool-result-subagent`,className:`flex flex-col gap-1`,children:[m.length>0?R(`ul`,{className:`-mx-2 flex flex-col`,children:m.map(e=>R(vn,{row:e},e.key))}):null,t&&t.lines.length>0?R(`pre`,{className:`${e?`whitespace-pre-wrap break-words`:`truncate`} text-po-dim`,children:t.lines.join(`
7
- `)}):null,!e&&h>0?T(c,{expands:!0,children:[h,` more`]}):null,r?R(c,{tone:r.tone,children:r.text}):null,t?.glyph===`more`?T(c,{expands:!0,children:[t.hidden,` more line(s)`]}):null,T(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 ${m.length>0?`mt-1 border-t border-po-border-soft pt-2.5`:``}`,children:[p&&p.summary?R(c,{"data-testid":`tool-result-subagent-summary`,tone:_n[p.tone],children:p.summary}):null,T(k,{variant:`link`,size:`sm`,"data-testid":`tool-result-subagent-open`,onClick:()=>l(Y()),className:`h-auto gap-1 px-0 text-sm text-po-green`,children:[`Open subagents`,R(u,{"aria-hidden":!0,className:`size-3.5`})]})]})]})]})}})}var bn=ee({message:yn}),$=(e,t)=>t===void 0?void 0:{...e,...t},xn=_e({id:`subagents`,packageName:`@agimon-ai/po-team`,host:{get settingsSections(){return[$({id:`team`},Te)]}},workspace:{get fills(){return[$({slot:`home`,id:`team`},Ee)]},get settingsSections(){return[$({id:`team`},De)]}},session:{get activityGroups(){return[$({name:`agents`},Nt)]},get channels(){return[$({channel:`subagent_catalog`},Pt),$({channel:`subagent_runs`},Ft)]},get contextActions(){return[$({id:`launch-agent`},Mt)]},get fills(){return[$({slot:`activity.agents`,id:`agents`},zt)]},get leaderBindings(){return[$({id:`subagents.catalog`},Vt),$({id:`subagents.fleet`},Ht)]},get slots(){return[$({slot:`subagents.run-actions`},Ut)]},get toolRenderers(){return[$({tools:[`intercom`]},mn),$({tools:[`subagent`]},bn)]}}});export{xn as webPlugin};
@@ -1 +0,0 @@
1
- import{A as e,At as t,B as n,Br as r,Ct as i,Dt as a,Et as o,H as s,Ht as c,Jn as l,Mr as u,Nr as d,Ot as f,Qn as p,Rt as m,S as h,St as g,T as _,Tn as v,Tt as y,Vt as b,Xn as x,Yn as S,Zn as C,_ as w,an as ee,bt as T,c as E,cr as te,ct as D,dr as O,er as k,f as A,in as j,ir as M,kt as N,n as ne,nn as re,o as P,or as F,q as ie,qn as ae,qr as oe,rr as se,s as I,sr as ce,u as L,vt as le,w as ue,xt as de,yt as fe}from"../chunks/po-web-runtime-DZvTbTGl.js";var R=`/api/plugins/vault/entries`,z=`secrets`,pe=/^[A-Z][A-Z0-9_]{0,63}$/u,B=`The request did not reach Po on your computer.`,V={namespace:``,key:``,value:``},H={"content-type":`application/json`};async function U(e){let t=await e.json().catch(()=>void 0);return{error:typeof t?.error==`string`?t.error:`Po answered ${e.status}.`,...t?.field?{field:t.field}:{}}}function me({request:e,requestWithStepUp:t}){let[n,r]=w(),[i,a]=w(),[o,s]=w(``),[c,l]=w(),[u,d]=w(V),[f,p]=w(!1),[m,h]=w(),[g,_]=w(!1),v=L(async()=>{try{let t=await e(R);if(!t.ok)throw Error((await U(t)).error);r(await t.json()),a(void 0)}catch(e){a(e instanceof Error?e.message:B)}},[e]);A(()=>{v()},[v]);let y=(e,t=V)=>{d(t),h(void 0),l(e)},b=n?.protection===`account`,x=e=>e.kind===`remove`?t(`${R}?${new URLSearchParams({namespace:e.entry.namespace,key:e.entry.key,revision:String(e.entry.revision),shared:String(e.entry.shared)}).toString()}`,{method:`DELETE`}):e.kind===`move`?t(`${R}/move`,{method:`POST`,headers:H,body:JSON.stringify({namespace:e.entry.namespace,key:e.entry.key,revision:e.entry.revision,shared:!e.entry.shared})}):t(R,{method:`PUT`,headers:H,body:JSON.stringify({namespace:u.namespace.trim(),key:u.key,text:u.value,expectRevision:e.kind===`replace`?e.entry.revision:null,shared:e.kind===`replace`?e.entry.shared:b||f})}),S=async()=>{if(c&&!g){_(!0);try{let e=await x(c);if(!e.ok){let t=await U(e);h({field:t.field??`form`,message:t.error});return}l(void 0),d(V),await v()}catch{h({field:`form`,message:B})}finally{_(!1)}}};return{...n?{protection:n.protection,account:n.account,entries:n.entries}:{},...i?{error:i}:{},query:o,...c?{dialog:c}:{},draft:u,shareNew:f,...m?{draftError:m}:{},busy:g,onQueryChange:s,onAdd:()=>{p(!1),y({kind:`add`})},onReplace:e=>y({kind:`replace`,entry:e},{namespace:e.namespace,key:e.key,value:``}),onRemove:e=>y({kind:`remove`,entry:e}),onMove:e=>y({kind:`move`,entry:e}),onDraftChange:(e,t)=>{d(n=>({...n,[e]:t})),h(void 0)},onShareNewChange:p,onSubmit:()=>void S(),onCancel:()=>{g||l(void 0)},onRetry:()=>void v()}}var he=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeZone:`UTC`});function W(e){return`${e.namespace}/${e.key}`}function ge(e,t){let n=t.trim().toLowerCase();return!n||W(e).toLowerCase().includes(n)}function _e(e){return`Updated ${he.format(new Date(e.updatedAt))} · revision ${e.revision}`}function ve(e){return e.length===1?`1 saved`:`${e.length} saved`}var ye={keyring:{badge:`Protected`,title:`Key kept in your system keychain`,detail:`Every secret is encrypted in Po’s database. The key that opens them stays in the keychain, never in a file.`},file:{badge:`File key`,title:`Key kept in a file next to your secrets`,detail:`This computer has no system keychain, so the key lives in vault/key.bin in your Po folder. Anyone who can read that folder can read your secrets.`},loading:{badge:`Checking`,title:`Opening the vault`,detail:`Po is loading the key that protects your secrets.`},closed:{badge:`Not opened yet`,title:`Opens the first time Po needs a secret`,detail:`The key that protects your secrets loads when a sign-in or a plugin first asks for one, or when you add a secret here.`},account:{badge:`In your account`,title:`Secrets kept in your Po account`,detail:`Every secret is encrypted in your account and opens only inside Po. Every Po signed in to this account can use them.`},unavailable:{badge:`Unavailable`,title:`Po could not open the vault`,detail:`Saved secrets are untouched. Sign-ins that need them wait until the vault opens again.`}},G={values:`Values are never shown here. Replace a secret to change it.`,add:`Saved encrypted on this computer. You will not be able to read it back here.`,addShared:`Saved encrypted in your Po account. You will not be able to read it back here.`,value:`Text, or JSON for structured values. Up to 64 KiB.`,namespace:`Usually the plugin that uses it, such as agiflow or mcp.github.`,remove:`The plugin that uses it will ask you to sign in again the next time it needs it.`,removeShared:`Every Po signed in to your account loses it. The plugin that uses it will ask you to sign in again.`,share:`Share with your account`,shareHint:`Every Po signed in to your account can use it, including Po Cloud.`},K={device:{title:`On this computer`,empty:`Nothing kept only on this computer.`},shared:{title:`Shared with your account`,empty:`Nothing shared yet. Share a secret from its menu.`}};function q(e){return e.shared?{menu:`Keep on this computer only`,title:`Keep on this computer only?`,detail:`Only this computer can use it. Other Po signed in to your account lose it.`,confirm:`Keep on this computer`,busy:`Moving…`}:{menu:`Share with your account`,title:`Share with your account?`,detail:`Every Po signed in to your account can use it, including Po Cloud. It leaves this computer’s vault.`,confirm:`Share secret`,busy:`Sharing…`}}var be={keyring:`size-4 text-po-green`,file:`size-4 text-po-yellow`,loading:`size-4 text-po-dim`,closed:`size-4 text-po-dim`,account:`size-4 text-po-green`,unavailable:`size-4 text-po-red`},xe={keyring:`ok`,file:`running`,loading:`neutral`,closed:`neutral`,account:`ok`,unavailable:`error`};function Se(e){let{children:n,protection:r,entries:s,error:l,query:u,busy:d}=e,p=l?`unavailable`:r??`loading`,_=ye[p],v=s!==void 0&&!l,b=s?.filter(e=>ge(e,u))??[],x=e.account===!0&&r!==`account`;return E(de,{"aria-busy":s===void 0||d,children:[n?I(fe,{children:n}):null,E(a,{children:[I(N,{children:I(t,{children:`Protection`})}),I(le,{children:E(g,{children:[I(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-po-deep`,children:I(m,{"aria-hidden":!0,className:be[p]})}),E(y,{children:[I(o,{children:_.title}),I(i,{children:_.detail})]}),I(c,{tone:xe[p],children:_.badge})]})})]}),E(a,{children:[E(N,{children:[I(t,{children:`Saved secrets`}),E(`div`,{className:`flex items-center gap-3`,children:[v&&s.length?I(`span`,{className:`text-sm text-po-dim`,children:ve(s)}):null,E(j,{variant:`primary`,disabled:!v||d,onClick:e.onAdd,children:[I(ie,{className:`size-3.5`}),`Add secret`]})]}),I(f,{children:G.values})]}),l?E(`div`,{className:`flex flex-wrap items-center gap-3`,children:[I(`p`,{role:`alert`,className:`text-sm text-po-red`,children:l}),I(j,{variant:`ghost`,onClick:e.onRetry,children:`Try again`})]}):s===void 0?I(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Loading saved secrets…`}):s.length===0?I(O,{title:`No secrets saved yet`,description:`Po saves one when you sign in to a provider or a plugin asks for a key.`,className:`py-12`}):E(P,{children:[E(`div`,{className:`relative`,children:[I(D,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-po-dim`}),I(h,{type:`search`,"aria-label":`Search saved secrets`,placeholder:`Search by name`,className:`w-full pl-9`,value:u,onChange:t=>e.onQueryChange(t.target.value)})]}),b.length===0?E(T,{role:`status`,children:[`No saved secret matches “`,u.trim(),`”.`]}):x?[`device`,`shared`].map(t=>{let n=b.filter(e=>e.shared===(t===`shared`));return E(`div`,{className:`flex flex-col gap-2`,children:[I(`h3`,{className:`text-sm font-medium text-po-dim`,children:K[t].title}),n.length?I(Ce,{...e,label:K[t].title,entries:n,sharing:!0}):I(T,{children:K[t].empty})]},t)}):I(Ce,{...e,label:`Saved secrets`,entries:b,sharing:!1})]})]}),I(we,{...e})]})}function Ce({entries:t,label:n,sharing:r,busy:a,openMenu:s,onReplace:c,onRemove:l,onMove:u}){return I(le,{asChild:!0,children:I(`ul`,{"aria-label":n,children:t.map(t=>{let n=W(t);return I(g,{asChild:!0,children:E(`li`,{"data-testid":`vault-entry-${n}`,children:[I(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-po-deep`,children:I(e,{"aria-hidden":!0,className:`size-4 text-po-dim`})}),E(y,{children:[E(o,{className:`truncate font-mono first-letter:normal-case`,children:[t.namespace,E(`span`,{className:`text-po-dim`,children:[` / `,t.key]})]}),I(i,{children:_e(t)})]}),E(se,{modal:!1,defaultOpen:s===n,children:[I(te,{asChild:!0,children:I(j,{variant:`ghost`,size:`icon-md`,"aria-label":`Actions for ${n}`,disabled:a,children:I(ue,{className:`size-4`})})}),E(M,{align:`end`,children:[I(F,{onSelect:()=>c(t),children:`Replace value`}),r?I(F,{onSelect:()=>u(t),children:q(t).menu}):null,I(ce,{}),E(F,{variant:`destructive`,onSelect:()=>l(t),children:[I(ee,{className:`size-3.5`}),`Remove secret`]})]})]})]})},`${t.shared}:${n}`)})})})}function we({dialog:e,draft:t,draftError:n,busy:r,protection:i,account:a,shareNew:o,onDraftChange:s,onShareNewChange:c,onSubmit:u,onCancel:d}){let f=a===!0&&i!==`account`,m=i===`account`||f&&o,g=e=>n?.field===e?n.message:void 0,y=(e,n,i)=>{let a=g(e),o=a?`vault-${e}-error`:i?`vault-${e}-hint`:void 0,c=e===`value`?I(re,{id:`vault-${e}`,rows:4,className:`font-mono`,autoComplete:`off`,spellCheck:!1,value:t.value,disabled:r,"aria-invalid":a?!0:void 0,"aria-describedby":o,onChange:t=>s(e,t.target.value)}):I(h,{id:`vault-${e}`,className:`font-mono`,autoComplete:`off`,spellCheck:!1,value:t[e],disabled:r,"aria-invalid":a?!0:void 0,"aria-describedby":o,onChange:t=>s(e,t.target.value)});return E(`div`,{className:`flex flex-col gap-1.5`,children:[I(_,{htmlFor:`vault-${e}`,children:n}),c,a?I(`p`,{id:`vault-${e}-error`,role:`alert`,className:`text-sm text-po-red`,children:a}):i?I(`p`,{id:`vault-${e}-hint`,className:`text-sm text-po-dim`,children:i}):null]})},b=n?.field===`form`?I(`p`,{role:`alert`,className:`text-sm text-po-red`,children:n.message}):null;return I(ae,{open:e!==void 0,onOpenChange:e=>e?void 0:d(),children:I(S,{children:e?.kind===`remove`?E(P,{children:[I(p,{children:E(k,{children:[`Remove `,I(`span`,{className:`font-mono`,children:W(e.entry)}),`?`]})}),E(l,{children:[I(x,{children:e.entry.shared?G.removeShared:G.remove}),b,E(C,{children:[I(j,{onClick:d,children:`Keep secret`}),I(j,{variant:`danger-outline`,disabled:r,onClick:u,children:r?`Removing…`:`Remove secret`})]})]})]}):e?.kind===`move`?E(P,{children:[I(p,{children:I(k,{children:q(e.entry).title})}),E(l,{children:[E(x,{children:[I(`span`,{className:`font-mono`,children:W(e.entry)}),`. `,q(e.entry).detail]}),b,E(C,{children:[I(j,{onClick:d,children:`Cancel`}),I(j,{variant:`primary`,disabled:r,onClick:u,children:r?q(e.entry).busy:q(e.entry).confirm})]})]})]}):e?E(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),u()},children:[I(p,{children:I(k,{children:e.kind===`add`?`Add a secret`:E(P,{children:[`Replace `,I(`span`,{className:`font-mono`,children:W(e.entry)})]})})}),E(l,{className:`gap-4`,children:[I(x,{children:e.kind===`replace`?e.entry.shared?G.addShared:G.add:m?G.addShared:G.add}),e.kind===`add`?E(P,{children:[y(`namespace`,`Namespace`,G.namespace),y(`key`,`Name`)]}):null,y(`value`,e.kind===`add`?`Value`:`New value`,G.value),e.kind===`add`&&f?E(`div`,{className:`flex items-start gap-2`,children:[I(v,{id:`vault-share`,className:`mt-0.5`,checked:o,disabled:r,"aria-describedby":`vault-share-hint`,onCheckedChange:e=>c(e===!0)}),E(`div`,{className:`flex flex-col gap-0.5`,children:[I(_,{htmlFor:`vault-share`,children:G.share}),I(`p`,{id:`vault-share-hint`,className:`text-sm text-po-dim`,children:G.shareHint})]})]}):null,b,E(C,{children:[I(j,{type:`button`,onClick:d,children:`Cancel`}),I(j,{type:`submit`,variant:`primary`,disabled:r,children:r?`Saving…`:e.kind===`add`?`Save secret`:`Replace value`})]})]})]}):null})})}function Te(e){return I(Se,{...me(e)})}var Ee=r({label:`Vault`,detail:`See which sign-ins, tokens and API keys Po keeps for you, and add, replace or remove them.`,order:15,icon:e,component:Te}),J=d(void 0);function De(){J.update(()=>!0)}function Oe(e){let t=()=>{J.store.state&&(J.reset(),e())},n=J.store.subscribe(t);return t(),()=>n.unsubscribe()}function ke(){return E(s,{role:`menuitem`,density:`compact`,"data-testid":`composer-menu-secret`,className:`w-full text-po-text hover:bg-po-tint-blue`,onClick:De,children:[I(e,{className:`h-3 w-3 shrink-0`}),I(n,{density:`compact`,children:`Secret`})]})}var Ae=u({component:ke}),je=(e,t)=>ne.fetch(e,t),Y={name:``,value:``,sites:``,iosApps:``,macApps:``},Me=/[\s,]+/u,Ne=/^[a-z][a-z0-9+.-]*:\/\//iu,Pe=/^[A-Za-z0-9][A-Za-z0-9.-]{0,254}$/u,X={name:`Use capital letters, digits and _, starting with a letter, such as GITHUB_LOGIN.`,value:`Enter the secret.`,where:`Add the site it signs in to, so Po types it nowhere else.`,app:`Use app bundle ids, such as com.example.app.`};function Z(e){return`{{ secrets.${e} }}`}function Fe(e){return e.toUpperCase().replace(/[^A-Z0-9_]+/gu,`_`)}function Ie(e){return e.entries.filter(e=>e.namespace===z).map(e=>({name:e.key,shared:e.shared}))}function Q(e){return[...new Set(e.split(Me).filter(Boolean))]}function Le(e){let t=Ne.test(e)?e:`https://${e}`;if(t.includes(`*`)||!URL.canParse(t))return;let n=new URL(t);if(!(n.protocol!==`https:`&&n.protocol!==`http:`||n.username||n.password))return n.origin}function Re(e,t){let n=(e,t)=>({ok:!1,field:e,message:t});if(!pe.test(e.name))return n(`name`,X.name);if(e.value===``)return n(`value`,X.value);let r=Q(e.sites),i=[];for(let e of r){let t=Le(e);if(t===void 0)return n(`sites`,`“${e}” is not a web address, such as github.com.`);i.push(t)}let a=Q(e.iosApps),o=Q(e.macApps);if(!a.every(e=>Pe.test(e)))return n(`iosApps`,X.app);if(!o.every(e=>Pe.test(e)))return n(`macApps`,X.app);let s=a.length>0||o.length>0;if(i.length===0&&!s)return n(`sites`,X.where);let c={value:e.value,purposes:[...i.length>0?[`browser`]:[],...s?[`input`]:[]],...i.length>0?{allowedOrigins:[...new Set(i)]}:{},...s?{allowedTargets:{...a.length>0?{ios:a}:{},...o.length>0?{computer:o}:{}}}:{}};return{ok:!0,request:{namespace:z,key:e.name,text:JSON.stringify(c),expectRevision:null,shared:t}}}var ze={name:{label:`Name`},value:{label:`Secret`,secret:!0},sites:{label:`Sites`,hint:`Where Po may type it, such as github.com. Separate several with commas.`},iosApps:{label:`iPhone apps (optional)`,hint:`App bundle ids, such as com.example.app.`},macApps:{label:`Mac apps (optional)`,hint:`App bundle ids, such as com.example.desktop.`}};function Be({open:t,onOpenChange:r,secrets:i,error:a,account:o,mode:c,draft:u,draftError:d,shareNew:f,busy:m,onPick:g,onAdd:y,onBack:w,onDraftChange:ee,onShareNewChange:T,onSubmit:te,onRetry:D}){let A=e=>{let{label:t,hint:n,secret:r}=ze[e],i=d?.field===e?d.message:void 0,a=e===`name`?`Prompts use it as ${Z(u.name||`NAME`)}.`:n,o=i?`secret-${e}-error`:a?`secret-${e}-hint`:void 0;return E(`div`,{className:`flex flex-col gap-1.5`,children:[I(_,{htmlFor:`secret-${e}`,children:t}),I(h,{id:`secret-${e}`,type:r?`password`:`text`,className:r?void 0:`font-mono`,autoComplete:r?`new-password`:`off`,spellCheck:!1,value:u[e],disabled:m,"aria-invalid":i?!0:void 0,"aria-describedby":o,onChange:t=>ee(e,t.target.value)}),i?I(`p`,{id:`secret-${e}-error`,role:`alert`,className:`text-sm text-po-red`,children:i}):a?I(`p`,{id:`secret-${e}-hint`,className:`text-sm text-po-dim`,children:a}):null]})},M=a?E(`div`,{className:`flex items-center justify-between gap-3`,children:[I(`p`,{role:`alert`,className:`text-sm text-po-red`,children:a}),I(j,{onClick:D,children:`Try again`})]}):i===void 0?I(b,{label:`Loading secrets`}):i.length===0?I(O,{title:`No saved secrets`,description:`Save a password or key once, then attach it to any prompt.`}):I(`div`,{role:`list`,className:`flex max-h-72 flex-col overflow-y-auto`,children:i.map(t=>I(`div`,{role:`listitem`,children:E(s,{density:`compact`,"data-testid":`secret-pick-${t.name}`,className:`w-full text-po-text hover:bg-po-tint-blue`,onClick:()=>g(t.name),children:[I(e,{className:`h-3 w-3 shrink-0 text-po-dim`}),I(n,{density:`compact`,className:`font-mono`,children:t.name}),t.shared?I(`span`,{className:`ml-auto text-xs text-po-dim`,children:`Shared`}):null]})},t.name))});return I(ae,{open:t,onOpenChange:e=>m?void 0:r(e),children:I(S,{"data-testid":`secret-dialog`,children:c===`pick`?E(P,{children:[I(p,{children:I(k,{children:`Attach a secret`})}),E(l,{className:`gap-4`,children:[I(x,{children:`The agent gets its name, never the value. Po types it only on the sites and apps saved with it.`}),M,E(C,{children:[I(j,{onClick:()=>r(!1),children:`Cancel`}),E(j,{variant:i?.length===0?`primary`:void 0,onClick:y,children:[I(ie,{className:`h-3 w-3`}),`New secret`]})]})]})]}):E(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),te()},children:[I(p,{children:I(k,{children:`Save a secret`})}),E(l,{className:`gap-4`,children:[I(x,{children:f&&o?`Saved encrypted in your Po account. Po types it only where you list below.`:`Saved encrypted on this computer. Po types it only where you list below.`}),A(`name`),A(`value`),A(`sites`),A(`iosApps`),A(`macApps`),o?E(`div`,{className:`flex items-start gap-2`,children:[I(v,{id:`secret-share`,className:`mt-0.5`,checked:f,disabled:m,"aria-describedby":`secret-share-hint`,onCheckedChange:e=>T(e===!0)}),E(`div`,{className:`flex flex-col gap-0.5`,children:[I(_,{htmlFor:`secret-share`,children:`Share with your account`}),I(`p`,{id:`secret-share-hint`,className:`text-sm text-po-dim`,children:`Every Po signed in to your account can use it, including Po Cloud.`})]})]}):null,d?.field===`form`?I(`p`,{role:`alert`,className:`text-sm text-po-red`,children:d.message}):null,E(C,{children:[I(j,{type:`button`,disabled:m,onClick:w,children:`Back`}),I(j,{type:`submit`,variant:`primary`,disabled:m,children:m?`Saving…`:`Save and attach`})]})]})]})})})}var Ve=`The request did not reach Po on your computer.`;async function He(e){let t=await e.json().catch(()=>void 0);return{...t,error:typeof t?.error==`string`?t.error:`Po answered ${e.status}.`}}function Ue(e,t,n=!0){let[r,i]=w(),[a,o]=w(!1),[s,c]=w(),[l,u]=w(`pick`),[d,f]=w(Y),[p,m]=w(),[h,g]=w(!1),[_,v]=w(!1),y=L(async()=>{try{let t=await e(R);if(!t.ok)throw Error((await He(t)).error);let n=await t.json();i(Ie(n)),o(n.account),c(void 0)}catch(e){c(e instanceof Error?e.message:Ve)}},[e]);A(()=>{n&&(u(`pick`),m(void 0),y())},[n,y]);let b=async()=>{if(_)return;let n=Re(d,a&&h);if(!n.ok)m({field:n.field,message:n.message});else{v(!0);try{let r=await e(R,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(n.request)});if(!r.ok){let e=await He(r),t=e.field===`key`?`name`:e.field===`value`?`value`:`form`;m({field:t,message:e.error});return}t(Z(d.name)),f(Y),u(`pick`),y()}catch{m({field:`form`,message:Ve})}finally{v(!1)}}};return{...r?{secrets:r}:{},...s?{error:s}:{},account:a,mode:l,draft:d,...p?{draftError:p}:{},shareNew:h,busy:_,onPick:e=>t(Z(e)),onAdd:()=>{f(Y),m(void 0),g(!1),u(`add`)},onBack:()=>{_||u(`pick`)},onDraftChange:(e,t)=>{f(n=>({...n,[e]:e===`name`?Fe(t):t})),m(void 0)},onShareNewChange:g,onSubmit:()=>void b(),onRetry:()=>void y()}}function We({appendComposerDraft:e}){let[t,n]=w(!1);A(()=>Oe(()=>n(!0)),[]);let r=Ue(je,L(t=>{e(t),n(!1)},[e]),t);return I(Be,{open:t,onOpenChange:n,...r})}var Ge=u({component:We}),$=(e,t)=>t===void 0?void 0:{...e,...t},Ke=oe({id:`vault`,packageName:`@agimon-ai/po-vault`,host:{get settingsPanels(){return[$({id:`vault`},Ee)]}},session:{get fills(){return[$({slot:`composer-menu`,id:`secret`},Ae),$({slot:`overlay`,id:`secret-dialog`},Ge)]}}});export{Ke as webPlugin};