@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
@@ -5,12 +5,15 @@ import { existsSync, statSync, readFileSync } from "node:fs";
5
5
  import { dirname, extname, join, normalize, resolve, sep } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { LOCAL_SERVICE_LOOPBACK_HOSTS, LocalServiceConfigSchema, LocalServiceDiscoverySchema, LocalServiceErrorSchema, OpenPathRequestSchema, ServiceRegistryEntrySchema, } from "./lib/schema.js";
8
- import { assertPathWithinRoot, } from "../shared/path-guards.js";
8
+ import { assertPathWithinRoot, } from "../contracts/utils/path-guards.js";
9
9
  import { createLocalServiceRuntime, } from "./runtime.js";
10
10
  import { buildLocalServiceUrl, LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, LOCAL_SERVICE_ROUTES, PREPARATION_SUBRESOURCES, } from "./routes.js";
11
11
  import { registerServiceLocally, unregisterService, } from "./service-registry.js";
12
- import { createStoredPreparation, deleteStoredPreparation, getStoredPreparation, listStoredPreparations, preparationWireShape, rehydratePreparations, } from "./preparation-store.js";
12
+ import { createStoredPreparation, deleteStoredPreparation, getStoredPreparation, listStoredPreparations, preparationWireShape, rehydratePreparations, updateStoredPreparation, } from "./preparation-store.js";
13
13
  import { clearConnection, readActiveConnection, writeConnection, } from "./connection-config.js";
14
+ import { userMethodsRoot } from "./instance-paths.js";
15
+ import { builtinMethodPackagePath, methodDefinitionPath, } from "../methods/package/local-methods.js";
16
+ import { userMethodPath, userMethodExists } from "../methods/package/user-methods.js";
14
17
  /** HTTP methods that require an authenticated bearer token + Origin guard. */
15
18
  const MUTATING_METHODS = new Set(["POST", "PUT", "PATCH", "DELETE"]);
16
19
  /** Generate a fresh per-instance bearer token. */
@@ -85,7 +88,7 @@ function corsHeadersFor(origin, allowed) {
85
88
  "access-control-allow-origin": origin ?? allowed.hostUrls[0] ?? "",
86
89
  "access-control-allow-credentials": "false",
87
90
  "access-control-allow-methods": "GET,POST,PATCH,DELETE,OPTIONS",
88
- "access-control-allow-headers": "content-type, authorization, x-interf-workspace, x-interf-idempotency-key",
91
+ "access-control-allow-headers": "content-type, authorization, x-interf-idempotency-key",
89
92
  vary: "origin",
90
93
  };
91
94
  }
@@ -152,6 +155,11 @@ function contentType(filePath) {
152
155
  return "image/x-icon";
153
156
  case ".txt":
154
157
  return "text/plain; charset=utf-8";
158
+ case ".md":
159
+ return "text/markdown; charset=utf-8";
160
+ case ".yml":
161
+ case ".yaml":
162
+ return "application/yaml; charset=utf-8";
155
163
  case ".map":
156
164
  return "application/json; charset=utf-8";
157
165
  case ".webmanifest":
@@ -274,6 +282,27 @@ function safeStaticPath(root, relativePath) {
274
282
  }
275
283
  return absolute;
276
284
  }
285
+ /**
286
+ * Resolve the on-disk root path for a method id. Used by the
287
+ * `/v1/methods/<id>/files/<relpath>` route. Resolution order matches
288
+ * the runtime: preparation-draft (if a prep id is supplied) → user
289
+ * library → built-in. Returns `null` when the method id resolves
290
+ * nowhere.
291
+ */
292
+ function resolveMethodPackageRoot(methodId, prepDataDir) {
293
+ if (prepDataDir) {
294
+ const localPath = methodDefinitionPath(prepDataDir, methodId);
295
+ if (existsSync(join(localPath, "method.json")))
296
+ return localPath;
297
+ }
298
+ if (userMethodExists(methodId)) {
299
+ return userMethodPath(methodId);
300
+ }
301
+ const builtinPath = builtinMethodPackagePath(methodId);
302
+ if (existsSync(join(builtinPath, "method.json")))
303
+ return builtinPath;
304
+ return null;
305
+ }
277
306
  function sendFile(res, filePath) {
278
307
  if (!existsSync(filePath))
279
308
  return false;
@@ -290,6 +319,25 @@ function sendFile(res, filePath) {
290
319
  return false;
291
320
  }
292
321
  }
