@interf/compiler 0.9.1 → 0.9.4

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 (251) hide show
  1. package/README.md +9 -9
  2. package/agent-skills/interf-actions/SKILL.md +3 -0
  3. package/agent-skills/interf-actions/references/cli.md +13 -13
  4. package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
  5. package/builtin-methods/interf-default/improve/SKILL.md +18 -0
  6. package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
  7. package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
  8. package/dist/cli/commands/check-draft.d.ts +6 -6
  9. package/dist/cli/commands/check-draft.js +5 -5
  10. package/dist/cli/commands/compile-controller.d.ts +7 -7
  11. package/dist/cli/commands/compile-controller.js +35 -38
  12. package/dist/cli/commands/compile.d.ts +3 -3
  13. package/dist/cli/commands/compile.js +23 -21
  14. package/dist/cli/commands/compiled-flow.d.ts +11 -11
  15. package/dist/cli/commands/compiled-flow.js +33 -30
  16. package/dist/cli/commands/create-method-wizard.d.ts +76 -0
  17. package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
  18. package/dist/cli/commands/create.d.ts +3 -3
  19. package/dist/cli/commands/create.js +44 -45
  20. package/dist/cli/commands/default.js +1 -1
  21. package/dist/cli/commands/executor-flow.d.ts +6 -6
  22. package/dist/cli/commands/executor-flow.js +1 -1
  23. package/dist/cli/commands/init.d.ts +2 -2
  24. package/dist/cli/commands/init.js +139 -118
  25. package/dist/cli/commands/list.js +11 -10
  26. package/dist/cli/commands/preparation-selection.d.ts +3 -3
  27. package/dist/cli/commands/source-config-wizard.d.ts +9 -9
  28. package/dist/cli/commands/source-config-wizard.js +43 -43
  29. package/dist/cli/commands/status.js +36 -9
  30. package/dist/cli/commands/test-flow.d.ts +15 -15
  31. package/dist/cli/commands/test-flow.js +29 -219
  32. package/dist/cli/commands/test.d.ts +2 -2
  33. package/dist/cli/commands/test.js +50 -51
  34. package/dist/cli/commands/verify.js +7 -7
  35. package/dist/cli/commands/web.js +41 -28
  36. package/dist/compiler-ui/404.html +1 -0
  37. package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
  38. package/dist/compiler-ui/__next._full.txt +20 -0
  39. package/dist/compiler-ui/__next._head.txt +5 -0
  40. package/dist/compiler-ui/__next._index.txt +5 -0
  41. package/dist/compiler-ui/__next._tree.txt +5 -0
  42. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
  43. package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js} +15 -21
  44. package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +3 -0
  45. package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
  46. package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
  47. package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
  48. package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
  49. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
  50. package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
  51. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
  52. package/dist/compiler-ui/_not-found.html +1 -0
  53. package/dist/compiler-ui/_not-found.txt +15 -0
  54. package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
  55. package/dist/compiler-ui/index.txt +20 -0
  56. package/dist/index.d.ts +8 -6
  57. package/dist/index.js +5 -3
  58. package/dist/packages/agents/index.d.ts +1 -1
  59. package/dist/packages/agents/lib/args.d.ts +2 -2
  60. package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
  61. package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
  62. package/dist/packages/agents/lib/execution-profile.js +7 -6
  63. package/dist/packages/agents/lib/executors.d.ts +13 -13
  64. package/dist/packages/agents/lib/preflight.d.ts +1 -0
  65. package/dist/packages/agents/lib/preflight.js +32 -9
  66. package/dist/packages/agents/lib/shells.d.ts +25 -24
  67. package/dist/packages/agents/lib/shells.js +161 -154
  68. package/dist/packages/agents/lib/types.d.ts +2 -2
  69. package/dist/packages/compiler/artifact-counts.d.ts +1 -0
  70. package/dist/packages/compiler/artifact-counts.js +30 -0
  71. package/dist/packages/compiler/compiled-paths.d.ts +4 -7
  72. package/dist/packages/compiler/compiled-paths.js +9 -15
  73. package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
  74. package/dist/packages/compiler/compiled-pipeline.js +22 -22
  75. package/dist/packages/compiler/compiled-schema.d.ts +20 -20
  76. package/dist/packages/compiler/compiled-schema.js +29 -29
  77. package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
  78. package/dist/packages/compiler/compiled-stage-plan.js +8 -8
  79. package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
  80. package/dist/packages/compiler/compiled-stage-runner.js +7 -7
  81. package/dist/packages/compiler/compiled-target.d.ts +5 -5
  82. package/dist/packages/compiler/compiled-target.js +5 -5
  83. package/dist/packages/compiler/index.d.ts +3 -3
  84. package/dist/packages/compiler/index.js +2 -2
  85. package/dist/packages/compiler/lib/schema.d.ts +62 -247
  86. package/dist/packages/compiler/lib/schema.js +56 -174
  87. package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
  88. package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
  89. package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
  90. package/dist/packages/compiler/raw-snapshot.js +0 -1
  91. package/dist/packages/compiler/reset.js +3 -3
  92. package/dist/packages/compiler/runtime-acceptance.js +9 -16
  93. package/dist/packages/compiler/runtime-contracts.js +9 -9
  94. package/dist/packages/compiler/runtime-prompt.js +4 -4
  95. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
  96. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  97. package/dist/packages/compiler/runtime-runs.js +9 -9
  98. package/dist/packages/compiler/runtime-types.d.ts +8 -7
  99. package/dist/packages/compiler/state-health.js +26 -35
  100. package/dist/packages/compiler/state-view.js +6 -6
  101. package/dist/packages/compiler/validate-compiled.d.ts +5 -5
  102. package/dist/packages/compiler/validate-compiled.js +56 -64
  103. package/dist/packages/compiler/validate.d.ts +2 -2
  104. package/dist/packages/compiler/validate.js +22 -14
  105. package/dist/packages/contracts/index.d.ts +2 -0
  106. package/dist/packages/contracts/index.js +1 -0
  107. package/dist/packages/contracts/lib/schema.d.ts +205 -0
  108. package/dist/packages/contracts/lib/schema.js +101 -0
  109. package/dist/packages/execution/index.d.ts +2 -2
  110. package/dist/packages/execution/index.js +1 -1
  111. package/dist/packages/execution/lib/schema.d.ts +80 -83
  112. package/dist/packages/execution/lib/schema.js +25 -48
  113. package/dist/packages/local-service/action-values.d.ts +1 -1
  114. package/dist/packages/local-service/action-values.js +1 -1
  115. package/dist/packages/local-service/client.d.ts +4 -4
  116. package/dist/packages/local-service/client.js +4 -4
  117. package/dist/packages/local-service/index.d.ts +3 -3
  118. package/dist/packages/local-service/index.js +2 -2
  119. package/dist/packages/local-service/lib/schema.d.ts +540 -974
  120. package/dist/packages/local-service/lib/schema.js +44 -160
  121. package/dist/packages/local-service/run-observability.d.ts +6 -0
  122. package/dist/packages/local-service/run-observability.js +592 -0
  123. package/dist/packages/local-service/runtime.d.ts +19 -23
  124. package/dist/packages/local-service/runtime.js +349 -913
  125. package/dist/packages/local-service/server.d.ts +1 -0
  126. package/dist/packages/local-service/server.js +25 -20
  127. package/dist/packages/method-authoring/index.d.ts +4 -0
  128. package/dist/packages/method-authoring/index.js +4 -0
  129. package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
  130. package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
  131. package/dist/packages/method-authoring/method-authoring.js +116 -0
  132. package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
  133. package/dist/packages/method-authoring/method-edit-session.js +125 -0
  134. package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
  135. package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
  136. package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
  137. package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
  138. package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
  139. package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
  140. package/dist/packages/method-package/index.d.ts +11 -0
  141. package/dist/packages/method-package/index.js +11 -0
  142. package/dist/packages/method-package/interf-method-package.d.ts +31 -0
  143. package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
  144. package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
  145. package/dist/packages/method-package/local-methods.d.ts +64 -0
  146. package/dist/packages/method-package/local-methods.js +466 -0
  147. package/dist/packages/method-package/method-definitions.d.ts +83 -0
  148. package/dist/packages/method-package/method-definitions.js +205 -0
  149. package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
  150. package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
  151. package/dist/packages/method-package/method-review-paths.d.ts +10 -0
  152. package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
  153. package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
  154. package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
  155. package/dist/packages/methods/index.d.ts +2 -0
  156. package/dist/packages/methods/index.js +2 -0
  157. package/dist/packages/methods/method-resolution.d.ts +6 -0
  158. package/dist/packages/methods/method-resolution.js +7 -0
  159. package/dist/packages/project-model/index.d.ts +1 -4
  160. package/dist/packages/project-model/index.js +0 -3
  161. package/dist/packages/project-model/interf-detect.d.ts +1 -5
  162. package/dist/packages/project-model/interf-detect.js +7 -18
  163. package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
  164. package/dist/packages/project-model/interf-scaffold.js +38 -39
  165. package/dist/packages/project-model/interf.d.ts +1 -2
  166. package/dist/packages/project-model/interf.js +1 -2
  167. package/dist/packages/project-model/lib/schema.d.ts +2 -66
  168. package/dist/packages/project-model/lib/schema.js +5 -23
  169. package/dist/packages/project-model/project-paths.d.ts +9 -10
  170. package/dist/packages/project-model/project-paths.js +14 -17
  171. package/dist/packages/project-model/source-config.d.ts +11 -18
  172. package/dist/packages/project-model/source-config.js +42 -60
  173. package/dist/packages/project-model/source-folders.d.ts +4 -4
  174. package/dist/packages/project-model/source-folders.js +10 -10
  175. package/dist/packages/testing/index.d.ts +2 -2
  176. package/dist/packages/testing/index.js +1 -1
  177. package/dist/packages/testing/lib/schema.d.ts +11 -11
  178. package/dist/packages/testing/lib/schema.js +8 -9
  179. package/dist/packages/testing/readiness-check-run.d.ts +67 -0
  180. package/dist/packages/testing/readiness-check-run.js +258 -0
  181. package/dist/packages/testing/test-execution.d.ts +3 -3
  182. package/dist/packages/testing/test-execution.js +5 -5
  183. package/dist/packages/testing/test-paths.js +6 -6
  184. package/dist/packages/testing/test-profile-presets.js +2 -2
  185. package/dist/packages/testing/test-sandbox.js +10 -11
  186. package/dist/packages/testing/test-targets.d.ts +1 -1
  187. package/dist/packages/testing/test-targets.js +8 -7
  188. package/dist/packages/testing/test-types.d.ts +1 -1
  189. package/package.json +16 -33
  190. package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
  191. package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +0 -3
  192. package/builtin-workflows/interf/improve/SKILL.md +0 -18
  193. package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
  194. package/dist/packages/project-model/compiled-paths.d.ts +0 -1
  195. package/dist/packages/project-model/compiled-paths.js +0 -1
  196. package/dist/packages/project-model/compiled-raw.d.ts +0 -1
  197. package/dist/packages/project-model/compiled-raw.js +0 -1
  198. package/dist/packages/project-model/compiled-reset.d.ts +0 -1
  199. package/dist/packages/project-model/compiled-reset.js +0 -1
  200. package/dist/packages/shared/index.d.ts +0 -7
  201. package/dist/packages/shared/index.js +0 -7
  202. package/dist/packages/shared/util.d.ts +0 -3
  203. package/dist/packages/shared/util.js +0 -3
  204. package/dist/packages/testing/test-matrices.d.ts +0 -90
  205. package/dist/packages/testing/test-matrices.js +0 -96
  206. package/dist/packages/workflow-authoring/index.d.ts +0 -4
  207. package/dist/packages/workflow-authoring/index.js +0 -4
  208. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
  209. package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
  210. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
  211. package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
  212. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
  213. package/dist/packages/workflow-package/index.d.ts +0 -11
  214. package/dist/packages/workflow-package/index.js +0 -11
  215. package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
  216. package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
  217. package/dist/packages/workflow-package/local-workflows.js +0 -457
  218. package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
  219. package/dist/packages/workflow-package/workflow-definitions.js +0 -211
  220. package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
  221. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
  222. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
  223. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
  224. /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
  225. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
  226. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
  227. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
  228. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
  229. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
  230. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
  231. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
  232. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
  233. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
  234. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
  235. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
  236. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
  237. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
  238. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
  239. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
  240. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_buildManifest.js +0 -0
  241. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_clientMiddlewareManifest.js +0 -0
  242. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_ssgManifest.js +0 -0
  243. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  244. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  245. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
  246. /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
  247. /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
  248. /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
  249. /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
  250. /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
  251. /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
@@ -1,86 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "../../execution/lib/schema.js";
3
- import { DatasetNameSchema, PreparationNameSchema, SourceDatasetConfigSchema, SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project-model/lib/schema.js";
4
- import { TestRunComparisonSchema, TestRunModeSchema, } from "../../testing/lib/schema.js";
5
- import { ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, WorkflowIdSchema, } from "../../compiler/lib/schema.js";
3
+ import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project-model/lib/schema.js";
4
+ import { PreparationNameSchema, ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, } from "../../contracts/lib/schema.js";
5
+ import { ReadinessCheckRunSchema, TestRunModeSchema, } from "../../testing/lib/schema.js";
6
6
  const JsonObjectSchema = z.record(z.string(), z.unknown());
7
- function normalizePreparationMethodRequest(value) {
8
- if (!value || typeof value !== "object" || Array.isArray(value))
9
- return value;
10
- const input = value;
11
- const normalized = { ...input };
12
- if (normalized.preparation == null || normalized.preparation === "") {
13
- delete normalized.preparation;
14
- }
15
- if (normalized.method == null || normalized.method === "") {
16
- delete normalized.method;
17
- }
18
- if (typeof normalized.preparation !== "string" && typeof input.dataset === "string") {
19
- normalized.preparation = input.dataset;
20
- }
21
- if (typeof normalized.method !== "string" && typeof input.workflow === "string") {
22
- normalized.method = input.workflow;
23
- }
24
- delete normalized.dataset;
25
- delete normalized.workflow;
26
- return normalized;
27
- }
28
- function normalizePreparationObjectRequest(value) {
29
- if (!value || typeof value !== "object" || Array.isArray(value))
30
- return value;
31
- const input = value;
32
- const normalized = { ...input };
33
- if (!normalized.preparation && input.dataset && typeof input.dataset === "object") {
34
- normalized.preparation = input.dataset;
35
- }
36
- delete normalized.dataset;
37
- return normalized;
38
- }
39
- function normalizePublicActionType(value) {
40
- const normalized = normalizePreparationMethodRequest(value);
41
- if (!normalized || typeof normalized !== "object" || Array.isArray(normalized)) {
42
- return normalized;
43
- }
44
- const output = { ...normalized };
45
- if (output.action_type === "dataset-setup")
46
- output.action_type = "preparation-setup";
47
- if (output.action_type === "workflow-authoring")
48
- output.action_type = "method-authoring";
49
- if (output.action_type === "workflow-improvement")
50
- output.action_type = "method-improvement";
51
- for (const key of ["title", "summary", "assistant_message", "command_preview"]) {
52
- if (output[key] == null || output[key] === "") {
53
- delete output[key];
54
- }
55
- }
56
- return output;
57
- }
58
- function normalizeWorkflowAuthoringRequest(value) {
59
- if (!value || typeof value !== "object" || Array.isArray(value))
60
- return value;
61
- const input = value;
62
- const normalized = normalizePreparationMethodRequest(input);
63
- if (typeof normalized.source_folder_path !== "string" && typeof input.dataset_path === "string") {
64
- normalized.source_folder_path = input.dataset_path;
65
- }
66
- if (typeof normalized.method_id !== "string") {
67
- if (typeof input.workflow_id === "string")
68
- normalized.method_id = input.workflow_id;
69
- else if (typeof normalized.method === "string")
70
- normalized.method_id = normalized.method;
71
- }
72
- if (typeof normalized.base_method_id !== "string" && typeof input.base_workflow_id === "string") {
73
- normalized.base_method_id = input.base_workflow_id;
74
- }
75
- if (typeof normalized.reference_method_id !== "string" && typeof input.reference_workflow_id === "string") {
76
- normalized.reference_method_id = input.reference_workflow_id;
77
- }
78
- delete normalized.dataset_path;
79
- delete normalized.workflow_id;
80
- delete normalized.base_workflow_id;
81
- delete normalized.reference_workflow_id;
82
- return normalized;
83
- }
84
7
  export const LocalServiceHostSchema = z.string().min(1);
85
8
  export const LocalServicePortSchema = z.number().int().min(1).max(65535);
86
9
  export const LocalServiceConfigSchema = z.object({
@@ -107,19 +30,12 @@ export const LocalServiceInstancePointerSchema = z.object({
107
30
  control_path: z.string().min(1),
108
31
  started_at: z.string().min(1),
109
32
  }).strict();
110
- export const DatasetResourceSchema = z.object({
111
- dataset: SourceDatasetConfigSchema,
112
- portable_context_path: z.string().min(1).nullable(),
113
- readiness: ReadinessStateSchema,
114
- latest_compile_run_id: z.string().min(1).nullable().optional(),
115
- latest_test_run_id: z.string().min(1).nullable().optional(),
116
- }).strict();
117
33
  export const PreparationReadinessStateSchema = ReadinessStateSchema;
118
34
  export const PortableContextMappingSchema = z.object({
119
35
  preparation: PreparationNameSchema,
120
36
  path: z.string().min(1).nullable(),
121
37
  exists: z.boolean(),
122
- method_id: WorkflowIdSchema.nullable(),
38
+ method_id: MethodIdSchema.nullable(),
123
39
  latest_compile_run_id: z.string().min(1).nullable(),
124
40
  latest_test_run_id: z.string().min(1).nullable(),
125
41
  }).strict();
@@ -132,7 +48,7 @@ export const PreparationResourceSchema = z.object({
132
48
  name: PreparationNameSchema,
133
49
  preparation: SourcePreparationConfigSchema,
134
50
  source_path: z.string().min(1),
135
- method_id: WorkflowIdSchema.nullable(),
51
+ method_id: MethodIdSchema.nullable(),
136
52
  checks: z.array(SourceReadinessCheckSchema).default([]),
137
53
  portable_context: PortableContextMappingSchema,
138
54
  portable_context_path: z.string().min(1).nullable(),
@@ -141,34 +57,15 @@ export const PreparationResourceSchema = z.object({
141
57
  latest_compile_run_id: z.string().min(1).nullable().optional(),
142
58
  latest_test_run_id: z.string().min(1).nullable().optional(),
143
59
  }).strict();
144
- export const WorkflowPackageResourceSchema = z.object({
145
- id: WorkflowIdSchema,
146
- path: z.string().min(1),
147
- label: z.string().min(1).optional(),
148
- hint: z.string().min(1).optional(),
149
- source_kind: z.enum(["builtin", "local"]).default("local"),
150
- built_in: z.boolean().default(false),
151
- active_for_datasets: z.array(DatasetNameSchema).default([]),
152
- stages: z.array(z.object({
153
- id: z.string().min(1),
154
- label: z.string().min(1),
155
- description: z.string().min(1).optional(),
156
- contract_type: z.string().min(1),
157
- skill_dir: z.string().min(1),
158
- reads: z.array(z.string().min(1)).default([]),
159
- writes: z.array(z.string().min(1)).default([]),
160
- acceptance: z.record(z.string(), z.unknown()).optional(),
161
- }).strict()).default([]),
162
- }).strict();
163
60
  export const MethodResourceSchema = z.object({
164
- id: WorkflowIdSchema,
165
- method_id: WorkflowIdSchema,
61
+ id: MethodIdSchema,
62
+ method_id: MethodIdSchema,
166
63
  path: z.string().min(1),
167
64
  label: z.string().min(1).optional(),
168
65
  hint: z.string().min(1).optional(),
169
66
  source_kind: z.enum(["builtin", "local"]).default("local"),
170
67
  built_in: z.boolean().default(false),
171
- active_for_preparations: z.array(DatasetNameSchema).default([]),
68
+ active_for_preparations: z.array(PreparationNameSchema).default([]),
172
69
  stages: z.array(z.object({
173
70
  id: z.string().min(1),
174
71
  label: z.string().min(1),
@@ -180,18 +77,18 @@ export const MethodResourceSchema = z.object({
180
77
  acceptance: z.record(z.string(), z.unknown()).optional(),
181
78
  }).strict()).default([]),
182
79
  }).strict();
183
- export const CompileRunCreateRequestSchema = z.preprocess(normalizePreparationMethodRequest, z.object({
80
+ export const CompileRunCreateRequestSchema = z.object({
184
81
  preparation: PreparationNameSchema,
185
- method: WorkflowIdSchema.optional(),
82
+ method: MethodIdSchema.optional(),
186
83
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
187
84
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
188
85
  preserve_stage_shells: z.enum(["on-failure", "always"]).optional(),
189
- }).strict());
86
+ }).strict();
190
87
  export const CompileRunSummarySchema = z.object({
191
88
  run_id: z.string().min(1),
192
89
  status: CompileRunStatusSchema,
193
90
  preparation: PreparationNameSchema,
194
- method: WorkflowIdSchema,
91
+ method: MethodIdSchema,
195
92
  portable_context_path: z.string().min(1),
196
93
  started_at: z.string().nullable().optional(),
197
94
  finished_at: z.string().nullable().optional(),
@@ -219,6 +116,7 @@ export const LocalJobStatusSchema = z.enum([
219
116
  export const LocalRunHandlerResultSchema = z.object({
220
117
  ok: z.boolean(),
221
118
  error: z.string().min(1).optional(),
119
+ comparison: ReadinessCheckRunSchema.nullable().optional(),
222
120
  }).strict();
223
121
  export const LocalJobAgentSchema = z.object({
224
122
  name: z.string().min(1),
@@ -259,11 +157,11 @@ export const LocalJobEventSchema = z.object({
259
157
  input: JsonObjectSchema.nullable().optional(),
260
158
  output: JsonObjectSchema.nullable().optional(),
261
159
  }).strict();
262
- export const LocalJobRunCreateRequestSchema = z.preprocess(normalizePreparationMethodRequest, z.object({
160
+ export const LocalJobRunCreateRequestSchema = z.object({
263
161
  job_type: LocalJobTypeSchema,
264
162
  title: z.string().min(1),
265
163
  preparation: PreparationNameSchema.nullable().optional(),
266
- method: WorkflowIdSchema.nullable().optional(),
164
+ method: MethodIdSchema.nullable().optional(),
267
165
  source_path: z.string().min(1).nullable().optional(),
268
166
  output_path: z.string().min(1).nullable().optional(),
269
167
  agent: LocalJobAgentSchema.nullable().optional(),
@@ -272,32 +170,32 @@ export const LocalJobRunCreateRequestSchema = z.preprocess(normalizePreparationM
272
170
  label: z.string().min(1),
273
171
  input: JsonObjectSchema.nullable().optional(),
274
172
  }).strict()).default([]),
275
- }).strict());
276
- export const PreparationSetupCreateRequestSchema = z.preprocess(normalizePreparationObjectRequest, z.object({
173
+ }).strict();
174
+ export const PreparationSetupCreateRequestSchema = z.object({
277
175
  preparation: SourcePreparationConfigSchema,
278
- }).strict());
279
- export const DatasetSetupCreateRequestSchema = PreparationSetupCreateRequestSchema;
280
- export const ReadinessCheckDraftCreateRequestSchema = z.preprocess(normalizeWorkflowAuthoringRequest, z.object({
176
+ prepare_after_setup: z.boolean().default(false),
177
+ }).strict();
178
+ export const ReadinessCheckDraftCreateRequestSchema = z.object({
281
179
  preparation: PreparationNameSchema,
282
180
  source_folder_path: z.string().min(1),
283
181
  about: z.string().min(1).optional(),
284
182
  target_count: z.number().int().min(1).max(8).default(4),
285
- }).strict());
183
+ }).strict();
286
184
  export const ReadinessCheckDraftResultSchema = z.object({
287
185
  checks: z.array(SourceReadinessCheckSchema).default([]),
288
186
  }).strict();
289
- export const WorkflowAuthoringCreateRequestSchema = z.preprocess(normalizeWorkflowAuthoringRequest, z.object({
187
+ export const MethodAuthoringCreateRequestSchema = z.object({
290
188
  preparation: PreparationNameSchema.nullable().optional(),
291
189
  source_folder_path: z.string().min(1),
292
- base_method_id: WorkflowIdSchema.optional(),
293
- reference_method_id: WorkflowIdSchema.optional(),
294
- method_id: WorkflowIdSchema,
190
+ base_method_id: MethodIdSchema.optional(),
191
+ reference_method_id: MethodIdSchema.optional(),
192
+ method_id: MethodIdSchema,
295
193
  label: z.string().min(1),
296
194
  hint: z.string().min(1),
297
195
  task_prompt: z.string().min(1),
298
196
  checks: z.array(SourceReadinessCheckSchema).default([]),
299
- }).strict());
300
- export const WorkflowAuthoringResultSchema = z.object({
197
+ }).strict();
198
+ export const MethodAuthoringResultSchema = z.object({
301
199
  status: z.enum(["updated", "no-change", "invalid", "executor-failed"]),
302
200
  changed: z.boolean(),
303
201
  summary: z.string().min(1),
@@ -321,7 +219,7 @@ export const LocalJobRunResourceSchema = z.object({
321
219
  status: LocalJobStatusSchema,
322
220
  title: z.string().min(1),
323
221
  preparation: PreparationNameSchema.nullable().optional(),
324
- method: WorkflowIdSchema.nullable().optional(),
222
+ method: MethodIdSchema.nullable().optional(),
325
223
  source_path: z.string().min(1).nullable().optional(),
326
224
  output_path: z.string().min(1).nullable().optional(),
327
225
  agent: LocalJobAgentSchema.nullable().optional(),
@@ -340,10 +238,10 @@ export const TestRunStatusSchema = z.enum([
340
238
  "failed",
341
239
  "cancelled",
342
240
  ]);
343
- export const TestRunCreateRequestSchema = z.preprocess(normalizePreparationMethodRequest, z.object({
241
+ export const TestRunCreateRequestSchema = z.object({
344
242
  preparation: PreparationNameSchema,
345
243
  mode: TestRunModeSchema.default("both"),
346
- }).strict());
244
+ }).strict();
347
245
  export const TestRunResourceSchema = z.object({
348
246
  run_id: z.string().min(1),
349
247
  status: TestRunStatusSchema,
@@ -353,17 +251,17 @@ export const TestRunResourceSchema = z.object({
353
251
  portable_context_path: z.string().min(1).nullable(),
354
252
  started_at: z.string().nullable().optional(),
355
253
  finished_at: z.string().nullable().optional(),
356
- comparison: TestRunComparisonSchema.nullable(),
254
+ comparison: ReadinessCheckRunSchema.nullable(),
357
255
  readiness: ReadinessStateSchema.nullable().optional(),
358
256
  events: z.array(InterfRunEventSchema).default([]),
359
257
  error: z.string().min(1).nullable().optional(),
360
258
  }).strict();
361
259
  export const RunObservabilityResourceSchema = RunObservabilitySchema;
362
- export const RunCreateRequestSchema = z.preprocess(normalizePreparationMethodRequest, z.discriminatedUnion("run_type", [
260
+ export const RunCreateRequestSchema = z.discriminatedUnion("run_type", [
363
261
  z.object({
364
262
  run_type: z.literal("compile"),
365
263
  preparation: PreparationNameSchema,
366
- method: WorkflowIdSchema.optional(),
264
+ method: MethodIdSchema.optional(),
367
265
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
368
266
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
369
267
  preserve_stage_shells: z.enum(["on-failure", "always"]).optional(),
@@ -371,7 +269,7 @@ export const RunCreateRequestSchema = z.preprocess(normalizePreparationMethodReq
371
269
  z.object({
372
270
  run_type: z.literal("prepare"),
373
271
  preparation: PreparationNameSchema,
374
- method: WorkflowIdSchema.optional(),
272
+ method: MethodIdSchema.optional(),
375
273
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
376
274
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
377
275
  preserve_stage_shells: z.enum(["on-failure", "always"]).optional(),
@@ -386,7 +284,7 @@ export const RunCreateRequestSchema = z.preprocess(normalizePreparationMethodReq
386
284
  preparation: PreparationNameSchema,
387
285
  mode: TestRunModeSchema.default("both"),
388
286
  }).strict(),
389
- ]));
287
+ ]);
390
288
  export const LocalExecutorStatusSchema = z.object({
391
289
  kind: z.literal("interf-local-executor-status"),
392
290
  version: z.literal(1),
@@ -416,21 +314,21 @@ export const ActionProposalStatusSchema = z.enum([
416
314
  "submitted",
417
315
  "failed",
418
316
  ]);
419
- export const ActionProposalCreateRequestSchema = z.preprocess(normalizePreparationMethodRequest, z.object({
317
+ export const ActionProposalCreateRequestSchema = z.object({
420
318
  message: z.string().min(1),
421
319
  preparation: PreparationNameSchema.optional(),
422
320
  values: JsonObjectSchema.optional(),
423
- }).strict());
424
- export const ActionProposalPlanSchema = z.preprocess(normalizePublicActionType, z.object({
321
+ }).strict();
322
+ export const ActionProposalPlanSchema = z.object({
425
323
  action_type: ActionProposalTypeSchema,
426
324
  preparation: PreparationNameSchema.optional(),
427
- method: WorkflowIdSchema.optional(),
325
+ method: MethodIdSchema.optional(),
428
326
  values: JsonObjectSchema.optional(),
429
327
  title: z.string().min(1).optional(),
430
328
  summary: z.string().min(1).optional(),
431
329
  assistant_message: z.string().min(1).optional(),
432
330
  command_preview: z.string().min(1).optional(),
433
- }).strict());
331
+ }).strict();
434
332
  export const ActionProposalApprovalRequestSchema = z.object({
435
333
  approved: z.boolean(),
436
334
  note: z.string().min(1).optional(),
@@ -451,7 +349,7 @@ const ActionProposalResourceBaseSchema = z.object({
451
349
  command_preview: z.string().min(1).optional(),
452
350
  message: z.string().min(1),
453
351
  preparation: PreparationNameSchema.nullable().optional(),
454
- method: WorkflowIdSchema.nullable().optional(),
352
+ method: MethodIdSchema.nullable().optional(),
455
353
  created_at: z.string().min(1),
456
354
  updated_at: z.string().min(1),
457
355
  proposed_by_executor: LocalJobAgentSchema.nullable().optional(),
@@ -483,11 +381,11 @@ export const ActionProposalResourceSchema = z.discriminatedUnion("action_type",
483
381
  }).strict(),
484
382
  ActionProposalResourceBaseSchema.extend({
485
383
  action_type: z.literal("method-authoring"),
486
- request: WorkflowAuthoringCreateRequestSchema,
384
+ request: MethodAuthoringCreateRequestSchema,
487
385
  }).strict(),
488
386
  ActionProposalResourceBaseSchema.extend({
489
387
  action_type: z.literal("method-improvement"),
490
- request: WorkflowAuthoringCreateRequestSchema,
388
+ request: MethodAuthoringCreateRequestSchema,
491
389
  }).strict(),
492
390
  ]);
493
391
  export const PortableContextResourceSchema = z.object({
@@ -495,7 +393,7 @@ export const PortableContextResourceSchema = z.object({
495
393
  path: z.string().min(1),
496
394
  exists: z.boolean(),
497
395
  readiness: ReadinessStateSchema,
498
- method: WorkflowIdSchema.nullable().optional(),
396
+ method: MethodIdSchema.nullable().optional(),
499
397
  latest_compile_run_id: z.string().min(1).nullable().optional(),
500
398
  latest_test_run_id: z.string().min(1).nullable().optional(),
501
399
  artifacts: z.array(ArtifactRefSchema).default([]),
@@ -538,18 +436,10 @@ export const OpenPathResponseSchema = z.object({
538
436
  path: z.string().min(1),
539
437
  }).strict();
540
438
  export const LocalServiceResourceSchema = z.discriminatedUnion("kind", [
541
- z.object({
542
- kind: z.literal("dataset"),
543
- value: DatasetResourceSchema,
544
- }).strict(),
545
439
  z.object({
546
440
  kind: z.literal("preparation"),
547
441
  value: PreparationResourceSchema,
548
442
  }).strict(),
549
- z.object({
550
- kind: z.literal("workflow-package"),
551
- value: WorkflowPackageResourceSchema,
552
- }).strict(),
553
443
  z.object({
554
444
  kind: z.literal("method"),
555
445
  value: MethodResourceSchema,
@@ -595,15 +485,9 @@ export const LocalServiceResourceSchema = z.discriminatedUnion("kind", [
595
485
  value: WorkspaceFileResourceSchema,
596
486
  }).strict(),
597
487
  ]);
598
- export const DatasetListResponseSchema = z.object({
599
- datasets: z.array(DatasetResourceSchema),
600
- }).strict();
601
488
  export const PreparationListResponseSchema = z.object({
602
489
  preparations: z.array(PreparationResourceSchema),
603
490
  }).strict();
604
- export const WorkflowPackageListResponseSchema = z.object({
605
- workflow_packages: z.array(WorkflowPackageResourceSchema),
606
- }).strict();
607
491
  export const MethodListResponseSchema = z.object({
608
492
  methods: z.array(MethodResourceSchema),
609
493
  }).strict();
@@ -0,0 +1,6 @@
1
+ import { type ArtifactRef, type CompileRun } from "../execution/lib/schema.js";
2
+ import { type LocalJobRunResource, type RunObservabilityResource, type TestRunResource } from "./lib/schema.js";
3
+ export declare function uniqueArtifacts(artifacts: ArtifactRef[]): ArtifactRef[];
4
+ export declare function compileRunToObservability(run: CompileRun): RunObservabilityResource;
5
+ export declare function testRunToObservability(run: TestRunResource): RunObservabilityResource;
6
+ export declare function jobRunToObservability(job: LocalJobRunResource): RunObservabilityResource;