@interf/compiler 0.6.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 (341) hide show
  1. package/README.md +94 -74
  2. package/builtin-workflows/interf/README.md +5 -5
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
  4. package/builtin-workflows/interf/improve/SKILL.md +2 -2
  5. package/builtin-workflows/interf/use/query/SKILL.md +1 -1
  6. package/builtin-workflows/interf/workflow.json +6 -6
  7. package/builtin-workflows/interf/workflow.schema.json +1 -1
  8. package/dist/bin.js +2 -28
  9. package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
  10. package/dist/{commands → cli/commands}/check-draft.js +12 -12
  11. package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
  12. package/dist/{commands → cli/commands}/compile-controller.js +36 -34
  13. package/dist/{commands → cli/commands}/compile.d.ts +2 -2
  14. package/dist/{commands → cli/commands}/compile.js +15 -11
  15. package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
  16. package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
  17. package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +3 -3
  18. package/dist/{commands → cli/commands}/create-workflow-wizard.js +61 -34
  19. package/dist/{commands → cli/commands}/create.d.ts +1 -1
  20. package/dist/{commands → cli/commands}/create.js +15 -18
  21. package/dist/{commands → cli/commands}/dataset-selection.d.ts +1 -1
  22. package/dist/{commands → cli/commands}/default.js +3 -3
  23. package/dist/{commands → cli/commands}/doctor.js +5 -6
  24. package/dist/{commands → cli/commands}/executor-flow.d.ts +1 -1
  25. package/dist/{commands → cli/commands}/executor-flow.js +13 -16
  26. package/dist/{commands → cli/commands}/init.d.ts +4 -1
  27. package/dist/{commands → cli/commands}/init.js +157 -72
  28. package/dist/{commands → cli/commands}/list.js +5 -5
  29. package/dist/{commands → cli/commands}/reset.js +4 -4
  30. package/dist/{commands → cli/commands}/source-config-wizard.d.ts +8 -3
  31. package/dist/{commands → cli/commands}/source-config-wizard.js +161 -87
  32. package/dist/{commands → cli/commands}/status.js +20 -11
  33. package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
  34. package/dist/{commands → cli/commands}/test-flow.js +30 -26
  35. package/dist/cli/commands/test.d.ts +14 -0
  36. package/dist/{commands → cli/commands}/test.js +39 -23
  37. package/dist/{commands → cli/commands}/verify.js +4 -4
  38. package/dist/cli/index.d.ts +21 -0
  39. package/dist/cli/index.js +33 -0
  40. package/dist/index.d.ts +22 -11
  41. package/dist/index.js +15 -6
  42. package/dist/lib/agent-args.d.ts +1 -4
  43. package/dist/lib/agent-args.js +1 -52
  44. package/dist/lib/agent-constants.d.ts +1 -5
  45. package/dist/lib/agent-constants.js +1 -28
  46. package/dist/lib/agent-detection.d.ts +1 -7
  47. package/dist/lib/agent-detection.js +1 -65
  48. package/dist/lib/agent-execution.d.ts +1 -2
  49. package/dist/lib/agent-execution.js +1 -243
  50. package/dist/lib/agent-logs.d.ts +1 -2
  51. package/dist/lib/agent-logs.js +1 -17
  52. package/dist/lib/agent-preflight.d.ts +1 -7
  53. package/dist/lib/agent-preflight.js +1 -77
  54. package/dist/lib/agent-render.d.ts +1 -8
  55. package/dist/lib/agent-render.js +1 -218
  56. package/dist/lib/agent-shells.d.ts +1 -69
  57. package/dist/lib/agent-shells.js +1 -1021
  58. package/dist/lib/agent-status.d.ts +1 -3
  59. package/dist/lib/agent-status.js +1 -58
  60. package/dist/lib/agent-types.d.ts +1 -30
  61. package/dist/lib/agent-types.js +1 -1
  62. package/dist/lib/agents.d.ts +1 -6
  63. package/dist/lib/agents.js +1 -5
  64. package/dist/lib/builtin-compiled-workflow.d.ts +1 -38
  65. package/dist/lib/builtin-compiled-workflow.js +1 -94
  66. package/dist/lib/compiled-compile.d.ts +1 -48
  67. package/dist/lib/compiled-compile.js +1 -255
  68. package/dist/lib/compiled-paths.d.ts +1 -40
  69. package/dist/lib/compiled-paths.js +3 -106
  70. package/dist/lib/compiled-raw.d.ts +1 -49
  71. package/dist/lib/compiled-raw.js +3 -102
  72. package/dist/lib/compiled-reset.d.ts +1 -2
  73. package/dist/lib/compiled-reset.js +3 -72
  74. package/dist/lib/compiled-schema.d.ts +1 -31
  75. package/dist/lib/compiled-schema.js +1 -141
  76. package/dist/lib/execution-profile.d.ts +1 -17
  77. package/dist/lib/execution-profile.js +1 -84
  78. package/dist/lib/executors.d.ts +1 -32
  79. package/dist/lib/executors.js +1 -43
  80. package/dist/lib/interf-bootstrap.d.ts +1 -3
  81. package/dist/lib/interf-bootstrap.js +3 -18
  82. package/dist/lib/interf-detect.d.ts +1 -33
  83. package/dist/lib/interf-detect.js +3 -176
  84. package/dist/lib/interf-scaffold.d.ts +1 -2
  85. package/dist/lib/interf-scaffold.js +3 -114
  86. package/dist/lib/interf-workflow-package.d.ts +1 -25
  87. package/dist/lib/interf-workflow-package.js +1 -342
  88. package/dist/lib/interf.d.ts +1 -5
  89. package/dist/lib/interf.js +3 -4
  90. package/dist/lib/local-workflows.d.ts +1 -54
  91. package/dist/lib/local-workflows.js +1 -422
  92. package/dist/lib/package-root.d.ts +1 -0
  93. package/dist/lib/package-root.js +1 -0
  94. package/dist/lib/project-paths.d.ts +1 -11
  95. package/dist/lib/project-paths.js +3 -32
  96. package/dist/lib/runtime-acceptance.d.ts +1 -9
  97. package/dist/lib/runtime-acceptance.js +1 -269
  98. package/dist/lib/runtime-contracts.d.ts +1 -2
  99. package/dist/lib/runtime-contracts.js +1 -48
  100. package/dist/lib/runtime-inventory.d.ts +1 -7
  101. package/dist/lib/runtime-inventory.js +1 -29
  102. package/dist/lib/runtime-paths.d.ts +1 -8
  103. package/dist/lib/runtime-paths.js +1 -26
  104. package/dist/lib/runtime-prompt.d.ts +1 -2
  105. package/dist/lib/runtime-prompt.js +1 -48
  106. package/dist/lib/runtime-reconcile.d.ts +1 -2
  107. package/dist/lib/runtime-reconcile.js +1 -193
  108. package/dist/lib/runtime-runs.d.ts +1 -11
  109. package/dist/lib/runtime-runs.js +1 -262
  110. package/dist/lib/runtime-types.d.ts +1 -43
  111. package/dist/lib/runtime-types.js +1 -1
  112. package/dist/lib/runtime.d.ts +1 -6
  113. package/dist/lib/runtime.js +1 -5
  114. package/dist/lib/schema.d.ts +4 -1073
  115. package/dist/lib/schema.js +6 -542
  116. package/dist/lib/source-config.d.ts +1 -39
  117. package/dist/lib/source-config.js +3 -293
  118. package/dist/lib/state-artifacts.d.ts +1 -8
  119. package/dist/lib/state-artifacts.js +1 -13
  120. package/dist/lib/state-health.d.ts +1 -4
  121. package/dist/lib/state-health.js +1 -132
  122. package/dist/lib/state-io.d.ts +1 -10
  123. package/dist/lib/state-io.js +1 -76
  124. package/dist/lib/state-paths.d.ts +1 -4
  125. package/dist/lib/state-paths.js +1 -13
  126. package/dist/lib/state-view.d.ts +1 -4
  127. package/dist/lib/state-view.js +1 -103
  128. package/dist/lib/state.d.ts +1 -7
  129. package/dist/lib/state.js +1 -12
  130. package/dist/lib/test-execution.d.ts +1 -14
  131. package/dist/lib/test-execution.js +3 -525
  132. package/dist/lib/test-matrices.d.ts +1 -90
  133. package/dist/lib/test-matrices.js +3 -96
  134. package/dist/lib/test-paths.d.ts +1 -12
  135. package/dist/lib/test-paths.js +3 -59
  136. package/dist/lib/test-profile-presets.d.ts +1 -57
  137. package/dist/lib/test-profile-presets.js +3 -50
  138. package/dist/lib/test-sandbox.d.ts +1 -11
  139. package/dist/lib/test-sandbox.js +3 -105
  140. package/dist/lib/test-specs.d.ts +1 -7
  141. package/dist/lib/test-specs.js +3 -114
  142. package/dist/lib/test-targets.d.ts +1 -5
  143. package/dist/lib/test-targets.js +3 -38
  144. package/dist/lib/test-types.d.ts +1 -17
  145. package/dist/lib/test-types.js +3 -1
  146. package/dist/lib/test.d.ts +1 -4
  147. package/dist/lib/test.js +3 -3
  148. package/dist/lib/validate-compiled.d.ts +1 -27
  149. package/dist/lib/validate-compiled.js +1 -241
  150. package/dist/lib/validate-helpers.d.ts +1 -12
  151. package/dist/lib/validate-helpers.js +1 -41
  152. package/dist/lib/validate.d.ts +1 -21
  153. package/dist/lib/validate.js +1 -249
  154. package/dist/lib/workflow-authoring.d.ts +1 -26
  155. package/dist/lib/workflow-authoring.js +1 -119
  156. package/dist/lib/workflow-definitions.d.ts +1 -78
  157. package/dist/lib/workflow-definitions.js +1 -203
  158. package/dist/lib/workflow-edit-session.d.ts +1 -16
  159. package/dist/lib/workflow-edit-session.js +1 -57
  160. package/dist/lib/workflow-edit-utils.d.ts +1 -10
  161. package/dist/lib/workflow-edit-utils.js +1 -39
  162. package/dist/lib/workflow-helpers.d.ts +1 -38
  163. package/dist/lib/workflow-helpers.js +1 -167
  164. package/dist/lib/workflow-improvement.d.ts +1 -22
  165. package/dist/lib/workflow-improvement.js +1 -209
  166. package/dist/lib/workflow-primitives.d.ts +1 -2
  167. package/dist/lib/workflow-primitives.js +1 -5
  168. package/dist/lib/workflow-review-paths.d.ts +1 -10
  169. package/dist/lib/workflow-review-paths.js +1 -27
  170. package/dist/lib/workflow-stage-policy.d.ts +1 -5
  171. package/dist/lib/workflow-stage-policy.js +1 -31
  172. package/dist/lib/workflow-stage-runner.d.ts +1 -41
  173. package/dist/lib/workflow-stage-runner.js +1 -109
  174. package/dist/lib/workflows.d.ts +1 -15
  175. package/dist/lib/workflows.js +1 -31
  176. package/dist/packages/agents/index.d.ts +17 -0
  177. package/dist/packages/agents/index.js +15 -0
  178. package/dist/packages/agents/lib/agents.d.ts +6 -0
  179. package/dist/packages/agents/lib/agents.js +5 -0
  180. package/dist/packages/agents/lib/args.d.ts +4 -0
  181. package/dist/packages/agents/lib/args.js +52 -0
  182. package/dist/packages/agents/lib/constants.d.ts +5 -0
  183. package/dist/packages/agents/lib/constants.js +28 -0
  184. package/dist/packages/agents/lib/detection.d.ts +7 -0
  185. package/dist/packages/agents/lib/detection.js +65 -0
  186. package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
  187. package/dist/packages/agents/lib/execution-profile.js +84 -0
  188. package/dist/packages/agents/lib/execution.d.ts +2 -0
  189. package/dist/packages/agents/lib/execution.js +243 -0
  190. package/dist/packages/agents/lib/executors.d.ts +32 -0
  191. package/dist/packages/agents/lib/executors.js +45 -0
  192. package/dist/packages/agents/lib/logs.d.ts +2 -0
  193. package/dist/packages/agents/lib/logs.js +17 -0
  194. package/dist/packages/agents/lib/preflight.d.ts +7 -0
  195. package/dist/packages/agents/lib/preflight.js +77 -0
  196. package/dist/packages/agents/lib/render.d.ts +8 -0
  197. package/dist/packages/agents/lib/render.js +218 -0
  198. package/dist/packages/agents/lib/schema.d.ts +8 -0
  199. package/dist/packages/agents/lib/schema.js +7 -0
  200. package/dist/packages/agents/lib/shells.d.ts +69 -0
  201. package/dist/packages/agents/lib/shells.js +1021 -0
  202. package/dist/packages/agents/lib/status.d.ts +3 -0
  203. package/dist/packages/agents/lib/status.js +58 -0
  204. package/dist/packages/agents/lib/types.d.ts +30 -0
  205. package/dist/packages/agents/lib/types.js +1 -0
  206. package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
  207. package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
  208. package/dist/packages/compiler/compiled-compile.d.ts +48 -0
  209. package/dist/packages/compiler/compiled-compile.js +256 -0
  210. package/dist/packages/compiler/compiled-schema.d.ts +31 -0
  211. package/dist/packages/compiler/compiled-schema.js +141 -0
  212. package/dist/packages/compiler/index.d.ts +24 -0
  213. package/dist/packages/compiler/index.js +23 -0
  214. package/dist/packages/compiler/lib/schema.d.ts +684 -0
  215. package/dist/packages/compiler/lib/schema.js +361 -0
  216. package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
  217. package/dist/packages/compiler/runtime-acceptance.js +269 -0
  218. package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
  219. package/dist/packages/compiler/runtime-contracts.js +48 -0
  220. package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
  221. package/dist/packages/compiler/runtime-inventory.js +29 -0
  222. package/dist/packages/compiler/runtime-paths.d.ts +8 -0
  223. package/dist/packages/compiler/runtime-paths.js +26 -0
  224. package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
  225. package/dist/packages/compiler/runtime-prompt.js +48 -0
  226. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
  227. package/dist/packages/compiler/runtime-reconcile.js +193 -0
  228. package/dist/packages/compiler/runtime-runs.d.ts +11 -0
  229. package/dist/packages/compiler/runtime-runs.js +262 -0
  230. package/dist/packages/compiler/runtime-types.d.ts +43 -0
  231. package/dist/packages/compiler/runtime-types.js +1 -0
  232. package/dist/packages/compiler/runtime.d.ts +6 -0
  233. package/dist/packages/compiler/runtime.js +5 -0
  234. package/dist/packages/compiler/state-artifacts.d.ts +8 -0
  235. package/dist/packages/compiler/state-artifacts.js +13 -0
  236. package/dist/packages/compiler/state-health.d.ts +4 -0
  237. package/dist/packages/compiler/state-health.js +132 -0
  238. package/dist/packages/compiler/state-io.d.ts +10 -0
  239. package/dist/packages/compiler/state-io.js +76 -0
  240. package/dist/packages/compiler/state-paths.d.ts +4 -0
  241. package/dist/packages/compiler/state-paths.js +13 -0
  242. package/dist/packages/compiler/state-view.d.ts +4 -0
  243. package/dist/packages/compiler/state-view.js +103 -0
  244. package/dist/packages/compiler/state.d.ts +7 -0
  245. package/dist/packages/compiler/state.js +12 -0
  246. package/dist/packages/compiler/validate-compiled.d.ts +27 -0
  247. package/dist/packages/compiler/validate-compiled.js +241 -0
  248. package/dist/packages/compiler/validate-helpers.d.ts +12 -0
  249. package/dist/packages/compiler/validate-helpers.js +41 -0
  250. package/dist/packages/compiler/validate.d.ts +21 -0
  251. package/dist/packages/compiler/validate.js +249 -0
  252. package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
  253. package/dist/packages/compiler/workflow-primitives.js +5 -0
  254. package/dist/packages/compiler/workflows.d.ts +15 -0
  255. package/dist/packages/compiler/workflows.js +31 -0
  256. package/dist/packages/project-model/compiled-paths.d.ts +40 -0
  257. package/dist/packages/project-model/compiled-paths.js +106 -0
  258. package/dist/packages/project-model/compiled-raw.d.ts +49 -0
  259. package/dist/packages/project-model/compiled-raw.js +102 -0
  260. package/dist/packages/project-model/compiled-reset.d.ts +2 -0
  261. package/dist/packages/project-model/compiled-reset.js +72 -0
  262. package/dist/packages/project-model/index.d.ts +11 -0
  263. package/dist/packages/project-model/index.js +10 -0
  264. package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
  265. package/dist/packages/project-model/interf-bootstrap.js +18 -0
  266. package/dist/packages/project-model/interf-detect.d.ts +33 -0
  267. package/dist/packages/project-model/interf-detect.js +176 -0
  268. package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
  269. package/dist/packages/project-model/interf-scaffold.js +124 -0
  270. package/dist/packages/project-model/interf.d.ts +5 -0
  271. package/dist/packages/project-model/interf.js +4 -0
  272. package/dist/packages/project-model/lib/schema.d.ts +125 -0
  273. package/dist/packages/project-model/lib/schema.js +62 -0
  274. package/dist/packages/project-model/project-paths.d.ts +11 -0
  275. package/dist/packages/project-model/project-paths.js +32 -0
  276. package/dist/packages/project-model/source-config.d.ts +38 -0
  277. package/dist/packages/project-model/source-config.js +297 -0
  278. package/dist/packages/testing/index.d.ts +13 -0
  279. package/dist/packages/testing/index.js +10 -0
  280. package/dist/packages/testing/lib/schema.d.ts +261 -0
  281. package/dist/packages/testing/lib/schema.js +119 -0
  282. package/dist/packages/testing/test-execution.d.ts +14 -0
  283. package/dist/packages/testing/test-execution.js +525 -0
  284. package/dist/packages/testing/test-matrices.d.ts +90 -0
  285. package/dist/packages/testing/test-matrices.js +96 -0
  286. package/dist/packages/testing/test-paths.d.ts +12 -0
  287. package/dist/packages/testing/test-paths.js +59 -0
  288. package/dist/packages/testing/test-profile-presets.d.ts +57 -0
  289. package/dist/packages/testing/test-profile-presets.js +50 -0
  290. package/dist/packages/testing/test-sandbox.d.ts +11 -0
  291. package/dist/packages/testing/test-sandbox.js +105 -0
  292. package/dist/packages/testing/test-specs.d.ts +7 -0
  293. package/dist/packages/testing/test-specs.js +114 -0
  294. package/dist/packages/testing/test-targets.d.ts +5 -0
  295. package/dist/packages/testing/test-targets.js +38 -0
  296. package/dist/packages/testing/test-types.d.ts +16 -0
  297. package/dist/packages/testing/test-types.js +1 -0
  298. package/dist/packages/testing/test.d.ts +4 -0
  299. package/dist/packages/testing/test.js +3 -0
  300. package/dist/packages/workflow-authoring/index.d.ts +4 -0
  301. package/dist/packages/workflow-authoring/index.js +4 -0
  302. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
  303. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
  304. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
  305. package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
  306. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
  307. package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
  308. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
  309. package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
  310. package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
  311. package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
  312. package/dist/packages/workflow-package/index.d.ts +9 -0
  313. package/dist/packages/workflow-package/index.js +9 -0
  314. package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
  315. package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
  316. package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
  317. package/dist/packages/workflow-package/lib/package-root.js +6 -0
  318. package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
  319. package/dist/packages/workflow-package/local-workflows.js +422 -0
  320. package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
  321. package/dist/packages/workflow-package/workflow-definitions.js +203 -0
  322. package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
  323. package/dist/packages/workflow-package/workflow-helpers.js +167 -0
  324. package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
  325. package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
  326. package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
  327. package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
  328. package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
  329. package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
  330. package/package.json +43 -19
  331. package/dist/commands/test.d.ts +0 -3
  332. package/dist/lib/compiled-home.d.ts +0 -5
  333. package/dist/lib/compiled-home.js +0 -32
  334. package/dist/lib/config.js +0 -9
  335. /package/dist/{commands → cli/commands}/dataset-selection.js +0 -0
  336. /package/dist/{commands → cli/commands}/default.d.ts +0 -0
  337. /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
  338. /package/dist/{commands → cli/commands}/list.d.ts +0 -0
  339. /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
  340. /package/dist/{commands → cli/commands}/status.d.ts +0 -0
  341. /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
