@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,8 +1,8 @@
1
1
  import { z } from "zod";
2
- import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "../../execution/lib/schema.js";
3
- import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project-model/lib/schema.js";
4
- import { PreparationNameSchema, ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, } from "../../contracts/lib/schema.js";
5
- import { ReadinessCheckRunSchema, TestRunModeSchema, } from "../../testing/lib/schema.js";
2
+ import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "../execution/lib/schema.js";
3
+ import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project/lib/schema.js";
4
+ import { LocatorSchema, PreparationNameSchema, ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, } from "../../contracts/lib/schema.js";
5
+ import { ReadinessCheckRunSchema, } from "../verify/lib/schema.js";
6
6
  const JsonObjectSchema = z.record(z.string(), z.unknown());
7
7
  // ───────────────────────────────────────────────────────────────────────────
8
8
  // 0.13 — preparation-first additions
@@ -12,11 +12,13 @@ export const SourceBindingSchema = z.object({
12
12
  kind: z.enum(["local-folder"]),
13
13
  locator: z.string().min(1),
14
14
  }).strict();
15
- /** Discriminated locator for an artifact returned by the API. */
16
- export const ArtifactLocatorSchema = z.object({
17
- kind: z.enum(["local-path", "remote-url"]),
18
- value: z.string().min(1),
19
- }).strict();
15
+ /**
16
+ * Discriminated locator for an artifact returned by the API. Aliases the
17
+ * canonical `LocatorSchema` from contracts so all three kinds —
18
+ * `local-path`, `remote-url`, `api-served` — flow through the same
19
+ * resource-access pattern.
20
+ */
21
+ export const ArtifactLocatorSchema = LocatorSchema;
20
22
  /** Per-instance metadata from `GET /v1/instance` (replaces /v1/status). */
