@loucompanion/forge-bridge 0.1.3-dev.0bd9fb991b79 → 0.1.3-dev.0d26c10244e1

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.
Files changed (127) hide show
  1. package/README.md +35 -0
  2. package/dist/bridge/bridge.base.d.ts +4 -1
  3. package/dist/bridge/bridge.service.d.ts +39 -3
  4. package/dist/bridge/bridge.service.js +585 -56
  5. package/dist/bridge/bridge.types.d.ts +59 -1
  6. package/dist/cleanup/cleanup.service.d.ts +14 -2
  7. package/dist/cleanup/cleanup.service.js +469 -3
  8. package/dist/cleanup/cleanup.types.d.ts +10 -0
  9. package/dist/cleanup/index.d.ts +1 -1
  10. package/dist/cleanup/index.js +1 -1
  11. package/dist/cleanup/internals.d.ts +2 -2
  12. package/dist/cleanup/internals.js +1 -1
  13. package/dist/cli/cli.help.js +37 -3
  14. package/dist/cli/cli.service.d.ts +30 -2
  15. package/dist/cli/cli.service.js +191 -27
  16. package/dist/cli/local-config.d.ts +4 -0
  17. package/dist/cli/local-config.js +41 -1
  18. package/dist/runtime/aspnet-runtime-prebuild.d.ts +35 -0
  19. package/dist/runtime/aspnet-runtime-prebuild.js +168 -0
  20. package/dist/runtime/attempt-node-runtime-launcher.d.ts +17 -0
  21. package/dist/runtime/attempt-node-runtime-launcher.js +105 -0
  22. package/dist/runtime/attempt-process-supervisor-registry.d.ts +20 -0
  23. package/dist/runtime/attempt-process-supervisor-registry.js +64 -0
  24. package/dist/runtime/attempt-process-supervisor.d.ts +86 -0
  25. package/dist/runtime/attempt-process-supervisor.js +350 -0
  26. package/dist/runtime/generated-output-reset.d.ts +10 -0
  27. package/dist/runtime/generated-output-reset.js +103 -0
  28. package/dist/runtime/host-listener-inspector.d.ts +46 -0
  29. package/dist/runtime/host-listener-inspector.js +349 -0
  30. package/dist/runtime/host-port-broker.d.ts +76 -0
  31. package/dist/runtime/host-port-broker.js +333 -0
  32. package/dist/runtime/host-runtime-contract.d.ts +47 -0
  33. package/dist/runtime/host-runtime-contract.js +700 -0
  34. package/dist/runtime/host-runtime-lease.d.ts +179 -0
  35. package/dist/runtime/host-runtime-lease.js +1990 -0
  36. package/dist/runtime/host-runtime-promotion.d.ts +23 -0
  37. package/dist/runtime/host-runtime-promotion.js +159 -0
  38. package/dist/runtime/node-host-runtime-adapter.d.ts +54 -0
  39. package/dist/runtime/node-host-runtime-adapter.js +284 -0
  40. package/dist/runtime/playwright-host-runtime-adapter.d.ts +20 -0
  41. package/dist/runtime/playwright-host-runtime-adapter.js +220 -0
  42. package/dist/runtime/runtime-isolation-lease.d.ts +67 -0
  43. package/dist/runtime/runtime-isolation-lease.js +158 -0
  44. package/dist/runtime/workspace-resource-estimator.d.ts +16 -0
  45. package/dist/runtime/workspace-resource-estimator.js +165 -0
  46. package/dist/sandbox/preflight.d.ts +15 -0
  47. package/dist/sandbox/preflight.js +100 -13
  48. package/dist/sandbox/process.js +125 -40
  49. package/dist/sandbox/repository-lock.js +37 -1
  50. package/dist/sandbox/runtime.d.ts +66 -3
  51. package/dist/sandbox/runtime.js +670 -105
  52. package/dist/sandbox/sandbox.types.d.ts +3 -0
  53. package/dist/sandbox/smoke.d.ts +76 -0
  54. package/dist/sandbox/smoke.js +380 -0
  55. package/dist/sandbox/worker-supervisor.js +1 -1
  56. package/dist/sandbox/worker.js +2 -5
  57. package/dist/sandbox/workspace.service.d.ts +1 -0
  58. package/dist/sandbox/workspace.service.js +28 -5
  59. package/dist/session/managed-attempt-tools.d.ts +18 -0
  60. package/dist/session/managed-attempt-tools.js +797 -0
  61. package/dist/session/managed-build-coordinator.d.ts +5 -0
  62. package/dist/session/managed-build-coordinator.js +105 -0
  63. package/dist/session/phase-completion.artifacts.js +21 -3
  64. package/dist/session/phase-completion.d.ts +11 -2
  65. package/dist/session/phase-completion.helpers.d.ts +5 -0
  66. package/dist/session/phase-completion.helpers.js +51 -10
  67. package/dist/session/phase-completion.js +12 -3
  68. package/dist/session/phase-completion.prompts.d.ts +3 -3
  69. package/dist/session/phase-completion.prompts.js +21 -6
  70. package/dist/session/phase-completion.runtime.d.ts +13 -1
  71. package/dist/session/phase-completion.runtime.js +187 -8
  72. package/dist/session/phase-completion.schemas.js +108 -3
  73. package/dist/session/phase-completion.validation.d.ts +4 -1
  74. package/dist/session/phase-completion.validation.js +150 -21
  75. package/dist/session/provider-cli/ci-repair-readiness.d.ts +14 -0
  76. package/dist/session/provider-cli/ci-repair-readiness.js +105 -0
  77. package/dist/session/provider-cli/provider-cli.artifacts.d.ts +3 -2
  78. package/dist/session/provider-cli/provider-cli.artifacts.js +65 -7
  79. package/dist/session/provider-cli/provider-cli.deterministic.js +47 -1
  80. package/dist/session/provider-cli/provider-cli.process.d.ts +16 -0
  81. package/dist/session/provider-cli/provider-cli.process.js +212 -25
  82. package/dist/session/provider-cli/provider-cli.prompts.d.ts +4 -1
  83. package/dist/session/provider-cli/provider-cli.prompts.js +99 -19
  84. package/dist/session/provider-cli/provider-cli.qa-sidecars.js +1 -0
  85. package/dist/session/provider-cli/provider-cli.runtime.d.ts +1 -1
  86. package/dist/session/provider-cli/provider-cli.runtime.js +3 -2
  87. package/dist/session/provider-cli/provider-cli.service.d.ts +20 -2
  88. package/dist/session/provider-cli/provider-cli.service.js +464 -102
  89. package/dist/session/provider-cli/provider-cli.types.d.ts +5 -0
  90. package/dist/session/provider-cli/provider-output-state.d.ts +2 -0
  91. package/dist/session/provider-cli/provider-output-state.js +69 -7
  92. package/dist/session/session-redaction.d.ts +3 -0
  93. package/dist/session/session-redaction.js +38 -0
  94. package/dist/session/session.base.d.ts +6 -1
  95. package/dist/session/session.service.d.ts +8 -2
  96. package/dist/session/session.service.js +482 -41
  97. package/dist/session/session.types.d.ts +70 -0
  98. package/dist/session/session.types.js +76 -4
  99. package/dist/shared/format/format-bytes.d.ts +1 -0
  100. package/dist/shared/format/format-bytes.js +9 -0
  101. package/dist/shared/path/path.js +3 -1
  102. package/dist/shared/process/host-process-recovery.d.ts +12 -0
  103. package/dist/shared/process/host-process-recovery.js +78 -0
  104. package/dist/shared/process/host-process-supervisor.d.ts +57 -0
  105. package/dist/shared/process/host-process-supervisor.js +282 -0
  106. package/dist/shared/process/process.d.ts +1 -0
  107. package/dist/shared/process/process.js +1 -0
  108. package/dist/shared/redaction/redaction.js +6 -1
  109. package/dist/version.d.ts +1 -1
  110. package/dist/version.js +1 -1
  111. package/dist/worktree/artifact-injector.d.ts +3 -2
  112. package/dist/worktree/artifact-injector.js +43 -4
  113. package/dist/worktree/dependency-warmer.d.ts +10 -1
  114. package/dist/worktree/dependency-warmer.js +94 -5
  115. package/dist/worktree/index.d.ts +1 -0
  116. package/dist/worktree/index.js +1 -0
  117. package/dist/worktree/prior-phase-artifact-hydrator.d.ts +2 -0
  118. package/dist/worktree/prior-phase-artifact-hydrator.js +136 -0
  119. package/dist/worktree/worktree-paths.d.ts +4 -0
  120. package/dist/worktree/worktree-paths.js +30 -0
  121. package/dist/worktree/worktree.base.d.ts +3 -0
  122. package/dist/worktree/worktree.service.d.ts +8 -2
  123. package/dist/worktree/worktree.service.js +206 -43
  124. package/dist/worktree/worktree.types.d.ts +4 -1
  125. package/package.json +3 -2
  126. package/runtime/windows-job-supervisor.ps1 +356 -0
  127. package/runtime/windows-listener-owner.ps1 +33 -0
