@interf/compiler 0.5.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +160 -201
  2. package/builtin-workflows/interf/README.md +22 -10
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +8 -5
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
  6. package/builtin-workflows/interf/improve/SKILL.md +4 -4
  7. package/builtin-workflows/interf/use/query/SKILL.md +1 -1
  8. package/builtin-workflows/interf/workflow.json +19 -5
  9. package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +10 -3
  10. package/dist/bin.js +2 -28
  11. package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
  12. package/dist/{commands → cli/commands}/check-draft.js +13 -13
  13. package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
  14. package/dist/{commands → cli/commands}/compile-controller.js +39 -44
  15. package/dist/cli/commands/compile.d.ts +33 -0
  16. package/dist/{commands → cli/commands}/compile.js +107 -33
  17. package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
  18. package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
  19. package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +20 -2
  20. package/dist/cli/commands/create-workflow-wizard.js +288 -0
  21. package/dist/{commands → cli/commands}/create.d.ts +2 -2
  22. package/dist/cli/commands/create.js +166 -0
  23. package/dist/cli/commands/dataset-selection.d.ts +6 -0
  24. package/dist/cli/commands/dataset-selection.js +11 -0
  25. package/dist/{commands → cli/commands}/default.js +5 -5
  26. package/dist/{commands → cli/commands}/doctor.js +12 -13
  27. package/dist/{commands → cli/commands}/executor-flow.d.ts +2 -2
  28. package/dist/{commands → cli/commands}/executor-flow.js +17 -17
  29. package/dist/cli/commands/init.d.ts +11 -0
  30. package/dist/{commands → cli/commands}/init.js +202 -109
  31. package/dist/{commands → cli/commands}/list.js +9 -6
  32. package/dist/{commands → cli/commands}/reset.js +5 -5
  33. package/dist/{commands → cli/commands}/source-config-wizard.d.ts +10 -5
  34. package/dist/{commands → cli/commands}/source-config-wizard.js +202 -95
  35. package/dist/{commands → cli/commands}/status.js +20 -11
  36. package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
  37. package/dist/{commands → cli/commands}/test-flow.js +30 -26
  38. package/dist/cli/commands/test.d.ts +14 -0
  39. package/dist/{commands → cli/commands}/test.js +48 -40
  40. package/dist/{commands → cli/commands}/verify.js +4 -4
  41. package/dist/cli/index.d.ts +21 -0
  42. package/dist/cli/index.js +33 -0
  43. package/dist/index.d.ts +22 -11
  44. package/dist/index.js +15 -6
  45. package/dist/lib/agent-args.d.ts +1 -3
  46. package/dist/lib/agent-args.js +1 -42
  47. package/dist/lib/agent-constants.d.ts +1 -5
  48. package/dist/lib/agent-constants.js +1 -28
  49. package/dist/lib/agent-detection.d.ts +1 -7
  50. package/dist/lib/agent-detection.js +1 -65
  51. package/dist/lib/agent-execution.d.ts +1 -2
  52. package/dist/lib/agent-execution.js +1 -242
  53. package/dist/lib/agent-logs.d.ts +1 -2
  54. package/dist/lib/agent-logs.js +1 -17
  55. package/dist/lib/agent-preflight.d.ts +1 -7
  56. package/dist/lib/agent-preflight.js +1 -76
  57. package/dist/lib/agent-render.d.ts +1 -8
  58. package/dist/lib/agent-render.js +1 -218
  59. package/dist/lib/agent-shells.d.ts +1 -44
  60. package/dist/lib/agent-shells.js +1 -847
  61. package/dist/lib/agent-status.d.ts +1 -3
  62. package/dist/lib/agent-status.js +1 -58
  63. package/dist/lib/agent-types.d.ts +1 -30
  64. package/dist/lib/agent-types.js +1 -1
  65. package/dist/lib/agents.d.ts +1 -6
  66. package/dist/lib/agents.js +1 -5
  67. package/dist/lib/builtin-compiled-workflow.d.ts +1 -129
  68. package/dist/lib/builtin-compiled-workflow.js +1 -153
  69. package/dist/lib/compiled-compile.d.ts +1 -52
  70. package/dist/lib/compiled-compile.js +1 -274
  71. package/dist/lib/compiled-paths.d.ts +1 -39
  72. package/dist/lib/compiled-paths.js +3 -103
  73. package/dist/lib/compiled-raw.d.ts +1 -49
  74. package/dist/lib/compiled-raw.js +3 -102
  75. package/dist/lib/compiled-reset.d.ts +1 -1
  76. package/dist/lib/compiled-reset.js +3 -44
  77. package/dist/lib/compiled-schema.d.ts +1 -27
  78. package/dist/lib/compiled-schema.js +1 -110
  79. package/dist/lib/discovery.d.ts +1 -1
  80. package/dist/lib/discovery.js +2 -2
  81. package/dist/lib/execution-profile.d.ts +1 -17
  82. package/dist/lib/execution-profile.js +1 -84
  83. package/dist/lib/executors.d.ts +1 -32
  84. package/dist/lib/executors.js +1 -43
  85. package/dist/lib/interf-bootstrap.d.ts +1 -3
  86. package/dist/lib/interf-bootstrap.js +3 -18
  87. package/dist/lib/interf-detect.d.ts +1 -33
  88. package/dist/lib/interf-detect.js +3 -176
  89. package/dist/lib/interf-scaffold.d.ts +1 -2
  90. package/dist/lib/interf-scaffold.js +3 -121
  91. package/dist/lib/interf-workflow-package.d.ts +1 -20
  92. package/dist/lib/interf-workflow-package.js +1 -276
  93. package/dist/lib/interf.d.ts +1 -5
  94. package/dist/lib/interf.js +3 -4
  95. package/dist/lib/local-workflows.d.ts +1 -53
  96. package/dist/lib/local-workflows.js +1 -399
  97. package/dist/lib/package-root.d.ts +1 -0
  98. package/dist/lib/package-root.js +1 -0
  99. package/dist/lib/project-paths.d.ts +1 -11
  100. package/dist/lib/project-paths.js +3 -32
  101. package/dist/lib/runtime-acceptance.d.ts +1 -9
  102. package/dist/lib/runtime-acceptance.js +1 -257
  103. package/dist/lib/runtime-contracts.d.ts +1 -2
  104. package/dist/lib/runtime-contracts.js +1 -47
  105. package/dist/lib/runtime-inventory.d.ts +1 -7
  106. package/dist/lib/runtime-inventory.js +1 -29
  107. package/dist/lib/runtime-paths.d.ts +1 -7
  108. package/dist/lib/runtime-paths.js +1 -23
  109. package/dist/lib/runtime-prompt.d.ts +1 -2
  110. package/dist/lib/runtime-prompt.js +1 -46
  111. package/dist/lib/runtime-reconcile.d.ts +1 -2
  112. package/dist/lib/runtime-reconcile.js +1 -156
  113. package/dist/lib/runtime-runs.d.ts +1 -11
  114. package/dist/lib/runtime-runs.js +1 -250
  115. package/dist/lib/runtime-types.d.ts +1 -43
  116. package/dist/lib/runtime-types.js +1 -1
  117. package/dist/lib/runtime.d.ts +1 -6
  118. package/dist/lib/runtime.js +1 -5
  119. package/dist/lib/schema.d.ts +4 -1016
  120. package/dist/lib/schema.js +6 -539
  121. package/dist/lib/source-config.d.ts +1 -39
  122. package/dist/lib/source-config.js +3 -293
  123. package/dist/lib/state-artifacts.d.ts +1 -8
  124. package/dist/lib/state-artifacts.js +1 -13
  125. package/dist/lib/state-health.d.ts +1 -4
  126. package/dist/lib/state-health.js +1 -132
  127. package/dist/lib/state-io.d.ts +1 -10
  128. package/dist/lib/state-io.js +1 -76
  129. package/dist/lib/state-paths.d.ts +1 -4
  130. package/dist/lib/state-paths.js +1 -13
  131. package/dist/lib/state-view.d.ts +1 -4
  132. package/dist/lib/state-view.js +1 -103
  133. package/dist/lib/state.d.ts +1 -6
  134. package/dist/lib/state.js +1 -5
  135. package/dist/lib/test-execution.d.ts +1 -14
  136. package/dist/lib/test-execution.js +3 -525
  137. package/dist/lib/test-matrices.d.ts +1 -90
  138. package/dist/lib/test-matrices.js +3 -96
  139. package/dist/lib/test-paths.d.ts +1 -12
  140. package/dist/lib/test-paths.js +3 -59
  141. package/dist/lib/test-profile-presets.d.ts +1 -57
  142. package/dist/lib/test-profile-presets.js +3 -50
  143. package/dist/lib/test-sandbox.d.ts +1 -11
  144. package/dist/lib/test-sandbox.js +3 -105
  145. package/dist/lib/test-specs.d.ts +1 -7
  146. package/dist/lib/test-specs.js +3 -114
  147. package/dist/lib/test-targets.d.ts +1 -5
  148. package/dist/lib/test-targets.js +3 -38
  149. package/dist/lib/test-types.d.ts +1 -17
  150. package/dist/lib/test-types.js +3 -1
  151. package/dist/lib/test.d.ts +1 -4
  152. package/dist/lib/test.js +3 -3
  153. package/dist/lib/validate-compiled.d.ts +1 -27
  154. package/dist/lib/validate-compiled.js +1 -238
  155. package/dist/lib/validate-helpers.d.ts +1 -12
  156. package/dist/lib/validate-helpers.js +1 -41
  157. package/dist/lib/validate.d.ts +1 -19
  158. package/dist/lib/validate.js +1 -256
  159. package/dist/lib/workflow-authoring.d.ts +1 -0
  160. package/dist/lib/workflow-authoring.js +1 -0
  161. package/dist/lib/workflow-definitions.d.ts +1 -68
  162. package/dist/lib/workflow-definitions.js +1 -206
  163. package/dist/lib/workflow-edit-session.d.ts +1 -0
  164. package/dist/lib/workflow-edit-session.js +1 -0
  165. package/dist/lib/workflow-edit-utils.d.ts +1 -0
  166. package/dist/lib/workflow-edit-utils.js +1 -0
  167. package/dist/lib/workflow-helpers.d.ts +1 -38
  168. package/dist/lib/workflow-helpers.js +1 -167
  169. package/dist/lib/workflow-improvement.d.ts +1 -22
  170. package/dist/lib/workflow-improvement.js +1 -396
  171. package/dist/lib/workflow-primitives.d.ts +1 -2
  172. package/dist/lib/workflow-primitives.js +1 -5
  173. package/dist/lib/workflow-review-paths.d.ts +1 -10
  174. package/dist/lib/workflow-review-paths.js +1 -27
  175. package/dist/lib/workflow-stage-policy.d.ts +1 -0
  176. package/dist/lib/workflow-stage-policy.js +1 -0
  177. package/dist/lib/workflow-stage-runner.d.ts +1 -41
  178. package/dist/lib/workflow-stage-runner.js +1 -109
  179. package/dist/lib/workflows.d.ts +1 -15
  180. package/dist/lib/workflows.js +1 -31
  181. package/dist/packages/agents/index.d.ts +17 -0
  182. package/dist/packages/agents/index.js +15 -0
  183. package/dist/packages/agents/lib/agents.d.ts +6 -0
  184. package/dist/packages/agents/lib/agents.js +5 -0
  185. package/dist/packages/agents/lib/args.d.ts +4 -0
  186. package/dist/packages/agents/lib/args.js +52 -0
  187. package/dist/packages/agents/lib/constants.d.ts +5 -0
  188. package/dist/packages/agents/lib/constants.js +28 -0
  189. package/dist/packages/agents/lib/detection.d.ts +7 -0
  190. package/dist/packages/agents/lib/detection.js +65 -0
  191. package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
  192. package/dist/packages/agents/lib/execution-profile.js +84 -0
  193. package/dist/packages/agents/lib/execution.d.ts +2 -0
  194. package/dist/packages/agents/lib/execution.js +243 -0
  195. package/dist/packages/agents/lib/executors.d.ts +32 -0
  196. package/dist/packages/agents/lib/executors.js +45 -0
  197. package/dist/packages/agents/lib/logs.d.ts +2 -0
  198. package/dist/packages/agents/lib/logs.js +17 -0
  199. package/dist/packages/agents/lib/preflight.d.ts +7 -0
  200. package/dist/packages/agents/lib/preflight.js +77 -0
  201. package/dist/packages/agents/lib/render.d.ts +8 -0
  202. package/dist/packages/agents/lib/render.js +218 -0
  203. package/dist/packages/agents/lib/schema.d.ts +8 -0
  204. package/dist/packages/agents/lib/schema.js +7 -0
  205. package/dist/packages/agents/lib/shells.d.ts +69 -0
  206. package/dist/packages/agents/lib/shells.js +1021 -0
  207. package/dist/packages/agents/lib/status.d.ts +3 -0
  208. package/dist/packages/agents/lib/status.js +58 -0
  209. package/dist/packages/agents/lib/types.d.ts +30 -0
  210. package/dist/packages/agents/lib/types.js +1 -0
  211. package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
  212. package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
  213. package/dist/packages/compiler/compiled-compile.d.ts +48 -0
  214. package/dist/packages/compiler/compiled-compile.js +256 -0
  215. package/dist/packages/compiler/compiled-schema.d.ts +31 -0
  216. package/dist/packages/compiler/compiled-schema.js +141 -0
  217. package/dist/packages/compiler/index.d.ts +24 -0
  218. package/dist/packages/compiler/index.js +23 -0
  219. package/dist/packages/compiler/lib/schema.d.ts +684 -0
  220. package/dist/packages/compiler/lib/schema.js +361 -0
  221. package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
  222. package/dist/packages/compiler/runtime-acceptance.js +269 -0
  223. package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
  224. package/dist/packages/compiler/runtime-contracts.js +48 -0
  225. package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
  226. package/dist/packages/compiler/runtime-inventory.js +29 -0
  227. package/dist/packages/compiler/runtime-paths.d.ts +8 -0
  228. package/dist/packages/compiler/runtime-paths.js +26 -0
  229. package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
  230. package/dist/packages/compiler/runtime-prompt.js +48 -0
  231. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
  232. package/dist/packages/compiler/runtime-reconcile.js +193 -0
  233. package/dist/packages/compiler/runtime-runs.d.ts +11 -0
  234. package/dist/packages/compiler/runtime-runs.js +262 -0
  235. package/dist/packages/compiler/runtime-types.d.ts +43 -0
  236. package/dist/packages/compiler/runtime-types.js +1 -0
  237. package/dist/packages/compiler/runtime.d.ts +6 -0
  238. package/dist/packages/compiler/runtime.js +5 -0
  239. package/dist/packages/compiler/state-artifacts.d.ts +8 -0
  240. package/dist/packages/compiler/state-artifacts.js +13 -0
  241. package/dist/packages/compiler/state-health.d.ts +4 -0
  242. package/dist/packages/compiler/state-health.js +132 -0
  243. package/dist/packages/compiler/state-io.d.ts +10 -0
  244. package/dist/packages/compiler/state-io.js +76 -0
  245. package/dist/packages/compiler/state-paths.d.ts +4 -0
  246. package/dist/packages/compiler/state-paths.js +13 -0
  247. package/dist/packages/compiler/state-view.d.ts +4 -0
  248. package/dist/packages/compiler/state-view.js +103 -0
  249. package/dist/packages/compiler/state.d.ts +7 -0
  250. package/dist/packages/compiler/state.js +12 -0
  251. package/dist/packages/compiler/validate-compiled.d.ts +27 -0
  252. package/dist/packages/compiler/validate-compiled.js +241 -0
  253. package/dist/packages/compiler/validate-helpers.d.ts +12 -0
  254. package/dist/packages/compiler/validate-helpers.js +41 -0
  255. package/dist/packages/compiler/validate.d.ts +21 -0
  256. package/dist/packages/compiler/validate.js +249 -0
  257. package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
  258. package/dist/packages/compiler/workflow-primitives.js +5 -0
  259. package/dist/packages/compiler/workflows.d.ts +15 -0
  260. package/dist/packages/compiler/workflows.js +31 -0
  261. package/dist/packages/project-model/compiled-paths.d.ts +40 -0
  262. package/dist/packages/project-model/compiled-paths.js +106 -0
  263. package/dist/packages/project-model/compiled-raw.d.ts +49 -0
  264. package/dist/packages/project-model/compiled-raw.js +102 -0
  265. package/dist/packages/project-model/compiled-reset.d.ts +2 -0
  266. package/dist/packages/project-model/compiled-reset.js +72 -0
  267. package/dist/packages/project-model/index.d.ts +11 -0
  268. package/dist/packages/project-model/index.js +10 -0
  269. package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
  270. package/dist/packages/project-model/interf-bootstrap.js +18 -0
  271. package/dist/packages/project-model/interf-detect.d.ts +33 -0
  272. package/dist/packages/project-model/interf-detect.js +176 -0
  273. package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
  274. package/dist/packages/project-model/interf-scaffold.js +124 -0
  275. package/dist/packages/project-model/interf.d.ts +5 -0
  276. package/dist/packages/project-model/interf.js +4 -0
  277. package/dist/packages/project-model/lib/schema.d.ts +125 -0
  278. package/dist/packages/project-model/lib/schema.js +62 -0
  279. package/dist/packages/project-model/project-paths.d.ts +11 -0
  280. package/dist/packages/project-model/project-paths.js +32 -0
  281. package/dist/packages/project-model/source-config.d.ts +38 -0
  282. package/dist/packages/project-model/source-config.js +297 -0
  283. package/dist/packages/testing/index.d.ts +13 -0
  284. package/dist/packages/testing/index.js +10 -0
  285. package/dist/packages/testing/lib/schema.d.ts +261 -0
  286. package/dist/packages/testing/lib/schema.js +119 -0
  287. package/dist/packages/testing/test-execution.d.ts +14 -0
  288. package/dist/packages/testing/test-execution.js +525 -0
  289. package/dist/packages/testing/test-matrices.d.ts +90 -0
  290. package/dist/packages/testing/test-matrices.js +96 -0
  291. package/dist/packages/testing/test-paths.d.ts +12 -0
  292. package/dist/packages/testing/test-paths.js +59 -0
  293. package/dist/packages/testing/test-profile-presets.d.ts +57 -0
  294. package/dist/packages/testing/test-profile-presets.js +50 -0
  295. package/dist/packages/testing/test-sandbox.d.ts +11 -0
  296. package/dist/packages/testing/test-sandbox.js +105 -0
  297. package/dist/packages/testing/test-specs.d.ts +7 -0
  298. package/dist/packages/testing/test-specs.js +114 -0
  299. package/dist/packages/testing/test-targets.d.ts +5 -0
  300. package/dist/packages/testing/test-targets.js +38 -0
  301. package/dist/packages/testing/test-types.d.ts +16 -0
  302. package/dist/packages/testing/test-types.js +1 -0
  303. package/dist/packages/testing/test.d.ts +4 -0
  304. package/dist/packages/testing/test.js +3 -0
  305. package/dist/packages/workflow-authoring/index.d.ts +4 -0
  306. package/dist/packages/workflow-authoring/index.js +4 -0
  307. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
  308. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
  309. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
  310. package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
  311. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
  312. package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
  313. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
  314. package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
  315. package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
  316. package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
  317. package/dist/packages/workflow-package/index.d.ts +9 -0
  318. package/dist/packages/workflow-package/index.js +9 -0
  319. package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
  320. package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
  321. package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
  322. package/dist/packages/workflow-package/lib/package-root.js +6 -0
  323. package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
  324. package/dist/packages/workflow-package/local-workflows.js +422 -0
  325. package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
  326. package/dist/packages/workflow-package/workflow-definitions.js +203 -0
  327. package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
  328. package/dist/packages/workflow-package/workflow-helpers.js +167 -0
  329. package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
  330. package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
  331. package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
  332. package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
  333. package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
  334. package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
  335. package/package.json +44 -21
  336. package/dist/commands/compile.d.ts +0 -15
  337. package/dist/commands/create-workflow-wizard.js +0 -125
  338. package/dist/commands/create.js +0 -162
  339. package/dist/commands/init.d.ts +0 -3
  340. package/dist/commands/test.d.ts +0 -9
  341. package/dist/lib/compiled-home.d.ts +0 -5
  342. package/dist/lib/compiled-home.js +0 -32
  343. package/dist/lib/config.js +0 -9
  344. package/dist/lib/obsidian.d.ts +0 -1
  345. package/dist/lib/obsidian.js +0 -15
  346. package/dist/lib/summarize-plan.d.ts +0 -17
  347. package/dist/lib/summarize-plan.js +0 -120
  348. /package/dist/{commands → cli/commands}/default.d.ts +0 -0
  349. /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
  350. /package/dist/{commands → cli/commands}/list.d.ts +0 -0
  351. /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
  352. /package/dist/{commands → cli/commands}/status.d.ts +0 -0
  353. /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
