@ogygie/generate 0.0.0-stage → 0.20.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -2
  3. package/dist/behavior-binding.d.ts +47 -0
  4. package/dist/behavior-grammar.d.ts +53 -0
  5. package/dist/check-spec.d.ts +53 -0
  6. package/dist/chunk-WVFHAPGC.js +10992 -0
  7. package/dist/cli/check-command.d.ts +3 -0
  8. package/dist/cli/fill-command.d.ts +39 -0
  9. package/dist/cli/generate-command.d.ts +8 -0
  10. package/dist/cli/generate-screen-command.d.ts +6 -0
  11. package/dist/cli/output.d.ts +9 -0
  12. package/dist/cli/preview-command.d.ts +19 -0
  13. package/dist/cli/project.d.ts +97 -0
  14. package/dist/cli/run.d.ts +13 -0
  15. package/dist/cli/run.js +1127 -0
  16. package/dist/cli/schemas-command.d.ts +31 -0
  17. package/dist/cli/verify-command.d.ts +3 -0
  18. package/dist/consumed-feature.d.ts +32 -0
  19. package/dist/emit/db.d.ts +27 -0
  20. package/dist/emit/factories.d.ts +14 -0
  21. package/dist/emit/hole-doc.d.ts +18 -0
  22. package/dist/emit/hole-tests.d.ts +28 -0
  23. package/dist/emit/manifest-entry.d.ts +44 -0
  24. package/dist/emit/mssql/migration.d.ts +2 -0
  25. package/dist/emit/mssql/repository.d.ts +17 -0
  26. package/dist/emit/mssql/sql-types.d.ts +23 -0
  27. package/dist/emit/mssql/statements.d.ts +55 -0
  28. package/dist/emit/mssql/stub.d.ts +17 -0
  29. package/dist/emit/names.d.ts +34 -0
  30. package/dist/emit/plan.d.ts +428 -0
  31. package/dist/emit/repository.d.ts +16 -0
  32. package/dist/emit/routes.d.ts +22 -0
  33. package/dist/emit/runtime.d.ts +47 -0
  34. package/dist/emit/screen/container.d.ts +17 -0
  35. package/dist/emit/screen/fixtures.d.ts +14 -0
  36. package/dist/emit/screen/hole-doc.d.ts +2 -0
  37. package/dist/emit/screen/previews.d.ts +24 -0
  38. package/dist/emit/screen/queries.d.ts +10 -0
  39. package/dist/emit/screen/shared.d.ts +35 -0
  40. package/dist/emit/screen/spec-contracts.d.ts +10 -0
  41. package/dist/emit/screen/tests-static.d.ts +21 -0
  42. package/dist/emit/screen/tests.d.ts +19 -0
  43. package/dist/emit/screen/views.d.ts +10 -0
  44. package/dist/emit/screen/writes.d.ts +9 -0
  45. package/dist/emit/screen-plan.d.ts +187 -0
  46. package/dist/emit/service.d.ts +18 -0
  47. package/dist/emit/spec-contracts.d.ts +27 -0
  48. package/dist/emit/tests.d.ts +3 -0
  49. package/dist/fill/body.d.ts +26 -0
  50. package/dist/fill/fill.d.ts +97 -0
  51. package/dist/fill/model-draw.d.ts +25 -0
  52. package/dist/generate-feature.d.ts +23 -0
  53. package/dist/generate-screen.d.ts +19 -0
  54. package/dist/generation-block.schema.d.ts +1279 -0
  55. package/dist/hole-shape.d.ts +100 -0
  56. package/dist/index.d.ts +45 -0
  57. package/dist/index.js +401 -0
  58. package/dist/manifest-generation.schema.d.ts +239 -0
  59. package/dist/motif-catalog.d.ts +175 -0
  60. package/dist/package-root.d.ts +5 -0
  61. package/dist/prompt-card.d.ts +3 -0
  62. package/dist/schema-checks.d.ts +32 -0
  63. package/dist/schemas/draft.d.ts +111 -0
  64. package/dist/screen-block.schema.d.ts +146 -0
  65. package/dist/screen-checks.d.ts +34 -0
  66. package/dist/screen-grammar.d.ts +36 -0
  67. package/dist/screen-vocabulary.d.ts +47 -0
  68. package/dist/spec-sections.d.ts +51 -0
  69. package/dist/verify-generation.d.ts +93 -0
  70. package/dist/vocabulary.d.ts +39 -0
  71. package/dist/zod-introspection.d.ts +119 -0
  72. package/holes-library/27560e1760bb184c.json +28 -0
  73. package/holes-library/2c26136fc6bff99a.json +30 -0
  74. package/holes-library/43a27770407bb38a.json +27 -0
  75. package/holes-library/46e67880a81012bc.json +27 -0
  76. package/holes-library/48dc5c44dc2cf3b7.json +32 -0
  77. package/holes-library/63d0825a61f6f5d3.json +27 -0
  78. package/holes-library/6784ed6c8e353dac.json +27 -0
  79. package/holes-library/8b4e4c8f04a5fc6a.json +31 -0
  80. package/holes-library/README.md +33 -0
  81. package/holes-library/d3597f50c265ba0c.json +27 -0
  82. package/holes-library/e48695e16221ff1a.json +32 -0
  83. package/package.json +59 -3
