@sequenceholdings/orm 2.0.0 → 2.1.1

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 (69) hide show
  1. package/README.md +94 -2
  2. package/dist/authoring.cjs +1474 -54
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +242 -4
  5. package/dist/authoring.d.ts +242 -4
  6. package/dist/authoring.js +1465 -56
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +740 -42
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +742 -53
  11. package/dist/canonical.d.ts +742 -53
  12. package/dist/canonical.js +724 -43
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +2478 -328
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +2480 -330
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +90 -25
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +39 -22
  21. package/dist/client.d.ts +39 -22
  22. package/dist/client.js +87 -26
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +1755 -329
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +56 -3
  27. package/dist/compiler.d.ts +56 -3
  28. package/dist/compiler.js +1756 -330
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-YoFGjIBM.d.cts +99 -0
  31. package/dist/constants-YoFGjIBM.d.ts +99 -0
  32. package/dist/dynamic-input.d.cts +1 -0
  33. package/dist/dynamic-input.d.ts +1 -0
  34. package/dist/index.cjs +1973 -164
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +474 -100
  37. package/dist/index.d.ts +474 -100
  38. package/dist/index.js +1940 -167
  39. package/dist/index.js.map +1 -1
  40. package/dist/ir.cjs +869 -46
  41. package/dist/ir.cjs.map +1 -1
  42. package/dist/ir.d.cts +699 -25
  43. package/dist/ir.d.ts +699 -25
  44. package/dist/ir.js +861 -47
  45. package/dist/ir.js.map +1 -1
  46. package/dist/{naming-CTvWSRTf.d.ts → naming-CPfx7EfF.d.ts} +28 -1
  47. package/dist/{naming-DRyinU4u.d.cts → naming-CU9ThP_E.d.cts} +28 -1
  48. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  49. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  50. package/dist/predicate-v2.cjs +852 -49
  51. package/dist/predicate-v2.cjs.map +1 -1
  52. package/dist/predicate-v2.d.cts +2 -1
  53. package/dist/predicate-v2.d.ts +2 -1
  54. package/dist/predicate-v2.js +852 -49
  55. package/dist/predicate-v2.js.map +1 -1
  56. package/dist/sdl.cjs +1309 -58
  57. package/dist/sdl.cjs.map +1 -1
  58. package/dist/sdl.d.cts +7 -3
  59. package/dist/sdl.d.ts +7 -3
  60. package/dist/sdl.js +1305 -59
  61. package/dist/sdl.js.map +1 -1
  62. package/package.json +11 -6
  63. package/templates/orm-namespace/CLAUDE.md +6 -4
  64. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  65. package/templates/orm-namespace/codegen.ts +2 -1
  66. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  67. package/templates/orm-namespace/package.json +2 -1
  68. package/templates/orm-namespace/schema/tables.ts +3 -2
  69. package/templates/orm-namespace/sequence.config.ts +7 -11
package/dist/ir.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export { C as CELLS_FIELD, a as CELL_PARTS, b as CellPart, c as cellColumnName } from './constants-YoFGjIBM.cjs';
2
3
 
3
4
  /**
4
5
  * Compiled-operation IR — THE frozen contract between the GraphQL compiler
@@ -22,7 +23,12 @@ import { z } from 'zod';
22
23
  * pattern): executor upgrades decouple from artifact re-pushes.
23
24
  */
24
25
 
25
- declare const IR_VERSION: 1;
26
+ /** Maximum supported version. Emit v1 until an operation needs v2 semantics. */
27
+ declare const IR_VERSION: 2;
28
+ declare const LEGACY_IR_VERSION: 1;
29
+ declare const irVersionSchema: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
30
+ /** Keep v1 artifact identity when assembling only legacy operations from registry rows. */
31
+ declare function requiredArtifactIrVersion(operations: readonly unknown[]): z.infer<typeof irVersionSchema>;
26
32
  /** The exact claim keys the platform stamps — mirrors claims.ts. */
