@tickernelz/wardmote-adapter-utils 2026.1108.2 → 2026.1111.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/README.md +1 -1
- package/dist/acpx-engine/composed-run-characterization.test.js +13 -16
- package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -1
- package/dist/acpx-engine/ephemeral-session-environment.test.js +6 -6
- package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -1
- package/dist/acpx-engine/execute-identity.test.js +12 -12
- package/dist/acpx-engine/execute-identity.test.js.map +1 -1
- package/dist/acpx-engine/execute.d.ts +2 -28
- package/dist/acpx-engine/execute.d.ts.map +1 -1
- package/dist/acpx-engine/execute.js +162 -224
- package/dist/acpx-engine/execute.js.map +1 -1
- package/dist/acpx-engine/execute.test.js +234 -250
- package/dist/acpx-engine/execute.test.js.map +1 -1
- package/dist/acpx-engine/filesystem-protocol.test.js +2 -2
- package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -1
- package/dist/acpx-engine/managed-codex-skills-manifest.d.ts +3 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.d.ts.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.js +30 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.js.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts +2 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.js +29 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.js.map +1 -0
- package/dist/acpx-engine/operator-stop.test.js +3 -3
- package/dist/acpx-engine/operator-stop.test.js.map +1 -1
- package/dist/acpx-engine/remote-spawn-smoke.test.js +5 -5
- package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/run-contracts.d.ts +5 -15
- package/dist/acpx-engine/run-contracts.d.ts.map +1 -1
- package/dist/acpx-engine/run-contracts.js.map +1 -1
- package/dist/acpx-engine/run-fault-matrix.test.js +7 -7
- package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.d.ts +5 -12
- package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.js +4 -16
- package/dist/acpx-engine/run-site-sandbox.js.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.test.js +13 -16
- package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -1
- package/dist/acpx-engine/settlement-characterization.test.js +20 -20
- package/dist/acpx-engine/settlement-characterization.test.js.map +1 -1
- package/dist/acpx-engine/spawn-smoke.test.js +12 -12
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/startup-characterization.test.js +27 -31
- package/dist/acpx-engine/startup-characterization.test.js.map +1 -1
- package/dist/acpx-engine/startup-timing.d.ts +27 -45
- package/dist/acpx-engine/startup-timing.d.ts.map +1 -1
- package/dist/acpx-engine/startup-timing.js +1 -19
- package/dist/acpx-engine/startup-timing.js.map +1 -1
- package/dist/acpx-engine/startup-timing.test.js +2 -2
- package/dist/acpx-engine/startup-timing.test.js.map +1 -1
- package/dist/acpx-engine/terminal-session-failure.js +1 -1
- package/dist/acpx-engine/terminal-session-failure.js.map +1 -1
- package/dist/acpx-engine/turn-characterization.test.js +3 -3
- package/dist/acpx-engine/turn-characterization.test.js.map +1 -1
- package/dist/acpx-engine/turn-sequence.js +1 -1
- package/dist/acpx-engine/turn-sequence.js.map +1 -1
- package/dist/chat-file-delivery.d.ts +2 -2
- package/dist/chat-file-delivery.d.ts.map +1 -1
- package/dist/chat-file-delivery.js +4 -4
- package/dist/chat-file-delivery.js.map +1 -1
- package/dist/chat-file-delivery.test.js +9 -9
- package/dist/chat-file-delivery.test.js.map +1 -1
- package/dist/command-managed-runtime.js +5 -5
- package/dist/command-managed-runtime.js.map +1 -1
- package/dist/command-managed-runtime.test.js +38 -40
- package/dist/command-managed-runtime.test.js.map +1 -1
- package/dist/directory-merge-lock.test.js +3 -3
- package/dist/directory-merge-lock.test.js.map +1 -1
- package/dist/execution-target-sandbox.test.js +361 -369
- package/dist/execution-target-sandbox.test.js.map +1 -1
- package/dist/execution-target-stdin-race.test.js +80 -90
- package/dist/execution-target-stdin-race.test.js.map +1 -1
- package/dist/execution-target.d.ts +6 -36
- package/dist/execution-target.d.ts.map +1 -1
- package/dist/execution-target.js +92 -144
- package/dist/execution-target.js.map +1 -1
- package/dist/execution-target.test.js +3 -3
- package/dist/execution-target.test.js.map +1 -1
- package/dist/forbidden-config-env.test.d.ts +2 -0
- package/dist/forbidden-config-env.test.d.ts.map +1 -0
- package/dist/forbidden-config-env.test.js +35 -0
- package/dist/forbidden-config-env.test.js.map +1 -0
- package/dist/git-workspace-sync.d.ts +2 -2
- package/dist/git-workspace-sync.d.ts.map +1 -1
- package/dist/git-workspace-sync.js +8 -8
- package/dist/git-workspace-sync.js.map +1 -1
- package/dist/git-workspace-sync.test.js +61 -61
- package/dist/git-workspace-sync.test.js.map +1 -1
- package/dist/github-launcher-environment.test.js +36 -36
- package/dist/github-launcher-environment.test.js.map +1 -1
- package/dist/github-launcher.js +16 -16
- package/dist/github-launcher.js.map +1 -1
- package/dist/github-launcher.test.js +5 -5
- package/dist/github-launcher.test.js.map +1 -1
- package/dist/http2-bridge-server.test.js +1 -1
- package/dist/http2-bridge-server.test.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/local-process-sandbox.js +7 -7
- package/dist/local-process-sandbox.js.map +1 -1
- package/dist/local-process-sandbox.test.js +24 -24
- package/dist/local-process-sandbox.test.js.map +1 -1
- package/dist/mcp-isolation.integration.test.js +4 -4
- package/dist/mcp-isolation.integration.test.js.map +1 -1
- package/dist/prompt-sections.test.js +11 -11
- package/dist/prompt-sections.test.js.map +1 -1
- package/dist/provider-models/claude.d.ts +0 -1
- package/dist/provider-models/claude.d.ts.map +1 -1
- package/dist/provider-models/claude.js +0 -1
- package/dist/provider-models/claude.js.map +1 -1
- package/dist/provider-models/codex.d.ts.map +1 -1
- package/dist/provider-models/codex.js +2 -2
- package/dist/provider-models/codex.js.map +1 -1
- package/dist/remote-managed-runtime.js +6 -6
- package/dist/remote-managed-runtime.js.map +1 -1
- package/dist/remote-managed-runtime.test.js +14 -14
- package/dist/remote-managed-runtime.test.js.map +1 -1
- package/dist/retired-marker-names.d.ts +2 -0
- package/dist/retired-marker-names.d.ts.map +1 -0
- package/dist/retired-marker-names.js +2 -0
- package/dist/retired-marker-names.js.map +1 -0
- package/dist/retired-skill-names.d.ts +3 -0
- package/dist/retired-skill-names.d.ts.map +1 -0
- package/dist/retired-skill-names.js +8 -0
- package/dist/retired-skill-names.js.map +1 -0
- package/dist/run-oom-score.d.ts +1 -1
- package/dist/run-oom-score.d.ts.map +1 -1
- package/dist/run-oom-score.js +1 -1
- package/dist/run-oom-score.js.map +1 -1
- package/dist/runner-connectivity.d.ts +7 -7
- package/dist/runner-connectivity.d.ts.map +1 -1
- package/dist/runner-connectivity.js +16 -16
- package/dist/runner-connectivity.js.map +1 -1
- package/dist/runner-connectivity.test.js +21 -21
- package/dist/runner-connectivity.test.js.map +1 -1
- package/dist/runtime-progress.d.ts.map +1 -1
- package/dist/runtime-progress.js +1 -4
- package/dist/runtime-progress.js.map +1 -1
- package/dist/runtime-progress.test.js +13 -13
- package/dist/runtime-progress.test.js.map +1 -1
- package/dist/sandbox-callback-bridge.d.ts +1 -16
- package/dist/sandbox-callback-bridge.d.ts.map +1 -1
- package/dist/sandbox-callback-bridge.js +55 -88
- package/dist/sandbox-callback-bridge.js.map +1 -1
- package/dist/sandbox-callback-bridge.test.js +94 -115
- package/dist/sandbox-callback-bridge.test.js.map +1 -1
- package/dist/sandbox-file-sync.test.js +9 -9
- package/dist/sandbox-file-sync.test.js.map +1 -1
- package/dist/sandbox-install-command.js +4 -4
- package/dist/sandbox-install-command.js.map +1 -1
- package/dist/sandbox-managed-runtime.d.ts +0 -30
- package/dist/sandbox-managed-runtime.d.ts.map +1 -1
- package/dist/sandbox-managed-runtime.js +12 -34
- package/dist/sandbox-managed-runtime.js.map +1 -1
- package/dist/sandbox-managed-runtime.test.js +134 -144
- package/dist/sandbox-managed-runtime.test.js.map +1 -1
- package/dist/sandbox-run-log-stream.js +5 -5
- package/dist/sandbox-run-log-stream.js.map +1 -1
- package/dist/server-utils-env.test.js +10 -9
- package/dist/server-utils-env.test.js.map +1 -1
- package/dist/server-utils.d.ts +121 -147
- package/dist/server-utils.d.ts.map +1 -1
- package/dist/server-utils.js +319 -346
- package/dist/server-utils.js.map +1 -1
- package/dist/server-utils.test.js +339 -322
- package/dist/server-utils.test.js.map +1 -1
- package/dist/skill-library-manifest.d.ts +2 -2
- package/dist/skill-library-manifest.d.ts.map +1 -1
- package/dist/skill-library-manifest.test.js +4 -4
- package/dist/skill-library-manifest.test.js.map +1 -1
- package/dist/ssh-fixture.test.js +57 -57
- package/dist/ssh-fixture.test.js.map +1 -1
- package/dist/ssh.d.ts.map +1 -1
- package/dist/ssh.js +18 -40
- package/dist/ssh.js.map +1 -1
- package/dist/test-fixtures/prompt-context.d.ts +5 -5
- package/dist/test-fixtures/prompt-context.js +5 -5
- package/dist/test-fixtures/prompt-context.js.map +1 -1
- package/dist/test-support/mcp-isolation-harness.js +1 -1
- package/dist/test-support/mcp-isolation-harness.js.map +1 -1
- package/dist/tool-profile.d.ts +1 -1
- package/dist/tool-profile.d.ts.map +1 -1
- package/dist/tool-profile.js +1 -1
- package/dist/tool-profile.js.map +1 -1
- package/dist/types.d.ts +13 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/{paperclip-mcp-mount.d.ts → wardmote-mcp-mount.d.ts} +10 -10
- package/dist/wardmote-mcp-mount.d.ts.map +1 -0
- package/dist/{paperclip-mcp-mount.js → wardmote-mcp-mount.js} +17 -17
- package/dist/wardmote-mcp-mount.js.map +1 -0
- package/dist/wardmote-mcp.d.ts +51 -0
- package/dist/wardmote-mcp.d.ts.map +1 -0
- package/dist/wardmote-mcp.js +148 -0
- package/dist/wardmote-mcp.js.map +1 -0
- package/dist/wardmote-mcp.test.d.ts +2 -0
- package/dist/wardmote-mcp.test.d.ts.map +1 -0
- package/dist/wardmote-mcp.test.js +133 -0
- package/dist/wardmote-mcp.test.js.map +1 -0
- package/dist/{paperclip-runner-permissions.d.ts → wardmote-runner-permissions.d.ts} +31 -36
- package/dist/wardmote-runner-permissions.d.ts.map +1 -0
- package/dist/{paperclip-runner-permissions.js → wardmote-runner-permissions.js} +30 -35
- package/dist/wardmote-runner-permissions.js.map +1 -0
- package/dist/wardmote-runner-permissions.test.d.ts +2 -0
- package/dist/wardmote-runner-permissions.test.d.ts.map +1 -0
- package/dist/wardmote-runner-permissions.test.js +80 -0
- package/dist/wardmote-runner-permissions.test.js.map +1 -0
- package/dist/workspace-git-stream.test.js +1 -1
- package/dist/workspace-git-stream.test.js.map +1 -1
- package/dist/workspace-manifest.js +1 -1
- package/dist/workspace-manifest.js.map +1 -1
- package/dist/workspace-manifest.test.js +5 -5
- package/dist/workspace-manifest.test.js.map +1 -1
- package/dist/workspace-restore-diagnostics.js +1 -1
- package/dist/workspace-restore-diagnostics.js.map +1 -1
- package/dist/workspace-restore-diagnostics.test.js +5 -5
- package/dist/workspace-restore-diagnostics.test.js.map +1 -1
- package/dist/workspace-restore-merge.js +8 -8
- package/dist/workspace-restore-merge.js.map +1 -1
- package/dist/workspace-restore-merge.test.js +76 -82
- package/dist/workspace-restore-merge.test.js.map +1 -1
- package/dist/workspace-restore-result.test.js +2 -2
- package/dist/workspace-restore-result.test.js.map +1 -1
- package/dist/workspace-restore-teardown.test.js +6 -6
- package/dist/workspace-restore-teardown.test.js.map +1 -1
- package/node_modules/@clack/core/dist/index.d.mts +5 -3
- package/node_modules/@clack/core/dist/index.mjs +70 -67
- package/node_modules/@clack/core/package.json +3 -2
- package/node_modules/@clack/prompts/dist/index.d.mts +5 -4
- package/node_modules/@clack/prompts/dist/index.mjs +212 -187
- package/node_modules/@clack/prompts/package.json +3 -3
- package/node_modules/sisteransi/dist/index.d.ts +33 -0
- package/node_modules/sisteransi/dist/index.js +57 -0
- package/node_modules/sisteransi/package.json +18 -7
- package/node_modules/sisteransi/readme.md +19 -6
- package/package.json +2 -2
- package/dist/env-aliases-run.test.d.ts +0 -2
- package/dist/env-aliases-run.test.d.ts.map +0 -1
- package/dist/env-aliases-run.test.js +0 -49
- package/dist/env-aliases-run.test.js.map +0 -1
- package/dist/paperclip-mcp-mount.d.ts.map +0 -1
- package/dist/paperclip-mcp-mount.js.map +0 -1
- package/dist/paperclip-mcp.d.ts +0 -53
- package/dist/paperclip-mcp.d.ts.map +0 -1
- package/dist/paperclip-mcp.js +0 -149
- package/dist/paperclip-mcp.js.map +0 -1
- package/dist/paperclip-mcp.test.d.ts +0 -2
- package/dist/paperclip-mcp.test.d.ts.map +0 -1
- package/dist/paperclip-mcp.test.js +0 -133
- package/dist/paperclip-mcp.test.js.map +0 -1
- package/dist/paperclip-runner-permissions.d.ts.map +0 -1
- package/dist/paperclip-runner-permissions.js.map +0 -1
- package/dist/paperclip-runner-permissions.test.d.ts +0 -2
- package/dist/paperclip-runner-permissions.test.d.ts.map +0 -1
- package/dist/paperclip-runner-permissions.test.js +0 -80
- package/dist/paperclip-runner-permissions.test.js.map +0 -1
- package/node_modules/sisteransi/src/index.js +0 -58
- package/node_modules/sisteransi/src/sisteransi.d.ts +0 -35
package/dist/execution-target.js
CHANGED
|
@@ -18,7 +18,6 @@ import { createDuplexObservability, mapHttp2EventToDuplexLossReason, } from "./d
|
|
|
18
18
|
import { createSshCommandManagedRuntimeRunner, parseSshRemoteExecutionSpec, runSshCommand, shellQuote } from "./ssh.js";
|
|
19
19
|
import { ensureCommandResolvable, resolveCommandForLogs, runChildProcess, } from "./server-utils.js";
|
|
20
20
|
import { sanitizeRemoteExecutionEnv } from "./remote-execution-env.js";
|
|
21
|
-
import { withWardmoteEnvAliases } from "@tickernelz/wardmote-shared/env-aliases";
|
|
22
21
|
import { preferredShellForSandbox, shellCommandArgs } from "./sandbox-shell.js";
|
|
23
22
|
import { runWithRuntimeParent, } from "./acpx-engine/startup-timing.js";
|
|
24
23
|
export function postedIssueCommentLogMarker(method, requestPath, status, body) {
|
|
@@ -85,14 +84,13 @@ function resolveHostForUrl(rawHost) {
|
|
|
85
84
|
return `[${host}]`;
|
|
86
85
|
return host;
|
|
87
86
|
}
|
|
88
|
-
function
|
|
89
|
-
const runtimeHost = resolveHostForUrl(process.env.
|
|
90
|
-
|
|
91
|
-
const runtimePort = process.env.PAPERCLIP_LISTEN_PORT ?? process.env.PORT ?? "3100";
|
|
87
|
+
function resolveDefaultWardmoteApiUrl() {
|
|
88
|
+
const runtimeHost = resolveHostForUrl(process.env.WARDMOTE_LISTEN_HOST ?? process.env.HOST ?? "localhost");
|
|
89
|
+
const runtimePort = process.env.WARDMOTE_LISTEN_PORT ?? process.env.PORT ?? "3100";
|
|
92
90
|
return `http://${runtimeHost}:${runtimePort}`;
|
|
93
91
|
}
|
|
94
92
|
function isBridgeDebugEnabled(env) {
|
|
95
|
-
const value = env.
|
|
93
|
+
const value = env.WARDMOTE_BRIDGE_DEBUG?.trim().toLowerCase();
|
|
96
94
|
return value === "1" || value === "true" || value === "yes";
|
|
97
95
|
}
|
|
98
96
|
function isAdapterExecutionTargetInstance(value) {
|
|
@@ -173,7 +171,7 @@ export function resolveAdapterExecutionTargetCwd(target, configuredCwd, localFal
|
|
|
173
171
|
}
|
|
174
172
|
return adapterExecutionTargetRemoteCwd(target, localFallbackCwd);
|
|
175
173
|
}
|
|
176
|
-
export function
|
|
174
|
+
export function adapterExecutionTargetUsesWardmoteBridge(target) {
|
|
177
175
|
return target?.kind === "remote";
|
|
178
176
|
}
|
|
179
177
|
export function describeAdapterExecutionTarget(target) {
|
|
@@ -234,10 +232,6 @@ export function formatAdapterExecutionTimeoutErrorMessage(resolution) {
|
|
|
234
232
|
`(timeoutSec=${resolution.timeoutSec}, ${describeAdapterExecutionTimeoutSource(resolution.source)}). ` +
|
|
235
233
|
`Set adapterConfig.timeoutSec to raise it.`);
|
|
236
234
|
}
|
|
237
|
-
/**
|
|
238
|
-
* One-line start-of-run statement of the effective wall-clock timeout and its
|
|
239
|
-
* source. Callers prefix with `[paperclip] ` and append a newline.
|
|
240
|
-
*/
|
|
241
235
|
export function formatAdapterExecutionTimeoutStartLogLine(resolution) {
|
|
242
236
|
if (resolution.timeoutSec <= 0) {
|
|
243
237
|
if (resolution.source === "configured") {
|
|
@@ -386,7 +380,7 @@ function applyRunDispositionSeam(result, settleRunDisposition) {
|
|
|
386
380
|
if (!disposition.failed)
|
|
387
381
|
return result;
|
|
388
382
|
const lossReason = disposition.lossReason ?? "other";
|
|
389
|
-
const note = `[
|
|
383
|
+
const note = `[wardmote] The sandbox duplex control channel was lost (${lossReason}) before the run completed.\n`;
|
|
390
384
|
const separator = result.stderr.length > 0 && !result.stderr.endsWith("\n") ? "\n" : "";
|
|
391
385
|
return {
|
|
392
386
|
...result,
|
|
@@ -398,7 +392,7 @@ function applyRunDispositionSeam(result, settleRunDisposition) {
|
|
|
398
392
|
export async function runAdapterExecutionTargetProcess(runId, target, command, args, options) {
|
|
399
393
|
if (target?.kind === "remote" && target.transport === "sandbox") {
|
|
400
394
|
const runner = requireSandboxRunner(target);
|
|
401
|
-
const env =
|
|
395
|
+
const env = sanitizeRemoteExecutionEnv(options.env);
|
|
402
396
|
await options.onRuntimeProgress?.({
|
|
403
397
|
phase: "adapter_startup",
|
|
404
398
|
message: "Starting adapter in environment",
|
|
@@ -683,7 +677,7 @@ export async function ensureAdapterExecutionTargetRuntimeCommandInstalled(input)
|
|
|
683
677
|
if (!recheck.timedOut && recheck.exitCode === 0) {
|
|
684
678
|
if (input.onLog) {
|
|
685
679
|
const reason = result.timedOut ? "timed out" : `exited ${result.exitCode ?? "?"}`;
|
|
686
|
-
await input.onLog("stderr", `[
|
|
680
|
+
await input.onLog("stderr", `[wardmote] Install command ${reason} (${installCommand}) but ${detectCommand} is on PATH; continuing.\n`);
|
|
687
681
|
}
|
|
688
682
|
return;
|
|
689
683
|
}
|
|
@@ -696,16 +690,6 @@ export async function ensureAdapterExecutionTargetRuntimeCommandInstalled(input)
|
|
|
696
690
|
export async function ensureAdapterExecutionTargetFile(runId, target, filePath, options) {
|
|
697
691
|
await runAdapterExecutionTargetShellCommand(runId, target, `mkdir -p ${shellQuote(path.posix.dirname(filePath))} && : > ${shellQuote(filePath)}`, options);
|
|
698
692
|
}
|
|
699
|
-
/**
|
|
700
|
-
* Ensure a working directory exists (and is a directory) on the execution target.
|
|
701
|
-
*
|
|
702
|
-
* For local targets this delegates to the local `ensureAbsoluteDirectory` helper
|
|
703
|
-
* (Node fs). For remote (SSH/sandbox) targets it shells out and runs
|
|
704
|
-
* `mkdir -p` (when allowed) followed by a `[ -d ]` check so the result reflects
|
|
705
|
-
* the directory state inside the environment, not on the Paperclip host.
|
|
706
|
-
*
|
|
707
|
-
* Throws an Error with a human-readable message on failure.
|
|
708
|
-
*/
|
|
709
693
|
export async function ensureAdapterExecutionTargetDirectory(runId, target, cwd, options) {
|
|
710
694
|
const createIfMissing = options.createIfMissing ?? false;
|
|
711
695
|
if (!target || target.kind === "local") {
|
|
@@ -918,7 +902,7 @@ export async function prepareAdapterExecutionTargetRuntime(input) {
|
|
|
918
902
|
};
|
|
919
903
|
}
|
|
920
904
|
export function runtimeAssetDir(prepared, key, fallbackRemoteCwd) {
|
|
921
|
-
return prepared.assetDirs[key] ?? path.posix.join(fallbackRemoteCwd, ".
|
|
905
|
+
return prepared.assetDirs[key] ?? path.posix.join(fallbackRemoteCwd, ".wardmote-runtime", key);
|
|
922
906
|
}
|
|
923
907
|
/** Keep sandbox housekeeping within the producer-owned Runner runtime. */
|
|
924
908
|
export function githubOperationLauncherDirectory(input) {
|
|
@@ -926,8 +910,8 @@ export function githubOperationLauncherDirectory(input) {
|
|
|
926
910
|
if (!/^[a-zA-Z0-9_-]+$/.test(input.runId))
|
|
927
911
|
throw new Error("Invalid GitHub launcher run ID");
|
|
928
912
|
return input.target?.kind === "remote"
|
|
929
|
-
? path.posix.join(input.target.remoteCwd, ".
|
|
930
|
-
: path.join(os.tmpdir(), "
|
|
913
|
+
? path.posix.join(input.target.remoteCwd, ".wardmote-runtime", ...(input.target.transport === "sandbox" ? ["paperclip-runner"] : []), "github", input.runId)
|
|
914
|
+
: path.join(os.tmpdir(), "wardmote-github-runtime", input.runId);
|
|
931
915
|
}
|
|
932
916
|
/** Call only after execution settles, before releasing its remote environment lease. */
|
|
933
917
|
export async function cleanupGitHubOperationLaunchers(input) {
|
|
@@ -973,18 +957,18 @@ const fs = require('node:fs');
|
|
|
973
957
|
const path = require('node:path');
|
|
974
958
|
const cp = require('node:child_process');
|
|
975
959
|
const env = {};
|
|
976
|
-
env.
|
|
960
|
+
env.WARDMOTE_RUNNER_NETWORK_ROOTS = JSON.stringify(['/etc/resolv.conf','/etc/hosts','/etc/nsswitch.conf','/etc/ssl/certs','/etc/ssl/cert.pem'].flatMap(p => { try { return [fs.realpathSync(p)]; } catch { return []; } }));
|
|
977
961
|
if (process.argv[1] === 'host') {
|
|
978
962
|
for (const [key, value] of Object.entries(process.env)) {
|
|
979
|
-
if (/^(GH_TOKEN|GITHUB_TOKEN|GH_ENTERPRISE_TOKEN|GITHUB_ENTERPRISE_TOKEN|
|
|
963
|
+
if (/^(GH_TOKEN|GITHUB_TOKEN|GH_ENTERPRISE_TOKEN|GITHUB_ENTERPRISE_TOKEN|WARDMOTE_GIT_TOKEN|GH_CONFIG_DIR|GIT_CONFIG_(GLOBAL|SYSTEM|NOSYSTEM|COUNT|KEY_\d+|VALUE_\d+)|GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL)|GIT_ASKPASS|SSH_ASKPASS|SSH_AUTH_SOCK|GIT_SSH_COMMAND|GIT_SSH)$/.test(key)) env[key] = value;
|
|
980
964
|
}
|
|
981
|
-
env.
|
|
965
|
+
env.WARDMOTE_GITHUB_HOST_HOME = process.env.HOME || '';
|
|
982
966
|
env.GH_CONFIG_DIR ||= path.join(process.env.XDG_CONFIG_HOME || path.join(process.env.HOME || '', '.config'), 'gh');
|
|
983
967
|
}
|
|
984
968
|
try {
|
|
985
969
|
const top = cp.execFileSync('git', ['rev-parse', '--show-toplevel'], {encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim();
|
|
986
970
|
if (fs.realpathSync(top) === fs.realpathSync(process.cwd())) {
|
|
987
|
-
env.
|
|
971
|
+
env.WARDMOTE_GIT_METADATA_ROOTS = JSON.stringify(cp.execFileSync('git', ['rev-parse','--path-format=absolute','--git-common-dir','--git-dir'], {encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim().split('\n').map(p => fs.realpathSync(p)));
|
|
988
972
|
}
|
|
989
973
|
} catch {}
|
|
990
974
|
process.stdout.write("\0" + JSON.stringify(env) + "\0");
|
|
@@ -996,9 +980,9 @@ process.stdout.write("\0" + JSON.stringify(env) + "\0");
|
|
|
996
980
|
// A legacy SSH host may run a standalone agent binary without Node. Use
|
|
997
981
|
// only the shell and Git, and emit bounded, NUL-framed environment records.
|
|
998
982
|
const probe = String.raw `
|
|
999
|
-
printf '\
|
|
983
|
+
printf '\0WARDMOTE_GIT_CONTEXT_V1\0'
|
|
1000
984
|
if [ "$1" = host ]; then
|
|
1001
|
-
for key in GH_TOKEN GITHUB_TOKEN GH_ENTERPRISE_TOKEN GITHUB_ENTERPRISE_TOKEN
|
|
985
|
+
for key in GH_TOKEN GITHUB_TOKEN GH_ENTERPRISE_TOKEN GITHUB_ENTERPRISE_TOKEN WARDMOTE_GIT_TOKEN GH_CONFIG_DIR GIT_CONFIG_GLOBAL GIT_CONFIG_SYSTEM GIT_CONFIG_NOSYSTEM GIT_CONFIG_COUNT GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_ASKPASS SSH_ASKPASS SSH_AUTH_SOCK GIT_SSH_COMMAND GIT_SSH; do
|
|
1002
986
|
eval 'value=${"$"}{'"$key"'-}'
|
|
1003
987
|
[ -z "$value" ] || printf '%s\0%s\0' "$key" "$value"
|
|
1004
988
|
done
|
|
@@ -1011,7 +995,7 @@ if [ "$1" = host ]; then
|
|
|
1011
995
|
done
|
|
1012
996
|
index=$((index + 1))
|
|
1013
997
|
done
|
|
1014
|
-
printf '
|
|
998
|
+
printf 'WARDMOTE_GITHUB_HOST_HOME\0%s\0' "$HOME"
|
|
1015
999
|
printf 'GH_CONFIG_DIR\0%s\0' "${"$"}{GH_CONFIG_DIR:-${"$"}{XDG_CONFIG_HOME:-$HOME/.config}/gh}"
|
|
1016
1000
|
fi
|
|
1017
1001
|
for file in /etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/ssl/certs /etc/ssl/cert.pem; do
|
|
@@ -1023,7 +1007,7 @@ for file in /etc/resolv.conf /etc/hosts /etc/nsswitch.conf /etc/ssl/certs /etc/s
|
|
|
1023
1007
|
done
|
|
1024
1008
|
if [ -e "$file" ]; then
|
|
1025
1009
|
parent=$(cd "$(dirname "$file")" && pwd -P) || continue
|
|
1026
|
-
printf '
|
|
1010
|
+
printf 'WARDMOTE_RUNNER_NETWORK_ROOT\0%s\0' "$parent/$(basename "$file")"
|
|
1027
1011
|
fi
|
|
1028
1012
|
done
|
|
1029
1013
|
cwd=$(pwd -P)
|
|
@@ -1032,10 +1016,10 @@ if [ -n "$top" ] && [ "$(cd "$top" && pwd -P)" = "$cwd" ]; then
|
|
|
1032
1016
|
for kind in --git-common-dir --git-dir; do
|
|
1033
1017
|
root=$(git rev-parse --path-format=absolute "$kind" 2>/dev/null) || continue
|
|
1034
1018
|
root=$(cd "$root" && pwd -P) || continue
|
|
1035
|
-
printf '
|
|
1019
|
+
printf 'WARDMOTE_GIT_METADATA_ROOT\0%s\0' "$root"
|
|
1036
1020
|
done
|
|
1037
1021
|
fi
|
|
1038
|
-
printf '\
|
|
1022
|
+
printf '\0WARDMOTE_GIT_CONTEXT_END\0'
|
|
1039
1023
|
`;
|
|
1040
1024
|
const result = await adapterExecutionTargetCommandRunner(remote).execute({
|
|
1041
1025
|
command: "sh", args: ["-c", probe, "paperclip-git-context", input.hostCredentials ? "host" : "managed"],
|
|
@@ -1045,7 +1029,7 @@ printf '\0PAPERCLIP_GIT_CONTEXT_END\0'
|
|
|
1045
1029
|
});
|
|
1046
1030
|
if (result.exitCode !== 0)
|
|
1047
1031
|
throw new Error("Could not read execution-target Git context");
|
|
1048
|
-
const payload = result.stdout.split("\
|
|
1032
|
+
const payload = result.stdout.split("\0WARDMOTE_GIT_CONTEXT_V1\0")[1]?.split("\0WARDMOTE_GIT_CONTEXT_END\0")[0];
|
|
1049
1033
|
if (payload === undefined)
|
|
1050
1034
|
throw new Error("Could not read execution-target Git context");
|
|
1051
1035
|
discovered = {};
|
|
@@ -1055,15 +1039,15 @@ printf '\0PAPERCLIP_GIT_CONTEXT_END\0'
|
|
|
1055
1039
|
for (let index = 0; index + 1 < records.length; index += 2) {
|
|
1056
1040
|
const key = records[index];
|
|
1057
1041
|
const value = records[index + 1];
|
|
1058
|
-
if (key === "
|
|
1042
|
+
if (key === "WARDMOTE_GIT_METADATA_ROOT")
|
|
1059
1043
|
roots.push(value);
|
|
1060
|
-
else if (key === "
|
|
1044
|
+
else if (key === "WARDMOTE_RUNNER_NETWORK_ROOT")
|
|
1061
1045
|
networkRoots.push(value);
|
|
1062
1046
|
else
|
|
1063
1047
|
discovered[key] = value;
|
|
1064
1048
|
}
|
|
1065
|
-
discovered.
|
|
1066
|
-
discovered.
|
|
1049
|
+
discovered.WARDMOTE_GIT_METADATA_ROOTS = JSON.stringify([...new Set(roots)]);
|
|
1050
|
+
discovered.WARDMOTE_RUNNER_NETWORK_ROOTS = JSON.stringify([...new Set(networkRoots)]);
|
|
1067
1051
|
}
|
|
1068
1052
|
else {
|
|
1069
1053
|
const result = await promisify(execFile)(process.execPath, args, { cwd: input.cwd, timeout: 15_000, maxBuffer: 1024 * 1024 });
|
|
@@ -1076,11 +1060,11 @@ printf '\0PAPERCLIP_GIT_CONTEXT_END\0'
|
|
|
1076
1060
|
}
|
|
1077
1061
|
// Controller-derived roots and mode must not be replaced by agent bindings.
|
|
1078
1062
|
return { ...discovered, ...input.env,
|
|
1079
|
-
...(input.hostCredentials ? {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1063
|
+
...(input.hostCredentials ? { WARDMOTE_GITHUB_HOST_HOME: discovered.WARDMOTE_GITHUB_HOST_HOME } : {}),
|
|
1064
|
+
WARDMOTE_GIT_METADATA_ROOTS: discovered.WARDMOTE_GIT_METADATA_ROOTS ?? "[]",
|
|
1065
|
+
WARDMOTE_RUNNER_NETWORK_ROOTS: discovered.WARDMOTE_RUNNER_NETWORK_ROOTS ?? "[]",
|
|
1066
|
+
WARDMOTE_GITHUB_AUTH_MODE: input.hostCredentials ? "host" : "managed",
|
|
1067
|
+
WARDMOTE_RUNNER_NETWORK_ACCESS: input.networkAccess ? "enabled" : "disabled",
|
|
1084
1068
|
};
|
|
1085
1069
|
}
|
|
1086
1070
|
/** Stage token-free launchers next to the execution, not in shared global Git config. */
|
|
@@ -1128,16 +1112,11 @@ export async function prepareGitHubOperationLaunchers(input) {
|
|
|
1128
1112
|
await fs.writeFile(path.join(directory, program), body, { mode: 0o700 });
|
|
1129
1113
|
}
|
|
1130
1114
|
return { ...input.env, PATH: managedPath, ZDOTDIR: directory, BASH_ENV: `${directory}/.bashrc`,
|
|
1131
|
-
GH_CONFIG_DIR: configDirectory,
|
|
1115
|
+
GH_CONFIG_DIR: configDirectory, WARDMOTE_GITHUB_LAUNCHER_DIR: directory };
|
|
1132
1116
|
}
|
|
1133
1117
|
function buildBridgeResponseHeaders(response) {
|
|
1134
1118
|
const out = {};
|
|
1135
|
-
|
|
1136
|
-
// possibly-committed mutation with the `indeterminate` outcome. The in-sandbox
|
|
1137
|
-
// server reads that header to map the 504 to a terminal 409. If the forward
|
|
1138
|
-
// drops the header, the server keeps the retryable 504 and a caller that
|
|
1139
|
-
// retries 5xx can repeat a mutation that already committed.
|
|
1140
|
-
for (const key of ["content-type", "etag", "last-modified", "x-paperclip-bridge-outcome"]) {
|
|
1119
|
+
for (const key of ["content-type", "etag", "last-modified", "x-wardmote-bridge-outcome"]) {
|
|
1141
1120
|
const value = response.headers.get(key);
|
|
1142
1121
|
if (value && value.trim().length > 0)
|
|
1143
1122
|
out[key] = value.trim();
|
|
@@ -1237,12 +1216,6 @@ async function writeProcessSessionProxyScript(dir, port, token) {
|
|
|
1237
1216
|
await fs.writeFile(proxyPath, getProcessSessionProxySource({ port, token }), { mode: 0o700 });
|
|
1238
1217
|
return proxyPath;
|
|
1239
1218
|
}
|
|
1240
|
-
// Content-hash-skip the process-session remote script write, mirroring the
|
|
1241
|
-
// sandbox callback bridge entrypoint sha256 gate. The script is a static
|
|
1242
|
-
// Paperclip-authored `.mjs` that only changes when the build changes, so on a
|
|
1243
|
-
// warm start (same sandbox, script already present) the single sha-gate exec
|
|
1244
|
-
// skips the ~3-exec base64 upload entirely. `syncRemoteTextFileWithHashSkip`
|
|
1245
|
-
// fails loud on a check error rather than silently re-uploading.
|
|
1246
1219
|
async function syncProcessSessionRemoteScript(input) {
|
|
1247
1220
|
const { uploaded } = await syncRemoteTextFileWithHashSkip({
|
|
1248
1221
|
runner: input.runner,
|
|
@@ -1252,7 +1225,7 @@ async function syncProcessSessionRemoteScript(input) {
|
|
|
1252
1225
|
body: getProcessSessionRemoteSource({ outputToStdout: input.outputToStdout === true }),
|
|
1253
1226
|
label: "Process session remote script",
|
|
1254
1227
|
action: "sync process session remote script",
|
|
1255
|
-
lockDir: path.posix.join(input.remoteScriptDir, ".
|
|
1228
|
+
lockDir: path.posix.join(input.remoteScriptDir, ".wardmote-process-session-script.lock"),
|
|
1256
1229
|
timeoutMs: input.timeoutMs,
|
|
1257
1230
|
shellCommand: input.shellCommand,
|
|
1258
1231
|
});
|
|
@@ -1312,7 +1285,7 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1312
1285
|
const timeoutMs = typeof input.timeoutSec === "number" && Number.isFinite(input.timeoutSec) && input.timeoutSec > 0
|
|
1313
1286
|
? Math.trunc(input.timeoutSec * 1000)
|
|
1314
1287
|
: target.timeoutMs ?? undefined;
|
|
1315
|
-
const bridgeRuntimeDir = path.posix.join(input.runtimeRootDir?.trim() || path.posix.join(target.remoteCwd, ".
|
|
1288
|
+
const bridgeRuntimeDir = path.posix.join(input.runtimeRootDir?.trim() || path.posix.join(target.remoteCwd, ".wardmote-runtime", input.adapterKey), "process-sessions");
|
|
1316
1289
|
const sessionId = randomUUID();
|
|
1317
1290
|
const sessionDir = path.posix.join(bridgeRuntimeDir, sessionId);
|
|
1318
1291
|
const stdinDir = path.posix.join(sessionDir, "stdin");
|
|
@@ -1340,9 +1313,6 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1340
1313
|
shellCommand,
|
|
1341
1314
|
outputToStdout: streamOutput,
|
|
1342
1315
|
});
|
|
1343
|
-
// Resolve the launch env AFTER the env-independent setup above, so a caller
|
|
1344
|
-
// can defer it until an upstream dependency (e.g. the paperclip bridge's env)
|
|
1345
|
-
// is ready without blocking the dir/script setup.
|
|
1346
1316
|
const launchEnv = typeof input.env === "function" ? await input.env() : input.env;
|
|
1347
1317
|
const commandPayload = Buffer.from(JSON.stringify({
|
|
1348
1318
|
command: input.command,
|
|
@@ -1359,7 +1329,7 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1359
1329
|
// the existing path; upload larger envelopes in bounded chunks instead.
|
|
1360
1330
|
const commandEnv = {};
|
|
1361
1331
|
if (commandPayload.length <= 64 * 1024) {
|
|
1362
|
-
commandEnv.
|
|
1332
|
+
commandEnv.WARDMOTE_PROCESS_SESSION_COMMAND_B64 = commandPayload;
|
|
1363
1333
|
}
|
|
1364
1334
|
else {
|
|
1365
1335
|
const payloadPath = path.posix.join(sessionDir, "command.b64");
|
|
@@ -1392,20 +1362,20 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1392
1362
|
// event files with the host poll below. The streamed path launches the wrapper
|
|
1393
1363
|
// as one foreground session command further down instead, so skip this.
|
|
1394
1364
|
if (!streamOutput) {
|
|
1395
|
-
await onLog("stdout", `[
|
|
1365
|
+
await onLog("stdout", `[wardmote] Starting ACP process session bridge in sandbox (${target.providerKey ?? "provider"}).\n`);
|
|
1396
1366
|
const startResult = await runSandboxBridgeControlCommand(runner, {
|
|
1397
1367
|
command: shellCommand,
|
|
1398
1368
|
args: shellCommandArgs([
|
|
1399
1369
|
`mkdir -p ${shellQuote(stdinDir)} ${shellQuote(eventsDir)}`,
|
|
1400
1370
|
// I3: no numeric process identifier anywhere. Background the
|
|
1401
1371
|
// wrapper and let it go; do not capture `$!`.
|
|
1402
|
-
`
|
|
1372
|
+
`WARDMOTE_PROCESS_SESSION_DIR=${shellQuote(sessionDir)} ` +
|
|
1403
1373
|
Object.entries(commandEnv).map(([key, value]) => `${key}=${shellQuote(value)} `).join("") +
|
|
1404
1374
|
`nohup node ${shellQuote(remoteScriptPath)} >/dev/null 2>&1 < /dev/null &`,
|
|
1405
1375
|
].join("\n")),
|
|
1406
1376
|
cwd: target.remoteCwd,
|
|
1407
1377
|
env: {
|
|
1408
|
-
|
|
1378
|
+
WARDMOTE_SANDBOX_EXEC_CHANNEL: "bridge",
|
|
1409
1379
|
},
|
|
1410
1380
|
timeoutMs,
|
|
1411
1381
|
// The wrapper launch is bridge plumbing. Keep it off the persistent
|
|
@@ -1475,11 +1445,11 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1475
1445
|
"SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGABRT", "SIGFPE", "SIGKILL",
|
|
1476
1446
|
"SIGSEGV", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGBUS", "SIGXCPU", "SIGXFSZ",
|
|
1477
1447
|
].includes(event.signal) ? event.signal : "unknown";
|
|
1478
|
-
logFailureWithoutWaiting(`[
|
|
1448
|
+
logFailureWithoutWaiting(`[wardmote] ACP process session terminal: source=${source} outcome=${outcome} exitCode=${code} signal=${signal}.\n`);
|
|
1479
1449
|
};
|
|
1480
1450
|
const pendingRemoteEvents = [];
|
|
1481
1451
|
const token = createSandboxCallbackBridgeToken(18);
|
|
1482
|
-
const proxyDir = await fs.mkdtemp(path.join(os.tmpdir(), "
|
|
1452
|
+
const proxyDir = await fs.mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-proxy-"));
|
|
1483
1453
|
// `stop()` waits on this promise, bounded, for the wrapper's `shutdownAck`
|
|
1484
1454
|
// event. `deliverRemoteEvent` resolves it below and never forwards the
|
|
1485
1455
|
// event further: it is a host-internal control ack, not part of the ACP
|
|
@@ -1632,7 +1602,7 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1632
1602
|
}
|
|
1633
1603
|
// stop() awaits this input chain before sending shutdown. Run-log
|
|
1634
1604
|
// persistence must not hold teardown open when it stalls or fails.
|
|
1635
|
-
logFailureWithoutWaiting(`[
|
|
1605
|
+
logFailureWithoutWaiting(`[wardmote] ${message}\n`);
|
|
1636
1606
|
}
|
|
1637
1607
|
});
|
|
1638
1608
|
}
|
|
@@ -1730,7 +1700,7 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1730
1700
|
for (const line of text.split(/\n/))
|
|
1731
1701
|
parseFrameLine(line);
|
|
1732
1702
|
};
|
|
1733
|
-
await onLog("stdout", `[
|
|
1703
|
+
await onLog("stdout", `[wardmote] Starting streamed ACP process session bridge in sandbox (${target.providerKey ?? "provider"}).\n`);
|
|
1734
1704
|
// Fire the long-lived command; do NOT await it here. `useSession` forces the
|
|
1735
1705
|
// persistent session so the provider streams the wrapper stdout back through
|
|
1736
1706
|
// `onLog`. On resolve, the terminal re-parse fills any frames the live stream
|
|
@@ -1764,9 +1734,9 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1764
1734
|
args: shellCommandArgs(`node ${shellQuote(remoteScriptPath)}`),
|
|
1765
1735
|
cwd: target.remoteCwd,
|
|
1766
1736
|
env: {
|
|
1767
|
-
|
|
1737
|
+
WARDMOTE_PROCESS_SESSION_DIR: sessionDir,
|
|
1768
1738
|
...commandEnv,
|
|
1769
|
-
|
|
1739
|
+
WARDMOTE_SANDBOX_EXEC_CHANNEL: "bridge",
|
|
1770
1740
|
},
|
|
1771
1741
|
timeoutMs,
|
|
1772
1742
|
useSession: true,
|
|
@@ -1897,7 +1867,7 @@ export async function startAdapterExecutionTargetProcessSessionBridge(input) {
|
|
|
1897
1867
|
]);
|
|
1898
1868
|
stopReadingForShutdownAck = true;
|
|
1899
1869
|
if (!acknowledgedInTime) {
|
|
1900
|
-
logFailureWithoutWaiting(`[
|
|
1870
|
+
logFailureWithoutWaiting(`[wardmote] ACP process session wrapper did not acknowledge shutdown within ${DEFAULT_PROCESS_SESSION_SHUTDOWN_WAIT_MS}ms; removing the session directory anyway.\n`);
|
|
1901
1871
|
}
|
|
1902
1872
|
// Unconditional: this removal runs whether or not the wrapper
|
|
1903
1873
|
// acknowledged, and whether or not any event (real or forged) arrived
|
|
@@ -1983,7 +1953,7 @@ const PROCESS_SESSION_STDIN_POLL_TAIL = `child.stdin.on("error", () => {});
|
|
|
1983
1953
|
// and write an error event, so a lost message fails loud, and let later files
|
|
1984
1954
|
// run.
|
|
1985
1955
|
const stdinMaxParseRetries = (() => {
|
|
1986
|
-
const raw = Number.parseInt(process.env.
|
|
1956
|
+
const raw = Number.parseInt(process.env.WARDMOTE_PROCESS_SESSION_STDIN_MAX_RETRIES || "", 10);
|
|
1987
1957
|
return Number.isFinite(raw) && raw > 0 ? raw : 100;
|
|
1988
1958
|
})();
|
|
1989
1959
|
const stdinParseRetries = new Map();
|
|
@@ -2001,7 +1971,7 @@ let stdinGapRetries = 0;
|
|
|
2001
1971
|
// call sends. A test can override it through the environment, so a stubborn
|
|
2002
1972
|
// child does not force a slow test.
|
|
2003
1973
|
const terminateGraceMs = (() => {
|
|
2004
|
-
const raw = Number.parseInt(process.env.
|
|
1974
|
+
const raw = Number.parseInt(process.env.WARDMOTE_PROCESS_SESSION_TERMINATE_GRACE_MS || "", 10);
|
|
2005
1975
|
return Number.isFinite(raw) && raw > 0 ? raw : 3000;
|
|
2006
1976
|
})();
|
|
2007
1977
|
|
|
@@ -2082,7 +2052,7 @@ async function statPathIdentity(candidatePath) {
|
|
|
2082
2052
|
const stats = await fs.lstat(candidatePath);
|
|
2083
2053
|
if (stats.isSymbolicLink()) {
|
|
2084
2054
|
const error = new Error("Refusing a symbolic link on a process session control path.");
|
|
2085
|
-
error.code = "
|
|
2055
|
+
error.code = "EWARDMOTE_SYMLINK";
|
|
2086
2056
|
throw error;
|
|
2087
2057
|
}
|
|
2088
2058
|
if (!stats.isDirectory()) {
|
|
@@ -2110,7 +2080,7 @@ let probeSeq = 0;
|
|
|
2110
2080
|
// a poll cycle ever lists the directory during the probe's short window.
|
|
2111
2081
|
function nextProbeFileName() {
|
|
2112
2082
|
probeSeq += 1;
|
|
2113
|
-
return ".
|
|
2083
|
+
return ".wardmote-birthtime-probe-" + process.pid + "-" + probeSeq;
|
|
2114
2084
|
}
|
|
2115
2085
|
|
|
2116
2086
|
// Proves a directory's reported birthtimeMs is a real creation time, not a
|
|
@@ -2294,7 +2264,7 @@ async function verifySessionIdentity() {
|
|
|
2294
2264
|
? "the control path no longer exists"
|
|
2295
2265
|
: code === "ENOTDIR"
|
|
2296
2266
|
? "the control path is no longer a directory"
|
|
2297
|
-
: code === "
|
|
2267
|
+
: code === "EWARDMOTE_SYMLINK"
|
|
2298
2268
|
? "the control path is now a symbolic link"
|
|
2299
2269
|
: "lstat failed" + (code ? " with " + code : "");
|
|
2300
2270
|
process.stderr.write("Latching on a lost process session identity: " + reason + ". Terminating.\\n");
|
|
@@ -2422,7 +2392,7 @@ void pollStdin().catch((error) => void writeEvent({ type: "error", message: erro
|
|
|
2422
2392
|
const PROCESS_SESSION_READ_COMMAND = `
|
|
2423
2393
|
let config;
|
|
2424
2394
|
try {
|
|
2425
|
-
let commandPayload = process.env.
|
|
2395
|
+
let commandPayload = process.env.WARDMOTE_PROCESS_SESSION_COMMAND_B64;
|
|
2426
2396
|
if (!commandPayload) {
|
|
2427
2397
|
const payloadPath = path.posix.join(sessionDir, "command.b64");
|
|
2428
2398
|
const handle = await fs.open(payloadPath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
@@ -2456,7 +2426,7 @@ function getProcessSessionRemoteStreamSource() {
|
|
|
2456
2426
|
import { promises as fs, constants as fsConstants } from "node:fs";
|
|
2457
2427
|
import path from "node:path";
|
|
2458
2428
|
|
|
2459
|
-
const sessionDir = process.env.
|
|
2429
|
+
const sessionDir = process.env.WARDMOTE_PROCESS_SESSION_DIR;
|
|
2460
2430
|
if (!sessionDir) throw new Error("Missing process session bridge env.");
|
|
2461
2431
|
|
|
2462
2432
|
const stdinDir = path.posix.join(sessionDir, "stdin");
|
|
@@ -2499,8 +2469,8 @@ ${PROCESS_SESSION_READ_COMMAND}
|
|
|
2499
2469
|
// session dir and the command payload. Scrub both keys before they reach the
|
|
2500
2470
|
// spawned child, so the child never inherits a path to its own control files.
|
|
2501
2471
|
const childEnv = { ...process.env, ...(config.env || {}) };
|
|
2502
|
-
delete childEnv.
|
|
2503
|
-
delete childEnv.
|
|
2472
|
+
delete childEnv.WARDMOTE_PROCESS_SESSION_DIR;
|
|
2473
|
+
delete childEnv.WARDMOTE_PROCESS_SESSION_COMMAND_B64;
|
|
2504
2474
|
|
|
2505
2475
|
// I1: exactly one child process per emitted wrapper. Do not add a second
|
|
2506
2476
|
// tracked child handle.
|
|
@@ -2538,7 +2508,7 @@ function getProcessSessionRemoteEventFileSource() {
|
|
|
2538
2508
|
import { promises as fs, constants as fsConstants } from "node:fs";
|
|
2539
2509
|
import path from "node:path";
|
|
2540
2510
|
|
|
2541
|
-
const sessionDir = process.env.
|
|
2511
|
+
const sessionDir = process.env.WARDMOTE_PROCESS_SESSION_DIR;
|
|
2542
2512
|
if (!sessionDir) throw new Error("Missing process session bridge env.");
|
|
2543
2513
|
|
|
2544
2514
|
const stdinDir = path.posix.join(sessionDir, "stdin");
|
|
@@ -2589,8 +2559,8 @@ ${PROCESS_SESSION_READ_COMMAND}
|
|
|
2589
2559
|
// session dir and the command payload. Scrub both keys before they reach the
|
|
2590
2560
|
// spawned child, so the child never inherits a path to its own control files.
|
|
2591
2561
|
const childEnv = { ...process.env, ...(config.env || {}) };
|
|
2592
|
-
delete childEnv.
|
|
2593
|
-
delete childEnv.
|
|
2562
|
+
delete childEnv.WARDMOTE_PROCESS_SESSION_DIR;
|
|
2563
|
+
delete childEnv.WARDMOTE_PROCESS_SESSION_COMMAND_B64;
|
|
2594
2564
|
|
|
2595
2565
|
// I1: exactly one child process per emitted wrapper. Do not add a second
|
|
2596
2566
|
// tracked child handle.
|
|
@@ -3431,11 +3401,11 @@ async function closeDuplexChannelWithinBudget(channel, budgetMs) {
|
|
|
3431
3401
|
}
|
|
3432
3402
|
let attachmentMaxBytesSource = null;
|
|
3433
3403
|
/** Lets the host supply its live attachment size limit so the bridge body cap follows Instance Settings. */
|
|
3434
|
-
export function
|
|
3404
|
+
export function setWardmoteBridgeAttachmentMaxBytesSource(source) {
|
|
3435
3405
|
attachmentMaxBytesSource = source;
|
|
3436
3406
|
}
|
|
3437
|
-
export async function
|
|
3438
|
-
if (!
|
|
3407
|
+
export async function startAdapterExecutionTargetWardmoteBridge(input) {
|
|
3408
|
+
if (!adapterExecutionTargetUsesWardmoteBridge(input.target)) {
|
|
3439
3409
|
return null;
|
|
3440
3410
|
}
|
|
3441
3411
|
if (!input.target || input.target.kind !== "remote") {
|
|
@@ -3445,7 +3415,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3445
3415
|
const onLog = input.onLog ?? (async () => { });
|
|
3446
3416
|
const hostApiToken = input.hostApiToken?.trim() ?? "";
|
|
3447
3417
|
if (hostApiToken.length === 0) {
|
|
3448
|
-
throw new Error("Sandbox bridge mode requires a host-side
|
|
3418
|
+
throw new Error("Sandbox bridge mode requires a host-side Wardmote API token.");
|
|
3449
3419
|
}
|
|
3450
3420
|
// The forward budget for one relayed request. It stays at the broker's default
|
|
3451
3421
|
// forward budget (30 s) when the caller sets no option, so current behavior
|
|
@@ -3453,12 +3423,12 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3453
3423
|
const forwardTimeoutMs = input.forwardTimeoutMs ?? DEFAULT_DUPLEX_BROKER_BUDGETS.forwardTimeoutMs;
|
|
3454
3424
|
const runtimeRootDir = input.runtimeRootDir?.trim().length
|
|
3455
3425
|
? input.runtimeRootDir.trim()
|
|
3456
|
-
: path.posix.join(target.remoteCwd, ".
|
|
3426
|
+
: path.posix.join(target.remoteCwd, ".wardmote-runtime", input.adapterKey);
|
|
3457
3427
|
const bridgeRuntimeDir = path.posix.join(runtimeRootDir, "paperclip-bridge");
|
|
3458
3428
|
const queueDir = path.posix.join(bridgeRuntimeDir, "queue");
|
|
3459
3429
|
const assetRemoteDir = path.posix.join(bridgeRuntimeDir, "server");
|
|
3460
3430
|
const bridgeToken = createSandboxCallbackBridgeToken();
|
|
3461
|
-
const configuredAttachmentBytes = attachmentMaxBytesSource?.() ?? Number(process.env.
|
|
3431
|
+
const configuredAttachmentBytes = attachmentMaxBytesSource?.() ?? Number(process.env.WARDMOTE_ATTACHMENT_MAX_BYTES);
|
|
3462
3432
|
// A larger upload limit needs multipart headroom. A smaller attachment limit
|
|
3463
3433
|
// remains enforced by the API and must not shrink unrelated JSON responses.
|
|
3464
3434
|
const defaultBodyBytes = Number.isSafeInteger(configuredAttachmentBytes) && configuredAttachmentBytes > 0
|
|
@@ -3467,25 +3437,13 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3467
3437
|
const maxBodyBytes = typeof input.maxBodyBytes === "number" && Number.isFinite(input.maxBodyBytes) && input.maxBodyBytes > 0
|
|
3468
3438
|
? Math.trunc(input.maxBodyBytes)
|
|
3469
3439
|
: defaultBodyBytes;
|
|
3470
|
-
|
|
3471
|
-
// API, so forwarded sandbox calls must target the LOCAL listen origin. The
|
|
3472
|
-
// PAPERCLIP_RUNTIME_API_URL / PAPERCLIP_API_URL exports now prefer a
|
|
3473
|
-
// configured public base URL, which is the origin browsers and external
|
|
3474
|
-
// agents use; routing this in-process loopback hop through the network edge
|
|
3475
|
-
// breaks deployments whose public origin sits behind a session-gated proxy
|
|
3476
|
-
// (every forwarded agent API call is rejected at the edge). Server boot
|
|
3477
|
-
// exports PAPERCLIP_LISTEN_HOST / PAPERCLIP_LISTEN_PORT before any run
|
|
3478
|
-
// executes, and resolveDefaultPaperclipApiUrl() maps wildcard listen hosts
|
|
3479
|
-
// to the loopback address of the same family (0.0.0.0 -> 127.0.0.1,
|
|
3480
|
-
// :: -> [::1]), so the fallback is always loopback-reachable.
|
|
3481
|
-
// input.hostApiUrl stays available as an explicit override seam.
|
|
3482
|
-
const hostApiUrl = input.hostApiUrl?.trim() || resolveDefaultPaperclipApiUrl();
|
|
3440
|
+
const hostApiUrl = input.hostApiUrl?.trim() || resolveDefaultWardmoteApiUrl();
|
|
3483
3441
|
const shellCommand = adapterExecutionTargetShellCommand(target);
|
|
3484
3442
|
const runner = adapterExecutionTargetCommandRunner(target);
|
|
3485
3443
|
const bridgeTimeoutMs = typeof input.timeoutSec === "number" && Number.isFinite(input.timeoutSec) && input.timeoutSec > 0
|
|
3486
3444
|
? Math.trunc(input.timeoutSec * 1000)
|
|
3487
3445
|
: adapterExecutionTargetTimeoutMs(target);
|
|
3488
|
-
await onLog("stdout", `[
|
|
3446
|
+
await onLog("stdout", `[wardmote] Starting sandbox callback bridge for ${input.adapterKey} in ${bridgeRuntimeDir}.\n`);
|
|
3489
3447
|
const bridgeAsset = await createSandboxCallbackBridgeAsset();
|
|
3490
3448
|
// The provider-scoped telemetry facade for the fixed duplex observability
|
|
3491
3449
|
// surface. It maps the raw provider key through the allowlist one time, so no
|
|
@@ -3499,17 +3457,12 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3499
3457
|
// record this facade produces stamps the `http2` transport value.
|
|
3500
3458
|
transport: "http2",
|
|
3501
3459
|
});
|
|
3502
|
-
//
|
|
3460
|
+
// WARDMOTE_BRIDGE_DEBUG opts into verbose stdout logs of every bridge proxy
|
|
3503
3461
|
// request/response. The query string is logged verbatim, so callers who pass
|
|
3504
3462
|
// auth tokens or other sensitive values as query parameters should be aware
|
|
3505
3463
|
// those values appear in the host process's stdout when this flag is enabled.
|
|
3506
3464
|
// Only intended for active debugging in trusted environments.
|
|
3507
3465
|
const bridgeDebugEnabled = isBridgeDebugEnabled(process.env);
|
|
3508
|
-
// One forward of a relayed sandbox request onto the existing Paperclip API
|
|
3509
|
-
// path. The forward applies the real host token and the signed run id, so the
|
|
3510
|
-
// token replacement and the run attribution stay in one place for both the
|
|
3511
|
-
// file bridge and the duplex broker. The sandbox request carries only the
|
|
3512
|
-
// bridge token; the real agent token never leaves the host.
|
|
3513
3466
|
const forwardBridgeRequest = async (request, signal, options) => {
|
|
3514
3467
|
const method = request.method.trim().toUpperCase() || "GET";
|
|
3515
3468
|
// The per-request debug log prints the method, the path, and the query. The
|
|
@@ -3517,7 +3470,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3517
3470
|
// file path keeps the existing behavior.
|
|
3518
3471
|
const emitDebugLog = bridgeDebugEnabled && options?.suppressDebugLog !== true;
|
|
3519
3472
|
if (emitDebugLog) {
|
|
3520
|
-
await onLog("stdout", `[
|
|
3473
|
+
await onLog("stdout", `[wardmote] Bridge proxy ${method} ${request.path}${request.query ? `?${request.query}` : ""}\n`);
|
|
3521
3474
|
}
|
|
3522
3475
|
const headers = new Headers();
|
|
3523
3476
|
for (const [key, value] of Object.entries(request.headers)) {
|
|
@@ -3526,7 +3479,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3526
3479
|
headers.set(key, value);
|
|
3527
3480
|
}
|
|
3528
3481
|
headers.set("authorization", `Bearer ${hostApiToken}`);
|
|
3529
|
-
headers.set("x-
|
|
3482
|
+
headers.set("x-wardmote-run-id", input.runId);
|
|
3530
3483
|
// Abort the forward when the caller aborts the request (its per-iteration
|
|
3531
3484
|
// timeout or watchdog fired, or the broker's forward budget ended), or after
|
|
3532
3485
|
// the forward budget here, whichever comes first.
|
|
@@ -3549,7 +3502,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3549
3502
|
}
|
|
3550
3503
|
const response = await fetch(buildBridgeForwardUrl(hostApiUrl, request), forwardInit);
|
|
3551
3504
|
if (emitDebugLog) {
|
|
3552
|
-
await onLog("stdout", `[
|
|
3505
|
+
await onLog("stdout", `[wardmote] Bridge proxy response ${response.status} for ${method} ${request.path}${request.query ? `?${request.query}` : ""}\n`);
|
|
3553
3506
|
}
|
|
3554
3507
|
// The host delivered response headers, so the response-body read starts after
|
|
3555
3508
|
// the host processed the request. A later response-body read failure (a body
|
|
@@ -3598,7 +3551,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3598
3551
|
status: 504,
|
|
3599
3552
|
headers: {
|
|
3600
3553
|
"content-type": "application/json",
|
|
3601
|
-
"x-
|
|
3554
|
+
"x-wardmote-bridge-outcome": "indeterminate",
|
|
3602
3555
|
},
|
|
3603
3556
|
body: Buffer.from(JSON.stringify({
|
|
3604
3557
|
error: error instanceof Error ? error.message : String(error),
|
|
@@ -3678,12 +3631,12 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3678
3631
|
shellCommand,
|
|
3679
3632
|
});
|
|
3680
3633
|
const gatewayEnv = {
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3634
|
+
WARDMOTE_API_BRIDGE_MODE: SANDBOX_CALLBACK_BRIDGE_HTTP2_MODE,
|
|
3635
|
+
WARDMOTE_BRIDGE_TOKEN: bridgeToken,
|
|
3636
|
+
WARDMOTE_BRIDGE_HOST: "127.0.0.1",
|
|
3637
|
+
WARDMOTE_BRIDGE_PORT: String(assignedPort),
|
|
3638
|
+
WARDMOTE_BRIDGE_NONCE: nonce,
|
|
3639
|
+
WARDMOTE_BRIDGE_MAX_BODY_BYTES: String(maxBodyBytes),
|
|
3687
3640
|
};
|
|
3688
3641
|
const command = buildDuplexGatewayLaunchArgv({
|
|
3689
3642
|
shellCommand,
|
|
@@ -3708,7 +3661,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3708
3661
|
? "entrypoint_sync_failed"
|
|
3709
3662
|
: "channel_open_failed";
|
|
3710
3663
|
duplexChannelOpen.fallback(reason);
|
|
3711
|
-
await onLog("stderr", `[
|
|
3664
|
+
await onLog("stderr", `[wardmote] Could not open the sandbox duplex channel (${reason}). Using the file bridge.\n`);
|
|
3712
3665
|
channel = null;
|
|
3713
3666
|
}
|
|
3714
3667
|
if (channel) {
|
|
@@ -3726,7 +3679,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3726
3679
|
gate.disposePendingReplay();
|
|
3727
3680
|
await closeDuplexChannelWithinBudget(channel, DEFAULT_DUPLEX_CLEANUP_BUDGET_MS);
|
|
3728
3681
|
duplexChannelOpen.fallback(duplexReadinessFallbackReason(readiness.reason));
|
|
3729
|
-
await onLog("stderr", `[
|
|
3682
|
+
await onLog("stderr", `[wardmote] Sandbox duplex readiness failed (${readiness.reason}). Using the file bridge.\n`);
|
|
3730
3683
|
}
|
|
3731
3684
|
else {
|
|
3732
3685
|
// Readiness passed. The gate retained every byte that followed the
|
|
@@ -3750,7 +3703,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3750
3703
|
gate.disposePendingReplay();
|
|
3751
3704
|
await closeDuplexChannelWithinBudget(openedChannel, DEFAULT_DUPLEX_CLEANUP_BUDGET_MS);
|
|
3752
3705
|
duplexChannelOpen.fallback("preface_missing");
|
|
3753
|
-
await onLog("stderr", "[
|
|
3706
|
+
await onLog("stderr", "[wardmote] Sandbox HTTP/2 client preface did not appear inside the bounded readiness buffer (preface_missing). Using the file bridge.\n");
|
|
3754
3707
|
}
|
|
3755
3708
|
else {
|
|
3756
3709
|
// The run disposition latch for the http2_v1 path, in the same
|
|
@@ -3773,7 +3726,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3773
3726
|
}
|
|
3774
3727
|
const lossClass = anyStreamDispatched ? "post_dispatch" : "pre_dispatch";
|
|
3775
3728
|
duplexObservability.recordLoss(lossClass, reason);
|
|
3776
|
-
void onLog("stderr", `[
|
|
3729
|
+
void onLog("stderr", `[wardmote] Sandbox HTTP/2 channel lost (${reason}). The run fails.\n`);
|
|
3777
3730
|
};
|
|
3778
3731
|
// The forward handler applies the real host token and the run id
|
|
3779
3732
|
// through the existing `forwardBridgeRequest` — the same function
|
|
@@ -3808,7 +3761,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3808
3761
|
forwardRequest: http2ForwardRequest,
|
|
3809
3762
|
routes: HTTP2_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST,
|
|
3810
3763
|
// The same resolved limit the launch environment hands the
|
|
3811
|
-
// sandbox-side gateway (`
|
|
3764
|
+
// sandbox-side gateway (`WARDMOTE_BRIDGE_MAX_BODY_BYTES`,
|
|
3812
3765
|
// below), so the host check and the gateway check enforce one
|
|
3813
3766
|
// value instead of the host silently falling back to the
|
|
3814
3767
|
// package default.
|
|
@@ -3847,7 +3800,7 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3847
3800
|
// reaches `recordHttp2Loss` the same way any other write fault does.
|
|
3848
3801
|
boundDuplex.on("error", () => recordHttp2Loss("write_error"));
|
|
3849
3802
|
duplexChannelOpen.ready();
|
|
3850
|
-
await onLog("stdout", "[
|
|
3803
|
+
await onLog("stdout", "[wardmote] Sandbox HTTP/2 transport ready; serving the host-assigned origin.\n");
|
|
3851
3804
|
// Stream run logs on the http2 path with the same gate and the same
|
|
3852
3805
|
// log line as the file path. The http2 path starts no file-bridge
|
|
3853
3806
|
// worker, so create the log directory before the tail starts.
|
|
@@ -3867,13 +3820,13 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3867
3820
|
logsDir: duplexLogsDir,
|
|
3868
3821
|
shellCommand,
|
|
3869
3822
|
});
|
|
3870
|
-
await onLog("stdout", "[
|
|
3823
|
+
await onLog("stdout", "[wardmote] Sandbox run log streaming enabled for this run.\n");
|
|
3871
3824
|
}
|
|
3872
3825
|
return {
|
|
3873
3826
|
env: {
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3827
|
+
WARDMOTE_API_URL: sandboxOrigin,
|
|
3828
|
+
WARDMOTE_API_KEY: bridgeToken,
|
|
3829
|
+
WARDMOTE_API_BRIDGE_MODE: SANDBOX_CALLBACK_BRIDGE_HTTP2_MODE,
|
|
3877
3830
|
},
|
|
3878
3831
|
runLogTail: duplexRunLogTail,
|
|
3879
3832
|
readRunDisposition: () => dispositionLatch.disposition,
|
|
@@ -3905,11 +3858,6 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3905
3858
|
timeoutMs: bridgeTimeoutMs,
|
|
3906
3859
|
shellCommand,
|
|
3907
3860
|
});
|
|
3908
|
-
// `startSandboxCallbackBridgeWorker` keeps its awaited queue-directory
|
|
3909
|
-
// setup on the active `bridge.paperclip` step, and runs each request under
|
|
3910
|
-
// the run parent context (see `runWithRuntimeParent` inside that function).
|
|
3911
|
-
// So the startup `mkdir` execs stay parented to the step, and every later
|
|
3912
|
-
// request `sandbox.exec` span parents to the live run span.
|
|
3913
3861
|
worker = await startSandboxCallbackBridgeWorker({
|
|
3914
3862
|
client,
|
|
3915
3863
|
queueDir,
|
|
@@ -3949,14 +3897,14 @@ export async function startAdapterExecutionTargetPaperclipBridge(input) {
|
|
|
3949
3897
|
logsDir: sandboxCallbackBridgeDirectories(queueDir).logsDir,
|
|
3950
3898
|
shellCommand,
|
|
3951
3899
|
});
|
|
3952
|
-
await onLog("stdout", "[
|
|
3900
|
+
await onLog("stdout", "[wardmote] Sandbox run log streaming enabled for this run.\n");
|
|
3953
3901
|
}
|
|
3954
3902
|
return {
|
|
3955
3903
|
env: {
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3904
|
+
WARDMOTE_API_URL: server.baseUrl,
|
|
3905
|
+
WARDMOTE_API_KEY: bridgeToken,
|
|
3906
|
+
WARDMOTE_API_BRIDGE_MODE: "queue_v1",
|
|
3907
|
+
WARDMOTE_BRIDGE_QUEUE_DIR: queueDir,
|
|
3960
3908
|
},
|
|
3961
3909
|
runLogTail,
|
|
3962
3910
|
stop: async () => {
|