@agimon-ai/po-runner 0.0.0-alpha.21 → 0.0.0-alpha.211
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
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
2
|
const require_runnerConfig = require("./runnerConfig-BoLMinlx.cjs");
|
|
3
|
-
const require_session = require("./session-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const require_session = require("./session-DnUj8Q71.cjs");
|
|
4
|
+
const require_session$1 = require("./session-PQd3azWf.cjs");
|
|
5
|
+
let node_fs_promises = require("node:fs/promises");
|
|
6
|
+
node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
|
|
6
7
|
let node_path = require("node:path");
|
|
7
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
9
|
+
let node_fs = require("node:fs");
|
|
10
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
8
11
|
let node_child_process = require("node:child_process");
|
|
9
|
-
let
|
|
12
|
+
let node_util = require("node:util");
|
|
10
13
|
//#region src/constants/runnerPaths.ts
|
|
11
14
|
const STORE_DIR_NAME = "po-runner";
|
|
12
15
|
const LOG_DIR_NAME = "logs";
|
|
@@ -17,6 +20,11 @@ const RAW_SUFFIX = ".raw";
|
|
|
17
20
|
const FILE_ENCODING = "utf8";
|
|
18
21
|
//#endregion
|
|
19
22
|
//#region src/services/runnerPaths/index.ts
|
|
23
|
+
var runnerPaths_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
24
|
+
RunnerPaths: () => RunnerPaths,
|
|
25
|
+
resolveRunnerStoreDirectory: () => resolveRunnerStoreDirectory,
|
|
26
|
+
runnerStateDirFor: () => runnerStateDirFor
|
|
27
|
+
});
|
|
20
28
|
/** Unscrubbed pane bytes, kept beside the log so an attached terminal can replay them. */
|
|
21
29
|
/**
|
|
22
30
|
* How long an entirely empty session directory is left alone before it counts
|
|
@@ -24,25 +32,22 @@ const FILE_ENCODING = "utf8";
|
|
|
24
32
|
* directory for a moment, and reclaiming it out from under that session would
|
|
25
33
|
* be churn for no gain.
|
|
26
34
|
*/
|
|
27
|
-
|
|
35
|
+
const runCommand = (0, node_util.promisify)(node_child_process.execFile);
|
|
36
|
+
async function git(args, cwd) {
|
|
28
37
|
try {
|
|
29
|
-
const
|
|
38
|
+
const { stdout } = await runCommand("git", args, {
|
|
30
39
|
cwd,
|
|
31
|
-
encoding: FILE_ENCODING
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"pipe",
|
|
35
|
-
"ignore"
|
|
36
|
-
]
|
|
37
|
-
}).trim();
|
|
40
|
+
encoding: FILE_ENCODING
|
|
41
|
+
});
|
|
42
|
+
const trimmed = stdout.trim();
|
|
38
43
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
39
44
|
} catch {
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
function realPath(target) {
|
|
48
|
+
async function realPath(target) {
|
|
44
49
|
try {
|
|
45
|
-
return
|
|
50
|
+
return await node_fs_promises.default.realpath(target);
|
|
46
51
|
} catch {
|
|
47
52
|
return target;
|
|
48
53
|
}
|
|
@@ -52,23 +57,13 @@ function realPath(target) {
|
|
|
52
57
|
* directory itself. A session still being written to therefore always looks
|
|
53
58
|
* recent, whatever state its individual records are in.
|
|
54
59
|
*/
|
|
55
|
-
function newestEntryTime(directory) {
|
|
56
|
-
let newest = node_fs.default.statSync(directory).mtimeMs;
|
|
57
|
-
for (const entry of node_fs.default.readdirSync(directory, { withFileTypes: true })) {
|
|
58
|
-
const target = node_path.default.join(directory, entry.name);
|
|
59
|
-
newest = Math.max(newest, node_fs.default.statSync(target).mtimeMs);
|
|
60
|
-
if (!entry.isDirectory()) continue;
|
|
61
|
-
for (const child of node_fs.default.readdirSync(target)) newest = Math.max(newest, node_fs.default.statSync(node_path.default.join(target, child)).mtimeMs);
|
|
62
|
-
}
|
|
63
|
-
return newest;
|
|
64
|
-
}
|
|
65
60
|
async function newestEntryTimeAsync(directory) {
|
|
66
|
-
let newest = (await
|
|
67
|
-
for (const entry of await
|
|
61
|
+
let newest = (await node_fs_promises.default.stat(directory)).mtimeMs;
|
|
62
|
+
for (const entry of await node_fs_promises.default.readdir(directory, { withFileTypes: true })) {
|
|
68
63
|
const target = node_path.default.join(directory, entry.name);
|
|
69
|
-
newest = Math.max(newest, (await
|
|
64
|
+
newest = Math.max(newest, (await node_fs_promises.default.stat(target)).mtimeMs);
|
|
70
65
|
if (!entry.isDirectory()) continue;
|
|
71
|
-
for (const child of await
|
|
66
|
+
for (const child of await node_fs_promises.default.readdir(target)) newest = Math.max(newest, (await node_fs_promises.default.stat(node_path.default.join(target, child))).mtimeMs);
|
|
72
67
|
}
|
|
73
68
|
return newest;
|
|
74
69
|
}
|
|
@@ -78,35 +73,17 @@ async function newestEntryTimeAsync(directory) {
|
|
|
78
73
|
* One live record is enough: records are only ever written by their owner, so a
|
|
79
74
|
* live host pid means the session is still in use however old its files look.
|
|
80
75
|
*/
|
|
81
|
-
function ownerAlive(stateDirectory) {
|
|
82
|
-
let entries;
|
|
83
|
-
try {
|
|
84
|
-
entries = node_fs.default.readdirSync(stateDirectory);
|
|
85
|
-
} catch {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
for (const entry of entries) {
|
|
89
|
-
if (!entry.endsWith(".json")) continue;
|
|
90
|
-
try {
|
|
91
|
-
const hostPid = JSON.parse(node_fs.default.readFileSync(node_path.default.join(stateDirectory, entry), FILE_ENCODING)).hostPid;
|
|
92
|
-
if (typeof hostPid !== "number") continue;
|
|
93
|
-
process.kill(hostPid, 0);
|
|
94
|
-
return true;
|
|
95
|
-
} catch {}
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
76
|
async function ownerAliveAsync(stateDirectory) {
|
|
100
77
|
let entries;
|
|
101
78
|
try {
|
|
102
|
-
entries = await
|
|
79
|
+
entries = await node_fs_promises.default.readdir(stateDirectory);
|
|
103
80
|
} catch {
|
|
104
81
|
return false;
|
|
105
82
|
}
|
|
106
83
|
for (const entry of entries) {
|
|
107
84
|
if (!entry.endsWith(".json")) continue;
|
|
108
85
|
try {
|
|
109
|
-
const hostPid = JSON.parse(await
|
|
86
|
+
const hostPid = JSON.parse(await node_fs_promises.default.readFile(node_path.default.join(stateDirectory, entry), FILE_ENCODING)).hostPid;
|
|
110
87
|
if (typeof hostPid !== "number") continue;
|
|
111
88
|
process.kill(hostPid, 0);
|
|
112
89
|
return true;
|
|
@@ -140,34 +117,28 @@ function expiredCompletedRecords(records, ttlMs, now, keep) {
|
|
|
140
117
|
* its lifeline socket in the state directory, so an entirely empty tree names
|
|
141
118
|
* no owner and no history.
|
|
142
119
|
*/
|
|
143
|
-
function isEmptySession(directory) {
|
|
144
|
-
for (const entry of node_fs.default.readdirSync(directory, { withFileTypes: true })) {
|
|
145
|
-
if (!entry.isDirectory()) return false;
|
|
146
|
-
if (node_fs.default.readdirSync(node_path.default.join(directory, entry.name)).length > 0) return false;
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
120
|
async function isEmptySessionAsync(directory) {
|
|
151
|
-
for (const entry of await
|
|
121
|
+
for (const entry of await node_fs_promises.default.readdir(directory, { withFileTypes: true })) {
|
|
152
122
|
if (!entry.isDirectory()) return false;
|
|
153
|
-
if ((await
|
|
123
|
+
if ((await node_fs_promises.default.readdir(node_path.default.join(directory, entry.name))).length > 0) return false;
|
|
154
124
|
}
|
|
155
125
|
return true;
|
|
156
126
|
}
|
|
157
127
|
/**
|
|
158
|
-
* The root
|
|
159
|
-
* override: `<agent dir>/po-runner/<session id>/{runs,logs}`. A reader in
|
|
128
|
+
* The root this session's runner state lives under: `<PO_SESSION_TEMP_DIR>/po-runner/<session id>/{runs,logs}`. A reader in
|
|
160
129
|
* another process, such as the cockpit hub, resolves the same root from its
|
|
161
|
-
* own environment.
|
|
130
|
+
* own environment. There is no durable or global temporary directory fallback.
|
|
162
131
|
*/
|
|
163
132
|
function resolveRunnerStoreDirectory(env) {
|
|
164
|
-
|
|
133
|
+
const temporaryDirectory = env[require_session.PO_SESSION_TEMP_DIR_ENV];
|
|
134
|
+
if (!temporaryDirectory || !node_path.default.isAbsolute(temporaryDirectory)) throw new Error("A host-admitted PO_SESSION_TEMP_DIR is required for po-runner storage");
|
|
135
|
+
return node_path.default.join(temporaryDirectory, STORE_DIR_NAME);
|
|
165
136
|
}
|
|
166
|
-
/**
|
|
137
|
+
/** Temporary metadata directory for one session. Used by APIs and history reads, not live transport. */
|
|
167
138
|
function runnerStateDirFor(storeDir, sessionId) {
|
|
168
139
|
return node_path.default.join(storeDir, sessionId, STATE_DIR_NAME);
|
|
169
140
|
}
|
|
170
|
-
/**
|
|
141
|
+
/** Runner storage inside the host-admitted session temporary directory. */
|
|
171
142
|
var RunnerPaths = class {
|
|
172
143
|
cwd;
|
|
173
144
|
env;
|
|
@@ -178,22 +149,19 @@ var RunnerPaths = class {
|
|
|
178
149
|
this.env = env;
|
|
179
150
|
}
|
|
180
151
|
repositoryPath() {
|
|
181
|
-
this.repository ??=
|
|
152
|
+
this.repository ??= git(["rev-parse", "--show-toplevel"], this.cwd).then((root) => realPath(root ?? this.cwd));
|
|
182
153
|
return this.repository;
|
|
183
154
|
}
|
|
184
155
|
setSessionId(sessionId) {
|
|
185
156
|
const trimmed = sessionId.trim();
|
|
186
157
|
if (!trimmed) throw new Error("po-runner session id cannot be blank");
|
|
158
|
+
if (!/^[a-zA-Z0-9_-]+$/u.test(trimmed)) throw new Error("Invalid runner session identity");
|
|
187
159
|
this.adoptedSessionId = trimmed;
|
|
188
160
|
}
|
|
189
161
|
logDirectory(sessionId) {
|
|
190
|
-
const override = this.env[require_runnerConfig.LOG_DIR_ENV]?.trim();
|
|
191
|
-
if (override) return node_path.default.resolve(this.cwd, override);
|
|
192
162
|
return node_path.default.join(this.sessionDirectory(sessionId), LOG_DIR_NAME);
|
|
193
163
|
}
|
|
194
164
|
stateDirectory(sessionId) {
|
|
195
|
-
const override = this.env[require_runnerConfig.LOG_DIR_ENV]?.trim();
|
|
196
|
-
if (override) return node_path.default.join(node_path.default.resolve(this.cwd, override), "..", STATE_DIR_NAME);
|
|
197
165
|
return node_path.default.join(this.sessionDirectory(sessionId), STATE_DIR_NAME);
|
|
198
166
|
}
|
|
199
167
|
logPathFor(id, sessionId) {
|
|
@@ -208,52 +176,25 @@ var RunnerPaths = class {
|
|
|
208
176
|
statePathFor(id, sessionId) {
|
|
209
177
|
return node_path.default.join(this.stateDirectory(sessionId), `${id}${STATE_EXTENSION}`);
|
|
210
178
|
}
|
|
211
|
-
ensureDirectories(sessionId) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
179
|
+
async ensureDirectories(sessionId) {
|
|
180
|
+
await node_fs_promises.default.mkdir(this.logDirectory(sessionId), {
|
|
181
|
+
recursive: true,
|
|
182
|
+
mode: 448
|
|
183
|
+
});
|
|
184
|
+
await node_fs_promises.default.mkdir(this.stateDirectory(sessionId), {
|
|
185
|
+
recursive: true,
|
|
186
|
+
mode: 448
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
async sweepHistory(ttlMs, now = Date.now(), live = this.liveSessions()) {
|
|
216
190
|
const result = {
|
|
217
191
|
removed: [],
|
|
218
192
|
errors: []
|
|
219
193
|
};
|
|
220
|
-
if (this.env["PO_RUNNER_LOG_DIR"]?.trim()) {
|
|
221
|
-
const owner = [...live][0] ?? this.sessionId();
|
|
222
|
-
this.sweepStateDirectory(this.stateDirectory(owner), owner, ttlMs, now, result);
|
|
223
|
-
return result;
|
|
224
|
-
}
|
|
225
194
|
const root = this.storeDirectory();
|
|
226
195
|
let sessions;
|
|
227
196
|
try {
|
|
228
|
-
sessions =
|
|
229
|
-
} catch (error) {
|
|
230
|
-
if (error.code === "ENOENT") return result;
|
|
231
|
-
result.errors.push(`Could not read runner history directory ${root}: ${String(error)}`);
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
for (const sessionId of sessions) {
|
|
235
|
-
if (live.has(sessionId)) {
|
|
236
|
-
this.sweepActiveSession(sessionId, ttlMs, now, result);
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
this.sweepSessionDirectory(node_path.default.join(root, sessionId), ttlMs, now, result);
|
|
240
|
-
}
|
|
241
|
-
return result;
|
|
242
|
-
}
|
|
243
|
-
async sweepHistoryAsync(ttlMs, now = Date.now(), live = this.liveSessions()) {
|
|
244
|
-
const result = {
|
|
245
|
-
removed: [],
|
|
246
|
-
errors: []
|
|
247
|
-
};
|
|
248
|
-
if (this.env["PO_RUNNER_LOG_DIR"]?.trim()) {
|
|
249
|
-
const owner = [...live][0] ?? this.sessionId();
|
|
250
|
-
await this.sweepStateDirectoryAsync(this.stateDirectory(owner), owner, ttlMs, now, result);
|
|
251
|
-
return result;
|
|
252
|
-
}
|
|
253
|
-
const root = this.storeDirectory();
|
|
254
|
-
let sessions;
|
|
255
|
-
try {
|
|
256
|
-
sessions = await node_fs.default.promises.readdir(root);
|
|
197
|
+
sessions = await node_fs_promises.default.readdir(root);
|
|
257
198
|
} catch (error) {
|
|
258
199
|
if (error.code === "ENOENT") return result;
|
|
259
200
|
result.errors.push(`Could not read runner history directory ${root}: ${String(error)}`);
|
|
@@ -268,6 +209,9 @@ var RunnerPaths = class {
|
|
|
268
209
|
}
|
|
269
210
|
return result;
|
|
270
211
|
}
|
|
212
|
+
sweepHistoryAsync(ttlMs, now, live) {
|
|
213
|
+
return this.sweepHistory(ttlMs, now, live);
|
|
214
|
+
}
|
|
271
215
|
/** The live session, if one is known, so a sweep never deletes underneath itself. */
|
|
272
216
|
liveSessions() {
|
|
273
217
|
try {
|
|
@@ -286,40 +230,15 @@ var RunnerPaths = class {
|
|
|
286
230
|
* files that record names, and never the directory itself. A running record
|
|
287
231
|
* has no `exit.finishedAt`, so it is not a candidate at any age.
|
|
288
232
|
*/
|
|
289
|
-
sweepActiveSession(sessionId, ttlMs, now, result) {
|
|
290
|
-
this.sweepStateDirectory(this.stateDirectory(sessionId), sessionId, ttlMs, now, result);
|
|
291
|
-
}
|
|
292
233
|
async sweepActiveSessionAsync(sessionId, ttlMs, now, result) {
|
|
293
234
|
await this.sweepStateDirectoryAsync(this.stateDirectory(sessionId), sessionId, ttlMs, now, result);
|
|
294
235
|
}
|
|
295
236
|
/** Removes a session's whole directory once its newest entry is past the TTL. */
|
|
296
|
-
sweepSessionDirectory(directory, ttlMs, now, result) {
|
|
297
|
-
try {
|
|
298
|
-
const newest = newestEntryTime(directory);
|
|
299
|
-
if (now - newest > 3e5 && isEmptySession(directory)) {
|
|
300
|
-
node_fs.default.rmSync(directory, {
|
|
301
|
-
recursive: true,
|
|
302
|
-
force: true
|
|
303
|
-
});
|
|
304
|
-
result.removed.push(directory);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
if (now - newest <= ttlMs) return;
|
|
308
|
-
if (ownerAlive(node_path.default.join(directory, "runs"))) return;
|
|
309
|
-
node_fs.default.rmSync(directory, {
|
|
310
|
-
recursive: true,
|
|
311
|
-
force: true
|
|
312
|
-
});
|
|
313
|
-
result.removed.push(directory);
|
|
314
|
-
} catch (error) {
|
|
315
|
-
if (error.code !== "ENOENT") result.errors.push(`Could not sweep runner session ${directory}: ${String(error)}`);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
237
|
async sweepSessionDirectoryAsync(directory, ttlMs, now, result) {
|
|
319
238
|
try {
|
|
320
239
|
const newest = await newestEntryTimeAsync(directory);
|
|
321
240
|
if (now - newest > 3e5 && await isEmptySessionAsync(directory)) {
|
|
322
|
-
await
|
|
241
|
+
await node_fs_promises.default.rm(directory, {
|
|
323
242
|
recursive: true,
|
|
324
243
|
force: true
|
|
325
244
|
});
|
|
@@ -328,7 +247,7 @@ var RunnerPaths = class {
|
|
|
328
247
|
}
|
|
329
248
|
if (now - newest <= ttlMs) return;
|
|
330
249
|
if (await ownerAliveAsync(node_path.default.join(directory, "runs"))) return;
|
|
331
|
-
await
|
|
250
|
+
await node_fs_promises.default.rm(directory, {
|
|
332
251
|
recursive: true,
|
|
333
252
|
force: true
|
|
334
253
|
});
|
|
@@ -338,48 +257,54 @@ var RunnerPaths = class {
|
|
|
338
257
|
}
|
|
339
258
|
}
|
|
340
259
|
sessionId(explicit) {
|
|
341
|
-
const sessionId = explicit?.trim() || this.adoptedSessionId || require_session.inheritedSessionId(this.env);
|
|
342
|
-
if (!sessionId) throw new Error("
|
|
260
|
+
const sessionId = explicit?.trim() || this.adoptedSessionId || require_session$1.inheritedSessionId(this.env);
|
|
261
|
+
if (!sessionId) throw new Error("PO_SESSION_ID is required for po-runner storage");
|
|
262
|
+
if (!/^[a-zA-Z0-9_-]+$/u.test(sessionId)) throw new Error("Invalid runner session identity");
|
|
343
263
|
return sessionId;
|
|
344
264
|
}
|
|
345
265
|
storeDirectory() {
|
|
346
|
-
const override = this.env[require_runnerConfig.LOG_DIR_ENV]?.trim();
|
|
347
|
-
if (override) return node_path.default.dirname(node_path.default.resolve(this.cwd, override));
|
|
348
266
|
return resolveRunnerStoreDirectory(this.env);
|
|
349
267
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
sweepStateDirectory(directory, sessionId, ttlMs, now, result) {
|
|
354
|
-
let entries;
|
|
268
|
+
/** Delete only this session's runner subtree, never its other temporary output. */
|
|
269
|
+
async removeSessionFiles(sessionId, generation) {
|
|
270
|
+
let directory = this.sessionDirectory(sessionId);
|
|
355
271
|
try {
|
|
356
|
-
|
|
272
|
+
const root = node_fs.default.lstatSync(this.storeDirectory());
|
|
273
|
+
if (root.isSymbolicLink() || !root.isDirectory()) throw new Error("Unsafe runner cleanup root");
|
|
357
274
|
} catch (error) {
|
|
358
|
-
if (error.code
|
|
359
|
-
|
|
275
|
+
if (error.code === "ENOENT") return;
|
|
276
|
+
throw error;
|
|
360
277
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (!entry.endsWith(".json")) continue;
|
|
364
|
-
const statePath = node_path.default.join(directory, entry);
|
|
278
|
+
if (generation !== void 0) {
|
|
279
|
+
if (!/^[a-zA-Z0-9_-]+$/u.test(generation)) throw new Error("Invalid runner cleanup generation");
|
|
365
280
|
try {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
statePath,
|
|
371
|
-
finishedAt
|
|
372
|
-
});
|
|
281
|
+
if (node_fs.default.readFileSync(node_path.default.join(directory, "runs", ".owner"), "utf8") !== generation) return;
|
|
282
|
+
const detached = `${directory}.removing-${generation}`;
|
|
283
|
+
node_fs.default.renameSync(directory, detached);
|
|
284
|
+
directory = detached;
|
|
373
285
|
} catch (error) {
|
|
374
|
-
|
|
286
|
+
if (error.code === "ENOENT") return;
|
|
287
|
+
throw error;
|
|
375
288
|
}
|
|
376
289
|
}
|
|
377
|
-
|
|
290
|
+
await node_fs_promises.default.rm(directory, {
|
|
291
|
+
recursive: true,
|
|
292
|
+
force: true
|
|
293
|
+
});
|
|
294
|
+
try {
|
|
295
|
+
await node_fs_promises.default.rmdir(this.storeDirectory());
|
|
296
|
+
} catch (error) {
|
|
297
|
+
const code = error.code;
|
|
298
|
+
if (code !== "ENOENT" && code !== "ENOTEMPTY" && code !== "EEXIST") throw error;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
sessionDirectory(sessionId) {
|
|
302
|
+
return node_path.default.join(this.storeDirectory(), this.sessionId(sessionId));
|
|
378
303
|
}
|
|
379
304
|
async sweepStateDirectoryAsync(directory, sessionId, ttlMs, now, result) {
|
|
380
305
|
let entries;
|
|
381
306
|
try {
|
|
382
|
-
entries = await
|
|
307
|
+
entries = await node_fs_promises.default.readdir(directory);
|
|
383
308
|
} catch (error) {
|
|
384
309
|
if (error.code !== "ENOENT") result.errors.push(`Could not read runner state directory ${directory}: ${String(error)}`);
|
|
385
310
|
return;
|
|
@@ -389,7 +314,7 @@ var RunnerPaths = class {
|
|
|
389
314
|
if (!entry.endsWith(".json")) continue;
|
|
390
315
|
const statePath = node_path.default.join(directory, entry);
|
|
391
316
|
try {
|
|
392
|
-
const finishedAt = completedAt(JSON.parse(await
|
|
317
|
+
const finishedAt = completedAt(JSON.parse(await node_fs_promises.default.readFile(statePath, FILE_ENCODING)));
|
|
393
318
|
if (finishedAt === void 0) continue;
|
|
394
319
|
completed.push({
|
|
395
320
|
id: entry.slice(0, -5),
|
|
@@ -402,7 +327,7 @@ var RunnerPaths = class {
|
|
|
402
327
|
}
|
|
403
328
|
for (const record of expiredCompletedRecords(completed, ttlMs, now, require_runnerConfig.getMaxCompletedRunners(this.env))) await this.removeHistoryFilesAsync(sessionId, record.id, record.statePath, result);
|
|
404
329
|
}
|
|
405
|
-
|
|
330
|
+
async removeHistoryFilesAsync(sessionId, id, statePath, result) {
|
|
406
331
|
const candidates = [
|
|
407
332
|
statePath,
|
|
408
333
|
this.logPathFor(id, sessionId),
|
|
@@ -410,20 +335,7 @@ var RunnerPaths = class {
|
|
|
410
335
|
this.rawLogPathFor(id, sessionId)
|
|
411
336
|
];
|
|
412
337
|
for (const candidate of candidates) try {
|
|
413
|
-
|
|
414
|
-
result.removed.push(candidate);
|
|
415
|
-
} catch (error) {
|
|
416
|
-
if (error.code !== "ENOENT") result.errors.push(`Could not remove runner history ${candidate}: ${String(error)}`);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
async removeHistoryFilesAsync(sessionId, id, statePath, result) {
|
|
420
|
-
const candidates = [
|
|
421
|
-
statePath,
|
|
422
|
-
this.logPathFor(id, sessionId),
|
|
423
|
-
this.rotatedLogPathFor(id, sessionId)
|
|
424
|
-
];
|
|
425
|
-
for (const candidate of candidates) try {
|
|
426
|
-
await node_fs.default.promises.unlink(candidate);
|
|
338
|
+
await node_fs_promises.default.unlink(candidate);
|
|
427
339
|
result.removed.push(candidate);
|
|
428
340
|
} catch (error) {
|
|
429
341
|
if (error.code !== "ENOENT") result.errors.push(`Could not remove runner history ${candidate}: ${String(error)}`);
|
|
@@ -443,6 +355,12 @@ Object.defineProperty(exports, "resolveRunnerStoreDirectory", {
|
|
|
443
355
|
return resolveRunnerStoreDirectory;
|
|
444
356
|
}
|
|
445
357
|
});
|
|
358
|
+
Object.defineProperty(exports, "runnerPaths_exports", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function() {
|
|
361
|
+
return runnerPaths_exports;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
446
364
|
Object.defineProperty(exports, "runnerStateDirFor", {
|
|
447
365
|
enumerable: true,
|
|
448
366
|
get: function() {
|
|
@@ -450,4 +368,4 @@ Object.defineProperty(exports, "runnerStateDirFor", {
|
|
|
450
368
|
}
|
|
451
369
|
});
|
|
452
370
|
|
|
453
|
-
//# sourceMappingURL=runnerPaths-
|
|
371
|
+
//# sourceMappingURL=runnerPaths-CSkswyjR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerPaths-CSkswyjR.cjs","names":["promisify","execFile","files","path","PO_SESSION_TEMP_DIR_ENV","inheritedSessionId","fs","getMaxCompletedRunners"],"sources":["../src/constants/runnerPaths.ts","../src/services/runnerPaths/index.ts"],"sourcesContent":["export const STORE_DIR_NAME = 'po-runner';\nexport const LOG_DIR_NAME = 'logs';\nexport const STATE_DIR_NAME = 'runs';\nexport const LOG_EXTENSION = '.log';\nexport const STATE_EXTENSION = '.json';\nexport const ROTATED_SUFFIX = '.1';\nexport const RAW_SUFFIX = '.raw';\nexport const PI_CODING_AGENT_DIR_ENV = 'PI_CODING_AGENT_DIR';\nexport const FILE_ENCODING = 'utf8';\nexport const NOT_FOUND_ERROR_CODE = 'ENOENT';\nexport const EMPTY_SESSION_GRACE_MS = 300_000;\n","import { execFile } from 'node:child_process';\nimport fs from 'node:fs';\nimport files from 'node:fs/promises';\nimport path from 'node:path';\nimport { promisify } from 'node:util';\n\nimport {\n EMPTY_SESSION_GRACE_MS,\n FILE_ENCODING,\n LOG_DIR_NAME,\n LOG_EXTENSION,\n NOT_FOUND_ERROR_CODE,\n RAW_SUFFIX,\n ROTATED_SUFFIX,\n STATE_DIR_NAME,\n STATE_EXTENSION,\n STORE_DIR_NAME,\n} from '../../constants/runnerPaths';\nimport { PO_SESSION_TEMP_DIR_ENV } from '../../constants/session';\nimport { getMaxCompletedRunners } from '../runnerConfig';\nimport { inheritedSessionId } from '../session';\nimport type { IRunnerPaths, LogSweepResult } from './type';\n\n/** Unscrubbed pane bytes, kept beside the log so an attached terminal can replay them. */\n/**\n * How long an entirely empty session directory is left alone before it counts\n * as an orphan. A session that has started but not yet run anything owns such a\n * directory for a moment, and reclaiming it out from under that session would\n * be churn for no gain.\n */\n\nconst runCommand = promisify(execFile);\n\n// Asynchronous: the server hosts every session, and a git call blocks its event loop for tens of ms.\nasync function git(args: string[], cwd: string): Promise<string | undefined> {\n try {\n const { stdout } = await runCommand('git', args, { cwd, encoding: FILE_ENCODING });\n const trimmed = stdout.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n } catch {\n return undefined;\n }\n}\n\nasync function realPath(target: string): Promise<string> {\n try {\n return await files.realpath(target);\n } catch {\n return target;\n }\n}\n\n/**\n * Newest mtime anywhere one level inside the session, falling back to the\n * directory itself. A session still being written to therefore always looks\n * recent, whatever state its individual records are in.\n */\nasync function newestEntryTimeAsync(directory: string): Promise<number> {\n let newest = (await files.stat(directory)).mtimeMs;\n for (const entry of await files.readdir(directory, { withFileTypes: true })) {\n const target = path.join(directory, entry.name);\n newest = Math.max(newest, (await files.stat(target)).mtimeMs);\n if (!entry.isDirectory()) continue;\n for (const child of await files.readdir(target)) {\n newest = Math.max(newest, (await files.stat(path.join(target, child))).mtimeMs);\n }\n }\n return newest;\n}\n\n/**\n * Whether any run in this session names a pi process that is still running.\n *\n * One live record is enough: records are only ever written by their owner, so a\n * live host pid means the session is still in use however old its files look.\n */\nasync function ownerAliveAsync(stateDirectory: string): Promise<boolean> {\n let entries: string[];\n try {\n entries = await files.readdir(stateDirectory);\n } catch {\n return false;\n }\n\n for (const entry of entries) {\n if (!entry.endsWith(STATE_EXTENSION)) continue;\n try {\n const value: unknown = JSON.parse(await files.readFile(path.join(stateDirectory, entry), FILE_ENCODING));\n const hostPid = (value as { hostPid?: unknown }).hostPid;\n if (typeof hostPid !== 'number') continue;\n process.kill(hostPid, 0);\n return true;\n } catch {\n // An unreadable record and a dead pid mean the same thing here: no claim.\n }\n }\n return false;\n}\n\nfunction completedAt(value: unknown): number | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = value as { state?: unknown; exit?: { finishedAt?: unknown } };\n if (record.state !== 'completed' || typeof record.exit?.finishedAt !== 'string') return undefined;\n const timestamp = Date.parse(record.exit.finishedAt);\n return Number.isFinite(timestamp) ? timestamp : undefined;\n}\n\ninterface CompletedRecord {\n readonly id: string;\n readonly statePath: string;\n readonly finishedAt: number;\n}\n\n/**\n * Completed records a sweep may delete: everything past the TTL, and everything\n * beyond the newest `keep`.\n *\n * The count bound is what keeps a live session from growing without limit. Its\n * records only reach a multi-day TTL long after the session that is still\n * writing them would have filled its directory, so age alone bounds nothing\n * while the session lasts.\n */\nfunction expiredCompletedRecords(\n records: readonly CompletedRecord[],\n ttlMs: number,\n now: number,\n keep: number,\n): CompletedRecord[] {\n return [...records]\n .sort((left, right) => right.finishedAt - left.finishedAt)\n .filter((record, index) => index >= keep || now - record.finishedAt > ttlMs);\n}\n\n/**\n * Whether the directory holds no files at all, only empty subdirectories.\n *\n * A session that ran something leaves metadata behind, and a live session keeps\n * its lifeline socket in the state directory, so an entirely empty tree names\n * no owner and no history.\n */\nasync function isEmptySessionAsync(directory: string): Promise<boolean> {\n for (const entry of await files.readdir(directory, { withFileTypes: true })) {\n if (!entry.isDirectory()) return false;\n if ((await files.readdir(path.join(directory, entry.name))).length > 0) return false;\n }\n return true;\n}\n\n/**\n * The root this session's runner state lives under: `<PO_SESSION_TEMP_DIR>/po-runner/<session id>/{runs,logs}`. A reader in\n * another process, such as the cockpit hub, resolves the same root from its\n * own environment. There is no durable or global temporary directory fallback.\n */\nexport function resolveRunnerStoreDirectory(env: Readonly<Record<string, string | undefined>>): string {\n const temporaryDirectory = env[PO_SESSION_TEMP_DIR_ENV];\n if (!temporaryDirectory || !path.isAbsolute(temporaryDirectory)) {\n throw new Error('A host-admitted PO_SESSION_TEMP_DIR is required for po-runner storage');\n }\n return path.join(temporaryDirectory, STORE_DIR_NAME);\n}\n\n/** Temporary metadata directory for one session. Used by APIs and history reads, not live transport. */\nexport function runnerStateDirFor(storeDir: string, sessionId: string): string {\n return path.join(storeDir, sessionId, STATE_DIR_NAME);\n}\n\n/** Runner storage inside the host-admitted session temporary directory. */\nexport class RunnerPaths implements IRunnerPaths {\n private adoptedSessionId: string | undefined;\n private repository: Promise<string> | undefined;\n\n constructor(\n private readonly cwd: string = process.cwd(),\n private readonly env: Readonly<Record<string, string | undefined>> = { ...process.env },\n ) {}\n\n repositoryPath(): Promise<string> {\n this.repository ??= git(['rev-parse', '--show-toplevel'], this.cwd).then((root) => realPath(root ?? this.cwd));\n return this.repository;\n }\n\n setSessionId(sessionId: string): void {\n const trimmed = sessionId.trim();\n if (!trimmed) throw new Error('po-runner session id cannot be blank');\n if (!/^[a-zA-Z0-9_-]+$/u.test(trimmed)) throw new Error('Invalid runner session identity');\n this.adoptedSessionId = trimmed;\n }\n\n logDirectory(sessionId?: string): string {\n return path.join(this.sessionDirectory(sessionId), LOG_DIR_NAME);\n }\n\n stateDirectory(sessionId?: string): string {\n return path.join(this.sessionDirectory(sessionId), STATE_DIR_NAME);\n }\n\n logPathFor(id: string, sessionId?: string): string {\n return path.join(this.logDirectory(sessionId), `${id}${LOG_EXTENSION}`);\n }\n\n rotatedLogPathFor(id: string, sessionId?: string): string {\n return `${this.logPathFor(id, sessionId)}${ROTATED_SUFFIX}`;\n }\n\n rawLogPathFor(id: string, sessionId?: string): string {\n return `${this.logPathFor(id, sessionId)}${RAW_SUFFIX}`;\n }\n\n statePathFor(id: string, sessionId?: string): string {\n return path.join(this.stateDirectory(sessionId), `${id}${STATE_EXTENSION}`);\n }\n\n async ensureDirectories(sessionId?: string): Promise<void> {\n // Owner-only, as po-core requires of the session temp tree; a wider parent it created would make session removal refuse it.\n await files.mkdir(this.logDirectory(sessionId), { recursive: true, mode: 0o700 });\n await files.mkdir(this.stateDirectory(sessionId), { recursive: true, mode: 0o700 });\n }\n\n async sweepHistory(\n ttlMs: number,\n now: number = Date.now(),\n live: ReadonlySet<string> = this.liveSessions(),\n ): Promise<LogSweepResult> {\n const result: LogSweepResult = { removed: [], errors: [] };\n const root = this.storeDirectory();\n let sessions: string[];\n try {\n sessions = await files.readdir(root);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return result;\n result.errors.push(`Could not read runner history directory ${root}: ${String(error)}`);\n return result;\n }\n\n for (const sessionId of sessions) {\n if (live.has(sessionId)) {\n await this.sweepActiveSessionAsync(sessionId, ttlMs, now, result);\n continue;\n }\n await this.sweepSessionDirectoryAsync(path.join(root, sessionId), ttlMs, now, result);\n }\n return result;\n }\n\n sweepHistoryAsync(ttlMs: number, now?: number, live?: ReadonlySet<string>): Promise<LogSweepResult> {\n return this.sweepHistory(ttlMs, now, live);\n }\n\n /** The live session, if one is known, so a sweep never deletes underneath itself. */\n private liveSessions(): ReadonlySet<string> {\n try {\n return new Set([this.sessionId()]);\n } catch {\n // A CLI invocation outside a session still sweeps; it just has nothing to spare.\n return new Set();\n }\n }\n\n /**\n * Retention inside the session that is still running.\n *\n * The whole-directory sweep cannot be pointed at the live session: it would\n * take the lifeline socket, the supervisor sidecars and the running runners'\n * own metadata with it. Per-record retention is safe there because it only\n * ever removes a record whose state is `completed` together with the two log\n * files that record names, and never the directory itself. A running record\n * has no `exit.finishedAt`, so it is not a candidate at any age.\n */\n private async sweepActiveSessionAsync(\n sessionId: string,\n ttlMs: number,\n now: number,\n result: LogSweepResult,\n ): Promise<void> {\n await this.sweepStateDirectoryAsync(this.stateDirectory(sessionId), sessionId, ttlMs, now, result);\n }\n\n /** Removes a session's whole directory once its newest entry is past the TTL. */\n private async sweepSessionDirectoryAsync(\n directory: string,\n ttlMs: number,\n now: number,\n result: LogSweepResult,\n ): Promise<void> {\n try {\n const newest = await newestEntryTimeAsync(directory);\n if (now - newest > EMPTY_SESSION_GRACE_MS && (await isEmptySessionAsync(directory))) {\n await files.rm(directory, { recursive: true, force: true });\n result.removed.push(directory);\n return;\n }\n if (now - newest <= ttlMs) return;\n if (await ownerAliveAsync(path.join(directory, STATE_DIR_NAME))) return;\n await files.rm(directory, { recursive: true, force: true });\n result.removed.push(directory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n result.errors.push(`Could not sweep runner session ${directory}: ${String(error)}`);\n }\n }\n }\n\n private sessionId(explicit?: string): string {\n const sessionId = explicit?.trim() || this.adoptedSessionId || inheritedSessionId(this.env);\n if (!sessionId) throw new Error('PO_SESSION_ID is required for po-runner storage');\n if (!/^[a-zA-Z0-9_-]+$/u.test(sessionId)) throw new Error('Invalid runner session identity');\n return sessionId;\n }\n\n storeDirectory(): string {\n return resolveRunnerStoreDirectory(this.env);\n }\n\n /** Delete only this session's runner subtree, never its other temporary output. */\n async removeSessionFiles(sessionId?: string, generation?: string): Promise<void> {\n let directory = this.sessionDirectory(sessionId);\n try {\n // sync: cleanup validates and detaches the owned generation before a replacement can create files.\n const root = fs.lstatSync(this.storeDirectory());\n if (root.isSymbolicLink() || !root.isDirectory()) throw new Error('Unsafe runner cleanup root');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return;\n throw error;\n }\n if (generation !== undefined) {\n if (!/^[a-zA-Z0-9_-]+$/u.test(generation)) throw new Error('Invalid runner cleanup generation');\n try {\n // sync: cleanup fences ownership and detaches the old tree without yielding to a replacement.\n if (fs.readFileSync(path.join(directory, STATE_DIR_NAME, '.owner'), FILE_ENCODING) !== generation) return;\n // No await between checking ownership and detaching the old tree. A replacement\n // can now recreate its original path without racing the asynchronous removal.\n const detached = `${directory}.removing-${generation}`;\n // sync: the ownership check and cleanup rename must run in one turn.\n fs.renameSync(directory, detached);\n directory = detached;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return;\n throw error;\n }\n }\n await files.rm(directory, { recursive: true, force: true });\n try {\n await files.rmdir(this.storeDirectory());\n } catch (error) {\n const code = (error as NodeJS.ErrnoException).code;\n if (code !== NOT_FOUND_ERROR_CODE && code !== 'ENOTEMPTY' && code !== 'EEXIST') throw error;\n }\n }\n\n private sessionDirectory(sessionId?: string): string {\n return path.join(this.storeDirectory(), this.sessionId(sessionId));\n }\n\n private async sweepStateDirectoryAsync(\n directory: string,\n sessionId: string,\n ttlMs: number,\n now: number,\n result: LogSweepResult,\n ): Promise<void> {\n let entries: string[];\n try {\n entries = await files.readdir(directory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n result.errors.push(`Could not read runner state directory ${directory}: ${String(error)}`);\n }\n return;\n }\n\n const completed: CompletedRecord[] = [];\n for (const entry of entries) {\n if (!entry.endsWith(STATE_EXTENSION)) continue;\n const statePath = path.join(directory, entry);\n try {\n const value: unknown = JSON.parse(await files.readFile(statePath, FILE_ENCODING));\n const finishedAt = completedAt(value);\n if (finishedAt === undefined) continue;\n completed.push({ id: entry.slice(0, -STATE_EXTENSION.length), statePath, finishedAt });\n } catch (error) {\n result.errors.push(`Could not sweep runner metadata ${statePath}: ${String(error)}`);\n }\n }\n\n for (const record of expiredCompletedRecords(completed, ttlMs, now, getMaxCompletedRunners(this.env))) {\n await this.removeHistoryFilesAsync(sessionId, record.id, record.statePath, result);\n }\n }\n\n private async removeHistoryFilesAsync(\n sessionId: string,\n id: string,\n statePath: string,\n result: LogSweepResult,\n ): Promise<void> {\n const candidates = [\n statePath,\n this.logPathFor(id, sessionId),\n this.rotatedLogPathFor(id, sessionId),\n this.rawLogPathFor(id, sessionId),\n ];\n for (const candidate of candidates) {\n try {\n await files.unlink(candidate);\n result.removed.push(candidate);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n result.errors.push(`Could not remove runner history ${candidate}: ${String(error)}`);\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,MAAa,iBAAiB;AAC9B,MAAa,eAAe;AAC5B,MAAa,iBAAiB;AAC9B,MAAa,gBAAgB;AAC7B,MAAa,kBAAkB;AAE/B,MAAa,aAAa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