@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,11 +1,11 @@
|
|
|
1
|
-
import { Et as composeServerProviderOverrides, Ht as PO_CONFIG_SERVICE, It as readPoFs, Jt as String$1, Lt as readPoIsolate, Mt as PO_SHELL_SERVICE, Pt as readPoBrowser, Qt as Integer, Rt as readPoNpm, U as Check$1, V as Check, W as Errors, _t as BACKGROUND_CONTEXT, h as getOrThrow, i as PO_SESSION_FILES_SERVICE, in as Optional, kt as PO_BROWSER_SERVICE, ln as requirePoServerScope, lt as invalidImageReason, on as PO_SERVER_SCOPE_SERVICE, pt as readPoHeadlessHost, rn as _Object_, sn as defineServiceContract, t as defineServerPlugin, yt as withAbortSignal } from "./serverPlugin-4nI5J6Zt.js";
|
|
1
|
+
import { Et as composeServerProviderOverrides, Ht as PO_CONFIG_SERVICE, It as readPoFs, Jt as String$1, Lt as readPoIsolate, Mt as PO_SHELL_SERVICE, Pt as readPoBrowser, Qt as Integer, Rt as readPoNpm, U as Check$1, V as Check, W as Errors, _t as BACKGROUND_CONTEXT, an as _Array_, h as getOrThrow, i as PO_SESSION_FILES_SERVICE, in as Optional, kt as PO_BROWSER_SERVICE, ln as requirePoServerScope, lt as invalidImageReason, on as PO_SERVER_SCOPE_SERVICE, pt as readPoHeadlessHost, rn as _Object_, sn as defineServiceContract, t as defineServerPlugin, yt as withAbortSignal } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import { t as Meta } from "./meta-CVgfTHQP.js";
|
|
3
3
|
import "./platform-CQahdzpG.js";
|
|
4
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
4
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-By7eSfpp.js";
|
|
5
5
|
import { c as defineRoot, d as defineServerCommand, f as defineServerTool, n as composeRootInjects, r as defineChannel, s as defineResource, t as composeRootHooks } from "./extensionFile-B940JOEn.js";
|
|
6
6
|
import { n as readPresetsConfig, t as readPackageConfigurations } from "./presetConfig-n-oiNd3h.js";
|
|
7
7
|
import "./exports-t_BpzyPr.js";
|
|
8
|
-
import { i as isUnattended, n as gateApproval, o as PO_APPROVAL_SERVICE, s as readPoApproval, t as ApprovalPendingError } from "./approval-
|
|
8
|
+
import { i as isUnattended, n as gateApproval, o as PO_APPROVAL_SERVICE, s as readPoApproval, t as ApprovalPendingError } from "./approval-DRipNxVh.js";
|
|
9
9
|
import { a as PO_BACKGROUND_WORK_SERVICE, l as readPoBackgroundWorkService } from "./backgroundWork-Bv0ib_lY.js";
|
|
10
10
|
import { r as assertCodemodeNamespaceName, t as PO_CODEMODE_CONTRACT } from "./codemode-LpcMFMYM.js";
|
|
11
11
|
import "./worker.js";
|
|
@@ -127,6 +127,15 @@ var FileSystemCodemodeScriptsService = class {
|
|
|
127
127
|
path
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
+
async saveLog(text) {
|
|
131
|
+
const fs = this.options.fs();
|
|
132
|
+
const directory = this.sessionDirectory();
|
|
133
|
+
if (!fs || directory === void 0) return void 0;
|
|
134
|
+
getOrThrow(await fs.createDir(directory, { recursive: true }, BACKGROUND_CONTEXT));
|
|
135
|
+
const path = `${directory}/exec-${crypto.randomUUID()}.log`;
|
|
136
|
+
getOrThrow(await fs.writeFile(path, `${text}\n`, BACKGROUND_CONTEXT));
|
|
137
|
+
return path;
|
|
138
|
+
}
|
|
130
139
|
candidates(specifier, domains) {
|
|
131
140
|
if (specifier.startsWith("/")) return [specifier];
|
|
132
141
|
const session = this.sessionDirectory();
|
|
@@ -184,26 +193,21 @@ const DiscoverToolSchema = _Object_({
|
|
|
184
193
|
namespace: Optional(String$1({ description: "Show the full TypeScript declarations of one namespace." })),
|
|
185
194
|
query: Optional(String$1({ description: "Find matching members across every namespace." }))
|
|
186
195
|
});
|
|
196
|
+
const MIN_EXEC_TIMEOUT_MS = 1e3;
|
|
197
|
+
const MAX_EXEC_TIMEOUT_MS = 72e5;
|
|
187
198
|
const ExecToolSchema = _Object_({
|
|
188
199
|
code: String$1({ description: "TypeScript body of an async function. Top-level await and return work. The returned value, console output and image() calls come back." }),
|
|
189
200
|
timeoutMs: Optional(Integer({
|
|
190
|
-
minimum:
|
|
191
|
-
maximum:
|
|
192
|
-
description: "Deadline in milliseconds. Default 30000."
|
|
193
|
-
}))
|
|
194
|
-
});
|
|
195
|
-
const ExecBackgroundToolSchema = _Object_({
|
|
196
|
-
code: ExecToolSchema.properties.code,
|
|
197
|
-
timeoutMs: Optional(Integer({
|
|
198
|
-
minimum: 1e3,
|
|
199
|
-
maximum: 72e5,
|
|
201
|
+
minimum: MIN_EXEC_TIMEOUT_MS,
|
|
202
|
+
maximum: MAX_EXEC_TIMEOUT_MS,
|
|
200
203
|
description: "Deadline in milliseconds. Default 1800000 (30 minutes), maximum 2 hours."
|
|
201
204
|
}))
|
|
202
205
|
});
|
|
206
|
+
const ExecBackgroundToolSchema = ExecToolSchema;
|
|
203
207
|
const ExecCancelToolSchema = _Object_({
|
|
204
208
|
id: String$1({
|
|
205
209
|
minLength: 1,
|
|
206
|
-
description: "The background
|
|
210
|
+
description: "The background job ID returned by exec or exec_background."
|
|
207
211
|
}),
|
|
208
212
|
reason: Optional(String$1({ maxLength: 256 }))
|
|
209
213
|
});
|
|
@@ -286,11 +290,8 @@ function createFsModule(fs, cwd, signal) {
|
|
|
286
290
|
}
|
|
287
291
|
//#endregion
|
|
288
292
|
//#region ../../default/po-codemode/src/services/codemodeTools/index.ts
|
|
289
|
-
const
|
|
290
|
-
const
|
|
291
|
-
const MIN_TIMEOUT_MS = 1e3;
|
|
292
|
-
const BACKGROUND_DEFAULT_TIMEOUT_MS = 18e5;
|
|
293
|
-
const BACKGROUND_MAX_TIMEOUT_MS = 72e5;
|
|
293
|
+
const FOREGROUND_WAIT_MS = 3e4;
|
|
294
|
+
const execDeadline = (timeoutMs) => Math.min(MAX_EXEC_TIMEOUT_MS, Math.max(MIN_EXEC_TIMEOUT_MS, timeoutMs ?? 18e5));
|
|
294
295
|
const MAX_LOG_CHARS = 1e4;
|
|
295
296
|
const MAX_VALUE_CHARS = 65536;
|
|
296
297
|
const MAX_DECLARATION_CHARS = 24e3;
|
|
@@ -308,6 +309,7 @@ const MAX_SCRIPT_LABEL = 200;
|
|
|
308
309
|
const MEMBER_LINE = /^\s{2}(?:readonly\s+)?(\w+)\s*[(?:<]/u;
|
|
309
310
|
const GLOBALS_HELP = "Globals: console.log/info/warn/error, image(data, mimeType?) to return a screenshot, sleep(ms). Return a value with `return`.";
|
|
310
311
|
const SCRIPTS_HELP = "Every exec run is saved. Call a saved script with `await (await import(specifier))(args)`; inside it, `args` is the argument and its `return` is the result.";
|
|
312
|
+
var ExecDeadlineError = class extends Error {};
|
|
311
313
|
/** The script's first non-empty line, so two scripts can be told apart. */
|
|
312
314
|
function scriptLabel(code) {
|
|
313
315
|
return (code.split("\n").find((candidate) => candidate.trim() !== "") ?? "").trim().slice(0, MAX_SCRIPT_LABEL);
|
|
@@ -472,12 +474,28 @@ function recordedCall(call, budget) {
|
|
|
472
474
|
} }
|
|
473
475
|
};
|
|
474
476
|
}
|
|
475
|
-
function toResult(result, output, saved, calls, approvals = []) {
|
|
477
|
+
function toResult(result, output, log, saved, calls, approvals = []) {
|
|
476
478
|
const pending = !result.ok && result.error.kind === "error" && result.error.name === "ApprovalPendingError" && approvals.length > 0;
|
|
477
479
|
const content = [];
|
|
478
|
-
if (output.lines.length > 0)
|
|
480
|
+
if (output.lines.length > 0) {
|
|
481
|
+
let preview = log.text;
|
|
482
|
+
if (preview.length > MAX_LOG_CHARS) {
|
|
483
|
+
const marker = "\n[... middle of console output omitted ...]\n";
|
|
484
|
+
const side = Math.floor(4978);
|
|
485
|
+
preview = `${preview.slice(0, side)}${marker}${preview.slice(-4978)}`;
|
|
486
|
+
}
|
|
487
|
+
content.push({
|
|
488
|
+
type: "text",
|
|
489
|
+
text: preview
|
|
490
|
+
});
|
|
491
|
+
if (log.text.length > MAX_LOG_CHARS && log.path === void 0 && log.warning === void 0) content.push({
|
|
492
|
+
type: "text",
|
|
493
|
+
text: "The full console log could not be saved on this host."
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
if (log.warning !== void 0) content.push({
|
|
479
497
|
type: "text",
|
|
480
|
-
text:
|
|
498
|
+
text: log.warning
|
|
481
499
|
});
|
|
482
500
|
if (result.ok) {
|
|
483
501
|
if (ArrayBuffer.isView(result.value)) content.push({
|
|
@@ -491,10 +509,10 @@ function toResult(result, output, saved, calls, approvals = []) {
|
|
|
491
509
|
} else if (!pending) {
|
|
492
510
|
const { kind, name, message, line } = result.error;
|
|
493
511
|
const location = line === void 0 ? "" : ` (line ${line})`;
|
|
494
|
-
const hint = kind === "timeout" ? " Split the work into smaller exec calls, or
|
|
512
|
+
const hint = kind === "timeout" ? " Split the work into smaller exec calls, or raise timeoutMs for long asynchronous work." : "";
|
|
495
513
|
content.push({
|
|
496
514
|
type: "text",
|
|
497
|
-
text: `${name}: ${message}${location}${hint}
|
|
515
|
+
text: truncate(`${name}: ${message}${location}${hint}`, MAX_VALUE_CHARS)
|
|
498
516
|
});
|
|
499
517
|
}
|
|
500
518
|
if (approvals.length > 0) content.push({
|
|
@@ -509,6 +527,10 @@ function toResult(result, output, saved, calls, approvals = []) {
|
|
|
509
527
|
type: "text",
|
|
510
528
|
text: saved
|
|
511
529
|
});
|
|
530
|
+
if (log.path !== void 0) content.push({
|
|
531
|
+
type: "text",
|
|
532
|
+
text: `Full console log: ${log.path}`
|
|
533
|
+
});
|
|
512
534
|
for (const image of output.images) content.push({
|
|
513
535
|
type: "image",
|
|
514
536
|
data: image.data,
|
|
@@ -519,6 +541,7 @@ function toResult(result, output, saved, calls, approvals = []) {
|
|
|
519
541
|
kind: result.error.kind === "compile" ? "validation" : result.error.kind === "error" ? "unknown" : result.error.kind,
|
|
520
542
|
reason: result.error.name
|
|
521
543
|
} } : {},
|
|
544
|
+
...log.path === void 0 ? {} : { logPath: log.path },
|
|
522
545
|
...calls.length > 0 ? { calls } : {},
|
|
523
546
|
...approvals.length > 0 ? { approvals } : {}
|
|
524
547
|
};
|
|
@@ -594,12 +617,14 @@ function gatedLabel(namespace, member) {
|
|
|
594
617
|
return policies.some(([, policy]) => policy.requirement === "human") ? `${member} (needs the person)` : `${member} (asks first)`;
|
|
595
618
|
}
|
|
596
619
|
/** `discover` and `exec` for one session, over the namespaces its packages contributed. */
|
|
597
|
-
function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: lifecycleSignal, onBackgroundChange, approval }) {
|
|
620
|
+
function createCodemodeTools({ registry, isolate, scripts, npm, bashActive, deniedImports, fs, signal: lifecycleSignal, onBackgroundChange, approval }) {
|
|
598
621
|
let running = 0;
|
|
599
622
|
let closing = false;
|
|
600
623
|
const lifecycle = new AbortController();
|
|
601
624
|
const ownerSignal = lifecycleSignal ? AbortSignal.any([lifecycle.signal, lifecycleSignal]) : lifecycle.signal;
|
|
602
625
|
const jobs = /* @__PURE__ */ new Map();
|
|
626
|
+
const activeRuns = /* @__PURE__ */ new Set();
|
|
627
|
+
const shutdownErrors = [];
|
|
603
628
|
const backgroundWork = {
|
|
604
629
|
provider: "po-codemode-background",
|
|
605
630
|
listActiveWork: () => [...jobs.values()].map(({ id, sessionId, status }) => ({
|
|
@@ -626,7 +651,7 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
626
651
|
if (domainScripts.length === 0) return [];
|
|
627
652
|
return [`Domain scripts: ${domainScripts.slice(0, MAX_LISTED_SCRIPTS).join(", ")}${domainScripts.length > MAX_LISTED_SCRIPTS ? ` and ${domainScripts.length - MAX_LISTED_SCRIPTS} more` : ""}. Use discover({ query }) to see what one does before importing it.`];
|
|
628
653
|
};
|
|
629
|
-
const executeCode = async (parameters, signal, execution, deadlineMs, toolCallId, background = false,
|
|
654
|
+
const executeCode = async (parameters, signal, execution, deadlineMs, toolCallId, background = false, updates) => {
|
|
630
655
|
const service = isolate();
|
|
631
656
|
if (!service) return text("Code mode is not available on this host.", true);
|
|
632
657
|
if (closing || ownerSignal.aborted) return text("Code mode session is disposing.", true);
|
|
@@ -645,12 +670,11 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
645
670
|
bytes: 0
|
|
646
671
|
};
|
|
647
672
|
const output = createOutput();
|
|
648
|
-
let updateTimer;
|
|
649
673
|
const scheduleUpdate = () => {
|
|
650
|
-
if (
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
if (!runSignal.aborted)
|
|
674
|
+
if (!updates?.send || updates.timer !== void 0) return;
|
|
675
|
+
updates.timer = setTimeout(() => {
|
|
676
|
+
delete updates.timer;
|
|
677
|
+
if (!runSignal.aborted) updates.send?.({
|
|
654
678
|
content: [],
|
|
655
679
|
details: { calls: [...calls] }
|
|
656
680
|
});
|
|
@@ -778,13 +802,20 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
778
802
|
exports
|
|
779
803
|
};
|
|
780
804
|
}
|
|
781
|
-
if (
|
|
782
|
-
|
|
805
|
+
if (builtin !== void 0) throw new Error("Session filesystem imports are not available on this host.");
|
|
806
|
+
const native = specifier.startsWith("node:");
|
|
807
|
+
if (native) {
|
|
808
|
+
if (!service.liveObjects) throw new Error("Node built-ins are not available on this host.");
|
|
809
|
+
if (execution.mcpSkills !== void 0) throw new Error("Remote MCP callers cannot import Node built-ins.");
|
|
810
|
+
if (bashActive?.() !== true) throw new Error("Node built-ins need the bash tool in this session.");
|
|
811
|
+
if ((await deniedImports?.())?.some((name) => specifier === name || specifier.startsWith(`${name}/`))) throw new Error(`${specifier} is blocked by deniedImports in the po-codemode config.`);
|
|
812
|
+
if (bashActive?.() !== true) throw new Error("Node built-ins need the bash tool in this session.");
|
|
813
|
+
} else if (!specifier.startsWith("npm:")) {
|
|
783
814
|
if (!scripts) throw new Error("Script imports are not available on this host.");
|
|
784
815
|
return scripts.resolve(specifier, activeDomains(execution));
|
|
785
816
|
}
|
|
786
817
|
const loader = npm?.();
|
|
787
|
-
if (!loader) throw new Error("npm imports are not available on this host.");
|
|
818
|
+
if (!loader) throw new Error(native ? "Node built-ins are not available on this host." : "npm imports are not available on this host.");
|
|
788
819
|
run.signal.throwIfAborted();
|
|
789
820
|
const started = Date.now();
|
|
790
821
|
try {
|
|
@@ -829,9 +860,18 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
829
860
|
};
|
|
830
861
|
} finally {
|
|
831
862
|
controller.abort();
|
|
832
|
-
clearTimeout(
|
|
863
|
+
clearTimeout(updates?.timer);
|
|
864
|
+
if (signal?.reason instanceof ExecDeadlineError && (result.ok || result.error.kind !== "timeout")) result = {
|
|
865
|
+
ok: false,
|
|
866
|
+
error: {
|
|
867
|
+
kind: "timeout",
|
|
868
|
+
name: "TimeoutError",
|
|
869
|
+
message: signal.reason.message
|
|
870
|
+
}
|
|
871
|
+
};
|
|
833
872
|
for (const cleanup of cleanups.reverse()) await Promise.resolve().then(cleanup).catch((error) => {
|
|
834
873
|
const message = truncate(`Code mode cleanup failed: ${String(error)}`, MAX_LOG_CHARS);
|
|
874
|
+
if (ownerSignal.aborted) shutdownErrors.push(message);
|
|
835
875
|
output.note(message);
|
|
836
876
|
if (result.ok || result.error.kind === "error" && result.error.name === "ApprovalPendingError" && approvals.length > 0) result = {
|
|
837
877
|
ok: false,
|
|
@@ -844,7 +884,14 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
844
884
|
});
|
|
845
885
|
running -= 1;
|
|
846
886
|
}
|
|
847
|
-
|
|
887
|
+
const log = { text: output.lines.join("\n") };
|
|
888
|
+
if (output.lines.length > 0) try {
|
|
889
|
+
const path = await scripts?.saveLog?.(log.text);
|
|
890
|
+
if (path !== void 0) log.path = path;
|
|
891
|
+
} catch (error) {
|
|
892
|
+
log.warning = truncate(`Could not save the full console log: ${String(error)}`, MAX_LOG_CHARS);
|
|
893
|
+
}
|
|
894
|
+
return toResult(result, output, log, saved, calls, approvals);
|
|
848
895
|
};
|
|
849
896
|
const discover = {
|
|
850
897
|
name: "discover",
|
|
@@ -900,6 +947,102 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
900
947
|
return text(sections.join("\n"));
|
|
901
948
|
}
|
|
902
949
|
};
|
|
950
|
+
const startCode = (parameters, execution, toolCallId, background, toolSignal, onUpdate) => {
|
|
951
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
952
|
+
const deadlineMs = execDeadline(parameters.timeoutMs);
|
|
953
|
+
const controller = new AbortController();
|
|
954
|
+
const updates = onUpdate ? { send: onUpdate } : {};
|
|
955
|
+
const abort = () => controller.abort(toolSignal?.reason);
|
|
956
|
+
if (toolSignal?.aborted) abort();
|
|
957
|
+
else toolSignal?.addEventListener("abort", abort, { once: true });
|
|
958
|
+
const detach = () => {
|
|
959
|
+
toolSignal?.removeEventListener("abort", abort);
|
|
960
|
+
clearTimeout(updates.timer);
|
|
961
|
+
delete updates.timer;
|
|
962
|
+
delete updates.send;
|
|
963
|
+
};
|
|
964
|
+
const timer = setTimeout(() => {
|
|
965
|
+
controller.abort(new ExecDeadlineError(`Script exceeded ${deadlineMs} ms.`));
|
|
966
|
+
}, deadlineMs);
|
|
967
|
+
const done = executeCode(parameters, controller.signal, execution, deadlineMs, toolCallId, background, updates).finally(() => {
|
|
968
|
+
clearTimeout(timer);
|
|
969
|
+
detach();
|
|
970
|
+
activeRuns.delete(done);
|
|
971
|
+
});
|
|
972
|
+
activeRuns.add(done);
|
|
973
|
+
return {
|
|
974
|
+
controller,
|
|
975
|
+
deadlineMs,
|
|
976
|
+
detach,
|
|
977
|
+
done,
|
|
978
|
+
startedAt
|
|
979
|
+
};
|
|
980
|
+
};
|
|
981
|
+
const adoptJob = ({ controller, done, startedAt }, label, execution) => {
|
|
982
|
+
const id = crypto.randomUUID();
|
|
983
|
+
const job = {
|
|
984
|
+
id,
|
|
985
|
+
sessionId: execution.sessionId,
|
|
986
|
+
label,
|
|
987
|
+
startedAt,
|
|
988
|
+
controller,
|
|
989
|
+
status: "running",
|
|
990
|
+
done: Promise.resolve()
|
|
991
|
+
};
|
|
992
|
+
jobs.set(id, job);
|
|
993
|
+
job.done = (async () => {
|
|
994
|
+
try {
|
|
995
|
+
const result = await done;
|
|
996
|
+
if (ownerSignal.aborted) return;
|
|
997
|
+
job.status = "reporting";
|
|
998
|
+
onBackgroundChange?.();
|
|
999
|
+
const status = controller.signal.reason instanceof ExecDeadlineError ? "timed-out" : controller.signal.aborted ? "stopped" : result.isError ? "failed" : "completed";
|
|
1000
|
+
const message = {
|
|
1001
|
+
type: "po-codemode-finished",
|
|
1002
|
+
text: `Background exec ${id} ${status}.\n${result.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n")}`,
|
|
1003
|
+
display: true,
|
|
1004
|
+
details: {
|
|
1005
|
+
id,
|
|
1006
|
+
status,
|
|
1007
|
+
result
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
let warned = false;
|
|
1011
|
+
while (!ownerSignal.aborted) {
|
|
1012
|
+
let stopAdmission;
|
|
1013
|
+
try {
|
|
1014
|
+
const stopped = new Promise((resolve) => {
|
|
1015
|
+
stopAdmission = resolve;
|
|
1016
|
+
ownerSignal.addEventListener("abort", stopAdmission, { once: true });
|
|
1017
|
+
if (ownerSignal.aborted) resolve();
|
|
1018
|
+
});
|
|
1019
|
+
await Promise.race([execution.session.admitMessage(message, "steer", `po-codemode-finished:${execution.sessionId}:${id}`), stopped]);
|
|
1020
|
+
break;
|
|
1021
|
+
} catch (error) {
|
|
1022
|
+
if (ownerSignal.aborted) break;
|
|
1023
|
+
if (!warned) {
|
|
1024
|
+
warned = true;
|
|
1025
|
+
Promise.resolve().then(() => ownerSignal.aborted ? void 0 : execution.client.notify({
|
|
1026
|
+
body: `Background exec completion admission failed; retrying: ${String(error)}`,
|
|
1027
|
+
level: "warning"
|
|
1028
|
+
})).catch(() => void 0);
|
|
1029
|
+
}
|
|
1030
|
+
await sleep(250, ownerSignal).catch(() => void 0);
|
|
1031
|
+
} finally {
|
|
1032
|
+
if (stopAdmission) ownerSignal.removeEventListener("abort", stopAdmission);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
} finally {
|
|
1036
|
+
jobs.delete(id);
|
|
1037
|
+
onBackgroundChange?.();
|
|
1038
|
+
}
|
|
1039
|
+
})();
|
|
1040
|
+
onBackgroundChange?.();
|
|
1041
|
+
return {
|
|
1042
|
+
...text(JSON.stringify({ id })),
|
|
1043
|
+
details: { id }
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
903
1046
|
const exec = {
|
|
904
1047
|
name: "exec",
|
|
905
1048
|
label: "Exec",
|
|
@@ -908,6 +1051,7 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
908
1051
|
return [
|
|
909
1052
|
"Run a TypeScript script inside the Po server with live objects from the namespaces below in scope.",
|
|
910
1053
|
"It runs with full server trust, like bash. Keep each call to one logical step.",
|
|
1054
|
+
"After 30 seconds, an eligible main-agent run continues in the background and returns its ID. A completion message follows; do not poll.",
|
|
911
1055
|
(service ? visible(service) : []).map((namespace) => `- ${namespace.name}: ${namespace.summary}`).join("\n") || "(no namespaces registered yet; call discover to check)",
|
|
912
1056
|
GLOBALS_HELP,
|
|
913
1057
|
...scripts && service?.liveObjects ? [`${SCRIPTS_HELP} discover lists saved and domain scripts.`, ...domainScriptsHelp()] : [],
|
|
@@ -918,7 +1062,23 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
918
1062
|
promptSnippet: "Run a TypeScript script against live Po objects (browser and other namespaces)",
|
|
919
1063
|
executionMode: "serial",
|
|
920
1064
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
921
|
-
|
|
1065
|
+
const run = startCode(parameters, execution, toolCallId, false, signal, onUpdate);
|
|
1066
|
+
if (execution.caller !== "main" || !execution.session?.admitMessage || run.deadlineMs <= FOREGROUND_WAIT_MS) return run.done;
|
|
1067
|
+
const waiting = new AbortController();
|
|
1068
|
+
const waitSignal = AbortSignal.any([
|
|
1069
|
+
ownerSignal,
|
|
1070
|
+
run.controller.signal,
|
|
1071
|
+
waiting.signal
|
|
1072
|
+
]);
|
|
1073
|
+
try {
|
|
1074
|
+
const result = await Promise.race([run.done, sleep(FOREGROUND_WAIT_MS, waitSignal).catch(() => void 0)]);
|
|
1075
|
+
if (result !== void 0) return result;
|
|
1076
|
+
if (waitSignal.aborted) return run.done;
|
|
1077
|
+
run.detach();
|
|
1078
|
+
return adoptJob(run, scriptLabel(parameters.code), execution);
|
|
1079
|
+
} finally {
|
|
1080
|
+
waiting.abort();
|
|
1081
|
+
}
|
|
922
1082
|
}
|
|
923
1083
|
};
|
|
924
1084
|
const execBackground = {
|
|
@@ -934,77 +1094,8 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
934
1094
|
if (!isolate()) return text("Background exec requires a code-mode script runner.", true);
|
|
935
1095
|
if (!execution.session?.admitMessage) return text("This session cannot admit background exec completion messages.", true);
|
|
936
1096
|
if (running >= MAX_CONCURRENT_RUNS) return text(`This session already has ${MAX_CONCURRENT_RUNS} exec runs active. Wait for one to finish.`, true);
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
const controller = new AbortController();
|
|
940
|
-
const job = {
|
|
941
|
-
id,
|
|
942
|
-
sessionId: execution.sessionId,
|
|
943
|
-
label: scriptLabel(parameters.code),
|
|
944
|
-
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
945
|
-
controller,
|
|
946
|
-
status: "running",
|
|
947
|
-
done: Promise.resolve()
|
|
948
|
-
};
|
|
949
|
-
jobs.set(id, job);
|
|
950
|
-
onBackgroundChange?.();
|
|
951
|
-
job.done = (async () => {
|
|
952
|
-
let timedOut = false;
|
|
953
|
-
const timer = setTimeout(() => {
|
|
954
|
-
timedOut = true;
|
|
955
|
-
controller.abort();
|
|
956
|
-
}, deadlineMs);
|
|
957
|
-
try {
|
|
958
|
-
const result = await executeCode(parameters, controller.signal, execution, deadlineMs, toolCallId, true);
|
|
959
|
-
clearTimeout(timer);
|
|
960
|
-
job.status = "reporting";
|
|
961
|
-
onBackgroundChange?.();
|
|
962
|
-
const status = timedOut ? "timed-out" : controller.signal.aborted ? "stopped" : result.isError ? "failed" : "completed";
|
|
963
|
-
const message = {
|
|
964
|
-
type: "po-codemode-finished",
|
|
965
|
-
text: `Background exec ${id} ${status}.\n${result.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n")}`,
|
|
966
|
-
display: true,
|
|
967
|
-
details: {
|
|
968
|
-
id,
|
|
969
|
-
status,
|
|
970
|
-
result
|
|
971
|
-
}
|
|
972
|
-
};
|
|
973
|
-
let warned = false;
|
|
974
|
-
while (!ownerSignal.aborted) {
|
|
975
|
-
let stopAdmission;
|
|
976
|
-
try {
|
|
977
|
-
const stopped = new Promise((resolve) => {
|
|
978
|
-
stopAdmission = resolve;
|
|
979
|
-
ownerSignal.addEventListener("abort", stopAdmission, { once: true });
|
|
980
|
-
if (ownerSignal.aborted) resolve();
|
|
981
|
-
});
|
|
982
|
-
await Promise.race([execution.session.admitMessage(message, "steer", `po-codemode-finished:${execution.sessionId}:${id}`), stopped]);
|
|
983
|
-
break;
|
|
984
|
-
} catch (error) {
|
|
985
|
-
if (ownerSignal.aborted) break;
|
|
986
|
-
if (!warned) {
|
|
987
|
-
warned = true;
|
|
988
|
-
await Promise.resolve().then(() => execution.client.notify({
|
|
989
|
-
body: `Background exec completion admission failed; retrying: ${String(error)}`,
|
|
990
|
-
level: "warning"
|
|
991
|
-
})).catch(() => void 0);
|
|
992
|
-
}
|
|
993
|
-
await sleep(250, ownerSignal).catch(() => void 0);
|
|
994
|
-
} finally {
|
|
995
|
-
if (stopAdmission) ownerSignal.removeEventListener("abort", stopAdmission);
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
} finally {
|
|
999
|
-
clearTimeout(timer);
|
|
1000
|
-
jobs.delete(id);
|
|
1001
|
-
onBackgroundChange?.();
|
|
1002
|
-
}
|
|
1003
|
-
})();
|
|
1004
|
-
return {
|
|
1005
|
-
...text(JSON.stringify({ id })),
|
|
1006
|
-
details: { id }
|
|
1007
|
-
};
|
|
1097
|
+
const run = startCode(parameters, execution, toolCallId, true);
|
|
1098
|
+
return adoptJob(run, scriptLabel(parameters.code), execution);
|
|
1008
1099
|
}
|
|
1009
1100
|
};
|
|
1010
1101
|
/** One cancel for the agent's `exec_cancel` and the page's stop control; only the owning session may stop a job. */
|
|
@@ -1104,17 +1195,25 @@ function createCodemodeTools({ registry, isolate, scripts, npm, fs, signal: life
|
|
|
1104
1195
|
closing = true;
|
|
1105
1196
|
unsubscribe();
|
|
1106
1197
|
lifecycle.abort();
|
|
1107
|
-
await Promise.
|
|
1198
|
+
const results = await Promise.allSettled([...activeRuns, ...[...jobs.values()].map((job) => job.done)]);
|
|
1199
|
+
const errors = [...shutdownErrors.splice(0), ...results.flatMap((result) => result.status === "rejected" ? [result.reason] : [])];
|
|
1200
|
+
if (errors.length > 0) throw new AggregateError(errors, `Code mode shutdown failed: ${errors.map(String).join("; ")}`);
|
|
1108
1201
|
}
|
|
1109
1202
|
};
|
|
1110
1203
|
}
|
|
1111
1204
|
//#endregion
|
|
1112
1205
|
//#region ../../default/po-codemode/src/schemas/packageConfig.ts
|
|
1113
1206
|
const CODEMODE_PACKAGE = "@agimon-ai/po-codemode";
|
|
1114
|
-
const CodemodePackageConfigSchema = _Object_({
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1207
|
+
const CodemodePackageConfigSchema = _Object_({
|
|
1208
|
+
llmModel: Optional(String$1({
|
|
1209
|
+
pattern: "^[^/\\s]+/\\S+$",
|
|
1210
|
+
maxLength: 256
|
|
1211
|
+
})),
|
|
1212
|
+
deniedImports: Optional(_Array_(String$1({
|
|
1213
|
+
pattern: "^node:(?!(?:fs|fs/promises|path)$)[a-z][a-z0-9_]*(?:/[a-z0-9_.-]+)*$",
|
|
1214
|
+
maxLength: 128
|
|
1215
|
+
}), { maxItems: 200 }))
|
|
1216
|
+
}, { additionalProperties: false });
|
|
1118
1217
|
//#endregion
|
|
1119
1218
|
//#region ../../default/po-codemode/src/services/llmConfig/index.ts
|
|
1120
1219
|
const PO_CODEMODE_LLM_CONFIG_SERVICE = "po/codemode-llm-config";
|
|
@@ -1154,7 +1253,7 @@ var LlmConfigService = class {
|
|
|
1154
1253
|
const configurations = await readPackageConfigurations(fs, modes, [...snapshot.harness.layers], CODEMODE_PACKAGE, BACKGROUND_CONTEXT);
|
|
1155
1254
|
let merged = {};
|
|
1156
1255
|
for (const entry of configurations) {
|
|
1157
|
-
if (!Check(CodemodePackageConfigSchema, entry.config)) throw new TypeError("Invalid code mode package configuration: llmModel must be provider/modelId.");
|
|
1256
|
+
if (!Check(CodemodePackageConfigSchema, entry.config)) throw new TypeError("Invalid code mode package configuration: llmModel must be provider/modelId and deniedImports must be valid node: specifiers.");
|
|
1158
1257
|
merged = {
|
|
1159
1258
|
...merged,
|
|
1160
1259
|
...entry.config
|
|
@@ -1516,6 +1615,7 @@ function createShellNamespace(options) {
|
|
|
1516
1615
|
let ok = false;
|
|
1517
1616
|
let failure;
|
|
1518
1617
|
try {
|
|
1618
|
+
if (options.bashActive?.() !== true) throw new Error("shell.bash needs the bash tool in this session.");
|
|
1519
1619
|
const result = await shell.exec(params.command, {
|
|
1520
1620
|
cwd: options.context.cwd,
|
|
1521
1621
|
env: Object.fromEntries(Object.entries(options.context.environment).filter((entry) => entry[1] !== void 0)),
|
|
@@ -1574,6 +1674,13 @@ function createCodemodeSession({ context, agent, host, signal }) {
|
|
|
1574
1674
|
temporaryDirectory: () => temporaryDirectory
|
|
1575
1675
|
});
|
|
1576
1676
|
const execution = agent?.context;
|
|
1677
|
+
const bashActive = () => {
|
|
1678
|
+
try {
|
|
1679
|
+
return readPoHeadlessHost(context)?.toolSurface?.readSurface().tools.some((tool) => tool.name === "bash") === true;
|
|
1680
|
+
} catch {
|
|
1681
|
+
return false;
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1577
1684
|
const config = execution ? new LlmConfigService({
|
|
1578
1685
|
fs: () => readPoFs(context),
|
|
1579
1686
|
environment: execution.environment,
|
|
@@ -1591,7 +1698,8 @@ function createCodemodeSession({ context, agent, host, signal }) {
|
|
|
1591
1698
|
}));
|
|
1592
1699
|
const shellRegistration = registry.register("@agimon-ai/po-codemode", createShellNamespace({
|
|
1593
1700
|
context: execution,
|
|
1594
|
-
shell: () => context.get(PO_SHELL_SERVICE)
|
|
1701
|
+
shell: () => context.get(PO_SHELL_SERVICE),
|
|
1702
|
+
bashActive
|
|
1595
1703
|
}));
|
|
1596
1704
|
disposeNamespaces = () => {
|
|
1597
1705
|
registration.dispose();
|
|
@@ -1616,6 +1724,8 @@ function createCodemodeSession({ context, agent, host, signal }) {
|
|
|
1616
1724
|
registry,
|
|
1617
1725
|
isolate: () => readPoIsolate(context),
|
|
1618
1726
|
npm: () => readPoNpm(context),
|
|
1727
|
+
bashActive,
|
|
1728
|
+
deniedImports: async () => (await config?.current())?.deniedImports ?? [],
|
|
1619
1729
|
fs: () => readPoFs(context),
|
|
1620
1730
|
scripts,
|
|
1621
1731
|
signal,
|
|
@@ -1643,8 +1753,11 @@ function createCodemodeSession({ context, agent, host, signal }) {
|
|
|
1643
1753
|
if (config) scoped.provide(PO_CODEMODE_LLM_CONFIG_SERVICE, config);
|
|
1644
1754
|
}],
|
|
1645
1755
|
onDispose: async () => {
|
|
1646
|
-
|
|
1647
|
-
|
|
1756
|
+
try {
|
|
1757
|
+
await tools.dispose();
|
|
1758
|
+
} finally {
|
|
1759
|
+
disposeNamespaces?.();
|
|
1760
|
+
}
|
|
1648
1761
|
}
|
|
1649
1762
|
};
|
|
1650
1763
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dt as defineServerMethod, Et as composeServerProviderOverrides, Gt as Record, It as readPoFs, Jt as String$1, Yt as Number$1, Zt as Literal, _t as BACKGROUND_CONTEXT, an as _Array_, h as getOrThrow, in as Optional, ln as requirePoServerScope, nn as Unknown, on as PO_SERVER_SCOPE_SERVICE, qt as Union, rn as _Object_, sn as defineServiceContract, t as defineServerPlugin } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import { d as readBoundedFile, l as FileTooLargeError, n as RootBoundReplaceError, r as replaceRootBoundFile } from "./platform-CQahdzpG.js";
|
|
3
3
|
import { n as defineTool, t as defineCommand } from "./pluginContributions-Be9EnCAW.js";
|
|
4
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
4
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-By7eSfpp.js";
|
|
5
5
|
import { f as validateArtifactRead, l as ArtifactAccessError, u as artifactRoot } from "./index.edge-CzoLWbyl.js";
|
|
6
6
|
import "./artifactFiles-5KwXIxYf.js";
|
|
7
7
|
import { i as definePoPluginMethod } from "./pluginProtocol-DVIfJnav.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Et as composeServerProviderOverrides, _t as BACKGROUND_CONTEXT, h as getOrThrow, jt as PO_FS_SERVICE, n as runCleanups, sn as defineServiceContract, t as defineServerPlugin, u as fileMutationRunner, zt as requirePoFs } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import { d as readBoundedFile, h as writeFileAtomic, l as FileTooLargeError } from "./platform-CQahdzpG.js";
|
|
3
|
-
import { n as readPackageResource } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource } from "./index.edge-By7eSfpp.js";
|
|
4
4
|
import { c as defineRoot, n as composeRootInjects, t as composeRootHooks, u as defineRoutedContribution } from "./extensionFile-B940JOEn.js";
|
|
5
5
|
import { a as PO_BACKGROUND_WORK_SERVICE, i as PO_BACKGROUND_WORK_CHANGED_EVENT, l as readPoBackgroundWorkService, o as awaitsCompletion } from "./backgroundWork-Bv0ib_lY.js";
|
|
6
6
|
import { t as defineMode } from "./modeDefinition-Di95_IiU.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $t as Boolean$1, Dt as defineServerMethod, Et as composeServerProviderOverrides, Jt as String$1, Nt as PO_SQLITE_SERVICE, Qt as Integer, V as Check, Vt as requirePoSqlite, Xt as Null, Zt as Literal, _t as BACKGROUND_CONTEXT, an as _Array_, c as poHomeDirectory, en as Intersect, in as Optional, jt as PO_FS_SERVICE, ln as requirePoServerScope, on as PO_SERVER_SCOPE_SERVICE, qt as Union, rn as _Object_, sn as defineServiceContract, t as defineServerPlugin, zt as requirePoFs } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import "./platform-CQahdzpG.js";
|
|
3
|
-
import { n as APPROVAL_ROOT_SERVICE, r as ApprovalRequestError, t as createApprovalSession$1 } from "./approvalSession-
|
|
3
|
+
import { n as APPROVAL_ROOT_SERVICE, r as ApprovalRequestError, t as createApprovalSession$1 } from "./approvalSession-DPQQRkG4.js";
|
|
4
4
|
import "./piSettings-ekBG5OeF.js";
|
|
5
5
|
import { l as jsonApiResponses, u as defineApiContract } from "./apiContracts-DaOpUHnu.js";
|
|
6
6
|
import { i as definePoPluginMethod } from "./pluginProtocol-DVIfJnav.js";
|
|
@@ -8,7 +8,7 @@ import { c as defineRoot, f as defineServerTool, l as defineRoute, n as composeR
|
|
|
8
8
|
import { i as PoApprovalPromptSchema, n as PO_APPROVAL_VOICE_EVENT, t as PO_APPROVAL_TEXT_LIMITS } from "./approvalPrompt-w2k884MA.js";
|
|
9
9
|
import "./hubChannel-Dldv3EEb.js";
|
|
10
10
|
import "./pluginProtocol-7_gVUeM9.js";
|
|
11
|
-
import { a as PO_APPROVAL_CONTRACT } from "./approval-
|
|
11
|
+
import { a as PO_APPROVAL_CONTRACT } from "./approval-DRipNxVh.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
//#region ../../foundations/po-approval/src/services/approvalRoot/index.ts
|
|
14
14
|
/** Outcomes the agent hears about once; withdrawn requests are its own doing and stay quiet. */
|
|
@@ -200,11 +200,13 @@ function createApprovalRoot(options) {
|
|
|
200
200
|
};
|
|
201
201
|
},
|
|
202
202
|
drain,
|
|
203
|
-
async decide(id, revision, decision, rawFeedback) {
|
|
203
|
+
async decide(id, revision, decision, rawFeedback, context) {
|
|
204
204
|
const feedback = rawFeedback?.trim() || void 0;
|
|
205
205
|
if (feedback !== void 0 && decision === "approve") throw new ApprovalRequestError("Feedback can only come with a denial.");
|
|
206
206
|
if (feedback !== void 0 && feedback.length > PO_APPROVAL_TEXT_LIMITS.feedback) throw new ApprovalRequestError(`Feedback is too long. Keep it under ${PO_APPROVAL_TEXT_LIMITS.feedback} characters.`);
|
|
207
|
-
|
|
207
|
+
const record = await store.get(id);
|
|
208
|
+
if (record === void 0) throw new ApprovalRequestError("This approval is no longer here.", 404);
|
|
209
|
+
if (record.description.ownerOnly === true && context?.hostOwner !== true) throw new ApprovalRequestError("Only the owner of this host can decide this approval.");
|
|
208
210
|
const now = Date.now();
|
|
209
211
|
const next = await store.update(id, ["pending"], decision === "approve" ? {
|
|
210
212
|
state: "approved",
|
|
@@ -662,7 +664,7 @@ async function answer$1(root, sessionId, id, work) {
|
|
|
662
664
|
}
|
|
663
665
|
}
|
|
664
666
|
function createApprovalGlobalDecideMethod(root) {
|
|
665
|
-
return defineServerMethod(approvalGlobalDecideMethod, ({ sessionId, id, revision, decision, feedback }) => answer$1(root, sessionId, id, (queue) => queue.decide(id, revision, decision, feedback)));
|
|
667
|
+
return defineServerMethod(approvalGlobalDecideMethod, ({ sessionId, id, revision, decision, feedback }) => answer$1(root, sessionId, id, (queue) => queue.decide(id, revision, decision, feedback, { hostOwner: true })));
|
|
666
668
|
}
|
|
667
669
|
function createApprovalGlobalDismissMethod(root) {
|
|
668
670
|
return defineServerMethod(approvalGlobalDismissMethod, ({ sessionId, id, revision }) => answer$1(root, sessionId, id, (queue) => queue.dismiss(id, revision)));
|
|
@@ -816,12 +818,12 @@ async function answer(work) {
|
|
|
816
818
|
}
|
|
817
819
|
}
|
|
818
820
|
function createApprovalDecideMethod(root) {
|
|
819
|
-
return defineServerMethod(approvalDecideMethod, ({ id, revision, decision, feedback }) => {
|
|
821
|
+
return defineServerMethod(approvalDecideMethod, ({ id, revision, decision, feedback }, caller) => {
|
|
820
822
|
const session = root.current();
|
|
821
823
|
return session === void 0 ? {
|
|
822
824
|
ok: false,
|
|
823
825
|
message: UNAVAILABLE
|
|
824
|
-
} : answer(() => session.decide(id, revision, decision, feedback));
|
|
826
|
+
} : answer(() => session.decide(id, revision, decision, feedback, { hostOwner: caller.hostOwner === true }));
|
|
825
827
|
});
|
|
826
828
|
}
|
|
827
829
|
function createApprovalDismissMethod(root) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $t as Boolean$1, Et as composeServerProviderOverrides, Jt as String$1, Ot as HOST_SLOT_METADATA, V as Check, Xt as Null, Zt as Literal, an as _Array_, in as Optional, ln as requirePoServerScope, on as PO_SERVER_SCOPE_SERVICE, qt as Union, rn as _Object_, sn as defineServiceContract, t as defineServerPlugin } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import { n as defineTool } from "./pluginContributions-Be9EnCAW.js";
|
|
3
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-By7eSfpp.js";
|
|
4
4
|
import { l as jsonApiResponses, u as defineApiContract } from "./apiContracts-DaOpUHnu.js";
|
|
5
5
|
import { c as defineRoot, l as defineRoute, n as composeRootInjects, t as composeRootHooks, u as defineRoutedContribution } from "./extensionFile-B940JOEn.js";
|
|
6
6
|
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-LpcMFMYM.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Et as composeServerProviderOverrides, Ht as PO_CONFIG_SERVICE, Jt as String$1, Nt as PO_SQLITE_SERVICE, V as Check, Vt as requirePoSqlite, Xt as Null, Zt as Literal, _t as BACKGROUND_CONTEXT, an as _Array_, c as poHomeDirectory, d as nodeHost, h as getOrThrow, in as Optional, it as PoHeadlessPromptAdmissionError, jt as PO_FS_SERVICE, l as createSerialRunner, ln as requirePoServerScope, n as runCleanups, on as PO_SERVER_SCOPE_SERVICE, qt as Union, rn as _Object_, sn as defineServiceContract, st as PoSessionSetupError, t as defineServerPlugin, ut as isPoHeadlessPromptAdmissionError, zt as requirePoFs } from "./serverPlugin-4nI5J6Zt.js";
|
|
2
2
|
import { h as writeFileAtomic, m as removePath, u as pathExists } from "./platform-CQahdzpG.js";
|
|
3
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-By7eSfpp.js";
|
|
4
4
|
import "./piSettings-ekBG5OeF.js";
|
|
5
5
|
import { l as jsonApiResponses, u as defineApiContract } from "./apiContracts-DaOpUHnu.js";
|
|
6
6
|
import { a as PO_WORKFLOW_PROFILE_ADMISSION_SERVICE, p as readPoWorkflowContextService } from "./workflow-DTCt4n6k.js";
|