@interf/compiler 0.13.0 → 0.16.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 (292) hide show
  1. package/README.md +40 -0
  2. package/agent-skills/interf-actions/SKILL.md +51 -5
  3. package/agent-skills/interf-actions/references/cli.md +82 -82
  4. package/dist/cli/commands/agents.d.ts +2 -0
  5. package/dist/cli/commands/agents.js +213 -0
  6. package/dist/cli/commands/compile.js +10 -1
  7. package/dist/cli/commands/doctor.js +1 -1
  8. package/dist/cli/commands/login.js +1 -1
  9. package/dist/cli/commands/logout.js +1 -1
  10. package/dist/cli/commands/mcp.d.ts +42 -0
  11. package/dist/cli/commands/mcp.js +239 -0
  12. package/dist/cli/commands/method.js +1 -1
  13. package/dist/cli/commands/prep.js +23 -5
  14. package/dist/cli/commands/reset.js +1 -1
  15. package/dist/cli/commands/runs.js +1 -1
  16. package/dist/cli/commands/status.js +1 -1
  17. package/dist/cli/commands/verify.d.ts +8 -0
  18. package/dist/cli/commands/{test.js → verify.js} +24 -18
  19. package/dist/cli/commands/web.js +71 -18
  20. package/dist/cli/commands/wizard.js +373 -126
  21. package/dist/cli/index.d.ts +4 -2
  22. package/dist/cli/index.js +7 -3
  23. package/dist/compiler-ui/404.html +1 -1
  24. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  25. package/dist/compiler-ui/__next._full.txt +3 -3
  26. package/dist/compiler-ui/__next._head.txt +1 -1
  27. package/dist/compiler-ui/__next._index.txt +2 -2
  28. package/dist/compiler-ui/__next._tree.txt +2 -2
  29. package/dist/compiler-ui/_next/static/chunks/{17t-lulmyawg5.js → 0jipmpez3_ehh.js} +16 -16
  30. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 13awzu4tooflw.css} +1 -1
  31. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  32. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  33. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  34. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  35. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  36. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  37. package/dist/compiler-ui/_not-found.html +1 -1
  38. package/dist/compiler-ui/_not-found.txt +2 -2
  39. package/dist/compiler-ui/index.html +1 -1
  40. package/dist/compiler-ui/index.txt +3 -3
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +2 -2
  43. package/dist/packages/contracts/index.d.ts +2 -1
  44. package/dist/packages/contracts/index.js +1 -0
  45. package/dist/packages/contracts/lib/schema.d.ts +102 -8
  46. package/dist/packages/contracts/lib/schema.js +102 -2
  47. package/dist/packages/{local-service → engine}/action-definitions.js +8 -1
  48. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  49. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  50. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  51. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  52. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  53. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  54. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  55. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  56. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +4 -4
  57. package/dist/packages/{agents → engine/agents}/lib/shells.js +8 -8
  58. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  59. package/dist/packages/engine/agents/registry.d.ts +91 -0
  60. package/dist/packages/engine/agents/registry.js +321 -0
  61. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  62. package/dist/packages/engine/agents/role-executors.js +88 -0
  63. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  64. package/dist/packages/engine/agents/role-router.js +73 -0
  65. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  66. package/dist/packages/{local-service → engine}/client.js +11 -11
  67. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
  68. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  69. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  70. package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
  71. package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
  72. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
  73. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +4 -4
  74. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  75. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
  76. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  77. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  78. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  79. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +4 -4
  80. package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -2
  81. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  82. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  83. package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
  84. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  85. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
  86. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  87. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
  88. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
  89. package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
  90. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
  91. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  92. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  93. package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
  94. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  95. package/dist/packages/{compiler → engine/compile}/state-view.js +2 -2
  96. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
  97. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  98. package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
  99. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +2 -22
  100. package/dist/packages/{execution → engine/execution}/lib/schema.js +2 -2
  101. package/dist/packages/{local-service → engine}/index.d.ts +4 -4
  102. package/dist/packages/{local-service → engine}/index.js +2 -2
  103. package/dist/packages/{local-service → engine}/lib/schema.d.ts +85 -209
  104. package/dist/packages/{local-service → engine}/lib/schema.js +58 -54
  105. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  106. package/dist/packages/{local-service → engine}/native-run-handlers.js +69 -25
  107. package/dist/packages/{local-service → engine}/preparation-store.d.ts +16 -4
  108. package/dist/packages/{local-service → engine}/preparation-store.js +48 -25
  109. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  110. package/dist/packages/{local-service → engine}/routes.d.ts +30 -1
  111. package/dist/packages/{local-service → engine}/routes.js +32 -1
  112. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  113. package/dist/packages/{local-service → engine}/run-observability.js +14 -13
  114. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  115. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  116. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  117. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  118. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  119. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +6 -6
  120. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +1 -1
  121. package/dist/packages/{local-service → engine}/runtime.d.ts +80 -49
  122. package/dist/packages/{local-service → engine}/runtime.js +177 -179
  123. package/dist/packages/{local-service → engine}/server.js +276 -14
  124. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  125. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  126. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +6 -13
  127. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +25 -81
  128. package/dist/packages/{testing → engine/verify}/test-paths.js +2 -2
  129. package/dist/packages/{testing → engine/verify}/test-sandbox.js +6 -6
  130. package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
  131. package/dist/packages/{testing → engine/verify}/test-targets.js +3 -3
  132. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +11 -3
  133. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +68 -5
  134. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  135. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  136. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +15 -9
  137. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +1 -1
  138. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +2 -2
  139. package/dist/packages/{method-package → methods/package}/context-interface.d.ts +1 -1
  140. package/dist/packages/{method-package → methods/package}/context-interface.js +3 -3
  141. package/dist/packages/{method-package → methods/package}/interf-method-package.js +3 -2
  142. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  143. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +8 -2
  144. package/dist/packages/{method-package → methods/package}/local-methods.js +8 -7
  145. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +8 -2
  146. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -4
  147. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -1
  148. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -4
  149. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  150. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  151. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  152. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  153. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  154. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  155. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  156. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  157. package/dist/packages/{project-model → project}/interf-scaffold.js +7 -7
  158. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  159. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  160. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  161. package/dist/packages/{project-model → project}/source-config.js +7 -7
  162. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  163. package/package.json +6 -5
  164. package/dist/cli/commands/test.d.ts +0 -9
  165. package/dist/packages/agents/lib/detection.d.ts +0 -7
  166. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
  167. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
  168. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
  169. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  170. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  171. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  172. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  173. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  174. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  175. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  176. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  177. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  178. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  179. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  180. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  181. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  182. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  183. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  184. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  185. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  186. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  187. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  188. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  189. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  190. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  191. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  192. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  193. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  194. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  195. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  196. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  197. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  198. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  199. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  200. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  201. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  202. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  203. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  204. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  205. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  206. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  207. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  208. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  209. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  210. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  211. /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
  212. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  213. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  214. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  215. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  216. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  217. /package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -0
  218. /package/dist/packages/{compiler → engine/compile}/index.js +0 -0
  219. /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
  220. /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
  221. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  222. /package/dist/packages/{compiler → engine/compile}/reset.js +0 -0
  223. /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
  224. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  225. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -0
  226. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  227. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  228. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  229. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  230. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  231. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +0 -0
  232. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  233. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  234. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  235. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  236. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  237. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  238. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  239. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  240. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  241. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  242. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  243. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  244. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  245. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  246. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  247. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  248. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  249. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  250. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  251. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  252. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  253. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  254. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  255. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  256. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  257. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  258. /package/dist/packages/{local-service → engine}/runtime-event-applier.js +0 -0
  259. /package/dist/packages/{local-service → engine}/server.d.ts +0 -0
  260. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  261. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  262. /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
  263. /package/dist/packages/{testing → engine/verify}/index.js +0 -0
  264. /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
  265. /package/dist/packages/{testing → engine/verify}/test-execution.js +0 -0
  266. /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
  267. /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
  268. /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
  269. /package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -0
  270. /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
  271. /package/dist/packages/{testing → engine/verify}/test-targets.d.ts +0 -0
  272. /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
  273. /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
  274. /package/dist/packages/{testing → engine/verify}/test.d.ts +0 -0
  275. /package/dist/packages/{testing → engine/verify}/test.js +0 -0
  276. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  277. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  278. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  279. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  280. /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
  281. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  282. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  283. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  284. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  285. /package/dist/packages/{project-model → project}/index.js +0 -0
  286. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  287. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  288. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  289. /package/dist/packages/{project-model → project}/interf.js +0 -0
  290. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  291. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  292. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -1,33 +1,34 @@
