@interf/compiler 0.16.0 → 0.18.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 (133) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +10 -7
  3. package/TRADEMARKS.md +4 -4
  4. package/builtin-methods/interf-default/README.md +6 -7
  5. package/builtin-methods/interf-default/method.json +7 -68
  6. package/builtin-methods/interf-default/method.schema.json +52 -50
  7. package/dist/cli/commands/prep.js +58 -2
  8. package/dist/cli/commands/verify.d.ts +2 -0
  9. package/dist/cli/commands/verify.js +17 -8
  10. package/dist/cli/commands/wizard.js +122 -14
  11. package/dist/compiler-ui/404.html +1 -1
  12. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  13. package/dist/compiler-ui/__next._full.txt +3 -3
  14. package/dist/compiler-ui/__next._head.txt +1 -1
  15. package/dist/compiler-ui/__next._index.txt +2 -2
  16. package/dist/compiler-ui/__next._tree.txt +2 -2
  17. package/dist/compiler-ui/_next/static/chunks/{13awzu4tooflw.css → 0_c_tvh-cukjz.css} +1 -1
  18. package/dist/compiler-ui/_next/static/chunks/{0jipmpez3_ehh.js → 0f_geuwdesg_c.js} +42 -17
  19. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  20. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  21. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  22. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  23. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  24. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  25. package/dist/compiler-ui/_not-found.html +1 -1
  26. package/dist/compiler-ui/_not-found.txt +2 -2
  27. package/dist/compiler-ui/index.html +1 -1
  28. package/dist/compiler-ui/index.txt +3 -3
  29. package/dist/packages/contracts/index.d.ts +2 -2
  30. package/dist/packages/contracts/index.js +1 -1
  31. package/dist/packages/contracts/lib/schema.d.ts +271 -72
  32. package/dist/packages/contracts/lib/schema.js +243 -83
  33. package/dist/packages/engine/action-definitions.js +1 -1
  34. package/dist/packages/engine/agents/lib/shells.d.ts +12 -4
  35. package/dist/packages/engine/agents/lib/shells.js +127 -120
  36. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  37. package/dist/packages/engine/cloud-seams.js +84 -0
  38. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -1
  39. package/dist/packages/engine/compile/artifact-counts.js +3 -3
  40. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  41. package/dist/packages/engine/compile/artifact-status.js +166 -0
  42. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  43. package/dist/packages/engine/compile/billing-events.js +74 -0
  44. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  45. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  46. package/dist/packages/engine/compile/compiled-schema.d.ts +7 -17
  47. package/dist/packages/engine/compile/compiled-schema.js +55 -70
  48. package/dist/packages/engine/compile/compiled-stage-plan.d.ts +1 -0
  49. package/dist/packages/engine/compile/compiled-stage-plan.js +32 -15
  50. package/dist/packages/engine/compile/compiled-stage-runner.js +1 -1
  51. package/dist/packages/engine/compile/index.d.ts +0 -1
  52. package/dist/packages/engine/compile/index.js +0 -1
  53. package/dist/packages/engine/compile/lib/schema.d.ts +111 -92
  54. package/dist/packages/engine/compile/lib/schema.js +35 -39
  55. package/dist/packages/engine/compile/method-primitives.d.ts +2 -2
  56. package/dist/packages/engine/compile/method-primitives.js +1 -1
  57. package/dist/packages/engine/compile/reset.js +4 -4
  58. package/dist/packages/engine/compile/runtime-contracts.js +2 -1
  59. package/dist/packages/engine/compile/runtime-prompt.js +3 -2
  60. package/dist/packages/engine/compile/runtime-reconcile.js +35 -35
  61. package/dist/packages/engine/compile/runtime-runs.js +0 -1
  62. package/dist/packages/engine/compile/runtime-types.d.ts +7 -8
  63. package/dist/packages/engine/compile/runtime.d.ts +1 -2
  64. package/dist/packages/engine/compile/runtime.js +0 -1
  65. package/dist/packages/engine/compile/state-health.js +6 -6
  66. package/dist/packages/engine/compile/state-view.js +7 -6
  67. package/dist/packages/engine/compile/validate-compiled.js +61 -30
  68. package/dist/packages/engine/compile/validate.js +26 -24
  69. package/dist/packages/engine/execution/lib/schema.d.ts +79 -33
  70. package/dist/packages/engine/execution/lib/schema.js +13 -5
  71. package/dist/packages/engine/index.d.ts +2 -2
  72. package/dist/packages/engine/index.js +1 -1
  73. package/dist/packages/engine/lib/schema.d.ts +551 -242
  74. package/dist/packages/engine/lib/schema.js +53 -17
  75. package/dist/packages/engine/native-run-handlers.js +15 -7
  76. package/dist/packages/engine/preparation-store.d.ts +6 -0
  77. package/dist/packages/engine/preparation-store.js +8 -0
  78. package/dist/packages/engine/routes.d.ts +6 -0
  79. package/dist/packages/engine/routes.js +6 -0
  80. package/dist/packages/engine/run-observability.js +1 -2
  81. package/dist/packages/engine/runtime-event-applier.js +7 -0
  82. package/dist/packages/engine/runtime-proposal-helpers.js +1 -1
  83. package/dist/packages/engine/runtime-resource-builders.d.ts +6 -6
  84. package/dist/packages/engine/runtime-resource-builders.js +5 -4
  85. package/dist/packages/engine/runtime.d.ts +67 -7
  86. package/dist/packages/engine/runtime.js +159 -29
  87. package/dist/packages/engine/server.d.ts +25 -0
  88. package/dist/packages/engine/server.js +62 -3
  89. package/dist/packages/engine/verify/index.d.ts +10 -10
  90. package/dist/packages/engine/verify/index.js +8 -8
  91. package/dist/packages/engine/verify/readiness-check-run.d.ts +27 -4
  92. package/dist/packages/engine/verify/readiness-check-run.js +92 -24
  93. package/dist/packages/engine/verify/{test-execution.d.ts → verify-execution.d.ts} +2 -2
  94. package/dist/packages/engine/verify/{test-execution.js → verify-execution.js} +2 -2
  95. package/dist/packages/engine/verify/{test-paths.d.ts → verify-paths.d.ts} +1 -1
  96. package/dist/packages/engine/verify/{test-sandbox.d.ts → verify-sandbox.d.ts} +1 -1
  97. package/dist/packages/engine/verify/{test-specs.d.ts → verify-specs.d.ts} +1 -1
  98. package/dist/packages/engine/verify/{test-specs.js → verify-specs.js} +1 -1
  99. package/dist/packages/engine/verify/{test-targets.d.ts → verify-targets.d.ts} +1 -1
  100. package/dist/packages/engine/verify/{test.d.ts → verify.d.ts} +4 -4
  101. package/dist/packages/engine/verify/{test.js → verify.js} +3 -3
  102. package/dist/packages/engine/wire-schemas.d.ts +545 -0
  103. package/dist/packages/engine/wire-schemas.js +59 -0
  104. package/dist/packages/methods/authoring/method-authoring.d.ts +2 -0
  105. package/dist/packages/methods/authoring/method-authoring.js +99 -18
  106. package/dist/packages/methods/authoring/method-edit-session.js +5 -5
  107. package/dist/packages/methods/authoring/method-improvement.js +1 -1
  108. package/dist/packages/methods/package/builtin-compiled-method.d.ts +12 -12
  109. package/dist/packages/methods/package/builtin-compiled-method.js +25 -22
  110. package/dist/packages/methods/package/context-interface.d.ts +39 -26
  111. package/dist/packages/methods/package/context-interface.js +48 -39
  112. package/dist/packages/methods/package/interf-method-package.js +28 -47
  113. package/dist/packages/methods/package/local-methods.d.ts +3 -4
  114. package/dist/packages/methods/package/local-methods.js +34 -62
  115. package/dist/packages/methods/package/method-definitions.d.ts +4 -6
  116. package/dist/packages/methods/package/method-definitions.js +0 -4
  117. package/dist/packages/methods/package/method-helpers.d.ts +0 -2
  118. package/dist/packages/methods/package/method-helpers.js +0 -4
  119. package/dist/packages/project/interf-scaffold.js +12 -12
  120. package/dist/packages/project/source-config.js +2 -1
  121. package/package.json +6 -16
  122. package/dist/packages/engine/compile/runtime-acceptance.d.ts +0 -9
  123. package/dist/packages/engine/compile/runtime-acceptance.js +0 -265
  124. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
  125. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
  126. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
  127. /package/dist/packages/engine/verify/{test-paths.js → verify-paths.js} +0 -0
  128. /package/dist/packages/engine/verify/{test-profile-presets.d.ts → verify-profile-presets.d.ts} +0 -0
  129. /package/dist/packages/engine/verify/{test-profile-presets.js → verify-profile-presets.js} +0 -0
  130. /package/dist/packages/engine/verify/{test-sandbox.js → verify-sandbox.js} +0 -0
  131. /package/dist/packages/engine/verify/{test-targets.js → verify-targets.js} +0 -0
  132. /package/dist/packages/engine/verify/{test-types.d.ts → verify-types.d.ts} +0 -0
  133. /package/dist/packages/engine/verify/{test-types.js → verify-types.js} +0 -0
