@interf/compiler 0.7.3 → 0.9.3

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 (418) hide show
  1. package/README.md +124 -90
  2. package/TRADEMARKS.md +1 -1
  3. package/agent-skills/interf-actions/SKILL.md +74 -0
  4. package/agent-skills/interf-actions/references/cli.md +190 -0
  5. package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +9 -9
  6. package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +4 -4
  7. package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +1 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +18 -0
  9. package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +9 -9
  10. package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +3 -3
  11. package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +1 -1
  12. package/dist/cli/commands/check-draft.d.ts +11 -10
  13. package/dist/cli/commands/check-draft.js +21 -20
  14. package/dist/cli/commands/compile-controller.d.ts +10 -7
  15. package/dist/cli/commands/compile-controller.js +84 -79
  16. package/dist/cli/commands/compile.d.ts +3 -3
  17. package/dist/cli/commands/compile.js +101 -43
  18. package/dist/cli/commands/compiled-flow.d.ts +14 -11
  19. package/dist/cli/commands/compiled-flow.js +38 -33
  20. package/dist/cli/commands/control-path.d.ts +11 -0
  21. package/dist/cli/commands/control-path.js +72 -0
  22. package/dist/cli/commands/create-method-wizard.d.ts +76 -0
  23. package/dist/cli/commands/create-method-wizard.js +465 -0
  24. package/dist/cli/commands/create.d.ts +3 -3
  25. package/dist/cli/commands/create.js +81 -68
  26. package/dist/cli/commands/default.js +4 -3
  27. package/dist/cli/commands/doctor.js +5 -5
  28. package/dist/cli/commands/executor-flow.d.ts +6 -6
  29. package/dist/cli/commands/executor-flow.js +2 -2
  30. package/dist/cli/commands/init.d.ts +2 -2
  31. package/dist/cli/commands/init.js +415 -144
  32. package/dist/cli/commands/list.js +16 -14
  33. package/dist/cli/commands/preparation-selection.d.ts +6 -0
  34. package/dist/cli/commands/preparation-selection.js +11 -0
  35. package/dist/cli/commands/reset.js +3 -3
  36. package/dist/cli/commands/source-config-wizard.d.ts +12 -11
  37. package/dist/cli/commands/source-config-wizard.js +206 -228
  38. package/dist/cli/commands/status.js +152 -17
  39. package/dist/cli/commands/test-flow.d.ts +16 -16
  40. package/dist/cli/commands/test-flow.js +53 -243
  41. package/dist/cli/commands/test.d.ts +6 -2
  42. package/dist/cli/commands/test.js +136 -100
  43. package/dist/cli/commands/verify.js +13 -13
  44. package/dist/cli/commands/web.d.ts +11 -0
  45. package/dist/cli/commands/web.js +386 -0
  46. package/dist/cli/index.d.ts +2 -1
  47. package/dist/cli/index.js +3 -1
  48. package/dist/compiler-ui/404.html +1 -0
  49. package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
  50. package/dist/compiler-ui/__next._full.txt +20 -0
  51. package/dist/compiler-ui/__next._head.txt +5 -0
  52. package/dist/compiler-ui/__next._index.txt +5 -0
  53. package/dist/compiler-ui/__next._tree.txt +5 -0
  54. package/dist/compiler-ui/_next/static/chunks/03~yq9q893hmn.js +1 -0
  55. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
  56. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +1 -0
  57. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +1 -0
  58. package/dist/compiler-ui/_next/static/chunks/08m7vf5asqlsm.js +91 -0
  59. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +1 -0
  60. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +1 -0
  61. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +1 -0
  62. package/dist/compiler-ui/_next/static/chunks/0c9mu7yldxyyg.css +3 -0
  63. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +31 -0
  64. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +1 -0
  65. package/dist/compiler-ui/_next/static/chunks/0n51hrfoufc7g.js +1 -0
  66. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +1 -0
  67. package/dist/compiler-ui/_next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
  68. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +1 -0
  69. package/dist/compiler-ui/_next/static/chunks/15mks7ry_cupt.js +118 -0
  70. package/dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js +1 -0
  71. package/dist/compiler-ui/_next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
  72. package/dist/compiler-ui/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
  73. package/dist/compiler-ui/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  74. package/dist/compiler-ui/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  75. package/dist/compiler-ui/_next/static/media/worker.102zas1s52_pf.js +109 -0
  76. package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_buildManifest.js +11 -0
  77. package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_clientMiddlewareManifest.js +1 -0
  78. package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_ssgManifest.js +1 -0
  79. package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
  80. package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
  81. package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
  82. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
  83. package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
  84. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
  85. package/dist/compiler-ui/_not-found.html +1 -0
  86. package/dist/compiler-ui/_not-found.txt +15 -0
  87. package/dist/compiler-ui/index.html +1 -0
  88. package/dist/compiler-ui/index.txt +20 -0
  89. package/dist/index.d.ts +11 -7
  90. package/dist/index.js +8 -4
  91. package/dist/packages/agents/index.d.ts +1 -1
  92. package/dist/packages/agents/lib/args.d.ts +2 -2
  93. package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
  94. package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
  95. package/dist/packages/agents/lib/execution-profile.js +7 -6
  96. package/dist/packages/agents/lib/execution.js +4 -2
  97. package/dist/packages/agents/lib/executors.d.ts +14 -13
  98. package/dist/packages/agents/lib/executors.js +1 -0
  99. package/dist/packages/agents/lib/preflight.d.ts +1 -0
  100. package/dist/packages/agents/lib/preflight.js +32 -9
  101. package/dist/packages/agents/lib/render.d.ts +2 -2
  102. package/dist/packages/agents/lib/render.js +10 -9
  103. package/dist/packages/agents/lib/shells.d.ts +27 -34
  104. package/dist/packages/agents/lib/shells.js +191 -235
  105. package/dist/packages/agents/lib/types.d.ts +3 -2
  106. package/dist/packages/compiler/artifact-counts.d.ts +1 -0
  107. package/dist/packages/compiler/artifact-counts.js +30 -0
  108. package/dist/packages/compiler/compiled-paths.d.ts +5 -5
  109. package/dist/packages/compiler/compiled-paths.js +10 -10
  110. package/dist/packages/compiler/compiled-pipeline.d.ts +18 -12
  111. package/dist/packages/compiler/compiled-pipeline.js +34 -23
  112. package/dist/packages/compiler/compiled-schema.d.ts +20 -20
  113. package/dist/packages/compiler/compiled-schema.js +29 -29
  114. package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
  115. package/dist/packages/compiler/compiled-stage-plan.js +11 -11
  116. package/dist/packages/compiler/compiled-stage-runner.d.ts +10 -5
  117. package/dist/packages/compiler/compiled-stage-runner.js +56 -8
  118. package/dist/packages/compiler/compiled-target.d.ts +5 -5
  119. package/dist/packages/compiler/compiled-target.js +5 -5
  120. package/dist/packages/compiler/index.d.ts +3 -3
  121. package/dist/packages/compiler/index.js +2 -2
  122. package/dist/packages/compiler/lib/schema.d.ts +68 -93
  123. package/dist/packages/compiler/lib/schema.js +57 -89
  124. package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
  125. package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
  126. package/dist/packages/compiler/raw-snapshot.d.ts +3 -3
  127. package/dist/packages/compiler/raw-snapshot.js +0 -1
  128. package/dist/packages/compiler/reset.js +3 -3
  129. package/dist/packages/compiler/runtime-acceptance.js +9 -16
  130. package/dist/packages/compiler/runtime-contracts.js +9 -9
  131. package/dist/packages/compiler/runtime-prompt.js +9 -9
  132. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
  133. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  134. package/dist/packages/compiler/runtime-runs.js +12 -9
  135. package/dist/packages/compiler/runtime-types.d.ts +9 -7
  136. package/dist/packages/compiler/state-health.js +26 -35
  137. package/dist/packages/compiler/state-view.js +6 -6
  138. package/dist/packages/compiler/validate-compiled.d.ts +5 -5
  139. package/dist/packages/compiler/validate-compiled.js +56 -62
  140. package/dist/packages/compiler/validate.d.ts +2 -2
  141. package/dist/packages/compiler/validate.js +22 -14
  142. package/dist/packages/contracts/index.d.ts +2 -0
  143. package/dist/packages/contracts/index.js +1 -0
  144. package/dist/packages/contracts/lib/schema.d.ts +205 -0
  145. package/dist/packages/contracts/lib/schema.js +101 -0
  146. package/dist/packages/execution/adapters.d.ts +15 -0
  147. package/dist/packages/execution/adapters.js +1 -0
  148. package/dist/packages/execution/events.d.ts +8 -0
  149. package/dist/packages/execution/events.js +16 -0
  150. package/dist/packages/execution/index.d.ts +9 -0
  151. package/dist/packages/execution/index.js +6 -0
  152. package/dist/packages/execution/lib/schema.d.ts +1551 -0
  153. package/dist/packages/execution/lib/schema.js +296 -0
  154. package/dist/packages/local-service/action-values.d.ts +22 -0
  155. package/dist/packages/local-service/action-values.js +30 -0
  156. package/dist/packages/local-service/client.d.ts +119 -0
  157. package/dist/packages/local-service/client.js +356 -0
  158. package/dist/packages/local-service/index.d.ts +15 -0
  159. package/dist/packages/local-service/index.js +11 -0
  160. package/dist/packages/local-service/lib/schema.d.ts +6917 -0
  161. package/dist/packages/local-service/lib/schema.js +519 -0
  162. package/dist/packages/local-service/routes.d.ts +27 -0
  163. package/dist/packages/local-service/routes.js +32 -0
  164. package/dist/packages/local-service/run-observability.d.ts +6 -0
  165. package/dist/packages/local-service/run-observability.js +592 -0
  166. package/dist/packages/local-service/runtime.d.ts +130 -0
  167. package/dist/packages/local-service/runtime.js +2263 -0
  168. package/dist/packages/local-service/server.d.ts +18 -0
  169. package/dist/packages/local-service/server.js +577 -0
  170. package/dist/packages/method-authoring/index.d.ts +4 -0
  171. package/dist/packages/method-authoring/index.js +4 -0
  172. package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
  173. package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
  174. package/dist/packages/method-authoring/method-authoring.js +116 -0
  175. package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
  176. package/dist/packages/method-authoring/method-edit-session.js +125 -0
  177. package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
  178. package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +65 -64
  179. package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
  180. package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
  181. package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
  182. package/dist/packages/{workflow-package → method-package}/context-interface.js +20 -20
  183. package/dist/packages/method-package/index.d.ts +11 -0
  184. package/dist/packages/method-package/index.js +11 -0
  185. package/dist/packages/method-package/interf-method-package.d.ts +31 -0
  186. package/dist/packages/method-package/interf-method-package.js +496 -0
  187. package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
  188. package/dist/packages/method-package/local-methods.d.ts +64 -0
  189. package/dist/packages/method-package/local-methods.js +466 -0
  190. package/dist/packages/method-package/method-definitions.d.ts +83 -0
  191. package/dist/packages/method-package/method-definitions.js +205 -0
  192. package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
  193. package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +27 -27
  194. package/dist/packages/method-package/method-review-paths.d.ts +10 -0
  195. package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
  196. package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +13 -11
  197. package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +8 -6
  198. package/dist/packages/methods/index.d.ts +2 -0
  199. package/dist/packages/methods/index.js +2 -0
  200. package/dist/packages/methods/method-resolution.d.ts +6 -0
  201. package/dist/packages/methods/method-resolution.js +7 -0
  202. package/dist/packages/project-model/index.d.ts +2 -4
  203. package/dist/packages/project-model/index.js +1 -3
  204. package/dist/packages/project-model/interf-detect.d.ts +3 -3
  205. package/dist/packages/project-model/interf-detect.js +18 -14
  206. package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
  207. package/dist/packages/project-model/interf-scaffold.js +40 -38
  208. package/dist/packages/project-model/interf.d.ts +1 -2
  209. package/dist/packages/project-model/interf.js +1 -2
  210. package/dist/packages/project-model/lib/schema.d.ts +24 -14
  211. package/dist/packages/project-model/lib/schema.js +22 -30
  212. package/dist/packages/project-model/project-paths.d.ts +9 -10
  213. package/dist/packages/project-model/project-paths.js +14 -17
  214. package/dist/packages/project-model/source-config.d.ts +19 -17
  215. package/dist/packages/project-model/source-config.js +144 -145
  216. package/dist/packages/project-model/source-folders.d.ts +11 -0
  217. package/dist/packages/project-model/source-folders.js +110 -0
  218. package/dist/packages/testing/index.d.ts +2 -2
  219. package/dist/packages/testing/index.js +1 -1
  220. package/dist/packages/testing/lib/schema.d.ts +11 -11
  221. package/dist/packages/testing/lib/schema.js +8 -9
  222. package/dist/packages/testing/readiness-check-run.d.ts +67 -0
  223. package/dist/packages/testing/readiness-check-run.js +258 -0
  224. package/dist/packages/testing/test-execution.d.ts +3 -3
  225. package/dist/packages/testing/test-execution.js +8 -8
  226. package/dist/packages/testing/test-paths.js +7 -9
  227. package/dist/packages/testing/test-profile-presets.js +2 -2
  228. package/dist/packages/testing/test-sandbox.js +10 -11
  229. package/dist/packages/testing/test-targets.d.ts +1 -1
  230. package/dist/packages/testing/test-targets.js +8 -7
  231. package/dist/packages/testing/test-types.d.ts +1 -1
  232. package/package.json +29 -30
  233. package/builtin-workflows/interf/improve/SKILL.md +0 -18
  234. package/dist/cli/commands/create-workflow-wizard.d.ts +0 -70
  235. package/dist/cli/commands/create-workflow-wizard.js +0 -361
  236. package/dist/cli/commands/dataset-selection.d.ts +0 -6
  237. package/dist/cli/commands/dataset-selection.js +0 -11
  238. package/dist/lib/agent-args.d.ts +0 -1
  239. package/dist/lib/agent-args.js +0 -1
  240. package/dist/lib/agent-constants.d.ts +0 -1
  241. package/dist/lib/agent-constants.js +0 -1
  242. package/dist/lib/agent-detection.d.ts +0 -1
  243. package/dist/lib/agent-detection.js +0 -1
  244. package/dist/lib/agent-execution.d.ts +0 -1
  245. package/dist/lib/agent-execution.js +0 -1
  246. package/dist/lib/agent-logs.d.ts +0 -1
  247. package/dist/lib/agent-logs.js +0 -1
  248. package/dist/lib/agent-preflight.d.ts +0 -1
  249. package/dist/lib/agent-preflight.js +0 -1
  250. package/dist/lib/agent-render.d.ts +0 -1
  251. package/dist/lib/agent-render.js +0 -1
  252. package/dist/lib/agent-shells.d.ts +0 -1
  253. package/dist/lib/agent-shells.js +0 -1
  254. package/dist/lib/agent-status.d.ts +0 -1
  255. package/dist/lib/agent-status.js +0 -1
  256. package/dist/lib/agent-types.d.ts +0 -1
  257. package/dist/lib/agent-types.js +0 -1
  258. package/dist/lib/agents.d.ts +0 -1
  259. package/dist/lib/agents.js +0 -1
  260. package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
  261. package/dist/lib/builtin-compiled-workflow.js +0 -1
  262. package/dist/lib/chart-guidance.d.ts +0 -1
  263. package/dist/lib/chart-guidance.js +0 -1
  264. package/dist/lib/compiled-compile.d.ts +0 -1
  265. package/dist/lib/compiled-compile.js +0 -1
  266. package/dist/lib/compiled-paths.d.ts +0 -1
  267. package/dist/lib/compiled-paths.js +0 -3
  268. package/dist/lib/compiled-raw.d.ts +0 -1
  269. package/dist/lib/compiled-raw.js +0 -3
  270. package/dist/lib/compiled-reset.d.ts +0 -1
  271. package/dist/lib/compiled-reset.js +0 -3
  272. package/dist/lib/compiled-schema.d.ts +0 -1
  273. package/dist/lib/compiled-schema.js +0 -1
  274. package/dist/lib/discovery.d.ts +0 -1
  275. package/dist/lib/discovery.js +0 -1
  276. package/dist/lib/execution-profile.d.ts +0 -1
  277. package/dist/lib/execution-profile.js +0 -1
  278. package/dist/lib/executors.d.ts +0 -1
  279. package/dist/lib/executors.js +0 -1
  280. package/dist/lib/filesystem.d.ts +0 -1
  281. package/dist/lib/filesystem.js +0 -1
  282. package/dist/lib/interf-bootstrap.d.ts +0 -1
  283. package/dist/lib/interf-bootstrap.js +0 -3
  284. package/dist/lib/interf-detect.d.ts +0 -1
  285. package/dist/lib/interf-detect.js +0 -3
  286. package/dist/lib/interf-scaffold.d.ts +0 -1
  287. package/dist/lib/interf-scaffold.js +0 -3
  288. package/dist/lib/interf-workflow-package.d.ts +0 -1
  289. package/dist/lib/interf-workflow-package.js +0 -1
  290. package/dist/lib/interf.d.ts +0 -1
  291. package/dist/lib/interf.js +0 -3
  292. package/dist/lib/local-workflows.d.ts +0 -1
  293. package/dist/lib/local-workflows.js +0 -1
  294. package/dist/lib/logger.d.ts +0 -1
  295. package/dist/lib/logger.js +0 -1
  296. package/dist/lib/package-root.d.ts +0 -1
  297. package/dist/lib/package-root.js +0 -1
  298. package/dist/lib/parse.d.ts +0 -1
  299. package/dist/lib/parse.js +0 -1
  300. package/dist/lib/project-paths.d.ts +0 -1
  301. package/dist/lib/project-paths.js +0 -3
  302. package/dist/lib/runtime-acceptance.d.ts +0 -1
  303. package/dist/lib/runtime-acceptance.js +0 -1
  304. package/dist/lib/runtime-contracts.d.ts +0 -1
  305. package/dist/lib/runtime-contracts.js +0 -1
  306. package/dist/lib/runtime-inventory.d.ts +0 -1
  307. package/dist/lib/runtime-inventory.js +0 -1
  308. package/dist/lib/runtime-paths.d.ts +0 -1
  309. package/dist/lib/runtime-paths.js +0 -1
  310. package/dist/lib/runtime-prompt.d.ts +0 -1
  311. package/dist/lib/runtime-prompt.js +0 -1
  312. package/dist/lib/runtime-reconcile.d.ts +0 -1
  313. package/dist/lib/runtime-reconcile.js +0 -1
  314. package/dist/lib/runtime-runs.d.ts +0 -1
  315. package/dist/lib/runtime-runs.js +0 -1
  316. package/dist/lib/runtime-types.d.ts +0 -1
  317. package/dist/lib/runtime-types.js +0 -1
  318. package/dist/lib/runtime.d.ts +0 -1
  319. package/dist/lib/runtime.js +0 -1
  320. package/dist/lib/schema.d.ts +0 -4
  321. package/dist/lib/schema.js +0 -6
  322. package/dist/lib/source-config.d.ts +0 -1
  323. package/dist/lib/source-config.js +0 -3
  324. package/dist/lib/state-artifacts.d.ts +0 -1
  325. package/dist/lib/state-artifacts.js +0 -1
  326. package/dist/lib/state-health.d.ts +0 -1
  327. package/dist/lib/state-health.js +0 -1
  328. package/dist/lib/state-io.d.ts +0 -1
  329. package/dist/lib/state-io.js +0 -1
  330. package/dist/lib/state-paths.d.ts +0 -1
  331. package/dist/lib/state-paths.js +0 -1
  332. package/dist/lib/state-view.d.ts +0 -1
  333. package/dist/lib/state-view.js +0 -1
  334. package/dist/lib/state.d.ts +0 -1
  335. package/dist/lib/state.js +0 -1
  336. package/dist/lib/test-execution.d.ts +0 -1
  337. package/dist/lib/test-execution.js +0 -3
  338. package/dist/lib/test-matrices.d.ts +0 -1
  339. package/dist/lib/test-matrices.js +0 -3
  340. package/dist/lib/test-paths.d.ts +0 -1
  341. package/dist/lib/test-paths.js +0 -3
  342. package/dist/lib/test-profile-presets.d.ts +0 -1
  343. package/dist/lib/test-profile-presets.js +0 -3
  344. package/dist/lib/test-sandbox.d.ts +0 -1
  345. package/dist/lib/test-sandbox.js +0 -3
  346. package/dist/lib/test-specs.d.ts +0 -1
  347. package/dist/lib/test-specs.js +0 -3
  348. package/dist/lib/test-targets.d.ts +0 -1
  349. package/dist/lib/test-targets.js +0 -3
  350. package/dist/lib/test-types.d.ts +0 -1
  351. package/dist/lib/test-types.js +0 -3
  352. package/dist/lib/test.d.ts +0 -1
  353. package/dist/lib/test.js +0 -3
  354. package/dist/lib/util.d.ts +0 -1
  355. package/dist/lib/util.js +0 -1
  356. package/dist/lib/validate-compiled.d.ts +0 -1
  357. package/dist/lib/validate-compiled.js +0 -1
  358. package/dist/lib/validate-helpers.d.ts +0 -1
  359. package/dist/lib/validate-helpers.js +0 -1
  360. package/dist/lib/validate.d.ts +0 -1
  361. package/dist/lib/validate.js +0 -1
  362. package/dist/lib/workflow-authoring.d.ts +0 -1
  363. package/dist/lib/workflow-authoring.js +0 -1
  364. package/dist/lib/workflow-definitions.d.ts +0 -1
  365. package/dist/lib/workflow-definitions.js +0 -1
  366. package/dist/lib/workflow-edit-session.d.ts +0 -1
  367. package/dist/lib/workflow-edit-session.js +0 -1
  368. package/dist/lib/workflow-edit-utils.d.ts +0 -1
  369. package/dist/lib/workflow-edit-utils.js +0 -1
  370. package/dist/lib/workflow-helpers.d.ts +0 -1
  371. package/dist/lib/workflow-helpers.js +0 -1
  372. package/dist/lib/workflow-improvement.d.ts +0 -1
  373. package/dist/lib/workflow-improvement.js +0 -1
  374. package/dist/lib/workflow-primitives.d.ts +0 -1
  375. package/dist/lib/workflow-primitives.js +0 -1
  376. package/dist/lib/workflow-review-paths.d.ts +0 -1
  377. package/dist/lib/workflow-review-paths.js +0 -1
  378. package/dist/lib/workflow-stage-policy.d.ts +0 -1
  379. package/dist/lib/workflow-stage-policy.js +0 -1
  380. package/dist/lib/workflow-stage-runner.d.ts +0 -1
  381. package/dist/lib/workflow-stage-runner.js +0 -1
  382. package/dist/lib/workflows.d.ts +0 -1
  383. package/dist/lib/workflows.js +0 -1
  384. package/dist/packages/project-model/compiled-paths.d.ts +0 -1
  385. package/dist/packages/project-model/compiled-paths.js +0 -1
  386. package/dist/packages/project-model/compiled-raw.d.ts +0 -1
  387. package/dist/packages/project-model/compiled-raw.js +0 -1
  388. package/dist/packages/project-model/compiled-reset.d.ts +0 -1
  389. package/dist/packages/project-model/compiled-reset.js +0 -1
  390. package/dist/packages/shared/index.d.ts +0 -7
  391. package/dist/packages/shared/index.js +0 -7
  392. package/dist/packages/shared/util.d.ts +0 -3
  393. package/dist/packages/shared/util.js +0 -3
  394. package/dist/packages/testing/test-matrices.d.ts +0 -90
  395. package/dist/packages/testing/test-matrices.js +0 -96
  396. package/dist/packages/workflow-authoring/index.d.ts +0 -4
  397. package/dist/packages/workflow-authoring/index.js +0 -4
  398. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -26
  399. package/dist/packages/workflow-authoring/workflow-authoring.js +0 -123
  400. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -16
  401. package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -60
  402. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
  403. package/dist/packages/workflow-package/index.d.ts +0 -11
  404. package/dist/packages/workflow-package/index.js +0 -11
  405. package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -25
  406. package/dist/packages/workflow-package/interf-workflow-package.js +0 -389
  407. package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
  408. package/dist/packages/workflow-package/local-workflows.js +0 -441
  409. package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
  410. package/dist/packages/workflow-package/workflow-definitions.js +0 -210
  411. package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
  412. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
  413. /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
  414. /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
  415. /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
  416. /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
  417. /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
  418. /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