1
1
  import { existsSync, mkdirSync, rmSync, statSync, } from "node:fs";
2
2
  import { join, resolve } from "node:path";
3
- import { CompileRunSchema, } from "../execution/lib/schema.js";
4
- import { createRunEventId, createRunEventTimestamp, } from "../execution/events.js";
5
- import { loadState, } from "../compiler/state.js";
6
- import { actionProposalPath, actionProposalsRoot, byCreatedAtDesc, compileRunPath, compileRunsRoot, listJsonFiles, localJobPath, localJobsRoot, newestFirst, readActionProposalAt, readCompileRunAt, readLocalJobRunAt, readRuntimeRunHistory, readTestRunAt, testRunPath, testRunsRoot, timestampKey, writeJsonFile, } from "./runtime-persistence.js";
3
+ import { CompileRunSchema, } from "./execution/lib/schema.js";
4
+ import { createRunEventId, createRunEventTimestamp, } from "./execution/events.js";
5
+ import { loadState, } from "./compile/state.js";
6
+ import { actionProposalPath, actionProposalsRoot, byCreatedAtDesc, compileRunPath, compileRunsRoot, listJsonFiles, localJobPath, localJobsRoot, newestFirst, readActionProposalAt, readCompileRunAt, readLocalJobRunAt, readRuntimeRunHistory, readVerifyRunAt, verifyRunPath, verifyRunsRoot, timestampKey, writeJsonFile, } from "./runtime-persistence.js";
7
7
  import { MethodListingCache, MtimeListingCache, ReadinessCache, RunListingCache, } from "./runtime-caches.js";
8
8
  import { applyEventToCompileRun, applyEventToLocalJob, } from "./runtime-event-applier.js";
9
9
  import { buildMethodResource, buildPreparationResource, createRunId, logsForRuntimeRun, logsForStageRun, proofForStage, readinessStateToPreparationReadiness, readinessSummaryForStatus, readinessTargetResult, stageArtifactRefs, } from "./runtime-resource-builders.js";
10
- import { ACTION_PLANNER_CLARIFICATION_MESSAGE, actionAssistantMessage, actionCommandPreview, actionTypeFromValues, actionValueMethodTaskPrompt, configuredAgentName, createActionProposalId, detachMethodFromPreparation, detectedExecutorOptions, directServiceEndpointForAction, hasCompiledTestTarget, methodAuthoringHintFromPrompt, methodAuthoringPromptFallback, methodIdForProposal, methodLabelFromId, numberValue, requireSelectedMethod, sanitizeActionProposalPlan, stringValue, testModeFromValues, testModeValue, } from "./runtime-proposal-helpers.js";
10
+ import { ACTION_PLANNER_CLARIFICATION_MESSAGE, actionAssistantMessage, actionCommandPreview, actionTypeFromValues, actionValueMethodTaskPrompt, configuredAgentName, createActionProposalId, detachMethodFromPreparation, detectedExecutorOptions, directServiceEndpointForAction, hasCompiledTestTarget, methodAuthoringHintFromPrompt, methodAuthoringPromptFallback, methodIdForProposal, methodLabelFromId, numberValue, requireSelectedMethod, sanitizeActionProposalPlan, stringValue, testModeFromValues, } from "./runtime-proposal-helpers.js";
11
11
  import { ReadinessStateSchema, } from "../contracts/lib/schema.js";
12
- import { discoverSourceFiles, } from "../compiler/discovery.js";
13
- import { resetCompiledGeneratedState, } from "../compiler/reset.js";
14
- import { ensurePortableContextScaffold, readInterfConfig, } from "../project-model/interf.js";
15
- import { findSourcePreparationConfig, fingerprintReadinessChecks, listSourcePreparationConfigs, loadSourceFolderConfig, DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, resolveConfiguredSourceFolderPath, resolveSourcePreparationPath, removeSourcePreparationConfig, saveSourceFolderConfig, syncCompiledInterfConfigFromSourcePreparationConfig, upsertSourcePreparationConfig, } from "../project-model/source-config.js";
16
- import { listSourceFolderChoices, } from "../project-model/source-folders.js";
12
+ import { discoverSourceFiles, } from "./compile/discovery.js";
13
+ import { resetCompiledGeneratedState, } from "./compile/reset.js";
14
+ import { ensurePortableContextScaffold, readInterfConfig, } from "../project/interf.js";
15
+ import { findSourcePreparationConfig, fingerprintReadinessChecks, listSourcePreparationConfigs, loadSourceFolderConfig, DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, resolveConfiguredSourceFolderPath, resolveSourcePreparationPath, removeSourcePreparationConfig, saveSourceFolderConfig, syncCompiledInterfConfigFromSourcePreparationConfig, upsertSourcePreparationConfig, } from "../project/source-config.js";
16
+ import { listSourceFolderChoices, } from "../project/source-folders.js";
17
17
  import { asPreparationDataDir, preparationPortableContextPath, userMethodsRoot, preparationConfigPath, preparationMethodPackagePath, preparationMethodsRoot, } from "../contracts/lib/preparation-paths.js";