322
+ /**
323
+ * Reject any path that contains `..` or absolute segments — used by the
324
+ * 0.16 file-serving endpoints (`/v1/methods/<id>/files/...`,
325
+ * `/v1/preparations/<id>/files/...`). The `safeStaticPath` helper used
326
+ * by the static-asset path silently strips traversal segments; for the
327
+ * API endpoints we want a hard reject so the response is unambiguous.
328
+ */
329
+ function isTraversalRelativePath(relPath) {
330
+ if (relPath.length === 0)
331
+ return true;
332
+ const segments = relPath.split(/[\\/]+/);
333
+ for (const segment of segments) {
334
+ if (segment === ".." || segment === "")
335
+ return true;
336
+ }
337
+ if (relPath.startsWith("/") || /^[A-Za-z]:/.test(relPath))
338
+ return true;
339
+ return false;
340
+ }
293
341
  function sendCompilerUiAsset(req, res, _runtime) {
294
342
  const staticRoot = compilerUiStaticRoot();
295
343
  const url = parseRequestUrl(req);
@@ -378,6 +426,7 @@ async function routeApi(req, res, runtime) {
378
426
  runs: LOCAL_SERVICE_ROUTES.runs,
379
427
  action_proposals: LOCAL_SERVICE_ROUTES.actionProposals,
380
428
  executor: LOCAL_SERVICE_ROUTES.executor,
429
+ agents: LOCAL_SERVICE_ROUTES.agents,
381
430
  open_path: LOCAL_SERVICE_ROUTES.openPath,
382
431
  },
383
432
  }));
