@loucompanion/forge-bridge 0.1.3-dev.f66395c3ac21 → 0.1.4-dev.bfa11ebe98c6
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 +165 -1
- package/dist/bridge/bridge-chat.types.d.ts +111 -0
- package/dist/bridge/bridge-chat.types.js +401 -0
- package/dist/bridge/bridge.base.d.ts +9 -1
- package/dist/bridge/bridge.service.d.ts +129 -3
- package/dist/bridge/bridge.service.js +2426 -70
- package/dist/bridge/bridge.types.d.ts +218 -2
- package/dist/bridge/dispatch-result-outbox.d.ts +25 -0
- package/dist/bridge/dispatch-result-outbox.js +62 -0
- package/dist/bridge/dispatch-result-worker.d.ts +2 -0
- package/dist/bridge/dispatch-result-worker.js +122 -0
- package/dist/bridge/internals.d.ts +2 -0
- package/dist/bridge/internals.js +1 -0
- package/dist/bridge/readiness-result-outbox.d.ts +21 -0
- package/dist/bridge/readiness-result-outbox.js +54 -0
- package/dist/bridge/readiness-result-worker.d.ts +2 -0
- package/dist/bridge/readiness-result-worker.js +121 -0
- package/dist/bridge/runner-host-capabilities.d.ts +15 -0
- package/dist/bridge/runner-host-capabilities.js +93 -0
- package/dist/cleanup/cleanup.service.d.ts +14 -2
- package/dist/cleanup/cleanup.service.js +496 -3
- package/dist/cleanup/cleanup.types.d.ts +10 -0
- package/dist/cleanup/index.d.ts +1 -1
- package/dist/cleanup/index.js +1 -1
- package/dist/cleanup/internals.d.ts +2 -2
- package/dist/cleanup/internals.js +1 -1
- package/dist/cli/cli.help.d.ts +2 -0
- package/dist/cli/cli.help.js +217 -0
- package/dist/cli/cli.service.d.ts +55 -7
- package/dist/cli/cli.service.js +429 -219
- package/dist/cli/local-config.d.ts +7 -0
- package/dist/cli/local-config.js +51 -3
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +36 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +341 -0
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +18 -0
- package/dist/runtime/attempt-node-runtime-launcher.js +140 -0
- package/dist/runtime/attempt-path-operation.d.ts +21 -0
- package/dist/runtime/attempt-path-operation.js +94 -0
- package/dist/runtime/attempt-private-directory.d.ts +6 -0
- package/dist/runtime/attempt-private-directory.js +54 -0
- package/dist/runtime/attempt-process-supervisor-registry.d.ts +20 -0
- package/dist/runtime/attempt-process-supervisor-registry.js +64 -0
- package/dist/runtime/attempt-process-supervisor.d.ts +97 -0
- package/dist/runtime/attempt-process-supervisor.js +397 -0
- package/dist/runtime/canonical-source-file.d.ts +3 -0
- package/dist/runtime/canonical-source-file.js +54 -0
- package/dist/runtime/docker-engine-probe.d.ts +90 -0
- package/dist/runtime/docker-engine-probe.js +333 -0
- package/dist/runtime/generated-output-reset.d.ts +20 -0
- package/dist/runtime/generated-output-reset.js +157 -0
- package/dist/runtime/host-database-capability-boundary.d.ts +16 -0
- package/dist/runtime/host-database-capability-boundary.js +62 -0
- package/dist/runtime/host-diagnostics.d.ts +11 -0
- package/dist/runtime/host-diagnostics.js +191 -0
- package/dist/runtime/host-execution-root.d.ts +4 -0
- package/dist/runtime/host-execution-root.js +39 -0
- package/dist/runtime/host-listener-inspector.d.ts +51 -0
- package/dist/runtime/host-listener-inspector.js +385 -0
- package/dist/runtime/host-port-broker.d.ts +76 -0
- package/dist/runtime/host-port-broker.js +333 -0
- package/dist/runtime/host-runtime-contract.d.ts +58 -0
- package/dist/runtime/host-runtime-contract.js +754 -0
- package/dist/runtime/host-runtime-lease.d.ts +215 -0
- package/dist/runtime/host-runtime-lease.js +2449 -0
- package/dist/runtime/host-runtime-promotion.d.ts +32 -0
- package/dist/runtime/host-runtime-promotion.js +206 -0
- package/dist/runtime/memory-capacity.d.ts +70 -0
- package/dist/runtime/memory-capacity.js +123 -0
- package/dist/runtime/native-test-postgres-fallback.d.ts +25 -0
- package/dist/runtime/native-test-postgres-fallback.js +91 -0
- package/dist/runtime/node-host-runtime-adapter.d.ts +54 -0
- package/dist/runtime/node-host-runtime-adapter.js +285 -0
- package/dist/runtime/pinned-directory-process.d.ts +9 -0
- package/dist/runtime/pinned-directory-process.js +61 -0
- package/dist/runtime/pinned-source-directory.d.ts +17 -0
- package/dist/runtime/pinned-source-directory.js +94 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +21 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +268 -0
- package/dist/runtime/prepared-runtime-identity.d.ts +6 -0
- package/dist/runtime/prepared-runtime-identity.js +218 -0
- package/dist/runtime/prepared-runtime-readiness.d.ts +30 -0
- package/dist/runtime/prepared-runtime-readiness.js +285 -0
- package/dist/runtime/runtime-isolation-lease.d.ts +67 -0
- package/dist/runtime/runtime-isolation-lease.js +161 -0
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/command-runner.d.ts +4 -0
- package/dist/sandbox/command-runner.js +47 -0
- package/dist/sandbox/contract.d.ts +5 -0
- package/dist/sandbox/contract.js +276 -0
- package/dist/sandbox/event-budget.d.ts +11 -0
- package/dist/sandbox/event-budget.js +27 -0
- package/dist/sandbox/image-policy.d.ts +35 -0
- package/dist/sandbox/image-policy.js +247 -0
- package/dist/sandbox/index.d.ts +5 -0
- package/dist/sandbox/index.js +5 -0
- package/dist/sandbox/lease-watchdog.d.ts +18 -0
- package/dist/sandbox/lease-watchdog.js +67 -0
- package/dist/sandbox/preflight.d.ts +84 -0
- package/dist/sandbox/preflight.js +521 -0
- package/dist/sandbox/process.d.ts +20 -0
- package/dist/sandbox/process.js +209 -0
- package/dist/sandbox/provider-auth/codex.d.ts +26 -0
- package/dist/sandbox/provider-auth/codex.js +212 -0
- package/dist/sandbox/repository-lock.d.ts +6 -0
- package/dist/sandbox/repository-lock.js +128 -0
- package/dist/sandbox/runtime.d.ts +302 -0
- package/dist/sandbox/runtime.js +2367 -0
- package/dist/sandbox/sandbox.types.d.ts +93 -0
- package/dist/sandbox/sandbox.types.js +1 -0
- package/dist/sandbox/smoke.d.ts +76 -0
- package/dist/sandbox/smoke.js +380 -0
- package/dist/sandbox/worker-supervisor.d.ts +13 -0
- package/dist/sandbox/worker-supervisor.js +36 -0
- package/dist/sandbox/worker.d.ts +1 -0
- package/dist/sandbox/worker.js +225 -0
- package/dist/sandbox/workspace.service.d.ts +13 -0
- package/dist/sandbox/workspace.service.js +74 -0
- package/dist/session/managed-attempt-tools.d.ts +28 -0
- package/dist/session/managed-attempt-tools.js +1011 -0
- package/dist/session/managed-build-coordinator.d.ts +5 -0
- package/dist/session/managed-build-coordinator.js +105 -0
- package/dist/session/managed-build-receipt.d.ts +21 -0
- package/dist/session/managed-build-receipt.js +337 -0
- package/dist/session/managed-verification-timeouts.d.ts +8 -0
- package/dist/session/managed-verification-timeouts.js +17 -0
- package/dist/session/phase-completion.artifacts.d.ts +27 -0
- package/dist/session/phase-completion.artifacts.js +829 -0
- package/dist/session/phase-completion.d.ts +53 -42
- package/dist/session/phase-completion.helpers.d.ts +117 -0
- package/dist/session/phase-completion.helpers.js +707 -0
- package/dist/session/phase-completion.js +125 -3007
- package/dist/session/phase-completion.prompts.d.ts +14 -0
- package/dist/session/phase-completion.prompts.js +233 -0
- package/dist/session/phase-completion.runtime.d.ts +49 -0
- package/dist/session/phase-completion.runtime.js +833 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -0
- package/dist/session/phase-completion.schemas.js +859 -0
- package/dist/session/phase-completion.validation.d.ts +38 -0
- package/dist/session/phase-completion.validation.js +918 -0
- package/dist/session/pre-publication-validation.d.ts +75 -0
- package/dist/session/pre-publication-validation.js +657 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.d.ts +72 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.js +462 -0
- package/dist/session/provider-cli/ci-repair-readiness.d.ts +16 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +110 -0
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +95 -0
- package/dist/session/provider-cli/provider-cli.artifacts.js +812 -0
- package/dist/session/provider-cli/provider-cli.base.d.ts +1 -0
- package/dist/session/provider-cli/provider-cli.deterministic-payloads.d.ts +12 -0
- package/dist/session/provider-cli/provider-cli.deterministic-payloads.js +279 -0
- package/dist/session/provider-cli/provider-cli.deterministic.d.ts +14 -0
- package/dist/session/provider-cli/provider-cli.deterministic.js +407 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +99 -0
- package/dist/session/provider-cli/provider-cli.process.js +874 -0
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +52 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +715 -0
- package/dist/session/provider-cli/provider-cli.qa-sidecars.d.ts +11 -0
- package/dist/session/provider-cli/provider-cli.qa-sidecars.js +66 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.js +11 -0
- package/dist/session/provider-cli/provider-cli.runtime.d.ts +16 -0
- package/dist/session/provider-cli/provider-cli.runtime.js +78 -0
- package/dist/session/provider-cli/provider-cli.service.d.ts +47 -53
- package/dist/session/provider-cli/provider-cli.service.js +1257 -2497
- package/dist/session/provider-cli/provider-cli.types.d.ts +8 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +32 -0
- package/dist/session/provider-cli/provider-output-state.js +817 -0
- package/dist/session/provider-cli/provider-usage.d.ts +7 -0
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/session-redaction.d.ts +3 -0
- package/dist/session/session-redaction.js +448 -0
- package/dist/session/session.base.d.ts +6 -1
- package/dist/session/session.service.d.ts +8 -2
- package/dist/session/session.service.js +586 -59
- package/dist/session/session.types.d.ts +324 -3
- package/dist/session/session.types.js +939 -10
- package/dist/session/unreferenced-exports.d.ts +12 -0
- package/dist/session/unreferenced-exports.js +59 -0
- package/dist/shared/format/format-bytes.d.ts +1 -0
- package/dist/shared/format/format-bytes.js +9 -0
- package/dist/shared/git/git.js +2 -1
- package/dist/shared/path/path.d.ts +1 -0
- package/dist/shared/path/path.js +21 -1
- package/dist/shared/process/dotnet-toolchain.d.ts +17 -0
- package/dist/shared/process/dotnet-toolchain.js +307 -0
- package/dist/shared/process/host-process-recovery.d.ts +12 -0
- package/dist/shared/process/host-process-recovery.js +78 -0
- package/dist/shared/process/host-process-supervisor.d.ts +59 -0
- package/dist/shared/process/host-process-supervisor.js +330 -0
- package/dist/shared/process/process.d.ts +3 -0
- package/dist/shared/process/process.js +13 -7
- package/dist/shared/process/windows-launch.d.ts +8 -0
- package/dist/shared/process/windows-launch.js +41 -0
- package/dist/shared/provider-capabilities.d.ts +4 -0
- package/dist/shared/provider-capabilities.js +88 -0
- package/dist/shared/redaction/redaction.d.ts +1 -0
- package/dist/shared/redaction/redaction.js +47 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/artifact-injector.d.ts +3 -2
- package/dist/worktree/artifact-injector.js +82 -10
- package/dist/worktree/dependency-warmer.d.ts +53 -1
- package/dist/worktree/dependency-warmer.js +619 -11
- package/dist/worktree/index.d.ts +2 -1
- package/dist/worktree/index.js +1 -0
- package/dist/worktree/prior-phase-artifact-hydrator.d.ts +2 -0
- package/dist/worktree/prior-phase-artifact-hydrator.js +136 -0
- package/dist/worktree/story-qa-reference-hydrator.d.ts +4 -0
- package/dist/worktree/story-qa-reference-hydrator.js +253 -0
- package/dist/worktree/worktree-paths.d.ts +4 -0
- package/dist/worktree/worktree-paths.js +30 -0
- package/dist/worktree/worktree.base.d.ts +3 -0
- package/dist/worktree/worktree.service.d.ts +16 -3
- package/dist/worktree/worktree.service.js +334 -54
- package/dist/worktree/worktree.types.d.ts +9 -1
- package/package.json +12 -7
- package/runtime/windows-job-supervisor.ps1 +722 -0
- package/runtime/windows-listener-owner.ps1 +33 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { GitClient } from "../../shared/git/git.js";
|
|
4
|
+
import { buildSpecBody, selectLaneCommand } from "../../worktree/artifact-injector.js";
|
|
5
|
+
import { completionPhaseFromDispatch, debugCompletionPhaseOrder, expectedCompletionToolName, expectedDebugCompletionToolName, expectedQaCompletionToolName, qaCompletionGateOrder, readCompletionArtifact, usesDebugCycleCompletion, usesDevelopCycleCompletion, writeCompletionArtifact } from "../phase-completion.js";
|
|
6
|
+
import { commitWorktreeChanges, emitArchitectStructuredEvents, emitCompletionArtifactRecorded, emitQaArtifactRecorded, emitQaGateAccepted, emitQaStructuredEvents, isDebugCompletionPhaseForProvider, nextQaGate, phaseCompleteEventType, qaArtifactRootForDispatch, readQaCompletionArtifactBundle, readQaGateArtifact } from "./provider-cli.artifacts.js";
|
|
7
|
+
import { deterministicBrowserCheck, deterministicBrowserSidecar, hasLaunchTarget, writeQaSidecarFiles } from "./provider-cli.qa-sidecars.js";
|
|
8
|
+
import { buildProviderCliCommand, formatProviderCliCommand, isPullRequestCheckRepairDispatch, isPullRequestCommentsDispatch, singleLine } from "./provider-cli.prompts.js";
|
|
9
|
+
import { estimatedDeterministicUsage, exactRedactionSecrets } from "./provider-cli.runtime.js";
|
|
10
|
+
import { buildProviderUsageEvent } from "./provider-usage.js";
|
|
11
|
+
import { writeCiRepairReadinessManifest } from "./ci-repair-readiness.js";
|
|
12
|
+
import { assertRepairHeadEpoch } from "./provider-cli.repair-epoch.js";
|
|
13
|
+
import { deterministicArchitectPayload, deterministicCompletionPayload, deterministicQaGatePayload } from "./provider-cli.deterministic-payloads.js";
|
|
14
|
+
export class DeterministicProviderCliService {
|
|
15
|
+
git;
|
|
16
|
+
constructor(git = new GitClient()) {
|
|
17
|
+
this.git = git;
|
|
18
|
+
}
|
|
19
|
+
async runDraft(context) {
|
|
20
|
+
const content = JSON.stringify(deterministicDraftPayload(context.dispatch));
|
|
21
|
+
await context.emit({
|
|
22
|
+
role: "assistant",
|
|
23
|
+
kind: "message",
|
|
24
|
+
content,
|
|
25
|
+
eventType: "draft_complete"
|
|
26
|
+
});
|
|
27
|
+
await context.emit(buildProviderUsageEvent(context.dispatch, estimatedDeterministicUsage()));
|
|
28
|
+
return { summary: "forge-bridge generated deterministic draft." };
|
|
29
|
+
}
|
|
30
|
+
async runImplementation(context) {
|
|
31
|
+
const { dispatch, worktree } = context;
|
|
32
|
+
const phase = completionPhaseFromDispatch(dispatch);
|
|
33
|
+
const developCycle = usesDevelopCycleCompletion(dispatch);
|
|
34
|
+
const debugCycle = usesDebugCycleCompletion(dispatch);
|
|
35
|
+
const providerCommand = buildProviderCliCommand(dispatch);
|
|
36
|
+
const providerCommandText = formatProviderCliCommand(providerCommand);
|
|
37
|
+
const metadataRoot = path.join(worktree.worktreePath, ".forge", "work-items", dispatch.workItem.id);
|
|
38
|
+
const artifactRoot = path.join(metadataRoot, "artifacts");
|
|
39
|
+
await fs.mkdir(artifactRoot, { recursive: true });
|
|
40
|
+
const laneCommand = selectLaneCommand(dispatch.artifacts, dispatch.execution.lane, dispatch.cycleRun.phase);
|
|
41
|
+
if (!laneCommand) {
|
|
42
|
+
throw new Error(`Lane command for lane '${dispatch.execution.lane}' phase '${dispatch.cycleRun.phase}' was not resolved.`);
|
|
43
|
+
}
|
|
44
|
+
const specBody = `${buildSpecBody(laneCommand, dispatch.workItem, phase)}
|
|
45
|
+
## Execution
|
|
46
|
+
|
|
47
|
+
- Provider: ${singleLine(dispatch.execution.provider)}
|
|
48
|
+
- Model: ${singleLine(dispatch.execution.model)}
|
|
49
|
+
- Command: ${providerCommandText}
|
|
50
|
+
`;
|
|
51
|
+
const specPath = path.join(metadataRoot, "spec.md");
|
|
52
|
+
await fs.writeFile(specPath, specBody, "utf8");
|
|
53
|
+
await fs.writeFile(path.join(metadataRoot, "spec.meta.json"), JSON.stringify({ schema_version: 1, status: "approved", produced_by: "forge-lane-command" }) + "\n", "utf8");
|
|
54
|
+
const changesetPath = path.join(worktree.worktreePath, "FORGE_PHASE5_CHANGESET.md");
|
|
55
|
+
const changesetBody = `# Forge Phase 5 bridge changeset\n\nWork item: ${dispatch.workItem.id}\nTitle: ${dispatch.workItem.title}\nBranch: ${worktree.branchName}\nProvider: ${singleLine(dispatch.execution.provider)}\nModel: ${singleLine(dispatch.execution.model)}\nCommand: ${providerCommandText}\n\nThis deterministic file is written by forge-bridge run-once through the shared session/worktree service path.\n`;
|
|
56
|
+
await fs.writeFile(changesetPath, changesetBody, "utf8");
|
|
57
|
+
await this.git.run(worktree.worktreePath, ["add", "FORGE_PHASE5_CHANGESET.md"]);
|
|
58
|
+
await this.git.run(worktree.worktreePath, ["commit", "--allow-empty", "-m", `forge bridge changeset for ${dispatch.workItem.id.slice(0, 8)}`]);
|
|
59
|
+
await context.emit({
|
|
60
|
+
role: "worker",
|
|
61
|
+
kind: "file_edit",
|
|
62
|
+
content: `Created bridge changeset at ${changesetPath}`,
|
|
63
|
+
eventType: "changeset"
|
|
64
|
+
});
|
|
65
|
+
const phases = debugCycle
|
|
66
|
+
? debugCompletionPhaseOrder
|
|
67
|
+
: developCycle
|
|
68
|
+
? ["implementation", "self_review", "validation"]
|
|
69
|
+
: [phase];
|
|
70
|
+
const completionArtifacts = [];
|
|
71
|
+
for (const completionPhase of phases) {
|
|
72
|
+
await writeCompletionArtifact({
|
|
73
|
+
worktreePath: worktree.worktreePath,
|
|
74
|
+
workItemId: dispatch.workItem.id,
|
|
75
|
+
phase: completionPhase,
|
|
76
|
+
producedBy: "forge-bridge",
|
|
77
|
+
redactionSecrets: exactRedactionSecrets(dispatch)
|
|
78
|
+
}, isDebugCompletionPhaseForProvider(completionPhase)
|
|
79
|
+
? expectedDebugCompletionToolName(completionPhase)
|
|
80
|
+
: expectedCompletionToolName(completionPhase), deterministicCompletionPayload(completionPhase, dispatch, changesetBody));
|
|
81
|
+
const completionArtifact = await readCompletionArtifact(worktree.worktreePath, dispatch.workItem.id, completionPhase);
|
|
82
|
+
if (!completionArtifact) {
|
|
83
|
+
throw new Error(`Deterministic provider did not produce the Forge ${completionPhase} completion artifact.`);
|
|
84
|
+
}
|
|
85
|
+
completionArtifacts.push(completionArtifact);
|
|
86
|
+
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, completionArtifact);
|
|
87
|
+
await context.emit({
|
|
88
|
+
role: "assistant",
|
|
89
|
+
kind: "message",
|
|
90
|
+
content: `${completionPhase.replace(/_/g, " ")} complete. forge-bridge produced deterministic phase artifacts.`,
|
|
91
|
+
eventType: phaseCompleteEventType(completionPhase)
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
await context.emit(buildProviderUsageEvent(dispatch, estimatedDeterministicUsage()));
|
|
95
|
+
return {
|
|
96
|
+
summary: `forge-bridge completed ${worktree.branchName} (${debugCycle ? "debug cycle" : developCycle ? "develop cycle" : phase}).`,
|
|
97
|
+
spec: {
|
|
98
|
+
repoPath: worktree.worktreePath,
|
|
99
|
+
path: specPath,
|
|
100
|
+
body: specBody,
|
|
101
|
+
producedBy: "forge-lane-command",
|
|
102
|
+
status: "approved"
|
|
103
|
+
},
|
|
104
|
+
artifact: completionArtifacts[0],
|
|
105
|
+
artifacts: completionArtifacts
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
async runArchitect(context) {
|
|
109
|
+
const { dispatch, worktree } = context;
|
|
110
|
+
const metadataRoot = path.join(worktree.worktreePath, ".forge", "work-items", dispatch.workItem.id);
|
|
111
|
+
await fs.mkdir(metadataRoot, { recursive: true });
|
|
112
|
+
const specBody = `---\ntitle: "${dispatch.workItem.title}"\nstatus: pending_approval\nproduced_by: forge-bridge\n---\n\n# ${dispatch.workItem.title}\n\nArchitect plan pending approval.\n`;
|
|
113
|
+
const specPath = path.join(metadataRoot, "spec.md");
|
|
114
|
+
await fs.writeFile(specPath, specBody, "utf8");
|
|
115
|
+
await fs.writeFile(path.join(metadataRoot, "spec.meta.json"), JSON.stringify({ schema_version: 1, status: "pending_approval", produced_by: "forge-bridge" }) + "\n", "utf8");
|
|
116
|
+
await writeCompletionArtifact({
|
|
117
|
+
worktreePath: worktree.worktreePath,
|
|
118
|
+
workItemId: dispatch.workItem.id,
|
|
119
|
+
phase: "architect",
|
|
120
|
+
producedBy: "forge-bridge",
|
|
121
|
+
redactionSecrets: exactRedactionSecrets(dispatch),
|
|
122
|
+
architectCycle: true
|
|
123
|
+
}, expectedCompletionToolName("architect"), deterministicArchitectPayload(dispatch));
|
|
124
|
+
const artifact = await readCompletionArtifact(worktree.worktreePath, dispatch.workItem.id, "architect");
|
|
125
|
+
if (!artifact) {
|
|
126
|
+
throw new Error("Deterministic provider did not produce the Forge Architect completion artifact.");
|
|
127
|
+
}
|
|
128
|
+
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, artifact);
|
|
129
|
+
await emitArchitectStructuredEvents(context.emit, worktree.worktreePath, dispatch.workItem.id, artifact);
|
|
130
|
+
await context.emit({
|
|
131
|
+
role: "assistant",
|
|
132
|
+
kind: "message",
|
|
133
|
+
content: "Architect plan complete. forge-bridge produced deterministic planning artifacts.",
|
|
134
|
+
eventType: "architect_complete"
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
summary: "forge-bridge completed Architect plan (deterministic).",
|
|
138
|
+
spec: {
|
|
139
|
+
repoPath: worktree.worktreePath,
|
|
140
|
+
path: specPath,
|
|
141
|
+
body: specBody,
|
|
142
|
+
producedBy: "forge-bridge",
|
|
143
|
+
status: "pending_approval"
|
|
144
|
+
},
|
|
145
|
+
artifact,
|
|
146
|
+
artifacts: [artifact]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async runQa(context) {
|
|
150
|
+
const { dispatch, worktree } = context;
|
|
151
|
+
await context.emit({
|
|
152
|
+
role: "worker",
|
|
153
|
+
kind: "message",
|
|
154
|
+
content: `Planning ${dispatch.execution.provider} QA checks through forge-bridge.`,
|
|
155
|
+
eventType: "qa_plan"
|
|
156
|
+
});
|
|
157
|
+
const qaBrowser = dispatch.qaBrowser;
|
|
158
|
+
const launchTarget = qaBrowser?.launchTarget ?? null;
|
|
159
|
+
const missingLaunchTarget = qaBrowser?.required === true && !hasLaunchTarget(launchTarget);
|
|
160
|
+
const browserSidecar = !missingLaunchTarget && qaBrowser?.required === true && launchTarget
|
|
161
|
+
? deterministicBrowserSidecar(dispatch.workItem.id, launchTarget, dispatch.cycleRun.ownerType, dispatch.cycleRun.ownerId)
|
|
162
|
+
: null;
|
|
163
|
+
const browserChecks = browserSidecar && launchTarget
|
|
164
|
+
? [deterministicBrowserCheck(launchTarget, browserSidecar.relativePath)]
|
|
165
|
+
: [];
|
|
166
|
+
const sidecars = await writeQaSidecarFiles(worktree.worktreePath, browserSidecar ? [browserSidecar] : []);
|
|
167
|
+
const summary = missingLaunchTarget
|
|
168
|
+
? "QA blocked because browser testing is required but no app launch target was provided."
|
|
169
|
+
: "All checks passed. forge-bridge QA completed.";
|
|
170
|
+
const criterion = dispatch.workItem.acceptanceCriteria.trim() || "Forge QA evidence exists";
|
|
171
|
+
for (const gate of qaCompletionGateOrder) {
|
|
172
|
+
await writeCompletionArtifact({
|
|
173
|
+
worktreePath: worktree.worktreePath,
|
|
174
|
+
workItemId: dispatch.workItem.id,
|
|
175
|
+
phase: "qa",
|
|
176
|
+
producedBy: "forge-bridge",
|
|
177
|
+
redactionSecrets: exactRedactionSecrets(dispatch),
|
|
178
|
+
qaCycle: true,
|
|
179
|
+
ownerType: dispatch.cycleRun.ownerType ?? undefined,
|
|
180
|
+
ownerId: dispatch.cycleRun.ownerId ?? undefined
|
|
181
|
+
}, expectedQaCompletionToolName(gate), deterministicQaGatePayload({
|
|
182
|
+
gate,
|
|
183
|
+
criterion,
|
|
184
|
+
summary,
|
|
185
|
+
missingLaunchTarget,
|
|
186
|
+
browserChecks,
|
|
187
|
+
sidecars
|
|
188
|
+
}));
|
|
189
|
+
const gateArtifact = await readQaGateArtifact(qaArtifactRootForDispatch(worktree.worktreePath, dispatch.workItem.id, dispatch), gate);
|
|
190
|
+
if (gateArtifact) {
|
|
191
|
+
await emitQaGateAccepted(context.emit, worktree.worktreePath, gateArtifact, nextQaGate(gate));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const qaArtifact = await readQaCompletionArtifactBundle(worktree.worktreePath, dispatch.workItem.id, dispatch.cycleRun.ownerType, dispatch.cycleRun.ownerId);
|
|
195
|
+
if (!qaArtifact) {
|
|
196
|
+
throw new Error("Deterministic QA did not produce the complete durable QA artifact bundle.");
|
|
197
|
+
}
|
|
198
|
+
await emitQaArtifactRecorded(context.emit, worktree.worktreePath, qaArtifact);
|
|
199
|
+
await emitQaStructuredEvents(context.emit, qaArtifact);
|
|
200
|
+
await context.emit(buildProviderUsageEvent(dispatch, estimatedDeterministicUsage()));
|
|
201
|
+
return {
|
|
202
|
+
summary: missingLaunchTarget ? "forge-bridge QA blocked." : "forge-bridge QA passed.",
|
|
203
|
+
artifact: qaArtifact,
|
|
204
|
+
artifacts: [qaArtifact]
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
async runCiRepair(context) {
|
|
208
|
+
return await this.runPullRequestRepair(context, "ci_repair");
|
|
209
|
+
}
|
|
210
|
+
async runConflictResolve(context) {
|
|
211
|
+
return await this.runPullRequestRepair(context, "conflict_resolve");
|
|
212
|
+
}
|
|
213
|
+
async runPullRequestRepair(context, route) {
|
|
214
|
+
const { dispatch, worktree } = context;
|
|
215
|
+
await assertRepairHeadEpoch(context, this.git);
|
|
216
|
+
const repairChecks = route === "ci_repair" || isPullRequestCheckRepairDispatch(dispatch);
|
|
217
|
+
const addressComments = isPullRequestCommentsDispatch(dispatch);
|
|
218
|
+
let repairArtifact = null;
|
|
219
|
+
let repairSpec = null;
|
|
220
|
+
if (repairChecks) {
|
|
221
|
+
const metadataRoot = path.join(worktree.worktreePath, ".forge", "work-items", dispatch.workItem.id);
|
|
222
|
+
await fs.mkdir(metadataRoot, { recursive: true });
|
|
223
|
+
const laneCommand = selectLaneCommand(dispatch.artifacts, dispatch.execution.lane, dispatch.cycleRun.phase);
|
|
224
|
+
if (!laneCommand)
|
|
225
|
+
throw new Error("Deterministic CI repair could not materialize the approved lane spec.");
|
|
226
|
+
const specBody = buildSpecBody(laneCommand, dispatch.workItem, "ci_repair");
|
|
227
|
+
const specPath = path.join(metadataRoot, "spec.md");
|
|
228
|
+
await fs.writeFile(specPath, specBody, "utf8");
|
|
229
|
+
await fs.writeFile(path.join(metadataRoot, "spec.meta.json"), `${JSON.stringify({ schema_version: 1, status: "approved", produced_by: "forge-lane-command" })}\n`, "utf8");
|
|
230
|
+
repairSpec = { repoPath: worktree.worktreePath, path: specPath, body: specBody, producedBy: "forge-lane-command", status: "approved" };
|
|
231
|
+
await writeCiRepairReadinessManifest(dispatch, worktree.worktreePath, specPath, context.runtimeEnvironment);
|
|
232
|
+
const reference = await writeCompletionArtifact({
|
|
233
|
+
worktreePath: worktree.worktreePath,
|
|
234
|
+
workItemId: dispatch.workItem.id,
|
|
235
|
+
phase: "ci_repair",
|
|
236
|
+
producedBy: "forge-deterministic-provider",
|
|
237
|
+
}, expectedCompletionToolName("ci_repair"), deterministicCiRepairPayload());
|
|
238
|
+
repairArtifact = await readCompletionArtifact(worktree.worktreePath, dispatch.workItem.id, "ci_repair");
|
|
239
|
+
if (!repairArtifact)
|
|
240
|
+
throw new Error(`Deterministic CI repair did not produce ${reference.path}.`);
|
|
241
|
+
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, repairArtifact);
|
|
242
|
+
}
|
|
243
|
+
if (addressComments) {
|
|
244
|
+
const actionable = dispatch.pullRequest?.reviewFindings.filter(finding => finding.actionable) ?? [];
|
|
245
|
+
if (actionable.length === 0 || !dispatch.pullRequest?.reviewIssueKey || !dispatch.pullRequest.headSha) {
|
|
246
|
+
throw new Error("Deterministic comment repair requires a durable actionable finding snapshot.");
|
|
247
|
+
}
|
|
248
|
+
await writeCompletionArtifact({
|
|
249
|
+
worktreePath: worktree.worktreePath,
|
|
250
|
+
workItemId: dispatch.workItem.id,
|
|
251
|
+
phase: "comment_repair",
|
|
252
|
+
producedBy: "forge-deterministic-provider",
|
|
253
|
+
}, expectedCompletionToolName("comment_repair"), {
|
|
254
|
+
status: "pass",
|
|
255
|
+
summary: "Recorded deterministic decision-required outcomes without changing source.",
|
|
256
|
+
repair_head_sha: dispatch.pullRequest.headSha,
|
|
257
|
+
repair_issue_key: dispatch.pullRequest.reviewIssueKey,
|
|
258
|
+
dispositions: actionable.map(finding => ({
|
|
259
|
+
claim_id: finding.claimId,
|
|
260
|
+
kind: finding.kind,
|
|
261
|
+
body_sha256: finding.bodySha256,
|
|
262
|
+
disposition: "needs_decision",
|
|
263
|
+
evidence: "The deterministic provider cannot evaluate semantic review feedback."
|
|
264
|
+
})),
|
|
265
|
+
changed_files: [],
|
|
266
|
+
validation: []
|
|
267
|
+
});
|
|
268
|
+
repairArtifact = await readCompletionArtifact(worktree.worktreePath, dispatch.workItem.id, "comment_repair");
|
|
269
|
+
if (!repairArtifact)
|
|
270
|
+
throw new Error("Deterministic comment repair did not produce its completion artifact.");
|
|
271
|
+
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, repairArtifact);
|
|
272
|
+
}
|
|
273
|
+
await commitWorktreeChanges(this.git, worktree.worktreePath, dispatch.workItem.id);
|
|
274
|
+
await context.emit(buildProviderUsageEvent(dispatch, estimatedDeterministicUsage()));
|
|
275
|
+
await context.emit({
|
|
276
|
+
role: "assistant",
|
|
277
|
+
kind: "message",
|
|
278
|
+
content: repairChecks
|
|
279
|
+
? `Deterministic CI repair completed for ${worktree.branchName}.`
|
|
280
|
+
: addressComments
|
|
281
|
+
? `Deterministic PR comment addressing completed for ${worktree.branchName}.`
|
|
282
|
+
: `Deterministic conflict resolve completed for ${worktree.branchName}.`,
|
|
283
|
+
eventType: repairChecks ? "pr_checks_complete" : addressComments ? "pr_comments_complete" : "conflict_resolve_complete"
|
|
284
|
+
});
|
|
285
|
+
return {
|
|
286
|
+
summary: repairChecks
|
|
287
|
+
? `forge-bridge repaired PR checks for ${worktree.branchName}.`
|
|
288
|
+
: addressComments
|
|
289
|
+
? `forge-bridge addressed PR comments for ${worktree.branchName}.`
|
|
290
|
+
: `forge-bridge resolved conflicts for ${worktree.branchName}.`,
|
|
291
|
+
spec: repairSpec,
|
|
292
|
+
artifact: repairArtifact,
|
|
293
|
+
artifacts: repairArtifact ? [repairArtifact] : [],
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function deterministicCiRepairPayload() {
|
|
298
|
+
const command = { command: "forge deterministic ci-repair validation", exit_code: 0, status: "pass", summary: "Deterministic CI repair fixture passed." };
|
|
299
|
+
return {
|
|
300
|
+
status: "pass",
|
|
301
|
+
summary: "Deterministic CI repair handoff is ready for provider checks.",
|
|
302
|
+
failed_checks: [{ name: "CI / deterministic", provider_state: "failure", workflow: ".github/workflows/ci.yml", job: "deterministic", step: "fixture" }],
|
|
303
|
+
root_cause: { classification: "test expectation mismatch", summary: "Deterministic fixture failure repaired.", evidence: ["Fixture provider reported the expected failed check."] },
|
|
304
|
+
changed_files: [],
|
|
305
|
+
no_code_action: { action: "deterministic_fixture", reason: "The deterministic provider models the repair without a product diff." },
|
|
306
|
+
narrow_validation: [command],
|
|
307
|
+
workflow_validation: [{ step: "deterministic fixture", equivalence: "supported", command: command.command, exit_code: 0, status: "pass", summary: command.summary }],
|
|
308
|
+
broader_validation: [command],
|
|
309
|
+
remaining_risks: [],
|
|
310
|
+
provider_state: "ready_for_rerun",
|
|
311
|
+
ready_for_push: true,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
function deterministicDraftPayload(dispatch) {
|
|
315
|
+
const kind = dispatch.draft?.kind ?? "work_item";
|
|
316
|
+
if (kind === "work_order_decomposition") {
|
|
317
|
+
return {
|
|
318
|
+
summary: "Fake decompose proposed a Feature DAG for the Work Order.",
|
|
319
|
+
blockedReason: "",
|
|
320
|
+
candidates: [
|
|
321
|
+
{
|
|
322
|
+
origin: "agent",
|
|
323
|
+
key: "intake-submission",
|
|
324
|
+
title: "Customer intake submission",
|
|
325
|
+
summary: "Collect, validate, de-duplicate, and confirm incoming customer requests.",
|
|
326
|
+
planningPacket: "# Customer intake submission\n\nPlan Stories for request form validation, attachment support, duplicate prevention, and submission confirmation.",
|
|
327
|
+
sortOrder: 10,
|
|
328
|
+
dependsOn: []
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
origin: "agent",
|
|
332
|
+
key: "review-queue",
|
|
333
|
+
title: "Reviewer triage queue",
|
|
334
|
+
summary: "Provide reviewer triage, assignment, notes, status transitions, and audit trail.",
|
|
335
|
+
planningPacket: "# Reviewer triage queue\n\nPlan Stories for queue filtering, assignment, reviewer notes, status changes, and immutable audit trail.",
|
|
336
|
+
sortOrder: 20,
|
|
337
|
+
dependsOn: ["intake-submission"]
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
if (kind === "feature_decomposition") {
|
|
343
|
+
return {
|
|
344
|
+
summary: "Fake decompose proposed a Story DAG for the Feature.",
|
|
345
|
+
blockedReason: "",
|
|
346
|
+
candidates: [
|
|
347
|
+
{
|
|
348
|
+
origin: "agent",
|
|
349
|
+
key: "foundation",
|
|
350
|
+
title: "Build the feature foundation",
|
|
351
|
+
description: "Create the persistence, API, and UI shell needed by the feature.",
|
|
352
|
+
acceptanceCriteria: "Scenario: Foundation exists\nGiven the Feature is selected\nWhen the foundation is delivered\nThen downstream Stories can build on stable contracts",
|
|
353
|
+
points: 3,
|
|
354
|
+
sortOrder: 10,
|
|
355
|
+
dependsOn: []
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
origin: "agent",
|
|
359
|
+
key: "workflow-behavior",
|
|
360
|
+
title: "Implement the primary workflow behavior",
|
|
361
|
+
description: "Implement the main user-visible behavior for the feature after the foundation is ready.",
|
|
362
|
+
acceptanceCriteria: "Scenario: Workflow behavior works\nGiven the foundation Story is complete\nWhen the user performs the primary workflow\nThen the expected state change and feedback are visible",
|
|
363
|
+
points: 5,
|
|
364
|
+
sortOrder: 20,
|
|
365
|
+
dependsOn: ["foundation"]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
origin: "agent",
|
|
369
|
+
key: "audit-and-tests",
|
|
370
|
+
title: "Add audit coverage and regression tests",
|
|
371
|
+
description: "Add audit/evidence behavior and automated regression coverage for the feature.",
|
|
372
|
+
acceptanceCriteria: "Scenario: Feature is verifiable\nGiven the workflow behavior is complete\nWhen validation runs\nThen audit evidence and tests cover the expected outcomes",
|
|
373
|
+
points: 3,
|
|
374
|
+
sortOrder: 30,
|
|
375
|
+
dependsOn: ["workflow-behavior"]
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
if (kind === "work_order") {
|
|
381
|
+
return {
|
|
382
|
+
title: "Deterministic runner Work Order draft",
|
|
383
|
+
summary: "Forge Runner generated this deterministic Work Order draft.",
|
|
384
|
+
objective: "Validate runner-backed Draft generation.",
|
|
385
|
+
planningPacket: "Runner-backed draft generation returned a Work Order JSON payload.",
|
|
386
|
+
decompositionContext: "Use this deterministic fixture only in bridge tests.",
|
|
387
|
+
assumptions: ["Forge Runner dispatch is available."],
|
|
388
|
+
warnings: []
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
if (kind === "story") {
|
|
392
|
+
return {
|
|
393
|
+
title: "Deterministic runner Story draft",
|
|
394
|
+
description: "Forge Runner generated this deterministic Story draft.",
|
|
395
|
+
acceptanceCriteria: "Given runner-backed Draft generation, when Forge requests a Story draft, then JSON is returned.",
|
|
396
|
+
points: 3
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
title: "Deterministic runner Work Item draft",
|
|
401
|
+
description: "Forge Runner generated this deterministic Work Item draft.",
|
|
402
|
+
acceptanceCriteria: "Given runner-backed Draft generation, when Forge requests a draft, then JSON is returned.",
|
|
403
|
+
reproSteps: "Run Draft with a Forge Runner provider selected.",
|
|
404
|
+
systemInfo: "forge-bridge deterministic provider",
|
|
405
|
+
points: 1
|
|
406
|
+
};
|
|
407
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type LaunchCommand } from "../../shared/process/windows-launch.js";
|
|
2
|
+
export declare const PROVIDER_OUTPUT_CAPTURE_LIMIT_CHARS: number;
|
|
3
|
+
export type ProviderCliCommand = LaunchCommand;
|
|
4
|
+
export interface ProviderProcessRunRequest {
|
|
5
|
+
readonly command: string;
|
|
6
|
+
readonly args: readonly string[];
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
9
|
+
readonly stdin?: string;
|
|
10
|
+
readonly captureOutput?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Exact process-local values that must be removed from rejected errors and
|
|
13
|
+
* supervisor persistence. This metadata is consumed by the attempt
|
|
14
|
+
* supervisor and is never forwarded to the child process.
|
|
15
|
+
*/
|
|
16
|
+
readonly failureRedactionValues?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface ProviderProcessRunResult {
|
|
19
|
+
readonly exitCode: number;
|
|
20
|
+
readonly stdout: string;
|
|
21
|
+
readonly stderr: string;
|
|
22
|
+
readonly peakMemoryBytes?: number;
|
|
23
|
+
readonly memorySampleCount?: number;
|
|
24
|
+
readonly memorySource?: string;
|
|
25
|
+
readonly memoryObservedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ProviderProcessRunner {
|
|
28
|
+
run(request: ProviderProcessRunRequest, handlers?: ProviderProcessHandlers, signal?: AbortSignal): Promise<ProviderProcessRunResult>;
|
|
29
|
+
}
|
|
30
|
+
export interface ProviderProcessHandlers {
|
|
31
|
+
onStarted?(): Promise<void> | void;
|
|
32
|
+
onStdoutLine?(line: string): Promise<void> | void;
|
|
33
|
+
onStderrLine?(line: string): Promise<void> | void;
|
|
34
|
+
}
|
|
35
|
+
/** Recovery must wrap the attempt coordinator, never its raw OS runner. Each
|
|
36
|
+
* relaunch needs a new fenced child generation and exclusive launch files. */
|
|
37
|
+
export declare function recoveringProviderProcessRunner(inner: ProviderProcessRunner): ProviderProcessRunner;
|
|
38
|
+
/**
|
|
39
|
+
* Codex Desktop and an independently installed Codex CLI can briefly disagree
|
|
40
|
+
* about the shared models-cache schema during a rolling upgrade. Recover only
|
|
41
|
+
* that exact failure by quarantining the bounded cache file and retrying once;
|
|
42
|
+
* auth, config, sessions, and every other CODEX_HOME entry remain untouched.
|
|
43
|
+
*/
|
|
44
|
+
export declare class CodexModelsCacheRecoveringProcessRunner implements ProviderProcessRunner {
|
|
45
|
+
private readonly inner;
|
|
46
|
+
constructor(inner: ProviderProcessRunner);
|
|
47
|
+
run(request: ProviderProcessRunRequest, handlers?: ProviderProcessHandlers, signal?: AbortSignal): Promise<ProviderProcessRunResult>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Some Codex CLI builds can start new turns but cannot resume an older thread
|
|
51
|
+
* because the backing app does not implement the paginated thread lookup RPC.
|
|
52
|
+
* Preserve the prepared worktree and prompt, then retry once as a fresh turn.
|
|
53
|
+
*/
|
|
54
|
+
export declare class CodexResumeRecoveringProcessRunner implements ProviderProcessRunner {
|
|
55
|
+
private readonly inner;
|
|
56
|
+
constructor(inner: ProviderProcessRunner);
|
|
57
|
+
run(request: ProviderProcessRunRequest, handlers?: ProviderProcessHandlers, signal?: AbortSignal): Promise<ProviderProcessRunResult>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Recognizes the exact nonzero Codex service response at the provider-process
|
|
61
|
+
* boundary. Provider stdout is deliberately excluded because it can contain
|
|
62
|
+
* arbitrary tool/command output and therefore cannot mint retry authority.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isTransientCodexProviderNotFoundFailure(command: string, result: ProviderProcessRunResult): boolean;
|
|
65
|
+
interface ProviderChildEnvironmentOptions {
|
|
66
|
+
readonly parentEnv?: NodeJS.ProcessEnv;
|
|
67
|
+
readonly platform?: NodeJS.Platform;
|
|
68
|
+
readonly homeDir?: string;
|
|
69
|
+
}
|
|
70
|
+
export declare function buildProviderChildEnvironment(requestEnv?: Readonly<Record<string, string>>, options?: ProviderChildEnvironmentOptions): NodeJS.ProcessEnv;
|
|
71
|
+
export declare class StreamingProviderProcessRunner implements ProviderProcessRunner {
|
|
72
|
+
private readonly terminalExitGraceMs;
|
|
73
|
+
constructor(terminalExitGraceMs?: number);
|
|
74
|
+
run(request: ProviderProcessRunRequest, handlers?: ProviderProcessHandlers, signal?: AbortSignal): Promise<ProviderProcessRunResult>;
|
|
75
|
+
}
|
|
76
|
+
/** Returns aggregate resident bytes for the exact supervised Unix process group. */
|
|
77
|
+
export declare function processGroupResidentMemoryBytes(processGroupId: number, platform?: NodeJS.Platform, procRoot?: string): number | null;
|
|
78
|
+
export declare function resolveCodexNpmDirectLaunch(commandPath: string, args: readonly string[]): LaunchCommand | null;
|
|
79
|
+
/**
|
|
80
|
+
* npm installs of Claude Code (`npm i -g @anthropic-ai/claude-code`) put a `claude.cmd` shim on
|
|
81
|
+
* PATH; launch its cli.js directly for the same Job Object reasons as Codex. The native installer
|
|
82
|
+
* ships `claude.exe`, which is preferred by PATH resolution and needs no rewrite.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveClaudeNpmDirectLaunch(commandPath: string, args: readonly string[]): LaunchCommand | null;
|
|
85
|
+
/**
|
|
86
|
+
* Avoids cmd.exe's nested-quote handling for package-manager shims. That
|
|
87
|
+
* quoting loses executable paths containing spaces after the command is
|
|
88
|
+
* wrapped by the Windows Job Object supervisor.
|
|
89
|
+
*/
|
|
90
|
+
export declare function resolvePackageManagerDirectLaunch(commandPath: string, args: readonly string[]): LaunchCommand | null;
|
|
91
|
+
/**
|
|
92
|
+
* Resolves Windows commands without spawning where.exe. Runtime launches can
|
|
93
|
+
* happen while the machine is under enough process pressure for where.exe to
|
|
94
|
+
* miss its timeout; returning the unresolved package-manager name in that case
|
|
95
|
+
* makes Node fall back to a shell shim that cannot survive Job Object wrapping.
|
|
96
|
+
*/
|
|
97
|
+
export declare function resolveWindowsCommandFromPath(command: string, pathValue?: string, pathExtValue?: string): string | null;
|
|
98
|
+
export declare function chooseWindowsCommandCandidate(candidates: readonly string[]): string | null;
|
|
99
|
+
export {};
|