27
33
  declare const CLAIMS_CONTRACT: {
28
34
  readonly sub: "string";
@@ -118,6 +124,24 @@ declare const limitIrSchema: z.ZodObject<{
118
124
  max: z.ZodNumber;
119
125
  }, z.core.$strip>;
120
126
  type LimitIr = z.infer<typeof limitIrSchema>;
127
+ /** One cell of a `cells { … }` block: the parts selected for one column. */
128
+ interface CellSelectionIr {
129
+ alias: string;
130
+ /** Logical column whose cell this is. */
131
+ column: string;
132
+ typename: string;
133
+ parts: Array<{
134
+ alias: string;
135
+ part: 'source' | 'at' | 'by' | 'conflicts';
136
+ /** `conflicts { … }`: the candidate fields selected, in order. */
137
+ fields?: Array<{
138
+ alias: string;
139
+ field: 'source' | 'at' | 'value';
140
+ }>;
141
+ /** `conflicts { … }` element typename. */
142
+ typename?: string;
143
+ }>;
144
+ }
121
145
  interface SelectionIr {
122
146
  /** GraphQL type name for __typename synthesis + Apollo normalization. */
123
147
  typename: string;
@@ -125,6 +149,12 @@ interface SelectionIr {
125
149
  alias: string;
126
150
  column: string;
127
151
  }>;
152
+ /** The typed `cells { … }` block (tables with cell metadata, resolved tables). */
153
+ cells?: {
154
+ alias: string;
155
+ typename: string;
156
+ fields: CellSelectionIr[];
157
+ };
128
158
  relations: Array<{
129
159
  alias: string;
130
160
  link: string;
@@ -156,6 +186,72 @@ interface SelectionIr {
156
186
  }
157
187
  declare const selectionIrSchema: z.ZodType<SelectionIr>;
158
188
 
189
+ /**
190
+ * `@prefetch(source:)` on a resolved-table query root: before the SQL runs,
191
+ * the data plane refreshes the named prefetch source for the keys this root
192
+ * addresses. `key` is the single pk value (byPk / `pk: {_eq}`) or the pk list
193
+ * (`pk: {_in}` on batch sources).
194
+ */
195
+ declare const prefetchPlanIrSchema: z.ZodObject<{
196
+ source: z.ZodString;
197
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
198
+ key: z.ZodUnion<readonly [z.ZodObject<{
199
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
200
+ kind: z.ZodLiteral<"literal">;
201
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"variable">;
204
+ name: z.ZodString;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"claim">;
207
+ key: z.ZodEnum<{
208
+ sub: "sub";
209
+ org: "org";
210
+ }>;
211
+ }, z.core.$strip>], "kind">;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
214
+ kind: z.ZodLiteral<"literal">;
215
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
216
+ }, z.core.$strip>, z.ZodObject<{
217
+ kind: z.ZodLiteral<"variable">;
218
+ name: z.ZodString;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ kind: z.ZodLiteral<"claim">;
221
+ key: z.ZodEnum<{
222
+ sub: "sub";
223
+ org: "org";
224
+ }>;
225
+ }, z.core.$strip>], "kind">;
226
+ }, z.core.$strip>]>;
227
+ }, z.core.$strip>;
228
+ type PrefetchPlanIr = z.infer<typeof prefetchPlanIrSchema>;
229
+ /**
230
+ * The date-bucket units a grouped aggregate may apply to a `date` /
231
+ * `timestamptz` group key. A CLOSED enum on purpose: the executor maps each
232
+ * member to a `date_trunc` literal, so no caller-supplied string ever reaches
233
+ * SQL text. Adding a unit means adding it here AND to the executor's map —
234
+ * the executor's exhaustive switch makes the omission a type error.
235
+ */
236
+ declare const DATE_BUCKETS: readonly ["year", "quarter", "month", "week", "day", "hour"];
237
+ type DateBucket = (typeof DATE_BUCKETS)[number];
238
+ /**
239
+ * One group key: a column, optionally bucketed. `bucket` is only ever set on a
240
+ * `date` / `timestamptz` column — the compiler rejects it on anything else, so
241
+ * the executor can apply `date_trunc` without re-checking the column type.
242
+ */
243
+ declare const groupByKeyIrSchema: z.ZodObject<{
244
+ column: z.ZodString;
245
+ bucket: z.ZodOptional<z.ZodEnum<{
246
+ year: "year";
247
+ quarter: "quarter";
248
+ month: "month";
249
+ week: "week";
250
+ day: "day";
251
+ hour: "hour";
252
+ }>>;
253
+ }, z.core.$strip>;
254
+ type GroupByKeyIr = z.infer<typeof groupByKeyIrSchema>;
159
255
  declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
256
  kind: z.ZodLiteral<"select">;
161
257
  alias: z.ZodString;
@@ -195,6 +291,39 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
195
291
  variable: z.ZodString;
196
292
  negated: z.ZodBoolean;
197
293
  }, z.core.$strip>>;
294
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
295
+ source: z.ZodString;
296
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
297
+ key: z.ZodUnion<readonly [z.ZodObject<{
298
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
299
+ kind: z.ZodLiteral<"literal">;
300
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
301
+ }, z.core.$strip>, z.ZodObject<{
302
+ kind: z.ZodLiteral<"variable">;
303
+ name: z.ZodString;
304
+ }, z.core.$strip>, z.ZodObject<{
305
+ kind: z.ZodLiteral<"claim">;
306
+ key: z.ZodEnum<{
307
+ sub: "sub";
308
+ org: "org";
309
+ }>;
310
+ }, z.core.$strip>], "kind">;
311
+ }, z.core.$strip>, z.ZodObject<{
312
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ kind: z.ZodLiteral<"literal">;
314
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
315
+ }, z.core.$strip>, z.ZodObject<{
316
+ kind: z.ZodLiteral<"variable">;
317
+ name: z.ZodString;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ kind: z.ZodLiteral<"claim">;
320
+ key: z.ZodEnum<{
321
+ sub: "sub";
322
+ org: "org";
323
+ }>;
324
+ }, z.core.$strip>], "kind">;
325
+ }, z.core.$strip>]>;
326
+ }, z.core.$strip>>>;
198
327
  }, z.core.$strip>, z.ZodObject<{
199
328
  kind: z.ZodLiteral<"byPk">;
200
329
  alias: z.ZodString;
@@ -221,6 +350,39 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
221
350
  variable: z.ZodString;
222
351
  negated: z.ZodBoolean;
223
352
  }, z.core.$strip>>;
353
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
354
+ source: z.ZodString;
355
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
356
+ key: z.ZodUnion<readonly [z.ZodObject<{
357
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
358
+ kind: z.ZodLiteral<"literal">;
359
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
360
+ }, z.core.$strip>, z.ZodObject<{
361
+ kind: z.ZodLiteral<"variable">;
362
+ name: z.ZodString;
363
+ }, z.core.$strip>, z.ZodObject<{
364
+ kind: z.ZodLiteral<"claim">;
365
+ key: z.ZodEnum<{
366
+ sub: "sub";
367
+ org: "org";
368
+ }>;
369
+ }, z.core.$strip>], "kind">;
370
+ }, z.core.$strip>, z.ZodObject<{
371
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
372
+ kind: z.ZodLiteral<"literal">;
373
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
374
+ }, z.core.$strip>, z.ZodObject<{
375
+ kind: z.ZodLiteral<"variable">;
376
+ name: z.ZodString;
377
+ }, z.core.$strip>, z.ZodObject<{
378
+ kind: z.ZodLiteral<"claim">;
379
+ key: z.ZodEnum<{
380
+ sub: "sub";
381
+ org: "org";
382
+ }>;
383
+ }, z.core.$strip>], "kind">;
384
+ }, z.core.$strip>]>;
385
+ }, z.core.$strip>>>;
224
386
  }, z.core.$strip>, z.ZodObject<{
225
387
  kind: z.ZodLiteral<"aggregate">;
226
388
  alias: z.ZodString;
@@ -237,6 +399,46 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
237
399
  variable: z.ZodString;
238
400
  negated: z.ZodBoolean;
239
401
  }, z.core.$strip>>;
