@interf/compiler 0.3.4 → 0.4.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 (385) hide show
  1. package/README.md +128 -149
  2. package/builtin-workflows/interf/README.md +19 -0
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +28 -0
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +18 -0
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -0
  6. package/builtin-workflows/interf/improve/SKILL.md +18 -0
  7. package/builtin-workflows/interf/use/query/SKILL.md +28 -0
  8. package/builtin-workflows/interf/workflow.json +120 -0
  9. package/builtin-workflows/interf/workspace.schema.json +75 -0
  10. package/dist/bin.d.ts +0 -1
  11. package/dist/bin.js +0 -1
  12. package/dist/commands/compile-controller.d.ts +14 -0
  13. package/dist/commands/compile-controller.js +409 -0
  14. package/dist/commands/compile.d.ts +8 -9
  15. package/dist/commands/compile.js +151 -153
  16. package/dist/commands/create-workflow-wizard.d.ts +4 -2
  17. package/dist/commands/create-workflow-wizard.js +33 -31
  18. package/dist/commands/create.d.ts +0 -1
  19. package/dist/commands/create.js +15 -11
  20. package/dist/commands/default.d.ts +0 -1
  21. package/dist/commands/default.js +0 -1
  22. package/dist/commands/doctor.d.ts +0 -1
  23. package/dist/commands/doctor.js +1 -16
  24. package/dist/commands/executor-flow.d.ts +0 -1
  25. package/dist/commands/executor-flow.js +0 -1
  26. package/dist/commands/init.d.ts +0 -1
  27. package/dist/commands/init.js +71 -14
  28. package/dist/commands/list.d.ts +0 -1
  29. package/dist/commands/list.js +0 -1
  30. package/dist/commands/reset.d.ts +0 -1
  31. package/dist/commands/reset.js +0 -1
  32. package/dist/commands/source-config-wizard.d.ts +28 -7
  33. package/dist/commands/source-config-wizard.js +159 -63
  34. package/dist/commands/status.d.ts +0 -1
  35. package/dist/commands/status.js +0 -1
  36. package/dist/commands/test-flow.d.ts +20 -10
  37. package/dist/commands/test-flow.js +89 -23
  38. package/dist/commands/test.d.ts +0 -1
  39. package/dist/commands/test.js +36 -72
  40. package/dist/commands/verify.d.ts +0 -1
  41. package/dist/commands/verify.js +0 -1
  42. package/dist/commands/workspace-flow.d.ts +3 -3
  43. package/dist/commands/workspace-flow.js +30 -12
  44. package/dist/index.d.ts +5 -6
  45. package/dist/index.js +3 -4
  46. package/dist/lib/agent-args.d.ts +0 -1
  47. package/dist/lib/agent-args.js +0 -1
  48. package/dist/lib/agent-constants.d.ts +0 -1
  49. package/dist/lib/agent-constants.js +0 -1
  50. package/dist/lib/agent-detection.d.ts +0 -1
  51. package/dist/lib/agent-detection.js +0 -1
  52. package/dist/lib/agent-execution.d.ts +0 -1
  53. package/dist/lib/agent-execution.js +47 -12
  54. package/dist/lib/agent-logs.d.ts +0 -1
  55. package/dist/lib/agent-logs.js +0 -1
  56. package/dist/lib/agent-preflight.d.ts +0 -1
  57. package/dist/lib/agent-preflight.js +1 -2
  58. package/dist/lib/agent-render.d.ts +0 -1
  59. package/dist/lib/agent-render.js +0 -1
  60. package/dist/lib/agent-shells.d.ts +30 -3
  61. package/dist/lib/agent-shells.js +517 -54
  62. package/dist/lib/agent-status.d.ts +0 -1
  63. package/dist/lib/agent-status.js +0 -1
  64. package/dist/lib/agent-types.d.ts +0 -1
  65. package/dist/lib/agent-types.js +0 -1
  66. package/dist/lib/agents.d.ts +0 -9
  67. package/dist/lib/agents.js +0 -9
  68. package/dist/lib/chart-guidance.d.ts +1 -0
  69. package/dist/lib/chart-guidance.js +8 -0
  70. package/dist/lib/config.d.ts +0 -3
  71. package/dist/lib/config.js +0 -5
  72. package/dist/lib/discovery.d.ts +0 -1
  73. package/dist/lib/discovery.js +0 -1
  74. package/dist/lib/execution-profile.d.ts +0 -1
  75. package/dist/lib/execution-profile.js +0 -1
  76. package/dist/lib/executors.d.ts +0 -1
  77. package/dist/lib/executors.js +0 -1
  78. package/dist/lib/filesystem.d.ts +0 -1
  79. package/dist/lib/filesystem.js +0 -1
  80. package/dist/lib/interf-bootstrap.d.ts +0 -1
  81. package/dist/lib/interf-bootstrap.js +6 -2
  82. package/dist/lib/interf-detect.d.ts +2 -2
  83. package/dist/lib/interf-detect.js +25 -8
  84. package/dist/lib/interf-scaffold.d.ts +0 -1
  85. package/dist/lib/interf-scaffold.js +54 -21
  86. package/dist/lib/interf-workflow-package.d.ts +18 -1
  87. package/dist/lib/interf-workflow-package.js +164 -23
  88. package/dist/lib/interf.d.ts +1 -2
  89. package/dist/lib/interf.js +1 -2
  90. package/dist/lib/local-workflows.d.ts +10 -5
  91. package/dist/lib/local-workflows.js +208 -97
  92. package/dist/lib/logger.d.ts +0 -1
  93. package/dist/lib/logger.js +0 -1
  94. package/dist/lib/obsidian.d.ts +0 -1
  95. package/dist/lib/obsidian.js +0 -1
  96. package/dist/lib/parse.d.ts +0 -1
  97. package/dist/lib/parse.js +0 -1
  98. package/dist/lib/registry.d.ts +0 -1
  99. package/dist/lib/registry.js +0 -1
  100. package/dist/lib/runtime-acceptance.d.ts +0 -1
  101. package/dist/lib/runtime-acceptance.js +1 -2
  102. package/dist/lib/runtime-contracts.d.ts +0 -1
  103. package/dist/lib/runtime-contracts.js +14 -8
  104. package/dist/lib/runtime-paths.d.ts +0 -1
  105. package/dist/lib/runtime-paths.js +5 -10
  106. package/dist/lib/runtime-prompt.d.ts +0 -1
  107. package/dist/lib/runtime-prompt.js +8 -23
  108. package/dist/lib/runtime-reconcile.d.ts +0 -1
  109. package/dist/lib/runtime-reconcile.js +7 -3
  110. package/dist/lib/runtime-runs.d.ts +0 -1
  111. package/dist/lib/runtime-runs.js +4 -5
  112. package/dist/lib/runtime-types.d.ts +0 -1
  113. package/dist/lib/runtime-types.js +0 -1
  114. package/dist/lib/runtime.d.ts +0 -1
  115. package/dist/lib/runtime.js +0 -1
  116. package/dist/lib/schema.d.ts +356 -51
  117. package/dist/lib/schema.js +189 -54
  118. package/dist/lib/source-config.d.ts +17 -8
  119. package/dist/lib/source-config.js +125 -11
  120. package/dist/lib/state-artifacts.d.ts +0 -1
  121. package/dist/lib/state-artifacts.js +0 -1
  122. package/dist/lib/state-health.d.ts +0 -1
  123. package/dist/lib/state-health.js +2 -3
  124. package/dist/lib/state-io.d.ts +1 -1
  125. package/dist/lib/state-io.js +9 -10
  126. package/dist/lib/state-paths.d.ts +0 -1
  127. package/dist/lib/state-paths.js +5 -11
  128. package/dist/lib/state-view.d.ts +0 -1
  129. package/dist/lib/state-view.js +7 -8
  130. package/dist/lib/state.d.ts +0 -1
  131. package/dist/lib/state.js +0 -1
  132. package/dist/lib/summarize-plan.d.ts +0 -1
  133. package/dist/lib/summarize-plan.js +3 -3
  134. package/dist/lib/test-execution.d.ts +14 -0
  135. package/dist/lib/{benchmark-execution.js → test-execution.js} +122 -120
  136. package/dist/lib/test-matrices.d.ts +90 -0
  137. package/dist/lib/test-matrices.js +96 -0
  138. package/dist/lib/test-paths.d.ts +12 -0
  139. package/dist/lib/test-paths.js +44 -0
  140. package/dist/lib/test-profile-presets.d.ts +57 -0
  141. package/dist/lib/test-profile-presets.js +50 -0
  142. package/dist/lib/test-sandbox.d.ts +11 -0
  143. package/dist/lib/{benchmark-sandbox.js → test-sandbox.js} +18 -13
  144. package/dist/lib/test-specs.d.ts +7 -0
  145. package/dist/lib/test-specs.js +114 -0
  146. package/dist/lib/test-targets.d.ts +5 -0
  147. package/dist/lib/test-targets.js +38 -0
  148. package/dist/lib/test-types.d.ts +17 -0
  149. package/dist/lib/test-types.js +1 -0
  150. package/dist/lib/test.d.ts +4 -0
  151. package/dist/lib/test.js +3 -0
  152. package/dist/lib/user-config.d.ts +0 -1
  153. package/dist/lib/user-config.js +0 -1
  154. package/dist/lib/util.d.ts +0 -2
  155. package/dist/lib/util.js +0 -2
  156. package/dist/lib/validate-helpers.d.ts +0 -1
  157. package/dist/lib/validate-helpers.js +0 -1
  158. package/dist/lib/validate-workspace.d.ts +0 -1
  159. package/dist/lib/validate-workspace.js +34 -25
  160. package/dist/lib/validate.d.ts +0 -1
  161. package/dist/lib/validate.js +55 -9
  162. package/dist/lib/workflow-abi.d.ts +138 -0
  163. package/dist/lib/workflow-abi.js +181 -0
  164. package/dist/lib/workflow-definitions.d.ts +26 -5
  165. package/dist/lib/workflow-definitions.js +105 -168
  166. package/dist/lib/workflow-helpers.d.ts +1 -2
  167. package/dist/lib/workflow-helpers.js +32 -21
  168. package/dist/lib/workflow-improvement.d.ts +22 -0
  169. package/dist/lib/workflow-improvement.js +396 -0
  170. package/dist/lib/workflow-review-paths.d.ts +10 -0
  171. package/dist/lib/workflow-review-paths.js +27 -0
  172. package/dist/lib/workflow-stage-runner.d.ts +1 -1
  173. package/dist/lib/workflow-stage-runner.js +4 -1
  174. package/dist/lib/workflows.d.ts +1 -2
  175. package/dist/lib/workflows.js +1 -2
  176. package/dist/lib/workspace-compile.d.ts +0 -1
  177. package/dist/lib/workspace-compile.js +146 -109
  178. package/dist/lib/workspace-home.d.ts +5 -0
  179. package/dist/lib/workspace-home.js +32 -0
  180. package/dist/lib/workspace-layout.d.ts +2 -0
  181. package/dist/lib/workspace-layout.js +60 -0
  182. package/dist/lib/workspace-paths.d.ts +41 -0
  183. package/dist/lib/workspace-paths.js +107 -0
  184. package/dist/lib/workspace-raw.d.ts +20 -2
  185. package/dist/lib/workspace-raw.js +6 -8
  186. package/dist/lib/workspace-reset.d.ts +0 -1
  187. package/dist/lib/workspace-reset.js +27 -5
  188. package/dist/lib/workspace-schema.d.ts +1 -10
  189. package/dist/lib/workspace-schema.js +16 -74
  190. package/package.json +16 -15
  191. package/dist/bin.d.ts.map +0 -1
  192. package/dist/bin.js.map +0 -1
  193. package/dist/commands/compile.d.ts.map +0 -1
  194. package/dist/commands/compile.js.map +0 -1
  195. package/dist/commands/create-workflow-wizard.d.ts.map +0 -1
  196. package/dist/commands/create-workflow-wizard.js.map +0 -1
  197. package/dist/commands/create.d.ts.map +0 -1
  198. package/dist/commands/create.js.map +0 -1
  199. package/dist/commands/default.d.ts.map +0 -1
  200. package/dist/commands/default.js.map +0 -1
  201. package/dist/commands/doctor.d.ts.map +0 -1
  202. package/dist/commands/doctor.js.map +0 -1
  203. package/dist/commands/executor-flow.d.ts.map +0 -1
  204. package/dist/commands/executor-flow.js.map +0 -1
  205. package/dist/commands/init.d.ts.map +0 -1
  206. package/dist/commands/init.js.map +0 -1
  207. package/dist/commands/list.d.ts.map +0 -1
  208. package/dist/commands/list.js.map +0 -1
  209. package/dist/commands/reset.d.ts.map +0 -1
  210. package/dist/commands/reset.js.map +0 -1
  211. package/dist/commands/source-config-wizard.d.ts.map +0 -1
  212. package/dist/commands/source-config-wizard.js.map +0 -1
  213. package/dist/commands/status.d.ts.map +0 -1
  214. package/dist/commands/status.js.map +0 -1
  215. package/dist/commands/test-flow.d.ts.map +0 -1
  216. package/dist/commands/test-flow.js.map +0 -1
  217. package/dist/commands/test.d.ts.map +0 -1
  218. package/dist/commands/test.js.map +0 -1
  219. package/dist/commands/verify.d.ts.map +0 -1
  220. package/dist/commands/verify.js.map +0 -1
  221. package/dist/commands/workspace-flow.d.ts.map +0 -1
  222. package/dist/commands/workspace-flow.js.map +0 -1
  223. package/dist/index.d.ts.map +0 -1
  224. package/dist/index.js.map +0 -1
  225. package/dist/lib/agent-args.d.ts.map +0 -1
  226. package/dist/lib/agent-args.js.map +0 -1
  227. package/dist/lib/agent-constants.d.ts.map +0 -1
  228. package/dist/lib/agent-constants.js.map +0 -1
  229. package/dist/lib/agent-detection.d.ts.map +0 -1
  230. package/dist/lib/agent-detection.js.map +0 -1
  231. package/dist/lib/agent-execution.d.ts.map +0 -1
  232. package/dist/lib/agent-execution.js.map +0 -1
  233. package/dist/lib/agent-logs.d.ts.map +0 -1
  234. package/dist/lib/agent-logs.js.map +0 -1
  235. package/dist/lib/agent-preflight.d.ts.map +0 -1
  236. package/dist/lib/agent-preflight.js.map +0 -1
  237. package/dist/lib/agent-render.d.ts.map +0 -1
  238. package/dist/lib/agent-render.js.map +0 -1
  239. package/dist/lib/agent-shells.d.ts.map +0 -1
  240. package/dist/lib/agent-shells.js.map +0 -1
  241. package/dist/lib/agent-skills.d.ts +0 -21
  242. package/dist/lib/agent-skills.d.ts.map +0 -1
  243. package/dist/lib/agent-skills.js +0 -215
  244. package/dist/lib/agent-skills.js.map +0 -1
  245. package/dist/lib/agent-status.d.ts.map +0 -1
  246. package/dist/lib/agent-status.js.map +0 -1
  247. package/dist/lib/agent-types.d.ts.map +0 -1
  248. package/dist/lib/agent-types.js.map +0 -1
  249. package/dist/lib/agents.d.ts.map +0 -1
  250. package/dist/lib/agents.js.map +0 -1
  251. package/dist/lib/benchmark-execution.d.ts +0 -13
  252. package/dist/lib/benchmark-execution.d.ts.map +0 -1
  253. package/dist/lib/benchmark-execution.js.map +0 -1
  254. package/dist/lib/benchmark-paths.d.ts +0 -13
  255. package/dist/lib/benchmark-paths.d.ts.map +0 -1
  256. package/dist/lib/benchmark-paths.js +0 -44
  257. package/dist/lib/benchmark-paths.js.map +0 -1
  258. package/dist/lib/benchmark-sandbox.d.ts +0 -12
  259. package/dist/lib/benchmark-sandbox.d.ts.map +0 -1
  260. package/dist/lib/benchmark-sandbox.js.map +0 -1
  261. package/dist/lib/benchmark-specs.d.ts +0 -8
  262. package/dist/lib/benchmark-specs.d.ts.map +0 -1
  263. package/dist/lib/benchmark-specs.js +0 -115
  264. package/dist/lib/benchmark-specs.js.map +0 -1
  265. package/dist/lib/benchmark-targets.d.ts +0 -5
  266. package/dist/lib/benchmark-targets.d.ts.map +0 -1
  267. package/dist/lib/benchmark-targets.js +0 -38
  268. package/dist/lib/benchmark-targets.js.map +0 -1
  269. package/dist/lib/benchmark-types.d.ts +0 -18
  270. package/dist/lib/benchmark-types.d.ts.map +0 -1
  271. package/dist/lib/benchmark-types.js +0 -2
  272. package/dist/lib/benchmark-types.js.map +0 -1
  273. package/dist/lib/benchmark.d.ts +0 -5
  274. package/dist/lib/benchmark.d.ts.map +0 -1
  275. package/dist/lib/benchmark.js +0 -4
  276. package/dist/lib/benchmark.js.map +0 -1
  277. package/dist/lib/config.d.ts.map +0 -1
  278. package/dist/lib/config.js.map +0 -1
  279. package/dist/lib/discovery.d.ts.map +0 -1
  280. package/dist/lib/discovery.js.map +0 -1
  281. package/dist/lib/eval-packs.d.ts +0 -158
  282. package/dist/lib/eval-packs.d.ts.map +0 -1
  283. package/dist/lib/eval-packs.js +0 -149
  284. package/dist/lib/eval-packs.js.map +0 -1
  285. package/dist/lib/execution-profile.d.ts.map +0 -1
  286. package/dist/lib/execution-profile.js.map +0 -1
  287. package/dist/lib/executors.d.ts.map +0 -1
  288. package/dist/lib/executors.js.map +0 -1
  289. package/dist/lib/filesystem.d.ts.map +0 -1
  290. package/dist/lib/filesystem.js.map +0 -1
  291. package/dist/lib/interf-bootstrap.d.ts.map +0 -1
  292. package/dist/lib/interf-bootstrap.js.map +0 -1
  293. package/dist/lib/interf-detect.d.ts.map +0 -1
  294. package/dist/lib/interf-detect.js.map +0 -1
  295. package/dist/lib/interf-scaffold.d.ts.map +0 -1
  296. package/dist/lib/interf-scaffold.js.map +0 -1
  297. package/dist/lib/interf-workflow-package.d.ts.map +0 -1
  298. package/dist/lib/interf-workflow-package.js.map +0 -1
  299. package/dist/lib/interf.d.ts.map +0 -1
  300. package/dist/lib/interf.js.map +0 -1
  301. package/dist/lib/local-workflows.d.ts.map +0 -1
  302. package/dist/lib/local-workflows.js.map +0 -1
  303. package/dist/lib/logger.d.ts.map +0 -1
  304. package/dist/lib/logger.js.map +0 -1
  305. package/dist/lib/obsidian.d.ts.map +0 -1
  306. package/dist/lib/obsidian.js.map +0 -1
  307. package/dist/lib/parse.d.ts.map +0 -1
  308. package/dist/lib/parse.js.map +0 -1
  309. package/dist/lib/registry.d.ts.map +0 -1
  310. package/dist/lib/registry.js.map +0 -1
  311. package/dist/lib/runtime-acceptance.d.ts.map +0 -1
  312. package/dist/lib/runtime-acceptance.js.map +0 -1
  313. package/dist/lib/runtime-contracts.d.ts.map +0 -1
  314. package/dist/lib/runtime-contracts.js.map +0 -1
  315. package/dist/lib/runtime-paths.d.ts.map +0 -1
  316. package/dist/lib/runtime-paths.js.map +0 -1
  317. package/dist/lib/runtime-prompt.d.ts.map +0 -1
  318. package/dist/lib/runtime-prompt.js.map +0 -1
  319. package/dist/lib/runtime-reconcile.d.ts.map +0 -1
  320. package/dist/lib/runtime-reconcile.js.map +0 -1
  321. package/dist/lib/runtime-runs.d.ts.map +0 -1
  322. package/dist/lib/runtime-runs.js.map +0 -1
  323. package/dist/lib/runtime-types.d.ts.map +0 -1
  324. package/dist/lib/runtime-types.js.map +0 -1
  325. package/dist/lib/runtime.d.ts.map +0 -1
  326. package/dist/lib/runtime.js.map +0 -1
  327. package/dist/lib/schema.d.ts.map +0 -1
  328. package/dist/lib/schema.js.map +0 -1
  329. package/dist/lib/source-config.d.ts.map +0 -1
  330. package/dist/lib/source-config.js.map +0 -1
  331. package/dist/lib/state-artifacts.d.ts.map +0 -1
  332. package/dist/lib/state-artifacts.js.map +0 -1
  333. package/dist/lib/state-health.d.ts.map +0 -1
  334. package/dist/lib/state-health.js.map +0 -1
  335. package/dist/lib/state-io.d.ts.map +0 -1
  336. package/dist/lib/state-io.js.map +0 -1
  337. package/dist/lib/state-paths.d.ts.map +0 -1
  338. package/dist/lib/state-paths.js.map +0 -1
  339. package/dist/lib/state-view.d.ts.map +0 -1
  340. package/dist/lib/state-view.js.map +0 -1
  341. package/dist/lib/state.d.ts.map +0 -1
  342. package/dist/lib/state.js.map +0 -1
  343. package/dist/lib/summarize-plan.d.ts.map +0 -1
  344. package/dist/lib/summarize-plan.js.map +0 -1
  345. package/dist/lib/user-config.d.ts.map +0 -1
  346. package/dist/lib/user-config.js.map +0 -1
  347. package/dist/lib/util.d.ts.map +0 -1
  348. package/dist/lib/util.js.map +0 -1
  349. package/dist/lib/validate-helpers.d.ts.map +0 -1
  350. package/dist/lib/validate-helpers.js.map +0 -1
  351. package/dist/lib/validate-workspace.d.ts.map +0 -1
  352. package/dist/lib/validate-workspace.js.map +0 -1
  353. package/dist/lib/validate.d.ts.map +0 -1
  354. package/dist/lib/validate.js.map +0 -1
  355. package/dist/lib/workflow-definitions.d.ts.map +0 -1
  356. package/dist/lib/workflow-definitions.js.map +0 -1
  357. package/dist/lib/workflow-helpers.d.ts.map +0 -1
  358. package/dist/lib/workflow-helpers.js.map +0 -1
  359. package/dist/lib/workflow-stage-runner.d.ts.map +0 -1
  360. package/dist/lib/workflow-stage-runner.js.map +0 -1
  361. package/dist/lib/workflow-starter-docs.d.ts +0 -7
  362. package/dist/lib/workflow-starter-docs.d.ts.map +0 -1
  363. package/dist/lib/workflow-starter-docs.js +0 -3
  364. package/dist/lib/workflow-starter-docs.js.map +0 -1
  365. package/dist/lib/workflows.d.ts.map +0 -1
  366. package/dist/lib/workflows.js.map +0 -1
  367. package/dist/lib/workspace-compile.d.ts.map +0 -1
  368. package/dist/lib/workspace-compile.js.map +0 -1
  369. package/dist/lib/workspace-docs.d.ts +0 -3
  370. package/dist/lib/workspace-docs.d.ts.map +0 -1
  371. package/dist/lib/workspace-docs.js +0 -82
  372. package/dist/lib/workspace-docs.js.map +0 -1
  373. package/dist/lib/workspace-raw.d.ts.map +0 -1
  374. package/dist/lib/workspace-raw.js.map +0 -1
  375. package/dist/lib/workspace-reset.d.ts.map +0 -1
  376. package/dist/lib/workspace-reset.js.map +0 -1
  377. package/dist/lib/workspace-schema.d.ts.map +0 -1
  378. package/dist/lib/workspace-schema.js.map +0 -1
  379. package/skills/benchmark/SKILL.md +0 -122
  380. package/skills/workflow/create/SKILL.md +0 -141
  381. package/skills/workspace/shape/SKILL.md +0 -15
  382. package/skills/workspace/structure/SKILL.md +0 -15
  383. package/skills/workspace/summarize/SKILL.md +0 -15
  384. package/templates/workspace/README.md +0 -24
  385. package/templates/workspace/interfignore +0 -2
