@agimon-ai/doompi-runner 0.0.1-alpha.0
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 -0
- package/README.md +47 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateMetadata.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateMetadata.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateParam.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateParam.mjs +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/bin/cli.cjs +5 -0
- package/dist/bin/cli.cjs.map +1 -0
- package/dist/bin/cli.d.cts +5 -0
- package/dist/bin/cli.d.cts.map +1 -0
- package/dist/bin/cli.d.mts +5 -0
- package/dist/bin/cli.d.mts.map +1 -0
- package/dist/bin/cli.mjs +5 -0
- package/dist/bin/cli.mjs.map +1 -0
- package/dist/bin/logSink.cjs +2 -0
- package/dist/bin/logSink.cjs.map +1 -0
- package/dist/bin/logSink.d.cts +5 -0
- package/dist/bin/logSink.d.cts.map +1 -0
- package/dist/bin/logSink.d.mts +5 -0
- package/dist/bin/logSink.d.mts.map +1 -0
- package/dist/bin/logSink.mjs +2 -0
- package/dist/bin/logSink.mjs.map +1 -0
- package/dist/bin/runnerHost.cjs +2 -0
- package/dist/bin/runnerHost.cjs.map +1 -0
- package/dist/bin/runnerHost.d.cts +5 -0
- package/dist/bin/runnerHost.d.cts.map +1 -0
- package/dist/bin/runnerHost.d.mts +5 -0
- package/dist/bin/runnerHost.d.mts.map +1 -0
- package/dist/bin/runnerHost.mjs +2 -0
- package/dist/bin/runnerHost.mjs.map +1 -0
- package/dist/cli/cliApp.cjs +6 -0
- package/dist/cli/cliApp.cjs.map +1 -0
- package/dist/cli/cliApp.d.cts +23 -0
- package/dist/cli/cliApp.d.cts.map +1 -0
- package/dist/cli/cliApp.d.mts +23 -0
- package/dist/cli/cliApp.d.mts.map +1 -0
- package/dist/cli/cliApp.mjs +6 -0
- package/dist/cli/cliApp.mjs.map +1 -0
- package/dist/compaction.cjs +4 -0
- package/dist/compaction.cjs.map +1 -0
- package/dist/compaction.d.cts +14 -0
- package/dist/compaction.d.cts.map +1 -0
- package/dist/compaction.d.mts +14 -0
- package/dist/compaction.d.mts.map +1 -0
- package/dist/compaction.mjs +4 -0
- package/dist/compaction.mjs.map +1 -0
- package/dist/config.cjs +2 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +32 -0
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +32 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +2 -0
- package/dist/config.mjs.map +1 -0
- package/dist/container/index.cjs +2 -0
- package/dist/container/index.cjs.map +1 -0
- package/dist/container/index.d.cts +14 -0
- package/dist/container/index.d.cts.map +1 -0
- package/dist/container/index.d.mts +14 -0
- package/dist/container/index.d.mts.map +1 -0
- package/dist/container/index.mjs +2 -0
- package/dist/container/index.mjs.map +1 -0
- package/dist/extension.cjs +3 -0
- package/dist/extension.cjs.map +1 -0
- package/dist/extension.d.cts +10 -0
- package/dist/extension.d.cts.map +1 -0
- package/dist/extension.d.mts +10 -0
- package/dist/extension.d.mts.map +1 -0
- package/dist/extension.mjs +3 -0
- package/dist/extension.mjs.map +1 -0
- package/dist/extensions/pi.cjs +2 -0
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.cts +2 -0
- package/dist/extensions/pi.d.mts +2 -0
- package/dist/extensions/pi.mjs +2 -0
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +1 -0
- package/dist/ptyProvider.cjs +2 -0
- package/dist/ptyProvider.cjs.map +1 -0
- package/dist/ptyProvider.d.cts +13 -0
- package/dist/ptyProvider.d.cts.map +1 -0
- package/dist/ptyProvider.d.mts +13 -0
- package/dist/ptyProvider.d.mts.map +1 -0
- package/dist/ptyProvider.mjs +2 -0
- package/dist/ptyProvider.mjs.map +1 -0
- package/dist/reconcile.cjs +2 -0
- package/dist/reconcile.cjs.map +1 -0
- package/dist/reconcile.d.cts +37 -0
- package/dist/reconcile.d.cts.map +1 -0
- package/dist/reconcile.d.mts +37 -0
- package/dist/reconcile.d.mts.map +1 -0
- package/dist/reconcile.mjs +2 -0
- package/dist/reconcile.mjs.map +1 -0
- package/dist/runnerSpec.cjs +2 -0
- package/dist/runnerSpec.cjs.map +1 -0
- package/dist/runnerSpec.d.cts +50 -0
- package/dist/runnerSpec.d.cts.map +1 -0
- package/dist/runnerSpec.d.mts +50 -0
- package/dist/runnerSpec.d.mts.map +1 -0
- package/dist/runnerSpec.mjs +2 -0
- package/dist/runnerSpec.mjs.map +1 -0
- package/dist/services/AnsiScrub/ansiScrub.cjs +5 -0
- package/dist/services/AnsiScrub/ansiScrub.cjs.map +1 -0
- package/dist/services/AnsiScrub/ansiScrub.d.cts +34 -0
- package/dist/services/AnsiScrub/ansiScrub.d.cts.map +1 -0
- package/dist/services/AnsiScrub/ansiScrub.d.mts +34 -0
- package/dist/services/AnsiScrub/ansiScrub.d.mts.map +1 -0
- package/dist/services/AnsiScrub/ansiScrub.mjs +5 -0
- package/dist/services/AnsiScrub/ansiScrub.mjs.map +1 -0
- package/dist/services/AnsiScrub/index.cjs +1 -0
- package/dist/services/AnsiScrub/index.d.cts +2 -0
- package/dist/services/AnsiScrub/index.d.mts +2 -0
- package/dist/services/AnsiScrub/index.mjs +1 -0
- package/dist/services/BashRunService/BashRunService.cjs +2 -0
- package/dist/services/BashRunService/BashRunService.cjs.map +1 -0
- package/dist/services/BashRunService/BashRunService.d.cts +38 -0
- package/dist/services/BashRunService/BashRunService.d.cts.map +1 -0
- package/dist/services/BashRunService/BashRunService.d.mts +38 -0
- package/dist/services/BashRunService/BashRunService.d.mts.map +1 -0
- package/dist/services/BashRunService/BashRunService.mjs +2 -0
- package/dist/services/BashRunService/BashRunService.mjs.map +1 -0
- package/dist/services/BashRunService/index.cjs +1 -0
- package/dist/services/BashRunService/index.d.cts +3 -0
- package/dist/services/BashRunService/index.d.mts +3 -0
- package/dist/services/BashRunService/index.mjs +1 -0
- package/dist/services/BashRunService/types.d.cts +62 -0
- package/dist/services/BashRunService/types.d.cts.map +1 -0
- package/dist/services/BashRunService/types.d.mts +62 -0
- package/dist/services/BashRunService/types.d.mts.map +1 -0
- package/dist/services/Clock/SystemClock.cjs +2 -0
- package/dist/services/Clock/SystemClock.cjs.map +1 -0
- package/dist/services/Clock/SystemClock.d.cts +11 -0
- package/dist/services/Clock/SystemClock.d.cts.map +1 -0
- package/dist/services/Clock/SystemClock.d.mts +11 -0
- package/dist/services/Clock/SystemClock.d.mts.map +1 -0
- package/dist/services/Clock/SystemClock.mjs +2 -0
- package/dist/services/Clock/SystemClock.mjs.map +1 -0
- package/dist/services/Clock/index.cjs +1 -0
- package/dist/services/Clock/index.d.cts +3 -0
- package/dist/services/Clock/index.d.mts +3 -0
- package/dist/services/Clock/index.mjs +1 -0
- package/dist/services/Clock/types.d.cts +11 -0
- package/dist/services/Clock/types.d.cts.map +1 -0
- package/dist/services/Clock/types.d.mts +11 -0
- package/dist/services/Clock/types.d.mts.map +1 -0
- package/dist/services/Launcher/Launcher.cjs +2 -0
- package/dist/services/Launcher/Launcher.cjs.map +1 -0
- package/dist/services/Launcher/Launcher.d.cts +27 -0
- package/dist/services/Launcher/Launcher.d.cts.map +1 -0
- package/dist/services/Launcher/Launcher.d.mts +27 -0
- package/dist/services/Launcher/Launcher.d.mts.map +1 -0
- package/dist/services/Launcher/Launcher.mjs +2 -0
- package/dist/services/Launcher/Launcher.mjs.map +1 -0
- package/dist/services/Launcher/index.cjs +1 -0
- package/dist/services/Launcher/index.d.cts +3 -0
- package/dist/services/Launcher/index.d.mts +3 -0
- package/dist/services/Launcher/index.mjs +1 -0
- package/dist/services/Launcher/types.d.cts +40 -0
- package/dist/services/Launcher/types.d.cts.map +1 -0
- package/dist/services/Launcher/types.d.mts +40 -0
- package/dist/services/Launcher/types.d.mts.map +1 -0
- package/dist/services/Lifeline/NodeLifeline.cjs +2 -0
- package/dist/services/Lifeline/NodeLifeline.cjs.map +1 -0
- package/dist/services/Lifeline/NodeLifeline.d.cts +21 -0
- package/dist/services/Lifeline/NodeLifeline.d.cts.map +1 -0
- package/dist/services/Lifeline/NodeLifeline.d.mts +21 -0
- package/dist/services/Lifeline/NodeLifeline.d.mts.map +1 -0
- package/dist/services/Lifeline/NodeLifeline.mjs +2 -0
- package/dist/services/Lifeline/NodeLifeline.mjs.map +1 -0
- package/dist/services/Lifeline/client.cjs +2 -0
- package/dist/services/Lifeline/client.cjs.map +1 -0
- package/dist/services/Lifeline/client.d.cts +23 -0
- package/dist/services/Lifeline/client.d.cts.map +1 -0
- package/dist/services/Lifeline/client.d.mts +23 -0
- package/dist/services/Lifeline/client.d.mts.map +1 -0
- package/dist/services/Lifeline/client.mjs +2 -0
- package/dist/services/Lifeline/client.mjs.map +1 -0
- package/dist/services/Lifeline/index.cjs +1 -0
- package/dist/services/Lifeline/index.d.cts +4 -0
- package/dist/services/Lifeline/index.d.mts +4 -0
- package/dist/services/Lifeline/index.mjs +1 -0
- package/dist/services/Lifeline/types.d.cts +19 -0
- package/dist/services/Lifeline/types.d.cts.map +1 -0
- package/dist/services/Lifeline/types.d.mts +19 -0
- package/dist/services/Lifeline/types.d.mts.map +1 -0
- package/dist/services/LogFile/LogFile.cjs +2 -0
- package/dist/services/LogFile/LogFile.cjs.map +1 -0
- package/dist/services/LogFile/LogFile.d.cts +13 -0
- package/dist/services/LogFile/LogFile.d.cts.map +1 -0
- package/dist/services/LogFile/LogFile.d.mts +13 -0
- package/dist/services/LogFile/LogFile.d.mts.map +1 -0
- package/dist/services/LogFile/LogFile.mjs +2 -0
- package/dist/services/LogFile/LogFile.mjs.map +1 -0
- package/dist/services/LogFile/index.cjs +1 -0
- package/dist/services/LogFile/index.d.cts +3 -0
- package/dist/services/LogFile/index.d.mts +3 -0
- package/dist/services/LogFile/index.mjs +1 -0
- package/dist/services/LogFile/types.d.cts +16 -0
- package/dist/services/LogFile/types.d.cts.map +1 -0
- package/dist/services/LogFile/types.d.mts +16 -0
- package/dist/services/LogFile/types.d.mts.map +1 -0
- package/dist/services/LogReader/LogReader.cjs +10 -0
- package/dist/services/LogReader/LogReader.cjs.map +1 -0
- package/dist/services/LogReader/LogReader.d.cts +14 -0
- package/dist/services/LogReader/LogReader.d.cts.map +1 -0
- package/dist/services/LogReader/LogReader.d.mts +14 -0
- package/dist/services/LogReader/LogReader.d.mts.map +1 -0
- package/dist/services/LogReader/LogReader.mjs +10 -0
- package/dist/services/LogReader/LogReader.mjs.map +1 -0
- package/dist/services/LogReader/index.cjs +1 -0
- package/dist/services/LogReader/index.d.cts +3 -0
- package/dist/services/LogReader/index.d.mts +3 -0
- package/dist/services/LogReader/index.mjs +1 -0
- package/dist/services/LogReader/types.d.cts +27 -0
- package/dist/services/LogReader/types.d.cts.map +1 -0
- package/dist/services/LogReader/types.d.mts +27 -0
- package/dist/services/LogReader/types.d.mts.map +1 -0
- package/dist/services/ProcessControl/NodeProcessControl.cjs +2 -0
- package/dist/services/ProcessControl/NodeProcessControl.cjs.map +1 -0
- package/dist/services/ProcessControl/NodeProcessControl.d.cts +11 -0
- package/dist/services/ProcessControl/NodeProcessControl.d.cts.map +1 -0
- package/dist/services/ProcessControl/NodeProcessControl.d.mts +11 -0
- package/dist/services/ProcessControl/NodeProcessControl.d.mts.map +1 -0
- package/dist/services/ProcessControl/NodeProcessControl.mjs +2 -0
- package/dist/services/ProcessControl/NodeProcessControl.mjs.map +1 -0
- package/dist/services/ProcessControl/index.cjs +1 -0
- package/dist/services/ProcessControl/index.d.cts +3 -0
- package/dist/services/ProcessControl/index.d.mts +3 -0
- package/dist/services/ProcessControl/index.mjs +1 -0
- package/dist/services/ProcessControl/types.d.cts +14 -0
- package/dist/services/ProcessControl/types.d.cts.map +1 -0
- package/dist/services/ProcessControl/types.d.mts +14 -0
- package/dist/services/ProcessControl/types.d.mts.map +1 -0
- package/dist/services/PtyHost/PtyHost.cjs +5 -0
- package/dist/services/PtyHost/PtyHost.cjs.map +1 -0
- package/dist/services/PtyHost/PtyHost.d.cts +28 -0
- package/dist/services/PtyHost/PtyHost.d.cts.map +1 -0
- package/dist/services/PtyHost/PtyHost.d.mts +28 -0
- package/dist/services/PtyHost/PtyHost.d.mts.map +1 -0
- package/dist/services/PtyHost/PtyHost.mjs +5 -0
- package/dist/services/PtyHost/PtyHost.mjs.map +1 -0
- package/dist/services/PtyHost/index.cjs +1 -0
- package/dist/services/PtyHost/index.d.cts +3 -0
- package/dist/services/PtyHost/index.d.mts +3 -0
- package/dist/services/PtyHost/index.mjs +1 -0
- package/dist/services/PtyHost/types.d.cts +39 -0
- package/dist/services/PtyHost/types.d.cts.map +1 -0
- package/dist/services/PtyHost/types.d.mts +39 -0
- package/dist/services/PtyHost/types.d.mts.map +1 -0
- package/dist/services/PtySpawner/NodePtySpawner.cjs +2 -0
- package/dist/services/PtySpawner/NodePtySpawner.cjs.map +1 -0
- package/dist/services/PtySpawner/NodePtySpawner.d.cts +18 -0
- package/dist/services/PtySpawner/NodePtySpawner.d.cts.map +1 -0
- package/dist/services/PtySpawner/NodePtySpawner.d.mts +18 -0
- package/dist/services/PtySpawner/NodePtySpawner.d.mts.map +1 -0
- package/dist/services/PtySpawner/NodePtySpawner.mjs +2 -0
- package/dist/services/PtySpawner/NodePtySpawner.mjs.map +1 -0
- package/dist/services/PtySpawner/index.cjs +1 -0
- package/dist/services/PtySpawner/index.d.cts +3 -0
- package/dist/services/PtySpawner/index.d.mts +3 -0
- package/dist/services/PtySpawner/index.mjs +1 -0
- package/dist/services/PtySpawner/types.d.cts +28 -0
- package/dist/services/PtySpawner/types.d.cts.map +1 -0
- package/dist/services/PtySpawner/types.d.mts +28 -0
- package/dist/services/PtySpawner/types.d.mts.map +1 -0
- package/dist/services/RmuxBackend/RmuxBackend.cjs +2 -0
- package/dist/services/RmuxBackend/RmuxBackend.cjs.map +1 -0
- package/dist/services/RmuxBackend/RmuxBackend.d.cts +36 -0
- package/dist/services/RmuxBackend/RmuxBackend.d.cts.map +1 -0
- package/dist/services/RmuxBackend/RmuxBackend.d.mts +36 -0
- package/dist/services/RmuxBackend/RmuxBackend.d.mts.map +1 -0
- package/dist/services/RmuxBackend/RmuxBackend.mjs +2 -0
- package/dist/services/RmuxBackend/RmuxBackend.mjs.map +1 -0
- package/dist/services/RmuxBackend/index.cjs +1 -0
- package/dist/services/RmuxBackend/index.d.cts +3 -0
- package/dist/services/RmuxBackend/index.d.mts +3 -0
- package/dist/services/RmuxBackend/index.mjs +1 -0
- package/dist/services/RmuxBackend/types.d.cts +29 -0
- package/dist/services/RmuxBackend/types.d.cts.map +1 -0
- package/dist/services/RmuxBackend/types.d.mts +29 -0
- package/dist/services/RmuxBackend/types.d.mts.map +1 -0
- package/dist/services/RunnerNamer/RunnerNamer.cjs +2 -0
- package/dist/services/RunnerNamer/RunnerNamer.cjs.map +1 -0
- package/dist/services/RunnerNamer/RunnerNamer.d.cts +13 -0
- package/dist/services/RunnerNamer/RunnerNamer.d.cts.map +1 -0
- package/dist/services/RunnerNamer/RunnerNamer.d.mts +13 -0
- package/dist/services/RunnerNamer/RunnerNamer.d.mts.map +1 -0
- package/dist/services/RunnerNamer/RunnerNamer.mjs +2 -0
- package/dist/services/RunnerNamer/RunnerNamer.mjs.map +1 -0
- package/dist/services/RunnerNamer/index.cjs +1 -0
- package/dist/services/RunnerNamer/index.d.cts +3 -0
- package/dist/services/RunnerNamer/index.d.mts +3 -0
- package/dist/services/RunnerNamer/index.mjs +1 -0
- package/dist/services/RunnerNamer/types.d.cts +12 -0
- package/dist/services/RunnerNamer/types.d.cts.map +1 -0
- package/dist/services/RunnerNamer/types.d.mts +12 -0
- package/dist/services/RunnerNamer/types.d.mts.map +1 -0
- package/dist/services/RunnerPaths/RunnerPaths.cjs +2 -0
- package/dist/services/RunnerPaths/RunnerPaths.cjs.map +1 -0
- package/dist/services/RunnerPaths/RunnerPaths.d.cts +31 -0
- package/dist/services/RunnerPaths/RunnerPaths.d.cts.map +1 -0
- package/dist/services/RunnerPaths/RunnerPaths.d.mts +31 -0
- package/dist/services/RunnerPaths/RunnerPaths.d.mts.map +1 -0
- package/dist/services/RunnerPaths/RunnerPaths.mjs +2 -0
- package/dist/services/RunnerPaths/RunnerPaths.mjs.map +1 -0
- package/dist/services/RunnerPaths/index.cjs +1 -0
- package/dist/services/RunnerPaths/index.d.cts +3 -0
- package/dist/services/RunnerPaths/index.d.mts +3 -0
- package/dist/services/RunnerPaths/index.mjs +1 -0
- package/dist/services/RunnerPaths/types.d.cts +33 -0
- package/dist/services/RunnerPaths/types.d.cts.map +1 -0
- package/dist/services/RunnerPaths/types.d.mts +33 -0
- package/dist/services/RunnerPaths/types.d.mts.map +1 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.cjs +2 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.cjs.map +1 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.d.cts +40 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.d.cts.map +1 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.d.mts +40 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.d.mts.map +1 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.mjs +2 -0
- package/dist/services/RunnerRegistry/RunnerRegistry.mjs.map +1 -0
- package/dist/services/RunnerRegistry/index.cjs +1 -0
- package/dist/services/RunnerRegistry/index.d.cts +3 -0
- package/dist/services/RunnerRegistry/index.d.mts +3 -0
- package/dist/services/RunnerRegistry/index.mjs +1 -0
- package/dist/services/RunnerRegistry/types.d.cts +98 -0
- package/dist/services/RunnerRegistry/types.d.cts.map +1 -0
- package/dist/services/RunnerRegistry/types.d.mts +98 -0
- package/dist/services/RunnerRegistry/types.d.mts.map +1 -0
- package/dist/services/Spawner/NodeSpawner.cjs +2 -0
- package/dist/services/Spawner/NodeSpawner.cjs.map +1 -0
- package/dist/services/Spawner/NodeSpawner.d.cts +10 -0
- package/dist/services/Spawner/NodeSpawner.d.cts.map +1 -0
- package/dist/services/Spawner/NodeSpawner.d.mts +10 -0
- package/dist/services/Spawner/NodeSpawner.d.mts.map +1 -0
- package/dist/services/Spawner/NodeSpawner.mjs +2 -0
- package/dist/services/Spawner/NodeSpawner.mjs.map +1 -0
- package/dist/services/Spawner/index.cjs +1 -0
- package/dist/services/Spawner/index.d.cts +3 -0
- package/dist/services/Spawner/index.d.mts +3 -0
- package/dist/services/Spawner/index.mjs +1 -0
- package/dist/services/Spawner/types.d.cts +31 -0
- package/dist/services/Spawner/types.d.cts.map +1 -0
- package/dist/services/Spawner/types.d.mts +31 -0
- package/dist/services/Spawner/types.d.mts.map +1 -0
- package/dist/session.cjs +2 -0
- package/dist/session.cjs.map +1 -0
- package/dist/session.d.cts +10 -0
- package/dist/session.d.cts.map +1 -0
- package/dist/session.d.mts +10 -0
- package/dist/session.d.mts.map +1 -0
- package/dist/session.mjs +2 -0
- package/dist/session.mjs.map +1 -0
- package/dist/tool/bashTool.cjs +7 -0
- package/dist/tool/bashTool.cjs.map +1 -0
- package/dist/tool/bashTool.d.cts +25 -0
- package/dist/tool/bashTool.d.cts.map +1 -0
- package/dist/tool/bashTool.d.mts +25 -0
- package/dist/tool/bashTool.d.mts.map +1 -0
- package/dist/tool/bashTool.mjs +7 -0
- package/dist/tool/bashTool.mjs.map +1 -0
- package/dist/tool/responseEnvelope.cjs +10 -0
- package/dist/tool/responseEnvelope.cjs.map +1 -0
- package/dist/tool/responseEnvelope.d.cts +45 -0
- package/dist/tool/responseEnvelope.d.cts.map +1 -0
- package/dist/tool/responseEnvelope.d.mts +45 -0
- package/dist/tool/responseEnvelope.d.mts.map +1 -0
- package/dist/tool/responseEnvelope.mjs +10 -0
- package/dist/tool/responseEnvelope.mjs.map +1 -0
- package/dist/tool/schema.cjs +2 -0
- package/dist/tool/schema.cjs.map +1 -0
- package/dist/tool/schema.d.cts +25 -0
- package/dist/tool/schema.d.cts.map +1 -0
- package/dist/tool/schema.d.mts +25 -0
- package/dist/tool/schema.d.mts.map +1 -0
- package/dist/tool/schema.mjs +2 -0
- package/dist/tool/schema.mjs.map +1 -0
- package/dist/tui/bashRender.cjs +8 -0
- package/dist/tui/bashRender.cjs.map +1 -0
- package/dist/tui/bashRender.d.cts +51 -0
- package/dist/tui/bashRender.d.cts.map +1 -0
- package/dist/tui/bashRender.d.mts +51 -0
- package/dist/tui/bashRender.d.mts.map +1 -0
- package/dist/tui/bashRender.mjs +8 -0
- package/dist/tui/bashRender.mjs.map +1 -0
- package/dist/tui/format.cjs +2 -0
- package/dist/tui/format.cjs.map +1 -0
- package/dist/tui/format.d.cts +25 -0
- package/dist/tui/format.d.cts.map +1 -0
- package/dist/tui/format.d.mts +25 -0
- package/dist/tui/format.d.mts.map +1 -0
- package/dist/tui/format.mjs +2 -0
- package/dist/tui/format.mjs.map +1 -0
- package/dist/tui/runnerSpace.cjs +6 -0
- package/dist/tui/runnerSpace.cjs.map +1 -0
- package/dist/tui/runnerSpace.d.cts +52 -0
- package/dist/tui/runnerSpace.d.cts.map +1 -0
- package/dist/tui/runnerSpace.d.mts +52 -0
- package/dist/tui/runnerSpace.d.mts.map +1 -0
- package/dist/tui/runnerSpace.mjs +6 -0
- package/dist/tui/runnerSpace.mjs.map +1 -0
- package/dist/types.cjs +2 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +28 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +28 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +335 -0
- package/skills/doom-runner/SKILL.md +69 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IRunnerPaths } from "../RunnerPaths/types.mjs";
|
|
2
|
+
import "../RunnerPaths/index.mjs";
|
|
3
|
+
import { IProcessControl } from "../ProcessControl/types.mjs";
|
|
4
|
+
import "../ProcessControl/index.mjs";
|
|
5
|
+
import { CompleteRunnerInput, IRunnerRegistry, RegisterRunnerInput, RunnerRecord } from "./types.mjs";
|
|
6
|
+
import "reflect-metadata/lite";
|
|
7
|
+
import { ProcessRegistryService } from "@agimon-ai/foundation-process-registry";
|
|
8
|
+
//#region src/services/RunnerRegistry/RunnerRegistry.d.ts
|
|
9
|
+
/** The slice of the shared registry service this wrapper depends on. */
|
|
10
|
+
type ProcessRegistryPort = Pick<ProcessRegistryService, 'registerProcess' | 'releaseProcess' | 'listProcesses' | 'close'>;
|
|
11
|
+
/** Opens the SQLite-backed registry the rest of the monorepo already shares. */
|
|
12
|
+
declare function createDefaultProcessRegistry(): ProcessRegistryPort;
|
|
13
|
+
declare class RunnerRegistry implements IRunnerRegistry {
|
|
14
|
+
private readonly paths;
|
|
15
|
+
private readonly processControl;
|
|
16
|
+
private readonly registry;
|
|
17
|
+
private readonly listeners;
|
|
18
|
+
constructor(paths: IRunnerPaths, processControl: IProcessControl, registry: ProcessRegistryPort);
|
|
19
|
+
register(input: RegisterRunnerInput): Promise<RunnerRecord>;
|
|
20
|
+
list(): Promise<RunnerRecord[]>;
|
|
21
|
+
listAcrossRepositories(): Promise<RunnerRecord[]>;
|
|
22
|
+
listBySession(sessionId: string): Promise<RunnerRecord[]>;
|
|
23
|
+
listByRootSession(rootSessionId: string): Promise<RunnerRecord[]>;
|
|
24
|
+
listAll(sessionId?: string): Promise<RunnerRecord[]>;
|
|
25
|
+
get(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
26
|
+
markPromoted(id: string): Promise<RunnerRecord | undefined>;
|
|
27
|
+
clearAlarm(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
28
|
+
markAlarmFired(id: string, firedAt: string): Promise<RunnerRecord | undefined>;
|
|
29
|
+
complete(id: string, outcome: CompleteRunnerInput, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
30
|
+
release(id: string): Promise<void>;
|
|
31
|
+
pruneDead(): Promise<string[]>;
|
|
32
|
+
subscribe(listener: () => void): () => void;
|
|
33
|
+
close(): void;
|
|
34
|
+
private notify;
|
|
35
|
+
private repositoryPath;
|
|
36
|
+
private writeRecord;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ProcessRegistryPort, RunnerRegistry, createDefaultProcessRegistry };
|
|
40
|
+
//# sourceMappingURL=RunnerRegistry.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunnerRegistry.d.mts","names":[],"sources":["../../../src/services/RunnerRegistry/RunnerRegistry.ts"],"mappings":";;;;;;;;;KA2BY,sBAAsB,KAChC;;iBAKc,gCAAgC;cAmBnC,0BAA0B;mBAIS;mBACG;mBACC;mBALjC;EAG6B,YAAA,OAAO,cACJ,gBAAgB,iBACf,UAAU;EAGtD,SAAS,OAAO,sBAAsB,QAAQ;EAoD9C,QAAQ,QAAQ;EAShB,0BAA0B,QAAQ;EAQlC,cAAc,oBAAoB,QAAQ;EAK1C,kBAAkB,wBAAwB,QAAQ;EAKlD,QAAQ,qBAAqB,QAAQ;EAgBrC,IAAI,YAAY,qBAAqB,QAAQ;EAgB7C,aAAa,aAAa,QAAQ;EASlC,WAAW,YAAY,qBAAqB,QAAQ;EAWpD,eAAe,YAAY,kBAAkB,QAAQ;EASrD,SAAS,YAAY,SAAS,qBAAqB,qBAAqB,QAAQ;EA0BhF,QAAQ,aAAa;EAerB,aAAa;EAQnB,UAAU;EAKV;UAKQ;UAIA;UAIA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TYPES as e}from"../../types.mjs";import t from"../../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateMetadata.mjs";import n from"../../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorateParam.mjs";import r from"../../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.mjs";import{inject as i,injectable as a}from"inversify";import"reflect-metadata/lite";import o from"node:fs";import s from"node:path";import{resolveRootSessionId as c}from"@agimon-ai/doompi-extension-contracts/child-process";import{createProcessRegistryService as l,normalizeRepositoryPath as u,resolveProcessTags as d}from"@agimon-ai/foundation-process-registry";const f=`tool`,p=`doom-runner:`,m=`doom-runner`;function h(){return l(process.env.PROCESS_REGISTRY_PATH)}function g(e){return`session:${e}`}function _(e,t){let n=e.metadata?.[t];return typeof n==`string`?n:``}function v(e,t){let n=e.metadata?.[t];return typeof n==`number`?n:0}let y=class{paths;processControl;registry;listeners=new Set;constructor(e,t,n){this.paths=e,this.processControl=t,this.registry=n}async register(e){let t=new Date().toISOString(),n=c(e.sessionId),r=await this.registry.registerProcess({repositoryPath:this.repositoryPath(),serviceName:`${p}${e.id}`,serviceType:f,pid:e.pid,command:e.command,tags:d([m,`runner:${e.id}`,g(e.sessionId)]),metadata:{id:e.id,name:e.name,command:e.command,cwd:e.cwd,logPath:e.logPath,interactive:e.interactive,sessionId:e.sessionId,rootSessionId:n,backend:e.backend,...e.backendTarget?{backendTarget:e.backendTarget}:{},startedAt:t,hostPid:process.pid},force:!0});if(!r.success)throw Error(r.error??`Failed to register runner ${e.name}`);let i={id:e.id,name:e.name,pid:e.pid,command:e.command,cwd:e.cwd,logPath:e.logPath,interactive:e.interactive,sessionId:e.sessionId,rootSessionId:n,startedAt:t,state:`running`,promoted:!1,backend:e.backend,...e.backendTarget?{backendTarget:e.backendTarget}:{},...e.alarmMs?{alarm:{intervalMs:e.alarmMs,lastFiredAt:t}}:{},hostPid:process.pid};return this.writeRecord(i),this.notify(),i}async list(){return(await this.registry.listProcesses({repositoryPath:this.repositoryPath(),serviceType:f,tags:d([m])})).map(b)}async listAcrossRepositories(){return(await this.registry.listProcesses({serviceType:f,tags:d([m])})).map(b)}async listBySession(e){return(await this.list()).filter(t=>t.sessionId===e)}async listByRootSession(e){return(await this.list()).filter(t=>(t.rootSessionId??t.sessionId)===e)}async listAll(e){this.paths.ensureDirectories(e);let t=[],n=this.paths.stateDirectory(e);for(let e of o.readdirSync(n))if(S(e))try{let r=JSON.parse(o.readFileSync(`${n}/${e}`,`utf8`));C(r)&&t.push(r)}catch(t){process.emitWarning(`Could not read runner metadata ${e}: ${String(t)}`)}return t.sort((e,t)=>t.startedAt.localeCompare(e.startedAt))}async get(e,t){let n=this.paths.statePathFor(e,t);try{let t=JSON.parse(o.readFileSync(n,`utf8`));if(!C(t)||t.id!==e){process.emitWarning(`Could not read runner metadata ${s.basename(n)}: invalid runner record`);return}return t}catch(e){if(e.code===`ENOENT`)return;process.emitWarning(`Could not read runner metadata ${s.basename(n)}: ${String(e)}`);return}}async markPromoted(e){let t=await this.get(e);if(!t)return;let n={...t,promoted:!0};return this.writeRecord(n),this.notify(),n}async clearAlarm(e,t){let n=await this.get(e,t);if(!n)return;if(!n.alarm)return n;let r={...n};return delete r.alarm,this.writeRecord(r),this.notify(),r}async markAlarmFired(e,t){let n=await this.get(e);if(!n?.alarm||n.state!==`running`)return;let r={...n,alarm:{...n.alarm,lastFiredAt:t}};return this.writeRecord(r),this.notify(),r}async complete(e,t,n){let r=await this.get(e,n);if(r?.state===`completed`)return await this.release(e),r;let i=await this.list(),a=r??i.find(t=>t.id===e&&(n===void 0||t.sessionId===n));if(!a){n!==void 0&&i.some(t=>t.id===e&&t.sessionId!==n)||await this.release(e);return}let o={...a,state:`completed`,exit:{...t,finishedAt:new Date().toISOString()}};return this.writeRecord(o),await this.release(e),o}async release(e){let t=await this.registry.releaseProcess({repositoryPath:this.repositoryPath(),serviceName:`${p}${e}`,serviceType:f,kill:!1,releasePort:!1,force:!0});if(!t.success&&!t.error?.includes(`No matching process entry`))throw Error(t.error??`Failed to release runner ${e}`);this.notify()}async pruneDead(){let e=(await this.list()).filter(e=>!this.processControl.isAlive(e.pid));for(let t of e)await this.complete(t.id,{reason:`backend_lost`,code:null,signal:null},t.sessionId);return e.map(e=>e.id)}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}close(){this.listeners.clear(),this.registry.close()}notify(){for(let e of this.listeners)e()}repositoryPath(){return u(this.paths.repositoryPath())}writeRecord(e){this.paths.ensureDirectories(e.sessionId);let t=this.paths.statePathFor(e.id,e.sessionId),n=`${t}.${process.pid}.tmp`;o.writeFileSync(n,`${JSON.stringify(e,null,2)}\n`,`utf8`),o.renameSync(n,t)}};y=r([a(),n(0,i(e.RunnerPaths)),n(1,i(e.ProcessControl)),n(2,i(e.ProcessRegistry)),t(`design:paramtypes`,[Object,Object,Object])],y);function b(e){return{id:_(e,`id`),name:_(e,`name`),pid:e.pid,command:_(e,`command`),cwd:_(e,`cwd`),logPath:_(e,`logPath`),interactive:e.metadata?.interactive===!0,sessionId:_(e,`sessionId`),..._(e,`rootSessionId`)?{rootSessionId:_(e,`rootSessionId`)}:{},startedAt:_(e,`startedAt`),state:`running`,promoted:!1,backend:x(e.metadata?.backend),..._(e,`backendTarget`)?{backendTarget:_(e,`backendTarget`)}:{},hostPid:v(e,`hostPid`)}}function x(e){return e===`rmux`||e===`tmux`?e:`native`}function S(e){return e.endsWith(`.json`)&&!e.endsWith(`.command.json`)&&!e.endsWith(`.exit.json`)}function C(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.name==`string`&&typeof t.pid==`number`&&typeof t.command==`string`&&typeof t.cwd==`string`&&typeof t.logPath==`string`&&typeof t.sessionId==`string`&&typeof t.startedAt==`string`&&(t.state===`running`||t.state===`completed`)&&typeof t.promoted==`boolean`&&(t.backend===`rmux`||t.backend===`tmux`||t.backend===`native`)}export{y as RunnerRegistry,h as createDefaultProcessRegistry};
|
|
2
|
+
//# sourceMappingURL=RunnerRegistry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunnerRegistry.mjs","names":[],"sources":["../../../src/services/RunnerRegistry/RunnerRegistry.ts"],"sourcesContent":["import { resolveRootSessionId } from '@agimon-ai/doompi-extension-contracts/child-process';\nimport {\n createProcessRegistryService,\n normalizeRepositoryPath,\n type ProcessRegistryRecord,\n type ProcessRegistryService,\n resolveProcessTags,\n} from '@agimon-ai/foundation-process-registry';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { inject, injectable } from 'inversify';\nimport 'reflect-metadata/lite';\nimport type { IProcessControl } from '../ProcessControl/index.ts';\nimport type { IRunnerPaths } from '../RunnerPaths/index.ts';\nimport { TYPES } from '../../types.ts';\nimport type { CompleteRunnerInput, IRunnerRegistry, RegisterRunnerInput, RunnerRecord } from './types.ts';\n\nconst SERVICE_TYPE = 'tool';\nconst SERVICE_PREFIX = 'doom-runner:';\nconst RUNNER_TAG = 'doom-runner';\nconst REGISTRY_PATH_ENV = 'PROCESS_REGISTRY_PATH';\nconst JSON_EXTENSION = '.json';\nconst COMMAND_SIDECAR_SUFFIX = '.command.json';\nconst EXIT_SIDECAR_SUFFIX = '.exit.json';\nconst NOT_FOUND_ERROR_CODE = 'ENOENT';\n\n/** The slice of the shared registry service this wrapper depends on. */\nexport type ProcessRegistryPort = Pick<\n ProcessRegistryService,\n 'registerProcess' | 'releaseProcess' | 'listProcesses' | 'close'\n>;\n\n/** Opens the SQLite-backed registry the rest of the monorepo already shares. */\nexport function createDefaultProcessRegistry(): ProcessRegistryPort {\n return createProcessRegistryService(process.env[REGISTRY_PATH_ENV]);\n}\n\nfunction sessionTag(sessionId: string): string {\n return `session:${sessionId}`;\n}\n\nfunction readString(record: ProcessRegistryRecord, key: string): string {\n const value = record.metadata?.[key];\n return typeof value === 'string' ? value : '';\n}\n\nfunction readNumber(record: ProcessRegistryRecord, key: string): number {\n const value = record.metadata?.[key];\n return typeof value === 'number' ? value : 0;\n}\n\n@injectable()\nexport class RunnerRegistry implements IRunnerRegistry {\n private readonly listeners = new Set<() => void>();\n\n constructor(\n @inject(TYPES.RunnerPaths) private readonly paths: IRunnerPaths,\n @inject(TYPES.ProcessControl) private readonly processControl: IProcessControl,\n @inject(TYPES.ProcessRegistry) private readonly registry: ProcessRegistryPort,\n ) {}\n\n async register(input: RegisterRunnerInput): Promise<RunnerRecord> {\n const startedAt = new Date().toISOString();\n const rootSessionId = resolveRootSessionId(input.sessionId);\n const response = await this.registry.registerProcess({\n repositoryPath: this.repositoryPath(),\n serviceName: `${SERVICE_PREFIX}${input.id}`,\n serviceType: SERVICE_TYPE,\n pid: input.pid,\n command: input.command,\n tags: resolveProcessTags([RUNNER_TAG, `runner:${input.id}`, sessionTag(input.sessionId)]),\n metadata: {\n id: input.id,\n name: input.name,\n command: input.command,\n cwd: input.cwd,\n logPath: input.logPath,\n interactive: input.interactive,\n sessionId: input.sessionId,\n rootSessionId,\n backend: input.backend,\n ...(input.backendTarget ? { backendTarget: input.backendTarget } : {}),\n startedAt,\n hostPid: process.pid,\n },\n // The caller has already resolved name collisions against live records,\n // so anything still holding this name is stale.\n force: true,\n });\n if (!response.success) throw new Error(response.error ?? `Failed to register runner ${input.name}`);\n const record: RunnerRecord = {\n id: input.id,\n name: input.name,\n pid: input.pid,\n command: input.command,\n cwd: input.cwd,\n logPath: input.logPath,\n interactive: input.interactive,\n sessionId: input.sessionId,\n rootSessionId,\n startedAt,\n state: 'running',\n promoted: false,\n backend: input.backend,\n ...(input.backendTarget ? { backendTarget: input.backendTarget } : {}),\n ...(input.alarmMs ? { alarm: { intervalMs: input.alarmMs, lastFiredAt: startedAt } } : {}),\n hostPid: process.pid,\n };\n this.writeRecord(record);\n this.notify();\n return record;\n }\n\n async list(): Promise<RunnerRecord[]> {\n const records = await this.registry.listProcesses({\n repositoryPath: this.repositoryPath(),\n serviceType: SERVICE_TYPE,\n tags: resolveProcessTags([RUNNER_TAG]),\n });\n return records.map(toRunnerRecord);\n }\n\n async listAcrossRepositories(): Promise<RunnerRecord[]> {\n const records = await this.registry.listProcesses({\n serviceType: SERVICE_TYPE,\n tags: resolveProcessTags([RUNNER_TAG]),\n });\n return records.map(toRunnerRecord);\n }\n\n async listBySession(sessionId: string): Promise<RunnerRecord[]> {\n const records = await this.list();\n return records.filter((record) => record.sessionId === sessionId);\n }\n\n async listByRootSession(rootSessionId: string): Promise<RunnerRecord[]> {\n const records = await this.list();\n return records.filter((record) => (record.rootSessionId ?? record.sessionId) === rootSessionId);\n }\n\n async listAll(sessionId?: string): Promise<RunnerRecord[]> {\n this.paths.ensureDirectories(sessionId);\n const records: RunnerRecord[] = [];\n const directory = this.paths.stateDirectory(sessionId);\n for (const entry of fs.readdirSync(directory)) {\n if (!isPrimaryMetadataEntry(entry)) continue;\n try {\n const parsed: unknown = JSON.parse(fs.readFileSync(`${directory}/${entry}`, 'utf8'));\n if (isRunnerRecord(parsed)) records.push(parsed);\n } catch (error) {\n process.emitWarning(`Could not read runner metadata ${entry}: ${String(error)}`);\n }\n }\n return records.sort((left, right) => right.startedAt.localeCompare(left.startedAt));\n }\n\n async get(id: string, sessionId?: string): Promise<RunnerRecord | undefined> {\n const target = this.paths.statePathFor(id, sessionId);\n try {\n const parsed: unknown = JSON.parse(fs.readFileSync(target, 'utf8'));\n if (!isRunnerRecord(parsed) || parsed.id !== id) {\n process.emitWarning(`Could not read runner metadata ${path.basename(target)}: invalid runner record`);\n return undefined;\n }\n return parsed;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return undefined;\n process.emitWarning(`Could not read runner metadata ${path.basename(target)}: ${String(error)}`);\n return undefined;\n }\n }\n\n async markPromoted(id: string): Promise<RunnerRecord | undefined> {\n const record = await this.get(id);\n if (!record) return undefined;\n const promoted = { ...record, promoted: true };\n this.writeRecord(promoted);\n this.notify();\n return promoted;\n }\n\n async clearAlarm(id: string, sessionId?: string): Promise<RunnerRecord | undefined> {\n const record = await this.get(id, sessionId);\n if (!record) return undefined;\n if (!record.alarm) return record;\n const cleared: RunnerRecord = { ...record };\n delete cleared.alarm;\n this.writeRecord(cleared);\n this.notify();\n return cleared;\n }\n\n async markAlarmFired(id: string, firedAt: string): Promise<RunnerRecord | undefined> {\n const record = await this.get(id);\n if (!record?.alarm || record.state !== 'running') return undefined;\n const fired: RunnerRecord = { ...record, alarm: { ...record.alarm, lastFiredAt: firedAt } };\n this.writeRecord(fired);\n this.notify();\n return fired;\n }\n\n async complete(id: string, outcome: CompleteRunnerInput, sessionId?: string): Promise<RunnerRecord | undefined> {\n const persisted = await this.get(id, sessionId);\n if (persisted?.state === 'completed') {\n await this.release(id);\n return persisted;\n }\n const active = await this.list();\n const record =\n persisted ??\n active.find((candidate) => candidate.id === id && (sessionId === undefined || candidate.sessionId === sessionId));\n if (!record) {\n const belongsToAnotherSession =\n sessionId !== undefined && active.some((candidate) => candidate.id === id && candidate.sessionId !== sessionId);\n if (!belongsToAnotherSession) await this.release(id);\n return undefined;\n }\n const completed: RunnerRecord = {\n ...record,\n state: 'completed',\n exit: { ...outcome, finishedAt: new Date().toISOString() },\n };\n this.writeRecord(completed);\n await this.release(id);\n return completed;\n }\n\n async release(id: string): Promise<void> {\n const response = await this.registry.releaseProcess({\n repositoryPath: this.repositoryPath(),\n serviceName: `${SERVICE_PREFIX}${id}`,\n serviceType: SERVICE_TYPE,\n kill: false,\n releasePort: false,\n force: true,\n });\n if (!response.success && !response.error?.includes('No matching process entry')) {\n throw new Error(response.error ?? `Failed to release runner ${id}`);\n }\n this.notify();\n }\n\n async pruneDead(): Promise<string[]> {\n const dead = (await this.list()).filter((record) => !this.processControl.isAlive(record.pid));\n for (const record of dead) {\n await this.complete(record.id, { reason: 'backend_lost', code: null, signal: null }, record.sessionId);\n }\n return dead.map((record) => record.id);\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n close(): void {\n this.listeners.clear();\n this.registry.close();\n }\n\n private notify(): void {\n for (const listener of this.listeners) listener();\n }\n\n private repositoryPath(): string {\n return normalizeRepositoryPath(this.paths.repositoryPath());\n }\n\n private writeRecord(record: RunnerRecord): void {\n this.paths.ensureDirectories(record.sessionId);\n const target = this.paths.statePathFor(record.id, record.sessionId);\n const temporary = `${target}.${process.pid}.tmp`;\n fs.writeFileSync(temporary, `${JSON.stringify(record, null, 2)}\\n`, 'utf8');\n fs.renameSync(temporary, target);\n }\n}\n\n/** Every field is read back from metadata this class wrote on registration. */\nfunction toRunnerRecord(record: ProcessRegistryRecord): RunnerRecord {\n return {\n id: readString(record, 'id'),\n name: readString(record, 'name'),\n pid: record.pid,\n command: readString(record, 'command'),\n cwd: readString(record, 'cwd'),\n logPath: readString(record, 'logPath'),\n interactive: record.metadata?.interactive === true,\n sessionId: readString(record, 'sessionId'),\n ...(readString(record, 'rootSessionId') ? { rootSessionId: readString(record, 'rootSessionId') } : {}),\n startedAt: readString(record, 'startedAt'),\n state: 'running',\n promoted: false,\n backend: readBackend(record.metadata?.backend),\n ...(readString(record, 'backendTarget') ? { backendTarget: readString(record, 'backendTarget') } : {}),\n hostPid: readNumber(record, 'hostPid'),\n };\n}\n\nfunction readBackend(value: unknown): RunnerRecord['backend'] {\n return value === 'rmux' || value === 'tmux' ? value : 'native';\n}\n\nfunction isPrimaryMetadataEntry(entry: string): boolean {\n return (\n entry.endsWith(JSON_EXTENSION) && !entry.endsWith(COMMAND_SIDECAR_SUFFIX) && !entry.endsWith(EXIT_SIDECAR_SUFFIX)\n );\n}\n\nfunction isRunnerRecord(value: unknown): value is RunnerRecord {\n if (typeof value !== 'object' || value === null) return false;\n const record = value as Partial<RunnerRecord>;\n return (\n typeof record.id === 'string' &&\n typeof record.name === 'string' &&\n typeof record.pid === 'number' &&\n typeof record.command === 'string' &&\n typeof record.cwd === 'string' &&\n typeof record.logPath === 'string' &&\n typeof record.sessionId === 'string' &&\n typeof record.startedAt === 'string' &&\n (record.state === 'running' || record.state === 'completed') &&\n typeof record.promoted === 'boolean' &&\n (record.backend === 'rmux' || record.backend === 'tmux' || record.backend === 'native')\n );\n}\n"],"mappings":"2pBAiBA,MAAM,E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GACV,QAAS,EAAY,EAAO,UAAU,OAAO,EAC7C,GAAI,EAAW,EAAQ,eAAe,EAAI,CAAE,cAAe,EAAW,EAAQ,eAAe,CAAE,EAAI,CAAC,EACpG,QAAS,EAAW,EAAQ,SAAS,CACvC,CACF,CAEA,SAAS,EAAY,EAAyC,CAC5D,OAAO,IAAU,QAAU,IAAU,OAAS,EAAQ,QACxD,CAEA,SAAS,EAAuB,EAAwB,CACtD,OACE,EAAM,SAAS,OAAc,GAAK,CAAC,EAAM,SAAS,eAAsB,GAAK,CAAC,EAAM,SAAS,YAAmB,CAEpH,CAEA,SAAS,EAAe,EAAuC,CAC7D,GAAI,OAAO,GAAU,WAAY,EAAgB,MAAO,GACxD,IAAM,EAAS,EACf,OACE,OAAO,EAAO,IAAO,UACrB,OAAO,EAAO,MAAS,UACvB,OAAO,EAAO,KAAQ,UACtB,OAAO,EAAO,SAAY,UAC1B,OAAO,EAAO,KAAQ,UACtB,OAAO,EAAO,SAAY,UAC1B,OAAO,EAAO,WAAc,UAC5B,OAAO,EAAO,WAAc,WAC3B,EAAO,QAAU,WAAa,EAAO,QAAU,cAChD,OAAO,EAAO,UAAa,YAC1B,EAAO,UAAY,QAAU,EAAO,UAAY,QAAU,EAAO,UAAY,SAElF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./RunnerRegistry.cjs");Object.defineProperty(exports,"RunnerRegistry",{enumerable:!0,get:function(){return e.RunnerRegistry}}),exports.createDefaultProcessRegistry=e.createDefaultProcessRegistry;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IRunnerRegistry, RegisterRunnerInput, RunnerRecord } from "./types.cjs";
|
|
2
|
+
import { ProcessRegistryPort, RunnerRegistry, createDefaultProcessRegistry } from "./RunnerRegistry.cjs";
|
|
3
|
+
export { type IRunnerRegistry, type ProcessRegistryPort, type RegisterRunnerInput, type RunnerRecord, RunnerRegistry, createDefaultProcessRegistry };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IRunnerRegistry, RegisterRunnerInput, RunnerRecord } from "./types.mjs";
|
|
2
|
+
import { ProcessRegistryPort, RunnerRegistry, createDefaultProcessRegistry } from "./RunnerRegistry.mjs";
|
|
3
|
+
export { type IRunnerRegistry, type ProcessRegistryPort, type RegisterRunnerInput, type RunnerRecord, RunnerRegistry, createDefaultProcessRegistry };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RunnerRegistry as e,createDefaultProcessRegistry as t}from"./RunnerRegistry.mjs";export{e as RunnerRegistry,t as createDefaultProcessRegistry};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//#region src/services/RunnerRegistry/types.d.ts
|
|
2
|
+
type RunnerBackend = 'rmux' | 'tmux' | 'native';
|
|
3
|
+
type RunnerState = 'running' | 'completed';
|
|
4
|
+
type RunnerExitReason = 'completed' | 'failed' | 'signaled' | 'stopped' | 'timed_out' | 'launcher_error' | 'backend_lost';
|
|
5
|
+
interface RunnerExit {
|
|
6
|
+
reason: RunnerExitReason;
|
|
7
|
+
code: number | null;
|
|
8
|
+
signal: NodeJS.Signals | null;
|
|
9
|
+
stopReason?: string;
|
|
10
|
+
finishedAt: string;
|
|
11
|
+
}
|
|
12
|
+
/** A recurring snapshot of a running runner, pushed to the model until it exits. */
|
|
13
|
+
interface RunnerAlarm {
|
|
14
|
+
intervalMs: number;
|
|
15
|
+
/** The last fire, or the runner's start time before the first one. */
|
|
16
|
+
lastFiredAt: string;
|
|
17
|
+
}
|
|
18
|
+
/** A command this extension supervises, retained after completion for CLI access. */
|
|
19
|
+
interface RunnerRecord {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
/** Process group leader, the pid signals are sent to. */
|
|
23
|
+
pid: number;
|
|
24
|
+
command: string;
|
|
25
|
+
cwd: string;
|
|
26
|
+
logPath: string;
|
|
27
|
+
interactive: boolean;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
/** Root Pi session shared by the process tree. Ownership remains with sessionId. */
|
|
30
|
+
rootSessionId?: string;
|
|
31
|
+
startedAt: string;
|
|
32
|
+
state: RunnerState;
|
|
33
|
+
promoted: boolean;
|
|
34
|
+
backend: RunnerBackend;
|
|
35
|
+
backendTarget?: string;
|
|
36
|
+
exit?: RunnerExit;
|
|
37
|
+
/** Present only while a runner is running with an alarm attached. */
|
|
38
|
+
alarm?: RunnerAlarm;
|
|
39
|
+
/** pid of the pi process that launched it, for orphan detection. */
|
|
40
|
+
hostPid: number;
|
|
41
|
+
}
|
|
42
|
+
interface RegisterRunnerInput {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
pid: number;
|
|
46
|
+
command: string;
|
|
47
|
+
cwd: string;
|
|
48
|
+
logPath: string;
|
|
49
|
+
interactive: boolean;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
backend: RunnerBackend;
|
|
52
|
+
backendTarget?: string;
|
|
53
|
+
/** Arms a recurring snapshot at this interval. */
|
|
54
|
+
alarmMs?: number;
|
|
55
|
+
}
|
|
56
|
+
interface CompleteRunnerInput {
|
|
57
|
+
reason: RunnerExitReason;
|
|
58
|
+
code: number | null;
|
|
59
|
+
signal: NodeJS.Signals | null;
|
|
60
|
+
stopReason?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Worktree-scoped active registry with session-scoped retained history. */
|
|
63
|
+
interface IRunnerRegistry {
|
|
64
|
+
register(input: RegisterRunnerInput): Promise<RunnerRecord>;
|
|
65
|
+
list(): Promise<RunnerRecord[]>;
|
|
66
|
+
/** Active doom-runner records across repository scopes, used only for safe legacy-store cleanup. */
|
|
67
|
+
listAcrossRepositories(): Promise<RunnerRecord[]>;
|
|
68
|
+
/** Active records started by one session, used for scoped bulk stop and shutdown. */
|
|
69
|
+
listBySession(sessionId: string): Promise<RunnerRecord[]>;
|
|
70
|
+
/** Active records visible to every descendant of one root Pi session. */
|
|
71
|
+
listByRootSession(rootSessionId: string): Promise<RunnerRecord[]>;
|
|
72
|
+
/** Active and recently completed records retained for one session. */
|
|
73
|
+
listAll(sessionId?: string): Promise<RunnerRecord[]>;
|
|
74
|
+
get(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
75
|
+
markPromoted(id: string): Promise<RunnerRecord | undefined>;
|
|
76
|
+
complete(id: string, outcome: CompleteRunnerInput, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
77
|
+
/** Disarms an alarm. Safe to call on a runner that has none. */
|
|
78
|
+
clearAlarm(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Reschedules an alarm from `firedAt`, returning the record the caller may
|
|
81
|
+
* report on.
|
|
82
|
+
*
|
|
83
|
+
* Returns undefined when the alarm was disarmed or the runner finished since
|
|
84
|
+
* the caller read it, which is what stops a concurrent `alarm stop` from
|
|
85
|
+
* being overwritten by an in-flight fire.
|
|
86
|
+
*/
|
|
87
|
+
markAlarmFired(id: string, firedAt: string): Promise<RunnerRecord | undefined>;
|
|
88
|
+
/** Removes the active process entry while retaining run metadata. */
|
|
89
|
+
release(id: string): Promise<void>;
|
|
90
|
+
/** Marks entries whose process is gone as lost. Returns their ids. */
|
|
91
|
+
pruneDead(): Promise<string[]>;
|
|
92
|
+
/** Notifies in-process consumers after the registry changes. */
|
|
93
|
+
subscribe(listener: () => void): () => void;
|
|
94
|
+
close(): void;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { CompleteRunnerInput, IRunnerRegistry, RegisterRunnerInput, RunnerAlarm, RunnerBackend, RunnerExit, RunnerExitReason, RunnerRecord, RunnerState };
|
|
98
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/services/RunnerRegistry/types.ts"],"mappings":";KAAY;KACA;KACA;UASK;EACf,QAAQ;EACR;EACA,QAAQ,OAAO;EACf;EACA;;;UAIe;EACf;;EAEA;;;UAIe;EACf;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA,OAAO;EACP;EACA,SAAS;EACT;EACA,OAAO;;EAEP,QAAQ;;EAER;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;;EAEA;;UAGe;EACf,QAAQ;EACR;EACA,QAAQ,OAAO;EACf;;;UAIe;EACf,SAAS,OAAO,sBAAsB,QAAQ;EAC9C,QAAQ,QAAQ;;EAEhB,0BAA0B,QAAQ;;EAElC,cAAc,oBAAoB,QAAQ;;EAE1C,kBAAkB,wBAAwB,QAAQ;;EAElD,QAAQ,qBAAqB,QAAQ;EACrC,IAAI,YAAY,qBAAqB,QAAQ;EAC7C,aAAa,aAAa,QAAQ;EAClC,SAAS,YAAY,SAAS,qBAAqB,qBAAqB,QAAQ;;EAEhF,WAAW,YAAY,qBAAqB,QAAQ;;;;;;;;;EASpD,eAAe,YAAY,kBAAkB,QAAQ;;EAErD,QAAQ,aAAa;;EAErB,aAAa;;EAEb,UAAU;EACV"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//#region src/services/RunnerRegistry/types.d.ts
|
|
2
|
+
type RunnerBackend = 'rmux' | 'tmux' | 'native';
|
|
3
|
+
type RunnerState = 'running' | 'completed';
|
|
4
|
+
type RunnerExitReason = 'completed' | 'failed' | 'signaled' | 'stopped' | 'timed_out' | 'launcher_error' | 'backend_lost';
|
|
5
|
+
interface RunnerExit {
|
|
6
|
+
reason: RunnerExitReason;
|
|
7
|
+
code: number | null;
|
|
8
|
+
signal: NodeJS.Signals | null;
|
|
9
|
+
stopReason?: string;
|
|
10
|
+
finishedAt: string;
|
|
11
|
+
}
|
|
12
|
+
/** A recurring snapshot of a running runner, pushed to the model until it exits. */
|
|
13
|
+
interface RunnerAlarm {
|
|
14
|
+
intervalMs: number;
|
|
15
|
+
/** The last fire, or the runner's start time before the first one. */
|
|
16
|
+
lastFiredAt: string;
|
|
17
|
+
}
|
|
18
|
+
/** A command this extension supervises, retained after completion for CLI access. */
|
|
19
|
+
interface RunnerRecord {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
/** Process group leader, the pid signals are sent to. */
|
|
23
|
+
pid: number;
|
|
24
|
+
command: string;
|
|
25
|
+
cwd: string;
|
|
26
|
+
logPath: string;
|
|
27
|
+
interactive: boolean;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
/** Root Pi session shared by the process tree. Ownership remains with sessionId. */
|
|
30
|
+
rootSessionId?: string;
|
|
31
|
+
startedAt: string;
|
|
32
|
+
state: RunnerState;
|
|
33
|
+
promoted: boolean;
|
|
34
|
+
backend: RunnerBackend;
|
|
35
|
+
backendTarget?: string;
|
|
36
|
+
exit?: RunnerExit;
|
|
37
|
+
/** Present only while a runner is running with an alarm attached. */
|
|
38
|
+
alarm?: RunnerAlarm;
|
|
39
|
+
/** pid of the pi process that launched it, for orphan detection. */
|
|
40
|
+
hostPid: number;
|
|
41
|
+
}
|
|
42
|
+
interface RegisterRunnerInput {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
pid: number;
|
|
46
|
+
command: string;
|
|
47
|
+
cwd: string;
|
|
48
|
+
logPath: string;
|
|
49
|
+
interactive: boolean;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
backend: RunnerBackend;
|
|
52
|
+
backendTarget?: string;
|
|
53
|
+
/** Arms a recurring snapshot at this interval. */
|
|
54
|
+
alarmMs?: number;
|
|
55
|
+
}
|
|
56
|
+
interface CompleteRunnerInput {
|
|
57
|
+
reason: RunnerExitReason;
|
|
58
|
+
code: number | null;
|
|
59
|
+
signal: NodeJS.Signals | null;
|
|
60
|
+
stopReason?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Worktree-scoped active registry with session-scoped retained history. */
|
|
63
|
+
interface IRunnerRegistry {
|
|
64
|
+
register(input: RegisterRunnerInput): Promise<RunnerRecord>;
|
|
65
|
+
list(): Promise<RunnerRecord[]>;
|
|
66
|
+
/** Active doom-runner records across repository scopes, used only for safe legacy-store cleanup. */
|
|
67
|
+
listAcrossRepositories(): Promise<RunnerRecord[]>;
|
|
68
|
+
/** Active records started by one session, used for scoped bulk stop and shutdown. */
|
|
69
|
+
listBySession(sessionId: string): Promise<RunnerRecord[]>;
|
|
70
|
+
/** Active records visible to every descendant of one root Pi session. */
|
|
71
|
+
listByRootSession(rootSessionId: string): Promise<RunnerRecord[]>;
|
|
72
|
+
/** Active and recently completed records retained for one session. */
|
|
73
|
+
listAll(sessionId?: string): Promise<RunnerRecord[]>;
|
|
74
|
+
get(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
75
|
+
markPromoted(id: string): Promise<RunnerRecord | undefined>;
|
|
76
|
+
complete(id: string, outcome: CompleteRunnerInput, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
77
|
+
/** Disarms an alarm. Safe to call on a runner that has none. */
|
|
78
|
+
clearAlarm(id: string, sessionId?: string): Promise<RunnerRecord | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Reschedules an alarm from `firedAt`, returning the record the caller may
|
|
81
|
+
* report on.
|
|
82
|
+
*
|
|
83
|
+
* Returns undefined when the alarm was disarmed or the runner finished since
|
|
84
|
+
* the caller read it, which is what stops a concurrent `alarm stop` from
|
|
85
|
+
* being overwritten by an in-flight fire.
|
|
86
|
+
*/
|
|
87
|
+
markAlarmFired(id: string, firedAt: string): Promise<RunnerRecord | undefined>;
|
|
88
|
+
/** Removes the active process entry while retaining run metadata. */
|
|
89
|
+
release(id: string): Promise<void>;
|
|
90
|
+
/** Marks entries whose process is gone as lost. Returns their ids. */
|
|
91
|
+
pruneDead(): Promise<string[]>;
|
|
92
|
+
/** Notifies in-process consumers after the registry changes. */
|
|
93
|
+
subscribe(listener: () => void): () => void;
|
|
94
|
+
close(): void;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { CompleteRunnerInput, IRunnerRegistry, RegisterRunnerInput, RunnerAlarm, RunnerBackend, RunnerExit, RunnerExitReason, RunnerRecord, RunnerState };
|
|
98
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/services/RunnerRegistry/types.ts"],"mappings":";KAAY;KACA;KACA;UASK;EACf,QAAQ;EACR;EACA,QAAQ,OAAO;EACf;EACA;;;UAIe;EACf;;EAEA;;;UAIe;EACf;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA,OAAO;EACP;EACA,SAAS;EACT;EACA,OAAO;;EAEP,QAAQ;;EAER;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;;EAEA;;UAGe;EACf,QAAQ;EACR;EACA,QAAQ,OAAO;EACf;;;UAIe;EACf,SAAS,OAAO,sBAAsB,QAAQ;EAC9C,QAAQ,QAAQ;;EAEhB,0BAA0B,QAAQ;;EAElC,cAAc,oBAAoB,QAAQ;;EAE1C,kBAAkB,wBAAwB,QAAQ;;EAElD,QAAQ,qBAAqB,QAAQ;EACrC,IAAI,YAAY,qBAAqB,QAAQ;EAC7C,aAAa,aAAa,QAAQ;EAClC,SAAS,YAAY,SAAS,qBAAqB,qBAAqB,QAAQ;;EAEhF,WAAW,YAAY,qBAAqB,QAAQ;;;;;;;;;EASpD,eAAe,YAAY,kBAAkB,QAAQ;;EAErD,QAAQ,aAAa;;EAErB,aAAa;;EAEb,UAAU;EACV"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.cjs");let t=require("inversify");require("reflect-metadata/lite");let n=require("node:child_process"),r=class{spawn(e){let t=(0,n.spawn)(e.command,{cwd:e.cwd,env:e.env,detached:e.detached,shell:`/bin/bash`,stdio:[`ignore`,`pipe`,`pipe`]});return t.stdout?.setEncoding(`utf8`),t.stderr?.setEncoding(`utf8`),{pid:t.pid,onOutput(e){t.stdout?.on(`data`,t=>e(t,`stdout`)),t.stderr?.on(`data`,t=>e(t,`stderr`))},onExit(e){t.on(`close`,(t,n)=>e({code:t,signal:n}))},onError(e){t.on(`error`,e)},kill(e){t.kill(e)},unref(){t.unref()}}}};r=e.default([(0,t.injectable)()],r),Object.defineProperty(exports,"NodeSpawner",{enumerable:!0,get:function(){return r}});
|
|
2
|
+
//# sourceMappingURL=NodeSpawner.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSpawner.cjs","names":["spawn","injectable"],"sources":["../../../src/services/Spawner/NodeSpawner.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { injectable } from 'inversify';\nimport 'reflect-metadata/lite';\nimport type { ExitResult, ISpawner, OutputStream, SpawnedProcess, SpawnRequest } from './types.ts';\n\nconst SHELL = '/bin/bash';\n\n/** Wraps `node:child_process.spawn`. */\n@injectable()\nexport class NodeSpawner implements ISpawner {\n spawn(request: SpawnRequest): SpawnedProcess {\n const child = spawn(request.command, {\n cwd: request.cwd,\n env: request.env,\n detached: request.detached,\n shell: SHELL,\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n\n child.stdout?.setEncoding('utf8');\n child.stderr?.setEncoding('utf8');\n\n return {\n pid: child.pid,\n onOutput(handler: (chunk: string, stream: OutputStream) => void): void {\n child.stdout?.on('data', (chunk: string) => handler(chunk, 'stdout'));\n child.stderr?.on('data', (chunk: string) => handler(chunk, 'stderr'));\n },\n onExit(handler: (result: ExitResult) => void): void {\n child.on('close', (code, signal) => handler({ code, signal }));\n },\n onError(handler: (error: Error) => void): void {\n child.on('error', handler);\n },\n kill(signal?: NodeJS.Signals): void {\n child.kill(signal);\n },\n unref(): void {\n child.unref();\n },\n };\n }\n}\n"],"mappings":"4PASa,EAAN,KAAsC,CAC3C,MAAM,EAAuC,CAC3C,IAAM,GAAA,EAAQA,EAAAA,MAAAA,CAAM,EAAQ,QAAS,CACnC,IAAK,EAAQ,IACb,IAAK,EAAQ,IACb,SAAU,EAAQ,SAClB,MAAO,YACP,MAAO,CAAC,SAAU,OAAQ,MAAM,CAClC,CAAC,EAKD,OAHA,EAAM,QAAQ,YAAY,MAAM,EAChC,EAAM,QAAQ,YAAY,MAAM,EAEzB,CACL,IAAK,EAAM,IACX,SAAS,EAA8D,CACrE,EAAM,QAAQ,GAAG,OAAS,GAAkB,EAAQ,EAAO,QAAQ,CAAC,EACpE,EAAM,QAAQ,GAAG,OAAS,GAAkB,EAAQ,EAAO,QAAQ,CAAC,CACtE,EACA,OAAO,EAA6C,CAClD,EAAM,GAAG,SAAU,EAAM,IAAW,EAAQ,CAAE,OAAM,QAAO,CAAC,CAAC,CAC/D,EACA,QAAQ,EAAuC,CAC7C,EAAM,GAAG,QAAS,CAAO,CAC3B,EACA,KAAK,EAA+B,CAClC,EAAM,KAAK,CAAM,CACnB,EACA,OAAc,CACZ,EAAM,MAAM,CACd,CACF,CACF,CACF,EAlCCC,EAAAA,EAAAA,QAAAA,EAAAA,EAAAA,EAAAA,WAAAA,CAAW,CAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISpawner, SpawnRequest, SpawnedProcess } from "./types.cjs";
|
|
2
|
+
import "reflect-metadata/lite";
|
|
3
|
+
//#region src/services/Spawner/NodeSpawner.d.ts
|
|
4
|
+
/** Wraps `node:child_process.spawn`. */
|
|
5
|
+
declare class NodeSpawner implements ISpawner {
|
|
6
|
+
spawn(request: SpawnRequest): SpawnedProcess;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NodeSpawner };
|
|
10
|
+
//# sourceMappingURL=NodeSpawner.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSpawner.d.cts","names":[],"sources":["../../../src/services/Spawner/NodeSpawner.ts"],"mappings":";;;;cASa,uBAAuB;EAClC,MAAM,SAAS,eAAe"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISpawner, SpawnRequest, SpawnedProcess } from "./types.mjs";
|
|
2
|
+
import "reflect-metadata/lite";
|
|
3
|
+
//#region src/services/Spawner/NodeSpawner.d.ts
|
|
4
|
+
/** Wraps `node:child_process.spawn`. */
|
|
5
|
+
declare class NodeSpawner implements ISpawner {
|
|
6
|
+
spawn(request: SpawnRequest): SpawnedProcess;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NodeSpawner };
|
|
10
|
+
//# sourceMappingURL=NodeSpawner.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSpawner.d.mts","names":[],"sources":["../../../src/services/Spawner/NodeSpawner.ts"],"mappings":";;;;cASa,uBAAuB;EAClC,MAAM,SAAS,eAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.mjs";import{injectable as t}from"inversify";import"reflect-metadata/lite";import{spawn as n}from"node:child_process";let r=class{spawn(e){let t=n(e.command,{cwd:e.cwd,env:e.env,detached:e.detached,shell:`/bin/bash`,stdio:[`ignore`,`pipe`,`pipe`]});return t.stdout?.setEncoding(`utf8`),t.stderr?.setEncoding(`utf8`),{pid:t.pid,onOutput(e){t.stdout?.on(`data`,t=>e(t,`stdout`)),t.stderr?.on(`data`,t=>e(t,`stderr`))},onExit(e){t.on(`close`,(t,n)=>e({code:t,signal:n}))},onError(e){t.on(`error`,e)},kill(e){t.kill(e)},unref(){t.unref()}}}};r=e([t()],r);export{r as NodeSpawner};
|
|
2
|
+
//# sourceMappingURL=NodeSpawner.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeSpawner.mjs","names":[],"sources":["../../../src/services/Spawner/NodeSpawner.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { injectable } from 'inversify';\nimport 'reflect-metadata/lite';\nimport type { ExitResult, ISpawner, OutputStream, SpawnedProcess, SpawnRequest } from './types.ts';\n\nconst SHELL = '/bin/bash';\n\n/** Wraps `node:child_process.spawn`. */\n@injectable()\nexport class NodeSpawner implements ISpawner {\n spawn(request: SpawnRequest): SpawnedProcess {\n const child = spawn(request.command, {\n cwd: request.cwd,\n env: request.env,\n detached: request.detached,\n shell: SHELL,\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n\n child.stdout?.setEncoding('utf8');\n child.stderr?.setEncoding('utf8');\n\n return {\n pid: child.pid,\n onOutput(handler: (chunk: string, stream: OutputStream) => void): void {\n child.stdout?.on('data', (chunk: string) => handler(chunk, 'stdout'));\n child.stderr?.on('data', (chunk: string) => handler(chunk, 'stderr'));\n },\n onExit(handler: (result: ExitResult) => void): void {\n child.on('close', (code, signal) => handler({ code, signal }));\n },\n onError(handler: (error: Error) => void): void {\n child.on('error', handler);\n },\n kill(signal?: NodeJS.Signals): void {\n child.kill(signal);\n },\n unref(): void {\n child.unref();\n },\n };\n }\n}\n"],"mappings":"qMASO,IAAM,EAAN,KAAsC,CAC3C,MAAM,EAAuC,CAC3C,IAAM,EAAQ,EAAM,EAAQ,QAAS,CACnC,IAAK,EAAQ,IACb,IAAK,EAAQ,IACb,SAAU,EAAQ,SAClB,MAAO,YACP,MAAO,CAAC,SAAU,OAAQ,MAAM,CAClC,CAAC,EAKD,OAHA,EAAM,QAAQ,YAAY,MAAM,EAChC,EAAM,QAAQ,YAAY,MAAM,EAEzB,CACL,IAAK,EAAM,IACX,SAAS,EAA8D,CACrE,EAAM,QAAQ,GAAG,OAAS,GAAkB,EAAQ,EAAO,QAAQ,CAAC,EACpE,EAAM,QAAQ,GAAG,OAAS,GAAkB,EAAQ,EAAO,QAAQ,CAAC,CACtE,EACA,OAAO,EAA6C,CAClD,EAAM,GAAG,SAAU,EAAM,IAAW,EAAQ,CAAE,OAAM,QAAO,CAAC,CAAC,CAC/D,EACA,QAAQ,EAAuC,CAC7C,EAAM,GAAG,QAAS,CAAO,CAC3B,EACA,KAAK,EAA+B,CAClC,EAAM,KAAK,CAAM,CACnB,EACA,OAAc,CACZ,EAAM,MAAM,CACd,CACF,CACF,CACF,EAlCC,EAAA,EAAA,CAAA,EAAW,CAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./NodeSpawner.cjs");Object.defineProperty(exports,"NodeSpawner",{enumerable:!0,get:function(){return e.NodeSpawner}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NodeSpawner as e}from"./NodeSpawner.mjs";export{e as NodeSpawner};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/services/Spawner/types.d.ts
|
|
2
|
+
/** Outcome of a finished child process. */
|
|
3
|
+
interface ExitResult {
|
|
4
|
+
code: number | null;
|
|
5
|
+
signal: NodeJS.Signals | null;
|
|
6
|
+
}
|
|
7
|
+
type OutputStream = 'stdout' | 'stderr';
|
|
8
|
+
interface SpawnRequest {
|
|
9
|
+
/** Shell command line, run through the login shell like pi's built-in bash. */
|
|
10
|
+
command: string;
|
|
11
|
+
cwd: string;
|
|
12
|
+
env: NodeJS.ProcessEnv;
|
|
13
|
+
/** Detached puts the child in its own process group, so the whole tree stays killable. */
|
|
14
|
+
detached: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface SpawnedProcess {
|
|
17
|
+
readonly pid: number | undefined;
|
|
18
|
+
onOutput(handler: (chunk: string, stream: OutputStream) => void): void;
|
|
19
|
+
onExit(handler: (result: ExitResult) => void): void;
|
|
20
|
+
onError(handler: (error: Error) => void): void;
|
|
21
|
+
kill(signal?: NodeJS.Signals): void;
|
|
22
|
+
/** Lets the host process exit while the child keeps running. */
|
|
23
|
+
unref(): void;
|
|
24
|
+
}
|
|
25
|
+
/** Subprocess creation as a port, so launching is testable without real processes. */
|
|
26
|
+
interface ISpawner {
|
|
27
|
+
spawn(request: SpawnRequest): SpawnedProcess;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ExitResult, ISpawner, OutputStream, SpawnRequest, SpawnedProcess };
|
|
31
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/services/Spawner/types.ts"],"mappings":";;UACiB;EACf;EACA,QAAQ,OAAO;;KAGL;UAEK;;EAEf;EACA;EACA,KAAK,OAAO;;EAEZ;;UAGe;WACN;EACT,SAAS,UAAU,eAAe,QAAQ;EAC1C,OAAO,UAAU,QAAQ;EACzB,QAAQ,UAAU,OAAO;EACzB,KAAK,SAAS,OAAO;;EAErB;;;UAIe;EACf,MAAM,SAAS,eAAe"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/services/Spawner/types.d.ts
|
|
2
|
+
/** Outcome of a finished child process. */
|
|
3
|
+
interface ExitResult {
|
|
4
|
+
code: number | null;
|
|
5
|
+
signal: NodeJS.Signals | null;
|
|
6
|
+
}
|
|
7
|
+
type OutputStream = 'stdout' | 'stderr';
|
|
8
|
+
interface SpawnRequest {
|
|
9
|
+
/** Shell command line, run through the login shell like pi's built-in bash. */
|
|
10
|
+
command: string;
|
|
11
|
+
cwd: string;
|
|
12
|
+
env: NodeJS.ProcessEnv;
|
|
13
|
+
/** Detached puts the child in its own process group, so the whole tree stays killable. */
|
|
14
|
+
detached: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface SpawnedProcess {
|
|
17
|
+
readonly pid: number | undefined;
|
|
18
|
+
onOutput(handler: (chunk: string, stream: OutputStream) => void): void;
|
|
19
|
+
onExit(handler: (result: ExitResult) => void): void;
|
|
20
|
+
onError(handler: (error: Error) => void): void;
|
|
21
|
+
kill(signal?: NodeJS.Signals): void;
|
|
22
|
+
/** Lets the host process exit while the child keeps running. */
|
|
23
|
+
unref(): void;
|
|
24
|
+
}
|
|
25
|
+
/** Subprocess creation as a port, so launching is testable without real processes. */
|
|
26
|
+
interface ISpawner {
|
|
27
|
+
spawn(request: SpawnRequest): SpawnedProcess;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ExitResult, ISpawner, OutputStream, SpawnRequest, SpawnedProcess };
|
|
31
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/services/Spawner/types.ts"],"mappings":";;UACiB;EACf;EACA,QAAQ,OAAO;;KAGL;UAEK;;EAEf;EACA;EACA,KAAK,OAAO;;EAEZ;;UAGe;WACN;EACT,SAAS,UAAU,eAAe,QAAQ;EAC1C,OAAO,UAAU,QAAQ;EACzB,QAAQ,UAAU,OAAO;EACzB,KAAK,SAAS,OAAO;;EAErB;;;UAIe;EACf,MAAM,SAAS,eAAe"}
|
package/dist/session.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=`PI_SESSION_ID`;function t(t=process.env){return t[e]?.trim()||void 0}function n(n=process.env){let r=t(n);if(!r)throw Error(`${e} is required for doom-runner`);return r}exports.PI_SESSION_ID_ENV=e,exports.inheritedSessionId=t,exports.requiredSessionId=n;
|
|
2
|
+
//# sourceMappingURL=session.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.cjs","names":[],"sources":["../src/session.ts"],"sourcesContent":["/** Session identity inherited by commands launched from a Pi session. */\nexport const PI_SESSION_ID_ENV = 'PI_SESSION_ID';\n\n/** Returns a usable inherited session id, failing closed on blank values. */\nexport function inheritedSessionId(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const value = env[PI_SESSION_ID_ENV]?.trim();\n return value ? value : undefined;\n}\n\n/** Returns the inherited Pi session id or fails closed outside a session. */\nexport function requiredSessionId(env: NodeJS.ProcessEnv = process.env): string {\n const sessionId = inheritedSessionId(env);\n if (!sessionId) throw new Error(`${PI_SESSION_ID_ENV} is required for doom-runner`);\n return sessionId;\n}\n"],"mappings":"mEACA,MAAa,EAAoB,gBAGjC,SAAgB,EAAmB,EAAyB,QAAQ,IAAyB,CAE3F,OADc,EAAI,EAAkB,EAAE,KAAK,GACpB,IAAA,EACzB,CAGA,SAAgB,EAAkB,EAAyB,QAAQ,IAAa,CAC9E,IAAM,EAAY,EAAmB,CAAG,EACxC,GAAI,CAAC,EAAW,MAAU,MAAM,GAAG,EAAkB,6BAA6B,EAClF,OAAO,CACT"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/session.d.ts
|
|
2
|
+
/** Session identity inherited by commands launched from a Pi session. */
|
|
3
|
+
declare const PI_SESSION_ID_ENV = "PI_SESSION_ID";
|
|
4
|
+
/** Returns a usable inherited session id, failing closed on blank values. */
|
|
5
|
+
declare function inheritedSessionId(env?: NodeJS.ProcessEnv): string | undefined;
|
|
6
|
+
/** Returns the inherited Pi session id or fails closed outside a session. */
|
|
7
|
+
declare function requiredSessionId(env?: NodeJS.ProcessEnv): string;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PI_SESSION_ID_ENV, inheritedSessionId, requiredSessionId };
|
|
10
|
+
//# sourceMappingURL=session.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.cts","names":[],"sources":["../src/session.ts"],"mappings":";;cACa;;iBAGG,mBAAmB,MAAK,OAAO;;iBAM/B,kBAAkB,MAAK,OAAO"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/session.d.ts
|
|
2
|
+
/** Session identity inherited by commands launched from a Pi session. */
|
|
3
|
+
declare const PI_SESSION_ID_ENV = "PI_SESSION_ID";
|
|
4
|
+
/** Returns a usable inherited session id, failing closed on blank values. */
|
|
5
|
+
declare function inheritedSessionId(env?: NodeJS.ProcessEnv): string | undefined;
|
|
6
|
+
/** Returns the inherited Pi session id or fails closed outside a session. */
|
|
7
|
+
declare function requiredSessionId(env?: NodeJS.ProcessEnv): string;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PI_SESSION_ID_ENV, inheritedSessionId, requiredSessionId };
|
|
10
|
+
//# sourceMappingURL=session.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.mts","names":[],"sources":["../src/session.ts"],"mappings":";;cACa;;iBAGG,mBAAmB,MAAK,OAAO;;iBAM/B,kBAAkB,MAAK,OAAO"}
|
package/dist/session.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=`PI_SESSION_ID`;function t(t=process.env){return t[e]?.trim()||void 0}function n(n=process.env){let r=t(n);if(!r)throw Error(`${e} is required for doom-runner`);return r}export{e as PI_SESSION_ID_ENV,t as inheritedSessionId,n as requiredSessionId};
|
|
2
|
+
//# sourceMappingURL=session.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.mjs","names":[],"sources":["../src/session.ts"],"sourcesContent":["/** Session identity inherited by commands launched from a Pi session. */\nexport const PI_SESSION_ID_ENV = 'PI_SESSION_ID';\n\n/** Returns a usable inherited session id, failing closed on blank values. */\nexport function inheritedSessionId(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const value = env[PI_SESSION_ID_ENV]?.trim();\n return value ? value : undefined;\n}\n\n/** Returns the inherited Pi session id or fails closed outside a session. */\nexport function requiredSessionId(env: NodeJS.ProcessEnv = process.env): string {\n const sessionId = inheritedSessionId(env);\n if (!sessionId) throw new Error(`${PI_SESSION_ID_ENV} is required for doom-runner`);\n return sessionId;\n}\n"],"mappings":"AACA,MAAa,EAAoB,gBAGjC,SAAgB,EAAmB,EAAyB,QAAQ,IAAyB,CAE3F,OADc,EAAI,EAAkB,EAAE,KAAK,GACpB,IAAA,EACzB,CAGA,SAAgB,EAAkB,EAAyB,QAAQ,IAAa,CAC9E,IAAM,EAAY,EAAmB,CAAG,EACxC,GAAI,CAAC,EAAW,MAAU,MAAM,GAAG,EAAkB,6BAA6B,EAClF,OAAO,CACT"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../config.cjs"),t=require("../services/AnsiScrub/ansiScrub.cjs");require("../services/AnsiScrub/index.cjs");const n=require("./responseEnvelope.cjs"),r=require("../tui/bashRender.cjs"),i=require("./schema.cjs"),a=1e3,o=`Options:`,s={requested:`Started in the background`,threshold:`Still running after the background threshold, so it was moved to the background`,interactive:`Started on a terminal so it can prompt, which means it runs in the background`},c=`Execute bash commands, with long-running ones supervised in the background`;function l(t=e.getBackgroundThresholdMs()){return[`A command still running after ${Math.round(t/a)} seconds remains active as a background runner. You get its unique id and streaming log path, then inspect it with the doom-runner CLI.`,`Pass background: true for commands you already know will not finish on their own (dev servers, watchers, tails). Waiting the full threshold first wastes a turn.`,`Pass interactive: true only when the command will prompt for confirmation or input. Use Runner Space for terminal input. Interactive logs are noisier, so avoid it otherwise.`,`Do not re-run a command to recover output. Read its saved log with doom-runner logs <id>.`,`Stop runners you no longer need. Every runner is stopped automatically when the session ends.`]}function u(e,t){e.registerTool({name:i.BASH_TOOL_NAME,label:i.BASH_TOOL_LABEL,description:`Execute a bash command in the current working directory. A command that outlives the background threshold keeps running under doom-runner and returns a unique id plus a streaming log path. Completed commands return a bounded log tail with exact file metadata. Optionally provide a timeout in seconds, background: true to background it immediately, or interactive: true if it will prompt.`,promptSnippet:c,promptGuidelines:l(),parameters:i.BashParamsSchema,async execute(e,r,i,s,c){let{command:l,timeout:u,background:f,interactive:p,name:m}=r,h;s&&s(n.textResult(`Starting ${p===!0?`interactive runner`:f===!0?`background runner`:`command`}...`)),f!==!0&&p!==!0&&s&&(h=e=>s(n.textResult(e)));let g;try{g=await t.bashRunService.run({command:l,timeoutMs:u===void 0?void 0:u*a,background:f,interactive:p,name:m,...h?{onOutput:h}:{},sessionId:t.getSessionId()})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error([`Could not execute the command: ${t}`,``,o,`- Check the command, runtime, and working directory, then retry once.`,`- Use a read-only diagnostic to confirm the missing dependency or environment value.`,`- Ask the user if recovery requires changing the requested approach.`].join(`
|
|
2
|
+
`),{cause:e})}return g.kind===`promoted`&&t.onRunnerStarted(g.id),d(g)},renderCall(e,t,n){return r.renderBashCall(e,t)},renderResult(e,t,n,i){return r.renderBashResult(e,t,n)}})}function d(e){if(e.kind===`failed`)throw Error([`Could not start runner "${e.name}": ${e.error}`,``,o,`- Correct the command or missing executable, then retry once.`,`- Use a read-only diagnostic to inspect the runtime environment.`,`- Ask the user if a different execution approach is required.`].join(`
|
|
3
|
+
`));if(e.kind===`promoted`){let t=[`${s[e.reason]} as runner "${e.name}".`,`Runner ID: ${e.id}`,`Backend: ${e.backend}`,`Log (streaming): ${e.logPath}`,`Inspect it with: doom-runner logs ${e.id}`].filter(e=>e.length>0).join(`
|
|
4
|
+
`);return{...n.textResult(t,{id:e.id,runner:e.name,pid:e.pid,logPath:e.logPath,promoted:!0,reason:e.reason})}}let r=n.summarizeLog(e.logPath),i=[];e.timedOut?i.push(`Command stopped: it exceeded the requested timeout.`):e.exitCode===null?e.signal!==null&&i.push(`Terminated by ${e.signal}`):i.push(`Exit: completed with code ${e.exitCode}.`);let a=t.stripAnsi(r.tail),c=[a.length>0?`Log tail (${r.tailLines} lines):\n${a}`:`Log tail: (no output)`,`Runner ID: ${e.id}`,...i,`Log: ${e.logPath}`,`File size: ${n.formatSize(r.bytes)}`,`Lines: ${r.lines.toLocaleString(`en-US`)}`].join(`
|
|
5
|
+
`),l={id:e.id,runner:e.name,exitCode:e.exitCode,logPath:e.logPath,backend:e.backend,fileSize:r.bytes,lines:r.lines,tail:r.tail,tailLines:r.tailLines,...e.timedOut?{timedOut:!0}:{}};if(e.timedOut||e.signal!==null||e.exitCode!==null&&e.exitCode!==0)throw Error([c,``,o,`- Inspect the full log at ${e.logPath}, correct the cause, then retry once.`,`- Run a read-only diagnostic if the output does not explain the failure.`,`- Ask the user if the failure requires changing the requested approach.`].join(`
|
|
6
|
+
`));return n.textResult(c,l)}exports.BASH_PROMPT_SNIPPET=c,exports.bashPromptGuidelines=l,exports.formatRunResult=d,exports.registerBashTool=u;
|
|
7
|
+
//# sourceMappingURL=bashTool.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.cjs","names":["getBackgroundThresholdMs","BASH_TOOL_NAME","BASH_TOOL_LABEL","BashParamsSchema","textResult","renderBashCall","renderBashResult","summarizeLog","stripAnsi","formatSize"],"sources":["../../src/tool/bashTool.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { getBackgroundThresholdMs } from '../config.ts';\nimport { stripAnsi } from '../services/AnsiScrub/index.ts';\nimport type { BashRunResult, IBashRunService } from '../services/BashRunService/index.ts';\nimport { renderBashCall, renderBashResult } from '../tui/bashRender.ts';\nimport { formatSize, summarizeLog, textResult, type ToolResult } from './responseEnvelope.ts';\nimport { BASH_TOOL_LABEL, BASH_TOOL_NAME, type BashParams, BashParamsSchema } from './schema.ts';\n\nconst MS_PER_SECOND = 1000;\nconst ERROR_OPTIONS_HEADING = 'Options:';\n\nconst PROMOTION_REASONS: Record<'requested' | 'threshold' | 'interactive', string> = {\n requested: 'Started in the background',\n threshold: 'Still running after the background threshold, so it was moved to the background',\n interactive: 'Started on a terminal so it can prompt, which means it runs in the background',\n};\n\nexport const BASH_PROMPT_SNIPPET = 'Execute bash commands, with long-running ones supervised in the background';\n\n/** Written at registration time so the stated threshold matches the configured one. */\nexport function bashPromptGuidelines(thresholdMs = getBackgroundThresholdMs()): string[] {\n return [\n `A command still running after ${Math.round(thresholdMs / MS_PER_SECOND)} seconds remains active as a background runner. You get its unique id and streaming log path, then inspect it with the doom-runner CLI.`,\n 'Pass background: true for commands you already know will not finish on their own (dev servers, watchers, tails). Waiting the full threshold first wastes a turn.',\n 'Pass interactive: true only when the command will prompt for confirmation or input. Use Runner Space for terminal input. Interactive logs are noisier, so avoid it otherwise.',\n 'Do not re-run a command to recover output. Read its saved log with doom-runner logs <id>.',\n 'Stop runners you no longer need. Every runner is stopped automatically when the session ends.',\n ];\n}\n\nexport interface BashToolDependencies {\n bashRunService: IBashRunService;\n getSessionId(): string;\n /** Called after a runner is promoted, so UI state can refresh. */\n onRunnerStarted(id: string): void;\n}\n\n/**\n * Registers a tool named `bash`, replacing pi's built-in.\n *\n * The name is deliberate: hooks, guardrails and doom-pi's dispatcher all key on\n * `bash`, and they keep working only while the replacement keeps the name.\n */\nexport function registerBashTool(pi: ExtensionAPI, dependencies: BashToolDependencies): void {\n pi.registerTool({\n name: BASH_TOOL_NAME,\n label: BASH_TOOL_LABEL,\n description:\n 'Execute a bash command in the current working directory. A command that outlives the background threshold keeps running under doom-runner and returns a unique id plus a streaming log path. Completed commands return a bounded log tail with exact file metadata. Optionally provide a timeout in seconds, background: true to background it immediately, or interactive: true if it will prompt.',\n promptSnippet: BASH_PROMPT_SNIPPET,\n promptGuidelines: bashPromptGuidelines(),\n parameters: BashParamsSchema,\n\n async execute(_toolCallId, params, _signal, onUpdate, _ctx): Promise<ToolResult> {\n const { command, timeout, background, interactive, name } = params as BashParams;\n let onOutput: ((output: string) => void) | undefined;\n if (onUpdate) {\n const mode =\n interactive === true ? 'interactive runner' : background === true ? 'background runner' : 'command';\n onUpdate(textResult(`Starting ${mode}...`));\n }\n if (background !== true && interactive !== true && onUpdate) {\n onOutput = (output) => onUpdate(textResult(output));\n }\n let result: BashRunResult;\n try {\n result = await dependencies.bashRunService.run({\n command,\n timeoutMs: timeout === undefined ? undefined : timeout * MS_PER_SECOND,\n background,\n interactive,\n name,\n ...(onOutput ? { onOutput } : {}),\n sessionId: dependencies.getSessionId(),\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(\n [\n `Could not execute the command: ${message}`,\n '',\n ERROR_OPTIONS_HEADING,\n '- Check the command, runtime, and working directory, then retry once.',\n '- Use a read-only diagnostic to confirm the missing dependency or environment value.',\n '- Ask the user if recovery requires changing the requested approach.',\n ].join('\\n'),\n { cause: error },\n );\n }\n\n if (result.kind === 'promoted') dependencies.onRunnerStarted(result.id);\n return formatRunResult(result);\n },\n\n // Without these, pi falls back to echoing the raw command and the tail end of\n // the result text, which is the metadata footer rather than the log output.\n renderCall(args, theme, _context) {\n return renderBashCall(args as BashParams, theme);\n },\n\n renderResult(result, options, theme, _context) {\n return renderBashResult(result, options, theme);\n },\n });\n}\n\nexport function formatRunResult(result: BashRunResult): ToolResult {\n if (result.kind === 'failed') {\n throw new Error(\n [\n `Could not start runner \"${result.name}\": ${result.error}`,\n '',\n ERROR_OPTIONS_HEADING,\n '- Correct the command or missing executable, then retry once.',\n '- Use a read-only diagnostic to inspect the runtime environment.',\n '- Ask the user if a different execution approach is required.',\n ].join('\\n'),\n );\n }\n\n if (result.kind === 'promoted') {\n const reason = PROMOTION_REASONS[result.reason];\n const body = [\n `${reason} as runner \"${result.name}\".`,\n `Runner ID: ${result.id}`,\n `Backend: ${result.backend}`,\n `Log (streaming): ${result.logPath}`,\n `Inspect it with: doom-runner logs ${result.id}`,\n ]\n .filter((line) => line.length > 0)\n .join('\\n');\n\n return {\n ...textResult(body, {\n id: result.id,\n runner: result.name,\n pid: result.pid,\n logPath: result.logPath,\n promoted: true,\n reason: result.reason,\n }),\n };\n }\n\n const log = summarizeLog(result.logPath);\n const notes: string[] = [];\n if (result.timedOut) notes.push('Command stopped: it exceeded the requested timeout.');\n else if (result.exitCode !== null) notes.push(`Exit: completed with code ${result.exitCode}.`);\n else if (result.signal !== null) notes.push(`Terminated by ${result.signal}`);\n\n // The model reads plain text; only the renderer gets the coloured copy below.\n const plainTail = stripAnsi(log.tail);\n const text = [\n plainTail.length > 0 ? `Log tail (${log.tailLines} lines):\\n${plainTail}` : 'Log tail: (no output)',\n `Runner ID: ${result.id}`,\n ...notes,\n `Log: ${result.logPath}`,\n `File size: ${formatSize(log.bytes)}`,\n `Lines: ${log.lines.toLocaleString('en-US')}`,\n ].join('\\n');\n const details = {\n id: result.id,\n runner: result.name,\n exitCode: result.exitCode,\n logPath: result.logPath,\n backend: result.backend,\n fileSize: log.bytes,\n lines: log.lines,\n // Carried structurally so renderResult shows the output instead of the footer.\n tail: log.tail,\n tailLines: log.tailLines,\n ...(result.timedOut ? { timedOut: true } : {}),\n };\n if (result.timedOut || result.signal !== null || (result.exitCode !== null && result.exitCode !== 0)) {\n throw new Error(\n [\n text,\n '',\n ERROR_OPTIONS_HEADING,\n `- Inspect the full log at ${result.logPath}, correct the cause, then retry once.`,\n '- Run a read-only diagnostic if the output does not explain the failure.',\n '- Ask the user if the failure requires changing the requested approach.',\n ].join('\\n'),\n );\n }\n return textResult(text, details);\n}\n"],"mappings":"uSAQM,EAAgB,IAChB,EAAwB,WAExB,EAA+E,CACnF,UAAW,4BACX,UAAW,kFACX,YAAa,+EACf,EAEa,EAAsB,6EAGnC,SAAgB,EAAqB,EAAcA,EAAAA,yBAAyB,EAAa,CACvF,MAAO,CACL,iCAAiC,KAAK,MAAM,EAAc,CAAa,EAAE,yIACzE,mKACA,gLACA,4FACA,+FACF,CACF,CAeA,SAAgB,EAAiB,EAAkB,EAA0C,CAC3F,EAAG,aAAa,CACd,KAAMC,EAAAA,eACN,MAAOC,EAAAA,gBACP,YACE,sYACF,cAAe,EACf,iBAAkB,EAAqB,EACvC,WAAYC,EAAAA,iBAEZ,MAAM,QAAQ,EAAa,EAAQ,EAAS,EAAU,EAA2B,CAC/E,GAAM,CAAE,UAAS,UAAS,aAAY,cAAa,QAAS,EACxD,EACA,GAGF,EAASC,EAAAA,WAAW,YADlB,IAAgB,GAAO,qBAAuB,IAAe,GAAO,oBAAsB,UACvD,IAAI,CAAC,EAExC,IAAe,IAAQ,IAAgB,IAAQ,IACjD,EAAY,GAAW,EAASA,EAAAA,WAAW,CAAM,CAAC,GAEpD,IAAI,EACJ,GAAI,CACF,EAAS,MAAM,EAAa,eAAe,IAAI,CAC7C,UACA,UAAW,IAAY,IAAA,GAAY,IAAA,GAAY,EAAU,EACzD,aACA,cACA,OACA,GAAI,EAAW,CAAE,UAA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SAAW,MAAM,EAAM,KAAK,iBAAiB,EAAO,QAAQ,EADzC,EAAM,KAAK,6BAA6B,EAAO,SAAS,EAAE,EAI7F,IAAM,EAAYC,EAAAA,UAAU,EAAI,IAAI,EAC9B,EAAO,CACX,EAAU,OAAS,EAAI,aAAa,EAAI,UAAU,YAAY,IAAc,wBAC5E,cAAc,EAAO,KACrB,GAAG,EACH,QAAQ,EAAO,UACf,cAAcC,EAAAA,WAAW,EAAI,KAAK,IAClC,UAAU,EAAI,MAAM,eAAe,OAAO,GAC5C,CAAC,CAAC,KAAK;CAAI,EACL,EAAU,CACd,GAAI,EAAO,GACX,OAAQ,EAAO,KACf,SAAU,EAAO,SACjB,QAAS,EAAO,QAChB,QAAS,EAAO,QAChB,SAAU,EAAI,MACd,MAAO,EAAI,MAEX,KAAM,EAAI,KACV,UAAW,EAAI,UACf,GAAI,EAAO,SAAW,CAAE,SAAU,EAAK,EAAI,CAAC,CAC9C,EACA,GAAI,EAAO,UAAY,EAAO,SAAW,MAAS,EAAO,WAAa,MAAQ,EAAO,WAAa,EAChG,MAAU,MACR,CACE,EACA,GACA,EACA,6BAA6B,EAAO,QAAQ,uCAC5C,2EACA,yEACF,CAAC,CAAC,KAAK;CAAI,CACb,EAEF,OAAOL,EAAAA,WAAW,EAAM,CAAO,CACjC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BashRunResult, IBashRunService } from "../services/BashRunService/types.cjs";
|
|
2
|
+
import "../services/BashRunService/index.cjs";
|
|
3
|
+
import { ToolResult } from "./responseEnvelope.cjs";
|
|
4
|
+
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
//#region src/tool/bashTool.d.ts
|
|
6
|
+
declare const BASH_PROMPT_SNIPPET = "Execute bash commands, with long-running ones supervised in the background";
|
|
7
|
+
/** Written at registration time so the stated threshold matches the configured one. */
|
|
8
|
+
declare function bashPromptGuidelines(thresholdMs?: number): string[];
|
|
9
|
+
interface BashToolDependencies {
|
|
10
|
+
bashRunService: IBashRunService;
|
|
11
|
+
getSessionId(): string;
|
|
12
|
+
/** Called after a runner is promoted, so UI state can refresh. */
|
|
13
|
+
onRunnerStarted(id: string): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registers a tool named `bash`, replacing pi's built-in.
|
|
17
|
+
*
|
|
18
|
+
* The name is deliberate: hooks, guardrails and doom-pi's dispatcher all key on
|
|
19
|
+
* `bash`, and they keep working only while the replacement keeps the name.
|
|
20
|
+
*/
|
|
21
|
+
declare function registerBashTool(pi: ExtensionAPI, dependencies: BashToolDependencies): void;
|
|
22
|
+
declare function formatRunResult(result: BashRunResult): ToolResult;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { BASH_PROMPT_SNIPPET, BashToolDependencies, bashPromptGuidelines, formatRunResult, registerBashTool };
|
|
25
|
+
//# sourceMappingURL=bashTool.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.d.cts","names":[],"sources":["../../src/tool/bashTool.ts"],"mappings":";;;;;cAiBa;;iBAGG,qBAAqB;UAUpB;EACf,gBAAgB;EAChB;;EAEA,gBAAgB;;;;;;;;iBASF,iBAAiB,IAAI,cAAc,cAAc;iBA+DjD,gBAAgB,QAAQ,gBAAgB"}
|