402
+ }, z.core.$strip>, z.ZodObject<{
403
+ kind: z.ZodLiteral<"aggregateGroups">;
404
+ alias: z.ZodString;
405
+ table: z.ZodString;
406
+ where: z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>;
407
+ groupBy: z.ZodArray<z.ZodObject<{
408
+ column: z.ZodString;
409
+ bucket: z.ZodOptional<z.ZodEnum<{
410
+ year: "year";
411
+ quarter: "quarter";
412
+ month: "month";
413
+ week: "week";
414
+ day: "day";
415
+ hour: "hour";
416
+ }>>;
417
+ }, z.core.$strip>>;
418
+ key: z.ZodDefault<z.ZodArray<z.ZodObject<{
419
+ alias: z.ZodString;
420
+ column: z.ZodString;
421
+ }, z.core.$strip>>>;
422
+ count: z.ZodOptional<z.ZodObject<{
423
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
424
+ distinct: z.ZodOptional<z.ZodBoolean>;
425
+ }, z.core.$strip>>;
426
+ sum: z.ZodOptional<z.ZodArray<z.ZodString>>;
427
+ avg: z.ZodOptional<z.ZodArray<z.ZodString>>;
428
+ limit: z.ZodObject<{
429
+ variable: z.ZodOptional<z.ZodString>;
430
+ value: z.ZodOptional<z.ZodNumber>;
431
+ default: z.ZodNumber;
432
+ max: z.ZodNumber;
433
+ }, z.core.$strip>;
434
+ offset: z.ZodOptional<z.ZodObject<{
435
+ variable: z.ZodOptional<z.ZodString>;
436
+ value: z.ZodOptional<z.ZodNumber>;
437
+ }, z.core.$strip>>;
438
+ includeIf: z.ZodOptional<z.ZodObject<{
439
+ variable: z.ZodString;
440
+ negated: z.ZodBoolean;
441
+ }, z.core.$strip>>;
240
442
  }, z.core.$strip>, z.ZodObject<{
241
443
  kind: z.ZodLiteral<"mutation">;
242
444
  op: z.ZodEnum<{
@@ -248,7 +450,23 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
248
450
  deleteByPk: "deleteByPk";
249
451
  cowOverride: "cowOverride";
250
452
  cowRevert: "cowRevert";
453
+ resolvedWrite: "resolvedWrite";
251
454
  }>;
455
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
456
+ insert: "insert";
457
+ update: "update";
458
+ revert: "revert";
459
+ delete: "delete";
460
+ }>>;
461
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
462
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
463
+ source: z.ZodString;
464
+ mode: z.ZodEnum<{
465
+ sync: "sync";
466
+ async: "async";
467
+ }>;
468
+ }, z.core.$strip>>>;
469
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
470
  alias: z.ZodString;
253
471
  table: z.ZodString;
254
472
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -376,6 +594,7 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
376
594
  insertCheck: z.ZodOptional<z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>;
377
595
  returning: z.ZodNullable<z.ZodType<SelectionIr, unknown, z.core.$ZodTypeInternals<SelectionIr, unknown>>>;
378
596
  affectedRows: z.ZodDefault<z.ZodBoolean>;
