@interf/compiler 0.13.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +40 -0
  2. package/agent-skills/interf-actions/SKILL.md +51 -5
  3. package/agent-skills/interf-actions/references/cli.md +82 -82
  4. package/dist/cli/commands/agents.d.ts +2 -0
  5. package/dist/cli/commands/agents.js +213 -0
  6. package/dist/cli/commands/compile.js +10 -1
  7. package/dist/cli/commands/doctor.js +1 -1
  8. package/dist/cli/commands/login.js +1 -1
  9. package/dist/cli/commands/logout.js +1 -1
  10. package/dist/cli/commands/mcp.d.ts +42 -0
  11. package/dist/cli/commands/mcp.js +239 -0
  12. package/dist/cli/commands/method.js +1 -1
  13. package/dist/cli/commands/prep.js +23 -5
  14. package/dist/cli/commands/reset.js +1 -1
  15. package/dist/cli/commands/runs.js +1 -1
  16. package/dist/cli/commands/status.js +1 -1
  17. package/dist/cli/commands/verify.d.ts +8 -0
  18. package/dist/cli/commands/{test.js → verify.js} +24 -18
  19. package/dist/cli/commands/web.js +71 -18
  20. package/dist/cli/commands/wizard.js +373 -126
  21. package/dist/cli/index.d.ts +4 -2
  22. package/dist/cli/index.js +7 -3
  23. package/dist/compiler-ui/404.html +1 -1
  24. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  25. package/dist/compiler-ui/__next._full.txt +3 -3
  26. package/dist/compiler-ui/__next._head.txt +1 -1
  27. package/dist/compiler-ui/__next._index.txt +2 -2
  28. package/dist/compiler-ui/__next._tree.txt +2 -2
  29. package/dist/compiler-ui/_next/static/chunks/{17t-lulmyawg5.js → 0jipmpez3_ehh.js} +16 -16
  30. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 13awzu4tooflw.css} +1 -1
  31. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  32. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  33. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  34. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  35. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  36. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  37. package/dist/compiler-ui/_not-found.html +1 -1
  38. package/dist/compiler-ui/_not-found.txt +2 -2
  39. package/dist/compiler-ui/index.html +1 -1
  40. package/dist/compiler-ui/index.txt +3 -3
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +2 -2
  43. package/dist/packages/contracts/index.d.ts +2 -1
  44. package/dist/packages/contracts/index.js +1 -0
  45. package/dist/packages/contracts/lib/schema.d.ts +102 -8
  46. package/dist/packages/contracts/lib/schema.js +102 -2
  47. package/dist/packages/{local-service → engine}/action-definitions.js +8 -1
  48. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  49. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  50. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  51. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  52. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  53. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  54. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  55. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  56. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +4 -4
  57. package/dist/packages/{agents → engine/agents}/lib/shells.js +8 -8
  58. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  59. package/dist/packages/engine/agents/registry.d.ts +91 -0
  60. package/dist/packages/engine/agents/registry.js +321 -0
  61. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  62. package/dist/packages/engine/agents/role-executors.js +88 -0
  63. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  64. package/dist/packages/engine/agents/role-router.js +73 -0
  65. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  66. package/dist/packages/{local-service → engine}/client.js +11 -11
  67. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
  68. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  69. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  70. package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
  71. package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
  72. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
  73. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +4 -4
  74. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  75. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
  76. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  77. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  78. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  79. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +4 -4
  80. package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -2
  81. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  82. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  83. package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
  84. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  85. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
  86. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  87. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
  88. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
  89. package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
  90. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
  91. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  92. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  93. package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
  94. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  95. package/dist/packages/{compiler → engine/compile}/state-view.js +2 -2
  96. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
  97. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  98. package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
  99. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +2 -22
  100. package/dist/packages/{execution → engine/execution}/lib/schema.js +2 -2
  101. package/dist/packages/{local-service → engine}/index.d.ts +4 -4
  102. package/dist/packages/{local-service → engine}/index.js +2 -2
  103. package/dist/packages/{local-service → engine}/lib/schema.d.ts +85 -209
  104. package/dist/packages/{local-service → engine}/lib/schema.js +58 -54
  105. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  106. package/dist/packages/{local-service → engine}/native-run-handlers.js +69 -25
  107. package/dist/packages/{local-service → engine}/preparation-store.d.ts +16 -4
  108. package/dist/packages/{local-service → engine}/preparation-store.js +48 -25
  109. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  110. package/dist/packages/{local-service → engine}/routes.d.ts +30 -1
  111. package/dist/packages/{local-service → engine}/routes.js +32 -1
  112. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  113. package/dist/packages/{local-service → engine}/run-observability.js +14 -13
  114. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  115. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  116. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  117. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  118. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  119. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +6 -6
  120. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +1 -1
  121. package/dist/packages/{local-service → engine}/runtime.d.ts +80 -49
  122. package/dist/packages/{local-service → engine}/runtime.js +177 -179
  123. package/dist/packages/{local-service → engine}/server.js +276 -14
  124. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  125. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  126. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +6 -13
  127. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +25 -81
  128. package/dist/packages/{testing → engine/verify}/test-paths.js +2 -2
  129. package/dist/packages/{testing → engine/verify}/test-sandbox.js +6 -6
  130. package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
  131. package/dist/packages/{testing → engine/verify}/test-targets.js +3 -3
  132. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +11 -3
  133. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +68 -5
  134. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  135. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  136. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +15 -9
  137. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +1 -1
  138. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +2 -2
  139. package/dist/packages/{method-package → methods/package}/context-interface.d.ts +1 -1
  140. package/dist/packages/{method-package → methods/package}/context-interface.js +3 -3
  141. package/dist/packages/{method-package → methods/package}/interf-method-package.js +3 -2
  142. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  143. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +8 -2
  144. package/dist/packages/{method-package → methods/package}/local-methods.js +8 -7
  145. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +8 -2
  146. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -4
  147. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -1
  148. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -4
  149. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  150. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  151. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  152. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  153. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  154. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  155. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  156. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  157. package/dist/packages/{project-model → project}/interf-scaffold.js +7 -7
  158. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  159. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  160. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  161. package/dist/packages/{project-model → project}/source-config.js +7 -7
  162. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  163. package/package.json +6 -5
  164. package/dist/cli/commands/test.d.ts +0 -9
  165. package/dist/packages/agents/lib/detection.d.ts +0 -7
  166. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
  167. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
  168. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
  169. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  170. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  171. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  172. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  173. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  174. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  175. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  176. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  177. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  178. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  179. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  180. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  181. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  182. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  183. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  184. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  185. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  186. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  187. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  188. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  189. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  190. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  191. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  192. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  193. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  194. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  195. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  196. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  197. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  198. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  199. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  200. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  201. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  202. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  203. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  204. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  205. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  206. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  207. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  208. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  209. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  210. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  211. /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
  212. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  213. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  214. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  215. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  216. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  217. /package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -0
  218. /package/dist/packages/{compiler → engine/compile}/index.js +0 -0
  219. /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
  220. /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
  221. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  222. /package/dist/packages/{compiler → engine/compile}/reset.js +0 -0
  223. /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
  224. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  225. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -0
  226. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  227. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  228. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  229. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  230. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  231. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +0 -0
  232. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  233. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  234. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  235. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  236. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  237. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  238. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  239. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  240. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  241. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  242. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  243. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  244. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  245. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  246. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  247. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  248. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  249. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  250. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  251. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  252. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  253. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  254. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  255. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  256. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  257. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  258. /package/dist/packages/{local-service → engine}/runtime-event-applier.js +0 -0
  259. /package/dist/packages/{local-service → engine}/server.d.ts +0 -0
  260. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  261. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  262. /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
  263. /package/dist/packages/{testing → engine/verify}/index.js +0 -0
  264. /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
  265. /package/dist/packages/{testing → engine/verify}/test-execution.js +0 -0
  266. /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
  267. /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
  268. /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
  269. /package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -0
  270. /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
  271. /package/dist/packages/{testing → engine/verify}/test-targets.d.ts +0 -0
  272. /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
  273. /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
  274. /package/dist/packages/{testing → engine/verify}/test.d.ts +0 -0
  275. /package/dist/packages/{testing → engine/verify}/test.js +0 -0
  276. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  277. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  278. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  279. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  280. /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
  281. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  282. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  283. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  284. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  285. /package/dist/packages/{project-model → project}/index.js +0 -0
  286. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  287. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  288. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  289. /package/dist/packages/{project-model → project}/interf.js +0 -0
  290. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  291. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  292. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Role router — picks which connected agent runs a given stage role.