@@ -4,7 +4,7 @@ import chalk from "chalk";
4
4
  import { countFilesRecursive } from "../shared/filesystem.js";
5
5
  import { buildRuntimeExecutorInfo } from "../agents/lib/executors.js";
6
6
  import { RuntimeRunSchema, } from "./lib/schema.js";
7
- import { getWorkflowStageDefinition, getWorkflowStagePosition, getWorkflowStages, } from "../workflow-package/workflow-definitions.js";
7
+ import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "../method-package/method-definitions.js";
8
8
  import { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
9
9
  import { warnInterf } from "../shared/logger.js";
10
10
  export function loadRuntimeRun(dirPath) {
@@ -49,6 +49,7 @@ export async function runExecutorStage(options) {
49
49
  eventLogPath: eventLogPath(options.compiledPath, startedRun.run.run_id),
50
50
  statusLogPath: statusLogPath(options.compiledPath, startedRun.run.run_id),
51
51
  completionCheck: options.completionCheck,
52
+ onStatus: options.onStatus,
52
53
  });
53
54
  finalizeRuntimeRun(options.compiledPath, code);
54
55
  return code;
@@ -63,6 +64,7 @@ export async function runExecutorSummarizeStage(options) {
63
64
  eventLogPath: eventLogPath(options.compiledPath, startedRun.run.run_id),
64
65
  statusLogPath: statusLogPath(options.compiledPath, startedRun.run.run_id),
65
66
  completionCheck: options.completionCheck,
67
+ onStatus: options.onStatus,
66
68
  });