597
+ assertAffectedRows: z.ZodOptional<z.ZodNumber>;
379
598
  includeIf: z.ZodOptional<z.ZodObject<{
380
599
  variable: z.ZodString;
381
600
  negated: z.ZodBoolean;
@@ -402,14 +621,14 @@ declare const variableIrSchema: z.ZodObject<{
402
621
  scalar: z.ZodEnum<{
403
622
  bigint: "bigint";
404
623
  boolean: "boolean";
405
- uuid: "uuid";
406
624
  text: "text";
625
+ date: "date";
626
+ timestamptz: "timestamptz";
627
+ jsonb: "jsonb";
628
+ uuid: "uuid";
407
629
  integer: "integer";
408
630
  numeric: "numeric";
409
631
  double: "double";
410
- timestamptz: "timestamptz";
411
- date: "date";
412
- jsonb: "jsonb";
413
632
  }>;
414
633
  }, z.core.$strip>, z.ZodObject<{
415
634
  kind: z.ZodLiteral<"enum">;
@@ -436,7 +655,7 @@ declare const variableIrSchema: z.ZodObject<{
436
655
  }, z.core.$strip>;
437
656
  type VariableIr = z.infer<typeof variableIrSchema>;
438
657
  declare const compiledOperationSchema: z.ZodObject<{
439
- irVersion: z.ZodLiteral<1>;
658
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
440
659
  name: z.ZodString;
441
660
  opHash: z.ZodString;
442
661
  kind: z.ZodEnum<{
@@ -454,14 +673,14 @@ declare const compiledOperationSchema: z.ZodObject<{
454
673
  scalar: z.ZodEnum<{
455
674
  bigint: "bigint";
456
675
  boolean: "boolean";
457
- uuid: "uuid";
458
676
  text: "text";
677
+ date: "date";
678
+ timestamptz: "timestamptz";
679
+ jsonb: "jsonb";
680
+ uuid: "uuid";
459
681
  integer: "integer";
460
682
  numeric: "numeric";
461
683
  double: "double";
462
- timestamptz: "timestamptz";
463
- date: "date";
464
- jsonb: "jsonb";
465
684
  }>;
466
685
  }, z.core.$strip>, z.ZodObject<{
467
686
  kind: z.ZodLiteral<"enum">;
@@ -526,6 +745,39 @@ declare const compiledOperationSchema: z.ZodObject<{
526
745
  variable: z.ZodString;
527
746
  negated: z.ZodBoolean;
528
747
  }, z.core.$strip>>;
748
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
749
+ source: z.ZodString;
750
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
751
+ key: z.ZodUnion<readonly [z.ZodObject<{
752
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
753
+ kind: z.ZodLiteral<"literal">;
754
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
755
+ }, z.core.$strip>, z.ZodObject<{
756
+ kind: z.ZodLiteral<"variable">;
757
+ name: z.ZodString;
758
+ }, z.core.$strip>, z.ZodObject<{
759
+ kind: z.ZodLiteral<"claim">;
760
+ key: z.ZodEnum<{
761
+ sub: "sub";
762
+ org: "org";
763
+ }>;
764
+ }, z.core.$strip>], "kind">;
765
+ }, z.core.$strip>, z.ZodObject<{
766
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
767
+ kind: z.ZodLiteral<"literal">;
768
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
769
+ }, z.core.$strip>, z.ZodObject<{
770
+ kind: z.ZodLiteral<"variable">;
771
+ name: z.ZodString;
772
+ }, z.core.$strip>, z.ZodObject<{
773
+ kind: z.ZodLiteral<"claim">;
774
+ key: z.ZodEnum<{
775
+ sub: "sub";
776
+ org: "org";
777
+ }>;
778
+ }, z.core.$strip>], "kind">;
779
+ }, z.core.$strip>]>;
780
+ }, z.core.$strip>>>;
529
781
  }, z.core.$strip>, z.ZodObject<{
530
782
  kind: z.ZodLiteral<"byPk">;
531
783
  alias: z.ZodString;
@@ -552,6 +804,39 @@ declare const compiledOperationSchema: z.ZodObject<{
552
804
  variable: z.ZodString;
553
805
  negated: z.ZodBoolean;
554
806
  }, z.core.$strip>>;
807
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
808
+ source: z.ZodString;
809
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
810
+ key: z.ZodUnion<readonly [z.ZodObject<{
811
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
812
+ kind: z.ZodLiteral<"literal">;
813
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
814
+ }, z.core.$strip>, z.ZodObject<{
815
+ kind: z.ZodLiteral<"variable">;
816
+ name: z.ZodString;
817
+ }, z.core.$strip>, z.ZodObject<{
818
+ kind: z.ZodLiteral<"claim">;
819
+ key: z.ZodEnum<{
820
+ sub: "sub";
821
+ org: "org";
822
+ }>;
823
+ }, z.core.$strip>], "kind">;
824
+ }, z.core.$strip>, z.ZodObject<{
825
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
826
+ kind: z.ZodLiteral<"literal">;
827
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
828
+ }, z.core.$strip>, z.ZodObject<{
829
+ kind: z.ZodLiteral<"variable">;
830
+ name: z.ZodString;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ kind: z.ZodLiteral<"claim">;
833
+ key: z.ZodEnum<{
834
+ sub: "sub";
835
+ org: "org";
836
+ }>;
837
+ }, z.core.$strip>], "kind">;
838
+ }, z.core.$strip>]>;
839
+ }, z.core.$strip>>>;
555
840
  }, z.core.$strip>, z.ZodObject<{
556
841
  kind: z.ZodLiteral<"aggregate">;
557
842
  alias: z.ZodString;
@@ -568,6 +853,46 @@ declare const compiledOperationSchema: z.ZodObject<{
568
853
  variable: z.ZodString;
569
854
  negated: z.ZodBoolean;
570
855
  }, z.core.$strip>>;
856
+ }, z.core.$strip>, z.ZodObject<{
857
+ kind: z.ZodLiteral<"aggregateGroups">;
858
+ alias: z.ZodString;
859
+ table: z.ZodString;
860
+ where: z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>;
861
+ groupBy: z.ZodArray<z.ZodObject<{
862
+ column: z.ZodString;
863
+ bucket: z.ZodOptional<z.ZodEnum<{
864
+ year: "year";
865
+ quarter: "quarter";
866
+ month: "month";
867
+ week: "week";
868
+ day: "day";
869
+ hour: "hour";
870
+ }>>;
871
+ }, z.core.$strip>>;
872
+ key: z.ZodDefault<z.ZodArray<z.ZodObject<{
873
+ alias: z.ZodString;
874
+ column: z.ZodString;
875
+ }, z.core.$strip>>>;
876
+ count: z.ZodOptional<z.ZodObject<{
877
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
878
+ distinct: z.ZodOptional<z.ZodBoolean>;
879
+ }, z.core.$strip>>;
880
+ sum: z.ZodOptional<z.ZodArray<z.ZodString>>;
881
+ avg: z.ZodOptional<z.ZodArray<z.ZodString>>;
882
+ limit: z.ZodObject<{
883
+ variable: z.ZodOptional<z.ZodString>;
884
+ value: z.ZodOptional<z.ZodNumber>;
885
+ default: z.ZodNumber;
886
+ max: z.ZodNumber;
887
+ }, z.core.$strip>;
888
+ offset: z.ZodOptional<z.ZodObject<{
889
+ variable: z.ZodOptional<z.ZodString>;
890
+ value: z.ZodOptional<z.ZodNumber>;
891
+ }, z.core.$strip>>;
892
+ includeIf: z.ZodOptional<z.ZodObject<{
893
+ variable: z.ZodString;
894
+ negated: z.ZodBoolean;
895
+ }, z.core.$strip>>;
571
896
  }, z.core.$strip>, z.ZodObject<{
572
897
  kind: z.ZodLiteral<"mutation">;
573
898
  op: z.ZodEnum<{
@@ -579,7 +904,23 @@ declare const compiledOperationSchema: z.ZodObject<{
579
904
  deleteByPk: "deleteByPk";
580
905
  cowOverride: "cowOverride";
581
906
  cowRevert: "cowRevert";
907
+ resolvedWrite: "resolvedWrite";
582
908
  }>;
909
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
910
+ insert: "insert";
911
+ update: "update";
912
+ revert: "revert";
913
+ delete: "delete";
914
+ }>>;
915
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
916
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
917
+ source: z.ZodString;
918
+ mode: z.ZodEnum<{
919
+ sync: "sync";
920
+ async: "async";
921
+ }>;
922
+ }, z.core.$strip>>>;
923
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
583
924
  alias: z.ZodString;
584
925
  table: z.ZodString;
