@loucompanion/forge-bridge 0.1.3-dev.f66395c3ac21 → 0.1.4-dev.0098fdb4e213

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 (381) hide show
  1. package/README.md +306 -1
  2. package/dist/bridge/bridge-chat-provider-command.d.ts +19 -0
  3. package/dist/bridge/bridge-chat-provider-command.js +132 -0
  4. package/dist/bridge/bridge-chat.types.d.ts +121 -0
  5. package/dist/bridge/bridge-chat.types.js +416 -0
  6. package/dist/bridge/bridge-state-file.d.ts +161 -0
  7. package/dist/bridge/bridge-state-file.js +376 -0
  8. package/dist/bridge/bridge-state-io.d.ts +11 -0
  9. package/dist/bridge/bridge-state-io.js +50 -0
  10. package/dist/bridge/bridge-state-lock.d.ts +11 -0
  11. package/dist/bridge/bridge-state-lock.js +102 -0
  12. package/dist/bridge/bridge-state-unpublished.d.ts +17 -0
  13. package/dist/bridge/bridge-state-unpublished.js +111 -0
  14. package/dist/bridge/bridge.base.d.ts +18 -1
  15. package/dist/bridge/bridge.service.d.ts +216 -4
  16. package/dist/bridge/bridge.service.js +2574 -90
  17. package/dist/bridge/bridge.types.d.ts +245 -2
  18. package/dist/bridge/dispatch-result-outbox.d.ts +35 -0
  19. package/dist/bridge/dispatch-result-outbox.js +87 -0
  20. package/dist/bridge/dispatch-result-worker.d.ts +2 -0
  21. package/dist/bridge/dispatch-result-worker.js +122 -0
  22. package/dist/bridge/in-flight-registry.d.ts +62 -0
  23. package/dist/bridge/in-flight-registry.js +207 -0
  24. package/dist/bridge/internals.d.ts +2 -0
  25. package/dist/bridge/internals.js +1 -0
  26. package/dist/bridge/local-yield-flag.d.ts +6 -0
  27. package/dist/bridge/local-yield-flag.js +34 -0
  28. package/dist/bridge/readiness-result-outbox.d.ts +25 -0
  29. package/dist/bridge/readiness-result-outbox.js +74 -0
  30. package/dist/bridge/readiness-result-worker.d.ts +2 -0
  31. package/dist/bridge/readiness-result-worker.js +121 -0
  32. package/dist/bridge/runner-host-capabilities.d.ts +20 -0
  33. package/dist/bridge/runner-host-capabilities.js +110 -0
  34. package/dist/bridge/sandbox-resource-accounting.d.ts +16 -0
  35. package/dist/bridge/sandbox-resource-accounting.js +150 -0
  36. package/dist/bridge/test-postgres-capability.d.ts +14 -0
  37. package/dist/bridge/test-postgres-capability.js +120 -0
  38. package/dist/cleanup/cleanup-wip.d.ts +12 -0
  39. package/dist/cleanup/cleanup-wip.js +66 -0
  40. package/dist/cleanup/cleanup.service.d.ts +33 -2
  41. package/dist/cleanup/cleanup.service.js +477 -3
  42. package/dist/cleanup/cleanup.types.d.ts +16 -0
  43. package/dist/cleanup/forge-owned-paths.d.ts +9 -0
  44. package/dist/cleanup/forge-owned-paths.js +53 -0
  45. package/dist/cleanup/host-runtime-ledger.d.ts +7 -0
  46. package/dist/cleanup/host-runtime-ledger.js +130 -0
  47. package/dist/cleanup/index.d.ts +1 -1
  48. package/dist/cleanup/index.js +1 -1
  49. package/dist/cleanup/internals.d.ts +2 -2
  50. package/dist/cleanup/internals.js +1 -1
  51. package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
  52. package/dist/cleanup/managed-branch-sweep.js +111 -0
  53. package/dist/cli/cli.help.d.ts +2 -0
  54. package/dist/cli/cli.help.js +279 -0
  55. package/dist/cli/cli.service.d.ts +69 -12
  56. package/dist/cli/cli.service.js +557 -382
  57. package/dist/cli/idle-status.d.ts +84 -0
  58. package/dist/cli/idle-status.js +181 -0
  59. package/dist/cli/local-config.d.ts +13 -0
  60. package/dist/cli/local-config.js +82 -6
  61. package/dist/cli/provider-cli-detection.d.ts +10 -0
  62. package/dist/cli/provider-cli-detection.js +160 -0
  63. package/dist/runtime/aspnet-runtime-prebuild.d.ts +41 -0
  64. package/dist/runtime/aspnet-runtime-prebuild.js +474 -0
  65. package/dist/runtime/attempt-database-broker.d.ts +89 -0
  66. package/dist/runtime/attempt-database-broker.js +390 -0
  67. package/dist/runtime/attempt-node-runtime-launcher.d.ts +18 -0
  68. package/dist/runtime/attempt-node-runtime-launcher.js +140 -0
  69. package/dist/runtime/attempt-path-operation.d.ts +21 -0
  70. package/dist/runtime/attempt-path-operation.js +94 -0
  71. package/dist/runtime/attempt-private-directory.d.ts +6 -0
  72. package/dist/runtime/attempt-private-directory.js +54 -0
  73. package/dist/runtime/attempt-process-supervisor-registry.d.ts +20 -0
  74. package/dist/runtime/attempt-process-supervisor-registry.js +64 -0
  75. package/dist/runtime/attempt-process-supervisor.d.ts +121 -0
  76. package/dist/runtime/attempt-process-supervisor.js +471 -0
  77. package/dist/runtime/canonical-source-file.d.ts +3 -0
  78. package/dist/runtime/canonical-source-file.js +54 -0
  79. package/dist/runtime/docker-engine-probe.d.ts +95 -0
  80. package/dist/runtime/docker-engine-probe.js +340 -0
  81. package/dist/runtime/ephemeral-test-postgres-grant.d.ts +37 -0
  82. package/dist/runtime/ephemeral-test-postgres-grant.js +85 -0
  83. package/dist/runtime/ephemeral-test-postgres.d.ts +57 -0
  84. package/dist/runtime/ephemeral-test-postgres.js +303 -0
  85. package/dist/runtime/generated-output-reset.d.ts +20 -0
  86. package/dist/runtime/generated-output-reset.js +157 -0
  87. package/dist/runtime/host-database-capability-boundary.d.ts +16 -0
  88. package/dist/runtime/host-database-capability-boundary.js +63 -0
  89. package/dist/runtime/host-diagnostics.d.ts +11 -0
  90. package/dist/runtime/host-diagnostics.js +192 -0
  91. package/dist/runtime/host-execution-root.d.ts +4 -0
  92. package/dist/runtime/host-execution-root.js +39 -0
  93. package/dist/runtime/host-facts.d.ts +36 -0
  94. package/dist/runtime/host-facts.js +95 -0
  95. package/dist/runtime/host-listener-inspector.d.ts +51 -0
  96. package/dist/runtime/host-listener-inspector.js +385 -0
  97. package/dist/runtime/host-load-admission.d.ts +67 -0
  98. package/dist/runtime/host-load-admission.js +99 -0
  99. package/dist/runtime/host-load-child-environment.d.ts +27 -0
  100. package/dist/runtime/host-load-child-environment.js +76 -0
  101. package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
  102. package/dist/runtime/host-load-forge-cgroups.js +140 -0
  103. package/dist/runtime/host-load-governor-config.d.ts +52 -0
  104. package/dist/runtime/host-load-governor-config.js +83 -0
  105. package/dist/runtime/host-load-governor.d.ts +186 -0
  106. package/dist/runtime/host-load-governor.js +632 -0
  107. package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
  108. package/dist/runtime/host-load-ledger-lock.js +187 -0
  109. package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
  110. package/dist/runtime/host-load-runtime-settings.js +80 -0
  111. package/dist/runtime/host-load-sampler.d.ts +156 -0
  112. package/dist/runtime/host-load-sampler.js +298 -0
  113. package/dist/runtime/host-load-step-class.d.ts +70 -0
  114. package/dist/runtime/host-load-step-class.js +161 -0
  115. package/dist/runtime/host-load-step-reaper.d.ts +27 -0
  116. package/dist/runtime/host-load-step-reaper.js +95 -0
  117. package/dist/runtime/host-load-step-run.d.ts +73 -0
  118. package/dist/runtime/host-load-step-run.js +102 -0
  119. package/dist/runtime/host-load-test-slot.d.ts +43 -0
  120. package/dist/runtime/host-load-test-slot.js +81 -0
  121. package/dist/runtime/host-load-token-ledger.d.ts +200 -0
  122. package/dist/runtime/host-load-token-ledger.js +453 -0
  123. package/dist/runtime/host-load-windows-cpu.d.ts +34 -0
  124. package/dist/runtime/host-load-windows-cpu.js +85 -0
  125. package/dist/runtime/host-port-broker.d.ts +76 -0
  126. package/dist/runtime/host-port-broker.js +333 -0
  127. package/dist/runtime/host-pressure-stall.d.ts +61 -0
  128. package/dist/runtime/host-pressure-stall.js +168 -0
  129. package/dist/runtime/host-runtime-contract.d.ts +74 -0
  130. package/dist/runtime/host-runtime-contract.js +846 -0
  131. package/dist/runtime/host-runtime-lease.d.ts +287 -0
  132. package/dist/runtime/host-runtime-lease.js +2763 -0
  133. package/dist/runtime/host-runtime-promotion.d.ts +55 -0
  134. package/dist/runtime/host-runtime-promotion.js +254 -0
  135. package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
  136. package/dist/runtime/host-runtime-requirements-check.js +29 -0
  137. package/dist/runtime/host-runtime-requirements.d.ts +36 -0
  138. package/dist/runtime/host-runtime-requirements.js +117 -0
  139. package/dist/runtime/managed-command-teardown.d.ts +62 -0
  140. package/dist/runtime/managed-command-teardown.js +596 -0
  141. package/dist/runtime/memory-capacity.d.ts +70 -0
  142. package/dist/runtime/memory-capacity.js +123 -0
  143. package/dist/runtime/native-test-postgres-fallback.d.ts +69 -0
  144. package/dist/runtime/native-test-postgres-fallback.js +143 -0
  145. package/dist/runtime/node-host-runtime-adapter.d.ts +54 -0
  146. package/dist/runtime/node-host-runtime-adapter.js +286 -0
  147. package/dist/runtime/pinned-directory-process.d.ts +9 -0
  148. package/dist/runtime/pinned-directory-process.js +61 -0
  149. package/dist/runtime/pinned-source-directory.d.ts +17 -0
  150. package/dist/runtime/pinned-source-directory.js +94 -0
  151. package/dist/runtime/playwright-browser-cache.d.ts +39 -0
  152. package/dist/runtime/playwright-browser-cache.js +227 -0
  153. package/dist/runtime/playwright-host-runtime-adapter.d.ts +39 -0
  154. package/dist/runtime/playwright-host-runtime-adapter.js +274 -0
  155. package/dist/runtime/prepared-runtime-identity.d.ts +6 -0
  156. package/dist/runtime/prepared-runtime-identity.js +218 -0
  157. package/dist/runtime/prepared-runtime-readiness.d.ts +30 -0
  158. package/dist/runtime/prepared-runtime-readiness.js +285 -0
  159. package/dist/runtime/runner-settings.d.ts +104 -0
  160. package/dist/runtime/runner-settings.js +236 -0
  161. package/dist/runtime/runtime-isolation-lease.d.ts +67 -0
  162. package/dist/runtime/runtime-isolation-lease.js +161 -0
  163. package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
  164. package/dist/runtime/workspace-resource-estimator.js +174 -0
  165. package/dist/sandbox/command-runner.d.ts +4 -0
  166. package/dist/sandbox/command-runner.js +47 -0
  167. package/dist/sandbox/contract.d.ts +5 -0
  168. package/dist/sandbox/contract.js +276 -0
  169. package/dist/sandbox/event-budget.d.ts +11 -0
  170. package/dist/sandbox/event-budget.js +27 -0
  171. package/dist/sandbox/host-capacity-broker.d.ts +115 -0
  172. package/dist/sandbox/host-capacity-broker.js +336 -0
  173. package/dist/sandbox/image-policy.d.ts +35 -0
  174. package/dist/sandbox/image-policy.js +247 -0
  175. package/dist/sandbox/index.d.ts +5 -0
  176. package/dist/sandbox/index.js +5 -0
  177. package/dist/sandbox/lease-watchdog.d.ts +18 -0
  178. package/dist/sandbox/lease-watchdog.js +67 -0
  179. package/dist/sandbox/managed-branch.d.ts +13 -0
  180. package/dist/sandbox/managed-branch.js +36 -0
  181. package/dist/sandbox/preflight.d.ts +84 -0
  182. package/dist/sandbox/preflight.js +521 -0
  183. package/dist/sandbox/process.d.ts +20 -0
  184. package/dist/sandbox/process.js +209 -0
  185. package/dist/sandbox/provider-auth/codex.d.ts +26 -0
  186. package/dist/sandbox/provider-auth/codex.js +212 -0
  187. package/dist/sandbox/repository-lock.d.ts +6 -0
  188. package/dist/sandbox/repository-lock.js +129 -0
  189. package/dist/sandbox/runtime.d.ts +311 -0
  190. package/dist/sandbox/runtime.js +2407 -0
  191. package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
  192. package/dist/sandbox/sandbox-cgroups.js +42 -0
  193. package/dist/sandbox/sandbox.types.d.ts +93 -0
  194. package/dist/sandbox/sandbox.types.js +1 -0
  195. package/dist/sandbox/smoke.d.ts +76 -0
  196. package/dist/sandbox/smoke.js +380 -0
  197. package/dist/sandbox/worker-supervisor.d.ts +13 -0
  198. package/dist/sandbox/worker-supervisor.js +36 -0
  199. package/dist/sandbox/worker.d.ts +1 -0
  200. package/dist/sandbox/worker.js +225 -0
  201. package/dist/sandbox/workspace.service.d.ts +13 -0
  202. package/dist/sandbox/workspace.service.js +74 -0
  203. package/dist/session/architect-waits.d.ts +2 -0
  204. package/dist/session/architect-waits.js +138 -0
  205. package/dist/session/managed-attempt-tools.d.ts +48 -0
  206. package/dist/session/managed-attempt-tools.js +1299 -0
  207. package/dist/session/managed-build-coordinator.d.ts +5 -0
  208. package/dist/session/managed-build-coordinator.js +109 -0
  209. package/dist/session/managed-build-receipt.d.ts +26 -0
  210. package/dist/session/managed-build-receipt.js +342 -0
  211. package/dist/session/managed-command-host-load.d.ts +47 -0
  212. package/dist/session/managed-command-host-load.js +83 -0
  213. package/dist/session/managed-verification-timeouts.d.ts +8 -0
  214. package/dist/session/managed-verification-timeouts.js +17 -0
  215. package/dist/session/mcp-argument-coercion.d.ts +23 -0
  216. package/dist/session/mcp-argument-coercion.js +121 -0
  217. package/dist/session/phase-completion.artifacts.d.ts +34 -0
  218. package/dist/session/phase-completion.artifacts.js +903 -0
  219. package/dist/session/phase-completion.command-validation.d.ts +7 -0
  220. package/dist/session/phase-completion.command-validation.js +77 -0
  221. package/dist/session/phase-completion.d.ts +65 -42
  222. package/dist/session/phase-completion.helpers.d.ts +117 -0
  223. package/dist/session/phase-completion.helpers.js +708 -0
  224. package/dist/session/phase-completion.js +130 -3007
  225. package/dist/session/phase-completion.mcp-args.d.ts +9 -0
  226. package/dist/session/phase-completion.mcp-args.js +156 -0
  227. package/dist/session/phase-completion.prompts.d.ts +14 -0
  228. package/dist/session/phase-completion.prompts.js +238 -0
  229. package/dist/session/phase-completion.runtime.d.ts +43 -0
  230. package/dist/session/phase-completion.runtime.js +721 -0
  231. package/dist/session/phase-completion.schema-parts.d.ts +19 -0
  232. package/dist/session/phase-completion.schema-parts.js +188 -0
  233. package/dist/session/phase-completion.schemas.d.ts +3 -0
  234. package/dist/session/phase-completion.schemas.js +836 -0
  235. package/dist/session/phase-completion.validation.d.ts +37 -0
  236. package/dist/session/phase-completion.validation.js +874 -0
  237. package/dist/session/pre-publication-host-load.d.ts +27 -0
  238. package/dist/session/pre-publication-host-load.js +111 -0
  239. package/dist/session/pre-publication-native-postgres.d.ts +30 -0
  240. package/dist/session/pre-publication-native-postgres.js +111 -0
  241. package/dist/session/pre-publication-pass.d.ts +61 -0
  242. package/dist/session/pre-publication-pass.js +148 -0
  243. package/dist/session/pre-publication-process.d.ts +23 -0
  244. package/dist/session/pre-publication-process.js +109 -0
  245. package/dist/session/pre-publication-skipped-tests.d.ts +21 -0
  246. package/dist/session/pre-publication-skipped-tests.js +109 -0
  247. package/dist/session/pre-publication-step-execution.d.ts +12 -0
  248. package/dist/session/pre-publication-step-execution.js +50 -0
  249. package/dist/session/pre-publication-validation.d.ts +91 -0
  250. package/dist/session/pre-publication-validation.js +670 -0
  251. package/dist/session/provider-cli/bridge-cli.conformance-fixtures.d.ts +72 -0
  252. package/dist/session/provider-cli/bridge-cli.conformance-fixtures.js +462 -0
  253. package/dist/session/provider-cli/ci-repair-readiness.d.ts +16 -0
  254. package/dist/session/provider-cli/ci-repair-readiness.js +110 -0
  255. package/dist/session/provider-cli/claude-background-work.d.ts +67 -0
  256. package/dist/session/provider-cli/claude-background-work.js +181 -0
  257. package/dist/session/provider-cli/host-build-lock.d.ts +18 -0
  258. package/dist/session/provider-cli/host-build-lock.js +30 -0
  259. package/dist/session/provider-cli/pre-publication-repair.d.ts +56 -0
  260. package/dist/session/provider-cli/pre-publication-repair.js +276 -0
  261. package/dist/session/provider-cli/provider-cli.artifacts.d.ts +96 -0
  262. package/dist/session/provider-cli/provider-cli.artifacts.js +818 -0
  263. package/dist/session/provider-cli/provider-cli.base.d.ts +1 -0
  264. package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
  265. package/dist/session/provider-cli/provider-cli.child-environment.js +75 -0
  266. package/dist/session/provider-cli/provider-cli.codex-models-cache.d.ts +3 -0
  267. package/dist/session/provider-cli/provider-cli.codex-models-cache.js +37 -0
  268. package/dist/session/provider-cli/provider-cli.deterministic-payloads.d.ts +12 -0
  269. package/dist/session/provider-cli/provider-cli.deterministic-payloads.js +279 -0
  270. package/dist/session/provider-cli/provider-cli.deterministic.d.ts +14 -0
  271. package/dist/session/provider-cli/provider-cli.deterministic.js +407 -0
  272. package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
  273. package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
  274. package/dist/session/provider-cli/provider-cli.process.d.ts +114 -0
  275. package/dist/session/provider-cli/provider-cli.process.js +757 -0
  276. package/dist/session/provider-cli/provider-cli.prompts.d.ts +62 -0
  277. package/dist/session/provider-cli/provider-cli.prompts.js +770 -0
  278. package/dist/session/provider-cli/provider-cli.qa-sidecars.d.ts +11 -0
  279. package/dist/session/provider-cli/provider-cli.qa-sidecars.js +66 -0
  280. package/dist/session/provider-cli/provider-cli.repair-epoch.d.ts +6 -0
  281. package/dist/session/provider-cli/provider-cli.repair-epoch.js +11 -0
  282. package/dist/session/provider-cli/provider-cli.runtime.d.ts +30 -0
  283. package/dist/session/provider-cli/provider-cli.runtime.js +120 -0
  284. package/dist/session/provider-cli/provider-cli.service.d.ts +53 -53
  285. package/dist/session/provider-cli/provider-cli.service.js +1299 -2523
  286. package/dist/session/provider-cli/provider-cli.types.d.ts +38 -0
  287. package/dist/session/provider-cli/provider-cli.windows-environment.d.ts +10 -0
  288. package/dist/session/provider-cli/provider-cli.windows-environment.js +151 -0
  289. package/dist/session/provider-cli/provider-cli.windows-launch.d.ts +23 -0
  290. package/dist/session/provider-cli/provider-cli.windows-launch.js +131 -0
  291. package/dist/session/provider-cli/provider-in-flight-work.d.ts +10 -0
  292. package/dist/session/provider-cli/provider-in-flight-work.js +92 -0
  293. package/dist/session/provider-cli/provider-output-pipes.d.ts +30 -0
  294. package/dist/session/provider-cli/provider-output-pipes.js +67 -0
  295. package/dist/session/provider-cli/provider-output-state.d.ts +40 -0
  296. package/dist/session/provider-cli/provider-output-state.js +832 -0
  297. package/dist/session/provider-cli/provider-usage.d.ts +9 -1
  298. package/dist/session/provider-cli/provider-usage.js +28 -5
  299. package/dist/session/provider-cli/provider-user-config-isolation.d.ts +69 -0
  300. package/dist/session/provider-cli/provider-user-config-isolation.js +164 -0
  301. package/dist/session/publishable-worktree-changes.d.ts +54 -0
  302. package/dist/session/publishable-worktree-changes.js +193 -0
  303. package/dist/session/qa-sidecar-validation.d.ts +6 -0
  304. package/dist/session/qa-sidecar-validation.js +28 -0
  305. package/dist/session/sandbox-host-capacity-gate.d.ts +51 -0
  306. package/dist/session/sandbox-host-capacity-gate.js +257 -0
  307. package/dist/session/session-redaction.d.ts +3 -0
  308. package/dist/session/session-redaction.js +298 -0
  309. package/dist/session/session.base.d.ts +14 -1
  310. package/dist/session/session.service.d.ts +17 -2
  311. package/dist/session/session.service.js +708 -60
  312. package/dist/session/session.types.d.ts +327 -3
  313. package/dist/session/session.types.js +951 -10
  314. package/dist/session/sidecar-json-shape.d.ts +31 -0
  315. package/dist/session/sidecar-json-shape.js +217 -0
  316. package/dist/session/unreferenced-exports.d.ts +12 -0
  317. package/dist/session/unreferenced-exports.js +59 -0
  318. package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
  319. package/dist/session/workspace-runtime-fingerprint.js +138 -0
  320. package/dist/shared/format/format-bytes.d.ts +1 -0
  321. package/dist/shared/format/format-bytes.js +9 -0
  322. package/dist/shared/fs/file-identity.d.ts +10 -0
  323. package/dist/shared/fs/file-identity.js +15 -0
  324. package/dist/shared/fs/replace-file.d.ts +7 -0
  325. package/dist/shared/fs/replace-file.js +33 -0
  326. package/dist/shared/git/git.js +2 -1
  327. package/dist/shared/path/path.d.ts +1 -0
  328. package/dist/shared/path/path.js +21 -1
  329. package/dist/shared/process/dotnet-toolchain.d.ts +17 -0
  330. package/dist/shared/process/dotnet-toolchain.js +307 -0
  331. package/dist/shared/process/host-process-recovery.d.ts +23 -0
  332. package/dist/shared/process/host-process-recovery.js +99 -0
  333. package/dist/shared/process/host-process-supervisor.d.ts +72 -0
  334. package/dist/shared/process/host-process-supervisor.js +383 -0
  335. package/dist/shared/process/process-tree.d.ts +52 -0
  336. package/dist/shared/process/process-tree.js +144 -0
  337. package/dist/shared/process/process.d.ts +70 -0
  338. package/dist/shared/process/process.js +224 -16
  339. package/dist/shared/process/windows-app-execution-alias.d.ts +19 -0
  340. package/dist/shared/process/windows-app-execution-alias.js +45 -0
  341. package/dist/shared/process/windows-launch.d.ts +26 -0
  342. package/dist/shared/process/windows-launch.js +109 -0
  343. package/dist/shared/provider-capabilities.d.ts +4 -0
  344. package/dist/shared/provider-capabilities.js +95 -0
  345. package/dist/shared/redaction/redaction.d.ts +1 -0
  346. package/dist/shared/redaction/redaction.js +47 -4
  347. package/dist/shared/time/monotonic.d.ts +1 -0
  348. package/dist/shared/time/monotonic.js +8 -0
  349. package/dist/version.d.ts +1 -1
  350. package/dist/version.js +1 -1
  351. package/dist/worktree/artifact-injector.d.ts +3 -2
  352. package/dist/worktree/artifact-injector.js +82 -10
  353. package/dist/worktree/dependency-warmer.d.ts +78 -1
  354. package/dist/worktree/dependency-warmer.js +731 -13
  355. package/dist/worktree/index.d.ts +2 -1
  356. package/dist/worktree/index.js +1 -0
  357. package/dist/worktree/prior-phase-artifact-hydrator.d.ts +2 -0
  358. package/dist/worktree/prior-phase-artifact-hydrator.js +136 -0
  359. package/dist/worktree/story-qa-reference-hydrator.d.ts +4 -0
  360. package/dist/worktree/story-qa-reference-hydrator.js +253 -0
  361. package/dist/worktree/wip-git.d.ts +33 -0
  362. package/dist/worktree/wip-git.js +122 -0
  363. package/dist/worktree/wip-refs.d.ts +62 -0
  364. package/dist/worktree/wip-refs.js +119 -0
  365. package/dist/worktree/wip-restore.d.ts +38 -0
  366. package/dist/worktree/wip-restore.js +190 -0
  367. package/dist/worktree/wip-snapshot.d.ts +50 -0
  368. package/dist/worktree/wip-snapshot.js +268 -0
  369. package/dist/worktree/worktree-paths.d.ts +4 -0
  370. package/dist/worktree/worktree-paths.js +30 -0
  371. package/dist/worktree/worktree-wip-events.d.ts +18 -0
  372. package/dist/worktree/worktree-wip-events.js +98 -0
  373. package/dist/worktree/worktree-wip.d.ts +49 -0
  374. package/dist/worktree/worktree-wip.js +182 -0
  375. package/dist/worktree/worktree.base.d.ts +10 -1
  376. package/dist/worktree/worktree.service.d.ts +30 -4
  377. package/dist/worktree/worktree.service.js +379 -54
  378. package/dist/worktree/worktree.types.d.ts +38 -1
  379. package/package.json +12 -7
  380. package/runtime/windows-job-supervisor.ps1 +722 -0
  381. package/runtime/windows-listener-owner.ps1 +33 -0
