@interf/compiler 0.7.3 → 0.9.1

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 (302) hide show
  1. package/README.md +123 -89
  2. package/TRADEMARKS.md +1 -1
  3. package/agent-skills/interf-actions/SKILL.md +71 -0
  4. package/agent-skills/interf-actions/references/cli.md +190 -0
  5. package/apps/compiler-ui/.next/server/app/index.html +1 -0
  6. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_buildManifest.js +11 -0
  7. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_clientMiddlewareManifest.js +1 -0
  8. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_ssgManifest.js +1 -0
  9. package/apps/compiler-ui/.next/static/chunks/03~yq9q893hmn.js +1 -0
  10. package/apps/compiler-ui/.next/static/chunks/06z~l3kwb891e.js +1 -0
  11. package/apps/compiler-ui/.next/static/chunks/08g7lvje.te.u.js +1 -0
  12. package/apps/compiler-ui/.next/static/chunks/08m7vf5asqlsm.js +91 -0
  13. package/apps/compiler-ui/.next/static/chunks/0_i-3_5l9t2qe.js +1 -0
  14. package/apps/compiler-ui/.next/static/chunks/0b-ywny_j0g~0.js +1 -0
  15. package/apps/compiler-ui/.next/static/chunks/0b52v41o1gixx.js +1 -0
  16. package/apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js +124 -0
  17. package/apps/compiler-ui/.next/static/chunks/0gpzgsv0w.q~m.js +31 -0
  18. package/apps/compiler-ui/.next/static/chunks/0ilwfezfvu6~-.js +1 -0
  19. package/apps/compiler-ui/.next/static/chunks/0n51hrfoufc7g.js +1 -0
  20. package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +5 -0
  21. package/apps/compiler-ui/.next/static/chunks/0xxmf45eskdt~.css +1 -0
  22. package/apps/compiler-ui/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
  23. package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +3 -0
  24. package/apps/compiler-ui/.next/static/chunks/14wtz~vq25~qq.js +1 -0
  25. package/apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js +1 -0
  26. package/apps/compiler-ui/.next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
  27. package/apps/compiler-ui/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
  28. package/apps/compiler-ui/.next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  29. package/apps/compiler-ui/.next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  30. package/apps/compiler-ui/.next/static/media/worker.102zas1s52_pf.js +109 -0
  31. package/builtin-workflows/interf/README.md +8 -8
  32. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
  33. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
  34. package/builtin-workflows/interf/improve/SKILL.md +1 -1
  35. package/builtin-workflows/interf/use/query/SKILL.md +1 -1
  36. package/builtin-workflows/interf/workflow.json +8 -8
  37. package/builtin-workflows/interf/workflow.schema.json +1 -1
  38. package/dist/cli/commands/check-draft.d.ts +5 -4
  39. package/dist/cli/commands/check-draft.js +18 -17
  40. package/dist/cli/commands/compile-controller.d.ts +3 -0
  41. package/dist/cli/commands/compile-controller.js +53 -45
  42. package/dist/cli/commands/compile.js +83 -27
  43. package/dist/cli/commands/compiled-flow.d.ts +3 -0
  44. package/dist/cli/commands/compiled-flow.js +9 -7
  45. package/dist/cli/commands/control-path.d.ts +11 -0
  46. package/dist/cli/commands/control-path.js +72 -0
  47. package/dist/cli/commands/create-workflow-wizard.d.ts +6 -0
  48. package/dist/cli/commands/create-workflow-wizard.js +191 -77
  49. package/dist/cli/commands/create.js +54 -40
  50. package/dist/cli/commands/default.js +4 -3
  51. package/dist/cli/commands/doctor.js +5 -5
  52. package/dist/cli/commands/executor-flow.js +1 -1
  53. package/dist/cli/commands/init.js +326 -76
  54. package/dist/cli/commands/list.js +8 -7
  55. package/dist/cli/commands/preparation-selection.d.ts +6 -0
  56. package/dist/cli/commands/preparation-selection.js +11 -0
  57. package/dist/cli/commands/reset.js +3 -3
  58. package/dist/cli/commands/source-config-wizard.d.ts +4 -3
  59. package/dist/cli/commands/source-config-wizard.js +175 -197
  60. package/dist/cli/commands/status.js +116 -8
  61. package/dist/cli/commands/test-flow.d.ts +1 -1
  62. package/dist/cli/commands/test-flow.js +31 -31
  63. package/dist/cli/commands/test.d.ts +4 -0
  64. package/dist/cli/commands/test.js +95 -58
  65. package/dist/cli/commands/verify.js +7 -7
  66. package/dist/cli/commands/web.d.ts +11 -0
  67. package/dist/cli/commands/web.js +373 -0
  68. package/dist/cli/index.d.ts +2 -1
  69. package/dist/cli/index.js +3 -1
  70. package/dist/index.d.ts +4 -2
  71. package/dist/index.js +3 -1
  72. package/dist/packages/agents/lib/execution.js +4 -2
  73. package/dist/packages/agents/lib/executors.d.ts +1 -0
  74. package/dist/packages/agents/lib/executors.js +1 -0
  75. package/dist/packages/agents/lib/render.d.ts +2 -2
  76. package/dist/packages/agents/lib/render.js +10 -9
  77. package/dist/packages/agents/lib/shells.d.ts +3 -11
  78. package/dist/packages/agents/lib/shells.js +45 -96
  79. package/dist/packages/agents/lib/types.d.ts +1 -0
  80. package/dist/packages/compiler/compiled-paths.d.ts +4 -1
  81. package/dist/packages/compiler/compiled-paths.js +7 -1
  82. package/dist/packages/compiler/compiled-pipeline.d.ts +7 -0
  83. package/dist/packages/compiler/compiled-pipeline.js +15 -4
  84. package/dist/packages/compiler/compiled-schema.js +1 -1
  85. package/dist/packages/compiler/compiled-stage-plan.d.ts +2 -2
  86. package/dist/packages/compiler/compiled-stage-plan.js +4 -4
  87. package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -0
  88. package/dist/packages/compiler/compiled-stage-runner.js +50 -2
  89. package/dist/packages/compiler/compiled-target.d.ts +1 -1
  90. package/dist/packages/compiler/compiled-target.js +2 -2
  91. package/dist/packages/compiler/lib/schema.d.ts +161 -1
  92. package/dist/packages/compiler/lib/schema.js +87 -1
  93. package/dist/packages/compiler/raw-snapshot.d.ts +9 -2
  94. package/dist/packages/compiler/runtime-acceptance.js +1 -1
  95. package/dist/packages/compiler/runtime-contracts.js +2 -2
  96. package/dist/packages/compiler/runtime-prompt.js +6 -6
  97. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  98. package/dist/packages/compiler/runtime-runs.js +3 -0
  99. package/dist/packages/compiler/runtime-types.d.ts +1 -0
  100. package/dist/packages/compiler/state-health.js +1 -1
  101. package/dist/packages/compiler/state-view.js +2 -2
  102. package/dist/packages/compiler/validate-compiled.js +11 -9
  103. package/dist/packages/execution/adapters.d.ts +15 -0
  104. package/dist/packages/execution/adapters.js +1 -0
  105. package/dist/packages/execution/events.d.ts +8 -0
  106. package/dist/packages/execution/events.js +16 -0
  107. package/dist/packages/execution/index.d.ts +9 -0
  108. package/dist/packages/execution/index.js +6 -0
  109. package/dist/packages/execution/lib/schema.d.ts +1554 -0
  110. package/dist/packages/execution/lib/schema.js +319 -0
  111. package/dist/packages/local-service/action-values.d.ts +23 -0
  112. package/dist/packages/local-service/action-values.js +31 -0
  113. package/dist/packages/local-service/client.d.ts +119 -0
  114. package/dist/packages/local-service/client.js +356 -0
  115. package/dist/packages/local-service/index.d.ts +15 -0
  116. package/dist/packages/local-service/index.js +11 -0
  117. package/dist/packages/local-service/lib/schema.d.ts +7355 -0
  118. package/dist/packages/local-service/lib/schema.js +636 -0
  119. package/dist/packages/local-service/routes.d.ts +27 -0
  120. package/dist/packages/local-service/routes.js +32 -0
  121. package/dist/packages/local-service/runtime.d.ts +134 -0
  122. package/dist/packages/local-service/runtime.js +2841 -0
  123. package/dist/packages/local-service/server.d.ts +17 -0
  124. package/dist/packages/local-service/server.js +572 -0
  125. package/dist/packages/project-model/index.d.ts +2 -1
  126. package/dist/packages/project-model/index.js +1 -0
  127. package/dist/packages/project-model/interf-detect.d.ts +6 -2
  128. package/dist/packages/project-model/interf-detect.js +25 -10
  129. package/dist/packages/project-model/interf-scaffold.js +9 -6
  130. package/dist/packages/project-model/interf.d.ts +1 -1
  131. package/dist/packages/project-model/interf.js +1 -1
  132. package/dist/packages/project-model/lib/schema.d.ts +80 -6
  133. package/dist/packages/project-model/lib/schema.js +29 -19
  134. package/dist/packages/project-model/source-config.d.ts +22 -13
  135. package/dist/packages/project-model/source-config.js +140 -123
  136. package/dist/packages/project-model/source-folders.d.ts +11 -0
  137. package/dist/packages/project-model/source-folders.js +110 -0
  138. package/dist/packages/testing/test-execution.js +5 -5
  139. package/dist/packages/testing/test-paths.js +1 -3
  140. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
  141. package/dist/packages/workflow-authoring/workflow-authoring.js +45 -86
  142. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
  143. package/dist/packages/workflow-authoring/workflow-edit-session.js +80 -49
  144. package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
  145. package/dist/packages/workflow-package/context-interface.js +1 -1
  146. package/dist/packages/workflow-package/interf-workflow-package.d.ts +6 -0
  147. package/dist/packages/workflow-package/interf-workflow-package.js +115 -8
  148. package/dist/packages/workflow-package/local-workflows.js +33 -17
  149. package/dist/packages/workflow-package/workflow-definitions.d.ts +5 -5
  150. package/dist/packages/workflow-package/workflow-definitions.js +23 -22
  151. package/dist/packages/workflow-package/workflow-helpers.js +10 -6
  152. package/dist/packages/workflow-package/workflow-stage-runner.d.ts +1 -0
  153. package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
  154. package/package.json +17 -1
  155. package/dist/cli/commands/dataset-selection.d.ts +0 -6
  156. package/dist/cli/commands/dataset-selection.js +0 -11
  157. package/dist/lib/agent-args.d.ts +0 -1
  158. package/dist/lib/agent-args.js +0 -1
  159. package/dist/lib/agent-constants.d.ts +0 -1
  160. package/dist/lib/agent-constants.js +0 -1
  161. package/dist/lib/agent-detection.d.ts +0 -1
  162. package/dist/lib/agent-detection.js +0 -1
  163. package/dist/lib/agent-execution.d.ts +0 -1
  164. package/dist/lib/agent-execution.js +0 -1
  165. package/dist/lib/agent-logs.d.ts +0 -1
  166. package/dist/lib/agent-logs.js +0 -1
  167. package/dist/lib/agent-preflight.d.ts +0 -1
  168. package/dist/lib/agent-preflight.js +0 -1
  169. package/dist/lib/agent-render.d.ts +0 -1
  170. package/dist/lib/agent-render.js +0 -1
  171. package/dist/lib/agent-shells.d.ts +0 -1
  172. package/dist/lib/agent-shells.js +0 -1
  173. package/dist/lib/agent-status.d.ts +0 -1
  174. package/dist/lib/agent-status.js +0 -1
  175. package/dist/lib/agent-types.d.ts +0 -1
  176. package/dist/lib/agent-types.js +0 -1
  177. package/dist/lib/agents.d.ts +0 -1
  178. package/dist/lib/agents.js +0 -1
  179. package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
  180. package/dist/lib/builtin-compiled-workflow.js +0 -1
  181. package/dist/lib/chart-guidance.d.ts +0 -1
  182. package/dist/lib/chart-guidance.js +0 -1
  183. package/dist/lib/compiled-compile.d.ts +0 -1
  184. package/dist/lib/compiled-compile.js +0 -1
  185. package/dist/lib/compiled-paths.d.ts +0 -1
  186. package/dist/lib/compiled-paths.js +0 -3
  187. package/dist/lib/compiled-raw.d.ts +0 -1
  188. package/dist/lib/compiled-raw.js +0 -3
  189. package/dist/lib/compiled-reset.d.ts +0 -1
  190. package/dist/lib/compiled-reset.js +0 -3
  191. package/dist/lib/compiled-schema.d.ts +0 -1
  192. package/dist/lib/compiled-schema.js +0 -1
  193. package/dist/lib/discovery.d.ts +0 -1
  194. package/dist/lib/discovery.js +0 -1
  195. package/dist/lib/execution-profile.d.ts +0 -1
  196. package/dist/lib/execution-profile.js +0 -1
  197. package/dist/lib/executors.d.ts +0 -1
  198. package/dist/lib/executors.js +0 -1
  199. package/dist/lib/filesystem.d.ts +0 -1
  200. package/dist/lib/filesystem.js +0 -1
  201. package/dist/lib/interf-bootstrap.d.ts +0 -1
  202. package/dist/lib/interf-bootstrap.js +0 -3
  203. package/dist/lib/interf-detect.d.ts +0 -1
  204. package/dist/lib/interf-detect.js +0 -3
  205. package/dist/lib/interf-scaffold.d.ts +0 -1
  206. package/dist/lib/interf-scaffold.js +0 -3
  207. package/dist/lib/interf-workflow-package.d.ts +0 -1
  208. package/dist/lib/interf-workflow-package.js +0 -1
  209. package/dist/lib/interf.d.ts +0 -1
  210. package/dist/lib/interf.js +0 -3
  211. package/dist/lib/local-workflows.d.ts +0 -1
  212. package/dist/lib/local-workflows.js +0 -1
  213. package/dist/lib/logger.d.ts +0 -1
  214. package/dist/lib/logger.js +0 -1
  215. package/dist/lib/package-root.d.ts +0 -1
  216. package/dist/lib/package-root.js +0 -1
  217. package/dist/lib/parse.d.ts +0 -1
  218. package/dist/lib/parse.js +0 -1
  219. package/dist/lib/project-paths.d.ts +0 -1
  220. package/dist/lib/project-paths.js +0 -3
  221. package/dist/lib/runtime-acceptance.d.ts +0 -1
  222. package/dist/lib/runtime-acceptance.js +0 -1
  223. package/dist/lib/runtime-contracts.d.ts +0 -1
  224. package/dist/lib/runtime-contracts.js +0 -1
  225. package/dist/lib/runtime-inventory.d.ts +0 -1
  226. package/dist/lib/runtime-inventory.js +0 -1
  227. package/dist/lib/runtime-paths.d.ts +0 -1
  228. package/dist/lib/runtime-paths.js +0 -1
  229. package/dist/lib/runtime-prompt.d.ts +0 -1
  230. package/dist/lib/runtime-prompt.js +0 -1
  231. package/dist/lib/runtime-reconcile.d.ts +0 -1
  232. package/dist/lib/runtime-reconcile.js +0 -1
  233. package/dist/lib/runtime-runs.d.ts +0 -1
  234. package/dist/lib/runtime-runs.js +0 -1
  235. package/dist/lib/runtime-types.d.ts +0 -1
  236. package/dist/lib/runtime-types.js +0 -1
  237. package/dist/lib/runtime.d.ts +0 -1
  238. package/dist/lib/runtime.js +0 -1
  239. package/dist/lib/schema.d.ts +0 -4
  240. package/dist/lib/schema.js +0 -6
  241. package/dist/lib/source-config.d.ts +0 -1
  242. package/dist/lib/source-config.js +0 -3
  243. package/dist/lib/state-artifacts.d.ts +0 -1
  244. package/dist/lib/state-artifacts.js +0 -1
  245. package/dist/lib/state-health.d.ts +0 -1
  246. package/dist/lib/state-health.js +0 -1
  247. package/dist/lib/state-io.d.ts +0 -1
  248. package/dist/lib/state-io.js +0 -1
  249. package/dist/lib/state-paths.d.ts +0 -1
  250. package/dist/lib/state-paths.js +0 -1
  251. package/dist/lib/state-view.d.ts +0 -1
  252. package/dist/lib/state-view.js +0 -1
  253. package/dist/lib/state.d.ts +0 -1
  254. package/dist/lib/state.js +0 -1
  255. package/dist/lib/test-execution.d.ts +0 -1
  256. package/dist/lib/test-execution.js +0 -3
  257. package/dist/lib/test-matrices.d.ts +0 -1
  258. package/dist/lib/test-matrices.js +0 -3
  259. package/dist/lib/test-paths.d.ts +0 -1
  260. package/dist/lib/test-paths.js +0 -3
  261. package/dist/lib/test-profile-presets.d.ts +0 -1
  262. package/dist/lib/test-profile-presets.js +0 -3
  263. package/dist/lib/test-sandbox.d.ts +0 -1
  264. package/dist/lib/test-sandbox.js +0 -3
  265. package/dist/lib/test-specs.d.ts +0 -1
  266. package/dist/lib/test-specs.js +0 -3
  267. package/dist/lib/test-targets.d.ts +0 -1
  268. package/dist/lib/test-targets.js +0 -3
  269. package/dist/lib/test-types.d.ts +0 -1
  270. package/dist/lib/test-types.js +0 -3
  271. package/dist/lib/test.d.ts +0 -1
  272. package/dist/lib/test.js +0 -3
  273. package/dist/lib/util.d.ts +0 -1
  274. package/dist/lib/util.js +0 -1
  275. package/dist/lib/validate-compiled.d.ts +0 -1
  276. package/dist/lib/validate-compiled.js +0 -1
  277. package/dist/lib/validate-helpers.d.ts +0 -1
  278. package/dist/lib/validate-helpers.js +0 -1
  279. package/dist/lib/validate.d.ts +0 -1
  280. package/dist/lib/validate.js +0 -1
  281. package/dist/lib/workflow-authoring.d.ts +0 -1
  282. package/dist/lib/workflow-authoring.js +0 -1
  283. package/dist/lib/workflow-definitions.d.ts +0 -1
  284. package/dist/lib/workflow-definitions.js +0 -1
  285. package/dist/lib/workflow-edit-session.d.ts +0 -1
  286. package/dist/lib/workflow-edit-session.js +0 -1
  287. package/dist/lib/workflow-edit-utils.d.ts +0 -1
  288. package/dist/lib/workflow-edit-utils.js +0 -1
  289. package/dist/lib/workflow-helpers.d.ts +0 -1
  290. package/dist/lib/workflow-helpers.js +0 -1
  291. package/dist/lib/workflow-improvement.d.ts +0 -1
  292. package/dist/lib/workflow-improvement.js +0 -1
  293. package/dist/lib/workflow-primitives.d.ts +0 -1
  294. package/dist/lib/workflow-primitives.js +0 -1
  295. package/dist/lib/workflow-review-paths.d.ts +0 -1
  296. package/dist/lib/workflow-review-paths.js +0 -1
  297. package/dist/lib/workflow-stage-policy.d.ts +0 -1
  298. package/dist/lib/workflow-stage-policy.js +0 -1
  299. package/dist/lib/workflow-stage-runner.d.ts +0 -1
  300. package/dist/lib/workflow-stage-runner.js +0 -1
  301. package/dist/lib/workflows.d.ts +0 -1
  302. package/dist/lib/workflows.js +0 -1
