@agimon-ai/po-cloudflare 0.0.2-alpha.76 → 0.0.2-alpha.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{approval-BlHIxC2J.js → approval-DRipNxVh.js} +4 -0
- package/dist/{approvalSession-UtzXVEB4.js → approvalSession-DPQQRkG4.js} +2 -2
- package/dist/assets/assets/{CodeEditorView-CaFk98Ji.js → CodeEditorView-CwDhkcuX.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-gzdpxFaJ.js → abnfDiagram-WEYOIA3C-x7ICShZ-.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-TugrtWoO.js → architecture-WOLXFQ4H-BbNcuwIa.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-Xy_pnmaH.js → architectureDiagram-ZHVYKT53-BaKFNXDN.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-pH1-jWYL.js → blockDiagram-RJAE7QA3-BpBDuUhc.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-CWmWk7y2.js → c4Diagram-XDPPPE54-CH1AYBxk.js} +2 -2
- package/dist/assets/assets/channel-DUu4-rZu.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-C2O60zos.js → chunk-2E7WHVMD-zuvalEA0.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-CEHzGYY0.js → chunk-4EMNKR2T-Y1aujIa_.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-CjyzuqJm.js → chunk-55XCU76K-Cj_usw4a.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-Db8_vjDs.js → chunk-7S6XSTFO-CNv4j2oa.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB-92c_fipW.js → chunk-AQDTSKZB-BgiafkbC.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-DFGW_rzV.js → chunk-DSNLSHJZ-CEqk3yOv.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-Cpx79XgA.js → chunk-HAGFOTED-w6XwPptZ.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-cz6K5cWs.js → chunk-HNE4Q36P-Du2F5NKF.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-Bhj8Cnrq.js → chunk-NQOKRVIF-e7LK2NBD.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-DugRZU3d.js → chunk-UHW7PFBP-CV1yEqMO.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-CFXU98Td.js → chunk-VQ5W62QI-Dz5nQ93K.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-BDYjxxgH.js → chunk-WQQL4CDK-CR_tliyN.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-KxRgluI2.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-Bw3Zv3ms.js → chunk-YZO67HFG-DFykz1uM.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-reWd5PI6.js → chunk-ZAUX2LTX-C-HZEj8t.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-RCmNKJ0K.js → chunk-ZCHMQSOR-DhOusRJf.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-DOBOI7kO.js → classDiagram-v2-4MYWR3UA-CODBKWcv.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-Dnga9ThU.js → cose-bilkent-JH36ORCC-CQBDxRkG.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-mbxppeTd.js → cynefin-EF2NZ3EQ-BqEZr_DI.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D5uSCW7P.js → cynefinDiagram-WF24UDRP-CAFtVFnZ.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-D3Utujwv.js → dagre-NK4GIZVX-6EbIcHjw.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-Bg8QfzPb.js → diagram-CBK3MWTC-DxOPl4wX.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-NjETU96V.js → diagram-I5XIIV2D-Dn-nrQn0.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-BRY10xxY.js → diagram-ODIL2UCW-Df9GeJiZ.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-CO5Nfc2a.js → diagram-PFBEJUXE-CzsqYRcB.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-jxuLnXXk.js → diagram-RJA3I4VV-Chxf9kLz.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-B-dUsynt.js → diagram-TYUNFSNR-DsSL0naA.js} +2 -2
- package/dist/assets/assets/{dist-Bsp48Zck.js → dist-1eIdTf5S.js} +2 -2
- package/dist/assets/assets/{dist-JCg255PN.js → dist-B7Fq62ue.js} +2 -2
- package/dist/assets/assets/{dist-DtWJqHVb.js → dist-C-zBeZYG.js} +2 -2
- package/dist/assets/assets/{dist-BMmgMuDM.js → dist-CNPkFbM6.js} +2 -2
- package/dist/assets/assets/{dist-lOIB9DJk.js → dist-DHBIyPPx.js} +2 -2
- package/dist/assets/assets/{dist-9C1WeAys.js → dist-DR6uuD7b.js} +2 -2
- package/dist/assets/assets/{dist-C8son2cz.js → dist-Dul31jTx.js} +2 -2
- package/dist/assets/assets/{dist-CXebcDwS.js → dist-dedZfm22.js} +2 -2
- package/dist/assets/assets/{dist-CUuM0eUM.js → dist-zUhlfRuY.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-KNVNlIfc.js → ebnfDiagram-V4P3TTPT-fUIcNhqL.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-DsX7hxD1.js → elk-QONTBCTQ-BtFtt9dx.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-pjQN44eX.js → erDiagram-KYQIGQAA-8nTQgw_u.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-BCKz9w4V.js → eventmodeling-K75KTNOO-u--ksfW0.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-U-4ltU4o.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CeuiGYpW.js → ganttDiagram-R7GPNTJY-CWqNS4bm.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-BsN0Vwsr.js → gitGraph-VSP46ZUC-Dy9xUPnQ.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-ZIMBu3bo.js → gitGraphDiagram-PDYL7XHY-D9OwLXxL.js} +2 -2
- package/dist/assets/assets/{index-fYkh5qQp.js → index-Blt5rLZT.js} +90 -90
- package/dist/assets/assets/{info-OHQRW6UA-CJmrVYr6.js → info-OHQRW6UA-ByFo5VxO.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-BsAIEQmU.js → infoDiagram-MVDRKAX5-DkV7tUak.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-BX_86A9r.js → ishikawaDiagram-HPEHV2GE-D62xVlJr.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-DVGI0WoP.js → journeyDiagram-BOSHW7O7-CmGrCQyD.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-4RLBwWbL.js → kanban-definition-FNSA4HC5-CQ-96zcl.js} +2 -2
- package/dist/assets/assets/{line-BL8hbik-.js → line-LyW2S8xe.js} +2 -2
- package/dist/assets/assets/{linear-BWVrkBYc.js → linear-Df5iFoGG.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-CMk5l3Wp.js → mermaid-parser.core-DwGEOVKN.js} +4 -4
- package/dist/assets/assets/{mermaid.core-DZuf73R_.js → mermaid.core-UZa2JDq1.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-CPuk1tgo.js → mindmap-definition-6OY57UG3-DXZpBkD7.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-pVue6YBL.js → packet-JDAUHWVQ-DVu5opyp.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-B8Ly6ehm.js → pegDiagram-ECIUJNBX-D2PGrJQR.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-DXAHc3bX.js → pie-XZMESJXO-CoJXcSM1.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-9nVo6xZM.js → pieDiagram-GNMPY74T-DlPni3lE.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-DbBqshQw.js → quadrantDiagram-D57K4MC3-tDWbeX9Y.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-CKPxbvS6.js → radar-ABXABTNO-CiE-yXqS.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-CULlMjWr.js → railroad-I3PHUGI6-Bt5352hi.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-BRjXoZsa.js → railroad-abnf-LNEFI6M7-BJH5rnqj.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CD_uPeUF.js → railroad-ebnf-DWYD2UWJ-C0KftBWL.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-Cv-b3SRa.js → railroad-peg-JR7BVNR7-CRa7U91X.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-DJ77wAhA.js → railroadDiagram-Y72NRBL7-fOs3RTR8.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-R7PFvkp-.js → requirementDiagram-EQYSW5RA-SvE7rYXk.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DR2gLc8z.js → sankeyDiagram-SY24JHO5-nqR9ZUs4.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-TwEQL0yK.js → sequenceDiagram-BLEHNHQU-CgEFMQSq.js} +2 -2
- package/dist/assets/assets/{src-Cv8dmcJt.js → src-B4g3Iold.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-ShloXczl.js → stateDiagram-v2-A6IESKWZ-C2jH_xDT.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-D17E07lx.js → swimlanes-B3ENRKFQ-Dbf1mXvK.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-Bc5KGsMc.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-BEvN2l_s.js → timeline-definition-JXYKGLGB-4u-pC3xz.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-B0QcYOKz.js → treeView-D4JQ5SDB-CZmVi5-J.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-CIGIJniE.js → treemap-SAJKECNS-BajhrENS.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-DbS-GLv8.js → usecaseDiagram-WPOLBNNX-J1gh4d5h.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-CEkmUNoT.js → vennDiagram-Q3Y3IDCW-CIRtS6C5.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-D9b-h7oE.js → wardley-7MLQ67FV-DjBwbtAb.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-BoWIYn_M.js → wardleyDiagram-IVAIDKWA-Cui7ZUN1.js} +2 -2
- package/dist/assets/assets/{webpack-rEg3nylj.js → webpack-FJjN4adW.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-xJdWE_nx.js → xychartDiagram-4URNHDU4-I-UzMoDZ.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +1 -1
- package/dist/assets/plugins/chunks/po-web-runtime-C0B3uAoC.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/{approval.09e72f36-B4Y8Wjzl.js → approval.dd60ec90-gfcirIrD.js} +1 -1
- package/dist/assets/plugins/slots/{artifacts.50b639bb-5Kf50LM1.js → artifacts.a078f1a5-B5YmdqFC.js} +1 -1
- package/dist/assets/plugins/slots/{author.ea449ace-BUAjd0RY.js → author.b2063a1b-QDThbn6B.js} +3 -3
- package/dist/assets/plugins/slots/{autocompact.6f428144-DUwf4L4s.js → autocompact.86aeccf4-DxTuE9o-.js} +1 -1
- package/dist/assets/plugins/slots/{backdrop-bamboo.6e4c928d-CT9PXrny.js → backdrop-bamboo.1a7d88ef-BfruoASs.js} +1 -1
- package/dist/assets/plugins/slots/{browse.fa1f1a50-ClrBioNv.js → browse.4b750f64-LwBuFuNb.js} +1 -1
- package/dist/assets/plugins/slots/{builtin-tools.75108f21-DmtavYBT.js → builtin-tools.0a7f0b8e-Cy2eN76-.js} +1 -1
- package/dist/assets/plugins/slots/{calendar.d8b70190-DmudDrcG.js → calendar.76ad65fa-CihobxD6.js} +1 -1
- package/dist/assets/plugins/slots/{codemode.c58fb583-BkVR1X2Y.js → codemode.ff16ac06-Dbjm7Efq.js} +1 -1
- package/dist/assets/plugins/slots/{domain.753f9f92-Bv-dlY79.js → domain.3ddea842-CJa-EzBA.js} +1 -1
- package/dist/assets/plugins/slots/{edit.804fec90-mJXCIk4G.js → edit.c5b0b072-Bp0bQ3N2.js} +1 -1
- package/dist/assets/plugins/slots/{files.66ffc636-CCRW8t1-.js → files.8ffcdcc0-re8nr2oz.js} +1 -1
- package/dist/assets/plugins/slots/{goal.45dffa01-q_Zh5QxW.js → goal.4524e2bf-C5mGe79a.js} +1 -1
- package/dist/assets/plugins/slots/{grep.98262cff-CTDwtVaK.js → grep.95f470b3-ClgsMgtm.js} +1 -1
- package/dist/assets/plugins/slots/{help.5fbd20f7-BBw7NYJI.js → help.dfbc8216-BGywkUKZ.js} +1 -1
- package/dist/assets/plugins/slots/{log.cb964209-BLY7IzD1.js → log.19bda339-6jMYUtlN.js} +1 -1
- package/dist/assets/plugins/slots/{mcp.82cc1ff5-5yoTabz8.js → mcp.ffbe405a-BnDP_LDU.js} +1 -1
- package/dist/assets/plugins/slots/{plan.3852ba52-DmdaEVVw.js → plan.2879a6ae-BXxVUfMI.js} +1 -1
- package/dist/assets/plugins/slots/{profile.ab16dcec-DOw3MhWl.js → profile.176710dd-Bc4Rwfhz.js} +1 -1
- package/dist/assets/plugins/slots/{prompts.ae48c07a-DQVmTxFZ.js → prompts.2c187969-CIBsOkp9.js} +1 -1
- package/dist/assets/plugins/slots/{read.4560591a-Bun0fKn1.js → read.1629d556-D-NY0ZCv.js} +1 -1
- package/dist/assets/plugins/slots/{runner.6e494d59-BDtBIqmQ.js → runner.962030e5-CCUVliK7.js} +1 -1
- package/dist/assets/plugins/slots/{scaffold.d87a6ee0-DZOiNwOS.js → scaffold.14b5f76b-DW44NU9X.js} +1 -1
- package/dist/assets/plugins/slots/{session-mcp.2be84084-DQpF2DkA.js → session-mcp.51089b63-Im-iuHcn.js} +1 -1
- package/dist/assets/plugins/slots/{sessions.6f47cb4c-y61JDvak.js → sessions.fc763f42-CL0PHuD4.js} +1 -1
- package/dist/assets/plugins/slots/{skill.62a0a1b3-C-mkriRv.js → skill.f5396fde-DHDfhNXW.js} +1 -1
- package/dist/assets/plugins/slots/{space.65a27e5a-Cr1HSI_z.js → space.d7bddb51-DFHblvL5.js} +1 -1
- package/dist/assets/plugins/slots/{subagents.8bb9992c-CrpR1Jhi.js → subagents.24539507-Db6YnHJd.js} +1 -1
- package/dist/assets/plugins/slots/{template-advanced.59f3f98a-CSuMHJ9x.js → template-advanced.292533fb-DyvcGxNV.js} +1 -1
- package/dist/assets/plugins/slots/{template-desktop.0f0b8491-C2ZheI0_.js → template-desktop.a1ef756c-5EQH-r7P.js} +1 -1
- package/dist/assets/plugins/slots/{template-elegant.0e3b0acf-Cq5Y_6VL.js → template-elegant.ceb23ac7-CrmEUE6V.js} +1 -1
- package/dist/assets/plugins/slots/{vault.3cbfcdc3-ZKO66wy8.js → vault.57fd9047-9cm8PfeP.js} +1 -1
- package/dist/assets/plugins/slots/{voice.a952113d-CsdoPA4G.js → voice.76006b18-BSC2gHHY.js} +1 -1
- package/dist/assets/plugins/slots/{web-search.65013836-C7W5RyLj.js → web-search.b025dda1-BMe5RM8K.js} +1 -1
- package/dist/assets/plugins/slots/{workflows.cbc5c5c0-BLNlHcfa.js → workflows.1fd6a554-CzFPuLnU.js} +1 -1
- package/dist/browser-BYWSPAEE.js +897 -0
- package/dist/{exports-Ct56PRB9.js → exports-BnHiOfC6.js} +1 -1
- package/dist/{index.edge-BRaAhap2.js → index.edge-By7eSfpp.js} +2 -2
- package/dist/sealedChannel-BeWNTWys.js +27 -0
- package/dist/{server-B3U0W7zD.js → server-1yS_uE-G.js} +1 -1
- package/dist/{server-CcKKktvn.js → server-B1kdSQrK.js} +1 -1
- package/dist/{server-fYfb0gN8.js → server-B3tod9fX.js} +3 -3
- package/dist/{server-BlbuM_IJ.js → server-BCuQ5v6n.js} +2 -2
- package/dist/{server-DAFM6HnJ.js → server-BGHoSIRR.js} +3 -3
- package/dist/{server-BUBijhBb.js → server-BN4AdrfM.js} +3 -3
- package/dist/{server-BSpJMYLb.js → server-Bl6gkrM7.js} +1 -1
- package/dist/{server-BPS6xFya.js → server-Bp5B4707.js} +1 -1
- package/dist/{server-D6-_DT9g.js → server-C-LM-7Mp.js} +1 -1
- package/dist/{server-CaFzaibK.js → server-Ca3X3h6Q.js} +1 -1
- package/dist/{server-CLRgSPVY.js → server-Cdrr9D-D.js} +1 -1
- package/dist/{server-BJssIIpm.js → server-Cj-2V-Z6.js} +1 -1
- package/dist/{server-Dnvp2U6V.js → server-CkEwZP4t.js} +1 -1
- package/dist/{server-DPG7BH6w.js → server-CodZPkK3.js} +1 -1
- package/dist/{server-7-DnO2Ww.js → server-CuKy4B95.js} +230 -117
- package/dist/{server-Dl3sng3O.js → server-D467psm_.js} +1 -1
- package/dist/{server-BUgDdcRW.js → server-DHAcLeIr.js} +1 -1
- package/dist/{server-HIbQWBba.js → server-DLZgrjI9.js} +9 -7
- package/dist/{server-BeAYfrzJ.js → server-DqEJjOJZ.js} +1 -1
- package/dist/{server-CKQwNrO8.js → server-DvXlixQN.js} +1 -1
- package/dist/{server-CMov-S5-.js → server-EyLWvUXw.js} +1 -1
- package/dist/{server-DMbdJzSQ.js → server-RF5gqssS.js} +1 -1
- package/dist/{server-BLcw1z6S.js → server-pp-NQWAR.js} +1 -1
- package/dist/{server-BqvkcVLn.js → server-rKR_yimq.js} +1 -1
- package/dist/{server-OzzJbeaS.js → server-sbfI6TAL.js} +2 -2
- package/dist/{type-DppaYz6F.js → type-1FxIJmfz.js} +2 -26
- package/dist/worker.js +80525 -80817
- package/package.json +49 -49
- package/dist/assets/assets/channel-CJxh7kPr.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-B7vCmBOn.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-BU7xmb8h.js +0 -1
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-i6-zDqZm.js +0 -9
- package/dist/assets/plugins/chunks/po-web-runtime-CQ9hLtG-.js +0 -1
- package/dist/browser-ks_k-6KA.js +0 -36
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{$r as e,At as t,Ba as n,Bi as r,Cn as i,Di as a,Ft as o,Gr as s,Ht as c,Ii as l,It as u,Kt as d,Li as f,Lt as p,Mi as m,Na as h,Pa as g,Ri as _,Ta as v,Ti as y,Wa as b,Yn as x,eo as S,gn as C,hn as w,ja as T,mn as ee,nn as te,on as ne,qa as re,qt as E,un as ie,vi as ae,vn as oe,wa as se,wi as ce}from"../chunks/po-web-runtime-CQ9hLtG-.js";var D=`planning`,O=[`modes`,D],k=`main`,A=`subagents`,j=`inherit the session model`,M=`inherit`,N=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],P={id:D,label:`planning`,detail:`the models plan mode switches to, and where written plans land`,order:30,fields:[{id:`main.model`,label:`main model`,keyPath:[...O,k,`model`],placeholder:j,detail:`model the main agent switches to while plan mode is on.`,models:!0},{id:`main.thinking`,label:`main thinking`,keyPath:[...O,k,`thinking`],placeholder:M,detail:`thinking level appended to the main model while planning.`,options:N},{id:`subagents.model`,label:`subagent model`,keyPath:[...O,A,`model`],placeholder:j,detail:`model forced onto delegated planning subagents.`,models:!0},{id:`subagents.thinking`,label:`subagent thinking`,keyPath:[...O,A,`thinking`],placeholder:M,detail:`thinking level appended to the subagent model.`,options:N},{id:`plansdirectory`,label:`plans directory`,keyPath:[...O,`plansDirectory`],placeholder:`~/.po/plans`,detail:`absolute, repo-relative, or under ~. written plans land here.`}].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}))}}))},le=n({...P,icon:s}),ue=n({...P,icon:s}),F=`po-plan-document`,I=[{label:`Exit plan mode and start implementation`,value:`exit`},{label:`Continue planning`,value:`continue`}].map(e=>e.label),de=` · `,fe=/\[[0-9;]*m/gu;function pe(e){if(e===void 0)return;let t=e.replace(fe,``).trim();if(t===``)return;let n=t.lastIndexOf(de);return n===-1?{title:t,stamp:``}:{title:t.slice(0,n).trim(),stamp:t.slice(n+3).trim()}}var me=v({name:`plan`,keys:`p e`,statusKey:F,marksBackgroundWork:!1,order:25}),L=se({current:{method:`GET`,path:`/current`,response:void 0},save:{method:`PUT`,path:`/content`,response:void 0}},{scopes:[`session`],basePath:`plans`,transport:(e,n)=>t.fetch(e,n),sessionAddress:S}),he=`The session is unreachable.`,ge=`This session has not written a plan yet.`;function R(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function z(e){return e.status===0?he:e.error===``?`The session answered ${String(e.status)}.`:e.error}async function B(e){let t=await L.session(e).current();return t.status===404?{ok:!1,error:t.ok||t.error===``?ge:t.error}:t.ok?R(t.data)?{ok:!0,detail:t.data}:{ok:!1,error:`The session answered with no plan.`}:{ok:!1,error:z(t)}}async function _e(e,t,n){let r=await L.session(e).save({body:{expectedHash:t,content:n}});if(r.status===409){let e=r.ok?void 0:r.data,t=R(e)&&typeof e.hash==`string`?e.hash:void 0;return{ok:!1,stale:!0,error:r.ok?`The plan changed since it was opened.`:z(r),...t===void 0?{}:{hash:t}}}return r.ok?{ok:!0,hash:R(r.data)&&typeof r.data.hash==`string`?r.data.hash:``}:{ok:!1,stale:!1,error:z(r)}}var V=`plan-document`,H=`saved`;function ve({sessionId:t,statuses:n,closeTransientTab:r}){let[i,a]=E(void 0),[s,d]=E(void 0),[f,m]=E(!1),[h,g]=E(`preview`),[_,v]=E(void 0),[y,b]=E(!1),[x,S]=E(void 0),C=n[`po-plan-document`]??``;c(()=>{if(t===null)return;let e=!1;return m(!0),B(t).then(t=>{e||(m(!1),t.ok?(a(t.detail),d(void 0),v(void 0),S(void 0)):(a(void 0),d(t.error)))}),()=>{e=!0}},[t,C]);let w=_??i?.content??``,T=async()=>{if(t===null||i===void 0||_===void 0)return;b(!0);let e=await _e(t,i.hash,_);if(b(!1),e.ok){S(H),v(void 0);let e=await B(t);e.ok?a(e.detail):d(e.error)}else S(e.error)};return p(`div`,{"data-testid":`plan-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[p(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-po-border px-4 py-2`,children:[u(`span`,{"data-testid":`plan-title`,className:`min-w-0 flex-1 truncate text-lg font-semibold text-po-hi`,children:i?.title??`plan`}),u(`nav`,{className:`flex shrink-0 items-center gap-1`,children:[`preview`,`source`].map(t=>u(e,{variant:h===t?`outline`:`ghost`,size:`xs`,"data-testid":`plan-view-${t}`,onClick:()=>g(t),children:t},t))}),u(e,{variant:`ghost`,size:`xs`,"data-testid":`plan-close`,onClick:()=>r(V),className:`shrink-0`,children:`close`})]}),f&&i===void 0?u(`p`,{"data-testid":`plan-loading`,className:`px-4 py-3 text-sm text-po-dim`,children:`reading this session's plan…`}):null,s===void 0?null:u(`p`,{"data-testid":`plan-error`,className:`px-4 py-3 text-sm text-po-red`,children:s}),u(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:i===void 0?null:i.unavailable?u(`p`,{"data-testid":`plan-unavailable`,className:`px-4 py-3 text-sm text-po-dim`,children:i.reason??`this plan cannot be shown`}):h===`preview`?u(`div`,{"data-testid":`plan-preview`,className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-4 text-base text-po-text`,children:u(ie,{text:w})}):p(o,{children:[u(l,{"data-testid":`plan-source`,value:w,path:i.path,onChange:v,className:`min-h-0 flex-1`}),p(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-po-border px-3 py-2`,children:[u(e,{variant:`outline`,size:`xs`,"data-testid":`plan-save`,loading:y,disabled:_===void 0||y,onClick:()=>void T(),children:`save to disk`}),_===void 0?null:u(e,{variant:`ghost`,size:`xs`,"data-testid":`plan-revert`,onClick:()=>v(void 0),children:`discard edits`}),x===void 0?null:u(`span`,{"data-testid":`plan-save-note`,className:x===H?`text-sm text-po-green`:`text-sm text-po-red`,children:x})]})]})}),i===void 0?null:u(`footer`,{"data-testid":`plan-source-path`,className:`shrink-0 truncate border-t border-po-border px-4 py-1.5`,children:u(`span`,{className:`font-mono text-sm text-po-dim`,children:i.path})})]})}function U(){return{id:V,label:`plan`,panel:ve}}function ye({sessionId:t,statuses:n,openTransientTab:r}){let i=pe(n[F]);return i===void 0?u(`p`,{"data-testid":`activity-summary-plan`,className:`px-1 text-sm text-po-dim`,children:`no plan written yet`}):p(`div`,{"data-testid":`activity-plan`,className:`flex flex-col gap-0.5`,children:[u(e,{variant:`ghost`,size:`card`,"data-testid":`activity-plan-open`,title:`open ${i.title}`,disabled:t===null,onClick:()=>{t!==null&&r(U())},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:p(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[u(`span`,{"data-testid":`activity-plan-title`,className:`min-w-0 flex-1 truncate text-left text-base font-semibold text-po-hi`,children:i.title}),i.stamp===``?null:u(`span`,{"data-testid":`activity-plan-stamp`,className:`shrink-0 text-sm tabular-nums text-po-dim`,children:i.stamp})]})}),u(`p`,{className:`px-1 text-sm leading-relaxed text-po-dim`,children:`open to read or edit; the agent reads what you save.`})]})}var be=T({slot:`activity.plan`,id:`plan`,component:ye}),xe=h({id:`plan.toggle`,path:[{key:`p`,label:`plan`,detail:`read-only planning modes`},{key:`e`,label:`toggle`,detail:`enter or leave read-only planning`}],command:`mode plan`}),Se=g({name:`plan`,icon:ne,keys:`p e`,statusKey:`plan-mode`,order:20});function Ce({dialog:t,answer:n,cancel:o,defaultExpanded:s=!0}){let[l,m]=E(s),[h,g]=E(0),v=d(null);return c(()=>v.current?.querySelector(`[role="listbox"]`)?.focus(),[t.id]),p(f,{ref:v,open:l,onOpenChange:m,role:`group`,"aria-label":`Plan review`,"data-testid":`plan-review-prompt`,className:`flex min-w-0 flex-col overflow-hidden`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),o())},children:[u(r,{asChild:!0,children:p(e,{variant:`ghost`,"aria-label":l?`Collapse plan review`:`Expand plan review`,className:`h-11 w-full justify-between rounded-none px-3.5`,children:[u(x,{children:`plan review`}),l?null:u(`span`,{className:`ml-auto text-sm font-normal text-po-dim`,children:`Awaiting decision`}),u(l?y:a,{size:16})]})}),p(_,{children:[p(`div`,{className:`flex flex-col gap-1 px-3.5 pb-2`,children:[u(`p`,{className:`text-base font-semibold leading-relaxed text-po-hi`,children:t.title}),u(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:`Review the plan in the conversation before choosing what happens next.`})]}),u(i,{options:t.options,cursor:h,onCursorChange:g,onSelect:n,onFocus:e=>{let t=Array.from(e.currentTarget.children).indexOf(e.target);t!==-1&&g(t)},tabIndex:-1,onKeyDown:e=>{ae(e,{options:t.options,cursor:h,onCursorChange:g,onSelect:n})},testIdPrefix:`plan-review-option`,className:`max-h-48 px-3.5 pb-3 outline-none`}),p(`div`,{className:`flex items-center gap-2 border-t border-po-border-soft px-3.5 py-2`,children:[p(`span`,{className:`text-sm text-po-dim`,children:[ce(t.options.length),` · `,u(te,{children:`esc`}),` cancels`]}),u(e,{variant:`outline`,size:`sm`,"data-testid":`plan-review-cancel`,className:`ml-auto`,onClick:o,children:`cancel`})]})]})]})}var we=[`record_debug_evidence`,`run_fable_plan`,`write_plan`,`complete_plan`];function Te(e){return e.method===`select`&&e.title===`Plan complete. What would you like to do?`&&e.options.length===I.length&&I.every((t,n)=>e.options[n]===t)}var Ee=12,De=72,W=[[`logs`,`log`],[`correlatedTraceEvidence`,`trace`],[`processOutput`,`process output`],[`browserConsoleEvidence`,`console entry`],[`correlationIds`,`correlation id`],[`timestamps`,`timestamp`],[`verifiedFacts`,`verified fact`],[`hypotheses`,`hypothesis`],[`unavailableEvidence`,`unavailable item`]],Oe=[[`goal`,`goal`],[`constraints`,`constraint`],[`decisions`,`decision`],[`verifiedFindings`,`verified finding`],[`inferredFindings`,`inferred finding`],[`unresolvedQuestions`,`open question`]];function G(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function K(e){let t=``;for(let n of e){let e=n.codePointAt(0)??0;t+=e<=31||e===127?` `:n}return t.replace(/\s+/gu,` `).trim()}function q(e,t){let n=e?.[t];return typeof n==`string`&&K(n)||void 0}function ke(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Ae(e,t){let n=e[t];return Array.isArray(n)?n.length:0}function J(e,t){return e===1?t:t.endsWith(`y`)?`${t.slice(0,-1)}ies`:`${t}s`}function je(e){if(e)return e.length>De?`${e.slice(0,69)}…`:e}function Y(e,t){return t.flatMap(([t,n])=>{let r=Ae(e,t);return r>0?[`${r} ${J(r,n)}`]:[]})}function X(e,t,n={}){return{text:e,tone:t,...n}}function Z(e){return e?e.content.flatMap(e=>{let t=G(e);return t?.type===`text`&&typeof t.text==`string`?[t.text]:[]}).join(`
|
|
1
|
+
import{$r as e,At as t,Ba as n,Bi as r,Cn as i,Di as a,Ft as o,Gr as s,Ht as c,Ii as l,It as u,Kt as d,Li as f,Lt as p,Mi as m,Na as h,Pa as g,Ri as _,Ta as v,Ti as y,Wa as b,Yn as x,eo as S,gn as C,hn as w,ja as T,mn as ee,nn as te,on as ne,qa as re,qt as E,un as ie,vi as ae,vn as oe,wa as se,wi as ce}from"../chunks/po-web-runtime-C0B3uAoC.js";var D=`planning`,O=[`modes`,D],k=`main`,A=`subagents`,j=`inherit the session model`,M=`inherit`,N=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],P={id:D,label:`planning`,detail:`the models plan mode switches to, and where written plans land`,order:30,fields:[{id:`main.model`,label:`main model`,keyPath:[...O,k,`model`],placeholder:j,detail:`model the main agent switches to while plan mode is on.`,models:!0},{id:`main.thinking`,label:`main thinking`,keyPath:[...O,k,`thinking`],placeholder:M,detail:`thinking level appended to the main model while planning.`,options:N},{id:`subagents.model`,label:`subagent model`,keyPath:[...O,A,`model`],placeholder:j,detail:`model forced onto delegated planning subagents.`,models:!0},{id:`subagents.thinking`,label:`subagent thinking`,keyPath:[...O,A,`thinking`],placeholder:M,detail:`thinking level appended to the subagent model.`,options:N},{id:`plansdirectory`,label:`plans directory`,keyPath:[...O,`plansDirectory`],placeholder:`~/.po/plans`,detail:`absolute, repo-relative, or under ~. written plans land here.`}].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}))}}))},le=n({...P,icon:s}),ue=n({...P,icon:s}),F=`po-plan-document`,I=[{label:`Exit plan mode and start implementation`,value:`exit`},{label:`Continue planning`,value:`continue`}].map(e=>e.label),de=` · `,fe=/\[[0-9;]*m/gu;function pe(e){if(e===void 0)return;let t=e.replace(fe,``).trim();if(t===``)return;let n=t.lastIndexOf(de);return n===-1?{title:t,stamp:``}:{title:t.slice(0,n).trim(),stamp:t.slice(n+3).trim()}}var me=v({name:`plan`,keys:`p e`,statusKey:F,marksBackgroundWork:!1,order:25}),L=se({current:{method:`GET`,path:`/current`,response:void 0},save:{method:`PUT`,path:`/content`,response:void 0}},{scopes:[`session`],basePath:`plans`,transport:(e,n)=>t.fetch(e,n),sessionAddress:S}),he=`The session is unreachable.`,ge=`This session has not written a plan yet.`;function R(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function z(e){return e.status===0?he:e.error===``?`The session answered ${String(e.status)}.`:e.error}async function B(e){let t=await L.session(e).current();return t.status===404?{ok:!1,error:t.ok||t.error===``?ge:t.error}:t.ok?R(t.data)?{ok:!0,detail:t.data}:{ok:!1,error:`The session answered with no plan.`}:{ok:!1,error:z(t)}}async function _e(e,t,n){let r=await L.session(e).save({body:{expectedHash:t,content:n}});if(r.status===409){let e=r.ok?void 0:r.data,t=R(e)&&typeof e.hash==`string`?e.hash:void 0;return{ok:!1,stale:!0,error:r.ok?`The plan changed since it was opened.`:z(r),...t===void 0?{}:{hash:t}}}return r.ok?{ok:!0,hash:R(r.data)&&typeof r.data.hash==`string`?r.data.hash:``}:{ok:!1,stale:!1,error:z(r)}}var V=`plan-document`,H=`saved`;function ve({sessionId:t,statuses:n,closeTransientTab:r}){let[i,a]=E(void 0),[s,d]=E(void 0),[f,m]=E(!1),[h,g]=E(`preview`),[_,v]=E(void 0),[y,b]=E(!1),[x,S]=E(void 0),C=n[`po-plan-document`]??``;c(()=>{if(t===null)return;let e=!1;return m(!0),B(t).then(t=>{e||(m(!1),t.ok?(a(t.detail),d(void 0),v(void 0),S(void 0)):(a(void 0),d(t.error)))}),()=>{e=!0}},[t,C]);let w=_??i?.content??``,T=async()=>{if(t===null||i===void 0||_===void 0)return;b(!0);let e=await _e(t,i.hash,_);if(b(!1),e.ok){S(H),v(void 0);let e=await B(t);e.ok?a(e.detail):d(e.error)}else S(e.error)};return p(`div`,{"data-testid":`plan-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[p(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-po-border px-4 py-2`,children:[u(`span`,{"data-testid":`plan-title`,className:`min-w-0 flex-1 truncate text-lg font-semibold text-po-hi`,children:i?.title??`plan`}),u(`nav`,{className:`flex shrink-0 items-center gap-1`,children:[`preview`,`source`].map(t=>u(e,{variant:h===t?`outline`:`ghost`,size:`xs`,"data-testid":`plan-view-${t}`,onClick:()=>g(t),children:t},t))}),u(e,{variant:`ghost`,size:`xs`,"data-testid":`plan-close`,onClick:()=>r(V),className:`shrink-0`,children:`close`})]}),f&&i===void 0?u(`p`,{"data-testid":`plan-loading`,className:`px-4 py-3 text-sm text-po-dim`,children:`reading this session's plan…`}):null,s===void 0?null:u(`p`,{"data-testid":`plan-error`,className:`px-4 py-3 text-sm text-po-red`,children:s}),u(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:i===void 0?null:i.unavailable?u(`p`,{"data-testid":`plan-unavailable`,className:`px-4 py-3 text-sm text-po-dim`,children:i.reason??`this plan cannot be shown`}):h===`preview`?u(`div`,{"data-testid":`plan-preview`,className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-4 text-base text-po-text`,children:u(ie,{text:w})}):p(o,{children:[u(l,{"data-testid":`plan-source`,value:w,path:i.path,onChange:v,className:`min-h-0 flex-1`}),p(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-po-border px-3 py-2`,children:[u(e,{variant:`outline`,size:`xs`,"data-testid":`plan-save`,loading:y,disabled:_===void 0||y,onClick:()=>void T(),children:`save to disk`}),_===void 0?null:u(e,{variant:`ghost`,size:`xs`,"data-testid":`plan-revert`,onClick:()=>v(void 0),children:`discard edits`}),x===void 0?null:u(`span`,{"data-testid":`plan-save-note`,className:x===H?`text-sm text-po-green`:`text-sm text-po-red`,children:x})]})]})}),i===void 0?null:u(`footer`,{"data-testid":`plan-source-path`,className:`shrink-0 truncate border-t border-po-border px-4 py-1.5`,children:u(`span`,{className:`font-mono text-sm text-po-dim`,children:i.path})})]})}function U(){return{id:V,label:`plan`,panel:ve}}function ye({sessionId:t,statuses:n,openTransientTab:r}){let i=pe(n[F]);return i===void 0?u(`p`,{"data-testid":`activity-summary-plan`,className:`px-1 text-sm text-po-dim`,children:`no plan written yet`}):p(`div`,{"data-testid":`activity-plan`,className:`flex flex-col gap-0.5`,children:[u(e,{variant:`ghost`,size:`card`,"data-testid":`activity-plan-open`,title:`open ${i.title}`,disabled:t===null,onClick:()=>{t!==null&&r(U())},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:p(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[u(`span`,{"data-testid":`activity-plan-title`,className:`min-w-0 flex-1 truncate text-left text-base font-semibold text-po-hi`,children:i.title}),i.stamp===``?null:u(`span`,{"data-testid":`activity-plan-stamp`,className:`shrink-0 text-sm tabular-nums text-po-dim`,children:i.stamp})]})}),u(`p`,{className:`px-1 text-sm leading-relaxed text-po-dim`,children:`open to read or edit; the agent reads what you save.`})]})}var be=T({slot:`activity.plan`,id:`plan`,component:ye}),xe=h({id:`plan.toggle`,path:[{key:`p`,label:`plan`,detail:`read-only planning modes`},{key:`e`,label:`toggle`,detail:`enter or leave read-only planning`}],command:`mode plan`}),Se=g({name:`plan`,icon:ne,keys:`p e`,statusKey:`plan-mode`,order:20});function Ce({dialog:t,answer:n,cancel:o,defaultExpanded:s=!0}){let[l,m]=E(s),[h,g]=E(0),v=d(null);return c(()=>v.current?.querySelector(`[role="listbox"]`)?.focus(),[t.id]),p(f,{ref:v,open:l,onOpenChange:m,role:`group`,"aria-label":`Plan review`,"data-testid":`plan-review-prompt`,className:`flex min-w-0 flex-col overflow-hidden`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),o())},children:[u(r,{asChild:!0,children:p(e,{variant:`ghost`,"aria-label":l?`Collapse plan review`:`Expand plan review`,className:`h-11 w-full justify-between rounded-none px-3.5`,children:[u(x,{children:`plan review`}),l?null:u(`span`,{className:`ml-auto text-sm font-normal text-po-dim`,children:`Awaiting decision`}),u(l?y:a,{size:16})]})}),p(_,{children:[p(`div`,{className:`flex flex-col gap-1 px-3.5 pb-2`,children:[u(`p`,{className:`text-base font-semibold leading-relaxed text-po-hi`,children:t.title}),u(`p`,{className:`text-sm leading-relaxed text-po-dim`,children:`Review the plan in the conversation before choosing what happens next.`})]}),u(i,{options:t.options,cursor:h,onCursorChange:g,onSelect:n,onFocus:e=>{let t=Array.from(e.currentTarget.children).indexOf(e.target);t!==-1&&g(t)},tabIndex:-1,onKeyDown:e=>{ae(e,{options:t.options,cursor:h,onCursorChange:g,onSelect:n})},testIdPrefix:`plan-review-option`,className:`max-h-48 px-3.5 pb-3 outline-none`}),p(`div`,{className:`flex items-center gap-2 border-t border-po-border-soft px-3.5 py-2`,children:[p(`span`,{className:`text-sm text-po-dim`,children:[ce(t.options.length),` · `,u(te,{children:`esc`}),` cancels`]}),u(e,{variant:`outline`,size:`sm`,"data-testid":`plan-review-cancel`,className:`ml-auto`,onClick:o,children:`cancel`})]})]})]})}var we=[`record_debug_evidence`,`run_fable_plan`,`write_plan`,`complete_plan`];function Te(e){return e.method===`select`&&e.title===`Plan complete. What would you like to do?`&&e.options.length===I.length&&I.every((t,n)=>e.options[n]===t)}var Ee=12,De=72,W=[[`logs`,`log`],[`correlatedTraceEvidence`,`trace`],[`processOutput`,`process output`],[`browserConsoleEvidence`,`console entry`],[`correlationIds`,`correlation id`],[`timestamps`,`timestamp`],[`verifiedFacts`,`verified fact`],[`hypotheses`,`hypothesis`],[`unavailableEvidence`,`unavailable item`]],Oe=[[`goal`,`goal`],[`constraints`,`constraint`],[`decisions`,`decision`],[`verifiedFindings`,`verified finding`],[`inferredFindings`,`inferred finding`],[`unresolvedQuestions`,`open question`]];function G(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function K(e){let t=``;for(let n of e){let e=n.codePointAt(0)??0;t+=e<=31||e===127?` `:n}return t.replace(/\s+/gu,` `).trim()}function q(e,t){let n=e?.[t];return typeof n==`string`&&K(n)||void 0}function ke(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Ae(e,t){let n=e[t];return Array.isArray(n)?n.length:0}function J(e,t){return e===1?t:t.endsWith(`y`)?`${t.slice(0,-1)}ies`:`${t}s`}function je(e){if(e)return e.length>De?`${e.slice(0,69)}…`:e}function Y(e,t){return t.flatMap(([t,n])=>{let r=Ae(e,t);return r>0?[`${r} ${J(r,n)}`]:[]})}function X(e,t,n={}){return{text:e,tone:t,...n}}function Z(e){return e?e.content.flatMap(e=>{let t=G(e);return t?.type===`text`&&typeof t.text==`string`?[t.text]:[]}).join(`
|
|
2
2
|
`):``}function Me(e,t){let n=e.split(`
|
|
3
3
|
`).map(e=>e.trimEnd()).filter(e=>e.length>0),r=t?n:n.slice(0,Ee),i=r.map(e=>X(e,`text`));return n.length>r.length&&i.push(X(`… ${n.length-r.length} more lines`,`dim`)),i}function Ne(e,t){if(e===`record_debug_evidence`){let e=je(q(t,`issue`));return{action:`record evidence`,...e?{detail:e}:{},metadata:Y(t,W)}}if(e===`run_fable_plan`){let e=Y(t,Oe);return q(t,`currentPlan`)&&e.push(`with current plan`),{action:`fable draft`,metadata:e}}if(e===`write_plan`)return{action:`save plan`,metadata:[]};let n=q(t,`decision`);return{action:n?`decide ${n}`:`request approval`,metadata:[]}}function Pe(e,t,n){let r=[G(t?.details)?.recorded===!0?X(`✓ evidence recorded as planning context`,`success`):X(`○ ${K(Z(t))||`not recorded`}`,`muted`)];if(!n.expanded)return r;for(let[t,n]of[[`issue`,`issue`],[`expectedBehavior`,`expected`],[`reproductionAttempt`,`reproduction`],[`actualBehavior`,`actual`]]){let i=q(e,t);i&&r.push(X(`${n} ${i}`,`text`,{label:n}))}for(let[t,n]of W){let i=e[t],a=Array.isArray(i)?i.filter(e=>typeof e==`string`):[];a.length!==0&&(r.push(X(J(a.length,n),`hi`,{bold:!0})),r.push(...a.map(e=>X(K(e),`text`,{indent:!0}))))}return r}function Fe(e,t){let n=G(e?.details),r=Z(e);if(n?.started!==!0){let e=q(n,`errorCode`);return[X(`○ ${K(r)||`fable planning did not start`}${e?` · ${e}`:``}`,`muted`)]}let i=q(n,`status`)??`unknown`,a=typeof n?.draft==`string`?n.draft:void 0,o=q(n,`errorCode`);if(!a)return[X(`✗ fable planning ${i}${o?` · ${o}`:``}`,`error`)];let s=i===`completed`;return[X(`${s?`✓`:`!`} fable draft · ${i}${o?` · ${o}`:``}`,s?`success`:`warning`,{bold:!0}),...Me(a,t.expanded)]}function Ie(e,t){let n=G(e?.details),r=q(n,`path`);if(t.isPartial)return[X(`◐ ${q(n,`phase`)??`checking`}${r?` ${r}`:``}`,`warning`)];let i=ke(n,`durationMs`);if(n?.written===!0)return[X(`✓ wrote ${r??`the plan`}${i===void 0?``:` · ${i}ms`}`,`success`)];let a=[X(`○ ${K(Z(e))||`plan not written`}`,`muted`)];return r&&a.push(X(`path ${r}`,`dim`)),a}function Le(e){let t=K(Z(e));return G(e?.details)?.exited===!0?[X(`✓ plan mode exited${t?` · ${t}`:``}`,`success`)]:[X(`○ staying in plan mode${t?` · ${t}`:``}`,`muted`)]}function Re(e){return K(Z(e))}function Q(e,t,n,r){return r.isError?[X(`✗ ${Re(n)||`${e} failed`}`,`error`)]:e===`record_debug_evidence`?Pe(t,n,r):e===`run_fable_plan`?r.isPartial?[X(`◐ drafting with the local Fable broker`,`warning`)]:Fe(n,r):e===`write_plan`?Ie(n,r):r.isPartial?[X(`◐ waiting for the review decision`,`warning`)]:Le(n)}function ze({toolName:e,args:t,result:n,running:r,isError:i}){let a=Ne(e,t),s=Q(e,t,n,{expanded:!1,isError:i,isPartial:r}),c=Q(e,t,n,{expanded:!0,isError:i,isPartial:r});return u(ee,{tone:m({running:r,isError:i}),expandable:c.length>s.length,children:({expanded:t})=>p(o,{children:[u(C,{title:a.action,children:u(`span`,{"data-testid":`tool-call-${e}`,title:[a.detail,...a.metadata].filter(Boolean).join(` · `)||void 0,className:`min-w-0 flex-1 truncate text-po-dim`,children:[a.detail,...a.metadata].filter(Boolean).join(` · `)})}),(t?c:s).length>0?u(w,{"data-testid":`tool-result-${e}`,children:u(oe,{lines:t?c:s})}):null]})})}var Be=b({tools:[...we],message:ze,prompt:{claims:Te,component:Ce}}),$=(e,t)=>t===void 0?void 0:{...e,...t},Ve=re({id:`plan`,packageName:`@agimon-ai/po-plan`,host:{get settingsSections(){return[$({id:`plan`},le)]}},workspace:{get settingsSections(){return[$({id:`plan`},ue)]}},session:{get activityGroups(){return[$({name:`plan`},me)]},get fills(){return[$({slot:`activity.plan`,id:`plan`},be)]},get leaderBindings(){return[$({id:`plan.toggle`},xe)]},get modes(){return[$({name:`plan`},Se)]},get toolRenderers(){return[$({tools:[`plan`]},Be)]}}});export{Ve as webPlugin};
|
package/dist/assets/plugins/slots/{profile.ab16dcec-DOw3MhWl.js → profile.176710dd-Bc4Rwfhz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ia as e,qa as t}from"../chunks/po-web-runtime-
|
|
1
|
+
import{Ia as e,qa as t}from"../chunks/po-web-runtime-C0B3uAoC.js";var n=e({name:`profile`,command:`profile`,statusKey:`po-profile`,emptyLabel:`None`,order:10}),r=(e,t)=>t===void 0?void 0:{...e,...t},i=t({id:`profile`,packageName:`@agimon-ai/po-profile`,session:{get selectionAxes(){return[r({name:`profile`},n)]}}});export{i as webPlugin};
|
package/dist/assets/plugins/slots/{prompts.ae48c07a-DQVmTxFZ.js → prompts.2c187969-CIBsOkp9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$r as e,At as t,Bt as n,Ga as r,Gi as i,Ht as a,It as o,Jr as s,Ki as c,Lt as l,Ma as u,Sn as d,Wi as f,Xi as p,Yi as m,Zi as h,eo as g,ja as _,kt as v,qa as y,qi as ee,qt as b,tn as x,wa as S,wn as C,wr as w}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,At as t,Bt as n,Ga as r,Gi as i,Ht as a,It as o,Jr as s,Ki as c,Lt as l,Ma as u,Sn as d,Wi as f,Xi as p,Yi as m,Zi as h,eo as g,ja as _,kt as v,qa as y,qi as ee,qt as b,tn as x,wa as S,wn as C,wr as w}from"../chunks/po-web-runtime-C0B3uAoC.js";import{S as T,c as te,i as ne,v as E,x as re}from"../chunks/schemas-DVQ8BvvP.js";var ie={assign:0,create:0,clone:0,discard:0,update:0};function ae(e){return D(typeof e,`bigint`)}function oe(e){return D(typeof e,`boolean`)}function se(e){return D(e,null)}function ce(e){return Number.isFinite(e)}function le(e){return D(typeof e,`object`)&&!se(e)}function ue(e){return D(typeof e,`string`)}function D(e,t){return e===t}function de(e,t,n){return D(e.length,0)?n():t(e[0],e.slice(1))}function fe(e){return D(e,`__proto__`)||D(e,`constructor`)||D(e,`prototype`)}function pe(e,t){return fe(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function me(e){return Object.getOwnPropertyNames(e)}function he(e){return Object.getOwnPropertySymbols(e)}var ge={immutableTypes:!1,maxErrors:8,maxParseErrors:1,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function _e(){return ge}function ve(e){return[...me(e),...he(e)]}function ye(e,t){if(!t.has(e)){t.add(e);for(let n of ve(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&`value`in r&&le(r.value)&&ye(r.value,t)}Object.freeze(e)}}function be(e){return _e().immutableTypes&&ye(e,new WeakSet),e}function xe(e,t){return{...e,...t}}function Se(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function O(e,t,n={}){ie.create+=1;let r=xe(t,n);return be(_e().enumerableKind?xe(r,e):Se(r,e))}function Ce(e,t,n,r){for(let i of ve(e)){if(fe(i)||t.includes(i)||n.includes(i))continue;let a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,a)}}function we(e,t,n){let r=_e().enumerableKind;for(let i of t)fe(i)||Object.defineProperty(n,i,{configurable:!0,writable:!0,enumerable:r,value:e[i]})}function Te(e,t,n){for(let r of t)fe(r)||Object.defineProperty(n,r,{configurable:!0,enumerable:!0,writable:!0,value:e[r]})}function Ee(e,t,n){ie.update+=1;let r={},i=ve(t),a=ve(n);return Ce(e,i,a,r),we(t,i,r),Te(n,a,r),be(r)}function De(e){return le(e)}function Oe(e,t){return Ee(e,{"~optional":!0},t)}function ke(e,t){return O({"~kind":`Array`},{type:`array`,items:e},t)}function Ae(e){return O({"~kind":`Never`},{not:{}},e)}function je(e,t={}){return Oe(e,t)}function Me(e){return je(e)}function Ne(e){return De(e)&&pe(e,`~optional`)}function Pe(e){return me(e).filter(t=>!Ne(e[t]))}function k(e,t={}){let n=Pe(e);return O({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function Fe(e){return O({"~kind":`Unknown`},{},e)}var Ie=new Float64Array(1);new DataView(Ie.buffer),new Uint8Array(Ie.buffer),new TextEncoder;function Le(e){return O({"~kind":`BigInt`},{type:`bigint`},e)}var Re=`-?(?:0|[1-9][0-9]*)`;function ze(e){return O({"~kind":`Integer`},{type:`integer`},e)}var Be=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function Ve(e){return ae(e)?`bigint`:oe(e)?`boolean`:ce(e)?`number`:ue(e)?`string`:(()=>{throw new Be(e)})()}function A(e,t){return O({"~kind":`Literal`},{type:Ve(e),const:e},t)}var He=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Ue(e){return O({"~kind":`Number`},{type:`number`},e)}function j(e){return O({"~kind":`String`},{type:`string`},e)}function M(e,t={}){return O({"~kind":`Union`},{anyOf:e},t)}var We=`^${Re}$`;`${He}`;function Ge(e){return Le()}function Ke(e){return j()}function qe(e){return Ue()}function Je(e){return ze()}function Ye(e){return Ae()}function Xe(e){return A(e)}function Ze(e){return e}function Qe(e){return M(e[1])}function $e(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function et(e){return[e[0],...e[1]]}function tt(e){return e}function nt(e){return D(e.length,2)}function rt(e,t,n){return nt(e)?t(e[0],e[1]):n()}function it(e,t){return D(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function at(e,t){for(let n=0;n<e.length;n++){let r=it(e[n],t);if(nt(r))return r}return[]}function ot(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var st=[...ot(97,122),...ot(65,90)],ct=[`0`,...ot(49,57)],lt=`//`,ut=`/*`,dt=`*/`;function ft(e){let t=e.indexOf(dt);return D(t,-1)?``:e.slice(t+2)}function pt(e){let t=e.indexOf(`
|
|
2
2
|
`);return D(t,-1)?``:e.slice(t)}function mt(e){return e.replace(/^[ \t\r\f\v]+/,``)}function ht(e){let t=mt(e);return t.startsWith(ut)?ht(ft(t.slice(2))):t.startsWith(lt)?ht(pt(t.slice(2))):t}function gt(e){let t=e.trimStart();return t.startsWith(ut)?gt(ft(t.slice(2))):t.startsWith(lt)?gt(pt(t.slice(2))):t}[...ct];function _t(e,t){return at([e],t)}function N(e,t){return D(e,``)?[``,t]:e.startsWith(`
|
|
3
3
|
`)?_t(e,ht(t)):e.startsWith(` `)?_t(e,t):_t(e,gt(t))}[...st,...ct],[...ct];function vt(e){return D(e,``)?[]:[e.slice(0,1),e.slice(1)]}function yt(e,t){return de(e,(e,n)=>t.startsWith(e)?!0:yt(n,t),()=>!1)}function bt(e,t,n=``){return rt(vt(t),(r,i)=>yt(e,t)?[n,t]:bt(e,i,`${n}${r}`),()=>[])}function xt(e,t){return rt(bt(e,t),(e,t)=>D(e,``)?[]:[e,t],()=>[])}var P=(e,t,n=()=>[])=>e.length===2?t(e):n(),St=e=>P(N(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Ge(e),t]),Ct=e=>P(N(`.*`,e),([e,t])=>[Ke(e),t]),wt=e=>P(N(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[qe(e),t]),Tt=e=>P(N(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[Je(e),t]),Et=e=>P(N(`(?!)`,e),([e,t])=>[Ye(e),t]),Dt=e=>P(xt([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[Xe(e),t]),Ot=e=>P(P(St(e),([e,t])=>[e,t],()=>P(Ct(e),([e,t])=>[e,t],()=>P(wt(e),([e,t])=>[e,t],()=>P(Tt(e),([e,t])=>[e,t],()=>P(Et(e),([e,t])=>[e,t],()=>P(kt(e),([e,t])=>[e,t],()=>P(Dt(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[Ze(e),t]),kt=e=>P(P(N(`(`,e),([e,t])=>P(Mt(t),([t,n])=>P(N(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Qe(e),t]),At=e=>P(P(P(jt(e),([e,t])=>P(N(`|`,t),([t,n])=>P(At(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>P(P(jt(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>P([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[$e(e),t]),jt=e=>P(P(Ot(e),([e,t])=>P(Mt(t),([t,n])=>[[e,t],n])),([e,t])=>[et(e),t]),Mt=e=>P(P(At(e),([e,t])=>[e,t],()=>P(jt(e),([e,t])=>[e,t],()=>[])),([e,t])=>[tt(e),t]);new RegExp(We);var Nt=[0,31,28,31,30,31,30,31,31,30,31,30,31],Pt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Ft(e){return e%4==0&&(e%100!=0||e%400==0)}function It(e){let t=Pt.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&Ft(n)?29:Nt[r])}var Lt=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Rt(e,t=!0){let n=Lt.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function zt(e){let t=e.split(/T/i);return t.length===2&&It(t[0])&&Rt(t[1])}var Bt=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function Vt(e){return Bt.test(e)}var Ht=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function Ut(e){return Ht.test(e)}var Wt=/^(?!-).*(?<!-)$/,Gt=/^(?!..--)/,Kt=/^[a-zA-Z0-9-]*$/,qt=/[^\p{ASCII}]/u,Jt=/[0-9]/,Yt=/[\u{0660}-\u{0669}]/u,Xt=/[\u{06f0}-\u{06f9}]/u,Zt=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,Qt=/[\u{002d}\u{002b}]/u,$t=/\p{Mn}/u,en=/\p{Mc}/u,tn=/[\p{Mn}\p{Mc}\p{Me}]/u,nn=/\p{L}/u,rn=/\p{Nd}/u,an=/\p{Script=Greek}/u,on=/\p{Script=Hebrew}/u,sn=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,cn=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,ln=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,un=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,dn=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,fn=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,pn=new RegExp([Jt,Xt].map(e=>e.source).join(`|`),`u`),mn=new RegExp([nn,Qt,Zt,rn,$t,en,dn,fn].map(e=>e.source).join(`|`),`u`);function hn(e){return Wt.test(e)&&Gt.test(e)&&Kt.test(e)}var F=36,gn=1,_n=26,vn=38,yn=700,bn=72,xn=128;function Sn(){throw null}function Cn(e){return e.toLowerCase().startsWith(`xn--`)}function wn(e,t,n){e=n?Math.floor(e/yn):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=F;return r+Math.floor(36*e/(e+vn))}function Tn(e){let t=[],n=xn,r=0,i=bn,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&Sn(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=F;for(;;){o>=e.length&&Sn();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:Sn(),r+=n*s;let a=c<=i?gn:c>=i+_n?_n:c-i;if(n<a)break;s*=F-a,c+=F}let l=t.length+1;i=wn(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function En(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Dn=new RegExp(qt.source,`gu`);function On(e){let t=e.replace(Dn,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=xn,o=0,s=bn,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=F;;t+=F){let n=t<=s?gn:t>=s+_n?_n:t-s;if(e<n)break;let i=n+(e-n)%(F-n);r.push(En(i)),e=Math.floor((e-n)/(F-n))}r.push(En(e)),s=wn(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var kn=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,An=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,jn=/^(?:R|AL|AN)$/;function Mn(e){if(Cn(e))try{return Pn(Tn(e.slice(4).toLowerCase()))}catch{return!1}return Pn(e)}function Nn(e){let t=String.fromCodePoint(e);return pn.test(t)?`EN`:Yt.test(t)?`AN`:$t.test(t)?`NSM`:on.test(t)?`R`:cn.test(t)?`AL`:nn.test(t)?`L`:`ON`}function Pn(e){for(let t of e)if(jn.test(Nn(t.codePointAt(0))))return!0;return!1}function Fn(e){let t=!1,n=An,r=!1,i=!1,a=!0;for(let o of e){let e=Nn(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?kn:An,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function In(e){return qt.test(e)&&On(e).length+4>63}function Ln(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function Rn(e){if(In(e)||Pn(e)&&!Fn(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(Ln(t)||tn.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(un.test(a)||!mn.test(a))return!1;sn.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!an.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!on.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!ln.test(t[e-1]))return!1;break;case 8205:if(!o||!ln.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function zn(e){if(!Cn(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=Tn(t);return qt.test(n)?Rn(n):!1}catch{return!1}}function Bn(e){return e.length>0&&e.length<=63}function Vn(e){return Bn(e)&&(zn(e)||hn(e))}function Hn(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>Vn(e))}function Un(e){return e.length>0&&e.length<=63}function Wn(e){return Un(e)&&(zn(e)||Rn(e))}function Gn(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function Kn(e){if(e.length===0||e.includes(` `))return!1;let t=Gn(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>Mn(e));return n.every(e=>Wn(e)&&(!r||Fn(e)))}function qn(e){return Hn(e)}var Jn=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function Yn(e){return Jn.test(e.normalize(`NFC`))}function Xn(e){return Kn(e)}var Zn=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Qn(e){return Zn.test(e)}var $n=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function er(e){return $n.test(e)}var tr=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,nr=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function rr(e){return!tr.test(e)&&!nr.test(e)&&URL.canParse(e,`http://example.com`)}var ir=/[\x00-\x20<>\^`{|}\\]/,ar=/%(?![0-9a-fA-F]{2})/;function or(e){return ir.test(e)||ar.test(e)?!1:URL.canParse(e)}var sr=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function cr(e){return sr.test(e)}var lr=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ur(e){return lr.test(e)}function dr(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var fr=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function pr(e){return fr.test(e)}var mr=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function hr(e){return mr.test(e)}var gr=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function _r(e){return gr.test(e)}var vr=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yr(e){return vr.test(e)}function br(e){return URL.canParse(e)}var xr=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Sr(e){return xr.test(e)}var I=new Map;function Cr(){I.clear()}function wr(){Cr(),I.set(`date-time`,zt),I.set(`date`,It),I.set(`duration`,Vt),I.set(`email`,Ut),I.set(`hostname`,qn),I.set(`idn-email`,Yn),I.set(`idn-hostname`,Xn),I.set(`ipv4`,Qn),I.set(`ipv6`,er),I.set(`iri-reference`,rr),I.set(`iri`,or),I.set(`json-pointer-uri-fragment`,cr),I.set(`json-pointer`,ur),I.set(`regex`,dr),I.set(`relative-json-pointer`,pr),I.set(`time`,Rt),I.set(`uri-reference`,hr),I.set(`uri-template`,_r),I.set(`uri`,yr),I.set(`url`,br),I.set(`uuid`,Sr)}wr(),BigInt(2**53-1),BigInt(-(2**53-1)),M([k({type:A(`insert`),path:j(),value:Fe()}),Object({type:A(`update`),path:j(),value:Fe()}),k({type:A(`delete`),path:j()})]);var L=Object.freeze({title:120,summary:600,details:12,label:60,value:300,name:200,content:65536,feedback:2e3}),Tr=j({minLength:1,maxLength:L.name}),Er=ke(k({path:j({maxLength:512,pattern:`^(?!host/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^/\\\\:\\x00-\\x1f]+(?:/[^/\\\\:\\x00-\\x1f]+)*(?![\\s\\S])`}),label:j({minLength:1,maxLength:L.label})}),{maxItems:8});k({id:Tr,toolCallId:Tr,operation:k({kind:M([A(`tool`),A(`codemode`)]),name:Tr}),requirement:M([A(`ask`),A(`human`)]),title:j({minLength:1,maxLength:L.title}),summary:j({maxLength:L.summary}),details:Me(ke(k({label:j({maxLength:L.label}),value:j({maxLength:L.value})}),{maxItems:L.details})),content:Me(j({maxLength:L.content})),artifacts:Me(Er)});var Dr=Symbol.for(`yaml.alias`),Or=Symbol.for(`yaml.document`),R=Symbol.for(`yaml.map`),kr=Symbol.for(`yaml.pair`),Ar=Symbol.for(`yaml.scalar`),jr=Symbol.for(`yaml.seq`),z=Symbol.for(`yaml.node.type`),B=e=>!!e&&typeof e==`object`&&e[z]===Dr,Mr=e=>!!e&&typeof e==`object`&&e[z]===Or,Nr=e=>!!e&&typeof e==`object`&&e[z]===R,V=e=>!!e&&typeof e==`object`&&e[z]===kr,H=e=>!!e&&typeof e==`object`&&e[z]===Ar,Pr=e=>!!e&&typeof e==`object`&&e[z]===jr;function U(e){if(e&&typeof e==`object`)switch(e[z]){case R:case jr:return!0}return!1}function W(e){if(e&&typeof e==`object`)switch(e[z]){case Dr:case R:case Ar:case jr:return!0}return!1}var Fr=e=>(H(e)||U(e))&&!!e.anchor,G=Symbol(`break visit`),Ir=Symbol(`skip children`),Lr=Symbol(`remove node`);function Rr(e,t){let n=zr(t);Mr(e)?K(null,e.contents,n,Object.freeze([e]))===Lr&&(e.contents=null):K(null,e,n,Object.freeze([]))}Rr.BREAK=G,Rr.SKIP=Ir,Rr.REMOVE=Lr;function K(e,t,n,r){let i=Br(e,t,n,r);if(W(i)||V(i))return Vr(e,r,i),K(e,i,n,r);if(typeof i!=`symbol`){if(U(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=K(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===G)return G;else i===Lr&&(t.items.splice(e,1),--e)}}else if(V(t)){r=Object.freeze(r.concat(t));let e=K(`key`,t.key,n,r);if(e===G)return G;e===Lr&&(t.key=null);let i=K(`value`,t.value,n,r);if(i===G)return G;i===Lr&&(t.value=null)}}return i}function zr(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Br(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Nr(t))return n.Map?.(e,t,r);if(Pr(t))return n.Seq?.(e,t,r);if(V(t))return n.Pair?.(e,t,r);if(H(t))return n.Scalar?.(e,t,r);if(B(t))return n.Alias?.(e,t,r)}function Vr(e,t,n){let r=t[t.length-1];if(U(r))r.items[e]=n;else if(V(r))e===`key`?r.key=n:r.value=n;else if(Mr(r))r.contents=n;else{let e=B(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function Hr(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Ur(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Ur(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Ur(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Ur(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Ur(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function q(e,t,n){if(Array.isArray(e))return e.map((e,t)=>q(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Fr(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Wr=class{constructor(e){Object.defineProperty(this,z,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Mr(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=q(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Ur(i,{"":o},``,o):o}},Gr=class extends Wr{constructor(e){super(Dr),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Rr(e,{Node:(e,t)=>{(B(t)||Fr(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(q(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Kr(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Hr(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Kr(e,t,n){if(B(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(U(t)){let r=0;for(let i of t.items){let t=Kr(e,i,n);t>r&&(r=t)}return r}if(V(t)){let r=Kr(e,t.key,n),i=Kr(e,t.value,n);return Math.max(r,i)}return 1}var qr=e=>!e||typeof e!=`function`&&typeof e!=`object`,J=class extends Wr{constructor(e){super(Ar),this.value=e}toJSON(e,t){return t?.keep?this.value:q(this.value,e,t)}toString(){return String(this.value)}};J.BLOCK_FOLDED=`BLOCK_FOLDED`,J.BLOCK_LITERAL=`BLOCK_LITERAL`,J.PLAIN=`PLAIN`,J.QUOTE_DOUBLE=`QUOTE_DOUBLE`,J.QUOTE_SINGLE=`QUOTE_SINGLE`;var Jr=`tag:yaml.org,2002:`;function Yr(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Xr(e,t,n){if(Mr(e)&&(e=e.contents),W(e))return e;if(V(e)){let t=n.schema[R].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new Gr(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Jr+t.slice(2));let l=Yr(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new J(e);return c&&(c.node=t),t}l=e instanceof Map?o[R]:Symbol.iterator in Object(e)?o[jr]:o[R]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new J(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zr(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Xr(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Qr=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,$r=class extends Wr{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>W(t)||V(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Qr(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(U(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Zr(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(U(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&H(i)?i.value:i:U(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!V(t))return!1;let n=t.value;return n==null||e&&H(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return U(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(U(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Zr(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},ei=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function ti(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Y=(e,t,n)=>e.endsWith(`
|
|
4
4
|
`)?ti(n,t):n.includes(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ft as e,It as t,Lt as n,Mi as r,Oi as i,Wa as a,Xr as o,Zt as s,_n as c,gn as l,hn as u,mn as d,qa as f,ri as p,yi as m}from"../chunks/po-web-runtime-
|
|
1
|
+
import{Ft as e,It as t,Lt as n,Mi as r,Oi as i,Wa as a,Xr as o,Zt as s,_n as c,gn as l,hn as u,mn as d,qa as f,ri as p,yi as m}from"../chunks/po-web-runtime-C0B3uAoC.js";function h(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function g(e){let t=h(e.offset),n=h(e.limit);return{path:typeof e.path==`string`?e.path:``,details:[t===void 0?void 0:`from ${t}`,n===void 0?void 0:`${n} lines`].filter(e=>e!==void 0&&e.length>0)}}var _=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function v(e){return e.flatMap(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return[];let t=e;return t.type===`image`&&typeof t.data==`string`&&typeof t.mimeType==`string`&&_.has(t.mimeType)?[{data:t.data,mimeType:t.mimeType}]:[]})}function y({args:a,result:f,output:h,running:_,isError:y,fileTabFor:b,openTransientTab:x}){let S=g(a),C=v(f?.content??[]),w=b(S.path),T=f===null||y?null:m(f,h,`read`,!0);return t(d,{tone:r({running:_,isError:y}),expandable:!0,defaultExpanded:!1,children:({expanded:r})=>n(e,{children:[t(l,{title:`read`,children:n(`span`,{"data-testid":`tool-call-read`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[t(o,{path:S.path,...w===void 0?{}:{onOpen:()=>x(w)}}),S.details.length>0?n(`span`,{className:`shrink-0 text-po-faint`,children:[`· `,S.details.join(` · `)]}):null]})}),r?y?n(u,{"data-testid":`tool-result-read`,className:`flex flex-col`,children:[t(c,{tone:`error`,children:`failed`}),i(f,h).map((e,n)=>t(`span`,{className:`whitespace-pre-wrap break-words text-po-red`,children:e},`${String(n)}-${e}`))]}):T===null?_?t(u,{"data-testid":`tool-result-read`,children:t(c,{tone:`running`,children:`running`})}):null:T.shown.length===0&&T.notice===void 0&&C.length===0?null:n(u,{"data-testid":`tool-result-read`,className:`flex flex-col gap-1`,children:[t(s,{lines:T.shown,gutter:T.gutter,path:S.path}),C.map((e,n)=>t(p,{src:`data:${e.mimeType};base64,${e.data}`,alt:`Read result ${String(n+1)}`,"data-testid":`tool-result-read-image`,className:`h-auto max-h-96 max-w-full rounded-md border border-po-border-soft object-contain`},`${e.mimeType}:${String(n)}`)),T.notice===void 0?null:t(`span`,{className:`text-po-faint`,children:T.notice})]}):null]})})}var b=a({message:y}),x=(e,t)=>t===void 0?void 0:{...e,...t},S=f({id:`read`,packageName:`@agimon-ai/po-read`,session:{get toolRenderers(){return[x({tools:[`read`]},b)]}}});export{S as webPlugin};
|
package/dist/assets/plugins/slots/{runner.6e494d59-BDtBIqmQ.js → runner.962030e5-CCUVliK7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$r as e,An as t,At as n,Bt as r,Da as i,Ft as a,Gt as o,Ht as s,It as c,Jn as l,Jt as u,Kt as d,Lt as f,Mi as p,Mn as m,Nr as h,On as g,Pt as _,Ra as v,Ta as y,Ti as b,Vt as x,Wa as S,_n as C,dn as w,ea as T,eo as E,fa as D,ga as ee,gn as te,hn as O,ja as ne,la as k,mn as re,na as A,oa as ie,pa as ae,qa as j,qr as oe,qt as M,si as N,tn as P,wa as F,zn as se,zr as I}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,An as t,At as n,Bt as r,Da as i,Ft as a,Gt as o,Ht as s,It as c,Jn as l,Jt as u,Kt as d,Lt as f,Mi as p,Mn as m,Nr as h,On as g,Pt as _,Ra as v,Ta as y,Ti as b,Vt as x,Wa as S,_n as C,dn as w,ea as T,eo as E,fa as D,ga as ee,gn as te,hn as O,ja as ne,la as k,mn as re,na as A,oa as ie,pa as ae,qa as j,qr as oe,qt as M,si as N,tn as P,wa as F,zn as se,zr as I}from"../chunks/po-web-runtime-C0B3uAoC.js";var ce=`/runners start`,L={command:'exec "${SHELL:-/bin/bash}" -l',name:`shell`,interactive:!0};function le(e,t){let n=t.trim()===``?{}:{cwd:t};return e.trim()===``?{...L,...n}:{command:e,...n,preferInteractive:!0}}function R(e){return/\s/u.test(e)?`"${e}"`:e}function z(e){let t=e.cwd?.trim()??``,n=e.name?.trim()??``;return[ce,...n===``?[]:[`name=${R(n)}`],...t===``?[]:[`cwd=${R(t)}`],...e.interactive===!0?[`interactive=true`]:e.preferInteractive===!0?[`interactive=prefer`]:[],`--`,e.command.trim()].join(` `)}var ue=`runner_runs`,B=`/runners stop`,V=v({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 de(e,t,n){e(t,{type:`prompt`,message:z(n)})}var K=V.channel({channel:ue,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 fe(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 pe(e,t,n,r={}){let i=e.split(`
|
|
2
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 me(e,t){let n=Math.max(1,e-t+1);return Array.from({length:t},(e,t)=>n+t)}function he(e,t,n){return e&&!t&&n}function ge(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 _e(e,t,n){let r=new Set([...e,t]);return r.delete(``),n!==void 0&&r.delete(n),[...r]}function ve(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 ye({command:t,onCommandChange:n,cwd:r,onCwdChange:i,sessionDirectory:a,folders:o,problem:s,onLaunch:l,defaultFolderOpen:u=!1}){let[d,p]=M(u),[h,_]=M(``),v=ge(r,a),y=e=>{i(e),_(``),p(!1)},x=[{value:``,title:`Session directory`,subtitle:a??`Where this session started`},..._e(o,r,a).map(e=>({value:e,title:ge(e,a),subtitle:e}))];return f(`div`,{className:`flex shrink-0 flex-col gap-1.5 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:[f(`div`,{className:`flex flex-wrap items-center gap-2 sm:flex-nowrap`,children:[f(`span`,{className:`relative flex min-w-0 flex-1 basis-full items-center sm:basis-auto`,children:[c(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute left-3 font-mono text-base text-po-faint`,children:`$`}),c(P,{size:`lg`,"data-testid":`runners-panel-command`,"aria-label":`Command to run`,value:t,placeholder:`a command, like pnpm dev`,autoComplete:`off`,spellCheck:!1,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()},className:`w-full pl-7 font-mono`})]}),f(m,{open:d,onOpenChange:p,children:[c(se,{asChild:!0,children:f(e,{variant:`outline`,size:`lg`,"data-testid":`runners-panel-cwd`,"aria-label":`Runs in ${v}`,"aria-invalid":s!==void 0||void 0,title:r===``?a:r,className:`max-w-56 gap-1.5 px-3 font-mono ${s===void 0?``:`border-po-red`}`,children:[c(ee,{className:`h-3.5 w-3.5 shrink-0 text-po-faint`}),c(`span`,{className:`truncate`,children:v}),c(b,{className:`size-3.5 shrink-0 opacity-60`})]})}),c(g,{side:`bottom`,align:`start`,title:`Runs in`,items:x,value:[r],onSelect:y,footer:f(`span`,{className:`relative flex items-center px-3 py-2`,children:[c(ee,{className:`pointer-events-none absolute left-5.5 h-3.5 w-3.5 text-po-faint`}),c(P,{"data-testid":`runners-panel-cwd-path`,"aria-label":`Another folder`,value:h,placeholder:`another folder, like packages/web`,spellCheck:!1,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h.trim()!==``&&y(h.trim())},className:`w-full pl-8 font-mono`})]})})]}),c(e,{variant:`primary`,size:`lg`,"data-testid":`runners-panel-run`,onClick:l,children:t.trim()===``?`Open shell`:`Run`})]}),s===void 0?c(`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.`}):f(`span`,{role:`alert`,"data-testid":`runners-panel-problem`,className:`flex items-center gap-1.5 text-sm text-po-red`,children:[c(A,{className:`size-3.5 shrink-0`}),s]})]})}var q=`runId`,be=`screen`,xe=`append`,J={lines:`lines`,grep:`grep`,ignoreCase:`ignoreCase`,contextLines:`contextLines`,from:`from`,generation:`generation`},Se={log:{method:`GET`,path:`/runners/:${q}/log`,query:[J.lines,J.grep,J.ignoreCase,J.contextLines],response:void 0},logStream:{method:`GET`,path:`/runners/:${q}/log/stream`,query:[J.from],stream:!0},screenStream:{method:`GET`,path:`/runners/:${q}/screen/stream`,query:[J.from],stream:!0},logRead:{method:`GET`,path:`/runners/:${q}/log/read`,query:[J.from],response:void 0},screenRead:{method:`GET`,path:`/runners/:${q}/screen/read`,query:[J.from,J.generation],response:void 0},input:{method:`POST`,path:`/runners/:${q}/screen/input`}},Y=F(Se,{scopes:[`session`],basePath:`runner`,transport:(e,t)=>n.fetch(e,t),sessionAddress:E});function Ce(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 we=5,Te=500;function Ee(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function De(e,t,n,r){let i=n,a=0,o=!1,s,c,l=()=>{if(o)return;let n=new EventSource(Y.session(e).screenStream.url({params:{[q]:t},query:{[J.from]:i}}));s=n,n.addEventListener(be,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!Ee(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>we?r.onLost():c=setTimeout(l,Te*2**(a-1)))})};return l(),{close:()=>{o=!0,c!==void 0&&clearTimeout(c),s?.close()}}}async function Oe(e,t,n){let r={text:n};return(await Y.session(e).input({params:{[q]:t},body:r})).ok}var ke=`The cockpit hub is unreachable.`;function Ae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function je(e,t,n={},r){let i=await Y.session(e).log({params:{[q]:t},query:{[J.lines]:n.lines,[J.grep]:n.grep===``?void 0:n.grep,[J.ignoreCase]:n.ignoreCase===!0||void 0,[J.contextLines]:n.contextLines},...r===void 0?{}:{signal:r}});return i.ok?!Ae(i.data)||typeof i.data.text!=`string`?{error:`The hub answered ${String(i.status)}.`}:{slice:i.data}:i.status===0?{error:r?.aborted===!0?``:ke}:{error:i.error===``?`The hub answered ${String(i.status)}.`:i.error}}var Me=5,Ne=500,Pe=2e3;function Fe(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=Pe;try{let r=await Y.session(e).logRead({params:{[q]:t},query:{[J.from]:i},signal:u.signal});if(o||!r.ok)return;let a=r.data;a.reset&&(d=new TextDecoder,f=``),f+=d.decode(Ce(a.chunk),{stream:!a.ended});let s=f.split(`
|
|
3
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(Y.session(e).logStream.url({params:{[q]:t},query:{[J.from]:i}}))}catch{m();return}c=n,n.addEventListener(`open`,()=>{s=!0}),n.addEventListener(xe,e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(!Ae(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>Me?m():l=setTimeout(h,Ne*2**(a-1)))})};return h(),{close:()=>{o=!0,l!==void 0&&clearTimeout(l),c?.close(),u.abort()}}}var Ie=`runner-log-`,Le=2e3,Re=2,ze=200,Be=24,X=1024,Ve=X*X;function Z(e){let t=e.id;return{id:`${Ie}${t}`,label:`log · ${e.name}`,panel:e=>c(Ge,{...e,runId:t})}}function He(e){return e<X?`${e} B`:e<Ve?`${(e/X).toFixed(1)} KB`:`${(e/Ve).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 f(`div`,{"data-testid":`runner-log-row`,"data-matched":n,className:`flex min-w-0 gap-2`,children:[e===void 0?null:c(`span`,{className:`w-12 shrink-0 select-none text-right font-mono text-sm leading-relaxed text-po-faint`,children:e}),c(`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?`>>`:``}),c(ie,{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:t,runId:n,sendSessionFrame:i,onTerminal:u}){let{runs:p,stopRequested:m}=_(V.store,e=>V.select(e,t)),g=p.find(e=>e.id===n),[v,y]=M(``),[S,C]=M(``),[w,T]=M(!1),[E,D]=M(Re),[ee,te]=M(!0),[O,ne]=M(void 0),[k,re]=M(void 0),[A,ie]=M([]),[ae,j]=M(0),[oe,N]=M(void 0),[F,se]=M(!0),[I,ce]=M(!1),L=d(null),le=d(null),R=S!==``,z=he(ee,R,O?.running===!0);s(()=>{let e=setTimeout(()=>C(v),ze);return()=>clearTimeout(e)},[v]);let ue=r(e=>{t!==null&&je(t,n,R?{grep:S,ignoreCase:w,contextLines:E}:{},e).then(t=>{e.aborted||(`error`in t?t.error!==``&&N(t.error):(N(void 0),ie([]),j(0),ne(t.slice),re(t.slice.completeBytes)))})},[t,n,R,S,w,E]);s(()=>{let e=new AbortController;return ue(e.signal),()=>e.abort()},[ue]),s(()=>{if(!z||t===null||k===void 0)return;let e=Fe(t,n,k,{onEvent:e=>{e.lines.length>0&&ie(t=>[...t,...e.lines].slice(-2e3)),typeof e.offset==`number`&&j(e.offset),e.ended===!0&&te(!1)}});return()=>e.close()},[z,t,n,k]);let B=O!==void 0&&O.exists&&O.completeBytes<O.fileSize,H=pe(O?.text??``,A,Le,{dropPartialTail:z&&B}),U=o(()=>O===void 0?[]:R?O.lineNumbers??[]:me(O.totalLines+A.length-(z&&B?1:0),H.lines.length),[O,R,A.length,z,B,H.lines.length]);s(()=>{z&&F&&L.current?.scrollIntoView({block:`end`})},[z,F,H.lines.length]);let W=()=>{let e=le.current;e!==null&&se(e.scrollHeight-e.scrollTop-e.clientHeight<=Be)},de=ve(g),K=g!==void 0&&m.includes(g.id);return f(`div`,{"data-testid":`runner-log-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[f(`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:[c(`span`,{"data-testid":`runner-log-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:g?.name??n}),c(h,{tone:de.tone,size:`md`,"data-testid":`runner-log-state`,children:de.label}),g?f(a,{children:[c(Ke,{run:g}),c(`span`,{className:`shrink-0 text-sm text-po-dim`,children:`pid ${String(g.pid)} · ${g.backend}${g.interactive?` · tty`:``}`})]}):c(`span`,{"data-testid":`runner-log-gone`,className:`text-sm text-po-dim`,children:`no longer listed; its log stays readable`}),c(`span`,{className:`min-w-0 flex-1`}),u?c(e,{variant:`outline`,size:`sm`,"data-testid":`runner-log-terminal`,onClick:u,children:`Back to terminal`}):null,g!==void 0&&g.state===`running`&&t!==null?c(e,{variant:K?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-log-stop`,disabled:K,title:K?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(i,t,g.id),children:K?`Stopping…`:`Stop`}):null]}),g?c(`div`,{className:`shrink-0 border-b border-po-border-soft px-3 py-3 sm:px-[26px]`,children:f(`div`,{className:`flex items-start gap-2 rounded-md bg-po-deep px-3 py-2`,children:[f(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[f(`span`,{"data-testid":`runner-log-command`,title:I?void 0:`${g.command}\nin ${g.cwd}`,className:`font-mono text-base text-po-hi ${I?`break-all`:`truncate`}`,children:[f(`span`,{"aria-hidden":!0,className:`select-none text-po-faint`,children:[`$`,` `]}),g.command]}),I?f(`span`,{className:`break-all font-mono text-sm text-po-dim`,children:[`in `,g.cwd]}):null]}),c(`button`,{type:`button`,"data-testid":`runner-log-command-toggle`,"aria-expanded":I,"aria-label":I?`Collapse command`:`Expand command`,className:`flex size-6 shrink-0 items-center justify-center rounded text-po-faint hover:text-po-hi`,onClick:()=>ce(e=>!e),children:c(b,{className:`size-4 transition-transform ${I?`rotate-180`:``}`})})]})}):null,f(`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:[f(`span`,{className:`relative flex min-w-0 flex-1 items-center sm:w-72 sm:flex-none`,children:[c(l,{className:`pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-po-faint`}),c(P,{size:`md`,"data-testid":`runner-log-search`,value:v,placeholder:`Search output`,onChange:e=>y(e.target.value),className:`w-full pl-8`})]}),c(e,{variant:w?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-ignore-case`,"aria-pressed":w,title:`match regardless of case`,onClick:()=>T(e=>!e),children:w?`Any case`:`Match case`}),c(e,{variant:E>0&&R?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-context`,disabled:!R,title:`lines of context kept either side of a match`,onClick:()=>D(e=>e===0?Re:0),children:`± ${String(E)} lines`}),c(`span`,{className:`min-w-0 flex-1`}),f(`span`,{"data-testid":`runner-log-stats`,className:`min-w-0 basis-full truncate text-sm text-po-dim sm:basis-auto`,children:[O===void 0?`reading…`:R?`${String(O.lineCount)} matching of ${O.totalLines.toLocaleString(`en-US`)} lines`:`${z?`tailing`:`showing`} last ${String(H.lines.length)} of ${(O.totalLines+(z?A.length:0)).toLocaleString(`en-US`)} lines`,H.hidden>0?` · ${H.hidden.toLocaleString(`en-US`)} older hidden`:``]}),c(e,{variant:z?`subtle`:`outline`,size:`sm`,"data-testid":`runner-log-follow`,"aria-pressed":z,disabled:R||O?.running!==!0,title:R?`a filtered view is a snapshot; clear the query to follow`:`follow the log as it grows`,onClick:()=>te(e=>!e),children:R?`Paused while searching`:z?`Following`:`Follow`})]}),f(`div`,{className:`relative min-h-0 flex-1`,children:[f(`div`,{ref:le,onScroll:W,"data-testid":`runner-log-body`,className:`h-full overflow-auto bg-po-deep px-3 py-3 sm:px-[26px]`,children:[oe===void 0?O===void 0?c(`p`,{"data-testid":`runner-log-reading`,className:`text-sm text-po-dim`,children:`reading…`}):O.exists===!1?c(`p`,{className:`text-sm text-po-dim`,children:`This runner has not printed anything yet.`}):H.lines.length===0?c(`p`,{className:`text-sm text-po-dim`,children:R?`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 f(x,{children:[i?c(`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,c(We,{number:n,line:e,matched:R&&Ue(e,S,w),dimmed:R&&!Ue(e,S,w)})]},n??`row-${String(t)}`)}):c(`p`,{"data-testid":`runner-log-error`,className:`text-sm text-po-red`,children:oe}),c(`div`,{ref:L})]}),z&&!F?c(e,{variant:`subtle`,size:`sm`,"data-testid":`runner-log-jump`,title:`scroll back to the newest lines and keep following`,onClick:()=>{se(!0),L.current?.scrollIntoView({block:`end`})},className:`absolute bottom-3 right-3`,children:`Jump to latest`}):null]}),f(`div`,{className:`flex h-8 shrink-0 items-center gap-2.5 border-t border-po-border-soft px-3 sm:px-[26px]`,children:[c(`span`,{"data-testid":`runner-log-path`,className:`min-w-0 flex-1 truncate font-mono text-sm text-po-dim`,children:g?.logPath??O?.path??``}),O===void 0?null:c(`span`,{className:`shrink-0 text-sm text-po-dim`,children:He(Math.max(O.fileSize,ae))})]})]})}function Ke({run:e}){let t=d(null),[n]=M(Date.now);return s(()=>{if(e.exit||e.state!==`running`)return;let n=()=>{let n=t.current?.firstChild;n&&(n.nodeValue=fe(e.startedAt,Date.now()))};n();let r=setInterval(n,1e3);return()=>clearInterval(r)},[e.startedAt,e.state,e.exit]),c(`span`,{ref:t,className:`shrink-0 text-sm text-po-dim`,children:fe(e.startedAt,e.exit?Date.parse(e.exit.finishedAt):n)})}var qe=30;function Je({sessionId:t,runId:n,sendSessionFrame:r,openTransientTab:i,onSearch:a}){let{runs:o,stopRequested:u}=_(V.store,e=>V.select(e,t)),p=o.find(e=>e.id===n),[m,g]=M(!1),[v,y]=M(!1),[b,x]=M(!1),S=d(null),C=d([]),w=d(void 0);s(()=>{if(t===null||!b)return;let e=De(t,n,0,{onEvent:e=>{e.chunk!==``&&S.current?.write(Ce(e.chunk)),e.ended===!0&&g(!0)},onLost:()=>y(!0)});return()=>e.close()},[t,n,b]),s(()=>()=>{w.current!==void 0&&clearTimeout(w.current)},[]);let T=e=>{t!==null&&(C.current.push(e),w.current===void 0&&(w.current=setTimeout(()=>{let e=C.current.join(``);C.current=[],w.current=void 0,e!==``&&Oe(t,n,e)},qe)))},E=p?.state===`running`&&!m,D=u.includes(n);return f(`div`,{"data-testid":`runner-shell-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[f(`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:[c(`span`,{"data-testid":`runner-shell-name`,className:`shrink-0 truncate text-base font-semibold text-po-hi`,children:p?.name??n}),c(h,{tone:E?`running`:`neutral`,size:`md`,"data-testid":`runner-shell-state`,children:E?`Running`:`Ended`}),p?c(`span`,{className:`min-w-0 truncate font-mono text-sm text-po-dim`,children:p.command}):null,c(`span`,{className:`min-w-0 flex-1`}),v?c(`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,p?f(e,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-search`,title:`search everything this runner has printed`,onClick:()=>a?a():i(Z(p)),className:`gap-1.5`,children:[c(l,{className:`h-3.5 w-3.5`}),`Search output`]}):null,E?c(e,{variant:`outline`,size:`sm`,"data-testid":`runner-shell-interrupt`,title:`send ctrl-c`,onClick:()=>T(``),children:`Ctrl-C`}):null,E&&t!==null?c(e,{variant:D?`outline`:`danger-outline`,size:`sm`,"data-testid":`runner-shell-stop`,disabled:D,title:D?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,onClick:()=>G(r,t,n),children:D?`Stopping…`:`Stop`}):null]}),f(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-po-deep px-3 py-2 sm:px-[26px]`,children:[c(oe,{ref:S,"data-testid":`runner-shell-terminal`,onData:e=>T(e),onReady:()=>x(!0)}),b?null:c(`p`,{"data-testid":`runner-shell-reading`,className:`text-sm text-po-dim`,children:`attaching…`})]}),c(`div`,{className:`flex h-8 shrink-0 items-center border-t border-po-border-soft px-3 sm:px-[26px]`,children:c(`span`,{className:`min-w-0 flex-1 truncate text-sm text-po-dim`,children:E?`Typing goes straight to ${p?.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(t){let{sessionId:n,sendSessionFrame:r}=t,i=_(V.store,e=>V.select(e,n)),o=i.runs.filter(e=>e.state===`running`),[l,u]=M(``),[p,m]=M(``),[h,g]=M(void 0),[v,y]=M(void 0),b=d(null),x=d(``),S=d(void 0),C=o.find(e=>e.id===h)??o[0],w=()=>{n!==null&&(b.current=new Set(i.runs.map(e=>e.id)),clearTimeout(S.current),S.current=setTimeout(()=>{b.current=null},Ye),de(r,n,le(l,p)),x.current=l,u(``))};s(()=>{let e=b.current;if(e===null)return;let t=i.runs.find(t=>t.state===`running`&&!e.has(t.id));t&&(b.current=null,clearTimeout(S.current),g(t.id))},[i.runs]);let E=i.startFailure?.id;return s(()=>{E!==void 0&&b.current!==null&&(b.current=null,clearTimeout(S.current),u(x.current))},[E]),s(()=>()=>clearTimeout(S.current),[]),f(`div`,{"data-testid":`runners-panel`,className:`flex min-h-0 flex-1 flex-col`,children:[f(`div`,{className:`flex h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft px-3 sm:px-[26px]`,children:[c(`span`,{className:`text-lg font-semibold text-po-hi`,children:`Runners`}),c(`span`,{"data-testid":`runners-panel-count`,className:`text-sm text-po-dim`,children:o.length===0?`Nothing running`:`${String(o.length)} running`})]}),n===null?null:c(ye,{command:l,onCommandChange:u,cwd:p,onCwdChange:m,folders:o.map(e=>e.cwd),...i.sessionDirectory===void 0?{}:{sessionDirectory:i.sessionDirectory},...i.startFailure===void 0?{}:{problem:i.startFailure.message},onLaunch:w}),C===void 0?c(k,{"data-testid":`runners-panel-empty`,className:`px-4 py-8`,title:`Nothing running yet`,description:n===null?`Open a session to start a runner.`:`Type a command above, like pnpm dev, and it opens here as a live terminal.`}):f(a,{children:[c(`div`,{"data-testid":`runners-panel-picker`,className:`flex shrink-0 flex-wrap gap-1.5 px-3 pt-3 sm:px-[26px]`,children:o.map(t=>f(e,{variant:t===C?`subtle`:`ghost`,size:`sm`,"data-testid":`runners-panel-pick-${t.id}`,"aria-pressed":t===C,title:t.command,onClick:()=>g(t.id),className:`gap-1.5 ${t===C?`text-po-hi`:``}`,children:[c(T,{tone:`yellow`,pulse:!0}),t.name]},t.id))}),c(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col border-t border-po-border-soft`,children:C.interactive&&v!==C.id?c(Je,{...t,runId:C.id,onSearch:()=>y(C.id)},C.id):c(Ge,{...t,runId:C.id,...C.interactive?{onTerminal:()=>y(void 0)}:{}},C.id)})]})]})}var $e=y({keys:`r l`,icon:t,activeSource:U,transientTab:Ze,order:20}),et=i(K),tt=5;function nt(e){for(let t=e.length-1;t>=0;--t){let n=N(e[t]??``).map(e=>e.text).join(``).trim();if(n.length>0)return n}}function rt(e,t,n){let[r,i]=M(void 0);return s(()=>{if(!n||e===null)return;let r=!0,a,o=new AbortController;return je(e,t,{lines:tt},o.signal).then(n=>{if(!r||`error`in n)return;let o=nt(n.slice.text.split(`
|
|
4
4
|
`));o!==void 0&&i({runId:t,text:o}),n.slice.running&&(a=Fe(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:t,sendSessionFrame:n,openTransientTab:r}){let i=_(V.store,e=>V.select(e,t)),a=()=>i.runs.filter(e=>H(e)).length;u(U.subscribe,a,a);let o=i.runs.filter(e=>H(e));return o.length===0?f(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[c(`p`,{"data-testid":`activity-summary-runners`,className:`text-sm text-po-dim`,children:`Idle`}),t===null?null:f(e,{variant:`link`,size:`sm`,"data-testid":`activity-runner-launch`,className:`h-auto gap-1 px-0 text-po-green`,onClick:()=>r(Ze()),children:[`Launch a runner`,c(w,{"aria-hidden":!0,className:`size-3.5`})]})]}):c(`div`,{"data-testid":`activity-runner-runs`,className:`flex flex-col gap-0.5`,children:o.map(e=>c(at,{run:e,stopRequested:i.stopRequested.includes(e.id),sessionId:t,sendSessionFrame:n,openTransientTab:r},e.id))})}function at({run:t,stopRequested:n,sessionId:r,sendSessionFrame:i,openTransientTab:a}){let o=rt(r,t.id,t.state===`running`);return f(e,{variant:`ghost`,size:`card`,"data-testid":`activity-runner-${t.id}`,"data-runner-tone":`running`,title:`open this runner's log`,onClick:()=>{r!==null&&a(Z(t))},className:`min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-po-panel`,children:[f(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[c(T,{tone:`yellow`,pulse:!0}),c(`span`,{className:`min-w-0 flex-1 truncate text-left text-base font-semibold text-po-hi`,children:t.name}),f(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[c(Ke,{run:t}),t.interactive?` · tty`:``]}),r===null?null:c(e,{asChild:!0,variant:n?`outline`:`danger-outline`,size:`xs`,"data-testid":`activity-runner-stop-${t.id}`,"data-stopping":n,title:n?`stop requested; the runner reports its own exit`:`ask the runtime to stop this runner`,className:`px-1.5`,children:c(`span`,{role:`button`,tabIndex:n?-1:0,"aria-disabled":n,onClick:e=>{e.stopPropagation(),n||G(i,r,t.id)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),n||G(i,r,t.id))},children:n?`stopping…`:`stop`})})]}),c(`span`,{"data-testid":`activity-runner-detail-${t.id}`,"data-detail":o===void 0?`command`:`tail`,className:`truncate pl-3 text-left text-sm text-po-dim`,children:o??t.command})]})}var ot=ne({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(`
|
package/dist/assets/plugins/slots/{scaffold.d87a6ee0-DZOiNwOS.js → scaffold.14b5f76b-DW44NU9X.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$r as e,At as t,Bt as n,Di as r,Fa as i,Ft as a,Gi as o,Ht as s,Ir as c,It as l,Ki as u,Lt as d,Wi as f,Xi as p,Yi as m,Zi as h,_r as g,cr as _,eo as v,fr as y,ga as b,gr as x,hr as S,in as C,la as w,mr as T,or as E,pr as D,qa as O,qi as k,qt as A,ti as j,vr as M,wa as N,yr as P,za as F}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,At as t,Bt as n,Di as r,Fa as i,Ft as a,Gi as o,Ht as s,Ir as c,It as l,Ki as u,Lt as d,Wi as f,Xi as p,Yi as m,Zi as h,_r as g,cr as _,eo as v,fr as y,ga as b,gr as x,hr as S,in as C,la as w,mr as T,or as E,pr as D,qa as O,qi as k,qt as A,ti as j,vr as M,wa as N,yr as P,za as F}from"../chunks/po-web-runtime-C0B3uAoC.js";var I=N({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,n)=>t.fetch(e,n),sessionAddress:v});async function L(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 R=e=>e?I.workspace(e):I.host;async function ee(e,t){return L(await e(R(t).listSets.url()),`Po could not read your template sets.`)}async function z(e,t,n){let r=R(n).setEnabled;return L(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=R(n).removeSet;return L(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 d(a,{children:[l(_,{tone:n.tone,children:n.label}),e.overrides?d(_,{children:[`Replaces `,V(e.overrides,t).label.toLowerCase()]}):null,e.error?l(_,{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 l(c,{"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`?l(a,{children:`Saved by you`}):e.origin===`host`&&t===`org`?l(a,{children:`Saved for your org`}):e.path?l(`span`,{className:`font-mono break-all`,children:e.path}):e.owner?l(`span`,{className:`font-mono`,children:e.owner}):l(a,{children:`Ships with Po`})}function Y(t){let{sets:n,busy:i}=t;return n.length===0?l(w,{title:`No template sets yet`,description:`Ask Po in Help mode to save one, and it appears here.`,className:`py-12`}):l(E,{asChild:!0,children:l(`ul`,{"aria-label":`Template sets`,children:n.map(n=>l(y,{asChild:!0,children:d(`li`,{"data-testid":`scaffold-set-${n.id}`,"aria-busy":i===n.id,children:[d(T,{children:[d(S,{className:`flex flex-wrap items-center gap-2`,children:[n.label,l(U,{set:n,host:t.host})]}),n.description?l(D,{children:n.description}):null,n.error?l(D,{className:`text-po-red first-letter:normal-case`,children:n.error}):l(D,{children:W(n)})]}),d(`div`,{className:`flex items-center gap-2`,children:[l(K,{set:n,busy:i,onToggle:t.onToggle,...q(t,n)}),l(e,{variant:`ghost`,size:`icon`,"aria-label":`Open ${n.label}`,onClick:()=>t.onOpen?.(n.id),children:l(r,{className:`size-3.5`})})]})]})},n.id))})})}function X(t){let{set:n,scope:r,busy:i,host:o}=t,s=n.origin===r||t.personal===!0&&n.origin===`personal`;return d(`div`,{className:`flex flex-col gap-5`,children:[l(`div`,{children:d(e,{variant:`ghost`,size:`sm`,onClick:t.onBack,children:[l(C,{className:`size-3.5`}),`All template sets`]})}),d(x,{children:[d(M,{children:[d(P,{className:`flex flex-wrap items-center gap-2`,children:[n.label,l(U,{set:n,host:o})]}),n.description?l(g,{children:n.description}):null]}),d(E,{children:[t.personal?d(a,{children:[n.origin===`personal`||o!==`org`?null:d(y,{children:[d(T,{children:[l(S,{children:`On for everyone in your org`}),l(D,{children:`Your org's choice. Anyone in the org can change it.`})]}),l(K,{set:n,scope:`host`,label:`Everyone in your org can use ${n.label}`,checked:n.hostEnabled??n.enabled,busy:i,onToggle:t.onToggle})]}),d(y,{children:[d(T,{children:[l(S,{children:`On in your sessions`}),l(D,{children:n.origin===`personal`?`Only you see this set.`:`Only you. Overrides your org's choice.`})]}),l(K,{set:n,scope:`personal`,label:`Agents can use ${n.label} in your sessions`,busy:i,onToggle:t.onToggle})]})]}):d(y,{children:[d(T,{children:[l(S,{children:`Agents can use this set`}),l(D,{children:r===`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.`})]}),l(K,{set:n,scope:r,label:`Agents can use ${n.label}`,busy:i,onToggle:t.onToggle})]}),d(y,{children:[d(T,{children:[l(S,{children:`Source`}),l(D,{className:`first-letter:normal-case`,children:l(J,{set:n,host:o})})]}),s?d(e,{variant:`danger-outline`,size:`sm`,disabled:i!==void 0,onClick:()=>t.onAskRemove?.(n.id),children:[l(j,{className:`size-3.5`}),`Remove set`]}):null]})]}),n.error?l(`p`,{role:`alert`,className:`text-sm text-po-red`,children:n.error}):null]}),n.templates.length>0?d(x,{children:[d(M,{children:[l(P,{children:`Templates`}),l(g,{children:`What an agent can start or add with this set, and what it asks for.`})]}),l(E,{asChild:!0,children:l(`ul`,{"aria-label":`Templates in ${n.label}`,children:n.templates.map(e=>l(y,{asChild:!0,children:l(`li`,{children:d(T,{children:[d(S,{className:`flex flex-wrap items-center gap-2`,children:[l(`span`,{className:`font-mono`,children:e.name}),l(_,{tone:e.kind===`boilerplate`?`teal`:`violet`,children:e.kind===`boilerplate`?`Starter`:`Feature`})]}),e.description?l(D,{children:e.description}):null,G(e).length>0?l(D,{className:`flex flex-wrap gap-1.5`,children:G(e).map(e=>d(`span`,{className:`font-mono`,children:[e.name,e.required?``:`?`]},e.name))}):null]})})},`${e.kind}:${e.name}`))})})]}):null,n.files&&n.files.length>0?d(x,{children:[l(M,{children:l(P,{children:`Files`})}),l(E,{asChild:!0,children:l(`ul`,{"aria-label":`Files in ${n.label}`,children:n.files.map(e=>l(y,{asChild:!0,className:`py-2`,children:l(`li`,{className:`font-mono text-sm break-all text-po-text`,children:e})},e))})})]}):null]})}function Z(t){let{sets:n,error:r,selected:i,confirming:s,busy:c}=t,g=i===void 0?void 0:n?.find(e=>e.id===i),_=s===void 0?void 0:n?.find(e=>e.id===s);return d(`div`,{"data-testid":`scaffold-library`,className:`flex flex-col gap-3`,children:[r?l(`p`,{role:`alert`,className:`text-sm text-po-red`,children:r}):null,n===void 0?l(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Loading template sets…`}):g?l(X,{...t,set:g}):l(Y,{...t,sets:n}),l(f,{open:_!==void 0,onOpenChange:e=>e?void 0:t.onCancelRemove?.(),children:d(u,{children:[l(p,{children:d(h,{children:[`Remove `,_?.label,`?`]})}),l(o,{children:l(k,{children:_?.origin===`personal`?`Its files are deleted. Your sessions stop offering it at once.`:_?.origin===`host`&&t.host===`org`?`Its files are deleted for everyone in your org. Agents stop offering it at once.`:d(a,{children:[`Its folder `,l(`span`,{className:`font-mono`,children:_?.path}),` and every file in it are deleted. Agents stop offering it at once.`]})})}),d(m,{children:[l(e,{onClick:t.onCancelRemove,children:`Keep set`}),l(e,{variant:`danger-outline`,disabled:c!==void 0,onClick:()=>_?t.onConfirmRemove?.(_.id):void 0,children:`Remove set`})]})]})})]})}var Q=(e,t)=>e instanceof Error?e.message:t;function $({request:e,requestWithStepUp:t,repositoryId:r}){let[i,a]=A(),[o,c]=A(r?`workspace`:`host`),[u,d]=A({}),[f,p]=A(),[m,h]=A(),[g,_]=A(),[v,y]=A(),b=n(async()=>{try{let t=await ee(e,r);a(t.sets),c(t.scope),d({host:t.host,personal:t.personal}),p(void 0)}catch(e){a(e=>e??[]),p(Q(e,`Po could not read your template sets.`))}},[e,r]);s(()=>{b()},[b]);let x=async(e,t,n)=>{_(e);try{a((await t()).sets),p(void 0)}catch(e){await b(),p(Q(e,n))}finally{_(void 0)}};return l(Z,{scope:o,...u.host?{host:u.host}:{},personal:u.personal===!0,sets:i,error:f,selected:m,busy:g,confirming:v,onOpen:h,onBack:()=>h(void 0),onToggle:(e,n,i)=>void x(e,()=>z(t,{id:e,enabled:n,scope:i},r),`Po could not change this template set.`),onAskRemove:y,onCancelRemove:()=>y(void 0),onConfirmRemove:e=>{let n=i?.find(t=>t.id===e)?.origin===`personal`;y(void 0),h(void 0),x(e,()=>B(t,{id:e,...n?{scope:`personal`}:{}},r),`Po could not remove this template set.`)}})}var te=F({label:`Scaffolds`,detail:`The template sets agents use to start projects, documents and plugins, and which of them they may use.`,order:140,icon:b,component:({request:e,requestWithStepUp:t})=>l($,{request:e,requestWithStepUp:t})}),ne=i({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:b,component:({repository:e,request:t,requestWithStepUp:n})=>e?l($,{request:t,requestWithStepUp:n,repositoryId:e.id},e.id):null}),re=(e,t)=>t===void 0?void 0:{...e,...t},ie=O({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,2 +1,2 @@
|
|
|
1
|
-
import{$n as e,$r as t,At as n,Bt as r,Fi as i,Ft as a,Gt as o,Ht as s,It as c,Jt as l,Lt as u,Mr as d,Nr as f,Pt as p,Ua as m,Wt as ee,Xa as te,Xn as ne,Yn as h,Yt as g,Zn as re,_r as ie,ar as ae,cr as _,fr as v,gi as y,gr as oe,hr as b,ir as x,ja as S,ka as C,kt as w,la as T,mr as E,nr as se,or as D,pr as O,qa as k,qt as A,ro as j,sr as M,tn as N,to as P,tr as ce,ur as F,vr as le,yr as ue,za as de,zi as I}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$n as e,$r as t,At as n,Bt as r,Fi as i,Ft as a,Gt as o,Ht as s,It as c,Jt as l,Lt as u,Mr as d,Nr as f,Pt as p,Ua as m,Wt as ee,Xa as te,Xn as ne,Yn as h,Yt as g,Zn as re,_r as ie,ar as ae,cr as _,fr as v,gi as y,gr as oe,hr as b,ir as x,ja as S,ka as C,kt as w,la as T,mr as E,nr as se,or as D,pr as O,qa as k,qt as A,ro as j,sr as M,tn as N,to as P,tr as ce,ur as F,vr as le,yr as ue,za as de,zi as I}from"../chunks/po-web-runtime-C0B3uAoC.js";var L=`load_context`,fe=`load_extra_tools`,R=`use_extra_tools`;function z(e,t){return t?`${t}_${e}`:e}function B(e,t){let n=new Set(e.map(e=>e.name)),r=e=>z(e,t),i=[`Use the Po MCP tools below for work in the Po session repository. They run on the Po host, not on your local machine.`,`Prefer them over your built-in bash, read, edit, write, grep, find, or ls tools for that repository.`];return t&&i.push(`Every tool name starts with "${t}_".`),n.has(L)&&i.push(`Start each task with ${r(L)}.`),n.has(fe)&&n.has(R)&&i.push(`${r(fe)} lists tools added or changed after you connected. Run one of those with ${r(R)}, passing the exact name it returns.`),i.push(`If a tool below is not in your visible tool list, find it in ALL_TOOLS (code mode) before concluding it is missing; do not use tool search or guess names.`,`Await every call, print its result, and check isError. If a call may have changed files or state, inspect before retrying.`,``,`Tools:`,...e.map(e=>`- ${r(e.name)}: ${e.description.replace(/\s+/g,` `).trim()}`)),i.join(`
|
|
2
2
|
`)}var V={"Content-Type":`application/json`,"X-Po-Mcp-Csrf":`1`},H=`The cockpit hub is unreachable.`;function U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function W(e){return e===void 0||typeof e==`string`}function G(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function K(e){return U(e)&&typeof e.clientId==`string`&&typeof e.name==`string`&&typeof e.redirectUri==`string`&&(e.tokenEndpointAuthMethod===`client_secret_post`||e.tokenEndpointAuthMethod===`api_key`||e.tokenEndpointAuthMethod===`url_token`)&&typeof e.createdAt==`number`&&(e.scope===void 0||e.scope===`restricted`||e.scope===`session`)&&(e.routing===void 0||e.routing===`conversation`)&&G(e.tools)&&G(e.skills)&&typeof e.audience==`string`&&W(e.toolPrefix)}function q(e){if(K(e))return{clientId:e.clientId,name:e.name,redirectUri:e.redirectUri,tokenEndpointAuthMethod:e.tokenEndpointAuthMethod,createdAt:e.createdAt,scope:e.scope===`session`?`session`:`restricted`,routing:`conversation`,tools:e.tools,skills:e.skills,audience:e.audience,...e.toolPrefix===void 0?{}:{toolPrefix:e.toolPrefix}}}function J(e,t){return`/api/workspaces/${encodeURIComponent(e)}/sessions/${encodeURIComponent(t)}/mcp`}async function Y(e,t,n,r){let i;try{i=await e(t,n)}catch{return{error:H}}let a=await i.json().catch(()=>void 0);if(i.ok&&U(a)){let e=r(a);if(e!==void 0)return e}return{error:U(a)&&typeof a.error==`string`?a.error:`The hub answered ${String(i.status)}.`}}function pe(e,t,n){return Y(e,`${J(t,n)}/clients`,{cache:`no-store`},e=>{if(!Array.isArray(e.clients))return;let t=e.clients.map(q);return t.every(e=>e!==void 0)?{clients:t}:void 0})}function me(e,t,n,r){return Y(e,`${J(t,n)}/clients/${encodeURIComponent(r)}`,{method:`DELETE`,headers:{"X-Po-Mcp-Csrf":`1`}},e=>e.ok===!0?{ok:!0}:void 0)}function he(e,t,n,r){return Y(e,`${J(t,n)}/conversations/${encodeURIComponent(r)}`,{method:`DELETE`,headers:V},e=>e.ok===!0?{ok:!0}:void 0)}var ge=(e,t)=>n.fetch(e,t);function _e(e,t,n){return Y(ge,e,t,n)}function ve(e){return U(e)&&typeof e.name==`string`&&typeof e.label==`string`&&typeof e.description==`string`}function ye(e){return U(e)&&typeof e.name==`string`&&typeof e.description==`string`&&typeof e.uri==`string`}function be(e){return U(e)&&typeof e.audience==`string`&&typeof e.mcpUrl==`string`&&typeof e.mcpAppUrl==`string`&&typeof e.authorizationEndpoint==`string`&&typeof e.tokenEndpoint==`string`&&Array.isArray(e.tools)&&e.tools.every(ve)&&Array.isArray(e.skills)&&e.skills.every(ye)}function xe(e){return!K(e)||!U(e)?!1:e.tokenEndpointAuthMethod===`url_token`?typeof e.connectionUrl==`string`&&e.connectionUrl!==``&&typeof e.mcpAppConnectionUrl==`string`&&e.mcpAppConnectionUrl!==``&&e.clientSecret===void 0:typeof e.clientSecret==`string`&&e.clientSecret!==``&&e.connectionUrl===void 0&&e.mcpAppConnectionUrl===void 0}async function Se(e,t){let n=await _e(`${J(e,t)}/config`,{cache:`no-store`},e=>be(e)?{config:e}:void 0);return`error`in n&&n.error===`Session MCP public origin is unavailable.`?{config:void 0}:n}function Ce(e,t){return pe(ge,e,t)}async function we(e,t,n){let r=await _e(`${J(e,t)}/clients`,{method:`POST`,headers:V,body:JSON.stringify(n)},e=>xe(e.client)?{client:e.client}:void 0);return`client`in r&&r.client.routing!==`conversation`?{error:`The host did not enable automatic per-conversation worktrees. Restart an updated host before creating this connection.`}:r}function Te(e,t,n){return me(ge,e,t,n)}function Ee(e){return!U(e)||typeof e.enabled!=`boolean`||typeof e.available!=`boolean`||!Number.isSafeInteger(e.total)||Number(e.total)<0||e.nextBefore!==void 0&&(!Number.isSafeInteger(e.nextBefore)||Number(e.nextBefore)<=0)||!W(e.toolPrefix)||!Array.isArray(e.tools)||!Array.isArray(e.calls)?!1:e.tools.every(e=>U(e)&&ve(e)&&U(e.inputSchema)&&G(e.connections))&&e.calls.every(e=>U(e)&&Number.isSafeInteger(e.sequence)&&Number(e.sequence)>0&&typeof e.id==`string`&&typeof e.toolName==`string`&&typeof e.clientName==`string`&&typeof e.startedAt==`number`&&Number.isFinite(e.startedAt)&&(e.finishedAt===void 0||typeof e.finishedAt==`number`&&Number.isFinite(e.finishedAt))&&[`running`,`succeeded`,`failed`,`cancelled`,`interrupted`].includes(String(e.status))&&typeof e.input==`string`&&(e.output===void 0||typeof e.output==`string`))}function De(e,t,n){let r=n===void 0?``:`?before=${encodeURIComponent(String(n))}`;return _e(`${J(e,t)}/activity${r}`,{cache:`no-store`},e=>Ee(e)?{activity:e}:void 0)}var X=new w({});function Oe(e){return e!==null&&X.state[e]===!0}function ke(e){return p(X,t=>e!==null&&t[e]===!0)}function Ae(e,t){let n=j(e??``,`session-mcp:${t??``}`),r=l(e=>P(n,e),()=>te(n)),i=JSON.stringify([e,t]),[a,o]=A({key:i}),c=a.key===i?a.before:void 0,[u,d]=A(0),[f,p]=A();s(()=>{if(e===void 0||t===void 0)return;let n=!1;return(async()=>{let r=await De(e,t,c);if(!n){if(`activity`in r&&X.state[t]!==r.activity.enabled){let e=r.activity.enabled;X.setState(n=>({...n,[t]:e}))}p(e=>{let t=`activity`in r?{key:i,before:c,snapshot:r.activity}:{key:i,before:c,snapshot:e?.key===i?e.snapshot:void 0,error:r.error};return e!==void 0&&JSON.stringify(e)===JSON.stringify(t)?e:t})}})(),()=>{n=!0}},[i,e,t,c,u,r]);let m=f?.key===i?f:void 0;return{snapshot:m?.snapshot,loading:m===void 0||m.before!==c,error:m?.error,before:c,showLatest:()=>o({key:i}),loadOlder:()=>{m?.snapshot?.nextBefore!==void 0&&o({key:i,before:m.snapshot.nextBefore})},refresh:()=>d(e=>e+1)}}var je={running:`running`,succeeded:`ok`,failed:`error`,cancelled:`neutral`,interrupted:`neutral`};function Me({status:e}){return c(f,{tone:je[e],size:`xs`,children:e})}function Ne({state:e}){return e.error===void 0?null:u(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 border-b border-po-border px-4 py-3 text-sm text-po-red`,children:[u(`span`,{children:[e.error,` Displayed data may be out of date.`]}),c(t,{variant:`outline`,size:`xs`,onClick:e.refresh,children:`retry`})]})}function Pe({state:e}){let n=e.snapshot?.calls??[];return u(`section`,{"data-testid":`session-mcp-history`,"aria-label":`MCP call history`,className:`flex h-full min-h-0 flex-col bg-po-bg text-po-text`,children:[u(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-po-border px-5 py-4`,children:[u(`div`,{children:[c(`h2`,{className:`text-lg font-semibold text-po-hi`,children:`Remote MCP activity`}),u(`p`,{className:`mt-1 text-sm text-po-dim`,children:[e.snapshot?.total??0,` calls recorded · `,e.before===void 0?`latest calls`:`older calls`]})]}),e.before===void 0?c(f,{tone:e.error?`error`:`info`,size:`sm`,children:e.error?`offline`:`live`}):c(t,{variant:`outline`,size:`sm`,onClick:e.showLatest,children:`latest calls`})]}),c(Ne,{state:e}),c(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5`,"aria-busy":e.loading,children:e.loading?c(T,{title:`loading MCP calls`,description:`Reading this session's remote tool history.`,className:`py-8`}):n.length===0?c(T,{title:`no MCP calls recorded yet`,description:`Remote tool calls will appear here as they start. Calls made before history capture was added are not available.`,className:`py-8`}):c(g,{type:`multiple`,children:n.map(e=>u(y,{value:e.id,children:[c(I,{className:`py-3`,"data-testid":`mcp-call-${e.id}`,children:u(`span`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1`,children:[c(Me,{status:e.status}),c(`span`,{className:`min-w-0 break-all text-base font-semibold text-po-hi`,children:e.toolName}),u(`span`,{className:`ml-auto flex shrink-0 items-center gap-3 text-sm text-po-dim`,children:[c(`span`,{children:e.finishedAt===void 0?`in progress`:`${Math.max(0,e.finishedAt-e.startedAt).toLocaleString()} ms`}),c(`time`,{dateTime:new Date(e.startedAt).toISOString(),title:new Date(e.startedAt).toLocaleString(),children:new Date(e.startedAt).toLocaleTimeString()})]})]})}),u(M,{className:`space-y-3 pb-4`,children:[u(`p`,{className:`text-sm text-po-dim`,children:[e.clientName,` · `,new Date(e.startedAt).toLocaleString()]}),c(h,{children:`arguments`}),c(`div`,{className:`max-h-64 overflow-auto`,children:c(i,{text:e.input,className:`language-json`})}),c(h,{children:`result`}),e.output===void 0?c(`p`,{className:`text-sm text-po-dim`,children:e.status===`interrupted`?`The host stopped before a result was recorded.`:`Waiting for the tool result.`}):c(`div`,{className:`max-h-80 overflow-auto`,children:c(i,{text:e.output,className:`language-json`})})]})]},e.id))})}),u(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-po-border px-5 py-3`,children:[c(`p`,{className:`text-sm text-po-dim`,children:`Text previews are limited to 16 KB. Common credential fields are redacted.`}),c(t,{variant:`outline`,size:`sm`,disabled:e.loading||e.snapshot?.nextBefore===void 0,onClick:e.loadOlder,children:`older calls`})]})]})}function Fe({state:e}){let[n,r]=A(``),[a,o]=A(`idle`),s=e.snapshot?.tools??[],l=e.snapshot?.toolPrefix;async function d(){if(navigator.clipboard===void 0)o(`failed`);else try{await navigator.clipboard.writeText(B(s,l)),o(`copied`)}catch{o(`failed`)}}let p=s.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(n.trim().toLowerCase()));return u(`section`,{"data-testid":`session-mcp-tools`,"aria-label":`Available MCP tools`,className:`flex min-h-0 flex-1 flex-col text-po-text`,children:[u(`div`,{className:`space-y-3 border-b border-po-border-soft px-4 py-3`,children:[u(`div`,{className:`flex items-center justify-between gap-2`,children:[c(h,{children:`available tools`}),u(`div`,{className:`flex items-center gap-2`,children:[c(t,{type:`button`,variant:`outline`,size:`xs`,"data-testid":`session-mcp-copy-prompt`,disabled:!e.snapshot?.available||s.length===0,onClick:()=>void d(),children:a===`copied`?`copied`:`copy as prompt`}),c(f,{tone:`info`,size:`xs`,children:s.length})]})]}),u(`div`,{className:`text-sm text-po-dim`,children:[c(`p`,{children:`Tools granted to this session's remote connections.`}),l?u(`p`,{className:`mt-1`,"data-testid":`session-mcp-remote-prefix`,children:[`remote names start with `,u(`code`,{className:`text-po-text`,children:[l,`_`]})]}):null,u(`output`,{"aria-live":`polite`,children:[a===`failed`?`copying the prompt was blocked. allow clipboard access and try again.`:``,a===`copied`?`prompt copied.`:``]})]}),c(N,{"aria-label":`Search MCP tools`,placeholder:`search tools...`,value:n,onChange:e=>r(e.target.value)})]}),c(Ne,{state:e}),c(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4`,"aria-busy":e.loading,children:e.snapshot===void 0&&e.loading?c(T,{title:`loading tools`,className:`py-5`}):e.snapshot?.available?p.length===0?c(T,{title:n?`no matching tools`:`no tools granted`,description:n?`Try a different tool name.`:`This connection does not currently grant any tools.`,className:`py-5`}):c(g,{type:`multiple`,children:p.map(e=>u(y,{value:e.name,children:[c(I,{className:`py-3`,children:c(`span`,{className:`min-w-0 break-all text-base font-semibold text-po-hi`,children:e.name})}),u(M,{className:`space-y-3 pb-3`,children:[c(`p`,{className:`whitespace-pre-wrap break-words text-base leading-relaxed`,children:e.description}),c(`p`,{className:`text-sm text-po-dim`,children:e.connections.join(`, `)}),c(h,{children:`input schema`}),c(`div`,{className:`max-h-64 overflow-auto`,children:c(i,{text:JSON.stringify(e.inputSchema,null,2),className:`language-json`})})]})]},e.name))}):c(T,{title:`no active MCP connection`,description:`History is retained. Available tools return when the session and its remote connection are active.`,className:`py-5`})})]})}function Ie({sessionId:e,sessionContext:t}){return Ae(t?.workspaceId,e??void 0)}function Le(e){return c(Pe,{state:Ie(e)},e.sessionId)}function Re(e){return c(Fe,{state:Ie(e)},e.sessionId)}function ze(e){return Ie(e),null}var Be=C({label:`MCP`,icon:x,order:0,panel:Re,visibility:{subscribe(e){let t=X.subscribe(e);return()=>t.unsubscribe()},isVisible:Oe}}),Ve=S({data:{claims:()=>!0,async remove({workspaceId:e,sessionId:t,setupId:n},r){let i=await he(r,e,t,n);return`error`in i?{error:i.error}:void 0}}}),He=S({component:ze}),Ue=new Map;function We(e,t){let n=Ue.get(e);return n===void 0&&(n=new w(typeof t==`function`?t():t),Ue.set(e,n)),n}function Z(e,t){let n=We(e,t);return[p(n),r(e=>{n.setState(t=>typeof e==`function`?e(t):e)},[n]),n]}function Ge(e){try{let t=new URL(e);return t.protocol===`https:`&&t.username===``&&t.password===``&&t.hash===``}catch{return!1}}function Ke(e){let{clientSecret:t,connectionUrl:n,mcpAppConnectionUrl:r,...i}=e;return i}var qe={url_token:`Signed URL`,api_key:`API key`,client_secret_post:`OAuth`};function Q({label:e,value:n,testId:r}){let[i,a]=A(`idle`);async function o(){if(navigator.clipboard===void 0)a(`failed`);else try{await navigator.clipboard.writeText(n),a(`copied`)}catch{a(`failed`)}}return u(v,{children:[u(E,{children:[c(b,{children:e}),c(`code`,{className:`break-all font-mono text-sm text-po-text`,"data-testid":r,children:n}),u(`output`,{"aria-live":`polite`,className:`text-sm text-po-dim empty:hidden`,children:[i===`failed`?`Copying was blocked. Select the value above to copy it by hand.`:``,i===`copied`?`${e} copied.`:``]})]}),c(t,{type:`button`,variant:`outline`,size:`sm`,"data-testid":`${r}-copy`,"aria-label":`Copy ${e}`,onClick:()=>void o(),children:i===`copied`?`Copied`:`Copy`})]})}function Je({listSessions:r,activeSessionId:i=null}){let l=o(()=>r?.()??[],[r]),f=i,[p,m]=Z(`session-mcp/session`,()=>f??l[0]?.id??``),te=l.find(e=>e.id===p),h=te?.workspaceId,g=h!==void 0,y=`${h??``}\u0000${p}`,[,x,S]=Z(`session-mcp/selection`,y),C=n.active(),[w,T]=Z(`session-mcp/config`,void 0),[k,A,j]=Z(`session-mcp/clients`,[]),[M,P]=Z(`session-mcp/redirect`,``),[de,I]=Z(`session-mcp/tool-prefix`,``),[L,fe]=Z(`session-mcp/auth-method`,`url_token`),[R,z]=Z(`session-mcp/created`,void 0),B=R?.sessionId===p?R.client:void 0,[V,H]=Z(`session-mcp/loading`,!1),[U,W,G]=Z(`session-mcp/busy`,!1),[K,q]=Z(`session-mcp/error`,void 0);ee(()=>{S.state===y&&g||(x(y),z(void 0),P(``),I(``),T(void 0),A([]),q(void 0),W(!1))},[g,y,S,x,z,P,I,T,A,q,W]),s(()=>()=>z(void 0),[z]),s(()=>{if(l.some(e=>e.id===p))return;let e=l.find(e=>e.id===f)??l[0];m(e?.id??``)},[l,p,f,m]),s(()=>{let e=!0,t=j.state;return!g||h===void 0?(H(!1),()=>{e=!1}):(H(!0),Promise.all([Se(h,p),Ce(h,p)]).then(([n,r])=>{e&&(`error`in n?q(n.error):T(n.config),`error`in r?q(e=>e??r.error):!G.state&&j.state===t&&A(r.clients),H(!1))}),()=>{e=!1})},[g,p,h,j,G,T,A,q,H]);let J=L===`oauth`&&M!==``&&!Ge(M),Y=g&&!C&&w!==void 0&&(L!==`oauth`||Ge(M))&&!U;async function pe(){if(!Y||h===void 0||G.state)return;let e=y;W(!0),q(void 0);let t=de.trim(),n=t===``?{}:{toolPrefix:t},r=await we(h,p,L===`oauth`?{redirectUri:M.trim(),scope:`session`,routing:`conversation`,...n}:{authMethod:L,scope:`session`,routing:`conversation`,...n});S.state===e&&(W(!1),`error`in r?q(r.error):(z({sessionId:p,client:r.client}),A(e=>[Ke(r.client),...e]),P(``),I(``)))}async function me(e){if(h===void 0||G.state)return;let t=y;W(!0),q(void 0);let n=await Te(h,p,e);S.state===t&&(W(!1),`error`in n?q(n.error):(A(t=>t.filter(t=>t.clientId!==e)),B?.clientId===e&&z(void 0)))}return u(`div`,{className:`flex min-w-0 flex-col gap-10`,"data-testid":`session-mcp-settings`,children:[u(oe,{children:[u(D,{children:[u(v,{children:[u(E,{children:[c(b,{id:`session-mcp-picker-label`,children:`Session`}),c(O,{children:V?u(`span`,{className:`inline-flex items-center gap-2`,children:[c(d,{label:`Reading the session MCP connection`}),`Reading the connection…`]}):te===void 0?`Start a session first, then come back to connect a client to it.`:g?!V&&w===void 0&&K===void 0?`Turn on remote control with a public HTTPS address first. Clients connect through it.`:`Clients connect to this session and work with its tools and permissions.`:`This session belongs to no workspace, so clients cannot connect to it.`})]}),u(ne,{value:p,disabled:l.length===0,onValueChange:m,children:[c(ce,{id:`session-mcp-picker`,"data-testid":`session-mcp-session`,"aria-labelledby":`session-mcp-picker-label`,className:`w-full sm:w-72`,children:c(se,{placeholder:`No live session`})}),c(re,{children:l.map(t=>u(e,{value:t.id,children:[t.name,` · `,t.detail]},t.id))})]})]}),w===void 0?null:u(a,{children:[c(Q,{label:`MCP`,value:w.mcpUrl,testId:`session-mcp-url`}),c(Q,{label:`MCP with widgets`,value:w.mcpAppUrl,testId:`session-mcp-app-url`}),u(`details`,{children:[c(`summary`,{className:`cursor-pointer px-5 py-3 text-sm text-po-dim hover:text-po-hi`,children:`OAuth endpoints`}),u(`dl`,{className:`grid gap-x-6 gap-y-1 border-t border-po-border-soft px-5 py-4 text-sm sm:grid-cols-[auto_minmax(0,1fr)]`,children:[c(`dt`,{className:`text-po-dim`,children:`Authorization`}),c(`dd`,{className:`break-all font-mono text-po-text`,children:w.authorizationEndpoint}),c(`dt`,{className:`text-po-dim`,children:`Token`}),c(`dd`,{className:`break-all font-mono text-po-text`,children:w.tokenEndpoint})]})]})]})]}),K?c(`p`,{role:`alert`,className:`text-sm leading-relaxed text-po-red`,children:K}):null]}),w===void 0||C?null:u(oe,{"data-testid":`session-mcp-create`,children:[u(le,{children:[c(ue,{children:`Connect a client`}),c(ie,{children:`A signed URL is the simplest way to connect ChatGPT: the key travels inside the URL, so there is no OAuth callback or header to set up. Other clients can use an API key or OAuth.`})]}),u(D,{children:[u(v,{children:[u(E,{children:[c(b,{id:`session-mcp-auth-method-label`,children:`Sign-in method`}),c(O,{children:`How the client proves it is allowed in.`})]}),u(ne,{value:L,onValueChange:e=>fe(e),children:[c(ce,{id:`session-mcp-auth-method`,"data-testid":`session-mcp-auth-method`,"aria-labelledby":`session-mcp-auth-method-label`,className:`w-full sm:w-72`,children:c(se,{})}),u(re,{children:[c(e,{value:`url_token`,children:`Signed URL (JWT)`}),c(e,{value:`api_key`,children:`API key (Bearer)`}),c(e,{value:`oauth`,children:`OAuth (callback required)`})]})]})]}),L===`oauth`?u(v,{children:[u(E,{children:[c(b,{children:c(`label`,{htmlFor:`session-mcp-callback`,children:`Redirect URL`})}),c(O,{id:`session-mcp-callback-help`,children:J?c(`span`,{className:`text-po-red`,children:`Use an absolute HTTPS URL without credentials or a fragment.`}):`Copy it from your OAuth client. Don’t work it out from the MCP URL.`})]}),c(N,{id:`session-mcp-callback`,"data-testid":`session-mcp-callback`,type:`url`,value:M,placeholder:`https://chatgpt.com/connector/oauth/…`,"aria-invalid":J,"aria-describedby":`session-mcp-callback-help`,spellCheck:!1,onChange:e=>P(e.target.value),className:`w-full font-mono text-sm sm:w-72`})]}):null,u(v,{children:[u(E,{children:[c(b,{children:c(`label`,{htmlFor:`session-mcp-tool-prefix`,children:`Tool prefix`})}),u(O,{id:`session-mcp-tool-prefix-help`,children:[`Tools appear as `,c(`code`,{className:`font-mono`,children:`prefix_bash`}),`,`,` `,c(`code`,{className:`font-mono`,children:`prefix_read`}),`. Lowercase letters and digits, joined by single underscores, up to 24 characters.`]})]}),c(N,{id:`session-mcp-tool-prefix`,"data-testid":`session-mcp-tool-prefix`,value:de,placeholder:`The session name`,autoComplete:`off`,spellCheck:!1,"aria-describedby":`session-mcp-tool-prefix-help`,onChange:e=>I(e.target.value),className:`w-full font-mono text-sm sm:w-72`})]})]}),u(`div`,{className:`flex flex-col gap-2`,"data-testid":`session-mcp-routing`,children:[c(F,{children:`Every conversation is automatically routed to its own worktree before tools run, never to the checkout this session uses. While a worktree is provisioning or recovering, tools wait; if recovery can't finish, the conversation reports it rather than falling back to this session.`}),c(F,{children:`Access follows this session's mode, domains and profile as they change, and tools run with its permissions.`})]}),c(ae,{children:c(t,{"data-testid":`session-mcp-create-button`,size:`sm`,variant:Y?`primary`:`outline`,loading:U,disabled:!Y,onClick:()=>void pe(),children:L===`url_token`?`Create signed URL`:L===`api_key`?`Create API key`:`Create OAuth client`})})]}),u(oe,{"data-testid":`session-mcp-clients`,children:[u(le,{children:[c(ue,{children:`Clients`}),k.length>0?u(`span`,{className:`text-sm text-po-dim tabular-nums`,children:[k.length,` connected`]}):null]}),C?c(F,{"data-testid":`session-mcp-remote-note`,children:`New clients can only be created on the machine Po runs on. From here you can still see and revoke existing ones, if the host allows it.`}):null,B===void 0?null:u(D,{className:`border-po-green/50`,"data-testid":`session-mcp-secret`,children:[u(v,{children:[u(E,{children:[u(b,{className:`flex flex-wrap items-center gap-2`,children:[`Save these details now`,B.toolPrefix?u(_,{tone:`neutral`,className:`font-mono`,"data-testid":`session-mcp-created-prefix`,children:[B.toolPrefix,`_*`]}):null]}),u(O,{children:[B.tokenEndpointAuthMethod===`url_token`?`In ChatGPT, paste either URL into Server URL and choose no additional authentication. Treat both like a password: they are shown once and work until you revoke the client.`:B.tokenEndpointAuthMethod===`api_key`?`In ChatGPT, choose API key with a Bearer header and paste the key. It is shown once and disappears when you dismiss it, leave this page or switch session.`:null,B.tokenEndpointAuthMethod===`url_token`||B.tokenEndpointAuthMethod===`api_key`?null:u(a,{children:[`Paste the client ID and secret into your OAuth client and choose`,` `,c(`code`,{className:`font-mono`,children:`client_secret_post`}),` as the token endpoint auth method. The secret is shown once.`]})]})]}),c(t,{variant:`ghost`,size:`sm`,onClick:()=>z(void 0),children:`Dismiss`})]}),B.tokenEndpointAuthMethod===`url_token`?u(a,{children:[c(Q,{label:`Signed MCP URL`,value:B.connectionUrl,testId:`session-mcp-created-url`}),c(Q,{label:`Signed MCP with widgets URL`,value:B.mcpAppConnectionUrl,testId:`session-mcp-created-app-url`})]}):u(a,{children:[w===void 0?null:u(a,{children:[c(Q,{label:`MCP`,value:w.mcpUrl,testId:`session-mcp-created-url`}),c(Q,{label:`MCP with widgets`,value:w.mcpAppUrl,testId:`session-mcp-created-app-url`})]}),B.tokenEndpointAuthMethod===`api_key`?null:c(Q,{label:`Client ID`,value:B.clientId,testId:`session-mcp-created-id`}),c(Q,{label:B.tokenEndpointAuthMethod===`api_key`?`API key`:`Client secret`,value:B.clientSecret,testId:`session-mcp-created-secret`})]})]}),k.length===0?V?null:c(D,{children:c(v,{children:u(E,{children:[c(b,{children:`No clients yet`}),c(O,{children:`Clients you connect to this session will be listed here.`})]})})}):c(D,{asChild:!0,children:c(`ul`,{children:k.map(e=>c(v,{asChild:!0,children:u(`li`,{children:[u(E,{children:[u(b,{className:`flex flex-wrap items-center gap-2`,children:[e.name,c(_,{tone:`neutral`,children:qe[e.tokenEndpointAuthMethod]??e.tokenEndpointAuthMethod}),e.toolPrefix?u(_,{tone:`neutral`,className:`font-mono`,children:[e.toolPrefix,`_*`]}):null]}),c(O,{children:e.scope===`session`?`Session access. Worktree per conversation.`:`Restricted access. Tools: ${e.tools.join(`, `)||`none`}. Skills: ${e.skills.join(`, `)||`none`}.`}),c(`code`,{className:`block break-all font-mono text-sm text-po-dim`,children:e.clientId}),e.redirectUri?c(`span`,{className:`block break-all font-mono text-sm text-po-dim`,children:e.redirectUri}):null]}),c(t,{variant:`ghost`,size:`sm`,disabled:U,onClick:()=>void me(e.clientId),children:`Revoke`})]})},e.clientId))})}),c(F,{children:`Signed URLs and API keys belong to this session and survive a restart until you revoke them. OAuth sign-ins last only while Po runs, so a client may ask to authorise again.`})]})]})}var Ye=de({label:`Session MCP`,detail:`Let ChatGPT or another MCP client work inside one live Po session. Separate from the MCP servers Po calls out to.`,menuGroup:`general`,component:Je}),Xe=m({label:`MCP`,panel:Le,useVisible:ke}),$=(e,t)=>t===void 0?void 0:{...e,...t},Ze=k({id:`session-mcp`,packageName:`@agimon-ai/po-session-mcp`,host:{get dockFaces(){return[$({id:`mcp`},Be)]},get fills(){return[$({slot:`session-setup-actions`,id:`mcp-setup`},Ve),$({slot:`overlay`,id:`mcp-watcher`},He)]},get settingsPanels(){return[$({id:`session-mcp`},Ye)]},get tabs(){return[$({id:`mcp`},Xe)]}}});export{Ze as webPlugin};
|
package/dist/assets/plugins/slots/{sessions.6f47cb4c-y61JDvak.js → sessions.fc763f42-CL0PHuD4.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$r as e,Gi as t,Ht as n,It as r,Jr as i,Ka as a,Ki as o,Lt as s,Ma as c,Sn as l,Wi as u,Xi as d,Yi as f,Zi as p,ea as m,ja as h,kn as g,qa as _,qi as v,qt as y,rr as b,wn as x}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,Gi as t,Ht as n,It as r,Jr as i,Ka as a,Ki as o,Lt as s,Ma as c,Sn as l,Wi as u,Xi as d,Yi as f,Zi as p,ea as m,ja as h,kn as g,qa as _,qi as v,qt as y,rr as b,wn as x}from"../chunks/po-web-runtime-C0B3uAoC.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=c(void 0),T=c([]);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:e,listSessions:t}){return!e||!t?null:s(x,{role:`menuitem`,density:`compact`,"data-testid":`composer-menu-send-to-session`,className:`w-full text-po-text hover:bg-po-tint-blue`,onClick:()=>D(e()),children:[r(b,{"aria-hidden":!0,className:`h-3 w-3 shrink-0`}),r(l,{density:`compact`,children:`Send to session…`})]})}var j=h({component:A}),M={running:`green`,waiting:`magenta`,idle:`neutral`};function N({open:n,sessions:a,to:c,text:l,error:h,sending:_,onPick:y,onTextChange:x,onCancel:S,onSend:C}){let w=a.find(e=>e.id===c);return r(u,{open:n,onOpenChange:e=>e?void 0:S(),children:s(o,{width:`md`,"data-testid":`send-to-session-dialog`,children:[r(d,{children:r(p,{children:`Send to session`})}),s(t,{className:`flex flex-col gap-3`,children:[r(v,{children:`It reaches that session right away, in its current turn, as a message from you.`}),a.length===0?r(`p`,{className:`text-sm text-po-dim`,children:`No other session is running. Open one, then send.`}):r(g,{label:`Sessions`,items:a.map(e=>({value:e.id,title:e.name,subtitle:e.detail,lead:r(m,{tone:M[e.state],size:`md`})})),value:c===void 0?[]:[c],filterable:!0,filterPlaceholder:`Search sessions`,onSelect:y,className:`max-h-56 rounded-md border border-po-border`}),r(i,{"aria-label":`Message`,rows:3,value:l,"data-testid":`send-to-session-text`,onChange:e=>x(e.currentTarget.value)}),h===``?null:r(`p`,{role:`alert`,className:`text-sm text-po-red`,children:h}),s(f,{children:[r(e,{variant:`outline`,size:`md`,onClick:S,children:`Cancel`}),s(e,{variant:`primary`,size:`md`,className:`gap-1.5`,"data-testid":`send-to-session-send`,disabled:w===void 0||l.trim()===``||_,onClick:C,children:[r(b,{"aria-hidden":!0,className:`size-3.5`}),w===void 0?`Send`:`Send to ${w.name}`]})]})]})]})})}function P({sessionId:e,listSessions:t,appendComposerDraft:i}){let[a,o]=y(!1),[s,c]=y([]),[l,u]=y(void 0),[d,f]=y(``),[p,m]=y(``),[h,g]=y(!1);if(n(()=>O(e=>{c(t?.()??[]),u(void 0),f(e.text),m(``),o(!0)}),[t]),!a||e===null)return null;let _=()=>{h||(i(d),o(!1))},v=async()=>{if(l===void 0)return;g(!0);let t=await k({from:e,to:l,text:d.trim()});g(!1),t===void 0?o(!1):m(t)};return r(N,{open:!0,sessions:s,to:l,text:d,error:p,sending:h,onPick:u,onTextChange:f,onCancel:_,onSend:()=>void v()})}var F=h({component:P}),I=a(E),L=(e,t)=>t===void 0?void 0:{...e,...t},R=_({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 +1,4 @@
|
|
|
1
|
-
import{$r as e,Ft as t,It as n,Lt as r,Mi as i,Wa as a,_n as o,gn as s,hn as c,mn as l,qa as u,qt as d,un as f}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,Ft as t,It as n,Lt as r,Mi as i,Wa as a,_n as o,gn as s,hn as c,mn as l,qa as u,qt as d,un as f}from"../chunks/po-web-runtime-C0B3uAoC.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
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
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
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[i,a]=d(!1),o=g(t),s=i||o.hidden===0;return r(c,{"data-testid":`tool-result-load_skill`,className:`flex flex-col gap-2`,children:[n(f,{text:s?t:o.text}),s?null:r(`span`,{className:`flex items-center gap-2`,children:[r(`span`,{className:`text-sm text-po-dim`,children:[o.hidden,` more lines`]}),n(e,{variant:`ghost`,size:`sm`,onClick:()=>a(!0),children:`Show more`})]})]})}function b({args:e,result:a,output:u,running:d,isError:f}){let g=m(e),_=a===null||f?``:h(p(a,u));return n(l,{tone:i({running:d,isError:f}),expandable:!0,children:({expanded:e})=>r(t,{children:[n(s,{title:`load_skill`,children:n(`span`,{"data-testid":`tool-call-load_skill`,className:`flex min-w-0 flex-1 items-center gap-2`,children:n(`span`,{className:`truncate text-po-text`,children:g})})}),e?f?n(c,{"data-testid":`tool-result-load_skill`,className:`flex flex-col`,children:n(`span`,{className:`whitespace-pre-wrap break-words text-po-red`,children:p(a,u)})}):a===null?d?n(c,{"data-testid":`tool-result-load_skill`,children:n(o,{tone:`running`,children:`running`})}):null:_.length===0?null:n(y,{body:_}):null]})})}var x=a({message:b});function S({args:e,result:a,output:u,running:d,isError:f}){let m=_(e),h=a===null||f?[]:v(a,u),g=a===null||f?void 0:`${h.length} ${h.length===1?`skill`:`skills`}`;return n(l,{tone:i({running:d,isError:f}),expandable:!0,children:({expanded:e})=>r(t,{children:[n(s,{title:`search_skills`,children:r(`span`,{"data-testid":`tool-call-search_skills`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[m===void 0?n(`span`,{className:`truncate text-po-dim`,children:`all skills`}):n(`span`,{className:`truncate text-po-text`,children:m}),g===void 0?null:r(`span`,{className:`shrink-0 text-po-faint`,children:[`· `,g]})]})}),e?f?n(c,{"data-testid":`tool-result-search_skills`,className:`flex flex-col`,children:n(`span`,{className:`whitespace-pre-wrap break-words text-po-red`,children:p(a,u)})}):a===null?d?n(c,{"data-testid":`tool-result-search_skills`,children:n(o,{tone:`running`,children:`running`})}):null:h.length===0?n(c,{"data-testid":`tool-result-search_skills`,children:n(`span`,{className:`text-po-dim`,children:`No skills match.`})}):n(c,{"data-testid":`tool-result-search_skills`,className:`flex flex-col gap-2`,children:h.map(e=>r(`span`,{className:`flex flex-col`,children:[n(`span`,{className:`font-semibold text-po-hi`,children:e.name}),e.description.length>0?n(`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=u({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 +1 @@
|
|
|
1
|
-
import{$r as e,Aa as t,At as n,Bt as r,Ei as i,Ht as a,It as o,Lt as s,Ui as c,da as l,eo as u,fn as d,ga as f,ja as p,la as m,ma as h,pi as g,qa as _,qt as v,wa as y}from"../chunks/po-web-runtime-
|
|
1
|
+
import{$r as e,Aa as t,At as n,Bt as r,Ei as i,Ht as a,It as o,Lt as s,Ui as c,da as l,eo as u,fn as d,ga as f,ja as p,la as m,ma as h,pi as g,qa as _,qt as v,wa as y}from"../chunks/po-web-runtime-C0B3uAoC.js";var b=26214400,x=134217728,S=3e3,C=y({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)=>n.fetch(e,t),sessionAddress:u});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(e,t,n){let r={space:e,path:t},a=await C.host.content({query:r,signal:n});if(a.ok)return a.response.blob();if(a.status!==413)throw Error(a.error||`This file could not be loaded.`);return i(async(e,t)=>{let n=await C.host.content({query:r,headers:e,signal:t});if(!n.ok)throw Error(n.error||`This file could not be loaded.`);return n.response},b,x,n)}async function O(e,t,n){let r=g(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:t,onSpaceChange:n,items:r,loading:i,error:a,now:u,onRetry:d,onOpen:f,path:p,preview:g,previewError:_,media:y,loadImage:b}){let[x,S]=v(`tree`),[C,w]=v(``),[T,E]=v(!1),[D,O]=v(c),[A,j]=v(`modified`),[M,N]=v(`desc`),[P,F]=v(new Set),I=e.find(e=>e.id===t)?.label??`Space`;return s(`main`,{className:`flex h-full min-h-0 flex-col bg-po-bg text-po-text`,children:[o(`h1`,{className:`shrink-0 border-b border-po-border px-4 py-3 text-2xl font-semibold text-po-hi`,children:`Space`}),s(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[o(`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:o(l,{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:r,loading:i,error:a,onRetry:d,now:u,layout:x,onLayoutChange:S,query:C,onQueryChange:w,searchOpen:T,onSearchOpenChange:E,filters:{...D,location:t},onFiltersChange:({location:e,...r})=>{O(r),e!==t&&n(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:p,onOpen:f})}),p?o(h,{source:I,path:p,preview:g,error:_,media:y,loadImage:b,documentPath:k(t,p)}):o(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:o(m,{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[r,i]=v(),s=`${e}:${t}:${n}`;a(()=>{let n=new AbortController,r;return D(e,t,n.signal).then(e=>{n.signal.aborted||(r=URL.createObjectURL(e),i({source:s,url:r,mimeType:e.type}))}).catch(e=>{n.signal.aborted||i({source:s,error:e instanceof Error?e.message:String(e)})}),()=>{n.abort(),r!==void 0&&URL.revokeObjectURL(r)}},[e,t,s]);let c=r?.source===s?r:void 0;return c?.url?o(d,{src:c.url,path:t,contentType:c.mimeType}):o(`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,i]=v(),s=`${e}:${t}`;a(()=>{let n=new AbortController;return E(e,t,n.signal).then(e=>{n.signal.aborted||i({key:s,preview:e})}).catch(e=>{n.signal.aborted||i({key:s,error:e instanceof Error?e.message:String(e)})}),()=>n.abort()},[e,t,s]);let c=r(n=>O(e,t,n).then(t=>({...t,path:k(e,t.path)})),[e,t]),l=n?.key===s?n:void 0;return o(h,{source:e===A.id?A.label:e,path:t,preview:l?.preview,error:l?.error,loadImage:c,documentPath:k(e,t),media:o(M,{space:e,path:t,revision:`tab`})})}function P(){let[e,t]=v([A]),[n,i]=v(A.id),[s,c]=v(()=>({space:A.id,items:[],now:Date.now(),loaded:!1})),[l,u]=v(0),[d,f]=v(),p=s.space===n?s.items:[],m=p.find(e=>e.path===d),h=m?`${m.modifiedAt}:${m.size}`:s.loaded?`missing`:`initial`,[g,_]=v(),y=`${n}:${d}:${h}`;a(()=>{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),c({space:n,items:i.items,loaded:!0,now:Date.now(),error:i.error})}catch(t){e.signal.aborted||c(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 a=setInterval(()=>void i(),S),o=()=>void i();return document.addEventListener(`visibilitychange`,o),()=>{e.abort(),clearInterval(a),document.removeEventListener(`visibilitychange`,o)}},[l,n]),a(()=>{if(!d||h===`missing`)return;let e=new AbortController;return E(n,d,e.signal).then(t=>{e.signal.aborted||_({key:y,preview:t})}).catch(t=>{e.signal.aborted||_({key:y,error:t instanceof Error?t.message:String(t)})}),()=>e.abort()},[n,d,h,y]);let b=r(e=>O(n,d??``,e).then(e=>({...e,path:k(n,e.path)})),[n,d]),x=g?.key===y?g:void 0;return o(j,{spaces:e,space:n,onSpaceChange:e=>{i(e),f(void 0)},items:p,now:s.now,error:s.space===n?s.error:void 0,loading:!s.loaded||s.space!==n,onRetry:()=>u(e=>e+1),onOpen:e=>f(e.path),path:d,preview:x?.preview,previewError:h===`missing`?`This file no longer exists.`:x?.error,loadImage:b,media:d?o(M,{space:n,path:d,revision:h}):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=t({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:()=>o(N,{space:n.space,path:n.path})}}}),V=p({slot:`page`,id:`space`,component:P});function H({openPage:t,activePageId:n}){let r=n===`space`;return o(`div`,{className:`px-3 pt-1 group-data-[rail=desktop]/rail:p-0 group-data-[rail=elegant]/rail:p-0`,children:s(e,{variant:`ghost`,size:`lg`,"data-testid":`space-open`,"aria-current":r?`page`:void 0,onClick:()=>t?.(`space`),className:r?`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:[o(`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:o(f,{"aria-hidden":`true`,className:r?`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=p({slot:`rail`,id:`space`,component:H}),W=(e,t)=>t===void 0?void 0:{...e,...t},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};
|