@agimon-ai/po-runner 0.0.0-alpha.21 → 0.0.0-alpha.210
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/LICENSE +21 -149
- package/README.md +34 -206
- package/dist/apiContracts.cjs +45 -2
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +2 -2
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +45 -2
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/{bashResult-BqDa7sbC.mjs → bashResult-BLCLerXE.mjs} +57 -7
- package/dist/bashResult-BLCLerXE.mjs.map +1 -0
- package/dist/{bashResult-C2iKhHpD.cjs → bashResult-CZYiyl4p.cjs} +74 -6
- package/dist/bashResult-CZYiyl4p.cjs.map +1 -0
- package/dist/{bashResult-DcrRaBLv.d.mts → bashResult-CgVS_JpL.d.mts} +8 -3
- package/dist/{bashResult-DcrRaBLv.d.mts.map → bashResult-CgVS_JpL.d.mts.map} +1 -1
- package/dist/{bashRunService-DjOH5kye.cjs → bashRunService-DmuA1mKL.cjs} +52 -31
- package/dist/bashRunService-DmuA1mKL.cjs.map +1 -0
- package/dist/{bashRunService-Ci0cGdYO.d.mts → bashRunService-Iotfc_nV.d.mts} +21 -2
- package/dist/bashRunService-Iotfc_nV.d.mts.map +1 -0
- package/dist/{bashRunService-Cl3pYccr.mjs → bashRunService-Luy2hPMS.mjs} +52 -31
- package/dist/bashRunService-Luy2hPMS.mjs.map +1 -0
- package/dist/bashRunService.cjs +1 -1
- package/dist/bashRunService.d.mts +4 -4
- package/dist/bashRunService.d.mts.map +1 -1
- package/dist/bashRunService.mjs +1 -1
- package/dist/bashSchema.cjs +1 -1
- package/dist/bashSchema.d.mts +1 -1
- package/dist/bashSchema.mjs +1 -1
- package/dist/bashTool-D2ECDAhc.cjs +43 -0
- package/dist/bashTool-D2ECDAhc.cjs.map +1 -0
- package/dist/{bashTool-B1EwZLo_.d.mts → bashTool-Dc1ld2E3.d.mts} +3 -9
- package/dist/bashTool-Dc1ld2E3.d.mts.map +1 -0
- package/dist/bashTool-vg8uhbkj.mjs +26 -0
- package/dist/bashTool-vg8uhbkj.mjs.map +1 -0
- package/dist/bashTool.cjs +3 -3
- package/dist/bashTool.cjs.map +1 -1
- package/dist/bashTool.d.mts +4 -4
- package/dist/bashTool.d.mts.map +1 -1
- package/dist/bashTool.mjs +3 -3
- package/dist/bashTool.mjs.map +1 -1
- package/dist/bin/cli.cjs +372 -9
- package/dist/bin/cli.cjs.map +1 -1
- package/dist/bin/cli.d.mts.map +1 -1
- package/dist/bin/cli.mjs +369 -8
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/bin/logSink.cjs +27 -24
- package/dist/bin/logSink.cjs.map +1 -1
- package/dist/bin/logSink.mjs +24 -21
- package/dist/bin/logSink.mjs.map +1 -1
- package/dist/bin/runnerHost.cjs +141 -53
- package/dist/bin/runnerHost.cjs.map +1 -1
- package/dist/bin/runnerHost.d.mts.map +1 -1
- package/dist/bin/runnerHost.mjs +141 -53
- package/dist/bin/runnerHost.mjs.map +1 -1
- package/dist/cliApp-7iTUx5KZ.cjs +351 -0
- package/dist/cliApp-7iTUx5KZ.cjs.map +1 -0
- package/dist/cliApp-S4iEO-fi.mjs +338 -0
- package/dist/cliApp-S4iEO-fi.mjs.map +1 -0
- package/dist/cliApp.cjs +2 -1
- package/dist/cliApp.d.mts +9 -4
- package/dist/cliApp.d.mts.map +1 -1
- package/dist/cliApp.mjs +1 -1
- package/dist/compaction.d.mts +1 -1
- package/dist/extensions/mcp-ui.mjs +7 -6
- package/dist/extensions/mcp-ui.mjs.map +1 -1
- package/dist/extensions/mcp.cjs +37 -17
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.d.mts.map +1 -1
- package/dist/extensions/mcp.mjs +37 -17
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs +1225 -374
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +900 -221
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +908 -227
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +924 -766
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/headless-CMj9hunm.cjs +237 -0
- package/dist/headless-CMj9hunm.cjs.map +1 -0
- package/dist/headless-CUJt5Ihx.mjs +226 -0
- package/dist/headless-CUJt5Ihx.mjs.map +1 -0
- package/dist/{index-DM7yJpMs.d.mts → index-7_nuKoVm.d.mts} +6 -6
- package/dist/index-7_nuKoVm.d.mts.map +1 -0
- package/dist/index-BCCF1sGD.d.mts.map +1 -1
- package/dist/{index-CzCF_OP9.d.mts → index-CH-z0BX3.d.mts} +11 -4
- package/dist/index-CH-z0BX3.d.mts.map +1 -0
- package/dist/{index-C-IC35d9.d.mts → index-CJNsR-Ir.d.mts} +10 -7
- package/dist/index-CJNsR-Ir.d.mts.map +1 -0
- package/dist/{index--xF7DvsE.d.mts → index-CNCb1usM.d.mts} +8 -2
- package/dist/index-CNCb1usM.d.mts.map +1 -0
- package/dist/index-EMbmq9gu.d.mts +45 -0
- package/dist/index-EMbmq9gu.d.mts.map +1 -0
- package/dist/index-QlfncPRs.d.mts +58 -0
- package/dist/index-QlfncPRs.d.mts.map +1 -0
- package/dist/index-qSi4-EJW.d.mts +49 -0
- package/dist/index-qSi4-EJW.d.mts.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/launch.cjs +4 -0
- package/dist/launch.d.mts +55 -0
- package/dist/launch.d.mts.map +1 -0
- package/dist/launch.mjs +1 -0
- package/dist/{launcher-CCYsFBM9.mjs → launcher-3xMxw72I.mjs} +45 -31
- package/dist/launcher-3xMxw72I.mjs.map +1 -0
- package/dist/{launcher-BG5t9nvG.d.mts → launcher-CDDBTvZq.d.mts} +4 -3
- package/dist/launcher-CDDBTvZq.d.mts.map +1 -0
- package/dist/{launcher-ZgDdyXpq.cjs → launcher-D7qAhSRL.cjs} +47 -33
- package/dist/launcher-D7qAhSRL.cjs.map +1 -0
- package/dist/launcher.cjs +1 -1
- package/dist/launcher.d.mts +5 -5
- package/dist/launcher.d.mts.map +1 -1
- package/dist/launcher.mjs +1 -1
- package/dist/lifeline-26IaW5w7.d.mts +34 -0
- package/dist/lifeline-26IaW5w7.d.mts.map +1 -0
- package/dist/lifeline-B4cjtrBe.cjs +27 -0
- package/dist/lifeline-B4cjtrBe.cjs.map +1 -0
- package/dist/lifeline-C1v2ItCY.mjs +214 -0
- package/dist/lifeline-C1v2ItCY.mjs.map +1 -0
- package/dist/lifeline-D4_ZRAhO.cjs +229 -0
- package/dist/lifeline-D4_ZRAhO.cjs.map +1 -0
- package/dist/lifeline-nPh3cx5A.mjs +10 -0
- package/dist/lifeline-nPh3cx5A.mjs.map +1 -0
- package/dist/lifeline.cjs +4 -1
- package/dist/lifeline.d.mts +4 -21
- package/dist/lifeline.mjs +3 -3
- package/dist/logFile-B9FSwmE0.cjs +44 -0
- package/dist/logFile-B9FSwmE0.cjs.map +1 -0
- package/dist/{logFile-C7oQ_v-g.d.mts → logFile-BirfZtS1.d.mts} +4 -4
- package/dist/logFile-BirfZtS1.d.mts.map +1 -0
- package/dist/logFile-D1EOKqmL.mjs +39 -0
- package/dist/logFile-D1EOKqmL.mjs.map +1 -0
- package/dist/logFile.cjs +1 -1
- package/dist/logFile.d.mts +3 -3
- package/dist/logFile.d.mts.map +1 -1
- package/dist/logFile.mjs +1 -1
- package/dist/{logReader-mq9uVurh.mjs → logReader-BYKii_s_.mjs} +99 -52
- package/dist/logReader-BYKii_s_.mjs.map +1 -0
- package/dist/{logReader-MdW9ffvV.d.mts → logReader-Bn3WEdjg.d.mts} +4 -2
- package/dist/{logReader-MdW9ffvV.d.mts.map → logReader-Bn3WEdjg.d.mts.map} +1 -1
- package/dist/{logReader-DHCK2BEr.cjs → logReader-DpMjBqfn.cjs} +101 -54
- package/dist/logReader-DpMjBqfn.cjs.map +1 -0
- package/dist/logReader.cjs +1 -1
- package/dist/logReader.d.mts +2 -2
- package/dist/logReader.mjs +1 -1
- package/dist/po-runtime-identity.json +1 -0
- package/dist/{ptyHost-D35hNmtd.cjs → ptyHost-C-oWV455.cjs} +20 -14
- package/dist/ptyHost-C-oWV455.cjs.map +1 -0
- package/dist/{ptyHost-CwbLLr90.mjs → ptyHost-C2zu-ZfO.mjs} +19 -13
- package/dist/ptyHost-C2zu-ZfO.mjs.map +1 -0
- package/dist/{ptyHost-DWWtRrGn.d.mts → ptyHost-C_6x2xuJ.d.mts} +2 -2
- package/dist/{ptyHost-DWWtRrGn.d.mts.map → ptyHost-C_6x2xuJ.d.mts.map} +1 -1
- package/dist/ptyHost.cjs +1 -1
- package/dist/ptyHost.d.mts +2 -2
- package/dist/ptyHost.d.mts.map +1 -1
- package/dist/ptyHost.mjs +1 -1
- package/dist/{reconcile-wNYQJZF-.mjs → reconcile-DUaX_vKZ.mjs} +2 -2
- package/dist/reconcile-DUaX_vKZ.mjs.map +1 -0
- package/dist/{reconcile-5cZ11jSD.cjs → reconcile-DjF9T1hN.cjs} +2 -2
- package/dist/reconcile-DjF9T1hN.cjs.map +1 -0
- package/dist/reconcile.cjs +1 -1
- package/dist/reconcile.d.mts +3 -3
- package/dist/reconcile.mjs +1 -1
- package/dist/responseEnvelope.cjs +5 -2
- package/dist/responseEnvelope.d.mts +15 -6
- package/dist/responseEnvelope.d.mts.map +1 -1
- package/dist/responseEnvelope.mjs +3 -3
- package/dist/{rmuxBackend-Dh0CYVAL.cjs → rmuxBackend-9tHTx1vf.cjs} +82 -48
- package/dist/rmuxBackend-9tHTx1vf.cjs.map +1 -0
- package/dist/{rmuxBackend-rjrVTG6K.mjs → rmuxBackend-BaK-R35I.mjs} +79 -45
- package/dist/rmuxBackend-BaK-R35I.mjs.map +1 -0
- package/dist/{rmuxBackend-CaEWooWn.d.mts → rmuxBackend-xFzlANM9.d.mts} +4 -4
- package/dist/rmuxBackend-xFzlANM9.d.mts.map +1 -0
- package/dist/rmuxBackend.cjs +1 -1
- package/dist/rmuxBackend.d.mts +2 -2
- package/dist/rmuxBackend.mjs +1 -1
- package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
- package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -0
- package/dist/{rtkProcessor-Iw9gP5Xp.mjs → rtkProcessor-DOXcp51z.mjs} +6 -5
- package/dist/rtkProcessor-DOXcp51z.mjs.map +1 -0
- package/dist/{rtkProcessor-DSGbM-Cm.cjs → rtkProcessor-J2gLQvM4.cjs} +8 -6
- package/dist/rtkProcessor-J2gLQvM4.cjs.map +1 -0
- package/dist/rtkProcessor.cjs +1 -1
- package/dist/rtkProcessor.mjs +1 -1
- package/dist/{runnerDependencies-DSun3xO-.cjs → runnerDependencies-CABYjW7H.cjs} +97 -64
- package/dist/runnerDependencies-CABYjW7H.cjs.map +1 -0
- package/dist/{runnerDependencies-7h_cxOva.mjs → runnerDependencies-DmvIcpZi.mjs} +95 -62
- package/dist/runnerDependencies-DmvIcpZi.mjs.map +1 -0
- package/dist/runnerDependencies.cjs +1 -1
- package/dist/runnerDependencies.d.mts +1 -1
- package/dist/runnerDependencies.mjs +1 -1
- package/dist/runnerHost-BvNYPMeh.mjs +165 -0
- package/dist/runnerHost-BvNYPMeh.mjs.map +1 -0
- package/dist/runnerHost-C2F5oxzn.cjs +184 -0
- package/dist/runnerHost-C2F5oxzn.cjs.map +1 -0
- package/dist/runnerLaunch-BAf7hXMr.cjs +192 -0
- package/dist/runnerLaunch-BAf7hXMr.cjs.map +1 -0
- package/dist/runnerLaunch-Bimgdh4h.mjs +175 -0
- package/dist/runnerLaunch-Bimgdh4h.mjs.map +1 -0
- package/dist/runnerNamer.d.mts +1 -1
- package/dist/{runnerPaths-B41rMOY6.cjs → runnerPaths-CSkswyjR.cjs} +97 -179
- package/dist/runnerPaths-CSkswyjR.cjs.map +1 -0
- package/dist/{runnerPaths-Dibbvyx_.mjs → runnerPaths-D3P7_EhW.mjs} +91 -179
- package/dist/runnerPaths-D3P7_EhW.mjs.map +1 -0
- package/dist/runnerPaths.cjs +1 -1
- package/dist/runnerPaths.d.mts +7 -9
- package/dist/runnerPaths.d.mts.map +1 -1
- package/dist/runnerPaths.mjs +1 -1
- package/dist/{runnerRegistry-dQYlMSpQ.cjs → runnerRegistry-B8K1L3lq.cjs} +68 -45
- package/dist/runnerRegistry-B8K1L3lq.cjs.map +1 -0
- package/dist/{runnerRegistry-V-Ocaf4N.d.mts → runnerRegistry-BlZhS9yL.d.mts} +2 -2
- package/dist/{runnerRegistry-V-Ocaf4N.d.mts.map → runnerRegistry-BlZhS9yL.d.mts.map} +1 -1
- package/dist/{runnerRegistry-BgaR5O86.mjs → runnerRegistry-Dqca6SD3.mjs} +53 -29
- package/dist/runnerRegistry-Dqca6SD3.mjs.map +1 -0
- package/dist/runnerRegistry-NW6oAJ71.cjs +60 -0
- package/dist/runnerRegistry-NW6oAJ71.cjs.map +1 -0
- package/dist/runnerRegistry-l0C_55oO.mjs +13 -0
- package/dist/runnerRegistry-l0C_55oO.mjs.map +1 -0
- package/dist/runnerRegistry.cjs +1 -1
- package/dist/runnerRegistry.d.mts +2 -2
- package/dist/runnerRegistry.mjs +1 -1
- package/dist/runnerSequence-ZTYgZ_2W.cjs +32 -0
- package/dist/runnerSequence-ZTYgZ_2W.cjs.map +1 -0
- package/dist/runnerSequence-k-_Fd77y.mjs +9 -0
- package/dist/runnerSequence-k-_Fd77y.mjs.map +1 -0
- package/dist/runnerSequenceStore-CaY7S_Sd.mjs +76 -0
- package/dist/runnerSequenceStore-CaY7S_Sd.mjs.map +1 -0
- package/dist/runnerSequenceStore-Ck6M-8r_.cjs +89 -0
- package/dist/runnerSequenceStore-Ck6M-8r_.cjs.map +1 -0
- package/dist/services/lifeline/client.cjs +88 -4
- package/dist/services/lifeline/client.cjs.map +1 -1
- package/dist/services/lifeline/client.d.mts +16 -0
- package/dist/services/lifeline/client.d.mts.map +1 -1
- package/dist/services/lifeline/client.mjs +83 -2
- package/dist/services/lifeline/client.mjs.map +1 -1
- package/dist/services/runnerSupervisor/index.cjs +36 -22
- package/dist/services/runnerSupervisor/index.cjs.map +1 -1
- package/dist/services/runnerSupervisor/index.d.mts +7 -5
- package/dist/services/runnerSupervisor/index.d.mts.map +1 -1
- package/dist/services/runnerSupervisor/index.mjs +35 -21
- package/dist/services/runnerSupervisor/index.mjs.map +1 -1
- package/dist/session-CdVeSD7F.mjs +8 -0
- package/dist/session-CdVeSD7F.mjs.map +1 -0
- package/dist/session-DnUj8Q71.cjs +25 -0
- package/dist/session-DnUj8Q71.cjs.map +1 -0
- package/dist/session-ISEGK4z9.mjs +26 -0
- package/dist/session-ISEGK4z9.mjs.map +1 -0
- package/dist/session-PQd3azWf.cjs +43 -0
- package/dist/session-PQd3azWf.cjs.map +1 -0
- package/dist/session.cjs +4 -3
- package/dist/session.d.mts +3 -1
- package/dist/session.d.mts.map +1 -1
- package/dist/session.mjs +3 -3
- package/dist/{type-DwMZoINK.d.mts → type-BWY9vvSq.d.mts} +6 -4
- package/dist/type-BWY9vvSq.d.mts.map +1 -0
- package/dist/{type-Do0YxwVQ.d.mts → type-bZgYQ7hv.d.mts} +11 -11
- package/dist/{type-Do0YxwVQ.d.mts.map → type-bZgYQ7hv.d.mts.map} +1 -1
- package/dist/types.d.mts +1 -1
- package/llms.txt +2 -1
- package/locales/vi.json +169 -0
- package/locales/zh-CN.json +169 -0
- package/package.json +95 -30
- package/skills/po-runner/SKILL.md +32 -14
- package/src/prompts/codemode-how-to-runner/SKILL.md +85 -0
- package/src/prompts/help-how-to-runner/SKILL.md +51 -0
- package/dist/bashResult-BqDa7sbC.mjs.map +0 -1
- package/dist/bashResult-C2iKhHpD.cjs.map +0 -1
- package/dist/bashRunService-Ci0cGdYO.d.mts.map +0 -1
- package/dist/bashRunService-Cl3pYccr.mjs.map +0 -1
- package/dist/bashRunService-DjOH5kye.cjs.map +0 -1
- package/dist/bashTool-B1EwZLo_.d.mts.map +0 -1
- package/dist/bashTool-BvC3YOgG.mjs +0 -24
- package/dist/bashTool-BvC3YOgG.mjs.map +0 -1
- package/dist/bashTool-euL6zMDl.cjs +0 -41
- package/dist/bashTool-euL6zMDl.cjs.map +0 -1
- package/dist/cliApp-T8Fx_-1j.cjs +0 -244
- package/dist/cliApp-T8Fx_-1j.cjs.map +0 -1
- package/dist/cliApp-q97eVh4E.mjs +0 -237
- package/dist/cliApp-q97eVh4E.mjs.map +0 -1
- package/dist/headless-DOlCixyf.mjs +0 -169
- package/dist/headless-DOlCixyf.mjs.map +0 -1
- package/dist/headless-Dko_yBiy.cjs +0 -180
- package/dist/headless-Dko_yBiy.cjs.map +0 -1
- package/dist/index--xF7DvsE.d.mts.map +0 -1
- package/dist/index-BzeXJk6V.d.mts +0 -12
- package/dist/index-BzeXJk6V.d.mts.map +0 -1
- package/dist/index-C-IC35d9.d.mts.map +0 -1
- package/dist/index-CzCF_OP9.d.mts.map +0 -1
- package/dist/index-DM7yJpMs.d.mts.map +0 -1
- package/dist/launcher-BG5t9nvG.d.mts.map +0 -1
- package/dist/launcher-CCYsFBM9.mjs.map +0 -1
- package/dist/launcher-ZgDdyXpq.cjs.map +0 -1
- package/dist/lifeline-Bm-bHIjS.mjs +0 -88
- package/dist/lifeline-Bm-bHIjS.mjs.map +0 -1
- package/dist/lifeline-eJdZV0nN.d.mts +0 -19
- package/dist/lifeline-eJdZV0nN.d.mts.map +0 -1
- package/dist/lifeline-m7laIzIP.cjs +0 -98
- package/dist/lifeline-m7laIzIP.cjs.map +0 -1
- package/dist/lifeline.d.mts.map +0 -1
- package/dist/logFile-C7oQ_v-g.d.mts.map +0 -1
- package/dist/logFile-CnPKtxPy.cjs +0 -67
- package/dist/logFile-CnPKtxPy.cjs.map +0 -1
- package/dist/logFile-XcDHBwu1.mjs +0 -60
- package/dist/logFile-XcDHBwu1.mjs.map +0 -1
- package/dist/logReader-DHCK2BEr.cjs.map +0 -1
- package/dist/logReader-mq9uVurh.mjs.map +0 -1
- package/dist/ptyHost-CwbLLr90.mjs.map +0 -1
- package/dist/ptyHost-D35hNmtd.cjs.map +0 -1
- package/dist/reconcile-5cZ11jSD.cjs.map +0 -1
- package/dist/reconcile-wNYQJZF-.mjs.map +0 -1
- package/dist/rmuxBackend-CaEWooWn.d.mts.map +0 -1
- package/dist/rmuxBackend-Dh0CYVAL.cjs.map +0 -1
- package/dist/rmuxBackend-rjrVTG6K.mjs.map +0 -1
- package/dist/rtkProcessor-DSGbM-Cm.cjs.map +0 -1
- package/dist/rtkProcessor-Iw9gP5Xp.mjs.map +0 -1
- package/dist/runnerDependencies-7h_cxOva.mjs.map +0 -1
- package/dist/runnerDependencies-DSun3xO-.cjs.map +0 -1
- package/dist/runnerPaths-B41rMOY6.cjs.map +0 -1
- package/dist/runnerPaths-Dibbvyx_.mjs.map +0 -1
- package/dist/runnerRegistry-BgaR5O86.mjs.map +0 -1
- package/dist/runnerRegistry-dQYlMSpQ.cjs.map +0 -1
- package/dist/session-BKYnH4R6.mjs +0 -18
- package/dist/session-BKYnH4R6.mjs.map +0 -1
- package/dist/session-BvqzhXZY.cjs +0 -29
- package/dist/session-BvqzhXZY.cjs.map +0 -1
- package/dist/session-DE2Acesp.mjs +0 -6
- package/dist/session-DE2Acesp.mjs.map +0 -1
- package/dist/session-SfIPtdZO.cjs +0 -11
- package/dist/session-SfIPtdZO.cjs.map +0 -1
- package/dist/type-DwMZoINK.d.mts.map +0 -1
- package/src/prompts/po-use-runner/SKILL.md +0 -47
package/dist/extensions/web.mjs
CHANGED
|
@@ -1,70 +1,12 @@
|
|
|
1
|
-
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineSessionStore, defineToolRenderer, defineWebPlugin, sessionApiAddress } from "@agimon-ai/po-core/web";
|
|
2
|
-
import { AnsiLine, AnsiText, ArrowRightIcon, Button,
|
|
1
|
+
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineSessionStore, defineToolRenderer, defineWebPlugin, sessionApiAddress, t, useLocale, useT } from "@agimon-ai/po-core/web";
|
|
2
|
+
import { AlertIcon, AnsiLine, AnsiText, ArrowRightIcon, Button, ChevronDownIcon, Dot, EmptyState, FileIcon, FolderIcon, Input, LoadingState, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, PickerContent, PlayCircleIcon, Popover, PopoverTrigger, SearchIcon, StatusBadge, SyntaxText, TerminalView, ansiSpans, toolTone } from "@agimon-ai/po-web-components";
|
|
3
3
|
import { useStore } from "@tanstack/react-store";
|
|
4
|
-
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { Fragment, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
7
|
-
//#region src/extensions/workspaces/sessions/(frontend)/_lib/format.ts
|
|
8
|
-
/**
|
|
9
|
-
* Local copy of the runtime's formatUptime (src/services/bashResult/index.ts):
|
|
10
|
-
* the web plugin may reach only src/types, so the one helper it needs lives here.
|
|
11
|
-
*/
|
|
12
|
-
function formatRunnerUptime(startedAt, now) {
|
|
13
|
-
const started = Date.parse(startedAt);
|
|
14
|
-
if (Number.isNaN(started)) return "unknown";
|
|
15
|
-
const seconds = Math.max(0, Math.floor((now - started) / 1e3));
|
|
16
|
-
if (seconds < 60) return `${seconds}s`;
|
|
17
|
-
const minutes = Math.floor(seconds / 60);
|
|
18
|
-
if (minutes < 60) return `${minutes}m`;
|
|
19
|
-
const hours = Math.floor(minutes / 60);
|
|
20
|
-
return hours < 24 ? `${hours}h` : `${Math.floor(hours / 24)}d`;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The lines a log view shows: the slice's text, then whatever the follow
|
|
24
|
-
* stream appended, bounded to the newest `max`.
|
|
25
|
-
*
|
|
26
|
-
* A log file ends with a newline, and the reader hands its text back with that
|
|
27
|
-
* newline intact, so a naive split reports one blank line more than the file
|
|
28
|
-
* has. Dropping exactly one trailing empty entry keeps the count the reader
|
|
29
|
-
* sees equal to the count the server reported.
|
|
30
|
-
*/
|
|
31
|
-
function logViewLines(text, appended, max, options = {}) {
|
|
32
|
-
const split = text.split("\n");
|
|
33
|
-
if (split.length > 0 && split[split.length - 1] === "") split.pop();
|
|
34
|
-
if (options.dropPartialTail === true && split.length > 0) split.pop();
|
|
35
|
-
const all = [...split, ...appended];
|
|
36
|
-
const lines = all.slice(-max);
|
|
37
|
-
return {
|
|
38
|
-
lines,
|
|
39
|
-
hidden: all.length - lines.length
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Absolute 1-based numbers for a tail, counted back from the last line.
|
|
44
|
-
*
|
|
45
|
-
* A tail is contiguous, so only its end has to be known. Grep results are not
|
|
46
|
-
* contiguous and carry their own numbers from the reader instead.
|
|
47
|
-
*/
|
|
48
|
-
function tailLineNumbers(lastLineNumber, count) {
|
|
49
|
-
const first = Math.max(1, lastLineNumber - count + 1);
|
|
50
|
-
return Array.from({ length: count }, (_, index) => first + index);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Whether the view is actually following a growing log.
|
|
54
|
-
*
|
|
55
|
-
* Three things must hold: the reader asked to follow, no query is set (a
|
|
56
|
-
* filtered view is a snapshot of the whole file, which a stream cannot
|
|
57
|
-
* assemble a chunk at a time), and the runner is still writing. Without the
|
|
58
|
-
* last one a finished run would claim to be tailing a file nothing will ever
|
|
59
|
-
* append to.
|
|
60
|
-
*/
|
|
61
|
-
function isFollowingLive(following, filtering, running) {
|
|
62
|
-
return following && !filtering && running;
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
6
|
+
import { browserTransport } from "@agimon-ai/po-web-security/browser";
|
|
65
7
|
//#region src/extensions/workspaces/sessions/(frontend)/_lib/launchLine.ts
|
|
66
8
|
/**
|
|
67
|
-
* The `/runners start` line the
|
|
9
|
+
* The `/runners start` line the runners panel's command bar sends.
|
|
68
10
|
*
|
|
69
11
|
* WHY THE BUILDER LIVES HERE AND THE PARSER DOES NOT:
|
|
70
12
|
* Cockpit code is compiled into the host bundle and may import only this
|
|
@@ -80,6 +22,21 @@ const RUNNER_SHELL_REQUEST = {
|
|
|
80
22
|
name: "shell",
|
|
81
23
|
interactive: true
|
|
82
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* What the runners panel's Run sends: the typed command on a terminal when
|
|
27
|
+
* one is available, or a login shell when nothing was typed.
|
|
28
|
+
*/
|
|
29
|
+
function runnerRunRequest(command, cwd) {
|
|
30
|
+
const where = cwd.trim() === "" ? {} : { cwd };
|
|
31
|
+
return command.trim() === "" ? {
|
|
32
|
+
...RUNNER_SHELL_REQUEST,
|
|
33
|
+
...where
|
|
34
|
+
} : {
|
|
35
|
+
command,
|
|
36
|
+
...where,
|
|
37
|
+
preferInteractive: true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
83
40
|
/** Quotes a value that carries whitespace, which is how a value survives tokenizing. */
|
|
84
41
|
function quote(value) {
|
|
85
42
|
return /\s/u.test(value) ? `"${value}"` : value;
|
|
@@ -90,7 +47,7 @@ function runnerLaunchLine(request) {
|
|
|
90
47
|
const pairs = [
|
|
91
48
|
...name === "" ? [] : [`name=${quote(name)}`],
|
|
92
49
|
...cwd === "" ? [] : [`cwd=${quote(cwd)}`],
|
|
93
|
-
...request.interactive === true ? ["interactive=true"] : []
|
|
50
|
+
...request.interactive === true ? ["interactive=true"] : request.preferInteractive === true ? ["interactive=prefer"] : []
|
|
94
51
|
];
|
|
95
52
|
return [
|
|
96
53
|
RUNNERS_START_LINE,
|
|
@@ -99,12 +56,6 @@ function runnerLaunchLine(request) {
|
|
|
99
56
|
request.command.trim()
|
|
100
57
|
].join(" ");
|
|
101
58
|
}
|
|
102
|
-
/** What the form will not let a reader send, worded the way the session would answer. */
|
|
103
|
-
function launchProblems(request) {
|
|
104
|
-
const problems = [];
|
|
105
|
-
if (request.command.trim() === "") problems.push("A runner needs a command to run.");
|
|
106
|
-
return problems;
|
|
107
|
-
}
|
|
108
59
|
//#endregion
|
|
109
60
|
//#region src/constants/webRunners.ts
|
|
110
61
|
const RUNNER_RUNS_TYPE = "runner_runs";
|
|
@@ -116,14 +67,43 @@ const runners = defineSessionStore({
|
|
|
116
67
|
runs: [],
|
|
117
68
|
stopRequested: []
|
|
118
69
|
});
|
|
70
|
+
/** Short commands stay out of the activity card, but remain in the runner feed. */
|
|
71
|
+
function isRunnerActivityVisible(run, now = Date.now()) {
|
|
72
|
+
return run.state === "running" && now - Date.parse(run.startedAt) > 3e3;
|
|
73
|
+
}
|
|
119
74
|
/** The runner channel keeps the dock's busy state aligned with its rendered run list. */
|
|
120
75
|
const runnerActivitySource = {
|
|
121
76
|
subscribe(listener) {
|
|
122
|
-
|
|
123
|
-
|
|
77
|
+
let timer;
|
|
78
|
+
const schedule = () => {
|
|
79
|
+
clearTimeout(timer);
|
|
80
|
+
const now = Date.now();
|
|
81
|
+
let deadline = Infinity;
|
|
82
|
+
for (const session of Object.values(runners.store.state)) {
|
|
83
|
+
if (!session) continue;
|
|
84
|
+
for (const run of session.runs) {
|
|
85
|
+
if (run.state !== "running") continue;
|
|
86
|
+
const revealAt = Date.parse(run.startedAt) + 3001;
|
|
87
|
+
if (revealAt > now) deadline = Math.min(deadline, revealAt);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (Number.isFinite(deadline)) timer = setTimeout(() => {
|
|
91
|
+
listener();
|
|
92
|
+
schedule();
|
|
93
|
+
}, Math.min(deadline - now, 2147483647));
|
|
94
|
+
};
|
|
95
|
+
const subscription = runners.store.subscribe(() => {
|
|
96
|
+
listener();
|
|
97
|
+
schedule();
|
|
98
|
+
});
|
|
99
|
+
schedule();
|
|
100
|
+
return () => {
|
|
101
|
+
subscription.unsubscribe();
|
|
102
|
+
clearTimeout(timer);
|
|
103
|
+
};
|
|
124
104
|
},
|
|
125
105
|
isActive(sessionId) {
|
|
126
|
-
return runners.select(runners.store.state, sessionId).runs.some((run) => run
|
|
106
|
+
return runners.select(runners.store.state, sessionId).runs.some((run) => isRunnerActivityVisible(run));
|
|
127
107
|
}
|
|
128
108
|
};
|
|
129
109
|
function isRecord$3(value) {
|
|
@@ -163,151 +143,235 @@ const runnerRunsChannel = runners.channel({
|
|
|
163
143
|
channel: RUNNER_RUNS_TYPE,
|
|
164
144
|
parse(input) {
|
|
165
145
|
if (!isRecord$3(input) || !Array.isArray(input.runs)) return null;
|
|
166
|
-
|
|
146
|
+
const failure = input.startFailure;
|
|
147
|
+
return {
|
|
148
|
+
runs: input.runs.filter(isRecord$3),
|
|
149
|
+
...typeof input.sessionDirectory === "string" ? { sessionDirectory: input.sessionDirectory } : {},
|
|
150
|
+
...isRecord$3(failure) && typeof failure.id === "string" && typeof failure.message === "string" ? { startFailure: {
|
|
151
|
+
id: failure.id,
|
|
152
|
+
message: failure.message
|
|
153
|
+
} } : {}
|
|
154
|
+
};
|
|
167
155
|
},
|
|
168
|
-
reduce(current,
|
|
169
|
-
const stillRunning = new Set(runs.filter((run) => run.state === "running").map((run) => run.id));
|
|
156
|
+
reduce(current, payload) {
|
|
157
|
+
const stillRunning = new Set(payload.runs.filter((run) => run.state === "running").map((run) => run.id));
|
|
170
158
|
return {
|
|
171
|
-
|
|
159
|
+
...payload,
|
|
160
|
+
loaded: true,
|
|
172
161
|
stopRequested: current.stopRequested.filter((id) => stillRunning.has(id))
|
|
173
162
|
};
|
|
174
163
|
}
|
|
175
164
|
});
|
|
176
165
|
//#endregion
|
|
177
|
-
//#region src/extensions/workspaces/sessions/(frontend)/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
166
|
+
//#region src/extensions/workspaces/sessions/(frontend)/_lib/format.ts
|
|
167
|
+
/**
|
|
168
|
+
* Local copy of the runtime's formatUptime (src/services/bashResult/index.ts):
|
|
169
|
+
* the web plugin may reach only src/types, so the one helper it needs lives here.
|
|
170
|
+
*/
|
|
171
|
+
function formatRunnerUptime(startedAt, now, t) {
|
|
172
|
+
const started = Date.parse(startedAt);
|
|
173
|
+
if (Number.isNaN(started)) return t?.("runner.ui.unknownUptime", "unknown") ?? "unknown";
|
|
174
|
+
const seconds = Math.max(0, Math.floor((now - started) / 1e3));
|
|
175
|
+
if (seconds < 60) return `${seconds}s`;
|
|
176
|
+
const minutes = Math.floor(seconds / 60);
|
|
177
|
+
if (minutes < 60) return `${minutes}m`;
|
|
178
|
+
const hours = Math.floor(minutes / 60);
|
|
179
|
+
return hours < 24 ? `${hours}h` : `${Math.floor(hours / 24)}d`;
|
|
185
180
|
}
|
|
186
181
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* session will parse.
|
|
182
|
+
* The lines a log view shows: the slice's text, then whatever the follow
|
|
183
|
+
* stream appended, bounded to the newest `max`.
|
|
190
184
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
185
|
+
* A log file ends with a newline, and the reader hands its text back with that
|
|
186
|
+
* newline intact, so a naive split reports one blank line more than the file
|
|
187
|
+
* has. Dropping exactly one trailing empty entry keeps the count the reader
|
|
188
|
+
* sees equal to the count the server reported.
|
|
194
189
|
*/
|
|
195
|
-
function
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const [
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
interactive
|
|
190
|
+
function logViewLines(text, appended, max, options = {}) {
|
|
191
|
+
const split = text.split("\n");
|
|
192
|
+
if (split.length > 0 && split[split.length - 1] === "") split.pop();
|
|
193
|
+
if (options.dropPartialTail === true && split.length > 0) split.pop();
|
|
194
|
+
const all = [...split, ...appended];
|
|
195
|
+
const lines = all.slice(-max);
|
|
196
|
+
return {
|
|
197
|
+
lines,
|
|
198
|
+
hidden: all.length - lines.length
|
|
205
199
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Absolute 1-based numbers for a tail, counted back from the last line.
|
|
203
|
+
*
|
|
204
|
+
* A tail is contiguous, so only its end has to be known. Grep results are not
|
|
205
|
+
* contiguous and carry their own numbers from the reader instead.
|
|
206
|
+
*/
|
|
207
|
+
function tailLineNumbers(lastLineNumber, count) {
|
|
208
|
+
const first = Math.max(1, lastLineNumber - count + 1);
|
|
209
|
+
return Array.from({ length: count }, (_, index) => first + index);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Whether the view is actually following a growing log.
|
|
213
|
+
*
|
|
214
|
+
* Three things must hold: the reader asked to follow, no query is set (a
|
|
215
|
+
* filtered view is a snapshot of the whole file, which a stream cannot
|
|
216
|
+
* assemble a chunk at a time), and the runner is still writing. Without the
|
|
217
|
+
* last one a finished run would claim to be tailing a file nothing will ever
|
|
218
|
+
* append to.
|
|
219
|
+
*/
|
|
220
|
+
function isFollowingLive(following, filtering, running) {
|
|
221
|
+
return following && !filtering && running;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* A folder as the command bar names it: the session directory by its last
|
|
225
|
+
* segment, a folder inside it relative to it, anything else as written.
|
|
226
|
+
*/
|
|
227
|
+
function runnerFolderLabel(folder, sessionDirectory, t) {
|
|
228
|
+
if (folder === "" || folder === sessionDirectory) return sessionDirectory === void 0 ? t?.("runner.ui.sessionDirectory", "session directory") ?? "session directory" : sessionDirectory.split("/").pop() ?? sessionDirectory;
|
|
229
|
+
if (sessionDirectory !== void 0 && folder.startsWith(`${sessionDirectory}/`)) return folder.slice(sessionDirectory.length + 1);
|
|
230
|
+
return folder;
|
|
231
|
+
}
|
|
232
|
+
/** The folders the picker offers past the session directory: those in use, then the one in effect. */
|
|
233
|
+
function runnerFolders(inUse, current, sessionDirectory) {
|
|
234
|
+
const folders = /* @__PURE__ */ new Set([...inUse, current]);
|
|
235
|
+
folders.delete("");
|
|
236
|
+
if (sessionDirectory !== void 0) folders.delete(sessionDirectory);
|
|
237
|
+
return [...folders];
|
|
238
|
+
}
|
|
239
|
+
/** The badge a run wears: its state while running, then how it ended. */
|
|
240
|
+
function runnerBadge(run, t) {
|
|
241
|
+
if (run === void 0) return {
|
|
242
|
+
tone: "neutral",
|
|
243
|
+
label: t?.("runner.ui.gone", "gone") ?? "gone"
|
|
212
244
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
245
|
+
if (run.state === "running") return {
|
|
246
|
+
tone: "running",
|
|
247
|
+
label: t?.("runner.ui.running", "running") ?? "running"
|
|
248
|
+
};
|
|
249
|
+
if (run.exit === void 0 || run.exit.reason === "stopped") return {
|
|
250
|
+
tone: "neutral",
|
|
251
|
+
label: t?.("runner.ui.stopped", "stopped") ?? "stopped"
|
|
252
|
+
};
|
|
253
|
+
return run.exit.reason === "completed" && (run.exit.code === 0 || run.exit.code === null) ? {
|
|
254
|
+
tone: "ok",
|
|
255
|
+
label: t?.("runner.ui.done", "done") ?? "done"
|
|
256
|
+
} : {
|
|
257
|
+
tone: "error",
|
|
258
|
+
label: run.exit.reason === "failed" ? t?.("runner.ui.failed", "failed") ?? "failed" : run.exit.reason === "timed_out" ? t?.("runner.ui.timedOut", "timed out") ?? "timed out" : run.exit.reason === "completed" ? t?.("runner.ui.completed", "completed") ?? "completed" : run.exit.reason === "backend_lost" ? t?.("runner.ui.backendLost", "backend lost") ?? "backend lost" : run.exit.reason === "launcher_error" ? t?.("runner.ui.launcherError", "launcher error") ?? "launcher error" : run.exit.reason === "signaled" ? t?.("runner.ui.signaled", "signaled") ?? "signaled" : String(run.exit.reason).replace("_", " ")
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/extensions/workspaces/sessions/(frontend)/_components/RunnerCommandBar.tsx
|
|
263
|
+
/**
|
|
264
|
+
* The one place a runner starts: a command, the folder it runs in, and Run.
|
|
265
|
+
* An empty command opens a plain shell in that folder instead.
|
|
266
|
+
*/
|
|
267
|
+
function RunnerCommandBar({ command, onCommandChange, cwd, onCwdChange, sessionDirectory, folders, problem, onLaunch, defaultFolderOpen = false }) {
|
|
268
|
+
const t = useT();
|
|
269
|
+
const [folderOpen, setFolderOpen] = useState(defaultFolderOpen);
|
|
270
|
+
const [path, setPath] = useState("");
|
|
271
|
+
const label = runnerFolderLabel(cwd, sessionDirectory, t);
|
|
272
|
+
const pick = (next) => {
|
|
273
|
+
onCwdChange(next);
|
|
274
|
+
setPath("");
|
|
275
|
+
setFolderOpen(false);
|
|
276
|
+
};
|
|
277
|
+
const items = [{
|
|
278
|
+
value: "",
|
|
279
|
+
title: t("runner.ui.sessionDirectoryPicker", "Session directory"),
|
|
280
|
+
subtitle: sessionDirectory ?? t("runner.ui.whereSessionStarted", "Where this session started")
|
|
281
|
+
}, ...runnerFolders(folders, cwd, sessionDirectory).map((folder) => ({
|
|
282
|
+
value: folder,
|
|
283
|
+
title: runnerFolderLabel(folder, sessionDirectory, t),
|
|
284
|
+
subtitle: folder
|
|
285
|
+
}))];
|
|
286
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
287
|
+
className: "flex shrink-0 flex-col gap-1.5 border-b border-po-border-soft px-3 py-3 sm:px-[26px]",
|
|
288
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
289
|
+
className: "flex flex-wrap items-center gap-2 sm:flex-nowrap",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ jsxs("span", {
|
|
292
|
+
className: "relative flex min-w-0 flex-1 basis-full items-center sm:basis-auto",
|
|
293
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
294
|
+
"aria-hidden": true,
|
|
295
|
+
className: "pointer-events-none absolute left-3 font-mono text-base text-po-faint",
|
|
296
|
+
children: "$"
|
|
297
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
298
|
+
size: "lg",
|
|
299
|
+
"data-testid": "runners-panel-command",
|
|
300
|
+
"aria-label": t("runner.ui.commandToRunLabel", "Command to run"),
|
|
231
301
|
value: command,
|
|
232
|
-
placeholder: "pnpm
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
className: "
|
|
240
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Cwd" }), /* @__PURE__ */ jsx(Input, {
|
|
241
|
-
size: "sm",
|
|
242
|
-
"data-testid": "runner-launch-cwd",
|
|
243
|
-
value: cwd,
|
|
244
|
-
placeholder: "the session's own directory",
|
|
245
|
-
onChange: (event) => setCwd(event.target.value)
|
|
246
|
-
})]
|
|
247
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
248
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
249
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Name" }), /* @__PURE__ */ jsx(Input, {
|
|
250
|
-
size: "sm",
|
|
251
|
-
"data-testid": "runner-launch-name",
|
|
252
|
-
value: name,
|
|
253
|
-
placeholder: "chosen for you when empty",
|
|
254
|
-
onChange: (event) => setName(event.target.value)
|
|
255
|
-
})]
|
|
256
|
-
})]
|
|
257
|
-
}),
|
|
258
|
-
/* @__PURE__ */ jsxs("div", {
|
|
259
|
-
className: "flex items-center gap-2",
|
|
260
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
261
|
-
id: INTERACTIVE_FIELD_ID,
|
|
262
|
-
"data-testid": "runner-launch-interactive",
|
|
263
|
-
checked: interactive,
|
|
264
|
-
onCheckedChange: (checked) => setInteractive(checked === true)
|
|
265
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
266
|
-
htmlFor: INTERACTIVE_FIELD_ID,
|
|
267
|
-
className: "text-base text-po-dim",
|
|
268
|
-
children: "needs a terminal, for a command that prompts (requires rmux or tmux)"
|
|
269
|
-
})]
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ jsxs("div", {
|
|
272
|
-
className: "flex flex-col gap-1 rounded-md border border-po-border bg-po-deep px-3 py-2",
|
|
273
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Sent to the session" }), /* @__PURE__ */ jsx("pre", {
|
|
274
|
-
"data-testid": "runner-launch-line",
|
|
275
|
-
className: "whitespace-pre-wrap break-words font-mono text-sm text-po-green",
|
|
276
|
-
children: line
|
|
302
|
+
placeholder: t("runner.ui.aCommandLikePnpmDev", "a command, like pnpm dev"),
|
|
303
|
+
autoComplete: "off",
|
|
304
|
+
spellCheck: false,
|
|
305
|
+
onChange: (event) => onCommandChange(event.target.value),
|
|
306
|
+
onKeyDown: (event) => {
|
|
307
|
+
if (event.key === "Enter") onLaunch();
|
|
308
|
+
},
|
|
309
|
+
className: "w-full pl-7 font-mono"
|
|
277
310
|
})]
|
|
278
311
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
children:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
className: "flex-wrap sm:flex-nowrap",
|
|
286
|
-
children: [
|
|
287
|
-
/* @__PURE__ */ jsx("span", {
|
|
288
|
-
className: "w-full text-sm text-po-dim sm:w-auto",
|
|
289
|
-
children: "it appears above once the runtime starts it"
|
|
290
|
-
}),
|
|
291
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
292
|
-
/* @__PURE__ */ jsx(Button, {
|
|
312
|
+
/* @__PURE__ */ jsxs(Popover, {
|
|
313
|
+
open: folderOpen,
|
|
314
|
+
onOpenChange: setFolderOpen,
|
|
315
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
316
|
+
asChild: true,
|
|
317
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
293
318
|
variant: "outline",
|
|
294
|
-
size: "
|
|
295
|
-
"data-testid": "
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
319
|
+
size: "lg",
|
|
320
|
+
"data-testid": "runners-panel-cwd",
|
|
321
|
+
"aria-label": t("runner.ui.runsInFolder", "Runs in {folder}", { folder: label }),
|
|
322
|
+
"aria-invalid": problem === void 0 ? void 0 : true,
|
|
323
|
+
title: cwd === "" ? sessionDirectory : cwd,
|
|
324
|
+
className: `max-w-56 gap-1.5 px-3 font-mono ${problem === void 0 ? "" : "border-po-red"}`,
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ jsx(FolderIcon, { className: "h-3.5 w-3.5 shrink-0 text-po-faint" }),
|
|
327
|
+
/* @__PURE__ */ jsx("span", {
|
|
328
|
+
className: "truncate",
|
|
329
|
+
children: label
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-3.5 shrink-0 opacity-60" })
|
|
332
|
+
]
|
|
333
|
+
})
|
|
334
|
+
}), /* @__PURE__ */ jsx(PickerContent, {
|
|
335
|
+
side: "bottom",
|
|
336
|
+
align: "start",
|
|
337
|
+
title: t("runner.ui.runsInLabel", "Runs in"),
|
|
338
|
+
items,
|
|
339
|
+
value: [cwd],
|
|
340
|
+
onSelect: pick,
|
|
341
|
+
footer: /* @__PURE__ */ jsxs("span", {
|
|
342
|
+
className: "relative flex items-center px-3 py-2",
|
|
343
|
+
children: [/* @__PURE__ */ jsx(FolderIcon, { className: "pointer-events-none absolute left-5.5 h-3.5 w-3.5 text-po-faint" }), /* @__PURE__ */ jsx(Input, {
|
|
344
|
+
"data-testid": "runners-panel-cwd-path",
|
|
345
|
+
"aria-label": t("runner.ui.anotherFolderLabel", "Another folder"),
|
|
346
|
+
value: path,
|
|
347
|
+
placeholder: t("runner.ui.anotherFolderLikePackagesweb", "another folder, like packages/web"),
|
|
348
|
+
spellCheck: false,
|
|
349
|
+
onChange: (event) => setPath(event.target.value),
|
|
350
|
+
onKeyDown: (event) => {
|
|
351
|
+
if (event.key === "Enter" && path.trim() !== "") pick(path.trim());
|
|
352
|
+
},
|
|
353
|
+
className: "w-full pl-8 font-mono"
|
|
354
|
+
})]
|
|
306
355
|
})
|
|
307
|
-
]
|
|
356
|
+
})]
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ jsx(Button, {
|
|
359
|
+
variant: "primary",
|
|
360
|
+
size: "lg",
|
|
361
|
+
"data-testid": "runners-panel-run",
|
|
362
|
+
onClick: onLaunch,
|
|
363
|
+
children: command.trim() === "" ? t("runner.ui.openShellLabel", "Open shell") : t("runner.ui.runLabel", "Run")
|
|
308
364
|
})
|
|
309
|
-
]
|
|
310
|
-
})
|
|
365
|
+
]
|
|
366
|
+
}), problem === void 0 ? /* @__PURE__ */ jsx("span", {
|
|
367
|
+
className: "text-sm text-po-dim",
|
|
368
|
+
children: t("runner.ui.runsInItsOwnTerminalAndKeepsGoingAfterPosTurnEndsLeaveItEmptyForAPlainShellLabel", "Runs in its own terminal and keeps going after Po's turn ends. Leave it empty for a plain shell.")
|
|
369
|
+
}) : /* @__PURE__ */ jsxs("span", {
|
|
370
|
+
role: "alert",
|
|
371
|
+
"data-testid": "runners-panel-problem",
|
|
372
|
+
className: "flex items-center gap-1.5 text-sm text-po-red",
|
|
373
|
+
children: [/* @__PURE__ */ jsx(AlertIcon, { className: "size-3.5 shrink-0" }), problem]
|
|
374
|
+
})]
|
|
311
375
|
});
|
|
312
376
|
}
|
|
313
377
|
//#endregion
|
|
@@ -404,13 +468,93 @@ const routes = {
|
|
|
404
468
|
const api = createApiClient(routes, {
|
|
405
469
|
scopes: ["session"],
|
|
406
470
|
basePath: "runner",
|
|
407
|
-
transport: (input, init) =>
|
|
471
|
+
transport: (input, init) => browserTransport.fetch(input, init),
|
|
408
472
|
sessionAddress: sessionApiAddress
|
|
409
473
|
});
|
|
410
474
|
//#endregion
|
|
475
|
+
//#region src/extensions/workspaces/sessions/(frontend)/_lib/screenApi.ts
|
|
476
|
+
/**
|
|
477
|
+
* The page's half of the attached pane.
|
|
478
|
+
*
|
|
479
|
+
* Two directions over two mechanisms, because the hub proxies requests and
|
|
480
|
+
* server-sent events but cannot upgrade a socket: pane bytes arrive on an
|
|
481
|
+
* EventSource, and keystrokes go back as ordinary POSTs. Both addresses come
|
|
482
|
+
* from the generated client: the stream route offers a URL and no call method,
|
|
483
|
+
* which is exactly what an EventSource wants and all it can be given.
|
|
484
|
+
*/
|
|
485
|
+
/** Turns one base64 chunk back into the bytes a terminal was sent. */
|
|
486
|
+
function decodeChunk(chunk) {
|
|
487
|
+
const binary = atob(chunk);
|
|
488
|
+
const bytes = new Uint8Array(binary.length);
|
|
489
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
490
|
+
return bytes;
|
|
491
|
+
}
|
|
492
|
+
/** Attempts before a dropped screen stream is reported as lost rather than retried. */
|
|
493
|
+
const MAX_RETRIES$1 = 5;
|
|
494
|
+
const RETRY_BASE_MS$1 = 500;
|
|
495
|
+
function isRecord$2(value) {
|
|
496
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
497
|
+
}
|
|
498
|
+
function watchRunnerScreen(sessionId, runId, from, handlers) {
|
|
499
|
+
let offset = from;
|
|
500
|
+
let retries = 0;
|
|
501
|
+
let closed = false;
|
|
502
|
+
let source;
|
|
503
|
+
let timer;
|
|
504
|
+
const open = () => {
|
|
505
|
+
if (closed) return;
|
|
506
|
+
const current = new EventSource(api.session(sessionId).screenStream.url({
|
|
507
|
+
params: { [RUN_ID_PARAM]: runId },
|
|
508
|
+
query: { [RUNNER_LOG_PARAMS.from]: offset }
|
|
509
|
+
}));
|
|
510
|
+
source = current;
|
|
511
|
+
current.addEventListener(RUNNER_SCREEN_EVENT, (message) => {
|
|
512
|
+
let parsed;
|
|
513
|
+
try {
|
|
514
|
+
parsed = JSON.parse(message.data);
|
|
515
|
+
} catch {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
if (!isRecord$2(parsed) || typeof parsed.chunk !== "string") return;
|
|
519
|
+
const event = parsed;
|
|
520
|
+
if (typeof event.offset === "number") offset = event.offset;
|
|
521
|
+
retries = 0;
|
|
522
|
+
if (event.ended === true) {
|
|
523
|
+
closed = true;
|
|
524
|
+
current.close();
|
|
525
|
+
}
|
|
526
|
+
handlers.onEvent(event);
|
|
527
|
+
});
|
|
528
|
+
current.addEventListener("error", () => {
|
|
529
|
+
current.close();
|
|
530
|
+
if (closed) return;
|
|
531
|
+
retries += 1;
|
|
532
|
+
if (retries > MAX_RETRIES$1) {
|
|
533
|
+
handlers.onLost();
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
timer = setTimeout(open, RETRY_BASE_MS$1 * 2 ** (retries - 1));
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
open();
|
|
540
|
+
return { close: () => {
|
|
541
|
+
closed = true;
|
|
542
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
543
|
+
source?.close();
|
|
544
|
+
} };
|
|
545
|
+
}
|
|
546
|
+
/** Sends one batch of keystrokes. Resolves to whether the pane took them. */
|
|
547
|
+
async function sendRunnerInput(sessionId, runId, text) {
|
|
548
|
+
const body = { text };
|
|
549
|
+
return (await api.session(sessionId).input({
|
|
550
|
+
params: { [RUN_ID_PARAM]: runId },
|
|
551
|
+
body
|
|
552
|
+
})).ok;
|
|
553
|
+
}
|
|
554
|
+
//#endregion
|
|
411
555
|
//#region src/extensions/workspaces/sessions/(frontend)/_lib/logApi.ts
|
|
412
556
|
const UNREACHABLE = "The cockpit hub is unreachable.";
|
|
413
|
-
function isRecord$
|
|
557
|
+
function isRecord$1(value) {
|
|
414
558
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
415
559
|
}
|
|
416
560
|
/** Reads one runner's log: the last N lines, or the lines matching a substring with context. */
|
|
@@ -429,12 +573,13 @@ async function fetchRunnerLog(sessionId, runId, params = {}, signal) {
|
|
|
429
573
|
if (result.status === 0) return { error: signal?.aborted === true ? "" : UNREACHABLE };
|
|
430
574
|
return { error: result.error === "" ? `The hub answered ${String(result.status)}.` : result.error };
|
|
431
575
|
}
|
|
432
|
-
if (!isRecord$
|
|
576
|
+
if (!isRecord$1(result.data) || typeof result.data.text !== "string") return { error: `The hub answered ${String(result.status)}.` };
|
|
433
577
|
return { slice: result.data };
|
|
434
578
|
}
|
|
435
|
-
/** Attempts before a dropped stream
|
|
436
|
-
const MAX_RETRIES
|
|
437
|
-
const RETRY_BASE_MS
|
|
579
|
+
/** Attempts before a dropped stream falls back to callable reads. */
|
|
580
|
+
const MAX_RETRIES = 5;
|
|
581
|
+
const RETRY_BASE_MS = 500;
|
|
582
|
+
const POLL_MS = 2e3;
|
|
438
583
|
/**
|
|
439
584
|
* Follows a running log from the offset already read, so no line is missed
|
|
440
585
|
* between the slice and the stream. The stream never filters; a page with a
|
|
@@ -442,7 +587,10 @@ const RETRY_BASE_MS$1 = 500;
|
|
|
442
587
|
*
|
|
443
588
|
* A dropped connection is retried with backoff from the offset the last event
|
|
444
589
|
* reported, not from the offset the page started at, so a reconnect resumes
|
|
445
|
-
* instead of replaying.
|
|
590
|
+
* instead of replaying. After retries are exhausted, callable reads take over.
|
|
591
|
+
* A stream that never opened (a host whose stream URL the browser cannot
|
|
592
|
+
* reach) is not retried: callable reads take over at once.
|
|
593
|
+
* The browser's own EventSource retry cannot do this:
|
|
446
594
|
* it reopens the URL it was given, whose offset is stale the moment a line
|
|
447
595
|
* arrives, so each of its reconnects would duplicate everything since.
|
|
448
596
|
*/
|
|
@@ -450,15 +598,69 @@ function followRunnerLog(sessionId, runId, from, handlers) {
|
|
|
450
598
|
let offset = from;
|
|
451
599
|
let retries = 0;
|
|
452
600
|
let closed = false;
|
|
601
|
+
let opened = false;
|
|
453
602
|
let source;
|
|
454
603
|
let timer;
|
|
604
|
+
const controller = new AbortController();
|
|
605
|
+
let decoder = new TextDecoder();
|
|
606
|
+
let pending = "";
|
|
607
|
+
const deliver = (event) => {
|
|
608
|
+
if (closed) return;
|
|
609
|
+
if (typeof event.offset === "number") offset = event.offset;
|
|
610
|
+
if (event.ended === true) {
|
|
611
|
+
closed = true;
|
|
612
|
+
source?.close();
|
|
613
|
+
}
|
|
614
|
+
handlers.onEvent(event);
|
|
615
|
+
};
|
|
616
|
+
const poll = async () => {
|
|
617
|
+
if (closed) return;
|
|
618
|
+
let delay = POLL_MS;
|
|
619
|
+
try {
|
|
620
|
+
const result = await api.session(sessionId).logRead({
|
|
621
|
+
params: { [RUN_ID_PARAM]: runId },
|
|
622
|
+
query: { [RUNNER_LOG_PARAMS.from]: offset },
|
|
623
|
+
signal: controller.signal
|
|
624
|
+
});
|
|
625
|
+
if (closed || !result.ok) return;
|
|
626
|
+
const read = result.data;
|
|
627
|
+
if (read.reset) {
|
|
628
|
+
decoder = new TextDecoder();
|
|
629
|
+
pending = "";
|
|
630
|
+
}
|
|
631
|
+
pending += decoder.decode(decodeChunk(read.chunk), { stream: !read.ended });
|
|
632
|
+
const lines = pending.split("\n");
|
|
633
|
+
pending = lines.pop() ?? "";
|
|
634
|
+
if (read.ended && pending !== "") {
|
|
635
|
+
lines.push(pending);
|
|
636
|
+
pending = "";
|
|
637
|
+
}
|
|
638
|
+
deliver({
|
|
639
|
+
lines,
|
|
640
|
+
offset: read.offset,
|
|
641
|
+
ended: read.ended
|
|
642
|
+
});
|
|
643
|
+
if (read.hasMore) delay = 0;
|
|
644
|
+
} catch {} finally {
|
|
645
|
+
if (!closed) timer = setTimeout(() => void poll(), delay);
|
|
646
|
+
}
|
|
647
|
+
};
|
|
455
648
|
const open = () => {
|
|
456
649
|
if (closed) return;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
650
|
+
let current;
|
|
651
|
+
try {
|
|
652
|
+
current = new EventSource(api.session(sessionId).logStream.url({
|
|
653
|
+
params: { [RUN_ID_PARAM]: runId },
|
|
654
|
+
query: { [RUNNER_LOG_PARAMS.from]: offset }
|
|
655
|
+
}));
|
|
656
|
+
} catch {
|
|
657
|
+
poll();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
461
660
|
source = current;
|
|
661
|
+
current.addEventListener("open", () => {
|
|
662
|
+
opened = true;
|
|
663
|
+
});
|
|
462
664
|
current.addEventListener(RUNNER_LOG_STREAM_EVENT, (message) => {
|
|
463
665
|
let parsed;
|
|
464
666
|
try {
|
|
@@ -466,25 +668,21 @@ function followRunnerLog(sessionId, runId, from, handlers) {
|
|
|
466
668
|
} catch {
|
|
467
669
|
return;
|
|
468
670
|
}
|
|
469
|
-
if (!isRecord$
|
|
671
|
+
if (!isRecord$1(parsed) || !Array.isArray(parsed.lines)) return;
|
|
470
672
|
const event = parsed;
|
|
471
|
-
|
|
673
|
+
opened = true;
|
|
472
674
|
retries = 0;
|
|
473
|
-
|
|
474
|
-
closed = true;
|
|
475
|
-
current.close();
|
|
476
|
-
}
|
|
477
|
-
handlers.onEvent(event);
|
|
675
|
+
deliver(event);
|
|
478
676
|
});
|
|
479
677
|
current.addEventListener("error", () => {
|
|
480
678
|
current.close();
|
|
481
679
|
if (closed) return;
|
|
482
680
|
retries += 1;
|
|
483
|
-
if (retries > MAX_RETRIES
|
|
484
|
-
|
|
681
|
+
if (!opened || retries > MAX_RETRIES) {
|
|
682
|
+
poll();
|
|
485
683
|
return;
|
|
486
684
|
}
|
|
487
|
-
timer = setTimeout(open, RETRY_BASE_MS
|
|
685
|
+
timer = setTimeout(open, RETRY_BASE_MS * 2 ** (retries - 1));
|
|
488
686
|
});
|
|
489
687
|
};
|
|
490
688
|
open();
|
|
@@ -492,13 +690,13 @@ function followRunnerLog(sessionId, runId, from, handlers) {
|
|
|
492
690
|
closed = true;
|
|
493
691
|
if (timer !== void 0) clearTimeout(timer);
|
|
494
692
|
source?.close();
|
|
693
|
+
controller.abort();
|
|
495
694
|
} };
|
|
496
695
|
}
|
|
497
696
|
//#endregion
|
|
498
697
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/RunnerLogPanel.tsx
|
|
499
|
-
const TICK_MS$2 = 1e4;
|
|
500
698
|
/** The tab id doubles as the URL segment, so it stays plain and unique across plugins. */
|
|
501
|
-
const TAB_ID_PREFIX
|
|
699
|
+
const TAB_ID_PREFIX = "runner-log-";
|
|
502
700
|
/** Lines held in the view; a follow that ran all day must not grow without bound. */
|
|
503
701
|
const MAX_VIEW_LINES = 2e3;
|
|
504
702
|
/** Context lines each side of a match, the same either-side window grep would use. */
|
|
@@ -511,10 +709,11 @@ const BYTES_PER_KB$1 = 1024;
|
|
|
511
709
|
const BYTES_PER_MB$1 = BYTES_PER_KB$1 * BYTES_PER_KB$1;
|
|
512
710
|
/** The temporary tab for one runner's log; the host keeps this panel while the tab is open. */
|
|
513
711
|
function runnerLogTab(run) {
|
|
712
|
+
const t$2 = t;
|
|
514
713
|
const runId = run.id;
|
|
515
714
|
return {
|
|
516
|
-
id: `${TAB_ID_PREFIX
|
|
517
|
-
label:
|
|
715
|
+
id: `${TAB_ID_PREFIX}${runId}`,
|
|
716
|
+
label: t$2("runner.ui.logTab", "log · {name}", { name: run.name }),
|
|
518
717
|
panel: (props) => /* @__PURE__ */ jsx(RunnerLogPanel, {
|
|
519
718
|
...props,
|
|
520
719
|
runId
|
|
@@ -526,45 +725,11 @@ function formatSize$1(bytes) {
|
|
|
526
725
|
if (bytes < BYTES_PER_MB$1) return `${(bytes / BYTES_PER_KB$1).toFixed(1)} KB`;
|
|
527
726
|
return `${(bytes / BYTES_PER_MB$1).toFixed(1)} MB`;
|
|
528
727
|
}
|
|
529
|
-
function badgeOf(run) {
|
|
530
|
-
if (run === void 0) return {
|
|
531
|
-
tone: "neutral",
|
|
532
|
-
label: "gone"
|
|
533
|
-
};
|
|
534
|
-
if (run.state === "running") return {
|
|
535
|
-
tone: "running",
|
|
536
|
-
label: "running"
|
|
537
|
-
};
|
|
538
|
-
if (run.exit === void 0 || run.exit.reason === "stopped") return {
|
|
539
|
-
tone: "neutral",
|
|
540
|
-
label: "stopped"
|
|
541
|
-
};
|
|
542
|
-
return run.exit.reason === "completed" && (run.exit.code === 0 || run.exit.code === null) ? {
|
|
543
|
-
tone: "ok",
|
|
544
|
-
label: "done"
|
|
545
|
-
} : {
|
|
546
|
-
tone: "error",
|
|
547
|
-
label: run.exit.reason.replace("_", " ")
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
728
|
/** Whether one line is a match rather than the context printed around one. */
|
|
551
729
|
function isMatch(line, needle, ignoreCase) {
|
|
552
730
|
if (needle === "") return false;
|
|
553
731
|
return ignoreCase ? line.toLowerCase().includes(needle.toLowerCase()) : line.includes(needle);
|
|
554
732
|
}
|
|
555
|
-
/** One fact of the runner, on its own line so a long command is never elided. */
|
|
556
|
-
function MetaRow({ label, value }) {
|
|
557
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
558
|
-
className: "flex min-w-0 gap-2.5",
|
|
559
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
560
|
-
className: "w-14 shrink-0 text-base text-po-dim",
|
|
561
|
-
children: label
|
|
562
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
563
|
-
className: "min-w-0 flex-1 break-all font-mono text-sm text-po-dim",
|
|
564
|
-
children: value
|
|
565
|
-
})]
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
733
|
/**
|
|
569
734
|
* One rendered log line: its number, whether it matched, and the text.
|
|
570
735
|
*
|
|
@@ -573,24 +738,24 @@ function MetaRow({ label, value }) {
|
|
|
573
738
|
* keyed on the joined string; keyed by line number instead, an append only
|
|
574
739
|
* costs the line that appended.
|
|
575
740
|
*/
|
|
576
|
-
function LogRow({ number, line, matched }) {
|
|
741
|
+
function LogRow({ number, line, matched, dimmed }) {
|
|
577
742
|
return /* @__PURE__ */ jsxs("div", {
|
|
578
743
|
"data-testid": "runner-log-row",
|
|
579
744
|
"data-matched": matched,
|
|
580
745
|
className: "flex min-w-0 gap-2",
|
|
581
746
|
children: [
|
|
582
747
|
number === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
583
|
-
className: "w-12 shrink-0 select-none text-right text-
|
|
748
|
+
className: "w-12 shrink-0 select-none text-right font-mono text-sm leading-relaxed text-po-faint",
|
|
584
749
|
children: number
|
|
585
750
|
}),
|
|
586
751
|
/* @__PURE__ */ jsx("span", {
|
|
587
752
|
"aria-hidden": true,
|
|
588
|
-
className: `w-4 shrink-0 select-none text-
|
|
753
|
+
className: `w-4 shrink-0 select-none font-mono text-sm leading-relaxed ${matched ? "text-po-yellow" : "text-po-faint"}`,
|
|
589
754
|
children: matched ? ">>" : ""
|
|
590
755
|
}),
|
|
591
756
|
/* @__PURE__ */ jsx(AnsiLine, {
|
|
592
757
|
line,
|
|
593
|
-
className: `min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-
|
|
758
|
+
className: `min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-sm leading-relaxed ${dimmed ? "text-po-dim" : "text-po-text"}`
|
|
594
759
|
})
|
|
595
760
|
]
|
|
596
761
|
});
|
|
@@ -604,10 +769,11 @@ function LogRow({ number, line, matched }) {
|
|
|
604
769
|
* rather than moving a cursor through it, and following pauses while one is
|
|
605
770
|
* set because a filtered view is a snapshot of a file that is still growing.
|
|
606
771
|
*/
|
|
607
|
-
function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
772
|
+
function RunnerLogPanel({ sessionId, runId, sendSessionFrame, onTerminal }) {
|
|
773
|
+
const t = useT();
|
|
774
|
+
const locale = useLocale();
|
|
608
775
|
const { runs, stopRequested } = useStore(runners.store, (state) => runners.select(state, sessionId));
|
|
609
776
|
const run = runs.find((candidate) => candidate.id === runId);
|
|
610
|
-
const [now, setNow] = useState(() => Date.now());
|
|
611
777
|
const [typed, setTyped] = useState("");
|
|
612
778
|
const [query, setQuery] = useState("");
|
|
613
779
|
const [ignoreCase, setIgnoreCase] = useState(false);
|
|
@@ -616,17 +782,17 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
616
782
|
const [slice, setSlice] = useState(void 0);
|
|
617
783
|
const [streamFrom, setStreamFrom] = useState(void 0);
|
|
618
784
|
const [appended, setAppended] = useState([]);
|
|
785
|
+
/** How far the stream has read, so the size shown grows with the lines instead of staying at the first read. */
|
|
786
|
+
const [followedBytes, setFollowedBytes] = useState(0);
|
|
619
787
|
const [error, setError] = useState(void 0);
|
|
620
788
|
/** False once the reader scrolls up: following must not yank them back down. */
|
|
621
789
|
const [pinned, setPinned] = useState(true);
|
|
790
|
+
/** A long command would eat a phone screen, so it starts as one truncated line. */
|
|
791
|
+
const [commandOpen, setCommandOpen] = useState(false);
|
|
622
792
|
const bottom = useRef(null);
|
|
623
793
|
const body = useRef(null);
|
|
624
794
|
const filtering = query !== "";
|
|
625
795
|
const live = isFollowingLive(following, filtering, slice?.running === true);
|
|
626
|
-
useEffect(() => {
|
|
627
|
-
const timer = setInterval(() => setNow(Date.now()), TICK_MS$2);
|
|
628
|
-
return () => clearInterval(timer);
|
|
629
|
-
}, []);
|
|
630
796
|
useEffect(() => {
|
|
631
797
|
const timer = setTimeout(() => setQuery(typed), SEARCH_DEBOUNCE_MS);
|
|
632
798
|
return () => clearTimeout(timer);
|
|
@@ -645,6 +811,7 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
645
811
|
}
|
|
646
812
|
setError(void 0);
|
|
647
813
|
setAppended([]);
|
|
814
|
+
setFollowedBytes(0);
|
|
648
815
|
setSlice(result.slice);
|
|
649
816
|
setStreamFrom(result.slice.completeBytes);
|
|
650
817
|
});
|
|
@@ -663,13 +830,11 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
663
830
|
}, [load]);
|
|
664
831
|
useEffect(() => {
|
|
665
832
|
if (!live || sessionId === null || streamFrom === void 0) return;
|
|
666
|
-
const follow = followRunnerLog(sessionId, runId, streamFrom, {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
onLost: () => setFollowing(false)
|
|
672
|
-
});
|
|
833
|
+
const follow = followRunnerLog(sessionId, runId, streamFrom, { onEvent: (event) => {
|
|
834
|
+
if (event.lines.length > 0) setAppended((current) => [...current, ...event.lines].slice(-2e3));
|
|
835
|
+
if (typeof event.offset === "number") setFollowedBytes(event.offset);
|
|
836
|
+
if (event.ended === true) setFollowing(false);
|
|
837
|
+
} });
|
|
673
838
|
return () => follow.close();
|
|
674
839
|
}, [
|
|
675
840
|
live,
|
|
@@ -703,9 +868,8 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
703
868
|
if (element === null) return;
|
|
704
869
|
setPinned(element.scrollHeight - element.scrollTop - element.clientHeight <= NEAR_BOTTOM_PX);
|
|
705
870
|
};
|
|
706
|
-
const badge =
|
|
871
|
+
const badge = runnerBadge(run, t);
|
|
707
872
|
const stopping = run !== void 0 && stopRequested.includes(run.id);
|
|
708
|
-
const elapsed = run === void 0 ? "" : formatRunnerUptime(run.startedAt, run.exit ? Date.parse(run.exit.finishedAt) : now);
|
|
709
873
|
return /* @__PURE__ */ jsxs("div", {
|
|
710
874
|
"data-testid": "runner-log-panel",
|
|
711
875
|
className: "flex min-h-0 flex-1 flex-col",
|
|
@@ -720,93 +884,131 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
720
884
|
}),
|
|
721
885
|
/* @__PURE__ */ jsx(StatusBadge, {
|
|
722
886
|
tone: badge.tone,
|
|
887
|
+
size: "md",
|
|
723
888
|
"data-testid": "runner-log-state",
|
|
724
889
|
children: badge.label
|
|
725
890
|
}),
|
|
726
|
-
run
|
|
891
|
+
run?.exit?.code !== void 0 && run.exit.code !== null ? /* @__PURE__ */ jsx("span", {
|
|
892
|
+
"data-testid": "runner-log-exit-code",
|
|
727
893
|
className: "shrink-0 text-sm text-po-dim",
|
|
728
|
-
children:
|
|
729
|
-
})
|
|
894
|
+
children: t("runner.ui.exitCode", "exit {code}", { code: String(run.exit.code) })
|
|
895
|
+
}) : null,
|
|
896
|
+
run ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RunnerUptime, { run }), /* @__PURE__ */ jsx("span", {
|
|
730
897
|
className: "shrink-0 text-sm text-po-dim",
|
|
731
898
|
children: `pid ${String(run.pid)} · ${run.backend}${run.interactive ? " · tty" : ""}`
|
|
732
899
|
})] }) : /* @__PURE__ */ jsx("span", {
|
|
733
900
|
"data-testid": "runner-log-gone",
|
|
734
901
|
className: "text-sm text-po-dim",
|
|
735
|
-
children: "no longer listed; its log stays readable"
|
|
902
|
+
children: t("runner.ui.noLongerListedItsLogStaysReadable", "no longer listed; its log stays readable")
|
|
736
903
|
}),
|
|
737
904
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
905
|
+
onTerminal ? /* @__PURE__ */ jsx(Button, {
|
|
906
|
+
variant: "outline",
|
|
907
|
+
size: "sm",
|
|
908
|
+
"data-testid": "runner-log-terminal",
|
|
909
|
+
onClick: onTerminal,
|
|
910
|
+
children: t("runner.ui.backToTerminalLabel", "Back to terminal")
|
|
911
|
+
}) : null,
|
|
738
912
|
run !== void 0 && run.state === "running" && sessionId !== null ? /* @__PURE__ */ jsx(Button, {
|
|
739
913
|
variant: stopping ? "outline" : "danger-outline",
|
|
740
|
-
size: "
|
|
914
|
+
size: "sm",
|
|
741
915
|
"data-testid": "runner-log-stop",
|
|
742
916
|
disabled: stopping,
|
|
743
|
-
title: stopping ? "stop requested; the runner reports its own exit" : "ask the runtime to stop this runner",
|
|
917
|
+
title: stopping ? t("runner.ui.stopRequestedTheRunnerReportsItsOwnExit", "stop requested; the runner reports its own exit") : t("runner.ui.askTheRuntimeToStopThisRunner", "ask the runtime to stop this runner"),
|
|
744
918
|
onClick: () => requestRunnerStop(sendSessionFrame, sessionId, run.id),
|
|
745
|
-
|
|
746
|
-
children: stopping ? "stopping…" : "stop"
|
|
919
|
+
children: stopping ? t("runner.ui.stoppingLabelProgress", "Stopping…") : t("runner.ui.stopLabel", "Stop")
|
|
747
920
|
}) : null
|
|
748
921
|
]
|
|
749
922
|
}),
|
|
750
|
-
run ? /* @__PURE__ */
|
|
751
|
-
className: "
|
|
752
|
-
children:
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
923
|
+
run ? /* @__PURE__ */ jsx("div", {
|
|
924
|
+
className: "shrink-0 border-b border-po-border-soft px-3 py-3 sm:px-[26px]",
|
|
925
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
926
|
+
className: "flex items-start gap-2 rounded-md bg-po-deep px-3 py-2",
|
|
927
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
928
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
929
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
930
|
+
"data-testid": "runner-log-command",
|
|
931
|
+
title: commandOpen ? void 0 : t("runner.ui.commandInDirectory", "{command}\nin {directory}", {
|
|
932
|
+
command: run.command,
|
|
933
|
+
directory: run.cwd
|
|
934
|
+
}),
|
|
935
|
+
className: `font-mono text-base text-po-hi ${commandOpen ? "break-all" : "truncate"}`,
|
|
936
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
937
|
+
"aria-hidden": true,
|
|
938
|
+
className: "select-none text-po-faint",
|
|
939
|
+
children: ["$", " "]
|
|
940
|
+
}), run.command]
|
|
941
|
+
}), commandOpen ? /* @__PURE__ */ jsxs("span", {
|
|
942
|
+
className: "break-all font-mono text-sm text-po-dim",
|
|
943
|
+
children: [t("runner.ui.in", "in"), run.cwd]
|
|
944
|
+
}) : null]
|
|
945
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
946
|
+
type: "button",
|
|
947
|
+
"data-testid": "runner-log-command-toggle",
|
|
948
|
+
"aria-expanded": commandOpen,
|
|
949
|
+
"aria-label": commandOpen ? t("runner.ui.collapseCommandLabel", "Collapse command") : t("runner.ui.expandCommandLabel", "Expand command"),
|
|
950
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded text-po-faint hover:text-po-hi",
|
|
951
|
+
onClick: () => setCommandOpen((open) => !open),
|
|
952
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: `size-4 transition-transform ${commandOpen ? "rotate-180" : ""}` })
|
|
953
|
+
})]
|
|
954
|
+
})
|
|
759
955
|
}) : null,
|
|
760
956
|
/* @__PURE__ */ jsxs("div", {
|
|
761
|
-
className: "flex min-h-
|
|
957
|
+
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]",
|
|
762
958
|
children: [
|
|
763
959
|
/* @__PURE__ */ jsxs("span", {
|
|
764
|
-
className: "relative flex min-w-0 flex-1 items-center sm:w-
|
|
765
|
-
children: [/* @__PURE__ */ jsx(SearchIcon, { className: "pointer-events-none absolute left-2.5 h-3 w-3 text-po-faint" }), /* @__PURE__ */ jsx(Input, {
|
|
766
|
-
size: "
|
|
960
|
+
className: "relative flex min-w-0 flex-1 items-center sm:w-72 sm:flex-none",
|
|
961
|
+
children: [/* @__PURE__ */ jsx(SearchIcon, { className: "pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-po-faint" }), /* @__PURE__ */ jsx(Input, {
|
|
962
|
+
size: "md",
|
|
767
963
|
"data-testid": "runner-log-search",
|
|
768
964
|
value: typed,
|
|
769
|
-
placeholder: "
|
|
965
|
+
placeholder: t("runner.ui.searchOutputLabel", "Search output"),
|
|
770
966
|
onChange: (event) => setTyped(event.target.value),
|
|
771
|
-
className: "pl-
|
|
967
|
+
className: "w-full pl-8"
|
|
772
968
|
})]
|
|
773
969
|
}),
|
|
774
970
|
/* @__PURE__ */ jsx(Button, {
|
|
775
971
|
variant: ignoreCase ? "subtle" : "outline",
|
|
776
|
-
size: "
|
|
972
|
+
size: "sm",
|
|
777
973
|
"data-testid": "runner-log-ignore-case",
|
|
778
974
|
"aria-pressed": ignoreCase,
|
|
779
|
-
title: "match regardless of case",
|
|
975
|
+
title: t("runner.ui.matchRegardlessOfCase", "match regardless of case"),
|
|
780
976
|
onClick: () => setIgnoreCase((current) => !current),
|
|
781
|
-
|
|
782
|
-
children: "aA"
|
|
977
|
+
children: ignoreCase ? t("runner.ui.anyCaseLabel", "Any case") : t("runner.ui.matchCaseLabel", "Match case")
|
|
783
978
|
}),
|
|
784
979
|
/* @__PURE__ */ jsx(Button, {
|
|
785
980
|
variant: context > 0 && filtering ? "subtle" : "outline",
|
|
786
|
-
size: "
|
|
981
|
+
size: "sm",
|
|
787
982
|
"data-testid": "runner-log-context",
|
|
788
983
|
disabled: !filtering,
|
|
789
|
-
title: "lines of context kept either side of a match",
|
|
984
|
+
title: t("runner.ui.linesOfContextKeptEitherSideOfAMatch", "lines of context kept either side of a match"),
|
|
790
985
|
onClick: () => setContext((current) => current === 0 ? CONTEXT_LINES : 0),
|
|
791
|
-
|
|
792
|
-
children: `± ${String(context)} lines`
|
|
986
|
+
children: t("runner.ui.contextLines", "± {count} lines", { count: context })
|
|
793
987
|
}),
|
|
794
988
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
795
989
|
/* @__PURE__ */ jsxs("span", {
|
|
796
990
|
"data-testid": "runner-log-stats",
|
|
797
991
|
className: "min-w-0 basis-full truncate text-sm text-po-dim sm:basis-auto",
|
|
798
|
-
children: [slice === void 0 ? "reading…" : filtering ?
|
|
992
|
+
children: [slice === void 0 ? t("runner.ui.readingProgress", "reading…") : filtering ? t("runner.ui.matchingLines", "{count} matching of {total} lines", {
|
|
993
|
+
count: String(slice.lineCount),
|
|
994
|
+
total: slice.totalLines.toLocaleString(locale)
|
|
995
|
+
}) : live ? t("runner.ui.tailingLines", "Tailing last {count} of {total} lines", {
|
|
996
|
+
count: String(view.lines.length),
|
|
997
|
+
total: (slice.totalLines + (live ? appended.length : 0)).toLocaleString(locale)
|
|
998
|
+
}) : t("runner.ui.showingLines", "Showing last {count} of {total} lines", {
|
|
999
|
+
count: String(view.lines.length),
|
|
1000
|
+
total: (slice.totalLines + (live ? appended.length : 0)).toLocaleString(locale)
|
|
1001
|
+
}), view.hidden > 0 ? t("runner.ui.olderHidden", " · {count} older hidden", { count: view.hidden.toLocaleString(locale) }) : ""]
|
|
799
1002
|
}),
|
|
800
1003
|
/* @__PURE__ */ jsx(Button, {
|
|
801
1004
|
variant: live ? "subtle" : "outline",
|
|
802
|
-
size: "
|
|
1005
|
+
size: "sm",
|
|
803
1006
|
"data-testid": "runner-log-follow",
|
|
804
1007
|
"aria-pressed": live,
|
|
805
1008
|
disabled: filtering || slice?.running !== true,
|
|
806
|
-
title: filtering ? "a filtered view is a snapshot; clear the query to follow" : "follow the log as it grows",
|
|
1009
|
+
title: filtering ? t("runner.ui.aFilteredViewIsASnapshotClearTheQueryToFollow", "a filtered view is a snapshot; clear the query to follow") : t("runner.ui.followTheLogAsItGrows", "follow the log as it grows"),
|
|
807
1010
|
onClick: () => setFollowing((current) => !current),
|
|
808
|
-
|
|
809
|
-
children: filtering ? "follow · paused" : "follow"
|
|
1011
|
+
children: filtering ? t("runner.ui.pausedWhileSearchingLabel", "Paused while searching") : live ? t("runner.ui.followingLabel", "Following") : t("runner.ui.followLabel", "Follow")
|
|
810
1012
|
})
|
|
811
1013
|
]
|
|
812
1014
|
}),
|
|
@@ -819,18 +1021,18 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
819
1021
|
className: "h-full overflow-auto bg-po-deep px-3 py-3 sm:px-[26px]",
|
|
820
1022
|
children: [error !== void 0 ? /* @__PURE__ */ jsx("p", {
|
|
821
1023
|
"data-testid": "runner-log-error",
|
|
822
|
-
className: "text-
|
|
1024
|
+
className: "text-sm text-po-red",
|
|
823
1025
|
children: error
|
|
824
1026
|
}) : slice === void 0 ? /* @__PURE__ */ jsx("p", {
|
|
825
1027
|
"data-testid": "runner-log-reading",
|
|
826
1028
|
className: "text-sm text-po-dim",
|
|
827
|
-
children: "reading…"
|
|
1029
|
+
children: t("runner.ui.readingProgress", "reading…")
|
|
828
1030
|
}) : slice.exists === false ? /* @__PURE__ */ jsx("p", {
|
|
829
1031
|
className: "text-sm text-po-dim",
|
|
830
|
-
children: "
|
|
1032
|
+
children: t("runner.ui.thisRunnerHasNotPrintedAnythingYetLabel", "This runner has not printed anything yet.")
|
|
831
1033
|
}) : view.lines.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
832
1034
|
className: "text-sm text-po-dim",
|
|
833
|
-
children: filtering ? "
|
|
1035
|
+
children: filtering ? t("runner.ui.nothingMatchedLabel", "Nothing matched.") : t("runner.ui.theLogIsEmptyLabel", "The log is empty.")
|
|
834
1036
|
}) : view.lines.map((line, index) => {
|
|
835
1037
|
const number = numbers[index];
|
|
836
1038
|
const previous = numbers[index - 1];
|
|
@@ -838,138 +1040,72 @@ function RunnerLogPanel({ sessionId, runId, sendSessionFrame }) {
|
|
|
838
1040
|
return /* @__PURE__ */ jsxs(Fragment, { children: [gap ? /* @__PURE__ */ jsx("div", {
|
|
839
1041
|
"data-testid": "runner-log-gap",
|
|
840
1042
|
"aria-hidden": true,
|
|
841
|
-
className: "select-none py-0.5 pl-
|
|
1043
|
+
className: "select-none py-0.5 pl-14 text-sm leading-relaxed text-po-faint",
|
|
842
1044
|
children: "⋯"
|
|
843
1045
|
}) : null, /* @__PURE__ */ jsx(LogRow, {
|
|
844
1046
|
number,
|
|
845
1047
|
line,
|
|
846
|
-
matched: filtering && isMatch(line, query, ignoreCase)
|
|
1048
|
+
matched: filtering && isMatch(line, query, ignoreCase),
|
|
1049
|
+
dimmed: filtering && !isMatch(line, query, ignoreCase)
|
|
847
1050
|
})] }, number ?? `row-${String(index)}`);
|
|
848
1051
|
}), /* @__PURE__ */ jsx("div", { ref: bottom })]
|
|
849
1052
|
}), live && !pinned ? /* @__PURE__ */ jsx(Button, {
|
|
850
1053
|
variant: "subtle",
|
|
851
|
-
size: "
|
|
1054
|
+
size: "sm",
|
|
852
1055
|
"data-testid": "runner-log-jump",
|
|
853
|
-
title: "scroll back to the newest lines and keep following",
|
|
1056
|
+
title: t("runner.ui.scrollBackToTheNewestLinesAndKeepFollowing", "scroll back to the newest lines and keep following"),
|
|
854
1057
|
onClick: () => {
|
|
855
1058
|
setPinned(true);
|
|
856
|
-
bottom.current?.scrollIntoView({ block: "end" });
|
|
857
|
-
},
|
|
858
|
-
className: "absolute bottom-3 right-3
|
|
859
|
-
children: "
|
|
860
|
-
}) : null]
|
|
861
|
-
}),
|
|
862
|
-
/* @__PURE__ */ jsxs("div", {
|
|
863
|
-
className: "flex h-8 shrink-0 items-center gap-2.5 border-t border-po-border-soft px-3 sm:px-[26px]",
|
|
864
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
865
|
-
"data-testid": "runner-log-path",
|
|
866
|
-
className: "min-w-0 flex-1 truncate font-mono text-sm text-po-dim",
|
|
867
|
-
children: run?.logPath ?? slice?.path ?? ""
|
|
868
|
-
}), slice !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
869
|
-
className: "shrink-0 text-sm text-po-dim",
|
|
870
|
-
children: formatSize$1(slice.fileSize)
|
|
871
|
-
}) : null]
|
|
872
|
-
})
|
|
873
|
-
]
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
//#endregion
|
|
877
|
-
//#region src/extensions/workspaces/sessions/(frontend)/_lib/screenApi.ts
|
|
878
|
-
/**
|
|
879
|
-
* The page's half of the attached pane.
|
|
880
|
-
*
|
|
881
|
-
* Two directions over two mechanisms, because the hub proxies requests and
|
|
882
|
-
* server-sent events but cannot upgrade a socket: pane bytes arrive on an
|
|
883
|
-
* EventSource, and keystrokes go back as ordinary POSTs. Both addresses come
|
|
884
|
-
* from the generated client: the stream route offers a URL and no call method,
|
|
885
|
-
* which is exactly what an EventSource wants and all it can be given.
|
|
886
|
-
*/
|
|
887
|
-
/** Turns one base64 chunk back into the bytes a terminal was sent. */
|
|
888
|
-
function decodeChunk(chunk) {
|
|
889
|
-
const binary = atob(chunk);
|
|
890
|
-
const bytes = new Uint8Array(binary.length);
|
|
891
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
892
|
-
return bytes;
|
|
893
|
-
}
|
|
894
|
-
/** Attempts before a dropped screen stream is reported as lost rather than retried. */
|
|
895
|
-
const MAX_RETRIES = 5;
|
|
896
|
-
const RETRY_BASE_MS = 500;
|
|
897
|
-
function isRecord$1(value) {
|
|
898
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
899
|
-
}
|
|
900
|
-
function watchRunnerScreen(sessionId, runId, from, handlers) {
|
|
901
|
-
let offset = from;
|
|
902
|
-
let retries = 0;
|
|
903
|
-
let closed = false;
|
|
904
|
-
let source;
|
|
905
|
-
let timer;
|
|
906
|
-
const open = () => {
|
|
907
|
-
if (closed) return;
|
|
908
|
-
const current = new EventSource(api.session(sessionId).screenStream.url({
|
|
909
|
-
params: { [RUN_ID_PARAM]: runId },
|
|
910
|
-
query: { [RUNNER_LOG_PARAMS.from]: offset }
|
|
911
|
-
}));
|
|
912
|
-
source = current;
|
|
913
|
-
current.addEventListener(RUNNER_SCREEN_EVENT, (message) => {
|
|
914
|
-
let parsed;
|
|
915
|
-
try {
|
|
916
|
-
parsed = JSON.parse(message.data);
|
|
917
|
-
} catch {
|
|
918
|
-
return;
|
|
919
|
-
}
|
|
920
|
-
if (!isRecord$1(parsed) || typeof parsed.chunk !== "string") return;
|
|
921
|
-
const event = parsed;
|
|
922
|
-
if (typeof event.offset === "number") offset = event.offset;
|
|
923
|
-
retries = 0;
|
|
924
|
-
if (event.ended === true) {
|
|
925
|
-
closed = true;
|
|
926
|
-
current.close();
|
|
927
|
-
}
|
|
928
|
-
handlers.onEvent(event);
|
|
929
|
-
});
|
|
930
|
-
current.addEventListener("error", () => {
|
|
931
|
-
current.close();
|
|
932
|
-
if (closed) return;
|
|
933
|
-
retries += 1;
|
|
934
|
-
if (retries > MAX_RETRIES) {
|
|
935
|
-
handlers.onLost();
|
|
936
|
-
return;
|
|
937
|
-
}
|
|
938
|
-
timer = setTimeout(open, RETRY_BASE_MS * 2 ** (retries - 1));
|
|
939
|
-
});
|
|
940
|
-
};
|
|
941
|
-
open();
|
|
942
|
-
return { close: () => {
|
|
943
|
-
closed = true;
|
|
944
|
-
if (timer !== void 0) clearTimeout(timer);
|
|
945
|
-
source?.close();
|
|
946
|
-
} };
|
|
1059
|
+
bottom.current?.scrollIntoView({ block: "end" });
|
|
1060
|
+
},
|
|
1061
|
+
className: "absolute bottom-3 right-3",
|
|
1062
|
+
children: t("runner.ui.jumpToLatestLabel", "Jump to latest")
|
|
1063
|
+
}) : null]
|
|
1064
|
+
}),
|
|
1065
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1066
|
+
className: "flex h-8 shrink-0 items-center gap-2.5 border-t border-po-border-soft px-3 sm:px-[26px]",
|
|
1067
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1068
|
+
"data-testid": "runner-log-path",
|
|
1069
|
+
className: "min-w-0 flex-1 truncate font-mono text-sm text-po-dim",
|
|
1070
|
+
children: run?.logPath ?? slice?.path ?? ""
|
|
1071
|
+
}), slice !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
1072
|
+
className: "shrink-0 text-sm text-po-dim",
|
|
1073
|
+
children: formatSize$1(Math.max(slice.fileSize, followedBytes))
|
|
1074
|
+
}) : null]
|
|
1075
|
+
})
|
|
1076
|
+
]
|
|
1077
|
+
});
|
|
947
1078
|
}
|
|
948
|
-
/**
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1079
|
+
/** Seconds below a minute, then minutes, hours and days, without rendering the log or activity panel. */
|
|
1080
|
+
function RunnerUptime({ run }) {
|
|
1081
|
+
const t = useT();
|
|
1082
|
+
const ref = useRef(null);
|
|
1083
|
+
const [mountedAt] = useState(Date.now);
|
|
1084
|
+
useEffect(() => {
|
|
1085
|
+
if (run.exit || run.state !== "running") return;
|
|
1086
|
+
const update = () => {
|
|
1087
|
+
const node = ref.current?.firstChild;
|
|
1088
|
+
if (node) node.nodeValue = formatRunnerUptime(run.startedAt, Date.now(), t);
|
|
1089
|
+
};
|
|
1090
|
+
update();
|
|
1091
|
+
const timer = setInterval(update, 1e3);
|
|
1092
|
+
return () => clearInterval(timer);
|
|
1093
|
+
}, [
|
|
1094
|
+
run.startedAt,
|
|
1095
|
+
run.state,
|
|
1096
|
+
run.exit,
|
|
1097
|
+
t
|
|
1098
|
+
]);
|
|
1099
|
+
return /* @__PURE__ */ jsx("span", {
|
|
1100
|
+
ref,
|
|
1101
|
+
className: "shrink-0 text-sm text-po-dim",
|
|
1102
|
+
children: formatRunnerUptime(run.startedAt, run.exit ? Date.parse(run.exit.finishedAt) : mountedAt, t)
|
|
1103
|
+
});
|
|
955
1104
|
}
|
|
956
1105
|
//#endregion
|
|
957
1106
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/RunnerShellPanel.tsx
|
|
958
|
-
const TAB_ID_PREFIX = "runner-shell-";
|
|
959
1107
|
/** Keystrokes are gathered for this long and sent as one request. */
|
|
960
1108
|
const FLUSH_MS = 30;
|
|
961
|
-
/** The temporary tab holding one interactive runner's pane. */
|
|
962
|
-
function runnerShellTab(run) {
|
|
963
|
-
const runId = run.id;
|
|
964
|
-
return {
|
|
965
|
-
id: `${TAB_ID_PREFIX}${runId}`,
|
|
966
|
-
label: `shell · ${run.name}`,
|
|
967
|
-
panel: (props) => /* @__PURE__ */ jsx(RunnerShellPanel, {
|
|
968
|
-
...props,
|
|
969
|
-
runId
|
|
970
|
-
})
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
1109
|
/**
|
|
974
1110
|
* An interactive runner's pane, attached.
|
|
975
1111
|
*
|
|
@@ -981,9 +1117,14 @@ function runnerShellTab(run) {
|
|
|
981
1117
|
*
|
|
982
1118
|
* xterm is loaded when the tab opens rather than with the plugin. Most sessions
|
|
983
1119
|
* never attach to anything, and an emulator is not a small thing to carry.
|
|
1120
|
+
*
|
|
1121
|
+
* Search reads the scrubbed log the sink writes beside the raw bytes, so it
|
|
1122
|
+
* hands over to the log view: `onSearch` when the panel is embedded, the
|
|
1123
|
+
* runner's log tab otherwise.
|
|
984
1124
|
*/
|
|
985
|
-
function RunnerShellPanel({ sessionId, runId }) {
|
|
986
|
-
const
|
|
1125
|
+
function RunnerShellPanel({ sessionId, runId, sendSessionFrame, openTransientTab, onSearch }) {
|
|
1126
|
+
const t = useT();
|
|
1127
|
+
const { runs, stopRequested } = useStore(runners.store, (state) => runners.select(state, sessionId));
|
|
987
1128
|
const run = runs.find((candidate) => candidate.id === runId);
|
|
988
1129
|
const [ended, setEnded] = useState(false);
|
|
989
1130
|
const [lost, setLost] = useState(false);
|
|
@@ -1021,12 +1162,13 @@ function RunnerShellPanel({ sessionId, runId }) {
|
|
|
1021
1162
|
}, FLUSH_MS);
|
|
1022
1163
|
};
|
|
1023
1164
|
const live = run?.state === "running" && !ended;
|
|
1165
|
+
const stopping = stopRequested.includes(runId);
|
|
1024
1166
|
return /* @__PURE__ */ jsxs("div", {
|
|
1025
1167
|
"data-testid": "runner-shell-panel",
|
|
1026
1168
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1027
1169
|
children: [
|
|
1028
1170
|
/* @__PURE__ */ jsxs("div", {
|
|
1029
|
-
className: "flex min-h-11 shrink-0 items-center gap-2
|
|
1171
|
+
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",
|
|
1030
1172
|
children: [
|
|
1031
1173
|
/* @__PURE__ */ jsx("span", {
|
|
1032
1174
|
"data-testid": "runner-shell-name",
|
|
@@ -1035,23 +1177,45 @@ function RunnerShellPanel({ sessionId, runId }) {
|
|
|
1035
1177
|
}),
|
|
1036
1178
|
/* @__PURE__ */ jsx(StatusBadge, {
|
|
1037
1179
|
tone: live ? "running" : "neutral",
|
|
1180
|
+
size: "md",
|
|
1038
1181
|
"data-testid": "runner-shell-state",
|
|
1039
|
-
children: live ? "
|
|
1182
|
+
children: live ? t("runner.ui.runningLabel", "Running") : t("runner.ui.endedLabel", "Ended")
|
|
1040
1183
|
}),
|
|
1184
|
+
run ? /* @__PURE__ */ jsx("span", {
|
|
1185
|
+
className: "min-w-0 truncate font-mono text-sm text-po-dim",
|
|
1186
|
+
children: run.command
|
|
1187
|
+
}) : null,
|
|
1041
1188
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
1042
1189
|
lost ? /* @__PURE__ */ jsx("span", {
|
|
1043
1190
|
"data-testid": "runner-shell-lost",
|
|
1044
|
-
className: "shrink-0 text-
|
|
1045
|
-
children: "
|
|
1191
|
+
className: "shrink-0 text-sm text-po-red",
|
|
1192
|
+
children: t("runner.ui.theConnectionToThisTerminalDroppedReopenTheRunnerToAttachAgainLabel", "The connection to this terminal dropped. Reopen the runner to attach again.")
|
|
1193
|
+
}) : null,
|
|
1194
|
+
run ? /* @__PURE__ */ jsxs(Button, {
|
|
1195
|
+
variant: "outline",
|
|
1196
|
+
size: "sm",
|
|
1197
|
+
"data-testid": "runner-shell-search",
|
|
1198
|
+
title: t("runner.ui.searchEverythingThisRunnerHasPrinted", "search everything this runner has printed"),
|
|
1199
|
+
onClick: () => onSearch ? onSearch() : openTransientTab(runnerLogTab(run)),
|
|
1200
|
+
className: "gap-1.5",
|
|
1201
|
+
children: [/* @__PURE__ */ jsx(SearchIcon, { className: "h-3.5 w-3.5" }), t("runner.ui.searchOutputLabel", "Search output")]
|
|
1046
1202
|
}) : null,
|
|
1047
1203
|
live ? /* @__PURE__ */ jsx(Button, {
|
|
1048
1204
|
variant: "outline",
|
|
1049
|
-
size: "
|
|
1205
|
+
size: "sm",
|
|
1050
1206
|
"data-testid": "runner-shell-interrupt",
|
|
1051
|
-
title: "send ctrl-c",
|
|
1207
|
+
title: t("runner.ui.sendCtrlc", "send ctrl-c"),
|
|
1052
1208
|
onClick: () => send(""),
|
|
1053
|
-
|
|
1054
|
-
|
|
1209
|
+
children: "Ctrl-C"
|
|
1210
|
+
}) : null,
|
|
1211
|
+
live && sessionId !== null ? /* @__PURE__ */ jsx(Button, {
|
|
1212
|
+
variant: stopping ? "outline" : "danger-outline",
|
|
1213
|
+
size: "sm",
|
|
1214
|
+
"data-testid": "runner-shell-stop",
|
|
1215
|
+
disabled: stopping,
|
|
1216
|
+
title: stopping ? t("runner.ui.stopRequestedTheRunnerReportsItsOwnExit", "stop requested; the runner reports its own exit") : t("runner.ui.askTheRuntimeToStopThisRunner", "ask the runtime to stop this runner"),
|
|
1217
|
+
onClick: () => requestRunnerStop(sendSessionFrame, sessionId, runId),
|
|
1218
|
+
children: stopping ? t("runner.ui.stoppingLabelProgress", "Stopping…") : t("runner.ui.stopLabel", "Stop")
|
|
1055
1219
|
}) : null
|
|
1056
1220
|
]
|
|
1057
1221
|
}),
|
|
@@ -1065,20 +1229,193 @@ function RunnerShellPanel({ sessionId, runId }) {
|
|
|
1065
1229
|
}), ready ? null : /* @__PURE__ */ jsx("p", {
|
|
1066
1230
|
"data-testid": "runner-shell-reading",
|
|
1067
1231
|
className: "text-sm text-po-dim",
|
|
1068
|
-
children: "attaching…"
|
|
1232
|
+
children: t("runner.ui.attachingProgress", "attaching…")
|
|
1069
1233
|
})]
|
|
1070
1234
|
}),
|
|
1071
1235
|
/* @__PURE__ */ jsx("div", {
|
|
1072
1236
|
className: "flex h-8 shrink-0 items-center border-t border-po-border-soft px-3 sm:px-[26px]",
|
|
1073
1237
|
children: /* @__PURE__ */ jsx("span", {
|
|
1074
1238
|
className: "min-w-0 flex-1 truncate text-sm text-po-dim",
|
|
1075
|
-
children: live ? "
|
|
1239
|
+
children: live ? t("runner.ui.terminalInputHint", "Typing goes straight to {name}. Ctrl-C stops what is running.", { name: run?.name ?? t("runner.ui.runnerFallback", "the runner") }) : t("runner.ui.thisRunnerHasEndedItsOutputStaysSearchableLabel", "This runner has ended. Its output stays searchable.")
|
|
1076
1240
|
})
|
|
1077
1241
|
})
|
|
1078
1242
|
]
|
|
1079
1243
|
});
|
|
1080
1244
|
}
|
|
1081
1245
|
//#endregion
|
|
1246
|
+
//#region src/extensions/workspaces/sessions/(frontend)/_components/RunnersPanel.tsx
|
|
1247
|
+
const LAUNCH_TIMEOUT_MS = 3e4;
|
|
1248
|
+
const RUNNERS_TAB_ID = "runner-runs";
|
|
1249
|
+
/** The temporary tab the dock's runners group opens from its own name. */
|
|
1250
|
+
function runnersTab() {
|
|
1251
|
+
return {
|
|
1252
|
+
id: RUNNERS_TAB_ID,
|
|
1253
|
+
label: t("runner.ui.runnersTab", "runners"),
|
|
1254
|
+
panel: RunnersPanel
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Everything this session has up, and the one place to start another.
|
|
1259
|
+
*
|
|
1260
|
+
* A runner is a shell: the bar takes a command and runs it on its own
|
|
1261
|
+
* terminal, or opens a plain shell when nothing was typed. The selected
|
|
1262
|
+
* runner is shown in place, as its terminal when it has one and as its log
|
|
1263
|
+
* when it does not (a command the agent backgrounded has no pane).
|
|
1264
|
+
*
|
|
1265
|
+
* Keep the feed's recently finished runners available here too: a UI-launched
|
|
1266
|
+
* command has no originating tool message from which to reopen its log.
|
|
1267
|
+
*/
|
|
1268
|
+
function RunnersPanel(props) {
|
|
1269
|
+
const t = useT();
|
|
1270
|
+
const { sessionId, sendSessionFrame } = props;
|
|
1271
|
+
const session = useStore(runners.store, (state) => runners.select(state, sessionId));
|
|
1272
|
+
const running = session.runs.filter((run) => run.state === "running");
|
|
1273
|
+
const [command, setCommand] = useState("");
|
|
1274
|
+
const [cwd, setCwd] = useState("");
|
|
1275
|
+
const [selectedId, setSelectedId] = useState(void 0);
|
|
1276
|
+
/** The terminal runner whose log is being searched instead of shown live. */
|
|
1277
|
+
const [searchingId, setSearchingId] = useState(void 0);
|
|
1278
|
+
const launchBaseline = useRef(null);
|
|
1279
|
+
/** What the pending launch ran, put back if the start fails. */
|
|
1280
|
+
const launchedCommand = useRef("");
|
|
1281
|
+
const launchTimeout = useRef(void 0);
|
|
1282
|
+
const selected = session.runs.find((run) => run.id === selectedId) ?? session.runs[0];
|
|
1283
|
+
const launch = () => {
|
|
1284
|
+
if (sessionId === null) return;
|
|
1285
|
+
launchBaseline.current = new Set(session.runs.map((run) => run.id));
|
|
1286
|
+
clearTimeout(launchTimeout.current);
|
|
1287
|
+
launchTimeout.current = setTimeout(() => {
|
|
1288
|
+
launchBaseline.current = null;
|
|
1289
|
+
}, LAUNCH_TIMEOUT_MS);
|
|
1290
|
+
requestRunnerStart(sendSessionFrame, sessionId, runnerRunRequest(command, cwd));
|
|
1291
|
+
launchedCommand.current = command;
|
|
1292
|
+
setCommand("");
|
|
1293
|
+
};
|
|
1294
|
+
useEffect(() => {
|
|
1295
|
+
const baseline = launchBaseline.current;
|
|
1296
|
+
if (baseline === null) return;
|
|
1297
|
+
const started = session.runs.find((run) => !baseline.has(run.id));
|
|
1298
|
+
if (!started) return;
|
|
1299
|
+
launchBaseline.current = null;
|
|
1300
|
+
clearTimeout(launchTimeout.current);
|
|
1301
|
+
setSelectedId(started.id);
|
|
1302
|
+
}, [session.runs]);
|
|
1303
|
+
const failureId = session.startFailure?.id;
|
|
1304
|
+
useEffect(() => {
|
|
1305
|
+
if (failureId === void 0 || launchBaseline.current === null) return;
|
|
1306
|
+
launchBaseline.current = null;
|
|
1307
|
+
clearTimeout(launchTimeout.current);
|
|
1308
|
+
setCommand(launchedCommand.current);
|
|
1309
|
+
}, [failureId]);
|
|
1310
|
+
useEffect(() => () => clearTimeout(launchTimeout.current), []);
|
|
1311
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1312
|
+
"data-testid": "runners-panel",
|
|
1313
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
1314
|
+
children: [
|
|
1315
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1316
|
+
className: "flex h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft px-3 sm:px-[26px]",
|
|
1317
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1318
|
+
className: "text-lg font-semibold text-po-hi",
|
|
1319
|
+
children: t("runner.ui.runnersLabel", "Runners")
|
|
1320
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1321
|
+
"data-testid": "runners-panel-count",
|
|
1322
|
+
className: "text-sm text-po-dim",
|
|
1323
|
+
children: running.length === 0 ? t("runner.ui.nothingRunningLabel", "Nothing running") : t("runner.ui.runningCount", "{count} running", { count: running.length })
|
|
1324
|
+
})]
|
|
1325
|
+
}),
|
|
1326
|
+
sessionId === null ? null : /* @__PURE__ */ jsx(RunnerCommandBar, {
|
|
1327
|
+
command,
|
|
1328
|
+
onCommandChange: setCommand,
|
|
1329
|
+
cwd,
|
|
1330
|
+
onCwdChange: setCwd,
|
|
1331
|
+
folders: running.map((run) => run.cwd),
|
|
1332
|
+
...session.sessionDirectory === void 0 ? {} : { sessionDirectory: session.sessionDirectory },
|
|
1333
|
+
...session.startFailure === void 0 ? {} : { problem: session.startFailure.message },
|
|
1334
|
+
onLaunch: launch
|
|
1335
|
+
}),
|
|
1336
|
+
selected === void 0 && sessionId !== null && session.loaded !== true ? /* @__PURE__ */ jsx(LoadingState, {
|
|
1337
|
+
"data-testid": "runners-panel-loading",
|
|
1338
|
+
className: "px-4 py-8",
|
|
1339
|
+
label: t("runner.ui.loadingRunnersLabel", "Loading runners")
|
|
1340
|
+
}) : selected === void 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
1341
|
+
"data-testid": "runners-panel-empty",
|
|
1342
|
+
className: "px-4 py-8",
|
|
1343
|
+
title: t("runner.ui.nothingRunningYetLabel", "Nothing running yet"),
|
|
1344
|
+
description: sessionId === null ? t("runner.ui.openSessionHint", "Open a session to start a runner.") : t("runner.ui.launchHint", "Type a command above, like pnpm dev, and it opens here as a live terminal.")
|
|
1345
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
1346
|
+
"data-testid": "runners-panel-picker",
|
|
1347
|
+
className: "flex shrink-0 flex-wrap gap-1.5 px-3 pt-3 sm:px-[26px]",
|
|
1348
|
+
children: session.runs.map((run) => /* @__PURE__ */ jsxs(Button, {
|
|
1349
|
+
variant: run === selected ? "subtle" : "ghost",
|
|
1350
|
+
size: "sm",
|
|
1351
|
+
"data-testid": `runners-panel-pick-${run.id}`,
|
|
1352
|
+
"aria-pressed": run === selected,
|
|
1353
|
+
title: run.command,
|
|
1354
|
+
onClick: () => setSelectedId(run.id),
|
|
1355
|
+
className: `gap-1.5 ${run === selected ? "text-po-hi" : ""}`,
|
|
1356
|
+
children: [/* @__PURE__ */ jsx(Dot, {
|
|
1357
|
+
tone: run.state === "running" ? "yellow" : "muted",
|
|
1358
|
+
pulse: run.state === "running"
|
|
1359
|
+
}), run.name]
|
|
1360
|
+
}, run.id))
|
|
1361
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1362
|
+
className: "mt-3 flex min-h-0 flex-1 flex-col border-t border-po-border-soft",
|
|
1363
|
+
children: selected.interactive && selected.state === "running" && searchingId !== selected.id ? /* @__PURE__ */ jsx(RunnerShellPanel, {
|
|
1364
|
+
...props,
|
|
1365
|
+
runId: selected.id,
|
|
1366
|
+
onSearch: () => setSearchingId(selected.id)
|
|
1367
|
+
}, selected.id) : /* @__PURE__ */ jsx(RunnerLogPanel, {
|
|
1368
|
+
...props,
|
|
1369
|
+
runId: selected.id,
|
|
1370
|
+
...selected.interactive && selected.state === "running" ? { onTerminal: () => setSearchingId(void 0) } : {}
|
|
1371
|
+
}, selected.id)
|
|
1372
|
+
})] })
|
|
1373
|
+
]
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/runners.web.ts
|
|
1378
|
+
var runners_web_default = defineActivityGroup({
|
|
1379
|
+
label: (t) => t("runner.activityGroup.label", "Runners"),
|
|
1380
|
+
keys: "r l",
|
|
1381
|
+
icon: PlayCircleIcon,
|
|
1382
|
+
activeSource: runnerActivitySource,
|
|
1383
|
+
transientTab: runnersTab
|
|
1384
|
+
});
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region src/extensions/workspaces/sessions/(frontend)/channel/runner-runs.web.ts
|
|
1387
|
+
var runner_runs_web_default = defineChannelFile(runnerRunsChannel);
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/extensions/workspaces/sessions/(frontend)/fill/Runner.help.guides.web.ts
|
|
1390
|
+
var Runner_help_guides_web_default = defineFill({
|
|
1391
|
+
slot: "help.guides",
|
|
1392
|
+
id: "Runner",
|
|
1393
|
+
order: 160,
|
|
1394
|
+
data: {
|
|
1395
|
+
version: 1,
|
|
1396
|
+
category: "tools",
|
|
1397
|
+
labelKey: "runner.guides.runner",
|
|
1398
|
+
label: "Runner",
|
|
1399
|
+
guides: [{
|
|
1400
|
+
id: "about",
|
|
1401
|
+
questionKey: "runner.guides.whatDoesRunnerDo",
|
|
1402
|
+
question: "What does Runner do?",
|
|
1403
|
+
order: 0,
|
|
1404
|
+
answerKey: "runner.guides.runnerRunsShellCommandsForPoAndKeepsFullLogsLongCommandsCanContinueInTheBackgroundWhilePoWorksOnOtherThings",
|
|
1405
|
+
answer: "Runner runs shell commands for Po and keeps full logs. Long commands can continue in the background while Po works on other things.",
|
|
1406
|
+
keywords: ["shell", "background"]
|
|
1407
|
+
}, {
|
|
1408
|
+
id: "use",
|
|
1409
|
+
questionKey: "runner.guides.howDoICheckOrStopACommand",
|
|
1410
|
+
question: "How do I check or stop a command?",
|
|
1411
|
+
order: 1,
|
|
1412
|
+
answerKey: "runner.guides.askPoToCheckARunnerReadItsFullLogOrStopItARunnerIDMeansWorkIsBeingTrackedNotThatItSucceeded",
|
|
1413
|
+
answer: "Ask Po to check a runner, read its full log, or stop it. A runner ID means work is being tracked, not that it succeeded.",
|
|
1414
|
+
keywords: ["logs", "cancel"]
|
|
1415
|
+
}]
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
//#endregion
|
|
1082
1419
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/runnerTail.ts
|
|
1083
1420
|
/**
|
|
1084
1421
|
* The newest line a running runner has written, for a row that has one line to
|
|
@@ -1130,16 +1467,13 @@ function useRunnerTail(sessionId, runId, running) {
|
|
|
1130
1467
|
text: initial
|
|
1131
1468
|
});
|
|
1132
1469
|
if (!result.slice.running) return;
|
|
1133
|
-
follow = followRunnerLog(sessionId, runId, result.slice.completeBytes, {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
},
|
|
1141
|
-
onLost: () => void 0
|
|
1142
|
-
});
|
|
1470
|
+
follow = followRunnerLog(sessionId, runId, result.slice.completeBytes, { onEvent: (event) => {
|
|
1471
|
+
const next = plainTailLine(event.lines);
|
|
1472
|
+
if (live && next !== void 0) setTail({
|
|
1473
|
+
runId,
|
|
1474
|
+
text: next
|
|
1475
|
+
});
|
|
1476
|
+
} });
|
|
1143
1477
|
});
|
|
1144
1478
|
return () => {
|
|
1145
1479
|
live = false;
|
|
@@ -1154,262 +1488,36 @@ function useRunnerTail(sessionId, runId, running) {
|
|
|
1154
1488
|
return running && tail?.runId === runId ? tail.text : void 0;
|
|
1155
1489
|
}
|
|
1156
1490
|
//#endregion
|
|
1157
|
-
//#region src/extensions/workspaces/sessions/(frontend)/_components/RunnersPanel.tsx
|
|
1158
|
-
const TICK_MS$1 = 1e4;
|
|
1159
|
-
const SHELL_LAUNCH_TIMEOUT_MS = 3e4;
|
|
1160
|
-
const RUNNERS_TAB_ID = "runner-runs";
|
|
1161
|
-
/** The temporary tab the dock's runners group opens from its own name. */
|
|
1162
|
-
function runnersTab() {
|
|
1163
|
-
return {
|
|
1164
|
-
id: RUNNERS_TAB_ID,
|
|
1165
|
-
label: "runners",
|
|
1166
|
-
panel: RunnersPanel
|
|
1167
|
-
};
|
|
1168
|
-
}
|
|
1169
|
-
/**
|
|
1170
|
-
* Everything this session has up, one card each.
|
|
1171
|
-
*
|
|
1172
|
-
* The dock's rail gives a runner one line, which is enough to notice it and
|
|
1173
|
-
* not enough to work with it. This is the same set with room: the command in
|
|
1174
|
-
* full, where it runs, and the last thing it said.
|
|
1175
|
-
*
|
|
1176
|
-
* Running runners only, the same rule the rail follows. A finished run leaves
|
|
1177
|
-
* the moment it exits, because this answers "what is happening"; its log stays
|
|
1178
|
-
* readable from its own tab, and `po-runner list` is where history lives.
|
|
1179
|
-
*/
|
|
1180
|
-
function RunnersPanel({ sessionId, sendSessionFrame, openTransientTab }) {
|
|
1181
|
-
const session = useStore(runners.store, (state) => runners.select(state, sessionId));
|
|
1182
|
-
const running = session.runs.filter((run) => run.state === "running");
|
|
1183
|
-
const [now, setNow] = useState(() => Date.now());
|
|
1184
|
-
const [launching, setLaunching] = useState(false);
|
|
1185
|
-
const shellBaseline = useRef(null);
|
|
1186
|
-
const shellLaunchTimeout = useRef(void 0);
|
|
1187
|
-
const defaultCwd = running[0]?.cwd;
|
|
1188
|
-
const startShell = () => {
|
|
1189
|
-
if (sessionId === null) return;
|
|
1190
|
-
shellBaseline.current = new Set(session.runs.map((run) => run.id));
|
|
1191
|
-
clearTimeout(shellLaunchTimeout.current);
|
|
1192
|
-
shellLaunchTimeout.current = setTimeout(() => {
|
|
1193
|
-
shellBaseline.current = null;
|
|
1194
|
-
}, SHELL_LAUNCH_TIMEOUT_MS);
|
|
1195
|
-
requestRunnerStart(sendSessionFrame, sessionId, RUNNER_SHELL_REQUEST);
|
|
1196
|
-
};
|
|
1197
|
-
useEffect(() => {
|
|
1198
|
-
const timer = setInterval(() => setNow(Date.now()), TICK_MS$1);
|
|
1199
|
-
return () => clearInterval(timer);
|
|
1200
|
-
}, []);
|
|
1201
|
-
useEffect(() => {
|
|
1202
|
-
const baseline = shellBaseline.current;
|
|
1203
|
-
if (baseline === null) return;
|
|
1204
|
-
const shell = session.runs.find((run) => run.state === "running" && run.interactive && !baseline.has(run.id));
|
|
1205
|
-
if (!shell) return;
|
|
1206
|
-
shellBaseline.current = null;
|
|
1207
|
-
clearTimeout(shellLaunchTimeout.current);
|
|
1208
|
-
openTransientTab(runnerShellTab(shell));
|
|
1209
|
-
}, [openTransientTab, session.runs]);
|
|
1210
|
-
useEffect(() => () => clearTimeout(shellLaunchTimeout.current), []);
|
|
1211
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1212
|
-
"data-testid": "runners-panel",
|
|
1213
|
-
className: "flex min-h-0 flex-1 flex-col overflow-auto",
|
|
1214
|
-
children: [
|
|
1215
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1216
|
-
className: "flex min-h-11 shrink-0 items-center gap-2.5 border-b border-po-border-soft px-3 sm:h-11 sm:px-[26px]",
|
|
1217
|
-
children: [
|
|
1218
|
-
/* @__PURE__ */ jsx("span", {
|
|
1219
|
-
className: "text-lg font-semibold text-po-hi",
|
|
1220
|
-
children: "runners"
|
|
1221
|
-
}),
|
|
1222
|
-
/* @__PURE__ */ jsx("span", {
|
|
1223
|
-
"data-testid": "runners-panel-count",
|
|
1224
|
-
className: "text-sm text-po-dim",
|
|
1225
|
-
children: running.length === 0 ? "nothing running" : `${String(running.length)} running`
|
|
1226
|
-
}),
|
|
1227
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
1228
|
-
sessionId === null ? null : /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
1229
|
-
asChild: true,
|
|
1230
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
1231
|
-
variant: "ghost",
|
|
1232
|
-
size: "icon",
|
|
1233
|
-
"data-testid": "runners-panel-launch",
|
|
1234
|
-
title: "launch a runner",
|
|
1235
|
-
"aria-label": "launch a runner",
|
|
1236
|
-
className: "text-po-faint hover:text-po-hi",
|
|
1237
|
-
children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-3 w-3" })
|
|
1238
|
-
})
|
|
1239
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
1240
|
-
align: "end",
|
|
1241
|
-
"data-testid": "runners-panel-launch-menu",
|
|
1242
|
-
children: [/* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
1243
|
-
"data-testid": "runners-panel-start-shell",
|
|
1244
|
-
onSelect: startShell,
|
|
1245
|
-
children: "start shell"
|
|
1246
|
-
}), /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
1247
|
-
"data-testid": "runners-panel-run-command",
|
|
1248
|
-
onSelect: () => setLaunching(true),
|
|
1249
|
-
children: "run command"
|
|
1250
|
-
})]
|
|
1251
|
-
})] })
|
|
1252
|
-
]
|
|
1253
|
-
}),
|
|
1254
|
-
running.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
1255
|
-
"data-testid": "runners-panel-empty",
|
|
1256
|
-
className: "px-4 py-8",
|
|
1257
|
-
title: "nothing running",
|
|
1258
|
-
description: "a command that outlives its turn moves to a runner and appears here while it works.",
|
|
1259
|
-
children: sessionId === null ? null : /* @__PURE__ */ jsx(Button, {
|
|
1260
|
-
variant: "outline",
|
|
1261
|
-
size: "xs",
|
|
1262
|
-
"data-testid": "runners-panel-launch-empty",
|
|
1263
|
-
onClick: () => setLaunching(true),
|
|
1264
|
-
className: "px-2 ",
|
|
1265
|
-
children: "launch a runner"
|
|
1266
|
-
})
|
|
1267
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
1268
|
-
"data-testid": "runners-panel-grid",
|
|
1269
|
-
className: "grid grid-cols-1 gap-2.5 px-3 py-3 sm:grid-cols-2 sm:px-[26px] xl:grid-cols-3",
|
|
1270
|
-
children: running.map((run) => /* @__PURE__ */ jsx(RunnerCard, {
|
|
1271
|
-
run,
|
|
1272
|
-
now,
|
|
1273
|
-
stopRequested: session.stopRequested.includes(run.id),
|
|
1274
|
-
sessionId,
|
|
1275
|
-
sendSessionFrame,
|
|
1276
|
-
openTransientTab
|
|
1277
|
-
}, run.id))
|
|
1278
|
-
}),
|
|
1279
|
-
launching && sessionId !== null ? /* @__PURE__ */ jsx(LaunchRunnerDialog, {
|
|
1280
|
-
sessionId,
|
|
1281
|
-
sendSessionFrame,
|
|
1282
|
-
...defaultCwd === void 0 ? {} : { defaultCwd },
|
|
1283
|
-
onClose: () => setLaunching(false)
|
|
1284
|
-
}) : null
|
|
1285
|
-
]
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
/**
|
|
1289
|
-
* One running runner. Its own component because the tail line is a
|
|
1290
|
-
* subscription per card, and a card that leaves the grid closes it.
|
|
1291
|
-
*/
|
|
1292
|
-
function RunnerCard({ run, now, stopRequested, sessionId, sendSessionFrame, openTransientTab }) {
|
|
1293
|
-
const tail = useRunnerTail(sessionId, run.id, run.state === "running");
|
|
1294
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1295
|
-
"data-testid": `runners-card-${run.id}`,
|
|
1296
|
-
className: "flex min-w-0 flex-col gap-1.5 rounded-md border border-po-border-soft bg-po-panel p-2.5",
|
|
1297
|
-
children: [
|
|
1298
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1299
|
-
className: "flex min-w-0 items-center gap-1.5",
|
|
1300
|
-
children: [
|
|
1301
|
-
/* @__PURE__ */ jsx(Dot, {
|
|
1302
|
-
tone: "yellow",
|
|
1303
|
-
pulse: true
|
|
1304
|
-
}),
|
|
1305
|
-
/* @__PURE__ */ jsx("span", {
|
|
1306
|
-
className: "min-w-0 flex-1 truncate text-base font-semibold text-po-hi",
|
|
1307
|
-
children: run.name
|
|
1308
|
-
}),
|
|
1309
|
-
/* @__PURE__ */ jsxs("span", {
|
|
1310
|
-
className: "shrink-0 text-sm text-po-dim",
|
|
1311
|
-
children: [formatRunnerUptime(run.startedAt, now), run.interactive ? " · tty" : ""]
|
|
1312
|
-
})
|
|
1313
|
-
]
|
|
1314
|
-
}),
|
|
1315
|
-
/* @__PURE__ */ jsx("span", {
|
|
1316
|
-
className: "min-w-0 break-all font-mono text-sm leading-normal text-po-dim",
|
|
1317
|
-
children: run.command
|
|
1318
|
-
}),
|
|
1319
|
-
/* @__PURE__ */ jsx("span", {
|
|
1320
|
-
className: "min-w-0 truncate font-mono text-sm text-po-dim",
|
|
1321
|
-
children: run.cwd
|
|
1322
|
-
}),
|
|
1323
|
-
/* @__PURE__ */ jsx("span", {
|
|
1324
|
-
"data-testid": `runners-card-detail-${run.id}`,
|
|
1325
|
-
"data-detail": tail === void 0 ? "command" : "tail",
|
|
1326
|
-
className: "min-w-0 truncate text-sm text-po-dim",
|
|
1327
|
-
children: tail ?? "…"
|
|
1328
|
-
}),
|
|
1329
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1330
|
-
className: "flex items-center gap-1.5 pt-0.5",
|
|
1331
|
-
children: [
|
|
1332
|
-
/* @__PURE__ */ jsx(Button, {
|
|
1333
|
-
variant: "outline",
|
|
1334
|
-
size: "xs",
|
|
1335
|
-
"data-testid": `runners-card-log-${run.id}`,
|
|
1336
|
-
title: "open this runner's log",
|
|
1337
|
-
onClick: () => openTransientTab(runnerLogTab(run)),
|
|
1338
|
-
className: "px-2 ",
|
|
1339
|
-
children: "log"
|
|
1340
|
-
}),
|
|
1341
|
-
run.interactive && sessionId !== null ? /* @__PURE__ */ jsx(Button, {
|
|
1342
|
-
variant: "outline",
|
|
1343
|
-
size: "xs",
|
|
1344
|
-
"data-testid": `runners-card-shell-${run.id}`,
|
|
1345
|
-
title: "attach to this runner's terminal",
|
|
1346
|
-
onClick: () => openTransientTab(runnerShellTab(run)),
|
|
1347
|
-
className: "px-2 ",
|
|
1348
|
-
children: "shell"
|
|
1349
|
-
}) : null,
|
|
1350
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
|
|
1351
|
-
sessionId !== null ? /* @__PURE__ */ jsx(Button, {
|
|
1352
|
-
variant: stopRequested ? "outline" : "danger-outline",
|
|
1353
|
-
size: "xs",
|
|
1354
|
-
"data-testid": `runners-card-stop-${run.id}`,
|
|
1355
|
-
disabled: stopRequested,
|
|
1356
|
-
title: stopRequested ? "stop requested; the runner reports its own exit" : "ask the runtime to stop this runner",
|
|
1357
|
-
onClick: () => requestRunnerStop(sendSessionFrame, sessionId, run.id),
|
|
1358
|
-
className: "px-2 ",
|
|
1359
|
-
children: stopRequested ? "stopping…" : "stop"
|
|
1360
|
-
}) : null
|
|
1361
|
-
]
|
|
1362
|
-
})
|
|
1363
|
-
]
|
|
1364
|
-
});
|
|
1365
|
-
}
|
|
1366
|
-
//#endregion
|
|
1367
|
-
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/runners.web.ts
|
|
1368
|
-
var runners_web_default = defineActivityGroup({
|
|
1369
|
-
keys: "r l",
|
|
1370
|
-
icon: PlayCircleIcon,
|
|
1371
|
-
statusKey: "po-runner-runners",
|
|
1372
|
-
activeSource: runnerActivitySource,
|
|
1373
|
-
transientTab: runnersTab,
|
|
1374
|
-
order: 20
|
|
1375
|
-
});
|
|
1376
|
-
//#endregion
|
|
1377
|
-
//#region src/extensions/workspaces/sessions/(frontend)/channel/runner-runs.web.ts
|
|
1378
|
-
var runner_runs_web_default = defineChannelFile(runnerRunsChannel);
|
|
1379
|
-
//#endregion
|
|
1380
1491
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_components/RunnersActivitySection.tsx
|
|
1381
|
-
const TICK_MS = 1e4;
|
|
1382
1492
|
/**
|
|
1383
1493
|
* The runners group's body in the activity dock: what this session has up
|
|
1384
1494
|
* right now.
|
|
1385
1495
|
*
|
|
1386
|
-
* Only running
|
|
1496
|
+
* Only runners running for more than three seconds are listed. A finished one leaves the moment it exits,
|
|
1387
1497
|
* because the dock answers "what is happening", and a rail that keeps ten
|
|
1388
1498
|
* completed playwright calls around buries the one command still working. The
|
|
1389
1499
|
* runtime keeps every record; `po-runner list` and the run's own log tab are
|
|
1390
1500
|
* where a finished run is read.
|
|
1391
1501
|
*/
|
|
1392
1502
|
function RunnersActivitySection({ sessionId, sendSessionFrame, openTransientTab }) {
|
|
1503
|
+
const t = useT();
|
|
1393
1504
|
const session = useStore(runners.store, (state) => runners.select(state, sessionId));
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
const timer = setInterval(() => setNow(Date.now()), TICK_MS);
|
|
1398
|
-
return () => clearInterval(timer);
|
|
1399
|
-
}, []);
|
|
1505
|
+
const visibleCount = () => session.runs.filter((run) => isRunnerActivityVisible(run)).length;
|
|
1506
|
+
useSyncExternalStore(runnerActivitySource.subscribe, visibleCount, visibleCount);
|
|
1507
|
+
const running = session.runs.filter((run) => isRunnerActivityVisible(run));
|
|
1400
1508
|
if (running.length === 0) return /* @__PURE__ */ jsxs("div", {
|
|
1401
1509
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1",
|
|
1402
1510
|
children: [/* @__PURE__ */ jsx("p", {
|
|
1403
1511
|
"data-testid": "activity-summary-runners",
|
|
1404
1512
|
className: "text-sm text-po-dim",
|
|
1405
|
-
children: "Idle"
|
|
1513
|
+
children: t("runner.ui.idleLabel", "Idle")
|
|
1406
1514
|
}), sessionId === null ? null : /* @__PURE__ */ jsxs(Button, {
|
|
1407
1515
|
variant: "link",
|
|
1408
1516
|
size: "sm",
|
|
1409
1517
|
"data-testid": "activity-runner-launch",
|
|
1410
1518
|
className: "h-auto gap-1 px-0 text-po-green",
|
|
1411
1519
|
onClick: () => openTransientTab(runnersTab()),
|
|
1412
|
-
children: ["Launch a runner", /* @__PURE__ */ jsx(ArrowRightIcon, {
|
|
1520
|
+
children: [t("runner.ui.launchARunnerLabel", "Launch a runner"), /* @__PURE__ */ jsx(ArrowRightIcon, {
|
|
1413
1521
|
"aria-hidden": true,
|
|
1414
1522
|
className: "size-3.5"
|
|
1415
1523
|
})]
|
|
@@ -1420,7 +1528,6 @@ function RunnersActivitySection({ sessionId, sendSessionFrame, openTransientTab
|
|
|
1420
1528
|
className: "flex flex-col gap-0.5",
|
|
1421
1529
|
children: running.map((run) => /* @__PURE__ */ jsx(RunnerRow, {
|
|
1422
1530
|
run,
|
|
1423
|
-
now,
|
|
1424
1531
|
stopRequested: session.stopRequested.includes(run.id),
|
|
1425
1532
|
sessionId,
|
|
1426
1533
|
sendSessionFrame,
|
|
@@ -1433,14 +1540,15 @@ function RunnersActivitySection({ sessionId, sendSessionFrame, openTransientTab
|
|
|
1433
1540
|
* one line of what it is doing. Its own component because the tail line is a
|
|
1434
1541
|
* subscription per row, and a row that scrolls out of the dock closes it.
|
|
1435
1542
|
*/
|
|
1436
|
-
function RunnerRow({ run,
|
|
1543
|
+
function RunnerRow({ run, stopRequested, sessionId, sendSessionFrame, openTransientTab }) {
|
|
1544
|
+
const t = useT();
|
|
1437
1545
|
const tail = useRunnerTail(sessionId, run.id, run.state === "running");
|
|
1438
1546
|
return /* @__PURE__ */ jsxs(Button, {
|
|
1439
1547
|
variant: "ghost",
|
|
1440
1548
|
size: "card",
|
|
1441
1549
|
"data-testid": `activity-runner-${run.id}`,
|
|
1442
1550
|
"data-runner-tone": "running",
|
|
1443
|
-
title: "open this runner's log",
|
|
1551
|
+
title: t("runner.ui.openThisRunnersLog", "open this runner's log"),
|
|
1444
1552
|
onClick: () => {
|
|
1445
1553
|
if (sessionId === null) return;
|
|
1446
1554
|
openTransientTab(runnerLogTab(run));
|
|
@@ -1459,7 +1567,7 @@ function RunnerRow({ run, now, stopRequested, sessionId, sendSessionFrame, openT
|
|
|
1459
1567
|
}),
|
|
1460
1568
|
/* @__PURE__ */ jsxs("span", {
|
|
1461
1569
|
className: "shrink-0 text-sm text-po-dim",
|
|
1462
|
-
children: [
|
|
1570
|
+
children: [/* @__PURE__ */ jsx(RunnerUptime, { run }), run.interactive ? " · tty" : ""]
|
|
1463
1571
|
}),
|
|
1464
1572
|
sessionId !== null ? /* @__PURE__ */ jsx(Button, {
|
|
1465
1573
|
asChild: true,
|
|
@@ -1467,7 +1575,7 @@ function RunnerRow({ run, now, stopRequested, sessionId, sendSessionFrame, openT
|
|
|
1467
1575
|
size: "xs",
|
|
1468
1576
|
"data-testid": `activity-runner-stop-${run.id}`,
|
|
1469
1577
|
"data-stopping": stopRequested,
|
|
1470
|
-
title: stopRequested ? "stop requested; the runner reports its own exit" : "ask the runtime to stop this runner",
|
|
1578
|
+
title: stopRequested ? t("runner.ui.stopRequestedTheRunnerReportsItsOwnExit", "stop requested; the runner reports its own exit") : t("runner.ui.askTheRuntimeToStopThisRunner", "ask the runtime to stop this runner"),
|
|
1471
1579
|
className: "px-1.5",
|
|
1472
1580
|
children: /* @__PURE__ */ jsx("span", {
|
|
1473
1581
|
role: "button",
|
|
@@ -1483,7 +1591,7 @@ function RunnerRow({ run, now, stopRequested, sessionId, sendSessionFrame, openT
|
|
|
1483
1591
|
event.stopPropagation();
|
|
1484
1592
|
if (!stopRequested) requestRunnerStop(sendSessionFrame, sessionId, run.id);
|
|
1485
1593
|
},
|
|
1486
|
-
children: stopRequested ? "stopping…" : "stop"
|
|
1594
|
+
children: stopRequested ? t("runner.ui.stoppingProgress", "stopping…") : t("runner.ui.stop", "stop")
|
|
1487
1595
|
})
|
|
1488
1596
|
}) : null
|
|
1489
1597
|
]
|
|
@@ -1500,10 +1608,6 @@ function RunnerRow({ run, now, stopRequested, sessionId, sendSessionFrame, openT
|
|
|
1500
1608
|
var Runners_activity_runners_web_default = defineFill({ component: RunnersActivitySection });
|
|
1501
1609
|
//#endregion
|
|
1502
1610
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/bashToolFormat.ts
|
|
1503
|
-
/**
|
|
1504
|
-
* Pure view logic for the browser bash tool card.
|
|
1505
|
-
* Every input is the wire JSON of a tool_execution frame.
|
|
1506
|
-
*/
|
|
1507
1611
|
const ELLIPSIS = "…";
|
|
1508
1612
|
/** Spaced so the join never glues two words into one unreadable token. */
|
|
1509
1613
|
const GAP = " … ";
|
|
@@ -1533,6 +1637,17 @@ function bashResultDetails(details) {
|
|
|
1533
1637
|
if (typeof details.reason === "string") out.reason = details.reason;
|
|
1534
1638
|
if (typeof details.tail === "string") out.tail = details.tail;
|
|
1535
1639
|
if (typeof details.tailLines === "number") out.tailLines = details.tailLines;
|
|
1640
|
+
if (typeof details.sequenceId === "string") {
|
|
1641
|
+
out.sequenceId = details.sequenceId;
|
|
1642
|
+
if (Array.isArray(details.stages)) out.stages = details.stages.flatMap((stage) => {
|
|
1643
|
+
if (!isRecord(stage) || !Number.isInteger(stage.index) || Number(stage.index) < 0 || typeof stage.state !== "string") return [];
|
|
1644
|
+
return [{
|
|
1645
|
+
index: Number(stage.index),
|
|
1646
|
+
state: stage.state,
|
|
1647
|
+
...typeof stage.logPath === "string" ? { logPath: stage.logPath } : {}
|
|
1648
|
+
}];
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1536
1651
|
return out;
|
|
1537
1652
|
}
|
|
1538
1653
|
/** `/Users/me/x` becomes `~/x`. Absolute home paths are what push these lines onto extra rows. */
|
|
@@ -1540,10 +1655,13 @@ function abbreviateHome(text) {
|
|
|
1540
1655
|
return text.replace(HOME_PATH, "~");
|
|
1541
1656
|
}
|
|
1542
1657
|
/** Collapse a heredoc or multi-line script to one scannable line plus a count. */
|
|
1543
|
-
function collapseCommand(command) {
|
|
1658
|
+
function collapseCommand(command, t) {
|
|
1544
1659
|
const lines = command.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
1545
1660
|
const first = lines[0] ?? "";
|
|
1546
|
-
return lines.length > 1 ?
|
|
1661
|
+
return lines.length > 1 ? t?.("runner.ui.commandMoreLines", "{command} … +{count} lines", {
|
|
1662
|
+
command: first,
|
|
1663
|
+
count: lines.length - 1
|
|
1664
|
+
}) ?? `${first} ${ELLIPSIS} +${lines.length - 1} lines` : first;
|
|
1547
1665
|
}
|
|
1548
1666
|
/** Drop the middle rather than the end, so a long pipeline keeps both its source and its sink. */
|
|
1549
1667
|
function truncateMiddle(text, max = MAX_COMMAND_LENGTH) {
|
|
@@ -1558,8 +1676,17 @@ function truncateMiddle(text, max = MAX_COMMAND_LENGTH) {
|
|
|
1558
1676
|
if (firstSpace >= 0 && firstSpace < end.length / 2) end = end.slice(firstSpace + 1);
|
|
1559
1677
|
return `${start}${GAP}${end}`;
|
|
1560
1678
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1679
|
+
/** Arrays are separate commands; the expanded body keeps their boundaries visible. */
|
|
1680
|
+
function bashCommandText(command) {
|
|
1681
|
+
if (typeof command === "string") return command;
|
|
1682
|
+
return Array.isArray(command) && command.every((entry) => typeof entry === "string") ? command.join("\n\n") : "";
|
|
1683
|
+
}
|
|
1684
|
+
function formatBashCommand(command, t) {
|
|
1685
|
+
const text = bashCommandText(command);
|
|
1686
|
+
if (text.length === 0) return "";
|
|
1687
|
+
const first = Array.isArray(command) ? bashCommandText(command[0]) : text;
|
|
1688
|
+
const suffix = Array.isArray(command) && command.length > 1 ? t?.("runner.ui.moreCommands", " … +{count} commands", { count: command.length - 1 }) ?? ` ${ELLIPSIS} +${command.length - 1} commands` : "";
|
|
1689
|
+
return truncateMiddle(`${abbreviateHome(collapseCommand(first, t))}${suffix}`);
|
|
1563
1690
|
}
|
|
1564
1691
|
/** Modifiers worth seeing at a glance, in the widget's `·` idiom. */
|
|
1565
1692
|
function formatBashFlags(args) {
|
|
@@ -1577,9 +1704,9 @@ function formatSize(bytes) {
|
|
|
1577
1704
|
return `${(bytes / BYTES_PER_MB).toFixed(1)} MB`;
|
|
1578
1705
|
}
|
|
1579
1706
|
/** The metadata footer, collapsed from five lines to one. */
|
|
1580
|
-
function formatResultSummary(details) {
|
|
1707
|
+
function formatResultSummary(details, t) {
|
|
1581
1708
|
const parts = [];
|
|
1582
|
-
if (details.lines !== void 0) parts.push(`${details.lines.toLocaleString("en-US")} lines`);
|
|
1709
|
+
if (details.lines !== void 0) parts.push(t?.("runner.ui.lineCount", "{count} lines", { count: details.lines.toLocaleString("en-US") }) ?? `${details.lines.toLocaleString("en-US")} lines`);
|
|
1583
1710
|
if (details.fileSize !== void 0) parts.push(formatSize(details.fileSize));
|
|
1584
1711
|
if (details.runner !== void 0) parts.push(details.runner);
|
|
1585
1712
|
return parts.join(" · ");
|
|
@@ -1590,50 +1717,62 @@ function lastLines(text, max) {
|
|
|
1590
1717
|
while (all.length > 0 && all[all.length - 1]?.trim() === "") all.pop();
|
|
1591
1718
|
return all.length <= max ? all : all.slice(-max);
|
|
1592
1719
|
}
|
|
1593
|
-
function bashResultView(input) {
|
|
1720
|
+
function bashResultView(input, t) {
|
|
1594
1721
|
const details = bashResultDetails(input.details);
|
|
1722
|
+
const logs = (details.stages ?? []).flatMap((stage) => stage.logPath === void 0 ? [] : [t?.("runner.ui.stageLog", "stage {index} · {state} · {path}", {
|
|
1723
|
+
index: stage.index + 1,
|
|
1724
|
+
state: stage.state,
|
|
1725
|
+
path: stage.logPath
|
|
1726
|
+
}) ?? `stage ${stage.index + 1} · ${stage.state} · ${stage.logPath}`]);
|
|
1595
1727
|
if (input.isPartial) return {
|
|
1596
|
-
lines: lastLines(input.output, STREAM_TAIL_LINES),
|
|
1728
|
+
lines: [...logs, ...lastLines(input.output, STREAM_TAIL_LINES)],
|
|
1597
1729
|
status: {
|
|
1598
1730
|
glyph: "◐",
|
|
1599
1731
|
tone: "running",
|
|
1600
|
-
text: "running"
|
|
1732
|
+
text: t?.("runner.ui.running", "running") ?? "running"
|
|
1601
1733
|
},
|
|
1602
1734
|
hidden: 0
|
|
1603
1735
|
};
|
|
1604
1736
|
if (input.isError) {
|
|
1605
|
-
const all = lastLines(input.output, Number.MAX_SAFE_INTEGER);
|
|
1606
|
-
const lines = input.expanded ? all : all.slice(-12);
|
|
1607
|
-
const summary = formatResultSummary(details);
|
|
1737
|
+
const all = lastLines(details.sequenceId === void 0 ? input.output : details.tail ?? input.output, Number.MAX_SAFE_INTEGER);
|
|
1738
|
+
const lines = [...logs, ...input.expanded ? all : all.slice(-12)];
|
|
1739
|
+
const summary = formatResultSummary(details, t);
|
|
1608
1740
|
return {
|
|
1609
1741
|
lines,
|
|
1610
1742
|
status: {
|
|
1611
1743
|
glyph: "✗",
|
|
1612
1744
|
tone: "error",
|
|
1613
|
-
text: summary.length > 0 ? summary : "failed"
|
|
1745
|
+
text: summary.length > 0 ? summary : t?.("runner.ui.failed", "failed") ?? "failed"
|
|
1614
1746
|
},
|
|
1615
|
-
hidden: all.length - lines.length
|
|
1747
|
+
hidden: Math.max(0, all.length + logs.length - lines.length)
|
|
1616
1748
|
};
|
|
1617
1749
|
}
|
|
1618
|
-
if (details.promoted === true)
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1750
|
+
if (details.promoted === true) {
|
|
1751
|
+
const label = details.runner ?? details.id ?? "runner";
|
|
1752
|
+
const suffix = details.id === void 0 ? "" : ` · ${details.id}`;
|
|
1753
|
+
return {
|
|
1754
|
+
lines: logs,
|
|
1755
|
+
status: {
|
|
1756
|
+
glyph: "●",
|
|
1757
|
+
tone: "background",
|
|
1758
|
+
text: t?.("runner.ui.backgroundStatus", "{label}{suffix} · background", {
|
|
1759
|
+
label,
|
|
1760
|
+
suffix
|
|
1761
|
+
}) ?? `${label}${suffix} · background`
|
|
1762
|
+
},
|
|
1763
|
+
hidden: 0
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
const all = lastLines(details.tail ?? (details.sequenceId === void 0 ? "" : input.output), Number.MAX_SAFE_INTEGER);
|
|
1767
|
+
const lines = [...logs, ...input.expanded ? all : all.slice(-12)];
|
|
1629
1768
|
const exited = details.exitCode !== void 0 && details.exitCode !== null;
|
|
1630
1769
|
const failed = details.timedOut === true || exited && details.exitCode !== 0;
|
|
1631
1770
|
const meta = [];
|
|
1632
|
-
if (details.timedOut === true) meta.push("timed out");
|
|
1633
|
-
else if (failed) meta.push(`exit ${details.exitCode}`);
|
|
1634
|
-
const summary = formatResultSummary(details);
|
|
1771
|
+
if (details.timedOut === true) meta.push(t?.("runner.ui.timedOut", "timed out") ?? "timed out");
|
|
1772
|
+
else if (failed) meta.push(t?.("runner.ui.exitCode", "exit {code}", { code: details.exitCode ?? "" }) ?? `exit ${details.exitCode}`);
|
|
1773
|
+
const summary = formatResultSummary(details, t);
|
|
1635
1774
|
if (summary.length > 0) meta.push(summary);
|
|
1636
|
-
const text = meta.length > 0 ? meta.join(" · ") : failed ? "failed" : lines.length === 0 ? "done" : "";
|
|
1775
|
+
const text = meta.length > 0 ? meta.join(" · ") : failed ? t?.("runner.ui.failed", "failed") ?? "failed" : lines.length === 0 ? t?.("runner.ui.done", "done") ?? "done" : "";
|
|
1637
1776
|
return {
|
|
1638
1777
|
lines,
|
|
1639
1778
|
status: text.length > 0 ? {
|
|
@@ -1641,7 +1780,36 @@ function bashResultView(input) {
|
|
|
1641
1780
|
tone: failed ? "error" : "ok",
|
|
1642
1781
|
text
|
|
1643
1782
|
} : null,
|
|
1644
|
-
hidden: all.length - lines.length
|
|
1783
|
+
hidden: Math.max(0, all.length + logs.length - lines.length)
|
|
1784
|
+
};
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* A promoted command's outcome, read from the runner the channel reports
|
|
1788
|
+
* rather than from the tool call, which returned when the run went to the
|
|
1789
|
+
* background. The card never reads Completed while the runner still runs.
|
|
1790
|
+
*/
|
|
1791
|
+
function backgroundOutcome(run, t) {
|
|
1792
|
+
if (run === void 0) return {
|
|
1793
|
+
tone: "info",
|
|
1794
|
+
badge: t?.("runner.ui.inBackground", "In background") ?? "In background"
|
|
1795
|
+
};
|
|
1796
|
+
if (run.exit === void 0) return {
|
|
1797
|
+
tone: "running",
|
|
1798
|
+
badge: t?.("runner.ui.inBackground", "In background") ?? "In background"
|
|
1799
|
+
};
|
|
1800
|
+
const { reason, code } = run.exit;
|
|
1801
|
+
const exit = code === null ? "" : t?.("runner.ui.exitSuffix", " · exit {code}", { code }) ?? ` · exit ${code}`;
|
|
1802
|
+
if (reason === "completed") return {
|
|
1803
|
+
tone: "ok",
|
|
1804
|
+
badge: t?.("runner.ui.completedExit", "Completed{exit}", { exit }) ?? `Completed${exit}`
|
|
1805
|
+
};
|
|
1806
|
+
if (reason === "stopped") return {
|
|
1807
|
+
tone: "neutral",
|
|
1808
|
+
badge: t?.("runner.ui.stoppedLabel", "Stopped") ?? "Stopped"
|
|
1809
|
+
};
|
|
1810
|
+
return {
|
|
1811
|
+
tone: "error",
|
|
1812
|
+
badge: t?.("runner.ui.failedExit", "Failed{exit}", { exit }) ?? `Failed${exit}`
|
|
1645
1813
|
};
|
|
1646
1814
|
}
|
|
1647
1815
|
//#endregion
|
|
@@ -1663,15 +1831,17 @@ const STATUS_TONE = {
|
|
|
1663
1831
|
* dock does, for as long as the runners channel reports it running.
|
|
1664
1832
|
*/
|
|
1665
1833
|
function BashToolMessage({ sessionId, args, result, output, running, isError, sendSessionFrame, openTransientTab }) {
|
|
1834
|
+
const t = useT();
|
|
1666
1835
|
const details = bashResultDetails(result?.details);
|
|
1667
|
-
const
|
|
1668
|
-
const
|
|
1836
|
+
const processId = details.sequenceId === void 0 ? details.id : void 0;
|
|
1837
|
+
const runnerId = details.promoted === true ? processId : void 0;
|
|
1838
|
+
const run = useStore(runners.store, (state) => processId === void 0 ? void 0 : runners.select(state, sessionId).runs.find((entry) => entry.id === processId));
|
|
1669
1839
|
const stopping = useStore(runners.store, (state) => runnerId !== void 0 && runners.select(state, sessionId).stopRequested.includes(runnerId));
|
|
1670
|
-
const rawCommand =
|
|
1671
|
-
const command = formatBashCommand(
|
|
1840
|
+
const rawCommand = bashCommandText(args.command);
|
|
1841
|
+
const command = formatBashCommand(args.command, t);
|
|
1672
1842
|
const flags = formatBashFlags(args);
|
|
1673
1843
|
const stoppable = sessionId !== null && runnerId !== void 0 && run !== void 0 && run.exit === void 0;
|
|
1674
|
-
const background = runnerId === void 0 ? void 0 : backgroundOutcome(run);
|
|
1844
|
+
const background = runnerId === void 0 ? void 0 : backgroundOutcome(run, t);
|
|
1675
1845
|
return /* @__PURE__ */ jsx(MessageItem, {
|
|
1676
1846
|
tone: background?.tone ?? toolTone({
|
|
1677
1847
|
running,
|
|
@@ -1685,7 +1855,7 @@ function BashToolMessage({ sessionId, args, result, output, running, isError, se
|
|
|
1685
1855
|
expanded: true,
|
|
1686
1856
|
isPartial: running,
|
|
1687
1857
|
isError
|
|
1688
|
-
});
|
|
1858
|
+
}, t);
|
|
1689
1859
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(MessageItemHeader, {
|
|
1690
1860
|
title: "bash",
|
|
1691
1861
|
...background ? { badge: background.badge } : {},
|
|
@@ -1705,13 +1875,13 @@ function BashToolMessage({ sessionId, args, result, output, running, isError, se
|
|
|
1705
1875
|
variant: "outline",
|
|
1706
1876
|
size: "xs",
|
|
1707
1877
|
"data-testid": "tool-result-bash-open-log",
|
|
1708
|
-
title: "open this runner's full log",
|
|
1878
|
+
title: t("runner.ui.openThisRunnersFullLog", "open this runner's full log"),
|
|
1709
1879
|
onClick: (event) => {
|
|
1710
1880
|
event.stopPropagation();
|
|
1711
1881
|
openTransientTab(runnerLogTab(run));
|
|
1712
1882
|
},
|
|
1713
1883
|
className: "shrink-0 gap-1 px-1.5 ",
|
|
1714
|
-
children: [/* @__PURE__ */ jsx(FileIcon, { className: "h-2.5 w-2.5" }), "log"]
|
|
1884
|
+
children: [/* @__PURE__ */ jsx(FileIcon, { className: "h-2.5 w-2.5" }), t("runner.ui.log", "log")]
|
|
1715
1885
|
}) : null,
|
|
1716
1886
|
stoppable ? /* @__PURE__ */ jsx(Button, {
|
|
1717
1887
|
size: "xs",
|
|
@@ -1719,13 +1889,13 @@ function BashToolMessage({ sessionId, args, result, output, running, isError, se
|
|
|
1719
1889
|
disabled: stopping,
|
|
1720
1890
|
"data-testid": "tool-result-bash-stop",
|
|
1721
1891
|
"data-stopping": stopping,
|
|
1722
|
-
title: stopping ? "stop requested; the runner reports its own exit" : "ask the runtime to stop this runner",
|
|
1892
|
+
title: stopping ? t("runner.ui.stopRequestedTheRunnerReportsItsOwnExit", "stop requested; the runner reports its own exit") : t("runner.ui.askTheRuntimeToStopThisRunner", "ask the runtime to stop this runner"),
|
|
1723
1893
|
onClick: (event) => {
|
|
1724
1894
|
event.stopPropagation();
|
|
1725
1895
|
if (sessionId !== null && runnerId !== void 0) requestRunnerStop(sendSessionFrame, sessionId, runnerId);
|
|
1726
1896
|
},
|
|
1727
1897
|
className: "shrink-0 px-1.5 ",
|
|
1728
|
-
children: stopping ? "stopping…" : "stop"
|
|
1898
|
+
children: stopping ? t("runner.ui.stoppingProgress", "stopping…") : t("runner.ui.stop", "stop")
|
|
1729
1899
|
}) : null
|
|
1730
1900
|
]
|
|
1731
1901
|
}), expanded ? /* @__PURE__ */ jsxs(MessageItemBody, {
|
|
@@ -1753,10 +1923,10 @@ function BashToolMessage({ sessionId, args, result, output, running, isError, se
|
|
|
1753
1923
|
children: view.status.text
|
|
1754
1924
|
})
|
|
1755
1925
|
}) : null,
|
|
1756
|
-
details.logPath !== void 0 ? /* @__PURE__ */ jsxs("span", {
|
|
1926
|
+
details.sequenceId === void 0 && details.logPath !== void 0 ? /* @__PURE__ */ jsxs("span", {
|
|
1757
1927
|
"data-testid": "tool-result-bash-log",
|
|
1758
1928
|
className: "min-w-0 break-all text-po-dim",
|
|
1759
|
-
children: ["full log ·
|
|
1929
|
+
children: [t("runner.ui.fullLog", "full log ·"), /* @__PURE__ */ jsx("span", {
|
|
1760
1930
|
className: "text-po-dim",
|
|
1761
1931
|
children: details.logPath
|
|
1762
1932
|
})]
|
|
@@ -1766,41 +1936,26 @@ function BashToolMessage({ sessionId, args, result, output, running, isError, se
|
|
|
1766
1936
|
}
|
|
1767
1937
|
});
|
|
1768
1938
|
}
|
|
1769
|
-
function backgroundOutcome(run) {
|
|
1770
|
-
if (run === void 0) return {
|
|
1771
|
-
tone: "info",
|
|
1772
|
-
badge: "In background"
|
|
1773
|
-
};
|
|
1774
|
-
if (run.exit === void 0) return {
|
|
1775
|
-
tone: "running",
|
|
1776
|
-
badge: "In background"
|
|
1777
|
-
};
|
|
1778
|
-
const { reason, code } = run.exit;
|
|
1779
|
-
const exit = code === null ? "" : ` · exit ${code}`;
|
|
1780
|
-
if (reason === "completed") return {
|
|
1781
|
-
tone: "ok",
|
|
1782
|
-
badge: `Completed${exit}`
|
|
1783
|
-
};
|
|
1784
|
-
if (reason === "stopped") return {
|
|
1785
|
-
tone: "neutral",
|
|
1786
|
-
badge: "Stopped"
|
|
1787
|
-
};
|
|
1788
|
-
return {
|
|
1789
|
-
tone: "error",
|
|
1790
|
-
badge: `Failed${exit}`
|
|
1791
|
-
};
|
|
1792
|
-
}
|
|
1793
1939
|
//#endregion
|
|
1794
1940
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/bash.web.tsx
|
|
1795
1941
|
var bash_web_default = defineToolRenderer({ message: BashToolMessage });
|
|
1796
1942
|
//#endregion
|
|
1797
1943
|
//#region generated/web.ts
|
|
1798
|
-
const via = (identity, value) =>
|
|
1799
|
-
|
|
1800
|
-
|
|
1944
|
+
const via = (identity, value) => {
|
|
1945
|
+
if (value === void 0) return void 0;
|
|
1946
|
+
const declaration = value;
|
|
1947
|
+
return {
|
|
1948
|
+
...identity,
|
|
1949
|
+
...declaration,
|
|
1950
|
+
...declaration.relations === void 0 ? {} : { relations: declaration.relations.map((relation) => ({
|
|
1951
|
+
evidence: "declared",
|
|
1952
|
+
...relation
|
|
1953
|
+
})) }
|
|
1954
|
+
};
|
|
1801
1955
|
};
|
|
1802
1956
|
const webPlugin = defineWebPlugin({
|
|
1803
1957
|
id: "runner",
|
|
1958
|
+
packageName: "@agimon-ai/po-runner",
|
|
1804
1959
|
session: {
|
|
1805
1960
|
get activityGroups() {
|
|
1806
1961
|
return [via({ name: "runners" }, runners_web_default)];
|
|
@@ -1810,6 +1965,9 @@ const webPlugin = defineWebPlugin({
|
|
|
1810
1965
|
},
|
|
1811
1966
|
get fills() {
|
|
1812
1967
|
return [via({
|
|
1968
|
+
slot: "help.guides",
|
|
1969
|
+
id: "runner"
|
|
1970
|
+
}, Runner_help_guides_web_default), via({
|
|
1813
1971
|
slot: "activity.runners",
|
|
1814
1972
|
id: "runners"
|
|
1815
1973
|
}, Runners_activity_runners_web_default)];
|