@@ -0,0 +1,545 @@
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
+ "readiness-checks": "readiness-checks";
306
+ "checks-current": "checks-current";
307
+ }>;
308
+ ok: z.ZodBoolean;
309
+ status: z.ZodOptional<z.ZodEnum<{
310
+ ready: "ready";
311
+ failed: "failed";
312
+ "not-configured": "not-configured";
313
+ "not-built": "not-built";
314
+ building: "building";
315
+ built: "built";
316
+ checking: "checking";
317
+ "not-ready": "not-ready";
318
+ stale: "stale";
319
+ }>>;
320
+ summary: z.ZodString;
321
+ detail: z.ZodOptional<z.ZodString>;
322
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
+ }, z.core.$strict>>;
325
+ check_results: z.ZodObject<{
326
+ configured: z.ZodNumber;
327
+ fingerprint: z.ZodNullable<z.ZodString>;
328
+ source_files: z.ZodNullable<z.ZodObject<{
329
+ passed: z.ZodNumber;
330
+ total: z.ZodNumber;
331
+ pass_rate: z.ZodNullable<z.ZodNumber>;
332
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ stale: z.ZodDefault<z.ZodBoolean>;
334
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ }, z.core.$strict>>;
337
+ portable_context: z.ZodNullable<z.ZodObject<{
338
+ passed: z.ZodNumber;
339
+ total: z.ZodNumber;
340
+ pass_rate: z.ZodNullable<z.ZodNumber>;
341
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
342
+ stale: z.ZodDefault<z.ZodBoolean>;
343
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ }, z.core.$strict>>;
346
+ }, z.core.$strict>;
347
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
348
+ gate: z.ZodEnum<{
349
+ "portable-context": "portable-context";
350
+ "preparation-config": "preparation-config";
351
+ "compile-run": "compile-run";
352
+ "readiness-checks": "readiness-checks";
353
+ "checks-current": "checks-current";
354
+ }>;
355
+ ok: z.ZodBoolean;
356
+ status: z.ZodOptional<z.ZodEnum<{
357
+ ready: "ready";
358
+ failed: "failed";
359
+ "not-configured": "not-configured";
360
+ "not-built": "not-built";
361
+ building: "building";
362
+ built: "built";
363
+ checking: "checking";
364
+ "not-ready": "not-ready";
365
+ stale: "stale";
366
+ }>>;
367
+ summary: z.ZodString;
368
+ detail: z.ZodOptional<z.ZodString>;
369
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
370
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
371
+ }, z.core.$strict>>>;
372
+ }, z.core.$strict>;
373
+ }, z.core.$strict>], "type">>>;
374
+ latest_proof: z.ZodOptional<z.ZodNullable<z.ZodObject<{
375
+ id: z.ZodString;
376
+ run_id: z.ZodString;
377
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
+ generated_at: z.ZodString;
379
+ summary: z.ZodString;
380
+ files_processed: z.ZodOptional<z.ZodNumber>;
381
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
382
+ path: z.ZodString;
383
+ role: z.ZodEnum<{
384
+ runtime: "runtime";
385
+ output: "output";
386
+ source: "source";
387
+ proof: "proof";
388
+ test: "test";
389
+ }>;
390
+ stage_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
391
+ label: z.ZodOptional<z.ZodString>;
392
+ sha256: z.ZodOptional<z.ZodString>;
393
+ }, z.core.$strict>>>;
394
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
395
+ id: z.ZodString;
396
+ label: z.ZodString;
397
+ ok: z.ZodBoolean;
398
+ detail: z.ZodOptional<z.ZodString>;
399
+ }, z.core.$strict>>>;
400
+ }, z.core.$strict>>>;
401
+ readiness: z.ZodOptional<z.ZodNullable<z.ZodObject<{
402
+ kind: z.ZodLiteral<"interf-readiness-state">;
403
+ version: z.ZodLiteral<1>;
404
+ generated_at: z.ZodString;
405
+ preparation: z.ZodString;
406
+ status: z.ZodEnum<{
407
+ ready: "ready";
408
+ failed: "failed";
409
+ "not-configured": "not-configured";
410
+ "not-built": "not-built";
411
+ building: "building";
412
+ built: "built";
413
+ checking: "checking";
414
+ "not-ready": "not-ready";
415
+ stale: "stale";
416
+ }>;
417
+ ready: z.ZodBoolean;
418
+ summary: z.ZodString;
419
+ portable_context_path: z.ZodNullable<z.ZodString>;
420
+ latest_compile_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
421
+ latest_test_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
422
+ compile: z.ZodNullable<z.ZodObject<{
423
+ gate: z.ZodEnum<{
424
+ "portable-context": "portable-context";
425
+ "preparation-config": "preparation-config";
426
+ "compile-run": "compile-run";
427
+ "readiness-checks": "readiness-checks";
428
+ "checks-current": "checks-current";
429
+ }>;
430
+ ok: z.ZodBoolean;
431
+ status: z.ZodOptional<z.ZodEnum<{
432
+ ready: "ready";
433
+ failed: "failed";
434
+ "not-configured": "not-configured";
435
+ "not-built": "not-built";
436
+ building: "building";
437
+ built: "built";
438
+ checking: "checking";
439
+ "not-ready": "not-ready";
440
+ stale: "stale";
441
+ }>>;
442
+ summary: z.ZodString;
443
+ detail: z.ZodOptional<z.ZodString>;
444
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
445
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
446
+ }, z.core.$strict>>;
447
+ check_results: z.ZodObject<{
448
+ configured: z.ZodNumber;
449
+ fingerprint: z.ZodNullable<z.ZodString>;
450
+ source_files: z.ZodNullable<z.ZodObject<{
451
+ passed: z.ZodNumber;
452
+ total: z.ZodNumber;
453
+ pass_rate: z.ZodNullable<z.ZodNumber>;
454
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
455
+ stale: z.ZodDefault<z.ZodBoolean>;
456
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
457
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
+ }, z.core.$strict>>;
459
+ portable_context: z.ZodNullable<z.ZodObject<{
460
+ passed: z.ZodNumber;
461
+ total: z.ZodNumber;
462
+ pass_rate: z.ZodNullable<z.ZodNumber>;
463
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
464
+ stale: z.ZodDefault<z.ZodBoolean>;
465
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
466
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
467
+ }, z.core.$strict>>;
468
+ }, z.core.$strict>;
469
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
470
+ gate: z.ZodEnum<{
471
+ "portable-context": "portable-context";
472
+ "preparation-config": "preparation-config";
473
+ "compile-run": "compile-run";
474
+ "readiness-checks": "readiness-checks";
475
+ "checks-current": "checks-current";
476
+ }>;
477
+ ok: z.ZodBoolean;
478
+ status: z.ZodOptional<z.ZodEnum<{
479
+ ready: "ready";
480
+ failed: "failed";
481
+ "not-configured": "not-configured";
482
+ "not-built": "not-built";
483
+ building: "building";
484
+ built: "built";
485
+ checking: "checking";
486
+ "not-ready": "not-ready";
487
+ stale: "stale";
488
+ }>>;
489
+ summary: z.ZodString;
490
+ detail: z.ZodOptional<z.ZodString>;
491
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
492
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
493
+ }, z.core.$strict>>>;
494
+ }, z.core.$strict>>>;
495
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
496
+ artifact_id: z.ZodString;
497
+ status: z.ZodEnum<{
498
+ ready: "ready";
499
+ not_ready: "not_ready";
500
+ failed: "failed";
501
+ skipped: "skipped";
502
+ }>;
503
+ built_by_stages: z.ZodDefault<z.ZodArray<z.ZodString>>;
504
+ proofs: z.ZodDefault<z.ZodArray<z.ZodObject<{
505
+ check_id: z.ZodString;
506
+ kind: z.ZodEnum<{
507
+ file_exists: "file_exists";
508
+ min_file_count: "min_file_count";
509
+ min_file_count_matches_source: "min_file_count_matches_source";
510
+ frontmatter_valid: "frontmatter_valid";
511
+ frontmatter_required_keys: "frontmatter_required_keys";
512
+ wikilinks_valid: "wikilinks_valid";
513
+ must_not_contain: "must_not_contain";
514
+ must_contain: "must_contain";
515
+ qa_match: "qa_match";
516
+ }>;
517
+ passed: z.ZodBoolean;
518
+ required: z.ZodBoolean;
519
+ summary: z.ZodString;
520
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
521
+ evaluated_at: z.ZodString;
522
+ }, z.core.$strict>>>;
523
+ summary: z.ZodOptional<z.ZodString>;
524
+ }, z.core.$strict>>>;
525
+ }, z.core.$strict>>;
526
+ }, z.core.$strict>;
527
+ export type PreparationCompileRunListResponse = z.infer<typeof PreparationCompileRunListResponseSchema>;
528
+ /**
529
+ * Thrown when `getJson` parses a response that fails the registered
530
+ * schema. Surfaces the request path and the zod issue list so the UI
531
+ * can render an actionable error rather than a stack trace.
532
+ *
533
+ * `issues` is typed as `unknown[]` so the class works across both
534
+ * `zod` dependency trees in the monorepo (root + `apps/compiler-ui`).
535
+ * Callers cast or render structurally as needed.
536
+ */
537
+ export declare class WireShapeError extends Error {
538
+ readonly name = "WireShapeError";
539
+ readonly path: string;
540
+ readonly issues: readonly unknown[];
541
+ constructor(options: {
542
+ path: string;
543
+ issues: readonly unknown[];
544
+ });
545
+ }
@@ -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 + `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,3 +1,4 @@
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
4
  import type { SourceReadinessCheck } from "../../project/lib/schema.js";
@@ -26,6 +27,7 @@ export declare function runMethodAuthoringDraft(options: {
26
27
  hint: string;
27
28
  taskPrompt: string;
28
29
  checks?: SourceReadinessCheck[];
30
+ artifactRequirements?: MethodAuthoringArtifactRequirement[];
29
31
  executor: MethodExecutor;
30
32
  onStatus?: (line: string) => void;
31
33
  }): Promise<MethodAuthoringRunResult>;