@@ -1,12 +1,11 @@
1
- import { existsSync, readdirSync, statSync } from "node:fs";
2
- import { join, relative, sep } from "node:path";
3
1
  import * as p from "@clack/prompts";
4
- import { sourceConfig as projectSourceConfig, } from "../../packages/project-model/index.js";
2
+ import { sourceConfig as projectSourceConfig, sourceFolders as projectSourceFolders, } from "../../packages/project-model/index.js";
5
3
  import { slugify } from "../../packages/shared/naming.js";
4
+ import { submitReadinessCheckDraftToLocalService, } from "../../packages/local-service/index.js";
6
5
  import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
7
- import { draftTruthChecks } from "./check-draft.js";
6
+ import { draftReadinessChecks } from "./check-draft.js";
8
7
  export const DEFAULT_COMPILED_NAME = "dataset1";
9
- export const DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER = "A question you can already verify from this source folder";
8
+ export const DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER = "An agent-work-critical check you can already verify from this Source Folder";
10
9
  export const DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
11
10
  export const DEFAULT_COMPILED_ABOUT_PLACEHOLDER = "Example: board prep from these files, chart reads from this report, or tax review from these exports.";
12
11
  export const DEFAULT_DATASET_PATH_PLACEHOLDER = "./dataset1";
