@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
@@ -1,15 +1,180 @@
1
1
  import chalk from "chalk";
2
2
  import * as p from "@clack/prompts";
3
- import { resolve } from "node:path";
4
- import { detectInterf, ensurePortableContextScaffold, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
5
- import { SOURCE_FOLDER_CONFIG_PATH, migrateLegacySourceFolderConfig, syncCompiledInterfConfigFromSourceDatasetConfig, upsertSourceDatasetConfig, } from "../../packages/project-model/source-config.js";
6
- import { DEFAULT_COMPILED_NAME, describeCompileLoopSelection, promptSingleCompiledConfig, } from "./source-config-wizard.js";
7
- import { chooseOrCreateCompiledWorkflowForDataset, createWorkflowWizard, } from "./create-workflow-wizard.js";
8
- import { seedLocalDefaultWorkflow } from "../../packages/workflow-package/local-workflows.js";
9
- import { findBuiltCompiledPath, findSavedCompiledConfig, listSavedCompiledEntries, } from "./compiled-flow.js";
3
+ import { existsSync, statSync } from "node:fs";
4
+ import { homedir } from "node:os";
5
+ import { basename, isAbsolute, relative, resolve } from "node:path";
6
+ import { assertCompiledContainer, detectInterf, ensurePortableContextScaffold, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
7
+ import { SOURCE_FOLDER_CONFIG_PATH, configuredSourceFolderPath, loadSourceFolderConfig, resolveConfiguredSourceFolderPath, saveSourceFolderConfig, syncCompiledInterfConfigFromSourcePreparationConfig, upsertSourcePreparationConfig, } from "../../packages/project-model/source-config.js";
8
+ import { defaultPreparationNameForPath, } from "../../packages/project-model/source-folders.js";
9
+ import { DEFAULT_PREPARATION_NAME, describeCompileLoopSelection, listSourceFolderChoices, promptSingleCompiledConfig, } from "./source-config-wizard.js";
10
+ import { chooseOrCreateCompiledMethodForPreparation, createMethodWizard, } from "./create-method-wizard.js";
11
+ import { seedLocalDefaultMethod } from "../../packages/method-package/local-methods.js";
12
+ import { findBuiltCompiledPath, findSavedCompiledConfig, listSavedPreparationEntries, } from "./compiled-flow.js";
10
13
  import { readCurrentSavedTestComparison, } from "./test-flow.js";
11
14
  import { runCompileCommand } from "./compile.js";
12
15
  import { runTestCommand } from "./test.js";
16
+ import { defaultInterfInstanceRoot, relativeSourceFolderPath, resolveInterfInstanceContext, } from "./control-path.js";
17
+ import { runWebCommand } from "./web.js";
18
+ function displayPath(path) {
19
+ const resolvedPath = resolve(path);
20
+ const cwd = process.cwd();
21
+ if (resolvedPath === cwd)
22
+ return ".";
23
+ if (isPathInside(cwd, resolvedPath))
24
+ return `./${relative(cwd, resolvedPath)}`;
25
+ const home = homedir();
26
+ if (resolvedPath === home)
27
+ return "~";
28
+ if (isPathInside(home, resolvedPath))
29
+ return `~/${relative(home, resolvedPath)}`;
30
+ return resolvedPath;
31
+ }
32
+ function isPathInside(parentPath, childPath) {
33
+ const relativePath = relative(parentPath, childPath);
34
+ return relativePath === "" || (!relativePath.startsWith("..") && !isAbsolute(relativePath));
35
+ }
36
+ function normalizeSourceFolderInput(cwd, input) {
37
+ const trimmed = input.trim();
38
+ if (trimmed.length === 0) {
39
+ throw new Error("Source Folder is required.");
40
+ }
41
+ const sourceFolderPath = resolve(cwd, trimmed);
42
+ if (!existsSync(sourceFolderPath)) {
43
+ throw new Error("Pick an existing Source Folder.");
44
+ }
45
+ if (!statSync(sourceFolderPath).isDirectory()) {
46
+ throw new Error("Source Folder must be a directory.");
47
+ }
48
+ return sourceFolderPath;
49
+ }
50
+ function normalizeInterfInstanceFolderInput(cwd, sourceFolderPath, input) {
51
+ const trimmed = input.trim();
52
+ if (trimmed.length === 0) {
53
+ throw new Error("Interf Workspace folder is required.");
54
+ }
55
+ const controlPath = resolve(cwd, trimmed);
56
+ if (isPathInside(sourceFolderPath, controlPath)) {
57
+ throw new Error("Choose an Interf Workspace folder outside the Source Folder so Interf does not write generated state into your source files.");
58
+ }
59
+ assertCompiledContainer(controlPath);
60
+ return controlPath;
61
+ }
62
+ async function promptSourceFolderForInstance(cwd) {
63
+ const folderChoices = listSourceFolderChoices(cwd);
64
+ const selected = await p.select({
65
+ message: "Which Source Folder should Interf prepare?",
66
+ options: [
67
+ ...folderChoices,
68
+ {
69
+ value: "__current__",
70
+ label: `Use current folder (${basename(cwd)})`,
71
+ hint: cwd,
72
+ },
73
+ {
74
+ value: "__manual__",
75
+ label: "Enter a different path",
76
+ hint: "Use an absolute path or a path relative to this folder",
77
+ },
78
+ ],
79
+ initialValue: folderChoices.length === 1 ? folderChoices[0]?.value : "__current__",
80
+ });
81
+ if (p.isCancel(selected))
82
+ return null;
83
+ if (selected === "__manual__") {
84
+ const sourceInput = await p.text({
85
+ message: "Source Folder path?",
86
+ placeholder: cwd,
87
+ initialValue: cwd,
88
+ validate: (value) => {
89
+ try {
90
+ normalizeSourceFolderInput(cwd, value);
91
+ return undefined;
92
+ }
93
+ catch (error) {
94
+ return error instanceof Error ? error.message : String(error);
95
+ }
96
+ },
97
+ });
98
+ if (p.isCancel(sourceInput))
99
+ return null;
100
+ return normalizeSourceFolderInput(cwd, String(sourceInput));
101
+ }
102
+ return normalizeSourceFolderInput(cwd, selected === "__current__" ? "." : String(selected));
103
+ }
104
+ async function promptInterfInstanceFolder(cwd, sourceFolderPath) {
105
+ const defaultControlPath = defaultInterfInstanceRoot(sourceFolderPath);
106
+ p.log.info("Interf stores config, Methods, runs, and portable context outside the Source Folder.");
107
+ const controlInput = await p.text({
108
+ message: "Where should Interf store this Interf Workspace?",
109
+ placeholder: defaultControlPath,
110
+ initialValue: defaultControlPath,
111
+ validate: (value) => {
112
+ try {
113
+ normalizeInterfInstanceFolderInput(cwd, sourceFolderPath, value);
114
+ return undefined;
115
+ }
116
+ catch (error) {
117
+ return error instanceof Error ? error.message : String(error);
118
+ }
119
+ },
120
+ });
121
+ if (p.isCancel(controlInput))
122
+ return null;
123
+ return normalizeInterfInstanceFolderInput(cwd, sourceFolderPath, String(controlInput));
124
+ }
125
+ async function setupInterfInstance(cwd) {
126
+ const sourceFolderPath = await promptSourceFolderForInstance(cwd);
127
+ if (!sourceFolderPath)
128
+ return null;
129
+ const controlPath = await promptInterfInstanceFolder(cwd, sourceFolderPath);
130
+ if (!controlPath)
131
+ return null;
132
+ const sourceFolderConfigPath = relativeSourceFolderPath(controlPath, sourceFolderPath);
133
+ saveSourceFolderConfig(controlPath, {
134
+ source_folder: { path: sourceFolderConfigPath },
135
+ preparations: [],
136
+ });
137
+ const seeded = seedLocalDefaultMethod({ sourcePath: controlPath });
138
+ p.log.info(`Source Folder: ${displayPath(sourceFolderPath)}`);
139
+ p.log.info(`Interf Workspace: ${displayPath(controlPath)}`);
140
+ if (!seeded.alreadyExisted)
141
+ p.log.info(`Method: ${seeded.methodId}`);
142
+ return {
143
+ sourceFolderPath,
144
+ controlPath,
145
+ sourceFolderConfigPath,
146
+ };
147
+ }
148
+ async function promptEmptyInstanceAction() {
149
+ const selected = await p.select({
150
+ message: "What next?",
151
+ options: [
152
+ {
153
+ value: "web",
154
+ label: "Open Interf UI (Recommended)",
155
+ hint: "Start the local UI and API for this Source Folder",
156
+ },
157
+ {
158
+ value: "preparation",
159
+ label: "Create Preparation",
160
+ hint: "Describe the agent work, choose a Method, and save readiness checks",
161
+ },
162
+ {
163
+ value: "method",
164
+ label: "Create Method",
165
+ hint: "Create or draft a reusable way to process files",
166
+ },
167
+ {
168
+ value: "done",
169
+ label: "Done",
170
+ hint: `Leave the empty Interf Workspace at ${SOURCE_FOLDER_CONFIG_PATH}`,
171
+ },
172
+ ],
173
+ });
174
+ if (p.isCancel(selected))
175
+ return null;
176
+ return selected;
177
+ }
13
178
  export function currentRunTargetStatus(rows, target) {
14
179
  const outcomes = rows
15
180
  .map((row) => (target === "raw" ? row.rawOutcome : row.compiledOutcome))
@@ -23,76 +188,85 @@ export function currentRunTargetStatus(rows, target) {
23
188
  return "mixed";
24
189
  return "fail";
25
190
  }
26
- function describeSavedQuestions(dataset) {
27
- const count = dataset.checks.length;
191
+ function describeSavedReadinessChecks(preparation) {
192
+ const count = preparation.checks.length;
28
193
  if (count === 0)
29
- return "No questions yet";
30
- return `${count} question${count === 1 ? "" : "s"}`;
194
+ return "no checks";
195
+ return `${count} readiness check${count === 1 ? "" : "s"}`;
31
196
  }
32
- function printDatasetSummary(options) {
197
+ function printPreparationSummary(options) {
33
198
  const compiledConfig = options.builtCompiledPath
34
199
  ? readInterfConfig(options.builtCompiledPath)
35
200
  : null;
36
- const workflowLabel = `${options.dataset.workflow ?? "interf"}${compiledConfig?.workflow_origin?.local_draft === true ? " (local draft)" : ""}`;
37
- p.log.info(`Dataset: ${options.dataset.name}`);
38
- p.log.info(`Source folder: ${options.dataset.path}`);
39
- if (options.dataset.about) {
40
- p.log.info(`About: ${options.dataset.about}`);
41
- }
42
- p.log.info(`Workflow: ${workflowLabel}`);
43
- p.log.info(describeCompileLoopSelection({
44
- maxAttempts: options.dataset.max_attempts,
45
- maxLoops: options.dataset.max_loops,
46
- }));
47
- p.log.info(describeSavedQuestions(options.dataset));
48
- p.log.info(options.built ? "Portable context is available." : "Portable context has not been built yet.");
201
+ const methodLabel = `${options.preparation.method ?? "interf-default"}${compiledConfig?.method_origin?.local_draft === true ? " (local draft)" : ""}`;
202
+ const sourceFolderPath = resolve(options.sourcePath, options.preparation.path);
203
+ p.log.info(`Preparation: ${options.preparation.name} · Method: ${methodLabel}`);
204
+ if (options.preparation.about) {
205
+ p.log.info(`Agent work: ${options.preparation.about}`);
206
+ }
207
+ p.log.info(`Source Folder: ${displayPath(sourceFolderPath)}`);
208
+ p.log.info(`Portable Context: ${options.built ? "built" : "not built"} · Readiness: ${describeSavedReadinessChecks(options.preparation)}`);
209
+ const prepareMode = describeCompileLoopSelection({
210
+ maxAttempts: options.preparation.max_attempts,
211
+ maxLoops: options.preparation.max_loops,
212
+ });
213
+ if (prepareMode !== "Prepare once.")
214
+ p.log.info(`Prepare mode: ${prepareMode}`);
49
215
  if (options.latestComparison?.raw && options.latestComparison?.compiled) {
50
- p.log.info(`Latest saved comparison: source files ${options.latestComparison.raw.passed_cases}/${options.latestComparison.raw.total_cases}, portable context ${options.latestComparison.compiled.passed_cases}/${options.latestComparison.compiled.total_cases}.`);
216
+ p.log.info(`Latest saved comparison: source files ${options.latestComparison.raw.passed_cases}/${options.latestComparison.raw.total_cases}, Portable Context ${options.latestComparison.compiled.passed_cases}/${options.latestComparison.compiled.total_cases}.`);
51
217
  }
52
218
  else if (options.latestComparison?.raw) {
53
219
  p.log.info(`Latest saved source-files run: ${options.latestComparison.raw.passed_cases}/${options.latestComparison.raw.total_cases}.`);
54
220
  }
55
221
  else if (options.latestComparison?.compiled) {
56
- p.log.info(`Latest portable-context run: ${options.latestComparison.compiled.passed_cases}/${options.latestComparison.compiled.total_cases}.`);
222
+ p.log.info(`Latest Portable Context run: ${options.latestComparison.compiled.passed_cases}/${options.latestComparison.compiled.total_cases}.`);
57
223
  }
58
224
  else if (options.latestComparisonStale) {
59
- p.log.info("Saved test results are stale for the current questions.");
225
+ p.log.info("Saved readiness results are stale for the current checks.");
60
226
  }
61
227
  if (options.sourcePath !== process.cwd()) {
62
- p.log.info(`Project folder: ${options.sourcePath}`);
228
+ p.log.info(`Interf Workspace: ${displayPath(options.sourcePath)}`);
63
229
  }
64
230
  }
65
- async function promptDatasetAction(dataset, built, latestComparison) {
231
+ async function promptPreparationAction(preparation, built, latestComparison) {
66
232
  const options = [];
67
233
  const hasSavedRawBaseline = Boolean(latestComparison?.raw);
68
234
  const latestRawPasses = latestComparison?.raw &&
69
235
  latestComparison.raw.passed_cases === latestComparison.raw.total_cases;
70
236
  const compileOption = {
71
237
  value: "compile",
72
- label: built ? "Rebuild portable context agents can use" : "Build portable context agents can use (Recommended)",
238
+ label: built ? "Prepare again" : "Prepare files",
73
239
  hint: built
74
- ? "Refresh it from the current source files"
75
- : dataset.checks.length > 0
240
+ ? "Refresh Portable Context"
241
+ : preparation.checks.length > 0
76
242
  ? latestRawPasses
77
- ? "Build portable context agents can use for a side-by-side comparison with the latest saved source-files run"
243
+ ? "Use the latest source-files baseline"
78
244
  : hasSavedRawBaseline
79
- ? "Some questions still fail on the source files. Build portable context agents can use and compare it on the same questions"
80
- : "Run the selected workflow and write portable context agents can use"
81
- : "Build it for agents first, then measure it",
245
+ ? "Run the same readiness checks after prepare"
246
+ : "Write Portable Context"
247
+ : "Write Portable Context",
82
248
  };
83
- if (dataset.checks.length > 0) {
249
+ const webOption = {
250
+ value: "web",
251
+ label: "Open Interf UI",
252
+ hint: "Start the local UI and API for this Interf Workspace",
253
+ };
254
+ if (built) {
255
+ options.push(webOption);
256
+ }
257
+ if (preparation.checks.length > 0) {
84
258
  const testOption = {
85
259
  value: "test",
86
260
  label: built
87
- ? "Compare source files and portable context (Recommended)"
261
+ ? "Run readiness checks"
88
262
  : hasSavedRawBaseline
89
263
  ? "Rerun the source-files baseline"
90
264
  : "Measure the source-files baseline",
91
265
  hint: built
92
- ? "See whether the portable context helps your agents on the saved questions"
266
+ ? "Check source files and Portable Context"
93
267
  : hasSavedRawBaseline
94
- ? "Refresh the saved source-files baseline on the current questions"
95
- : "Optional benchmark before Interf builds portable context",
268
+ ? "Refresh the saved source-files baseline on the current readiness checks"
269
+ : "Optional source-files readiness baseline before Interf builds Portable Context",
96
270
  };
97
271
  if (built) {
98
272
  options.push(testOption, compileOption);
@@ -105,46 +279,45 @@ async function promptDatasetAction(dataset, built, latestComparison) {
105
279
  options.push(compileOption);
106
280
  }
107
281
  options.push({
108
- value: "dataset",
109
- label: "Add another setup",
110
- hint: "Add a separate folder, focus, or question set",
282
+ value: "preparation",
283
+ label: "Add another Preparation",
284
+ hint: "Separate source, focus, or checks",
111
285
  }, {
112
286
  value: "edit",
113
- label: "Edit questions and settings",
114
- hint: "Update questions, focus, workflow, or compile mode",
287
+ label: preparation.checks.length === 0 ? "Add readiness checks" : "Edit checks and settings",
288
+ hint: "Checks, focus, Method, or mode",
115
289
  }, {
116
- value: "workflow",
117
- label: "Create workflow",
118
- hint: "Advanced: customize the compile method",
290
+ value: "method",
291
+ label: "Create Method",
292
+ hint: "Custom file processing",
119
293
  }, {
120
294
  value: "done",
121
295
  label: "Done",
122
296
  hint: "Exit the wizard",
123
297
  });
124
298
  const selected = await p.select({
125
- message: "What do you want to do next?",
299
+ message: "What next?",
126
300
  options,
127
301
  });
128
302
  if (p.isCancel(selected))
129
303
  return null;
130
304
  return selected;
131
305
  }
132
- function printDatasetRecommendation(dataset, built, latestComparison) {
133
- if (dataset.checks.length === 0) {
134
- p.log.info("Recommended first step: save a few questions for this dataset.");
306
+ function printPreparationRecommendation(preparation, built, latestComparison) {
307
+ if (preparation.checks.length === 0) {
135
308
  return;
136
309
  }
137
310
  if (!built) {
138
311
  if (latestComparison?.raw) {
139
312
  p.log.info(latestComparison.raw.passed_cases === latestComparison.raw.total_cases
140
- ? `Latest source-files run: ${latestComparison.raw.passed_cases}/${latestComparison.raw.total_cases}. Build portable context agents can use if you want a side-by-side comparison.`
141
- : `Latest source-files run: ${latestComparison.raw.passed_cases}/${latestComparison.raw.total_cases}. Some questions still fail on the source files. Build portable context agents can use if you want Interf to process this data and compare it on the same questions.`);
313
+ ? `Latest source-files run: ${latestComparison.raw.passed_cases}/${latestComparison.raw.total_cases}. Prepare files if you want a side-by-side comparison.`
314
+ : `Latest source-files run: ${latestComparison.raw.passed_cases}/${latestComparison.raw.total_cases}. Some readiness checks still fail on the source files. Prepare files if you want Interf to process this data and run the same checks.`);
142
315
  return;
143
316
  }
144
- p.log.info("Recommended first step: choose a workflow and build portable context agents can use.");
317
+ p.log.info("Recommended first step: choose a Method and prepare files.");
145
318
  return;
146
319
  }
147
- p.log.info("Recommended first step: compare the source-files baseline and portable context.");
320
+ p.log.info("Recommended first step: compare the source-files baseline and Portable Context.");
148
321
  }
149
322
  async function promptPostBaselineAction(rows) {
150
323
  const status = currentRunTargetStatus(rows, "raw");
@@ -160,33 +333,33 @@ async function promptPostBaselineAction(rows) {
160
333
  }
161
334
  const compileRecommended = status !== "pass";
162
335
  const selected = await p.select({
163
- message: "What do you want to do next?",
336
+ message: "What next?",
164
337
  options: [
165
338
  {
166
339
  value: "compile",
167
340
  label: compileRecommended
168
- ? "Build portable context agents can use (Recommended)"
169
- : "Build portable context agents can use",
341
+ ? "Prepare files and write Portable Context (Recommended)"
342
+ : "Prepare files and write Portable Context",
170
343
  hint: compileRecommended
171
344
  ? status === "mixed"
172
- ? "Some selected agents still failed on the source files. Build portable context agents can use and compare it on the same questions"
173
- : "Build portable context agents can use and compare it on the same questions"
174
- : "Build portable context agents can use and compare it on the same questions",
345
+ ? "Some selected agents still failed on the source files. Prepare files and run the same readiness checks"
346
+ : "Prepare files and run the same readiness checks"
347
+ : "Prepare files and run the same readiness checks",
175
348
  },
176
349
  {
177
350
  value: "edit",
178
- label: "Change questions and settings",
179
- hint: "Revise the questions or setup settings before the next run",
351
+ label: "Change readiness checks and settings",
352
+ hint: "Revise the readiness checks or Preparation settings before the next run",
180
353
  },
181
354
  {
182
355
  value: "rerun",
183
356
  label: "Rerun the source-files baseline",
184
- hint: "Run the same questions again, including different local agents if you want",
357
+ hint: "Run the same readiness checks again, including different local agents if you want",
185
358
  },
186
359
  {
187
360
  value: "done",
188
361
  label: "Stop here",
189
- hint: "Leave the dataset as-is for now",
362
+ hint: "Leave the Preparation as-is for now",
190
363
  },
191
364
  ],
192
365
  });
@@ -198,28 +371,28 @@ async function chooseCompiledForWizard(options) {
198
371
  if (options.fixedCompiledName) {
199
372
  return findSavedCompiledConfig(options.sourcePath, options.fixedCompiledName);
200
373
  }
201
- const savedEntries = listSavedCompiledEntries(options.sourcePath);
374
+ const savedEntries = listSavedPreparationEntries(options.sourcePath);
202
375
  if (savedEntries.length === 0)
203
376
  return null;
204
377
  if (savedEntries.length === 1)
205
378
  return savedEntries[0]?.config ?? null;
206
379
  const selected = await p.select({
207
- message: "Which source folder setup do you want to work with?",
380
+ message: "Which saved Preparation do you want to work with?",
208
381
  options: [
209
382
  ...savedEntries.map((entry) => ({
210
383
  value: entry.config.name,
211
384
  label: entry.config.name,
212
385
  hint: [
213
386
  `path ${entry.config.path}`,
214
- entry.config.about ?? describeSavedQuestions(entry.config),
215
- `workflow ${entry.config.workflow ?? "interf"}${entry.localDraft ? " (local draft)" : ""}`,
216
- entry.path ? "built" : "not built yet",
387
+ entry.config.about ?? describeSavedReadinessChecks(entry.config),
388
+ `Method ${entry.config.method ?? "interf-default"}${entry.localDraft ? " (local draft)" : ""}`,
389
+ entry.path ? "Portable Context available" : "Portable Context not built yet",
217
390
  ].join(" · "),
218
391
  })),
219
392
  {
220
393
  value: "__new__",
221
- label: "Add another setup",
222
- hint: "Add a separate folder, focus, or question set",
394
+ label: "Add another Preparation",
395
+ hint: "Add a separate folder, focus, or readiness-check set",
223
396
  },
224
397
  ],
225
398
  });
@@ -230,111 +403,119 @@ async function chooseCompiledForWizard(options) {
230
403
  return findSavedCompiledConfig(options.sourcePath, String(selected));
231
404
  }
232
405
  async function promptCompiledSetup(options) {
406
+ const savedConfig = loadSourceFolderConfig(options.sourcePath);
407
+ const fixedPath = options.fixedPath
408
+ ?? (options.fixedName ? options.initial?.path : configuredSourceFolderPath(savedConfig) ?? undefined);
233
409
  const compiledConfig = await promptSingleCompiledConfig({
234
410
  projectPath: options.sourcePath,
235
411
  initial: options.initial,
236
412
  ...(options.fixedName ? { fixedName: options.fixedName } : {}),
413
+ ...(fixedPath ? { fixedPath } : {}),
237
414
  introStyle: options.introStyle,
238
415
  });
239
416
  if (!compiledConfig)
240
417
  return null;
241
- const workflowChoice = await chooseOrCreateCompiledWorkflowForDataset(options.sourcePath, compiledConfig, {
242
- currentWorkflowId: options.initial?.workflow ?? "interf-default",
418
+ const methodChoice = await chooseOrCreateCompiledMethodForPreparation(options.sourcePath, compiledConfig, {
419
+ currentMethodId: options.initial?.method ?? "interf-default",
243
420
  executionProfile: options.executionProfile,
244
421
  });
245
- if (!workflowChoice || p.isCancel(workflowChoice))
422
+ if (!methodChoice || p.isCancel(methodChoice))
246
423
  return null;
247
- const workflowId = String(workflowChoice);
248
- const compiledConfigWithWorkflow = {
424
+ const methodId = String(methodChoice);
425
+ const compiledConfigWithMethod = {
249
426
  ...compiledConfig,
250
- workflow: workflowId,
427
+ method: methodId,
251
428
  };
252
- upsertSourceDatasetConfig(options.sourcePath, compiledConfigWithWorkflow, {
429
+ upsertSourcePreparationConfig(options.sourcePath, compiledConfigWithMethod, {
253
430
  ...(options.fixedName ? { matchName: options.fixedName } : {}),
254
431
  });
255
- const builtCompiledPath = findBuiltCompiledPath(options.sourcePath, compiledConfigWithWorkflow.name);
432
+ const builtCompiledPath = findBuiltCompiledPath(options.sourcePath, compiledConfigWithMethod.name);
256
433
  if (builtCompiledPath) {
257
- syncCompiledInterfConfigFromSourceDatasetConfig(builtCompiledPath, compiledConfigWithWorkflow);
434
+ syncCompiledInterfConfigFromSourcePreparationConfig(builtCompiledPath, compiledConfigWithMethod);
258
435
  }
259
436
  else {
260
- ensurePortableContextScaffold(options.sourcePath, compiledConfigWithWorkflow.name, compiledConfigWithWorkflow.workflow ?? "interf-default");
437
+ ensurePortableContextScaffold(options.sourcePath, compiledConfigWithMethod.name, compiledConfigWithMethod.method ?? "interf-default");
261
438
  }
262
439
  console.log();
263
- console.log(chalk.green(` ✓ Saved setup in ${SOURCE_FOLDER_CONFIG_PATH}`));
264
- console.log(chalk.dim(` Project folder: ${options.sourcePath}`));
265
- console.log(chalk.dim(` Setup: ${compiledConfigWithWorkflow.name}`));
266
- console.log(chalk.dim(` Source folder: ${compiledConfigWithWorkflow.path}`));
267
- console.log(chalk.dim(` Workflow: ${workflowId} · interf/workflows/${workflowId}/`));
268
- console.log(chalk.dim(` Compile mode: ${describeCompileLoopSelection({
269
- maxAttempts: compiledConfigWithWorkflow.max_attempts,
270
- maxLoops: compiledConfigWithWorkflow.max_loops,
440
+ console.log(chalk.green(` ✓ Saved Preparation in ${SOURCE_FOLDER_CONFIG_PATH}`));
441
+ console.log(chalk.dim(` Interf Workspace: ${options.sourcePath}`));
442
+ console.log(chalk.dim(` Preparation: ${compiledConfigWithMethod.name}`));
443
+ console.log(chalk.dim(` Source folder: ${compiledConfigWithMethod.path}`));
444
+ console.log(chalk.dim(` Method: ${methodId} · interf/methods/${methodId}/`));
445
+ console.log(chalk.dim(` Prepare mode: ${describeCompileLoopSelection({
446
+ maxAttempts: compiledConfigWithMethod.max_attempts,
447
+ maxLoops: compiledConfigWithMethod.max_loops,
271
448
  })}`));
272
- return compiledConfigWithWorkflow;
449
+ return compiledConfigWithMethod;
273
450
  }
274
451
  export async function compileSelectedCompiled(sourcePath, compiledConfig, deps = {}) {
275
452
  return (deps.runCompileCommand ?? runCompileCommand)({
276
453
  sourcePath,
277
- dataset: compiledConfig.name,
278
- datasetConfig: compiledConfig,
454
+ preparation: compiledConfig.name,
455
+ preparationConfig: compiledConfig,
279
456
  skipConfirm: true,
280
- skipDatasetBanner: true,
457
+ skipPreparationBanner: true,
281
458
  });
282
459
  }
283
460
  async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
284
461
  const builtCompiledPath = findBuiltCompiledPath(sourcePath, compiledConfig.name);
285
462
  const { comparison: latestComparison, stale: latestComparisonStale, } = readCurrentSavedTestComparison({
286
463
  projectPath: sourcePath,
287
- datasetName: compiledConfig.name,
464
+ preparationName: compiledConfig.name,
288
465
  checks: compiledConfig.checks,
289
466
  });
290
- printDatasetSummary({
467
+ printPreparationSummary({
291
468
  sourcePath,
292
- dataset: compiledConfig,
469
+ preparation: compiledConfig,
293
470
  built: Boolean(builtCompiledPath),
294
471
  builtCompiledPath,
295
472
  latestComparison,
296
473
  latestComparisonStale,
297
474
  });
298
- printDatasetRecommendation(compiledConfig, Boolean(builtCompiledPath), latestComparison);
299
- const action = await promptDatasetAction(compiledConfig, Boolean(builtCompiledPath), latestComparison);
475
+ printPreparationRecommendation(compiledConfig, Boolean(builtCompiledPath), latestComparison);
476
+ const action = await promptPreparationAction(compiledConfig, Boolean(builtCompiledPath), latestComparison);
300
477
  if (!action)
301
478
  return;
302
479
  if (action === "done") {
303
- p.outro(options.justConfigured ? "Saved dataset setup." : "Nothing changed.");
480
+ p.outro(options.justConfigured ? "Saved Preparation." : "Nothing changed.");
304
481
  return;
305
482
  }
306
- if (action === "workflow") {
307
- const workflowId = await createWorkflowWizard({
483
+ if (action === "method") {
484
+ const methodId = await createMethodWizard({
308
485
  sourcePath,
309
- datasetContext: {
486
+ preparationContext: {
310
487
  config: compiledConfig,
311
- datasetPath: resolve(sourcePath, compiledConfig.path),
488
+ sourceFolderPath: resolve(sourcePath, compiledConfig.path),
312
489
  },
313
490
  });
314
- if (typeof workflowId === "string") {
491
+ if (typeof methodId === "string") {
315
492
  const nextConfig = {
316
493
  ...compiledConfig,
317
- workflow: workflowId,
494
+ method: methodId,
318
495
  };
319
- upsertSourceDatasetConfig(sourcePath, nextConfig, {
496
+ upsertSourcePreparationConfig(sourcePath, nextConfig, {
320
497
  matchName: compiledConfig.name,
321
498
  });
322
499
  const builtCompiledPath = findBuiltCompiledPath(sourcePath, compiledConfig.name);
323
500
  if (builtCompiledPath) {
324
- syncCompiledInterfConfigFromSourceDatasetConfig(builtCompiledPath, nextConfig);
501
+ syncCompiledInterfConfigFromSourcePreparationConfig(builtCompiledPath, nextConfig);
325
502
  }
326
503
  else {
327
- ensurePortableContextScaffold(sourcePath, nextConfig.name, nextConfig.workflow ?? "interf-default");
504
+ ensurePortableContextScaffold(sourcePath, nextConfig.name, nextConfig.method ?? "interf-default");
328
505
  }
329
- p.log.info(`Assigned workflow "${workflowId}" to dataset "${compiledConfig.name}".`);
506
+ p.log.info(`Assigned Method "${methodId}" to Preparation "${compiledConfig.name}".`);
330
507
  p.log.info("Next: run `interf compile`, then `interf test`.");
331
508
  }
332
509
  return;
333
510
  }
334
- if (action === "dataset") {
511
+ if (action === "web") {
512
+ await runWebCommand({ "control-path": sourcePath });
513
+ return;
514
+ }
515
+ if (action === "preparation") {
335
516
  const nextCompiled = await promptCompiledSetup({
336
517
  sourcePath,
337
- initial: { name: DEFAULT_COMPILED_NAME },
518
+ initial: { name: DEFAULT_PREPARATION_NAME },
338
519
  introStyle: "additional",
339
520
  });
340
521
  if (!nextCompiled)
@@ -357,16 +538,16 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
357
538
  if (action === "test") {
358
539
  if (compiledConfig.checks.length === 0) {
359
540
  process.exitCode = 1;
360
- console.log(chalk.red(` Setup "${compiledConfig.name}" does not have any questions yet.`));
361
- console.log(chalk.dim(" Run `interf`, edit this setup, and add a few questions first."));
541
+ console.log(chalk.red(` Preparation "${compiledConfig.name}" does not have any readiness checks yet.`));
542
+ console.log(chalk.dim(" Run `interf`, edit this Preparation, and add a few readiness checks first."));
362
543
  console.log(chalk.dim(" Then rerun `interf test`."));
363
544
  return;
364
545
  }
365
546
  if (builtCompiledPath) {
366
547
  const baselineRan = await runTestCommand({
367
548
  sourcePath,
368
- dataset: compiledConfig.name,
369
- datasetConfig: compiledConfig,
549
+ preparation: compiledConfig.name,
550
+ preparationConfig: compiledConfig,
370
551
  target: "both",
371
552
  });
372
553
  if (!baselineRan) {
@@ -378,9 +559,9 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
378
559
  const baselineCapture = { result: null };
379
560
  const baselineRan = await runTestCommand({
380
561
  sourcePath,
381
- dataset: compiledConfig.name,
382
- datasetConfig: compiledConfig,
383
- target: "raw",
562
+ preparation: compiledConfig.name,
563
+ preparationConfig: compiledConfig,
564
+ target: "source-files",
384
565
  onComplete(result) {
385
566
  baselineCapture.result = result;
386
567
  },
@@ -416,14 +597,14 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
416
597
  return;
417
598
  }
418
599
  if (compileResult.testedDuringCompile) {
419
- p.log.info("This compile run already checked the portable context on the saved questions.");
600
+ p.log.info("This prepare run already checked the Portable Context on the saved readiness checks.");
420
601
  p.log.info("Run `interf test` later if you want a fresh side-by-side comparison summary.");
421
602
  return;
422
603
  }
423
604
  await runTestCommand({
424
605
  sourcePath,
425
- dataset: compiledConfig.name,
426
- datasetConfig: compiledConfig,
606
+ preparation: compiledConfig.name,
607
+ preparationConfig: compiledConfig,
427
608
  target: "both",
428
609
  });
429
610
  return;
@@ -435,22 +616,22 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
435
616
  if (compiledConfig.checks.length === 0)
436
617
  return;
437
618
  if (compileResult.testedDuringCompile) {
438
- p.log.info("This compile run already checked the portable context on the compile agent.");
619
+ p.log.info("This prepare run already checked the Portable Context on the compile agent.");
439
620
  }
440
621
  const runCompiledTest = await p.confirm({
441
622
  message: compileResult.testedDuringCompile
442
- ? "Run a fresh source-files versus portable-context comparison now?"
623
+ ? "Run a fresh source-files versus Portable Context comparison now?"
443
624
  : builtCompiledPath
444
- ? "Run source files and portable context on the saved questions now?"
445
- : "Compare source files and portable context on the saved questions now?",
625
+ ? "Run readiness checks on source files and Portable Context now?"
626
+ : "Run readiness checks on source files and Portable Context now?",
446
627
  initialValue: true,
447
628
  });
448
629
  if (p.isCancel(runCompiledTest) || !runCompiledTest)
449
630
  return;
450
631
  await runTestCommand({
451
632
  sourcePath,
452
- dataset: compiledConfig.name,
453
- datasetConfig: compiledConfig,
633
+ preparation: compiledConfig.name,
634
+ preparationConfig: compiledConfig,
454
635
  target: "both",
455
636
  });
456
637
  return;
@@ -458,33 +639,117 @@ async function runCompiledActionMenu(sourcePath, compiledConfig, options = {}) {
458
639
  }
459
640
  export const initCommand = {
460
641
  command: "init",
461
- describe: "Open the dataset wizard for this folder",
642
+ describe: "Set up Interf or open the Preparation wizard",
462
643
  handler: async () => {
463
644
  await runInitCommand();
464
645
  },
465
646
  };
466
647
  export async function runInitCommand() {
467
648
  p.intro(chalk.bold("Interf"));
468
- p.log.info("Interf prepares data for agent work.");
469
- p.log.info("Run locally, process files, show evidence that your data is ready, and write verifiable outputs as portable context for agents.");
470
649
  const cwd = process.cwd();
471
650
  const detected = detectInterf(cwd);
472
- const sourcePath = detected ? resolveSourceControlPath(detected.path) : cwd;
651
+ let initContext = detected
652
+ ? {
653
+ controlPath: resolveSourceControlPath(detected.path),
654
+ defaultSourceFolderPath: null,
655
+ defaultPreparationPath: null,
656
+ }
657
+ : resolveInterfInstanceContext(cwd);
658
+ let sourcePath = initContext.controlPath;
473
659
  if (detected) {
474
- p.log.info(`Working from the project folder: ${sourcePath}`);
660
+ p.log.info(`Interf Workspace: ${displayPath(sourcePath)}`);
475
661
  }
476
- if (migrateLegacySourceFolderConfig(sourcePath)) {
477
- p.log.info(`Moved saved setup to ${SOURCE_FOLDER_CONFIG_PATH}.`);
662
+ const hasConfig = Boolean(loadSourceFolderConfig(sourcePath));
663
+ let initialSourceFolderPath = initContext.defaultSourceFolderPath;
664
+ let initialSourceFolderConfigPath = initContext.defaultPreparationPath;
665
+ if (!detected && !hasConfig) {
666
+ const setup = await setupInterfInstance(cwd);
667
+ if (!setup)
668
+ return;
669
+ sourcePath = setup.controlPath;
670
+ initialSourceFolderPath = setup.sourceFolderPath;
671
+ initialSourceFolderConfigPath = setup.sourceFolderConfigPath;
672
+ initContext = {
673
+ controlPath: sourcePath,
674
+ defaultSourceFolderPath: initialSourceFolderPath,
675
+ defaultPreparationPath: initialSourceFolderConfigPath,
676
+ };
478
677
  }
479
- const seeded = seedLocalDefaultWorkflow({ sourcePath });
480
- if (!seeded.alreadyExisted) {
481
- p.log.info(`Copied built-in workflow package to interf/workflows/${seeded.workflowId}/ — inspect or fork it anytime.`);
678
+ else {
679
+ const seeded = seedLocalDefaultMethod({ sourcePath });
680
+ if (!seeded.alreadyExisted) {
681
+ p.log.info(`Method: ${seeded.methodId}`);
682
+ }
683
+ }
684
+ let currentConfig = loadSourceFolderConfig(sourcePath);
685
+ if (!currentConfig?.source_folder && !detected) {
686
+ const currentEntries = currentConfig?.preparations ?? [];
687
+ if (initialSourceFolderPath && initialSourceFolderConfigPath) {
688
+ saveSourceFolderConfig(sourcePath, {
689
+ source_folder: { path: initialSourceFolderConfigPath },
690
+ preparations: currentEntries,
691
+ });
692
+ currentConfig = loadSourceFolderConfig(sourcePath);
693
+ }
694
+ else if (currentConfig && currentEntries.length === 0) {
695
+ const sourceFolderPath = await promptSourceFolderForInstance(cwd);
696
+ if (!sourceFolderPath)
697
+ return;
698
+ const sourceFolderConfigPath = relativeSourceFolderPath(sourcePath, sourceFolderPath);
699
+ saveSourceFolderConfig(sourcePath, {
700
+ source_folder: { path: sourceFolderConfigPath },
701
+ preparations: [],
702
+ });
703
+ initialSourceFolderPath = sourceFolderPath;
704
+ initialSourceFolderConfigPath = sourceFolderConfigPath;
705
+ currentConfig = loadSourceFolderConfig(sourcePath);
706
+ p.log.info(`Source Folder: ${sourceFolderPath}`);
707
+ p.log.info(`Source Folder path in Interf config: ${sourceFolderConfigPath}`);
708
+ }
709
+ else if (!currentConfig) {
710
+ const setup = await setupInterfInstance(cwd);
711
+ if (!setup)
712
+ return;
713
+ sourcePath = setup.controlPath;
714
+ initialSourceFolderPath = setup.sourceFolderPath;
715
+ initialSourceFolderConfigPath = setup.sourceFolderConfigPath;
716
+ currentConfig = loadSourceFolderConfig(sourcePath);
717
+ }
482
718
  }
483
- const savedEntries = listSavedCompiledEntries(sourcePath);
719
+ const configuredSourcePath = resolveConfiguredSourceFolderPath(sourcePath, currentConfig);
720
+ const configuredSourceConfigPath = configuredSourceFolderPath(currentConfig);
721
+ if (configuredSourcePath && configuredSourceConfigPath) {
722
+ initialSourceFolderPath = configuredSourcePath;
723
+ initialSourceFolderConfigPath = configuredSourceConfigPath;
724
+ }
725
+ const savedEntries = listSavedPreparationEntries(sourcePath);
484
726
  if (savedEntries.length === 0) {
727
+ p.log.info("No Preparations yet. Create one when you are ready to describe the agent work.");
728
+ const action = await promptEmptyInstanceAction();
729
+ if (!action || action === "done") {
730
+ p.outro("Interf Workspace is ready. Next: run `interf web` or `interf create preparation`.");
731
+ return;
732
+ }
733
+ if (action === "web") {
734
+ await runWebCommand({ "control-path": sourcePath });
735
+ return;
736
+ }
737
+ if (action === "method") {
738
+ const methodId = await createMethodWizard({ sourcePath });
739
+ if (typeof methodId === "string") {
740
+ p.outro(`Saved Method "${methodId}". Next: create a Preparation and assign this Method.`);
741
+ }
742
+ return;
743
+ }
485
744
  const compiledConfig = await promptCompiledSetup({
486
745
  sourcePath,
487
- initial: { name: DEFAULT_COMPILED_NAME },
746
+ initial: initialSourceFolderPath && initialSourceFolderConfigPath
747
+ ? {
748
+ name: defaultPreparationNameForPath(initialSourceFolderPath),
749
+ path: initialSourceFolderConfigPath,
750
+ }
751
+ : { name: DEFAULT_PREPARATION_NAME },
752
+ ...(initialSourceFolderConfigPath ? { fixedPath: initialSourceFolderConfigPath } : {}),
488
753
  introStyle: "first",
489
754
  });
490
755
  if (!compiledConfig)
@@ -501,7 +766,13 @@ export async function runInitCommand() {
501
766
  if (selectedCompiled === "__new__") {
502
767
  const compiledConfig = await promptCompiledSetup({
503
768
  sourcePath,
504
- initial: { name: DEFAULT_COMPILED_NAME },
769
+ initial: initialSourceFolderPath && initialSourceFolderConfigPath
770
+ ? {
771
+ name: defaultPreparationNameForPath(initialSourceFolderPath),
772
+ path: initialSourceFolderConfigPath,
773
+ }
774
+ : { name: DEFAULT_PREPARATION_NAME },
775
+ ...(initialSourceFolderConfigPath ? { fixedPath: initialSourceFolderConfigPath } : {}),
505
776
  introStyle: "additional",
506
777
  });
507
778
  if (!compiledConfig)