@agimon-ai/doompi-runner 0.0.1-alpha.2 → 0.0.1-alpha.21
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/README.md +25 -16
- package/dist/adapters/RunnerPaths.cjs +2 -0
- package/dist/adapters/RunnerPaths.cjs.map +1 -0
- package/dist/adapters/RunnerPaths.d.cts +35 -0
- package/dist/adapters/RunnerPaths.d.cts.map +1 -0
- package/dist/adapters/RunnerPaths.d.mts +35 -0
- package/dist/adapters/RunnerPaths.d.mts.map +1 -0
- package/dist/adapters/RunnerPaths.mjs +2 -0
- package/dist/adapters/RunnerPaths.mjs.map +1 -0
- package/dist/adapters/pi/extension.cjs +3 -0
- package/dist/adapters/pi/extension.cjs.map +1 -0
- package/dist/adapters/pi/extension.d.cts +10 -0
- package/dist/adapters/pi/extension.d.cts.map +1 -0
- package/dist/adapters/pi/extension.d.mts +10 -0
- package/dist/adapters/pi/extension.d.mts.map +1 -0
- package/dist/adapters/pi/extension.mjs +3 -0
- package/dist/adapters/pi/extension.mjs.map +1 -0
- package/dist/adapters/pty/ptyProvider.cjs +2 -0
- package/dist/adapters/pty/ptyProvider.cjs.map +1 -0
- package/dist/adapters/pty/ptyProvider.d.cts +13 -0
- package/dist/adapters/pty/ptyProvider.d.cts.map +1 -0
- package/dist/adapters/pty/ptyProvider.d.mts +13 -0
- package/dist/adapters/pty/ptyProvider.d.mts.map +1 -0
- package/dist/adapters/pty/ptyProvider.mjs +2 -0
- package/dist/adapters/pty/ptyProvider.mjs.map +1 -0
- package/dist/bin/cli.cjs +1 -1
- package/dist/bin/cli.cjs.map +1 -1
- package/dist/bin/cli.mjs +1 -1
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/bin/logSink.cjs.map +1 -1
- package/dist/bin/logSink.mjs.map +1 -1
- package/dist/bin/runnerHost.cjs.map +1 -1
- package/dist/bin/runnerHost.mjs.map +1 -1
- package/dist/cli/cliApp.cjs +1 -6
- package/dist/cli/cliApp.d.cts +2 -23
- package/dist/cli/cliApp.d.mts +2 -23
- package/dist/cli/cliApp.mjs +1 -6
- package/dist/commands/bash/bashTool.cjs +7 -0
- package/dist/commands/bash/bashTool.cjs.map +1 -0
- package/dist/commands/bash/bashTool.d.cts +25 -0
- package/dist/commands/bash/bashTool.d.cts.map +1 -0
- package/dist/commands/bash/bashTool.d.mts +25 -0
- package/dist/commands/bash/bashTool.d.mts.map +1 -0
- package/dist/commands/bash/bashTool.mjs +7 -0
- package/dist/commands/bash/bashTool.mjs.map +1 -0
- package/dist/commands/bash/responseEnvelope.cjs +10 -0
- package/dist/commands/bash/responseEnvelope.cjs.map +1 -0
- package/dist/commands/bash/responseEnvelope.d.cts +45 -0
- package/dist/commands/bash/responseEnvelope.d.cts.map +1 -0
- package/dist/commands/bash/responseEnvelope.d.mts +45 -0
- package/dist/commands/bash/responseEnvelope.d.mts.map +1 -0
- package/dist/commands/bash/responseEnvelope.mjs +10 -0
- package/dist/{tool/responseEnvelope.cjs.map → commands/bash/responseEnvelope.mjs.map} +1 -1
- package/dist/commands/cli/cliApp.cjs +6 -0
- package/dist/commands/cli/cliApp.cjs.map +1 -0
- package/dist/commands/cli/cliApp.d.cts +23 -0
- package/dist/commands/cli/cliApp.d.cts.map +1 -0
- package/dist/commands/cli/cliApp.d.mts +23 -0
- package/dist/commands/cli/cliApp.d.mts.map +1 -0
- package/dist/commands/cli/cliApp.mjs +6 -0
- package/dist/commands/cli/cliApp.mjs.map +1 -0
- package/dist/compaction.cjs +1 -4
- package/dist/compaction.d.cts +2 -14
- package/dist/compaction.d.mts +2 -14
- package/dist/compaction.mjs +1 -4
- package/dist/config.cjs +1 -2
- package/dist/config.d.cts +2 -32
- package/dist/config.d.mts +2 -32
- package/dist/config.mjs +1 -2
- package/dist/container/index.cjs +1 -1
- package/dist/container/index.cjs.map +1 -1
- package/dist/container/index.mjs +1 -1
- package/dist/container/index.mjs.map +1 -1
- package/dist/extension.cjs +1 -3
- package/dist/extension.d.cts +2 -10
- package/dist/extension.d.mts +2 -10
- package/dist/extension.mjs +1 -3
- package/dist/extensions/pi.cjs +1 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.cts +1 -1
- package/dist/extensions/pi.d.mts +1 -1
- package/dist/extensions/pi.mjs +1 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/ptyProvider.cjs +1 -2
- package/dist/ptyProvider.d.cts +2 -13
- package/dist/ptyProvider.d.mts +2 -13
- package/dist/ptyProvider.mjs +1 -2
- package/dist/reconcile.cjs +1 -2
- package/dist/reconcile.d.cts +2 -37
- package/dist/reconcile.d.mts +2 -37
- package/dist/reconcile.mjs +1 -2
- package/dist/runnerSpec.cjs +1 -2
- package/dist/runnerSpec.d.cts +2 -50
- package/dist/runnerSpec.d.mts +2 -50
- package/dist/runnerSpec.mjs +1 -2
- package/dist/schemas/bashTool.cjs +2 -0
- package/dist/schemas/bashTool.cjs.map +1 -0
- package/dist/schemas/bashTool.d.cts +25 -0
- package/dist/schemas/bashTool.d.cts.map +1 -0
- package/dist/schemas/bashTool.d.mts +25 -0
- package/dist/schemas/bashTool.d.mts.map +1 -0
- package/dist/schemas/bashTool.mjs +2 -0
- package/dist/schemas/bashTool.mjs.map +1 -0
- package/dist/schemas/runnerSpec.cjs +2 -0
- package/dist/schemas/runnerSpec.cjs.map +1 -0
- package/dist/schemas/runnerSpec.d.cts +50 -0
- package/dist/schemas/runnerSpec.d.cts.map +1 -0
- package/dist/schemas/runnerSpec.d.mts +50 -0
- package/dist/schemas/runnerSpec.d.mts.map +1 -0
- package/dist/schemas/runnerSpec.mjs +2 -0
- package/dist/schemas/runnerSpec.mjs.map +1 -0
- package/dist/services/AnsiScrub/ansiScrub.cjs +1 -1
- package/dist/services/AnsiScrub/ansiScrub.cjs.map +1 -1
- package/dist/services/AnsiScrub/ansiScrub.mjs +1 -1
- package/dist/services/AnsiScrub/ansiScrub.mjs.map +1 -1
- package/dist/services/BashRunService/BashRunService.cjs +1 -1
- package/dist/services/BashRunService/BashRunService.cjs.map +1 -1
- package/dist/services/BashRunService/BashRunService.mjs +1 -1
- package/dist/services/BashRunService/BashRunService.mjs.map +1 -1
- package/dist/services/Launcher/Launcher.cjs +1 -1
- package/dist/services/Launcher/Launcher.cjs.map +1 -1
- package/dist/services/Launcher/Launcher.mjs +1 -1
- package/dist/services/Launcher/Launcher.mjs.map +1 -1
- package/dist/services/Lifeline/NodeLifeline.cjs +1 -1
- package/dist/services/Lifeline/NodeLifeline.cjs.map +1 -1
- package/dist/services/Lifeline/NodeLifeline.mjs +1 -1
- package/dist/services/Lifeline/NodeLifeline.mjs.map +1 -1
- package/dist/services/LogFile/LogFile.cjs +1 -1
- package/dist/services/LogFile/LogFile.cjs.map +1 -1
- package/dist/services/LogFile/LogFile.mjs +1 -1
- package/dist/services/LogFile/LogFile.mjs.map +1 -1
- package/dist/services/PtyHost/PtyHost.cjs +1 -1
- package/dist/services/PtyHost/PtyHost.cjs.map +1 -1
- package/dist/services/PtyHost/PtyHost.mjs +1 -1
- package/dist/services/PtyHost/PtyHost.mjs.map +1 -1
- package/dist/services/RmuxBackend/RmuxBackend.cjs +1 -1
- package/dist/services/RmuxBackend/RmuxBackend.cjs.map +1 -1
- package/dist/services/RmuxBackend/RmuxBackend.mjs +1 -1
- package/dist/services/RmuxBackend/RmuxBackend.mjs.map +1 -1
- package/dist/services/RunnerNamer/RunnerNamer.cjs +1 -1
- package/dist/services/RunnerNamer/RunnerNamer.cjs.map +1 -1
- package/dist/services/RunnerNamer/RunnerNamer.mjs +1 -1
- package/dist/services/RunnerNamer/RunnerNamer.mjs.map +1 -1
- package/dist/services/RunnerPaths/RunnerPaths.cjs +1 -2
- package/dist/services/RunnerPaths/RunnerPaths.d.cts +2 -31
- package/dist/services/RunnerPaths/RunnerPaths.d.mts +2 -31
- package/dist/services/RunnerPaths/RunnerPaths.mjs +1 -2
- package/dist/services/RunnerPaths/index.cjs +1 -1
- package/dist/services/RunnerPaths/index.d.cts +2 -1
- package/dist/services/RunnerPaths/index.d.mts +2 -1
- package/dist/services/RunnerPaths/index.mjs +1 -1
- package/dist/services/RunnerPaths/types.d.cts +2 -0
- package/dist/services/RunnerPaths/types.d.cts.map +1 -1
- package/dist/services/RunnerPaths/types.d.mts +2 -0
- package/dist/services/RunnerPaths/types.d.mts.map +1 -1
- package/dist/services/RunnerRegistry/RunnerRegistry.cjs +1 -1
- package/dist/services/RunnerRegistry/RunnerRegistry.cjs.map +1 -1
- package/dist/services/RunnerRegistry/RunnerRegistry.mjs +1 -1
- package/dist/services/RunnerRegistry/RunnerRegistry.mjs.map +1 -1
- package/dist/services/runs/compaction.cjs +4 -0
- package/dist/services/runs/compaction.cjs.map +1 -0
- package/dist/services/runs/compaction.d.cts +14 -0
- package/dist/services/runs/compaction.d.cts.map +1 -0
- package/dist/services/runs/compaction.d.mts +14 -0
- package/dist/services/runs/compaction.d.mts.map +1 -0
- package/dist/services/runs/compaction.mjs +4 -0
- package/dist/services/runs/compaction.mjs.map +1 -0
- package/dist/services/runs/reconcile.cjs +2 -0
- package/dist/services/runs/reconcile.cjs.map +1 -0
- package/dist/services/runs/reconcile.d.cts +37 -0
- package/dist/services/runs/reconcile.d.cts.map +1 -0
- package/dist/services/runs/reconcile.d.mts +37 -0
- package/dist/services/runs/reconcile.d.mts.map +1 -0
- package/dist/services/runs/reconcile.mjs +2 -0
- package/dist/services/runs/reconcile.mjs.map +1 -0
- package/dist/services/runs/session.cjs +2 -0
- package/dist/services/runs/session.cjs.map +1 -0
- package/dist/services/runs/session.d.cts +10 -0
- package/dist/services/runs/session.d.cts.map +1 -0
- package/dist/services/runs/session.d.mts +10 -0
- package/dist/services/runs/session.d.mts.map +1 -0
- package/dist/services/runs/session.mjs +2 -0
- package/dist/services/runs/session.mjs.map +1 -0
- package/dist/session.cjs +1 -2
- package/dist/session.d.cts +2 -10
- package/dist/session.d.mts +2 -10
- package/dist/session.mjs +1 -2
- package/dist/tool/bashTool.cjs +1 -7
- package/dist/tool/bashTool.d.cts +2 -25
- package/dist/tool/bashTool.d.mts +2 -25
- package/dist/tool/bashTool.mjs +1 -7
- package/dist/tool/responseEnvelope.cjs +1 -10
- package/dist/tool/responseEnvelope.d.cts +2 -45
- package/dist/tool/responseEnvelope.d.mts +2 -45
- package/dist/tool/responseEnvelope.mjs +1 -10
- package/dist/tool/schema.cjs +1 -2
- package/dist/tool/schema.d.cts +2 -25
- package/dist/tool/schema.d.mts +2 -25
- package/dist/tool/schema.mjs +1 -2
- package/dist/tui/bashRender.cjs +4 -7
- package/dist/tui/bashRender.cjs.map +1 -1
- package/dist/tui/bashRender.d.cts +5 -5
- package/dist/tui/bashRender.d.cts.map +1 -1
- package/dist/tui/bashRender.d.mts +5 -5
- package/dist/tui/bashRender.d.mts.map +1 -1
- package/dist/tui/bashRender.mjs +4 -7
- package/dist/tui/bashRender.mjs.map +1 -1
- package/dist/tui/format.cjs +1 -1
- package/dist/tui/format.cjs.map +1 -1
- package/dist/tui/format.mjs +1 -1
- package/dist/tui/format.mjs.map +1 -1
- package/dist/tui/runnerSpace.cjs +4 -4
- package/dist/tui/runnerSpace.cjs.map +1 -1
- package/dist/tui/runnerSpace.d.cts.map +1 -1
- package/dist/tui/runnerSpace.d.mts.map +1 -1
- package/dist/tui/runnerSpace.mjs +4 -4
- package/dist/tui/runnerSpace.mjs.map +1 -1
- package/dist/types/config.cjs +2 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +32 -0
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +32 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +2 -0
- package/dist/types/config.mjs.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +28 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.mts +28 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types.cjs +1 -2
- package/dist/types.d.cts +2 -28
- package/dist/types.d.mts +2 -28
- package/dist/types.mjs +1 -2
- package/package.json +20 -13
- package/dist/cli/cliApp.cjs.map +0 -1
- package/dist/cli/cliApp.d.cts.map +0 -1
- package/dist/cli/cliApp.d.mts.map +0 -1
- package/dist/cli/cliApp.mjs.map +0 -1
- package/dist/compaction.cjs.map +0 -1
- package/dist/compaction.d.cts.map +0 -1
- package/dist/compaction.d.mts.map +0 -1
- package/dist/compaction.mjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs.map +0 -1
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts.map +0 -1
- package/dist/extension.mjs.map +0 -1
- package/dist/ptyProvider.cjs.map +0 -1
- package/dist/ptyProvider.d.cts.map +0 -1
- package/dist/ptyProvider.d.mts.map +0 -1
- package/dist/ptyProvider.mjs.map +0 -1
- package/dist/reconcile.cjs.map +0 -1
- package/dist/reconcile.d.cts.map +0 -1
- package/dist/reconcile.d.mts.map +0 -1
- package/dist/reconcile.mjs.map +0 -1
- package/dist/runnerSpec.cjs.map +0 -1
- package/dist/runnerSpec.d.cts.map +0 -1
- package/dist/runnerSpec.d.mts.map +0 -1
- package/dist/runnerSpec.mjs.map +0 -1
- package/dist/services/RunnerPaths/RunnerPaths.cjs.map +0 -1
- package/dist/services/RunnerPaths/RunnerPaths.d.cts.map +0 -1
- package/dist/services/RunnerPaths/RunnerPaths.d.mts.map +0 -1
- package/dist/services/RunnerPaths/RunnerPaths.mjs.map +0 -1
- package/dist/session.cjs.map +0 -1
- package/dist/session.d.cts.map +0 -1
- package/dist/session.d.mts.map +0 -1
- package/dist/session.mjs.map +0 -1
- package/dist/tool/bashTool.cjs.map +0 -1
- package/dist/tool/bashTool.d.cts.map +0 -1
- package/dist/tool/bashTool.d.mts.map +0 -1
- package/dist/tool/bashTool.mjs.map +0 -1
- package/dist/tool/responseEnvelope.d.cts.map +0 -1
- package/dist/tool/responseEnvelope.d.mts.map +0 -1
- package/dist/tool/responseEnvelope.mjs.map +0 -1
- package/dist/tool/schema.cjs.map +0 -1
- package/dist/tool/schema.d.cts.map +0 -1
- package/dist/tool/schema.d.mts.map +0 -1
- package/dist/tool/schema.mjs.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/types.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRmuxBackend, RmuxLaunchRequest } from "./services/RmuxBackend/types.cjs";
|
|
2
2
|
import { RmuxBackend } from "./services/RmuxBackend/RmuxBackend.cjs";
|
|
3
3
|
import "./services/RmuxBackend/index.cjs";
|
|
4
|
-
import { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes } from "./config.cjs";
|
|
4
|
+
import { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes } from "./types/config.cjs";
|
|
5
5
|
import { createRunnerContainer } from "./container/index.cjs";
|
|
6
|
-
import { TYPES } from "./types.cjs";
|
|
6
|
+
import { TYPES } from "./types/index.cjs";
|
|
7
7
|
export { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, type IRmuxBackend, RmuxBackend, type RmuxLaunchRequest, TYPES, createRunnerContainer, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRmuxBackend, RmuxLaunchRequest } from "./services/RmuxBackend/types.mjs";
|
|
2
2
|
import { RmuxBackend } from "./services/RmuxBackend/RmuxBackend.mjs";
|
|
3
3
|
import "./services/RmuxBackend/index.mjs";
|
|
4
|
-
import { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes } from "./config.mjs";
|
|
4
|
+
import { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes } from "./types/config.mjs";
|
|
5
5
|
import { createRunnerContainer } from "./container/index.mjs";
|
|
6
|
-
import { TYPES } from "./types.mjs";
|
|
6
|
+
import { TYPES } from "./types/index.mjs";
|
|
7
7
|
export { DEFAULT_BG_THRESHOLD_MS, DEFAULT_LOG_MAX_BYTES, DEFAULT_LOG_TTL_MS, DEFAULT_RESULT_MAX_BYTES, type IRmuxBackend, RmuxBackend, type RmuxLaunchRequest, TYPES, createRunnerContainer, getBackgroundThresholdMs, getLogMaxBytes, getLogTtlMs, getResultMaxBytes };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_BG_THRESHOLD_MS as e,DEFAULT_LOG_MAX_BYTES as t,DEFAULT_LOG_TTL_MS as n,DEFAULT_RESULT_MAX_BYTES as r,getBackgroundThresholdMs as i,getLogMaxBytes as a,getLogTtlMs as o,getResultMaxBytes as s}from"./config.mjs";import{TYPES as c}from"./types.mjs";import{RmuxBackend as l}from"./services/RmuxBackend/RmuxBackend.mjs";import"./services/RmuxBackend/index.mjs";import{createRunnerContainer as u}from"./container/index.mjs";export{e as DEFAULT_BG_THRESHOLD_MS,t as DEFAULT_LOG_MAX_BYTES,n as DEFAULT_LOG_TTL_MS,r as DEFAULT_RESULT_MAX_BYTES,l as RmuxBackend,c as TYPES,u as createRunnerContainer,i as getBackgroundThresholdMs,a as getLogMaxBytes,o as getLogTtlMs,s as getResultMaxBytes};
|
|
1
|
+
import{DEFAULT_BG_THRESHOLD_MS as e,DEFAULT_LOG_MAX_BYTES as t,DEFAULT_LOG_TTL_MS as n,DEFAULT_RESULT_MAX_BYTES as r,getBackgroundThresholdMs as i,getLogMaxBytes as a,getLogTtlMs as o,getResultMaxBytes as s}from"./types/config.mjs";import{TYPES as c}from"./types/index.mjs";import{RmuxBackend as l}from"./services/RmuxBackend/RmuxBackend.mjs";import"./services/RmuxBackend/index.mjs";import{createRunnerContainer as u}from"./container/index.mjs";export{e as DEFAULT_BG_THRESHOLD_MS,t as DEFAULT_LOG_MAX_BYTES,n as DEFAULT_LOG_TTL_MS,r as DEFAULT_RESULT_MAX_BYTES,l as RmuxBackend,c as TYPES,u as createRunnerContainer,i as getBackgroundThresholdMs,a as getLogMaxBytes,o as getLogTtlMs,s as getResultMaxBytes};
|
package/dist/ptyProvider.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
2
|
-
//# sourceMappingURL=ptyProvider.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./adapters/pty/ptyProvider.cjs");exports.provideRunnerPty=e.provideRunnerPty;
|
package/dist/ptyProvider.d.cts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ProtocolRuntime } from "@agimon-ai/doompi-extension-contracts/protocol";
|
|
4
|
-
//#region src/ptyProvider.d.ts
|
|
5
|
-
interface PtyProviderOptions {
|
|
6
|
-
ptyHost: IPtyHost;
|
|
7
|
-
sessionId: () => string | undefined;
|
|
8
|
-
onError?: (error: unknown, id: string) => void;
|
|
9
|
-
}
|
|
10
|
-
declare function provideRunnerPty(runtime: ProtocolRuntime, options: PtyProviderOptions): () => void;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { PtyProviderOptions, provideRunnerPty };
|
|
13
|
-
//# sourceMappingURL=ptyProvider.d.cts.map
|
|
1
|
+
import { PtyProviderOptions, provideRunnerPty } from "./adapters/pty/ptyProvider.cjs";
|
|
2
|
+
export { PtyProviderOptions, provideRunnerPty };
|
package/dist/ptyProvider.d.mts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ProtocolRuntime } from "@agimon-ai/doompi-extension-contracts/protocol";
|
|
4
|
-
//#region src/ptyProvider.d.ts
|
|
5
|
-
interface PtyProviderOptions {
|
|
6
|
-
ptyHost: IPtyHost;
|
|
7
|
-
sessionId: () => string | undefined;
|
|
8
|
-
onError?: (error: unknown, id: string) => void;
|
|
9
|
-
}
|
|
10
|
-
declare function provideRunnerPty(runtime: ProtocolRuntime, options: PtyProviderOptions): () => void;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { PtyProviderOptions, provideRunnerPty };
|
|
13
|
-
//# sourceMappingURL=ptyProvider.d.mts.map
|
|
1
|
+
import { PtyProviderOptions, provideRunnerPty } from "./adapters/pty/ptyProvider.mjs";
|
|
2
|
+
export { PtyProviderOptions, provideRunnerPty };
|
package/dist/ptyProvider.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=ptyProvider.mjs.map
|
|
1
|
+
import{provideRunnerPty as e}from"./adapters/pty/ptyProvider.mjs";export{e as provideRunnerPty};
|
package/dist/reconcile.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
2
|
-
//# sourceMappingURL=reconcile.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./services/runs/reconcile.cjs");exports.cleanupLegacyRunnerStore=e.cleanupLegacyRunnerStore,exports.reconcileActiveRunners=e.reconcileActiveRunners,exports.stopRunnerProcess=e.stopRunnerProcess;
|
package/dist/reconcile.d.cts
CHANGED
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { IProcessControl } from "./services/ProcessControl/types.cjs";
|
|
4
|
-
import "./services/ProcessControl/index.cjs";
|
|
5
|
-
import { ILauncher } from "./services/Launcher/types.cjs";
|
|
6
|
-
import "./services/Launcher/index.cjs";
|
|
7
|
-
import { IRmuxBackend } from "./services/RmuxBackend/types.cjs";
|
|
8
|
-
import "./services/RmuxBackend/index.cjs";
|
|
9
|
-
import { IRunnerRegistry, RunnerRecord } from "./services/RunnerRegistry/types.cjs";
|
|
10
|
-
import "./services/RunnerRegistry/index.cjs";
|
|
11
|
-
//#region src/reconcile.d.ts
|
|
12
|
-
interface ReconcileDependencies {
|
|
13
|
-
registry: IRunnerRegistry;
|
|
14
|
-
launcher: ILauncher;
|
|
15
|
-
rmuxBackend: IRmuxBackend;
|
|
16
|
-
processControl: IProcessControl;
|
|
17
|
-
currentHostPid: number;
|
|
18
|
-
startup: boolean;
|
|
19
|
-
active?: readonly RunnerRecord[];
|
|
20
|
-
}
|
|
21
|
-
interface RunnerReconcileResult {
|
|
22
|
-
reclaimed: string[];
|
|
23
|
-
errors: string[];
|
|
24
|
-
}
|
|
25
|
-
declare function stopRunnerProcess(record: RunnerRecord, launcher: ILauncher, rmuxBackend: IRmuxBackend): Promise<boolean>;
|
|
26
|
-
/** Repairs active registry entries that lost their original completion observer. */
|
|
27
|
-
declare function reconcileActiveRunners(dependencies: ReconcileDependencies): Promise<RunnerReconcileResult>;
|
|
28
|
-
interface LegacyCleanupDependencies extends Omit<ReconcileDependencies, 'startup'> {
|
|
29
|
-
paths: IRunnerPaths;
|
|
30
|
-
}
|
|
31
|
-
/** Deletes the legacy Git store only after no live foreign runner uses it. */
|
|
32
|
-
declare function cleanupLegacyRunnerStore(dependencies: LegacyCleanupDependencies): Promise<RunnerReconcileResult & {
|
|
33
|
-
removed?: string;
|
|
34
|
-
}>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess };
|
|
37
|
-
//# sourceMappingURL=reconcile.d.cts.map
|
|
1
|
+
import { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess } from "./services/runs/reconcile.cjs";
|
|
2
|
+
export { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess };
|
package/dist/reconcile.d.mts
CHANGED
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { IProcessControl } from "./services/ProcessControl/types.mjs";
|
|
4
|
-
import "./services/ProcessControl/index.mjs";
|
|
5
|
-
import { ILauncher } from "./services/Launcher/types.mjs";
|
|
6
|
-
import "./services/Launcher/index.mjs";
|
|
7
|
-
import { IRmuxBackend } from "./services/RmuxBackend/types.mjs";
|
|
8
|
-
import "./services/RmuxBackend/index.mjs";
|
|
9
|
-
import { IRunnerRegistry, RunnerRecord } from "./services/RunnerRegistry/types.mjs";
|
|
10
|
-
import "./services/RunnerRegistry/index.mjs";
|
|
11
|
-
//#region src/reconcile.d.ts
|
|
12
|
-
interface ReconcileDependencies {
|
|
13
|
-
registry: IRunnerRegistry;
|
|
14
|
-
launcher: ILauncher;
|
|
15
|
-
rmuxBackend: IRmuxBackend;
|
|
16
|
-
processControl: IProcessControl;
|
|
17
|
-
currentHostPid: number;
|
|
18
|
-
startup: boolean;
|
|
19
|
-
active?: readonly RunnerRecord[];
|
|
20
|
-
}
|
|
21
|
-
interface RunnerReconcileResult {
|
|
22
|
-
reclaimed: string[];
|
|
23
|
-
errors: string[];
|
|
24
|
-
}
|
|
25
|
-
declare function stopRunnerProcess(record: RunnerRecord, launcher: ILauncher, rmuxBackend: IRmuxBackend): Promise<boolean>;
|
|
26
|
-
/** Repairs active registry entries that lost their original completion observer. */
|
|
27
|
-
declare function reconcileActiveRunners(dependencies: ReconcileDependencies): Promise<RunnerReconcileResult>;
|
|
28
|
-
interface LegacyCleanupDependencies extends Omit<ReconcileDependencies, 'startup'> {
|
|
29
|
-
paths: IRunnerPaths;
|
|
30
|
-
}
|
|
31
|
-
/** Deletes the legacy Git store only after no live foreign runner uses it. */
|
|
32
|
-
declare function cleanupLegacyRunnerStore(dependencies: LegacyCleanupDependencies): Promise<RunnerReconcileResult & {
|
|
33
|
-
removed?: string;
|
|
34
|
-
}>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess };
|
|
37
|
-
//# sourceMappingURL=reconcile.d.mts.map
|
|
1
|
+
import { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess } from "./services/runs/reconcile.mjs";
|
|
2
|
+
export { RunnerReconcileResult, cleanupLegacyRunnerStore, reconcileActiveRunners, stopRunnerProcess };
|
package/dist/reconcile.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//# sourceMappingURL=reconcile.mjs.map
|
|
1
|
+
import{cleanupLegacyRunnerStore as e,reconcileActiveRunners as t,stopRunnerProcess as n}from"./services/runs/reconcile.mjs";export{e as cleanupLegacyRunnerStore,t as reconcileActiveRunners,n as stopRunnerProcess};
|
package/dist/runnerSpec.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
2
|
-
//# sourceMappingURL=runnerSpec.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./schemas/runnerSpec.cjs");exports.NO_TERMINAL_INPUT_ENV=e.NO_TERMINAL_INPUT_ENV,exports.cleanupSupervisorFiles=e.cleanupSupervisorFiles,exports.readExitMetadata=e.readExitMetadata,exports.runtimeEntry=e.runtimeEntry,exports.shellJoin=e.shellJoin,exports.supervisorCommand=e.supervisorCommand,exports.supervisorPaths=e.supervisorPaths,exports.writeCommandSpec=e.writeCommandSpec;
|
package/dist/runnerSpec.d.cts
CHANGED
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface CommandSpec {
|
|
4
|
-
command: string;
|
|
5
|
-
cwd: string;
|
|
6
|
-
env: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
/** Exit status the supervisor records once its command is gone. */
|
|
9
|
-
interface ExitMetadata {
|
|
10
|
-
code: number | null;
|
|
11
|
-
signal: NodeJS.Signals | null;
|
|
12
|
-
}
|
|
13
|
-
/** Sidecars a supervised run reads and writes beside its log. */
|
|
14
|
-
interface SupervisorPaths {
|
|
15
|
-
spec: string;
|
|
16
|
-
gate: string;
|
|
17
|
-
exit: string;
|
|
18
|
-
logDone: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Settings that make a terminal safe for a caller with no keyboard.
|
|
22
|
-
*
|
|
23
|
-
* Commands run inside an rmux pane, so their stdout is a real tty. Git and
|
|
24
|
-
* friends take that as permission to open a pager, and `less` then waits at
|
|
25
|
-
* `(END)` for a keypress nobody is there to send, so the run hangs until its
|
|
26
|
-
* timeout. The same tty invites credential prompts, which hang the same way.
|
|
27
|
-
* A conventional piped stdout disables both automatically; a pane has to be
|
|
28
|
-
* told. A command that genuinely wants a pager can still ask for one, as in
|
|
29
|
-
* `git -c core.pager=less log`.
|
|
30
|
-
*/
|
|
31
|
-
declare const NO_TERMINAL_INPUT_ENV: {
|
|
32
|
-
GIT_PAGER: string;
|
|
33
|
-
PAGER: string;
|
|
34
|
-
GIT_TERMINAL_PROMPT: string;
|
|
35
|
-
};
|
|
36
|
-
declare function supervisorPaths(directory: string, id: string): SupervisorPaths;
|
|
37
|
-
declare function writeCommandSpec(target: string, spec: CommandSpec): void;
|
|
38
|
-
declare function readExitMetadata(target: string): ExitMetadata | undefined;
|
|
39
|
-
declare function cleanupSupervisorFiles(paths: SupervisorPaths): void;
|
|
40
|
-
/** Resolves a bundled entry point in whichever form the package is running from. */
|
|
41
|
-
declare function runtimeEntry(name: 'runnerHost' | 'logSink'): string;
|
|
42
|
-
/**
|
|
43
|
-
* Replaces the shell rather than nesting under it, so the pid handed back is the
|
|
44
|
-
* supervisor's and a group signal reaches it directly.
|
|
45
|
-
*/
|
|
46
|
-
declare function supervisorCommand(paths: SupervisorPaths): string;
|
|
47
|
-
declare function shellJoin(values: readonly string[]): string;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
|
50
|
-
//# sourceMappingURL=runnerSpec.d.cts.map
|
|
1
|
+
import { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec } from "./schemas/runnerSpec.cjs";
|
|
2
|
+
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
package/dist/runnerSpec.d.mts
CHANGED
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface CommandSpec {
|
|
4
|
-
command: string;
|
|
5
|
-
cwd: string;
|
|
6
|
-
env: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
/** Exit status the supervisor records once its command is gone. */
|
|
9
|
-
interface ExitMetadata {
|
|
10
|
-
code: number | null;
|
|
11
|
-
signal: NodeJS.Signals | null;
|
|
12
|
-
}
|
|
13
|
-
/** Sidecars a supervised run reads and writes beside its log. */
|
|
14
|
-
interface SupervisorPaths {
|
|
15
|
-
spec: string;
|
|
16
|
-
gate: string;
|
|
17
|
-
exit: string;
|
|
18
|
-
logDone: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Settings that make a terminal safe for a caller with no keyboard.
|
|
22
|
-
*
|
|
23
|
-
* Commands run inside an rmux pane, so their stdout is a real tty. Git and
|
|
24
|
-
* friends take that as permission to open a pager, and `less` then waits at
|
|
25
|
-
* `(END)` for a keypress nobody is there to send, so the run hangs until its
|
|
26
|
-
* timeout. The same tty invites credential prompts, which hang the same way.
|
|
27
|
-
* A conventional piped stdout disables both automatically; a pane has to be
|
|
28
|
-
* told. A command that genuinely wants a pager can still ask for one, as in
|
|
29
|
-
* `git -c core.pager=less log`.
|
|
30
|
-
*/
|
|
31
|
-
declare const NO_TERMINAL_INPUT_ENV: {
|
|
32
|
-
GIT_PAGER: string;
|
|
33
|
-
PAGER: string;
|
|
34
|
-
GIT_TERMINAL_PROMPT: string;
|
|
35
|
-
};
|
|
36
|
-
declare function supervisorPaths(directory: string, id: string): SupervisorPaths;
|
|
37
|
-
declare function writeCommandSpec(target: string, spec: CommandSpec): void;
|
|
38
|
-
declare function readExitMetadata(target: string): ExitMetadata | undefined;
|
|
39
|
-
declare function cleanupSupervisorFiles(paths: SupervisorPaths): void;
|
|
40
|
-
/** Resolves a bundled entry point in whichever form the package is running from. */
|
|
41
|
-
declare function runtimeEntry(name: 'runnerHost' | 'logSink'): string;
|
|
42
|
-
/**
|
|
43
|
-
* Replaces the shell rather than nesting under it, so the pid handed back is the
|
|
44
|
-
* supervisor's and a group signal reaches it directly.
|
|
45
|
-
*/
|
|
46
|
-
declare function supervisorCommand(paths: SupervisorPaths): string;
|
|
47
|
-
declare function shellJoin(values: readonly string[]): string;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
|
50
|
-
//# sourceMappingURL=runnerSpec.d.mts.map
|
|
1
|
+
import { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec } from "./schemas/runnerSpec.mjs";
|
|
2
|
+
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
package/dist/runnerSpec.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//# sourceMappingURL=runnerSpec.mjs.map
|
|
1
|
+
import{NO_TERMINAL_INPUT_ENV as e,cleanupSupervisorFiles as t,readExitMetadata as n,runtimeEntry as r,shellJoin as i,supervisorCommand as a,supervisorPaths as o,writeCommandSpec as s}from"./schemas/runnerSpec.mjs";export{e as NO_TERMINAL_INPUT_ENV,t as cleanupSupervisorFiles,n as readExitMetadata,r as runtimeEntry,i as shellJoin,a as supervisorCommand,o as supervisorPaths,s as writeCommandSpec};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("typebox");const t=e.Type.Object({command:e.Type.String({description:`Bash command to execute`}),timeout:e.Type.Optional(e.Type.Number({description:`Timeout in seconds (optional, no default timeout)`})),background:e.Type.Optional(e.Type.Boolean({description:`Start the command in the background immediately instead of waiting. Use for dev servers, watchers and other commands you already know will not finish.`})),interactive:e.Type.Optional(e.Type.Boolean({description:`Run under a pseudo terminal so the command can prompt. Use only when the command asks for confirmation or input; answer it with doom-runner input. Logs from interactive runs are noisier.`})),name:e.Type.Optional(e.Type.String({description:`Preferred runner name if the command ends up in the background. A name in use gets a suffix.`})),alarm:e.Type.Optional(e.Type.Number({description:`Send you a snapshot of this runner every N seconds, so you never have to poll it. Implies background. Use it to watch a dev server or a long build, or to wake yourself on a schedule by backgrounding a sleep loop. Minimum 10 seconds. It stops on its own when the process exits, or early with doom-runner alarm stop <id>.`}))});exports.BASH_TOOL_LABEL=`bash`,exports.BASH_TOOL_NAME=`bash`,exports.BashParamsSchema=t,exports.MIN_ALARM_SECONDS=10;
|
|
2
|
+
//# sourceMappingURL=bashTool.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.cjs","names":["Type"],"sources":["../../src/schemas/bashTool.ts"],"sourcesContent":["import { type Static, Type } from 'typebox';\n\n/** Replaces pi's built-in tool of the same name, so hooks keyed on `bash` keep working. */\nexport const BASH_TOOL_NAME = 'bash';\nexport const BASH_TOOL_LABEL = 'bash';\n\n/** Floor for `alarm`, so a short interval cannot flood the conversation. */\nexport const MIN_ALARM_SECONDS = 10;\n\n/**\n * Built-in bash parameters plus the backgrounding controls.\n *\n * `command` and `timeout` keep their original names and wording so the tool is\n * a drop-in replacement. Every `description` is prompt copy the model reads.\n */\nexport const BashParamsSchema = Type.Object({\n command: Type.String({ description: 'Bash command to execute' }),\n timeout: Type.Optional(Type.Number({ description: 'Timeout in seconds (optional, no default timeout)' })),\n background: Type.Optional(\n Type.Boolean({\n description:\n 'Start the command in the background immediately instead of waiting. Use for dev servers, watchers and other commands you already know will not finish.',\n }),\n ),\n interactive: Type.Optional(\n Type.Boolean({\n description:\n 'Run under a pseudo terminal so the command can prompt. Use only when the command asks for confirmation or input; answer it with doom-runner input. Logs from interactive runs are noisier.',\n }),\n ),\n name: Type.Optional(\n Type.String({\n description: 'Preferred runner name if the command ends up in the background. A name in use gets a suffix.',\n }),\n ),\n alarm: Type.Optional(\n Type.Number({\n description: `Send you a snapshot of this runner every N seconds, so you never have to poll it. Implies background. Use it to watch a dev server or a long build, or to wake yourself on a schedule by backgrounding a sleep loop. Minimum ${MIN_ALARM_SECONDS} seconds. It stops on its own when the process exits, or early with doom-runner alarm stop <id>.`,\n }),\n ),\n});\n\nexport type BashParams = Static<typeof BashParamsSchema>;\n"],"mappings":"yBAGA,MAYa,EAAmBA,EAAAA,KAAK,OAAO,CAC1C,QAASA,EAAAA,KAAK,OAAO,CAAE,YAAa,yBAA0B,CAAC,EAC/D,QAASA,EAAAA,KAAK,SAASA,EAAAA,KAAK,OAAO,CAAE,YAAa,mDAAoD,CAAC,CAAC,EACxG,WAAYA,EAAAA,KAAK,SACfA,EAAAA,KAAK,QAAQ,CACX,YACE,wJACJ,CAAC,CACH,EACA,YAAaA,EAAAA,KAAK,SAChBA,EAAAA,KAAK,QAAQ,CACX,YACE,4LACJ,CAAC,CACH,EACA,KAAMA,EAAAA,KAAK,SACTA,EAAAA,KAAK,OAAO,CACV,YAAa,8FACf,CAAC,CACH,EACA,MAAOA,EAAAA,KAAK,SACVA,EAAAA,KAAK,OAAO,CACV,YAAa,iUACf,CAAC,CACH,CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Static, Type } from "typebox";
|
|
2
|
+
//#region src/schemas/bashTool.d.ts
|
|
3
|
+
/** Replaces pi's built-in tool of the same name, so hooks keyed on `bash` keep working. */
|
|
4
|
+
declare const BASH_TOOL_NAME = "bash";
|
|
5
|
+
declare const BASH_TOOL_LABEL = "bash";
|
|
6
|
+
/** Floor for `alarm`, so a short interval cannot flood the conversation. */
|
|
7
|
+
declare const MIN_ALARM_SECONDS = 10;
|
|
8
|
+
/**
|
|
9
|
+
* Built-in bash parameters plus the backgrounding controls.
|
|
10
|
+
*
|
|
11
|
+
* `command` and `timeout` keep their original names and wording so the tool is
|
|
12
|
+
* a drop-in replacement. Every `description` is prompt copy the model reads.
|
|
13
|
+
*/
|
|
14
|
+
declare const BashParamsSchema: Type.TObject<{
|
|
15
|
+
command: Type.TString;
|
|
16
|
+
timeout: Type.TOptional<Type.TNumber>;
|
|
17
|
+
background: Type.TOptional<Type.TBoolean>;
|
|
18
|
+
interactive: Type.TOptional<Type.TBoolean>;
|
|
19
|
+
name: Type.TOptional<Type.TString>;
|
|
20
|
+
alarm: Type.TOptional<Type.TNumber>;
|
|
21
|
+
}>;
|
|
22
|
+
type BashParams = Static<typeof BashParamsSchema>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { BASH_TOOL_LABEL, BASH_TOOL_NAME, BashParams, BashParamsSchema, MIN_ALARM_SECONDS };
|
|
25
|
+
//# sourceMappingURL=bashTool.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.d.cts","names":[],"sources":["../../src/schemas/bashTool.ts"],"mappings":";;;cAGa;cACA;;cAGA;;;;;;;cAQA,kBAAgB,KAAA;;;;;;;;KA2BjB,aAAa,cAAc"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Static, Type } from "typebox";
|
|
2
|
+
//#region src/schemas/bashTool.d.ts
|
|
3
|
+
/** Replaces pi's built-in tool of the same name, so hooks keyed on `bash` keep working. */
|
|
4
|
+
declare const BASH_TOOL_NAME = "bash";
|
|
5
|
+
declare const BASH_TOOL_LABEL = "bash";
|
|
6
|
+
/** Floor for `alarm`, so a short interval cannot flood the conversation. */
|
|
7
|
+
declare const MIN_ALARM_SECONDS = 10;
|
|
8
|
+
/**
|
|
9
|
+
* Built-in bash parameters plus the backgrounding controls.
|
|
10
|
+
*
|
|
11
|
+
* `command` and `timeout` keep their original names and wording so the tool is
|
|
12
|
+
* a drop-in replacement. Every `description` is prompt copy the model reads.
|
|
13
|
+
*/
|
|
14
|
+
declare const BashParamsSchema: Type.TObject<{
|
|
15
|
+
command: Type.TString;
|
|
16
|
+
timeout: Type.TOptional<Type.TNumber>;
|
|
17
|
+
background: Type.TOptional<Type.TBoolean>;
|
|
18
|
+
interactive: Type.TOptional<Type.TBoolean>;
|
|
19
|
+
name: Type.TOptional<Type.TString>;
|
|
20
|
+
alarm: Type.TOptional<Type.TNumber>;
|
|
21
|
+
}>;
|
|
22
|
+
type BashParams = Static<typeof BashParamsSchema>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { BASH_TOOL_LABEL, BASH_TOOL_NAME, BashParams, BashParamsSchema, MIN_ALARM_SECONDS };
|
|
25
|
+
//# sourceMappingURL=bashTool.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.d.mts","names":[],"sources":["../../src/schemas/bashTool.ts"],"mappings":";;;cAGa;cACA;;cAGA;;;;;;;cAQA,kBAAgB,KAAA;;;;;;;;KA2BjB,aAAa,cAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Type as e}from"typebox";const t=`bash`,n=`bash`,r=10,i=e.Object({command:e.String({description:`Bash command to execute`}),timeout:e.Optional(e.Number({description:`Timeout in seconds (optional, no default timeout)`})),background:e.Optional(e.Boolean({description:`Start the command in the background immediately instead of waiting. Use for dev servers, watchers and other commands you already know will not finish.`})),interactive:e.Optional(e.Boolean({description:`Run under a pseudo terminal so the command can prompt. Use only when the command asks for confirmation or input; answer it with doom-runner input. Logs from interactive runs are noisier.`})),name:e.Optional(e.String({description:`Preferred runner name if the command ends up in the background. A name in use gets a suffix.`})),alarm:e.Optional(e.Number({description:`Send you a snapshot of this runner every N seconds, so you never have to poll it. Implies background. Use it to watch a dev server or a long build, or to wake yourself on a schedule by backgrounding a sleep loop. Minimum 10 seconds. It stops on its own when the process exits, or early with doom-runner alarm stop <id>.`}))});export{n as BASH_TOOL_LABEL,t as BASH_TOOL_NAME,i as BashParamsSchema,r as MIN_ALARM_SECONDS};
|
|
2
|
+
//# sourceMappingURL=bashTool.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bashTool.mjs","names":[],"sources":["../../src/schemas/bashTool.ts"],"sourcesContent":["import { type Static, Type } from 'typebox';\n\n/** Replaces pi's built-in tool of the same name, so hooks keyed on `bash` keep working. */\nexport const BASH_TOOL_NAME = 'bash';\nexport const BASH_TOOL_LABEL = 'bash';\n\n/** Floor for `alarm`, so a short interval cannot flood the conversation. */\nexport const MIN_ALARM_SECONDS = 10;\n\n/**\n * Built-in bash parameters plus the backgrounding controls.\n *\n * `command` and `timeout` keep their original names and wording so the tool is\n * a drop-in replacement. Every `description` is prompt copy the model reads.\n */\nexport const BashParamsSchema = Type.Object({\n command: Type.String({ description: 'Bash command to execute' }),\n timeout: Type.Optional(Type.Number({ description: 'Timeout in seconds (optional, no default timeout)' })),\n background: Type.Optional(\n Type.Boolean({\n description:\n 'Start the command in the background immediately instead of waiting. Use for dev servers, watchers and other commands you already know will not finish.',\n }),\n ),\n interactive: Type.Optional(\n Type.Boolean({\n description:\n 'Run under a pseudo terminal so the command can prompt. Use only when the command asks for confirmation or input; answer it with doom-runner input. Logs from interactive runs are noisier.',\n }),\n ),\n name: Type.Optional(\n Type.String({\n description: 'Preferred runner name if the command ends up in the background. A name in use gets a suffix.',\n }),\n ),\n alarm: Type.Optional(\n Type.Number({\n description: `Send you a snapshot of this runner every N seconds, so you never have to poll it. Implies background. Use it to watch a dev server or a long build, or to wake yourself on a schedule by backgrounding a sleep loop. Minimum ${MIN_ALARM_SECONDS} seconds. It stops on its own when the process exits, or early with doom-runner alarm stop <id>.`,\n }),\n ),\n});\n\nexport type BashParams = Static<typeof BashParamsSchema>;\n"],"mappings":"+BAGA,MAAa,EAAiB,OACjB,EAAkB,OAGlB,EAAoB,GAQpB,EAAmB,EAAK,OAAO,CAC1C,QAAS,EAAK,OAAO,CAAE,YAAa,yBAA0B,CAAC,EAC/D,QAAS,EAAK,SAAS,EAAK,OAAO,CAAE,YAAa,mDAAoD,CAAC,CAAC,EACxG,WAAY,EAAK,SACf,EAAK,QAAQ,CACX,YACE,wJACJ,CAAC,CACH,EACA,YAAa,EAAK,SAChB,EAAK,QAAQ,CACX,YACE,4LACJ,CAAC,CACH,EACA,KAAM,EAAK,SACT,EAAK,OAAO,CACV,YAAa,8FACf,CAAC,CACH,EACA,MAAO,EAAK,SACV,EAAK,OAAO,CACV,YAAa,iUACf,CAAC,CACH,CACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs");let t=require("node:fs");t=e.__toESM(t,1);let n=require("node:path");n=e.__toESM(n,1);let r=require("node:url");const i={GIT_PAGER:`cat`,PAGER:`cat`,GIT_TERMINAL_PROMPT:`0`},a=`ENOENT`;function o(e,t){return{spec:n.default.join(e,`${t}.command.json`),gate:n.default.join(e,`${t}.gate`),exit:n.default.join(e,`${t}.exit.json`),logDone:n.default.join(e,`${t}.log.done`)}}function s(e,n){t.default.writeFileSync(e,`${JSON.stringify(n)}\n`,{mode:384})}function c(e){try{let n=JSON.parse(t.default.readFileSync(e,`utf8`));if(typeof n!=`object`||!n)return;let r=n;return{code:typeof r.code==`number`?r.code:null,signal:typeof r.signal==`string`?r.signal:null}}catch(t){t.code!==a&&process.emitWarning(`Could not read runner exit metadata ${e}: ${String(t)}`);return}}function l(e){for(let n of Object.values(e))try{t.default.unlinkSync(n)}catch(e){e.code!==a&&process.emitWarning(String(e))}}function u(e){let t=require("url").pathToFileURL(__filename).href.endsWith(`.ts`)?`ts`:`mjs`;return(0,r.fileURLToPath)(new URL(`../bin/${e}.${t}`,require("url").pathToFileURL(__filename).href))}function d(e){return`exec ${f([process.execPath,u(`runnerHost`),e.spec,e.gate,e.exit])}`}function f(e){return e.map(e=>`'${e.replaceAll(`'`,`'"'"'`)}'`).join(` `)}exports.NO_TERMINAL_INPUT_ENV=i,exports.cleanupSupervisorFiles=l,exports.readExitMetadata=c,exports.runtimeEntry=u,exports.shellJoin=f,exports.supervisorCommand=d,exports.supervisorPaths=o,exports.writeCommandSpec=s;
|
|
2
|
+
//# sourceMappingURL=runnerSpec.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerSpec.cjs","names":["path","fs","fileURLToPath"],"sources":["../../src/schemas/runnerSpec.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/** What a supervisor needs to run one command. */\nexport interface CommandSpec {\n command: string;\n cwd: string;\n env: Record<string, string>;\n}\n\n/** Exit status the supervisor records once its command is gone. */\nexport interface ExitMetadata {\n code: number | null;\n signal: NodeJS.Signals | null;\n}\n\n/** Sidecars a supervised run reads and writes beside its log. */\nexport interface SupervisorPaths {\n spec: string;\n gate: string;\n exit: string;\n logDone: string;\n}\n\n/**\n * Settings that make a terminal safe for a caller with no keyboard.\n *\n * Commands run inside an rmux pane, so their stdout is a real tty. Git and\n * friends take that as permission to open a pager, and `less` then waits at\n * `(END)` for a keypress nobody is there to send, so the run hangs until its\n * timeout. The same tty invites credential prompts, which hang the same way.\n * A conventional piped stdout disables both automatically; a pane has to be\n * told. A command that genuinely wants a pager can still ask for one, as in\n * `git -c core.pager=less log`.\n */\nexport const NO_TERMINAL_INPUT_ENV = {\n GIT_PAGER: 'cat',\n PAGER: 'cat',\n GIT_TERMINAL_PROMPT: '0',\n};\n\nconst SPEC_MODE = 0o600;\nconst NOT_FOUND_ERROR_CODE = 'ENOENT';\n\nexport function supervisorPaths(directory: string, id: string): SupervisorPaths {\n return {\n spec: path.join(directory, `${id}.command.json`),\n gate: path.join(directory, `${id}.gate`),\n exit: path.join(directory, `${id}.exit.json`),\n logDone: path.join(directory, `${id}.log.done`),\n };\n}\n\nexport function writeCommandSpec(target: string, spec: CommandSpec): void {\n fs.writeFileSync(target, `${JSON.stringify(spec)}\\n`, { mode: SPEC_MODE });\n}\n\nexport function readExitMetadata(target: string): ExitMetadata | undefined {\n try {\n const value: unknown = JSON.parse(fs.readFileSync(target, 'utf8'));\n if (typeof value !== 'object' || value === null) return undefined;\n const metadata = value as Partial<ExitMetadata>;\n const code = typeof metadata.code === 'number' ? metadata.code : null;\n const signal = typeof metadata.signal === 'string' ? (metadata.signal as NodeJS.Signals) : null;\n return { code, signal };\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n process.emitWarning(`Could not read runner exit metadata ${target}: ${String(error)}`);\n }\n return undefined;\n }\n}\n\nexport function cleanupSupervisorFiles(paths: SupervisorPaths): void {\n for (const target of Object.values(paths)) {\n try {\n fs.unlinkSync(target);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) process.emitWarning(String(error));\n }\n }\n}\n\n/** Resolves a bundled entry point in whichever form the package is running from. */\nexport function runtimeEntry(name: 'runnerHost' | 'logSink'): string {\n const extension = import.meta.url.endsWith('.ts') ? 'ts' : 'mjs';\n return fileURLToPath(new URL(`../bin/${name}.${extension}`, import.meta.url));\n}\n\n/**\n * Replaces the shell rather than nesting under it, so the pid handed back is the\n * supervisor's and a group signal reaches it directly.\n */\nexport function supervisorCommand(paths: SupervisorPaths): string {\n return `exec ${shellJoin([process.execPath, runtimeEntry('runnerHost'), paths.spec, paths.gate, paths.exit])}`;\n}\n\nexport function shellJoin(values: readonly string[]): string {\n return values.map((value) => `'${value.replaceAll(\"'\", `'\"'\"'`)}'`).join(' ');\n}\n"],"mappings":"qKAoCA,MAAa,EAAwB,CACnC,UAAW,MACX,MAAO,MACP,oBAAqB,GACvB,EAGM,EAAuB,SAE7B,SAAgB,EAAgB,EAAmB,EAA6B,CAC9E,MAAO,CACL,KAAMA,EAAAA,QAAK,KAAK,EAAW,GAAG,EAAG,cAAc,EAC/C,KAAMA,EAAAA,QAAK,KAAK,EAAW,GAAG,EAAG,MAAM,EACvC,KAAMA,EAAAA,QAAK,KAAK,EAAW,GAAG,EAAG,WAAW,EAC5C,QAASA,EAAAA,QAAK,KAAK,EAAW,GAAG,EAAG,UAAU,CAChD,CACF,CAEA,SAAgB,EAAiB,EAAgB,EAAyB,CACxE,EAAA,QAAG,cAAc,EAAQ,GAAG,KAAK,UAAU,CAAI,EAAE,IAAK,CAAE,KAAM,GAAU,CAAC,CAC3E,CAEA,SAAgB,EAAiB,EAA0C,CACzE,GAAI,CACF,IAAM,EAAiB,KAAK,MAAMC,EAAAA,QAAG,aAAa,EAAQ,MAAM,CAAC,EACjE,GAAI,OAAO,GAAU,WAAY,EAAgB,OACjD,IAAM,EAAW,EAGjB,MAAO,CAAE,KAFI,OAAO,EAAS,MAAS,SAAW,EAAS,KAAO,KAElD,OADA,OAAO,EAAS,QAAW,SAAY,EAAS,OAA4B,IACrE,CACxB,OAAS,EAAO,CACT,EAAgC,OAAS,GAC5C,QAAQ,YAAY,uCAAuC,EAAO,IAAI,OAAO,CAAK,GAAG,EAEvF,MACF,CACF,CAEA,SAAgB,EAAuB,EAA8B,CACnE,IAAK,IAAM,KAAU,OAAO,OAAO,CAAK,EACtC,GAAI,CACF,EAAA,QAAG,WAAW,CAAM,CACtB,OAAS,EAAO,CACT,EAAgC,OAAS,GAAsB,QAAQ,YAAY,OAAO,CAAK,CAAC,CACvG,CAEJ,CAGA,SAAgB,EAAa,EAAwC,CACnE,IAAM,EAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,KAA4B,SAAS,KAAK,EAAI,KAAO,MAC3D,OAAA,EAAOC,EAAAA,cAAAA,CAAc,IAAI,IAAI,UAAU,EAAK,GAAG,IAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,IAA4B,CAAC,CAC9E,CAMA,SAAgB,EAAkB,EAAgC,CAChE,MAAO,QAAQ,EAAU,CAAC,QAAQ,SAAU,EAAa,YAAY,EAAG,EAAM,KAAM,EAAM,KAAM,EAAM,IAAI,CAAC,GAC7G,CAEA,SAAgB,EAAU,EAAmC,CAC3D,OAAO,EAAO,IAAK,GAAU,IAAI,EAAM,WAAW,IAAK,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAC9E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/schemas/runnerSpec.d.ts
|
|
2
|
+
/** What a supervisor needs to run one command. */
|
|
3
|
+
interface CommandSpec {
|
|
4
|
+
command: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
env: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
/** Exit status the supervisor records once its command is gone. */
|
|
9
|
+
interface ExitMetadata {
|
|
10
|
+
code: number | null;
|
|
11
|
+
signal: NodeJS.Signals | null;
|
|
12
|
+
}
|
|
13
|
+
/** Sidecars a supervised run reads and writes beside its log. */
|
|
14
|
+
interface SupervisorPaths {
|
|
15
|
+
spec: string;
|
|
16
|
+
gate: string;
|
|
17
|
+
exit: string;
|
|
18
|
+
logDone: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Settings that make a terminal safe for a caller with no keyboard.
|
|
22
|
+
*
|
|
23
|
+
* Commands run inside an rmux pane, so their stdout is a real tty. Git and
|
|
24
|
+
* friends take that as permission to open a pager, and `less` then waits at
|
|
25
|
+
* `(END)` for a keypress nobody is there to send, so the run hangs until its
|
|
26
|
+
* timeout. The same tty invites credential prompts, which hang the same way.
|
|
27
|
+
* A conventional piped stdout disables both automatically; a pane has to be
|
|
28
|
+
* told. A command that genuinely wants a pager can still ask for one, as in
|
|
29
|
+
* `git -c core.pager=less log`.
|
|
30
|
+
*/
|
|
31
|
+
declare const NO_TERMINAL_INPUT_ENV: {
|
|
32
|
+
GIT_PAGER: string;
|
|
33
|
+
PAGER: string;
|
|
34
|
+
GIT_TERMINAL_PROMPT: string;
|
|
35
|
+
};
|
|
36
|
+
declare function supervisorPaths(directory: string, id: string): SupervisorPaths;
|
|
37
|
+
declare function writeCommandSpec(target: string, spec: CommandSpec): void;
|
|
38
|
+
declare function readExitMetadata(target: string): ExitMetadata | undefined;
|
|
39
|
+
declare function cleanupSupervisorFiles(paths: SupervisorPaths): void;
|
|
40
|
+
/** Resolves a bundled entry point in whichever form the package is running from. */
|
|
41
|
+
declare function runtimeEntry(name: 'runnerHost' | 'logSink'): string;
|
|
42
|
+
/**
|
|
43
|
+
* Replaces the shell rather than nesting under it, so the pid handed back is the
|
|
44
|
+
* supervisor's and a group signal reaches it directly.
|
|
45
|
+
*/
|
|
46
|
+
declare function supervisorCommand(paths: SupervisorPaths): string;
|
|
47
|
+
declare function shellJoin(values: readonly string[]): string;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
|
50
|
+
//# sourceMappingURL=runnerSpec.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerSpec.d.cts","names":[],"sources":["../../src/schemas/runnerSpec.ts"],"mappings":";;UAKiB;EACf;EACA;EACA,KAAK;;;UAIU;EACf;EACA,QAAQ,OAAO;;;UAIA;EACf;EACA;EACA;EACA;;;;;;;;;;;;;cAcW;;;;;iBASG,gBAAgB,mBAAmB,aAAa;iBAShD,iBAAiB,gBAAgB,MAAM;iBAIvC,iBAAiB,iBAAiB;iBAgBlC,uBAAuB,OAAO;;iBAW9B,aAAa;;;;;iBASb,kBAAkB,OAAO;iBAIzB,UAAU"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/schemas/runnerSpec.d.ts
|
|
2
|
+
/** What a supervisor needs to run one command. */
|
|
3
|
+
interface CommandSpec {
|
|
4
|
+
command: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
env: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
/** Exit status the supervisor records once its command is gone. */
|
|
9
|
+
interface ExitMetadata {
|
|
10
|
+
code: number | null;
|
|
11
|
+
signal: NodeJS.Signals | null;
|
|
12
|
+
}
|
|
13
|
+
/** Sidecars a supervised run reads and writes beside its log. */
|
|
14
|
+
interface SupervisorPaths {
|
|
15
|
+
spec: string;
|
|
16
|
+
gate: string;
|
|
17
|
+
exit: string;
|
|
18
|
+
logDone: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Settings that make a terminal safe for a caller with no keyboard.
|
|
22
|
+
*
|
|
23
|
+
* Commands run inside an rmux pane, so their stdout is a real tty. Git and
|
|
24
|
+
* friends take that as permission to open a pager, and `less` then waits at
|
|
25
|
+
* `(END)` for a keypress nobody is there to send, so the run hangs until its
|
|
26
|
+
* timeout. The same tty invites credential prompts, which hang the same way.
|
|
27
|
+
* A conventional piped stdout disables both automatically; a pane has to be
|
|
28
|
+
* told. A command that genuinely wants a pager can still ask for one, as in
|
|
29
|
+
* `git -c core.pager=less log`.
|
|
30
|
+
*/
|
|
31
|
+
declare const NO_TERMINAL_INPUT_ENV: {
|
|
32
|
+
GIT_PAGER: string;
|
|
33
|
+
PAGER: string;
|
|
34
|
+
GIT_TERMINAL_PROMPT: string;
|
|
35
|
+
};
|
|
36
|
+
declare function supervisorPaths(directory: string, id: string): SupervisorPaths;
|
|
37
|
+
declare function writeCommandSpec(target: string, spec: CommandSpec): void;
|
|
38
|
+
declare function readExitMetadata(target: string): ExitMetadata | undefined;
|
|
39
|
+
declare function cleanupSupervisorFiles(paths: SupervisorPaths): void;
|
|
40
|
+
/** Resolves a bundled entry point in whichever form the package is running from. */
|
|
41
|
+
declare function runtimeEntry(name: 'runnerHost' | 'logSink'): string;
|
|
42
|
+
/**
|
|
43
|
+
* Replaces the shell rather than nesting under it, so the pid handed back is the
|
|
44
|
+
* supervisor's and a group signal reaches it directly.
|
|
45
|
+
*/
|
|
46
|
+
declare function supervisorCommand(paths: SupervisorPaths): string;
|
|
47
|
+
declare function shellJoin(values: readonly string[]): string;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CommandSpec, ExitMetadata, NO_TERMINAL_INPUT_ENV, SupervisorPaths, cleanupSupervisorFiles, readExitMetadata, runtimeEntry, shellJoin, supervisorCommand, supervisorPaths, writeCommandSpec };
|
|
50
|
+
//# sourceMappingURL=runnerSpec.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerSpec.d.mts","names":[],"sources":["../../src/schemas/runnerSpec.ts"],"mappings":";;UAKiB;EACf;EACA;EACA,KAAK;;;UAIU;EACf;EACA,QAAQ,OAAO;;;UAIA;EACf;EACA;EACA;EACA;;;;;;;;;;;;;cAcW;;;;;iBASG,gBAAgB,mBAAmB,aAAa;iBAShD,iBAAiB,gBAAgB,MAAM;iBAIvC,iBAAiB,iBAAiB;iBAgBlC,uBAAuB,OAAO;;iBAW9B,aAAa;;;;;iBASb,kBAAkB,OAAO;iBAIzB,UAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"node:fs";import t from"node:path";import{fileURLToPath as n}from"node:url";const r={GIT_PAGER:`cat`,PAGER:`cat`,GIT_TERMINAL_PROMPT:`0`},i=`ENOENT`;function a(e,n){return{spec:t.join(e,`${n}.command.json`),gate:t.join(e,`${n}.gate`),exit:t.join(e,`${n}.exit.json`),logDone:t.join(e,`${n}.log.done`)}}function o(t,n){e.writeFileSync(t,`${JSON.stringify(n)}\n`,{mode:384})}function s(t){try{let n=JSON.parse(e.readFileSync(t,`utf8`));if(typeof n!=`object`||!n)return;let r=n;return{code:typeof r.code==`number`?r.code:null,signal:typeof r.signal==`string`?r.signal:null}}catch(e){e.code!==i&&process.emitWarning(`Could not read runner exit metadata ${t}: ${String(e)}`);return}}function c(t){for(let n of Object.values(t))try{e.unlinkSync(n)}catch(e){e.code!==i&&process.emitWarning(String(e))}}function l(e){let t=import.meta.url.endsWith(`.ts`)?`ts`:`mjs`;return n(new URL(`../bin/${e}.${t}`,import.meta.url))}function u(e){return`exec ${d([process.execPath,l(`runnerHost`),e.spec,e.gate,e.exit])}`}function d(e){return e.map(e=>`'${e.replaceAll(`'`,`'"'"'`)}'`).join(` `)}export{r as NO_TERMINAL_INPUT_ENV,c as cleanupSupervisorFiles,s as readExitMetadata,l as runtimeEntry,d as shellJoin,u as supervisorCommand,a as supervisorPaths,o as writeCommandSpec};
|
|
2
|
+
//# sourceMappingURL=runnerSpec.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerSpec.mjs","names":[],"sources":["../../src/schemas/runnerSpec.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/** What a supervisor needs to run one command. */\nexport interface CommandSpec {\n command: string;\n cwd: string;\n env: Record<string, string>;\n}\n\n/** Exit status the supervisor records once its command is gone. */\nexport interface ExitMetadata {\n code: number | null;\n signal: NodeJS.Signals | null;\n}\n\n/** Sidecars a supervised run reads and writes beside its log. */\nexport interface SupervisorPaths {\n spec: string;\n gate: string;\n exit: string;\n logDone: string;\n}\n\n/**\n * Settings that make a terminal safe for a caller with no keyboard.\n *\n * Commands run inside an rmux pane, so their stdout is a real tty. Git and\n * friends take that as permission to open a pager, and `less` then waits at\n * `(END)` for a keypress nobody is there to send, so the run hangs until its\n * timeout. The same tty invites credential prompts, which hang the same way.\n * A conventional piped stdout disables both automatically; a pane has to be\n * told. A command that genuinely wants a pager can still ask for one, as in\n * `git -c core.pager=less log`.\n */\nexport const NO_TERMINAL_INPUT_ENV = {\n GIT_PAGER: 'cat',\n PAGER: 'cat',\n GIT_TERMINAL_PROMPT: '0',\n};\n\nconst SPEC_MODE = 0o600;\nconst NOT_FOUND_ERROR_CODE = 'ENOENT';\n\nexport function supervisorPaths(directory: string, id: string): SupervisorPaths {\n return {\n spec: path.join(directory, `${id}.command.json`),\n gate: path.join(directory, `${id}.gate`),\n exit: path.join(directory, `${id}.exit.json`),\n logDone: path.join(directory, `${id}.log.done`),\n };\n}\n\nexport function writeCommandSpec(target: string, spec: CommandSpec): void {\n fs.writeFileSync(target, `${JSON.stringify(spec)}\\n`, { mode: SPEC_MODE });\n}\n\nexport function readExitMetadata(target: string): ExitMetadata | undefined {\n try {\n const value: unknown = JSON.parse(fs.readFileSync(target, 'utf8'));\n if (typeof value !== 'object' || value === null) return undefined;\n const metadata = value as Partial<ExitMetadata>;\n const code = typeof metadata.code === 'number' ? metadata.code : null;\n const signal = typeof metadata.signal === 'string' ? (metadata.signal as NodeJS.Signals) : null;\n return { code, signal };\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n process.emitWarning(`Could not read runner exit metadata ${target}: ${String(error)}`);\n }\n return undefined;\n }\n}\n\nexport function cleanupSupervisorFiles(paths: SupervisorPaths): void {\n for (const target of Object.values(paths)) {\n try {\n fs.unlinkSync(target);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) process.emitWarning(String(error));\n }\n }\n}\n\n/** Resolves a bundled entry point in whichever form the package is running from. */\nexport function runtimeEntry(name: 'runnerHost' | 'logSink'): string {\n const extension = import.meta.url.endsWith('.ts') ? 'ts' : 'mjs';\n return fileURLToPath(new URL(`../bin/${name}.${extension}`, import.meta.url));\n}\n\n/**\n * Replaces the shell rather than nesting under it, so the pid handed back is the\n * supervisor's and a group signal reaches it directly.\n */\nexport function supervisorCommand(paths: SupervisorPaths): string {\n return `exec ${shellJoin([process.execPath, runtimeEntry('runnerHost'), paths.spec, paths.gate, paths.exit])}`;\n}\n\nexport function shellJoin(values: readonly string[]): string {\n return values.map((value) => `'${value.replaceAll(\"'\", `'\"'\"'`)}'`).join(' ');\n}\n"],"mappings":"yFAoCA,MAAa,EAAwB,CACnC,UAAW,MACX,MAAO,MACP,oBAAqB,GACvB,EAGM,EAAuB,SAE7B,SAAgB,EAAgB,EAAmB,EAA6B,CAC9E,MAAO,CACL,KAAM,EAAK,KAAK,EAAW,GAAG,EAAG,cAAc,EAC/C,KAAM,EAAK,KAAK,EAAW,GAAG,EAAG,MAAM,EACvC,KAAM,EAAK,KAAK,EAAW,GAAG,EAAG,WAAW,EAC5C,QAAS,EAAK,KAAK,EAAW,GAAG,EAAG,UAAU,CAChD,CACF,CAEA,SAAgB,EAAiB,EAAgB,EAAyB,CACxE,EAAG,cAAc,EAAQ,GAAG,KAAK,UAAU,CAAI,EAAE,IAAK,CAAE,KAAM,GAAU,CAAC,CAC3E,CAEA,SAAgB,EAAiB,EAA0C,CACzE,GAAI,CACF,IAAM,EAAiB,KAAK,MAAM,EAAG,aAAa,EAAQ,MAAM,CAAC,EACjE,GAAI,OAAO,GAAU,WAAY,EAAgB,OACjD,IAAM,EAAW,EAGjB,MAAO,CAAE,KAFI,OAAO,EAAS,MAAS,SAAW,EAAS,KAAO,KAElD,OADA,OAAO,EAAS,QAAW,SAAY,EAAS,OAA4B,IACrE,CACxB,OAAS,EAAO,CACT,EAAgC,OAAS,GAC5C,QAAQ,YAAY,uCAAuC,EAAO,IAAI,OAAO,CAAK,GAAG,EAEvF,MACF,CACF,CAEA,SAAgB,EAAuB,EAA8B,CACnE,IAAK,IAAM,KAAU,OAAO,OAAO,CAAK,EACtC,GAAI,CACF,EAAG,WAAW,CAAM,CACtB,OAAS,EAAO,CACT,EAAgC,OAAS,GAAsB,QAAQ,YAAY,OAAO,CAAK,CAAC,CACvG,CAEJ,CAGA,SAAgB,EAAa,EAAwC,CACnE,IAAM,EAAY,YAAY,IAAI,SAAS,KAAK,EAAI,KAAO,MAC3D,OAAO,EAAc,IAAI,IAAI,UAAU,EAAK,GAAG,IAAa,YAAY,GAAG,CAAC,CAC9E,CAMA,SAAgB,EAAkB,EAAgC,CAChE,MAAO,QAAQ,EAAU,CAAC,QAAQ,SAAU,EAAa,YAAY,EAAG,EAAM,KAAM,EAAM,KAAM,EAAM,IAAI,CAAC,GAC7G,CAEA,SAAgB,EAAU,EAAmC,CAC3D,OAAO,EAAO,IAAK,GAAU,IAAI,EAAM,WAAW,IAAK,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAC9E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`),t
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`),t=/[\u0007\u0008]/g,n=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-ln-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`);function r(n){return n.replace(e,``).replace(t,``)}function i(e){return e.replace(n,``).replace(t,``)}function a(e){return e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`).map(e=>e.includes(`\r`)?e.split(`\r`).at(-1)??``:e).join(`
|
|
4
4
|
`)}function o(e){return a(i(e))}function s(e){return a(r(e))}exports.collapseCarriageReturns=a,exports.scrubTerminalOutput=o,exports.scrubTerminalOutputToPlainText=s,exports.stripAnsi=r,exports.stripAnsiKeepingColour=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ansiScrub.cjs","names":[],"sources":["../../../src/services/AnsiScrub/ansiScrub.ts"],"sourcesContent":["/**\n * Turns terminal output into text worth grepping.\n *\n * PTY output is written for a screen, not a file: colours, cursor moves and\n * carriage-return redraws all end up in the byte stream. Without this a single\n * progress bar becomes thousands of near-identical log lines.\n */\n\n/**\n * CSI sequences (colours, cursor moves), OSC strings, the two-byte Fe escapes,\n * and the keypad-mode escapes shells emit around every prompt.\n */\nconst ANSI_PATTERN = new RegExp(\n [\n '\\\\u001B\\\\[[0-9;?]*[ -/]*[@-~]',\n '\\\\u001B\\\\][^\\\\u0007\\\\u001B]*(?:\\\\u0007|\\\\u001B\\\\\\\\)',\n '\\\\u001B[@-Z\\\\\\\\-_]',\n '\\\\u001B[=><]',\n ].join('|'),\n 'g',\n);\n\n/** Bell and backspace, which a terminal consumes rather than displays. */\n// oxlint-disable-next-line no-control-regex -- matching terminal control bytes is the whole job\nconst CONTROL_PATTERN =
|
|
1
|
+
{"version":3,"file":"ansiScrub.cjs","names":[],"sources":["../../../src/services/AnsiScrub/ansiScrub.ts"],"sourcesContent":["/**\n * Turns terminal output into text worth grepping.\n *\n * PTY output is written for a screen, not a file: colours, cursor moves and\n * carriage-return redraws all end up in the byte stream. Without this a single\n * progress bar becomes thousands of near-identical log lines.\n */\n\n/**\n * CSI sequences (colours, cursor moves), OSC strings, the two-byte Fe escapes,\n * and the keypad-mode escapes shells emit around every prompt.\n */\nconst ANSI_PATTERN = new RegExp(\n [\n '\\\\u001B\\\\[[0-9;?]*[ -/]*[@-~]',\n '\\\\u001B\\\\][^\\\\u0007\\\\u001B]*(?:\\\\u0007|\\\\u001B\\\\\\\\)',\n '\\\\u001B[@-Z\\\\\\\\-_]',\n '\\\\u001B[=><]',\n ].join('|'),\n 'g',\n);\n\n/** Bell and backspace, which a terminal consumes rather than displays. */\n// oxlint-disable-next-line no-control-regex -- matching terminal control bytes is the whole job\nconst CONTROL_PATTERN = /[\\u0007\\u0008]/g;\n\n/**\n * The same set minus SGR, the sequence that only sets colour and weight.\n *\n * The final byte class omits `m`, so `ESC[32m` survives while cursor moves,\n * OSC strings and keypad escapes are still removed.\n */\nconst ANSI_PATTERN_KEEPING_COLOUR = new RegExp(\n [\n '\\\\u001B\\\\[[0-9;?]*[ -/]*[@-ln-~]',\n '\\\\u001B\\\\][^\\\\u0007\\\\u001B]*(?:\\\\u0007|\\\\u001B\\\\\\\\)',\n '\\\\u001B[@-Z\\\\\\\\-_]',\n '\\\\u001B[=><]',\n ].join('|'),\n 'g',\n);\n\n/** Removes escape sequences, leaving the characters a user would have seen. */\nexport function stripAnsi(text: string): string {\n return text.replace(ANSI_PATTERN, '').replace(CONTROL_PATTERN, '');\n}\n\n/**\n * Removes everything `stripAnsi` does except colour.\n *\n * Logs are read back by a terminal renderer as well as by grep, and a command\n * that colours its own output has already said how it should look.\n */\nexport function stripAnsiKeepingColour(text: string): string {\n return text.replace(ANSI_PATTERN_KEEPING_COLOUR, '').replace(CONTROL_PATTERN, '');\n}\n\n/**\n * Collapses carriage-return redraws.\n *\n * A bare `\\r` returns the cursor to the start of the current line, so whatever\n * follows overwrites it. Only the final state of each line is kept. The `\\r` of\n * a CRLF pair is a line terminator rather than a redraw, so it is normalised\n * away first: a pseudo terminal ends every line that way, and treating it as a\n * redraw would blank the whole log.\n */\nexport function collapseCarriageReturns(text: string): string {\n return text\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n .map((line) => (line.includes('\\r') ? (line.split('\\r').at(-1) ?? '') : line))\n .join('\\n');\n}\n\n/** Full scrub applied to PTY output before it reaches the log file. */\nexport function scrubTerminalOutput(text: string): string {\n return collapseCarriageReturns(stripAnsiKeepingColour(text));\n}\n\n/** Plain-text scrub, for the copy the model reads. */\nexport function scrubTerminalOutputToPlainText(text: string): string {\n return collapseCarriageReturns(stripAnsi(text));\n}\n"],"mappings":"mEAYA,MAAM,EAAe,IAAI,OACvB,CACE,gCACA,sDACA,qBACA,cACF,CAAC,CAAC,KAAK,GAAG,EACV,GACF,EAIM,EAAkB,kBAQlB,EAA8B,IAAI,OACtC,CACE,mCACA,sDACA,qBACA,cACF,CAAC,CAAC,KAAK,GAAG,EACV,GACF,EAGA,SAAgB,EAAU,EAAsB,CAC9C,OAAO,EAAK,QAAQ,EAAc,EAAE,CAAC,CAAC,QAAQ,EAAiB,EAAE,CACnE,CAQA,SAAgB,EAAuB,EAAsB,CAC3D,OAAO,EAAK,QAAQ,EAA6B,EAAE,CAAC,CAAC,QAAQ,EAAiB,EAAE,CAClF,CAWA,SAAgB,EAAwB,EAAsB,CAC5D,OAAO,EACJ,QAAQ,QAAS;CAAI,CAAC,CACtB,MAAM;CAAI,CAAC,CACX,IAAK,GAAU,EAAK,SAAS,IAAI,EAAK,EAAK,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,GAAK,GAAM,CAAK,CAAC,CAC7E,KAAK;CAAI,CACd,CAGA,SAAgB,EAAoB,EAAsB,CACxD,OAAO,EAAwB,EAAuB,CAAI,CAAC,CAC7D,CAGA,SAAgB,EAA+B,EAAsB,CACnE,OAAO,EAAwB,EAAU,CAAI,CAAC,CAChD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`),t
|
|
1
|
+
const e=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`),t=/[\u0007\u0008]/g,n=new RegExp([`\\u001B\\[[0-9;?]*[ -/]*[@-ln-~]`,`\\u001B\\][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)`,`\\u001B[@-Z\\\\-_]`,`\\u001B[=><]`].join(`|`),`g`);function r(n){return n.replace(e,``).replace(t,``)}function i(e){return e.replace(n,``).replace(t,``)}function a(e){return e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`).map(e=>e.includes(`\r`)?e.split(`\r`).at(-1)??``:e).join(`
|
|
4
4
|
`)}function o(e){return a(i(e))}function s(e){return a(r(e))}export{a as collapseCarriageReturns,o as scrubTerminalOutput,s as scrubTerminalOutputToPlainText,r as stripAnsi,i as stripAnsiKeepingColour};
|