@interf/compiler 0.9.5 → 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 (365) hide show
  1. package/README.md +135 -91
  2. package/TRADEMARKS.md +2 -13
  3. package/agent-skills/interf-actions/SKILL.md +143 -38
  4. package/agent-skills/interf-actions/references/cli.md +134 -67
  5. package/builtin-methods/interf-default/README.md +3 -4
  6. package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
  7. package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +1 -1
  9. package/builtin-methods/interf-default/method.json +10 -4
  10. package/builtin-methods/interf-default/method.schema.json +0 -9
  11. package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
  12. package/dist/cli/commands/agents.d.ts +2 -0
  13. package/dist/cli/commands/agents.js +213 -0
  14. package/dist/cli/commands/compile.d.ts +8 -25
  15. package/dist/cli/commands/compile.js +83 -359
  16. package/dist/cli/commands/doctor.js +2 -2
  17. package/dist/cli/commands/login.d.ts +7 -0
  18. package/dist/cli/commands/login.js +39 -0
  19. package/dist/cli/commands/logout.d.ts +2 -0
  20. package/dist/cli/commands/logout.js +16 -0
  21. package/dist/cli/commands/mcp.d.ts +42 -0
  22. package/dist/cli/commands/mcp.js +239 -0
  23. package/dist/cli/commands/method.d.ts +2 -0
  24. package/dist/cli/commands/method.js +113 -0
  25. package/dist/cli/commands/prep.d.ts +2 -0
  26. package/dist/cli/commands/prep.js +152 -0
  27. package/dist/cli/commands/reset.d.ts +8 -1
  28. package/dist/cli/commands/reset.js +47 -26
  29. package/dist/cli/commands/runs.d.ts +2 -0
  30. package/dist/cli/commands/runs.js +120 -0
  31. package/dist/cli/commands/status.d.ts +6 -1
  32. package/dist/cli/commands/status.js +68 -111
  33. package/dist/cli/commands/verify.d.ts +7 -1
  34. package/dist/cli/commands/verify.js +69 -85
  35. package/dist/cli/commands/web.d.ts +0 -9
  36. package/dist/cli/commands/web.js +201 -121
  37. package/dist/cli/commands/wizard.d.ts +9 -0
  38. package/dist/cli/commands/wizard.js +689 -0
  39. package/dist/cli/index.d.ts +10 -7
  40. package/dist/cli/index.js +19 -12
  41. package/dist/compiler-ui/404.html +1 -1
  42. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  43. package/dist/compiler-ui/__next._full.txt +3 -3
  44. package/dist/compiler-ui/__next._head.txt +1 -1
  45. package/dist/compiler-ui/__next._index.txt +2 -2
  46. package/dist/compiler-ui/__next._tree.txt +2 -2
  47. package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
  48. package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
  49. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  50. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  51. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  52. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  53. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  54. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  55. package/dist/compiler-ui/_not-found.html +1 -1
  56. package/dist/compiler-ui/_not-found.txt +2 -2
  57. package/dist/compiler-ui/index.html +1 -1
  58. package/dist/compiler-ui/index.txt +3 -3
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.js +2 -2
  61. package/dist/packages/contracts/index.d.ts +2 -1
  62. package/dist/packages/contracts/index.js +1 -0
  63. package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
  64. package/dist/packages/contracts/lib/preparation-paths.js +177 -0
  65. package/dist/packages/contracts/lib/schema.d.ts +187 -13
  66. package/dist/packages/contracts/lib/schema.js +148 -3
  67. package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
  68. package/dist/packages/contracts/utils/filesystem.js +142 -0
  69. package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
  70. package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
  71. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  72. package/dist/packages/{local-service → engine}/action-planner.js +3 -2
  73. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  74. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  75. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  76. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  77. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  78. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  79. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +5 -5
  80. package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
  81. package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
  82. package/dist/packages/engine/agents/lib/user-config.js +24 -0
  83. package/dist/packages/engine/agents/registry.d.ts +91 -0
  84. package/dist/packages/engine/agents/registry.js +321 -0
  85. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  86. package/dist/packages/engine/agents/role-executors.js +88 -0
  87. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  88. package/dist/packages/engine/agents/role-router.js +73 -0
  89. package/dist/packages/{local-service → engine}/client.d.ts +59 -60
  90. package/dist/packages/{local-service → engine}/client.js +137 -145
  91. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
  92. package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
  93. package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
  94. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  95. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
  96. package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
  97. package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
  98. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
  99. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
  100. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  101. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
  102. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
  103. package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
  104. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  105. package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
  106. package/dist/packages/{compiler → engine/compile}/index.js +1 -0
  107. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
  108. package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
  109. package/dist/packages/engine/compile/method-runs.d.ts +14 -0
  110. package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
  111. package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
  112. package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
  113. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
  114. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
  115. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  116. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
  117. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  118. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
  119. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
  120. package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
  121. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
  122. package/dist/packages/engine/compile/source-files.d.ts +46 -0
  123. package/dist/packages/engine/compile/source-files.js +149 -0
  124. package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
  125. package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
  126. package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
  127. package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
  128. package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
  129. package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
  130. package/dist/packages/engine/compile/state-paths.js +16 -0
  131. package/dist/packages/engine/compile/state-view.d.ts +5 -0
  132. package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
  133. package/dist/packages/engine/compile/state.d.ts +7 -0
  134. package/dist/packages/{compiler → engine/compile}/state.js +3 -3
  135. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
  136. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  137. package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
  138. package/dist/packages/engine/connection-config.d.ts +38 -0
  139. package/dist/packages/engine/connection-config.js +75 -0
  140. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
  141. package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
  142. package/dist/packages/engine/index.d.ts +22 -0
  143. package/dist/packages/engine/index.js +15 -0
  144. package/dist/packages/engine/instance-paths.d.ts +100 -0
  145. package/dist/packages/engine/instance-paths.js +165 -0
  146. package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
  147. package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
  148. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  149. package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
  150. package/dist/packages/engine/preparation-store.d.ts +104 -0
  151. package/dist/packages/engine/preparation-store.js +194 -0
  152. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  153. package/dist/packages/engine/routes.d.ts +78 -0
  154. package/dist/packages/engine/routes.js +92 -0
  155. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  156. package/dist/packages/{local-service → engine}/run-observability.js +25 -24
  157. package/dist/packages/engine/runtime-caches.d.ts +76 -0
  158. package/dist/packages/engine/runtime-caches.js +191 -0
  159. package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
  160. package/dist/packages/engine/runtime-event-applier.js +177 -0
  161. package/dist/packages/engine/runtime-persistence.d.ts +47 -0
  162. package/dist/packages/engine/runtime-persistence.js +137 -0
  163. package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
  164. package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
  165. package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
  166. package/dist/packages/engine/runtime-resource-builders.js +149 -0
  167. package/dist/packages/engine/runtime.d.ts +318 -0
  168. package/dist/packages/{local-service → engine}/runtime.js +835 -1011
  169. package/dist/packages/{local-service → engine}/server.d.ts +15 -0
  170. package/dist/packages/engine/server.js +1257 -0
  171. package/dist/packages/engine/service-registry.d.ts +47 -0
  172. package/dist/packages/engine/service-registry.js +137 -0
  173. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
  174. package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
  175. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
  176. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
  177. package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
  178. package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
  179. package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
  180. package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
  181. package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
  182. package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
  183. package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
  184. package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
  185. package/dist/packages/{testing → engine/verify}/test.js +1 -1
  186. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
  187. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
  188. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  189. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  190. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  191. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +4 -5
  192. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
  193. package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
  194. package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
  195. package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
  196. package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
  197. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  198. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
  199. package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
  200. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
  201. package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
  202. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
  203. package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
  204. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  205. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  206. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  207. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +3 -31
  208. package/dist/packages/methods/package/user-methods.d.ts +17 -0
  209. package/dist/packages/methods/package/user-methods.js +77 -0
  210. package/dist/packages/{project-model → project}/index.d.ts +0 -1
  211. package/dist/packages/{project-model → project}/index.js +0 -1
  212. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  213. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  214. package/dist/packages/{project-model → project}/interf-detect.d.ts +8 -3
  215. package/dist/packages/{project-model → project}/interf-detect.js +38 -38
  216. package/dist/packages/project/interf-scaffold.d.ts +3 -0
  217. package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
  218. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  219. package/dist/packages/{project-model → project}/lib/schema.js +39 -2
  220. package/dist/packages/project/preparation-entries.d.ts +11 -0
  221. package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
  222. package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
  223. package/dist/packages/{project-model → project}/source-config.js +81 -53
  224. package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
  225. package/dist/packages/{project-model → project}/source-folders.js +16 -16
  226. package/package.json +8 -8
  227. package/CHANGELOG.md +0 -93
  228. package/LICENSE +0 -183
  229. package/dist/cli/commands/action-input-cli.d.ts +0 -25
  230. package/dist/cli/commands/action-input-cli.js +0 -73
  231. package/dist/cli/commands/control-path.d.ts +0 -11
  232. package/dist/cli/commands/control-path.js +0 -72
  233. package/dist/cli/commands/create-method-wizard.d.ts +0 -64
  234. package/dist/cli/commands/create-method-wizard.js +0 -434
  235. package/dist/cli/commands/create.d.ts +0 -6
  236. package/dist/cli/commands/create.js +0 -183
  237. package/dist/cli/commands/default.d.ts +0 -2
  238. package/dist/cli/commands/default.js +0 -39
  239. package/dist/cli/commands/executor-flow.d.ts +0 -29
  240. package/dist/cli/commands/executor-flow.js +0 -163
  241. package/dist/cli/commands/init.d.ts +0 -26
  242. package/dist/cli/commands/init.js +0 -771
  243. package/dist/cli/commands/list.d.ts +0 -2
  244. package/dist/cli/commands/list.js +0 -30
  245. package/dist/cli/commands/preparation-action.d.ts +0 -8
  246. package/dist/cli/commands/preparation-action.js +0 -29
  247. package/dist/cli/commands/preparation-picker.d.ts +0 -5
  248. package/dist/cli/commands/preparation-picker.js +0 -36
  249. package/dist/cli/commands/preparation-selection.d.ts +0 -6
  250. package/dist/cli/commands/preparation-selection.js +0 -11
  251. package/dist/cli/commands/service-action-flow.d.ts +0 -9
  252. package/dist/cli/commands/service-action-flow.js +0 -19
  253. package/dist/cli/commands/source-config-wizard.d.ts +0 -51
  254. package/dist/cli/commands/source-config-wizard.js +0 -670
  255. package/dist/cli/commands/test.d.ts +0 -17
  256. package/dist/cli/commands/test.js +0 -188
  257. package/dist/packages/agents/lib/detection.d.ts +0 -7
  258. package/dist/packages/agents/lib/user-config.js +0 -16
  259. package/dist/packages/compiler/method-runs.d.ts +0 -15
  260. package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
  261. package/dist/packages/compiler/raw-snapshot.js +0 -101
  262. package/dist/packages/compiler/state-artifacts.d.ts +0 -8
  263. package/dist/packages/compiler/state-paths.js +0 -13
  264. package/dist/packages/compiler/state-view.d.ts +0 -4
  265. package/dist/packages/compiler/state.d.ts +0 -7
  266. package/dist/packages/local-service/index.d.ts +0 -18
  267. package/dist/packages/local-service/index.js +0 -13
  268. package/dist/packages/local-service/routes.d.ts +0 -32
  269. package/dist/packages/local-service/routes.js +0 -37
  270. package/dist/packages/local-service/runtime.d.ts +0 -133
  271. package/dist/packages/local-service/server.js +0 -627
  272. package/dist/packages/method-package/index.d.ts +0 -11
  273. package/dist/packages/method-package/index.js +0 -11
  274. package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
  275. package/dist/packages/method-package/method-stage-policy.js +0 -31
  276. package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
  277. package/dist/packages/project-model/preparation-entries.d.ts +0 -11
  278. package/dist/packages/project-model/project-paths.d.ts +0 -12
  279. package/dist/packages/project-model/project-paths.js +0 -33
  280. package/dist/packages/shared/filesystem.d.ts +0 -2
  281. package/dist/packages/shared/filesystem.js +0 -55
  282. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
  283. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
  284. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
  285. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  286. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  287. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  288. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  289. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  290. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  291. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  292. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  293. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  294. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  295. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  296. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  297. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  298. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  299. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  300. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  301. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  302. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  303. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  304. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  305. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  306. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  307. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  308. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  309. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  310. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  311. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  312. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  313. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  314. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  315. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  316. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  317. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  318. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  319. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  320. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  321. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  322. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  323. /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
  324. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  325. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  326. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  327. /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
  328. /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
  329. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  330. /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
  331. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  332. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  333. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  334. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  335. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  336. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  337. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  338. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  339. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  340. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  341. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  342. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  343. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  344. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  345. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  346. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  347. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  348. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  349. /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
  350. /package/dist/packages/{testing → engine/verify}/index.js +0 -0
  351. /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
  352. /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
  353. /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
  354. /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
  355. /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
  356. /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
  357. /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
  358. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  359. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  360. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  361. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  362. /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
  363. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  364. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  365. /package/dist/packages/{project-model → project}/interf.js +0 -0
