@interf/compiler 0.13.0 → 0.18.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 (320) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +50 -7
  3. package/TRADEMARKS.md +4 -4
  4. package/agent-skills/interf-actions/SKILL.md +51 -5
  5. package/agent-skills/interf-actions/references/cli.md +82 -82
  6. package/builtin-methods/interf-default/README.md +6 -7
  7. package/builtin-methods/interf-default/method.json +7 -68
  8. package/builtin-methods/interf-default/method.schema.json +52 -50
  9. package/dist/cli/commands/agents.d.ts +2 -0
  10. package/dist/cli/commands/agents.js +213 -0
  11. package/dist/cli/commands/compile.js +10 -1
  12. package/dist/cli/commands/doctor.js +1 -1
  13. package/dist/cli/commands/login.js +1 -1
  14. package/dist/cli/commands/logout.js +1 -1
  15. package/dist/cli/commands/mcp.d.ts +42 -0
  16. package/dist/cli/commands/mcp.js +239 -0
  17. package/dist/cli/commands/method.js +1 -1
  18. package/dist/cli/commands/prep.js +81 -7
  19. package/dist/cli/commands/reset.js +1 -1
  20. package/dist/cli/commands/runs.js +1 -1
  21. package/dist/cli/commands/status.js +1 -1
  22. package/dist/cli/commands/verify.d.ts +10 -0
  23. package/dist/cli/commands/{test.js → verify.js} +30 -15
  24. package/dist/cli/commands/web.js +71 -18
  25. package/dist/cli/commands/wizard.js +462 -107
  26. package/dist/cli/index.d.ts +4 -2
  27. package/dist/cli/index.js +7 -3
  28. package/dist/compiler-ui/404.html +1 -1
  29. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  30. package/dist/compiler-ui/__next._full.txt +3 -3
  31. package/dist/compiler-ui/__next._head.txt +1 -1
  32. package/dist/compiler-ui/__next._index.txt +2 -2
  33. package/dist/compiler-ui/__next._tree.txt +2 -2
  34. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
  35. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
  36. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  37. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  38. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  39. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  40. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  41. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  42. package/dist/compiler-ui/_not-found.html +1 -1
  43. package/dist/compiler-ui/_not-found.txt +2 -2
  44. package/dist/compiler-ui/index.html +1 -1
  45. package/dist/compiler-ui/index.txt +3 -3
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.js +2 -2
  48. package/dist/packages/contracts/index.d.ts +2 -1
  49. package/dist/packages/contracts/index.js +1 -0
  50. package/dist/packages/contracts/lib/schema.d.ts +324 -31
  51. package/dist/packages/contracts/lib/schema.js +281 -21
  52. package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
  53. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  54. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  55. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  56. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  57. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  58. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  59. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  60. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  61. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
  62. package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
  63. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  64. package/dist/packages/engine/agents/registry.d.ts +91 -0
  65. package/dist/packages/engine/agents/registry.js +321 -0
  66. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  67. package/dist/packages/engine/agents/role-executors.js +88 -0
  68. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  69. package/dist/packages/engine/agents/role-router.js +73 -0
  70. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  71. package/dist/packages/{local-service → engine}/client.js +11 -11
  72. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  73. package/dist/packages/engine/cloud-seams.js +84 -0
  74. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
  75. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
  76. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  77. package/dist/packages/engine/compile/artifact-status.js +166 -0
  78. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  79. package/dist/packages/engine/compile/billing-events.js +74 -0
  80. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  81. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  82. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  83. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  84. package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
  85. package/dist/packages/engine/compile/compiled-schema.js +126 -0
  86. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
  87. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
  88. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  89. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
  90. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  91. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  92. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  93. package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
  94. package/dist/packages/{compiler → engine/compile}/index.js +0 -1
  95. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
  96. package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
  97. package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
  98. package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
  99. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  100. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  101. package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
  102. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
  103. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
  104. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  105. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
  106. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  107. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
  108. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
  109. package/dist/packages/engine/compile/runtime.d.ts +5 -0
  110. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
  111. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  112. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  113. package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
  114. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  115. package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
  116. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
  117. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  118. package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
  119. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
  120. package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
  121. package/dist/packages/engine/index.d.ts +22 -0
  122. package/dist/packages/engine/index.js +15 -0
  123. package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
  124. package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
  125. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  126. package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
  127. package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
  128. package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
  129. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  130. package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
  131. package/dist/packages/{local-service → engine}/routes.js +38 -1
  132. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  133. package/dist/packages/{local-service → engine}/run-observability.js +15 -15
  134. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  135. package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
  136. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  137. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  138. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  139. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  140. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
  141. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
  142. package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
  143. package/dist/packages/{local-service → engine}/runtime.js +333 -205
  144. package/dist/packages/{local-service → engine}/server.d.ts +25 -0
  145. package/dist/packages/{local-service → engine}/server.js +338 -17
  146. package/dist/packages/engine/verify/index.d.ts +13 -0
  147. package/dist/packages/engine/verify/index.js +10 -0
  148. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  149. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  150. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
  151. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
  152. package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
  153. package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
  154. package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
  155. package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
  156. package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
  157. package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
  158. package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
  159. package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
  160. package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
  161. package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
  162. package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
  163. package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
  164. package/dist/packages/engine/wire-schemas.d.ts +545 -0
  165. package/dist/packages/engine/wire-schemas.js +59 -0
  166. package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
  167. package/dist/packages/methods/authoring/method-authoring.js +260 -0
  168. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  169. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
  170. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  171. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  172. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
  173. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
  174. package/dist/packages/methods/package/context-interface.d.ts +73 -0
  175. package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
  176. package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
  177. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  178. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
  179. package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
  180. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
  181. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
  182. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
  183. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
  184. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  185. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  186. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  187. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  188. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  189. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  190. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  191. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  192. package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
  193. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  194. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  195. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  196. package/dist/packages/{project-model → project}/source-config.js +9 -8
  197. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  198. package/package.json +7 -16
  199. package/dist/cli/commands/test.d.ts +0 -9
  200. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
  201. package/dist/packages/agents/lib/detection.d.ts +0 -7
  202. package/dist/packages/compiler/artifact-counts.d.ts +0 -1
  203. package/dist/packages/compiler/compiled-schema.d.ts +0 -31
  204. package/dist/packages/compiler/compiled-schema.js +0 -141
  205. package/dist/packages/compiler/method-primitives.d.ts +0 -2
  206. package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
  207. package/dist/packages/compiler/runtime-acceptance.js +0 -262
  208. package/dist/packages/compiler/runtime.d.ts +0 -6
  209. package/dist/packages/local-service/index.d.ts +0 -22
  210. package/dist/packages/local-service/index.js +0 -15
  211. package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
  212. package/dist/packages/method-authoring/method-authoring.js +0 -116
  213. package/dist/packages/method-package/context-interface.d.ts +0 -60
  214. package/dist/packages/testing/index.d.ts +0 -13
  215. package/dist/packages/testing/index.js +0 -10
  216. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
  217. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
  218. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
  219. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  220. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  221. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  222. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  223. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  224. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  225. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  226. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  227. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  228. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  229. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  230. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  231. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  232. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  233. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  234. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  235. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  236. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  237. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  238. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  239. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  240. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  241. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  242. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  243. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  244. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  245. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  246. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  247. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  248. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  249. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  250. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  251. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  252. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  253. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  254. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  255. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  256. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  257. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  258. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  259. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  260. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  261. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  262. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  263. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  264. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  265. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  266. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  267. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  268. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  269. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  270. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  271. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  272. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  273. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  274. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  275. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  276. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  277. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  278. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  279. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  280. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  281. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  282. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  283. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  284. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  285. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  286. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  287. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  288. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  289. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  290. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  291. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  292. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  293. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  294. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  295. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  296. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  297. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  298. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  299. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  300. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  301. /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
  302. /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
  303. /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
  304. /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
  305. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  306. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  307. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  308. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  309. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  310. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  311. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  312. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  313. /package/dist/packages/{project-model → project}/index.js +0 -0
  314. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  315. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  316. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  317. /package/dist/packages/{project-model → project}/interf.js +0 -0
  318. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  319. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  320. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -1,22 +1,30 @@
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 { ArtifactSchema, ArtifactIdSchema, ArtifactPathShapeSchema, ArtifactStatusSchema, CheckSchema, LocatorSchema, PreparationNameSchema, ReadinessSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, TestTargetTypeSchema, } 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
9
9
  // ───────────────────────────────────────────────────────────────────────────