3
+ *
4
+ * The compile pipeline calls `resolveAgentForRole` for each agent-typed
5
+ * stage, passing the stage's declared role and the current registry +
6
+ * active agent. The verify pipeline always passes role `"verifier"`.
7
+ *
8
+ * Resolution priority (lean / explicit):
9
+ * 1. Explicit role-map entry for the requested role.
10
+ * 2. Role-map's `general` row (when the requested role isn't mapped).
11
+ * 3. The active agent (when `general` isn't mapped either).
12
+ *
13
+ * If the role-map points at an agent name that no longer exists in the
14
+ * merged agents list (e.g. user uninstalled it), we fall through to
15
+ * `general` then `activeAgent`. Only when ALL three are missing does the
16
+ * router return an error.
17
+ */
18
+ import type { AgentRecord, RoleMap } from "../../contracts/lib/schema.js";
19
+ export type RoleResolutionSource = "explicit" | "fallback-general" | "fallback-active";
20
+ export interface ResolvedAgent {
21
+ agent: AgentRecord;
22
+ /** The role the caller asked for (kept for audit / logging). */
23
+ role: string;
24
+ /** Which fallback rung the agent came from. */
25
+ source: RoleResolutionSource;
26
+ }
27
+ export interface RoleResolutionContext {
28
+ roleMap: RoleMap;
29
+ agents: AgentRecord[];
30
+ /**
31
+ * The agent the role-map's `general` row points at — or, when no
32
+ * role-map exists yet, the first detected agent. Pass `null` when
33
+ * there is no agent available; the router then returns an error.
34
+ */
35
+ activeAgent: AgentRecord | null;
36
+ }
37
+ export type RoleResolutionError = {
38
+ error: "no-agents";
39
+ detail: string;
40
+ } | {
41
+ error: "mapped-agent-missing";
42
+ detail: string;
43
+ };
44
+ /**
45
+ * Resolve a stage role to an agent + provenance trail. Returns
46
+ * `{ agent, role, source }` on success or `{ error, detail }` on
47
+ * failure.
48
+ */
49
+ export declare function resolveAgentForRole(role: string, context: RoleResolutionContext): ResolvedAgent | RoleResolutionError;
50
+ /**
51
+ * Resolve every role declared by a Method's stages. Useful for
52
+ * pre-flight: returns either `{ resolutions }` (one entry per stage)
53
+ * or `{ error, role }` if any stage cannot resolve.
54
+ */
55
+ export declare function resolveAgentsForStages(stages: ReadonlyArray<{
56
+ id: string;
57
+ role: string;
58
+ }>, context: RoleResolutionContext): {
59
+ resolutions: Array<{
60
+ stageId: string;
61
+ resolved: ResolvedAgent;
62
+ }>;
63
+ } | (RoleResolutionError & {
64
+ stageId: string;
65
+ role: string;
66
+ });
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Resolve a stage role to an agent + provenance trail. Returns
3
+ * `{ agent, role, source }` on success or `{ error, detail }` on
4
+ * failure.
5
+ */
6
+ export function resolveAgentForRole(role, context) {
7
+ if (context.agents.length === 0) {
8
+ return {
9
+ error: "no-agents",
10
+ detail: "No agents are available. Install Claude Code, Codex, or another agent CLI, " +
11
+ "or register a custom CLI with `interf agents register`.",
12
+ };
13
+ }
14
+ const trimmedRole = role && role.trim().length > 0 ? role.trim() : "general";
15
+ // 1. Explicit role-map entry for the requested role.
16
+ const explicitName = context.roleMap[trimmedRole];
17
+ if (explicitName) {
18
+ const found = context.agents.find((agent) => agent.name === explicitName);
19
+ if (found) {
20
+ return { agent: found, role: trimmedRole, source: "explicit" };
21
+ }
22
+ // Map exists but points at a missing agent. Fall through to
23
+ // `general` and ultimately `activeAgent`. We do NOT return
24
+ // `mapped-agent-missing` here because the resolution priority
25
+ // explicitly allows fallback through `general` and active —
26
+ // returning an error would block a usable agent.
27
+ }
28
+ // 2. Role-map's `general` row, if the requested role isn't `general`.
29
+ if (trimmedRole !== "general") {
30
+ const generalName = context.roleMap["general"];
31
+ if (generalName) {
32
+ const found = context.agents.find((agent) => agent.name === generalName);
33
+ if (found) {
34
+ return { agent: found, role: trimmedRole, source: "fallback-general" };
35
+ }
36
+ }
37
+ }
38
+ // 3. Active agent.
39
+ if (context.activeAgent) {
40
+ return {
41
+ agent: context.activeAgent,
42
+ role: trimmedRole,
43
+ source: "fallback-active",
44
+ };
45
+ }
46
+ // Map points at an agent we cannot find AND there is no active fallback.
47
+ if (explicitName) {
48
+ return {
49
+ error: "mapped-agent-missing",
50
+ detail: `Role "${trimmedRole}" maps to agent "${explicitName}", which is not detected or registered.`,
51
+ };
52
+ }
53
+ return {
54
+ error: "no-agents",
55
+ detail: `No agent is mapped to role "${trimmedRole}" and no active agent fallback is available.`,
56
+ };
57
+ }
58
+ /**
59
+ * Resolve every role declared by a Method's stages. Useful for
60
+ * pre-flight: returns either `{ resolutions }` (one entry per stage)
61
+ * or `{ error, role }` if any stage cannot resolve.
62
+ */
63
+ export function resolveAgentsForStages(stages, context) {
64
+ const resolutions = [];
65
+ for (const stage of stages) {
66
+ const result = resolveAgentForRole(stage.role, context);
67
+ if ("error" in result) {
68
+ return { ...result, stageId: stage.id, role: stage.role };
69
+ }
70
+ resolutions.push({ stageId: stage.id, resolved: result });
71
+ }
72
+ return { resolutions };
73
+ }
@@ -1,4 +1,4 @@
1
- import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type TestRunCreateRequest, type TestRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
1
+ import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type VerifyRunCreateRequest, type VerifyRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
2
2
  export interface FindOrStartLocalServiceOptions {
3
3
  url?: string;
4
4
  authToken?: string;
@@ -41,12 +41,12 @@ export declare function submitCompileRunToLocalService(options: {
41
41
  serviceUrl: string;
42
42
  resource: CompileRunResource;
43
43
  } | null>;
44
- export declare function submitTestRunToLocalService(options: {
44
+ export declare function submitVerifyRunToLocalService(options: {
45
45
  preparationId: string;
46
- request: TestRunCreateRequest;
46
+ request: VerifyRunCreateRequest;
47
47
  }): Promise<{
48
48
  serviceUrl: string;
49
- resource: TestRunResource;
49
+ resource: VerifyRunResource;
50
50
  } | null>;
51
51
  export declare function submitResetToLocalService(options: {
52
52
  preparationId: string;
@@ -103,18 +103,18 @@ export declare function waitForLocalCompileRun(options: {
103
103
  authToken?: string | null;
104
104
  onUpdate?: (resource: CompileRunResource) => void;
105
105
  }): Promise<CompileRunResource>;
106
- export declare function getLocalTestRun(options: {
106
+ export declare function getLocalVerifyRun(options: {
107
107
  serviceUrl: string;
108
108
  runId: string;
109
109
  authToken?: string | null;
110
- }): Promise<TestRunResource>;
111
- export declare function waitForLocalTestRun(options: {
110
+ }): Promise<VerifyRunResource>;
111
+ export declare function waitForLocalVerifyRun(options: {
112
112
  serviceUrl: string;
113
113
  runId: string;
114
114
  pollMs?: number;
115
115
  authToken?: string | null;
116
- onUpdate?: (resource: TestRunResource) => void;
117
- }): Promise<TestRunResource>;
116
+ onUpdate?: (resource: VerifyRunResource) => void;
117
+ }): Promise<VerifyRunResource>;
118
118
  export declare function getLocalJobRun(options: {
119
119
  serviceUrl: string;
120
120
  runId: string;
@@ -1,4 +1,4 @@
1
- import { CompileRunCreateRequestSchema, CompileRunResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, TestRunCreateRequestSchema, TestRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
1
+ import { CompileRunCreateRequestSchema, CompileRunResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, VerifyRunCreateRequestSchema, VerifyRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
2
2
  import { LOCAL_SERVICE_ROUTES, buildLocalServiceUrl, preparationSubresourcePath, } from "./routes.js";
3
3
  import { readActiveConnection } from "./connection-config.js";
4
4
  async function connectOrNull(options = {}) {
@@ -8,8 +8,8 @@ async function connectOrNull(options = {}) {
8
8
  });
9
9
  if (!conn)
10
10
  return null;
11
- // Probe the engine; we expose the LocalServiceHealth-shaped object the
12
- // legacy callers expect so submitCompileRun et al. keep compiling.
11
+ // Probe the engine and surface a LocalServiceHealth object that
12
+ // submitCompileRun et al. consume.
13
13
  try {
14
14
  const headers = {};
15
15
  if (conn.auth_token)
@@ -102,13 +102,13 @@ export async function submitCompileRunToLocalService(options) {
102
102
  resource,
103
103
  };
104
104
  }
105
- export async function submitTestRunToLocalService(options) {
105
+ export async function submitVerifyRunToLocalService(options) {
106
106
  const connection = await connectOrNull();
107
107
  if (!connection)
108
108
  return null;
109
- const request = TestRunCreateRequestSchema.parse(options.request);
110
- const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "testRuns")}`;
111
- const resource = TestRunResourceSchema.parse(await fetchJson(url, {
109
+ const request = VerifyRunCreateRequestSchema.parse(options.request);
110
+ const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "verifyRuns")}`;
111
+ const resource = VerifyRunResourceSchema.parse(await fetchJson(url, {
112
112
  method: "POST",
113
113
  body: JSON.stringify(request),
114
114
  headers: authHeaders(connection.authToken),
@@ -235,19 +235,19 @@ export async function waitForLocalCompileRun(options) {
235
235
  }
236
236
  }
237
237
  }
238
- export async function getLocalTestRun(options) {
239
- return TestRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/test-runs/${encodeURIComponent(options.runId)}`, {
238
+ export async function getLocalVerifyRun(options) {
239
+ return VerifyRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/verify-runs/${encodeURIComponent(options.runId)}`, {
240
240
  method: "GET",
241
241
  timeoutMs: 2000,
242
242
  headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
243
243
  }));
244
244
  }
245
- export async function waitForLocalTestRun(options) {
245
+ export async function waitForLocalVerifyRun(options) {
246
246
  // Same exponential backoff as `waitForLocalCompileRun`.
247
247
  const explicit = options.pollMs;
248
248
  let delay = explicit ?? 250;
249
249
  while (true) {
250
- const resource = await getLocalTestRun({
250
+ const resource = await getLocalVerifyRun({
251
251
  serviceUrl: options.serviceUrl,
252
252
  runId: options.runId,
253
253
  authToken: options.authToken ?? null,
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
- import { listFilesRecursive } from "../shared/filesystem.js";
2
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
3
3
  import { compiledZoneAbsolutePath } from "./compiled-schema.js";
4
4
  const SCAFFOLD_PLACEHOLDER_SNIPPETS = [
5
5
  "Not yet compiled. Run `interf compile` to build the portable context.",
@@ -1,5 +1,5 @@
1
1
  import { type MethodExecutor } from "../agents/lib/executors.js";
2
- import { type MethodReporter, type MethodStageResult } from "../method-package/method-helpers.js";
2
+ import { type MethodReporter, type MethodStageResult } from "../../methods/package/method-helpers.js";
3
3
  import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
4
4
  import type { RunEventSink } from "../execution/events.js";
5
5
  export interface CompiledSummarizeResult extends MethodStageResult {
@@ -15,8 +15,17 @@ export interface CompiledCompileResult {
15
15
  failedStage: string | null;
16
16
  }
17
17
  export type StageShellRetentionMode = "on-failure" | "always";
18
+ /**
19
+ * Per-stage executor resolver. When provided, the pipeline calls this
20
+ * for each stage and uses the returned executor instead of the
21
+ * top-level `executor`. The top-level `executor` stays as the default
22
+ * fallback so single-active-agent setups keep working without any
23
+ * resolver wired up.
24
+ */
25
+ export type ResolveStageExecutor = (stage: CompiledStageExecutionDefinition) => MethodExecutor;
18
26
  export declare function runCompiledSummarize(options: {
19
27
  executor: MethodExecutor;
28
+ resolveStageExecutor?: ResolveStageExecutor;
20
29
  compiledPath: string;
21
30
  reporter?: MethodReporter;
22
31
  reportSummary?: boolean;
@@ -28,6 +37,7 @@ export declare function runCompiledSummarize(options: {
28
37
  }): Promise<CompiledSummarizeResult>;
29
38
  export declare function runCompiledCompile(options: {
30
39
  executor: MethodExecutor;
40
+ resolveStageExecutor?: ResolveStageExecutor;
31
41
  compiledPath: string;
32
42
  reporter?: MethodReporter;
33
43
  reportStep?: boolean;
@@ -37,6 +47,7 @@ export declare function runCompiledCompile(options: {
37
47
  }): Promise<MethodStageResult>;
38
48
  export declare function compileCompiled(options: {
39
49
  executor: MethodExecutor;
50
+ resolveStageExecutor?: ResolveStageExecutor;
40
51
  compiledPath: string;
41
52
  reporter?: MethodReporter;
42
53
  preserveStageShells?: StageShellRetentionMode;
@@ -1,15 +1,25 @@
1
1
  import { refreshCompiledBootstrapGuidance, } from "../agents/lib/compiled-bootstrap.js";
2
- import { validateMethodPackage } from "../method-package/local-methods.js";
3
- import { reportValidationFailure, } from "../method-package/method-helpers.js";
2
+ import { validateMethodPackage } from "../../methods/package/local-methods.js";
3
+ import { reportValidationFailure, } from "../../methods/package/method-helpers.js";
4
4
  import { validateCompiledMethod, } from "./validate.js";
5
5
  import { pruneStageExecutionShells, } from "../agents/lib/shells.js";
6
6
  import { resetCompiledGeneratedState } from "./reset.js";
7
7
  import { compiledExecutionStages, resolveCompiledContext, } from "./compiled-target.js";
8
8
  import { discoverSourceFiles } from "./discovery.js";
9
9
  import { runCompiledStage } from "./compiled-stage-runner.js";
10
- import { resolveSourceInputPath } from "../project-model/interf-detect.js";
10
+ import { resolveSourceInputPath } from "../../project/interf-detect.js";
11
11
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
12
12
  import { writeCompiledSourceRuntime } from "./source-files.js";
13
+ function pickStageExecutor(fallback, stage, resolve) {
14
+ if (!resolve)
15
+ return fallback;
16
+ try {
17
+ return resolve(stage) ?? fallback;
18
+ }
19
+ catch {
20
+ return fallback;
21
+ }
22
+ }
13
23
  export async function runCompiledSummarize(options) {
14
24
  const context = resolveCompiledContext(options.compiledPath);
15
25
  const stageDefinition = options.stageDefinition
@@ -31,7 +41,7 @@ export async function runCompiledSummarize(options) {
31
41
  runId: options.runId ?? null,
32
42
  });
33
43
  const result = await runCompiledStage({
34
- executor: options.executor,
44
+ executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
35
45
  compiledPath: options.compiledPath,
36
46
  reporter: options.reporter,
37
47
  reportStep: options.reportStep,
@@ -66,7 +76,7 @@ export async function runCompiledCompile(options) {
66
76
  });
67
77
  for (const [index, stageDefinition] of stages.entries()) {
68
78
  const result = await runCompiledStage({
69
- executor: options.executor,
79
+ executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
70
80
  compiledPath: options.compiledPath,
71
81
  reporter: options.reporter,
72
82
  reportStep: options.reportStep,
@@ -130,7 +140,7 @@ export async function compileCompiled(options) {
130
140
  });
131
141
  for (const [index, stageDefinition] of stages.entries()) {
132
142
  const stageResult = await runCompiledStage({
133
- executor: options.executor,
143
+ executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
134
144
  compiledPath: options.compiledPath,
135
145
  reporter: options.reporter,
136
146
  reportStep: true,
@@ -1,10 +1,10 @@
1
- import { type BuiltinCompiledZoneId } from "../method-package/builtin-compiled-method.js";
1
+ import { type BuiltinCompiledZoneId } from "../../methods/package/builtin-compiled-method.js";
2
2
  import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "./lib/schema.js";
3
3
  export interface MethodSchemaStageLike {
4
4
  id: string;
5
5
  writes: readonly string[];
6
6
  }
7
- export { BUILTIN_COMPILED_ZONE_IDS } from "../method-package/builtin-compiled-method.js";
7
+ export { BUILTIN_COMPILED_ZONE_IDS } from "../../methods/package/builtin-compiled-method.js";
8
8
  export declare const METHOD_SCHEMA_FILE = "method.schema.json";
9
9
  export declare function methodSchemaFilePath(rootPath: string): string;
10
10
  export declare function resolveMethodSchemaPath(rootPath: string): string | null;
@@ -1,10 +1,10 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import { warnInterf } from "../shared/logger.js";
4
- import { readJsonFileUnchecked } from "../shared/parse.js";
5
- import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "../method-package/builtin-compiled-method.js";
3
+ import { warnInterf } from "../../contracts/utils/logger.js";
4
+ import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
5
+ import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "../../methods/package/builtin-compiled-method.js";
6
6
  import { MethodCompiledSchemaSchema, } from "./lib/schema.js";
7
- export { BUILTIN_COMPILED_ZONE_IDS } from "../method-package/builtin-compiled-method.js";
7
+ export { BUILTIN_COMPILED_ZONE_IDS } from "../../methods/package/builtin-compiled-method.js";
8
8
  export const METHOD_SCHEMA_FILE = "method.schema.json";
9
9
  const BUILTIN_COMPILED_ZONE_SPEC_BY_ID = new Map(listBuiltinCompiledZoneSpecs().map((zone) => [zone.id, zone]));
10
10
  export function methodSchemaFilePath(rootPath) {
@@ -1,5 +1,5 @@
1
1
  import { type RuntimeStageContractDraft } from "./runtime.js";
2
- import { type MethodStageDefinition } from "../method-package/method-definitions.js";
2
+ import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
3
3
  import { resolveCompiledContext, type CompiledStageExecutionDefinition } from "./compiled-target.js";
4
4
  import type { RuntimeStageInstructions } from "./lib/schema.js";
5
5
  export declare function resolveStageContractArtifacts(compiledPath: string, stageDefinition: Pick<MethodStageDefinition, "id" | "reads" | "writes">): {
@@ -1,12 +1,12 @@
1
1
  import { join } from "node:path";
2
2
  import { buildRuntimeStageContract, } from "./runtime.js";
3
3
  import { discoverSourceFiles } from "./discovery.js";
4
- import { listFilesRecursive } from "../shared/filesystem.js";
4
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
5
5
  import { compiledContractArtifactPathsForZoneIds, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
6
- import { buildLocalSkillContractExtension, buildStageInstructions, methodCompileStageDirectory, } from "../method-package/method-helpers.js";
7
- import { getActiveCompiledStagePolicyNotes, resolveActiveCompiledStageAcceptance, } from "../method-package/method-definitions.js";
6
+ import { buildLocalSkillContractExtension, buildStageInstructions, methodCompileStageDirectory, } from "../../methods/package/method-helpers.js";
7
+ import { getActiveCompiledStagePolicyNotes, resolveActiveCompiledStageAcceptance, } from "../../methods/package/method-definitions.js";
8
8
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
- import { readInterfConfig } from "../project-model/interf-detect.js";
9
+ import { readInterfConfig } from "../../project/interf-detect.js";
10
10
  import { resolveCompiledContext, } from "./compiled-target.js";
11
11
  function zoneArtifactCount(compiledPath, zonePath, kind) {
12
12
  const absolutePath = join(compiledPath, zonePath);
@@ -1,5 +1,5 @@
1
1
  import { type MethodExecutor } from "../agents/lib/executors.js";
2
- import { type MethodReporter, type MethodStageResult } from "../method-package/method-helpers.js";
2
+ import { type MethodReporter, type MethodStageResult } from "../../methods/package/method-helpers.js";
3
3
  import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
4
4
  import { type RunEventSink } from "../execution/events.js";
5
5
  export declare function runCompiledStage(options: {
@@ -2,9 +2,9 @@ import { createStageExecutionShell, freezeStageExecutionShell, syncStageExecutio
2
2
  import { reconcileCompiledStageRun } from "./runtime-reconcile.js";
3
3
  import { refreshCompiledArtifacts } from "./state.js";
4
4
  import { validateCompiledStage } from "./validate.js";
5
- import { executeValidatedStage, } from "../method-package/method-stage-runner.js";
6
- import { formatActiveCompiledMethodStageStep, } from "../method-package/method-definitions.js";
7
- import { reportBlankLine, reportLine, } from "../method-package/method-helpers.js";
5
+ import { executeValidatedStage, } from "../../methods/package/method-stage-runner.js";
6
+ import { formatActiveCompiledMethodStageStep, } from "../../methods/package/method-definitions.js";
7
+ import { reportBlankLine, reportLine, } from "../../methods/package/method-helpers.js";
8
8
  import { buildCompiledStageExecutionPlan, } from "./compiled-stage-plan.js";
9
9
  import { createRunEventId, createRunEventTimestamp, } from "../execution/events.js";
10
10
  async function emitRunEvent(sink, event) {
@@ -1,5 +1,5 @@
1
- import { type MethodStageDefinition } from "../method-package/method-definitions.js";
2
- import { type CompiledMethodId } from "../method-package/method-definitions.js";
1
+ import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
2
+ import { type CompiledMethodId } from "../../methods/package/method-definitions.js";
3
3
  export interface CompiledStageExecutionDefinition extends MethodStageDefinition {
4
4
  }
5
5
  export declare function resolveCompiledContext(compiledPath: string): {
@@ -1,5 +1,5 @@
1
- import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../method-package/method-definitions.js";
2
- import { readInterfConfig, resolveSourceFolderPath, resolveSourceControlPath, } from "../project-model/interf-detect.js";
1
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../../methods/package/method-definitions.js";
2
+ import { readInterfConfig, resolveSourceFolderPath, resolveSourceControlPath, } from "../../project/interf-detect.js";
3
3
  export function resolveCompiledContext(compiledPath) {
4
4
  const config = readInterfConfig(compiledPath);
5
5
  const methodId = resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${compiledPath}`);
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join, relative } from "node:path";
3
- import { listFilesRecursive } from "../shared/filesystem.js";
3
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
4
  const DEFAULT_IGNORE_DIRS = new Set([
5
5
  "interf",
6
6
  ".interf",
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "../../contracts/lib/schema.js";
3
- export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
2
+ import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "../../../contracts/lib/schema.js";
3
+ export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
4
4
  export type RuntimeStatus = "idle" | "running" | "compiled" | "stale" | "failed";
5
5
  export type CompiledStage = "idle" | "compiled" | "failed" | string;
6
6
  export declare const MethodZoneIdSchema: z.ZodString;
@@ -264,8 +264,8 @@ export declare const ExecutionShellPathsSchema: z.ZodObject<{
264
264
  export declare const RuntimeStageInstructionsSchema: z.ZodObject<{
265
265
  stage_skill_dir: z.ZodString;
266
266
  effective_mode: z.ZodEnum<{
267
- override: "override";
268
267
  builtin: "builtin";
268
+ override: "override";
269
269
  extend: "extend";
270
270
  }>;
271
271
  local_mode: z.ZodNullable<z.ZodEnum<{
@@ -324,8 +324,8 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
324
324
  instructions: z.ZodObject<{
325
325
  stage_skill_dir: z.ZodString;
326
326
  effective_mode: z.ZodEnum<{
327
- override: "override";
328
327
  builtin: "builtin";
328
+ override: "override";
329
329
  extend: "extend";
330
330
  }>;
331
331
  local_mode: z.ZodNullable<z.ZodEnum<{
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { COMPILED_ZONE_KINDS, } from "../method-primitives.js";
3
- import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
4
- export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
3
+ import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
4
+ export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
5
5
  const JsonRecordSchema = z.record(z.string(), z.unknown());
6
6
  const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
7
7
  function isCompiledRelativePath(value) {
@@ -1,5 +1,5 @@
1
- import { type InterfConfig } from "../project-model/interf-detect.js";
2
- export type { MethodReporter } from "../method-package/method-helpers.js";
1
+ import { type InterfConfig } from "../../project/interf-detect.js";
2
+ export type { MethodReporter } from "../../methods/package/method-helpers.js";
3
3
  export type CompiledCheck = "compiled" | "stage";
4
4
  export interface DetectedInterfTarget {
5
5
  path: string;
@@ -11,4 +11,4 @@ export declare function detectCompiled(cwd: string): DetectedInterfTarget | null
11
11
  export declare function createCompiled(name: string, sourcePath: string, methodId: string | undefined, about: string | undefined, sourceFolderPath: string): string;
12
12
  export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
13
13
  export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
14
- export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
14
+ export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, ResolveStageExecutor, } from "./compiled-compile.js";
@@ -1,7 +1,7 @@
1
- import { createCompiled as createCompiledScaffold, } from "../project-model/interf-scaffold.js";
2
- import { detectInterf } from "../project-model/interf-detect.js";
1
+ import { createCompiled as createCompiledScaffold, } from "../../project/interf-scaffold.js";
2
+ import { detectInterf } from "../../project/interf-detect.js";
3
3
  import { validateCompiledCompile, } from "./validate.js";
4
- import { DEFAULT_METHOD_ID } from "../methods/method-resolution.js";
4
+ import { DEFAULT_METHOD_ID } from "../../methods/method-resolution.js";
5
5
  export function detectCompiled(cwd) {
6
6
  const detected = detectInterf(cwd);
7
7
  if (!detected)
@@ -1,9 +1,10 @@
1
1
  import { existsSync, } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { listFilesRecursive } from "../shared/filesystem.js";
4
- import { readJsonFileWithSchema } from "../shared/parse.js";
3
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
5
5
  import { METHOD_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
6
6
  import { RuntimeStageContractSchema, } from "./lib/schema.js";
7
+ import { ACCEPTANCE_RULE_KEYS } from "../../contracts/lib/schema.js";
7
8
  import { stageContractPath } from "./runtime-paths.js";
8
9
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
10
  import { loadState } from "./state-io.js";
@@ -17,18 +18,20 @@ function toFiniteNumber(value) {
17
18
  function hasAcceptanceRules(acceptance) {
18
19
  if (!acceptance)
19
20
  return false;
20
- return (acceptance.artifacts_exist?.length ?? 0) > 0 ||
21
- (acceptance.stage_truthy?.length ?? 0) > 0 ||
22
- Object.keys(acceptance.stage_equals_counts ?? {}).length > 0 ||
23
- Object.keys(acceptance.stage_at_least ?? {}).length > 0 ||
24
- Object.keys(acceptance.stage_at_least_counts ?? {}).length > 0 ||
25
- Object.keys(acceptance.zone_counts_at_least ?? {}).length > 0 ||
26
- Object.keys(acceptance.zone_counts_at_least_counts ?? {}).length > 0 ||
27
- (acceptance.markdown_frontmatter_valid_zones?.length ?? 0) > 0 ||
28
- Object.keys(acceptance.frontmatter_required_keys_in_zones ?? {}).length > 0 ||
29
- (acceptance.markdown_abstract_valid_zones?.length ?? 0) > 0 ||
30
- (acceptance.wikilinks_valid_in_zones?.length ?? 0) > 0 ||
31
- Object.keys(acceptance.artifacts_must_not_contain ?? {}).length > 0;
21
+ // Drive off the canonical rule-key list so a new key added to
22
+ // contracts/ is automatically considered here.
23
+ for (const key of ACCEPTANCE_RULE_KEYS) {
24
+ const value = acceptance[key];
25
+ if (Array.isArray(value)) {
26
+ if (value.length > 0)
27
+ return true;
28
+ }
29
+ else if (value && typeof value === "object") {
30
+ if (Object.keys(value).length > 0)
31
+ return true;
32
+ }
33
+ }
34
+ return false;
32
35
  }
33
36
  function readPathValue(record, keyPath) {
34
37
  if (!record)
@@ -1,2 +1,2 @@
1
- import { type MethodStageDefinition } from "../method-package/method-definitions.js";
1
+ import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
2
2
  export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<MethodStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;
@@ -1,11 +1,12 @@
1
1
  import { existsSync, readFileSync, statSync, writeFileSync, } from "node:fs";
2
2
  import { extname, join, relative } from "node:path";
3
- import { listFilesRecursive } from "../shared/filesystem.js";
3
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
4
  import { compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
5
- import { parseJsonFrontmatter } from "../shared/parse.js";
5
+ import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
6
6
  import { loadRuntimeRun } from "./runtime.js";
7
7
  import { initCompiledState, loadState, refreshCompiledArtifacts, saveState, } from "./state.js";
8
8
  import { compiledInventoryFromEntries } from "./runtime-inventory.js";
9
+ import { STANDARD_EVIDENCE_FRONTMATTER_KEYS, } from "../../contracts/lib/schema.js";
9
10
  import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
10
11
  import { extractSynthAbstract, isOutputMarkdownFile } from "./validate.js";
11
12
  function readActiveRunStartedAtMs(dirPath) {
@@ -80,15 +81,16 @@ function buildInventoryMetadata(options) {
80
81
  metadata.abstract = abstract;
81
82
  metadata.abstract_read = true;
82
83
  }
84
+ // Project the standard evidence frontmatter keys onto the inventory
85
+ // metadata. Method authors that emit the canonical evidence keys
86
+ // (`STANDARD_EVIDENCE_FRONTMATTER_KEYS` in contracts) get them
87
+ // surfaced on stage inventory entries; non-standard keys are ignored.
83
88
  const frontmatter = options.parsedFrontmatter.frontmatter;
84
- if (typeof frontmatter.source_kind === "string") {
85
- metadata.source_kind = frontmatter.source_kind;
86
- }
87
- if (typeof frontmatter.evidence_tier === "string") {
88
- metadata.evidence_tier = frontmatter.evidence_tier;
89
- }
90
- if (typeof frontmatter.truth_mode === "string") {
91
- metadata.truth_mode = frontmatter.truth_mode;
89
+ for (const key of STANDARD_EVIDENCE_FRONTMATTER_KEYS) {
90
+ const value = frontmatter[key];
91
+ if (typeof value === "string") {
92
+ metadata[key] = value;
93
+ }
92
94
  }
93
95
  return metadata;
94
96
  }