18
- import { getCompiledMethod, listCompiledMethodChoices, } from "../method-package/method-definitions.js";
19
- import { contextInterfaceArtifactPath, } from "../method-package/context-interface.js";
20
- import { methodDefinitionPath, resolveMethodPackageSourcePath, seedLocalDefaultMethod, } from "../method-package/local-methods.js";
21
- import { seedLocalMethodPackageFromBase, } from "../method-package/interf-method-package.js";
22
- import { PACKAGE_ROOT } from "../method-package/lib/package-root.js";
23
- import { resolveAgent, detectAgents, supportsAutomatedRuns, } from "../agents/lib/detection.js";
24
- import { loadUserConfig, saveUserConfig, } from "../agents/lib/user-config.js";
25
- import { readSavedReadinessCheckRun, } from "../testing/readiness-check-run.js";
26
- import { createCompiledTestTarget, } from "../testing/test-targets.js";
27
- import { ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalPlanSchema, ActionProposalResourceSchema, ActionProposalTypeSchema, CompileRunCreateRequestSchema, CompileRunResourceSchema, LocalExecutorStatusSchema, LocalExecutorSelectRequestSchema, LocalServiceHealthSchema, LocalRunHandlerResultSchema, LocalJobEventAppendRequestSchema, LocalJobRunCreateRequestSchema, LocalJobRunResourceSchema, SourceFileResourceSchema, WorkspaceFileResourceSchema, PortableContextResourceSchema, PreparationSetupCreateRequestSchema, PreparationSetupResultSchema, WorkspaceBootstrapCreateRequestSchema, WorkspaceBootstrapResultSchema, MethodChangeCreateRequestSchema, MethodChangeResultSchema, PreparationChangeCreateRequestSchema, PreparationChangeResultSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, ServiceRegistryWorkspaceSchema, TestRunCreateRequestSchema, TestRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
18
+ import { getCompiledMethod, listCompiledMethodChoices, } from "../methods/package/method-definitions.js";
19
+ import { contextInterfaceArtifactPath, } from "../methods/package/context-interface.js";
20
+ import { methodDefinitionPath, resolveMethodPackageSourcePath, } from "../methods/package/local-methods.js";
21
+ import { seedLocalMethodPackageFromBase, } from "../methods/package/interf-method-package.js";
22
+ import { PACKAGE_ROOT } from "../methods/package/lib/package-root.js";
23
+ import { resolveAgent, detectAgents, supportsAutomatedRuns, } from "./agents/lib/detection.js";
24
+ import { loadUserConfig, saveUserConfig, } from "./agents/lib/user-config.js";
25
+ import { loadAgentsRegistry, registerCustomAgent, unregisterCustomAgent, patchRoleMap, setActiveAgent, } from "./agents/registry.js";
26
+ import { readSavedReadinessCheckRun, } from "./verify/readiness-check-run.js";
27
+ import { createCompiledTestTarget, } from "./verify/test-targets.js";
28
+ import { ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalPlanSchema, ActionProposalResourceSchema, ActionProposalTypeSchema, CompileRunCreateRequestSchema, CompileRunResourceSchema, LocalExecutorStatusSchema, LocalExecutorSelectRequestSchema, LocalServiceHealthSchema, LocalRunHandlerResultSchema, LocalJobEventAppendRequestSchema, LocalJobRunCreateRequestSchema, LocalJobRunResourceSchema, SourceFileResourceSchema, WorkspaceFileResourceSchema, PortableContextResourceSchema, PreparationSetupCreateRequestSchema, PreparationSetupResultSchema, MethodChangeCreateRequestSchema, MethodChangeResultSchema, PreparationChangeCreateRequestSchema, PreparationChangeResultSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, ServiceRegistryWorkspaceSchema, VerifyRunCreateRequestSchema, VerifyRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
28
29
  import { buildLocalServiceUrl, } from "./routes.js";
29
30
  import { MethodAuthoringActionValuesSchema, PreparationSetupActionValuesSchema, } from "./action-values.js";
30
- import { compileRunToObservability, jobRunToObservability, testRunToObservability, uniqueArtifacts, } from "./run-observability.js";
31
+ import { compileRunToObservability, jobRunToObservability, verifyRunToObservability, uniqueArtifacts, } from "./run-observability.js";
31
32
  /** TTL for `POST /v1/compile-runs` idempotency-key dedupe entries. */
32
33
  const IDEMPOTENCY_TTL_MS = 60 * 60 * 1000;
33
34
  /** Idempotency cache size at which to schedule an opportunistic prune. */
@@ -51,10 +52,10 @@ export class LocalServiceRuntime {
51
52
  */
52
53
  authToken;
53
54
  /** Map of prepDataDir -> PreparationContext. */
54
- workspaces = new Map();
55
- /** Hook called whenever a workspace is registered or deregistered. */
55
+ preparationContexts = new Map();
56
+ /** Hook called whenever a preparation is registered or deregistered. */
56
57
  onRegistryChanged = null;
57
- /** In-flight runs across all workspaces. Used for `idle_for_seconds`. */
58
+ /** In-flight runs across all preparations. Used for `idle_for_seconds`. */
58
59
  activeRunCount = 0;
59
60
  /**
60
61
  * Active compile-run cancellation handles, keyed by run id. Populated
@@ -65,10 +66,10 @@ export class LocalServiceRuntime {
65
66
  activeCompileRuns = new Map();
66
67
  /**
67
68
  * Idempotency-key cache for `POST /v1/compile-runs`. Outer key is the
68
- * resolved workspace root; inner key is the client-supplied idempotency
69
- * value. Namespacing per workspace prevents key collisions across
70
- * tenants on the same engine (CSO finding: a malicious workspace could
71
- * otherwise hijack another workspace's run id by reusing its key).
69
+ * resolved preparation root; inner key is the client-supplied idempotency
70
+ * value. Namespacing per preparation prevents key collisions across
71
+ * tenants on the same engine (CSO finding: a malicious preparation could
72
+ * otherwise hijack another preparation's run id by reusing its key).
72
73
  * Entries expire after `IDEMPOTENCY_TTL_MS`.
73
74
  */
74
75
  idempotencyKeyCache = new Map();
@@ -80,7 +81,7 @@ export class LocalServiceRuntime {
80
81
  * matching write path. See {@link runtime-caches} for design notes.
81
82
  */
82
83
  compileRunCache = new RunListingCache();
83
- testRunCache = new RunListingCache();
84
+ verifyRunCache = new RunListingCache();
84
85
  readinessCache = new ReadinessCache();
85
86
  sourceFilesCache = new MtimeListingCache();
86
87
  methodListingCache = new MethodListingCache();
@@ -92,7 +93,7 @@ export class LocalServiceRuntime {
92
93
  this.handlers = options.handlers ?? {};
93
94
  this.authToken = options.authToken ?? null;
94
95
  this.rootPath = resolve(options.rootPath);
95
- // Auto-register the initial workspace so single-workspace callers
96
+ // Auto-register the initial preparation so single-preparation callers
96
97
  // (existing tests, the current `interf web` command) work without
97
98
  // additional bootstrapping. The constructor seed is the only role
98
99
  // `options.rootPath` plays; runtime methods take `prepDataDir`
@@ -102,18 +103,18 @@ export class LocalServiceRuntime {
102
103
  setBoundPort(port) {
103
104
  this.port = port;
104
105
  }
105
- /** Set a hook that fires whenever the registered workspaces change. */
106
+ /** Set a hook that fires whenever the registered preparations change. */
106
107
  setOnRegistryChanged(handler) {
107
108
  this.onRegistryChanged = handler;
108
109
  }
109
110
  /**
110
- * Register a workspace with this runtime. Returns the PreparationContext.
111
- * Idempotent: re-registering an existing workspace updates `lastActivity`.
111
+ * Register a preparation with this runtime. Returns the PreparationContext.
112
+ * Idempotent: re-registering an existing preparation updates `lastActivity`.
112
113
  */
113
114
  registerPreparation(prepDataDir) {
114
115
  const resolved = resolve(prepDataDir);
115
116
  const now = new Date().toISOString();
116
- const existing = this.workspaces.get(resolved);
117
+ const existing = this.preparationContexts.get(resolved);
117
118
  if (existing) {
118
119
  existing.lastActivity = now;
119
120
  this.onRegistryChanged?.();
@@ -124,57 +125,57 @@ export class LocalServiceRuntime {
124
125
  startedAt: now,
125
126
  lastActivity: now,
126
127
  };
127
- this.workspaces.set(resolved, context);
128
+ this.preparationContexts.set(resolved, context);
128
129
  this.onRegistryChanged?.();
129
130
  return context;
130
131
  }
131
132
  /**
132
- * Remove a workspace from the runtime. Returns true if a workspace was
133
+ * Remove a preparation from the runtime. Returns true if a preparation was
133
134
  * removed.
134
135
  */
135
136
  deregisterPreparation(prepDataDir) {
136
137
  const resolved = resolve(prepDataDir);
137
- const removed = this.workspaces.delete(resolved);
138
+ const removed = this.preparationContexts.delete(resolved);
138
139
  if (removed) {
139
140
  this.onRegistryChanged?.();
140
141
  }
141
142
  return removed;
142
143
  }
143
144
  /**
144
- * Most recently active workspace, or the first registered if none has
145
+ * Most recently active preparation, or the first registered if none has
145
146
  * activity yet. Server code uses this as the fallback when a request
146
- * omits the workspace header. Throws if no workspace is registered.
147
+ * does not specify a preparation. Throws if none are registered.
147
148
  */
148
149
  defaultPreparationDataDir() {
149
- if (this.workspaces.size === 0) {
150
- throw new Error("Local service has no registered workspaces.");
150
+ if (this.preparationContexts.size === 0) {
151
+ throw new Error("Local service has no registered preparations.");
151
152
  }
152
153
  let best = null;
153
154
  let bestKey = -Infinity;
154
- for (const context of this.workspaces.values()) {
155
+ for (const context of this.preparationContexts.values()) {
155
156
  const key = Date.parse(context.lastActivity);
156
157
  if (Number.isFinite(key) && key > bestKey) {
157
158
  best = context;
158
159
  bestKey = key;
159
160
  }
160
161
  }
161
- return (best ?? this.workspaces.values().next().value).rootPath;
162
+ return (best ?? this.preparationContexts.values().next().value).rootPath;
162
163
  }
163
- /** Look up a workspace context by rootPath. */
164
+ /** Look up a preparation context by rootPath. */
164
165
  getPreparationContext(prepDataDir) {
165
- return this.workspaces.get(resolve(prepDataDir)) ?? null;
166
+ return this.preparationContexts.get(resolve(prepDataDir)) ?? null;
166
167
  }
167
- /** All registered workspaces, ordered by registration time. */
168
+ /** All registered preparations, ordered by registration time. */
168
169
  listRegisteredPreparations() {
169
- return Array.from(this.workspaces.values()).sort((left, right) => Date.parse(left.startedAt) - Date.parse(right.startedAt));
170
+ return Array.from(this.preparationContexts.values()).sort((left, right) => Date.parse(left.startedAt) - Date.parse(right.startedAt));
170
171
  }
171
- /** True when no workspaces are registered. */
172
- hasNoWorkspaces() {
173
- return this.workspaces.size === 0;
172
+ /** True when no preparations are registered. */
173
+ hasNoPreparations() {
174
+ return this.preparationContexts.size === 0;
174
175
  }
175
- /** Number of registered workspaces. */
176
+ /** Number of registered preparations. */
176
177
  registeredPreparationCount() {
177
- return this.workspaces.size;
178
+ return this.preparationContexts.size;
178
179
  }
179
180
  /** Increment in-flight run counter. Call when a long-running run starts. */
180
181
  beginActiveRun() {
@@ -185,22 +186,28 @@ export class LocalServiceRuntime {
185
186
  if (this.activeRunCount > 0)
186
187
  this.activeRunCount -= 1;
187
188
  }
188
- /** Sum of in-flight runs across all workspaces. */
189
+ /** Sum of in-flight runs across all preparations. */
189
190
  activeRuns() {
190
191
  return this.activeRunCount;
191
192
  }
192
193
  /**
193
- * Mark the workspace as recently active. Routes call this on entry so
194
+ * Mark the preparation as recently active. Routes call this on entry so
194
195
  * `idleForSeconds` and the registry snapshots stay in sync with the
195
196
  * actual request cadence.
196
197
  */
197
198
  touchPreparation(prepDataDir) {
198
- const context = this.workspaces.get(resolve(prepDataDir));
199
+ const context = this.preparationContexts.get(resolve(prepDataDir));
199
200
  if (context) {
200
201
  context.lastActivity = new Date().toISOString();
201
202
  }
202
203
  }
203
- /** Snapshot of registered workspaces for the registry / status output. */
204
+ /**
205
+ * Snapshot of registered preparations for the registry / status output.
206
+ * Wire shape (`ServiceRegistryWorkspace`) keeps the legacy
207
+ * "workspace" name for backward compatibility with the public health
208
+ * response and `~/.interf/services.json`. Synthetic-workspace bridge
209
+ * code; do not rename without coordinating an API break.
210
+ */
204
211
  registeredPreparationSnapshots() {
205
212
  return this.listRegisteredPreparations().map((context) => ServiceRegistryWorkspaceSchema.parse({
206
213
  control_path: context.rootPath,
@@ -208,7 +215,7 @@ export class LocalServiceRuntime {
208
215
  last_activity: context.lastActivity,
209
216
  }));
210
217
  }
211
- /** Seconds since the most recent workspace activity (0 if active). */
218
+ /** Seconds since the most recent preparation activity (0 if active). */
212
219
  idleForSeconds() {
213
220
  const all = this.listRegisteredPreparations();
214
221
  if (all.length === 0)
@@ -249,9 +256,9 @@ export class LocalServiceRuntime {
249
256
  const config = loadSourceFolderConfig(prepDataDir);
250
257
  return listSourcePreparationConfigs(config).map((preparation) => {
251
258
  const compileRuns = this.listCompileRunsForPreparation(prepDataDir, preparation.name);
252
- const testRuns = this.listTestRunsForPreparation(prepDataDir, preparation.name);
259
+ const verifyRuns = this.listVerifyRunsForPreparation(prepDataDir, preparation.name);
253
260
  const readiness = this.computePreparationReadiness(prepDataDir, preparation);
254
- return buildPreparationResource(prepDataDir, preparation, readiness, compileRuns[0]?.run_id ?? null, testRuns[0]?.run_id ?? null);
261
+ return buildPreparationResource(prepDataDir, preparation, readiness, compileRuns[0]?.run_id ?? null, verifyRuns[0]?.run_id ?? null);
255
262
  });
256
263
  }
257
264
  getPreparation(prepDataDir, preparationName) {
@@ -282,7 +289,7 @@ export class LocalServiceRuntime {
282
289
  const compiledTarget = createCompiledTestTarget(compiledPath, preparation.name, methodIdForSourcePreparationConfig(preparation) ?? DEFAULT_METHOD_ID);
283
290
  const contextReady = compiledTarget.eligible;
284
291
  const compileRun = this.listCompileRunsForPreparation(prepDataDir, preparation.name)[0] ?? null;
285
- const testRun = this.listTestRunsForPreparation(prepDataDir, preparation.name)[0] ?? null;
292
+ const verifyRun = this.listVerifyRunsForPreparation(prepDataDir, preparation.name)[0] ?? null;
286
293
  const readinessRun = this.readLatestReadinessRun(prepDataDir, preparation.name);
287
294
  const configuredChecks = preparation.checks.length;
288
295
  const currentFingerprint = configuredChecks > 0 ? fingerprintReadinessChecks(preparation.checks) : null;
@@ -369,7 +376,7 @@ export class LocalServiceRuntime {
369
376
  const status = (() => {
370
377
  if (compileRun?.status === "queued" || compileRun?.status === "running")
371
378
  return "building";
372
- if (testRun?.status === "queued" || testRun?.status === "running")
379
+ if (verifyRun?.status === "queued" || verifyRun?.status === "running")
373
380
  return "checking";
374
381
  if (compileRun?.status === "failed" || compileRun?.status === "cancelled")
375
382
  return "failed";
@@ -394,7 +401,7 @@ export class LocalServiceRuntime {
394
401
  summary: readinessSummaryForStatus(status),
395
402
  portable_context_path: contextReady ? compiledPath : null,
396
403
  latest_compile_run_id: compileRun?.run_id ?? null,
397
- latest_test_run_id: testRun?.run_id ?? null,
404
+ latest_test_run_id: verifyRun?.run_id ?? null,
398
405
  compile: compileCheck,
399
406
  check_results: {
400
407
  configured: configuredChecks,
@@ -406,10 +413,16 @@ export class LocalServiceRuntime {
406
413
  });
407
414
  }
408
415
  listSourceFiles(prepDataDir, preparationName) {
409
- const preparations = listSourcePreparationConfigs(loadSourceFolderConfig(prepDataDir))
416
+ const config = loadSourceFolderConfig(prepDataDir);
417
+ const preparations = listSourcePreparationConfigs(config)
410
418
  .filter((preparation) => !preparationName || preparation.name === preparationName);
419
+ // 0.13+ source binding: the source folder is the user-supplied
420
+ // absolute path on `source_folder.path`. `preparation.path` is the
421
+ // portable-context name inside `prepDataDir` (legacy field; in the
422
+ // synthetic-workspace bridge it equals `preparation.name`). Walk
423
+ // the actual source bytes, not the portable-context subdir.
424
+ const sourceFolderPath = resolveConfiguredSourceFolderPath(prepDataDir, config) ?? prepDataDir;
411
425
  return preparations.flatMap((preparation) => {
412
- const sourceFolderPath = resolveSourcePreparationPath(prepDataDir, preparation);
413
426
  const compiledPath = preparationPortableContextPath(asPreparationDataDir(prepDataDir), preparation.name);
414
427
  // Cache by source-folder root mtime so identical UI polls do not
415
428
  // re-walk and re-stat the entire tree. The cache imposes a short
@@ -499,6 +512,7 @@ export class LocalServiceRuntime {
499
512
  description: stage.description,
500
513
  contract_type: stage.contractType,
501
514
  skill_dir: stage.skillDir,
515
+ role: stage.role && stage.role.trim().length > 0 ? stage.role : "general",
502
516
  reads: stage.reads,
503
517
  writes: stage.writes,
504
518
  ...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
@@ -587,8 +601,48 @@ export class LocalServiceRuntime {
587
601
  skillsInstalled: current?.skillsInstalled ?? false,
588
602
  initialized: current?.initialized ?? new Date().toISOString(),
589
603
  });
604
+ // Mirror the selection into the 0.15 role-map. `setActiveAgent`
605
+ // also sweeps any role still pointing at the previous active so
606
+ // single-active-agent setups stay coherent across CLIs.
607
+ try {
608
+ setActiveAgent(selected.name);
609
+ }
610
+ catch {
611
+ // Best effort — the registry update is convenience for the new
612
+ // role-aware path. The user_config.json write above is the
613
+ // source of truth for the legacy `getExecutorStatus()`.
614
+ }
590
615
  return this.getExecutorStatus();
591
616
  }
617
+ // ─── 0.15 connected-agents primitive ─────────────────────────────
618
+ /**
619
+ * Snapshot of the merged agents registry (built-in detected + custom)
620
+ * with the current role-map and resolved active agent.
621
+ */
622
+ getAgentsRegistry() {
623
+ const registry = loadAgentsRegistry();
624
+ return {
625
+ agents: registry.agents,
626
+ role_map: registry.roleMap,
627
+ active_agent: registry.activeAgent,
628
+ };
629
+ }
630
+ registerCustomAgent(input) {
631
+ registerCustomAgent(input);
632
+ return this.getAgentsRegistry();
633
+ }
634
+ unregisterCustomAgent(name) {
635
+ unregisterCustomAgent(name);
636
+ return this.getAgentsRegistry();
637
+ }
638
+ patchAgentsRoleMap(patch) {
639
+ patchRoleMap(patch);
640
+ const registry = loadAgentsRegistry();
641
+ return {
642
+ role_map: registry.roleMap,
643
+ active_agent: registry.activeAgent,
644
+ };
645
+ }
592
646
  listActionProposals(prepDataDir) {
593
647
  return byCreatedAtDesc(listJsonFiles(actionProposalsRoot(prepDataDir))
594
648
  .map(readActionProposalAt)
@@ -654,7 +708,7 @@ export class LocalServiceRuntime {
654
708
  listRunObservability(prepDataDir) {
655
709
  return [
656
710
  ...this.listCompileRuns(prepDataDir).map((resource) => compileRunToObservability(resource.run)),
657
- ...this.listTestRuns(prepDataDir).map(testRunToObservability),
711
+ ...this.listVerifyRuns(prepDataDir).map(verifyRunToObservability),
658
712
  ...this.listJobs(prepDataDir).map(jobRunToObservability),
659
713
  ].sort((left, right) => {
660
714
  const leftTime = timestampKey(left.started_at ?? left.created_at ?? left.finished_at);
@@ -665,6 +719,20 @@ export class LocalServiceRuntime {
665
719
  getRunObservability(prepDataDir, runId) {
666
720
  return this.listRunObservability(prepDataDir).find((run) => run.run_id === runId) ?? null;
667
721
  }
722
+ /**
723
+ * Method-scoped runs: every method-authoring or method-improvement job
724
+ * whose `method` matches `methodId`. Surfaced through
725
+ * `GET /v1/methods/<id>/runs` so Method Detail can show the full audit
726
+ * trail of authoring + improvement work for a Method.
727
+ */
728
+ listMethodRuns(prepDataDir, methodId) {
729
+ return this.listRunObservability(prepDataDir).filter((run) => {
730
+ if (run.method !== methodId)
731
+ return false;
732
+ return (run.run_type === "method-authoring" ||
733
+ run.run_type === "method-improvement");
734
+ });
735
+ }
668
736
  createJobRun(prepDataDir, requestValue) {
669
737
  const request = LocalJobRunCreateRequestSchema.parse(requestValue);
670
738
  const runId = createRunId("job");
@@ -848,74 +916,6 @@ export class LocalServiceRuntime {
848
916
  : `Removed Method ${request.method}.`,
849
917
  });
850
918
  }
851
- /**
852
- * Bootstrap the workspace's source-folder binding and seed the default
853
- * Method. Idempotent: re-running with the same source folder preserves
854
- * existing preparations and reports `changed: false`.
855
- *
856
- * The CLI calls this in place of writing `interf.json` directly, so the
857
- * operation is recorded by the service (and visible to other clients).
858
- */
859
- bootstrapWorkspace(prepDataDir, requestValue) {
860
- const request = WorkspaceBootstrapCreateRequestSchema.parse(requestValue);
861
- const requestedPath = request.source_folder?.path?.trim() ?? null;
862
- const existing = loadSourceFolderConfig(prepDataDir);
863
- const existingSourcePath = existing?.source_folder?.path ?? null;
864
- const preparations = existing?.preparations ?? [];
865
- let sourceFolderPath = existingSourcePath;
866
- let sourceChanged = false;
867
- if (requestedPath && requestedPath.length > 0) {
868
- // Validate that the source folder exists relative to the workspace.
869
- const resolvedSourcePath = resolve(prepDataDir, requestedPath);
870
- if (!existsSync(resolvedSourcePath) || !statSync(resolvedSourcePath).isDirectory()) {
871
- throw new Error(`Source folder "${requestedPath}" is not available.`);
872
- }
873
- if (existingSourcePath !== requestedPath) {
874
- sourceFolderPath = requestedPath;
875
- sourceChanged = true;
876
- }
877
- }
878
- const writeNeeded = !existing || sourceChanged;
879
- if (writeNeeded) {
880
- saveSourceFolderConfig(prepDataDir, {
881
- ...(sourceFolderPath ? { source_folder: { path: sourceFolderPath } } : {}),
882
- preparations,
883
- });
884
- // Source folder rebound: drop every cached read for this workspace.
885
- this.readinessCache.invalidateWorkspace(prepDataDir);
886
- this.compileRunCache.invalidateWorkspace(prepDataDir);
887
- this.testRunCache.invalidateWorkspace(prepDataDir);
888
- this.sourceFilesCache.invalidateAll();
889
- this.methodListingCache.invalidate(prepDataDir);
890
- }
891
- let seededMethodId = null;
892
- let seededDefaultMethod = false;
893
- if (request.seed_default_method) {
894
- const seeded = seedLocalDefaultMethod({ prepDataDir });
895
- seededMethodId = seeded.methodId;
896
- seededDefaultMethod = !seeded.alreadyExisted;
897
- if (seededDefaultMethod) {
898
- this.methodListingCache.invalidate(prepDataDir);
899
- }
900
- }
901
- const changed = writeNeeded || seededDefaultMethod;
902
- return WorkspaceBootstrapResultSchema.parse({
903
- kind: "interf-workspace-bootstrap-result",
904
- version: 1,
905
- control_path: prepDataDir,
906
- config_path: preparationConfigPath(asPreparationDataDir(prepDataDir)),
907
- source_folder_path: sourceFolderPath,
908
- preparations: preparations.length,
909
- seeded_default_method: seededDefaultMethod,
910
- default_method_id: seededMethodId,
911
- changed,
912
- message: changed
913
- ? sourceFolderPath
914
- ? `Workspace ready. Source Folder: ${sourceFolderPath}.`
915
- : `Workspace ready.`
916
- : `Workspace already initialized.`,
917
- });
918
- }
919
919
  applyPreparationSetup(prepDataDir, requestValue) {
920
920
  const request = PreparationSetupCreateRequestSchema.parse(requestValue);
921
921
  const preparationConfig = request.preparation;
@@ -934,7 +934,7 @@ export class LocalServiceRuntime {
934
934
  // caches so the next read reflects the new shape.
935
935
  this.readinessCache.invalidatePreparation(prepDataDir, normalizedPreparationConfig.name);
936
936
  this.compileRunCache.invalidatePreparation(prepDataDir, normalizedPreparationConfig.name);
937
- this.testRunCache.invalidatePreparation(prepDataDir, normalizedPreparationConfig.name);
937
+ this.verifyRunCache.invalidatePreparation(prepDataDir, normalizedPreparationConfig.name);
938
938
  this.methodListingCache.invalidate(prepDataDir);
939
939
  const operation = request.setup_mode === "select-method" ? "select-method" : "create";
940
940
  return PreparationSetupResultSchema.parse({
@@ -964,7 +964,7 @@ export class LocalServiceRuntime {
964
964
  removeSourcePreparationConfig(prepDataDir, request.preparation);
965
965
  this.readinessCache.invalidatePreparation(prepDataDir, request.preparation);
966
966
  this.compileRunCache.invalidatePreparation(prepDataDir, request.preparation);
967
- this.testRunCache.invalidatePreparation(prepDataDir, request.preparation);
967
+ this.verifyRunCache.invalidatePreparation(prepDataDir, request.preparation);
968
968
  this.methodListingCache.invalidate(prepDataDir);
969
969
  return PreparationChangeResultSchema.parse({
970
970
  kind: "interf-preparation-change-result",
@@ -991,7 +991,7 @@ export class LocalServiceRuntime {
991
991
  resetCompiledGeneratedState(compiledPath, request.scope);
992
992
  // Reset wipes generated state, including saved compile/test/readiness records.
993
993
  this.compileRunCache.invalidatePreparation(prepDataDir, request.preparation);
994
- this.testRunCache.invalidatePreparation(prepDataDir, request.preparation);
994
+ this.verifyRunCache.invalidatePreparation(prepDataDir, request.preparation);
995
995
  this.readinessCache.invalidatePreparation(prepDataDir, request.preparation);
996
996
  return ResetResultSchema.parse({
997
997
  kind: "interf-reset-result",
@@ -1085,7 +1085,7 @@ export class LocalServiceRuntime {
1085
1085
  const path = preparationPortableContextPath(asPreparationDataDir(prepDataDir), preparation.name);
1086
1086
  const config = readInterfConfig(path);
1087
1087
  const compileRuns = this.listCompileRunsForPreparation(prepDataDir, preparation.name);
1088
- const testRuns = this.listTestRunsForPreparation(prepDataDir, preparation.name);
1088
+ const verifyRuns = this.listVerifyRunsForPreparation(prepDataDir, preparation.name);
1089
1089
  const readiness = this.computePreparationReadiness(prepDataDir, preparation);
1090
1090
  const method = config?.method ?? methodIdForSourcePreparationConfig(preparation);
1091
1091
  return PortableContextResourceSchema.parse({
@@ -1095,7 +1095,7 @@ export class LocalServiceRuntime {
1095
1095
  readiness,
1096
1096
  method,
1097
1097
  latest_compile_run_id: compileRuns[0]?.run_id ?? null,
1098
- latest_test_run_id: testRuns[0]?.run_id ?? null,
1098
+ latest_test_run_id: verifyRuns[0]?.run_id ?? null,
1099
1099
  artifacts: uniqueArtifacts(compileRuns[0]?.stages.flatMap((stage) => stage.artifacts) ?? []),
1100
1100
  });
1101
1101
  }
@@ -1269,8 +1269,8 @@ export class LocalServiceRuntime {
1269
1269
  /**
1270
1270
  * Look up the run id previously associated with this idempotency key in
1271
1271
  * `prepDataDir`. Returns null when the key is unknown or its TTL has
1272
- * elapsed. The workspace argument is required so that the same key in
1273
- * two different workspaces always returns two different runs.
1272
+ * elapsed. The preparation argument is required so that the same key in
1273
+ * two different preparations always returns two different runs.
1274
1274
  */
1275
1275
  findIdempotentCompileRun(prepDataDir, key) {
1276
1276
  const resolvedRoot = resolve(prepDataDir);
@@ -1313,7 +1313,7 @@ export class LocalServiceRuntime {
1313
1313
  this.pruneIdempotencyKeyCache();
1314
1314
  }
1315
1315
  }
1316
- /** Total cached idempotency entries across all workspaces. */
1316
+ /** Total cached idempotency entries across all preparations. */
1317
1317
  totalIdempotencyEntries() {
1318
1318
  let total = 0;
1319
1319
  for (const bucket of this.idempotencyKeyCache.values())
@@ -1348,46 +1348,45 @@ export class LocalServiceRuntime {
1348
1348
  entry.expiresAt = Date.now() - 1;
1349
1349
  return true;
1350
1350
  }
1351
- listTestRuns(prepDataDir) {
1351
+ listVerifyRuns(prepDataDir) {
1352
1352
  return newestFirst(listSourcePreparationConfigs(loadSourceFolderConfig(prepDataDir))
1353
- .flatMap((preparation) => this.listTestRunsForPreparation(prepDataDir, preparation.name)));
1353
+ .flatMap((preparation) => this.listVerifyRunsForPreparation(prepDataDir, preparation.name)));
1354
1354
  }
1355
- listTestRunsForPreparation(prepDataDir, preparationName) {
1356
- return this.testRunCache.get(prepDataDir, preparationName, () => {
1355
+ listVerifyRunsForPreparation(prepDataDir, preparationName) {
1356
+ return this.verifyRunCache.get(prepDataDir, preparationName, () => {
1357
1357
  const compiledPath = preparationPortableContextPath(asPreparationDataDir(prepDataDir), preparationName);
1358
- return newestFirst(listJsonFiles(testRunsRoot(compiledPath))
1359
- .map(readTestRunAt)
1358
+ return newestFirst(listJsonFiles(verifyRunsRoot(compiledPath))
1359
+ .map(readVerifyRunAt)
1360
1360
  .filter((run) => run !== null));
1361
1361
  }, (run) => run.run_id);
1362
1362
  }
1363
- getTestRun(prepDataDir, runId) {
1364
- const known = this.testRunCache.preparationFor(prepDataDir, runId);
1363
+ getVerifyRun(prepDataDir, runId) {
1364
+ const known = this.verifyRunCache.preparationFor(prepDataDir, runId);
1365
1365
  if (known) {
1366
- const found = this.listTestRunsForPreparation(prepDataDir, known).find((run) => run.run_id === runId);
1366
+ const found = this.listVerifyRunsForPreparation(prepDataDir, known).find((run) => run.run_id === runId);
1367
1367
  if (found)
1368
1368
  return found;
1369
1369
  }
1370
- return this.listTestRuns(prepDataDir).find((run) => run.run_id === runId) ?? null;
1370
+ return this.listVerifyRuns(prepDataDir).find((run) => run.run_id === runId) ?? null;
1371
1371
  }
1372
- async createTestRun(prepDataDir, requestValue) {
1373
- const request = TestRunCreateRequestSchema.parse(requestValue);
1372
+ async createVerifyRun(prepDataDir, requestValue) {
1373
+ const request = VerifyRunCreateRequestSchema.parse(requestValue);
1374
1374
  const preparationConfig = this.resolvePreparationConfig(prepDataDir, request.preparation);
1375
1375
  const compiledPath = preparationPortableContextPath(asPreparationDataDir(prepDataDir), preparationConfig.name);
1376
1376
  const compiledTarget = createCompiledTestTarget(compiledPath, preparationConfig.name, methodIdForSourcePreparationConfig(preparationConfig) ?? DEFAULT_METHOD_ID);
1377
- const runId = createRunId("test");
1377
+ const runId = createRunId("verify");
1378
1378
  const now = new Date().toISOString();
1379
- const initial = TestRunResourceSchema.parse({
1379
+ const initial = VerifyRunResourceSchema.parse({
1380
1380
  run_id: runId,
1381
1381
  status: "running",
1382
1382
  preparation: preparationConfig.name,
1383
- mode: request.mode,
1384
1383
  source_path: prepDataDir,
1385
1384
  portable_context_path: compiledTarget.eligible ? compiledPath : null,
1386
1385
  started_at: now,
1387
1386
  readiness_run: null,
1388
1387
  events: [],
1389
1388
  });
1390
- this.writeTestRun(prepDataDir, compiledPath, initial);
1389
+ this.writeVerifyRun(prepDataDir, compiledPath, initial);
1391
1390
  void this.runTestInBackground(prepDataDir, request, {
1392
1391
  runId,
1393
1392
  sourcePath: prepDataDir,
@@ -1453,15 +1452,15 @@ export class LocalServiceRuntime {
1453
1452
  async runTestInBackground(prepDataDir, request, context, initial) {
1454
1453
  this.beginActiveRun();
1455
1454
  try {
1456
- if (!this.handlers.createTestRun) {
1457
- throw new Error("No test-run handler is configured for this local service.");
1455
+ if (!this.handlers.createVerifyRun) {
1456
+ throw new Error("No verify-run handler is configured for this local service.");
1458
1457
  }
1459
- const result = LocalRunHandlerResultSchema.parse(await this.handlers.createTestRun(request, context));
1458
+ const result = LocalRunHandlerResultSchema.parse(await this.handlers.createVerifyRun(request, context));
1460
1459
  const readinessRun = result.readiness_run ?? this.readLatestReadinessRun(prepDataDir, context.preparationConfig.name);
1461
1460
  const resultEvent = readinessRun
1462
1461
  ? this.checksEvaluatedEvent(context.runId, readinessRun)
1463
1462
  : null;
1464
- const nextWithoutReadiness = TestRunResourceSchema.parse({
1463
+ const nextWithoutReadiness = VerifyRunResourceSchema.parse({
1465
1464
  ...initial,
1466
1465
  status: result.ok ? "succeeded" : "failed",
1467
1466
  finished_at: new Date().toISOString(),
@@ -1469,9 +1468,9 @@ export class LocalServiceRuntime {
1469
1468
  events: resultEvent ? [resultEvent] : [],
1470
1469
  ...(!result.ok ? { error: result.error ?? "Readiness check failed." } : {}),
1471
1470
  });
1472
- this.writeTestRun(prepDataDir, context.compiledPath, nextWithoutReadiness);
1471
+ this.writeVerifyRun(prepDataDir, context.compiledPath, nextWithoutReadiness);
1473
1472
  const readiness = this.computePreparationReadiness(prepDataDir, context.preparationConfig);
1474
- const next = TestRunResourceSchema.parse({
1473
+ const next = VerifyRunResourceSchema.parse({
1475
1474
  ...nextWithoutReadiness,
1476
1475
  readiness,
1477
1476
  events: [
@@ -1479,23 +1478,23 @@ export class LocalServiceRuntime {
1479
1478
  this.readinessUpdatedEvent(context.runId, context.preparationConfig.name, readiness),
1480
1479
  ],
1481
1480
  });
1482
- this.writeTestRun(prepDataDir, context.compiledPath, next);
1481
+ this.writeVerifyRun(prepDataDir, context.compiledPath, next);
1483
1482
  }
1484
1483
  catch (error) {
1485
- const failedWithoutReadiness = TestRunResourceSchema.parse({
1484
+ const failedWithoutReadiness = VerifyRunResourceSchema.parse({
1486
1485
  ...initial,
1487
1486
  status: "failed",
1488
1487
  finished_at: new Date().toISOString(),
1489
1488
  error: error instanceof Error ? error.message : String(error),
1490
1489
  });
1491
- this.writeTestRun(prepDataDir, context.compiledPath, failedWithoutReadiness);
1490
+ this.writeVerifyRun(prepDataDir, context.compiledPath, failedWithoutReadiness);
1492
1491
  const readiness = this.computePreparationReadiness(prepDataDir, context.preparationConfig);
1493
- const next = TestRunResourceSchema.parse({
1492
+ const next = VerifyRunResourceSchema.parse({
1494
1493
  ...failedWithoutReadiness,
1495
1494
  readiness,
1496
1495
  events: [this.readinessUpdatedEvent(context.runId, context.preparationConfig.name, readiness)],
1497
1496
  });
1498
- this.writeTestRun(prepDataDir, context.compiledPath, next);
1497
+ this.writeVerifyRun(prepDataDir, context.compiledPath, next);
1499
1498
  }
1500
1499
  finally {
1501
1500
  this.endActiveRun();
@@ -1931,10 +1930,11 @@ export class LocalServiceRuntime {
1931
1930
  };
1932
1931
  }
1933
1932
  if (actionType === "test") {
1934
- const defaultMode = hasCompiledTestTarget(prepDataDir, preparationConfig) ? "both" : "source-files";
1933
+ // 0.15 verify runs always judge against the compiled
1934
+ // portable context. The legacy `mode` field is gone from the
1935
+ // wire request shape.
1935
1936
  return {
1936
1937
  preparation: preparationConfig.name,
1937
- mode: testModeValue(proposalValues, defaultMode),
1938
1938
  };
1939
1939
  }
1940
1940
  if (actionType === "readiness-check-draft") {
@@ -1984,9 +1984,7 @@ export class LocalServiceRuntime {
1984
1984
  return "Ask the configured local executor to draft saved readiness checks.";
1985
1985
  return "Ask the configured local executor to create a reusable local Method.";
1986
1986
  })();
1987
- const previewValues = proposalActionType === "test"
1988
- ? { mode: actionRequest.mode }
1989
- : proposalValues;
1987
+ const previewValues = proposalValues;
1990
1988
  const commandPreview = plan.command_preview ?? actionCommandPreview(proposalActionType, preparationConfig.name, methodId, previewValues);
1991
1989
  return ActionProposalResourceSchema.parse({
1992
1990
  kind: "interf-action-proposal",
@@ -2023,10 +2021,10 @@ export class LocalServiceRuntime {
2023
2021
  };
2024
2022
  }
2025
2023
  if (proposal.action_type === "test") {
2026
- const resource = await this.createTestRun(prepDataDir, proposal.request);
2024
+ const resource = await this.createVerifyRun(prepDataDir, proposal.request);
2027
2025
  return {
2028
2026
  runId: resource.run_id,
2029
- runType: "test-run",
2027
+ runType: "verify-run",
2030
2028
  };
2031
2029
  }
2032
2030
  if (proposal.action_type === "readiness-check-draft") {
@@ -2221,10 +2219,10 @@ export class LocalServiceRuntime {
2221
2219
  readiness,
2222
2220
  };
2223
2221
  }
2224
- writeTestRun(prepDataDir, compiledPath, run) {
2225
- mkdirSync(testRunsRoot(compiledPath), { recursive: true });
2226
- writeJsonFile(testRunPath(compiledPath, run.run_id), TestRunResourceSchema.parse(run));
2227
- this.testRunCache.invalidatePreparation(prepDataDir, run.preparation);
2222
+ writeVerifyRun(prepDataDir, compiledPath, run) {
2223
+ mkdirSync(verifyRunsRoot(compiledPath), { recursive: true });
2224
+ writeJsonFile(verifyRunPath(compiledPath, run.run_id), VerifyRunResourceSchema.parse(run));
2225
+ this.verifyRunCache.invalidatePreparation(prepDataDir, run.preparation);
2228
2226
  this.readinessCache.invalidatePreparation(prepDataDir, run.preparation);
2229
2227
  }
2230
2228
  }