@@ -1,9 +1,9 @@
1
1
  import chalk from "chalk";
2
2
  import * as p from "@clack/prompts";
3
- import { detectInterf, resolveSourceControlPath, } from "../lib/interf.js";
4
- import { SOURCE_FOLDER_CONFIG_FILE, listSourceWorkspaceConfigs, loadSourceFolderConfig, upsertSourceWorkspaceConfig, } from "../lib/source-config.js";
5
- import { DEFAULT_WORKSPACE_NAME, promptSingleWorkspaceConfig, } from "./source-config-wizard.js";
6
- import { createWorkflowWizard } from "./create-workflow-wizard.js";
3
+ import { detectInterf, readInterfConfig, resolveSourceControlPath, } from "../lib/interf.js";
4
+ import { SOURCE_FOLDER_CONFIG_FILE, resolveWorkspaceCompileMaxAttempts, resolveWorkspaceCompileMaxLoops, syncWorkspaceInterfConfigFromSourceWorkspaceConfig, upsertSourceWorkspaceConfig, } from "../lib/source-config.js";
5
+ import { DEFAULT_WORKSPACE_NAME, describeCompileLoopSelection, promptSingleWorkspaceConfig, } from "./source-config-wizard.js";
6
+ import { buildWorkspaceWorkflowOptions, chooseWorkspaceWorkflow, createWorkflowWizard, } from "./create-workflow-wizard.js";
7
7
  import { findBuiltWorkspacePath, findSavedWorkspaceConfig, listSavedWorkspaceEntries, ensureWorkspaceFromConfig, } from "./workspace-flow.js";