@@ -1,167 +1 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join, relative, sep } from "node:path";
3
- import { listFilesRecursive } from "./filesystem.js";
4
- import { isMarkdownFile } from "./util.js";
5
- import { getCompiledWorkflow, } from "./workflow-definitions.js";
6
- import { parseJsonFrontmatter } from "./parse.js";
7
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
8
- const LOCAL_SKILL_READ_LIMIT = 50;
9
- export function workflowQueryDirectory() {
10
- return "workflow/use/query";
11
- }
12
- export function workflowImproveDirectory() {
13
- return "workflow/improve";
14
- }
15
- export function workflowCompileStageDirectory(stageDir) {
16
- return `workflow/compile/stages/${stageDir}`;
17
- }
18
- export function emptyLocalSkillContractExtension() {
19
- return {
20
- reads: [],
21
- count: 0,
22
- notes: [],
23
- localMode: null,
24
- effectiveMode: "builtin",
25
- modeSources: [],
26
- };
27
- }
28
- function readLocalInstructionMode(filePath) {
29
- try {
30
- const parsed = parseJsonFrontmatter(readFileSync(filePath, "utf8"));
31
- const mode = parsed?.frontmatter.mode;
32
- return mode === "extend" || mode === "override" ? mode : null;
33
- }
34
- catch {
35
- return null;
36
- }
37
- }
38
- function collectLocalSkillDocs(rootPath, directories) {
39
- return collectLocalSkillDocsRelativeTo(rootPath, rootPath, directories);
40
- }
41
- function collectLocalSkillDocsRelativeTo(rootPath, relativeToPath, directories) {
42
- const docs = new Map();
43
- const workflowRoot = workflowPackagePathForCompiled(rootPath);
44
- const rootReadme = join(workflowRoot, "README.md");
45
- if (existsSync(rootReadme)) {
46
- const read = projectWorkflowReadPath(rootPath, relativeToPath, rootReadme);
47
- docs.set(read, {
48
- read,
49
- absolutePath: rootReadme,
50
- mode: readLocalInstructionMode(rootReadme),
51
- });
52
- }
53
- for (const directory of directories) {
54
- const absoluteDirectory = resolveAuthoringDirectory(rootPath, directory);
55
- for (const filePath of listFilesRecursive(absoluteDirectory, isMarkdownFile)) {
56
- const read = projectWorkflowReadPath(rootPath, relativeToPath, filePath);
57
- docs.set(read, {
58
- read,
59
- absolutePath: filePath,
60
- mode: readLocalInstructionMode(filePath),
61
- });
62
- }
63
- }
64
- return Array.from(docs.values())
65
- .sort((a, b) => a.read.localeCompare(b.read))
66
- .slice(0, LOCAL_SKILL_READ_LIMIT);
67
- }
68
- function resolveAuthoringDirectory(rootPath, directory) {
69
- if (directory === "workflow") {
70
- return workflowPackagePathForCompiled(rootPath);
71
- }
72
- if (directory.startsWith(`workflow${sep}`) || directory.startsWith("workflow/")) {
73
- const relativeWorkflowPath = directory.replace(/^workflow[\\/]/, "");
74
- return join(workflowPackagePathForCompiled(rootPath), relativeWorkflowPath);
75
- }
76
- return join(rootPath, directory);
77
- }
78
- function projectWorkflowReadPath(rootPath, relativeToPath, absolutePath) {
79
- const workflowRoot = workflowPackagePathForCompiled(rootPath);
80
- const normalizedWorkflowRoot = `${workflowRoot}${sep}`;
81
- if (absolutePath === workflowRoot || absolutePath.startsWith(normalizedWorkflowRoot)) {
82
- const relativeWorkflowPath = relative(workflowRoot, absolutePath);
83
- return relative(relativeToPath, join(rootPath, "workflow", relativeWorkflowPath));
84
- }
85
- return relative(relativeToPath, absolutePath);
86
- }
87
- export function buildLocalSkillContractExtension(rootPath, directories, purpose) {
88
- const docs = collectLocalSkillDocs(rootPath, directories);
89
- return buildContractExtensionFromDocs(docs, directories, purpose);
90
- }
91
- export function buildLocalSkillContractExtensionRelativeTo(rootPath, relativeToPath, directories, purpose) {
92
- const docs = collectLocalSkillDocsRelativeTo(rootPath, relativeToPath, directories);
93
- return buildContractExtensionFromDocs(docs, directories, purpose);
94
- }
95
- function buildContractExtensionFromDocs(docs, directories, purpose) {
96
- const reads = docs.map((doc) => doc.read);
97
- const modeSources = docs.filter((doc) => doc.mode !== null).map((doc) => doc.read);
98
- const localMode = docs.some((doc) => doc.mode === "override")
99
- ? "override"
100
- : docs.some((doc) => doc.mode === "extend")
101
- ? "extend"
102
- : null;
103
- if (docs.length === 0) {
104
- return emptyLocalSkillContractExtension();
105
- }
106
- const readNotice = directories.length > 0
107
- ? `Read any local instruction docs listed under ${directories.join(", ")} before executing the core stage.`
108
- : "Read any local instruction docs listed by the stage contract before executing the core stage.";
109
- return {
110
- reads,
111
- count: reads.length,
112
- notes: [
113
- readNotice,
114
- localMode === "override"
115
- ? `${purpose} One or more local docs declare \`mode: override\`, so their workflow instructions replace Interf's bundled stage instructions for this run. They still do not bypass coverage proof, evidence weighting, required writes, or deterministic runtime reconciliation.`
116
- : `${purpose} These local workflow docs can refine the stage, but they do not bypass coverage proof, evidence weighting, required writes, or deterministic runtime reconciliation.`,
117
- ],
118
- localMode,
119
- effectiveMode: localMode ?? "builtin",
120
- modeSources,
121
- };
122
- }
123
- export function mergeLocalSkillContractExtensions(extensions) {
124
- const reads = Array.from(new Set(extensions.flatMap((extension) => extension.reads)));
125
- const notes = Array.from(new Set(extensions.flatMap((extension) => extension.notes)));
126
- const modeSources = Array.from(new Set(extensions.flatMap((extension) => extension.modeSources)));
127
- const localMode = extensions.some((extension) => extension.localMode === "override")
128
- ? "override"
129
- : extensions.some((extension) => extension.localMode === "extend")
130
- ? "extend"
131
- : null;
132
- return {
133
- reads,
134
- count: reads.length,
135
- notes,
136
- localMode,
137
- effectiveMode: localMode ?? "builtin",
138
- modeSources,
139
- };
140
- }
141
- export function buildStageInstructions(stageSkillDir, localSkills) {
142
- return {
143
- stage_skill_dir: stageSkillDir,
144
- effective_mode: localSkills.effectiveMode,
145
- local_mode: localSkills.localMode,
146
- local_docs: localSkills.reads,
147
- mode_sources: localSkills.modeSources,
148
- };
149
- }
150
- export function reportLine(reporter, message) {
151
- reporter?.line?.(message);
152
- }
153
- export function reportBlankLine(reporter) {
154
- reporter?.blankLine?.();
155
- }
156
- export function reportValidationFailure(reporter, summary, errors = []) {
157
- reportLine(reporter, summary);
158
- for (const error of errors) {
159
- reportLine(reporter, `- ${error}`);
160
- }
161
- }
162
- export function resolveStageAcceptance(workflowId, stageId, sourcePath) {
163
- return getCompiledWorkflow(workflowId, { sourcePath }).stages.find((stage) => stage.id === stageId)?.acceptance;
164
- }
165
- export function validateStageOutcome(_dirPath, validation) {
166
- return validation;
167
- }
1
+ export * from "../packages/workflow-package/workflow-helpers.js";
@@ -1,22 +1 @@
1
- import type { WorkflowExecutor } from "./executors.js";
2
- import { type WorkflowValidationResult } from "./local-workflows.js";
3
- import type { SourceDatasetConfig, WorkflowImprovementLoopSummary } from "./schema.js";
4
- export interface WorkflowImprovementRunResult {
5
- status: "updated" | "no-change" | "invalid" | "executor-failed";
6
- changed: boolean;
7
- validation: WorkflowValidationResult | null;
8
- summary: string;
9
- shellPath: string;
10
- loopRootPath: string;
11
- }
12
- export declare function runWorkflowImprovementLoop(options: {
13
- executor: WorkflowExecutor;
14
- compiledPath: string;
15
- workflowId: string;
16
- compiledConfig: Pick<SourceDatasetConfig, "checks">;
17
- runId: string;
18
- loopIndex: number;
19
- maxLoops: number;
20
- maxAttempts: number;
21
- previousVariations: WorkflowImprovementLoopSummary[];
22
- }): Promise<WorkflowImprovementRunResult>;
1
+ export * from "../packages/workflow-authoring/workflow-improvement.js";
@@ -1,396 +1 @@
1
- import { appendFileSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
2
- import { join, relative } from "node:path";
3
- import { createWorkflowImprovementShell, freezeWorkflowImprovementShell, } from "./agent-shells.js";
4
- import { readInterfConfig } from "./interf.js";
5
- import { validateWorkflowPackage } from "./local-workflows.js";
6
- import { readJsonFileWithSchema } from "./parse.js";
7
- import { saveCompiledInterfConfig } from "./source-config.js";
8
- import { WorkflowImprovementRunLedgerSchema, } from "./schema.js";
9
- import { resolveWorkflowImprovementReviewPaths } from "./workflow-review-paths.js";
10
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, workflowImprovementRunRoot, workflowPackagePathForCompiled, } from "./compiled-paths.js";
11
- function copyDirectory(sourcePath, targetPath) {
12
- rmSync(targetPath, { recursive: true, force: true });
13
- mkdirSync(targetPath, { recursive: true });
14
- cpSync(sourcePath, targetPath, { recursive: true });
15
- }
16
- function listFileSnapshot(dirPath) {
17
- const snapshot = new Map();
18
- if (!existsSync(dirPath))
19
- return snapshot;
20
- const collect = (currentPath) => {
21
- for (const entry of readdirSync(currentPath)) {
22
- const fullPath = join(currentPath, entry);
23
- const stat = statSync(fullPath);
24
- if (stat.isDirectory()) {
25
- collect(fullPath);
26
- continue;
27
- }
28
- if (!stat.isFile())
29
- continue;
30
- snapshot.set(relative(dirPath, fullPath), readFileSync(fullPath, "utf8"));
31
- }
32
- };
33
- collect(dirPath);
34
- return snapshot;
35
- }
36
- function directoriesMatch(leftPath, rightPath) {
37
- const left = listFileSnapshot(leftPath);
38
- const right = listFileSnapshot(rightPath);
39
- if (left.size !== right.size)
40
- return false;
41
- for (const [relativePath, content] of left.entries()) {
42
- if (right.get(relativePath) !== content) {
43
- return false;
44
- }
45
- }
46
- return true;
47
- }
48
- function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
49
- if (!absolutePath)
50
- return null;
51
- const normalizedSourceRoot = `${sourceRoot}/`;
52
- if (absolutePath !== sourceRoot && !absolutePath.startsWith(normalizedSourceRoot)) {
53
- return null;
54
- }
55
- const relativePath = relative(sourceRoot, absolutePath);
56
- return join(shellRoot, relativePath);
57
- }
58
- function mapLoopSummaryForShell(summary, compiledPath) {
59
- const shellTestRunsRoot = "artifacts/test-runs";
60
- const shellTestSandboxesRoot = "artifacts/test-sandboxes";
61
- return {
62
- ...summary,
63
- test_run_path: toShellArtifactPath(summary.test_run_path, targetTestRunsRootForCompiled(compiledPath), shellTestRunsRoot) ?? summary.test_run_path ?? null,
64
- test_sandbox_path: toShellArtifactPath(summary.test_sandbox_path, targetTestSandboxesRootForCompiled(compiledPath), shellTestSandboxesRoot) ?? summary.test_sandbox_path ?? null,
65
- };
66
- }
67
- function buildLoopContext(options) {
68
- const previousVariations = options.previousVariations.map((summary) => mapLoopSummaryForShell(summary, options.compiledPath));
69
- const latestFailure = previousVariations.at(-1) ?? null;
70
- return {
71
- kind: "interf-workflow-improvement-loop",
72
- version: 1,
73
- generated_at: new Date().toISOString(),
74
- target_name: readInterfConfig(options.compiledPath)?.name ?? "compiled",
75
- workflow_id: options.workflowId,
76
- loop_index: options.loopIndex,
77
- max_loops: options.maxLoops,
78
- max_attempts: options.maxAttempts,
79
- review_paths: resolveWorkflowImprovementReviewPaths(options.compiledPath),
80
- truth_checks: {
81
- count: options.compiledConfig.checks.length,
82
- questions: options.compiledConfig.checks.map((check, index) => ({
83
- id: check.id ?? `check-${index + 1}`,
84
- question: check.question,
85
- })),
86
- },
87
- previous_variations: previousVariations,
88
- latest_failure: latestFailure,
89
- };
90
- }
91
- function buildWorkflowImprovementPrompt() {
92
- return [
93
- "This is an automated Interf Compiler workflow-improvement run, not an open-ended chat session.",
94
- "The user already invoked this through `interf compile` with self-improving loops enabled. Execute it now.",
95
- "Read `runtime/loop-context.json` first.",
96
- "Then read `workflow/README.md`, `workflow/workflow.json`, `workflow/compiled.schema.json`, and `workflow/improve/SKILL.md` if it exists.",
97
- "Review preserved evidence from earlier failures under `artifacts/` before you edit the workflow.",
98
- "Treat `workflow/improve/SKILL.md` as guidance for how to improve the workflow, not as the default file to edit.",
99
- "Prefer editing the stage docs, workflow contract, or schema ownership that actually change compiled outputs.",
100
- "Edit only files under `workflow/`.",
101
- "Do not edit truth checks, test specs, raw dataset files, or generated compiled outputs.",
102
- "Keep the workflow valid for the current compiler API and compiled schema.",
103
- "Prefer small, defensible changes to workflow docs, stage docs, stage policies, or schema ownership over random churn.",
104
- "Do not narrate plans or ask follow-up questions.",
105
- "Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
106
- "As soon as the workflow edits are complete, stop.",
107
- ].join("\n");
108
- }
109
- function updateCompiledWorkflowOrigin(options) {
110
- const current = readInterfConfig(options.compiledPath);
111
- if (!current)
112
- return;
113
- const nextConfig = {
114
- ...current,
115
- workflow: current.workflow ?? options.selectedWorkflowId,
116
- workflow_origin: {
117
- selected: options.selectedWorkflowId,
118
- ...(options.localDraft ? { local_draft: true } : {}),
119
- },
120
- };
121
- saveCompiledInterfConfig(options.compiledPath, nextConfig);
122
- }
123
- function workflowImprovementRunLedgerPath(compiledPath, runId) {
124
- return join(workflowImprovementRunRoot(compiledPath, runId), "run.json");
125
- }
126
- function workflowImprovementLoopHistoryPath(compiledPath, runId) {
127
- return join(workflowImprovementRunRoot(compiledPath, runId), "loop-history.jsonl");
128
- }
129
- function workflowImprovementLoopRecordPath(loopRootPath) {
130
- return join(loopRootPath, "loop.json");
131
- }
132
- function readWorkflowImprovementRunLedger(compiledPath, runId) {
133
- const ledgerPath = workflowImprovementRunLedgerPath(compiledPath, runId);
134
- if (!existsSync(ledgerPath))
135
- return null;
136
- return readJsonFileWithSchema(ledgerPath, "workflow improvement run ledger", WorkflowImprovementRunLedgerSchema);
137
- }
138
- function writeWorkflowImprovementRunLedger(compiledPath, runId, record, options) {
139
- const runRoot = workflowImprovementRunRoot(compiledPath, runId);
140
- mkdirSync(runRoot, { recursive: true });
141
- const existing = readWorkflowImprovementRunLedger(compiledPath, runId);
142
- const generatedAt = existing?.generated_at ?? new Date().toISOString();
143
- const ledger = {
144
- kind: "interf-workflow-improvement-run",
145
- version: 1,
146
- generated_at: generatedAt,
147
- updated_at: new Date().toISOString(),
148
- run_id: runId,
149
- target_name: options.targetName,
150
- workflow_id: options.workflowId,
151
- max_loops: options.maxLoops,
152
- max_attempts: options.maxAttempts,
153
- loops: [...(existing?.loops ?? []), record],
154
- };
155
- writeFileSync(workflowImprovementRunLedgerPath(compiledPath, runId), `${JSON.stringify(ledger, null, 2)}\n`);
156
- writeFileSync(workflowImprovementLoopRecordPath(record.loop_root_path), `${JSON.stringify(record, null, 2)}\n`);
157
- appendFileSync(workflowImprovementLoopHistoryPath(compiledPath, runId), `${JSON.stringify(record)}\n`);
158
- }
159
- function buildWorkflowImprovementLoopRecord(options) {
160
- return {
161
- kind: "interf-workflow-improvement-loop-record",
162
- version: 1,
163
- recorded_at: new Date().toISOString(),
164
- run_id: options.runId,
165
- loop_index: options.loopIndex,
166
- target_name: options.targetName,
167
- workflow_id: options.workflowId,
168
- result: options.result,
169
- changed: options.changed,
170
- applied: options.result === "updated",
171
- summary: options.summary,
172
- shell_path: options.shellPath,
173
- loop_root_path: options.loopRootPath,
174
- context_path: join(options.shellPath, "runtime", "loop-context.json"),
175
- workflow_before_path: options.workflowBeforePath,
176
- workflow_after_path: options.workflowAfterPath,
177
- prompt_log_path: options.promptLogPath,
178
- event_log_path: options.eventLogPath,
179
- status_log_path: options.statusLogPath,
180
- preserved_shell_manifest_path: options.preservedShellManifestPath,
181
- validation: options.validation,
182
- };
183
- }
184
- export async function runWorkflowImprovementLoop(options) {
185
- const compiledName = readInterfConfig(options.compiledPath)?.name ?? "compiled";
186
- const context = buildLoopContext(options);
187
- const shell = createWorkflowImprovementShell({
188
- compiledPath: options.compiledPath,
189
- compiledName,
190
- workflowId: options.workflowId,
191
- runId: options.runId,
192
- loopIndex: options.loopIndex,
193
- context,
194
- });
195
- const workflowRoot = workflowPackagePathForCompiled(options.compiledPath);
196
- copyDirectory(workflowRoot, shell.workflowBeforePath);
197
- const prompt = buildWorkflowImprovementPrompt();
198
- writeFileSync(shell.promptLogPath, `${prompt}\n`);
199
- let code = 1;
200
- let executeError = null;
201
- try {
202
- code = await options.executor.execute(shell.rootPath, prompt, {
203
- eventLogPath: shell.eventLogPath,
204
- statusLogPath: shell.statusLogPath,
205
- });
206
- }
207
- catch (error) {
208
- executeError = error instanceof Error ? error.message : String(error);
209
- }
210
- copyDirectory(workflowRoot, shell.workflowAfterPath);
211
- const preservedShellManifestPath = freezeWorkflowImprovementShell(shell.rootPath);
212
- const changed = !directoriesMatch(shell.workflowBeforePath, shell.workflowAfterPath);
213
- if (executeError) {
214
- copyDirectory(shell.workflowBeforePath, workflowRoot);
215
- const summary = `Workflow improver failed before completing: ${executeError}`;
216
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
217
- targetName: compiledName,
218
- workflowId: options.workflowId,
219
- runId: options.runId,
220
- loopIndex: options.loopIndex,
221
- shellPath: shell.rootPath,
222
- loopRootPath: shell.loopRootPath,
223
- workflowBeforePath: shell.workflowBeforePath,
224
- workflowAfterPath: shell.workflowAfterPath,
225
- promptLogPath: shell.promptLogPath,
226
- eventLogPath: shell.eventLogPath,
227
- statusLogPath: shell.statusLogPath,
228
- preservedShellManifestPath,
229
- changed,
230
- validation: null,
231
- result: "executor-failed",
232
- summary,
233
- }), {
234
- targetName: compiledName,
235
- workflowId: options.workflowId,
236
- maxLoops: options.maxLoops,
237
- maxAttempts: options.maxAttempts,
238
- });
239
- return {
240
- status: "executor-failed",
241
- changed,
242
- validation: null,
243
- summary,
244
- shellPath: shell.rootPath,
245
- loopRootPath: shell.loopRootPath,
246
- };
247
- }
248
- if (code !== 0) {
249
- copyDirectory(shell.workflowBeforePath, workflowRoot);
250
- const summary = `Workflow improver exited with code ${code}.`;
251
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
252
- targetName: compiledName,
253
- workflowId: options.workflowId,
254
- runId: options.runId,
255
- loopIndex: options.loopIndex,
256
- shellPath: shell.rootPath,
257
- loopRootPath: shell.loopRootPath,
258
- workflowBeforePath: shell.workflowBeforePath,
259
- workflowAfterPath: shell.workflowAfterPath,
260
- promptLogPath: shell.promptLogPath,
261
- eventLogPath: shell.eventLogPath,
262
- statusLogPath: shell.statusLogPath,
263
- preservedShellManifestPath,
264
- changed,
265
- validation: null,
266
- result: "executor-failed",
267
- summary,
268
- }), {
269
- targetName: compiledName,
270
- workflowId: options.workflowId,
271
- maxLoops: options.maxLoops,
272
- maxAttempts: options.maxAttempts,
273
- });
274
- return {
275
- status: "executor-failed",
276
- changed,
277
- validation: null,
278
- summary,
279
- shellPath: shell.rootPath,
280
- loopRootPath: shell.loopRootPath,
281
- };
282
- }
283
- if (!changed) {
284
- const validation = validateWorkflowPackage(workflowRoot);
285
- const result = validation.ok ? "no-change" : "invalid";
286
- if (!validation.ok) {
287
- copyDirectory(shell.workflowBeforePath, workflowRoot);
288
- }
289
- const summary = validation.ok
290
- ? "Workflow improver made no workflow edits."
291
- : `Workflow variation is invalid without any workflow edits: ${validation.summary}`;
292
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
293
- targetName: compiledName,
294
- workflowId: options.workflowId,
295
- runId: options.runId,
296
- loopIndex: options.loopIndex,
297
- shellPath: shell.rootPath,
298
- loopRootPath: shell.loopRootPath,
299
- workflowBeforePath: shell.workflowBeforePath,
300
- workflowAfterPath: shell.workflowAfterPath,
301
- promptLogPath: shell.promptLogPath,
302
- eventLogPath: shell.eventLogPath,
303
- statusLogPath: shell.statusLogPath,
304
- preservedShellManifestPath,
305
- changed: false,
306
- validation,
307
- result,
308
- summary,
309
- }), {
310
- targetName: compiledName,
311
- workflowId: options.workflowId,
312
- maxLoops: options.maxLoops,
313
- maxAttempts: options.maxAttempts,
314
- });
315
- return {
316
- status: result,
317
- changed: false,
318
- validation,
319
- summary,
320
- shellPath: shell.rootPath,
321
- loopRootPath: shell.loopRootPath,
322
- };
323
- }
324
- const validation = validateWorkflowPackage(workflowRoot);
325
- if (!validation.ok) {
326
- copyDirectory(shell.workflowBeforePath, workflowRoot);
327
- const summary = `Workflow variation failed validation: ${validation.summary}`;
328
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
329
- targetName: compiledName,
330
- workflowId: options.workflowId,
331
- runId: options.runId,
332
- loopIndex: options.loopIndex,
333
- shellPath: shell.rootPath,
334
- loopRootPath: shell.loopRootPath,
335
- workflowBeforePath: shell.workflowBeforePath,
336
- workflowAfterPath: shell.workflowAfterPath,
337
- promptLogPath: shell.promptLogPath,
338
- eventLogPath: shell.eventLogPath,
339
- statusLogPath: shell.statusLogPath,
340
- preservedShellManifestPath,
341
- changed: true,
342
- validation,
343
- result: "invalid",
344
- summary,
345
- }), {
346
- targetName: compiledName,
347
- workflowId: options.workflowId,
348
- maxLoops: options.maxLoops,
349
- maxAttempts: options.maxAttempts,
350
- });
351
- return {
352
- status: "invalid",
353
- changed: true,
354
- validation,
355
- summary,
356
- shellPath: shell.rootPath,
357
- loopRootPath: shell.loopRootPath,
358
- };
359
- }
360
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
361
- targetName: compiledName,
362
- workflowId: options.workflowId,
363
- runId: options.runId,
364
- loopIndex: options.loopIndex,
365
- shellPath: shell.rootPath,
366
- loopRootPath: shell.loopRootPath,
367
- workflowBeforePath: shell.workflowBeforePath,
368
- workflowAfterPath: shell.workflowAfterPath,
369
- promptLogPath: shell.promptLogPath,
370
- eventLogPath: shell.eventLogPath,
371
- statusLogPath: shell.statusLogPath,
372
- preservedShellManifestPath,
373
- changed: true,
374
- validation,
375
- result: "updated",
376
- summary: "Workflow variation updated and validated.",
377
- }), {
378
- targetName: compiledName,
379
- workflowId: options.workflowId,
380
- maxLoops: options.maxLoops,
381
- maxAttempts: options.maxAttempts,
382
- });
383
- updateCompiledWorkflowOrigin({
384
- compiledPath: options.compiledPath,
385
- selectedWorkflowId: options.workflowId,
386
- localDraft: true,
387
- });
388
- return {
389
- status: "updated",
390
- changed: true,
391
- validation,
392
- summary: "Workflow variation updated and validated.",
393
- shellPath: shell.rootPath,
394
- loopRootPath: shell.loopRootPath,
395
- };
396
- }
1
+ export * from "../packages/workflow-authoring/workflow-improvement.js";
@@ -1,2 +1 @@
1
- export declare const COMPILED_ZONE_KINDS: readonly ["directory", "file", "runtime"];
2
- export type CompiledZoneKind = typeof COMPILED_ZONE_KINDS[number];
1
+ export * from "../packages/compiler/workflow-primitives.js";
@@ -1,5 +1 @@
1
- export const COMPILED_ZONE_KINDS = [
2
- "directory",
3
- "file",
4
- "runtime",
5
- ];
1
+ export * from "../packages/compiler/workflow-primitives.js";
@@ -1,10 +1 @@
1
- import type { WorkflowImprovementContext } from "./schema.js";
2
- export interface WorkflowImprovementReviewSourcePaths {
3
- compiledRuntime: string | null;
4
- testComparisons: string | null;
5
- executionShells: string | null;
6
- targetTestRuns: string | null;
7
- targetTestSandboxes: string | null;
8
- }
9
- export declare function resolveWorkflowImprovementReviewSourcePaths(compiledPath: string): WorkflowImprovementReviewSourcePaths;
10
- export declare function resolveWorkflowImprovementReviewPaths(compiledPath: string): WorkflowImprovementContext["review_paths"];
1
+ export * from "../packages/workflow-package/workflow-review-paths.js";
@@ -1,27 +1 @@
1
- import { existsSync } from "node:fs";
2
- import { testRootForCompiled, targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, stageExecutionShellsRoot, compiledRuntimeRoot, } from "./compiled-paths.js";
3
- export function resolveWorkflowImprovementReviewSourcePaths(compiledPath) {
4
- const compiledRuntime = compiledRuntimeRoot(compiledPath);
5
- const testComparisons = testRootForCompiled(compiledPath);
6
- const executionShells = stageExecutionShellsRoot(compiledPath);
7
- const targetTestRuns = targetTestRunsRootForCompiled(compiledPath);
8
- const targetTestSandboxes = targetTestSandboxesRootForCompiled(compiledPath);
9
- return {
10
- compiledRuntime: existsSync(compiledRuntime) ? compiledRuntime : null,
11
- testComparisons: existsSync(testComparisons) ? testComparisons : null,
12
- executionShells: existsSync(executionShells) ? executionShells : null,
13
- targetTestRuns: existsSync(targetTestRuns) ? targetTestRuns : null,
14
- targetTestSandboxes: existsSync(targetTestSandboxes) ? targetTestSandboxes : null,
15
- };
16
- }
17
- export function resolveWorkflowImprovementReviewPaths(compiledPath) {
18
- const sources = resolveWorkflowImprovementReviewSourcePaths(compiledPath);
19
- return {
20
- workflow_root: "workflow",
21
- compiled_runtime: sources.compiledRuntime ? "artifacts/compiled-runtime" : null,
22
- test_comparisons: sources.testComparisons ? "artifacts/test-comparisons" : null,
23
- execution_shells: sources.executionShells ? "artifacts/execution-shells" : null,
24
- test_runs: sources.targetTestRuns ? "artifacts/test-runs" : null,
25
- test_sandboxes: sources.targetTestSandboxes ? "artifacts/test-sandboxes" : null,
26
- };
27
- }
1
+ export * from "../packages/workflow-package/workflow-review-paths.js";
@@ -0,0 +1 @@
1
+ export * from "../packages/workflow-package/workflow-stage-policy.js";
@@ -0,0 +1 @@
1
+ export * from "../packages/workflow-package/workflow-stage-policy.js";