10
- /** Source binding shape on the API (only `local-folder` ships in 0.13). */
10
+ /**
11
+ * Source binding shape on the API. `local-folder` is the only kind the
12
+ * local binary accepts in 0.17; `remote-folder` rides in the type
13
+ * plumbing for the future cloud variant (B4.4 cloud-variant seam) and
14
+ * is rejected at the validator branch in server.ts. See `TODO(cloud)`
15
+ * marker there.
16
+ */
11
17
  export const SourceBindingSchema = z.object({
12
- kind: z.enum(["local-folder"]),
18
+ kind: z.enum(["local-folder", "remote-folder"]),
13
19
  locator: z.string().min(1),
14
20
  }).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();
21
+ /**
22
+ * Discriminated locator for an artifact returned by the API. Aliases the
23
+ * canonical `LocatorSchema` from contracts so all three kinds —
24
+ * `local-path`, `remote-url`, `api-served` — flow through the same
25
+ * resource-access pattern.
26
+ */
27
+ export const ArtifactLocatorSchema = LocatorSchema;
20
28
  /** Per-instance metadata from `GET /v1/instance` (replaces /v1/status). */
21
29
  export const InstanceResourceSchema = z.object({
22
30
  kind: z.literal("interf-instance"),
@@ -30,17 +38,40 @@ export const InstanceResourceSchema = z.object({
30
38
  active_run_count: z.number().int().min(0),
31
39
  idle_for_seconds: z.number().int().min(0),
32
40
  auth_required: z.boolean(),
41
+ /**
42
+ * 0.16 — locator-pattern connection mode. `local` means the engine
43
+ * is bound to a loopback host the user's UI can target with OS-shell
44
+ * actions; `remote` means OS-open is unavailable and resources must
45
+ * be fetched via api-served / signed URLs.
46
+ */
47
+ connection_kind: z.enum(["local", "remote"]).optional(),
33
48
  }).strict();
34
49
  /** Body of `POST /v1/preparations` — the 0.13 preparation create request. */
35
50
  export const PreparationCreateRequestSchema = z.object({
36
51
  id: PreparationNameSchema,
37
52
  source: SourceBindingSchema,
38
- method_id: MethodIdSchema,
53
+ /**
54
+ * Method binding. Optional — a preparation can be created with no
55
+ * method bound, then have one selected (or drafted) later before the
56
+ * first compile. Null/missing means "method not chosen yet".
57
+ */
58
+ method_id: MethodIdSchema.nullable().optional(),
39
59
  about: z.string().min(1).optional(),
40
60
  checks: z.array(SourceReadinessCheckSchema).default([]),
41
61
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
42
62
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
43
63
  }).strict();
64
+ /** Body of `PATCH /v1/preparations/<id>` — update mutable preparation fields. */
65
+ export const PreparationUpdateRequestSchema = z.object({
66
+ method_id: MethodIdSchema.nullable().optional(),
67
+ about: z.string().nullable().optional(),
68
+ /**
69
+ * Replace the full quality-check list. Use the empty array to clear
70
+ * every check. Each item is a `SourceReadinessCheck`
71
+ * (`{ question, answer?, strictness?, expect? }`).
72
+ */
73
+ checks: z.array(SourceReadinessCheckSchema).optional(),
74
+ }).strict();
44
75
  /** Body of `POST /v1/methods` — install a Method package by path. */
45
76
  export const MethodInstallRequestSchema = z.object({
46
77
  source_path: z.string().min(1),
@@ -55,6 +86,15 @@ export const PreparationDeleteResponseSchema = z.object({
55
86
  deleted: z.boolean(),
56
87
  id: PreparationNameSchema,
57
88
  }).strict();
89
+ export const PreparationWireShapeSchema = z.object({
90
+ id: PreparationNameSchema,
91
+ source: SourceBindingSchema,
92
+ method_id: MethodIdSchema.nullable(),
93
+ about: z.string().min(1).nullable(),
94
+ config_path: z.string().min(1),
95
+ portable_context: ArtifactLocatorSchema,
96
+ checks: z.array(SourceReadinessCheckSchema).default([]),
97
+ }).strict();
58
98
  /**
59
99
  * The local service must only ever bind to a loopback interface. Any other
60
100
  * host (LAN IP, 0.0.0.0, public address) lets a remote browser tab POST at
@@ -105,21 +145,6 @@ export const ServiceRegistryEntrySchema = z.object({
105
145
  export const ServiceRegistrySchema = z.object({
106
146
  services: z.array(ServiceRegistryEntrySchema).default([]),
107
147
  }).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
148
  export const LocalServiceHealthSchema = z.object({
124
149
  kind: z.literal("interf-local-service-health"),
125
150
  version: z.literal(1),
@@ -176,10 +201,15 @@ export const PreparationResourceSchema = z.object({
176
201
  checks: z.array(SourceReadinessCheckSchema).default([]),
177
202
  portable_context: PortableContextMappingSchema,
178
203
  portable_context_path: z.string().min(1).nullable(),
179
- readiness: ReadinessStateSchema,
204
+ readiness: ReadinessSchema,
180
205
  runs: PreparationRunLinkageSchema,
181
206
  latest_compile_run_id: z.string().min(1).nullable().optional(),
182
207
  latest_test_run_id: z.string().min(1).nullable().optional(),
208
+ // 0.17 — per-Artifact status from the latest compile run, mirrored
209
+ // here so the UI/CLI can render artifact rows without a separate
210
+ // GET /v1/preparations/<id>/runs fetch. Empty when the Method
211
+ // no compile run has produced artifacts yet.
212
+ artifacts: z.array(ArtifactStatusSchema).default([]),
183
213
  }).strict();
184
214
  export const MethodResourceSchema = z.object({
185
215
  id: MethodIdSchema,
@@ -190,16 +220,21 @@ export const MethodResourceSchema = z.object({
190
220
  source_kind: z.enum(["builtin", "local"]).default("local"),
191
221
  built_in: z.boolean().default(false),
192
222
  active_for_preparations: z.array(PreparationNameSchema).default([]),
193
- output_paths: z.array(z.string().min(1)).default([]),
223
+ artifacts: z.array(ArtifactSchema).default([]),
194
224
  stages: z.array(z.object({
195
225
  id: z.string().min(1),
196
226
  label: z.string().min(1),
197
227
  description: z.string().min(1).optional(),
198
228
  contract_type: z.string().min(1),
199
229
  skill_dir: z.string().min(1),
230
+ /**
231
+ * 0.15 — role hint Methods declare per stage. Defaults to
232
+ * `general` at the runtime layer; the wire shape mirrors that
233
+ * default so older /v1/methods clients always see a string.
234
+ */
235
+ role: z.string().min(1).default("general"),
200
236
  reads: z.array(z.string().min(1)).default([]),
201
237
  writes: z.array(z.string().min(1)).default([]),
202
- acceptance: z.record(z.string(), z.unknown()).optional(),
203
238
  }).strict()).default([]),
204
239
  }).strict();
