@loucompanion/forge-bridge 0.1.3-dev.fbe15023cdfe → 0.1.4-dev.028808a841c8
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 +89 -3
- 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 +4 -1
- package/dist/bridge/bridge.service.d.ts +83 -3
- package/dist/bridge/bridge.service.js +1609 -152
- package/dist/bridge/bridge.types.d.ts +52 -1
- package/dist/bridge/dispatch-result-outbox.d.ts +35 -0
- package/dist/bridge/dispatch-result-outbox.js +87 -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 +1 -0
- package/dist/cleanup/cleanup.service.js +70 -9
- package/dist/cli/cli.help.js +4 -4
- package/dist/cli/cli.service.d.ts +14 -6
- package/dist/cli/cli.service.js +75 -16
- package/dist/cli/local-config.d.ts +1 -0
- package/dist/cli/local-config.js +4 -0
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +36 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +341 -0
- package/dist/runtime/attempt-database-broker.d.ts +89 -0
- package/dist/runtime/attempt-database-broker.js +390 -0
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +2 -1
- package/dist/runtime/attempt-node-runtime-launcher.js +57 -18
- 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.d.ts +35 -0
- package/dist/runtime/attempt-process-supervisor.js +144 -23
- 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 +10 -0
- package/dist/runtime/generated-output-reset.js +62 -8
- package/dist/runtime/host-database-capability-boundary.d.ts +16 -0
- package/dist/runtime/host-database-capability-boundary.js +63 -0
- package/dist/runtime/host-diagnostics.d.ts +11 -0
- package/dist/runtime/host-diagnostics.js +192 -0
- package/dist/runtime/host-execution-root.d.ts +4 -0
- package/dist/runtime/host-execution-root.js +39 -0
- package/dist/runtime/host-facts.d.ts +35 -0
- package/dist/runtime/host-facts.js +95 -0
- package/dist/runtime/host-listener-inspector.d.ts +8 -1
- package/dist/runtime/host-listener-inspector.js +121 -60
- package/dist/runtime/host-load-sampler.d.ts +83 -0
- package/dist/runtime/host-load-sampler.js +164 -0
- package/dist/runtime/host-pressure-stall.d.ts +41 -0
- package/dist/runtime/host-pressure-stall.js +121 -0
- package/dist/runtime/host-runtime-contract.d.ts +13 -1
- package/dist/runtime/host-runtime-contract.js +170 -55
- package/dist/runtime/host-runtime-lease.d.ts +92 -8
- package/dist/runtime/host-runtime-lease.js +1193 -120
- package/dist/runtime/host-runtime-promotion.d.ts +12 -3
- package/dist/runtime/host-runtime-promotion.js +59 -12
- package/dist/runtime/managed-command-teardown.d.ts +62 -0
- package/dist/runtime/managed-command-teardown.js +607 -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 +3 -0
- package/dist/runtime/node-host-runtime-adapter.js +29 -11
- 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-browser-cache.d.ts +39 -0
- package/dist/runtime/playwright-browser-cache.js +227 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +12 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +100 -58
- 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.js +4 -1
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/preflight.d.ts +31 -1
- package/dist/sandbox/preflight.js +237 -51
- package/dist/sandbox/repository-lock.d.ts +2 -1
- package/dist/sandbox/repository-lock.js +19 -9
- package/dist/sandbox/runtime.d.ts +6 -1
- package/dist/sandbox/runtime.js +137 -107
- package/dist/sandbox/sandbox.types.d.ts +7 -0
- package/dist/sandbox/workspace.service.js +2 -0
- package/dist/session/managed-attempt-tools.d.ts +42 -1
- package/dist/session/managed-attempt-tools.js +692 -40
- package/dist/session/managed-build-coordinator.d.ts +5 -0
- package/dist/session/managed-build-coordinator.js +109 -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 +17 -0
- package/dist/session/phase-completion.artifacts.js +228 -22
- package/dist/session/phase-completion.d.ts +11 -1
- package/dist/session/phase-completion.helpers.d.ts +5 -0
- package/dist/session/phase-completion.helpers.js +30 -7
- package/dist/session/phase-completion.js +14 -3
- package/dist/session/phase-completion.prompts.js +17 -18
- package/dist/session/phase-completion.runtime.d.ts +3 -1
- package/dist/session/phase-completion.runtime.js +148 -34
- package/dist/session/phase-completion.schemas.js +49 -2
- package/dist/session/phase-completion.validation.d.ts +1 -0
- package/dist/session/phase-completion.validation.js +111 -21
- package/dist/session/pre-publication-process.d.ts +20 -0
- package/dist/session/pre-publication-process.js +97 -0
- package/dist/session/pre-publication-skipped-tests.d.ts +21 -0
- package/dist/session/pre-publication-skipped-tests.js +109 -0
- package/dist/session/pre-publication-validation.d.ts +75 -0
- package/dist/session/pre-publication-validation.js +631 -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 +8 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +23 -3
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +6 -3
- package/dist/session/provider-cli/provider-cli.artifacts.js +62 -22
- package/dist/session/provider-cli/provider-cli.deterministic.js +34 -2
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +80 -0
- package/dist/session/provider-cli/provider-cli.process.js +694 -28
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +10 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +151 -16
- 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 +14 -1
- package/dist/session/provider-cli/provider-cli.runtime.js +54 -3
- package/dist/session/provider-cli/provider-cli.service.d.ts +30 -5
- package/dist/session/provider-cli/provider-cli.service.js +858 -77
- package/dist/session/provider-cli/provider-cli.types.d.ts +2 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +6 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +47 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +16 -0
- package/dist/session/provider-cli/provider-output-state.js +370 -17
- package/dist/session/provider-cli/provider-usage.d.ts +9 -1
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/publishable-worktree-changes.d.ts +54 -0
- package/dist/session/publishable-worktree-changes.js +193 -0
- package/dist/session/session-redaction.js +434 -9
- package/dist/session/session.service.js +145 -23
- package/dist/session/session.types.d.ts +147 -2
- package/dist/session/session.types.js +599 -7
- 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 +18 -0
- 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.js +3 -2
- package/dist/shared/process/host-process-supervisor.d.ts +2 -0
- package/dist/shared/process/host-process-supervisor.js +60 -11
- package/dist/shared/process/process.d.ts +2 -0
- package/dist/shared/process/process.js +12 -7
- package/dist/shared/provider-capabilities.d.ts +3 -0
- package/dist/shared/provider-capabilities.js +85 -0
- package/dist/shared/redaction/redaction.d.ts +1 -0
- package/dist/shared/redaction/redaction.js +39 -3
- package/dist/shared/time/monotonic.d.ts +1 -0
- package/dist/shared/time/monotonic.js +8 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/dependency-warmer.d.ts +41 -9
- package/dist/worktree/dependency-warmer.js +571 -22
- package/dist/worktree/index.d.ts +1 -1
- 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.service.d.ts +7 -0
- package/dist/worktree/worktree.service.js +253 -21
- package/dist/worktree/worktree.types.d.ts +7 -1
- package/package.json +7 -5
- package/runtime/windows-job-supervisor.ps1 +380 -14
|
@@ -3,19 +3,28 @@ export interface HostParallelPromotionRecord {
|
|
|
3
3
|
readonly schemaVersion: 1;
|
|
4
4
|
readonly repoId: string;
|
|
5
5
|
readonly runtimeContractFingerprint: string;
|
|
6
|
+
readonly inputCommitSha?: string | null;
|
|
7
|
+
readonly sourceFingerprint?: string;
|
|
6
8
|
readonly runtimeContractSource?: "project" | "derived";
|
|
7
9
|
readonly observedAt: string;
|
|
8
10
|
readonly observedDispatchAttemptId: string;
|
|
9
11
|
readonly verifiedPortNames: readonly string[];
|
|
10
12
|
}
|
|
13
|
+
export interface HostParallelProofIdentity {
|
|
14
|
+
readonly runtimeContractFingerprint: string;
|
|
15
|
+
readonly inputCommitSha: string;
|
|
16
|
+
readonly sourceFingerprint?: string;
|
|
17
|
+
}
|
|
11
18
|
/** Persists only observed, contract-bound host parallel-safety evidence. */
|
|
12
19
|
export declare class HostParallelPromotionStore {
|
|
13
20
|
private readonly stateRoot;
|
|
14
21
|
constructor(stateRoot: string);
|
|
15
|
-
load(repoId: string): Promise<HostParallelPromotionRecord | null>;
|
|
22
|
+
load(repoId: string, identity?: HostParallelProofIdentity): Promise<HostParallelPromotionRecord | null>;
|
|
16
23
|
list(): Promise<readonly HostParallelPromotionRecord[]>;
|
|
17
|
-
observe(repoId: string, runtimeContract: LoadedHostRuntimeContract, dispatchAttemptId: string, verifiedPortNames: readonly string[]): Promise<HostParallelPromotionRecord>;
|
|
18
|
-
|
|
24
|
+
observe(repoId: string, runtimeContract: LoadedHostRuntimeContract, dispatchAttemptId: string, verifiedPortNames: readonly string[], inputCommitSha?: string, sourceFingerprint?: string): Promise<HostParallelPromotionRecord>;
|
|
25
|
+
private writeRecord;
|
|
26
|
+
private pruneVersions;
|
|
27
|
+
invalidate(repoId: string, scope?: "all" | "discovery"): Promise<void>;
|
|
19
28
|
private recordPath;
|
|
20
29
|
}
|
|
21
30
|
export declare function hostRuntimeContractFingerprint(runtimeContract: LoadedHostRuntimeContract): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
/** Persists only observed, contract-bound host parallel-safety evidence. */
|
|
@@ -7,11 +7,12 @@ export class HostParallelPromotionStore {
|
|
|
7
7
|
constructor(stateRoot) {
|
|
8
8
|
this.stateRoot = stateRoot;
|
|
9
9
|
}
|
|
10
|
-
async load(repoId) {
|
|
10
|
+
async load(repoId, identity) {
|
|
11
11
|
const normalizedRepoId = normalizeRepoId(repoId);
|
|
12
12
|
try {
|
|
13
|
-
const parsed = JSON.parse(await fs.readFile(this.recordPath(normalizedRepoId), "utf8"));
|
|
14
|
-
return validRecord(parsed, normalizedRepoId)
|
|
13
|
+
const parsed = JSON.parse(await fs.readFile(this.recordPath(normalizedRepoId, identity), "utf8"));
|
|
14
|
+
return validRecord(parsed, normalizedRepoId)
|
|
15
|
+
&& (!identity || matchesIdentity(parsed, identity)) ? parsed : null;
|
|
15
16
|
}
|
|
16
17
|
catch (error) {
|
|
17
18
|
if (error.code === "ENOENT" || error instanceof SyntaxError)
|
|
@@ -45,7 +46,7 @@ export class HostParallelPromotionStore {
|
|
|
45
46
|
}
|
|
46
47
|
return records.sort((left, right) => left.repoId.localeCompare(right.repoId));
|
|
47
48
|
}
|
|
48
|
-
async observe(repoId, runtimeContract, dispatchAttemptId, verifiedPortNames) {
|
|
49
|
+
async observe(repoId, runtimeContract, dispatchAttemptId, verifiedPortNames, inputCommitSha, sourceFingerprint) {
|
|
49
50
|
if (!hostRuntimeParallelEligible(runtimeContract)) {
|
|
50
51
|
throw new Error("host_parallel_promotion_ineligible: the runtime contract is not eligible for parallel host execution.");
|
|
51
52
|
}
|
|
@@ -60,15 +61,26 @@ export class HostParallelPromotionStore {
|
|
|
60
61
|
schemaVersion: 1,
|
|
61
62
|
repoId: normalizedRepoId,
|
|
62
63
|
runtimeContractFingerprint: hostRuntimeContractFingerprint(runtimeContract),
|
|
64
|
+
inputCommitSha: inputCommitSha ?? null,
|
|
65
|
+
...(sourceFingerprint ? { sourceFingerprint } : {}),
|
|
63
66
|
runtimeContractSource: runtimeContract.source === "project" ? "project" : "derived",
|
|
64
67
|
observedAt: new Date().toISOString(),
|
|
65
68
|
observedDispatchAttemptId: normalizedUuid(dispatchAttemptId, "dispatch attempt"),
|
|
66
69
|
verifiedPortNames: observedPorts,
|
|
67
70
|
};
|
|
68
|
-
|
|
71
|
+
if (inputCommitSha) {
|
|
72
|
+
await this.writeRecord(this.recordPath(normalizedRepoId, {
|
|
73
|
+
runtimeContractFingerprint: record.runtimeContractFingerprint, inputCommitSha, sourceFingerprint,
|
|
74
|
+
}), record);
|
|
75
|
+
}
|
|
76
|
+
await this.writeRecord(this.recordPath(normalizedRepoId), record);
|
|
77
|
+
await this.pruneVersions(normalizedRepoId);
|
|
78
|
+
return record;
|
|
79
|
+
}
|
|
80
|
+
async writeRecord(target, record) {
|
|
69
81
|
const root = path.dirname(target);
|
|
70
82
|
await ensurePrivateDirectory(root);
|
|
71
|
-
const temporary = `${target}.${
|
|
83
|
+
const temporary = `${target}.${randomUUID()}.tmp`;
|
|
72
84
|
try {
|
|
73
85
|
const handle = await fs.open(temporary, "wx", 0o600);
|
|
74
86
|
try {
|
|
@@ -79,21 +91,56 @@ export class HostParallelPromotionStore {
|
|
|
79
91
|
await handle.close();
|
|
80
92
|
}
|
|
81
93
|
await fs.rename(temporary, target);
|
|
82
|
-
return record;
|
|
83
94
|
}
|
|
84
95
|
catch (error) {
|
|
85
96
|
await fs.rm(temporary, { force: true }).catch(() => undefined);
|
|
86
97
|
throw error;
|
|
87
98
|
}
|
|
88
99
|
}
|
|
89
|
-
async
|
|
90
|
-
|
|
100
|
+
async pruneVersions(repoId) {
|
|
101
|
+
const target = this.recordPath(repoId);
|
|
102
|
+
const root = path.dirname(target);
|
|
103
|
+
const prefix = path.basename(target, ".json") + ".";
|
|
104
|
+
const versions = (await fs.readdir(root)).filter(name => name.startsWith(prefix)
|
|
105
|
+
&& /^[0-9a-f]{64}\.[0-9a-f]{64}\.json$/u.test(name));
|
|
106
|
+
if (versions.length <= 128)
|
|
107
|
+
return;
|
|
108
|
+
const dated = await Promise.all(versions.map(async (name) => ({ name,
|
|
109
|
+
at: await fs.stat(path.join(root, name)).then(stat => stat.mtimeMs, () => Number.MAX_SAFE_INTEGER) })));
|
|
110
|
+
for (const entry of dated.sort((a, b) => b.at - a.at).slice(128)) {
|
|
111
|
+
await fs.rm(path.join(root, entry.name), { force: true });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async invalidate(repoId, scope = "all") {
|
|
115
|
+
const target = this.recordPath(normalizeRepoId(repoId));
|
|
116
|
+
await fs.rm(target, { force: true });
|
|
117
|
+
// Background/default-branch discovery must not erase proofs bound to other
|
|
118
|
+
// prepared sources. Actual containment/cleanup degradation invalidates all.
|
|
119
|
+
if (scope === "discovery")
|
|
120
|
+
return;
|
|
121
|
+
const prefix = path.basename(target, ".json") + ".";
|
|
122
|
+
const entries = await fs.readdir(path.dirname(target)).catch((error) => {
|
|
123
|
+
if (error.code === "ENOENT")
|
|
124
|
+
return [];
|
|
125
|
+
throw error;
|
|
126
|
+
});
|
|
127
|
+
for (const entry of entries.filter(name => name.startsWith(prefix) && /^[0-9a-f]{64}\.[0-9a-f]{64}\.json$/u.test(name))) {
|
|
128
|
+
await fs.rm(path.join(path.dirname(target), entry), { force: true });
|
|
129
|
+
}
|
|
91
130
|
}
|
|
92
|
-
recordPath(normalizedRepoId) {
|
|
131
|
+
recordPath(normalizedRepoId, identity) {
|
|
93
132
|
const key = createHash("sha256").update(normalizedRepoId).digest("hex");
|
|
94
|
-
|
|
133
|
+
const version = identity ? `.${createHash("sha256").update(JSON.stringify([
|
|
134
|
+
identity.runtimeContractFingerprint, identity.inputCommitSha, identity.sourceFingerprint ?? null,
|
|
135
|
+
])).digest("hex")}` : "";
|
|
136
|
+
return path.join(this.stateRoot, "runtime-promotion", "host", `${key}${version}.json`);
|
|
95
137
|
}
|
|
96
138
|
}
|
|
139
|
+
function matchesIdentity(record, identity) {
|
|
140
|
+
return record.runtimeContractFingerprint === identity.runtimeContractFingerprint
|
|
141
|
+
&& record.inputCommitSha === identity.inputCommitSha
|
|
142
|
+
&& record.sourceFingerprint === identity.sourceFingerprint;
|
|
143
|
+
}
|
|
97
144
|
export function hostRuntimeContractFingerprint(runtimeContract) {
|
|
98
145
|
const canonical = JSON.stringify({
|
|
99
146
|
schemaVersion: runtimeContract.contract.schemaVersion,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PinnedDirectoryIdentity } from "./pinned-directory-process.js";
|
|
2
|
+
/**
|
|
3
|
+
* Why Forge stopped a managed command that had not finished:
|
|
4
|
+
* - `owner_exited`: the provider process whose MCP server started it has exited, so no
|
|
5
|
+
* process is left to supervise it or write its receipt.
|
|
6
|
+
* - `attempt_teardown`: the dispatch attempt is being torn down.
|
|
7
|
+
*/
|
|
8
|
+
export type ManagedCommandTeardownReason = "owner_exited" | "attempt_teardown";
|
|
9
|
+
export interface ManagedCommandTeardownScope {
|
|
10
|
+
/** The attempt's private FORGE_LOG_DIR; managed commands record ownership under it. */
|
|
11
|
+
readonly logDirectory: string;
|
|
12
|
+
readonly dispatchAttemptId: string;
|
|
13
|
+
readonly runtimeLeaseId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Reads the ownership records through pinned directory and file identities instead of
|
|
16
|
+
* pathnames. Restart recovery supplies the verified identity of the attempt's logs.
|
|
17
|
+
*/
|
|
18
|
+
readonly pinnedLogDirectory?: PinnedDirectoryIdentity;
|
|
19
|
+
}
|
|
20
|
+
export interface ManagedCommandTeardownOptions {
|
|
21
|
+
readonly reason: ManagedCommandTeardownReason;
|
|
22
|
+
/**
|
|
23
|
+
* Stop only commands whose owning MCP server process is gone. A command whose owner is
|
|
24
|
+
* alive is still supervised by it and must survive wait slices and MCP call boundaries.
|
|
25
|
+
*/
|
|
26
|
+
readonly onlyOrphaned?: boolean;
|
|
27
|
+
readonly graceMs?: number;
|
|
28
|
+
readonly platform?: NodeJS.Platform;
|
|
29
|
+
}
|
|
30
|
+
export type ManagedCommandTeardownOutcomeKind =
|
|
31
|
+
/** The recorded process tree had already exited. */
|
|
32
|
+
"absent"
|
|
33
|
+
/** Forge stopped the recorded process tree and proved it gone. */
|
|
34
|
+
| "terminated"
|
|
35
|
+
/** The recorded root PID now names another process, so the recorded tree is gone. */
|
|
36
|
+
| "pid_reused"
|
|
37
|
+
/** The command's owning MCP server is alive and still supervises it. */
|
|
38
|
+
| "owner_alive"
|
|
39
|
+
/** The command finished on its own; nothing was signalled or rewritten. */
|
|
40
|
+
| "already_terminal"
|
|
41
|
+
/** The command never recorded a process: it was queued, or its launch was interrupted. */
|
|
42
|
+
| "no_process_record";
|
|
43
|
+
export interface ManagedCommandTeardownOutcome {
|
|
44
|
+
readonly commandId: string;
|
|
45
|
+
readonly outcome: ManagedCommandTeardownOutcomeKind;
|
|
46
|
+
readonly receiptFinalized: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Test support: points the Linux process inventory at another directory (null restores /proc). */
|
|
49
|
+
export declare function setManagedCommandProcRootForTesting(root: string | null): void;
|
|
50
|
+
/**
|
|
51
|
+
* Stops managed commands that an attempt's MCP servers started and proves their process
|
|
52
|
+
* trees are gone. Managed commands run in their own process group (Unix) or Job Object
|
|
53
|
+
* (Windows), outside the provider tree that the attempt supervisor stops, so stopping the
|
|
54
|
+
* provider alone leaves them running. Each command's durable receipt is given a terminal
|
|
55
|
+
* status when its owner can no longer write one.
|
|
56
|
+
*
|
|
57
|
+
* Every signal is fenced: the recorded root must still carry the recorded birth identity
|
|
58
|
+
* and, on Linux, this command's supervisor and attempt identity in its environment. A
|
|
59
|
+
* tree that cannot be proven to be the command's own fails the teardown instead of being
|
|
60
|
+
* reported stopped.
|
|
61
|
+
*/
|
|
62
|
+
export declare function terminateAttemptManagedCommands(scope: ManagedCommandTeardownScope, options: ManagedCommandTeardownOptions): Promise<readonly ManagedCommandTeardownOutcome[]>;
|