@@ -19,108 +18,29 @@ function normalizeOptionalPromptText(value) {
19
18
  const normalized = value.trim();
20
19
  return normalized.length > 0 ? normalized : undefined;
21
20
  }
22
- function listVisibleDatasetFolders(cwd) {
23
- const ignoredEntries = new Set([
24
- ".DS_Store",
25
- ".git",
26
- ".interf",
27
- "interf",
28
- "interf.json",
29
- "node_modules",
30
- ]);
31
- let rootEntries = [];
32
- try {
33
- rootEntries = readdirSync(cwd);
34
- }
35
- catch {
36
- return [];
37
- }
38
- const visibleEntries = rootEntries.filter((entry) => !ignoredEntries.has(entry) && !entry.startsWith("."));
39
- const visibleDirectories = [];
40
- for (const entry of visibleEntries) {
41
- try {
42
- const entryPath = join(cwd, entry);
43
- if (statSync(entryPath).isDirectory()) {
44
- visibleDirectories.push(entry);
45
- }
46
- }
47
- catch {
48
- // ignore unreadable entries
49
- }
50
- }
51
- return visibleDirectories.sort((left, right) => left.localeCompare(right));
52
- }
53
- function isReservedDatasetPath(relativePath) {
54
- const normalized = relativePath.replace(/\\/g, "/").replace(/^\.\/+/, "");
55
- return normalized === "interf" || normalized.startsWith("interf/") || normalized === ".interf" || normalized.startsWith(".interf/");
56
- }
57
21
  export function normalizeDatasetPathForConfig(projectPath, value) {
58
- const resolvedPath = projectSourceConfig.resolveSourceDatasetPath(projectPath, { path: value.trim() });
59
- const relativePath = relative(projectPath, resolvedPath).split(sep).join("/") || ".";
60
- if (relativePath === ".") {
61
- throw new Error("Pick a source folder inside this project, not the project root.");
62
- }
63
- if (isReservedDatasetPath(relativePath)) {
64
- throw new Error("Pick an existing source folder under the project root, not `interf/` or `.interf/`.");
65
- }
66
- if (!existsSync(resolvedPath)) {
67
- throw new Error("Pick an existing source folder under the project root.");
68
- }
69
- if (!statSync(resolvedPath).isDirectory()) {
70
- throw new Error("Source folder must be a directory.");
71
- }
72
- return relativePath.startsWith("./") ? relativePath : `./${relativePath}`;
22
+ return projectSourceFolders.normalizeSourceDatasetPathForConfig(projectPath, value);
73
23
  }