205
240
  export const CompileRunCreateRequestSchema = z.object({
@@ -313,24 +348,6 @@ export const PreparationSetupResultSchema = z.object({
313
348
  submitted_run_id: z.string().min(1).nullable().optional(),
314
349
  submitted_run_type: z.literal("compile-run").nullable().optional(),
315
350
  }).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
351
  export const MethodChangeCreateRequestSchema = z.discriminatedUnion("operation", [
335
352
  z.object({
336
353
  action_type: z.literal("method-change").optional(),
@@ -399,6 +416,13 @@ export const ReadinessCheckDraftCreateRequestSchema = z.object({
399
416
  export const ReadinessCheckDraftResultSchema = z.object({
400
417
  checks: z.array(SourceReadinessCheckSchema).default([]),
401
418
  }).strict();
419
+ export const MethodAuthoringArtifactRequirementSchema = z.object({
420
+ id: ArtifactIdSchema,
421
+ description: z.string().min(1).optional(),
422
+ shape: ArtifactPathShapeSchema,
423
+ checks: z.array(CheckSchema).default([]),
424
+ stage_hint: z.string().min(1).optional(),
425
+ }).strict();
402
426
  export const MethodAuthoringCreateRequestSchema = z.object({
403
427
  preparation: PreparationNameSchema.nullable().optional(),
404
428
  source_folder_path: z.string().min(1),
@@ -409,6 +433,7 @@ export const MethodAuthoringCreateRequestSchema = z.object({
409
433
  hint: z.string().min(1),
410
434
  task_prompt: z.string().min(1),
411
435
  checks: z.array(SourceReadinessCheckSchema).default([]),
436
+ artifact_requirements: z.array(MethodAuthoringArtifactRequirementSchema).default([]),
412
437
  }).strict();
413
438
  export const MethodAuthoringResultSchema = z.object({
414
439
  status: z.enum(["updated", "no-change", "invalid", "executor-failed"]),
@@ -446,22 +471,32 @@ export const LocalJobRunResourceSchema = z.object({
446
471
  result: z.record(z.string(), z.unknown()).nullable().optional(),
447
472
  error: z.string().min(1).nullable().optional(),
448
473
  }).strict();
449
- export const TestRunStatusSchema = RunStatusSchema;
450
- export const TestRunCreateRequestSchema = z.object({
474
+ export const VerifyRunStatusSchema = RunStatusSchema;
475
+ /**
476
+ * 0.17 — verify runs choose their judge target. `compiled` (default)
477
+ * judges against the latest portable-context output; `source-files`
478
+ * judges against the raw source folder for a baseline that reveals
479
+ * how much value the Method actually adds. The 0.15 cleanup made
480
+ * verify compiled-only on the wire because the source-files branch
481
+ * had been retired in 0.13.1; 0.17 restores it because the QA tab and
482
+ * `verify/README.md` have always claimed the option exists, and the
483
+ * sandbox + spec builders for source-files have remained in tree
484
+ * since 0.13.
485
+ */
486
+ export const VerifyRunCreateRequestSchema = z.object({
451
487
  preparation: PreparationNameSchema,
452
- mode: TestRunModeSchema.default("both"),
488
+ target: TestTargetTypeSchema.default("compiled"),
453
489
  }).strict();
454
- export const TestRunResourceSchema = z.object({
490
+ export const VerifyRunResourceSchema = z.object({
455
491
  run_id: z.string().min(1),
456
- status: TestRunStatusSchema,
492
+ status: VerifyRunStatusSchema,
457
493
  preparation: PreparationNameSchema,
458
- mode: TestRunModeSchema,
459
494
  source_path: z.string().min(1),
460
495
  portable_context_path: z.string().min(1).nullable(),
461
496
  started_at: z.string().nullable().optional(),
462
497
  finished_at: z.string().nullable().optional(),
463
498
  readiness_run: ReadinessCheckRunSchema.nullable(),
464
- readiness: ReadinessStateSchema.nullable().optional(),
499
+ readiness: ReadinessSchema.nullable().optional(),
465
500
  events: z.array(InterfRunEventSchema).default([]),
466
501
  error: z.string().min(1).nullable().optional(),
467
502
  }).strict();
@@ -556,7 +591,7 @@ const ActionProposalResourceBaseSchema = z.object({
556
591
  proposed_by_executor: LocalJobAgentSchema.nullable().optional(),
557
592
  approval: ActionProposalApprovalSchema.nullable().optional(),
558
593
  submitted_run_id: z.string().min(1).nullable().optional(),
559
- submitted_run_type: z.enum(["compile-run", "test-run", "job-run"]).nullable().optional(),
594
+ submitted_run_type: z.enum(["compile-run", "verify-run", "job-run"]).nullable().optional(),
560
595
  error: z.string().min(1).nullable().optional(),
561
596
  }).strict();
562
597
  export const ActionProposalResourceSchema = z.discriminatedUnion("action_type", [
@@ -570,7 +605,7 @@ export const ActionProposalResourceSchema = z.discriminatedUnion("action_type",
570
605
  }).strict(),
571
606
  ActionProposalResourceBaseSchema.extend({
572
607
  action_type: z.literal("test"),
573
- request: TestRunCreateRequestSchema,
608
+ request: VerifyRunCreateRequestSchema,
574
609
  }).strict(),
575
610
  ActionProposalResourceBaseSchema.extend({
576
611
  action_type: z.literal("readiness-check-draft"),
@@ -589,13 +624,13 @@ export const PortableContextResourceSchema = z.object({
589
624
  preparation: PreparationNameSchema,
590
625
  path: z.string().min(1),
591
626
  exists: z.boolean(),
592
- readiness: ReadinessStateSchema,
627
+ readiness: ReadinessSchema,
593
628
  method: MethodIdSchema.nullable().optional(),
594
629
  latest_compile_run_id: z.string().min(1).nullable().optional(),
595
630
  latest_test_run_id: z.string().min(1).nullable().optional(),
596
631
  artifacts: z.array(ArtifactRefSchema).default([]),
597
632
  }).strict();
598
- export const ReadinessResourceSchema = ReadinessStateSchema;
633
+ export const ReadinessResourceSchema = ReadinessSchema;
599
634
  export const SourceFileResourceSchema = z.object({
600
635
  preparation: PreparationNameSchema,
601
636
  path: z.string().min(1),
@@ -630,9 +665,14 @@ export const LocalServiceDiscoverySchema = z.object({
630
665
  method_authoring_runs: z.string().min(1),
631
666
  method_improvement_runs: z.string().min(1),
632
667
  compile_runs: z.string().min(1),
633
- test_runs: z.string().min(1),
668
+ verify_runs: z.string().min(1),
634
669
  reset: z.string().min(1),
635
670
  executor: z.string().min(1),
671
+ /**
672
+ * 0.15 — connected agents primitive. Optional during the 0.14 →
673
+ * 0.15 rollout so older clients don't fail discovery validation.
674
+ */
675
+ agents: z.string().min(1).optional(),
636
676
  workspaces: z.string().min(1).optional(),
637
677
  status: z.string().min(1).optional(),
638
678
  }).strict(),
@@ -645,7 +685,7 @@ export const OpenPathResponseSchema = z.object({
645
685
  path: z.string().min(1),
646
686
  }).strict();
647
687
  export const PreparationListResponseSchema = z.object({
648
- preparations: z.array(PreparationResourceSchema),
688
+ preparations: z.array(PreparationWireShapeSchema),
649
689
  }).strict();
650
690
  export const MethodListResponseSchema = z.object({
651
691
  methods: z.array(MethodResourceSchema),
@@ -656,8 +696,8 @@ export const CompileRunListResponseSchema = z.object({
656
696
  export const LocalJobRunListResponseSchema = z.object({
657
697
  jobs: z.array(LocalJobRunResourceSchema),
658
698
  }).strict();
659
- export const TestRunListResponseSchema = z.object({
660
- test_runs: z.array(TestRunResourceSchema),
699
+ export const VerifyRunListResponseSchema = z.object({
700
+ verify_runs: z.array(VerifyRunResourceSchema),
661
701
  }).strict();
662
702
  export const RunObservabilityListResponseSchema = z.object({
663
703
  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 { listCompiledSchemaArtifacts, 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,
@@ -83,9 +87,9 @@ function printSavedReadinessOutcome(prefix, outcome) {
83
87
  }
84
88
  function bestVariationRestorePaths(compiledPath) {
85
89
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
86
- const zonePaths = (schema?.zones ?? [])
87
- .filter((zone) => zone.kind !== "runtime")
88
- .map((zone) => zone.path);
90
+ const artifactPaths = (schema ? listCompiledSchemaArtifacts(schema) : [])
91
+ .filter((artifact) => artifact.kind !== "runtime")
92
+ .map((artifact) => artifact.path);
89
93
  return [
90
94
  "AGENTS.md",
91
95
  "CLAUDE.md",
@@ -95,7 +99,7 @@ function bestVariationRestorePaths(compiledPath) {
95
99
  ".cursor",
96
100
  ".interf/interf.json",
97
101
  ".interf/method",
98
- ...zonePaths,
102
+ ...artifactPaths,
99
103
  ];
100
104
  }
101
105
  function copyRelativePathIfPresent(sourceRoot, targetRoot, relativePath) {
@@ -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,38 @@ 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,
601
+ target: request.target,
553
602
  });
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) {
603
+ const outcome = request.target === "source-files"
604
+ ? result.sourceFilesOutcome
605
+ : result.compiledOutcome;
606
+ if (!outcome) {
607
+ const targetLabel = request.target === "source-files"
608
+ ? "Source files"
609
+ : "Portable Context";
557
610
  return {
558
611
  ok: false,
559
612
  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.",
613
+ error: `${targetLabel} is not ready for readiness checks.`,
563
614
  };
564
615
  }
565
616
  return {
@@ -609,6 +660,7 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
609
660
  hint: request.hint,
610
661
  taskPrompt: request.task_prompt,
611
662
  checks: request.checks,
663
+ artifactRequirements: request.artifact_requirements,
612
664
  executor,
613
665
  onStatus: (line) => context.emit({
614
666
  type: "log.appended",
@@ -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,16 @@ 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
+ checks?: Array<{
46
+ question: string;
47
+ answer?: string;
48
+ strictness?: string;
49
+ expect?: string;
50
+ }>;
51
+ }
41
52
  export interface StoredPreparation {
42
53
  id: string;
43
54
  prepDataDir: string;
@@ -45,7 +56,8 @@ export interface StoredPreparation {
45
56
  kind: "local-folder";
46
57
  locator: string;
47
58
  };
48
- methodId: string;
59
+ /** Null when no method has been bound to this preparation yet. */
60
+ methodId: string | null;
49
61
  about: string | null;
50
62
  config: SourcePreparationConfig;
51
63
  portableContextPath: string;
@@ -69,6 +81,12 @@ export declare function createStoredPreparation(runtime: LocalServiceRuntime, in
69
81
  * was actually removed.
70
82
  */
71
83
  export declare function deleteStoredPreparation(runtime: LocalServiceRuntime, prepId: string): boolean;
84
+ /**
85
+ * Update mutable fields on an existing preparation (method binding,
86
+ * about text). Returns the freshly-loaded record. Throws if the
87
+ * preparation does not exist.
88
+ */
89
+ export declare function updateStoredPreparation(prepId: string, patch: PreparationUpdateInput): StoredPreparation;
72
90
  /**
73
91
  * Re-register every preparation directory with the runtime on startup so
74
92
  * synthetic workspaces survive a `interf web` restart.
@@ -81,7 +99,7 @@ export declare function preparationWireShape(stored: StoredPreparation): {
81
99
  kind: string;
82
100
  locator: string;
83
101
  };
84
- method_id: string;
102
+ method_id: string | null;
85
103
  about: string | null;
86
104
  config_path: string;
87
105
  portable_context: {