@@ -1,293 +1,3 @@
1
- import { createHash } from "node:crypto";
2
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { join, relative, resolve, sep } from "node:path";
4
- import { readInterfConfig, refreshCompiledBootstrapGuidance, } from "./interf.js";
5
- import { seedCompiledWorkflowPackage } from "./interf-workflow-package.js";
6
- import { readJsonFileWithSchema } from "./parse.js";
7
- import { getCompiledWorkflow } from "./workflow-definitions.js";
8
- import { SourceFolderConfigSchema, } from "./schema.js";
9
- import { slugify } from "./util.js";
10
- import { assertPathWithinRoot } from "./util.js";
11
- import { defaultControlPathForCompiled, resolveSourceControlPathForCompiled, compiledInterfConfigPath, compiledInterfRoot, } from "./compiled-paths.js";
12
- export const SOURCE_FOLDER_CONFIG_FILE = "interf.json";
13
- function sourceConfigPath(sourcePath) {
14
- return join(sourcePath, SOURCE_FOLDER_CONFIG_FILE);
15
- }
16
- function normalizeTruthChecks(cases) {
17
- const seen = new Set();
18
- return cases.map((caseSpec, index) => {
19
- const baseId = slugify(caseSpec.id ?? caseSpec.question) || `check-${index + 1}`;
20
- let id = baseId;
21
- let suffix = 2;
22
- while (seen.has(id)) {
23
- id = `${baseId}-${suffix}`;
24
- suffix += 1;
25
- }
26
- seen.add(id);
27
- return {
28
- id,
29
- question: caseSpec.question.trim(),
30
- ...(caseSpec.answer ? { answer: caseSpec.answer.trim() } : {}),
31
- ...(caseSpec.strictness ? { strictness: caseSpec.strictness.trim() } : {}),
32
- ...(caseSpec.expect ? { expect: caseSpec.expect } : {}),
33
- };
34
- });
35
- }
36
- export function fingerprintTruthChecks(checks) {
37
- const normalized = checks.map((check) => ({
38
- question: check.question.trim(),
39
- ...(check.answer ? { answer: check.answer.trim() } : {}),
40
- ...(check.strictness ? { strictness: check.strictness.trim() } : {}),
41
- ...(check.expect ? { expect: check.expect } : {}),
42
- }));
43
- return createHash("sha256")
44
- .update(JSON.stringify(normalized))
45
- .digest("hex")
46
- .slice(0, 16);
47
- }
48
- export function loadSourceFolderConfig(sourcePath) {
49
- const filePath = sourceConfigPath(sourcePath);
50
- if (!existsSync(filePath))
51
- return null;
52
- return readJsonFileWithSchema(filePath, "Interf project config", SourceFolderConfigSchema);
53
- }
54
- export function listSourceDatasetConfigs(config) {
55
- return config?.datasets ?? [];
56
- }
57
- export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null) {
58
- const configured = override ?? datasetConfig.max_attempts ?? null;
59
- if (configured == null)
60
- return null;
61
- const normalized = Math.trunc(configured);
62
- if (!Number.isFinite(normalized) || normalized < 1)
63
- return 1;
64
- return Math.min(5, normalized);
65
- }
66
- export function resolveDatasetCompileMaxLoops(datasetConfig, override = null) {
67
- const configured = override ?? datasetConfig.max_loops ?? null;
68
- if (configured == null)
69
- return null;
70
- const normalized = Math.trunc(configured);
71
- if (!Number.isFinite(normalized) || normalized < 1)
72
- return 1;
73
- return Math.min(3, normalized);
74
- }
75
- export function getDefaultSourceDatasetConfig(config) {
76
- const datasets = listSourceDatasetConfigs(config);
77
- return datasets[0] ?? null;
78
- }
79
- export function findSourceDatasetConfig(config, datasetName) {
80
- return listSourceDatasetConfigs(config).find((dataset) => dataset.name === datasetName) ?? null;
81
- }
82
- function toWritableSourceProjectConfig(config) {
83
- const datasets = config?.datasets ?? [];
84
- if (datasets.length > 0) {
85
- return {
86
- datasets: datasets.map((dataset) => toWritableSourceDatasetConfig(dataset)),
87
- };
88
- }
89
- return {};
90
- }
91
- function toWritableSourceDatasetConfig(dataset) {
92
- return {
93
- name: dataset.name,
94
- ...(dataset.path && dataset.path !== "." ? { path: dataset.path } : {}),
95
- ...(dataset.about ? { about: dataset.about } : {}),
96
- ...(dataset.workflow && dataset.workflow !== "interf" ? { workflow: dataset.workflow } : {}),
97
- ...(typeof dataset.max_attempts === "number" ? { max_attempts: dataset.max_attempts } : {}),
98
- ...(typeof dataset.max_loops === "number" ? { max_loops: dataset.max_loops } : {}),
99
- checks: dataset.checks,
100
- };
101
- }
102
- export function saveSourceFolderConfig(sourcePath, config) {
103
- writeFileSync(sourceConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(config), null, 2) + "\n");
104
- }
105
- export function appendSourceDatasetChecks(sourcePath, datasetName, checks) {
106
- const existing = loadSourceFolderConfig(sourcePath);
107
- const currentDataset = findSourceDatasetConfig(existing, datasetName);
108
- const otherDatasets = listSourceDatasetConfigs(existing).filter((dataset) => dataset.name !== datasetName);
109
- const currentChecks = currentDataset?.checks ?? [];
110
- const nextDataset = {
111
- ...toWritableSourceDatasetConfig(currentDataset ?? {
112
- name: datasetName,
113
- path: ".",
114
- checks: [],
115
- }),
116
- checks: [...currentChecks, ...checks],
117
- };
118
- saveSourceFolderConfig(sourcePath, {
119
- datasets: [
120
- nextDataset,
121
- ...otherDatasets,
122
- ],
123
- });
124
- }
125
- export function upsertSourceDatasetConfig(sourcePath, datasetConfig, options = {}) {
126
- const existing = loadSourceFolderConfig(sourcePath);
127
- const datasets = listSourceDatasetConfigs(existing);
128
- const candidateNames = Array.from(new Set([datasetConfig.name, options.matchName].filter((value) => Boolean(value))));
129
- const existingIndex = datasets.findIndex((entry) => candidateNames.includes(entry.name));
130
- if (existingIndex >= 0) {
131
- datasets[existingIndex] = datasetConfig;
132
- }
133
- else {
134
- datasets.push(datasetConfig);
135
- }
136
- saveSourceFolderConfig(sourcePath, {
137
- datasets,
138
- });
139
- }
140
- export function compiledMaxAttempts(maxAttempts) {
141
- if (maxAttempts == null)
142
- return undefined;
143
- return resolveDatasetCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
144
- }
145
- export function compiledMaxLoops(maxLoops) {
146
- if (maxLoops == null)
147
- return undefined;
148
- return resolveDatasetCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
149
- }
150
- export function sourceDatasetConfigFromInterfConfig(config, datasetPath = ".") {
151
- return {
152
- name: config.name,
153
- path: datasetPath,
154
- ...(config.about ? { about: config.about } : {}),
155
- ...(config.workflow ? { workflow: config.workflow } : {}),
156
- ...(typeof config.max_attempts === "number"
157
- ? { max_attempts: config.max_attempts }
158
- : {}),
159
- ...(typeof config.max_loops === "number"
160
- ? { max_loops: config.max_loops }
161
- : {}),
162
- checks: config.checks ?? [],
163
- };
164
- }
165
- export function loadCompiledDatasetConfig(compiledPath) {
166
- const config = readInterfConfig(compiledPath);
167
- if (!config)
168
- return null;
169
- const projectPath = resolveSourceControlPathForCompiled(compiledPath);
170
- const datasetPath = typeof config.source?.dataset_path === "string" && config.source.dataset_path.length > 0
171
- ? relative(projectPath, assertPathWithinRoot(projectPath, resolve(compiledPath, config.source.dataset_path), "Compiled dataset source path")).split(sep).join("/") || "."
172
- : ".";
173
- return sourceDatasetConfigFromInterfConfig(config, datasetPath);
174
- }
175
- export function saveCompiledInterfConfig(compiledPath, config) {
176
- mkdirSync(compiledInterfRoot(compiledPath), { recursive: true });
177
- writeFileSync(compiledInterfConfigPath(compiledPath), JSON.stringify(config, null, 2) + "\n");
178
- return config;
179
- }
180
- export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, datasetConfig) {
181
- const current = readInterfConfig(compiledPath);
182
- const projectPath = resolveSourceControlPathForCompiled(compiledPath);
183
- const datasetAbsolutePath = resolve(projectPath, datasetConfig.path ?? ".");
184
- const datasetRelativePath = relative(compiledPath, datasetAbsolutePath).split(sep).join("/") || ".";
185
- const workflowId = datasetConfig.workflow ?? current?.workflow ?? "interf";
186
- const workflowChanged = current?.workflow !== undefined && current.workflow !== workflowId;
187
- const workflowOrigin = workflowChanged || !current?.workflow_origin
188
- ? {
189
- selected: workflowId,
190
- local_draft: false,
191
- }
192
- : current.workflow_origin;
193
- const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, workflow: _ignoredWorkflow, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, workflow_origin: _ignoredWorkflowOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
194
- const nextConfig = {
195
- ...passthrough,
196
- ...(!current ? {
197
- type: "compiled",
198
- source: {
199
- path: "./raw",
200
- },
201
- } : {}),
202
- type: "compiled",
203
- name: datasetConfig.name,
204
- ...(datasetConfig.about ? { about: datasetConfig.about } : {}),
205
- workflow: workflowId,
206
- ...(typeof datasetConfig.max_attempts === "number"
207
- ? { max_attempts: datasetConfig.max_attempts }
208
- : {}),
209
- ...(typeof datasetConfig.max_loops === "number"
210
- ? { max_loops: datasetConfig.max_loops }
211
- : {}),
212
- checks: datasetConfig.checks,
213
- workflow_origin: workflowOrigin,
214
- source: {
215
- path: current?.source?.path ?? "./raw",
216
- control_path: defaultControlPathForCompiled(compiledPath),
217
- dataset_path: datasetRelativePath,
218
- },
219
- };
220
- const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
221
- if (workflowChanged) {
222
- const sourcePath = projectPath;
223
- const selectedWorkflow = getCompiledWorkflow(workflowId, { sourcePath });
224
- seedCompiledWorkflowPackage({
225
- compiledPath,
226
- sourcePath,
227
- workflowId: selectedWorkflow.id,
228
- });
229
- }
230
- refreshCompiledBootstrapGuidance(compiledPath);
231
- return saved;
232
- }
233
- function buildLoadedTestSpec(options) {
234
- if (options.checks.length === 0)
235
- return null;
236
- const testId = options.id ?? slugify(options.name);
237
- return {
238
- id: options.targetType === "raw" ? `${testId}-raw` : testId,
239
- filePath: options.filePath,
240
- type: options.targetType,
241
- name: options.name,
242
- description: options.about ?? options.fallbackDescription,
243
- cases: normalizeTruthChecks(options.checks),
244
- };
245
- }
246
- export function buildTestSpecFromSourceFolderConfig(options) {
247
- const { sourcePath, targetName, targetType = "compiled" } = options;
248
- const config = loadSourceFolderConfig(sourcePath);
249
- if (!config)
250
- return null;
251
- const datasets = listSourceDatasetConfigs(config);
252
- if (datasets.length === 0)
253
- return null;
254
- const match = targetName
255
- ? datasets.find((entry) => entry.name === targetName)
256
- : datasets.length === 1
257
- ? datasets[0]
258
- : getDefaultSourceDatasetConfig(config);
259
- if (!match)
260
- return null;
261
- const configPath = sourceConfigPath(sourcePath);
262
- return buildLoadedTestSpec({
263
- id: match.id,
264
- name: match.name,
265
- about: match.about,
266
- checks: match.checks,
267
- targetType,
268
- filePath: targetType === "raw"
269
- ? `${configPath}#datasets/${match.name}:file-as-is`
270
- : `${configPath}#datasets/${match.name}:compiled`,
271
- fallbackDescription: `Derived from dataset truth checks in ${SOURCE_FOLDER_CONFIG_FILE}`,
272
- });
273
- }
274
- export function buildTestSpecFromCompiledDatasetConfig(options) {
275
- const { compiledPath, targetType = "compiled" } = options;
276
- const config = readInterfConfig(compiledPath);
277
- const configPath = compiledInterfConfigPath(compiledPath);
278
- if (!config)
279
- return null;
280
- return buildLoadedTestSpec({
281
- name: config.name,
282
- about: config.about,
283
- checks: config.checks ?? [],
284
- targetType,
285
- filePath: targetType === "raw"
286
- ? `${configPath}#checks:file-as-is`
287
- : `${configPath}#checks:compiled`,
288
- fallbackDescription: "Derived from compiled-dataset truth checks.",
289
- });
290
- }
291
- export function resolveSourceDatasetPath(projectPath, datasetConfig) {
292
- return assertPathWithinRoot(projectPath, resolve(projectPath, datasetConfig.path ?? "."), "Dataset path");
293
- }
1
+ // Compatibility shim for historical `src/lib/source-config.ts` imports.
2
+ // Source of truth: `src/packages/project-model/source-config.ts`.
3
+ export * from "../packages/project-model/source-config.js";
@@ -1,8 +1 @@
1
- import { type CompiledHealth, type CompiledRawSnapshot, type CompiledViewSpec } from "./schema.js";
2
- export declare function refreshCompiledArtifacts(dirPath: string, options?: {
3
- ensureViewSpec?: boolean;
4
- }): {
5
- health: CompiledHealth;
6
- viewSpec?: CompiledViewSpec;
7
- rawSnapshot: CompiledRawSnapshot;
8
- };
1
+ export * from "../packages/compiler/state-artifacts.js";
@@ -1,13 +1 @@
1
- import { saveCompiledHealth, } from "./state-io.js";
2
- import { computeCompiledHealth, } from "./state-health.js";
3
- import { ensureCompiledRawSnapshot, ensureCompiledViewSpec, } from "./state-view.js";
4
- export function refreshCompiledArtifacts(dirPath, options) {
5
- const health = computeCompiledHealth(dirPath);
6
- saveCompiledHealth(dirPath, health);
7
- const rawSnapshot = ensureCompiledRawSnapshot(dirPath);
8
- let viewSpec;
9
- if (options?.ensureViewSpec) {
10
- viewSpec = ensureCompiledViewSpec(dirPath);
11
- }
12
- return { health, viewSpec, rawSnapshot };
13
- }
1
+ export * from "../packages/compiler/state-artifacts.js";
@@ -1,4 +1 @@
1
- import { type CompiledHealth, type CompiledStage, type RuntimeStatus } from "./schema.js";
2
- export declare function computeCompiledHealth(dirPath: string): CompiledHealth;
3
- export declare function resolveCompiledStatus(..._args: unknown[]): RuntimeStatus;
4
- export declare function resolveCompiledStage(...args: unknown[]): CompiledStage;
1
+ export * from "../packages/compiler/state-health.js";
@@ -1,132 +1 @@
1
- import { basename, join } from "node:path";
2
- import { existsSync } from "node:fs";
3
- import { readInterfConfig, resolveSourceFolderPath, } from "./interf.js";
4
- import { discoverSourceFiles } from "./discovery.js";
5
- import { loadRuntimeRun } from "./runtime.js";
6
- import { loadState } from "./state-io.js";
7
- import { validateCompiled, validateCompiledStage, validateCompiledWorkflow, } from "./validate.js";
8
- import { readCompiledSchemaFile } from "./compiled-schema.js";
9
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
10
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig } from "./workflow-definitions.js";
11
- import { listFilesRecursive } from "./filesystem.js";
12
- function countZoneArtifacts(compiledPath, zonePath, kind) {
13
- const absolutePath = join(compiledPath, zonePath);
14
- if (!existsSync(absolutePath))
15
- return 0;
16
- if (kind === "file")
17
- return 1;
18
- return listFilesRecursive(absolutePath).length;
19
- }
20
- export function computeCompiledHealth(dirPath) {
21
- const now = new Date().toISOString();
22
- const config = readInterfConfig(dirPath);
23
- const targetName = config?.name ?? basename(dirPath);
24
- const sourcePath = config ? resolveSourceFolderPath(dirPath, config) : dirPath;
25
- const sourceTotal = config ? discoverSourceFiles(sourcePath, dirPath).totalCount : 0;
26
- const state = loadState(dirPath);
27
- const validation = validateCompiled(dirPath);
28
- const activeRun = loadRuntimeRun(dirPath);
29
- const workflowId = config
30
- ? resolveRequiredCompiledWorkflowFromConfig(config, `.interf/interf.json for ${dirPath}`)
31
- : null;
32
- let workflow = null;
33
- if (workflowId) {
34
- try {
35
- workflow = getActiveCompiledWorkflow(dirPath, workflowId);
36
- }
37
- catch {
38
- workflow = null;
39
- }
40
- }
41
- const stageResults = workflow?.stages.map((stage) => ({
42
- stage,
43
- validation: validateCompiledStage(dirPath, stage.id),
44
- })) ?? [];
45
- const completedStages = stageResults.filter((entry) => entry.validation.ok).length;
46
- const firstFailed = stageResults.find((entry) => !entry.validation.ok) ?? null;
47
- const workflowValidation = validateCompiledWorkflow(dirPath);
48
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
49
- const zoneMetrics = Object.fromEntries((schema?.zones ?? []).map((zone) => [
50
- `zone_${zone.id}`,
51
- countZoneArtifacts(dirPath, zone.path, zone.kind),
52
- ]));
53
- let status = "idle";
54
- let stage = "idle";
55
- let summary = "Idle — no source files have been compiled yet.";
56
- const errors = workflowValidation.errors.length;
57
- if (!validation.config_present || !validation.config_valid || !validation.config_type_match || !validation.workflow_valid || !validation.schema_valid) {
58
- status = "failed";
59
- stage = "failed";
60
- summary = workflowValidation.summary;
61
- }
62
- else if (activeRun?.status === "running") {
63
- status = "running";
64
- stage = activeRun.stage;
65
- summary = `Running — ${activeRun.stage_label} via ${activeRun.executor.display_name}. ${activeRun.summary}`;
66
- }
67
- else if (sourceTotal === 0 && completedStages === 0) {
68
- status = "idle";
69
- stage = "idle";
70
- summary = "Idle — no source files have been compiled yet.";
71
- }
72
- else if (activeRun?.status === "failed") {
73
- status = "failed";
74
- stage = activeRun.stage;
75
- summary = activeRun.error ?? activeRun.summary;
76
- }
77
- else if (workflowValidation.ok) {
78
- status = "compiled";
79
- stage = "compiled";
80
- summary = `Compiled — ${completedStages}/${workflow?.stages.length ?? 0} workflow stages satisfied.`;
81
- }
82
- else {
83
- status = "stale";
84
- stage = firstFailed?.stage.id ?? "compiled";
85
- summary = firstFailed?.validation.summary ?? workflowValidation.summary;
86
- }
87
- const checks = {
88
- ...validation,
89
- ...(workflow
90
- ? Object.fromEntries(workflow.stages.map((workflowStage) => [
91
- `stage_${workflowStage.id}_ok`,
92
- stageResults.find((entry) => entry.stage.id === workflowStage.id)?.validation.ok ?? false,
93
- ]))
94
- : {}),
95
- };
96
- return {
97
- kind: "compiled-health",
98
- version: 2,
99
- generated_at: now,
100
- target_name: targetName,
101
- status,
102
- stage,
103
- summary,
104
- metrics: {
105
- source_total: sourceTotal,
106
- stage_total: workflow?.stages.length ?? 0,
107
- completed_stages: completedStages,
108
- warnings: state?.warning_count ?? 0,
109
- errors: (state?.error_count ?? 0) + errors,
110
- ...zoneMetrics,
111
- },
112
- checks,
113
- };
114
- }
115
- export function resolveCompiledStatus(..._args) {
116
- const state = _args[_args.length - 1];
117
- if (state?.error_count && state.error_count > 0)
118
- return "failed";
119
- if (!state?.stages || Object.keys(state.stages).length === 0)
120
- return "idle";
121
- const allSucceeded = Object.values(state.stages).every((stage) => stage.status === "succeeded");
122
- return allSucceeded ? "compiled" : "stale";
123
- }
124
- export function resolveCompiledStage(...args) {
125
- const state = args[0];
126
- if (state?.error_count && state.error_count > 0)
127
- return "failed";
128
- if (!state?.stages || Object.keys(state.stages).length === 0)
129
- return "idle";
130
- const failedStage = Object.entries(state.stages).find(([, stage]) => stage.status !== "succeeded");
131
- return failedStage?.[0] ?? "compiled";
132
- }
1
+ export * from "../packages/compiler/state-health.js";
@@ -1,10 +1 @@
1
- import { type CompiledHealth, type CompiledRawSnapshot, type CompiledState, type CompiledViewSpec } from "./schema.js";
2
- export declare function loadState<T>(dirPath: string): T | null;
3
- export declare function saveState<T>(dirPath: string, state: T): void;
4
- export declare function loadCompiledHealth(dirPath: string): CompiledHealth | null;
5
- export declare function saveCompiledHealth(dirPath: string, health: CompiledHealth): void;
6
- export declare function loadCompiledViewSpec(dirPath: string): CompiledViewSpec | null;
7
- export declare function saveCompiledViewSpec(dirPath: string, viewSpec: CompiledViewSpec): void;
8
- export declare function loadCompiledRawSnapshot(dirPath: string): CompiledRawSnapshot | null;
9
- export declare function saveEmptyCompiledInventory(dirPath: string): void;
10
- export declare function initCompiledState(): CompiledState;
1
+ export * from "../packages/compiler/state-io.js";
@@ -1,76 +1 @@
1
- import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
2
- import { warnInterf } from "./logger.js";
3
- import { readJsonFileUnchecked, readJsonFileWithSchema } from "./parse.js";
4
- import { CompiledHealthSchema, CompiledRawSnapshotSchema, CompiledStateSchema, CompiledViewSpecSchema, } from "./schema.js";
5
- import { emptyCompiledInventory, } from "./runtime-inventory.js";
6
- import { healthPath, rawSnapshotPath, statePath, viewSpecPath } from "./state-paths.js";
7
- import { compiledRuntimeInventoryPath, compiledRuntimeRoot, } from "./compiled-paths.js";
8
- export function loadState(dirPath) {
9
- const path = statePath(dirPath);
10
- if (!existsSync(path))
11
- return null;
12
- const raw = readJsonFileUnchecked(path, "runtime state");
13
- if (raw === null)
14
- return null;
15
- const parsed = CompiledStateSchema.safeParse(raw);
16
- if (parsed.success) {
17
- return parsed.data;
18
- }
19
- warnInterf(`Warning: failed to validate runtime state at ${path}: ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
20
- return null;
21
- }
22
- export function saveState(dirPath, state) {
23
- mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
24
- writeFileSync(statePath(dirPath), JSON.stringify(state, null, 2) + "\n");
25
- }
26
- export function loadCompiledHealth(dirPath) {
27
- const path = healthPath(dirPath);
28
- if (!existsSync(path))
29
- return null;
30
- return readJsonFileWithSchema(path, "compiled health", CompiledHealthSchema);
31
- }
32
- export function saveCompiledHealth(dirPath, health) {
33
- mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
34
- writeFileSync(healthPath(dirPath), JSON.stringify(health, null, 2) + "\n");
35
- }
36
- export function loadCompiledViewSpec(dirPath) {
37
- const path = viewSpecPath(dirPath);
38
- if (!existsSync(path))
39
- return null;
40
- return loadViewSpec(path, CompiledViewSpecSchema);
41
- }
42
- export function saveCompiledViewSpec(dirPath, viewSpec) {
43
- mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
44
- writeFileSync(viewSpecPath(dirPath), JSON.stringify(viewSpec, null, 2) + "\n");
45
- }
46
- export function loadCompiledRawSnapshot(dirPath) {
47
- const path = rawSnapshotPath(dirPath);
48
- if (!existsSync(path))
49
- return null;
50
- return readJsonFileWithSchema(path, "compiled raw snapshot", CompiledRawSnapshotSchema);
51
- }
52
- export function saveEmptyCompiledInventory(dirPath) {
53
- mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
54
- writeFileSync(compiledRuntimeInventoryPath(dirPath), JSON.stringify(emptyCompiledInventory(), null, 2) + "\n");
55
- }
56
- export function initCompiledState() {
57
- return {
58
- version: 2,
59
- pending: [],
60
- stages: {},
61
- last_add: null,
62
- last_compile: null,
63
- warning_count: 0,
64
- error_count: 0,
65
- };
66
- }
67
- function loadViewSpec(filePath, schema) {
68
- try {
69
- const raw = JSON.parse(readFileSync(filePath, "utf8"));
70
- const parsed = schema.safeParse(raw);
71
- return parsed.success ? parsed.data ?? null : null;
72
- }
73
- catch {
74
- return null;
75
- }
76
- }
1
+ export * from "../packages/compiler/state-io.js";
@@ -1,4 +1 @@
1
- export declare function statePath(dirPath: string): string;
2
- export declare function healthPath(dirPath: string): string;
3
- export declare function viewSpecPath(dirPath: string): string;
4
- export declare function rawSnapshotPath(dirPath: string): string;
1
+ export * from "../packages/compiler/state-paths.js";
@@ -1,13 +1 @@
1
- import { compiledRawSnapshotMetadataPath, compiledRuntimeHealthPath, compiledRuntimeStatePath, compiledRuntimeViewSpecPath, } from "./compiled-paths.js";
2
- export function statePath(dirPath) {
3
- return compiledRuntimeStatePath(dirPath);
4
- }
5
- export function healthPath(dirPath) {
6
- return compiledRuntimeHealthPath(dirPath);
7
- }
8
- export function viewSpecPath(dirPath) {
9
- return compiledRuntimeViewSpecPath(dirPath);
10
- }
11
- export function rawSnapshotPath(dirPath) {
12
- return compiledRawSnapshotMetadataPath(dirPath);
13
- }
1
+ export * from "../packages/compiler/state-paths.js";
@@ -1,4 +1 @@
1
- import { type CompiledRawSnapshot, type CompiledViewSpec } from "./schema.js";
2
- export declare function ensureCompiledViewSpec(dirPath: string): CompiledViewSpec;
3
- export declare function ensureCompiledRawSnapshot(dirPath: string): CompiledRawSnapshot;
4
- export declare function normalizeCompiledViewSpec(existing: CompiledViewSpec, defaults?: CompiledViewSpec): CompiledViewSpec;
1
+ export * from "../packages/compiler/state-view.js";