67
69
  const timer = setInterval(() => {
68
70
  const currentSummaryCount = countFilesRecursive(join(options.compiledPath, "summaries"));
@@ -79,6 +81,7 @@ export async function runExecutorSummarizeStage(options) {
79
81
  summary: `${options.stageLabel} ${completed}/${options.targetCount} source files into summaries.`,
80
82
  });
81
83
  console.log(chalk.dim(` STATUS: wrote ${completed}/${options.targetCount} summaries`));
84
+ options.onStatus?.(`STATUS: wrote ${completed}/${options.targetCount} summaries`);
82
85
  }, 10000);
83
86
  try {
84
87
  const code = await progressPromise;
@@ -144,9 +147,9 @@ export function markRuntimeRunSucceededAfterValidation(dirPath, summary) {
144
147
  function startRuntimeRun(options) {
145
148
  const runId = createRunId();
146
149
  const generatedAt = new Date().toISOString();
147
- const workflowStages = getWorkflowStages(options.workflow, options.workflowSourcePath);
148
- const stagePosition = getWorkflowStagePosition(options.workflow, options.stage, options.workflowSourcePath);
149
- const stageDefinition = getWorkflowStageDefinition(options.workflow, options.stage, options.workflowSourcePath);
150
+ const methodStages = getMethodStages(options.method, options.methodSourcePath);
151
+ const stagePosition = getMethodStagePosition(options.method, options.stage, options.methodSourcePath);
152
+ const stageDefinition = getMethodStageDefinition(options.method, options.stage, options.methodSourcePath);
150
153
  const contract = {
151
154
  kind: "interf-stage-contract",
152
155
  version: 1,
@@ -154,11 +157,11 @@ function startRuntimeRun(options) {
154
157
  run_id: runId,
155
158
  target_type: "compiled",
156
159
  target_name: options.compiledName,
157
- workflow: {
158
- id: options.workflow,
160
+ method: {
161
+ id: options.method,
159
162
  stage_index: stagePosition?.stageIndex ?? null,
160
- stage_total: stagePosition?.stageTotal ?? workflowStages.length,
161
- stages: stagePosition?.stages ?? workflowStages,
163
+ stage_total: stagePosition?.stageTotal ?? methodStages.length,
164
+ stages: stagePosition?.stages ?? methodStages,
162
165
  },
163
166
  stage: options.stage,
164
167
  stage_label: stageDefinition?.label ?? options.stageLabel,
@@ -178,7 +181,7 @@ function startRuntimeRun(options) {
178
181
  run_id: runId,
179
182
  target_type: "compiled",
180
183
  target_name: options.compiledName,
181
- workflow: options.workflow,
184
+ method: options.method,
182
185
  stage: options.stage,
183
186
  stage_label: stageDefinition?.label ?? options.stageLabel,
184
187
  contract_type: options.contractType,
@@ -1,14 +1,15 @@
1
- import { type WorkflowExecutor } from "../agents/lib/executors.js";
2
- import { type WorkflowId, type RuntimeContractType, type RuntimeRun, type RuntimeStage, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
1
+ import { type MethodExecutor } from "../agents/lib/executors.js";
2
+ import { type RuntimeRun, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
3
+ import type { MethodId, RuntimeContractType, RuntimeStage } from "../contracts/lib/schema.js";
3
4
  export type RuntimeRunStatus = "running" | "succeeded" | "failed";
4
- export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "workflow" | "stage" | "stage_label" | "contract_type" | "executor">;
5
+ export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "method" | "stage" | "stage_label" | "contract_type" | "executor">;
5
6
  export interface RuntimeStageExecutionOptions {
6
- executor: WorkflowExecutor;
7
+ executor: MethodExecutor;
7
8
  compiledPath: string;
8
9
  executionPath?: string;
9
10
  compiledName: string;
10
- workflow: WorkflowId;
11
- workflowSourcePath?: string;
11
+ method: MethodId;
12
+ methodSourcePath?: string;
12
13
  stage: RuntimeStage;
13
14
  stageLabel: string;
14
15
  contractType: RuntimeContractType;
@@ -16,6 +17,7 @@ export interface RuntimeStageExecutionOptions {
16
17
  contract: RuntimeStageContractDraft;
17
18
  buildPrompt: (contractPath: string) => string;
18
19
  completionCheck?: (() => boolean) | null;
20
+ onStatus?: (line: string) => void;
19
21
  }
20
22
  export interface RuntimeSummarizeExecutionOptions extends RuntimeStageExecutionOptions {
21
23
  startingSummaryCount: number;
@@ -34,7 +36,7 @@ export interface RuntimeStageContractOptions {
34
36
  extraReadArtifacts?: string[];
35
37
  stageReadArtifacts: string[];
36
38
  stageWriteArtifacts: string[];
37
- workflowNotes?: string[];
39
+ methodNotes?: string[];
38
40
  localSkillDocs?: string[];
39
41
  instructions: RuntimeStageInstructions;
40
42
  acceptance?: RuntimeStageAcceptance;
@@ -1,22 +1,13 @@
1
- import { basename, join } from "node:path";
2
- import { existsSync } from "node:fs";
1
+ import { basename } from "node:path";
3
2
  import { readInterfConfig, resolveSourceFolderPath, } from "../project-model/interf-detect.js";
4
3
  import { discoverSourceFiles } from "./discovery.js";
5
4
  import { loadRuntimeRun } from "./runtime.js";
6
5
  import { loadState } from "./state-io.js";
7
- import { validateCompiled, validateCompiledStage, validateCompiledWorkflow, } from "./validate.js";
6
+ import { validateCompiled, validateCompiledStage, validateCompiledMethod, } from "./validate.js";
8
7
  import { readCompiledSchemaFile } from "./compiled-schema.js";
9
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
10
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig } from "../workflow-package/workflow-definitions.js";
11
- import { listFilesRecursive } from "../shared/filesystem.js";
12
- function countZoneArtifacts(compiledPath, zonePath, kind) {
13
- const absolutePath = join(compiledPath, zonePath);
14
- if (!existsSync(absolutePath))
15
- return 0;
16
- if (kind === "file")
17
- return 1;
18
- return listFilesRecursive(absolutePath).length;
19
- }
8
+ import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
10
+ import { countCompiledZoneArtifacts } from "./artifact-counts.js";
20
11
  export function computeCompiledHealth(dirPath) {
21
12
  const now = new Date().toISOString();
22
13
  const config = readInterfConfig(dirPath);
@@ -26,38 +17,38 @@ export function computeCompiledHealth(dirPath) {
26
17
  const state = loadState(dirPath);
27
18
  const validation = validateCompiled(dirPath);
28
19
  const activeRun = loadRuntimeRun(dirPath);
29
- const workflowId = config
30
- ? resolveRequiredCompiledWorkflowFromConfig(config, `.interf/interf.json for ${dirPath}`)
20
+ const methodId = config
21
+ ? resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`)
31
22
  : null;
32
- let workflow = null;
33
- if (workflowId) {
23
+ let method = null;
24
+ if (methodId) {
34
25
  try {
35
- workflow = getActiveCompiledWorkflow(dirPath, workflowId);
26
+ method = getActiveCompiledMethod(dirPath);
36
27
  }
37
28
  catch {
38
- workflow = null;
29
+ method = null;
39
30
  }
40
31
  }
41
- const stageResults = workflow?.stages.map((stage) => ({
32
+ const stageResults = method?.stages.map((stage) => ({
42
33
  stage,
43
34
  validation: validateCompiledStage(dirPath, stage.id),
44
35
  })) ?? [];
45
36
  const completedStages = stageResults.filter((entry) => entry.validation.ok).length;
46
37
  const firstFailed = stageResults.find((entry) => !entry.validation.ok) ?? null;
47
- const workflowValidation = validateCompiledWorkflow(dirPath);
48
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
38
+ const methodValidation = validateCompiledMethod(dirPath);
39
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
49
40
  const zoneMetrics = Object.fromEntries((schema?.zones ?? []).map((zone) => [
50
41
  `zone_${zone.id}`,
51
- countZoneArtifacts(dirPath, zone.path, zone.kind),
42
+ countCompiledZoneArtifacts(dirPath, zone.path, zone.kind),
52
43
  ]));
53
44
  let status = "idle";
54
45
  let stage = "idle";
55
46
  let summary = "Idle — no source files have been compiled yet.";
56
- const errors = workflowValidation.errors.length;
57
- if (!validation.config_present || !validation.config_valid || !validation.config_type_match || !validation.workflow_valid || !validation.schema_valid) {
47
+ const errors = methodValidation.errors.length;
48
+ if (!validation.config_present || !validation.config_valid || !validation.config_type_match || !validation.method_valid || !validation.schema_valid) {
58
49
  status = "failed";
59
50
  stage = "failed";
60
- summary = workflowValidation.summary;
51
+ summary = methodValidation.summary;
61
52
  }
62
53
  else if (activeRun?.status === "running") {
63
54
  status = "running";
@@ -74,22 +65,22 @@ export function computeCompiledHealth(dirPath) {
74
65
  stage = activeRun.stage;
75
66
  summary = activeRun.error ?? activeRun.summary;
76
67
  }
77
- else if (workflowValidation.ok) {
68
+ else if (methodValidation.ok) {
78
69
  status = "compiled";
79
70
  stage = "compiled";
80
- summary = `Compiled — ${completedStages}/${workflow?.stages.length ?? 0} workflow stages satisfied.`;
71
+ summary = `Compiled — ${completedStages}/${method?.stages.length ?? 0} method stages satisfied.`;
81
72
  }
82
73
  else {
83
74
  status = "stale";
84
75
  stage = firstFailed?.stage.id ?? "compiled";
85
- summary = firstFailed?.validation.summary ?? workflowValidation.summary;
76
+ summary = firstFailed?.validation.summary ?? methodValidation.summary;
86
77
  }
87
78
  const checks = {
88
79
  ...validation,
89
- ...(workflow
90
- ? Object.fromEntries(workflow.stages.map((workflowStage) => [
91
- `stage_${workflowStage.id}_ok`,
92
- stageResults.find((entry) => entry.stage.id === workflowStage.id)?.validation.ok ?? false,
80
+ ...(method
81
+ ? Object.fromEntries(method.stages.map((methodStage) => [
82
+ `stage_${methodStage.id}_ok`,
83
+ stageResults.find((entry) => entry.stage.id === methodStage.id)?.validation.ok ?? false,
93
84
  ]))
94
85
  : {}),
95
86
  };
@@ -103,7 +94,7 @@ export function computeCompiledHealth(dirPath) {
103
94
  summary,
104
95
  metrics: {
105
96
  source_total: sourceTotal,
106
- stage_total: workflow?.stages.length ?? 0,
97
+ stage_total: method?.stages.length ?? 0,
107
98
  completed_stages: completedStages,
108
99
  warnings: state?.warning_count ?? 0,
109
100
  errors: (state?.error_count ?? 0) + errors,
@@ -4,9 +4,9 @@ import { discoverSourceFiles } from "./discovery.js";
4
4
  import { readInterfConfig, resolveSourceFolderPath } from "../project-model/interf-detect.js";
5
5
  import { loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
6
6
  import { rawSnapshotPath } from "./state-paths.js";
7
- import { compiledRuntimeRoot, workflowPackagePathForCompiled } from "./compiled-paths.js";
7
+ import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
8
8
  import { readCompiledSchemaFile } from "./compiled-schema.js";
9
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig } from "../workflow-package/workflow-definitions.js";
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
10
10
  export function ensureCompiledViewSpec(dirPath) {
11
11
  const existing = loadCompiledViewSpec(dirPath);
12
12
  const now = new Date().toISOString();
@@ -70,9 +70,9 @@ export function normalizeCompiledViewSpec(existing, defaults) {
70
70
  }
71
71
  function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
72
72
  const config = readInterfConfig(dirPath);
73
- const workflowId = resolveRequiredCompiledWorkflowFromConfig(config, `.interf/interf.json for ${dirPath}`);
74
- const workflow = getActiveCompiledWorkflow(dirPath, workflowId);
75
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
73
+ resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`);
74
+ const method = getActiveCompiledMethod(dirPath);
75
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
76
76
  const outputDocumentPaths = (schema?.zones ?? [])
77
77
  .filter((zone) => zone.role === "output" && zone.kind !== "runtime")
78
78
  .map((zone) => zone.path);
@@ -97,7 +97,7 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
97
97
  ...(outputDocumentPaths.length > 0
98
98
  ? [{ id: "outputs", type: "documents", title: "Output Zones", paths: outputDocumentPaths }]
99
99
  : []),
100
- { id: "workflow", type: "documents", title: "Workflow Docs", paths: ["workflow/README.md", ...workflow.stages.map((stage) => `workflow/compile/stages/${stage.skillDir}`)] },
100
+ { id: "method", type: "documents", title: "Method Docs", paths: ["method/README.md", ...method.stages.map((stage) => `method/compile/stages/${stage.skillDir}`)] },
101
101
  ],
102
102
  };
103
103
  }
@@ -2,8 +2,8 @@ export interface CompiledValidationSummary {
2
2
  config_present: boolean;
3
3
  config_valid: boolean;
4
4
  config_type_match: boolean;
5
- workflow_present: boolean;
6
- workflow_valid: boolean;
5
+ method_present: boolean;
6
+ method_valid: boolean;
7
7
  schema_present: boolean;
8
8
  schema_valid: boolean;
9
9
  }
@@ -16,12 +16,12 @@ export interface CompiledStageValidation {
16
16
  checks: Record<string, boolean>;
17
17
  errors: string[];
18
18
  }
19
- export interface CompiledWorkflowValidation extends CompiledStageValidation {
19
+ export interface CompiledMethodValidation extends CompiledStageValidation {
20
20
  stage_results: Record<string, boolean>;
21
21
  }
22
22
  export declare function validateCompiled(dirPath: string): CompiledValidationSummary;
23
23
  export declare function validateCompiledStage(dirPath: string, stageId: string): CompiledStageValidation;
24
- export declare function validateCompiledWorkflow(dirPath: string): CompiledWorkflowValidation;
24
+ export declare function validateCompiledMethod(dirPath: string): CompiledMethodValidation;
25
25
  export declare function validateCompiledSummarize(dirPath: string): CompiledStageValidation;
26
26
  export declare function validateCompiledStructure(dirPath: string): CompiledStageValidation;
27
- export declare function validateCompiledCompile(dirPath: string): CompiledWorkflowValidation;
27
+ export declare function validateCompiledCompile(dirPath: string): CompiledMethodValidation;
@@ -1,51 +1,45 @@
1
1
  import { existsSync } from "node:fs";
2
- import { join } from "node:path";
3
2
  import { discoverSourceFiles } from "./discovery.js";
4
- import { WORKFLOW_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, workflowSchemaExists, } from "./compiled-schema.js";
3
+ import { METHOD_SCHEMA_FILE, findCompiledSchemaZone, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
5
4
  import { resolveSourceFolderPath } from "../project-model/interf-detect.js";
6
- import { compiledInterfConfigPath, workflowPackagePathForCompiled } from "./compiled-paths.js";
5
+ import { compiledInterfConfigPath, methodPackagePathForCompiled } from "./compiled-paths.js";
7
6
  import { readCompiledConfig } from "./validate.js";
8
7
  import { loadState } from "./state.js";
9
8
  import { validateResolvedStageAcceptance, stageRecordFromState } from "./runtime-acceptance.js";
10
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig, } from "../workflow-package/workflow-definitions.js";
11
- import { listFilesRecursive } from "../shared/filesystem.js";
12
- function workflowSchemaPresent(dirPath) {
13
- return workflowSchemaExists(join(dirPath, ".interf", "workflow"));
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../method-package/method-definitions.js";
10
+ import { countCompiledZoneArtifacts } from "./artifact-counts.js";
11
+ function methodSchemaPresent(dirPath) {
12
+ return methodSchemaExists(methodPackagePathForCompiled(dirPath));
14
13
  }
15
- function countZoneArtifacts(compiledPath, zonePath, kind) {
16
- const absolutePath = compiledZoneAbsolutePath(compiledPath, { path: zonePath });
17
- if (!existsSync(absolutePath))
18
- return 0;
19
- if (kind === "file")
20
- return 1;
21
- return listFilesRecursive(absolutePath).length;
14
+ function methodJsonPresent(dirPath) {
15
+ return existsSync(methodPackagePathForCompiled(dirPath) + "/method.json");
22
16
  }
23
- function readWorkflowContext(dirPath) {
17
+ function readMethodContext(dirPath) {
24
18
  const config = readCompiledConfig(dirPath);
25
- const workflowId = config.valid
26
- ? resolveRequiredCompiledWorkflowFromConfig(config.value, `.interf/interf.json for ${dirPath}`)
19
+ const methodId = config.valid
20
+ ? resolveRequiredCompiledMethodFromConfig(config.value, `.interf/interf.json for ${dirPath}`)
27
21
  : null;
28
- let workflow = null;
29
- if (workflowId) {
22
+ let method = null;
23
+ if (methodId) {
30
24
  try {
31
- workflow = getActiveCompiledWorkflow(dirPath, workflowId);
25
+ method = getActiveCompiledMethod(dirPath);
32
26
  }
33
27
  catch {
34
- workflow = null;
28
+ method = null;
35
29
  }
36
30
  }
37
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
31
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
38
32
  const state = loadState(dirPath);
39
33
  const sourceTotal = config.valid
40
34
  ? discoverSourceFiles(resolveSourceFolderPath(dirPath, config.value), dirPath).totalCount
41
35
  : 0;
42
36
  return {
43
37
  config,
44
- workflow,
38
+ method,
45
39
  schema,
46
40
  state,
47
41
  sourceTotal,
48
- workflowId,
42
+ methodId,
49
43
  };
50
44
  }
51
45
  function stageRequired(sourceTotal, writeCounts, stageRecordPresent) {
@@ -58,7 +52,7 @@ function zoneWriteCount(compiledPath, schema, stage) {
58
52
  const zone = findCompiledSchemaZone(schema, zoneId);
59
53
  if (!zone)
60
54
  continue;
61
- const count = countZoneArtifacts(compiledPath, zone.path, zone.kind);
55
+ const count = countCompiledZoneArtifacts(compiledPath, zone.path, zone.kind);
62
56
  zoneCounts[zoneId] = count;
63
57
  total += count;
64
58
  }
@@ -80,26 +74,26 @@ function mergeValidationCounts(sourceTotal, stageRecord, zoneCounts) {
80
74
  return merged;
81
75
  }
82
76
  export function validateCompiled(dirPath) {
83
- const context = readWorkflowContext(dirPath);
77
+ const context = readMethodContext(dirPath);
84
78
  return {
85
79
  config_present: context.config.present,
86
80
  config_valid: context.config.valid,
87
81
  config_type_match: context.config.typeMatch(),
88
- workflow_present: existsSync(join(dirPath, ".interf", "workflow", "workflow.json")),
89
- workflow_valid: context.workflow !== null,
90
- schema_present: workflowSchemaPresent(dirPath),
82
+ method_present: methodJsonPresent(dirPath),
83
+ method_valid: context.method !== null,
84
+ schema_present: methodSchemaPresent(dirPath),
91
85
  schema_valid: context.schema !== null,
92
86
  };
93
87
  }
94
88
  export function validateCompiledStage(dirPath, stageId) {
95
- const context = readWorkflowContext(dirPath);
89
+ const context = readMethodContext(dirPath);
96
90
  const checks = {
97
91
  config_present: context.config.present,
98
92
  config_valid: context.config.valid,
99
93
  config_type_match: context.config.typeMatch(),
100
- workflow_present: existsSync(join(dirPath, ".interf", "workflow", "workflow.json")),
101
- workflow_valid: context.workflow !== null,
102
- schema_present: workflowSchemaPresent(dirPath),
94
+ method_present: methodJsonPresent(dirPath),
95
+ method_valid: context.method !== null,
96
+ schema_present: methodSchemaPresent(dirPath),
103
97
  schema_valid: context.schema !== null,
104
98
  };
105
99
  const errors = [];
@@ -108,34 +102,34 @@ export function validateCompiledStage(dirPath, stageId) {
108
102
  else if (!checks.config_valid)
109
103
  errors.push(`Could not parse ${compiledInterfConfigPath(dirPath)}.`);
110
104
  else if (!checks.config_type_match)
111
- errors.push("Config is not a compiled context.");
112
- if (!checks.workflow_present)
113
- errors.push("Missing .interf/workflow/workflow.json.");
114
- else if (!checks.workflow_valid)
115
- errors.push("Could not load the active workflow package.");
105
+ errors.push("Config is not a portable context.");
106
+ if (!checks.method_present)
107
+ errors.push("Missing .interf/method/method.json.");
108
+ else if (!checks.method_valid)
109
+ errors.push("Could not load the active Method package.");
116
110
  if (!checks.schema_present)
117
- errors.push(`Missing .interf/workflow/${WORKFLOW_SCHEMA_FILE}.`);
111
+ errors.push(`Missing .interf/method/${METHOD_SCHEMA_FILE}.`);
118
112
  else if (!checks.schema_valid)
119
- errors.push(`Could not parse .interf/workflow/${WORKFLOW_SCHEMA_FILE}.`);
120
- const workflowStage = context.workflow?.stages.find((stage) => stage.id === stageId) ?? null;
121
- checks.stage_present = workflowStage !== null;
113
+ errors.push(`Could not parse .interf/method/${METHOD_SCHEMA_FILE}.`);
114
+ const methodStage = context.method?.stages.find((stage) => stage.id === stageId) ?? null;
115
+ checks.stage_present = methodStage !== null;
122
116
  if (!checks.stage_present) {
123
- errors.push(`Workflow does not declare stage "${stageId}".`);
117
+ errors.push(`Method does not declare stage "${stageId}".`);
124
118
  }
125
119
  const stageRecord = stageRecordFromState(context.state, stageId);
126
120
  checks.stage_record_present = stageRecord !== null;
127
121
  checks.stage_finished = Boolean(stageRecord?.finished_at);
128
122
  checks.stage_succeeded = stageRecord?.status === "succeeded";
129
- const writeCounts = workflowStage && context.schema
130
- ? zoneWriteCount(dirPath, context.schema, workflowStage)
123
+ const writeCounts = methodStage && context.schema
124
+ ? zoneWriteCount(dirPath, context.schema, methodStage)
131
125
  : { total: 0, zoneCounts: {} };
132
126
  const acceptanceCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.zoneCounts);
133
127
  const required = stageRequired(context.sourceTotal, writeCounts.total, checks.stage_record_present);
134
128
  let acceptanceErrors = [];
135
- if (workflowStage && context.schema) {
129
+ if (methodStage && context.schema) {
136
130
  const acceptanceValidation = validateResolvedStageAcceptance(dirPath, {
137
131
  stageId,
138
- acceptance: workflowStage.acceptance,
132
+ acceptance: methodStage.acceptance,
139
133
  counts: acceptanceCounts,
140
134
  });
141
135
  checks.acceptance_ok = acceptanceValidation.ok;
@@ -167,30 +161,30 @@ export function validateCompiledStage(dirPath, stageId) {
167
161
  counts: {
168
162
  ...acceptanceCounts,
169
163
  write_artifacts: writeCounts.total,
170
- declared_write_zones: workflowStage?.writes.length ?? 0,
164
+ declared_write_zones: methodStage?.writes.length ?? 0,
171
165
  },
172
166
  checks,
173
167
  errors,
174
168
  };
175
169
  }
176
- export function validateCompiledWorkflow(dirPath) {
177
- const context = readWorkflowContext(dirPath);
170
+ export function validateCompiledMethod(dirPath) {
171
+ const context = readMethodContext(dirPath);
178
172
  const checks = {
179
173
  config_present: context.config.present,
180
174
  config_valid: context.config.valid,
181
175
  config_type_match: context.config.typeMatch(),
182
- workflow_present: existsSync(join(dirPath, ".interf", "workflow", "workflow.json")),
183
- workflow_valid: context.workflow !== null,
184
- schema_present: workflowSchemaPresent(dirPath),
176
+ method_present: methodJsonPresent(dirPath),
177
+ method_valid: context.method !== null,
178
+ schema_present: methodSchemaPresent(dirPath),
185
179
  schema_valid: context.schema !== null,
186
180
  };
187
- if (!context.workflow) {
188
- const errors = ["Could not load the active workflow package."];
181
+ if (!context.method) {
182
+ const errors = ["Could not load the active Method package."];
189
183
  return {
190
184
  ok: false,
191
185
  required: true,
192
- stage: "workflow",
193
- summary: `Compiled workflow failed — ${errors[0]}`,
186
+ stage: "method",
187
+ summary: `Compiled Method failed — ${errors[0]}`,
194
188
  counts: { source_total: context.sourceTotal, stage_total: 0, completed_stages: 0 },
195
189
  checks,
196
190
  errors,
@@ -201,7 +195,7 @@ export function validateCompiledWorkflow(dirPath) {
201
195
  const errors = [];
202
196
  let completedStages = 0;
203
197
  let failedStage = "compiled";
204
- for (const stage of context.workflow.stages) {
198
+ for (const stage of context.method.stages) {
205
199
  const validation = validateCompiledStage(dirPath, stage.id);
206
200
  stageResults[stage.id] = validation.ok;
207
201
  if (validation.ok) {
@@ -218,11 +212,11 @@ export function validateCompiledWorkflow(dirPath) {
218
212
  required: context.sourceTotal > 0,
219
213
  stage: failedStage,
220
214
  summary: ok
221
- ? `Compiled workflow verified — ${completedStages}/${context.workflow.stages.length} stages satisfied.`
222
- : `Compiled workflow failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
215
+ ? `Compiled Method verified — ${completedStages}/${context.method.stages.length} stages satisfied.`
216
+ : `Compiled Method failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
223
217
  counts: {
224
218
  source_total: context.sourceTotal,
225
- stage_total: context.workflow.stages.length,
219
+ stage_total: context.method.stages.length,
226
220
  completed_stages: completedStages,
227
221
  },
228
222
  checks,
@@ -237,5 +231,5 @@ export function validateCompiledStructure(dirPath) {
237
231
  return validateCompiledStage(dirPath, "structure");
238
232
  }
239
233
  export function validateCompiledCompile(dirPath) {
240
- return validateCompiledWorkflow(dirPath);
234
+ return validateCompiledMethod(dirPath);
241
235
  }
@@ -17,5 +17,5 @@ export declare function isOutputMarkdownFile(filePath: string): boolean;
17
17
  export declare function safeReadText(filePath: string): string | null;
18
18
  export declare function extractSynthAbstract(frontmatter: Record<string, unknown>, body: string): string | null;
19
19
  export declare function countSynthAbstractWords(frontmatter: Record<string, unknown>, body: string): number;
20
- export { validateCompiled, validateCompiledStage, validateCompiledWorkflow, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
21
- export type { CompiledValidationSummary, CompiledStageValidation, CompiledWorkflowValidation, } from "./validate-compiled.js";
20
+ export { validateCompiled, validateCompiledStage, validateCompiledMethod, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
21
+ export type { CompiledValidationSummary, CompiledStageValidation, CompiledMethodValidation, } from "./validate-compiled.js";
@@ -1,8 +1,8 @@
1
1
  import { existsSync, readFileSync, statSync, } from "node:fs";
2
- import { basename, extname, join } from "node:path";
2
+ import { basename, dirname, extname, join, resolve } from "node:path";
3
3
  import { readCompiledSchemaFile } from "./compiled-schema.js";
4
4
  import { compiledKnowledgeRootPath } from "./compiled-schema.js";
5
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
5
+ import { methodPackagePathForCompiled } from "./compiled-paths.js";
6
6
  import { listFilesRecursive } from "../shared/filesystem.js";
7
7
  import { readInterfConfig } from "../project-model/interf-detect.js";
8
8
  import { parseJsonFrontmatter } from "../shared/parse.js";
@@ -75,15 +75,15 @@ export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots
75
75
  if (!target)
76
76
  continue;
77
77
  if (target.includes("/")) {
78
- if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes)) {
78
+ if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath)) {
79
79
  brokenLinks += 1;
80
80
  }
81
81
  continue;
82
82
  }
83
83
  if (!noteIndex.has(target.toLowerCase()) &&
84
84
  !noteIndex.has(noteName(target).toLowerCase()) &&
85
- !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) &&
86
- !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes)) {
85
+ !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath) &&
86
+ !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes, filePath)) {
87
87
  brokenLinks += 1;
88
88
  }
89
89
  }
@@ -172,13 +172,16 @@ function countWords(text) {
172
172
  function noteName(filePath) {
173
173
  return basename(filePath, extname(filePath));
174
174
  }
175
- function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) {
176
- return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes)
175
+ function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
176
+ return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath)
177
177
  .some((candidate) => existsSync(candidate));
178
178
  }
179
- function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) {
179
+ function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
180
180
  const candidates = new Set();
181
181
  addPathCandidate(candidates, join(compiledRoot, target));
182
+ if (sourceFilePath && (target.startsWith("./") || target.startsWith("../"))) {
183
+ addPathCandidateIfInside(candidates, compiledRoot, resolve(dirname(sourceFilePath), target));
184
+ }
182
185
  const [firstSegment] = target.split("/");
183
186
  if (firstSegment && knowledgeRelativePrefixes.has(firstSegment)) {
184
187
  addPathCandidate(candidates, join(compiledKnowledgeRootPath(compiledRoot), target));
@@ -194,13 +197,18 @@ function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativ
194
197
  }
195
198
  function addPathCandidate(candidates, absolutePath) {
196
199
  candidates.add(absolutePath);
197
- if (!absolutePath.endsWith(".md")) {
198
- candidates.add(`${absolutePath}.md`);
199
- }
200
+ candidates.add(`${absolutePath}.md`);
201
+ }
202
+ function addPathCandidateIfInside(candidates, compiledRoot, absolutePath) {
203
+ const root = resolve(compiledRoot);
204
+ const candidate = resolve(absolutePath);
205
+ if (candidate !== root && !candidate.startsWith(`${root}/`))
206
+ return;
207
+ addPathCandidate(candidates, candidate);
200
208
  }
201
209
  function compiledZoneDirectoryPaths(compiledRoot) {
202
- const workflowRoot = workflowPackagePathForCompiled(compiledRoot);
203
- const schema = readCompiledSchemaFile(workflowRoot);
210
+ const methodRoot = methodPackagePathForCompiled(compiledRoot);
211
+ const schema = readCompiledSchemaFile(methodRoot);
204
212
  if (!schema)
205
213
  return new Map();
206
214
  return new Map(schema.zones
@@ -246,4 +254,4 @@ function addFrontmatterLinkTarget(targets, value) {
246
254
  }
247
255
  }
248
256
  }
249
- export { validateCompiled, validateCompiledStage, validateCompiledWorkflow, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
257
+ export { validateCompiled, validateCompiledStage, validateCompiledMethod, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
@@ -0,0 +1,2 @@
1
+ export * as schema from "./lib/schema.js";
2
+ export type { MethodId, PreparationName, ReadinessCheck, ReadinessGate, ReadinessState, ReadinessStatus, ReadinessTargetResult, RuntimeContractType, RuntimeExecutorInfo, RuntimeStage, RuntimeTargetType, TestCaseExpect, TestTargetType, } from "./lib/schema.js";
@@ -0,0 +1 @@
1
+ export * as schema from "./lib/schema.js";