@interf/compiler 0.22.2 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (616) hide show
  1. package/README.md +119 -282
  2. package/dist/bin-mcp.d.ts +2 -0
  3. package/dist/bin-mcp.js +63 -0
  4. package/dist/bin-runtime.d.ts +2 -0
  5. package/dist/bin-runtime.js +111 -0
  6. package/dist/cli/commands/agents.js +4 -35
  7. package/dist/cli/commands/auth.d.ts +20 -0
  8. package/dist/cli/commands/auth.js +161 -0
  9. package/dist/cli/commands/benchmark.d.ts +9 -0
  10. package/dist/cli/commands/benchmark.js +58 -0
  11. package/dist/cli/commands/build-plan.js +107 -139
  12. package/dist/cli/commands/build.d.ts +3 -4
  13. package/dist/cli/commands/build.js +16 -45
  14. package/dist/cli/commands/doctor.js +3 -3
  15. package/dist/cli/commands/graphs.d.ts +2 -0
  16. package/dist/cli/commands/graphs.js +344 -0
  17. package/dist/cli/commands/login.js +4 -6
  18. package/dist/cli/commands/logout.js +1 -1
  19. package/dist/cli/commands/mcp.d.ts +4 -2
  20. package/dist/cli/commands/mcp.js +846 -232
  21. package/dist/cli/commands/project.d.ts +2 -0
  22. package/dist/cli/commands/project.js +176 -0
  23. package/dist/cli/commands/reset.d.ts +3 -4
  24. package/dist/cli/commands/reset.js +10 -31
  25. package/dist/cli/commands/runs.js +136 -57
  26. package/dist/cli/commands/runtime.d.ts +24 -0
  27. package/dist/cli/commands/runtime.js +373 -0
  28. package/dist/cli/commands/status.d.ts +1 -0
  29. package/dist/cli/commands/status.js +35 -45
  30. package/dist/cli/commands/traces.d.ts +2 -0
  31. package/dist/cli/commands/traces.js +97 -0
  32. package/dist/cli/commands/wizard.js +171 -178
  33. package/dist/cli/index.d.ts +7 -4
  34. package/dist/cli/index.js +13 -7
  35. package/dist/cli/lib/http-client.d.ts +39 -0
  36. package/dist/cli/lib/http-client.js +73 -0
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.js +2 -2
  39. package/dist/packages/build-plans/authoring/brief.d.ts +538 -0
  40. package/dist/packages/build-plans/authoring/brief.js +89 -0
  41. package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +52 -11
  42. package/dist/packages/build-plans/authoring/build-plan-authoring.js +493 -46
  43. package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +10 -1
  44. package/dist/packages/build-plans/authoring/build-plan-edit-session.js +27 -4
  45. package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +9 -6
  46. package/dist/packages/build-plans/authoring/build-plan-improvement.js +97 -46
  47. package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.d.ts +1 -0
  48. package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.js +7 -7
  49. package/dist/packages/build-plans/build-plan-resolution.d.ts +1 -1
  50. package/dist/packages/build-plans/build-plan-resolution.js +3 -3
  51. package/dist/packages/build-plans/index.d.ts +1 -1
  52. package/dist/packages/build-plans/index.js +1 -1
  53. package/dist/packages/build-plans/package/build-plan-definitions.d.ts +14 -13
  54. package/dist/packages/build-plans/package/build-plan-definitions.js +45 -42
  55. package/dist/packages/build-plans/package/build-plan-helpers.d.ts +3 -2
  56. package/dist/packages/build-plans/package/build-plan-helpers.js +27 -13
  57. package/dist/packages/build-plans/package/build-plan-review-paths.d.ts +5 -5
  58. package/dist/packages/build-plans/package/build-plan-review-paths.js +15 -15
  59. package/dist/packages/build-plans/package/build-plan-stage-runner.d.ts +5 -4
  60. package/dist/packages/build-plans/package/build-plan-stage-runner.js +23 -11
  61. package/dist/packages/build-plans/package/builtin-build-plan.d.ts +7 -8
  62. package/dist/packages/build-plans/package/builtin-build-plan.js +10 -11
  63. package/dist/packages/build-plans/package/context-interface.d.ts +14 -9
  64. package/dist/packages/build-plans/package/context-interface.js +14 -33
  65. package/dist/packages/build-plans/package/interf-build-plan-package.d.ts +6 -17
  66. package/dist/packages/build-plans/package/interf-build-plan-package.js +68 -64
  67. package/dist/packages/build-plans/package/local-build-plans.d.ts +21 -14
  68. package/dist/packages/build-plans/package/local-build-plans.js +105 -55
  69. package/dist/packages/build-plans/package/user-build-plans.js +1 -1
  70. package/dist/packages/contracts/index.d.ts +5 -2
  71. package/dist/packages/contracts/index.js +3 -1
  72. package/dist/packages/contracts/lib/context-graph-layer.d.ts +161 -0
  73. package/dist/packages/contracts/lib/context-graph-layer.js +216 -0
  74. package/dist/packages/contracts/lib/project-paths.d.ts +144 -0
  75. package/dist/packages/contracts/lib/project-paths.js +220 -0
  76. package/dist/packages/contracts/lib/project-schema.d.ts +423 -0
  77. package/dist/packages/contracts/lib/project-schema.js +138 -0
  78. package/dist/packages/contracts/lib/schema.d.ts +1273 -81
  79. package/dist/packages/contracts/lib/schema.js +675 -79
  80. package/dist/packages/contracts/utils/filesystem.d.ts +1 -0
  81. package/dist/packages/contracts/utils/filesystem.js +29 -1
  82. package/dist/packages/contracts/utils/parse.js +67 -0
  83. package/dist/packages/projects/index.d.ts +6 -0
  84. package/dist/packages/{project → projects}/index.js +0 -3
  85. package/dist/packages/{project → projects}/interf-detect.d.ts +12 -12
  86. package/dist/packages/{project → projects}/interf-detect.js +56 -50
  87. package/dist/packages/projects/interf.d.ts +2 -0
  88. package/dist/packages/projects/interf.js +1 -0
  89. package/dist/packages/projects/lib/schema.d.ts +77 -0
  90. package/dist/packages/projects/lib/schema.js +91 -0
  91. package/dist/packages/projects/source-config.d.ts +53 -0
  92. package/dist/packages/projects/source-config.js +339 -0
  93. package/dist/packages/projects/source-folders.d.ts +11 -0
  94. package/dist/packages/{project → projects}/source-folders.js +26 -26
  95. package/dist/packages/{engine → runtime}/action-planner.d.ts +1 -1
  96. package/dist/packages/{engine → runtime}/action-planner.js +20 -22
  97. package/dist/packages/runtime/action-values.d.ts +1 -0
  98. package/dist/packages/runtime/action-values.js +1 -0
  99. package/dist/packages/runtime/actions/errors.d.ts +2 -0
  100. package/dist/packages/runtime/actions/errors.js +12 -0
  101. package/dist/packages/runtime/actions/fields.d.ts +86 -0
  102. package/dist/packages/runtime/actions/form-builders.d.ts +14 -0
  103. package/dist/packages/runtime/actions/form-builders.js +667 -0
  104. package/dist/packages/runtime/actions/form-validators.d.ts +8 -0
  105. package/dist/packages/runtime/actions/form-validators.js +134 -0
  106. package/dist/packages/runtime/actions/helpers.d.ts +11 -0
  107. package/dist/packages/runtime/actions/helpers.js +80 -0
  108. package/dist/packages/runtime/actions/index.d.ts +8 -0
  109. package/dist/packages/runtime/actions/index.js +11 -0
  110. package/dist/packages/runtime/actions/registry.d.ts +64 -0
  111. package/dist/packages/runtime/actions/registry.js +62 -0
  112. package/dist/packages/runtime/actions/requests.d.ts +45 -0
  113. package/dist/packages/runtime/actions/requests.js +164 -0
  114. package/dist/packages/runtime/actions/schemas.d.ts +161 -0
  115. package/dist/packages/runtime/actions/schemas.js +37 -0
  116. package/dist/packages/runtime/agent-handoff.d.ts +11 -0
  117. package/dist/packages/runtime/agent-handoff.js +102 -0
  118. package/dist/packages/{engine → runtime}/agents/index.d.ts +1 -2
  119. package/dist/packages/{engine → runtime}/agents/index.js +1 -2
  120. package/dist/packages/runtime/agents/lib/args.d.ts +14 -0
  121. package/dist/packages/runtime/agents/lib/args.js +24 -0
  122. package/dist/packages/{engine → runtime}/agents/lib/constants.d.ts +4 -1
  123. package/dist/packages/runtime/agents/lib/constants.js +13 -0
  124. package/dist/packages/runtime/agents/lib/context-graph-bootstrap.d.ts +3 -0
  125. package/dist/packages/{engine/agents/lib/verifiable-context-bootstrap.js → runtime/agents/lib/context-graph-bootstrap.js} +5 -6
  126. package/dist/packages/{engine → runtime}/agents/lib/detection.d.ts +5 -0
  127. package/dist/packages/{engine → runtime}/agents/lib/detection.js +16 -7
  128. package/dist/packages/{engine → runtime}/agents/lib/execution-profile.d.ts +14 -0
  129. package/dist/packages/{engine → runtime}/agents/lib/execution-profile.js +31 -14
  130. package/dist/packages/{engine → runtime}/agents/lib/execution.js +22 -6
  131. package/dist/packages/{engine → runtime}/agents/lib/executors.d.ts +1 -0
  132. package/dist/packages/{engine → runtime}/agents/lib/executors.js +11 -2
  133. package/dist/packages/runtime/agents/lib/logs.d.ts +12 -0
  134. package/dist/packages/runtime/agents/lib/logs.js +41 -0
  135. package/dist/packages/{engine → runtime}/agents/lib/preflight.js +19 -14
  136. package/dist/packages/runtime/agents/lib/render.d.ts +26 -0
  137. package/dist/packages/{engine → runtime}/agents/lib/render.js +48 -22
  138. package/dist/packages/runtime/agents/lib/shell-fs.d.ts +18 -0
  139. package/dist/packages/runtime/agents/lib/shell-fs.js +190 -0
  140. package/dist/packages/runtime/agents/lib/shell-paths.d.ts +16 -0
  141. package/dist/packages/runtime/agents/lib/shell-paths.js +63 -0
  142. package/dist/packages/runtime/agents/lib/shell-projection.d.ts +25 -0
  143. package/dist/packages/runtime/agents/lib/shell-projection.js +314 -0
  144. package/dist/packages/runtime/agents/lib/shell-templates.d.ts +30 -0
  145. package/dist/packages/runtime/agents/lib/shell-templates.js +494 -0
  146. package/dist/packages/runtime/agents/lib/shell-workspace.d.ts +17 -0
  147. package/dist/packages/runtime/agents/lib/shell-workspace.js +70 -0
  148. package/dist/packages/runtime/agents/lib/shells.d.ts +92 -0
  149. package/dist/packages/runtime/agents/lib/shells.js +509 -0
  150. package/dist/packages/runtime/agents/lib/source-context-scan.d.ts +10 -0
  151. package/dist/packages/runtime/agents/lib/source-context-scan.js +388 -0
  152. package/dist/packages/{engine → runtime}/agents/lib/status.js +1 -14
  153. package/dist/packages/runtime/agents/lib/string-utils.d.ts +16 -0
  154. package/dist/packages/runtime/agents/lib/string-utils.js +36 -0
  155. package/dist/packages/{engine → runtime}/agents/lib/types.d.ts +1 -0
  156. package/dist/packages/{engine → runtime}/agents/lib/user-config.d.ts +8 -2
  157. package/dist/packages/{engine → runtime}/agents/lib/user-config.js +8 -2
  158. package/dist/packages/runtime/agents/providers/claude-code.d.ts +13 -0
  159. package/dist/packages/runtime/agents/providers/claude-code.js +45 -0
  160. package/dist/packages/runtime/agents/providers/codex.d.ts +17 -0
  161. package/dist/packages/runtime/agents/providers/codex.js +66 -0
  162. package/dist/packages/runtime/agents/providers/cursor.d.ts +9 -0
  163. package/dist/packages/runtime/agents/providers/cursor.js +24 -0
  164. package/dist/packages/runtime/agents/providers/index.d.ts +9 -0
  165. package/dist/packages/runtime/agents/providers/index.js +31 -0
  166. package/dist/packages/runtime/agents/providers/types.d.ts +50 -0
  167. package/dist/packages/{engine → runtime}/agents/registry.d.ts +13 -2
  168. package/dist/packages/{engine → runtime}/agents/registry.js +48 -10
  169. package/dist/packages/{engine → runtime}/agents/role-executors.d.ts +1 -1
  170. package/dist/packages/{engine → runtime}/agents/role-executors.js +9 -7
  171. package/dist/packages/{engine → runtime}/agents/role-router.js +7 -5
  172. package/dist/packages/runtime/auth/account-context.d.ts +52 -0
  173. package/dist/packages/runtime/auth/account-context.js +68 -0
  174. package/dist/packages/runtime/auth/auth-flow.d.ts +73 -0
  175. package/dist/packages/runtime/auth/auth-flow.js +189 -0
  176. package/dist/packages/runtime/auth/jwt-validator.d.ts +58 -0
  177. package/dist/packages/runtime/auth/jwt-validator.js +86 -0
  178. package/dist/packages/runtime/auth/keychain.d.ts +35 -0
  179. package/dist/packages/runtime/auth/keychain.js +85 -0
  180. package/dist/packages/runtime/auth/session-store.d.ts +38 -0
  181. package/dist/packages/runtime/auth/session-store.js +96 -0
  182. package/dist/packages/runtime/auth/workos-client.d.ts +58 -0
  183. package/dist/packages/runtime/auth/workos-client.js +87 -0
  184. package/dist/packages/runtime/benchmark-question-draft.d.ts +23 -0
  185. package/dist/packages/runtime/benchmark-question-draft.js +153 -0
  186. package/dist/packages/runtime/build/artifact-counts.d.ts +1 -0
  187. package/dist/packages/{engine → runtime}/build/artifact-counts.js +5 -9
  188. package/dist/packages/{engine → runtime}/build/artifact-status.d.ts +6 -6
  189. package/dist/packages/{engine → runtime}/build/artifact-status.js +26 -24
  190. package/dist/packages/runtime/build/atomic-fs.d.ts +3 -0
  191. package/dist/packages/runtime/build/atomic-fs.js +95 -0
  192. package/dist/packages/runtime/build/billing-events.d.ts +78 -0
  193. package/dist/packages/{engine → runtime}/build/billing-events.js +17 -19
  194. package/dist/packages/runtime/build/build-evidence.d.ts +16 -0
  195. package/dist/packages/runtime/build/build-evidence.js +179 -0
  196. package/dist/packages/{engine → runtime}/build/build-pipeline.d.ts +12 -8
  197. package/dist/packages/runtime/build/build-pipeline.js +388 -0
  198. package/dist/packages/{engine → runtime}/build/build-plan-primitives.d.ts +1 -1
  199. package/dist/packages/{engine → runtime}/build/build-plan-primitives.js +0 -1
  200. package/dist/packages/runtime/build/build-plan-runs.d.ts +14 -0
  201. package/dist/packages/runtime/build/build-plan-runs.js +31 -0
  202. package/dist/packages/runtime/build/build-stage-plan.d.ts +16 -0
  203. package/dist/packages/runtime/build/build-stage-plan.js +101 -0
  204. package/dist/packages/{engine → runtime}/build/build-stage-runner.d.ts +2 -1
  205. package/dist/packages/runtime/build/build-stage-runner.js +302 -0
  206. package/dist/packages/{engine → runtime}/build/build-target.d.ts +7 -4
  207. package/dist/packages/runtime/build/build-target.js +40 -0
  208. package/dist/packages/{engine → runtime}/build/check-evaluator.d.ts +14 -16
  209. package/dist/packages/runtime/build/check-evaluator.js +1226 -0
  210. package/dist/packages/runtime/build/context-graph-paths.d.ts +64 -0
  211. package/dist/packages/runtime/build/context-graph-paths.js +160 -0
  212. package/dist/packages/runtime/build/context-graph-schema.d.ts +19 -0
  213. package/dist/packages/runtime/build/context-graph-schema.js +39 -0
  214. package/dist/packages/{engine → runtime}/build/discovery.d.ts +2 -2
  215. package/dist/packages/{engine → runtime}/build/discovery.js +4 -4
  216. package/dist/packages/{engine → runtime}/build/index.d.ts +7 -5
  217. package/dist/packages/{engine → runtime}/build/index.js +7 -5
  218. package/dist/packages/runtime/build/inspect-map.d.ts +10 -0
  219. package/dist/packages/runtime/build/inspect-map.js +270 -0
  220. package/dist/packages/{engine → runtime}/build/lib/schema.d.ts +449 -123
  221. package/dist/packages/runtime/build/lib/schema.js +494 -0
  222. package/dist/packages/runtime/build/native-entrypoint.d.ts +2 -0
  223. package/dist/packages/runtime/build/native-entrypoint.js +286 -0
  224. package/dist/packages/runtime/build/reset.d.ts +2 -0
  225. package/dist/packages/runtime/build/reset.js +62 -0
  226. package/dist/packages/{engine → runtime}/build/runtime-contracts.js +13 -7
  227. package/dist/packages/runtime/build/runtime-inventory.d.ts +7 -0
  228. package/dist/packages/{engine → runtime}/build/runtime-inventory.js +3 -3
  229. package/dist/packages/runtime/build/runtime-log-paths.d.ts +3 -0
  230. package/dist/packages/runtime/build/runtime-log-paths.js +16 -0
  231. package/dist/packages/{engine → runtime}/build/runtime-prompt.js +12 -9
  232. package/dist/packages/{engine → runtime}/build/runtime-reconcile.d.ts +1 -1
  233. package/dist/packages/{engine → runtime}/build/runtime-reconcile.js +25 -21
  234. package/dist/packages/runtime/build/runtime-runs.d.ts +10 -0
  235. package/dist/packages/runtime/build/runtime-runs.js +318 -0
  236. package/dist/packages/{engine → runtime}/build/runtime-types.d.ts +9 -6
  237. package/dist/packages/runtime/build/runtime-types.js +1 -0
  238. package/dist/packages/runtime/build/runtime.d.ts +8 -0
  239. package/dist/packages/runtime/build/runtime.js +7 -0
  240. package/dist/packages/runtime/build/source-files.d.ts +58 -0
  241. package/dist/packages/runtime/build/source-files.js +193 -0
  242. package/dist/packages/runtime/build/source-inventory.d.ts +28 -0
  243. package/dist/packages/runtime/build/source-inventory.js +512 -0
  244. package/dist/packages/runtime/build/source-manifest.d.ts +63 -0
  245. package/dist/packages/runtime/build/source-manifest.js +220 -0
  246. package/dist/packages/runtime/build/stage-evidence.d.ts +22 -0
  247. package/dist/packages/runtime/build/stage-evidence.js +386 -0
  248. package/dist/packages/runtime/build/stage-manifest.d.ts +45 -0
  249. package/dist/packages/runtime/build/stage-manifest.js +1125 -0
  250. package/dist/packages/runtime/build/stage-reuse.d.ts +11 -0
  251. package/dist/packages/runtime/build/stage-reuse.js +154 -0
  252. package/dist/packages/runtime/build/stage-session.d.ts +81 -0
  253. package/dist/packages/runtime/build/stage-session.js +308 -0
  254. package/dist/packages/runtime/build/state-artifacts.d.ts +9 -0
  255. package/dist/packages/runtime/build/state-artifacts.js +14 -0
  256. package/dist/packages/runtime/build/state-health.d.ts +4 -0
  257. package/dist/packages/{engine → runtime}/build/state-health.js +21 -26
  258. package/dist/packages/runtime/build/state-io.d.ts +12 -0
  259. package/dist/packages/runtime/build/state-io.js +118 -0
  260. package/dist/packages/runtime/build/state-view.d.ts +5 -0
  261. package/dist/packages/runtime/build/state-view.js +121 -0
  262. package/dist/packages/runtime/build/state.d.ts +7 -0
  263. package/dist/packages/runtime/build/state.js +12 -0
  264. package/dist/packages/runtime/build/summary-coverage-index.d.ts +21 -0
  265. package/dist/packages/runtime/build/summary-coverage-index.js +189 -0
  266. package/dist/packages/runtime/build/traces.d.ts +30 -0
  267. package/dist/packages/runtime/build/traces.js +133 -0
  268. package/dist/packages/{engine/build/validate-verifiable-context.d.ts → runtime/build/validate-context-graph.d.ts} +6 -6
  269. package/dist/packages/{engine/build/validate-verifiable-context.js → runtime/build/validate-context-graph.js} +49 -36
  270. package/dist/packages/{engine → runtime}/build/validate.d.ts +5 -5
  271. package/dist/packages/{engine → runtime}/build/validate.js +26 -26
  272. package/dist/packages/{engine → runtime}/client.d.ts +18 -18
  273. package/dist/packages/{engine → runtime}/client.js +48 -36
  274. package/dist/packages/{engine → runtime}/connection-config.d.ts +3 -2
  275. package/dist/packages/{engine → runtime}/connection-config.js +9 -8
  276. package/dist/packages/runtime/context-checks.d.ts +10 -0
  277. package/dist/packages/runtime/context-checks.js +127 -0
  278. package/dist/packages/runtime/context-graph-scaffold.d.ts +9 -0
  279. package/dist/packages/runtime/context-graph-scaffold.js +135 -0
  280. package/dist/packages/runtime/context-graph-semantic-graph.d.ts +9 -0
  281. package/dist/packages/runtime/context-graph-semantic-graph.js +416 -0
  282. package/dist/packages/runtime/entitlement-guard.d.ts +43 -0
  283. package/dist/packages/runtime/entitlement-guard.js +70 -0
  284. package/dist/packages/{engine → runtime}/execution/index.d.ts +2 -2
  285. package/dist/packages/{engine → runtime}/execution/index.js +1 -1
  286. package/dist/packages/{engine → runtime}/execution/lib/schema.d.ts +272 -191
  287. package/dist/packages/{engine → runtime}/execution/lib/schema.js +35 -32
  288. package/dist/packages/runtime/index.d.ts +29 -0
  289. package/dist/packages/runtime/index.js +21 -0
  290. package/dist/packages/runtime/instance-paths.d.ts +30 -0
  291. package/dist/packages/runtime/instance-paths.js +29 -0
  292. package/dist/packages/runtime/native-run-handlers.d.ts +63 -0
  293. package/dist/packages/{engine → runtime}/native-run-handlers.js +217 -166
  294. package/dist/packages/runtime/plan-artifact-contract.d.ts +17 -0
  295. package/dist/packages/runtime/plan-artifact-contract.js +42 -0
  296. package/dist/packages/runtime/project-entries.d.ts +11 -0
  297. package/dist/packages/runtime/project-entries.js +49 -0
  298. package/dist/packages/runtime/project-source-state.d.ts +26 -0
  299. package/dist/packages/runtime/project-source-state.js +56 -0
  300. package/dist/packages/runtime/project-store.d.ts +90 -0
  301. package/dist/packages/runtime/project-store.js +195 -0
  302. package/dist/packages/runtime/requested-artifacts.d.ts +7 -0
  303. package/dist/packages/{engine → runtime}/requested-artifacts.js +23 -1
  304. package/dist/packages/{engine → runtime}/run-observability.d.ts +2 -1
  305. package/dist/packages/{engine → runtime}/run-observability.js +174 -87
  306. package/dist/packages/runtime/runtime-action-proposals.d.ts +7 -0
  307. package/dist/packages/runtime/runtime-action-proposals.js +542 -0
  308. package/dist/packages/runtime/runtime-build-plans.d.ts +5 -0
  309. package/dist/packages/runtime/runtime-build-plans.js +175 -0
  310. package/dist/packages/runtime/runtime-build-runs.d.ts +47 -0
  311. package/dist/packages/runtime/runtime-build-runs.js +555 -0
  312. package/dist/packages/runtime/runtime-caches.d.ts +117 -0
  313. package/dist/packages/runtime/runtime-caches.js +266 -0
  314. package/dist/packages/{engine → runtime}/runtime-event-applier.d.ts +3 -1
  315. package/dist/packages/{engine → runtime}/runtime-event-applier.js +53 -17
  316. package/dist/packages/runtime/runtime-executor.d.ts +22 -0
  317. package/dist/packages/runtime/runtime-executor.js +131 -0
  318. package/dist/packages/runtime/runtime-jobs.d.ts +13 -0
  319. package/dist/packages/runtime/runtime-jobs.js +463 -0
  320. package/dist/packages/runtime/runtime-observability.d.ts +11 -0
  321. package/dist/packages/runtime/runtime-observability.js +39 -0
  322. package/dist/packages/{engine → runtime}/runtime-persistence.d.ts +9 -18
  323. package/dist/packages/{engine → runtime}/runtime-persistence.js +25 -25
  324. package/dist/packages/runtime/runtime-project-mutations.d.ts +7 -0
  325. package/dist/packages/runtime/runtime-project-mutations.js +65 -0
  326. package/dist/packages/runtime/runtime-project-reads.d.ts +18 -0
  327. package/dist/packages/runtime/runtime-project-reads.js +574 -0
  328. package/dist/packages/runtime/runtime-proposal-helpers.d.ts +22 -0
  329. package/dist/packages/runtime/runtime-proposal-helpers.js +223 -0
  330. package/dist/packages/{engine → runtime}/runtime-resource-builders.d.ts +23 -16
  331. package/dist/packages/{engine → runtime}/runtime-resource-builders.js +58 -46
  332. package/dist/packages/runtime/runtime-status.d.ts +14 -0
  333. package/dist/packages/runtime/runtime-status.js +15 -0
  334. package/dist/packages/runtime/runtime-verify-runs.d.ts +84 -0
  335. package/dist/packages/runtime/runtime-verify-runs.js +296 -0
  336. package/dist/packages/runtime/runtime.d.ts +1582 -0
  337. package/dist/packages/runtime/runtime.js +431 -0
  338. package/dist/packages/runtime/schemas/actions.d.ts +1206 -0
  339. package/dist/packages/runtime/schemas/actions.js +117 -0
  340. package/dist/packages/runtime/schemas/agents.d.ts +104 -0
  341. package/dist/packages/runtime/schemas/agents.js +74 -0
  342. package/dist/packages/runtime/schemas/build-plans.d.ts +1132 -0
  343. package/dist/packages/runtime/schemas/build-plans.js +141 -0
  344. package/dist/packages/runtime/schemas/context-graphs.d.ts +1522 -0
  345. package/dist/packages/runtime/schemas/context-graphs.js +110 -0
  346. package/dist/packages/runtime/schemas/files.d.ts +227 -0
  347. package/dist/packages/runtime/schemas/files.js +28 -0
  348. package/dist/packages/runtime/schemas/index.d.ts +9 -0
  349. package/dist/packages/runtime/schemas/index.js +13 -0
  350. package/dist/packages/runtime/schemas/instance.d.ts +141 -0
  351. package/dist/packages/runtime/schemas/instance.js +143 -0
  352. package/dist/packages/runtime/schemas/jobs.d.ts +339 -0
  353. package/dist/packages/runtime/schemas/jobs.js +107 -0
  354. package/dist/packages/runtime/schemas/projects.d.ts +366 -0
  355. package/dist/packages/runtime/schemas/projects.js +160 -0
  356. package/dist/packages/runtime/schemas/runs.d.ts +3445 -0
  357. package/dist/packages/runtime/schemas/runs.js +115 -0
  358. package/dist/packages/runtime/service/index.d.ts +3 -0
  359. package/dist/packages/runtime/service/index.js +3 -0
  360. package/dist/packages/runtime/service/openapi.d.ts +7 -0
  361. package/dist/packages/runtime/service/openapi.js +118 -0
  362. package/dist/packages/runtime/service/operations.d.ts +3011 -0
  363. package/dist/packages/runtime/service/operations.js +375 -0
  364. package/dist/packages/runtime/service/routes.d.ts +114 -0
  365. package/dist/packages/runtime/service/routes.js +128 -0
  366. package/dist/packages/runtime/service/server-api-files.d.ts +10 -0
  367. package/dist/packages/runtime/service/server-api-files.js +85 -0
  368. package/dist/packages/runtime/service/server-app-boot.d.ts +4 -0
  369. package/dist/packages/runtime/service/server-app-boot.js +46 -0
  370. package/dist/packages/runtime/service/server-guards.d.ts +63 -0
  371. package/dist/packages/runtime/service/server-guards.js +181 -0
  372. package/dist/packages/runtime/service/server-helpers.d.ts +38 -0
  373. package/dist/packages/runtime/service/server-helpers.js +108 -0
  374. package/dist/packages/runtime/service/server-instance-helpers.d.ts +30 -0
  375. package/dist/packages/runtime/service/server-instance-helpers.js +114 -0
  376. package/dist/packages/runtime/service/server-routes-action-proposals.d.ts +3 -0
  377. package/dist/packages/runtime/service/server-routes-action-proposals.js +45 -0
  378. package/dist/packages/runtime/service/server-routes-agents.d.ts +4 -0
  379. package/dist/packages/runtime/service/server-routes-agents.js +132 -0
  380. package/dist/packages/runtime/service/server-routes-auth.d.ts +33 -0
  381. package/dist/packages/runtime/service/server-routes-auth.js +138 -0
  382. package/dist/packages/runtime/service/server-routes-build-plans.d.ts +3 -0
  383. package/dist/packages/runtime/service/server-routes-build-plans.js +86 -0
  384. package/dist/packages/runtime/service/server-routes-discovery.d.ts +4 -0
  385. package/dist/packages/runtime/service/server-routes-discovery.js +196 -0
  386. package/dist/packages/runtime/service/server-routes-events.d.ts +5 -0
  387. package/dist/packages/runtime/service/server-routes-events.js +99 -0
  388. package/dist/packages/runtime/service/server-routes-project-context.d.ts +9 -0
  389. package/dist/packages/runtime/service/server-routes-project-context.js +287 -0
  390. package/dist/packages/runtime/service/server-routes-project-jobs.d.ts +9 -0
  391. package/dist/packages/runtime/service/server-routes-project-jobs.js +137 -0
  392. package/dist/packages/runtime/service/server-routes-project-runs.d.ts +14 -0
  393. package/dist/packages/runtime/service/server-routes-project-runs.js +88 -0
  394. package/dist/packages/runtime/service/server-routes-projects.d.ts +4 -0
  395. package/dist/packages/runtime/service/server-routes-projects.js +96 -0
  396. package/dist/packages/runtime/service/server-routes-runs.d.ts +3 -0
  397. package/dist/packages/runtime/service/server-routes-runs.js +119 -0
  398. package/dist/packages/runtime/service/server.d.ts +37 -0
  399. package/dist/packages/runtime/service/server.js +300 -0
  400. package/dist/packages/{engine → runtime/service}/service-registry.d.ts +5 -5
  401. package/dist/packages/{engine → runtime/service}/service-registry.js +7 -7
  402. package/dist/packages/runtime/verify/benchmark-run.d.ts +81 -0
  403. package/dist/packages/runtime/verify/benchmark-run.js +303 -0
  404. package/dist/packages/{engine → runtime}/verify/index.d.ts +2 -2
  405. package/dist/packages/{engine → runtime}/verify/index.js +1 -1
  406. package/dist/packages/{engine → runtime}/verify/lib/schema.d.ts +83 -16
  407. package/dist/packages/{engine → runtime}/verify/lib/schema.js +38 -18
  408. package/dist/packages/runtime/verify/test-file-guard.d.ts +2 -0
  409. package/dist/packages/runtime/verify/test-file-guard.js +29 -0
  410. package/dist/packages/{engine → runtime}/verify/verify-execution.d.ts +7 -0
  411. package/dist/packages/{engine → runtime}/verify/verify-execution.js +119 -45
  412. package/dist/packages/{engine → runtime}/verify/verify-paths.d.ts +5 -4
  413. package/dist/packages/runtime/verify/verify-paths.js +65 -0
  414. package/dist/packages/{engine → runtime}/verify/verify-sandbox.d.ts +1 -1
  415. package/dist/packages/runtime/verify/verify-sandbox.js +88 -0
  416. package/dist/packages/{engine → runtime}/verify/verify-specs.d.ts +2 -0
  417. package/dist/packages/runtime/verify/verify-specs.js +126 -0
  418. package/dist/packages/runtime/verify/verify-targets.d.ts +5 -0
  419. package/dist/packages/{engine → runtime}/verify/verify-targets.js +12 -12
  420. package/dist/packages/runtime/verify/verify-types.js +1 -0
  421. package/dist/packages/{engine → runtime}/verify/verify.d.ts +1 -1
  422. package/dist/packages/{engine → runtime}/verify/verify.js +1 -1
  423. package/dist/packages/runtime/wire-schemas.d.ts +18 -0
  424. package/dist/packages/runtime/wire-schemas.js +27 -0
  425. package/package.json +32 -30
  426. package/public-repo/CONTRIBUTING.md +16 -18
  427. package/public-repo/README.md +119 -282
  428. package/public-repo/SECURITY.md +3 -4
  429. package/public-repo/build-plans/interf-default/README.md +24 -16
  430. package/public-repo/build-plans/interf-default/build/stages/entrypoint/SKILL.md +74 -0
  431. package/public-repo/build-plans/interf-default/build/stages/knowledge/SKILL.md +95 -0
  432. package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +49 -4
  433. package/public-repo/build-plans/interf-default/build-plan.json +49 -39
  434. package/public-repo/build-plans/interf-default/build-plan.schema.json +59 -33
  435. package/public-repo/build-plans/interf-default/improve/SKILL.md +3 -3
  436. package/public-repo/build-plans/interf-default/use/query/SKILL.md +18 -11
  437. package/public-repo/openapi/local-service.openapi.json +14227 -0
  438. package/public-repo/skills/interf/SKILL.md +508 -187
  439. package/dist/cli/commands/prep.d.ts +0 -2
  440. package/dist/cli/commands/prep.js +0 -240
  441. package/dist/cli/commands/test.d.ts +0 -10
  442. package/dist/cli/commands/test.js +0 -85
  443. package/dist/cli/commands/web.d.ts +0 -2
  444. package/dist/cli/commands/web.js +0 -286
  445. package/dist/interf-ui/404.html +0 -1
  446. package/dist/interf-ui/__next.__PAGE__.txt +0 -10
  447. package/dist/interf-ui/__next._full.txt +0 -20
  448. package/dist/interf-ui/__next._head.txt +0 -5
  449. package/dist/interf-ui/__next._index.txt +0 -5
  450. package/dist/interf-ui/__next._tree.txt +0 -5
  451. package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_buildManifest.js +0 -11
  452. package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_clientMiddlewareManifest.js +0 -1
  453. package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_ssgManifest.js +0 -1
  454. package/dist/interf-ui/_next/static/chunks/0.tjb6f4golw..css +0 -3
  455. package/dist/interf-ui/_next/static/chunks/03~yq9q893hmn.js +0 -1
  456. package/dist/interf-ui/_next/static/chunks/085-n_jv2ng_q.css +0 -1
  457. package/dist/interf-ui/_next/static/chunks/0dn41fa_zvgsl.js +0 -1
  458. package/dist/interf-ui/_next/static/chunks/0g-ea0zj5d-0k.js +0 -1
  459. package/dist/interf-ui/_next/static/chunks/0gwqglc4iz583.js +0 -1
  460. package/dist/interf-ui/_next/static/chunks/0haldgm65ve6l.js +0 -1
  461. package/dist/interf-ui/_next/static/chunks/0nv3am99vjzn4.js +0 -1
  462. package/dist/interf-ui/_next/static/chunks/0s77gt_o4jwtx.js +0 -1
  463. package/dist/interf-ui/_next/static/chunks/0y5z3t-z1c8ks.js.map +0 -5
  464. package/dist/interf-ui/_next/static/chunks/0~a36ujuzpaz..js +0 -116
  465. package/dist/interf-ui/_next/static/chunks/10jeodxe4nkgj.js +0 -31
  466. package/dist/interf-ui/_next/static/chunks/119h2rouych2t.js +0 -1
  467. package/dist/interf-ui/_next/static/chunks/13c8b~m8knjsf.js +0 -1
  468. package/dist/interf-ui/_next/static/chunks/14dznb2qpt-ho.js +0 -91
  469. package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +0 -5
  470. package/dist/interf-ui/_next/static/chunks/turbopack-0p.pvcjrtq-jh.js +0 -1
  471. package/dist/interf-ui/_next/static/chunks/turbopack-0usj_75.8frlw.js +0 -1
  472. package/dist/interf-ui/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -1
  473. package/dist/interf-ui/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  474. package/dist/interf-ui/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  475. package/dist/interf-ui/_next/static/media/worker.102zas1s52_pf.js +0 -109
  476. package/dist/interf-ui/_not-found/__next._full.txt +0 -15
  477. package/dist/interf-ui/_not-found/__next._head.txt +0 -5
  478. package/dist/interf-ui/_not-found/__next._index.txt +0 -5
  479. package/dist/interf-ui/_not-found/__next._not-found.__PAGE__.txt +0 -5
  480. package/dist/interf-ui/_not-found/__next._not-found.txt +0 -5
  481. package/dist/interf-ui/_not-found/__next._tree.txt +0 -2
  482. package/dist/interf-ui/_not-found.html +0 -1
  483. package/dist/interf-ui/_not-found.txt +0 -15
  484. package/dist/interf-ui/index.html +0 -1
  485. package/dist/interf-ui/index.txt +0 -20
  486. package/dist/packages/contracts/lib/preparation-paths.d.ts +0 -117
  487. package/dist/packages/contracts/lib/preparation-paths.js +0 -177
  488. package/dist/packages/engine/action-definitions.d.ts +0 -407
  489. package/dist/packages/engine/action-definitions.js +0 -1158
  490. package/dist/packages/engine/action-values.d.ts +0 -1
  491. package/dist/packages/engine/action-values.js +0 -1
  492. package/dist/packages/engine/agents/lib/args.d.ts +0 -4
  493. package/dist/packages/engine/agents/lib/args.js +0 -52
  494. package/dist/packages/engine/agents/lib/chart-guidance.d.ts +0 -1
  495. package/dist/packages/engine/agents/lib/chart-guidance.js +0 -8
  496. package/dist/packages/engine/agents/lib/constants.js +0 -28
  497. package/dist/packages/engine/agents/lib/logs.d.ts +0 -2
  498. package/dist/packages/engine/agents/lib/logs.js +0 -17
  499. package/dist/packages/engine/agents/lib/render.d.ts +0 -8
  500. package/dist/packages/engine/agents/lib/schema.d.ts +0 -8
  501. package/dist/packages/engine/agents/lib/schema.js +0 -7
  502. package/dist/packages/engine/agents/lib/shells.d.ts +0 -74
  503. package/dist/packages/engine/agents/lib/shells.js +0 -1052
  504. package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.d.ts +0 -3
  505. package/dist/packages/engine/build/artifact-counts.d.ts +0 -1
  506. package/dist/packages/engine/build/billing-events.d.ts +0 -89
  507. package/dist/packages/engine/build/build-pipeline.js +0 -175
  508. package/dist/packages/engine/build/build-plan-runs.d.ts +0 -14
  509. package/dist/packages/engine/build/build-plan-runs.js +0 -31
  510. package/dist/packages/engine/build/build-stage-plan.d.ts +0 -16
  511. package/dist/packages/engine/build/build-stage-plan.js +0 -100
  512. package/dist/packages/engine/build/build-stage-runner.js +0 -94
  513. package/dist/packages/engine/build/build-target.js +0 -16
  514. package/dist/packages/engine/build/check-evaluator.js +0 -298
  515. package/dist/packages/engine/build/lib/schema.js +0 -316
  516. package/dist/packages/engine/build/reset.d.ts +0 -2
  517. package/dist/packages/engine/build/reset.js +0 -74
  518. package/dist/packages/engine/build/runtime-inventory.d.ts +0 -7
  519. package/dist/packages/engine/build/runtime-paths.d.ts +0 -8
  520. package/dist/packages/engine/build/runtime-paths.js +0 -26
  521. package/dist/packages/engine/build/runtime-runs.d.ts +0 -10
  522. package/dist/packages/engine/build/runtime-runs.js +0 -224
  523. package/dist/packages/engine/build/runtime.d.ts +0 -5
  524. package/dist/packages/engine/build/runtime.js +0 -4
  525. package/dist/packages/engine/build/source-files.d.ts +0 -46
  526. package/dist/packages/engine/build/source-files.js +0 -149
  527. package/dist/packages/engine/build/state-artifacts.d.ts +0 -9
  528. package/dist/packages/engine/build/state-artifacts.js +0 -14
  529. package/dist/packages/engine/build/state-health.d.ts +0 -4
  530. package/dist/packages/engine/build/state-io.d.ts +0 -11
  531. package/dist/packages/engine/build/state-io.js +0 -82
  532. package/dist/packages/engine/build/state-paths.d.ts +0 -5
  533. package/dist/packages/engine/build/state-paths.js +0 -16
  534. package/dist/packages/engine/build/state-view.d.ts +0 -5
  535. package/dist/packages/engine/build/state-view.js +0 -94
  536. package/dist/packages/engine/build/state.d.ts +0 -7
  537. package/dist/packages/engine/build/state.js +0 -12
  538. package/dist/packages/engine/build/validate-helpers.d.ts +0 -12
  539. package/dist/packages/engine/build/validate-helpers.js +0 -41
  540. package/dist/packages/engine/build/verifiable-context-paths.d.ts +0 -47
  541. package/dist/packages/engine/build/verifiable-context-paths.js +0 -121
  542. package/dist/packages/engine/build/verifiable-context-schema.d.ts +0 -21
  543. package/dist/packages/engine/build/verifiable-context-schema.js +0 -126
  544. package/dist/packages/engine/cloud-seams.d.ts +0 -115
  545. package/dist/packages/engine/cloud-seams.js +0 -84
  546. package/dist/packages/engine/index.d.ts +0 -22
  547. package/dist/packages/engine/index.js +0 -15
  548. package/dist/packages/engine/instance-paths.d.ts +0 -106
  549. package/dist/packages/engine/instance-paths.js +0 -171
  550. package/dist/packages/engine/lib/schema.d.ts +0 -6304
  551. package/dist/packages/engine/lib/schema.js +0 -730
  552. package/dist/packages/engine/native-run-handlers.d.ts +0 -25
  553. package/dist/packages/engine/preparation-store.d.ts +0 -105
  554. package/dist/packages/engine/preparation-store.js +0 -213
  555. package/dist/packages/engine/readiness-check-draft.d.ts +0 -20
  556. package/dist/packages/engine/readiness-check-draft.js +0 -111
  557. package/dist/packages/engine/requested-artifacts.d.ts +0 -5
  558. package/dist/packages/engine/routes.d.ts +0 -85
  559. package/dist/packages/engine/routes.js +0 -99
  560. package/dist/packages/engine/runtime-caches.d.ts +0 -76
  561. package/dist/packages/engine/runtime-caches.js +0 -191
  562. package/dist/packages/engine/runtime-proposal-helpers.d.ts +0 -35
  563. package/dist/packages/engine/runtime-proposal-helpers.js +0 -247
  564. package/dist/packages/engine/runtime.d.ts +0 -371
  565. package/dist/packages/engine/runtime.js +0 -2463
  566. package/dist/packages/engine/server.d.ts +0 -58
  567. package/dist/packages/engine/server.js +0 -1399
  568. package/dist/packages/engine/verify/readiness-check-run.d.ts +0 -82
  569. package/dist/packages/engine/verify/readiness-check-run.js +0 -265
  570. package/dist/packages/engine/verify/verify-paths.js +0 -61
  571. package/dist/packages/engine/verify/verify-sandbox.js +0 -88
  572. package/dist/packages/engine/verify/verify-specs.js +0 -114
  573. package/dist/packages/engine/verify/verify-targets.d.ts +0 -5
  574. package/dist/packages/engine/wire-schemas.d.ts +0 -547
  575. package/dist/packages/engine/wire-schemas.js +0 -59
  576. package/dist/packages/project/index.d.ts +0 -9
  577. package/dist/packages/project/interf-bootstrap.d.ts +0 -1
  578. package/dist/packages/project/interf-bootstrap.js +0 -1
  579. package/dist/packages/project/interf-scaffold.d.ts +0 -3
  580. package/dist/packages/project/interf-scaffold.js +0 -136
  581. package/dist/packages/project/interf.d.ts +0 -4
  582. package/dist/packages/project/interf.js +0 -3
  583. package/dist/packages/project/lib/schema.d.ts +0 -328
  584. package/dist/packages/project/lib/schema.js +0 -136
  585. package/dist/packages/project/preparation-entries.d.ts +0 -11
  586. package/dist/packages/project/preparation-entries.js +0 -49
  587. package/dist/packages/project/source-config.d.ts +0 -46
  588. package/dist/packages/project/source-config.js +0 -394
  589. package/dist/packages/project/source-folders.d.ts +0 -11
  590. package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +0 -27
  591. package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +0 -21
  592. package/public-repo/plugins/README.md +0 -9
  593. package/public-repo/plugins/interf/.claude-plugin/plugin.json +0 -21
  594. package/public-repo/plugins/interf/.mcp.json +0 -12
  595. package/public-repo/plugins/interf/README.md +0 -32
  596. package/public-repo/plugins/interf/skills/interf/SKILL.md +0 -376
  597. /package/dist/packages/{engine/agents/lib/types.js → runtime/actions/fields.js} +0 -0
  598. /package/dist/packages/{engine → runtime}/agents/lib/agents.d.ts +0 -0
  599. /package/dist/packages/{engine → runtime}/agents/lib/agents.js +0 -0
  600. /package/dist/packages/{engine → runtime}/agents/lib/execution.d.ts +0 -0
  601. /package/dist/packages/{engine → runtime}/agents/lib/preflight.d.ts +0 -0
  602. /package/dist/packages/{engine → runtime}/agents/lib/status.d.ts +0 -0
  603. /package/dist/packages/{engine/build/runtime-types.js → runtime/agents/lib/types.js} +0 -0
  604. /package/dist/packages/{engine/verify/verify-types.js → runtime/agents/providers/types.js} +0 -0
  605. /package/dist/packages/{engine → runtime}/agents/role-router.d.ts +0 -0
  606. /package/dist/packages/{engine → runtime}/build/build-execution.d.ts +0 -0
  607. /package/dist/packages/{engine → runtime}/build/build-execution.js +0 -0
  608. /package/dist/packages/{engine → runtime}/build/runtime-contracts.d.ts +0 -0
  609. /package/dist/packages/{engine → runtime}/build/runtime-prompt.d.ts +0 -0
  610. /package/dist/packages/{engine → runtime}/execution/adapters.d.ts +0 -0
  611. /package/dist/packages/{engine → runtime}/execution/adapters.js +0 -0
  612. /package/dist/packages/{engine → runtime}/execution/events.d.ts +0 -0
  613. /package/dist/packages/{engine → runtime}/execution/events.js +0 -0
  614. /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.d.ts +0 -0
  615. /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.js +0 -0
  616. /package/dist/packages/{engine → runtime}/verify/verify-types.d.ts +0 -0