74
24
  function defaultDatasetNameForPath(datasetPath) {
75
- const segments = datasetPath
76
- .replace(/\\/g, "/")
77
- .replace(/\/+$/g, "")
78
- .split("/")
79
- .filter((segment) => segment.length > 0 && segment !== ".");
80
- return slugify(segments[segments.length - 1] ?? "") || DEFAULT_COMPILED_NAME;
81
- }
82
- function findSingleDatasetFolderCandidate(cwd) {
83
- const visibleDirectories = listVisibleDatasetFolders(cwd);
84
- if (visibleDirectories.length !== 1) {
85
- return null;
86
- }
87
- return `./${visibleDirectories[0]}`;
25
+ return projectSourceFolders.defaultDatasetNameForPath(datasetPath);
88
26
  }
89
27
  export function listDatasetFolderChoices(cwd = process.cwd()) {
90
- return listVisibleDatasetFolders(cwd).map((entry) => ({
91
- value: `./${entry}`,
92
- label: entry,
93
- hint: `Use ./${entry} as the source folder`,
94
- }));
28
+ return projectSourceFolders.listSourceFolderChoices(cwd);
95
29
  }
96
30
  export function defaultDatasetPathForPrompt(name, introStyle, cwd = process.cwd()) {
97
- const namedFolderPath = join(cwd, name);
98
- if (existsSync(namedFolderPath)) {
99
- try {
100
- if (statSync(namedFolderPath).isDirectory()) {
101
- return `./${name}`;
102
- }
103
- }
104
- catch {
105
- // fall through
106
- }
107
- }
108
- if (introStyle === "first") {
109
- return findSingleDatasetFolderCandidate(cwd) ?? `./${name}`;
110
- }
111
- return `./${name}`;
31
+ return projectSourceFolders.defaultSourceDatasetPathForPrompt(name, introStyle, cwd);
112
32
  }