585
926
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -707,6 +1048,7 @@ declare const compiledOperationSchema: z.ZodObject<{
707
1048
  insertCheck: z.ZodOptional<z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>;
708
1049
  returning: z.ZodNullable<z.ZodType<SelectionIr, unknown, z.core.$ZodTypeInternals<SelectionIr, unknown>>>;
709
1050
  affectedRows: z.ZodDefault<z.ZodBoolean>;
1051
+ assertAffectedRows: z.ZodOptional<z.ZodNumber>;
710
1052
  includeIf: z.ZodOptional<z.ZodObject<{
711
1053
  variable: z.ZodString;
712
1054
  negated: z.ZodBoolean;
@@ -714,6 +1056,99 @@ declare const compiledOperationSchema: z.ZodObject<{
714
1056
  }, z.core.$strip>], "kind">>;
715
1057
  }, z.core.$strip>;
716
1058
  type CompiledOperation = z.infer<typeof compiledOperationSchema>;
1059
+ declare const resolvedSourceIrSchema: z.ZodObject<{
1060
+ name: z.ZodString;
1061
+ kind: z.ZodEnum<{
1062
+ manual: "manual";
1063
+ prefetch: "prefetch";
1064
+ etl: "etl";
1065
+ }>;
1066
+ table: z.ZodString;
1067
+ columns: z.ZodArray<z.ZodString>;
1068
+ key: z.ZodOptional<z.ZodString>;
1069
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1070
+ shape: z.ZodLiteral<"single">;
1071
+ }, z.core.$strip>, z.ZodObject<{
1072
+ shape: z.ZodLiteral<"batch">;
1073
+ maxKeys: z.ZodNumber;
1074
+ }, z.core.$strip>]>>;
1075
+ function: z.ZodOptional<z.ZodObject<{
1076
+ kind: z.ZodEnum<{
1077
+ managed: "managed";
1078
+ native: "native";
1079
+ }>;
1080
+ id: z.ZodString;
1081
+ }, z.core.$strip>>;
1082
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1083
+ maxStalenessMs: z.ZodNumber;
1084
+ timeoutMs: z.ZodNumber;
1085
+ onError: z.ZodEnum<{
1086
+ fallback: "fallback";
1087
+ fail: "fail";
1088
+ }>;
1089
+ }, z.core.$strip>>;
1090
+ writeback: z.ZodOptional<z.ZodObject<{
1091
+ columns: z.ZodArray<z.ZodString>;
1092
+ defaultMode: z.ZodEnum<{
1093
+ sync: "sync";
1094
+ async: "async";
1095
+ }>;
1096
+ timeoutMs: z.ZodNumber;
1097
+ clearManualOnConfirm: z.ZodBoolean;
1098
+ }, z.core.$strip>>;
1099
+ }, z.core.$strip>;
1100
+ type ResolvedSourceIr = z.infer<typeof resolvedSourceIrSchema>;
1101
+ declare const resolvedMetaIrSchema: z.ZodObject<{
1102
+ pk: z.ZodString;
1103
+ manual: z.ZodString;
1104
+ sources: z.ZodArray<z.ZodObject<{
1105
+ name: z.ZodString;
1106
+ kind: z.ZodEnum<{
1107
+ manual: "manual";
1108
+ prefetch: "prefetch";
1109
+ etl: "etl";
1110
+ }>;
1111
+ table: z.ZodString;
1112
+ columns: z.ZodArray<z.ZodString>;
1113
+ key: z.ZodOptional<z.ZodString>;
1114
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1115
+ shape: z.ZodLiteral<"single">;
1116
+ }, z.core.$strip>, z.ZodObject<{
1117
+ shape: z.ZodLiteral<"batch">;
1118
+ maxKeys: z.ZodNumber;
1119
+ }, z.core.$strip>]>>;
1120
+ function: z.ZodOptional<z.ZodObject<{
1121
+ kind: z.ZodEnum<{
1122
+ managed: "managed";
1123
+ native: "native";
1124
+ }>;
1125
+ id: z.ZodString;
1126
+ }, z.core.$strip>>;
1127
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1128
+ maxStalenessMs: z.ZodNumber;
1129
+ timeoutMs: z.ZodNumber;
1130
+ onError: z.ZodEnum<{
1131
+ fallback: "fallback";
1132
+ fail: "fail";
1133
+ }>;
1134
+ }, z.core.$strip>>;
1135
+ writeback: z.ZodOptional<z.ZodObject<{
1136
+ columns: z.ZodArray<z.ZodString>;
1137
+ defaultMode: z.ZodEnum<{
1138
+ sync: "sync";
1139
+ async: "async";
1140
+ }>;
1141
+ timeoutMs: z.ZodNumber;
1142
+ clearManualOnConfirm: z.ZodBoolean;
1143
+ }, z.core.$strip>>;
1144
+ }, z.core.$strip>>;
1145
+ deletedBy: z.ZodArray<z.ZodString>;
1146
+ materialized: z.ZodOptional<z.ZodObject<{
1147
+ table: z.ZodString;
1148
+ compute: z.ZodString;
1149
+ }, z.core.$strip>>;
1150
+ }, z.core.$strip>;
1151
+ type ResolvedMetaIr = z.infer<typeof resolvedMetaIrSchema>;
717
1152
  /**
718
1153
  * Runtime whitelist metadata per table — everything the executor needs to
719
1154
  * build Drizzle table objects, validate §4f dynamic inputs, and lower them.
@@ -730,14 +1165,14 @@ declare const tableMetaIrSchema: z.ZodObject<{
730
1165
  type: z.ZodUnion<readonly [z.ZodEnum<{
731
1166
  bigint: "bigint";
732
1167
  boolean: "boolean";
733
- uuid: "uuid";
734
1168
  text: "text";
1169
+ date: "date";
1170
+ timestamptz: "timestamptz";
1171
+ jsonb: "jsonb";
1172
+ uuid: "uuid";
735
1173
  integer: "integer";
736
1174
  numeric: "numeric";
737
1175
  double: "double";
738
- timestamptz: "timestamptz";
739
- date: "date";
740
- jsonb: "jsonb";
741
1176
  }>, z.ZodObject<{
742
1177
  enum: z.ZodString;
743
1178
  values: z.ZodArray<z.ZodString>;
@@ -761,6 +1196,64 @@ declare const tableMetaIrSchema: z.ZodObject<{
761
1196
  insertable: z.ZodArray<z.ZodString>;
762
1197
  settable: z.ZodArray<z.ZodString>;
763
1198
  appendable: z.ZodArray<z.ZodString>;
1199
+ touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
1200
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1201
+ at: z.ZodOptional<z.ZodString>;
1202
+ by: z.ZodOptional<z.ZodString>;
1203
+ rev: z.ZodOptional<z.ZodString>;
1204
+ source: z.ZodOptional<z.ZodString>;
1205
+ conflicts: z.ZodOptional<z.ZodString>;
1206
+ }, z.core.$strict>>>;
1207
+ resolved: z.ZodOptional<z.ZodObject<{
1208
+ pk: z.ZodString;
1209
+ manual: z.ZodString;
1210
+ sources: z.ZodArray<z.ZodObject<{
1211
+ name: z.ZodString;
1212
+ kind: z.ZodEnum<{
1213
+ manual: "manual";
1214
+ prefetch: "prefetch";
1215
+ etl: "etl";
1216
+ }>;
1217
+ table: z.ZodString;
1218
+ columns: z.ZodArray<z.ZodString>;
1219
+ key: z.ZodOptional<z.ZodString>;
1220
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1221
+ shape: z.ZodLiteral<"single">;
1222
+ }, z.core.$strip>, z.ZodObject<{
1223
+ shape: z.ZodLiteral<"batch">;
1224
+ maxKeys: z.ZodNumber;
1225
+ }, z.core.$strip>]>>;
1226
+ function: z.ZodOptional<z.ZodObject<{
1227
+ kind: z.ZodEnum<{
1228
+ managed: "managed";
1229
+ native: "native";
1230
+ }>;
1231
+ id: z.ZodString;
1232
+ }, z.core.$strip>>;
1233
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1234
+ maxStalenessMs: z.ZodNumber;
1235
+ timeoutMs: z.ZodNumber;
1236
+ onError: z.ZodEnum<{
1237
+ fallback: "fallback";
1238
+ fail: "fail";
1239
+ }>;
1240
+ }, z.core.$strip>>;
1241
+ writeback: z.ZodOptional<z.ZodObject<{
1242
+ columns: z.ZodArray<z.ZodString>;
1243
+ defaultMode: z.ZodEnum<{
1244
+ sync: "sync";
1245
+ async: "async";
1246
+ }>;
1247
+ timeoutMs: z.ZodNumber;
1248
+ clearManualOnConfirm: z.ZodBoolean;
1249
+ }, z.core.$strip>>;
1250
+ }, z.core.$strip>>;
1251
+ deletedBy: z.ZodArray<z.ZodString>;
1252
+ materialized: z.ZodOptional<z.ZodObject<{
1253
+ table: z.ZodString;
1254
+ compute: z.ZodString;
1255
+ }, z.core.$strip>>;
1256
+ }, z.core.$strip>>;
764
1257
  constraints: z.ZodArray<z.ZodObject<{
765
1258
  name: z.ZodString;
766
1259
  columns: z.ZodArray<z.ZodString>;
@@ -770,7 +1263,7 @@ declare const tableMetaIrSchema: z.ZodObject<{
770
1263
  }, z.core.$strip>;
771
1264
  type TableMetaIr = z.infer<typeof tableMetaIrSchema>;
772
1265
  declare const compiledArtifactSchema: z.ZodObject<{
773
- irVersion: z.ZodLiteral<1>;
1266
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
774
1267
  namespace: z.ZodString;
775
1268
  schemaHash: z.ZodString;
776
1269
  opsHash: z.ZodString;
@@ -785,14 +1278,14 @@ declare const compiledArtifactSchema: z.ZodObject<{
785
1278
  type: z.ZodUnion<readonly [z.ZodEnum<{
786
1279
  bigint: "bigint";
787
1280
  boolean: "boolean";
788
- uuid: "uuid";
789
1281
  text: "text";
1282
+ date: "date";
1283
+ timestamptz: "timestamptz";
1284
+ jsonb: "jsonb";
1285
+ uuid: "uuid";
790
1286
  integer: "integer";
791
1287
  numeric: "numeric";
792
1288
  double: "double";
793
- timestamptz: "timestamptz";
794
- date: "date";
795
- jsonb: "jsonb";
796
1289
  }>, z.ZodObject<{
797
1290
  enum: z.ZodString;
798
1291
  values: z.ZodArray<z.ZodString>;
@@ -816,6 +1309,64 @@ declare const compiledArtifactSchema: z.ZodObject<{
816
1309
  insertable: z.ZodArray<z.ZodString>;
817
1310
  settable: z.ZodArray<z.ZodString>;
818
1311
  appendable: z.ZodArray<z.ZodString>;
1312
+ touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
1313
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1314
+ at: z.ZodOptional<z.ZodString>;
1315
+ by: z.ZodOptional<z.ZodString>;
1316
+ rev: z.ZodOptional<z.ZodString>;
1317
+ source: z.ZodOptional<z.ZodString>;
1318
+ conflicts: z.ZodOptional<z.ZodString>;
1319
+ }, z.core.$strict>>>;
1320
+ resolved: z.ZodOptional<z.ZodObject<{
1321
+ pk: z.ZodString;
1322
+ manual: z.ZodString;
1323
+ sources: z.ZodArray<z.ZodObject<{
1324
+ name: z.ZodString;
1325
+ kind: z.ZodEnum<{
1326
+ manual: "manual";
1327
+ prefetch: "prefetch";
1328
+ etl: "etl";
1329
+ }>;
1330
+ table: z.ZodString;
1331
+ columns: z.ZodArray<z.ZodString>;
1332
+ key: z.ZodOptional<z.ZodString>;
1333
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1334
+ shape: z.ZodLiteral<"single">;
1335
+ }, z.core.$strip>, z.ZodObject<{
1336
+ shape: z.ZodLiteral<"batch">;
1337
+ maxKeys: z.ZodNumber;
1338
+ }, z.core.$strip>]>>;
1339
+ function: z.ZodOptional<z.ZodObject<{
1340
+ kind: z.ZodEnum<{
1341
+ managed: "managed";
1342
+ native: "native";
1343
+ }>;
1344
+ id: z.ZodString;
1345
+ }, z.core.$strip>>;
1346
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1347
+ maxStalenessMs: z.ZodNumber;
1348
+ timeoutMs: z.ZodNumber;
1349
+ onError: z.ZodEnum<{
1350
+ fallback: "fallback";
1351
+ fail: "fail";
1352
+ }>;
1353
+ }, z.core.$strip>>;
1354
+ writeback: z.ZodOptional<z.ZodObject<{
1355
+ columns: z.ZodArray<z.ZodString>;
1356
+ defaultMode: z.ZodEnum<{
1357
+ sync: "sync";
1358
+ async: "async";
1359
+ }>;
1360
+ timeoutMs: z.ZodNumber;
1361
+ clearManualOnConfirm: z.ZodBoolean;
1362
+ }, z.core.$strip>>;
1363
+ }, z.core.$strip>>;
1364
+ deletedBy: z.ZodArray<z.ZodString>;
1365
+ materialized: z.ZodOptional<z.ZodObject<{
1366
+ table: z.ZodString;
1367
+ compute: z.ZodString;
1368
+ }, z.core.$strip>>;
1369
+ }, z.core.$strip>>;
819
1370
  constraints: z.ZodArray<z.ZodObject<{
820
1371
  name: z.ZodString;
821
1372
  columns: z.ZodArray<z.ZodString>;
@@ -824,7 +1375,7 @@ declare const compiledArtifactSchema: z.ZodObject<{
824
1375
  dynamicFilterMaxNodes: z.ZodDefault<z.ZodNumber>;
825
1376
  }, z.core.$strip>>;
826
1377
  operations: z.ZodRecord<z.ZodString, z.ZodObject<{
827
- irVersion: z.ZodLiteral<1>;
1378
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
828
1379
  name: z.ZodString;
829
1380
  opHash: z.ZodString;
830
1381
  kind: z.ZodEnum<{
@@ -842,14 +1393,14 @@ declare const compiledArtifactSchema: z.ZodObject<{
842
1393
  scalar: z.ZodEnum<{
843
1394
  bigint: "bigint";
844
1395
  boolean: "boolean";
845
- uuid: "uuid";
846
1396
  text: "text";
1397
+ date: "date";
1398
+ timestamptz: "timestamptz";
1399
+ jsonb: "jsonb";
1400
+ uuid: "uuid";
847
1401
  integer: "integer";
848
1402
  numeric: "numeric";
849
1403
  double: "double";
850
- timestamptz: "timestamptz";
851
- date: "date";
852
- jsonb: "jsonb";
853
1404
  }>;
854
1405
  }, z.core.$strip>, z.ZodObject<{
855
1406
  kind: z.ZodLiteral<"enum">;
@@ -914,6 +1465,39 @@ declare const compiledArtifactSchema: z.ZodObject<{
914
1465
  variable: z.ZodString;
915
1466
  negated: z.ZodBoolean;
916
1467
  }, z.core.$strip>>;
1468
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
1469
+ source: z.ZodString;
1470
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
1471
+ key: z.ZodUnion<readonly [z.ZodObject<{
1472
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
1473
+ kind: z.ZodLiteral<"literal">;
1474
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1475
+ }, z.core.$strip>, z.ZodObject<{
1476
+ kind: z.ZodLiteral<"variable">;
1477
+ name: z.ZodString;
1478
+ }, z.core.$strip>, z.ZodObject<{
1479
+ kind: z.ZodLiteral<"claim">;
1480
+ key: z.ZodEnum<{
1481
+ sub: "sub";
1482
+ org: "org";
1483
+ }>;
1484
+ }, z.core.$strip>], "kind">;
1485
+ }, z.core.$strip>, z.ZodObject<{
1486
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
1487
+ kind: z.ZodLiteral<"literal">;
1488
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1489
+ }, z.core.$strip>, z.ZodObject<{
1490
+ kind: z.ZodLiteral<"variable">;
1491
+ name: z.ZodString;
1492
+ }, z.core.$strip>, z.ZodObject<{
1493
+ kind: z.ZodLiteral<"claim">;
1494
+ key: z.ZodEnum<{
1495
+ sub: "sub";
1496
+ org: "org";
1497
+ }>;
1498
+ }, z.core.$strip>], "kind">;
1499
+ }, z.core.$strip>]>;
1500
+ }, z.core.$strip>>>;
917
1501
  }, z.core.$strip>, z.ZodObject<{
918
1502
  kind: z.ZodLiteral<"byPk">;
919
1503
  alias: z.ZodString;
@@ -940,6 +1524,39 @@ declare const compiledArtifactSchema: z.ZodObject<{
940
1524
  variable: z.ZodString;
941
1525
  negated: z.ZodBoolean;
942
1526
  }, z.core.$strip>>;
1527
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
1528
+ source: z.ZodString;
1529
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
1530
+ key: z.ZodUnion<readonly [z.ZodObject<{
1531
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
1532
+ kind: z.ZodLiteral<"literal">;
1533
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1534
+ }, z.core.$strip>, z.ZodObject<{
1535
+ kind: z.ZodLiteral<"variable">;
1536
+ name: z.ZodString;
1537
+ }, z.core.$strip>, z.ZodObject<{
1538
+ kind: z.ZodLiteral<"claim">;
1539
+ key: z.ZodEnum<{
1540
+ sub: "sub";
1541
+ org: "org";
1542
+ }>;
1543
+ }, z.core.$strip>], "kind">;
1544
+ }, z.core.$strip>, z.ZodObject<{
1545
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
1546
+ kind: z.ZodLiteral<"literal">;
1547
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1548
+ }, z.core.$strip>, z.ZodObject<{
1549
+ kind: z.ZodLiteral<"variable">;
1550
+ name: z.ZodString;
1551
+ }, z.core.$strip>, z.ZodObject<{
1552
+ kind: z.ZodLiteral<"claim">;
1553
+ key: z.ZodEnum<{
1554
+ sub: "sub";
1555
+ org: "org";
1556
+ }>;
1557
+ }, z.core.$strip>], "kind">;
1558
+ }, z.core.$strip>]>;
1559
+ }, z.core.$strip>>>;
943
1560
  }, z.core.$strip>, z.ZodObject<{
944
1561
  kind: z.ZodLiteral<"aggregate">;
945
1562
  alias: z.ZodString;
@@ -956,6 +1573,46 @@ declare const compiledArtifactSchema: z.ZodObject<{
956
1573
  variable: z.ZodString;
957
1574
  negated: z.ZodBoolean;
958
1575
  }, z.core.$strip>>;
1576
+ }, z.core.$strip>, z.ZodObject<{
1577
+ kind: z.ZodLiteral<"aggregateGroups">;
1578
+ alias: z.ZodString;
1579
+ table: z.ZodString;
1580
+ where: z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>;
1581
+ groupBy: z.ZodArray<z.ZodObject<{
1582
+ column: z.ZodString;
1583
+ bucket: z.ZodOptional<z.ZodEnum<{
1584
+ year: "year";
1585
+ quarter: "quarter";
1586
+ month: "month";
1587
+ week: "week";
1588
+ day: "day";
1589
+ hour: "hour";
1590
+ }>>;
1591
+ }, z.core.$strip>>;
1592
+ key: z.ZodDefault<z.ZodArray<z.ZodObject<{
1593
+ alias: z.ZodString;
1594
+ column: z.ZodString;
1595
+ }, z.core.$strip>>>;
1596
+ count: z.ZodOptional<z.ZodObject<{
1597
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1598
+ distinct: z.ZodOptional<z.ZodBoolean>;
1599
+ }, z.core.$strip>>;
1600
+ sum: z.ZodOptional<z.ZodArray<z.ZodString>>;
1601
+ avg: z.ZodOptional<z.ZodArray<z.ZodString>>;
1602
+ limit: z.ZodObject<{
1603
+ variable: z.ZodOptional<z.ZodString>;
1604
+ value: z.ZodOptional<z.ZodNumber>;
1605
+ default: z.ZodNumber;
1606
+ max: z.ZodNumber;
1607
+ }, z.core.$strip>;
1608
+ offset: z.ZodOptional<z.ZodObject<{
1609
+ variable: z.ZodOptional<z.ZodString>;
1610
+ value: z.ZodOptional<z.ZodNumber>;
1611
+ }, z.core.$strip>>;
1612
+ includeIf: z.ZodOptional<z.ZodObject<{
1613
+ variable: z.ZodString;
1614
+ negated: z.ZodBoolean;
1615
+ }, z.core.$strip>>;
959
1616
  }, z.core.$strip>, z.ZodObject<{
960
1617
  kind: z.ZodLiteral<"mutation">;
961
1618
  op: z.ZodEnum<{
@@ -967,7 +1624,23 @@ declare const compiledArtifactSchema: z.ZodObject<{
967
1624
  deleteByPk: "deleteByPk";
968
1625
  cowOverride: "cowOverride";
969
1626
  cowRevert: "cowRevert";
1627
+ resolvedWrite: "resolvedWrite";
970
1628
  }>;
1629
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
1630
+ insert: "insert";
1631
+ update: "update";
1632
+ revert: "revert";
1633
+ delete: "delete";
1634
+ }>>;
1635
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1636
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
1637
+ source: z.ZodString;
1638
+ mode: z.ZodEnum<{
1639
+ sync: "sync";
1640
+ async: "async";
1641
+ }>;
1642
+ }, z.core.$strip>>>;
1643
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
971
1644
  alias: z.ZodString;
972
1645
  table: z.ZodString;
973
1646
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -1095,6 +1768,7 @@ declare const compiledArtifactSchema: z.ZodObject<{
1095
1768
  insertCheck: z.ZodOptional<z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>;
1096
1769
  returning: z.ZodNullable<z.ZodType<SelectionIr, unknown, z.core.$ZodTypeInternals<SelectionIr, unknown>>>;
1097
1770
  affectedRows: z.ZodDefault<z.ZodBoolean>;
1771
+ assertAffectedRows: z.ZodOptional<z.ZodNumber>;
1098
1772
  includeIf: z.ZodOptional<z.ZodObject<{
1099
1773
  variable: z.ZodString;
1100
1774
  negated: z.ZodBoolean;
@@ -1116,4 +1790,4 @@ declare function normalizeIr(raw: unknown): CompiledArtifact;
1116
1790
  /** Index an artifact's operations by opHash (the wire selector). */