21
23
  export const InstanceResourceSchema = z.object({
22
24
  kind: z.literal("interf-instance"),
@@ -30,17 +32,34 @@ export const InstanceResourceSchema = z.object({
30
32
  active_run_count: z.number().int().min(0),
31
33
  idle_for_seconds: z.number().int().min(0),
32
34
  auth_required: z.boolean(),
35
+ /**
36
+ * 0.16 — locator-pattern connection mode. `local` means the engine
37
+ * is bound to a loopback host the user's UI can target with OS-shell
38
+ * actions; `remote` means OS-open is unavailable and resources must
39
+ * be fetched via api-served / signed URLs.
40
+ */
41
+ connection_kind: z.enum(["local", "remote"]).optional(),
33
42
  }).strict();
34
43
  /** Body of `POST /v1/preparations` — the 0.13 preparation create request. */
35
44
  export const PreparationCreateRequestSchema = z.object({
36
45
  id: PreparationNameSchema,
37
46
  source: SourceBindingSchema,
38
- method_id: MethodIdSchema,
47
+ /**
48
+ * Method binding. Optional — a preparation can be created with no
49
+ * method bound, then have one selected (or drafted) later before the
50
+ * first compile. Null/missing means "method not chosen yet".
51
+ */
52
+ method_id: MethodIdSchema.nullable().optional(),
39
53
  about: z.string().min(1).optional(),
40
54
  checks: z.array(SourceReadinessCheckSchema).default([]),
41
55
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
42
56
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
43
57
  }).strict();
58
+ /** Body of `PATCH /v1/preparations/<id>` — update mutable preparation fields. */
59
+ export const PreparationUpdateRequestSchema = z.object({
60
+ method_id: MethodIdSchema.nullable().optional(),
61
+ about: z.string().nullable().optional(),
62
+ }).strict();
44
63
  /** Body of `POST /v1/methods` — install a Method package by path. */
45
64
  export const MethodInstallRequestSchema = z.object({
46
65
  source_path: z.string().min(1),
@@ -105,21 +124,6 @@ export const ServiceRegistryEntrySchema = z.object({
105
124
  export const ServiceRegistrySchema = z.object({
106
125
  services: z.array(ServiceRegistryEntrySchema).default([]),
107
126
  }).strict();
108
- export const WorkspaceRegistrationRequestSchema = z.object({
109
- control_path: z.string().min(1),
110
- }).strict();
111
- export const WorkspaceRegistrationResponseSchema = z.object({
112
- workspace: ServiceRegistryWorkspaceSchema,
113
- service: ServiceRegistryEntrySchema,
114
- }).strict();
115
- export const WorkspaceListResponseSchema = z.object({
116
- workspaces: z.array(ServiceRegistryWorkspaceSchema),
117
- }).strict();
118
- export const WorkspaceDeregisterResponseSchema = z.object({
119
- deregistered: z.boolean(),
120
- control_path: z.string().min(1),
121
- remaining_workspaces: z.number().int().min(0),
122
- }).strict();
123
127
  export const LocalServiceHealthSchema = z.object({
124
128
  kind: z.literal("interf-local-service-health"),
125
129
  version: z.literal(1),
@@ -197,6 +201,12 @@ export const MethodResourceSchema = z.object({
197
201
  description: z.string().min(1).optional(),
198
202
  contract_type: z.string().min(1),
199
203
  skill_dir: z.string().min(1),
204
+ /**
205
+ * 0.15 — role hint Methods declare per stage. Defaults to
206
+ * `general` at the runtime layer; the wire shape mirrors that
207
+ * default so older /v1/methods clients always see a string.
208
+ */
209
+ role: z.string().min(1).default("general"),
200
210
  reads: z.array(z.string().min(1)).default([]),
201
211
  writes: z.array(z.string().min(1)).default([]),
202
212
  acceptance: z.record(z.string(), z.unknown()).optional(),
@@ -313,24 +323,6 @@ export const PreparationSetupResultSchema = z.object({
313
323
  submitted_run_id: z.string().min(1).nullable().optional(),
314
324
  submitted_run_type: z.literal("compile-run").nullable().optional(),
315
325
  }).strict();
316
- export const WorkspaceBootstrapCreateRequestSchema = z.object({
317
- source_folder: z.object({
318
- path: z.string().min(1),
319
- }).strict().optional(),
320
- seed_default_method: z.boolean().default(true),
321
- }).strict();
322
- export const WorkspaceBootstrapResultSchema = z.object({
323
- kind: z.literal("interf-workspace-bootstrap-result"),
324
- version: z.literal(1),
325
- control_path: z.string().min(1),
326
- config_path: z.string().min(1),
327
- source_folder_path: z.string().min(1).nullable(),
328
- preparations: z.number().int().min(0),
329
- seeded_default_method: z.boolean(),
330
- default_method_id: MethodIdSchema.nullable(),
331
- changed: z.boolean(),
332
- message: z.string().min(1),
333
- }).strict();
334
326
  export const MethodChangeCreateRequestSchema = z.discriminatedUnion("operation", [
335
327
  z.object({
336
328
  action_type: z.literal("method-change").optional(),
@@ -446,16 +438,23 @@ export const LocalJobRunResourceSchema = z.object({
446
438
  result: z.record(z.string(), z.unknown()).nullable().optional(),
447
439
  error: z.string().min(1).nullable().optional(),
448
440
  }).strict();
449
- export const TestRunStatusSchema = RunStatusSchema;
450
- export const TestRunCreateRequestSchema = z.object({
441
+ export const VerifyRunStatusSchema = RunStatusSchema;
442
+ /**
443
+ * 0.15 cleanup — `mode` was a 0.13 hold-over from when verify could
444
+ * judge against either the source-files baseline or the compiled
445
+ * portable context. 0.13.1 redirected every verify run to compiled-
446
+ * only, which made `mode` a vestigial field. We drop it here so the
447
+ * wire shape matches the runtime behavior. Older clients sending
448
+ * `mode` get it ignored by the strict-but-tolerant runtime parser
449
+ * upstream.
450
+ */
451
+ export const VerifyRunCreateRequestSchema = z.object({
451
452
  preparation: PreparationNameSchema,
452
- mode: TestRunModeSchema.default("both"),
453
453
  }).strict();
454
- export const TestRunResourceSchema = z.object({
454
+ export const VerifyRunResourceSchema = z.object({
455
455
  run_id: z.string().min(1),
456
- status: TestRunStatusSchema,
456
+ status: VerifyRunStatusSchema,
457
457
  preparation: PreparationNameSchema,
458
- mode: TestRunModeSchema,
459
458
  source_path: z.string().min(1),
460
459
  portable_context_path: z.string().min(1).nullable(),
461
460
  started_at: z.string().nullable().optional(),
@@ -556,7 +555,7 @@ const ActionProposalResourceBaseSchema = z.object({
556
555
  proposed_by_executor: LocalJobAgentSchema.nullable().optional(),
557
556
  approval: ActionProposalApprovalSchema.nullable().optional(),
558
557
  submitted_run_id: z.string().min(1).nullable().optional(),
559
- submitted_run_type: z.enum(["compile-run", "test-run", "job-run"]).nullable().optional(),
558
+ submitted_run_type: z.enum(["compile-run", "verify-run", "job-run"]).nullable().optional(),
560
559
  error: z.string().min(1).nullable().optional(),
561
560
  }).strict();
562
561
  export const ActionProposalResourceSchema = z.discriminatedUnion("action_type", [
@@ -570,7 +569,7 @@ export const ActionProposalResourceSchema = z.discriminatedUnion("action_type",
570
569
  }).strict(),
571
570
  ActionProposalResourceBaseSchema.extend({
572
571
  action_type: z.literal("test"),
573
- request: TestRunCreateRequestSchema,
572
+ request: VerifyRunCreateRequestSchema,
574
573
  }).strict(),
575
574
  ActionProposalResourceBaseSchema.extend({
576
575
  action_type: z.literal("readiness-check-draft"),
@@ -630,9 +629,14 @@ export const LocalServiceDiscoverySchema = z.object({
630
629
  method_authoring_runs: z.string().min(1),
631
630
  method_improvement_runs: z.string().min(1),
632
631
  compile_runs: z.string().min(1),
633
- test_runs: z.string().min(1),
632
+ verify_runs: z.string().min(1),
634
633
  reset: z.string().min(1),
635
634
  executor: z.string().min(1),
635
+ /**
636
+ * 0.15 — connected agents primitive. Optional during the 0.14 →
637
+ * 0.15 rollout so older clients don't fail discovery validation.
638
+ */
639
+ agents: z.string().min(1).optional(),
636
640
  workspaces: z.string().min(1).optional(),
637
641
  status: z.string().min(1).optional(),
638
642
  }).strict(),
@@ -656,8 +660,8 @@ export const CompileRunListResponseSchema = z.object({
656
660
  export const LocalJobRunListResponseSchema = z.object({
657
661
  jobs: z.array(LocalJobRunResourceSchema),
658
662
  }).strict();
659
- export const TestRunListResponseSchema = z.object({
660
- test_runs: z.array(TestRunResourceSchema),
663
+ export const VerifyRunListResponseSchema = z.object({
664
+ verify_runs: z.array(VerifyRunResourceSchema),
661
665
  }).strict();
662
666
  export const RunObservabilityListResponseSchema = z.object({
663
667
  runs: z.array(RunObservabilityResourceSchema),
@@ -1,7 +1,8 @@
1
- import type { MethodExecutionProfile, MethodExecutor } from "../agents/lib/executors.js";
2
- import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
3
- import type { StageShellRetentionMode } from "../compiler/method-runs.js";
4
- import type { RunEventSink } from "../execution/events.js";
1
+ import { type ResolveStageExecutor } from "./compile/method-runs.js";
2
+ import type { MethodExecutionProfile, MethodExecutor } from "./agents/lib/executors.js";
3
+ import type { SourcePreparationConfig } from "../project/lib/schema.js";
4
+ import type { StageShellRetentionMode } from "./compile/method-runs.js";
5
+ import { type RunEventSink } from "./execution/events.js";
5
6
  import type { LocalServiceRunHandlers } from "./runtime.js";
6
7
  export interface NativeLocalServiceRunHandlerOptions {
7
8
  executor?: MethodExecutor;
@@ -10,6 +11,7 @@ export interface NativeLocalServiceRunHandlerOptions {
10
11
  export declare function runConfiguredCompiledCompile(options: {
11
12
  executor: MethodExecutor;
12
13
  testExecutor?: MethodExecutor | null;
14
+ resolveStageExecutor?: ResolveStageExecutor;
13
15
  compiledPath: string;
14
16
  sourcePath: string;
15
17
  compiledConfig: SourcePreparationConfig | null;
@@ -20,4 +22,4 @@ export declare function runConfiguredCompiledCompile(options: {
20
22
  runId?: string;
21
23
  events?: RunEventSink;
22
24
  }): Promise<boolean>;
23
- export declare function createNativeLocalServiceRunHandlers(options?: NativeLocalServiceRunHandlerOptions): Pick<LocalServiceRunHandlers, "planActionProposal" | "createCompileRun" | "createTestRun" | "createReadinessCheckDraft" | "createMethodAuthoringRun">;
25
+ export declare function createNativeLocalServiceRunHandlers(options?: NativeLocalServiceRunHandlerOptions): Pick<LocalServiceRunHandlers, "planActionProposal" | "createCompileRun" | "createVerifyRun" | "createReadinessCheckDraft" | "createMethodAuthoringRun">;
@@ -2,19 +2,22 @@ import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
4
  import chalk from "chalk";
5
- import { compileCompiled, } from "../compiler/method-runs.js";
6
- import { readInterfConfig } from "../project-model/interf.js";
7
- import { resolveLocalExecutor, } from "../agents/lib/executors.js";
8
- import { formatMethodExecutionProfile } from "../agents/lib/execution-profile.js";
9
- import { clearCompiledRuntimeDerivedArtifacts, } from "../compiler/reset.js";
10
- import { formatActiveCompiledMethodStageStep, resolveRequiredCompiledMethodFromConfig, } from "../method-package/method-definitions.js";
11
- import { loadCompiledPreparationConfig, resolvePreparationCompileMaxAttempts, resolvePreparationCompileMaxLoops, } from "../project-model/source-config.js";
12
- import { runMethodImprovementLoop } from "../method-authoring/method-improvement.js";
13
- import { stageExecutionShellsRoot, methodPackagePathForCompiled, } from "../compiler/compiled-paths.js";
14
- import { readCompiledSchemaFile } from "../compiler/compiled-schema.js";
15
- import { initializeCompiledRuntimeState } from "../compiler/state.js";
16
- import { readinessPassRate, runReadinessChecksForExecutor, runSavedPortableContextCheck, } from "../testing/readiness-check-run.js";
17
- import { runMethodAuthoringDraft, } from "../method-authoring/method-authoring.js";
5
+ import { compileCompiled, } from "./compile/method-runs.js";
6
+ import { readInterfConfig } from "../project/interf.js";
7
+ import { resolveLocalExecutor, } from "./agents/lib/executors.js";
8
+ import { formatMethodExecutionProfile } from "./agents/lib/execution-profile.js";
9
+ import { loadAgentsRegistry } from "./agents/registry.js";
10
+ import { buildRoleExecutorBundle } from "./agents/role-executors.js";
11
+ import { clearCompiledRuntimeDerivedArtifacts, } from "./compile/reset.js";
12
+ import { formatActiveCompiledMethodStageStep, resolveRequiredCompiledMethodFromConfig, } from "../methods/package/method-definitions.js";
13
+ import { createRunEventId, createRunEventTimestamp, } from "./execution/events.js";
14
+ import { loadCompiledPreparationConfig, resolvePreparationCompileMaxAttempts, resolvePreparationCompileMaxLoops, } from "../project/source-config.js";
15
+ import { runMethodImprovementLoop } from "../methods/authoring/method-improvement.js";
16
+ import { stageExecutionShellsRoot, methodPackagePathForCompiled, } from "./compile/compiled-paths.js";
17
+ import { readCompiledSchemaFile } from "./compile/compiled-schema.js";
18
+ import { initializeCompiledRuntimeState } from "./compile/state.js";
19
+ import { readinessPassRate, runReadinessChecksForExecutor, runSavedPortableContextCheck, } from "./verify/readiness-check-run.js";
20
+ import { runMethodAuthoringDraft, } from "../methods/authoring/method-authoring.js";
18
21
  import { draftReadinessChecks, } from "./readiness-check-draft.js";
19
22
  import { planActionProposalWithExecutor, } from "./action-planner.js";
20
23
  import { ActionProposalPlanSchema, } from "./lib/schema.js";
@@ -46,6 +49,7 @@ async function compileCompiledWithReporter(executor, compiledPath, options = {})
46
49
  };
47
50
  const result = await compileCompiled({
48
51
  executor,
52
+ resolveStageExecutor: options.resolveStageExecutor,
49
53
  compiledPath,
50
54
  reporter,
51
55
  preserveStageShells: options.preserveStageShells,
@@ -144,6 +148,7 @@ async function runMethodVariation(options) {
144
148
  preserveStageShells: options.preserveStageShells,
145
149
  runId: options.runId,
146
150
  events: options.events,
151
+ resolveStageExecutor: options.resolveStageExecutor,
147
152
  });
148
153
  if (!result.ok) {
149
154
  printCompileFailure(options.compiledPath, result.failedStage);
@@ -269,14 +274,14 @@ function printStageShellReviewHint(compiledPath, preserveStageShells, result) {
269
274
  function printPostCompileNextStep(options) {
270
275
  console.log(chalk.dim(` Portable Context: ${options.compiledPath}`));
271
276
  if (options.checks === 0) {
272
- console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf test`."));
277
+ console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf verify`."));
273
278
  return;
274
279
  }
275
280
  if (options.testedDuringCompile) {
276
- console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf test` if you also want readiness evidence for source files and Portable Context."));
281
+ console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf verify` if you also want readiness evidence for source files and Portable Context."));
277
282
  return;
278
283
  }
279
- console.log(chalk.dim(" Next: run `interf test` to collect readiness evidence for source files and Portable Context."));
284
+ console.log(chalk.dim(" Next: run `interf verify` to collect readiness evidence for source files and Portable Context."));
280
285
  }
281
286
  function formatVariationReadinessSummary(summary) {
282
287
  return `${summary.passed_questions}/${summary.total_questions}`;
@@ -329,6 +334,7 @@ export async function runConfiguredCompiledCompile(options) {
329
334
  preserveStageShells,
330
335
  runId: options.runId,
331
336
  events: options.events,
337
+ resolveStageExecutor: options.resolveStageExecutor,
332
338
  });
333
339
  if (!result.ok) {
334
340
  process.exitCode = 1;
@@ -377,6 +383,7 @@ export async function runConfiguredCompiledCompile(options) {
377
383
  const baseline = await runMethodVariation({
378
384
  executor: options.executor,
379
385
  testExecutor: options.testExecutor,
386
+ resolveStageExecutor: options.resolveStageExecutor,
380
387
  compiledPath: options.compiledPath,
381
388
  sourcePath: options.sourcePath,
382
389
  compiledConfig,
@@ -436,6 +443,7 @@ export async function runConfiguredCompiledCompile(options) {
436
443
  const variation = await runMethodVariation({
437
444
  executor: options.executor,
438
445
  testExecutor: options.testExecutor,
446
+ resolveStageExecutor: options.resolveStageExecutor,
439
447
  compiledPath: options.compiledPath,
440
448
  sourcePath: options.sourcePath,
441
449
  compiledConfig,
@@ -528,9 +536,38 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
528
536
  async createCompileRun(request, context) {
529
537
  const executor = resolveHandlerExecutor(options.executor);
530
538
  const testExecutor = resolveHandlerExecutor(options.testExecutor ?? options.executor);
539
+ const registry = loadAgentsRegistry();
540
+ const bundle = buildRoleExecutorBundle({
541
+ agents: registry.agents,
542
+ roleMap: registry.roleMap,
543
+ activeAgent: registry.activeAgent,
544
+ defaultExecutor: executor,
545
+ });
531
546
  const ok = await runConfiguredCompiledCompile({
532
547
  executor,
533
548
  testExecutor,
549
+ resolveStageExecutor(stage) {
550
+ const role = stage.role && stage.role.trim().length > 0 ? stage.role : "general";
551
+ const { executor: stageExecutor, resolved } = bundle.resolveExecutorForRole(role);
552
+ // Best-effort audit trail — do not block the stage if event
553
+ // emission fails. Emits a `log.appended` system event so the
554
+ // run record shows which agent ran which stage.
555
+ try {
556
+ void context.events?.emit({
557
+ type: "log.appended",
558
+ event_id: createRunEventId("event"),
559
+ run_id: context.runId,
560
+ timestamp: createRunEventTimestamp(),
561
+ stage_id: stage.id,
562
+ stream: "system",
563
+ message: `Role ${role} → agent ${resolved.agent.name} (${resolved.source}).`,
564
+ });
565
+ }
566
+ catch {
567
+ /* best effort */
568
+ }
569
+ return stageExecutor;
570
+ },
534
571
  compiledPath: context.compiledPath,
535
572
  sourcePath: context.sourcePath,
536
573
  compiledConfig: context.preparationConfig,
@@ -542,24 +579,31 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
542
579
  });
543
580
  return { ok };
544
581
  },
545
- async createTestRun(request, context) {
546
- const executor = resolveHandlerExecutor(options.testExecutor ?? options.executor);
582
+ async createVerifyRun(request, context) {
583
+ const fallbackExecutor = resolveHandlerExecutor(options.testExecutor ?? options.executor);
584
+ const registry = loadAgentsRegistry();
585
+ const bundle = buildRoleExecutorBundle({
586
+ agents: registry.agents,
587
+ roleMap: registry.roleMap,
588
+ activeAgent: registry.activeAgent,
589
+ defaultExecutor: fallbackExecutor,
590
+ });
591
+ // Verify runs always use the `verifier` role. We resolve here
592
+ // for symmetry with compile runs — verify-run events are not
593
+ // streamed in 0.15, so the resolution shows up only in the
594
+ // executor field on the saved test run record.
595
+ const { executor } = bundle.resolveExecutorForRole("verifier");
547
596
  const result = await runReadinessChecksForExecutor({
548
597
  sourcePath: context.sourcePath,
549
598
  preparationConfig: context.preparationConfig,
550
599
  portableContextPath: context.compiledPath,
551
- mode: request.mode,
552
600
  executor,
553
601
  });
554
- const missingSourceFiles = (request.mode === "source-files" || request.mode === "both") && !result.sourceFilesOutcome;
555
- const missingPortableContext = (request.mode === "compiled" || request.mode === "both") && !result.compiledOutcome;
556
- if (missingSourceFiles || missingPortableContext) {
602
+ if (!result.compiledOutcome) {
557
603
  return {
558
604
  ok: false,
559
605
  readiness_run: result.readinessRun,
560
- error: missingPortableContext
561
- ? "Portable Context is not ready for readiness checks."
562
- : "Source files are not ready for readiness checks.",
606
+ error: "Portable Context is not ready for readiness checks.",
563
607
  };
564
608
  }
565
609
  return {
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * Public callers reach this through the preparation-keyed HTTP routes.
21
21
  */
22
- import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
22
+ import type { SourcePreparationConfig } from "../project/lib/schema.js";
23
23
  import type { LocalServiceRuntime } from "./runtime.js";
24
24
  export interface PreparationCreateInput {
25
25
  id: string;
@@ -27,7 +27,8 @@ export interface PreparationCreateInput {
27
27
  kind: "local-folder";
28
28
  locator: string;
29
29
  };
30
- method_id: string;
30
+ /** Method binding. Null/undefined means "not bound yet" — bind later via update. */
31
+ method_id?: string | null;
31
32
  about?: string;
32
33
  checks?: Array<{
33
34
  question: string;
@@ -38,6 +39,10 @@ export interface PreparationCreateInput {
38
39
  max_attempts?: number;
39
40
  max_loops?: number;
40
41
  }
42
+ export interface PreparationUpdateInput {
43
+ method_id?: string | null;
44
+ about?: string | null;
45
+ }
41
46
  export interface StoredPreparation {
42
47
  id: string;
43
48
  prepDataDir: string;
@@ -45,7 +50,8 @@ export interface StoredPreparation {
45
50
  kind: "local-folder";
46
51
  locator: string;
47
52
  };
48
- methodId: string;
53
+ /** Null when no method has been bound to this preparation yet. */
54
+ methodId: string | null;
49
55
  about: string | null;
50
56
  config: SourcePreparationConfig;
51
57
  portableContextPath: string;
@@ -69,6 +75,12 @@ export declare function createStoredPreparation(runtime: LocalServiceRuntime, in
69
75
  * was actually removed.
70
76
  */
71
77
  export declare function deleteStoredPreparation(runtime: LocalServiceRuntime, prepId: string): boolean;
78
+ /**
79
+ * Update mutable fields on an existing preparation (method binding,
80
+ * about text). Returns the freshly-loaded record. Throws if the
81
+ * preparation does not exist.
82
+ */
83
+ export declare function updateStoredPreparation(prepId: string, patch: PreparationUpdateInput): StoredPreparation;
72
84
  /**
73
85
  * Re-register every preparation directory with the runtime on startup so
74
86
  * synthetic workspaces survive a `interf web` restart.
@@ -81,7 +93,7 @@ export declare function preparationWireShape(stored: StoredPreparation): {
81
93
  kind: string;
82
94
  locator: string;
83
95
  };
84
- method_id: string;
96
+ method_id: string | null;
85
97
  about: string | null;
86
98
  config_path: string;
87
99
  portable_context: {
@@ -19,29 +19,14 @@
19
19
  *
20
20
  * Public callers reach this through the preparation-keyed HTTP routes.
21
21
  */
22
- import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, } from "node:fs";
22
+ import { existsSync, mkdirSync, readdirSync, rmSync, statSync, } from "node:fs";
23
23
  import { join, resolve } from "node:path";
24
24
  import { PreparationNameSchema, MethodIdSchema, } from "../contracts/lib/schema.js";
25
25
  import { preparationDataDir, preparationsRoot, } from "./instance-paths.js";
26
- import { saveSourceFolderConfig, loadSourceFolderConfig, } from "../project-model/source-config.js";
26
+ import { saveSourceFolderConfig, loadSourceFolderConfig, } from "../project/source-config.js";
27
27
  function ensurePreparationsRoot() {
28
28
  mkdirSync(preparationsRoot(), { recursive: true });
29
29
  }
30
- function readSourceFolderBindingFromInterfJson(prepDataDir) {
31
- const filePath = join(prepDataDir, "interf.json");
32
- if (!existsSync(filePath))
33
- return null;
34
- try {
35
- const raw = JSON.parse(readFileSync(filePath, "utf8"));
36
- const sourceFolder = raw.source_folder;
37
- if (!sourceFolder?.path)
38
- return null;
39
- return { path: sourceFolder.path, about: sourceFolder.about ?? null };
40
- }
41
- catch {
42
- return null;
43
- }
44
- }
45
30
  function loadStoredPreparation(prepId) {
46
31
  const prepDataDir = preparationDataDir(prepId);
47
32
  if (!existsSync(prepDataDir) || !statSync(prepDataDir).isDirectory())
@@ -52,15 +37,15 @@ function loadStoredPreparation(prepId) {
52
37
  const preparation = config.preparations?.find((p) => p.name === prepId);
53
38
  if (!preparation)
54
39
  return null;
55
- const binding = readSourceFolderBindingFromInterfJson(prepDataDir);
56
- if (!binding?.path)
40
+ const sourceFolderPath = config.source_folder?.path;
41
+ if (!sourceFolderPath)
57
42
  return null;
58
43
  return {
59
44
  id: prepId,
60
45
  prepDataDir,
61
- source: { kind: "local-folder", locator: binding.path },
62
- methodId: preparation.method ?? "interf-default",
63
- about: binding.about ?? null,
46
+ source: { kind: "local-folder", locator: sourceFolderPath },
47
+ methodId: preparation.method ?? null,
48
+ about: preparation.about ?? null,
64
49
  config: preparation,
65
50
  portableContextPath: join(prepDataDir, prepId),
66
51
  configPath: join(prepDataDir, "interf.json"),
@@ -95,7 +80,9 @@ export function getStoredPreparation(prepId) {
95
80
  */
96
81
  export function createStoredPreparation(runtime, input) {
97
82
  PreparationNameSchema.parse(input.id);
98
- MethodIdSchema.parse(input.method_id);
83
+ if (input.method_id != null) {
84
+ MethodIdSchema.parse(input.method_id);
85
+ }
99
86
  const sourceLocator = resolve(input.source.locator);
100
87
  if (!existsSync(sourceLocator)) {
101
88
  throw new Error(`Source folder does not exist: ${sourceLocator}`);
@@ -112,7 +99,7 @@ export function createStoredPreparation(runtime, input) {
112
99
  const preparation = {
113
100
  name: input.id,
114
101
  path: input.id,
115
- method: input.method_id,
102
+ ...(input.method_id ? { method: input.method_id } : {}),
116
103
  checks: (input.checks ?? []).map((check) => ({
117
104
  question: check.question,
118
105
  ...(check.answer ? { answer: check.answer } : {}),
@@ -124,7 +111,7 @@ export function createStoredPreparation(runtime, input) {
124
111
  ...(input.max_loops ? { max_loops: input.max_loops } : {}),
125
112
  };
126
113
  saveSourceFolderConfig(prepDataDir, {
127
- source_folder: { path: sourceLocator, ...(input.about ? { about: input.about } : {}) },
114
+ source_folder: { path: sourceLocator },
128
115
  preparations: [preparation],
129
116
  });
130
117
  // Hand the synthetic workspace to the runtime so the existing
@@ -148,6 +135,42 @@ export function deleteStoredPreparation(runtime, prepId) {
148
135
  rmSync(prepDataDir, { recursive: true, force: true });
149
136
  return true;
150
137
  }
138
+ /**
139
+ * Update mutable fields on an existing preparation (method binding,
140
+ * about text). Returns the freshly-loaded record. Throws if the
141
+ * preparation does not exist.
142
+ */
143
+ export function updateStoredPreparation(prepId, patch) {
144
+ const stored = loadStoredPreparation(prepId);
145
+ if (!stored)
146
+ throw new Error(`Preparation not found: ${prepId}`);
147
+ if (patch.method_id !== undefined && patch.method_id !== null) {
148
+ MethodIdSchema.parse(patch.method_id);
149
+ }
150
+ const nextPreparation = {
151
+ ...stored.config,
152
+ ...(patch.method_id === null
153
+ ? { method: undefined }
154
+ : patch.method_id !== undefined
155
+ ? { method: patch.method_id }
156
+ : {}),
157
+ };
158
+ const aboutPatch = patch.about === undefined ? stored.about : patch.about;
159
+ const preparationWithAbout = aboutPatch
160
+ ? { ...nextPreparation, about: aboutPatch }
161
+ : (() => {
162
+ const { about: _omitAbout, ...rest } = nextPreparation;
163
+ return rest;
164
+ })();
165
+ saveSourceFolderConfig(stored.prepDataDir, {
166
+ source_folder: { path: stored.source.locator },
167
+ preparations: [preparationWithAbout],
168
+ });
169
+ const next = loadStoredPreparation(prepId);
170
+ if (!next)
171
+ throw new Error(`Failed to reload updated preparation ${prepId}`);
172
+ return next;
173
+ }
151
174
  /**
152
175
  * Re-register every preparation directory with the runtime on startup so
153
176
  * synthetic workspaces survive a `interf web` restart.
@@ -1,5 +1,5 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import type { SourceReadinessCheck } from "../project-model/lib/schema.js";
1
+ import type { MethodExecutor } from "./agents/lib/executors.js";
2
+ import type { SourceReadinessCheck } from "../project/lib/schema.js";
3
3
  export declare function buildReadinessCheckDraftPrompt(options: {
4
4
  preparationName: string;
5
5
  sourceFolderPath: string;
@@ -9,13 +9,23 @@ export declare const LOCAL_SERVICE_ROUTES: {
9
9
  readonly methods: "/v1/methods";
10
10
  readonly runs: "/v1/runs";
11
11
  readonly actionProposals: "/v1/action-proposals";
12
+ /**
13
+ * 0.14 single-active-agent shortcut. Kept as a back-compat shim
14
+ * over the role-map's `general` row in 0.15+.
15
+ */
12
16
  readonly executor: "/v1/executor";
17
+ /**
18
+ * 0.15 connected-agents primitive — registry, role-map, role list.
19
+ * `agents/{name}` and `agents/role-map` are sub-resources handled
20
+ * by string match in `server.ts`.
21
+ */
22
+ readonly agents: "/v1/agents";
13
23
  readonly openPath: "/v1/open-path";
14
24
  };
15
25
  /** Preparation-scoped sub-resources (relative to /v1/preparations/<id>/). */
16
26
  export declare const PREPARATION_SUBRESOURCES: {
17
27
  readonly compileRuns: "compile-runs";
18
- readonly testRuns: "test-runs";
28
+ readonly verifyRuns: "verify-runs";
19
29
  readonly methodAuthoringRuns: "method-authoring-runs";
20
30
  readonly methodImprovementRuns: "method-improvement-runs";
21
31
  readonly readinessCheckDrafts: "readiness-check-drafts";
@@ -25,6 +35,23 @@ export declare const PREPARATION_SUBRESOURCES: {
25
35
  readonly readiness: "readiness";
26
36
  readonly sourceFiles: "source-files";
27
37
  readonly portableContext: "portable-context";
38
+ /**
39
+ * 0.16 — read a portable-context file (read-only, path-guarded
40
+ * inside the prep's portable-context root). Used by the locator
41
+ * pattern's `api-served` kind:
42
+ * GET /v1/preparations/<id>/files/<relpath>
43
+ */
44
+ readonly files: "files";
45
+ };
46
+ /** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
47
+ export declare const METHOD_SUBRESOURCES: {
48
+ readonly runs: "runs";
49
+ /**
50
+ * 0.16 — read a method package file (read-only, path-guarded inside
51
+ * the method root). Used by the locator pattern's `api-served` kind:
52
+ * GET /v1/methods/<id>/files/<relpath>
53
+ */
54
+ readonly files: "files";
28
55
  };
29
56
  /** Run-scoped sub-resources (relative to /v1/runs/<run-id>/). */
30
57
  export declare const RUN_SUBRESOURCES: {
@@ -47,3 +74,5 @@ export declare function runResourcePath(runId: string): string;
47
74
  export declare function runSubresourcePath(runId: string, sub: keyof typeof RUN_SUBRESOURCES): string;
48
75
  /** Path builder: /v1/methods/<id>. */
49
76
  export declare function methodResourcePath(methodId: string): string;
77
+ /** Path builder: /v1/methods/<id>/<subresource>. */
78
+ export declare function methodSubresourcePath(methodId: string, sub: keyof typeof METHOD_SUBRESOURCES): string;