113
33
  async function promptDatasetFolderPath(options) {
114
34
  const folderChoices = listDatasetFolderChoices(options.projectPath);
115
35
  if (folderChoices.length > 0) {
116
36
  const selected = await p.select({
117
- message: "Which source folder should Interf use?",
37
+ message: "Which Source Folder should Interf use?",
118
38
  options: [
119
39
  ...folderChoices,
120
40
  {
121
41
  value: "__manual__",
122
42
  label: "Enter a different path",
123
- hint: "Use a relative path if the source folder is not listed here",
43
+ hint: "Use a relative path if the Source Folder is not listed here",
124
44
  },
125
45
  ],
126
46
  initialValue: folderChoices.some((choice) => choice.value === options.initialPath)
@@ -140,13 +60,13 @@ async function promptDatasetFolderPath(options) {
140
60
  }
141
61
  }
142
62
  const datasetPath = await p.text({
143
- message: "Which source folder should Interf use?",
63
+ message: "Which Source Folder should Interf use?",
144
64
  placeholder: DEFAULT_DATASET_PATH_PLACEHOLDER,
145
65
  initialValue: options.initialPath,
146
66
  validate: (value) => {
147
67
  const normalized = value.trim();
148
68
  if (normalized.length === 0)
149
- return "Source folder is required";
69
+ return "Source Folder is required";
150
70
  try {
151
71
  normalizeDatasetPathForConfig(options.projectPath, normalized);
152
72
  return undefined;
@@ -162,9 +82,9 @@ async function promptDatasetFolderPath(options) {
162
82
  }
163
83
  export function datasetAboutPromptMessage(introStyle) {
164
84
  if (introStyle === "edit") {
165
- return "What work should this source folder stay focused on?";
85
+ return "What agent work should this Preparation stay focused on?";
166
86
  }
167
- return "What work should this source folder help with?";
87
+ return "What agent work should this Preparation help with?";
168
88
  }
169
89
  function formatAttemptLabel(count, noun) {
170
90
  return `${count} ${noun}${count === 1 ? "" : "s"}`;
@@ -179,15 +99,15 @@ export function resolveCompileLoopMode(maxAttempts, maxLoops) {
179
99
  export function describeCompileLoopSelection(options) {
180
100
  const mode = resolveCompileLoopMode(options.maxAttempts, options.maxLoops);
181
101
  if (mode === "once") {
182
- return "Compile once.";
102
+ return "Prepare once.";
183
103
  }
184
104
  if (mode === "retry") {
185
105
  const attempts = options.maxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS;
186
- return `Compile retries are enabled here (${formatAttemptLabel(attempts, "total attempt")}).`;
106
+ return `Prepare retries are enabled here (${formatAttemptLabel(attempts, "total attempt")}).`;
187
107
  }
188
108
  const loops = options.maxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS;
189
109
  const attempts = options.maxAttempts ?? DEFAULT_SELF_IMPROVING_ATTEMPTS;
190
- return `Self-improving loops are enabled here (${formatAttemptLabel(attempts, "attempt")} per variation, ${formatAttemptLabel(loops, "workflow revision")}).`;
110
+ return `Self-improving loops are enabled here (${formatAttemptLabel(attempts, "attempt")} per variation, ${formatAttemptLabel(loops, "Method revision")}).`;
191
111
  }
192
112
  async function promptCompileRetryAttempts(options) {
193
113
  const maxAttempts = await p.text({
@@ -215,9 +135,9 @@ export async function promptCheckCases(options) {
215
135
  const question = await p.text({
216
136
  message: cases.length === 0
217
137
  ? options.questionMessage
218
- : `Question ${startIndex + cases.length}?`,
138
+ : `Check ${startIndex + cases.length}?`,
219
139
  placeholder: options.questionPlaceholder,
220
- validate: (value) => (value.trim().length === 0 ? "Question is required" : undefined),
140
+ validate: (value) => (value.trim().length === 0 ? "Check is required" : undefined),
221
141
  });
222
142
  if (p.isCancel(question))
223
143
  return null;
@@ -244,15 +164,15 @@ export async function promptCheckCases(options) {
244
164
  return cases;
245
165
  }
246
166
  }
247
- function printDraftTruthChecks(checks) {
167
+ function printDraftReadinessChecks(checks) {
248
168
  console.log();
249
- p.log.info(`Draft tests: ${checks.length}`);
169
+ p.log.info(`Draft readiness checks: ${checks.length}`);
250
170
  for (const [index, check] of checks.entries()) {
251
171
  console.log(` ${index + 1}. ${check.question}`);
252
172
  console.log(` Expected: ${check.answer ?? ""}`);
253
173
  }
254
174
  }
255
- async function promptDraftTruthChecks(options) {
175
+ async function promptDraftReadinessChecks(options) {
256
176
  let resolvedDatasetPath;
257
177
  try {
258
178
  const datasetConfig = {
@@ -264,61 +184,101 @@ async function promptDraftTruthChecks(options) {
264
184
  p.log.error(error instanceof Error ? error.message : String(error));
265
185
  return "manual";
266
186
  }
267
- const resolved = await resolveOrConfigureLocalExecutor({
268
- preflight: true,
269
- purpose: "draft",
270
- });
271
- if (!resolved.executor) {
272
- if (resolved.cancelled)
273
- return null;
274
- p.log.error(resolved.error ?? "No local agent detected for question drafting.");
275
- const fallback = await p.select({
276
- message: "How do you want to continue?",
277
- options: [
278
- {
279
- value: "manual",
280
- label: "Add questions manually",
281
- hint: "Write the questions and expected answers yourself",
282
- },
283
- {
284
- value: "skip",
285
- label: "Skip for now",
286
- hint: "Save this dataset without questions",
287
- },
288
- ],
289
- });
290
- if (p.isCancel(fallback))
291
- return null;
292
- return fallback === "manual" ? "manual" : [];
293
- }
294
187
  while (true) {
295
- p.log.info("Drafting questions from the source files.");
296
- const drafted = await draftTruthChecks({
297
- datasetName: options.datasetName,
298
- datasetPath: resolvedDatasetPath,
299
- about: options.about,
300
- executor: resolved.executor,
301
- targetCount: 4,
188
+ p.log.info("Drafting readiness checks from the source files.");
189
+ let lastServiceStatus = "";
190
+ const serviceRun = await submitReadinessCheckDraftToLocalService({
191
+ projectPath: options.projectPath,
192
+ request: {
193
+ preparation: options.datasetName,
194
+ source_folder_path: resolvedDatasetPath,
195
+ about: options.about,
196
+ target_count: 4,
197
+ },
198
+ onSubmitted: (submission) => {
199
+ p.log.info(`Visible in Interf: ${submission.serviceUrl}/`);
200
+ },
201
+ onUpdate: (job) => {
202
+ const activeStep = job.steps.find((step) => step.status === "running")
203
+ ?? [...job.steps].reverse().find((step) => step.status === "succeeded" || step.status === "failed")
204
+ ?? null;
205
+ const statusKey = `${job.status}:${activeStep?.id ?? ""}:${activeStep?.status ?? ""}`;
206
+ if (statusKey === lastServiceStatus)
207
+ return;
208
+ lastServiceStatus = statusKey;
209
+ p.log.info(activeStep
210
+ ? `${activeStep.label}: ${activeStep.status}`
211
+ : `Readiness-check draft run: ${job.status}`);
212
+ },
302
213
  });
214
+ const drafted = serviceRun
215
+ ? {
216
+ checks: serviceRun.result?.checks ?? null,
217
+ error: serviceRun.error,
218
+ }
219
+ : await (async () => {
220
+ const resolved = await resolveOrConfigureLocalExecutor({
221
+ preflight: true,
222
+ purpose: "draft",
223
+ });
224
+ if (!resolved.executor) {
225
+ if (resolved.cancelled)
226
+ return null;
227
+ p.log.error(resolved.error ?? "No local agent detected for readiness-check drafting.");
228
+ const manualChoice = await p.select({
229
+ message: "How do you want to continue?",
230
+ options: [
231
+ {
232
+ value: "manual",
233
+ label: "Add readiness checks manually",
234
+ hint: "Write the checks and expected answers yourself",
235
+ },
236
+ {
237
+ value: "skip",
238
+ label: "Skip for now",
239
+ hint: "Save this Preparation without readiness checks",
240
+ },
241
+ ],
242
+ });
243
+ if (p.isCancel(manualChoice))
244
+ return null;
245
+ return manualChoice === "manual"
246
+ ? "manual"
247
+ : "skip";
248
+ }
249
+ return draftReadinessChecks({
250
+ datasetName: options.datasetName,
251
+ datasetPath: resolvedDatasetPath,
252
+ about: options.about,
253
+ executor: resolved.executor,
254
+ targetCount: 4,
255
+ });
256
+ })();
257
+ if (drafted === null)
258
+ return null;
259
+ if (drafted === "manual")
260
+ return "manual";
261
+ if (drafted === "skip")
262
+ return [];
303
263
  if (!drafted.checks) {
304
- p.log.error(drafted.error ?? "Could not draft questions from this source folder.");
264
+ p.log.error(drafted.error ?? "Could not draft readiness checks from this Source Folder.");
305
265
  const retryMode = await p.select({
306
266
  message: "How do you want to continue?",
307
267
  options: [
308
268
  {
309
269
  value: "retry",
310
270
  label: "Try auto-create again",
311
- hint: "Run the same local agent again on the source folder",
271
+ hint: "Run the same local agent again on the Source Folder",
312
272
  },
313
273
  {
314
274
  value: "manual",
315
- label: "Add questions manually",
316
- hint: "Write the questions yourself instead",
275
+ label: "Add readiness checks manually",
276
+ hint: "Write the checks yourself instead",
317
277
  },
318
278
  {
319
279
  value: "skip",
320
280
  label: "Skip for now",
321
- hint: "Save this dataset without questions",
281
+ hint: "Save this Preparation without readiness checks",
322
282
  },
323
283
  ],
324
284
  });
@@ -328,29 +288,29 @@ async function promptDraftTruthChecks(options) {
328
288
  continue;
329
289
  return retryMode === "manual" ? "manual" : [];
330
290
  }
331
- printDraftTruthChecks(drafted.checks);
291
+ printDraftReadinessChecks(drafted.checks);
332
292
  const nextStep = await p.select({
333
- message: "Use these questions?",
293
+ message: "Use these readiness checks?",
334
294
  options: [
335
295
  {
336
296
  value: "use",
337
297
  label: "Use this draft (Recommended)",
338
- hint: "Save these questions and edit them later if needed",
298
+ hint: "Save these checks and edit them later if needed",
339
299
  },
340
300
  {
341
301
  value: "retry",
342
302
  label: "Draft again",
343
- hint: "Run the same local agent again on the source folder",
303
+ hint: "Run the same local agent again on the Source Folder",
344
304
  },
345
305
  {
346
306
  value: "manual",
347
- label: "Add questions manually instead",
348
- hint: "Discard this draft and write the questions yourself",
307
+ label: "Add readiness checks manually instead",
308
+ hint: "Discard this draft and write the checks yourself",
349
309
  },
350
310
  {
351
311
  value: "skip",
352
312
  label: "Skip for now",
353
- hint: "Save this dataset without questions",
313
+ hint: "Save this Preparation without readiness checks",
354
314
  },
355
315
  ],
356
316
  });
@@ -370,24 +330,24 @@ async function promptCompiledChecks(options) {
370
330
  if (options.initialAbout) {
371
331
  p.log.info(`About: ${options.initialAbout}`);
372
332
  }
373
- p.log.info("Questions are simple question-and-answer pairs Interf uses to check accuracy, so you can decide whether to trust the portable context.");
333
+ p.log.info("Readiness checks are small agent-work-critical checks from your files that define when this data is ready for agent work.");
374
334
  const mode = await p.select({
375
335
  message: "How should Interf create them?",
376
336
  options: [
377
337
  {
378
338
  value: "draft",
379
- label: "Auto-create a question draft (Recommended)",
380
- hint: "Let your chosen local agent recommend a few clear, verifiable questions from this source folder",
339
+ label: "Auto-create readiness checks (Recommended)",
340
+ hint: "Let your chosen local agent recommend a few clear, verifiable checks from this Source Folder",
381
341
  },
382
342
  {
383
343
  value: "manual",
384
- label: "Add questions manually",
385
- hint: "Write the questions and expected answers yourself",
344
+ label: "Add readiness checks manually",
345
+ hint: "Write the checks and expected answers yourself",
386
346
  },
387
347
  {
388
348
  value: "skip",
389
349
  label: "Skip for now",
390
- hint: "You can save the dataset first and add questions later",
350
+ hint: "You can save the Preparation first and add readiness checks later",
391
351
  },
392
352
  ],
393
353
  });
@@ -396,7 +356,7 @@ async function promptCompiledChecks(options) {
396
356
  if (mode === "skip")
397
357
  return [];
398
358
  if (mode === "draft") {
399
- const drafted = await promptDraftTruthChecks({
359
+ const drafted = await promptDraftReadinessChecks({
400
360
  projectPath: options.projectPath,
401
361
  datasetName: options.datasetName,
402
362
  datasetPath: options.datasetPath,
@@ -406,56 +366,56 @@ async function promptCompiledChecks(options) {
406
366
  return null;
407
367
  if (drafted === "manual") {
408
368
  return promptCheckCases({
409
- heading: "Questions",
410
- questionMessage: "Question 1?",
369
+ heading: "Readiness checks",
370
+ questionMessage: "Check 1?",
411
371
  questionPlaceholder: DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER,
412
372
  answerMessage: "Expected answer 1?",
413
373
  answerPlaceholder: DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER,
414
- addAnotherMessage: "Add another question?",
374
+ addAnotherMessage: "Add another readiness check?",
415
375
  });
416
376
  }
417
377
  return drafted;
418
378
  }
419
379
  return promptCheckCases({
420
- heading: "Questions",
421
- questionMessage: "Question 1?",
380
+ heading: "Readiness checks",
381
+ questionMessage: "Check 1?",
422
382
  questionPlaceholder: DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER,
423
383
  answerMessage: "Expected answer 1?",
424
384
  answerPlaceholder: DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER,
425
- addAnotherMessage: "Add another question?",
385
+ addAnotherMessage: "Add another readiness check?",
426
386
  });
427
387
  }
428
388
  if (options.initialAbout) {
429
389
  p.log.info(`About: ${options.initialAbout}`);
430
390
  }
431
- p.log.info(`Current questions: ${options.initialChecks.length}`);
391
+ p.log.info(`Current readiness checks: ${options.initialChecks.length}`);
432
392
  const mode = await p.select({
433
393
  message: "What do you want to do with them?",
434
394
  options: [
435
395
  {
436
396
  value: "keep",
437
397
  label: "Keep them",
438
- hint: "Leave the current questions as-is",
398
+ hint: "Leave the current readiness checks as-is",
439
399
  },
440
400
  {
441
401
  value: "add",
442
402
  label: "Add more",
443
- hint: "Append more questions",
403
+ hint: "Append more readiness checks",
444
404
  },
445
405
  {
446
406
  value: "replace",
447
407
  label: "Replace all",
448
- hint: "Rewrite the questions from scratch",
408
+ hint: "Rewrite the readiness checks from scratch",
449
409
  },
450
410
  {
451
411
  value: "redraft",
452
412
  label: "Replace with auto-created draft",
453
- hint: "Let a local agent rewrite the questions from the dataset files",
413
+ hint: "Let a local agent rewrite the readiness checks from the Preparation files",
454
414
  },
455
415
  {
456
416
  value: "clear",
457
417
  label: "Clear them for now",
458
- hint: "Keep this setup without questions",
418
+ hint: "Keep this Preparation without readiness checks",
459
419
  },
460
420
  ],
461
421
  });
@@ -468,7 +428,7 @@ async function promptCompiledChecks(options) {
468
428
  return [];
469
429
  }
470
430
  if (mode === "redraft") {
471
- const drafted = await promptDraftTruthChecks({
431
+ const drafted = await promptDraftReadinessChecks({
472
432
  projectPath: options.projectPath,
473
433
  datasetName: options.datasetName,
474
434
  datasetPath: options.datasetPath,
@@ -478,27 +438,27 @@ async function promptCompiledChecks(options) {
478
438
  return null;
479
439
  if (drafted === "manual") {
480
440
  return promptCheckCases({
481
- heading: "Replace questions",
482
- questionMessage: "Question 1?",
441
+ heading: "Replace readiness checks",
442
+ questionMessage: "Check 1?",
483
443
  questionPlaceholder: DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER,
484
444
  answerMessage: "Expected answer 1?",
485
445
  answerPlaceholder: DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER,
486
- addAnotherMessage: "Add another question?",
446
+ addAnotherMessage: "Add another readiness check?",
487
447
  });
488
448
  }
489
449
  return drafted;
490
450
  }
491
451
  const nextChecks = await promptCheckCases({
492
- heading: mode === "add" ? "Add more questions" : "Replace questions",
452
+ heading: mode === "add" ? "Add more readiness checks" : "Replace readiness checks",
493
453
  questionMessage: mode === "add"
494
- ? `Question ${options.initialChecks.length + 1}?`
495
- : "Question 1?",
454
+ ? `Check ${options.initialChecks.length + 1}?`
455
+ : "Check 1?",
496
456
  questionPlaceholder: DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER,
497
457
  answerMessage: mode === "add"
498
458
  ? `Expected answer ${options.initialChecks.length + 1}?`
499
459
  : "Expected answer 1?",
500
460
  answerPlaceholder: DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER,
501
- addAnotherMessage: "Add another question?",
461
+ addAnotherMessage: "Add another readiness check?",
502
462
  startIndex: mode === "add" ? options.initialChecks.length + 1 : 1,
503
463
  });
504
464
  if (nextChecks === null)
@@ -543,20 +503,20 @@ export async function promptCompileLoopSelection(options) {
543
503
  const optionsByMode = {
544
504
  once: {
545
505
  value: "once",
546
- label: "Compile once",
547
- hint: "Build portable context agents can use once with the selected workflow",
506
+ label: "Prepare once",
507
+ hint: "Run the selected Method once and write Portable Context",
548
508
  },
549
509
  "self-improving": {
550
510
  value: "self-improving",
551
511
  label: recommendedMode === "self-improving"
552
512
  ? "Self-improving loops (Recommended)"
553
513
  : "Self-improving loops",
554
- hint: `Let Interf revise the workflow and retry up to ${options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS} time${(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS) === 1 ? "" : "s"}`,
514
+ hint: `Let Interf revise the Method and retry up to ${options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS} time${(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS) === 1 ? "" : "s"}`,
555
515
  },
556
516
  retry: {
557
517
  value: "retry",
558
- label: "Retry same workflow",
559
- hint: `Retry compile and portable-context checks up to ${options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS} total time${(options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS) === 1 ? "" : "s"} without editing the workflow`,
518
+ label: "Retry same Method",
519
+ hint: `Retry the same Method and readiness checks up to ${options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS} total time${(options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS) === 1 ? "" : "s"} without editing the Method`,
560
520
  },
561
521
  };
562
522
  const orderedModes = (hasSavedPolicy
@@ -573,7 +533,7 @@ export async function promptCompileLoopSelection(options) {
573
533
  ]).filter((mode, index, list) => list.indexOf(mode) === index)
574
534
  .filter((mode) => includeCompileOnce || mode !== "once");
575
535
  const selectedMode = await p.select({
576
- message: options.message ?? "How should this compile run work?",
536
+ message: options.message ?? "How should this prepare run work?",
577
537
  options: orderedModes.map((mode) => optionsByMode[mode]),
578
538
  });
579
539
  if (p.isCancel(selectedMode))
@@ -594,7 +554,7 @@ export async function promptCompileLoopSelection(options) {
594
554
  }
595
555
  const maxLoops = await promptSelfImprovingLoops({
596
556
  initialMaxLoops: options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS,
597
- message: "How many workflow revisions should Interf try?",
557
+ message: "How many Method revisions should Interf try?",
598
558
  });
599
559
  if (maxLoops === null)
600
560
  return null;
@@ -607,48 +567,66 @@ export async function promptSingleCompiledConfig(options = {}) {
607
567
  const initial = options.initial;
608
568
  const introStyle = options.introStyle ?? "first";
609
569
  if (introStyle === "first") {
610
- p.log.info("Pick the source folder for this work.");
611
- p.log.info("Then say what work this source folder should help with and review the recommended questions.");
570
+ if (options.fixedPath) {
571
+ p.log.info("Describe the agent work this Preparation should help with and review the recommended readiness checks.");
572
+ }
573
+ else {
574
+ p.log.info("Pick the Source Folder for this Preparation.");
575
+ p.log.info("Then say what agent work this Preparation should help with and review the recommended readiness checks.");
576
+ }
612
577
  }
613
578
  else if (introStyle === "additional") {
614
- p.log.info("Add another setup only if this project needs a separate folder or set of questions.");
579
+ p.log.info("Add another Preparation only if this Source Folder needs a separate folder, agent-work focus, or readiness-check set.");
615
580
  }
616
581
  const fixedName = options.fixedName ? slugify(String(options.fixedName)) : undefined;
617
582
  if (options.fixedName && !fixedName) {
618
- p.log.error("Current dataset name needs letters, numbers, or dashes.");
583
+ p.log.error("Current Preparation name needs letters, numbers, or dashes.");
619
584
  return null;
620
585
  }
621
586
  let name = fixedName;
622
587
  if (name && options.fixedName) {
623
- p.log.info(`Editing questions for dataset "${name}".`);
588
+ p.log.info(`Editing readiness checks for Preparation "${name}".`);
624
589
  }
625
590
  let about = normalizeOptionalPromptText(initial?.about);
626
591
  const projectPath = options.projectPath ?? process.cwd();
627
592
  const defaultNameSeed = slugify(String(initial?.name ?? DEFAULT_COMPILED_NAME)) || DEFAULT_COMPILED_NAME;
628
593
  const defaultDatasetPath = initial?.path ?? defaultDatasetPathForPrompt(defaultNameSeed, introStyle, projectPath);
629
- const normalizedDatasetPath = await promptDatasetFolderPath({
630
- projectPath,
631
- initialPath: defaultDatasetPath,
632
- });
594
+ const normalizedDatasetPath = options.fixedPath
595
+ ? (() => {
596
+ try {
597
+ return normalizeDatasetPathForConfig(projectPath, options.fixedPath);
598
+ }
599
+ catch (error) {
600
+ p.log.error(error instanceof Error ? error.message : String(error));
601
+ return null;
602
+ }
603
+ })()
604
+ : await promptDatasetFolderPath({
605
+ projectPath,
606
+ initialPath: defaultDatasetPath,
607
+ });
633
608
  if (!normalizedDatasetPath)
634
609
  return null;
610
+ if (options.fixedPath) {
611
+ p.log.info(`Source Folder: ${normalizedDatasetPath}`);
612
+ }
635
613
  if (!name) {
636
614
  const suggestedName = defaultDatasetNameForPath(normalizedDatasetPath);
637
615
  const rawName = await p.text({
638
- message: "Dataset name?",
616
+ message: "Preparation name?",
639
617
  placeholder: suggestedName,
640
618
  initialValue: suggestedName,
641
- validate: (value) => (value.trim().length === 0 ? "Dataset name is required" : undefined),
619
+ validate: (value) => (value.trim().length === 0 ? "Preparation name is required" : undefined),
642
620
  });
643
621
  if (p.isCancel(rawName))
644
622
  return null;
645
623
  name = slugify(String(rawName));
646
624
  if (!name) {
647
- p.log.error("Dataset name needs letters, numbers, or dashes.");
625
+ p.log.error("Preparation name needs letters, numbers, or dashes.");
648
626
  return null;
649
627
  }
650
628
  if (name !== rawName) {
651
- p.log.info(`Dataset name: ${name}`);
629
+ p.log.info(`Preparation name: ${name}`);
652
630
  }
653
631
  }
654
632
  let compileLoopSelection = {
@@ -680,8 +658,8 @@ export async function promptSingleCompiledConfig(options = {}) {
680
658
  initialMaxLoops: initial?.max_loops,
681
659
  hasChecks: checks.length > 0,
682
660
  intro: [
683
- "Compile mode",
684
- "Choose whether Interf should compile once, retry the same workflow, or try self-improving workflow variations on the same questions.",
661
+ "Prepare mode",
662
+ "Choose whether Interf should prepare once, retry the same Method, or try self-improving Method variations against the same readiness checks.",
685
663
  ],
686
664
  });
687
665
  if (compileLoopSelection === null)