1117
1791
  declare function indexByHash(artifact: CompiledArtifact): Map<string, CompiledOperation>;
1118
1792
 
1119
- export { CLAIMS_CONTRACT, CMP_OPS, type ClaimKey, type CmpOp, type CompiledArtifact, type CompiledOperation, INPUT_REF_KINDS, IR_VERSION, type InputRefKind, IrVersionError, type LimitIr, type OrderIr, type PredIr, type RootIr, type SelectionIr, type TableMetaIr, type ValueIr, type VariableDefaultIr, type VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema };
1793
+ export { CLAIMS_CONTRACT, CMP_OPS, type CellSelectionIr, type ClaimKey, type CmpOp, type CompiledArtifact, type CompiledOperation, DATE_BUCKETS, type DateBucket, type GroupByKeyIr, INPUT_REF_KINDS, IR_VERSION, type InputRefKind, IrVersionError, LEGACY_IR_VERSION, type LimitIr, type OrderIr, type PredIr, type PrefetchPlanIr, type ResolvedMetaIr, type ResolvedSourceIr, type RootIr, type SelectionIr, type TableMetaIr, type ValueIr, type VariableDefaultIr, type VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, prefetchPlanIrSchema, requiredArtifactIrVersion, resolvedMetaIrSchema, resolvedSourceIrSchema, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema };