@interf/compiler 0.16.0 → 0.21.0

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 (203) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +90 -73
  3. package/TRADEMARKS.md +4 -4
  4. package/dist/cli/commands/mcp.d.ts +0 -34
  5. package/dist/cli/commands/mcp.js +246 -45
  6. package/dist/cli/commands/method.js +261 -15
  7. package/dist/cli/commands/prep.js +116 -15
  8. package/dist/cli/commands/runs.js +103 -9
  9. package/dist/cli/commands/status.js +4 -2
  10. package/dist/cli/commands/test.d.ts +10 -0
  11. package/dist/cli/commands/{verify.js → test.js} +24 -17
  12. package/dist/cli/commands/web.js +82 -8
  13. package/dist/cli/commands/wizard.js +158 -51
  14. package/dist/cli/index.d.ts +2 -2
  15. package/dist/cli/index.js +3 -3
  16. package/dist/compiler-ui/404.html +1 -1
  17. package/dist/compiler-ui/__next.__PAGE__.txt +5 -5
  18. package/dist/compiler-ui/__next._full.txt +13 -12
  19. package/dist/compiler-ui/__next._head.txt +3 -3
  20. package/dist/compiler-ui/__next._index.txt +5 -4
  21. package/dist/compiler-ui/__next._tree.txt +4 -3
  22. package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +1 -0
  23. package/dist/compiler-ui/_next/static/chunks/{0n51hrfoufc7g.js → 02f_.8.ebn556.js} +1 -1
  24. package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +1 -0
  25. package/dist/compiler-ui/_next/static/chunks/{08m7vf5asqlsm.js → 04d0ly-7xb~-j.js} +10 -10
  26. package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +1 -0
  27. package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +2 -0
  28. package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +116 -0
  29. package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +31 -0
  30. package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +1 -0
  31. package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +1 -0
  32. package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +1 -0
  33. package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +1 -0
  34. package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +1 -0
  35. package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +5 -0
  36. package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +1 -0
  37. package/dist/compiler-ui/_next/static/chunks/{turbopack-0.uq1k8c0j4s..js → turbopack-02-3e_c-yz~5g.js} +1 -1
  38. package/dist/compiler-ui/_next/static/chunks/{turbopack-10e~t1yzi4svj.js → turbopack-0apv8vb-nczuy.js} +1 -1
  39. package/dist/compiler-ui/_not-found/__next._full.txt +10 -9
  40. package/dist/compiler-ui/_not-found/__next._head.txt +3 -3
  41. package/dist/compiler-ui/_not-found/__next._index.txt +5 -4
  42. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +2 -2
  43. package/dist/compiler-ui/_not-found/__next._not-found.txt +3 -3
  44. package/dist/compiler-ui/_not-found/__next._tree.txt +3 -2
  45. package/dist/compiler-ui/_not-found.html +1 -1
  46. package/dist/compiler-ui/_not-found.txt +10 -9
  47. package/dist/compiler-ui/index.html +1 -1
  48. package/dist/compiler-ui/index.txt +13 -12
  49. package/dist/packages/contracts/index.d.ts +2 -2
  50. package/dist/packages/contracts/index.js +1 -1
  51. package/dist/packages/contracts/lib/schema.d.ts +275 -72
  52. package/dist/packages/contracts/lib/schema.js +244 -83
  53. package/dist/packages/engine/action-definitions.d.ts +174 -13
  54. package/dist/packages/engine/action-definitions.js +125 -122
  55. package/dist/packages/engine/action-planner.js +4 -11
  56. package/dist/packages/engine/agents/lib/shells.d.ts +15 -5
  57. package/dist/packages/engine/agents/lib/shells.js +134 -123
  58. package/dist/packages/engine/agents/role-executors.js +1 -1
  59. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  60. package/dist/packages/engine/cloud-seams.js +84 -0
  61. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -1
  62. package/dist/packages/engine/compile/artifact-counts.js +3 -3
  63. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  64. package/dist/packages/engine/compile/artifact-status.js +166 -0
  65. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  66. package/dist/packages/engine/compile/billing-events.js +74 -0
  67. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  68. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  69. package/dist/packages/engine/compile/compiled-paths.js +6 -6
  70. package/dist/packages/engine/compile/compiled-schema.d.ts +7 -17
  71. package/dist/packages/engine/compile/compiled-schema.js +55 -70
  72. package/dist/packages/engine/compile/compiled-stage-plan.d.ts +1 -0
  73. package/dist/packages/engine/compile/compiled-stage-plan.js +32 -15
  74. package/dist/packages/engine/compile/compiled-stage-runner.js +1 -1
  75. package/dist/packages/engine/compile/index.d.ts +0 -1
  76. package/dist/packages/engine/compile/index.js +0 -1
  77. package/dist/packages/engine/compile/lib/schema.d.ts +111 -92
  78. package/dist/packages/engine/compile/lib/schema.js +35 -39
  79. package/dist/packages/engine/compile/method-primitives.d.ts +2 -2
  80. package/dist/packages/engine/compile/method-primitives.js +1 -1
  81. package/dist/packages/engine/compile/reset.js +4 -4
  82. package/dist/packages/engine/compile/runtime-contracts.js +2 -1
  83. package/dist/packages/engine/compile/runtime-prompt.js +3 -2
  84. package/dist/packages/engine/compile/runtime-reconcile.js +35 -35
  85. package/dist/packages/engine/compile/runtime-runs.js +0 -1
  86. package/dist/packages/engine/compile/runtime-types.d.ts +7 -8
  87. package/dist/packages/engine/compile/runtime.d.ts +1 -2
  88. package/dist/packages/engine/compile/runtime.js +0 -1
  89. package/dist/packages/engine/compile/state-health.js +6 -6
  90. package/dist/packages/engine/compile/state-view.js +7 -6
  91. package/dist/packages/engine/compile/validate-compiled.js +61 -30
  92. package/dist/packages/engine/compile/validate.js +26 -24
  93. package/dist/packages/engine/connection-config.js +1 -1
  94. package/dist/packages/engine/execution/lib/schema.d.ts +89 -33
  95. package/dist/packages/engine/execution/lib/schema.js +13 -5
  96. package/dist/packages/engine/index.d.ts +2 -2
  97. package/dist/packages/engine/index.js +1 -1
  98. package/dist/packages/engine/instance-paths.d.ts +15 -9
  99. package/dist/packages/engine/instance-paths.js +15 -9
  100. package/dist/packages/engine/lib/schema.d.ts +1316 -351
  101. package/dist/packages/engine/lib/schema.js +99 -36
  102. package/dist/packages/engine/native-run-handlers.js +25 -15
  103. package/dist/packages/engine/preparation-store.d.ts +9 -7
  104. package/dist/packages/engine/preparation-store.js +20 -0
  105. package/dist/packages/engine/requested-artifacts.d.ts +5 -0
  106. package/dist/packages/engine/requested-artifacts.js +36 -0
  107. package/dist/packages/engine/routes.d.ts +7 -1
  108. package/dist/packages/engine/routes.js +7 -1
  109. package/dist/packages/engine/run-observability.js +4 -4
  110. package/dist/packages/engine/runtime-event-applier.js +7 -0
  111. package/dist/packages/engine/runtime-proposal-helpers.d.ts +2 -2
  112. package/dist/packages/engine/runtime-proposal-helpers.js +6 -8
  113. package/dist/packages/engine/runtime-resource-builders.d.ts +11 -6
  114. package/dist/packages/engine/runtime-resource-builders.js +18 -6
  115. package/dist/packages/engine/runtime.d.ts +70 -8
  116. package/dist/packages/engine/runtime.js +304 -49
  117. package/dist/packages/engine/server.d.ts +25 -0
  118. package/dist/packages/engine/server.js +161 -50
  119. package/dist/packages/engine/verify/index.d.ts +10 -10
  120. package/dist/packages/engine/verify/index.js +8 -8
  121. package/dist/packages/engine/verify/readiness-check-run.d.ts +27 -4
  122. package/dist/packages/engine/verify/readiness-check-run.js +92 -24
  123. package/dist/packages/engine/verify/{test-execution.d.ts → verify-execution.d.ts} +2 -2
  124. package/dist/packages/engine/verify/{test-execution.js → verify-execution.js} +3 -3
  125. package/dist/packages/engine/verify/{test-paths.d.ts → verify-paths.d.ts} +1 -1
  126. package/dist/packages/engine/verify/{test-sandbox.d.ts → verify-sandbox.d.ts} +1 -1
  127. package/dist/packages/engine/verify/{test-specs.d.ts → verify-specs.d.ts} +1 -1
  128. package/dist/packages/engine/verify/{test-specs.js → verify-specs.js} +1 -1
  129. package/dist/packages/engine/verify/{test-targets.d.ts → verify-targets.d.ts} +1 -1
  130. package/dist/packages/engine/verify/{test.d.ts → verify.d.ts} +4 -4
  131. package/dist/packages/engine/verify/{test.js → verify.js} +3 -3
  132. package/dist/packages/engine/wire-schemas.d.ts +549 -0
  133. package/dist/packages/engine/wire-schemas.js +59 -0
  134. package/dist/packages/methods/authoring/method-authoring.d.ts +5 -1
  135. package/dist/packages/methods/authoring/method-authoring.js +68 -18
  136. package/dist/packages/methods/authoring/method-edit-session.js +5 -5
  137. package/dist/packages/methods/authoring/method-improvement.js +1 -1
  138. package/dist/packages/methods/package/builtin-compiled-method.d.ts +12 -12
  139. package/dist/packages/methods/package/builtin-compiled-method.js +26 -23
  140. package/dist/packages/methods/package/context-interface.d.ts +39 -26
  141. package/dist/packages/methods/package/context-interface.js +48 -39
  142. package/dist/packages/methods/package/interf-method-package.js +28 -47
  143. package/dist/packages/methods/package/local-methods.d.ts +4 -4
  144. package/dist/packages/methods/package/local-methods.js +53 -66
  145. package/dist/packages/methods/package/method-definitions.d.ts +4 -6
  146. package/dist/packages/methods/package/method-definitions.js +1 -5
  147. package/dist/packages/methods/package/method-helpers.d.ts +0 -2
  148. package/dist/packages/methods/package/method-helpers.js +0 -4
  149. package/dist/packages/project/interf-detect.js +6 -6
  150. package/dist/packages/project/interf-scaffold.js +12 -12
  151. package/dist/packages/project/lib/schema.d.ts +193 -0
  152. package/dist/packages/project/lib/schema.js +46 -1
  153. package/dist/packages/project/source-config.js +6 -1
  154. package/dist/packages/project/source-folders.js +1 -1
  155. package/package.json +12 -23
  156. package/public-repo/CONTRIBUTING.md +47 -0
  157. package/public-repo/LICENSE.md +1 -0
  158. package/public-repo/README.md +325 -0
  159. package/public-repo/SECURITY.md +67 -0
  160. package/public-repo/TRADEMARKS.md +8 -0
  161. package/{builtin-methods → public-repo/methods}/interf-default/README.md +10 -7
  162. package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/shape/SKILL.md +4 -8
  163. package/{builtin-methods → public-repo/methods}/interf-default/method.json +8 -69
  164. package/public-repo/methods/interf-default/method.schema.json +75 -0
  165. package/public-repo/methods/interf-default/use/query/SKILL.md +23 -0
  166. package/public-repo/plugins/README.md +9 -0
  167. package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
  168. package/public-repo/plugins/interf/.mcp.json +12 -0
  169. package/public-repo/plugins/interf/README.md +29 -0
  170. package/public-repo/plugins/interf/skills/interf/SKILL.md +477 -0
  171. package/public-repo/skills/interf/SKILL.md +477 -0
  172. package/agent-skills/interf-actions/SKILL.md +0 -185
  173. package/agent-skills/interf-actions/references/cli.md +0 -243
  174. package/builtin-methods/interf-default/method.schema.json +0 -73
  175. package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
  176. package/dist/cli/commands/verify.d.ts +0 -8
  177. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
  178. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
  179. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +0 -1
  180. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +0 -1
  181. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
  182. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
  183. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
  184. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
  185. package/dist/compiler-ui/_next/static/chunks/0jipmpez3_ehh.js +0 -89
  186. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
  187. package/dist/compiler-ui/_next/static/chunks/13awzu4tooflw.css +0 -3
  188. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
  189. package/dist/packages/engine/compile/runtime-acceptance.d.ts +0 -9
  190. package/dist/packages/engine/compile/runtime-acceptance.js +0 -265
  191. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_buildManifest.js +0 -0
  192. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_clientMiddlewareManifest.js +0 -0
  193. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_ssgManifest.js +0 -0
  194. /package/dist/packages/engine/verify/{test-paths.js → verify-paths.js} +0 -0
  195. /package/dist/packages/engine/verify/{test-profile-presets.d.ts → verify-profile-presets.d.ts} +0 -0
  196. /package/dist/packages/engine/verify/{test-profile-presets.js → verify-profile-presets.js} +0 -0
  197. /package/dist/packages/engine/verify/{test-sandbox.js → verify-sandbox.js} +0 -0
  198. /package/dist/packages/engine/verify/{test-targets.js → verify-targets.js} +0 -0
  199. /package/dist/packages/engine/verify/{test-types.d.ts → verify-types.d.ts} +0 -0
  200. /package/dist/packages/engine/verify/{test-types.js → verify-types.js} +0 -0
  201. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/structure/SKILL.md +0 -0
  202. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/summarize/SKILL.md +0 -0
  203. /package/{builtin-methods → public-repo/methods}/interf-default/improve/SKILL.md +0 -0
@@ -0,0 +1,549 @@
1
+ /**
2
+ * 0.17 — private wire-shape registry for the Compiler UI.
3
+ *
4
+ * The UI consumes the local-service API at `/v1/...`. Before 0.17 it
5
+ * cast each `getJson` response to a TypeScript type without runtime
6
+ * validation, which let the 0.16 prepRuns shape-mismatch bug
7
+ * (UI typed `{ runs: CompileRunResource[] }`, API returns
8
+ * `{ runs: CompileRun[] }`) ship to production. This module exposes
9
+ * the response schemas the UI needs so `getJson` can validate at the
10
+ * fetch boundary.
11
+ *
12
+ * **Stays private.** Do NOT re-export from
13
+ * `src/packages/engine/index.ts` and do NOT add a `package.json#exports`
14
+ * subpath. 0.16 just pruned three subpath exports
15
+ * (`./contracts`, `./execution`, `./local-service`); adding wire
16
+ * schemas to the public ABI would reverse that direction-of-travel.
17
+ * The Compiler UI builds inside the same repo and imports these
18
+ * schemas via relative path — no public ABI change.
19
+ */
20
+ import { z } from "zod";
21
+ import { ActionProposalListResponseSchema, InstanceResourceSchema, LocalExecutorStatusSchema, LocalServiceHealthSchema, MethodListResponseSchema, PreparationListResponseSchema, RunObservabilityListResponseSchema, ReadinessListResponseSchema, SourceFileListResponseSchema, VerifyRunListResponseSchema } from "./lib/schema.js";
22
+ export { ActionProposalListResponseSchema, InstanceResourceSchema, LocalExecutorStatusSchema, LocalServiceHealthSchema, MethodListResponseSchema, PreparationListResponseSchema, RunObservabilityListResponseSchema, ReadinessListResponseSchema, SourceFileListResponseSchema, VerifyRunListResponseSchema, };
23
+ /**
24
+ * `GET /v1/preparations/<id>/runs` returns a flat list of compile runs.
25
+ * The 0.16 bug came from typing this as `{ runs: CompileRunResource[] }`
26
+ * (the wrapped form `{ run: CompileRun }`) when the API returns the
27
+ * unwrapped form. Pinning the schema here prevents the regression.
28
+ */
29
+ export declare const PreparationCompileRunListResponseSchema: z.ZodObject<{
30
+ runs: z.ZodArray<z.ZodObject<{
31
+ kind: z.ZodLiteral<"interf-compile-run">;
32
+ version: z.ZodLiteral<1>;
33
+ run_id: z.ZodString;
34
+ status: z.ZodEnum<{
35
+ succeeded: "succeeded";
36
+ failed: "failed";
37
+ running: "running";
38
+ cancelled: "cancelled";
39
+ queued: "queued";
40
+ }>;
41
+ preparation: z.ZodString;
42
+ method: z.ZodString;
43
+ backend: z.ZodEnum<{
44
+ native: "native";
45
+ "workflow-sdk": "workflow-sdk";
46
+ }>;
47
+ source_path: z.ZodString;
48
+ portable_context_path: z.ZodString;
49
+ created_at: z.ZodString;
50
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ finished_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ stages: z.ZodDefault<z.ZodArray<z.ZodObject<{
53
+ run_id: z.ZodString;
54
+ stage_id: z.ZodString;
55
+ stage_label: z.ZodOptional<z.ZodString>;
56
+ stage_index: z.ZodOptional<z.ZodNumber>;
57
+ stage_total: z.ZodOptional<z.ZodNumber>;
58
+ status: z.ZodEnum<{
59
+ succeeded: "succeeded";
60
+ failed: "failed";
61
+ running: "running";
62
+ queued: "queued";
63
+ }>;
64
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ finished_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
+ contract: z.ZodOptional<z.ZodObject<{
68
+ stage_label: z.ZodOptional<z.ZodString>;
69
+ stage_index: z.ZodOptional<z.ZodNumber>;
70
+ stage_total: z.ZodOptional<z.ZodNumber>;
71
+ reads: z.ZodDefault<z.ZodArray<z.ZodString>>;
72
+ writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
73
+ }, z.core.$strict>>;
74
+ executor: z.ZodOptional<z.ZodNullable<z.ZodObject<{
75
+ kind: z.ZodEnum<{
76
+ "local-agent": "local-agent";
77
+ "connected-provider": "connected-provider";
78
+ managed: "managed";
79
+ }>;
80
+ name: z.ZodString;
81
+ display_name: z.ZodString;
82
+ command: z.ZodNullable<z.ZodString>;
83
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ profile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ timeout_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
87
+ }, z.core.$strip>>>;
88
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
89
+ path: z.ZodString;
90
+ role: z.ZodEnum<{
91
+ runtime: "runtime";
92
+ output: "output";
93
+ source: "source";
94
+ proof: "proof";
95
+ test: "test";
96
+ }>;
97
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ label: z.ZodOptional<z.ZodString>;
99
+ sha256: z.ZodOptional<z.ZodString>;
100
+ }, z.core.$strict>>>;
101
+ logs: z.ZodOptional<z.ZodObject<{
102
+ prompt_path: z.ZodOptional<z.ZodString>;
103
+ event_stream_path: z.ZodOptional<z.ZodString>;
104
+ status_path: z.ZodOptional<z.ZodString>;
105
+ contract_path: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strict>>;
107
+ latest_proof: z.ZodOptional<z.ZodNullable<z.ZodObject<{
108
+ id: z.ZodString;
109
+ run_id: z.ZodString;
110
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
+ generated_at: z.ZodString;
112
+ summary: z.ZodString;
113
+ files_processed: z.ZodOptional<z.ZodNumber>;
114
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
115
+ path: z.ZodString;
116
+ role: z.ZodEnum<{
117
+ runtime: "runtime";
118
+ output: "output";
119
+ source: "source";
120
+ proof: "proof";
121
+ test: "test";
122
+ }>;
123
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
+ label: z.ZodOptional<z.ZodString>;
125
+ sha256: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strict>>>;
127
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
128
+ id: z.ZodString;
129
+ label: z.ZodString;
130
+ ok: z.ZodBoolean;
131
+ detail: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strict>>>;
133
+ }, z.core.$strict>>>;
134
+ failure: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ }, z.core.$strict>>>;
136
+ events: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ event_id: z.ZodString;
138
+ run_id: z.ZodString;
139
+ timestamp: z.ZodString;
140
+ type: z.ZodLiteral<"run.started">;
141
+ preparation: z.ZodString;
142
+ method: z.ZodString;
143
+ portable_context_path: z.ZodString;
144
+ backend: z.ZodEnum<{
145
+ native: "native";
146
+ "workflow-sdk": "workflow-sdk";
147
+ }>;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ event_id: z.ZodString;
150
+ run_id: z.ZodString;
151
+ timestamp: z.ZodString;
152
+ type: z.ZodLiteral<"stage.started">;
153
+ stage_id: z.ZodString;
154
+ stage_index: z.ZodOptional<z.ZodNumber>;
155
+ stage_total: z.ZodOptional<z.ZodNumber>;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ event_id: z.ZodString;
158
+ run_id: z.ZodString;
159
+ timestamp: z.ZodString;
160
+ type: z.ZodLiteral<"file.processed">;
161
+ stage_id: z.ZodString;
162
+ path: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ event_id: z.ZodString;
165
+ run_id: z.ZodString;
166
+ timestamp: z.ZodString;
167
+ type: z.ZodLiteral<"artifact.written">;
168
+ stage_id: z.ZodString;
169
+ artifact: z.ZodObject<{
170
+ path: z.ZodString;
171
+ role: z.ZodEnum<{
172
+ runtime: "runtime";
173
+ output: "output";
174
+ source: "source";
175
+ proof: "proof";
176
+ test: "test";
177
+ }>;
178
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ label: z.ZodOptional<z.ZodString>;
180
+ sha256: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$strict>;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ event_id: z.ZodString;
184
+ run_id: z.ZodString;
185
+ timestamp: z.ZodString;
186
+ type: z.ZodLiteral<"proof.updated">;
187
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
+ proof: z.ZodObject<{
189
+ id: z.ZodString;
190
+ run_id: z.ZodString;
191
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
+ generated_at: z.ZodString;
193
+ summary: z.ZodString;
194
+ files_processed: z.ZodOptional<z.ZodNumber>;
195
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
196
+ path: z.ZodString;
197
+ role: z.ZodEnum<{
198
+ runtime: "runtime";
199
+ output: "output";
200
+ source: "source";
201
+ proof: "proof";
202
+ test: "test";
203
+ }>;
204
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
205
+ label: z.ZodOptional<z.ZodString>;
206
+ sha256: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strict>>>;
208
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
209
+ id: z.ZodString;
210
+ label: z.ZodString;
211
+ ok: z.ZodBoolean;
212
+ detail: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strict>>>;
214
+ }, z.core.$strict>;
215
+ }, z.core.$strict>, z.ZodObject<{
216
+ event_id: z.ZodString;
217
+ run_id: z.ZodString;
218
+ timestamp: z.ZodString;
219
+ type: z.ZodLiteral<"log.appended">;
220
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
+ stream: z.ZodEnum<{
222
+ status: "status";
223
+ trace: "trace";
224
+ system: "system";
225
+ }>;
226
+ message: z.ZodString;
227
+ }, z.core.$strict>, z.ZodObject<{
228
+ event_id: z.ZodString;
229
+ run_id: z.ZodString;
230
+ timestamp: z.ZodString;
231
+ type: z.ZodLiteral<"stage.passed">;
232
+ stage_id: z.ZodString;
233
+ summary: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strict>, z.ZodObject<{
235
+ event_id: z.ZodString;
236
+ run_id: z.ZodString;
237
+ timestamp: z.ZodString;
238
+ type: z.ZodLiteral<"stage.failed">;
239
+ stage_id: z.ZodString;
240
+ error: z.ZodString;
241
+ }, z.core.$strict>, z.ZodObject<{
242
+ event_id: z.ZodString;
243
+ run_id: z.ZodString;
244
+ timestamp: z.ZodString;
245
+ type: z.ZodLiteral<"run.completed">;
246
+ summary: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ event_id: z.ZodString;
249
+ run_id: z.ZodString;
250
+ timestamp: z.ZodString;
251
+ type: z.ZodLiteral<"run.failed">;
252
+ error: z.ZodString;
253
+ }, z.core.$strict>, z.ZodObject<{
254
+ event_id: z.ZodString;
255
+ run_id: z.ZodString;
256
+ timestamp: z.ZodString;
257
+ type: z.ZodLiteral<"run.cancelled">;
258
+ reason: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strict>, z.ZodObject<{
260
+ event_id: z.ZodString;
261
+ run_id: z.ZodString;
262
+ timestamp: z.ZodString;
263
+ type: z.ZodLiteral<"checks.evaluated">;
264
+ passed: z.ZodNumber;
265
+ total: z.ZodNumber;
266
+ target: z.ZodOptional<z.ZodEnum<{
267
+ "source-files": "source-files";
268
+ compiled: "compiled";
269
+ }>>;
270
+ checks_fingerprint: z.ZodOptional<z.ZodString>;
271
+ stale: z.ZodOptional<z.ZodBoolean>;
272
+ test_run_id: z.ZodOptional<z.ZodString>;
273
+ }, z.core.$strict>, z.ZodObject<{
274
+ event_id: z.ZodString;
275
+ run_id: z.ZodString;
276
+ timestamp: z.ZodString;
277
+ type: z.ZodLiteral<"readiness.updated">;
278
+ preparation: z.ZodString;
279
+ readiness: z.ZodObject<{
280
+ kind: z.ZodLiteral<"interf-readiness-state">;
281
+ version: z.ZodLiteral<1>;
282
+ generated_at: z.ZodString;
283
+ preparation: z.ZodString;
284
+ status: z.ZodEnum<{
285
+ ready: "ready";
286
+ failed: "failed";
287
+ "not-configured": "not-configured";
288
+ "not-built": "not-built";
289
+ building: "building";
290
+ built: "built";
291
+ checking: "checking";
292
+ "not-ready": "not-ready";
293
+ stale: "stale";
294
+ }>;
295
+ ready: z.ZodBoolean;
296
+ summary: z.ZodString;
297
+ portable_context_path: z.ZodNullable<z.ZodString>;
298
+ latest_compile_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ latest_test_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ compile: z.ZodNullable<z.ZodObject<{
301
+ gate: z.ZodEnum<{
302
+ "portable-context": "portable-context";
303
+ "preparation-config": "preparation-config";
304
+ "compile-run": "compile-run";
305
+ "artifact-checks": "artifact-checks";
306
+ "readiness-checks": "readiness-checks";
307
+ "checks-current": "checks-current";
308
+ }>;
309
+ ok: z.ZodBoolean;
310
+ status: z.ZodOptional<z.ZodEnum<{
311
+ ready: "ready";
312
+ failed: "failed";
313
+ "not-configured": "not-configured";
314
+ "not-built": "not-built";
315
+ building: "building";
316
+ built: "built";
317
+ checking: "checking";
318
+ "not-ready": "not-ready";
319
+ stale: "stale";
320
+ }>>;
321
+ summary: z.ZodString;
322
+ detail: z.ZodOptional<z.ZodString>;
323
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
+ }, z.core.$strict>>;
326
+ check_results: z.ZodObject<{
327
+ configured: z.ZodNumber;
328
+ fingerprint: z.ZodNullable<z.ZodString>;
329
+ source_files: z.ZodNullable<z.ZodObject<{
330
+ passed: z.ZodNumber;
331
+ total: z.ZodNumber;
332
+ pass_rate: z.ZodNullable<z.ZodNumber>;
333
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
334
+ stale: z.ZodDefault<z.ZodBoolean>;
335
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
337
+ }, z.core.$strict>>;
338
+ portable_context: z.ZodNullable<z.ZodObject<{
339
+ passed: z.ZodNumber;
340
+ total: z.ZodNumber;
341
+ pass_rate: z.ZodNullable<z.ZodNumber>;
342
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
+ stale: z.ZodDefault<z.ZodBoolean>;
344
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ }, z.core.$strict>>;
347
+ }, z.core.$strict>;
348
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
349
+ gate: z.ZodEnum<{
350
+ "portable-context": "portable-context";
351
+ "preparation-config": "preparation-config";
352
+ "compile-run": "compile-run";
353
+ "artifact-checks": "artifact-checks";
354
+ "readiness-checks": "readiness-checks";
355
+ "checks-current": "checks-current";
356
+ }>;
357
+ ok: z.ZodBoolean;
358
+ status: z.ZodOptional<z.ZodEnum<{
359
+ ready: "ready";
360
+ failed: "failed";
361
+ "not-configured": "not-configured";
362
+ "not-built": "not-built";
363
+ building: "building";
364
+ built: "built";
365
+ checking: "checking";
366
+ "not-ready": "not-ready";
367
+ stale: "stale";
368
+ }>>;
369
+ summary: z.ZodString;
370
+ detail: z.ZodOptional<z.ZodString>;
371
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
372
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
373
+ }, z.core.$strict>>>;
374
+ }, z.core.$strict>;
375
+ }, z.core.$strict>], "type">>>;
376
+ latest_proof: z.ZodOptional<z.ZodNullable<z.ZodObject<{
377
+ id: z.ZodString;
378
+ run_id: z.ZodString;
379
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
+ generated_at: z.ZodString;
381
+ summary: z.ZodString;
382
+ files_processed: z.ZodOptional<z.ZodNumber>;
383
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
384
+ path: z.ZodString;
385
+ role: z.ZodEnum<{
386
+ runtime: "runtime";
387
+ output: "output";
388
+ source: "source";
389
+ proof: "proof";
390
+ test: "test";
391
+ }>;
392
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
393
+ label: z.ZodOptional<z.ZodString>;
394
+ sha256: z.ZodOptional<z.ZodString>;
395
+ }, z.core.$strict>>>;
396
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
397
+ id: z.ZodString;
398
+ label: z.ZodString;
399
+ ok: z.ZodBoolean;
400
+ detail: z.ZodOptional<z.ZodString>;
401
+ }, z.core.$strict>>>;
402
+ }, z.core.$strict>>>;
403
+ readiness: z.ZodOptional<z.ZodNullable<z.ZodObject<{
404
+ kind: z.ZodLiteral<"interf-readiness-state">;
405
+ version: z.ZodLiteral<1>;
406
+ generated_at: z.ZodString;
407
+ preparation: z.ZodString;
408
+ status: z.ZodEnum<{
409
+ ready: "ready";
410
+ failed: "failed";
411
+ "not-configured": "not-configured";
412
+ "not-built": "not-built";
413
+ building: "building";
414
+ built: "built";
415
+ checking: "checking";
416
+ "not-ready": "not-ready";
417
+ stale: "stale";
418
+ }>;
419
+ ready: z.ZodBoolean;
420
+ summary: z.ZodString;
421
+ portable_context_path: z.ZodNullable<z.ZodString>;
422
+ latest_compile_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
423
+ latest_test_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
424
+ compile: z.ZodNullable<z.ZodObject<{
425
+ gate: z.ZodEnum<{
426
+ "portable-context": "portable-context";
427
+ "preparation-config": "preparation-config";
428
+ "compile-run": "compile-run";
429
+ "artifact-checks": "artifact-checks";
430
+ "readiness-checks": "readiness-checks";
431
+ "checks-current": "checks-current";
432
+ }>;
433
+ ok: z.ZodBoolean;
434
+ status: z.ZodOptional<z.ZodEnum<{
435
+ ready: "ready";
436
+ failed: "failed";
437
+ "not-configured": "not-configured";
438
+ "not-built": "not-built";
439
+ building: "building";
440
+ built: "built";
441
+ checking: "checking";
442
+ "not-ready": "not-ready";
443
+ stale: "stale";
444
+ }>>;
445
+ summary: z.ZodString;
446
+ detail: z.ZodOptional<z.ZodString>;
447
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
448
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
449
+ }, z.core.$strict>>;
450
+ check_results: z.ZodObject<{
451
+ configured: z.ZodNumber;
452
+ fingerprint: z.ZodNullable<z.ZodString>;
453
+ source_files: z.ZodNullable<z.ZodObject<{
454
+ passed: z.ZodNumber;
455
+ total: z.ZodNumber;
456
+ pass_rate: z.ZodNullable<z.ZodNumber>;
457
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
+ stale: z.ZodDefault<z.ZodBoolean>;
459
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
460
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
461
+ }, z.core.$strict>>;
462
+ portable_context: z.ZodNullable<z.ZodObject<{
463
+ passed: z.ZodNumber;
464
+ total: z.ZodNumber;
465
+ pass_rate: z.ZodNullable<z.ZodNumber>;
466
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
467
+ stale: z.ZodDefault<z.ZodBoolean>;
468
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
469
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
+ }, z.core.$strict>>;
471
+ }, z.core.$strict>;
472
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
473
+ gate: z.ZodEnum<{
474
+ "portable-context": "portable-context";
475
+ "preparation-config": "preparation-config";
476
+ "compile-run": "compile-run";
477
+ "artifact-checks": "artifact-checks";
478
+ "readiness-checks": "readiness-checks";
479
+ "checks-current": "checks-current";
480
+ }>;
481
+ ok: z.ZodBoolean;
482
+ status: z.ZodOptional<z.ZodEnum<{
483
+ ready: "ready";
484
+ failed: "failed";
485
+ "not-configured": "not-configured";
486
+ "not-built": "not-built";
487
+ building: "building";
488
+ built: "built";
489
+ checking: "checking";
490
+ "not-ready": "not-ready";
491
+ stale: "stale";
492
+ }>>;
493
+ summary: z.ZodString;
494
+ detail: z.ZodOptional<z.ZodString>;
495
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
497
+ }, z.core.$strict>>>;
498
+ }, z.core.$strict>>>;
499
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
500
+ artifact_id: z.ZodString;
501
+ status: z.ZodEnum<{
502
+ ready: "ready";
503
+ not_ready: "not_ready";
504
+ failed: "failed";
505
+ skipped: "skipped";
506
+ }>;
507
+ built_by_stages: z.ZodDefault<z.ZodArray<z.ZodString>>;
508
+ proofs: z.ZodDefault<z.ZodArray<z.ZodObject<{
509
+ check_id: z.ZodString;
510
+ kind: z.ZodEnum<{
511
+ file_exists: "file_exists";
512
+ min_file_count: "min_file_count";
513
+ min_file_count_matches_source: "min_file_count_matches_source";
514
+ frontmatter_valid: "frontmatter_valid";
515
+ frontmatter_required_keys: "frontmatter_required_keys";
516
+ wikilinks_valid: "wikilinks_valid";
517
+ must_not_contain: "must_not_contain";
518
+ must_contain: "must_contain";
519
+ qa_match: "qa_match";
520
+ }>;
521
+ passed: z.ZodBoolean;
522
+ required: z.ZodBoolean;
523
+ summary: z.ZodString;
524
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
525
+ evaluated_at: z.ZodString;
526
+ }, z.core.$strict>>>;
527
+ summary: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strict>>>;
529
+ }, z.core.$strict>>;
530
+ }, z.core.$strict>;
531
+ export type PreparationCompileRunListResponse = z.infer<typeof PreparationCompileRunListResponseSchema>;
532
+ /**
533
+ * Thrown when `getJson` parses a response that fails the registered
534
+ * schema. Surfaces the request path and the zod issue list so the UI
535
+ * can render an actionable error rather than a stack trace.
536
+ *
537
+ * `issues` is typed as `unknown[]` so the class works across both
538
+ * `zod` dependency trees in the monorepo (root + `src/apps/compiler-ui`).
539
+ * Callers cast or render structurally as needed.
540
+ */
541
+ export declare class WireShapeError extends Error {
542
+ readonly name = "WireShapeError";
543
+ readonly path: string;
544
+ readonly issues: readonly unknown[];
545
+ constructor(options: {
546
+ path: string;
547
+ issues: readonly unknown[];
548
+ });
549
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * 0.17 — private wire-shape registry for the Compiler UI.
3
+ *
4
+ * The UI consumes the local-service API at `/v1/...`. Before 0.17 it
5
+ * cast each `getJson` response to a TypeScript type without runtime
6
+ * validation, which let the 0.16 prepRuns shape-mismatch bug
7
+ * (UI typed `{ runs: CompileRunResource[] }`, API returns
8
+ * `{ runs: CompileRun[] }`) ship to production. This module exposes
9
+ * the response schemas the UI needs so `getJson` can validate at the
10
+ * fetch boundary.
11
+ *
12
+ * **Stays private.** Do NOT re-export from
13
+ * `src/packages/engine/index.ts` and do NOT add a `package.json#exports`
14
+ * subpath. 0.16 just pruned three subpath exports
15
+ * (`./contracts`, `./execution`, `./local-service`); adding wire
16
+ * schemas to the public ABI would reverse that direction-of-travel.
17
+ * The Compiler UI builds inside the same repo and imports these
18
+ * schemas via relative path — no public ABI change.
19
+ */
20
+ import { z } from "zod";
21
+ import { ActionProposalListResponseSchema, InstanceResourceSchema, LocalExecutorStatusSchema, LocalServiceHealthSchema, MethodListResponseSchema, PreparationListResponseSchema, RunObservabilityListResponseSchema, ReadinessListResponseSchema, SourceFileListResponseSchema, VerifyRunListResponseSchema, } from "./lib/schema.js";
22
+ import { CompileRunSchema, } from "./execution/lib/schema.js";
23
+ export { ActionProposalListResponseSchema, InstanceResourceSchema, LocalExecutorStatusSchema, LocalServiceHealthSchema, MethodListResponseSchema, PreparationListResponseSchema, RunObservabilityListResponseSchema, ReadinessListResponseSchema, SourceFileListResponseSchema, VerifyRunListResponseSchema, };
24
+ /**
25
+ * `GET /v1/preparations/<id>/runs` returns a flat list of compile runs.
26
+ * The 0.16 bug came from typing this as `{ runs: CompileRunResource[] }`
27
+ * (the wrapped form `{ run: CompileRun }`) when the API returns the
28
+ * unwrapped form. Pinning the schema here prevents the regression.
29
+ */
30
+ export const PreparationCompileRunListResponseSchema = z.object({
31
+ runs: z.array(CompileRunSchema),
32
+ }).strict();
33
+ /**
34
+ * Thrown when `getJson` parses a response that fails the registered
35
+ * schema. Surfaces the request path and the zod issue list so the UI
36
+ * can render an actionable error rather than a stack trace.
37
+ *
38
+ * `issues` is typed as `unknown[]` so the class works across both
39
+ * `zod` dependency trees in the monorepo (root + `src/apps/compiler-ui`).
40
+ * Callers cast or render structurally as needed.
41
+ */
42
+ export class WireShapeError extends Error {
43
+ name = "WireShapeError";
44
+ path;
45
+ issues;
46
+ constructor(options) {
47
+ super(`Wire-shape validation failed for ${options.path}: ${options.issues.map((issue) => describeIssue(issue)).join("; ")}`);
48
+ this.path = options.path;
49
+ this.issues = options.issues;
50
+ }
51
+ }
52
+ function describeIssue(issue) {
53
+ if (typeof issue === "object" && issue !== null && "message" in issue) {
54
+ const message = issue.message;
55
+ if (typeof message === "string")
56
+ return message;
57
+ }
58
+ return JSON.stringify(issue);
59
+ }
@@ -1,6 +1,7 @@
1
+ import { type MethodAuthoringArtifactRequirement } from "../../engine/agents/lib/shells.js";
1
2
  import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
3
  import { validateMethodPackage } from "../package/local-methods.js";
3
- import type { SourceReadinessCheck } from "../../project/lib/schema.js";
4
+ import type { RequestedArtifact, SourceProfile, SourceReadinessCheck } from "../../project/lib/schema.js";
4
5
  /**
5
6
  * Walk method.json after a successful authoring run and fill in
6
7
  * `role: "general"` for any stage missing a role field. Custom role
@@ -26,6 +27,9 @@ export declare function runMethodAuthoringDraft(options: {
26
27
  hint: string;
27
28
  taskPrompt: string;
28
29
  checks?: SourceReadinessCheck[];
30
+ requestedArtifacts?: RequestedArtifact[];
31
+ sourceProfile?: SourceProfile | null;
32
+ artifactRequirements?: MethodAuthoringArtifactRequirement[];
29
33
  executor: MethodExecutor;
30
34
  onStatus?: (line: string) => void;
31
35
  }): Promise<MethodAuthoringRunResult>;