@@ -0,0 +1,1279 @@
1
+ /**
2
+ * @intent Zod schema AND parser of the `# Génération` block of a spec
3
+ * (DECISIONS.md D18, D28, D30, D32): ONE fenced YAML block, four keys —
4
+ * `contracts`, `operations`, `motifs`, `holes` — nothing else. The shape is
5
+ * validated field by field, then every cross-reference is checked (an
6
+ * operation that uses an unknown motif or method, a hole nobody carries, two
7
+ * operations on one route, a method that does not fit the kind, a keyed write
8
+ * whose `by` is not the contracts key, a slot or a reference nobody declared,
9
+ * a `respondsWith` that is not a read of the block, a view reading an unknown
10
+ * table…) and each violation names its path: the refusal is
11
+ * `OGYGIE_GENERATION_BLOCK_INVALID`, with `details.path` dot-joined
12
+ * (`operations.3.uses`) so an agent fixes the right line without guessing.
13
+ *
14
+ * The YAML is read by the `yaml` package — a real parser, carried by this
15
+ * package alone (D11) — never by the core's restricted frontmatter reader,
16
+ * which would misread a nested object as a string without a sound.
17
+ * What the block cannot check without the schemas module (does
18
+ * `CreateRateInputSchema` exist? are `reads` fields of the input?) is
19
+ * `schema-checks.ts` (D19): this module says so instead of pretending.
20
+ */
21
+ import { z } from "zod";
22
+ import { type OgygieError } from "@ogygie/core/errors";
23
+ import { type HttpOperationKind } from "./motif-catalog.js";
24
+ export declare const GENERATION_BLOCK_INVALID = "OGYGIE_GENERATION_BLOCK_INVALID";
25
+ export declare const GENERATION_BLOCK_KEYS: readonly ["contracts", "operations", "motifs", "holes"];
26
+ /** SQL types a `columns` override may name — what Zod cannot express alone. */
27
+ export declare const SqlTypeSchema: z.ZodString;
28
+ export declare const TableNameSchema: z.ZodString;
29
+ /** A route under /api/, lowercase segments, `:camelCase` parameters (the key and the slot key of a keyed write). */
30
+ export declare const RoutePathSchema: z.ZodString;
31
+ /** A cache root the mutation stales, as the manifest-derived client reads them. */
32
+ export declare const CacheRootSchema: z.ZodString;
33
+ /** A path into an output: `canManage`, `grades[].holderCount`. */
34
+ export declare const OutputPathSchema: z.ZodString;
35
+ export declare const HoleEffectSchema: z.ZodEnum<{
36
+ clock: "clock";
37
+ db: "db";
38
+ }>;
39
+ export declare const TransformSourceSchema: z.ZodEnum<{
40
+ "text/csv": "text/csv";
41
+ }>;
42
+ export declare const HttpMethodSchema: z.ZodEnum<{
43
+ GET: "GET";
44
+ POST: "POST";
45
+ PATCH: "PATCH";
46
+ PUT: "PUT";
47
+ DELETE: "DELETE";
48
+ }>;
49
+ export declare const SUCCESS_STATUS_BY_KIND: Readonly<Record<HttpOperationKind, number>>;
50
+ /** The one method each kind answers to (D22, D28). */
51
+ export declare const METHOD_BY_KIND: Readonly<Record<HttpOperationKind, z.infer<typeof HttpMethodSchema>>>;
52
+ /** D36: a constraint name as the database knows it — raw: the one thing of an adopted table the target does not render. */
53
+ export declare const ConstraintNameSchema: z.ZodString;
54
+ /** D36: one column of an adopted table — its logical name (camelCase, rendered in the target's casing) and its SQL type (the `columns` vocabulary, rendered by the target). */
55
+ export declare const AdoptedColumnSchema: z.ZodObject<{
56
+ name: z.ZodString;
57
+ type: z.ZodString;
58
+ }, z.core.$strict>;
59
+ export type AdoptedColumn = z.infer<typeof AdoptedColumnSchema>;
60
+ /** D36: the CLOSED list of what the generator may ALTER on an adopted table — each step replayable, everything else written by hand. */
61
+ export declare const AlterStepSchema: z.ZodUnion<readonly [z.ZodObject<{
62
+ drop: z.ZodLiteral<"check">;
63
+ name: z.ZodString;
64
+ }, z.core.$strict>, z.ZodObject<{
65
+ add: z.ZodLiteral<"check">;
66
+ name: z.ZodString;
67
+ column: z.ZodString;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ add: z.ZodLiteral<"foreignKey">;
70
+ name: z.ZodString;
71
+ columns: z.ZodArray<z.ZodString>;
72
+ references: z.ZodObject<{
73
+ table: z.ZodString;
74
+ columns: z.ZodArray<z.ZodString>;
75
+ }, z.core.$strict>;
76
+ onDelete: z.ZodEnum<{
77
+ cascade: "cascade";
78
+ restrict: "restrict";
79
+ }>;
80
+ }, z.core.$strict>, z.ZodObject<{
81
+ add: z.ZodLiteral<"column">;
82
+ field: z.ZodString;
83
+ }, z.core.$strict>]>;
84
+ export type AlterStep = z.infer<typeof AlterStepSchema>;
85
+ /**
86
+ * D36: a table by its declared shape. `owned` (the default of a bare name): the generator creates it. `adopted`: the table
87
+ * exists in the product; `columns` declares every field the generator touches, `key` its primary key (composite allowed),
88
+ * `id: none` that there is no identity column, `alter` what the migration may change about it.
89
+ */
90
+ export declare const TableRefSchema: z.ZodObject<{
91
+ name: z.ZodString;
92
+ mode: z.ZodEnum<{
93
+ owned: "owned";
94
+ adopted: "adopted";
95
+ }>;
96
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
97
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
99
+ name: z.ZodString;
100
+ type: z.ZodString;
101
+ }, z.core.$strict>>>;
102
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
103
+ drop: z.ZodLiteral<"check">;
104
+ name: z.ZodString;
105
+ }, z.core.$strict>, z.ZodObject<{
106
+ add: z.ZodLiteral<"check">;
107
+ name: z.ZodString;
108
+ column: z.ZodString;
109
+ }, z.core.$strict>, z.ZodObject<{
110
+ add: z.ZodLiteral<"foreignKey">;
111
+ name: z.ZodString;
112
+ columns: z.ZodArray<z.ZodString>;
113
+ references: z.ZodObject<{
114
+ table: z.ZodString;
115
+ columns: z.ZodArray<z.ZodString>;
116
+ }, z.core.$strict>;
117
+ onDelete: z.ZodEnum<{
118
+ cascade: "cascade";
119
+ restrict: "restrict";
120
+ }>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ add: z.ZodLiteral<"column">;
123
+ field: z.ZodString;
124
+ }, z.core.$strict>]>>>;
125
+ }, z.core.$strict>;
126
+ export type TableRef = z.infer<typeof TableRefSchema>;
127
+ /** A table of the block: its snake_case name alone (owned), or its TableRef. */
128
+ export declare const TableDeclarationSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
129
+ name: z.ZodString;
130
+ mode: z.ZodEnum<{
131
+ owned: "owned";
132
+ adopted: "adopted";
133
+ }>;
134
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
135
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
137
+ name: z.ZodString;
138
+ type: z.ZodString;
139
+ }, z.core.$strict>>>;
140
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
141
+ drop: z.ZodLiteral<"check">;
142
+ name: z.ZodString;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ add: z.ZodLiteral<"check">;
145
+ name: z.ZodString;
146
+ column: z.ZodString;
147
+ }, z.core.$strict>, z.ZodObject<{
148
+ add: z.ZodLiteral<"foreignKey">;
149
+ name: z.ZodString;
150
+ columns: z.ZodArray<z.ZodString>;
151
+ references: z.ZodObject<{
152
+ table: z.ZodString;
153
+ columns: z.ZodArray<z.ZodString>;
154
+ }, z.core.$strict>;
155
+ onDelete: z.ZodEnum<{
156
+ cascade: "cascade";
157
+ restrict: "restrict";
158
+ }>;
159
+ }, z.core.$strict>, z.ZodObject<{
160
+ add: z.ZodLiteral<"column">;
161
+ field: z.ZodString;
162
+ }, z.core.$strict>]>>>;
163
+ }, z.core.$strict>]>;
164
+ export type TableDeclaration = z.infer<typeof TableDeclarationSchema>;
165
+ export declare function tableNameOf(table: TableDeclaration): string;
166
+ /** The declared shape of a table, a bare name being an owned table with an id. */
167
+ export declare function tableRefOf(table: TableDeclaration): TableRef;
168
+ /** The field of a slot or reference row that carries the resource key: `GradeSchema` + `code` → `gradeCode` (D28). */
169
+ export declare function parentKeyFieldOf(resourceSchema: string, key: string): string;
170
+ /** D28: a detail table of values by composite key (resource key, slot key), FK ON DELETE CASCADE. */
171
+ export declare const SlotSchema: z.ZodObject<{
172
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
173
+ name: z.ZodString;
174
+ mode: z.ZodEnum<{
175
+ owned: "owned";
176
+ adopted: "adopted";
177
+ }>;
178
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
179
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
181
+ name: z.ZodString;
182
+ type: z.ZodString;
183
+ }, z.core.$strict>>>;
184
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
185
+ drop: z.ZodLiteral<"check">;
186
+ name: z.ZodString;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ add: z.ZodLiteral<"check">;
189
+ name: z.ZodString;
190
+ column: z.ZodString;
191
+ }, z.core.$strict>, z.ZodObject<{
192
+ add: z.ZodLiteral<"foreignKey">;
193
+ name: z.ZodString;
194
+ columns: z.ZodArray<z.ZodString>;
195
+ references: z.ZodObject<{
196
+ table: z.ZodString;
197
+ columns: z.ZodArray<z.ZodString>;
198
+ }, z.core.$strict>;
199
+ onDelete: z.ZodEnum<{
200
+ cascade: "cascade";
201
+ restrict: "restrict";
202
+ }>;
203
+ }, z.core.$strict>, z.ZodObject<{
204
+ add: z.ZodLiteral<"column">;
205
+ field: z.ZodString;
206
+ }, z.core.$strict>]>>>;
207
+ }, z.core.$strict>]>;
208
+ key: z.ZodString;
209
+ value: z.ZodString;
210
+ schema: z.ZodString;
211
+ field: z.ZodString;
212
+ }, z.core.$strict>;
213
+ export type Slot = z.infer<typeof SlotSchema>;
214
+ /** D28: a table that POINTS at the resource — counted by refuseWhenReferenced, exposed by countField. */
215
+ export declare const ReferenceSchema: z.ZodObject<{
216
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
217
+ name: z.ZodString;
218
+ mode: z.ZodEnum<{
219
+ owned: "owned";
220
+ adopted: "adopted";
221
+ }>;
222
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
223
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
225
+ name: z.ZodString;
226
+ type: z.ZodString;
227
+ }, z.core.$strict>>>;
228
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
229
+ drop: z.ZodLiteral<"check">;
230
+ name: z.ZodString;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ add: z.ZodLiteral<"check">;
233
+ name: z.ZodString;
234
+ column: z.ZodString;
235
+ }, z.core.$strict>, z.ZodObject<{
236
+ add: z.ZodLiteral<"foreignKey">;
237
+ name: z.ZodString;
238
+ columns: z.ZodArray<z.ZodString>;
239
+ references: z.ZodObject<{
240
+ table: z.ZodString;
241
+ columns: z.ZodArray<z.ZodString>;
242
+ }, z.core.$strict>;
243
+ onDelete: z.ZodEnum<{
244
+ cascade: "cascade";
245
+ restrict: "restrict";
246
+ }>;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ add: z.ZodLiteral<"column">;
249
+ field: z.ZodString;
250
+ }, z.core.$strict>]>>>;
251
+ }, z.core.$strict>]>;
252
+ column: z.ZodString;
253
+ schema: z.ZodOptional<z.ZodString>;
254
+ countField: z.ZodOptional<z.ZodString>;
255
+ }, z.core.$strict>;
256
+ export type Reference = z.infer<typeof ReferenceSchema>;
257
+ export declare const ContractsSchema: z.ZodObject<{
258
+ module: z.ZodString;
259
+ resource: z.ZodOptional<z.ZodString>;
260
+ table: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
261
+ name: z.ZodString;
262
+ mode: z.ZodEnum<{
263
+ owned: "owned";
264
+ adopted: "adopted";
265
+ }>;
266
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
267
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
268
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
269
+ name: z.ZodString;
270
+ type: z.ZodString;
271
+ }, z.core.$strict>>>;
272
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
273
+ drop: z.ZodLiteral<"check">;
274
+ name: z.ZodString;
275
+ }, z.core.$strict>, z.ZodObject<{
276
+ add: z.ZodLiteral<"check">;
277
+ name: z.ZodString;
278
+ column: z.ZodString;
279
+ }, z.core.$strict>, z.ZodObject<{
280
+ add: z.ZodLiteral<"foreignKey">;
281
+ name: z.ZodString;
282
+ columns: z.ZodArray<z.ZodString>;
283
+ references: z.ZodObject<{
284
+ table: z.ZodString;
285
+ columns: z.ZodArray<z.ZodString>;
286
+ }, z.core.$strict>;
287
+ onDelete: z.ZodEnum<{
288
+ cascade: "cascade";
289
+ restrict: "restrict";
290
+ }>;
291
+ }, z.core.$strict>, z.ZodObject<{
292
+ add: z.ZodLiteral<"column">;
293
+ field: z.ZodString;
294
+ }, z.core.$strict>]>>>;
295
+ }, z.core.$strict>]>>;
296
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
297
+ indexes: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
298
+ key: z.ZodOptional<z.ZodString>;
299
+ slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
300
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
301
+ name: z.ZodString;
302
+ mode: z.ZodEnum<{
303
+ owned: "owned";
304
+ adopted: "adopted";
305
+ }>;
306
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
307
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
308
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
309
+ name: z.ZodString;
310
+ type: z.ZodString;
311
+ }, z.core.$strict>>>;
312
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
313
+ drop: z.ZodLiteral<"check">;
314
+ name: z.ZodString;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ add: z.ZodLiteral<"check">;
317
+ name: z.ZodString;
318
+ column: z.ZodString;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ add: z.ZodLiteral<"foreignKey">;
321
+ name: z.ZodString;
322
+ columns: z.ZodArray<z.ZodString>;
323
+ references: z.ZodObject<{
324
+ table: z.ZodString;
325
+ columns: z.ZodArray<z.ZodString>;
326
+ }, z.core.$strict>;
327
+ onDelete: z.ZodEnum<{
328
+ cascade: "cascade";
329
+ restrict: "restrict";
330
+ }>;
331
+ }, z.core.$strict>, z.ZodObject<{
332
+ add: z.ZodLiteral<"column">;
333
+ field: z.ZodString;
334
+ }, z.core.$strict>]>>>;
335
+ }, z.core.$strict>]>;
336
+ key: z.ZodString;
337
+ value: z.ZodString;
338
+ schema: z.ZodString;
339
+ field: z.ZodString;
340
+ }, z.core.$strict>>>;
341
+ references: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
342
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
343
+ name: z.ZodString;
344
+ mode: z.ZodEnum<{
345
+ owned: "owned";
346
+ adopted: "adopted";
347
+ }>;
348
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
349
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
350
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
351
+ name: z.ZodString;
352
+ type: z.ZodString;
353
+ }, z.core.$strict>>>;
354
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
355
+ drop: z.ZodLiteral<"check">;
356
+ name: z.ZodString;
357
+ }, z.core.$strict>, z.ZodObject<{
358
+ add: z.ZodLiteral<"check">;
359
+ name: z.ZodString;
360
+ column: z.ZodString;
361
+ }, z.core.$strict>, z.ZodObject<{
362
+ add: z.ZodLiteral<"foreignKey">;
363
+ name: z.ZodString;
364
+ columns: z.ZodArray<z.ZodString>;
365
+ references: z.ZodObject<{
366
+ table: z.ZodString;
367
+ columns: z.ZodArray<z.ZodString>;
368
+ }, z.core.$strict>;
369
+ onDelete: z.ZodEnum<{
370
+ cascade: "cascade";
371
+ restrict: "restrict";
372
+ }>;
373
+ }, z.core.$strict>, z.ZodObject<{
374
+ add: z.ZodLiteral<"column">;
375
+ field: z.ZodString;
376
+ }, z.core.$strict>]>>>;
377
+ }, z.core.$strict>]>;
378
+ column: z.ZodString;
379
+ schema: z.ZodOptional<z.ZodString>;
380
+ countField: z.ZodOptional<z.ZodString>;
381
+ }, z.core.$strict>>>;
382
+ sharedTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
383
+ }, z.core.$strict>;
384
+ export declare const OrderBySchema: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodEnum<{
385
+ asc: "asc";
386
+ desc: "desc";
387
+ }>], null>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
388
+ asc: "asc";
389
+ desc: "desc";
390
+ }>], null>>]>;
391
+ export declare const ReadOperationSchema: z.ZodObject<{
392
+ kind: z.ZodLiteral<"read">;
393
+ orderBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodEnum<{
394
+ asc: "asc";
395
+ desc: "desc";
396
+ }>], null>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
397
+ asc: "asc";
398
+ desc: "desc";
399
+ }>], null>>]>>;
400
+ limit: z.ZodOptional<z.ZodNumber>;
401
+ range: z.ZodOptional<z.ZodString>;
402
+ id: z.ZodString;
403
+ method: z.ZodEnum<{
404
+ GET: "GET";
405
+ POST: "POST";
406
+ PATCH: "PATCH";
407
+ PUT: "PUT";
408
+ DELETE: "DELETE";
409
+ }>;
410
+ path: z.ZodString;
411
+ guard: z.ZodString;
412
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
413
+ input: z.ZodString;
414
+ output: z.ZodString;
415
+ uses: z.ZodOptional<z.ZodString>;
416
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
417
+ }, z.core.$strict>;
418
+ export declare const CreateOperationSchema: z.ZodObject<{
419
+ kind: z.ZodLiteral<"create">;
420
+ respondsWith: z.ZodOptional<z.ZodString>;
421
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
422
+ id: z.ZodString;
423
+ method: z.ZodEnum<{
424
+ GET: "GET";
425
+ POST: "POST";
426
+ PATCH: "PATCH";
427
+ PUT: "PUT";
428
+ DELETE: "DELETE";
429
+ }>;
430
+ path: z.ZodString;
431
+ guard: z.ZodString;
432
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
433
+ input: z.ZodString;
434
+ output: z.ZodString;
435
+ uses: z.ZodOptional<z.ZodString>;
436
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
437
+ }, z.core.$strict>;
438
+ export declare const ImportOperationSchema: z.ZodObject<{
439
+ kind: z.ZodLiteral<"import">;
440
+ respondsWith: z.ZodOptional<z.ZodString>;
441
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
442
+ id: z.ZodString;
443
+ method: z.ZodEnum<{
444
+ GET: "GET";
445
+ POST: "POST";
446
+ PATCH: "PATCH";
447
+ PUT: "PUT";
448
+ DELETE: "DELETE";
449
+ }>;
450
+ path: z.ZodString;
451
+ guard: z.ZodString;
452
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
453
+ input: z.ZodString;
454
+ output: z.ZodString;
455
+ uses: z.ZodOptional<z.ZodString>;
456
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
457
+ }, z.core.$strict>;
458
+ export declare const UpdateOperationSchema: z.ZodObject<{
459
+ kind: z.ZodLiteral<"update">;
460
+ by: z.ZodString;
461
+ notFound: z.ZodString;
462
+ respondsWith: z.ZodOptional<z.ZodString>;
463
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
464
+ id: z.ZodString;
465
+ method: z.ZodEnum<{
466
+ GET: "GET";
467
+ POST: "POST";
468
+ PATCH: "PATCH";
469
+ PUT: "PUT";
470
+ DELETE: "DELETE";
471
+ }>;
472
+ path: z.ZodString;
473
+ guard: z.ZodString;
474
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
475
+ input: z.ZodString;
476
+ output: z.ZodString;
477
+ uses: z.ZodOptional<z.ZodString>;
478
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
479
+ }, z.core.$strict>;
480
+ export declare const SetOrClearOperationSchema: z.ZodObject<{
481
+ kind: z.ZodLiteral<"setOrClear">;
482
+ slot: z.ZodString;
483
+ by: z.ZodString;
484
+ notFound: z.ZodString;
485
+ respondsWith: z.ZodOptional<z.ZodString>;
486
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
487
+ id: z.ZodString;
488
+ method: z.ZodEnum<{
489
+ GET: "GET";
490
+ POST: "POST";
491
+ PATCH: "PATCH";
492
+ PUT: "PUT";
493
+ DELETE: "DELETE";
494
+ }>;
495
+ path: z.ZodString;
496
+ guard: z.ZodString;
497
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
498
+ input: z.ZodString;
499
+ output: z.ZodString;
500
+ uses: z.ZodOptional<z.ZodString>;
501
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
502
+ }, z.core.$strict>;
503
+ export declare const DeleteOperationSchema: z.ZodObject<{
504
+ kind: z.ZodLiteral<"delete">;
505
+ by: z.ZodString;
506
+ notFound: z.ZodString;
507
+ respondsWith: z.ZodOptional<z.ZodString>;
508
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
509
+ id: z.ZodString;
510
+ method: z.ZodEnum<{
511
+ GET: "GET";
512
+ POST: "POST";
513
+ PATCH: "PATCH";
514
+ PUT: "PUT";
515
+ DELETE: "DELETE";
516
+ }>;
517
+ path: z.ZodString;
518
+ guard: z.ZodString;
519
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
520
+ input: z.ZodString;
521
+ output: z.ZodString;
522
+ uses: z.ZodOptional<z.ZodString>;
523
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
524
+ }, z.core.$strict>;
525
+ /** A non-HTTP operation — the generator specifies itself with these (D20). */
526
+ export declare const CommandOperationSchema: z.ZodObject<{
527
+ id: z.ZodString;
528
+ kind: z.ZodLiteral<"command">;
529
+ input: z.ZodOptional<z.ZodString>;
530
+ output: z.ZodOptional<z.ZodString>;
531
+ errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
532
+ }, z.core.$strict>;
533
+ export declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
534
+ kind: z.ZodLiteral<"read">;
535
+ orderBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodEnum<{
536
+ asc: "asc";
537
+ desc: "desc";
538
+ }>], null>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
539
+ asc: "asc";
540
+ desc: "desc";
541
+ }>], null>>]>>;
542
+ limit: z.ZodOptional<z.ZodNumber>;
543
+ range: z.ZodOptional<z.ZodString>;
544
+ id: z.ZodString;
545
+ method: z.ZodEnum<{
546
+ GET: "GET";
547
+ POST: "POST";
548
+ PATCH: "PATCH";
549
+ PUT: "PUT";
550
+ DELETE: "DELETE";
551
+ }>;
552
+ path: z.ZodString;
553
+ guard: z.ZodString;
554
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
555
+ input: z.ZodString;
556
+ output: z.ZodString;
557
+ uses: z.ZodOptional<z.ZodString>;
558
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
559
+ }, z.core.$strict>, z.ZodObject<{
560
+ kind: z.ZodLiteral<"create">;
561
+ respondsWith: z.ZodOptional<z.ZodString>;
562
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
563
+ id: z.ZodString;
564
+ method: z.ZodEnum<{
565
+ GET: "GET";
566
+ POST: "POST";
567
+ PATCH: "PATCH";
568
+ PUT: "PUT";
569
+ DELETE: "DELETE";
570
+ }>;
571
+ path: z.ZodString;
572
+ guard: z.ZodString;
573
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
574
+ input: z.ZodString;
575
+ output: z.ZodString;
576
+ uses: z.ZodOptional<z.ZodString>;
577
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
578
+ }, z.core.$strict>, z.ZodObject<{
579
+ kind: z.ZodLiteral<"import">;
580
+ respondsWith: z.ZodOptional<z.ZodString>;
581
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
582
+ id: z.ZodString;
583
+ method: z.ZodEnum<{
584
+ GET: "GET";
585
+ POST: "POST";
586
+ PATCH: "PATCH";
587
+ PUT: "PUT";
588
+ DELETE: "DELETE";
589
+ }>;
590
+ path: z.ZodString;
591
+ guard: z.ZodString;
592
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
593
+ input: z.ZodString;
594
+ output: z.ZodString;
595
+ uses: z.ZodOptional<z.ZodString>;
596
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
597
+ }, z.core.$strict>, z.ZodObject<{
598
+ kind: z.ZodLiteral<"update">;
599
+ by: z.ZodString;
600
+ notFound: z.ZodString;
601
+ respondsWith: z.ZodOptional<z.ZodString>;
602
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
603
+ id: z.ZodString;
604
+ method: z.ZodEnum<{
605
+ GET: "GET";
606
+ POST: "POST";
607
+ PATCH: "PATCH";
608
+ PUT: "PUT";
609
+ DELETE: "DELETE";
610
+ }>;
611
+ path: z.ZodString;
612
+ guard: z.ZodString;
613
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
614
+ input: z.ZodString;
615
+ output: z.ZodString;
616
+ uses: z.ZodOptional<z.ZodString>;
617
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
618
+ }, z.core.$strict>, z.ZodObject<{
619
+ kind: z.ZodLiteral<"setOrClear">;
620
+ slot: z.ZodString;
621
+ by: z.ZodString;
622
+ notFound: z.ZodString;
623
+ respondsWith: z.ZodOptional<z.ZodString>;
624
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
625
+ id: z.ZodString;
626
+ method: z.ZodEnum<{
627
+ GET: "GET";
628
+ POST: "POST";
629
+ PATCH: "PATCH";
630
+ PUT: "PUT";
631
+ DELETE: "DELETE";
632
+ }>;
633
+ path: z.ZodString;
634
+ guard: z.ZodString;
635
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
636
+ input: z.ZodString;
637
+ output: z.ZodString;
638
+ uses: z.ZodOptional<z.ZodString>;
639
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
640
+ }, z.core.$strict>, z.ZodObject<{
641
+ kind: z.ZodLiteral<"delete">;
642
+ by: z.ZodString;
643
+ notFound: z.ZodString;
644
+ respondsWith: z.ZodOptional<z.ZodString>;
645
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
646
+ id: z.ZodString;
647
+ method: z.ZodEnum<{
648
+ GET: "GET";
649
+ POST: "POST";
650
+ PATCH: "PATCH";
651
+ PUT: "PUT";
652
+ DELETE: "DELETE";
653
+ }>;
654
+ path: z.ZodString;
655
+ guard: z.ZodString;
656
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
657
+ input: z.ZodString;
658
+ output: z.ZodString;
659
+ uses: z.ZodOptional<z.ZodString>;
660
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
661
+ }, z.core.$strict>, z.ZodObject<{
662
+ id: z.ZodString;
663
+ kind: z.ZodLiteral<"command">;
664
+ input: z.ZodOptional<z.ZodString>;
665
+ output: z.ZodOptional<z.ZodString>;
666
+ errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
667
+ }, z.core.$strict>], "kind">;
668
+ export type Operation = z.infer<typeof OperationSchema>;
669
+ export type HttpOperation = Exclude<Operation, {
670
+ kind: "command";
671
+ }>;
672
+ export type CommandOperation = Extract<Operation, {
673
+ kind: "command";
674
+ }>;
675
+ export type ReadOperation = Extract<Operation, {
676
+ kind: "read";
677
+ }>;
678
+ export type WriteOperation = Exclude<HttpOperation, {
679
+ kind: "read";
680
+ }>;
681
+ export type KeyedOperation = Extract<Operation, {
682
+ kind: "update" | "setOrClear" | "delete";
683
+ }>;
684
+ export declare function isHttpOperation(operation: Operation): operation is HttpOperation;
685
+ export declare function isWriteOperation(operation: Operation): operation is WriteOperation;
686
+ export declare function isKeyedOperation(operation: Operation): operation is KeyedOperation;
687
+ export declare const ValidateHoleSchema: z.ZodObject<{
688
+ id: z.ZodString;
689
+ kind: z.ZodLiteral<"validate">;
690
+ reads: z.ZodArray<z.ZodString>;
691
+ error: z.ZodString;
692
+ effects: z.ZodArray<z.ZodEnum<{
693
+ clock: "clock";
694
+ db: "db";
695
+ }>>;
696
+ suggestedFix: z.ZodOptional<z.ZodBoolean>;
697
+ examples: z.ZodObject<{
698
+ accept: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
699
+ reject: z.ZodRecord<z.ZodString, z.ZodUnknown>;
700
+ }, z.core.$strict>;
701
+ }, z.core.$strict>;
702
+ export declare const TransformHoleSchema: z.ZodObject<{
703
+ id: z.ZodString;
704
+ kind: z.ZodLiteral<"transform">;
705
+ from: z.ZodEnum<{
706
+ "text/csv": "text/csv";
707
+ }>;
708
+ columns: z.ZodArray<z.ZodString>;
709
+ effects: z.ZodArray<z.ZodEnum<{
710
+ clock: "clock";
711
+ db: "db";
712
+ }>>;
713
+ error: z.ZodOptional<z.ZodString>;
714
+ motifCandidate: z.ZodOptional<z.ZodBoolean>;
715
+ examples: z.ZodObject<{
716
+ accept: z.ZodObject<{
717
+ input: z.ZodUnknown;
718
+ output: z.ZodUnknown;
719
+ }, z.core.$strict>;
720
+ reject: z.ZodObject<{
721
+ input: z.ZodUnknown;
722
+ line: z.ZodOptional<z.ZodNumber>;
723
+ }, z.core.$strict>;
724
+ }, z.core.$strict>;
725
+ }, z.core.$strict>;
726
+ /** D32: computes ONE resource field from the input before persistence; `error` is the operation's 400 when the derivation is empty. */
727
+ export declare const DeriveHoleSchema: z.ZodObject<{
728
+ id: z.ZodString;
729
+ kind: z.ZodLiteral<"derive">;
730
+ reads: z.ZodArray<z.ZodString>;
731
+ writes: z.ZodString;
732
+ error: z.ZodOptional<z.ZodString>;
733
+ effects: z.ZodArray<z.ZodEnum<{
734
+ clock: "clock";
735
+ db: "db";
736
+ }>>;
737
+ examples: z.ZodObject<{
738
+ accept: z.ZodArray<z.ZodObject<{
739
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
740
+ output: z.ZodUnknown;
741
+ }, z.core.$strict>>;
742
+ reject: z.ZodOptional<z.ZodObject<{
743
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
744
+ }, z.core.$strict>>;
745
+ }, z.core.$strict>;
746
+ }, z.core.$strict>;
747
+ /** D32: shapes the output of a read by caller — receives the guard's context (without its db) and the computed output. */
748
+ export declare const ProjectHoleSchema: z.ZodObject<{
749
+ id: z.ZodString;
750
+ kind: z.ZodLiteral<"project">;
751
+ reads: z.ZodArray<z.ZodString>;
752
+ writes: z.ZodArray<z.ZodString>;
753
+ examples: z.ZodObject<{
754
+ accept: z.ZodArray<z.ZodObject<{
755
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
756
+ input: z.ZodUnknown;
757
+ output: z.ZodUnknown;
758
+ }, z.core.$strict>>;
759
+ }, z.core.$strict>;
760
+ }, z.core.$strict>;
761
+ /** D32: a computation the DATABASE does — its body is SQL in the migration, between markers; the repository reads the view. */
762
+ export declare const ViewHoleSchema: z.ZodObject<{
763
+ id: z.ZodString;
764
+ kind: z.ZodLiteral<"view">;
765
+ name: z.ZodString;
766
+ from: z.ZodArray<z.ZodString>;
767
+ writes: z.ZodString;
768
+ examples: z.ZodObject<{
769
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
770
+ value: z.ZodUnknown;
771
+ }, z.core.$strict>;
772
+ }, z.core.$strict>;
773
+ export declare const HoleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
774
+ id: z.ZodString;
775
+ kind: z.ZodLiteral<"validate">;
776
+ reads: z.ZodArray<z.ZodString>;
777
+ error: z.ZodString;
778
+ effects: z.ZodArray<z.ZodEnum<{
779
+ clock: "clock";
780
+ db: "db";
781
+ }>>;
782
+ suggestedFix: z.ZodOptional<z.ZodBoolean>;
783
+ examples: z.ZodObject<{
784
+ accept: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
785
+ reject: z.ZodRecord<z.ZodString, z.ZodUnknown>;
786
+ }, z.core.$strict>;
787
+ }, z.core.$strict>, z.ZodObject<{
788
+ id: z.ZodString;
789
+ kind: z.ZodLiteral<"transform">;
790
+ from: z.ZodEnum<{
791
+ "text/csv": "text/csv";
792
+ }>;
793
+ columns: z.ZodArray<z.ZodString>;
794
+ effects: z.ZodArray<z.ZodEnum<{
795
+ clock: "clock";
796
+ db: "db";
797
+ }>>;
798
+ error: z.ZodOptional<z.ZodString>;
799
+ motifCandidate: z.ZodOptional<z.ZodBoolean>;
800
+ examples: z.ZodObject<{
801
+ accept: z.ZodObject<{
802
+ input: z.ZodUnknown;
803
+ output: z.ZodUnknown;
804
+ }, z.core.$strict>;
805
+ reject: z.ZodObject<{
806
+ input: z.ZodUnknown;
807
+ line: z.ZodOptional<z.ZodNumber>;
808
+ }, z.core.$strict>;
809
+ }, z.core.$strict>;
810
+ }, z.core.$strict>, z.ZodObject<{
811
+ id: z.ZodString;
812
+ kind: z.ZodLiteral<"derive">;
813
+ reads: z.ZodArray<z.ZodString>;
814
+ writes: z.ZodString;
815
+ error: z.ZodOptional<z.ZodString>;
816
+ effects: z.ZodArray<z.ZodEnum<{
817
+ clock: "clock";
818
+ db: "db";
819
+ }>>;
820
+ examples: z.ZodObject<{
821
+ accept: z.ZodArray<z.ZodObject<{
822
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
823
+ output: z.ZodUnknown;
824
+ }, z.core.$strict>>;
825
+ reject: z.ZodOptional<z.ZodObject<{
826
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
827
+ }, z.core.$strict>>;
828
+ }, z.core.$strict>;
829
+ }, z.core.$strict>, z.ZodObject<{
830
+ id: z.ZodString;
831
+ kind: z.ZodLiteral<"project">;
832
+ reads: z.ZodArray<z.ZodString>;
833
+ writes: z.ZodArray<z.ZodString>;
834
+ examples: z.ZodObject<{
835
+ accept: z.ZodArray<z.ZodObject<{
836
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
837
+ input: z.ZodUnknown;
838
+ output: z.ZodUnknown;
839
+ }, z.core.$strict>>;
840
+ }, z.core.$strict>;
841
+ }, z.core.$strict>, z.ZodObject<{
842
+ id: z.ZodString;
843
+ kind: z.ZodLiteral<"view">;
844
+ name: z.ZodString;
845
+ from: z.ZodArray<z.ZodString>;
846
+ writes: z.ZodString;
847
+ examples: z.ZodObject<{
848
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
849
+ value: z.ZodUnknown;
850
+ }, z.core.$strict>;
851
+ }, z.core.$strict>], "kind">;
852
+ export type Hole = z.infer<typeof HoleSchema>;
853
+ export type ValidateHole = Extract<Hole, {
854
+ kind: "validate";
855
+ }>;
856
+ export type TransformHole = Extract<Hole, {
857
+ kind: "transform";
858
+ }>;
859
+ export type DeriveHole = Extract<Hole, {
860
+ kind: "derive";
861
+ }>;
862
+ export type ProjectHole = Extract<Hole, {
863
+ kind: "project";
864
+ }>;
865
+ export type ViewHole = Extract<Hole, {
866
+ kind: "view";
867
+ }>;
868
+ /** The accept examples of a validate hole, always as a list (first = the valid input overlay). */
869
+ export declare function acceptExamplesOf(hole: ValidateHole): Record<string, unknown>[];
870
+ /** The kinds of operation each kind of hole may serve (D22, D32). */
871
+ export declare const HOLE_KIND_SERVES: Readonly<Record<Hole["kind"], readonly HttpOperationKind[]>>;
872
+ /** `/api/grades/:code/targets/:criterionCode` → ["code", "criterionCode"]. */
873
+ export declare function pathParametersOf(path: string): string[];
874
+ export declare const GenerationBlockSchema: z.ZodObject<{
875
+ contracts: z.ZodObject<{
876
+ module: z.ZodString;
877
+ resource: z.ZodOptional<z.ZodString>;
878
+ table: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
879
+ name: z.ZodString;
880
+ mode: z.ZodEnum<{
881
+ owned: "owned";
882
+ adopted: "adopted";
883
+ }>;
884
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
885
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
886
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
887
+ name: z.ZodString;
888
+ type: z.ZodString;
889
+ }, z.core.$strict>>>;
890
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
891
+ drop: z.ZodLiteral<"check">;
892
+ name: z.ZodString;
893
+ }, z.core.$strict>, z.ZodObject<{
894
+ add: z.ZodLiteral<"check">;
895
+ name: z.ZodString;
896
+ column: z.ZodString;
897
+ }, z.core.$strict>, z.ZodObject<{
898
+ add: z.ZodLiteral<"foreignKey">;
899
+ name: z.ZodString;
900
+ columns: z.ZodArray<z.ZodString>;
901
+ references: z.ZodObject<{
902
+ table: z.ZodString;
903
+ columns: z.ZodArray<z.ZodString>;
904
+ }, z.core.$strict>;
905
+ onDelete: z.ZodEnum<{
906
+ cascade: "cascade";
907
+ restrict: "restrict";
908
+ }>;
909
+ }, z.core.$strict>, z.ZodObject<{
910
+ add: z.ZodLiteral<"column">;
911
+ field: z.ZodString;
912
+ }, z.core.$strict>]>>>;
913
+ }, z.core.$strict>]>>;
914
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
915
+ indexes: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
916
+ key: z.ZodOptional<z.ZodString>;
917
+ slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
918
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
919
+ name: z.ZodString;
920
+ mode: z.ZodEnum<{
921
+ owned: "owned";
922
+ adopted: "adopted";
923
+ }>;
924
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
925
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
926
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
927
+ name: z.ZodString;
928
+ type: z.ZodString;
929
+ }, z.core.$strict>>>;
930
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
931
+ drop: z.ZodLiteral<"check">;
932
+ name: z.ZodString;
933
+ }, z.core.$strict>, z.ZodObject<{
934
+ add: z.ZodLiteral<"check">;
935
+ name: z.ZodString;
936
+ column: z.ZodString;
937
+ }, z.core.$strict>, z.ZodObject<{
938
+ add: z.ZodLiteral<"foreignKey">;
939
+ name: z.ZodString;
940
+ columns: z.ZodArray<z.ZodString>;
941
+ references: z.ZodObject<{
942
+ table: z.ZodString;
943
+ columns: z.ZodArray<z.ZodString>;
944
+ }, z.core.$strict>;
945
+ onDelete: z.ZodEnum<{
946
+ cascade: "cascade";
947
+ restrict: "restrict";
948
+ }>;
949
+ }, z.core.$strict>, z.ZodObject<{
950
+ add: z.ZodLiteral<"column">;
951
+ field: z.ZodString;
952
+ }, z.core.$strict>]>>>;
953
+ }, z.core.$strict>]>;
954
+ key: z.ZodString;
955
+ value: z.ZodString;
956
+ schema: z.ZodString;
957
+ field: z.ZodString;
958
+ }, z.core.$strict>>>;
959
+ references: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
960
+ table: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
961
+ name: z.ZodString;
962
+ mode: z.ZodEnum<{
963
+ owned: "owned";
964
+ adopted: "adopted";
965
+ }>;
966
+ id: z.ZodOptional<z.ZodLiteral<"none">>;
967
+ key: z.ZodOptional<z.ZodArray<z.ZodString>>;
968
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
969
+ name: z.ZodString;
970
+ type: z.ZodString;
971
+ }, z.core.$strict>>>;
972
+ alter: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
973
+ drop: z.ZodLiteral<"check">;
974
+ name: z.ZodString;
975
+ }, z.core.$strict>, z.ZodObject<{
976
+ add: z.ZodLiteral<"check">;
977
+ name: z.ZodString;
978
+ column: z.ZodString;
979
+ }, z.core.$strict>, z.ZodObject<{
980
+ add: z.ZodLiteral<"foreignKey">;
981
+ name: z.ZodString;
982
+ columns: z.ZodArray<z.ZodString>;
983
+ references: z.ZodObject<{
984
+ table: z.ZodString;
985
+ columns: z.ZodArray<z.ZodString>;
986
+ }, z.core.$strict>;
987
+ onDelete: z.ZodEnum<{
988
+ cascade: "cascade";
989
+ restrict: "restrict";
990
+ }>;
991
+ }, z.core.$strict>, z.ZodObject<{
992
+ add: z.ZodLiteral<"column">;
993
+ field: z.ZodString;
994
+ }, z.core.$strict>]>>>;
995
+ }, z.core.$strict>]>;
996
+ column: z.ZodString;
997
+ schema: z.ZodOptional<z.ZodString>;
998
+ countField: z.ZodOptional<z.ZodString>;
999
+ }, z.core.$strict>>>;
1000
+ sharedTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
1001
+ }, z.core.$strict>;
1002
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1003
+ kind: z.ZodLiteral<"read">;
1004
+ orderBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodEnum<{
1005
+ asc: "asc";
1006
+ desc: "desc";
1007
+ }>], null>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
1008
+ asc: "asc";
1009
+ desc: "desc";
1010
+ }>], null>>]>>;
1011
+ limit: z.ZodOptional<z.ZodNumber>;
1012
+ range: z.ZodOptional<z.ZodString>;
1013
+ id: z.ZodString;
1014
+ method: z.ZodEnum<{
1015
+ GET: "GET";
1016
+ POST: "POST";
1017
+ PATCH: "PATCH";
1018
+ PUT: "PUT";
1019
+ DELETE: "DELETE";
1020
+ }>;
1021
+ path: z.ZodString;
1022
+ guard: z.ZodString;
1023
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1024
+ input: z.ZodString;
1025
+ output: z.ZodString;
1026
+ uses: z.ZodOptional<z.ZodString>;
1027
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1028
+ }, z.core.$strict>, z.ZodObject<{
1029
+ kind: z.ZodLiteral<"create">;
1030
+ respondsWith: z.ZodOptional<z.ZodString>;
1031
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1032
+ id: z.ZodString;
1033
+ method: z.ZodEnum<{
1034
+ GET: "GET";
1035
+ POST: "POST";
1036
+ PATCH: "PATCH";
1037
+ PUT: "PUT";
1038
+ DELETE: "DELETE";
1039
+ }>;
1040
+ path: z.ZodString;
1041
+ guard: z.ZodString;
1042
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1043
+ input: z.ZodString;
1044
+ output: z.ZodString;
1045
+ uses: z.ZodOptional<z.ZodString>;
1046
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1047
+ }, z.core.$strict>, z.ZodObject<{
1048
+ kind: z.ZodLiteral<"import">;
1049
+ respondsWith: z.ZodOptional<z.ZodString>;
1050
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1051
+ id: z.ZodString;
1052
+ method: z.ZodEnum<{
1053
+ GET: "GET";
1054
+ POST: "POST";
1055
+ PATCH: "PATCH";
1056
+ PUT: "PUT";
1057
+ DELETE: "DELETE";
1058
+ }>;
1059
+ path: z.ZodString;
1060
+ guard: z.ZodString;
1061
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1062
+ input: z.ZodString;
1063
+ output: z.ZodString;
1064
+ uses: z.ZodOptional<z.ZodString>;
1065
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1066
+ }, z.core.$strict>, z.ZodObject<{
1067
+ kind: z.ZodLiteral<"update">;
1068
+ by: z.ZodString;
1069
+ notFound: z.ZodString;
1070
+ respondsWith: z.ZodOptional<z.ZodString>;
1071
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1072
+ id: z.ZodString;
1073
+ method: z.ZodEnum<{
1074
+ GET: "GET";
1075
+ POST: "POST";
1076
+ PATCH: "PATCH";
1077
+ PUT: "PUT";
1078
+ DELETE: "DELETE";
1079
+ }>;
1080
+ path: z.ZodString;
1081
+ guard: z.ZodString;
1082
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1083
+ input: z.ZodString;
1084
+ output: z.ZodString;
1085
+ uses: z.ZodOptional<z.ZodString>;
1086
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1087
+ }, z.core.$strict>, z.ZodObject<{
1088
+ kind: z.ZodLiteral<"setOrClear">;
1089
+ slot: z.ZodString;
1090
+ by: z.ZodString;
1091
+ notFound: z.ZodString;
1092
+ respondsWith: z.ZodOptional<z.ZodString>;
1093
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1094
+ id: z.ZodString;
1095
+ method: z.ZodEnum<{
1096
+ GET: "GET";
1097
+ POST: "POST";
1098
+ PATCH: "PATCH";
1099
+ PUT: "PUT";
1100
+ DELETE: "DELETE";
1101
+ }>;
1102
+ path: z.ZodString;
1103
+ guard: z.ZodString;
1104
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1105
+ input: z.ZodString;
1106
+ output: z.ZodString;
1107
+ uses: z.ZodOptional<z.ZodString>;
1108
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1109
+ }, z.core.$strict>, z.ZodObject<{
1110
+ kind: z.ZodLiteral<"delete">;
1111
+ by: z.ZodString;
1112
+ notFound: z.ZodString;
1113
+ respondsWith: z.ZodOptional<z.ZodString>;
1114
+ invalidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1115
+ id: z.ZodString;
1116
+ method: z.ZodEnum<{
1117
+ GET: "GET";
1118
+ POST: "POST";
1119
+ PATCH: "PATCH";
1120
+ PUT: "PUT";
1121
+ DELETE: "DELETE";
1122
+ }>;
1123
+ path: z.ZodString;
1124
+ guard: z.ZodString;
1125
+ guardDeniedCode: z.ZodOptional<z.ZodString>;
1126
+ input: z.ZodString;
1127
+ output: z.ZodString;
1128
+ uses: z.ZodOptional<z.ZodString>;
1129
+ holes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1130
+ }, z.core.$strict>, z.ZodObject<{
1131
+ id: z.ZodString;
1132
+ kind: z.ZodLiteral<"command">;
1133
+ input: z.ZodOptional<z.ZodString>;
1134
+ output: z.ZodOptional<z.ZodString>;
1135
+ errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
1136
+ }, z.core.$strict>], "kind">>;
1137
+ motifs: z.ZodDefault<z.ZodObject<{
1138
+ appendOnlySupersedes: z.ZodOptional<z.ZodObject<{
1139
+ key: z.ZodTuple<[z.ZodString, z.ZodString], null>;
1140
+ errors: z.ZodObject<{
1141
+ duplicate: z.ZodString;
1142
+ mismatch: z.ZodString;
1143
+ alreadySuperseded: z.ZodString;
1144
+ notFound: z.ZodString;
1145
+ }, z.core.$strict>;
1146
+ }, z.core.$strict>>;
1147
+ allOrNothingImport: z.ZodOptional<z.ZodObject<{
1148
+ rowSchema: z.ZodString;
1149
+ applies: z.ZodString;
1150
+ maxBytes: z.ZodNumber;
1151
+ error: z.ZodString;
1152
+ }, z.core.$strict>>;
1153
+ uniqueKey: z.ZodOptional<z.ZodObject<{
1154
+ key: z.ZodArray<z.ZodString>;
1155
+ error: z.ZodString;
1156
+ }, z.core.$strict>>;
1157
+ refuseWhenReferenced: z.ZodOptional<z.ZodObject<{
1158
+ reference: z.ZodString;
1159
+ error: z.ZodString;
1160
+ }, z.core.$strict>>;
1161
+ idempotentSetOrClear: z.ZodOptional<z.ZodObject<{
1162
+ slot: z.ZodString;
1163
+ }, z.core.$strict>>;
1164
+ signedWrite: z.ZodOptional<z.ZodObject<{
1165
+ by: z.ZodString;
1166
+ at: z.ZodString;
1167
+ }, z.core.$strict>>;
1168
+ }, z.core.$strict>>;
1169
+ holes: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1170
+ id: z.ZodString;
1171
+ kind: z.ZodLiteral<"validate">;
1172
+ reads: z.ZodArray<z.ZodString>;
1173
+ error: z.ZodString;
1174
+ effects: z.ZodArray<z.ZodEnum<{
1175
+ clock: "clock";
1176
+ db: "db";
1177
+ }>>;
1178
+ suggestedFix: z.ZodOptional<z.ZodBoolean>;
1179
+ examples: z.ZodObject<{
1180
+ accept: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
1181
+ reject: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1182
+ }, z.core.$strict>;
1183
+ }, z.core.$strict>, z.ZodObject<{
1184
+ id: z.ZodString;
1185
+ kind: z.ZodLiteral<"transform">;
1186
+ from: z.ZodEnum<{
1187
+ "text/csv": "text/csv";
1188
+ }>;
1189
+ columns: z.ZodArray<z.ZodString>;
1190
+ effects: z.ZodArray<z.ZodEnum<{
1191
+ clock: "clock";
1192
+ db: "db";
1193
+ }>>;
1194
+ error: z.ZodOptional<z.ZodString>;
1195
+ motifCandidate: z.ZodOptional<z.ZodBoolean>;
1196
+ examples: z.ZodObject<{
1197
+ accept: z.ZodObject<{
1198
+ input: z.ZodUnknown;
1199
+ output: z.ZodUnknown;
1200
+ }, z.core.$strict>;
1201
+ reject: z.ZodObject<{
1202
+ input: z.ZodUnknown;
1203
+ line: z.ZodOptional<z.ZodNumber>;
1204
+ }, z.core.$strict>;
1205
+ }, z.core.$strict>;
1206
+ }, z.core.$strict>, z.ZodObject<{
1207
+ id: z.ZodString;
1208
+ kind: z.ZodLiteral<"derive">;
1209
+ reads: z.ZodArray<z.ZodString>;
1210
+ writes: z.ZodString;
1211
+ error: z.ZodOptional<z.ZodString>;
1212
+ effects: z.ZodArray<z.ZodEnum<{
1213
+ clock: "clock";
1214
+ db: "db";
1215
+ }>>;
1216
+ examples: z.ZodObject<{
1217
+ accept: z.ZodArray<z.ZodObject<{
1218
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1219
+ output: z.ZodUnknown;
1220
+ }, z.core.$strict>>;
1221
+ reject: z.ZodOptional<z.ZodObject<{
1222
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1223
+ }, z.core.$strict>>;
1224
+ }, z.core.$strict>;
1225
+ }, z.core.$strict>, z.ZodObject<{
1226
+ id: z.ZodString;
1227
+ kind: z.ZodLiteral<"project">;
1228
+ reads: z.ZodArray<z.ZodString>;
1229
+ writes: z.ZodArray<z.ZodString>;
1230
+ examples: z.ZodObject<{
1231
+ accept: z.ZodArray<z.ZodObject<{
1232
+ context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1233
+ input: z.ZodUnknown;
1234
+ output: z.ZodUnknown;
1235
+ }, z.core.$strict>>;
1236
+ }, z.core.$strict>;
1237
+ }, z.core.$strict>, z.ZodObject<{
1238
+ id: z.ZodString;
1239
+ kind: z.ZodLiteral<"view">;
1240
+ name: z.ZodString;
1241
+ from: z.ZodArray<z.ZodString>;
1242
+ writes: z.ZodString;
1243
+ examples: z.ZodObject<{
1244
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1245
+ value: z.ZodUnknown;
1246
+ }, z.core.$strict>;
1247
+ }, z.core.$strict>], "kind">>>;
1248
+ }, z.core.$strict>;
1249
+ export type GenerationBlock = z.infer<typeof GenerationBlockSchema>;
1250
+ export interface BlockLocation {
1251
+ /** Spec path, relative to the repo root — the `file` of every refusal. */
1252
+ file: string;
1253
+ /** 1-based line of the first YAML line in the spec file. */
1254
+ line: number;
1255
+ }
1256
+ export type GenerationBlockParse = {
1257
+ ok: true;
1258
+ block: GenerationBlock;
1259
+ } | {
1260
+ ok: false;
1261
+ problems: OgygieError[];
1262
+ };
1263
+ /** Validates an already-parsed block value (what the YAML reader produced). */
1264
+ export declare function validateGenerationBlock(raw: unknown, location: BlockLocation): GenerationBlockParse;
1265
+ /** A refusal of a block at its path — shared with the screen block (D41), which refuses the same way. */
1266
+ export declare function blockProblemOf(location: BlockLocation, cause: string, suggestedFix: string, details: Record<string, unknown>): OgygieError;
1267
+ export type YamlBlockRead = {
1268
+ ok: true;
1269
+ raw: unknown;
1270
+ } | {
1271
+ ok: false;
1272
+ problems: OgygieError[];
1273
+ };
1274
+ /** Reads the YAML text of a `# Génération` block into a raw value — one refusal per YAML error, at its line. */
1275
+ export declare function readYamlBlock(yamlText: string, location: BlockLocation): YamlBlockRead;
1276
+ /** D41: a raw block is a SCREEN block when it carries `consumes` — a feature block carries `contracts`; `check` refuses a block that carries both or neither. */
1277
+ export declare function blockKindOf(raw: unknown): "feature" | "screen" | "both" | "neither";
1278
+ /** Reads the YAML text of the block, then validates it. */
1279
+ export declare function parseGenerationBlock(yamlText: string, location: BlockLocation): GenerationBlockParse;