package/README.md CHANGED
@@ -23,6 +23,16 @@ forge-bridge status
23
23
  forge-bridge connect --server <forge-url> --runner-id <runner-id> --device-token <device-token>
24
24
  ```
25
25
 
26
+ To pair, open **Settings → Runners → Connect a bridge** in Forge and run the command it shows:
27
+
28
+ ```bash
29
+ forge-bridge pair <code> --server <forge-url>
30
+ ```
31
+
32
+ The runner name, provider CLIs and repo folder chosen in that dialog come back with the claim
33
+ and are saved to `bridge.json`; `--repo-root` and `--cli-provider` on the command line win over
34
+ them. `bridge.json` holds the device token, so the bridge writes it with mode `0600`.
35
+
26
36
  The bridge can also read connection settings from environment variables:
27
37
 
28
38
  - `FORGE_URL`
@@ -31,7 +41,44 @@ The bridge can also read connection settings from environment variables:
31
41
  - `FORGE_DEVICE_NAME`
32
42
  - `FORGE_REPO_ROOT`
33
43
  - `FORGE_CLI_PROVIDERS`
34
- - `FORGE_CODEX_MODELS` / `FORGE_CURSOR_MODELS` (optional comma-separated model ids advertised in runner capabilities)
44
+ - `FORGE_CODEX_MODELS` / `FORGE_CURSOR_MODELS` / `FORGE_CLAUDE_MODELS` (optional comma-separated model ids advertised in runner capabilities)
45
+ - `FORGE_DOTNET_PATH` (optional absolute `dotnet` executable; the bridge otherwise selects one SDK compatible with its mapped repositories)
46
+
47
+ At `connect`, the bridge inspects mapped .NET repositories and the configured repository root,
48
+ selects one installation satisfying their SDK policies, and pins that executable through `PATH` and `DOTNET_ROOT` for dependency warming,
49
+ managed commands, tests, and host-runtime launches. It fails before accepting work when
50
+ no compatible SDK is available instead of falling through to an older ambient SDK.
51
+ During a framework transition, that installation may need both SDK 8 and SDK 10 side by side;
52
+ separate installations do not combine their SDK inventories. Each checkout retains its own
53
+ `global.json` policy. Keep the default clone root narrowly scoped rather than pointing it at
54
+ a parent containing unrelated maintenance checkouts and generated projects.
55
+
56
+ ## Provider CLIs
57
+
58
+ The bridge auto-detects these provider CLIs on `PATH` and advertises the ones it finds:
59
+
60
+ | Provider | CLI | Sign-in | Headless invocation |
61
+ | --- | --- | --- | --- |
62
+ | `codex` | `codex` | `codex login` | `codex exec --json` |
63
+ | `cursor` | `cursor-agent` | `cursor-agent login` | `cursor-agent --print --output-format stream-json` |
64
+ | `claude` | `claude` (Claude Code) | `claude` then `/login`, or an Anthropic API key granted by Forge | `claude -p --output-format stream-json --verbose` |
65
+
66
+ Claude Code notes:
67
+
68
+ - Install with the native installer or `npm install -g @anthropic-ai/claude-code`. On Windows, Claude Code needs Git for Windows; set `CLAUDE_CODE_GIT_BASH_PATH` if `bash.exe` is not on `PATH`. Forge doesn't pass `CLAUDE_CONFIG_DIR` to Claude Code, so it signs in from `~/.claude` (`%USERPROFILE%\.claude` on Windows) or with an Anthropic API key Forge grants; sign in there, not in a custom config directory.
69
+ - Forge pipes the prompt on stdin, runs with `--permission-mode bypassPermissions` inside the managed worktree, and registers its completion MCP server through a temporary `--mcp-config` file outside the worktree with `--strict-mcp-config`, so user-level MCP servers are not loaded into unattended runs. Forge tools appear to the model as `mcp__forge__<tool>`.
70
+ - Claude Code has no model-listing command, so the bridge advertises the `sonnet`, `opus`, and `haiku` aliases. Set `FORGE_CLAUDE_MODELS` to advertise specific model ids instead.
71
+ - Claude runs in host mode only. Docker sandbox placement currently supports Codex only.
72
+
73
+ Show or change the saved server without editing `bridge.json`:
74
+
75
+ ```bash
76
+ forge-bridge server show
77
+ forge-bridge server set http://localhost:5208
78
+ forge-bridge server set https://forge.example.ts.net:8443
79
+ ```
80
+
81
+ `FORGE_URL` overrides the saved server. Changing the saved URL retains runner credentials so aliases for the same deployment keep working; pair again with `--server` when switching to a different Forge deployment.
35
82
 
36
83
  ## Repo-local development
37
84
 
@@ -53,6 +100,264 @@ forge-bridge add-repo Forge /path/to/Forge
53
100
  forge-bridge remove-repo Forge
54
101
  ```