@@ -390,6 +439,15 @@ async function routeApi(req, res, runtime) {
390
439
  const uptimeSeconds = Number.isFinite(startedMs)
391
440
  ? Math.max(0, Math.floor((Date.now() - startedMs) / 1000))
392
441
  : 0;
442
+ const agentSnapshot = runtime.getAgentsRegistry();
443
+ // 0.16 — `connection_kind` lets the UI know whether OS-open is even
444
+ // possible. A loopback bind means the engine has filesystem access
445
+ // to the same host as the user; non-loopback (cloud) returns
446
+ // "remote" so the UI routes to api-served / signed-URL paths
447
+ // instead. The current binary refuses non-loopback binds (see the
448
+ // host whitelist below), so the value is "local" today; the field
449
+ // is in place so the UI can read it without a CLI version sniff.
450
+ const isLoopback = LOCAL_SERVICE_LOOPBACK_HOSTS.includes(runtime.host);
393
451
  sendJson(res, 200, {
394
452
  kind: "interf-instance",
395
453
  version: 1,
@@ -402,6 +460,11 @@ async function routeApi(req, res, runtime) {
402
460
  package_version: runtime.packageVersion ?? null,
403
461
  preparation_count: listStoredPreparations().length,
404
462
  auth_required: Boolean(runtime.authToken),
463
+ // 0.15 connected-agents fields:
464
+ agent_count: agentSnapshot.agents.length,
465
+ default_agent: agentSnapshot.active_agent?.name ?? null,
466
+ // 0.16 connection-mode flag:
467
+ connection_kind: isLoopback ? "local" : "remote",
405
468
  });
406
469
  return true;
407
470
  }
@@ -471,6 +534,24 @@ async function routeApi(req, res, runtime) {
471
534
  sendJson(res, 200, preparationWireShape(storedPrep));
472
535
  return true;
473
536
  }
537
+ if (method === "PATCH") {
538
+ try {
539
+ const body = (await readJsonBody(req));
540
+ if (!body || typeof body !== "object") {
541
+ sendError(res, 400, "Request body must be a JSON object.");
542
+ return true;
543
+ }
544
+ const updated = updateStoredPreparation(decodedPrepId, {
545
+ method_id: body.method_id,
546
+ about: body.about,
547
+ });
548
+ sendJson(res, 200, preparationWireShape(updated));
549
+ }
550
+ catch (error) {
551
+ sendError(res, 400, error instanceof Error ? error.message : String(error));
552
+ }
553
+ return true;
554
+ }
474
555
  if (method === "DELETE") {
475
556
  deleteStoredPreparation(runtime, decodedPrepId);
476
557
  sendJson(res, 200, { id: decodedPrepId, deleted: true });
@@ -479,6 +560,10 @@ async function routeApi(req, res, runtime) {
479
560
  }
480
561
  else if (subPath === PREPARATION_SUBRESOURCES.compileRuns) {
481
562
  if (method === "POST") {
563
+ if (!storedPrep.methodId) {
564
+ sendError(res, 400, `Preparation ${storedPrep.id} has no method bound. Set one via PATCH /v1/preparations/${storedPrep.id} { "method_id": "<id>" } before compiling.`);
565
+ return true;
566
+ }
482
567
  try {
483
568
  const body = (await readJsonBody(req));
484
569
  const request = { preparation: storedPrep.id, ...(body ?? {}) };
@@ -509,12 +594,16 @@ async function routeApi(req, res, runtime) {
509
594
  return true;
510
595
  }
511
596
  }
512
- else if (subPath === PREPARATION_SUBRESOURCES.testRuns) {
597
+ else if (subPath === PREPARATION_SUBRESOURCES.verifyRuns) {
513
598
  if (method === "POST") {
599
+ if (!storedPrep.methodId) {
600
+ sendError(res, 400, `Preparation ${storedPrep.id} has no method bound. Set one via PATCH /v1/preparations/${storedPrep.id} { "method_id": "<id>" } before verifying.`);
601
+ return true;
602
+ }
514
603
  try {
515
604
  const body = (await readJsonBody(req));
516
605
  const request = { preparation: storedPrep.id, ...(body ?? {}) };
517
- const resource = await runtime.createTestRun(storedPrep.prepDataDir, request);
606
+ const resource = await runtime.createVerifyRun(storedPrep.prepDataDir, request);
518
607
  sendJson(res, 201, resource);
519
608
  }
520
609
  catch (error) {
@@ -620,6 +709,35 @@ async function routeApi(req, res, runtime) {
620
709
  return true;
621
710
  }
622
711
  }
712
+ else if (subPath.startsWith(`${PREPARATION_SUBRESOURCES.files}/`)) {
713
+ // GET /v1/preparations/<id>/files/<relpath> — read-only file
714
+ // serving inside the prep's portable-context root. Used by the
715
+ // locator pattern's `api-served` kind.
716
+ if (method === "GET") {
717
+ const rawRelPath = subPath.slice(PREPARATION_SUBRESOURCES.files.length + 1);
718
+ let relPath;
719
+ try {
720
+ relPath = decodeURIComponent(rawRelPath);
721
+ }
722
+ catch {
723
+ sendError(res, 400, "File path is not valid URI-encoded UTF-8.");
724
+ return true;
725
+ }
726
+ if (isTraversalRelativePath(relPath)) {
727
+ sendError(res, 400, "File path escapes portable-context root.");
728
+ return true;
729
+ }
730
+ const safePath = safeStaticPath(storedPrep.portableContextPath, relPath);
731
+ if (!safePath) {
732
+ sendError(res, 400, "File path escapes portable-context root.");
733
+ return true;
734
+ }
735
+ if (!sendFile(res, safePath)) {
736
+ sendError(res, 404, `File not found: ${relPath}`);
737
+ }
738
+ return true;
739
+ }
740
+ }
623
741
  sendError(res, 404, `Unknown preparation sub-route: ${subPath}`);
624
742
  return true;
625
743
  }
@@ -644,6 +762,50 @@ async function routeApi(req, res, runtime) {
644
762
  sendJson(res, 200, methodResource);
645
763
  return true;
646
764
  }
765
+ const methodRunsMatch = path.match(/^\/v1\/methods\/([^/]+)\/runs$/);
766
+ if (method === "GET" && methodRunsMatch?.[1]) {
767
+ const firstPrep = listStoredPreparations()[0];
768
+ const runs = runtime.listMethodRuns(firstPrep?.prepDataDir ?? runtime.rootPath, decodeURIComponent(methodRunsMatch[1]));
769
+ sendJson(res, 200, { runs });
770
+ return true;
771
+ }
772
+ // GET /v1/methods/<id>/files/<relpath> — read-only file serving inside
773
+ // the method root. Used by the locator pattern's `api-served` kind so
774
+ // the UI can render SKILL.md / contract files in a side drawer over a
775
+ // remote engine. Resolution: prep-draft (when first prep exists) →
776
+ // user library → built-in. Path-guard rejects any traversal outside
777
+ // the resolved root.
778
+ const methodFilesMatch = path.match(/^\/v1\/methods\/([^/]+)\/files\/(.+)$/);
779
+ if (method === "GET" && methodFilesMatch?.[1] && methodFilesMatch[2]) {
780
+ const methodId = decodeURIComponent(methodFilesMatch[1]);
781
+ let relPath;
782
+ try {
783
+ relPath = decodeURIComponent(methodFilesMatch[2]);
784
+ }
785
+ catch {
786
+ sendError(res, 400, "File path is not valid URI-encoded UTF-8.");
787
+ return true;
788
+ }
789
+ if (isTraversalRelativePath(relPath)) {
790
+ sendError(res, 400, "File path escapes method root.");
791
+ return true;
792
+ }
793
+ const firstPrep = listStoredPreparations()[0];
794
+ const root = resolveMethodPackageRoot(methodId, firstPrep?.prepDataDir);
795
+ if (!root) {
796
+ sendError(res, 404, `Method not found: ${methodId}`);
797
+ return true;
798
+ }
799
+ const safePath = safeStaticPath(root, relPath);
800
+ if (!safePath) {
801
+ sendError(res, 400, "File path escapes method root.");
802
+ return true;
803
+ }
804
+ if (!sendFile(res, safePath)) {
805
+ sendError(res, 404, `File not found: ${relPath}`);
806
+ }
807
+ return true;
808
+ }
647
809
  // ─────────────────────────────────────────────────────────────────────────
648
810
  // Run observability — instance-wide. Each run record carries a workspace,
649
811
  // so the runtime takes a "first prep" hint to scan registered preparations.
@@ -755,12 +917,12 @@ async function routeApi(req, res, runtime) {
755
917
  return true;
756
918
  }
757
919
  }
758
- const testRunMatch = path.match(/^\/v1\/test-runs\/([^/]+)$/);
759
- if (method === "GET" && testRunMatch?.[1]) {
920
+ const verifyRunMatch = path.match(/^\/v1\/verify-runs\/([^/]+)$/);
921
+ if (method === "GET" && verifyRunMatch?.[1]) {
760
922
  const firstPrep = listStoredPreparations()[0];
761
- const run = runtime.getTestRun(firstPrep?.prepDataDir ?? runtime.rootPath, decodeURIComponent(testRunMatch[1]));
923
+ const run = runtime.getVerifyRun(firstPrep?.prepDataDir ?? runtime.rootPath, decodeURIComponent(verifyRunMatch[1]));
762
924
  if (!run)
763
- sendError(res, 404, "Readiness check run not found.");
925
+ sendError(res, 404, "Verify run not found.");
764
926
  else
765
927
  sendJson(res, 200, run);
766
928
  return true;
@@ -800,19 +962,119 @@ async function routeApi(req, res, runtime) {
800
962
  sendJson(res, 202, runtime.selectExecutor(body));
801
963
  return true;
802
964
  }
965
+ // ─────────────────────────────────────────────────────────────────────────
966
+ // Connected agents (0.15) — registry, role-map, role list.
967
+ // ─────────────────────────────────────────────────────────────────────────
968
+ if (path === LOCAL_SERVICE_ROUTES.agents) {
969
+ if (method === "GET") {
970
+ sendJson(res, 200, runtime.getAgentsRegistry());
971
+ return true;
972
+ }
973
+ if (method === "POST") {
974
+ try {
975
+ const body = (await readJsonBody(req));
976
+ if (!body || typeof body !== "object") {
977
+ sendError(res, 400, "Request body must be a JSON object.");
978
+ return true;
979
+ }
980
+ if (!body.name || typeof body.name !== "string") {
981
+ sendError(res, 400, "Missing required field: name");
982
+ return true;
983
+ }
984
+ if (!body.display_name || typeof body.display_name !== "string") {
985
+ sendError(res, 400, "Missing required field: display_name");
986
+ return true;
987
+ }
988
+ if (!body.command || typeof body.command !== "string") {
989
+ sendError(res, 400, "Missing required field: command");
990
+ return true;
991
+ }
992
+ const updated = runtime.registerCustomAgent({
993
+ name: body.name,
994
+ display_name: body.display_name,
995
+ command: body.command,
996
+ });
997
+ sendJson(res, 201, updated);
998
+ }
999
+ catch (error) {
1000
+ sendError(res, 400, error instanceof Error ? error.message : String(error));
1001
+ }
1002
+ return true;
1003
+ }
1004
+ }
1005
+ if (method === "GET" && path === `${LOCAL_SERVICE_ROUTES.agents}/roles`) {
1006
+ sendJson(res, 200, {
1007
+ kind: "interf-canonical-roles",
1008
+ version: 1,
1009
+ roles: ["extractor", "summarizer", "structurer", "verifier", "general"],
1010
+ });
1011
+ return true;
1012
+ }
1013
+ if (path === `${LOCAL_SERVICE_ROUTES.agents}/role-map`) {
1014
+ if (method === "GET") {
1015
+ const snapshot = runtime.getAgentsRegistry();
1016
+ sendJson(res, 200, {
1017
+ role_map: snapshot.role_map,
1018
+ active_agent: snapshot.active_agent,
1019
+ });
1020
+ return true;
1021
+ }
1022
+ if (method === "PATCH") {
1023
+ try {
1024
+ const body = (await readJsonBody(req));
1025
+ if (!body || typeof body !== "object") {
1026
+ sendError(res, 400, "Request body must be a JSON object.");
1027
+ return true;
1028
+ }
1029
+ const patch = {};
1030
+ for (const [role, value] of Object.entries(body)) {
1031
+ if (typeof value !== "string") {
1032
+ sendError(res, 400, `Role-map values must be strings (or "" to clear). Got ${typeof value} for role "${role}".`);
1033
+ return true;
1034
+ }
1035
+ patch[role] = value;
1036
+ }
1037
+ const updated = runtime.patchAgentsRoleMap(patch);
1038
+ sendJson(res, 200, updated);
1039
+ }
1040
+ catch (error) {
1041
+ sendError(res, 400, error instanceof Error ? error.message : String(error));
1042
+ }
1043
+ return true;
1044
+ }
1045
+ }
1046
+ // /v1/agents/<name> — only DELETE; built-in names return 400.
1047
+ const agentMatch = path.match(/^\/v1\/agents\/([^/]+)$/);
1048
+ if (agentMatch?.[1] && method === "DELETE") {
1049
+ const name = decodeURIComponent(agentMatch[1]);
1050
+ try {
1051
+ const updated = runtime.unregisterCustomAgent(name);
1052
+ sendJson(res, 200, updated);
1053
+ }
1054
+ catch (error) {
1055
+ const message = error instanceof Error ? error.message : String(error);
1056
+ // Rejecting a built-in unregister is a 400 (bad request, the
1057
+ // caller is asking for something the contract doesn't allow).
1058
+ const status = /built-in agent/.test(message) ? 400 : 404;
1059
+ sendError(res, status, message);
1060
+ }
1061
+ return true;
1062
+ }
803
1063
  if (method === "POST" && path === LOCAL_SERVICE_ROUTES.openPath) {
804
1064
  const body = OpenPathRequestSchema.parse(await readJsonBody(req));
805
- // Permit opening any registered preparation root or its bound source folder.
1065
+ // Permit opening:
1066
+ // - any registered preparation root or its bound source folder
1067
+ // - the user method library at `~/.interf/methods/`
1068
+ // - the bundled built-in method root inside the installed package
1069
+ // (so SKILL.md / contract files in `interf-default` open correctly)
806
1070
  const allowedRoots = [];
807
1071
  for (const stored of listStoredPreparations()) {
808
1072
  allowedRoots.push(stored.prepDataDir);
809
1073
  if (stored.source.locator)
810
1074
  allowedRoots.push(stored.source.locator);
811
1075
  }
812
- if (allowedRoots.length === 0) {
813
- sendError(res, 400, "No preparation registered; nothing to open.");
814
- return true;
815
- }
1076
+ allowedRoots.push(userMethodsRoot());
1077
+ allowedRoots.push(packageRoot()); // covers <pkg>/builtin-methods/...
816
1078
  const openedPath = await openLocalPath(allowedRoots, body.path);
817
1079
  sendJson(res, 202, { opened: true, path: openedPath });
818
1080
  return true;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type TestCaseExpect, type TestTargetType } from "../../contracts/lib/schema.js";
2
+ import { type TestCaseExpect, type TestTargetType } from "../../../contracts/lib/schema.js";
3
3
  export declare const TestCaseSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  question: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, PreparationNameSchema, } from "../../contracts/lib/schema.js";
2
+ import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, PreparationNameSchema, } from "../../../contracts/lib/schema.js";
3
3
  const TestCaseCoreSchema = z.object({
4
4
  id: z.string().regex(/^[a-z0-9][a-z0-9-]{0,79}$/),
5
5
  question: z.string().min(1),
@@ -1,8 +1,8 @@
1
1
  import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
2
+ import type { SourcePreparationConfig } from "../../project/lib/schema.js";
3
3
  import { type TestTargetCandidate, type TestTargetResult } from "./test.js";
4
4
  import type { TestSandboxRetentionMode } from "./test-sandbox.js";
5
- import { type ReadinessCheckRun, type TestRunMode } from "./lib/schema.js";
5
+ import { type ReadinessCheckRun } from "./lib/schema.js";
6
6
  export interface SavedReadinessCheckOutcome {
7
7
  runPath: string;
8
8
  displayRunPath?: string;
@@ -13,7 +13,10 @@ export interface ReadinessCheckRunResult {
13
13
  sourcePath: string;
14
14
  preparationConfig: SourcePreparationConfig;
15
15
  portableContextPath: string | null;
16
- mode: TestRunMode;
16
+ /**
17
+ * 0.15 — `sourceFilesOutcome` is always `null`. Kept on the type so
18
+ * older readers parse cleanly during the rollout; remove in 0.16+.
19
+ */
17
20
  sourceFilesOutcome: SavedReadinessCheckOutcome | null;
18
21
  compiledOutcome: SavedReadinessCheckOutcome | null;
19
22
  readinessRunPath: string | null;
@@ -36,17 +39,8 @@ export declare function saveReadinessCheckRun(options: {
36
39
  portableContextPath: string | null;
37
40
  preparationName: string;
38
41
  checksFingerprint: string;
39
- mode: TestRunMode;
40
- sourceFilesOutcome: SavedReadinessCheckOutcome | null;
41
42
  compiledOutcome: SavedReadinessCheckOutcome | null;
42
43
  }): string;
43
- export declare function runSavedSourceFilesCheck(options: {
44
- sourcePath: string;
45
- preparationConfig: SourcePreparationConfig;
46
- executor?: MethodExecutor | null;
47
- preserveSandboxes?: TestSandboxRetentionMode;
48
- runSuffix?: string | null;
49
- }): Promise<SavedReadinessCheckOutcome | null>;
50
44
  export declare function runSavedPortableContextCheck(options: {
51
45
  sourcePath: string;
52
46
  preparationConfig: SourcePreparationConfig;
@@ -59,7 +53,6 @@ export declare function runReadinessChecksForExecutor(options: {
59
53
  sourcePath: string;
60
54
  preparationConfig: SourcePreparationConfig;
61
55
  portableContextPath: string | null;
62
- mode: TestRunMode;
63
56
  executor?: MethodExecutor | null;
64
57
  preserveSandboxes?: TestSandboxRetentionMode;
65
58
  runSuffix?: string | null;
@@ -1,11 +1,11 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import { buildTestSpecFromCompiledPreparationConfig, buildTestSpecFromSourceFolderConfig, fingerprintReadinessChecks, resolveSourcePreparationPath, } from "../project-model/source-config.js";
4
- import { asPreparationDataDir, preparationLatestReadinessRunPath, preparationLatestReadinessSummaryPath, preparationTestRunPath, preparationTestRunsRoot, normalizePreparationTestRunId, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
5
- import { testRootForCompiled } from "../compiler/compiled-paths.js";
6
- import { readJsonFileWithSchema } from "../shared/parse.js";
7
- import { resolveMethodId } from "../methods/method-resolution.js";
8
- import { createCompiledTestTarget, createSourceFilesTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "./test.js";
3
+ import { buildTestSpecFromCompiledPreparationConfig, fingerprintReadinessChecks, } from "../../project/source-config.js";
4
+ import { asPreparationDataDir, preparationLatestReadinessRunPath, preparationLatestReadinessSummaryPath, preparationTestRunPath, preparationTestRunsRoot, normalizePreparationTestRunId, preparationPortableContextPath, } from "../../contracts/lib/preparation-paths.js";
5
+ import { testRootForCompiled } from "../compile/compiled-paths.js";
6
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
7
+ import { resolveMethodId } from "../../methods/method-resolution.js";
8
+ import { createCompiledTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "./test.js";
9
9
  import { ReadinessCheckRunSchema, } from "./lib/schema.js";
10
10
  export function readinessPassRate(outcome) {
11
11
  return outcome.result.totalCases > 0
@@ -82,20 +82,9 @@ export function readCurrentSavedReadinessCheckRun(options) {
82
82
  }
83
83
  export function saveReadinessCheckRun(options) {
84
84
  const generatedAt = new Date().toISOString();
85
- const sourceFilesSummary = options.sourceFilesOutcome
86
- ? summarizeSavedTestOutcome("Source files", options.sourceFilesOutcome)
87
- : null;
88
85
  const compiledSummary = options.compiledOutcome
89
86
  ? summarizeSavedTestOutcome("Portable Context", options.compiledOutcome)
90
87
  : null;
91
- const effectiveMode = sourceFilesSummary && compiledSummary
92
- ? "both"
93
- : sourceFilesSummary
94
- ? "source-files"
95
- : "compiled";
96
- const sourceFilesPassRate = sourceFilesSummary
97
- ? Math.round((sourceFilesSummary.passed_cases / sourceFilesSummary.total_cases) * 100)
98
- : null;
99
88
  const compiledPassRate = compiledSummary
100
89
  ? Math.round((compiledSummary.passed_cases / compiledSummary.total_cases) * 100)
101
90
  : null;
@@ -103,17 +92,20 @@ export function saveReadinessCheckRun(options) {
103
92
  kind: "interf-readiness-check-run",
104
93
  version: 1,
105
94
  generated_at: generatedAt,
106
- mode: effectiveMode,
95
+ // 0.15 — verify always runs in compiled-only mode. We keep the
96
+ // `mode: "compiled"` literal in the saved payload so existing
97
+ // dashboards / consumers that expect the field still parse.
98
+ mode: "compiled",
107
99
  source_path: options.sourcePath,
108
100
  checks_fingerprint: options.checksFingerprint,
109
101
  preparation: {
110
102
  name: options.preparationName,
111
103
  portable_context_path: options.portableContextPath,
112
104
  },
113
- source_files: sourceFilesSummary,
105
+ source_files: null,
114
106
  compiled: compiledSummary,
115
107
  summary: {
116
- source_files_pass_rate: sourceFilesPassRate,
108
+ source_files_pass_rate: null,
117
109
  portable_context_pass_rate: compiledPassRate,
118
110
  },
119
111
  };
@@ -127,40 +119,6 @@ export function saveReadinessCheckRun(options) {
127
119
  }
128
120
  return latestStatePath;
129
121
  }
130
- export async function runSavedSourceFilesCheck(options) {
131
- const spec = buildTestSpecFromSourceFolderConfig({
132
- prepDataDir: options.sourcePath,
133
- targetName: options.preparationConfig.name,
134
- targetType: "source-files",
135
- });
136
- if (!spec)
137
- return null;
138
- const sourceFolderPath = resolveSourcePreparationPath(options.sourcePath, options.preparationConfig);
139
- const target = createSourceFilesTestTarget(sourceFolderPath);
140
- const artifactRoot = preparationLatestReadinessRunPath(asPreparationDataDir(options.sourcePath), options.preparationConfig.name);
141
- const run = await runTargetTestsAuto(sourceFolderPath, spec, [target], {
142
- executor: options.executor,
143
- preserveSandboxes: options.preserveSandboxes ?? "on-failure",
144
- artifactRootPath: dirname(artifactRoot),
145
- });
146
- const result = run.results[0];
147
- if (!result)
148
- return null;
149
- const preparationRunPath = writePreparationTargetRun({
150
- prepDataDir: options.sourcePath,
151
- preparationName: options.preparationConfig.name,
152
- target: "source-files",
153
- generatedAt: run.generated_at,
154
- runId: normalizePreparationTestRunId(spec.id),
155
- runSuffix: options.runSuffix,
156
- payload: run,
157
- });
158
- return {
159
- runPath: preparationRunPath,
160
- target,
161
- result,
162
- };
163
- }
164
122
  export async function runSavedPortableContextCheck(options) {
165
123
  const portableContextPath = options.portableContextPath
166
124
  ?? portableContextPathForPreparation(options.sourcePath, options.preparationConfig.name);
@@ -199,29 +157,18 @@ export async function runSavedPortableContextCheck(options) {
199
157
  };
200
158
  }
201
159
  export async function runReadinessChecksForExecutor(options) {
202
- const sourceFilesPromise = options.mode === "source-files" || options.mode === "both"
203
- ? runSavedSourceFilesCheck({
204
- sourcePath: options.sourcePath,
205
- preparationConfig: options.preparationConfig,
206
- executor: options.executor,
207
- preserveSandboxes: options.preserveSandboxes,
208
- runSuffix: options.runSuffix,
209
- })
210
- : Promise.resolve(null);
211
- const compiledPromise = options.mode === "compiled" || options.mode === "both"
212
- ? runSavedPortableContextCheck({
213
- sourcePath: options.sourcePath,
214
- preparationConfig: options.preparationConfig,
215
- executor: options.executor,
216
- portableContextPath: options.portableContextPath,
217
- preserveSandboxes: options.preserveSandboxes,
218
- runSuffix: options.runSuffix,
219
- })
220
- : Promise.resolve(null);
221
- const [sourceFilesOutcome, compiledOutcome] = await Promise.all([sourceFilesPromise, compiledPromise]);
222
- const modeSatisfied = (options.mode !== "source-files" || Boolean(sourceFilesOutcome)) &&
223
- (options.mode !== "compiled" || Boolean(compiledOutcome)) &&
224
- (options.mode !== "both" || (Boolean(sourceFilesOutcome) && Boolean(compiledOutcome)));
160
+ // 0.15 verify runs always judge against the compiled portable
161
+ // context. The legacy `source-files` and `both` modes were retired
162
+ // in 0.13.1 and removed from the wire shape here.
163
+ const compiledOutcome = await runSavedPortableContextCheck({
164
+ sourcePath: options.sourcePath,
165
+ preparationConfig: options.preparationConfig,
166
+ executor: options.executor,
167
+ portableContextPath: options.portableContextPath,
168
+ preserveSandboxes: options.preserveSandboxes,
169
+ runSuffix: options.runSuffix,
170
+ });
171
+ const modeSatisfied = Boolean(compiledOutcome);
225
172
  const shouldSave = options.saveLatest !== false;
226
173
  const readinessRunPath = shouldSave && modeSatisfied
227
174
  ? saveReadinessCheckRun({
@@ -229,8 +176,6 @@ export async function runReadinessChecksForExecutor(options) {
229
176
  portableContextPath: options.portableContextPath,
230
177
  preparationName: options.preparationConfig.name,
231
178
  checksFingerprint: fingerprintReadinessChecks(options.preparationConfig.checks),
232
- mode: options.mode,
233
- sourceFilesOutcome,
234
179
  compiledOutcome,
235
180
  })
236
181
  : null;
@@ -241,8 +186,7 @@ export async function runReadinessChecksForExecutor(options) {
241
186
  sourcePath: options.sourcePath,
242
187
  preparationConfig: options.preparationConfig,
243
188
  portableContextPath: options.portableContextPath,
244
- mode: options.mode,
245
- sourceFilesOutcome,
189
+ sourceFilesOutcome: null,
246
190
  compiledOutcome,
247
191
  readinessRunPath,
248
192
  readinessRun,
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { basename, dirname, join } from "node:path";
3
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compiler/compiled-paths.js";
4
- import { asPreparationDataDir, preparationTestsSpecsRoot, } from "../contracts/lib/preparation-paths.js";
3
+ import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compile/compiled-paths.js";
4
+ import { asPreparationDataDir, preparationTestsSpecsRoot, } from "../../contracts/lib/preparation-paths.js";
5
5
  const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
6
6
  export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
7
7
  export function testSpecRootPath(sourcePath) {