@@ -0,0 +1,1582 @@
1
+ import { type ArtifactRef, type BuildRun, type InterfRunEvent, type EvidenceRecord } from "./execution/lib/schema.js";
2
+ import { type RunEventSink } from "./execution/events.js";
3
+ import { RunListingCache, ReadinessCache, MtimeListingCache, BuildPlanListingCache, ContextGraphResourceCache } from "./runtime-caches.js";
4
+ import { type Readiness } from "../contracts/lib/schema.js";
5
+ import type { ContextGraphHandoff } from "../contracts/lib/project-schema.js";
6
+ import type { ProjectConfig } from "../projects/lib/schema.js";
7
+ import type { ActionProposalCreateRequest, ActionProposalPlan, ActionProposalResource, BuildPlanAuthoringRuntimeRequest, BuildPlanAuthoringResult, BuildPlanChangeResult, BuildPlanResource, BuildRunCreateRequest, BuildRunResource, LocalExecutorStatus, LocalJobEvent, LocalJobEventAppendRequest, LocalJobRunResource, LocalRunHandlerResult, LocalServiceHealth, ProjectResource, BenchmarkQuestionDraftRuntimeRequest, BenchmarkQuestionDraftResult, ResetResult, RunObservabilityResource, SourceFileResource, ContextGraphResource, StageExecutionSession, VerifyRunCreateRequest, VerifyRunResource } from "./schemas/index.js";
8
+ import { type AgentsRegistryRoleState, type AgentsRegistryState } from "./runtime-executor.js";
9
+ import type { AgentPrefs, AgentRecord, RoleMap } from "../contracts/lib/schema.js";
10
+ export interface LocalServiceBuildRunContext {
11
+ runId: string;
12
+ sourcePath: string;
13
+ contextGraphPath: string;
14
+ projectConfig: ProjectConfig;
15
+ events: RunEventSink;
16
+ }
17
+ export interface LocalServiceVerifyRunContext {
18
+ runId: string;
19
+ sourcePath: string;
20
+ contextGraphPath: string;
21
+ projectConfig: ProjectConfig;
22
+ }
23
+ export interface LocalServiceJobRunContext {
24
+ runId: string;
25
+ sourcePath: string;
26
+ emit(event: LocalJobEventAppendRequest): void;
27
+ }
28
+ export interface LocalServiceActionPlanningContext {
29
+ sourcePath: string;
30
+ projects: ProjectConfig[];
31
+ projectHealth: Array<{
32
+ name: string;
33
+ benchmark_questions: number;
34
+ context_graph_ready: boolean;
35
+ can_run_benchmark: boolean;
36
+ recommended_next_actions: string[];
37
+ }>;
38
+ sourceFolders: Array<{
39
+ value: string;
40
+ label: string;
41
+ hint: string;
42
+ }>;
43
+ recentProposals: ActionProposalResource[];
44
+ }
45
+ export interface LocalServiceRunHandlers {
46
+ planActionProposal(request: ActionProposalCreateRequest, context: LocalServiceActionPlanningContext): Promise<ActionProposalPlan>;
47
+ createBuildRun(request: BuildRunCreateRequest, context: LocalServiceBuildRunContext): Promise<LocalRunHandlerResult>;
48
+ createVerifyRun(request: VerifyRunCreateRequest, context: LocalServiceVerifyRunContext): Promise<LocalRunHandlerResult>;
49
+ createBenchmarkQuestionDraft(request: BenchmarkQuestionDraftRuntimeRequest, context: LocalServiceJobRunContext): Promise<BenchmarkQuestionDraftResult>;
50
+ createBuildPlanAuthoringRun(request: BuildPlanAuthoringRuntimeRequest, context: LocalServiceJobRunContext): Promise<BuildPlanAuthoringResult>;
51
+ }
52
+ export interface LocalServiceRuntimeOptions {
53
+ rootPath: string;
54
+ host: string;
55
+ port: number;
56
+ packageVersion?: string;
57
+ ownerKind?: "desktop-app" | "headless";
58
+ ownerPid?: number;
59
+ startedAt?: string;
60
+ handlers?: Partial<LocalServiceRunHandlers>;
61
+ /**
62
+ * Per-instance bearer token. The server requires it on protected local
63
+ * API requests: mutating routes plus non-discovery `/v1` reads.
64
+ * Optional only because test code can opt into tokenless-dev mode.
65
+ */
66
+ authToken?: string;
67
+ /**
68
+ * Active account context for this engine. Populated at boot from
69
+ * `~/.interf/auth/session.json`. Null for pre-auth / loopback sessions.
70
+ * Entitlement guards treat null as Free tier.
71
+ */
72
+ currentAccount?: import("./auth/account-context.js").CurrentAccount | null;
73
+ /**
74
+ * How the server authenticates mutating requests.
75
+ *
76
+ * `"hex"` (default) — per-instance hex bearer compared against `authToken`.
77
+ * The loopback engine uses this. The loopback bind + CORS allowlist are
78
+ * the real security boundary; the hex bearer is a belt-and-braces guard.
79
+ *
80
+ * `"jwt"` — `Authorization: Bearer <jwt>` validated against the WorkOS
81
+ * JWKS. Used by the cloud engine binding when it lands. Validated claims
82
+ * are attached to the request as `(req as any).interfAccount` so route
83
+ * handlers can stamp `account_id` without re-parsing.
84
+ */
85
+ authMode?: "hex" | "jwt";
86
+ }
87
+ /**
88
+ * Per-Project context tracked by the runtime. Multiple Projects can
89
+ * be registered against one running service; each one owns its rootPath and
90
+ * activity timestamps. Routes pass the project explicitly to every
91
+ * runtime operation that needs one, so there is no swap-state to manage.
92
+ */
93
+ export interface ProjectContext {
94
+ rootPath: string;
95
+ startedAt: string;
96
+ lastActivity: string;
97
+ }
98
+ /**
99
+ * Tracking record for a Build run that the runtime can still cancel. The
100
+ * record is created when the background build starts and cleared when it
101
+ * reaches a terminal state. `cancelled` is set once a cancel request has
102
+ * been observed so the background loop can record the right terminal event
103
+ * (and so the persisted record is marked even when no executor child is
104
+ * running yet). `projectDataDir` lets the cancel path invalidate the right
105
+ * Project's caches without walking the registry.
106
+ */
107
+ export interface ActiveBuildRunHandle {
108
+ projectDataDir: string;
109
+ contextGraphPath: string;
110
+ project: string;
111
+ cancelled: boolean;
112
+ cancelledAt?: string;
113
+ }
114
+ export declare class LocalServiceRuntime {
115
+ readonly host: string;
116
+ port: number;
117
+ readonly startedAt: string;
118
+ readonly packageVersion?: string;
119
+ readonly ownerKind: "desktop-app" | "headless";
120
+ readonly ownerPid?: number;
121
+ readonly handlers: Partial<LocalServiceRunHandlers>;
122
+ /**
123
+ * The seed root path the runtime was constructed with. Used as a
124
+ * non-Project fallback when a Project-independent route
125
+ * (Build Plans, action proposals, runs listings) needs an anchor to load
126
+ * shared state (user-library Build Plans, bundled Build Plans, etc).
127
+ */
128
+ readonly rootPath: string;
129
+ /**
130
+ * Per-instance bearer token. Protected routes require this on the
131
+ * Authorization header. `null` means tokenless-dev mode (test harness).
132
+ */
133
+ readonly authToken: string | null;
134
+ /**
135
+ * Auth dispatch mode. See {@link LocalServiceRuntimeOptions.authMode}.
136
+ * Default is `"hex"` so loopback engines and existing tests are unaffected.
137
+ */
138
+ readonly authMode: "hex" | "jwt";
139
+ /**
140
+ * Active account / signed-in user for this engine instance. Populated at
141
+ * boot from `~/.interf/auth/session.json`. `null` for pre-auth /
142
+ * anonymous sessions; entitlement guards treat null as Free tier.
143
+ */
144
+ currentAccount: import("./auth/account-context.js").CurrentAccount | null;
145
+ /** Map of projectDataDir -> ProjectContext. */
146
+ private projectContexts;
147
+ /** Hook called whenever a Project is registered or deregistered. */
148
+ private onRegistryChanged;
149
+ /** In-flight runs across all projects. Used for `idle_for_seconds`. */
150
+ private activeRunCount;
151
+ /**
152
+ * Active Build run cancellation handles, keyed by run id. Populated
153
+ * when a Build run is launched and cleared once the run reaches a
154
+ * terminal state. Each entry remembers where the persisted record lives
155
+ * so cancel can mark it without re-resolving the Project.
156
+ */
157
+ activeBuildRuns: Map<string, ActiveBuildRunHandle>;
158
+ /**
159
+ * Active local job runs, keyed by run id. Build Plan drafting,
160
+ * Build Plan improvement, and benchmark-question drafting all persist
161
+ * through the local-job store; recovery must not mark these as
162
+ * interrupted while this runtime is still executing them.
163
+ */
164
+ activeJobRuns: Set<string>;
165
+ /**
166
+ * Idempotency-key cache for `POST .../build-runs`. Outer key is the
167
+ * resolved project root; inner key is the client-supplied idempotency
168
+ * value. Namespacing per project prevents key collisions across
169
+ * tenants on the same engine (CSO finding: a malicious project could
170
+ * otherwise hijack another project's run id by reusing its key).
171
+ * Entries expire after the idempotency TTL defined in `runtime-build-runs.ts`.
172
+ */
173
+ idempotencyKeyCache: Map<string, Map<string, {
174
+ runId: string;
175
+ expiresAt: number;
176
+ }>>;
177
+ /**
178
+ * Read-side caches. Polling clients (Interf Desktop renderer, CLI status loops)
179
+ * hit list/get endpoints multiple times per second; without these,
180
+ * every request re-walks the filesystem and re-parses every JSON
181
+ * record through Zod. The runtime invalidates each cache on the
182
+ * matching write path. See {@link runtime-caches} for design notes.
183
+ */
184
+ readonly buildRunCache: RunListingCache<{
185
+ kind: "interf-build-run";
186
+ version: 1;
187
+ run_id: string;
188
+ status: "running" | "failed" | "cancelled" | "queued" | "succeeded";
189
+ project: string;
190
+ build_plan: string;
191
+ backend: "native";
192
+ source_path: string;
193
+ context_graph_path: string;
194
+ created_at: string;
195
+ stages: {
196
+ run_id: string;
197
+ stage_id: string;
198
+ status: "running" | "failed" | "queued" | "succeeded";
199
+ artifacts: {
200
+ path: string;
201
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
202
+ stage_id?: string | null | undefined;
203
+ label?: string | undefined;
204
+ sha256?: string | undefined;
205
+ }[];
206
+ stage_label?: string | undefined;
207
+ stage_index?: number | undefined;
208
+ stage_total?: number | undefined;
209
+ started_at?: string | null | undefined;
210
+ finished_at?: string | null | undefined;
211
+ summary?: string | null | undefined;
212
+ contract?: {
213
+ reads: string[];
214
+ writes: string[];
215
+ stage_label?: string | undefined;
216
+ stage_index?: number | undefined;
217
+ stage_total?: number | undefined;
218
+ } | undefined;
219
+ executor?: {
220
+ kind: "local-agent" | "connected-provider" | "managed";
221
+ name: string;
222
+ display_name: string;
223
+ command: string | null;
224
+ model?: string | null | undefined;
225
+ effort?: string | null | undefined;
226
+ profile?: string | null | undefined;
227
+ timeout_ms?: number | null | undefined;
228
+ } | null | undefined;
229
+ logs?: {
230
+ prompt_path?: string | undefined;
231
+ event_stream_path?: string | undefined;
232
+ status_path?: string | undefined;
233
+ contract_path?: string | undefined;
234
+ evidence_path?: string | undefined;
235
+ } | undefined;
236
+ latest_evidence?: {
237
+ id: string;
238
+ run_id: string;
239
+ generated_at: string;
240
+ summary: string;
241
+ artifacts: {
242
+ path: string;
243
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
244
+ stage_id?: string | null | undefined;
245
+ label?: string | undefined;
246
+ sha256?: string | undefined;
247
+ }[];
248
+ checks: {
249
+ id: string;
250
+ label: string;
251
+ ok: boolean;
252
+ detail?: string | undefined;
253
+ }[];
254
+ stage_id?: string | null | undefined;
255
+ files_processed?: number | undefined;
256
+ } | null | undefined;
257
+ failure?: string | null | undefined;
258
+ }[];
259
+ events: ({
260
+ event_id: string;
261
+ run_id: string;
262
+ timestamp: string;
263
+ type: "run.started";
264
+ project: string;
265
+ backend: "native";
266
+ build_plan?: string | undefined;
267
+ context_graph_path?: string | undefined;
268
+ } | {
269
+ event_id: string;
270
+ run_id: string;
271
+ timestamp: string;
272
+ type: "stage.started";
273
+ stage_id: string;
274
+ stage_index?: number | undefined;
275
+ stage_total?: number | undefined;
276
+ logs?: {
277
+ prompt_path?: string | undefined;
278
+ event_stream_path?: string | undefined;
279
+ status_path?: string | undefined;
280
+ contract_path?: string | undefined;
281
+ evidence_path?: string | undefined;
282
+ } | undefined;
283
+ } | {
284
+ event_id: string;
285
+ run_id: string;
286
+ timestamp: string;
287
+ type: "file.processed";
288
+ stage_id: string;
289
+ path: string;
290
+ } | {
291
+ event_id: string;
292
+ run_id: string;
293
+ timestamp: string;
294
+ type: "artifact.written";
295
+ stage_id: string;
296
+ artifact: {
297
+ path: string;
298
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
299
+ stage_id?: string | null | undefined;
300
+ label?: string | undefined;
301
+ sha256?: string | undefined;
302
+ };
303
+ } | {
304
+ event_id: string;
305
+ run_id: string;
306
+ timestamp: string;
307
+ type: "evidence.updated";
308
+ evidence: {
309
+ id: string;
310
+ run_id: string;
311
+ generated_at: string;
312
+ summary: string;
313
+ artifacts: {
314
+ path: string;
315
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
316
+ stage_id?: string | null | undefined;
317
+ label?: string | undefined;
318
+ sha256?: string | undefined;
319
+ }[];
320
+ checks: {
321
+ id: string;
322
+ label: string;
323
+ ok: boolean;
324
+ detail?: string | undefined;
325
+ }[];
326
+ stage_id?: string | null | undefined;
327
+ files_processed?: number | undefined;
328
+ };
329
+ stage_id?: string | null | undefined;
330
+ } | {
331
+ event_id: string;
332
+ run_id: string;
333
+ timestamp: string;
334
+ type: "log.appended";
335
+ stream: "status" | "trace" | "system";
336
+ message: string;
337
+ stage_id?: string | null | undefined;
338
+ } | {
339
+ event_id: string;
340
+ run_id: string;
341
+ timestamp: string;
342
+ type: "stage.passed";
343
+ stage_id: string;
344
+ summary?: string | undefined;
345
+ } | {
346
+ event_id: string;
347
+ run_id: string;
348
+ timestamp: string;
349
+ type: "stage.failed";
350
+ stage_id: string;
351
+ error: string;
352
+ } | {
353
+ event_id: string;
354
+ run_id: string;
355
+ timestamp: string;
356
+ type: "run.completed";
357
+ summary?: string | undefined;
358
+ } | {
359
+ event_id: string;
360
+ run_id: string;
361
+ timestamp: string;
362
+ type: "run.failed";
363
+ error: string;
364
+ } | {
365
+ event_id: string;
366
+ run_id: string;
367
+ timestamp: string;
368
+ type: "run.cancelled";
369
+ reason?: string | undefined;
370
+ } | {
371
+ event_id: string;
372
+ run_id: string;
373
+ timestamp: string;
374
+ type: "checks.evaluated";
375
+ passed: number;
376
+ total: number;
377
+ target?: "source-files" | "context-graph" | undefined;
378
+ checks_fingerprint?: string | undefined;
379
+ stale?: boolean | undefined;
380
+ test_run_id?: string | undefined;
381
+ } | {
382
+ event_id: string;
383
+ run_id: string;
384
+ timestamp: string;
385
+ type: "readiness.updated";
386
+ project: string;
387
+ readiness: {
388
+ kind: "interf-readiness-state";
389
+ version: 1;
390
+ generated_at: string;
391
+ project: string;
392
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
393
+ ready: boolean;
394
+ summary: string;
395
+ context_graph_path: string | null;
396
+ build: {
397
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
398
+ ok: boolean;
399
+ summary: string;
400
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
401
+ detail?: string | undefined;
402
+ run_id?: string | null | undefined;
403
+ artifact_path?: string | null | undefined;
404
+ } | null;
405
+ check_results: {
406
+ configured: number;
407
+ fingerprint: string | null;
408
+ source_files: {
409
+ passed: number;
410
+ total: number;
411
+ pass_rate: number | null;
412
+ stale: boolean;
413
+ checks_fingerprint?: string | null | undefined;
414
+ run_id?: string | null | undefined;
415
+ run_path?: string | null | undefined;
416
+ } | null;
417
+ context_graph: {
418
+ passed: number;
419
+ total: number;
420
+ pass_rate: number | null;
421
+ stale: boolean;
422
+ checks_fingerprint?: string | null | undefined;
423
+ run_id?: string | null | undefined;
424
+ run_path?: string | null | undefined;
425
+ } | null;
426
+ };
427
+ checks: {
428
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
429
+ ok: boolean;
430
+ summary: string;
431
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
432
+ detail?: string | undefined;
433
+ run_id?: string | null | undefined;
434
+ artifact_path?: string | null | undefined;
435
+ }[];
436
+ latest_build_run_id?: string | null | undefined;
437
+ latest_benchmark_run_id?: string | null | undefined;
438
+ };
439
+ })[];
440
+ context_checks: {
441
+ id: string;
442
+ label: string;
443
+ backed_by_artifact_ids: string[];
444
+ required: boolean;
445
+ description?: string | undefined;
446
+ evidence_expectation?: string | undefined;
447
+ status?: "passed" | "pending" | "running" | "failed" | "skipped" | undefined;
448
+ evidence?: string | undefined;
449
+ issue?: string | undefined;
450
+ }[];
451
+ artifacts: {
452
+ artifact_id: string;
453
+ status: "ready" | "failed" | "skipped" | "not_ready";
454
+ built_by_stages: string[];
455
+ check_results: {
456
+ check_id: string;
457
+ kind: "file_exists" | "source_manifest_valid" | "min_file_count" | "min_file_count_matches_source" | "source_summary_folders" | "source_page_coverage" | "frontmatter_valid" | "frontmatter_required_keys" | "frontmatter_nonempty_keys" | "source_refs_required" | "summary_backlinks_present" | "knowledge_web_connectivity" | "graph_notes_connected" | "wikilinks_valid" | "must_not_contain" | "must_contain" | "qa_match";
458
+ passed: boolean;
459
+ required: boolean;
460
+ summary: string;
461
+ evaluated_at: string;
462
+ details?: Record<string, unknown> | undefined;
463
+ }[];
464
+ summary?: string | undefined;
465
+ }[];
466
+ started_at?: string | null | undefined;
467
+ finished_at?: string | null | undefined;
468
+ latest_evidence?: {
469
+ id: string;
470
+ run_id: string;
471
+ generated_at: string;
472
+ summary: string;
473
+ artifacts: {
474
+ path: string;
475
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
476
+ stage_id?: string | null | undefined;
477
+ label?: string | undefined;
478
+ sha256?: string | undefined;
479
+ }[];
480
+ checks: {
481
+ id: string;
482
+ label: string;
483
+ ok: boolean;
484
+ detail?: string | undefined;
485
+ }[];
486
+ stage_id?: string | null | undefined;
487
+ files_processed?: number | undefined;
488
+ } | null | undefined;
489
+ readiness?: {
490
+ kind: "interf-readiness-state";
491
+ version: 1;
492
+ generated_at: string;
493
+ project: string;
494
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
495
+ ready: boolean;
496
+ summary: string;
497
+ context_graph_path: string | null;
498
+ build: {
499
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
500
+ ok: boolean;
501
+ summary: string;
502
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
503
+ detail?: string | undefined;
504
+ run_id?: string | null | undefined;
505
+ artifact_path?: string | null | undefined;
506
+ } | null;
507
+ check_results: {
508
+ configured: number;
509
+ fingerprint: string | null;
510
+ source_files: {
511
+ passed: number;
512
+ total: number;
513
+ pass_rate: number | null;
514
+ stale: boolean;
515
+ checks_fingerprint?: string | null | undefined;
516
+ run_id?: string | null | undefined;
517
+ run_path?: string | null | undefined;
518
+ } | null;
519
+ context_graph: {
520
+ passed: number;
521
+ total: number;
522
+ pass_rate: number | null;
523
+ stale: boolean;
524
+ checks_fingerprint?: string | null | undefined;
525
+ run_id?: string | null | undefined;
526
+ run_path?: string | null | undefined;
527
+ } | null;
528
+ };
529
+ checks: {
530
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
531
+ ok: boolean;
532
+ summary: string;
533
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
534
+ detail?: string | undefined;
535
+ run_id?: string | null | undefined;
536
+ artifact_path?: string | null | undefined;
537
+ }[];
538
+ latest_build_run_id?: string | null | undefined;
539
+ latest_benchmark_run_id?: string | null | undefined;
540
+ } | null | undefined;
541
+ }>;
542
+ readonly verifyRunCache: RunListingCache<{
543
+ run_id: string;
544
+ status: "running" | "failed" | "cancelled" | "queued" | "succeeded";
545
+ project: string;
546
+ source_path: string;
547
+ context_graph_path: string | null;
548
+ benchmark_run: {
549
+ kind: "interf-benchmark-run";
550
+ version: 1;
551
+ generated_at: string;
552
+ mode: "source-files" | "context-graph" | "both";
553
+ source_path: string;
554
+ project: {
555
+ name: string;
556
+ context_graph_path: string | null;
557
+ };
558
+ source_files: {
559
+ label: string;
560
+ run_path: string;
561
+ ok: boolean;
562
+ passed_cases: number;
563
+ total_cases: number;
564
+ passed_checks: number;
565
+ total_checks: number;
566
+ source_usage: "unknown" | "source-baseline" | "graph-only" | "graph-source-verified";
567
+ target: {
568
+ type: "source-files" | "context-graph";
569
+ name: string;
570
+ path: string;
571
+ build_plan: string;
572
+ };
573
+ executor?: {
574
+ kind: "local-agent" | "connected-provider" | "managed";
575
+ name: string;
576
+ display_name: string;
577
+ command: string | null;
578
+ model?: string | null | undefined;
579
+ effort?: string | null | undefined;
580
+ profile?: string | null | undefined;
581
+ timeout_ms?: number | null | undefined;
582
+ } | null | undefined;
583
+ } | null;
584
+ context_graph: {
585
+ label: string;
586
+ run_path: string;
587
+ ok: boolean;
588
+ passed_cases: number;
589
+ total_cases: number;
590
+ passed_checks: number;
591
+ total_checks: number;
592
+ source_usage: "unknown" | "source-baseline" | "graph-only" | "graph-source-verified";
593
+ target: {
594
+ type: "source-files" | "context-graph";
595
+ name: string;
596
+ path: string;
597
+ build_plan: string;
598
+ };
599
+ executor?: {
600
+ kind: "local-agent" | "connected-provider" | "managed";
601
+ name: string;
602
+ display_name: string;
603
+ command: string | null;
604
+ model?: string | null | undefined;
605
+ effort?: string | null | undefined;
606
+ profile?: string | null | undefined;
607
+ timeout_ms?: number | null | undefined;
608
+ } | null | undefined;
609
+ } | null;
610
+ summary: {
611
+ source_files_pass_rate: number | null;
612
+ context_graph_pass_rate: number | null;
613
+ };
614
+ checks_fingerprint?: string | undefined;
615
+ } | null;
616
+ events: ({
617
+ event_id: string;
618
+ run_id: string;
619
+ timestamp: string;
620
+ type: "run.started";
621
+ project: string;
622
+ backend: "native";
623
+ build_plan?: string | undefined;
624
+ context_graph_path?: string | undefined;
625
+ } | {
626
+ event_id: string;
627
+ run_id: string;
628
+ timestamp: string;
629
+ type: "stage.started";
630
+ stage_id: string;
631
+ stage_index?: number | undefined;
632
+ stage_total?: number | undefined;
633
+ logs?: {
634
+ prompt_path?: string | undefined;
635
+ event_stream_path?: string | undefined;
636
+ status_path?: string | undefined;
637
+ contract_path?: string | undefined;
638
+ evidence_path?: string | undefined;
639
+ } | undefined;
640
+ } | {
641
+ event_id: string;
642
+ run_id: string;
643
+ timestamp: string;
644
+ type: "file.processed";
645
+ stage_id: string;
646
+ path: string;
647
+ } | {
648
+ event_id: string;
649
+ run_id: string;
650
+ timestamp: string;
651
+ type: "artifact.written";
652
+ stage_id: string;
653
+ artifact: {
654
+ path: string;
655
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
656
+ stage_id?: string | null | undefined;
657
+ label?: string | undefined;
658
+ sha256?: string | undefined;
659
+ };
660
+ } | {
661
+ event_id: string;
662
+ run_id: string;
663
+ timestamp: string;
664
+ type: "evidence.updated";
665
+ evidence: {
666
+ id: string;
667
+ run_id: string;
668
+ generated_at: string;
669
+ summary: string;
670
+ artifacts: {
671
+ path: string;
672
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
673
+ stage_id?: string | null | undefined;
674
+ label?: string | undefined;
675
+ sha256?: string | undefined;
676
+ }[];
677
+ checks: {
678
+ id: string;
679
+ label: string;
680
+ ok: boolean;
681
+ detail?: string | undefined;
682
+ }[];
683
+ stage_id?: string | null | undefined;
684
+ files_processed?: number | undefined;
685
+ };
686
+ stage_id?: string | null | undefined;
687
+ } | {
688
+ event_id: string;
689
+ run_id: string;
690
+ timestamp: string;
691
+ type: "log.appended";
692
+ stream: "status" | "trace" | "system";
693
+ message: string;
694
+ stage_id?: string | null | undefined;
695
+ } | {
696
+ event_id: string;
697
+ run_id: string;
698
+ timestamp: string;
699
+ type: "stage.passed";
700
+ stage_id: string;
701
+ summary?: string | undefined;
702
+ } | {
703
+ event_id: string;
704
+ run_id: string;
705
+ timestamp: string;
706
+ type: "stage.failed";
707
+ stage_id: string;
708
+ error: string;
709
+ } | {
710
+ event_id: string;
711
+ run_id: string;
712
+ timestamp: string;
713
+ type: "run.completed";
714
+ summary?: string | undefined;
715
+ } | {
716
+ event_id: string;
717
+ run_id: string;
718
+ timestamp: string;
719
+ type: "run.failed";
720
+ error: string;
721
+ } | {
722
+ event_id: string;
723
+ run_id: string;
724
+ timestamp: string;
725
+ type: "run.cancelled";
726
+ reason?: string | undefined;
727
+ } | {
728
+ event_id: string;
729
+ run_id: string;
730
+ timestamp: string;
731
+ type: "checks.evaluated";
732
+ passed: number;
733
+ total: number;
734
+ target?: "source-files" | "context-graph" | undefined;
735
+ checks_fingerprint?: string | undefined;
736
+ stale?: boolean | undefined;
737
+ test_run_id?: string | undefined;
738
+ } | {
739
+ event_id: string;
740
+ run_id: string;
741
+ timestamp: string;
742
+ type: "readiness.updated";
743
+ project: string;
744
+ readiness: {
745
+ kind: "interf-readiness-state";
746
+ version: 1;
747
+ generated_at: string;
748
+ project: string;
749
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
750
+ ready: boolean;
751
+ summary: string;
752
+ context_graph_path: string | null;
753
+ build: {
754
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
755
+ ok: boolean;
756
+ summary: string;
757
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
758
+ detail?: string | undefined;
759
+ run_id?: string | null | undefined;
760
+ artifact_path?: string | null | undefined;
761
+ } | null;
762
+ check_results: {
763
+ configured: number;
764
+ fingerprint: string | null;
765
+ source_files: {
766
+ passed: number;
767
+ total: number;
768
+ pass_rate: number | null;
769
+ stale: boolean;
770
+ checks_fingerprint?: string | null | undefined;
771
+ run_id?: string | null | undefined;
772
+ run_path?: string | null | undefined;
773
+ } | null;
774
+ context_graph: {
775
+ passed: number;
776
+ total: number;
777
+ pass_rate: number | null;
778
+ stale: boolean;
779
+ checks_fingerprint?: string | null | undefined;
780
+ run_id?: string | null | undefined;
781
+ run_path?: string | null | undefined;
782
+ } | null;
783
+ };
784
+ checks: {
785
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
786
+ ok: boolean;
787
+ summary: string;
788
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
789
+ detail?: string | undefined;
790
+ run_id?: string | null | undefined;
791
+ artifact_path?: string | null | undefined;
792
+ }[];
793
+ latest_build_run_id?: string | null | undefined;
794
+ latest_benchmark_run_id?: string | null | undefined;
795
+ };
796
+ })[];
797
+ target?: "source-files" | "context-graph" | "both" | undefined;
798
+ started_at?: string | null | undefined;
799
+ finished_at?: string | null | undefined;
800
+ executor?: {
801
+ kind: "local-agent" | "connected-provider" | "managed";
802
+ name: string;
803
+ display_name: string;
804
+ command: string | null;
805
+ model?: string | null | undefined;
806
+ effort?: string | null | undefined;
807
+ profile?: string | null | undefined;
808
+ timeout_ms?: number | null | undefined;
809
+ } | null | undefined;
810
+ agent_label?: string | null | undefined;
811
+ parent_run_id?: string | null | undefined;
812
+ batch?: {
813
+ child_run_ids: string[];
814
+ total_agents: number;
815
+ completed_agents: number;
816
+ succeeded_agents: number;
817
+ failed_agents: number;
818
+ } | null | undefined;
819
+ readiness?: {
820
+ kind: "interf-readiness-state";
821
+ version: 1;
822
+ generated_at: string;
823
+ project: string;
824
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
825
+ ready: boolean;
826
+ summary: string;
827
+ context_graph_path: string | null;
828
+ build: {
829
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
830
+ ok: boolean;
831
+ summary: string;
832
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
833
+ detail?: string | undefined;
834
+ run_id?: string | null | undefined;
835
+ artifact_path?: string | null | undefined;
836
+ } | null;
837
+ check_results: {
838
+ configured: number;
839
+ fingerprint: string | null;
840
+ source_files: {
841
+ passed: number;
842
+ total: number;
843
+ pass_rate: number | null;
844
+ stale: boolean;
845
+ checks_fingerprint?: string | null | undefined;
846
+ run_id?: string | null | undefined;
847
+ run_path?: string | null | undefined;
848
+ } | null;
849
+ context_graph: {
850
+ passed: number;
851
+ total: number;
852
+ pass_rate: number | null;
853
+ stale: boolean;
854
+ checks_fingerprint?: string | null | undefined;
855
+ run_id?: string | null | undefined;
856
+ run_path?: string | null | undefined;
857
+ } | null;
858
+ };
859
+ checks: {
860
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
861
+ ok: boolean;
862
+ summary: string;
863
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
864
+ detail?: string | undefined;
865
+ run_id?: string | null | undefined;
866
+ artifact_path?: string | null | undefined;
867
+ }[];
868
+ latest_build_run_id?: string | null | undefined;
869
+ latest_benchmark_run_id?: string | null | undefined;
870
+ } | null | undefined;
871
+ error?: string | null | undefined;
872
+ }>;
873
+ readonly readinessCache: ReadinessCache<{
874
+ kind: "interf-readiness-state";
875
+ version: 1;
876
+ generated_at: string;
877
+ project: string;
878
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
879
+ ready: boolean;
880
+ summary: string;
881
+ context_graph_path: string | null;
882
+ build: {
883
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
884
+ ok: boolean;
885
+ summary: string;
886
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
887
+ detail?: string | undefined;
888
+ run_id?: string | null | undefined;
889
+ artifact_path?: string | null | undefined;
890
+ } | null;
891
+ check_results: {
892
+ configured: number;
893
+ fingerprint: string | null;
894
+ source_files: {
895
+ passed: number;
896
+ total: number;
897
+ pass_rate: number | null;
898
+ stale: boolean;
899
+ checks_fingerprint?: string | null | undefined;
900
+ run_id?: string | null | undefined;
901
+ run_path?: string | null | undefined;
902
+ } | null;
903
+ context_graph: {
904
+ passed: number;
905
+ total: number;
906
+ pass_rate: number | null;
907
+ stale: boolean;
908
+ checks_fingerprint?: string | null | undefined;
909
+ run_id?: string | null | undefined;
910
+ run_path?: string | null | undefined;
911
+ } | null;
912
+ };
913
+ checks: {
914
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
915
+ ok: boolean;
916
+ summary: string;
917
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
918
+ detail?: string | undefined;
919
+ run_id?: string | null | undefined;
920
+ artifact_path?: string | null | undefined;
921
+ }[];
922
+ latest_build_run_id?: string | null | undefined;
923
+ latest_benchmark_run_id?: string | null | undefined;
924
+ }>;
925
+ readonly sourceFilesCache: MtimeListingCache<{
926
+ project: string;
927
+ path: string;
928
+ absolute_path: string;
929
+ size_bytes: number;
930
+ modified_at: string | null;
931
+ source_folder_path: string;
932
+ source_manifest_id?: string | undefined;
933
+ source_file_id?: string | undefined;
934
+ locator?: string | undefined;
935
+ kind?: "image" | "pdf" | "document" | "spreadsheet" | "presentation" | "text" | "other" | undefined;
936
+ }[]>;
937
+ readonly buildPlanListingCache: BuildPlanListingCache<{
938
+ id: string;
939
+ build_plan_id: string;
940
+ path: string;
941
+ inputs: {
942
+ id: string;
943
+ label: string;
944
+ description: string;
945
+ required: boolean;
946
+ examples?: string[] | undefined;
947
+ }[];
948
+ source_kind: "builtin" | "local";
949
+ built_in: boolean;
950
+ scope: "builtin" | "user" | "local";
951
+ active_for_projects: string[];
952
+ context_checks: {
953
+ id: string;
954
+ label: string;
955
+ backed_by_artifact_ids: string[];
956
+ required: boolean;
957
+ description?: string | undefined;
958
+ evidence_expectation?: string | undefined;
959
+ }[];
960
+ artifacts: {
961
+ id: string;
962
+ description: string;
963
+ shape: {
964
+ kind: "path";
965
+ path: string;
966
+ artifact_kind: "file" | "directory";
967
+ };
968
+ checks: {
969
+ id: string;
970
+ kind: "file_exists" | "source_manifest_valid" | "min_file_count" | "min_file_count_matches_source" | "source_summary_folders" | "source_page_coverage" | "frontmatter_valid" | "frontmatter_required_keys" | "frontmatter_nonempty_keys" | "source_refs_required" | "summary_backlinks_present" | "knowledge_web_connectivity" | "graph_notes_connected" | "wikilinks_valid" | "must_not_contain" | "must_contain" | "qa_match";
971
+ required: boolean;
972
+ description?: string | undefined;
973
+ params?: Record<string, unknown> | undefined;
974
+ }[];
975
+ built_by_stages: string[];
976
+ }[];
977
+ stages: {
978
+ id: string;
979
+ label: string;
980
+ contract_type: string;
981
+ skill_dir: string;
982
+ role: string;
983
+ reads: string[];
984
+ writes: string[];
985
+ description?: string | undefined;
986
+ }[];
987
+ label?: string | undefined;
988
+ hint?: string | undefined;
989
+ purpose?: {
990
+ label: string;
991
+ task_hint: string;
992
+ } | undefined;
993
+ brief?: {
994
+ requested_artifacts: {
995
+ title: string;
996
+ checks: (string | {
997
+ label: string;
998
+ })[];
999
+ id?: string | undefined;
1000
+ purpose?: string | undefined;
1001
+ description?: string | undefined;
1002
+ output?: {
1003
+ checks: {
1004
+ id: string;
1005
+ kind: "file_exists" | "source_manifest_valid" | "min_file_count" | "min_file_count_matches_source" | "source_summary_folders" | "source_page_coverage" | "frontmatter_valid" | "frontmatter_required_keys" | "frontmatter_nonempty_keys" | "source_refs_required" | "summary_backlinks_present" | "knowledge_web_connectivity" | "graph_notes_connected" | "wikilinks_valid" | "must_not_contain" | "must_contain" | "qa_match";
1006
+ required: boolean;
1007
+ description?: string | undefined;
1008
+ params?: Record<string, unknown> | undefined;
1009
+ }[];
1010
+ path?: string | undefined;
1011
+ shape?: {
1012
+ kind: "path";
1013
+ path: string;
1014
+ artifact_kind: "file" | "directory";
1015
+ } | undefined;
1016
+ stage_hint?: string | undefined;
1017
+ } | undefined;
1018
+ }[];
1019
+ checks: {
1020
+ label: string;
1021
+ backed_by_artifact_ids: string[];
1022
+ required: boolean;
1023
+ id?: string | undefined;
1024
+ description?: string | undefined;
1025
+ evidence?: string | undefined;
1026
+ evidence_expectation?: string | undefined;
1027
+ }[];
1028
+ artifact_requirements: {
1029
+ id: string;
1030
+ shape: {
1031
+ kind: "path";
1032
+ path: string;
1033
+ artifact_kind: "file" | "directory";
1034
+ };
1035
+ checks: {
1036
+ id: string;
1037
+ kind: "file_exists" | "source_manifest_valid" | "min_file_count" | "min_file_count_matches_source" | "source_summary_folders" | "source_page_coverage" | "frontmatter_valid" | "frontmatter_required_keys" | "frontmatter_nonempty_keys" | "source_refs_required" | "summary_backlinks_present" | "knowledge_web_connectivity" | "graph_notes_connected" | "wikilinks_valid" | "must_not_contain" | "must_contain" | "qa_match";
1038
+ required: boolean;
1039
+ description?: string | undefined;
1040
+ params?: Record<string, unknown> | undefined;
1041
+ }[];
1042
+ description?: string | undefined;
1043
+ stage_hint?: string | undefined;
1044
+ }[];
1045
+ intent: string;
1046
+ user_prep_instructions?: string | undefined;
1047
+ source_context?: {
1048
+ items: {
1049
+ name?: string | undefined;
1050
+ path?: string | undefined;
1051
+ kind?: string | undefined;
1052
+ page_count?: number | undefined;
1053
+ note?: string | undefined;
1054
+ }[];
1055
+ observations: string[];
1056
+ limitations: string[];
1057
+ summary?: string | undefined;
1058
+ } | null | undefined;
1059
+ } | undefined;
1060
+ created_at?: string | null | undefined;
1061
+ updated_at?: string | null | undefined;
1062
+ }[]>;
1063
+ /**
1064
+ * Per-Build-run Context Graph resource cache. A succeeded Build's graph is
1065
+ * immutable, so the full `ContextGraphResource` (readiness join, semantic
1066
+ * graph, evidence, validation) is memoized keyed by run id + graph-manifest
1067
+ * mtime. Busted on Build completion and Build Plan change via
1068
+ * `invalidateProject` on the matching write paths.
1069
+ */
1070
+ readonly contextGraphResourceCache: ContextGraphResourceCache<{
1071
+ kind: "interf-context-graph";
1072
+ version: 1;
1073
+ intent: string;
1074
+ project: string;
1075
+ path: string;
1076
+ exists: boolean;
1077
+ readiness: {
1078
+ kind: "interf-readiness-state";
1079
+ version: 1;
1080
+ generated_at: string;
1081
+ project: string;
1082
+ status: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale";
1083
+ ready: boolean;
1084
+ summary: string;
1085
+ context_graph_path: string | null;
1086
+ build: {
1087
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
1088
+ ok: boolean;
1089
+ summary: string;
1090
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
1091
+ detail?: string | undefined;
1092
+ run_id?: string | null | undefined;
1093
+ artifact_path?: string | null | undefined;
1094
+ } | null;
1095
+ check_results: {
1096
+ configured: number;
1097
+ fingerprint: string | null;
1098
+ source_files: {
1099
+ passed: number;
1100
+ total: number;
1101
+ pass_rate: number | null;
1102
+ stale: boolean;
1103
+ checks_fingerprint?: string | null | undefined;
1104
+ run_id?: string | null | undefined;
1105
+ run_path?: string | null | undefined;
1106
+ } | null;
1107
+ context_graph: {
1108
+ passed: number;
1109
+ total: number;
1110
+ pass_rate: number | null;
1111
+ stale: boolean;
1112
+ checks_fingerprint?: string | null | undefined;
1113
+ run_id?: string | null | undefined;
1114
+ run_path?: string | null | undefined;
1115
+ } | null;
1116
+ };
1117
+ checks: {
1118
+ gate: "context-graph" | "project-config" | "build-run" | "artifact-diagnostics" | "context-checks" | "benchmarks" | "benchmarks-current";
1119
+ ok: boolean;
1120
+ summary: string;
1121
+ status?: "ready" | "not-ready" | "failed" | "not-configured" | "not-built" | "building" | "built" | "checking" | "stale" | undefined;
1122
+ detail?: string | undefined;
1123
+ run_id?: string | null | undefined;
1124
+ artifact_path?: string | null | undefined;
1125
+ }[];
1126
+ latest_build_run_id?: string | null | undefined;
1127
+ latest_benchmark_run_id?: string | null | undefined;
1128
+ };
1129
+ artifact_handoffs: {
1130
+ label: string;
1131
+ locator: {
1132
+ kind: "local-path" | "remote-url" | "api-served";
1133
+ value: string;
1134
+ };
1135
+ role: "entrypoint" | "artifact" | "guidance" | "source-index";
1136
+ artifact_id?: string | undefined;
1137
+ path?: string | undefined;
1138
+ artifact_kind?: "file" | "directory" | undefined;
1139
+ summary?: string | undefined;
1140
+ }[];
1141
+ artifacts: {
1142
+ path: string;
1143
+ role: "runtime" | "output" | "source" | "evidence" | "benchmark";
1144
+ stage_id?: string | null | undefined;
1145
+ label?: string | undefined;
1146
+ sha256?: string | undefined;
1147
+ }[];
1148
+ primary_metrics: {
1149
+ key: string;
1150
+ label: string;
1151
+ value: number;
1152
+ primary: boolean;
1153
+ total?: number | undefined;
1154
+ unit?: string | undefined;
1155
+ issue_state?: "pass" | "fail" | "missing" | "review" | undefined;
1156
+ detail?: string | undefined;
1157
+ metadata?: Record<string, unknown> | undefined;
1158
+ }[];
1159
+ stage_summaries: {
1160
+ stage_id: string;
1161
+ stage_label: string;
1162
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1163
+ manifest_path: string;
1164
+ summary: string;
1165
+ produced_total: number;
1166
+ missing_required_total: number;
1167
+ metrics: {
1168
+ key: string;
1169
+ label: string;
1170
+ value: number;
1171
+ primary: boolean;
1172
+ total?: number | undefined;
1173
+ unit?: string | undefined;
1174
+ issue_state?: "pass" | "fail" | "missing" | "review" | undefined;
1175
+ detail?: string | undefined;
1176
+ metadata?: Record<string, unknown> | undefined;
1177
+ }[];
1178
+ }[];
1179
+ entrypoints: {
1180
+ id: string;
1181
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1182
+ kind: string;
1183
+ label: string;
1184
+ source_refs: string[];
1185
+ links: string[];
1186
+ required: boolean;
1187
+ path?: string | undefined;
1188
+ locator?: string | undefined;
1189
+ stage_id?: string | undefined;
1190
+ metadata?: Record<string, unknown> | undefined;
1191
+ }[];
1192
+ resources: {
1193
+ id: string;
1194
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1195
+ kind: string;
1196
+ label: string;
1197
+ source_refs: string[];
1198
+ links: string[];
1199
+ required: boolean;
1200
+ path?: string | undefined;
1201
+ locator?: string | undefined;
1202
+ stage_id?: string | undefined;
1203
+ metadata?: Record<string, unknown> | undefined;
1204
+ }[];
1205
+ stage_sessions: {
1206
+ kind: "interf-stage-execution-session";
1207
+ version: 1;
1208
+ job_type: "stage" | "source-inventory";
1209
+ generated_at: string;
1210
+ updated_at: string;
1211
+ project: string;
1212
+ project_intent: string | null;
1213
+ context_graph_path: string;
1214
+ build_plan: string;
1215
+ build_run_id: string | null;
1216
+ stage_id: string | null;
1217
+ stage_label: string | null;
1218
+ contract_type: string | null;
1219
+ stage_run_id: string;
1220
+ attempt: number;
1221
+ status: "running" | "failed" | "succeeded";
1222
+ executor: {
1223
+ kind: "local-agent" | "connected-provider" | "managed";
1224
+ name: string;
1225
+ display_name: string;
1226
+ command: string | null;
1227
+ model?: string | null | undefined;
1228
+ effort?: string | null | undefined;
1229
+ profile?: string | null | undefined;
1230
+ timeout_ms?: number | null | undefined;
1231
+ };
1232
+ shell: {
1233
+ root_path: string;
1234
+ workspace_manifest_path: string | null;
1235
+ preserved_shell_manifest_path: string | null;
1236
+ replay_ready: boolean;
1237
+ retention_reason: string | null;
1238
+ };
1239
+ logs: {
1240
+ prompt_path: string | null;
1241
+ event_stream_path: string | null;
1242
+ status_path: string | null;
1243
+ };
1244
+ runtime_files: {
1245
+ project_path: string | null;
1246
+ contract_path: string | null;
1247
+ paths_path: string | null;
1248
+ source_locator_path: string | null;
1249
+ source_manifest_path: string | null;
1250
+ source_state_path: string | null;
1251
+ stage_inputs_path: string | null;
1252
+ expected_inputs_path: string | null;
1253
+ reviewed_inputs_path: string | null;
1254
+ previous_attempts_path: string | null;
1255
+ retry_feedback_path: string | null;
1256
+ last_validation_failure_path: string | null;
1257
+ verifier_path: string | null;
1258
+ stage_evidence_path: string | null;
1259
+ reasoning_path: string | null;
1260
+ };
1261
+ artifacts: {
1262
+ reads: {
1263
+ artifact_id: string;
1264
+ artifact_path: string;
1265
+ shell_root_path: string;
1266
+ input_mount_path: string | null;
1267
+ output_mount_path: string | null;
1268
+ }[];
1269
+ writes: {
1270
+ artifact_id: string;
1271
+ artifact_path: string;
1272
+ shell_root_path: string;
1273
+ input_mount_path: string | null;
1274
+ output_mount_path: string | null;
1275
+ }[];
1276
+ };
1277
+ validation_attempts: {
1278
+ attempt: number;
1279
+ recorded_at: string;
1280
+ status: "failed" | "succeeded";
1281
+ summary: string;
1282
+ }[];
1283
+ summary: string | null;
1284
+ error: string | null;
1285
+ }[];
1286
+ graph_id?: string | undefined;
1287
+ project_id?: string | undefined;
1288
+ build_run_id?: string | null | undefined;
1289
+ source_manifest_id?: string | null | undefined;
1290
+ created_at?: string | undefined;
1291
+ is_latest?: boolean | undefined;
1292
+ build_plan?: string | null | undefined;
1293
+ latest_build_run_id?: string | null | undefined;
1294
+ latest_benchmark_run_id?: string | null | undefined;
1295
+ entrypoint_artifact?: {
1296
+ label: string;
1297
+ locator: {
1298
+ kind: "local-path" | "remote-url" | "api-served";
1299
+ value: string;
1300
+ };
1301
+ role: "entrypoint" | "artifact" | "guidance" | "source-index";
1302
+ artifact_id?: string | undefined;
1303
+ path?: string | undefined;
1304
+ artifact_kind?: "file" | "directory" | undefined;
1305
+ summary?: string | undefined;
1306
+ } | null | undefined;
1307
+ portable_handoff?: {
1308
+ locator: {
1309
+ kind: "local-path" | "remote-url" | "api-served";
1310
+ value: string;
1311
+ };
1312
+ instructions?: string | undefined;
1313
+ } | null | undefined;
1314
+ build_evidence?: {
1315
+ kind: "interf-build-evidence";
1316
+ version: 1;
1317
+ generated_at: string;
1318
+ project_id: string;
1319
+ build_run_id: string | null;
1320
+ ready: boolean;
1321
+ summary: string;
1322
+ rows: {
1323
+ id: string;
1324
+ assertion: string;
1325
+ metric: {
1326
+ observed: number;
1327
+ total?: number | undefined;
1328
+ unit?: string | undefined;
1329
+ };
1330
+ evidence: {
1331
+ kind: "output" | "source-inventory" | "stage-record" | "validator" | "trace" | "stage-evidence";
1332
+ label: string;
1333
+ ref?: string | undefined;
1334
+ path?: string | undefined;
1335
+ run_id?: string | undefined;
1336
+ stage_id?: string | undefined;
1337
+ artifact_id?: string | undefined;
1338
+ };
1339
+ issue_state?: "pass" | "fail" | "missing" | "review" | undefined;
1340
+ issue?: string | undefined;
1341
+ }[];
1342
+ } | undefined;
1343
+ semantic_graph?: {
1344
+ kind: "interf-context-graph-semantic-graph";
1345
+ version: 1;
1346
+ generated_at: string;
1347
+ nodes: {
1348
+ id: string;
1349
+ kind: "source" | "index" | "summary" | "project" | "knowledge" | "artifact" | "note" | "home" | "claim" | "entity";
1350
+ label: string;
1351
+ source_refs: string[];
1352
+ link_count: number;
1353
+ backlink_count: number;
1354
+ path?: string | null | undefined;
1355
+ summary?: string | null | undefined;
1356
+ }[];
1357
+ edges: {
1358
+ id: string;
1359
+ kind: "links-to" | "source-ref" | "contains" | "handoff";
1360
+ source: string;
1361
+ target: string;
1362
+ label: string;
1363
+ detail: string;
1364
+ }[];
1365
+ stats: {
1366
+ notes: number;
1367
+ links: number;
1368
+ source_refs: number;
1369
+ unresolved_links: number;
1370
+ };
1371
+ } | undefined;
1372
+ graph_manifest?: {
1373
+ kind: "interf-graph-manifest";
1374
+ version: 1;
1375
+ generated_at: string;
1376
+ project: string;
1377
+ graph_id: string;
1378
+ run_id: string | null;
1379
+ build_plan: string;
1380
+ intent: string | null;
1381
+ graph_path: string;
1382
+ primary_metrics: {
1383
+ key: string;
1384
+ label: string;
1385
+ value: number;
1386
+ primary: boolean;
1387
+ total?: number | undefined;
1388
+ unit?: string | undefined;
1389
+ issue_state?: "pass" | "fail" | "missing" | "review" | undefined;
1390
+ detail?: string | undefined;
1391
+ metadata?: Record<string, unknown> | undefined;
1392
+ }[];
1393
+ stages: {
1394
+ stage_id: string;
1395
+ stage_label: string;
1396
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1397
+ manifest_path: string;
1398
+ summary: string;
1399
+ produced_total: number;
1400
+ missing_required_total: number;
1401
+ metrics: {
1402
+ key: string;
1403
+ label: string;
1404
+ value: number;
1405
+ primary: boolean;
1406
+ total?: number | undefined;
1407
+ unit?: string | undefined;
1408
+ issue_state?: "pass" | "fail" | "missing" | "review" | undefined;
1409
+ detail?: string | undefined;
1410
+ metadata?: Record<string, unknown> | undefined;
1411
+ }[];
1412
+ }[];
1413
+ entrypoints: {
1414
+ id: string;
1415
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1416
+ kind: string;
1417
+ label: string;
1418
+ source_refs: string[];
1419
+ links: string[];
1420
+ required: boolean;
1421
+ path?: string | undefined;
1422
+ locator?: string | undefined;
1423
+ stage_id?: string | undefined;
1424
+ metadata?: Record<string, unknown> | undefined;
1425
+ }[];
1426
+ resources: {
1427
+ id: string;
1428
+ role: "source" | "summary" | "other" | "knowledge" | "entrypoint" | "diagnostic";
1429
+ kind: string;
1430
+ label: string;
1431
+ source_refs: string[];
1432
+ links: string[];
1433
+ required: boolean;
1434
+ path?: string | undefined;
1435
+ locator?: string | undefined;
1436
+ stage_id?: string | undefined;
1437
+ metadata?: Record<string, unknown> | undefined;
1438
+ }[];
1439
+ graph_outputs: {
1440
+ nodes: number;
1441
+ edges: number;
1442
+ notes: number;
1443
+ links: number;
1444
+ source_refs: number;
1445
+ claims?: number | undefined;
1446
+ entities?: number | undefined;
1447
+ };
1448
+ readiness: {
1449
+ status: "ready" | "not-ready";
1450
+ ready: boolean;
1451
+ summary: string;
1452
+ missing_required_total: number;
1453
+ missing: {
1454
+ resource_id: string;
1455
+ status: "missing" | "blocked" | "not-relevant";
1456
+ reason: string;
1457
+ }[];
1458
+ context_graph_path?: string | null | undefined;
1459
+ };
1460
+ } | null | undefined;
1461
+ readiness_rollup?: {
1462
+ status: "ready" | "not-ready";
1463
+ ready: boolean;
1464
+ summary: string;
1465
+ missing_required_total: number;
1466
+ missing: {
1467
+ resource_id: string;
1468
+ status: "missing" | "blocked" | "not-relevant";
1469
+ reason: string;
1470
+ }[];
1471
+ context_graph_path?: string | null | undefined;
1472
+ } | null | undefined;
1473
+ } | null>;
1474
+ constructor(options: LocalServiceRuntimeOptions);
1475
+ setBoundPort(port: number): void;
1476
+ /** Set a hook that fires whenever the registered Projects change. */
1477
+ setOnRegistryChanged(handler: (() => void) | null): void;
1478
+ /**
1479
+ * Register a Project with this runtime. Returns the ProjectContext.
1480
+ * Idempotent: re-registering an existing Project updates `lastActivity`.
1481
+ */
1482
+ registerProject(projectDataDir: string): ProjectContext;
1483
+ /**
1484
+ * Remove a project from the runtime. Returns true if a project was
1485
+ * removed.
1486
+ */
1487
+ deregisterProject(projectDataDir: string): boolean;
1488
+ /**
1489
+ * Most recently active project, or the first registered if none has
1490
+ * activity yet. Server code uses this as the fallback when a request
1491
+ * does not specify a project. Throws if none are registered.
1492
+ */
1493
+ defaultProjectDataDir(): string;
1494
+ /** Look up a Project context by rootPath. */
1495
+ getProjectContext(projectDataDir: string): ProjectContext | null;
1496
+ /** All registered Projects, ordered by registration time. */
1497
+ listRegisteredProjects(): ProjectContext[];
1498
+ /** True when no projects are registered. */
1499
+ hasNoProjects(): boolean;
1500
+ /** Number of registered Projects. */
1501
+ registeredProjectCount(): number;
1502
+ /** Increment in-flight run counter. Call when a long-running run starts. */
1503
+ beginActiveRun(): void;
1504
+ /** Decrement in-flight run counter. Pair with `beginActiveRun`. */
1505
+ endActiveRun(): void;
1506
+ /** Sum of in-flight runs across all projects. */
1507
+ activeRuns(): number;
1508
+ beginActiveJobRun(runId: string): void;
1509
+ endActiveJobRun(runId: string): void;
1510
+ /**
1511
+ * Mark the project as recently active. Routes call this on entry so
1512
+ * `idleForSeconds` and the registry graphs stay in sync with the
1513
+ * actual request cadence.
1514
+ */
1515
+ touchProject(projectDataDir: string): void;
1516
+ /** Seconds since the most recent Project activity (0 if active). */
1517
+ idleForSeconds(): number;
1518
+ health(projectDataDir?: string): LocalServiceHealth;
1519
+ listProjects(projectDataDir: string): ProjectResource[];
1520
+ getProject(projectDataDir: string, projectName: string): ProjectResource | null;
1521
+ listProjectReadiness(projectDataDir: string): Readiness[];
1522
+ getProjectReadiness(projectDataDir: string, projectName: string): Readiness | null;
1523
+ listReadiness(projectDataDir: string): Readiness[];
1524
+ getReadiness(projectDataDir: string, projectName: string): Readiness | null;
1525
+ computeProjectReadiness(projectDataDir: string, project: ProjectConfig): Readiness;
1526
+ listSourceFiles(projectDataDir: string, projectName?: string | null): SourceFileResource[];
1527
+ listContextGraphs(projectDataDir: string, projectName?: string | null): ContextGraphResource[];
1528
+ getContextGraph(projectDataDir: string, graphId: string): ContextGraphResource | null;
1529
+ getLatestContextGraph(projectDataDir: string, projectName: string): ContextGraphResource | null;
1530
+ listLatestContextGraphStageSessions(projectDataDir: string, projectName: string): StageExecutionSession[];
1531
+ getContextGraphHandoff(projectDataDir: string, projectName: string): ContextGraphHandoff | null;
1532
+ listBuildPlans(projectDataDir: string): BuildPlanResource[];
1533
+ getBuildPlanResource(projectDataDir: string, buildPlanId: string): BuildPlanResource | null;
1534
+ applyBuildPlanChange(projectDataDir: string, requestValue: unknown): BuildPlanChangeResult;
1535
+ applyReset(projectDataDir: string, requestValue: unknown): ResetResult;
1536
+ resolveProjectConfig(projectDataDir: string, projectName: string, overrides?: Partial<Pick<ProjectConfig, "build_plan">>): ProjectConfig;
1537
+ ensureContextGraphForRun(projectDataDir: string, projectConfig: ProjectConfig, runId: string): string;
1538
+ defaultProjectId(projectDataDir: string): string;
1539
+ getExecutorStatus(): LocalExecutorStatus;
1540
+ selectExecutor(requestValue: unknown): LocalExecutorStatus;
1541
+ getAgentsRegistry(): AgentsRegistryState;
1542
+ registerCustomAgent(input: {
1543
+ name: string;
1544
+ display_name: string;
1545
+ command: string;
1546
+ }): AgentsRegistryState;
1547
+ unregisterCustomAgent(name: string): AgentsRegistryState;
1548
+ patchAgentsRoleMap(patch: Record<string, string>): AgentsRegistryRoleState;
1549
+ setAgentPrefs(name: string, prefs: AgentPrefs): AgentsRegistryState;
1550
+ listActionProposals(projectDataDir: string): ActionProposalResource[];
1551
+ getActionProposal(projectDataDir: string, proposalId: string): ActionProposalResource | null;
1552
+ createActionProposal(projectDataDir: string, requestValue: unknown): Promise<ActionProposalResource>;
1553
+ decideActionProposal(projectDataDir: string, proposalId: string, requestValue: unknown): Promise<ActionProposalResource | null>;
1554
+ listRunObservability(projectDataDir: string): RunObservabilityResource[];
1555
+ getRunObservability(projectDataDir: string, runId: string): RunObservabilityResource | null;
1556
+ listBuildPlanRuns(projectDataDir: string, buildPlanId: string): RunObservabilityResource[];
1557
+ listBuildRuns(projectDataDir: string): BuildRunResource[];
1558
+ listBuildRunsForProject(projectDataDir: string, projectName: string): BuildRun[];
1559
+ getBuildRun(projectDataDir: string, runId: string): BuildRunResource | null;
1560
+ getBuildRunEvents(projectDataDir: string, runId: string): InterfRunEvent[] | null;
1561
+ getBuildRunEvidence(projectDataDir: string, runId: string): EvidenceRecord[] | null;
1562
+ getBuildRunArtifacts(projectDataDir: string, runId: string): ArtifactRef[] | null;
1563
+ createBuildRun(projectDataDir: string, requestValue: unknown): Promise<BuildRunResource>;
1564
+ cancelBuildRun(runId: string): {
1565
+ cancelled: boolean;
1566
+ reason?: string;
1567
+ };
1568
+ findIdempotentBuildRun(projectDataDir: string, key: string): string | null;
1569
+ recordIdempotentBuildRun(projectDataDir: string, key: string, runId: string): void;
1570
+ expireIdempotencyKeyForTesting(projectDataDir: string, key: string): boolean;
1571
+ listVerifyRuns(projectDataDir: string): VerifyRunResource[];
1572
+ listVerifyRunsForProject(projectDataDir: string, projectName: string): VerifyRunResource[];
1573
+ getVerifyRun(projectDataDir: string, runId: string): VerifyRunResource | null;
1574
+ createVerifyRun(projectDataDir: string, requestValue: unknown): Promise<VerifyRunResource>;
1575
+ listJobs(projectDataDir: string): LocalJobRunResource[];
1576
+ getJob(projectDataDir: string, runId: string): LocalJobRunResource | null;
1577
+ getJobEvents(projectDataDir: string, runId: string): LocalJobEvent[] | null;
1578
+ createBenchmarkQuestionDraftRun(projectDataDir: string, requestValue: unknown): Promise<LocalJobRunResource>;
1579
+ createBuildPlanAuthoringRun(projectDataDir: string, requestValue: unknown, jobType?: "build-plan-draft" | "build-plan-improvement"): Promise<LocalJobRunResource>;
1580
+ }
1581
+ export declare function createLocalServiceRuntime(options: LocalServiceRuntimeOptions): LocalServiceRuntime;
1582
+ export type { AgentPrefs, AgentRecord, RoleMap };