8
8
  import { printSavedTestOutcome, printSavedTestComparison, questionPassRate, runSavedRawTest, runSavedWorkspaceTest, } from "./test-flow.js";
9
9
  import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
@@ -14,11 +14,26 @@ function describeSavedQuestions(workspace) {
14
14
  return "No saved truth checks yet";
15
15
  return `${count} saved truth check${count === 1 ? "" : "s"}`;
16
16
  }
17
+ function compileModeAlreadyRanSavedTests(workspace) {
18
+ if (workspace.checks.length === 0)
19
+ return false;
20
+ return (resolveWorkspaceCompileMaxAttempts(workspace) != null ||
21
+ resolveWorkspaceCompileMaxLoops(workspace) != null);
22
+ }
17
23
  function printWorkspaceSummary(options) {
24
+ const workspaceConfig = options.builtWorkspacePath
25
+ ? readInterfConfig(options.builtWorkspacePath)
26
+ : null;
27
+ const workflowLabel = `${options.workspace.workflow ?? "interf"}${workspaceConfig?.workflow_origin?.local_draft === true ? " (local draft)" : ""}`;
18
28
  p.log.info(`Workspace: ${options.workspace.name}`);
19
29
  if (options.workspace.about) {
20
30
  p.log.info(`Focus: ${options.workspace.about}`);
21
31
  }
32
+ p.log.info(`Workflow: ${workflowLabel}`);
33
+ p.log.info(describeCompileLoopSelection({
34
+ maxAttempts: options.workspace.max_attempts,
35
+ maxLoops: options.workspace.max_loops,
36
+ }));
22
37
  p.log.info(describeSavedQuestions(options.workspace));
23
38
  p.log.info(options.built ? "Compiled workspace is available." : "Compiled workspace has not been built yet.");
24
39
  if (options.sourcePath !== process.cwd()) {
@@ -29,7 +44,7 @@ async function promptWorkspaceAction(workspace, built) {
29
44
  const options = [
30
45
  {
31
46
  value: "edit",
32
- label: "Edit truth checks and focus",
47
+ label: "Edit workflow, truth checks, and compile mode",
33
48
  hint: "Update this workspace setup",
34
49
  },
35
50
  ];
@@ -90,6 +105,7 @@ async function chooseWorkspaceForWizard(options) {
90
105
  label: entry.config.name,
91
106
  hint: [
92
107
  entry.config.about ?? describeSavedQuestions(entry.config),
108
+ `workflow ${entry.config.workflow ?? "interf"}${entry.localDraft ? " (local draft)" : ""}`,
93
109
  entry.path ? "built" : "not built yet",
94
110
  ].join(" · "),
95
111
  })),
@@ -107,22 +123,47 @@ async function chooseWorkspaceForWizard(options) {
107
123
  return findSavedWorkspaceConfig(options.sourcePath, String(selected));
108
124
  }
109
125
  async function promptWorkspaceSetup(options) {
126
+ const workflowChoice = await chooseWorkspaceWorkflow(options.sourcePath, {
127
+ currentWorkflowId: options.initial?.workflow ?? "interf",
128
+ message: options.introStyle === "edit"
129
+ ? "Which workflow should this workspace use?"
130
+ : "Which workflow should this workspace start from?",
131
+ });
132
+ if (p.isCancel(workflowChoice))
133
+ return null;
134
+ const workflowId = workflowChoice;
135
+ const workflowLabel = buildWorkspaceWorkflowOptions(options.sourcePath)
136
+ .find((option) => option.value === workflowId)?.label ?? workflowId;
110
137
  const workspaceConfig = await promptSingleWorkspaceConfig({
111
138
  initial: options.initial,
112
139
  ...(options.fixedName ? { fixedName: options.fixedName } : {}),
113
140
  skipNamePrompt: !options.fixedName && options.introStyle === "first",
114
141
  introStyle: options.introStyle,
142
+ selectedWorkflowLabel: workflowLabel,
115
143
  });
116
144
  if (!workspaceConfig)
117
145
  return null;
118
- upsertSourceWorkspaceConfig(options.sourcePath, workspaceConfig, {
146
+ const workspaceConfigWithWorkflow = {
147
+ ...workspaceConfig,
148
+ workflow: workflowId,
149
+ };
150
+ upsertSourceWorkspaceConfig(options.sourcePath, workspaceConfigWithWorkflow, {
119
151
  ...(options.fixedName ? { matchName: options.fixedName } : {}),
120
152
  });
153
+ const builtWorkspacePath = findBuiltWorkspacePath(options.sourcePath, workspaceConfigWithWorkflow.name);
154
+ if (builtWorkspacePath) {
155
+ syncWorkspaceInterfConfigFromSourceWorkspaceConfig(builtWorkspacePath, workspaceConfigWithWorkflow);
156
+ }
121
157
  console.log();
122
158
  console.log(chalk.green(` ✓ Saved workspace setup in ${SOURCE_FOLDER_CONFIG_FILE}`));
123
159
  console.log(chalk.dim(` Source folder: ${options.sourcePath}`));
124
- console.log(chalk.dim(` Workspace: ${workspaceConfig.name}`));
125
- return workspaceConfig;
160
+ console.log(chalk.dim(` Workspace: ${workspaceConfigWithWorkflow.name}`));
161
+ console.log(chalk.dim(` Workflow: ${workflowLabel}`));
162
+ console.log(chalk.dim(` Compile mode: ${describeCompileLoopSelection({
163
+ maxAttempts: workspaceConfigWithWorkflow.max_attempts,
164
+ maxLoops: workspaceConfigWithWorkflow.max_loops,
165
+ })}`));
166
+ return workspaceConfigWithWorkflow;
126
167
  }
127
168
  async function compileSelectedWorkspace(sourcePath, workspaceConfig) {
128
169
  const { executor, error } = await resolveOrConfigureLocalExecutor({
@@ -143,6 +184,7 @@ async function compileSelectedWorkspace(sourcePath, workspaceConfig) {
143
184
  sourcePath,
144
185
  workspaceConfig,
145
186
  maxAttemptsOverride: null,
187
+ maxLoopsOverride: null,
146
188
  });
147
189
  if (!compiled) {
148
190
  return null;
@@ -177,11 +219,11 @@ async function runFirstWorkspaceFlow(sourcePath, workspaceConfig) {
177
219
  }
178
220
  const compileAndTest = workspaceConfig.checks.length > 0 && rawOutcome
179
221
  ? await p.confirm({
180
- message: "Compile the workspace and run the same test now? (Recommended)",
222
+ message: "Compile the workspace with this workflow and run the same test now? (Recommended)",
181
223
  initialValue: true,
182
224
  })
183
225
  : await p.confirm({
184
- message: "Compile the workspace now? (Recommended)",
226
+ message: "Compile the workspace with this workflow now? (Recommended)",
185
227
  initialValue: true,
186
228
  });
187
229
  if (p.isCancel(compileAndTest) || !compileAndTest) {
@@ -206,6 +248,10 @@ async function runFirstWorkspaceFlow(sourcePath, workspaceConfig) {
206
248
  if (workspaceConfig.checks.length === 0) {
207
249
  return;
208
250
  }
251
+ if (compileModeAlreadyRanSavedTests(workspaceConfig)) {
252
+ p.log.info("Saved compile mode already ran the workspace test.");
253
+ return;
254
+ }
209
255
  if (!rawOutcome) {
210
256
  const runWorkspaceTest = await p.confirm({
211
257
  message: "Run the saved test on the compiled workspace now? (Recommended)",
@@ -254,8 +300,8 @@ export async function runInitCommand() {
254
300
  if (detected) {
255
301
  p.log.info(`Working from the dataset control plane: ${sourcePath}`);
256
302
  }
257
- const currentConfig = loadSourceFolderConfig(sourcePath);
258
- if (!currentConfig || listSourceWorkspaceConfigs(currentConfig).length === 0) {
303
+ const savedEntries = listSavedWorkspaceEntries(sourcePath);
304
+ if (savedEntries.length === 0) {
259
305
  const workspaceConfig = await promptWorkspaceSetup({
260
306
  sourcePath,
261
307
  initial: { name: DEFAULT_WORKSPACE_NAME },
@@ -288,6 +334,7 @@ export async function runInitCommand() {
288
334
  sourcePath,
289
335
  workspace: selectedWorkspace,
290
336
  built: Boolean(builtWorkspacePath),
337
+ builtWorkspacePath,
291
338
  });
292
339
  const action = await promptWorkspaceAction(selectedWorkspace, Boolean(builtWorkspacePath));
293
340
  if (!action)
@@ -320,7 +367,14 @@ export async function runInitCommand() {
320
367
  });
321
368
  if (!workspaceConfig)
322
369
  return;
323
- await runFirstWorkspaceFlow(sourcePath, workspaceConfig);
370
+ const refreshedBuiltWorkspacePath = findBuiltWorkspacePath(sourcePath, workspaceConfig.name);
371
+ printWorkspaceSummary({
372
+ sourcePath,
373
+ workspace: workspaceConfig,
374
+ built: Boolean(refreshedBuiltWorkspacePath),
375
+ builtWorkspacePath: refreshedBuiltWorkspacePath,
376
+ });
377
+ p.log.info("Saved workspace setup updated.");
324
378
  return;
325
379
  }
326
380
  if (action === "raw") {
@@ -363,6 +417,10 @@ export async function runInitCommand() {
363
417
  return;
364
418
  if (selectedWorkspace.checks.length === 0)
365
419
  return;
420
+ if (compileModeAlreadyRanSavedTests(selectedWorkspace)) {
421
+ p.log.info("Saved compile mode already ran the workspace test.");
422
+ return;
423
+ }
366
424
  const runWorkspaceTest = await p.confirm({
367
425
  message: "Run the saved test on the compiled workspace now?",
368
426
  initialValue: true,
@@ -390,4 +448,3 @@ export async function runInitCommand() {
390
448
  });
391
449
  printSavedTestComparison(null, workspaceOutcome);
392
450
  }
393
- //# sourceMappingURL=init.js.map
@@ -1,3 +1,2 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  export declare const listCommand: CommandModule;
3
- //# sourceMappingURL=list.d.ts.map
@@ -19,4 +19,3 @@ export const listCommand = {
19
19
  }
20
20
  },
21
21
  };
22
- //# sourceMappingURL=list.js.map
@@ -1,3 +1,2 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  export declare const resetCommand: CommandModule;
3
- //# sourceMappingURL=reset.d.ts.map
@@ -20,4 +20,3 @@ export const resetCommand = {
20
20
  console.log(chalk.green(" Workspace reset complete."));
21
21
  },
22
22
  };
23
- //# sourceMappingURL=reset.js.map
@@ -1,8 +1,20 @@
1
- import type { SourceEvalCase, SourceWorkspaceConfig } from "../lib/schema.js";
1
+ import type { SourceTruthCheck, SourceWorkspaceConfig } from "../lib/schema.js";
2
2
  export declare const DEFAULT_WORKSPACE_NAME = "my-workspace";
3
- export declare const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "What was Central London under offers in Q1 2021?";
4
- export declare const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "About 2.0 to 2.1 million sq ft.";
5
- export declare const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Quarterly results workspace for finance reporting and strategy questions.";
3
+ export declare const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "A question you can already verify from this dataset";
4
+ export declare const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
5
+ export declare const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Focused workspace for the dataset questions that matter most here.";
6
+ export declare const DEFAULT_COMPILE_RETRY_ATTEMPTS = 1;
7
+ export declare const DEFAULT_SELF_IMPROVING_LOOPS = 3;
8
+ export type CompileLoopMode = "once" | "retry" | "self-improving";
9
+ export interface CompileLoopSelection {
10
+ max_attempts?: number;
11
+ max_loops?: number;
12
+ }
13
+ export declare function resolveCompileLoopMode(maxAttempts?: number | null, maxLoops?: number | null): CompileLoopMode;
14
+ export declare function describeCompileLoopSelection(options: {
15
+ maxAttempts?: number | null;
16
+ maxLoops?: number | null;
17
+ }): string;
6
18
  export declare function promptCheckCases(options: {
7
19
  heading: string;
8
20
  questionMessage: string;
@@ -11,12 +23,21 @@ export declare function promptCheckCases(options: {
11
23
  answerPlaceholder: string;
12
24
  addAnotherMessage: string;
13
25
  startIndex?: number;
14
- }): Promise<SourceEvalCase[] | null>;
26
+ }): Promise<SourceTruthCheck[] | null>;
27
+ export declare function promptCompileLoopSelection(options: {
28
+ hasChecks: boolean;
29
+ initialMaxAttempts?: number;
30
+ initialMaxLoops?: number;
31
+ message?: string;
32
+ intro?: string[];
33
+ includeCompileOnce?: boolean;
34
+ recommendedMode?: CompileLoopMode;
35
+ }): Promise<CompileLoopSelection | null>;
15
36
  export declare function promptSingleWorkspaceConfig(options?: {
16
- initial?: Partial<Pick<SourceWorkspaceConfig, "name" | "about" | "checks" | "max_attempts">>;
37
+ initial?: Partial<Pick<SourceWorkspaceConfig, "name" | "about" | "checks" | "max_attempts" | "max_loops">>;
17
38
  fixedName?: string;
18
39
  skipAboutPrompt?: boolean;
19
40
  skipNamePrompt?: boolean;
20
41
  introStyle?: "first" | "additional" | "edit";
42
+ selectedWorkflowLabel?: string;
21
43
  }): Promise<SourceWorkspaceConfig | null>;
22
- //# sourceMappingURL=source-config-wizard.d.ts.map
@@ -1,10 +1,34 @@
1
1
  import * as p from "@clack/prompts";
2
- import { workspaceMaxAttempts } from "../lib/source-config.js";
2
+ import { workspaceMaxAttempts, workspaceMaxLoops } from "../lib/source-config.js";
3
3
  import { slugify } from "../lib/util.js";
4
4
  export const DEFAULT_WORKSPACE_NAME = "my-workspace";
5
- export const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "What was Central London under offers in Q1 2021?";
6
- export const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "About 2.0 to 2.1 million sq ft.";
7
- export const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Quarterly results workspace for finance reporting and strategy questions.";
5
+ export const DEFAULT_WORKSPACE_CHECK_QUESTION_PLACEHOLDER = "A question you can already verify from this dataset";
6
+ export const DEFAULT_WORKSPACE_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
7
+ export const DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER = "Focused workspace for the dataset questions that matter most here.";
8
+ export const DEFAULT_COMPILE_RETRY_ATTEMPTS = 1;
9
+ export const DEFAULT_SELF_IMPROVING_LOOPS = 3;
10
+ function formatAttemptLabel(count, noun) {
11
+ return `${count} ${noun}${count === 1 ? "" : "s"}`;
12
+ }
13
+ export function resolveCompileLoopMode(maxAttempts, maxLoops) {
14
+ if ((maxLoops ?? 0) > 0)
15
+ return "self-improving";
16
+ if ((maxAttempts ?? 0) > 1)
17
+ return "retry";
18
+ return "once";
19
+ }
20
+ export function describeCompileLoopSelection(options) {
21
+ const mode = resolveCompileLoopMode(options.maxAttempts, options.maxLoops);
22
+ if (mode === "once") {
23
+ return "Run a single compile attempt without workflow edits.";
24
+ }
25
+ if (mode === "retry") {
26
+ return `Retry the same workflow up to ${formatAttemptLabel(options.maxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS, "attempt")}.`;
27
+ }
28
+ const attempts = options.maxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS;
29
+ const loops = options.maxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS;
30
+ return `Run ${formatAttemptLabel(attempts, "attempt")} per workflow variation and allow up to ${formatAttemptLabel(loops, "self-improving workflow loop")}.`;
31
+ }
8
32
  export async function promptCheckCases(options) {
9
33
  p.log.info(options.heading);
10
34
  const cases = [];
@@ -47,11 +71,11 @@ async function promptWorkspaceChecks(options) {
47
71
  if (options.initialAbout) {
48
72
  p.log.info(`Focus: ${options.initialAbout}`);
49
73
  }
50
- p.log.info("Truth checks");
51
- p.log.info("A truth check is a question plus the expected correct answer for this dataset.");
74
+ p.log.info("Truth checks define what should hold for this dataset.");
75
+ p.log.info("Each truth check is a question plus the expected correct answer.");
52
76
  p.log.info("Start with simple facts, comparisons, or conclusions you can verify in the source material.");
53
77
  const addNow = await p.confirm({
54
- message: "Add a few truth checks you already know for this dataset? (Recommended)",
78
+ message: "Add a few truth checks for this dataset now? (Recommended)",
55
79
  initialValue: true,
56
80
  });
57
81
  if (p.isCancel(addNow))
@@ -121,65 +145,122 @@ async function promptWorkspaceChecks(options) {
121
145
  return null;
122
146
  return mode === "add" ? [...options.initialChecks, ...nextChecks] : nextChecks;
123
147
  }
124
- async function promptWorkspaceRetryPolicy(options) {
125
- if (!options.hasChecks) {
126
- return undefined;
127
- }
128
- const currentMaxAttempts = options.initialMaxAttempts ?? null;
129
- if (currentMaxAttempts) {
130
- p.log.info(`Self-improving workflow loop: up to ${currentMaxAttempts} attempts.`);
131
- const mode = await p.select({
132
- message: "What do you want to do with the compile loop?",
133
- options: [
134
- {
135
- value: "keep",
136
- label: "Keep it",
137
- hint: "Reuse the current attempt budget",
138
- },
139
- {
140
- value: "change",
141
- label: "Change it",
142
- hint: "Use a different attempt budget",
143
- },
144
- {
145
- value: "disable",
146
- label: "Turn it off",
147
- hint: "Compile once without the retry loop",
148
- },
149
- ],
150
- });
151
- if (p.isCancel(mode))
152
- return null;
153
- if (mode === "keep")
154
- return currentMaxAttempts;
155
- if (mode === "disable")
156
- return undefined;
157
- }
158
- else {
159
- const enable = await p.confirm({
160
- message: "Keep rerunning the workflow and test until this workspace passes or reaches the attempt limit? (optional)",
161
- initialValue: false,
162
- });
163
- if (p.isCancel(enable))
164
- return null;
165
- if (!enable)
166
- return undefined;
167
- }
148
+ async function promptRetryAttempts(options) {
149
+ const minimum = options.minimum ?? 1;
168
150
  const maxAttempts = await p.text({
169
- message: "Maximum compile attempts?",
170
- placeholder: "3",
171
- initialValue: String(currentMaxAttempts ?? 3),
151
+ message: options.message,
152
+ placeholder: String(Math.max(minimum, DEFAULT_COMPILE_RETRY_ATTEMPTS)),
153
+ initialValue: String(Math.max(options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS, minimum)),
172
154
  validate: (value) => {
173
155
  const parsed = Number.parseInt(value.trim(), 10);
174
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > 5) {
175
- return "Enter a whole number from 1 to 5";
156
+ if (!Number.isInteger(parsed) || parsed < minimum || parsed > 5) {
157
+ return `Enter a whole number from ${minimum} to 5`;
176
158
  }
177
159
  return undefined;
178
160
  },
179
161
  });
180
162
  if (p.isCancel(maxAttempts))
181
163
  return null;
182
- return workspaceMaxAttempts(Number.parseInt(String(maxAttempts).trim(), 10));
164
+ return workspaceMaxAttempts(Number.parseInt(String(maxAttempts).trim(), 10)) ?? DEFAULT_COMPILE_RETRY_ATTEMPTS;
165
+ }
166
+ async function promptSelfImprovingLoops(options) {
167
+ const maxLoops = await p.text({
168
+ message: options.message,
169
+ placeholder: String(DEFAULT_SELF_IMPROVING_LOOPS),
170
+ initialValue: String(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS),
171
+ validate: (value) => {
172
+ const parsed = Number.parseInt(value.trim(), 10);
173
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 3) {
174
+ return "Enter a whole number from 1 to 3";
175
+ }
176
+ return undefined;
177
+ },
178
+ });
179
+ if (p.isCancel(maxLoops))
180
+ return null;
181
+ return workspaceMaxLoops(Number.parseInt(String(maxLoops).trim(), 10)) ?? DEFAULT_SELF_IMPROVING_LOOPS;
182
+ }
183
+ export async function promptCompileLoopSelection(options) {
184
+ if (!options.hasChecks) {
185
+ return {};
186
+ }
187
+ const currentMode = resolveCompileLoopMode(options.initialMaxAttempts, options.initialMaxLoops);
188
+ const recommendedMode = options.recommendedMode ?? "self-improving";
189
+ const includeCompileOnce = options.includeCompileOnce !== false;
190
+ const hasSavedPolicy = typeof options.initialMaxAttempts === "number" ||
191
+ typeof options.initialMaxLoops === "number";
192
+ for (const line of options.intro ?? []) {
193
+ p.log.info(line);
194
+ }
195
+ p.log.info(`Current mode: ${describeCompileLoopSelection({
196
+ maxAttempts: options.initialMaxAttempts,
197
+ maxLoops: options.initialMaxLoops,
198
+ })}`);
199
+ const optionsByMode = {
200
+ once: {
201
+ value: "once",
202
+ label: "Single attempt",
203
+ hint: "No retries or workflow edits",
204
+ },
205
+ retry: {
206
+ value: "retry",
207
+ label: "Retry the same workflow",
208
+ hint: `Run compile + test up to ${formatAttemptLabel(Math.max(options.initialMaxAttempts ?? 2, 2), "attempt")}`,
209
+ },
210
+ "self-improving": {
211
+ value: "self-improving",
212
+ label: recommendedMode === "self-improving"
213
+ ? "Self-improving loops (Recommended)"
214
+ : "Self-improving loops",
215
+ hint: `Retry each variation, then edit the workflow and retest up to ${options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS} loop${(options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS) === 1 ? "" : "s"}`,
216
+ },
217
+ };
218
+ const orderedModes = (hasSavedPolicy
219
+ ? [
220
+ currentMode,
221
+ ...(recommendedMode !== currentMode ? [recommendedMode] : []),
222
+ "retry",
223
+ "once",
224
+ ]
225
+ : [
226
+ recommendedMode,
227
+ "retry",
228
+ "once",
229
+ ]).filter((mode, index, list) => list.indexOf(mode) === index)
230
+ .filter((mode) => includeCompileOnce || mode !== "once");
231
+ const selectedMode = await p.select({
232
+ message: options.message ?? "How should this workspace compile?",
233
+ options: orderedModes.map((mode) => optionsByMode[mode]),
234
+ });
235
+ if (p.isCancel(selectedMode))
236
+ return null;
237
+ if (selectedMode === "once") {
238
+ return {};
239
+ }
240
+ const maxAttempts = await promptRetryAttempts({
241
+ initialMaxAttempts: options.initialMaxAttempts ?? DEFAULT_COMPILE_RETRY_ATTEMPTS,
242
+ minimum: selectedMode === "retry" ? 2 : 1,
243
+ message: selectedMode === "retry"
244
+ ? "Maximum compile attempts for the same workflow?"
245
+ : "Attempts per workflow variation?",
246
+ });
247
+ if (maxAttempts === null)
248
+ return null;
249
+ if (selectedMode === "retry") {
250
+ return {
251
+ max_attempts: maxAttempts,
252
+ };
253
+ }
254
+ const maxLoops = await promptSelfImprovingLoops({
255
+ initialMaxLoops: options.initialMaxLoops ?? DEFAULT_SELF_IMPROVING_LOOPS,
256
+ message: "Maximum self-improving workflow loops?",
257
+ });
258
+ if (maxLoops === null)
259
+ return null;
260
+ return {
261
+ max_attempts: maxAttempts,
262
+ max_loops: maxLoops,
263
+ };
183
264
  }
184
265
  export async function promptSingleWorkspaceConfig(options = {}) {
185
266
  const initial = options.initial;
@@ -224,7 +305,10 @@ export async function promptSingleWorkspaceConfig(options = {}) {
224
305
  }
225
306
  let about = initial?.about ?? "";
226
307
  let checks = null;
227
- let maxAttempts = initial?.max_attempts;
308
+ let compileLoopSelection = {
309
+ ...(typeof initial?.max_attempts === "number" ? { max_attempts: initial.max_attempts } : {}),
310
+ ...(typeof initial?.max_loops === "number" ? { max_loops: initial.max_loops } : {}),
311
+ };
228
312
  if (collectChecksFirst) {
229
313
  checks = await promptWorkspaceChecks({
230
314
  initialChecks: initial?.checks,
@@ -234,7 +318,7 @@ export async function promptSingleWorkspaceConfig(options = {}) {
234
318
  }
235
319
  if (!(options.skipAboutPrompt && initial?.about)) {
236
320
  about = await p.text({
237
- message: "Anything specific you want this workspace to be especially good at? (optional)",
321
+ message: "Optional focus for this workspace?",
238
322
  placeholder: DEFAULT_WORKSPACE_ABOUT_PLACEHOLDER,
239
323
  initialValue: initial?.about,
240
324
  });
@@ -249,17 +333,29 @@ export async function promptSingleWorkspaceConfig(options = {}) {
249
333
  if (checks === null)
250
334
  return null;
251
335
  }
252
- maxAttempts = await promptWorkspaceRetryPolicy({
336
+ compileLoopSelection = await promptCompileLoopSelection({
253
337
  initialMaxAttempts: initial?.max_attempts,
338
+ initialMaxLoops: initial?.max_loops,
254
339
  hasChecks: checks.length > 0,
340
+ intro: [
341
+ ...(options.selectedWorkflowLabel
342
+ ? [`Workflow: ${options.selectedWorkflowLabel}`]
343
+ : []),
344
+ "Compile mode",
345
+ "Choose whether this workspace should compile once, retry the same workflow, or run self-improving loops that edit the workflow and retest it on the same truth checks.",
346
+ ],
255
347
  });
256
- if (maxAttempts === null)
348
+ if (compileLoopSelection === null)
257
349
  return null;
258
350
  return {
259
351
  name,
260
352
  ...(String(about).trim().length > 0 ? { about: String(about).trim() } : {}),
261
- ...(typeof maxAttempts === "number" ? { max_attempts: maxAttempts } : {}),
353
+ ...(typeof compileLoopSelection.max_attempts === "number"
354
+ ? { max_attempts: compileLoopSelection.max_attempts }
355
+ : {}),
356
+ ...(typeof compileLoopSelection.max_loops === "number"
357
+ ? { max_loops: compileLoopSelection.max_loops }
358
+ : {}),
262
359
  checks,
263
360
  };
264
361
  }
265
- //# sourceMappingURL=source-config-wizard.js.map
@@ -1,3 +1,2 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  export declare const statusCommand: CommandModule;
3
- //# sourceMappingURL=status.d.ts.map
@@ -68,4 +68,3 @@ export const statusCommand = {
68
68
  console.log(chalk.dim(` errors: ${health.metrics.errors}`));
69
69
  },
70
70
  };
71
- //# sourceMappingURL=status.js.map
@@ -1,26 +1,36 @@
1
- import { type BenchmarkTargetCandidate, type BenchmarkTargetResult } from "../lib/benchmark.js";
2
- import type { WorkflowExecutionProfile } from "../lib/executors.js";
3
- import type { BenchmarkSandboxRetentionMode } from "../lib/benchmark-sandbox.js";
4
- import type { SourceWorkspaceConfig } from "../lib/schema.js";
1
+ import { type TestTargetCandidate, type TestTargetResult } from "../lib/test.js";
2
+ import type { WorkflowExecutionProfile, WorkflowExecutor } from "../lib/executors.js";
3
+ import type { TestSandboxRetentionMode } from "../lib/test-sandbox.js";
4
+ import type { SourceWorkspaceConfig, TestRunMode } from "../lib/schema.js";
5
5
  export interface SavedTestOutcome {
6
6
  runPath: string;
7
- target: BenchmarkTargetCandidate;
8
- result: BenchmarkTargetResult;
7
+ target: TestTargetCandidate;
8
+ result: TestTargetResult;
9
9
  }
10
10
  export declare function questionPassRate(outcome: SavedTestOutcome): number;
11
11
  export declare function printSavedTestOutcome(prefix: string, outcome: SavedTestOutcome): void;
12
- export declare function printSavedTestComparison(rawOutcome: SavedTestOutcome | null, workspaceOutcome: SavedTestOutcome | null): void;
12
+ export declare function printSavedTestComparison(rawOutcome: SavedTestOutcome | null, workspaceOutcome: SavedTestOutcome | null, comparisonRunPath?: string | null): void;
13
+ export declare function saveTestComparisonRun(options: {
14
+ sourcePath: string;
15
+ workspacePath: string;
16
+ workspaceName: string;
17
+ mode: TestRunMode;
18
+ rawOutcome: SavedTestOutcome | null;
19
+ workspaceOutcome: SavedTestOutcome | null;
20
+ }): string;
13
21
  export declare function runSavedRawTest(options: {
14
22
  sourcePath: string;
15
23
  workspaceConfig: SourceWorkspaceConfig;
24
+ workspacePath?: string | null;
25
+ executor?: WorkflowExecutor | null;
16
26
  executionProfile?: WorkflowExecutionProfile;
17
- preserveSandboxes?: BenchmarkSandboxRetentionMode;
27
+ preserveSandboxes?: TestSandboxRetentionMode;
18
28
  }): Promise<SavedTestOutcome | null>;
19
29
  export declare function runSavedWorkspaceTest(options: {
20
30
  sourcePath: string;
21
31
  workspaceConfig: SourceWorkspaceConfig;
32
+ executor?: WorkflowExecutor | null;
22
33
  executionProfile?: WorkflowExecutionProfile;
23
34
  workspacePath?: string | null;
24
- preserveSandboxes?: BenchmarkSandboxRetentionMode;
35
+ preserveSandboxes?: TestSandboxRetentionMode;
25
36
  }): Promise<SavedTestOutcome | null>;
26
- //# sourceMappingURL=test-flow.d.ts.map