55
102
 
103
+ Readiness probes and Story dispatch select the same local mapping: repository ID first,
104
+ then a remote-only mapping, then a legacy name-only mapping. Explicit mappings may point
105
+ outside the default clone root; both paths use the mapped checkout's parent without moving
106
+ existing managed worktrees. A readiness request must name the same fully qualified local
107
+ checkout. Missing, ambiguous or mismatched mappings fail before runtime preparation; a
108
+ server-supplied path never grants access to a different repository.
109
+
110
+ Before narrowing a runner's default root, inventory its advertisements, explicitly retain
111
+ every approved or intended executable mapping and its QA launch targets, and document any
112
+ intentional exclusions. An omitted repository mapping can lose its server-side execution
113
+ approval. Reconcile a stale mapping rather than widening filesystem
114
+ access to make a failed readiness request pass.
115
+
116
+ ## Host Docker engine capability
117
+
118
+ The bridge probes ordinary Docker-daemon access under its own process identity and advertises the
119
+ generic `docker_engine` execution facility independently from Docker sandbox placement. A Story whose
120
+ QA scope requires `docker_engine` is admitted only to a managed host runner with a fresh successful
121
+ probe. This supports repository-owned Testcontainers, Compose services, and other container tests;
122
+ the repository remains responsible for database and image versions. Forge agent sandboxes do not
123
+ receive the host Docker socket, so a Docker-engine requirement is not eligible for
124
+ `executionMode: docker`. The probe is refreshed on heartbeats and again immediately before a matching
125
+ dispatch.
126
+
127
+ On developer Windows runners, local Docker Desktop recovery can be explicitly enabled by setting
128
+ `dockerDesktopRecoveryEnabled` to `true` in the bridge's local `bridge.json`, or with the
129
+ `FORGE_DOCKER_DESKTOP_AUTO_RECOVERY=true` operator override. The bridge waits for three consecutive
130
+ failed daemon probes plus a fresh confirmation probe after a 30-second grace period. It recovers only
131
+ the local `default` or `desktop-linux` context, and only while it owns no active session or
132
+ reservation. If Docker Desktop is already stopped, recovery starts it without issuing shutdown or
133
+ WSL termination commands. Before relaunch, it removes only verified orphaned Docker companion
134
+ processes whose executable is inside the Docker installation and whose parent is no longer a valid
135
+ Docker backend. A running but unresponsive Desktop is stopped, allowed to settle, and relaunched
136
+ with bounded retries that reject an immediately exiting process. Every recovery is
137
+ single-flight, must pass a fresh `docker info` probe before the capability is advertised again, and
138
+ enters a ten-minute cooldown after an unsuccessful attempt. Remote `DOCKER_HOST` endpoints are never
139
+ restarted. Operators can tune the bounded policy with `FORGE_DOCKER_RECOVERY_FAILURE_THRESHOLD`,
140
+ `FORGE_DOCKER_RECOVERY_COOLDOWN_MS`, and `FORGE_DOCKER_RECOVERY_STARTUP_TIMEOUT_MS`.
141
+
142
+ ## Runner limits and yield
143
+
144
+ Forge owns each runner's limits (Settings → Runners → Limits) and pushes them to the bridge, which
145
+ applies them without a restart and without stopping admitted work: max attempts and the memory reserve
146
+ apply at the next attempt admission, the CPU budget, yield budget and max heavy steps at the next heavy
147
+ step. Host env vars only bound the server's values and are reported back to Forge: a ceiling on
148
+ capacity (`FORGE_HOST_MAX_CONCURRENT_ATTEMPTS`, `FORGE_HOST_CPU_BUDGET_PERCENT`,
149
+ `FORGE_HOST_LOAD_CPU_BUDGET_FRACTION`, `FORGE_HOST_MAX_HEAVY_STEPS`) and a floor on the reserve
150
+ (`FORGE_HOST_MEMORY_RESERVE_BYTES`). Without a server value, the env var or the bridge default applies.
151
+ The CPU budget, yield budget and heavy-step limit take effect only with `FORGE_HOST_LOAD_GOVERNOR=on`.
152
+ They gate on Linux PSI. Windows has no PSI, so a Windows bridge estimates CPU pressure from whole-host
153
+ CPU use and reports it with `pressureSource: "windows_estimate"` (decision 0021). Forge's Load column
154
+ and the budgets then work there too. Without either signal, the governor falls back to one heavy step at a time.
155
+
156
+ Two or more attempts on one host take turns at the host test slot (decision 0018): builds, test runs,
157
+ Playwright, pre-publication checks and the ASP.NET runtime build each wait for it in one host-wide queue,
158
+ foreground first, then first come, first served, across the bridge and every completion MCP server. Plain
159
+ managed commands and dependency installs never wait for it. A waiting step reports who holds the slot
160
+ (`prepublication_host_capacity_waiting`, `host_runtime_build_waiting_for_host_capacity`, or
161
+ `host_load_wait_detail` on a managed command's receipt), and its own timeout starts only once it runs.
162
+ A holder that crashes or stalls keeps the slot only until the host load ledger takes its token back (its
163
+ process tree stopped, its lease fenced, or attempt teardown). `FORGE_HOST_LOAD_TEST_SLOTS` sets how many
164
+ run at once (default 1; `0` turns the slot off).
165
+
166
+ Yield this machine to foreground work (for example while gaming) from the host itself:
167
+
168
+ ```bash
169
+ forge-bridge yield on
170
+ forge-bridge yield status
171
+ forge-bridge yield off
172
+ ```
173
+
174
+ While yielding, the bridge takes no new attempts and heavy steps of running attempts use the yield CPU
175
+ budget. Yield is on when this local flag or the runner's Yield toggle in Forge is on. The flag is stored
176
+ in `bridge.yield.json` next to `bridge.json`, and a running bridge notices it within one heartbeat.
177
+
178
+ ## Restarting or updating the bridge safely
179
+
180
+ Restarting `forge-bridge connect` kills everything it is running, including work that has no agent
181
+ process yet: an accepted offer waiting for Start, host-runtime admission, worktree and dependency
182
+ preparation, prepared-runtime probes, pre-publication validation and teardown. Forge then records the
183
+ attempt's outcome as unknown. Checking for agent processes is not enough, so the running bridge
184
+ publishes its in-flight work to `bridge.state.json` next to `bridge.json` (pid, runner instance, a
185
+ heartbeat refreshed every 5 seconds, and each in-flight item with its ids, phase and start time), and
186
+ `forge-bridge status --idle` reads it. Each bridge reads and rewrites the file while it holds a lock
187
+ the operating system owns and frees when the bridge exits (an abstract socket on Linux, a named pipe
188
+ on Windows, a flock on `bridge.state.json.lock` on macOS), so a second bridge on the same config always
189
+ sees the first one's record and reports the conflict, and a stopping bridge never writes its "stopped"
190
+ record over a newer bridge's. A bridge that can't publish (a failed write, or the lock held by another
191
+ process for more than 5 seconds) leaves `bridge.state.json.unpublished.<id>.json` instead of touching
192
+ the shared record, and a record missing any field reads as unknown, so neither can read as idle:
193
+
194
+ | Exit code | Verdict | Meaning |
195
+ |---:|---|---|
196
+ | 0 | `idle` | A live bridge reported a fresh heartbeat with nothing in flight. |
197
+ | 1 | `busy` | Work is in flight; restarting now would kill it. |
198
+ | 2 | | Usage error. |
199
+ | 3 | `stale` / `unknown` | Old heartbeat (hung bridge or reused pid), missing or unreadable state file, two bridge processes publishing to one config, or the bridge is shutting down. Idle can't be confirmed. A bridge older than this check writes no state file, so it reads as `unknown`. |
200
+ | 4 | `not_running` | The recorded bridge process has exited. Nothing to interrupt, but it is not an idle report. |
201
+ | 5 | `not_yielding` | With `--require-yield`: nothing in flight, but Forge has not acknowledged yield from this bridge, so placement can still pick it. |
202
+
203
+ `--json` prints the verdict, the reason, the heartbeat age, the pid check, the yield state (`yielding`:
204
+ acknowledged by Forge; `yieldApplied`: applied by the bridge) and the in-flight list. `--wait <seconds>`
205
+ keeps checking until the bridge is idle, its process has exited, or the time is up, so a file briefly
206
+ held by antivirus or the indexer doesn't end the wait; `--wait 0` checks once, like no `--wait`.
207
+ Against a bridge older than this check (no state file) it waits out the full time; check once without
208
+ `--wait` first.
209
+
210
+ What yield does and doesn't stop:
211
+
212
+ - It stops new attempts: the bridge refuses Offers while yielding (Forge re-places them), and Forge
213
+ stops placing work on the runner once it has acknowledged the yield (the next heartbeat or settings
214
+ report, at most about 30 seconds). `--require-yield` waits for that acknowledgement.
215
+ - It defers background runtime-readiness probes; Forge retries them after yield is off.
216
+ - It doesn't stop a Bridge Chat turn whose chat lease is already bound to this runner: Forge has no
217
+ retry for a refused turn, so the bridge runs it, and `status --idle` reports it as busy until it ends.
218
+ - It doesn't stop a legacy `Dispatch`, which Forge sends only to protocol-1 bridges. This bridge
219
+ registers a newer protocol, so it receives Offer and Start instead. A legacy dispatch is still
220
+ counted as busy.
221
+ - Attempts already running finish normally.
222
+
223
+ Restart procedure: yield, wait for idle, restart, then turn yield off once the new bridge has connected
224
+ (the flag file survives the restart, so the new bridge starts yielded and takes no work until then).
225
+ If the wait fails, turn yield off again so the runner doesn't stay out of placement, or leave it on
226
+ deliberately and retry later.
227
+ Run the commands as the same user and with the same `FORGE_BRIDGE_CONFIG` as the bridge so they use its
228
+ `bridge.json`, `bridge.yield.json` and `bridge.state.json`. On Windows, a shell inside an MSIX-packaged
229
+ app can have `%APPDATA%` writes virtualized away from the bridge; `--require-yield` catches that, because
230
+ the yield has to be applied by the bridge and acknowledged by Forge.
231
+
232
+ Linux or macOS:
233
+
234
+ ```bash
235
+ forge-bridge yield on
236
+ if forge-bridge status --idle --require-yield --wait 3600; then
237
+ # Stop forge-bridge connect, update it (npm install -g @loucompanion/forge-bridge@next), start it again.
238
+ forge-bridge yield off # once the new bridge has connected
239
+ else
240
+ code=$?
241
+ forge-bridge yield off # don't leave the runner out of placement
242
+ echo "Bridge is not idle (exit $code); not restarting." >&2
243
+ fi
244
+ ```
245
+
246
+ Windows PowerShell:
247
+
248
+ ```powershell
249
+ forge-bridge yield on
250
+ forge-bridge status --idle --require-yield --wait 3600
251
+ $code = $LASTEXITCODE
252
+ if ($code -eq 0) {
253
+ # Stop forge-bridge connect, update it (npm install -g @loucompanion/forge-bridge@next), start it again.
254
+ forge-bridge yield off # once the new bridge has connected
255
+ } else {
256
+ forge-bridge yield off # don't leave the runner out of placement
257
+ Write-Error "Bridge is not idle (exit $code); not restarting."
258
+ }
259
+ ```
260
+
261
+ The bridge also logs each accepted offer, each accepted dispatch and the start and end of each run,
262
+ with the dispatch attempt, lease, session and cycle ids.
263
+
264
+ ## Pre-publication repair
265
+
266
+ Before Forge commits and pushes an agent's work, the bridge runs the CI parity checks in
267
+ `.forge/validation/ci-parity.v1.json`. A failed check does not stop the pass: the other checks still
268
+ run, except those that need what failed (the OpenAPI export and E2E after a .NET compile failure, E2E
269
+ after a failed runtime restart). The provider thread then gets one in-place repair turn that lists
270
+ every failed check. A Work Order holds after `FORGE_PREPUBLICATION_REPAIR_TURNS` repair turns (a whole
271
+ number from 1, capped at 10; default 4) if validation still fails.
272
+
273
+ ## Docker sandbox runners
274
+
275
+ Protocol-v2 bridges preflight Docker before advertising the `docker` sandbox runtime. Validate a repository contract and the local runner before enabling a project's `sandbox_required` policy:
276
+
277
+ ```bash
278
+ forge sandbox init
279
+ forge sandbox doctor
280
+ forge sandbox smoke
281
+ forge-bridge sandbox reap
282
+ ```
283
+
284
+ Configure the local bridge's persistent Docker placement policy with:
285
+
286
+ ```bash
287
+ forge-bridge sandbox on
288
+ forge-bridge sandbox on --allow-open-public
289
+ forge-bridge sandbox status
290
+ forge-bridge sandbox off
291
+ ```
292
+
293
+ `sandbox on` keeps unrestricted public networking denied by default. The developer-only
294
+ `--allow-open-public` option stores an explicit local approval in `bridge.json`; it survives
295
+ bridge restarts and is reported by `sandbox status`. Restart a connected bridge after changing
296
+ the policy. `FORGE_DOCKER_SANDBOX` and `FORGE_ALLOW_OPEN_PUBLIC_SANDBOX` remain higher-priority
297
+ operator overrides when present.
298
+
299
+ `forge sandbox smoke` runs doctor, builds the repository-owned `.forge/Dockerfile`, launches a disposable hardened container on an internal network with a fresh workspace volume, and verifies that its exact attempt-labeled container, network, volume, and image are gone afterward. It writes a redacted JSON report under `FORGE_SANDBOX_STATE_ROOT/smoke-reports`; use `--report <path>` to choose a different destination. Stop the connected bridge before running smoke so the command can exclusively acquire the Docker-context ownership lock.
300
+
301
+ Use `forge sandbox smoke --probe-loopback-port` only when proving Docker host-port allocation. The normal hardened container remains internal with no publication; a separate exact-labeled fixture requests `127.0.0.1::8080/tcp`, records Docker's assigned loopback port, rejects wildcard or ambiguous mappings, and is removed by the same exact-label cleanup verification.
302
+
303
+ Production shared runners require a Linux rootless Docker daemon. Docker Desktop is developer-only and must be opted in with `FORGE_ALLOW_DOCKER_DESKTOP_SANDBOX=true`. Useful runner settings are:
304
+
305
+ - `FORGE_TRUST_DOMAIN_ID` — must match the project trust domain.
306
+ - `FORGE_MAX_CONCURRENT_SANDBOXES` — hard slot ceiling; start at `1`.
307
+ - `FORGE_MAX_CONCURRENT_SANDBOX_BUILDS` / `FORGE_SANDBOX_PID_CAPACITY` — weighted build and PID admission ceilings (defaults: `1` and `2048`).
308
+ - `FORGE_DOCKER_CONTEXT` / `FORGE_DOCKER_EXECUTABLE` — dedicated daemon selection.
309
+ - `FORGE_SANDBOX_STATE_ROOT` — fsync'd attempt ledgers, restricted diagnostics, and build state.
310
+ - `FORGE_SANDBOX_EXECUTION_ROOT` — optional absolute root for disposable managed-host temp/cache/test trees. Windows defaults to the compact per-user `%USERPROFILE%\.fgx` root and rejects a configured root that cannot fit Forge's nested Git/test path budget before an agent starts. Durable ledgers and retained diagnostics remain under `FORGE_SANDBOX_STATE_ROOT`.
311
+ - `FORGE_DISK_HIGH_WATERMARK_PERCENT` / `FORGE_DISK_LOW_WATERMARK_PERCENT` / `FORGE_MINIMUM_WORKSPACE_BYTES` — admission watermarks with high/low hysteresis.
312
+ - Per-attempt workspace reservations are calculated from the repository source footprint, detected Node/.NET/browser toolchains, the execution role, and immutable sandbox app services. The API uses that request for local and Bridge placement; a Bridge rechecks its authoritative checkout and Docker contract before acceptance. Shared Docker images and package caches remain runner-level capacity, while `FORGE_MINIMUM_WORKSPACE_BYTES` remains a separate host safety reserve rather than a per-lane charge.
313
+ - `FORGE_SANDBOX_HOST_MEMORY_RESERVE_BYTES` — explicit host-memory safety-reserve override for sandbox admission. Without an override, Forge derives a bounded reserve from the sampled capacity domain (Linux: 12.5%, 1–4 GiB; Docker Desktop development: 6.25%, 1–2 GiB). The floor, ceiling, and percentage are configurable with `FORGE_SANDBOX_HOST_MEMORY_RESERVE_FLOOR_BYTES`, `FORGE_SANDBOX_HOST_MEMORY_RESERVE_CEILING_BYTES`, and `FORGE_SANDBOX_HOST_MEMORY_RESERVE_PERCENT`.
314
+ - Managed-host admission uses the same bounded 12.5% physical-memory policy through `FORGE_HOST_MEMORY_RESERVE_BYTES` or its `_FLOOR_BYTES`, `_CEILING_BYTES`, and `_PERCENT` controls. While no Forge attempt holds capacity, the first worker is admitted against the configured reserve floor (1 GiB by default); `FORGE_HOST_IDLE_MEMORY_RESERVE_BYTES` can override that idle reserve. Once an attempt is admitted, every additional admission enforces the full target reserve. Pressure is applied immediately; recovery requires two samples one second apart by default (`FORGE_HOST_MEMORY_RECOVERY_SAMPLES` and `FORGE_HOST_MEMORY_RECOVERY_SAMPLE_INTERVAL_MS`). `FORGE_HOST_DEFAULT_WORKER_MEMORY_LIMIT_BYTES` configures only the conservative cold-start fallback for legacy packets that omit an exact worker request; current packets remain governed by their explicit role request.
315
+ - `FORGE_SANDBOX_MEMORY_SAMPLE_INTERVAL_MS` — interval for sampled Docker peak-memory telemetry (default `1000` ms, clamped to `250`–`30000` ms). Sampling is diagnostic and never changes an attempt outcome.
316
+ - `FORGE_SANDBOX_DEDICATED_DISK=true` — operator assertion that sandbox storage is on a dedicated, conservatively watermarked disk when the Docker storage driver cannot enforce per-volume quotas. `sandbox_required` fails placement unless either quota support or this assertion is advertised.
317
+ - `FORGE_SANDBOX_IMAGE_RETENTION_COUNT` / `FORGE_SANDBOX_IMAGE_RETENTION_TTL_MS` — per-project image-cache retention (defaults: 3 images and 7 days).
318
+ - `FORGE_SANDBOX_AUDIT_RETENTION_COUNT` / `FORGE_SANDBOX_AUDIT_RETENTION_TTL_MS` — restricted failed-build/attestation retention (defaults: 200 keys and 30 days); evidence for active image digests is protected.
319
+ - `FORGE_AGENT_TOOLING_IMAGE` — digest-pinned Node tooling base required by `sandbox_required`.
320
+ - `FORGE_SANDBOX_IMAGE_POLICY_ENFORCED`, `FORGE_SANDBOX_SBOM_EXECUTABLE`, `FORGE_SANDBOX_VULNERABILITY_EXECUTABLE`, and `FORGE_SANDBOX_PROVENANCE_SIGNING_KEY` — required generated-image promotion gates. The SBOM command must accept Syft-compatible `<image> -o spdx-json`; the vulnerability command must accept Trivy-compatible image arguments.
321
+ - `FORGE_SANDBOX_SIGNATURE_EXECUTABLE` / `FORGE_SANDBOX_SIGNATURE_PUBLIC_KEY` — Cosign-compatible verifier and bounded public-key file. `sandbox_required` verifies every digest-pinned external Dockerfile base/`COPY --from` source and Forge tooling base before generated-image promotion, plus every service-catalog and egress-proxy image before runtime use; adoption modes emit a warning when verification is not configured.
322
+ - `FORGE_SANDBOX_BUILD_EGRESS_ENFORCED` — confirms the dedicated BuildKit builder is behind the approved build-egress control; required for `sandbox_required`.
323
+ - `FORGE_SANDBOX_BUILD_NOFILE` — bounded per-build-step file-descriptor cap (default: `4096`). `FORGE_SANDBOX_BUILDER_PIDS_LIMIT` caps and verifies aggregate processes on the dedicated BuildKit container (default `512`). Buildx `--resource` memory/CPU caps are intentionally not emitted because they are not portable across supported Buildx versions; agent runtime containers still receive Docker memory/CPU limits.
324
+ - `FORGE_SANDBOX_BUILDKIT_CACHE_MAX` / `FORGE_SANDBOX_BUILDKIT_CACHE_RESERVED` — pressure-triggered dedicated-builder cache bounds (defaults: 20 GiB maximum and 2 GiB reserved; minimum free space follows `FORGE_MINIMUM_WORKSPACE_BYTES`).
325
+ - `FORGE_SANDBOX_SECCOMP_PROFILE` / `FORGE_SANDBOX_LSM_SECURITY_OPT` — absolute hardened seccomp profile and AppArmor/SELinux Docker security option applied to every agent and service; required for `sandbox_required`.
326
+ - `FORGE_SANDBOX_HARD_WALL_SECONDS` / `FORGE_SANDBOX_IDLE_SECONDS` — monotonic worker deadlines (defaults: 8 hours and 30 minutes; both are capped by the 8-hour hard maximum).
327
+ - `FORGE_SANDBOX_PUBLICATION_MODE=bridge_push` — remote-safe exact-SHA result publication. This is required for `sandbox_required`; the default `shared_filesystem` mode is intended only for deployments where the bridge and API intentionally share the repository filesystem.
328
+ - `FORGE_SERVICE_POSTGRES_IMAGE`, `FORGE_SERVICE_REDIS_IMAGE`, and `FORGE_SERVICE_BROWSER_IMAGE` — digest-pinned service-catalog images when declared by a contract.
329
+
330
+ `public_allowlist` uses an internal agent network plus a separate external network joined only by a restricted Squid-compatible proxy. Configure a digest-pinned `FORGE_SANDBOX_EGRESS_PROXY_IMAGE` and `FORGE_SANDBOX_EGRESS_ENFORCED=true`; Forge generates the domain allowlist with private, loopback, link-local, metadata, unsafe-port, and default-deny rules and injects proxy variables into the worker. `open_public` is developer-only and additionally requires `FORGE_ALLOW_OPEN_PUBLIC_SANDBOX=true`. Neither setting weakens `sandbox_required`.
331
+
332
+ Before selecting `sandbox_required`, save the full approved 40- or 64-character Git commit SHA in the project's Sandbox policy dialog. The server persists that SHA on the immutable attempt and the bridge reads `.forge/forge.sandbox.yml`, `.forge/Dockerfile`, and the tracked build context only from that commit. API-key dispatches carry an opaque one-time grant handle; the authenticated current runner instance redeems it after reservation, and plaintext stays out of offers, database payloads, Docker metadata, and host-persisted control files.
333
+
334
+ Temporary host fallback for `sandbox_preferred` requires both sides to opt in: a project owner must save a reason and future expiry (maximum 30 days), and an operator must enable **Host fallback** for the runner in Settings › Runners. Either missing or expired authorization fails closed. `sandbox_required` never falls back.
335
+
336
+ The bridge reaps exact-labeled orphan resources before connecting and every minute afterward. Connected passes reconcile current-instance ledgers against an authoritative, instance-scoped server attempt snapshot; startup does not adopt old-instance resources and terminates them before advertising capacity. Per-resource removal outcomes are written mode-0600 under `FORGE_SANDBOX_STATE_ROOT/cleanup-reports` before transmission, replayed after reconnect, acknowledged by report ID, and persisted by the API only when attempt, fence, resource runner instance, and current reporting runner match. Fenced dispatch events also persist image/cache status, build/agent-start/import/teardown timestamps, and a validated inventory of created agent/sidecar containers, networks, volumes, and published ports. Selected-session diagnostics expose that lifecycle data and recent cleanup actions while retaining cleanup-pending state after the agent outcome is terminal. Install `forge-bridge sandbox reap` as an independently supervised OS timer with the same `FORGE_RUNNER_ID`, Docker context, and state root so resources are reconciled while the bridge is down; the Docker-context ownership lock makes an overlapping pass fail safely. A non-zero `degradedReservationCount` means teardown has not completed; the affected capacity remains unavailable until a successful reaper pass. Drain a runner from Settings › Runners before upgrades or Docker maintenance, wait for active/starting counts to reach zero, then restart the bridge. Settings › Runners also exposes a scoped **Reap** action; the API delivers it only to the currently established protocol-v2 runner instance. Image GC runs only while disk pressure is latched, shares the build lock, preserves active image digests, and prunes only expired images beyond the per-project retention count. Lease renewals are HMAC-bound to the attempt and fence and advance an in-container monotonic deadline; lease, hard-wall, and idle expiry produce distinct failure codes.
337
+
338
+ Every attempt-owned container (including short-lived initialization helpers), network, and volume carries `dev.forge.resource-lease-id` equal to the dispatch execution lease. Ledger schema v2 persists the same `resourceLeaseId`; teardown compares the complete expected label set, and orphan reaping fails closed unless the managed, resource-lease, execution-lease, attempt, runner, runner-instance, and fencing identities are all present and consistent.
339
+
340
+ Host-mode diagnostics retain logs and test results under the 200 MiB archive budget, but omit reproducible `.dll` and `.pdb` copies from `test-output`; the archive manifest records their count and bytes. If other evidence exceeds the budget after supervised children and adapters have stopped, the Bridge releases runtime capacity while preserving the original attempt directory and a released ledger for restricted operator review. It does not delete over-budget original evidence automatically. Process-cleanup failures and unsafe evidence paths still fail closed and retain the runtime claim.
341
+
342
+ In `bridge_push` mode, the start packet carries only an attempt/fence/branch-bound publication handle. After validating and importing the output bundle, the authenticated current bridge redeems that handle for an in-memory, exact-repository credential; the API rechecks the live lease/fence/grant/branch/result SHA and records redemption before returning it. Git receives the credential through a process environment configuration, never command arguments, files, Git config, or the container. The bridge compares the remote branch with the immutable input commit and pushes only the exact result commit using `--force-with-lease`; cancellation aborts Git, an already-published matching result is an idempotent success, and any other remote value is rejected as stale. The API records the fenced publication acknowledgment before sign-off and does not push the branch a second time while opening the pull request.
343
+
344
+ Failed project, tooling, and agent image stages preserve only a redacted, capped, mode-0600 diagnostic at `FORGE_SANDBOX_STATE_ROOT/build-logs/<image-key>/<stage>.log`. The event stream carries its digest, byte count, and truncation flag, never the log contents. Treat this directory as restricted source-bearing audit data and apply local retention controls.
345
+
346
+ ## Owned test evidence
347
+
348
+ `npm test` closes a manifest over the complete Bridge source, test, runtime, configuration, workflow,
349
+ and imported fixture set before compilation. It records the Git commit and exact Node, npm, Git, .NET,
350
+ TypeScript, Vitest, OS, and temporary-root identities, compiles into an owned temporary root, runs
351
+ Vitest through the Windows process-tree supervisor, revalidates the source and toolchain, independently
352
+ rehashes the compiled output, and removes the exact owner root before reporting success.
353
+
354
+ Set `FORGE_BRIDGE_SUITE_RECEIPT_PATH` to an absolute path for a nonexistent output file to retain the
355
+ verified execution receipt. On Windows evidence runs, `TEMP`, `TMP`, `TMPDIR`, and `FORGE_TMPDIR` may
356
+ point to the same short, empty, high-capacity root. This changes only owned temporary-file placement; it
357
+ does not weaken disk, memory, cleanup, or Docker preflight policy. A Bridge receipt remains
358
+ `fullGateAttested=false` until the suite is registered with the live residue auditor and the required
359
+ source/toolchain-identical repeat evidence is complete.
360
+
56
361
  ## Package smoke check
57
362
 
58
363
  From this package directory:
@@ -0,0 +1,19 @@
1
+ import type { ProviderCliCommand, ProviderProcessRunResult } from "../session/provider-cli/provider-cli.process.js";
2
+ import { type ChatTurnDispatchPacket } from "./bridge-chat.types.js";
3
+ /** The turn-scoped handoff metadata file the bridge writes into the chat workspace. */
4
+ export declare const chatTurnMetadataFileName = "forge-chat-metadata.json";
5
+ /**
6
+ * Fails a Bridge Chat turn Forge stopped because it ended with background work still live: the
7
+ * turn never delivered its answer, so it must not be reported as one.
8
+ */
9
+ export declare function assertChatTurnFinished(result: Pick<ProviderProcessRunResult, "terminalStopReason">): void;
10
+ export interface ChatProviderCommandPlan {
11
+ readonly command: ProviderCliCommand;
12
+ readonly stdin?: string;
13
+ /**
14
+ * Provider environment: the host's .NET build lock (host-build-lock.ts), Codex's own home, and
15
+ * the headless background-work restrictions for Claude.
16
+ */
17
+ readonly env?: Readonly<Record<string, string>>;
18
+ }
19
+ export declare function buildChatProviderCommand(packet: ChatTurnDispatchPacket, cwd: string): ChatProviderCommandPlan;
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Builds the provider command for a Bridge Chat turn: the CLI invocation for the turn's provider
3
+ * and the prompt that carries the conversation, its context references and its bounded handoff
4
+ * metadata.
5
+ */
6
+ import { claudeHeadlessEnvironment, providerTurnEndedWithBackgroundWorkFailure } from "../session/provider-cli/claude-background-work.js";
7
+ import { hostDotnetBuildLockEnvironment, hostDotnetBuildLockInstruction } from "../session/provider-cli/host-build-lock.js";
8
+ import { claudeIsolatedLaunchArgs, providerUserConfigIsolationUnsupported, providerUserConfigIsolationEnv } from "../session/provider-cli/provider-user-config-isolation.js";
9
+ import { codexSandboxModeForPlatform, providerEffort } from "../session/provider-cli/provider-cli.prompts.js";
10
+ import { chatProviderKind } from "./bridge-chat.types.js";
11
+ /** The turn-scoped handoff metadata file the bridge writes into the chat workspace. */
12
+ export const chatTurnMetadataFileName = "forge-chat-metadata.json";
13
+ /**
14
+ * Fails a Bridge Chat turn Forge stopped because it ended with background work still live: the
15
+ * turn never delivered its answer, so it must not be reported as one.
16
+ */
17
+ export function assertChatTurnFinished(result) {
18
+ if (result.terminalStopReason === "turn_ended_with_background_work") {
19
+ throw providerTurnEndedWithBackgroundWorkFailure("The Bridge Chat turn did not finish.");
20
+ }
21
+ }
22
+ export function buildChatProviderCommand(packet, cwd) {
23
+ // The provider kind picks the CLI and its effort levels; an auth-path suffix such as `:bridge` does not.
24
+ const provider = chatProviderKind(packet.providerKind);
25
+ const model = packet.model.trim();
26
+ const prompt = buildChatPrompt(packet);
27
+ const resumeThreadId = packet.providerThreadId?.trim() || null;
28
+ // Levels the provider does not accept are dropped, so the CLI keeps its own default.
29
+ const effort = providerEffort(provider, packet.effort);
30
+ if (provider === "codex") {
31
+ const args = ["-s", codexSandboxModeForPlatform(process.platform, "host"), "-a", "never", "exec"];
32
+ if (resumeThreadId) {
33
+ args.push("--cd", cwd, "resume");
34
+ }
35
+ args.push("--model", model);
36
+ if (effort) {
37
+ args.push("-c", `model_reasoning_effort=${JSON.stringify(effort)}`);
38
+ }
39
+ args.push("--json");
40
+ if (!resumeThreadId) {
41
+ args.push("--cd", cwd);
42
+ }
43
+ args.push("--skip-git-repo-check");
44
+ if (resumeThreadId) {
45
+ args.push(resumeThreadId);
46
+ }
47
+ args.push("-");
48
+ // Codex runs with Forge's own CODEX_HOME, not the user's ~/.codex (provider-user-config-isolation.ts).
49
+ return { command: { command: "codex", args }, stdin: prompt, env: { ...hostDotnetBuildLockEnvironment(), ...providerUserConfigIsolationEnv("codex") } };
50
+ }
51
+ if (provider === "claude") {
52
+ const args = ["-p", "--output-format", "stream-json", "--verbose", "--model", model];
53
+ if (effort) {
54
+ args.push("--effort", effort);
55
+ }
56
+ // Only Forge's context and no MCP servers (provider-user-config-isolation.ts).
57
+ args.push("--permission-mode", "bypassPermissions", ...claudeIsolatedLaunchArgs({ workingDirectory: cwd, forgeMcpConfigPath: null, headless: true }));
58
+ if (resumeThreadId) {
59
+ args.push("--resume", resumeThreadId);
60
+ }
61
+ return { command: { command: "claude", args }, stdin: prompt, env: { ...hostDotnetBuildLockEnvironment(), ...claudeHeadlessEnvironment } };
62
+ }
63
+ // cursor-agent and other CLIs can't be kept from the host user's own configuration.
64
+ throw providerUserConfigIsolationUnsupported(packet.providerKind);
65
+ }
66
+ function buildChatPrompt(packet) {
67
+ const messages = packet.messages
68
+ .map((message, index) => {
69
+ const role = message.role.trim() || `message-${index + 1}`;
70
+ return `[${role}]\n${message.content}`;
71
+ })
72
+ .join("\n\n");
73
+ const contextRefs = packet.contextRefs.length === 0
74
+ ? ""
75
+ : `\n\n# Context References\n\n${packet.contextRefs.map((ref, index) => {
76
+ const title = ref.title?.trim() ? `\nTitle: ${ref.title.trim()}` : "";
77
+ const summary = ref.summary?.trim() ? `\nSummary: ${ref.summary.trim()}` : "";
78
+ return `${index + 1}. ${ref.kind}:${ref.refId}${title}${summary}`;
79
+ }).join("\n\n")}`;
80
+ const continuation = packet.providerThreadId
81
+ ? "\n\nContinue the existing provider thread identified by the bridge; do not restart the conversation context."
82
+ : "";
83
+ const boundedMetadata = buildChatBoundedMetadataPrompt(packet);
84
+ // Chat turns run on the bridge's host, so they follow its .NET build lock like session turns.
85
+ const buildLock = hostDotnetBuildLockInstruction(process.env, "chat");
86
+ const hostRules = buildLock ? `\n\n# Host rules\n${buildLock}` : "";
87
+ return `You are handling a Forge Bridge Chat turn.
88
+
89
+ Conversation ID: ${packet.conversationId}
90
+ Turn ID: ${packet.turnId}
91
+ Provider: ${packet.providerKind}
92
+ Model: ${packet.model}${continuation}${boundedMetadata}${hostRules}
93
+
94
+ # Conversation
95
+
96
+ ${messages}${contextRefs}
97
+ `;
98
+ }
99
+ function buildChatBoundedMetadataPrompt(packet) {
100
+ if (packet.attachmentHandoffs.length === 0 && packet.actionBrokerGrants.length === 0) {
101
+ return "";
102
+ }
103
+ const sections = [
104
+ `\n\n# Bounded Handoff Metadata\n\nMetadata file: ${chatTurnMetadataFileName}\n\nThe metadata file is turn-scoped and cleaned up by the bridge when the turn ends. It contains opaque handles only; attachment content, raw paths, and grant nonces are not included.`,
105
+ ];
106
+ if (packet.attachmentHandoffs.length > 0) {
107
+ sections.push(`Attachment handoffs:\n${packet.attachmentHandoffs.map((handoff, index) => [
108
+ `${index + 1}. turnId: ${handoff.turnId}`,
109
+ ` attachmentId: ${handoff.attachmentId}`,
110
+ ` tempFileToken: ${handoff.tempFileToken}`,
111
+ ` mimeType: ${handoff.mimeType}`,
112
+ ` sizeBytes: ${handoff.sizeBytes}`,
113
+ ` sha256: ${handoff.sha256}`,
114
+ ` fileNameDisplay: ${handoff.fileNameDisplay}`,
115
+ ` expiresAt: ${handoff.expiresAt}`,
116
+ ` status: ${handoff.status}`,
117
+ ].join("\n")).join("\n\n")}`);
118
+ }
119
+ if (packet.actionBrokerGrants.length > 0) {
120
+ sections.push(`Action-broker grants:\n${packet.actionBrokerGrants.map((grant, index) => [
121
+ `${index + 1}. grantId: ${grant.grantId}`,
122
+ ` turnId: ${grant.turnId}`,
123
+ ` leaseId: ${grant.leaseId}`,
124
+ ` fencingToken: ${grant.fencingToken}`,
125
+ ` allowedScopes: ${grant.allowedScopes.join(", ")}`,
126
+ ` expiresAt: ${grant.expiresAt}`,
127
+ ` redactionStatus: ${grant.redactionStatus}`,
128
+ " nonce: held by bridge",
129
+ ].join("\n")).join("\n\n")}`);
130
+ }
131
+ return sections.join("\n\n");
132
+ }
@@ -0,0 +1,121 @@
1
+ export declare const bridgeChatProtocolVersion = "chat_interactive_v1";
2
+ export declare const bridgeChatUpdateRequiredCode = "update_required";
3
+ export declare const bridgeChatMaxCallbackPayloadBytes: number;
4
+ export declare const bridgeChatMaxProviderThreadIdChars = 256;
5
+ export type BridgeChatAvailability = "available" | "degraded" | "unavailable";
6
+ export type BridgeChatRequestedCapability = "text" | "cancel" | "resume" | "thread_continuity" | "attachment_handoffs" | "action_broker_grants";
7
+ export type ChatTurnCallbackKind = "turn_started" | "output_delta" | "output_completed" | "failed" | "cancelled" | "expired";
8
+ export type ChatTurnCallbackRedactionStatus = "redacted" | "not_applicable";
9
+ export interface BridgeChatCapability {
10
+ readonly availability: BridgeChatAvailability;
11
+ readonly protocolVersion: string;
12
+ readonly supportedProviders: readonly string[];
13
+ readonly supportedModels: readonly string[];
14
+ readonly supportsTextStreaming: boolean;
15
+ readonly supportsCancel: boolean;
16
+ readonly supportsResume: boolean;
17
+ readonly supportsProviderThreadContinuity: boolean;
18
+ readonly supportsAttachments: boolean;
19
+ readonly supportsActionBrokerGrants: boolean;
20
+ readonly maxMessageBytes: number;
21
+ readonly maxContextRefs: number;
22
+ readonly unavailableCode?: string | null;
23
+ readonly unavailableReason?: string | null;
24
+ }
25
+ export interface ChatTurnDispatchPacket {
26
+ readonly chatRunId: string;
27
+ readonly conversationId: string;
28
+ readonly turnId: string;
29
+ readonly leaseId: string;
30
+ readonly fencingToken: string;
31
+ readonly runnerInstanceId: string;
32
+ readonly providerKind: string;
33
+ readonly model: string;
34
+ readonly messages: readonly ChatTurnMessage[];
35
+ readonly contextRefs: readonly ChatTurnContextRef[];
36
+ readonly idempotencyKey: string;
37
+ readonly providerThreadId?: string | null;
38
+ /**
39
+ * The Chat role's reasoning effort for this provider and model, or null for the provider default.
40
+ * Older servers omit it. The command builder drops levels the provider does not accept.
41
+ */
42
+ readonly effort?: string | null;
43
+ readonly protocolVersion: typeof bridgeChatProtocolVersion;
44
+ readonly requestedCapabilities: readonly BridgeChatRequestedCapability[];
45
+ readonly attachmentHandoffs: readonly ChatAttachmentHandoffHandle[];
46
+ readonly actionBrokerGrants: readonly ChatActionBrokerGrant[];
47
+ }
48
+ export interface ChatTurnMessage {
49
+ readonly role: string;
50
+ readonly content: string;
51
+ readonly metadata?: Readonly<Record<string, unknown>> | null;
52
+ }
53
+ export interface ChatTurnContextRef {
54
+ readonly kind: string;
55
+ readonly refId: string;
56
+ readonly title?: string | null;
57
+ readonly summary?: string | null;
58
+ readonly metadata?: Readonly<Record<string, unknown>> | null;
59
+ }
60
+ export interface ChatAttachmentHandoffHandle {
61
+ readonly turnId: string;
62
+ readonly attachmentId: string;
63
+ readonly tempFileToken: string;
64
+ readonly mimeType: string;
65
+ readonly sizeBytes: number;
66
+ readonly sha256: string;
67
+ readonly fileNameDisplay: string;
68
+ readonly expiresAt: string;
69
+ readonly status: "available";
70
+ }
71
+ export interface ChatActionBrokerGrant {
72
+ readonly grantId: string;
73
+ readonly turnId: string;
74
+ readonly leaseId: string;
75
+ readonly fencingToken: string;
76
+ readonly allowedScopes: readonly string[];
77
+ readonly nonce: string;
78
+ readonly expiresAt: string;
79
+ readonly redactionStatus: ChatTurnCallbackRedactionStatus;
80
+ }
81
+ export interface ChatTurnCallbackEnvelope {
82
+ readonly callbackId: string;
83
+ readonly chatRunId: string;
84
+ readonly conversationId: string;
85
+ readonly turnId: string;
86
+ readonly leaseId: string;
87
+ readonly fencingToken: string;
88
+ readonly runnerId: string;
89
+ readonly runnerInstanceId: string;
90
+ readonly sequence: number;
91
+ readonly eventType: ChatTurnCallbackKind;
92
+ readonly redactionStatus: ChatTurnCallbackRedactionStatus;
93
+ readonly providerThreadId?: string | null;
94
+ readonly payload?: Readonly<Record<string, unknown>> | null;
95
+ readonly occurredAt?: string | null;
96
+ readonly protocolVersion: typeof bridgeChatProtocolVersion;
97
+ }
98
+ export interface ChatTurnCancelPacket {
99
+ readonly chatRunId?: string | null;
100
+ readonly conversationId?: string | null;
101
+ readonly turnId?: string | null;
102
+ readonly leaseId: string;
103
+ readonly fencingToken: string;
104
+ readonly runnerId?: string | null;
105
+ readonly runnerInstanceId?: string | null;
106
+ readonly providerThreadId?: string | null;
107
+ readonly reason?: string | null;
108
+ readonly payload?: Readonly<Record<string, unknown>> | null;
109
+ readonly requestedAt?: string | null;
110
+ readonly protocolVersion?: string | null;
111
+ }
112
+ export declare function unavailableBridgeChatCapability(protocolVersion?: string, unavailableCode?: string | null, unavailableReason?: string | null): BridgeChatCapability;
113
+ export declare function normalizeBridgeChatCapability(value: BridgeChatCapability | null | undefined): BridgeChatCapability;
114
+ export declare function parseChatTurnDispatchPacket(value: unknown, capability?: BridgeChatCapability): ChatTurnDispatchPacket;
115
+ /**
116
+ * The provider kind of a saved provider selection: `codex:bridge` and `codex` are both `codex`.
117
+ * Forge stores the Chat role's provider with its auth-path suffix and may send it as is.
118
+ */
119
+ export declare function chatProviderKind(provider: string): string;
120
+ export declare function isTerminalChatTurnCallbackKind(kind: ChatTurnCallbackKind): boolean;
121
+ export declare function assertBridgeChatCallbackPayload(value: unknown, label?: string): void;