@@ -1,15 +1,129 @@
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
- export const LocalServiceHostSchema = z.string().min(1);
7
+ // ───────────────────────────────────────────────────────────────────────────
8
+ // 0.13 — preparation-first additions
9
+ // ───────────────────────────────────────────────────────────────────────────
10
+ /** Source binding shape on the API (only `local-folder` ships in 0.13). */
11
+ export const SourceBindingSchema = z.object({
12
+ kind: z.enum(["local-folder"]),
13
+ locator: z.string().min(1),
14
+ }).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;
22
+ /** Per-instance metadata from `GET /v1/instance` (replaces /v1/status). */
23
+ export const InstanceResourceSchema = z.object({
24
+ kind: z.literal("interf-instance"),
25
+ version: z.literal(1),
26
+ url: z.string().min(1),
27
+ host: z.string().min(1),
28
+ port: z.number().int().min(1).max(65535),
29
+ started_at: z.string().min(1),
30
+ package_version: z.string().min(1).optional(),
31
+ preparation_count: z.number().int().min(0),
32
+ active_run_count: z.number().int().min(0),
33
+ idle_for_seconds: z.number().int().min(0),
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(),
42
+ }).strict();
43
+ /** Body of `POST /v1/preparations` — the 0.13 preparation create request. */
44
+ export const PreparationCreateRequestSchema = z.object({
45
+ id: PreparationNameSchema,
46
+ source: SourceBindingSchema,
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(),
53
+ about: z.string().min(1).optional(),
54
+ checks: z.array(SourceReadinessCheckSchema).default([]),
55
+ max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
56
+ max_loops: SourceCompiledMaxLoopsSchema.optional(),
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();
63
+ /** Body of `POST /v1/methods` — install a Method package by path. */
64
+ export const MethodInstallRequestSchema = z.object({
65
+ source_path: z.string().min(1),
66
+ overwrite: z.boolean().default(false),
67
+ }).strict();
68
+ export const MethodInstallResultSchema = z.object({
69
+ method_id: MethodIdSchema,
70
+ installed: z.boolean(),
71
+ path: z.string().min(1),
72
+ }).strict();
73
+ export const PreparationDeleteResponseSchema = z.object({
74
+ deleted: z.boolean(),
75
+ id: PreparationNameSchema,
76
+ }).strict();
77
+ /**
78
+ * The local service must only ever bind to a loopback interface. Any other
79
+ * host (LAN IP, 0.0.0.0, public address) lets a remote browser tab POST at
80
+ * the service, which is the CSRF model we are explicitly rejecting. Keep
81
+ * the allowlist literal — refactoring to a `.refine()` over `z.string()`
82
+ * would lose the static type narrowing.
83
+ */
84
+ export const LOCAL_SERVICE_LOOPBACK_HOSTS = ["127.0.0.1", "localhost", "::1"];
85
+ export const LocalServiceHostSchema = z
86
+ .string()
87
+ .min(1)
88
+ .refine((value) => LOCAL_SERVICE_LOOPBACK_HOSTS.includes(value), {
89
+ message: `Local service host must be one of: ${LOCAL_SERVICE_LOOPBACK_HOSTS.join(", ")}.`,
90
+ });
8
91
  export const LocalServicePortSchema = z.number().int().min(1).max(65535);
92
+ /**
93
+ * Per-instance bearer token. Generated at startup with crypto.randomBytes(32)
94
+ * and rendered as a 64-char hex string. Any deviation should fail validation
95
+ * loud and early.
96
+ */
97
+ export const LocalServiceAuthTokenSchema = z
98
+ .string()
99
+ .regex(/^[0-9a-f]{64}$/i, "Auth token must be a 64-character hex string.");
9
100
  export const LocalServiceConfigSchema = z.object({
10
101
  host: LocalServiceHostSchema.default("127.0.0.1"),
11
102
  port: LocalServicePortSchema.default(4873),
12
103
  }).strict();
104
+ export const ServiceRegistryWorkspaceSchema = z.object({
105
+ control_path: z.string().min(1),
106
+ registered_at: z.string().min(1),
107
+ last_activity: z.string().min(1),
108
+ }).strict();
109
+ export const ServiceRegistryEntrySchema = z.object({
110
+ pid: z.number().int().positive(),
111
+ host: LocalServiceHostSchema,
112
+ port: LocalServicePortSchema,
113
+ url: z.string().min(1),
114
+ started_at: z.string().min(1),
115
+ /**
116
+ * Bearer token mutating clients must send. Optional in the schema so
117
+ * older registry files (pre-0.12.1) keep parsing; the runtime treats a
118
+ * missing token as "open" only when the entry already exists on disk —
119
+ * fresh entries always have one.
120
+ */
121
+ auth_token: LocalServiceAuthTokenSchema.optional(),
122
+ workspaces: z.array(ServiceRegistryWorkspaceSchema).default([]),
123
+ }).strict();
124
+ export const ServiceRegistrySchema = z.object({
125
+ services: z.array(ServiceRegistryEntrySchema).default([]),
126
+ }).strict();
13
127
  export const LocalServiceHealthSchema = z.object({
14
128
  kind: z.literal("interf-local-service-health"),
15
129
  version: z.literal(1),
@@ -21,6 +135,10 @@ export const LocalServiceHealthSchema = z.object({
21
135
  source_folder_path: z.string().min(1).nullable().optional(),
22
136
  started_at: z.string().min(1).optional(),
23
137
  package_version: z.string().min(1).optional(),
138
+ instance_started_at: z.string().min(1).optional(),
139
+ registered_workspaces: z.array(ServiceRegistryWorkspaceSchema).default([]),
140
+ active_runs: z.number().int().min(0).default(0),
141
+ idle_for_seconds: z.number().int().min(0).default(0),
24
142
  }).strict();
25
143
  export const LocalServiceErrorSchema = z.object({
26
144
  error: z.object({
@@ -35,8 +153,12 @@ export const LocalServicePointerSchema = z.object({
35
153
  pid: z.number().int().positive(),
36
154
  control_path: z.string().min(1),
37
155
  started_at: z.string().min(1),
156
+ /**
157
+ * Per-workspace copy of the bearer token. Optional so legacy pointer
158
+ * files keep parsing during upgrades; new pointers always include it.
159
+ */
160
+ auth_token: LocalServiceAuthTokenSchema.optional(),
38
161
  }).strict();
39
- export const PreparationReadinessStateSchema = ReadinessStateSchema;
40
162
  export const PortableContextMappingSchema = z.object({
41
163
  preparation: PreparationNameSchema,
42
164
  path: z.string().min(1).nullable(),
@@ -58,7 +180,7 @@ export const PreparationResourceSchema = z.object({
58
180
  checks: z.array(SourceReadinessCheckSchema).default([]),
59
181
  portable_context: PortableContextMappingSchema,
60
182
  portable_context_path: z.string().min(1).nullable(),
61
- readiness: PreparationReadinessStateSchema,
183
+ readiness: ReadinessStateSchema,
62
184
  runs: PreparationRunLinkageSchema,
63
185
  latest_compile_run_id: z.string().min(1).nullable().optional(),
64
186
  latest_test_run_id: z.string().min(1).nullable().optional(),
@@ -79,6 +201,12 @@ export const MethodResourceSchema = z.object({
79
201
  description: z.string().min(1).optional(),
80
202
  contract_type: z.string().min(1),
81
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"),
82
210
  reads: z.array(z.string().min(1)).default([]),
83
211
  writes: z.array(z.string().min(1)).default([]),
84
212
  acceptance: z.record(z.string(), z.unknown()).optional(),
@@ -110,13 +238,14 @@ export const LocalJobTypeSchema = z.enum([
110
238
  "method-authoring",
111
239
  "method-improvement",
112
240
  ]);
113
- export const LocalJobStatusSchema = z.enum([
241
+ export const RunStatusSchema = z.enum([
114
242
  "queued",
115
243
  "running",
116
244
  "succeeded",
117
245
  "failed",
118
246
  "cancelled",
119
247
  ]);
248
+ export const LocalJobStatusSchema = RunStatusSchema;
120
249
  export const LocalRunHandlerResultSchema = z.object({
121
250
  ok: z.boolean(),
122
251
  error: z.string().min(1).optional(),
@@ -309,22 +438,23 @@ export const LocalJobRunResourceSchema = z.object({
309
438
  result: z.record(z.string(), z.unknown()).nullable().optional(),
310
439
  error: z.string().min(1).nullable().optional(),
311
440
  }).strict();
312
- export const TestRunStatusSchema = z.enum([
313
- "queued",
314
- "running",
315
- "succeeded",
316
- "failed",
317
- "cancelled",
318
- ]);
319
- 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({
320
452
  preparation: PreparationNameSchema,
321
- mode: TestRunModeSchema.default("both"),
322
453
  }).strict();
323
- export const TestRunResourceSchema = z.object({
454
+ export const VerifyRunResourceSchema = z.object({
324
455
  run_id: z.string().min(1),
325
- status: TestRunStatusSchema,
456
+ status: VerifyRunStatusSchema,
326
457
  preparation: PreparationNameSchema,
327
- mode: TestRunModeSchema,
328
458
  source_path: z.string().min(1),
329
459
  portable_context_path: z.string().min(1).nullable(),
330
460
  started_at: z.string().nullable().optional(),
@@ -425,7 +555,7 @@ const ActionProposalResourceBaseSchema = z.object({
425
555
  proposed_by_executor: LocalJobAgentSchema.nullable().optional(),
426
556
  approval: ActionProposalApprovalSchema.nullable().optional(),
427
557
  submitted_run_id: z.string().min(1).nullable().optional(),
428
- 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(),
429
559
  error: z.string().min(1).nullable().optional(),
430
560
  }).strict();
431
561
  export const ActionProposalResourceSchema = z.discriminatedUnion("action_type", [
@@ -439,7 +569,7 @@ export const ActionProposalResourceSchema = z.discriminatedUnion("action_type",
439
569
  }).strict(),
440
570
  ActionProposalResourceBaseSchema.extend({
441
571
  action_type: z.literal("test"),
442
- request: TestRunCreateRequestSchema,
572
+ request: VerifyRunCreateRequestSchema,
443
573
  }).strict(),
444
574
  ActionProposalResourceBaseSchema.extend({
445
575
  action_type: z.literal("readiness-check-draft"),
@@ -464,7 +594,7 @@ export const PortableContextResourceSchema = z.object({
464
594
  latest_test_run_id: z.string().min(1).nullable().optional(),
465
595
  artifacts: z.array(ArtifactRefSchema).default([]),
466
596
  }).strict();
467
- export const ReadinessResourceSchema = PreparationReadinessStateSchema;
597
+ export const ReadinessResourceSchema = ReadinessStateSchema;
468
598
  export const SourceFileResourceSchema = z.object({
469
599
  preparation: PreparationNameSchema,
470
600
  path: z.string().min(1),
@@ -494,13 +624,21 @@ export const LocalServiceDiscoverySchema = z.object({
494
624
  preparation_setups: z.string().min(1),
495
625
  preparation_changes: z.string().min(1),
496
626
  method_changes: z.string().min(1),
627
+ workspace_bootstraps: z.string().min(1).optional(),
497
628
  readiness_check_drafts: z.string().min(1),
498
629
  method_authoring_runs: z.string().min(1),
499
630
  method_improvement_runs: z.string().min(1),
500
631
  compile_runs: z.string().min(1),
501
- test_runs: z.string().min(1),
632
+ verify_runs: z.string().min(1),
502
633
  reset: z.string().min(1),
503
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(),
640
+ workspaces: z.string().min(1).optional(),
641
+ status: z.string().min(1).optional(),
504
642
  }).strict(),
505
643
  }).strict();
506
644
  export const OpenPathRequestSchema = z.object({
@@ -510,56 +648,6 @@ export const OpenPathResponseSchema = z.object({
510
648
  opened: z.boolean(),
511
649
  path: z.string().min(1),
512
650
  }).strict();
513
- export const LocalServiceResourceSchema = z.discriminatedUnion("kind", [
514
- z.object({
515
- kind: z.literal("preparation"),
516
- value: PreparationResourceSchema,
517
- }).strict(),
518
- z.object({
519
- kind: z.literal("method"),
520
- value: MethodResourceSchema,
521
- }).strict(),
522
- z.object({
523
- kind: z.literal("compile-run"),
524
- value: CompileRunResourceSchema,
525
- }).strict(),
526
- z.object({
527
- kind: z.literal("job-run"),
528
- value: LocalJobRunResourceSchema,
529
- }).strict(),
530
- z.object({
531
- kind: z.literal("test-run"),
532
- value: TestRunResourceSchema,
533
- }).strict(),
534
- z.object({
535
- kind: z.literal("run-observability"),
536
- value: RunObservabilityResourceSchema,
537
- }).strict(),
538
- z.object({
539
- kind: z.literal("executor-status"),
540
- value: LocalExecutorStatusSchema,
541
- }).strict(),
542
- z.object({
543
- kind: z.literal("action-proposal"),
544
- value: ActionProposalResourceSchema,
545
- }).strict(),
546
- z.object({
547
- kind: z.literal("portable-context"),
548
- value: PortableContextResourceSchema,
549
- }).strict(),
550
- z.object({
551
- kind: z.literal("readiness"),
552
- value: ReadinessResourceSchema,
553
- }).strict(),
554
- z.object({
555
- kind: z.literal("source-file"),
556
- value: SourceFileResourceSchema,
557
- }).strict(),
558
- z.object({
559
- kind: z.literal("workspace-file"),
560
- value: WorkspaceFileResourceSchema,
561
- }).strict(),
562
- ]);
563
651
  export const PreparationListResponseSchema = z.object({
564
652
  preparations: z.array(PreparationResourceSchema),
565
653
  }).strict();
@@ -572,8 +660,8 @@ export const CompileRunListResponseSchema = z.object({
572
660
  export const LocalJobRunListResponseSchema = z.object({
573
661
  jobs: z.array(LocalJobRunResourceSchema),
574
662
  }).strict();
575
- export const TestRunListResponseSchema = z.object({
576
- test_runs: z.array(TestRunResourceSchema),
663
+ export const VerifyRunListResponseSchema = z.object({
664
+ verify_runs: z.array(VerifyRunResourceSchema),
577
665
  }).strict();
578
666
  export const RunObservabilityListResponseSchema = z.object({
579
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,
@@ -84,7 +88,7 @@ function printSavedReadinessOutcome(prefix, outcome) {
84
88
  function bestVariationRestorePaths(compiledPath) {
85
89
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
86
90
  const zonePaths = (schema?.zones ?? [])
87
- .filter((zone) => zone.id !== "raw" && zone.kind !== "runtime")
91
+ .filter((zone) => zone.kind !== "runtime")
88
92
  .map((zone) => zone.path);
89
93
  return [
90
94
  "AGENTS.md",
@@ -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 === "raw" || request.mode === "both") && !result.rawOutcome;
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 {
@@ -601,7 +645,7 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
601
645
  message: `Using ${executor.displayName} for Method authoring.`,
602
646
  });
603
647
  const result = await runMethodAuthoringDraft({
604
- sourcePath: context.sourcePath,
648
+ prepDataDir: context.sourcePath,
605
649
  sourceFolderPath: request.source_folder_path,
606
650
  baseMethodId: request.reference_method_id ?? request.base_method_id,
607
651
  methodId: request.method_id,
@@ -0,0 +1,104 @@
1
+ /**
2
+ * 0.13 preparation store.
3
+ *
4
+ * Each preparation lives at `~/.interf/preparations/<id>/` and is also
5
+ * registered with the runtime as a synthetic workspace so the existing
6
+ * compile / test / readiness machinery (preparation-keyed under the hood)
7
+ * keeps working without a parallel implementation.
8
+ *
9
+ * ~/.interf/preparations/<id>/
10
+ * interf.json ← preparation config, single preparation entry name=<id>
11
+ * <id>/ ← portable context (matches preparation name)
12
+ *
13
+ * NOTE: We keep the synthetic `interf.json` shape (with a `preparations[]`
14
+ * array of length 1, name=id, path=id) so the existing compile/test
15
+ * machinery stays functional. The doc-shape `config.json` /
16
+ * `portable-context/` from `instance-paths.ts` is aspirational; transitioning
17
+ * the entire compile pipeline to read those names is out of scope for the
18
+ * 0.13 cutover.
19
+ *
20
+ * Public callers reach this through the preparation-keyed HTTP routes.
21
+ */
22
+ import type { SourcePreparationConfig } from "../project/lib/schema.js";
23
+ import type { LocalServiceRuntime } from "./runtime.js";
24
+ export interface PreparationCreateInput {
25
+ id: string;
26
+ source: {
27
+ kind: "local-folder";
28
+ locator: string;
29
+ };
30
+ /** Method binding. Null/undefined means "not bound yet" — bind later via update. */
31
+ method_id?: string | null;
32
+ about?: string;
33
+ checks?: Array<{
34
+ question: string;
35
+ answer?: string;
36
+ strictness?: string;
37
+ expect?: string;
38
+ }>;
39
+ max_attempts?: number;
40
+ max_loops?: number;
41
+ }
42
+ export interface PreparationUpdateInput {
43
+ method_id?: string | null;
44
+ about?: string | null;
45
+ }
46
+ export interface StoredPreparation {
47
+ id: string;
48
+ prepDataDir: string;
49
+ source: {
50
+ kind: "local-folder";
51
+ locator: string;
52
+ };
53
+ /** Null when no method has been bound to this preparation yet. */
54
+ methodId: string | null;
55
+ about: string | null;
56
+ config: SourcePreparationConfig;
57
+ portableContextPath: string;
58
+ configPath: string;
59
+ }
60
+ /** List every preparation registered under `~/.interf/preparations/`. */
61
+ export declare function listStoredPreparations(): StoredPreparation[];
62
+ /** Read one preparation by id. Returns null when missing. */
63
+ export declare function getStoredPreparation(prepId: string): StoredPreparation | null;
64
+ /**
65
+ * Create a preparation: scaffold its data dir, write the synthetic
66
+ * workspace config, and register it with the runtime so subsequent
67
+ * compile / test / readiness calls find it.
68
+ *
69
+ * Throws on validation errors (bad id, bad method id, source missing).
70
+ */
71
+ export declare function createStoredPreparation(runtime: LocalServiceRuntime, input: PreparationCreateInput): StoredPreparation;
72
+ /**
73
+ * Delete a preparation: deregister its synthetic workspace and remove
74
+ * `~/.interf/preparations/<id>/` from disk. Returns true when something
75
+ * was actually removed.
76
+ */
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;
84
+ /**
85
+ * Re-register every preparation directory with the runtime on startup so
86
+ * synthetic workspaces survive a `interf web` restart.
87
+ */
88
+ export declare function rehydratePreparations(runtime: LocalServiceRuntime): void;
89
+ /** Build the wire shape for `GET /v1/preparations/<id>` given a stored preparation. */
90
+ export declare function preparationWireShape(stored: StoredPreparation): {
91
+ id: string;
92
+ source: {
93
+ kind: string;
94
+ locator: string;
95
+ };
96
+ method_id: string | null;
97
+ about: string | null;
98
+ config_path: string;
99
+ portable_context: {
100
+ kind: "local-path";
101
+ value: string;
102
+ };
103
+ checks: SourcePreparationConfig["checks"];
104
+ };