@@ -1,9 +1,11 @@
1
1
  import { execFile, spawn } from "node:child_process";
2
+ import fs from "node:fs";
2
3
  import os from "node:os";
3
4
  import path from "node:path";
4
5
  import readline from "node:readline";
5
6
  import { promisify } from "node:util";
6
7
  import { resolveCursorAgentDirectLaunch } from "../../shared/cursor-agent/cursor-agent.launch.js";
8
+ import { persistHostProcessSupervisorMetadata, resolveHostProcessSupervisedLaunch, terminateHostProcessTree, } from "../../shared/process/host-process-supervisor.js";
7
9
  import { buildWindowsLaunchCommand } from "../../shared/process/windows-launch.js";
8
10
  const execFileAsync = promisify(execFile);
9
11
  const allowedProviderParentEnvNames = [
@@ -137,24 +139,35 @@ function setEnvironmentValueIfMissing(env, name, value) {
137
139
  }
138
140
  export class StreamingProviderProcessRunner {
139
141
  async run(request, handlers = {}, signal) {
140
- const launch = await resolveProviderProcessLaunch(request.command, request.args);
142
+ const providerLaunch = await resolveProviderProcessLaunch(request.command, request.args);
143
+ const supervisedLaunch = resolveHostProcessSupervisedLaunch(request, providerLaunch.command, providerLaunch.args);
144
+ const launch = supervisedLaunch ?? { ...providerLaunch, detached: false };
141
145
  return await new Promise((resolve, reject) => {
146
+ const rootCreatedAt = new Date().toISOString();
142
147
  const child = spawn(launch.command, launch.args, {
143
148
  cwd: request.cwd,
144
149
  env: buildProviderChildEnvironment(request.env),
145
150
  stdio: [request.stdin === undefined ? "ignore" : "pipe", "pipe", "pipe"],
146
- windowsHide: true
151
+ windowsHide: true,
152
+ detached: launch.detached,
147
153
  });
154
+ let termination = null;
155
+ const terminate = () => {
156
+ termination ??= terminateHostProcessTree(child, supervisedLaunch);
157
+ return termination;
158
+ };
148
159
  const childStdout = child.stdout;
149
160
  const childStderr = child.stderr;
150
161
  if (!childStdout || !childStderr) {
151
- child.kill("SIGTERM");
162
+ void terminate();
152
163
  reject(new Error("Provider process stdout/stderr streams were not piped."));
153
164
  return;
154
165
  }
155
166
  let stdout = "";
156
167
  let stderr = "";
157
168
  let settled = false;
169
+ let closed = false;
170
+ let readiness = null;
158
171
  const cleanup = () => {
159
172
  signal?.removeEventListener("abort", abort);
160
173
  };
@@ -164,15 +177,14 @@ export class StreamingProviderProcessRunner {
164
177
  }
165
178
  settled = true;
166
179
  cleanup();
180
+ void terminate().catch(() => undefined);
167
181
  reject(error);
168
182
  };
169
183
  const abort = () => {
170
- try {
171
- child.kill("SIGTERM");
172
- }
173
- catch {
174
- // Best effort; close/error will settle the promise.
175
- }
184
+ // Cancellation is not a launch failure when the supervised tree can be
185
+ // proven stopped. Let the close handler settle the command after exact
186
+ // termination; only a failed termination proof rejects the run.
187
+ void terminate().catch(fail);
176
188
  };
177
189
  if (signal?.aborted) {
178
190
  abort();
@@ -181,40 +193,66 @@ export class StreamingProviderProcessRunner {
181
193
  signal?.addEventListener("abort", abort, { once: true });
182
194
  }
183
195
  child.on("error", fail);
184
- if (request.stdin !== undefined) {
185
- if (!child.stdin) {
186
- try {
187
- child.kill("SIGTERM");
196
+ child.once("spawn", () => {
197
+ readiness = (async () => {
198
+ const providerReady = supervisedLaunch?.strategy === "windows_job_object"
199
+ ? await waitForWindowsProviderReady(supervisedLaunch, signal, () => closed)
200
+ : undefined;
201
+ if (supervisedLaunch) {
202
+ persistHostProcessSupervisorMetadata(supervisedLaunch, request, child.pid ?? 0, rootCreatedAt, providerReady);
188
203
  }
189
- catch {
190
- // Best effort; the missing stdin pipe will fail the provider run.
204
+ await handlers.onStarted?.();
205
+ if (supervisedLaunch?.strategy === "windows_job_object") {
206
+ grantWindowsProviderStart(supervisedLaunch);
191
207
  }
208
+ })();
209
+ void readiness.catch(error => {
210
+ if (!closed && !signal?.aborted)
211
+ fail(error);
212
+ });
213
+ });
214
+ const writeProviderInput = () => {
215
+ if (request.stdin === undefined)
216
+ return;
217
+ if (!child.stdin) {
218
+ void terminate();
192
219
  fail(new Error("Provider process stdin stream was not piped."));
193
220
  return;
194
221
  }
195
222
  child.stdin.on("error", (error) => {
196
- try {
197
- child.kill("SIGTERM");
198
- }
199
- catch {
200
- // Best effort; the stdin error will fail the provider run.
201
- }
223
+ void terminate();
202
224
  fail(error);
203
225
  });
204
226
  child.stdin.end(request.stdin, "utf8");
227
+ };
228
+ if (request.stdin !== undefined) {
229
+ if (supervisedLaunch?.strategy === "windows_job_object") {
230
+ // The outer supervisor must receive stdin before it can launch the
231
+ // inner provider. Its start-grant file prevents prompt delivery.
232
+ writeProviderInput();
233
+ }
234
+ else {
235
+ child.once("spawn", () => {
236
+ void readiness?.then(writeProviderInput).catch(fail);
237
+ });
238
+ }
205
239
  }
206
240
  const readers = [
207
241
  readProcessLines(childStdout, (line) => {
208
- stdout += `${line}\n`;
242
+ if (request.captureOutput !== false)
243
+ stdout += `${line}\n`;
209
244
  return handlers.onStdoutLine?.(line);
210
245
  }),
211
246
  readProcessLines(childStderr, (line) => {
212
- stderr += `${line}\n`;
247
+ if (request.captureOutput !== false)
248
+ stderr += `${line}\n`;
213
249
  return handlers.onStderrLine?.(line);
214
250
  })
215
251
  ];
216
252
  child.on("close", (code) => {
217
- Promise.allSettled(readers).then((readerResults) => {
253
+ closed = true;
254
+ Promise.allSettled(readers).then(async (readerResults) => {
255
+ await readiness?.catch(() => undefined);
218
256
  const rejected = readerResults.find((result) => result.status === "rejected");
219
257
  if (rejected?.status === "rejected") {
220
258
  fail(rejected.reason);
@@ -223,6 +261,18 @@ export class StreamingProviderProcessRunner {
223
261
  if (settled) {
224
262
  return;
225
263
  }
264
+ try {
265
+ if (supervisedLaunch?.strategy === "unix_process_group") {
266
+ await terminate();
267
+ }
268
+ else if (termination) {
269
+ await termination;
270
+ }
271
+ }
272
+ catch (error) {
273
+ fail(error);
274
+ return;
275
+ }
226
276
  settled = true;
227
277
  cleanup();
228
278
  resolve({
@@ -244,12 +294,115 @@ async function resolveProviderProcessLaunch(command, args) {
244
294
  return cursorDirect;
245
295
  }
246
296
  const resolved = await resolveWindowsCommand(command);
247
- return resolved ? buildWindowsLaunchCommand(resolved, args) : { command, args };
297
+ if (!resolved) {
298
+ return { command, args };
299
+ }
300
+ return resolveCodexNpmDirectLaunch(resolved, args)
301
+ ?? resolvePackageManagerDirectLaunch(resolved, args)
302
+ ?? buildWindowsLaunchCommand(resolved, args);
303
+ }
304
+ function grantWindowsProviderStart(launch) {
305
+ if (!launch.startGrantPath) {
306
+ throw new Error("host_process_supervisor_invalid: Windows provider start-grant path was not assigned.");
307
+ }
308
+ fs.writeFileSync(launch.startGrantPath, "granted\n", {
309
+ encoding: "utf8",
310
+ flag: "wx",
311
+ mode: 0o600,
312
+ });
313
+ }
314
+ async function waitForWindowsProviderReady(launch, signal, isClosed) {
315
+ const readyPath = launch.readyPath;
316
+ if (!readyPath) {
317
+ throw new Error("host_process_supervisor_invalid: Windows provider-ready path was not assigned.");
318
+ }
319
+ while (true) {
320
+ try {
321
+ const parsed = JSON.parse(await fs.promises.readFile(readyPath, "utf8"));
322
+ if (parsed.schemaVersion !== 1
323
+ || parsed.supervisorId !== launch.supervisorId
324
+ || !Number.isSafeInteger(parsed.rootPid)
325
+ || (parsed.rootPid ?? 0) <= 0
326
+ || typeof parsed.rootIdentity !== "string"
327
+ || !/^win32:\d+$/u.test(parsed.rootIdentity)
328
+ || !Number.isSafeInteger(parsed.providerPid)
329
+ || (parsed.providerPid ?? 0) <= 0
330
+ || typeof parsed.providerCreatedAt !== "string"
331
+ || Number.isNaN(Date.parse(parsed.providerCreatedAt))
332
+ || (parsed.providerIdentity !== undefined
333
+ && (typeof parsed.providerIdentity !== "string" || !/^win32:\d+$/u.test(parsed.providerIdentity)))
334
+ || !Number.isSafeInteger(parsed.startAttempt)
335
+ || (parsed.startAttempt ?? 0) < 1) {
336
+ throw new Error("host_process_supervisor_invalid: provider-ready receipt was invalid.");
337
+ }
338
+ return parsed;
339
+ }
340
+ catch (error) {
341
+ if (error.code !== "ENOENT")
342
+ throw error;
343
+ }
344
+ if (isClosed()) {
345
+ throw new Error("host_process_supervisor_start_failed: supervisor exited before the provider became ready.");
346
+ }
347
+ if (signal?.aborted) {
348
+ throw signal.reason instanceof Error ? signal.reason : new Error("Provider process launch was aborted.");
349
+ }
350
+ await new Promise(resolve => setTimeout(resolve, 25));
351
+ }
352
+ }
353
+ export function resolveCodexNpmDirectLaunch(commandPath, args) {
354
+ const extension = path.extname(commandPath).toLowerCase();
355
+ if ((extension !== ".cmd" && extension !== ".ps1")
356
+ || path.basename(commandPath, extension).toLowerCase() !== "codex") {
357
+ return null;
358
+ }
359
+ const entryPoint = path.join(path.dirname(commandPath), "node_modules", "@openai", "codex", "bin", "codex.js");
360
+ return fs.existsSync(entryPoint)
361
+ ? { command: process.execPath, args: [entryPoint, ...args] }
362
+ : null;
363
+ }
364
+ /**
365
+ * Avoids cmd.exe's nested-quote handling for package-manager shims. That
366
+ * quoting loses executable paths containing spaces after the command is
367
+ * wrapped by the Windows Job Object supervisor.
368
+ */
369
+ export function resolvePackageManagerDirectLaunch(commandPath, args) {
370
+ const extension = path.extname(commandPath).toLowerCase();
371
+ if (extension !== ".cmd" && extension !== ".ps1")
372
+ return null;
373
+ const packageManager = path.basename(commandPath, extension).toLowerCase();
374
+ if (!["npm", "npx", "pnpm", "pnpx", "yarn", "yarnpkg"].includes(packageManager))
375
+ return null;
376
+ const root = path.dirname(commandPath);
377
+ const candidates = [
378
+ path.join(root, "node_modules", "corepack", "dist", `${packageManager}.js`),
379
+ ...(packageManager === "npm" || packageManager === "npx"
380
+ ? [path.join(root, "node_modules", "npm", "bin", `${packageManager}-cli.js`)]
381
+ : []),
382
+ ...(packageManager === "pnpm" || packageManager === "pnpx"
383
+ ? [path.join(root, "node_modules", "pnpm", "bin", `${packageManager}.cjs`)]
384
+ : []),
385
+ ...(packageManager === "yarn" || packageManager === "yarnpkg"
386
+ ? [path.join(root, "node_modules", "yarn", "bin", "yarn.js")]
387
+ : []),
388
+ ];
389
+ const entryPoint = candidates.find(candidate => fs.existsSync(candidate));
390
+ if (!entryPoint)
391
+ return null;
392
+ const adjacentNode = path.join(root, "node.exe");
393
+ return {
394
+ command: fs.existsSync(adjacentNode) ? adjacentNode : process.execPath,
395
+ args: [entryPoint, ...args],
396
+ };
248
397
  }
249
398
  async function resolveWindowsCommand(command) {
250
399
  if (path.isAbsolute(command)) {
251
400
  return command;
252
401
  }
402
+ const resolvedFromPath = resolveWindowsCommandFromPath(command);
403
+ if (resolvedFromPath) {
404
+ return resolvedFromPath;
405
+ }
253
406
  try {
254
407
  const result = await execFileAsync("where.exe", [command], { timeout: 2000 });
255
408
  return chooseWindowsCommandCandidate(result.stdout.split(/\r?\n/));
@@ -258,6 +411,40 @@ async function resolveWindowsCommand(command) {
258
411
  return null;
259
412
  }
260
413
  }
414
+ /**
415
+ * Resolves Windows commands without spawning where.exe. Runtime launches can
416
+ * happen while the machine is under enough process pressure for where.exe to
417
+ * miss its timeout; returning the unresolved package-manager name in that case
418
+ * makes Node fall back to a shell shim that cannot survive Job Object wrapping.
419
+ */
420
+ export function resolveWindowsCommandFromPath(command, pathValue = process.env.PATH ?? "", pathExtValue = process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD") {
421
+ if (!command || path.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
422
+ return null;
423
+ }
424
+ const hasExtension = path.extname(command).length > 0;
425
+ const extensions = hasExtension
426
+ ? [""]
427
+ : [...new Set([
428
+ "",
429
+ ".exe",
430
+ ".ps1",
431
+ ".cmd",
432
+ ".bat",
433
+ ...pathExtValue.split(";").map(value => value.trim().toLowerCase()).filter(Boolean),
434
+ ])];
435
+ const candidates = [];
436
+ for (const rawDirectory of pathValue.split(path.delimiter)) {
437
+ const directory = rawDirectory.trim().replace(/^"|"$/gu, "");
438
+ if (!directory)
439
+ continue;
440
+ for (const extension of extensions) {
441
+ const candidate = path.join(directory, `${command}${extension}`);
442
+ if (fs.existsSync(candidate))
443
+ candidates.push(candidate);
444
+ }
445
+ }
446
+ return chooseWindowsCommandCandidate(candidates);
447
+ }
261
448
  export function chooseWindowsCommandCandidate(candidates) {
262
449
  const normalized = candidates
263
450
  .map((candidate) => candidate.trim())
@@ -17,12 +17,15 @@ export declare function formatProviderCliCommandForCheckpoint(command: ProviderC
17
17
  export declare function singleLine(value: string): string;
18
18
  export declare function buildProviderCliCommand(dispatch: RunOnceDispatchPacket, run?: {
19
19
  readonly prompt?: string;
20
+ readonly promptFromStdin?: boolean;
20
21
  readonly worktreePath?: string;
21
22
  readonly completionTools?: CompletionToolRuntime;
22
23
  readonly skipGitRepoCheck?: boolean;
23
24
  readonly imagePaths?: readonly string[];
25
+ readonly runtimeEnvironment?: Readonly<Record<string, string>>;
24
26
  }): ProviderCliCommand;
25
- export declare function codexSandboxModeForPlatform(platform?: NodeJS.Platform): "workspace-write" | "danger-full-access";
27
+ export declare function buildProviderCliPrompt(dispatch: RunOnceDispatchPacket, prompt: string, runtimeEnvironment?: Readonly<Record<string, string>>): string;
28
+ export declare function codexSandboxModeForPlatform(platform?: NodeJS.Platform, executionMode?: string): "workspace-write" | "danger-full-access";
26
29
  export declare function buildArchitectPrompt(dispatch: RunOnceDispatchPacket): string;
27
30
  export declare function architectDependencyInstruction(dispatch: RunOnceDispatchPacket): string;
28
31
  export declare function designerRefInstruction(dispatch: RunOnceDispatchPacket): string;
@@ -150,15 +150,30 @@ export function buildProviderCliCommand(dispatch, run) {
150
150
  const provider = dispatch.execution.provider.trim();
151
151
  const normalizedProvider = provider.toLowerCase();
152
152
  const model = dispatch.execution.model.trim();
153
+ const prompt = run
154
+ ? buildProviderCliPrompt(dispatch, run.prompt ?? "", run.runtimeEnvironment)
155
+ : undefined;
153
156
  if (normalizedProvider === "codex") {
154
- const args = run ? ["-s", codexSandboxModeForPlatform(), "-a", "never", "exec"] : ["exec"];
157
+ const resumeThreadId = run ? dispatch.session.resumeProviderThreadId?.trim() : null;
158
+ const args = run
159
+ ? ["-s", codexSandboxModeForPlatform(process.platform, dispatch.sandbox?.executionMode), "-a", "never", "exec"]
160
+ : ["exec"];
161
+ // `--cd` belongs to `codex exec`, not its `resume` subcommand. Keep it
162
+ // ahead of `resume` so a continued provider thread starts in the prepared
163
+ // worktree instead of failing argument parsing before the agent launches.
164
+ if (resumeThreadId && run?.worktreePath) {
165
+ args.push("--cd", run.worktreePath);
166
+ }
167
+ if (resumeThreadId) {
168
+ args.push("resume");
169
+ }
155
170
  if (run?.completionTools) {
156
171
  args.push(...codexMcpConfigArgs(run.completionTools));
157
172
  }
158
173
  args.push("--model", model);
159
174
  if (run) {
160
175
  args.push("--json");
161
- if (run.worktreePath) {
176
+ if (run.worktreePath && !resumeThreadId) {
162
177
  args.push("--cd", run.worktreePath);
163
178
  }
164
179
  if (run.skipGitRepoCheck) {
@@ -167,7 +182,10 @@ export function buildProviderCliCommand(dispatch, run) {
167
182
  for (const imagePath of run.imagePaths ?? []) {
168
183
  args.push("--image", imagePath);
169
184
  }
170
- args.push(run.prompt ?? "");
185
+ if (resumeThreadId) {
186
+ args.push(resumeThreadId);
187
+ }
188
+ args.push(run.promptFromStdin ? "-" : prompt ?? "");
171
189
  }
172
190
  return { command: "codex", args };
173
191
  }
@@ -176,19 +194,56 @@ export function buildProviderCliCommand(dispatch, run) {
176
194
  if (run?.worktreePath) {
177
195
  args.push("--workspace", run.worktreePath);
178
196
  }
179
- if (run?.prompt) {
180
- args.push("--yolo", "--approve-mcps", "--trust", run.prompt);
197
+ if (prompt) {
198
+ args.push("--yolo", "--approve-mcps", "--trust", prompt);
181
199
  }
182
200
  return { command: "cursor-agent", args };
183
201
  }
184
202
  const args = ["--model", model];
185
- if (run?.prompt) {
186
- args.push(run.prompt);
203
+ if (prompt) {
204
+ args.push(prompt);
187
205
  }
188
206
  return { command: provider, args };
189
207
  }
190
- export function codexSandboxModeForPlatform(platform = process.platform) {
191
- return platform === "win32" ? "danger-full-access" : "workspace-write";
208
+ export function buildProviderCliPrompt(dispatch, prompt, runtimeEnvironment) {
209
+ const executionMode = dispatch.sandbox?.executionMode;
210
+ if (executionMode !== "docker" && executionMode !== "host") {
211
+ return prompt;
212
+ }
213
+ if (executionMode === "host") {
214
+ const concurrency = runtimeEnvironment?.FORGE_HOST_CONCURRENCY === "host_parallel_safe"
215
+ ? "- `FORGE_HOST_CONCURRENCY=host_parallel_safe` means Forge verified this contract's assigned-port probe and gave this attempt independent ports, paths, and process supervisors. Do not share or discover another attempt's runtime resources."
216
+ : "- `FORGE_HOST_CONCURRENCY=host_serial_only` means Forge holds the runner-local project singleton named by `FORGE_SINGLETON_KEYS`; do not bypass or release it yourself.";
217
+ const playwright = runtimeEnvironment?.FORGE_PLAYWRIGHT_CONFIG
218
+ ? "\n- For Playwright, use the generated `FORGE_PLAYWRIGHT_CONFIG`; it targets this attempt's verified `FORGE_PLAYWRIGHT_BASE_URL`, disables project `webServer` startup/reuse, and writes under `FORGE_TEST_OUTPUT_DIR`. Do not invoke the project Playwright config directly."
219
+ : "";
220
+ return `${prompt.trimEnd()}
221
+
222
+ # Trusted Forge runtime context
223
+
224
+ - Placement: managed host worktree. Host mode prevents ownership collisions but does not provide Docker filesystem, network, credential, or kernel isolation.
225
+ - \`FORGE_RUNTIME_MODE=host\`, \`FORGE_RESOURCE_LEASE_ID\`, and \`FORGE_DISPATCH_ATTEMPT_ID\` identify the fenced runtime lease. \`FORGE_WORKTREE_PATH\` identifies the prepared repository root.
226
+ ${concurrency}
227
+ - Forge owns this attempt's process tree through \`FORGE_PROCESS_SUPERVISOR_ID\`. Do not detach, adopt pre-existing servers, or kill processes by name or port; cancellation and teardown are supervisor-owned.
228
+ - Prefer \`forge.start_managed_verification\` for Forge .NET tiers or the solution suite so the runner owns cwd, arguments, isolated output, timeout, and supervision. Use \`forge.start_managed_command\` only for other commands expected to run longer than two minutes. Continue independent work, then call \`forge.wait_managed_command\` for its terminal receipt. If it returns \`command_continues=true\`, continue useful work or wait again after \`retry_after_ms\`; do not poll \`forge.get_managed_command\`. Forge keeps live progress in its durable UI receipt; its command timeout terminates and verifies the exact attempt-owned process tree. Do not run those commands through the generic shell tool.
229
+ - If a tool creates \`TestResults\`, \`test-results\`, or \`playwright-report\` beneath source, use \`forge.reset_generated_outputs\` to quarantine only those untracked generated directories. Do not issue a recursive delete.
230
+ - Use the attempt-scoped \`FORGE_TMPDIR\`, \`FORGE_LOG_DIR\`, \`FORGE_CACHE_DIR\`, \`FORGE_BROWSER_PROFILE_DIR\`, and \`FORGE_TEST_OUTPUT_DIR\` paths instead of shared host paths.
231
+ - Use supplied \`FORGE_*\` URLs, ports, and paths. Do not search for a free port, kill a process occupying one, or reuse an existing dev server, browser profile, database, container, network, or volume.
232
+ - Never run broad process or Docker cleanup. Stop only resources you created for this resource lease.${playwright}`;
233
+ }
234
+ return `${prompt.trimEnd()}
235
+
236
+ # Trusted Forge runtime context
237
+
238
+ - Placement: Docker sandbox. You are already running inside the agent container with the repository mounted at \`/workspace\`.
239
+ - \`FORGE_RUNTIME_MODE=docker\`, \`FORGE_RESOURCE_LEASE_ID\`, and \`FORGE_DISPATCH_ATTEMPT_ID\` identify the fenced runtime lease. \`FORGE_WORKTREE_PATH\` identifies the mounted repository root.
240
+ - Use the attempt-scoped \`FORGE_TMPDIR\`, \`FORGE_LOG_DIR\`, and \`FORGE_BROWSER_PROFILE_DIR\` paths instead of shared host paths.
241
+ - The host Docker CLI and daemon are intentionally not mounted inside the agent container. Do not use \`docker --version\`, Docker socket access, or a nested container launch to decide whether this run is sandboxed.
242
+ - When the work item requires in-sandbox evidence, use container-local facts such as \`pwd\`, \`printenv FORGE_RUNTIME_MODE\`, and \`printenv FORGE_RESOURCE_LEASE_ID\`.
243
+ - Forge records container startup outside the provider process and performs resource cleanup after the provider exits. Do not block the current phase because host-side cleanup cannot be observed from inside the container.`;
244
+ }
245
+ export function codexSandboxModeForPlatform(platform = process.platform, executionMode) {
246
+ return platform === "win32" || executionMode === "docker" ? "danger-full-access" : "workspace-write";
192
247
  }
193
248
  export function buildArchitectPrompt(dispatch) {
194
249
  return `You are Forge's Architect lane running locally in a prepared git worktree.
@@ -205,7 +260,7 @@ Forge owns protocol files: write Architect artifacts only through the completion
205
260
 
206
261
  ${completionPromptForPhase("architect")}
207
262
 
208
- Finish only after calling forge.complete_architect_plan with implementation_plan, qa_plan, status, summary, and report/report_markdown.`;
263
+ Finish only after forge.complete_architect_plan accepts implementation_plan, qa_plan, status, summary, and report/report_markdown. If the tool rejects the payload, apply its correction in the same plan and resubmit; task ids must be unique and every phase/dependency reference must follow any corrected id.`;
209
264
  }
210
265
  export function architectDependencyInstruction(dispatch) {
211
266
  if (!dispatch.architectDependencies || dispatch.architectDependencies.prerequisites.length === 0) {
@@ -363,8 +418,13 @@ export function phaseWorkInstruction(phase) {
363
418
  export function qaBrowserInstruction(dispatch) {
364
419
  const qaBrowser = dispatch.qaBrowser;
365
420
  const qaScope = dispatch.qaScope;
421
+ const playwrightPolicy = `
422
+ - \`browser_manual\` is Forge's browser-level evidence class; it may be satisfied by a real Playwright interaction against the current prepared worktree. It does not require a human-operated browser.
423
+ - First use an attempt-scoped \`FORGE_PLAYWRIGHT_CONFIG\` when present. Otherwise inspect the repository's package scripts and Playwright configuration and prefer an existing self-contained e2e workflow over an ad-hoc browser script.
424
+ - Run browser evidence against this attempt's checked-out commit. Do not substitute a shared, deployed, or already-running app unless Forge's launch context explicitly identifies it as the target for this commit.
425
+ - Designer refs are optional product context, not a prerequisite for UI QA. When no refs are attached, exercise the acceptance criteria with the repository's existing fixtures, seed APIs, or Playwright route fixtures.`;
366
426
  if (!qaBrowser) {
367
- return "Browser/app launch context: not provided by Forge.";
427
+ return `Browser/app launch context: not provided by Forge.${playwrightPolicy}\n- Return missing_app_launch_target only after confirming that neither a managed Playwright config nor a safe repository-owned Playwright workflow can launch and exercise the affected UI.`;
368
428
  }
369
429
  const scopeAuthority = qaScope
370
430
  ? qaScope.source === "heuristic"
@@ -376,13 +436,13 @@ export function qaBrowserInstruction(dispatch) {
376
436
  : "";
377
437
  const launchTarget = qaBrowser.launchTarget;
378
438
  if (qaBrowser.required && !hasLaunchTarget(launchTarget ?? null)) {
379
- return `Browser/app launch context:\n- UI/browser QA is required for this item by ${scopeAuthority}.\n- No app launch target was provided.\n- Return blocked with blocker_reason: missing_app_launch_target instead of pretending browser testing occurred.${scopeEvidence}\n- Artifact sidecars path when available: ${qaBrowser.artifactsPath || `.forge/work-items/${dispatch.workItem.id}/artifacts/qa`}`;
439
+ return `Browser/app launch context:\n- UI/browser QA is required for this item by ${scopeAuthority}.\n- No configured app launch target was provided.${scopeEvidence}${playwrightPolicy}\n- If a managed or repository-owned Playwright workflow successfully exercises the affected UI, record both its passing command and browser_checks evidence. Otherwise return blocked with blocker_reason: missing_app_launch_target instead of pretending browser testing occurred.\n- Artifact sidecars path when available: ${qaSidecarRoot(dispatch)}`;
380
440
  }
381
441
  if (!launchTarget) {
382
- return `Browser/app launch context:\n- UI/browser QA is not required by ${scopeAuthority} for this item.\n- If you determine browser testing is needed, return blocked with blocker_reason: missing_app_launch_target unless you can safely identify a launch target from the repo.${scopeEvidence}\n- Browser sidecars path: ${qaBrowser.artifactsPath || `.forge/work-items/${dispatch.workItem.id}/artifacts/qa`}`;
442
+ return `Browser/app launch context:\n- UI/browser QA is not required by ${scopeAuthority} for this item.\n- If the diff or acceptance criteria require browser testing, use a managed or repository-owned Playwright workflow when available; otherwise return blocked with blocker_reason: missing_app_launch_target.${scopeEvidence}${playwrightPolicy}\n- Browser sidecars path: ${qaSidecarRoot(dispatch)}`;
383
443
  }
384
444
  const routes = launchTarget.routes.length > 0 ? launchTarget.routes.join(", ") : "not specified";
385
- return `Browser/app launch context:\n- Browser QA required: ${qaBrowser.required ? `yes, by ${scopeAuthority}` : `no by ${scopeAuthority}, unless the diff/AC requires it`}\n- URL: ${launchTarget.url || "not specified"}\n- Ready URL: ${launchTarget.ready_url || "not specified"}\n- Launch command: ${launchTarget.command || "not specified"}\n- Working directory: ${launchTarget.working_directory || "repo root"}\n- Routes to cover: ${routes}\n- Notes: ${launchTarget.notes || "none"}${scopeEvidence}\n- Browser sidecars path: ${qaBrowser.artifactsPath || `.forge/work-items/${dispatch.workItem.id}/artifacts/qa`}`;
445
+ return `Browser/app launch context:\n- Browser QA required: ${qaBrowser.required ? `yes, by ${scopeAuthority}` : `no by ${scopeAuthority}, unless the diff/AC requires it`}\n- URL: ${launchTarget.url || "not specified"}\n- Ready URL: ${launchTarget.ready_url || "not specified"}\n- Launch command: ${launchTarget.command || "not specified"}\n- Working directory: ${launchTarget.working_directory || "repo root"}\n- Routes to cover: ${routes}\n- Notes: ${launchTarget.notes || "none"}${scopeEvidence}${playwrightPolicy}\n- Browser sidecars path: ${qaSidecarRoot(dispatch)}`;
386
446
  }
387
447
  export function storyQaInstruction(dispatch) {
388
448
  const storyQa = dispatch.storyQa;
@@ -418,6 +478,8 @@ ${finalQa}
418
478
  This is parent Story QA: inspect the integrated Story result, all current-plan child specs/evidence, and the final worktree state. Do not treat the final child task as separately signed off.`;
419
479
  }
420
480
  export function buildQaPrompt(dispatch, laneSpec) {
481
+ const sidecarRoot = qaSidecarRoot(dispatch);
482
+ const artifactRoot = sidecarRoot.replace(/\/qa\/?$/i, "");
421
483
  return `You are Forge's QA lane running locally in a prepared git worktree.
422
484
 
423
485
  First read and follow the injected QA lane command at .forge/work-items/${dispatch.workItem.id}/spec.md. It defines the required gated QA skill workflow for this run.
@@ -442,18 +504,28 @@ System info / environment notes:
442
504
  ${dispatch.workItem.systemInfo || "Not provided."}
443
505
 
444
506
  ${storyQaInstruction(dispatch)}
445
- Inspect the validated implementation and Forge artifacts under .forge/work-items/${dispatch.workItem.id}/artifacts/ when present, especially implementation, self-review, and validation evidence.
507
+ Inspect the validated implementation evidence referenced by the dispatch and the owner-scoped QA artifacts under ${artifactRoot}/ when present.
446
508
  ${qaBrowserInstruction(dispatch)}
447
509
  ${qaReworkRetestInstruction(dispatch)}
448
510
  QA is read-mostly: inspect code, run commands, and exercise browser/app flows when available, but do not edit product source or tests.
449
- Record concrete evidence. For UI/browser work, include browser_checks with URLs/routes, actions, observed results, screenshots/traces when available, console errors, failed network requests, and responsive checks. Store browser sidecars under .forge/work-items/${dispatch.workItem.id}/artifacts/qa/.
511
+ Record concrete evidence. For UI/browser work, include browser_checks with URLs/routes, actions, observed results, screenshots/traces when available, console errors, failed network requests, and responsive checks. Store browser sidecars under ${sidecarRoot}/.
450
512
  Report in-scope defects as actionable findings with repro steps, expected/actual behavior, evidence, likely area, required fix, and required regression.
451
- Out-of-scope or follow-up issues belong in candidate_bugs instead of blocking the current item.
513
+ Out-of-scope or follow-up issues belong in candidate_bugs instead of blocking the current item. If a broad regression command fails only on a surface outside both the current diff and acceptance criteria, reproduce that failure with a focused command. The regression gate may pass only when the current item has independent passing evidence and the failed command is preserved with classification out_of_scope_failure, candidate_bug_id, scope_evidence, acceptance_criteria_independent: true, repro_command, and a non-zero repro_exit_code. Never use this classification for an unexplained failure, a runner/environment failure, or a failure that can affect the current item.
452
514
 
453
- ${completionPromptForQaCycle()}
515
+ ${completionPromptForQaCycle("qa_plan", artifactRoot)}
454
516
 
455
517
  Finish with a concise summary only after forge.complete_qa_verdict accepts the QA bundle.`;
456
518
  }
519
+ function qaSidecarRoot(dispatch) {
520
+ const configured = dispatch.qaBrowser?.artifactsPath?.trim().replace(/\\/g, "/").replace(/\/+$/, "");
521
+ if (configured) {
522
+ return configured;
523
+ }
524
+ const ownerType = dispatch.cycleRun.ownerType?.trim().toLowerCase();
525
+ const ownerId = dispatch.cycleRun.ownerId?.trim() || dispatch.workItem.id;
526
+ const ownerDirectory = ownerType === "story" ? "stories" : "work-items";
527
+ return `.forge/${ownerDirectory}/${ownerId}/artifacts/qa`;
528
+ }
457
529
  export function buildConflictResolvePrompt(dispatch, branchName) {
458
530
  const targetBranch = dispatch.cycleRun.requestedBase || dispatch.repo.defaultBranch || "main";
459
531
  return `You are Forge's Conflict Resolve lane running locally in a prepared git worktree.
@@ -487,12 +559,20 @@ This is not a merge-conflict resolution task. Only fetch/merge/rebase ${targetBr
487
559
 
488
560
  Load and follow .forge/commands/operational/ci-repair-prompt.md, including its CI repair phase gate and validation skill. Inspect the failed provider check logs, identify the exact failed workflow job/step, make the smallest scoped repair, and before pushing run the failed job's local workflow-equivalent gate, including pre-test guard/drift steps when available.
489
561
 
562
+ Forge prepared two required inputs before this agent started:
563
+ - Approved spec: .forge/work-items/${dispatch.workItem.id}/spec.md
564
+ - Readiness contract: .forge/work-items/${dispatch.workItem.id}/ci-repair.readiness.json
565
+
566
+ Read both first. The readiness contract supplies attempt-scoped E2E URLs, Playwright/browser readiness, runnable local preflight commands, and exact provider-only cases. Run every applicable local preflight. A provider-only case is not permission to classify its entire spec as unavailable or weaken CI; record the exact nested-control-plane case and leave provider CI authoritative for that case only.
567
+
568
+ After repair and validation, call forge.complete_ci_repair with the complete structured handoff. Forge Bridge will validate it and will not commit, push, or report success until that gate passes. If the tool rejects the payload, correct the exact missing evidence it reports and call it again.
569
+
490
570
  Keep the original work item intent intact:
491
571
  - Work item: ${dispatch.workItem.id}
492
572
  - Title: ${dispatch.workItem.title}
493
573
  - Acceptance criteria: ${dispatch.workItem.acceptanceCriteria || "Not specified"}
494
574
 
495
- Finish with a concise summary of failing checks, changed files, validation commands, pushed commit status, and any remaining provider checks still pending.`;
575
+ Forge Bridge owns the final commit and push after the completion gate succeeds. Finish with a concise summary of failing checks, changed files, validation commands, and remaining provider checks.`;
496
576
  }
497
577
  export function buildPullRequestCommentsPrompt(dispatch, branchName) {
498
578
  const pr = dispatch.pullRequest;
@@ -4,6 +4,7 @@ import path from "node:path";
4
4
  export function hasLaunchTarget(target) {
5
5
  return Boolean(target?.url?.trim()
6
6
  || target?.ready_url?.trim()
7
+ || target?.managed_runtime_port?.trim()
7
8
  || target?.command?.trim()
8
9
  || (target?.routes ?? []).some((route) => route.trim().length > 0));
9
10
  }
@@ -2,7 +2,7 @@ import type { RunOnceDispatchPacket } from "../session.types.js";
2
2
  import type { ProviderCliRunContext } from "./provider-cli.types.js";
3
3
  import type { ProviderOutputState } from "./provider-output-state.js";
4
4
  import { type ProviderUsage } from "./provider-usage.js";
5
- export declare function providerProcessEnv(dispatch: RunOnceDispatchPacket): Readonly<Record<string, string>> | undefined;
5
+ export declare function providerProcessEnv(dispatch: RunOnceDispatchPacket, runtimeEnvironment?: Readonly<Record<string, string>>): Readonly<Record<string, string>> | undefined;
6
6
  export declare function providerCredentialEnv(dispatch: RunOnceDispatchPacket): Readonly<Record<string, string>>;
7
7
  export declare function exactRedactionSecrets(dispatch: RunOnceDispatchPacket): readonly string[];
8
8
  export declare function emitProviderUsageEvent(emit: ProviderCliRunContext["emit"], dispatch: RunOnceDispatchPacket, outputState: ProviderOutputState): Promise<void>;
@@ -1,9 +1,10 @@
1
1
  import { completionRedactionEnv } from "../phase-completion.js";
2
2
  import { addUsage, buildProviderUsageEvent, emptyUsage, hasUsage } from "./provider-usage.js";
3
- export function providerProcessEnv(dispatch) {
3
+ export function providerProcessEnv(dispatch, runtimeEnvironment) {
4
4
  const env = {
5
5
  ...completionRedactionEnv(exactRedactionSecrets(dispatch)),
6
- ...providerCredentialEnv(dispatch)
6
+ ...providerCredentialEnv(dispatch),
7
+ ...runtimeEnvironment,
7
8
  };
8
9
  return Object.keys(env).length > 0 ? env : undefined;
9
10
  }
@@ -1,12 +1,28 @@
1
1
  import { GitClient } from "../../shared/git/git.js";
2
+ import type { WorktreeLifecycleCoordinator } from "../../worktree/worktree.base.js";
3
+ import type { RunnerDispatchEvent } from "../session.types.js";
2
4
  import type { ProviderCliService } from "./provider-cli.base.js";
3
5
  import type { ProviderCliDraftContext, ProviderCliRunContext, ProviderCliRunResult } from "./provider-cli.types.js";
4
6
  import { type ProviderProcessRunner } from "./provider-cli.process.js";
5
7
  export { DeterministicProviderCliService } from "./provider-cli.deterministic.js";
6
8
  export { buildProviderCliCommand, codexSandboxModeForPlatform, formatProviderCliCommand, formatProviderCliCommandForCheckpoint } from "./provider-cli.prompts.js";
7
- export { buildProviderChildEnvironment, chooseWindowsCommandCandidate, StreamingProviderProcessRunner } from "./provider-cli.process.js";
9
+ export { buildProviderChildEnvironment, chooseWindowsCommandCandidate, resolveCodexNpmDirectLaunch, resolvePackageManagerDirectLaunch, resolveWindowsCommandFromPath, StreamingProviderProcessRunner } from "./provider-cli.process.js";
8
10
  export { buildWindowsLaunchCommand } from "../../shared/process/windows-launch.js";
9
11
  export type { ProviderCliCommand, ProviderProcessRunner, ProviderProcessRunRequest, ProviderProcessRunResult } from "./provider-cli.process.js";
12
+ export declare function isProviderNetworkFailure(output: string): boolean;
13
+ export declare class ManagedVerificationProgressEmitter {
14
+ private readonly logDirectory;
15
+ private readonly emit;
16
+ private readonly intervalMs;
17
+ private timer;
18
+ private readonly observedStatuses;
19
+ private readonly completedCommands;
20
+ constructor(logDirectory: string | undefined, emit: (event: RunnerDispatchEvent) => Promise<void>, intervalMs?: number);
21
+ start(): void;
22
+ stop(): Promise<void>;
23
+ private scan;
24
+ private emitTransition;
25
+ }
10
26
  export declare class RoutingProviderCliService implements ProviderCliService {
11
27
  private readonly realProvider;
12
28
  private readonly deterministicProvider;
@@ -21,7 +37,9 @@ export declare class RoutingProviderCliService implements ProviderCliService {
21
37
  export declare class ProcessBackedProviderCliService implements ProviderCliService {
22
38
  private readonly processRunner;
23
39
  private readonly git;
24
- constructor(processRunner?: ProviderProcessRunner, git?: GitClient);
40
+ private readonly providerToolHeartbeatIntervalMs;
41
+ private readonly publicationCoordinator;
42
+ constructor(processRunner?: ProviderProcessRunner, git?: GitClient, providerToolHeartbeatIntervalMs?: number, publicationCoordinator?: WorktreeLifecycleCoordinator);
25
43
  runDraft(context: ProviderCliDraftContext): Promise<ProviderCliRunResult>;
26
44
  runImplementation(context: ProviderCliRunContext): Promise<ProviderCliRunResult>;
27
45
  runArchitect(context: ProviderCliRunContext): Promise<ProviderCliRunResult>;