@sequenceholdings/orm 2.1.0 → 2.2.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 (77) hide show
  1. package/README.md +40 -1
  2. package/dist/authoring.cjs +1619 -121
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +252 -8
  5. package/dist/authoring.d.ts +252 -8
  6. package/dist/authoring.js +1607 -123
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +713 -41
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +1520 -51
  11. package/dist/canonical.d.ts +1520 -51
  12. package/dist/canonical.js +693 -42
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +7103 -3901
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +7104 -3902
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +122 -40
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +85 -25
  21. package/dist/client.d.ts +85 -25
  22. package/dist/client.js +119 -41
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +2464 -450
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +79 -4
  27. package/dist/compiler.d.ts +79 -4
  28. package/dist/compiler.js +2457 -451
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-C6EG6Wq7.d.cts +99 -0
  31. package/dist/constants-C6EG6Wq7.d.ts +99 -0
  32. package/dist/definition-DjfC7Lll.d.cts +91 -0
  33. package/dist/definition-DjfC7Lll.d.ts +91 -0
  34. package/dist/dynamic-input.cjs +2 -1
  35. package/dist/dynamic-input.cjs.map +1 -1
  36. package/dist/dynamic-input.d.cts +9 -1
  37. package/dist/dynamic-input.d.ts +9 -1
  38. package/dist/dynamic-input.js +2 -1
  39. package/dist/dynamic-input.js.map +1 -1
  40. package/dist/index.cjs +2656 -418
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +693 -116
  43. package/dist/index.d.ts +693 -116
  44. package/dist/index.js +2622 -420
  45. package/dist/index.js.map +1 -1
  46. package/dist/ir.cjs +811 -48
  47. package/dist/ir.cjs.map +1 -1
  48. package/dist/ir.d.cts +670 -27
  49. package/dist/ir.d.ts +670 -27
  50. package/dist/ir.js +802 -49
  51. package/dist/ir.js.map +1 -1
  52. package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
  53. package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
  54. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  55. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  56. package/dist/predicate-v2.cjs +804 -51
  57. package/dist/predicate-v2.cjs.map +1 -1
  58. package/dist/predicate-v2.d.cts +2 -1
  59. package/dist/predicate-v2.d.ts +2 -1
  60. package/dist/predicate-v2.js +804 -51
  61. package/dist/predicate-v2.js.map +1 -1
  62. package/dist/sdl.cjs +1014 -75
  63. package/dist/sdl.cjs.map +1 -1
  64. package/dist/sdl.d.cts +14 -3
  65. package/dist/sdl.d.ts +14 -3
  66. package/dist/sdl.js +1012 -76
  67. package/dist/sdl.js.map +1 -1
  68. package/package.json +13 -7
  69. package/src/codegen-gql/server-fns.cjs +2 -2
  70. package/templates/orm-namespace/AGENTS.md +10 -0
  71. package/templates/orm-namespace/CLAUDE.md +1 -82
  72. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  73. package/templates/orm-namespace/codegen.ts +2 -1
  74. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  75. package/templates/orm-namespace/package.json +2 -1
  76. package/templates/orm-namespace/schema/tables.ts +3 -2
  77. 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-C6EG6Wq7.cjs';
2
3
 
3
4
  /**
4
5
  * Compiled-operation IR — THE frozen contract between the GraphQL compiler
@@ -22,10 +23,15 @@ import { z } from 'zod';
22
23
  * pattern): executor upgrades decouple from artifact re-pushes.
23
24
  */
24
25
 
25
- /** Maximum supported version. Emit v1 until an operation needs v2 semantics. */
26
- declare const IR_VERSION: 2;
26
+ /** Maximum supported version; emit the oldest version that preserves semantics. */
27
+ declare const IR_VERSION: 5;
27
28
  declare const LEGACY_IR_VERSION: 1;
28
- declare const irVersionSchema: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
29
+ declare const GUARDED_IR_VERSION: 2;
30
+ /** Older v2 executors must not strip namespace-scoped authorization. */
31
+ declare const COMPOSED_IR_VERSION: 3;
32
+ declare const SQL_IR_VERSION: 4;
33
+ declare const RUNTIME_SQL_IR_VERSION: 5;
34
+ declare const irVersionSchema: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
29
35
  /** Keep v1 artifact identity when assembling only legacy operations from registry rows. */
30
36
  declare function requiredArtifactIrVersion(operations: readonly unknown[]): z.infer<typeof irVersionSchema>;
31
37
  /** The exact claim keys the platform stamps — mirrors claims.ts. */
@@ -86,9 +92,11 @@ type PredIr = {
86
92
  | {
87
93
  kind: 'capability';
88
94
  key: string;
95
+ namespace?: string;
89
96
  } | {
90
97
  kind: 'role';
91
98
  key: string;
99
+ namespace?: string;
92
100
  }
93
101
  /** §4f: a client-supplied BoolExp variable lands here, validated + lowered at runtime. */
94
102
  | {
@@ -123,6 +131,24 @@ declare const limitIrSchema: z.ZodObject<{
123
131
  max: z.ZodNumber;
124
132
  }, z.core.$strip>;
125
133
  type LimitIr = z.infer<typeof limitIrSchema>;
134
+ /** One cell of a `cells { … }` block: the parts selected for one column. */
135
+ interface CellSelectionIr {
136
+ alias: string;
137
+ /** Logical column whose cell this is. */
138
+ column: string;
139
+ typename: string;
140
+ parts: Array<{
141
+ alias: string;
142
+ part: 'source' | 'at' | 'by' | 'conflicts';
143
+ /** `conflicts { … }`: the candidate fields selected, in order. */
144
+ fields?: Array<{
145
+ alias: string;
146
+ field: 'source' | 'at' | 'value';
147
+ }>;
148
+ /** `conflicts { … }` element typename. */
149
+ typename?: string;
150
+ }>;
151
+ }
126
152
  interface SelectionIr {
127
153
  /** GraphQL type name for __typename synthesis + Apollo normalization. */
128
154
  typename: string;
@@ -130,6 +156,12 @@ interface SelectionIr {
130
156
  alias: string;
131
157
  column: string;
132
158
  }>;
159
+ /** The typed `cells { … }` block (tables with cell metadata, resolved tables). */
160
+ cells?: {
161
+ alias: string;
162
+ typename: string;
163
+ fields: CellSelectionIr[];
164
+ };
133
165
  relations: Array<{
134
166
  alias: string;
135
167
  link: string;
@@ -161,6 +193,46 @@ interface SelectionIr {
161
193
  }
162
194
  declare const selectionIrSchema: z.ZodType<SelectionIr>;
163
195
 
196
+ /**
197
+ * `@prefetch(source:)` on a resolved-table query root: before the SQL runs,
198
+ * the data plane refreshes the named prefetch source for the keys this root
199
+ * addresses. `key` is the single pk value (byPk / `pk: {_eq}`) or the pk list
200
+ * (`pk: {_in}` on batch sources).
201
+ */
202
+ declare const prefetchPlanIrSchema: z.ZodObject<{
203
+ source: z.ZodString;
204
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
205
+ key: z.ZodUnion<readonly [z.ZodObject<{
206
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
207
+ kind: z.ZodLiteral<"literal">;
208
+ 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]>>]>;
209
+ }, z.core.$strip>, z.ZodObject<{
210
+ kind: z.ZodLiteral<"variable">;
211
+ name: z.ZodString;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"claim">;
214
+ key: z.ZodEnum<{
215
+ sub: "sub";
216
+ org: "org";
217
+ }>;
218
+ }, z.core.$strip>], "kind">;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
221
+ kind: z.ZodLiteral<"literal">;
222
+ 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]>>]>;
223
+ }, z.core.$strip>, z.ZodObject<{
224
+ kind: z.ZodLiteral<"variable">;
225
+ name: z.ZodString;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"claim">;
228
+ key: z.ZodEnum<{
229
+ sub: "sub";
230
+ org: "org";
231
+ }>;
232
+ }, z.core.$strip>], "kind">;
233
+ }, z.core.$strip>]>;
234
+ }, z.core.$strip>;
235
+ type PrefetchPlanIr = z.infer<typeof prefetchPlanIrSchema>;
164
236
  /**
165
237
  * The date-bucket units a grouped aggregate may apply to a `date` /
166
238
  * `timestamptz` group key. A CLOSED enum on purpose: the executor maps each
@@ -226,6 +298,39 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
226
298
  variable: z.ZodString;
227
299
  negated: z.ZodBoolean;
228
300
  }, z.core.$strip>>;
301
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
302
+ source: z.ZodString;
303
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
304
+ key: z.ZodUnion<readonly [z.ZodObject<{
305
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
306
+ kind: z.ZodLiteral<"literal">;
307
+ 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]>>]>;
308
+ }, z.core.$strip>, z.ZodObject<{
309
+ kind: z.ZodLiteral<"variable">;
310
+ name: z.ZodString;
311
+ }, z.core.$strip>, z.ZodObject<{
312
+ kind: z.ZodLiteral<"claim">;
313
+ key: z.ZodEnum<{
314
+ sub: "sub";
315
+ org: "org";
316
+ }>;
317
+ }, z.core.$strip>], "kind">;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
320
+ kind: z.ZodLiteral<"literal">;
321
+ 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]>>]>;
322
+ }, z.core.$strip>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"variable">;
324
+ name: z.ZodString;
325
+ }, z.core.$strip>, z.ZodObject<{
326
+ kind: z.ZodLiteral<"claim">;
327
+ key: z.ZodEnum<{
328
+ sub: "sub";
329
+ org: "org";
330
+ }>;
331
+ }, z.core.$strip>], "kind">;
332
+ }, z.core.$strip>]>;
333
+ }, z.core.$strip>>>;
229
334
  }, z.core.$strip>, z.ZodObject<{
230
335
  kind: z.ZodLiteral<"byPk">;
231
336
  alias: z.ZodString;
@@ -252,6 +357,39 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
252
357
  variable: z.ZodString;
253
358
  negated: z.ZodBoolean;
254
359
  }, z.core.$strip>>;
360
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
361
+ source: z.ZodString;
362
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
363
+ key: z.ZodUnion<readonly [z.ZodObject<{
364
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
365
+ kind: z.ZodLiteral<"literal">;
366
+ 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]>>]>;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ kind: z.ZodLiteral<"variable">;
369
+ name: z.ZodString;
370
+ }, z.core.$strip>, z.ZodObject<{
371
+ kind: z.ZodLiteral<"claim">;
372
+ key: z.ZodEnum<{
373
+ sub: "sub";
374
+ org: "org";
375
+ }>;
376
+ }, z.core.$strip>], "kind">;
377
+ }, z.core.$strip>, z.ZodObject<{
378
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
379
+ kind: z.ZodLiteral<"literal">;
380
+ 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]>>]>;
381
+ }, z.core.$strip>, z.ZodObject<{
382
+ kind: z.ZodLiteral<"variable">;
383
+ name: z.ZodString;
384
+ }, z.core.$strip>, z.ZodObject<{
385
+ kind: z.ZodLiteral<"claim">;
386
+ key: z.ZodEnum<{
387
+ sub: "sub";
388
+ org: "org";
389
+ }>;
390
+ }, z.core.$strip>], "kind">;
391
+ }, z.core.$strip>]>;
392
+ }, z.core.$strip>>>;
255
393
  }, z.core.$strip>, z.ZodObject<{
256
394
  kind: z.ZodLiteral<"aggregate">;
257
395
  alias: z.ZodString;
@@ -319,7 +457,23 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
319
457
  deleteByPk: "deleteByPk";
320
458
  cowOverride: "cowOverride";
321
459
  cowRevert: "cowRevert";
460
+ resolvedWrite: "resolvedWrite";
322
461
  }>;
462
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
463
+ insert: "insert";
464
+ update: "update";
465
+ revert: "revert";
466
+ delete: "delete";
467
+ }>>;
468
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
469
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
470
+ source: z.ZodString;
471
+ mode: z.ZodEnum<{
472
+ sync: "sync";
473
+ async: "async";
474
+ }>;
475
+ }, z.core.$strip>>>;
476
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
323
477
  alias: z.ZodString;
324
478
  table: z.ZodString;
325
479
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -474,14 +628,14 @@ declare const variableIrSchema: z.ZodObject<{
474
628
  scalar: z.ZodEnum<{
475
629
  bigint: "bigint";
476
630
  boolean: "boolean";
477
- uuid: "uuid";
631
+ date: "date";
478
632
  text: "text";
633
+ timestamptz: "timestamptz";
634
+ jsonb: "jsonb";
635
+ uuid: "uuid";
479
636
  integer: "integer";
480
637
  numeric: "numeric";
481
638
  double: "double";
482
- timestamptz: "timestamptz";
483
- date: "date";
484
- jsonb: "jsonb";
485
639
  }>;
486
640
  }, z.core.$strip>, z.ZodObject<{
487
641
  kind: z.ZodLiteral<"enum">;
@@ -508,7 +662,47 @@ declare const variableIrSchema: z.ZodObject<{
508
662
  }, z.core.$strip>;
509
663
  type VariableIr = z.infer<typeof variableIrSchema>;
510
664
  declare const compiledOperationSchema: z.ZodObject<{
511
- irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
665
+ language: z.ZodOptional<z.ZodLiteral<"sql">>;
666
+ sqlQuery: z.ZodOptional<z.ZodObject<{
667
+ catalog: z.ZodObject<{
668
+ identity: z.ZodString;
669
+ objects: z.ZodArray<z.ZodObject<{
670
+ ref: z.ZodString;
671
+ table: z.ZodString;
672
+ columns: z.ZodArray<z.ZodObject<{
673
+ name: z.ZodString;
674
+ nullable: z.ZodBoolean;
675
+ type: z.ZodString;
676
+ }, z.core.$strip>>;
677
+ scan: z.ZodString;
678
+ read: z.ZodArray<z.ZodString>;
679
+ }, z.core.$strict>>;
680
+ }, z.core.$strict>;
681
+ read: z.ZodArray<z.ZodString>;
682
+ maxRows: z.ZodNumber;
683
+ }, z.core.$strict>>;
684
+ sql: z.ZodOptional<z.ZodObject<{
685
+ text: z.ZodString;
686
+ columns: z.ZodArray<z.ZodObject<{
687
+ name: z.ZodString;
688
+ type: z.ZodEnum<{
689
+ bigint: "bigint";
690
+ boolean: "boolean";
691
+ date: "date";
692
+ text: "text";
693
+ timestamptz: "timestamptz";
694
+ uuid: "uuid";
695
+ integer: "integer";
696
+ numeric: "numeric";
697
+ double: "double";
698
+ }>;
699
+ nullable: z.ZodBoolean;
700
+ }, z.core.$strip>>;
701
+ parameters: z.ZodArray<z.ZodString>;
702
+ read: z.ZodArray<z.ZodString>;
703
+ maxRows: z.ZodNumber;
704
+ }, z.core.$strict>>;
705
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
512
706
  name: z.ZodString;
513
707
  opHash: z.ZodString;
514
708
  kind: z.ZodEnum<{
@@ -526,14 +720,14 @@ declare const compiledOperationSchema: z.ZodObject<{
526
720
  scalar: z.ZodEnum<{
527
721
  bigint: "bigint";
528
722
  boolean: "boolean";
529
- uuid: "uuid";
723
+ date: "date";
530
724
  text: "text";
725
+ timestamptz: "timestamptz";
726
+ jsonb: "jsonb";
727
+ uuid: "uuid";
531
728
  integer: "integer";
532
729
  numeric: "numeric";
533
730
  double: "double";
534
- timestamptz: "timestamptz";
535
- date: "date";
536
- jsonb: "jsonb";
537
731
  }>;
538
732
  }, z.core.$strip>, z.ZodObject<{
539
733
  kind: z.ZodLiteral<"enum">;
@@ -598,6 +792,39 @@ declare const compiledOperationSchema: z.ZodObject<{
598
792
  variable: z.ZodString;
599
793
  negated: z.ZodBoolean;
600
794
  }, z.core.$strip>>;
795
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
796
+ source: z.ZodString;
797
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
798
+ key: z.ZodUnion<readonly [z.ZodObject<{
799
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
800
+ kind: z.ZodLiteral<"literal">;
801
+ 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]>>]>;
802
+ }, z.core.$strip>, z.ZodObject<{
803
+ kind: z.ZodLiteral<"variable">;
804
+ name: z.ZodString;
805
+ }, z.core.$strip>, z.ZodObject<{
806
+ kind: z.ZodLiteral<"claim">;
807
+ key: z.ZodEnum<{
808
+ sub: "sub";
809
+ org: "org";
810
+ }>;
811
+ }, z.core.$strip>], "kind">;
812
+ }, z.core.$strip>, z.ZodObject<{
813
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
814
+ kind: z.ZodLiteral<"literal">;
815
+ 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]>>]>;
816
+ }, z.core.$strip>, z.ZodObject<{
817
+ kind: z.ZodLiteral<"variable">;
818
+ name: z.ZodString;
819
+ }, z.core.$strip>, z.ZodObject<{
820
+ kind: z.ZodLiteral<"claim">;
821
+ key: z.ZodEnum<{
822
+ sub: "sub";
823
+ org: "org";
824
+ }>;
825
+ }, z.core.$strip>], "kind">;
826
+ }, z.core.$strip>]>;
827
+ }, z.core.$strip>>>;
601
828
  }, z.core.$strip>, z.ZodObject<{
602
829
  kind: z.ZodLiteral<"byPk">;
603
830
  alias: z.ZodString;
@@ -624,6 +851,39 @@ declare const compiledOperationSchema: z.ZodObject<{
624
851
  variable: z.ZodString;
625
852
  negated: z.ZodBoolean;
626
853
  }, z.core.$strip>>;
854
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
855
+ source: z.ZodString;
856
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
857
+ key: z.ZodUnion<readonly [z.ZodObject<{
858
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
859
+ kind: z.ZodLiteral<"literal">;
860
+ 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]>>]>;
861
+ }, z.core.$strip>, z.ZodObject<{
862
+ kind: z.ZodLiteral<"variable">;
863
+ name: z.ZodString;
864
+ }, z.core.$strip>, z.ZodObject<{
865
+ kind: z.ZodLiteral<"claim">;
866
+ key: z.ZodEnum<{
867
+ sub: "sub";
868
+ org: "org";
869
+ }>;
870
+ }, z.core.$strip>], "kind">;
871
+ }, z.core.$strip>, z.ZodObject<{
872
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
873
+ kind: z.ZodLiteral<"literal">;
874
+ 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]>>]>;
875
+ }, z.core.$strip>, z.ZodObject<{
876
+ kind: z.ZodLiteral<"variable">;
877
+ name: z.ZodString;
878
+ }, z.core.$strip>, z.ZodObject<{
879
+ kind: z.ZodLiteral<"claim">;
880
+ key: z.ZodEnum<{
881
+ sub: "sub";
882
+ org: "org";
883
+ }>;
884
+ }, z.core.$strip>], "kind">;
885
+ }, z.core.$strip>]>;
886
+ }, z.core.$strip>>>;
627
887
  }, z.core.$strip>, z.ZodObject<{
628
888
  kind: z.ZodLiteral<"aggregate">;
629
889
  alias: z.ZodString;
@@ -691,7 +951,23 @@ declare const compiledOperationSchema: z.ZodObject<{
691
951
  deleteByPk: "deleteByPk";
692
952
  cowOverride: "cowOverride";
693
953
  cowRevert: "cowRevert";
954
+ resolvedWrite: "resolvedWrite";
694
955
  }>;
956
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
957
+ insert: "insert";
958
+ update: "update";
959
+ revert: "revert";
960
+ delete: "delete";
961
+ }>>;
962
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
963
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
964
+ source: z.ZodString;
965
+ mode: z.ZodEnum<{
966
+ sync: "sync";
967
+ async: "async";
968
+ }>;
969
+ }, z.core.$strip>>>;
970
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
695
971
  alias: z.ZodString;
696
972
  table: z.ZodString;
697
973
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -827,6 +1103,99 @@ declare const compiledOperationSchema: z.ZodObject<{
827
1103
  }, z.core.$strip>], "kind">>;
828
1104
  }, z.core.$strip>;
829
1105
  type CompiledOperation = z.infer<typeof compiledOperationSchema>;
1106
+ declare const resolvedSourceIrSchema: z.ZodObject<{
1107
+ name: z.ZodString;
1108
+ kind: z.ZodEnum<{
1109
+ manual: "manual";
1110
+ prefetch: "prefetch";
1111
+ etl: "etl";
1112
+ }>;
1113
+ table: z.ZodString;
1114
+ columns: z.ZodArray<z.ZodString>;
1115
+ key: z.ZodOptional<z.ZodString>;
1116
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1117
+ shape: z.ZodLiteral<"single">;
1118
+ }, z.core.$strip>, z.ZodObject<{
1119
+ shape: z.ZodLiteral<"batch">;
1120
+ maxKeys: z.ZodNumber;
1121
+ }, z.core.$strip>]>>;
1122
+ function: z.ZodOptional<z.ZodObject<{
1123
+ kind: z.ZodEnum<{
1124
+ managed: "managed";
1125
+ native: "native";
1126
+ }>;
1127
+ id: z.ZodString;
1128
+ }, z.core.$strip>>;
1129
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1130
+ maxStalenessMs: z.ZodNumber;
1131
+ timeoutMs: z.ZodNumber;
1132
+ onError: z.ZodEnum<{
1133
+ fallback: "fallback";
1134
+ fail: "fail";
1135
+ }>;
1136
+ }, z.core.$strip>>;
1137
+ writeback: z.ZodOptional<z.ZodObject<{
1138
+ columns: z.ZodArray<z.ZodString>;
1139
+ defaultMode: z.ZodEnum<{
1140
+ sync: "sync";
1141
+ async: "async";
1142
+ }>;
1143
+ timeoutMs: z.ZodNumber;
1144
+ clearManualOnConfirm: z.ZodBoolean;
1145
+ }, z.core.$strip>>;
1146
+ }, z.core.$strip>;
1147
+ type ResolvedSourceIr = z.infer<typeof resolvedSourceIrSchema>;
1148
+ declare const resolvedMetaIrSchema: z.ZodObject<{
1149
+ pk: z.ZodString;
1150
+ manual: z.ZodString;
1151
+ sources: z.ZodArray<z.ZodObject<{
1152
+ name: z.ZodString;
1153
+ kind: z.ZodEnum<{
1154
+ manual: "manual";
1155
+ prefetch: "prefetch";
1156
+ etl: "etl";
1157
+ }>;
1158
+ table: z.ZodString;
1159
+ columns: z.ZodArray<z.ZodString>;
1160
+ key: z.ZodOptional<z.ZodString>;
1161
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1162
+ shape: z.ZodLiteral<"single">;
1163
+ }, z.core.$strip>, z.ZodObject<{
1164
+ shape: z.ZodLiteral<"batch">;
1165
+ maxKeys: z.ZodNumber;
1166
+ }, z.core.$strip>]>>;
1167
+ function: z.ZodOptional<z.ZodObject<{
1168
+ kind: z.ZodEnum<{
1169
+ managed: "managed";
1170
+ native: "native";
1171
+ }>;
1172
+ id: z.ZodString;
1173
+ }, z.core.$strip>>;
1174
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1175
+ maxStalenessMs: z.ZodNumber;
1176
+ timeoutMs: z.ZodNumber;
1177
+ onError: z.ZodEnum<{
1178
+ fallback: "fallback";
1179
+ fail: "fail";
1180
+ }>;
1181
+ }, z.core.$strip>>;
1182
+ writeback: z.ZodOptional<z.ZodObject<{
1183
+ columns: z.ZodArray<z.ZodString>;
1184
+ defaultMode: z.ZodEnum<{
1185
+ sync: "sync";
1186
+ async: "async";
1187
+ }>;
1188
+ timeoutMs: z.ZodNumber;
1189
+ clearManualOnConfirm: z.ZodBoolean;
1190
+ }, z.core.$strip>>;
1191
+ }, z.core.$strip>>;
1192
+ deletedBy: z.ZodArray<z.ZodString>;
1193
+ materialized: z.ZodOptional<z.ZodObject<{
1194
+ table: z.ZodString;
1195
+ compute: z.ZodString;
1196
+ }, z.core.$strip>>;
1197
+ }, z.core.$strip>;
1198
+ type ResolvedMetaIr = z.infer<typeof resolvedMetaIrSchema>;
830
1199
  /**
831
1200
  * Runtime whitelist metadata per table — everything the executor needs to
832
1201
  * build Drizzle table objects, validate §4f dynamic inputs, and lower them.
@@ -834,6 +1203,23 @@ type CompiledOperation = z.infer<typeof compiledOperationSchema>;
834
1203
  */
835
1204
  declare const tableMetaIrSchema: z.ZodObject<{
836
1205
  table: z.ZodString;
1206
+ namespace: z.ZodOptional<z.ZodString>;
1207
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1208
+ foreignReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
1209
+ column: z.ZodString;
1210
+ target: z.ZodString;
1211
+ targetColumn: z.ZodString;
1212
+ }, z.core.$strip>>>;
1213
+ exportRead: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1214
+ capability: z.ZodString;
1215
+ }, z.core.$strip>, z.ZodObject<{
1216
+ role: z.ZodString;
1217
+ }, z.core.$strip>]>>;
1218
+ exportWrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1219
+ capability: z.ZodString;
1220
+ }, z.core.$strip>, z.ZodObject<{
1221
+ role: z.ZodString;
1222
+ }, z.core.$strip>]>>;
837
1223
  schema: z.ZodString;
838
1224
  typename: z.ZodString;
839
1225
  claimsGated: z.ZodDefault<z.ZodBoolean>;
@@ -843,14 +1229,14 @@ declare const tableMetaIrSchema: z.ZodObject<{
843
1229
  type: z.ZodUnion<readonly [z.ZodEnum<{
844
1230
  bigint: "bigint";
845
1231
  boolean: "boolean";
846
- uuid: "uuid";
1232
+ date: "date";
847
1233
  text: "text";
1234
+ timestamptz: "timestamptz";
1235
+ jsonb: "jsonb";
1236
+ uuid: "uuid";
848
1237
  integer: "integer";
849
1238
  numeric: "numeric";
850
1239
  double: "double";
851
- timestamptz: "timestamptz";
852
- date: "date";
853
- jsonb: "jsonb";
854
1240
  }>, z.ZodObject<{
855
1241
  enum: z.ZodString;
856
1242
  values: z.ZodArray<z.ZodString>;
@@ -875,6 +1261,63 @@ declare const tableMetaIrSchema: z.ZodObject<{
875
1261
  settable: z.ZodArray<z.ZodString>;
876
1262
  appendable: z.ZodArray<z.ZodString>;
877
1263
  touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
1264
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1265
+ at: z.ZodOptional<z.ZodString>;
1266
+ by: z.ZodOptional<z.ZodString>;
1267
+ rev: z.ZodOptional<z.ZodString>;
1268
+ source: z.ZodOptional<z.ZodString>;
1269
+ conflicts: z.ZodOptional<z.ZodString>;
1270
+ }, z.core.$strict>>>;
1271
+ resolved: z.ZodOptional<z.ZodObject<{
1272
+ pk: z.ZodString;
1273
+ manual: z.ZodString;
1274
+ sources: z.ZodArray<z.ZodObject<{
1275
+ name: z.ZodString;
1276
+ kind: z.ZodEnum<{
1277
+ manual: "manual";
1278
+ prefetch: "prefetch";
1279
+ etl: "etl";
1280
+ }>;
1281
+ table: z.ZodString;
1282
+ columns: z.ZodArray<z.ZodString>;
1283
+ key: z.ZodOptional<z.ZodString>;
1284
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1285
+ shape: z.ZodLiteral<"single">;
1286
+ }, z.core.$strip>, z.ZodObject<{
1287
+ shape: z.ZodLiteral<"batch">;
1288
+ maxKeys: z.ZodNumber;
1289
+ }, z.core.$strip>]>>;
1290
+ function: z.ZodOptional<z.ZodObject<{
1291
+ kind: z.ZodEnum<{
1292
+ managed: "managed";
1293
+ native: "native";
1294
+ }>;
1295
+ id: z.ZodString;
1296
+ }, z.core.$strip>>;
1297
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1298
+ maxStalenessMs: z.ZodNumber;
1299
+ timeoutMs: z.ZodNumber;
1300
+ onError: z.ZodEnum<{
1301
+ fallback: "fallback";
1302
+ fail: "fail";
1303
+ }>;
1304
+ }, z.core.$strip>>;
1305
+ writeback: z.ZodOptional<z.ZodObject<{
1306
+ columns: z.ZodArray<z.ZodString>;
1307
+ defaultMode: z.ZodEnum<{
1308
+ sync: "sync";
1309
+ async: "async";
1310
+ }>;
1311
+ timeoutMs: z.ZodNumber;
1312
+ clearManualOnConfirm: z.ZodBoolean;
1313
+ }, z.core.$strip>>;
1314
+ }, z.core.$strip>>;
1315
+ deletedBy: z.ZodArray<z.ZodString>;
1316
+ materialized: z.ZodOptional<z.ZodObject<{
1317
+ table: z.ZodString;
1318
+ compute: z.ZodString;
1319
+ }, z.core.$strip>>;
1320
+ }, z.core.$strip>>;
878
1321
  constraints: z.ZodArray<z.ZodObject<{
879
1322
  name: z.ZodString;
880
1323
  columns: z.ZodArray<z.ZodString>;
@@ -884,12 +1327,33 @@ declare const tableMetaIrSchema: z.ZodObject<{
884
1327
  }, z.core.$strip>;
885
1328
  type TableMetaIr = z.infer<typeof tableMetaIrSchema>;
886
1329
  declare const compiledArtifactSchema: z.ZodObject<{
887
- irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
1330
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
888
1331
  namespace: z.ZodString;
889
1332
  schemaHash: z.ZodString;
1333
+ ownSchemaHash: z.ZodOptional<z.ZodString>;
1334
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1335
+ readPolicies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>>;
890
1336
  opsHash: z.ZodString;
1337
+ unbackedTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
891
1338
  tables: z.ZodRecord<z.ZodString, z.ZodObject<{
892
1339
  table: z.ZodString;
1340
+ namespace: z.ZodOptional<z.ZodString>;
1341
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1342
+ foreignReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
1343
+ column: z.ZodString;
1344
+ target: z.ZodString;
1345
+ targetColumn: z.ZodString;
1346
+ }, z.core.$strip>>>;
1347
+ exportRead: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1348
+ capability: z.ZodString;
1349
+ }, z.core.$strip>, z.ZodObject<{
1350
+ role: z.ZodString;
1351
+ }, z.core.$strip>]>>;
1352
+ exportWrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1353
+ capability: z.ZodString;
1354
+ }, z.core.$strip>, z.ZodObject<{
1355
+ role: z.ZodString;
1356
+ }, z.core.$strip>]>>;
893
1357
  schema: z.ZodString;
894
1358
  typename: z.ZodString;
895
1359
  claimsGated: z.ZodDefault<z.ZodBoolean>;
@@ -899,14 +1363,14 @@ declare const compiledArtifactSchema: z.ZodObject<{
899
1363
  type: z.ZodUnion<readonly [z.ZodEnum<{
900
1364
  bigint: "bigint";
901
1365
  boolean: "boolean";
902
- uuid: "uuid";
1366
+ date: "date";
903
1367
  text: "text";
1368
+ timestamptz: "timestamptz";
1369
+ jsonb: "jsonb";
1370
+ uuid: "uuid";
904
1371
  integer: "integer";
905
1372
  numeric: "numeric";
906
1373
  double: "double";
907
- timestamptz: "timestamptz";
908
- date: "date";
909
- jsonb: "jsonb";
910
1374
  }>, z.ZodObject<{
911
1375
  enum: z.ZodString;
912
1376
  values: z.ZodArray<z.ZodString>;
@@ -931,6 +1395,63 @@ declare const compiledArtifactSchema: z.ZodObject<{
931
1395
  settable: z.ZodArray<z.ZodString>;
932
1396
  appendable: z.ZodArray<z.ZodString>;
933
1397
  touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
1398
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1399
+ at: z.ZodOptional<z.ZodString>;
1400
+ by: z.ZodOptional<z.ZodString>;
1401
+ rev: z.ZodOptional<z.ZodString>;
1402
+ source: z.ZodOptional<z.ZodString>;
1403
+ conflicts: z.ZodOptional<z.ZodString>;
1404
+ }, z.core.$strict>>>;
1405
+ resolved: z.ZodOptional<z.ZodObject<{
1406
+ pk: z.ZodString;
1407
+ manual: z.ZodString;
1408
+ sources: z.ZodArray<z.ZodObject<{
1409
+ name: z.ZodString;
1410
+ kind: z.ZodEnum<{
1411
+ manual: "manual";
1412
+ prefetch: "prefetch";
1413
+ etl: "etl";
1414
+ }>;
1415
+ table: z.ZodString;
1416
+ columns: z.ZodArray<z.ZodString>;
1417
+ key: z.ZodOptional<z.ZodString>;
1418
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1419
+ shape: z.ZodLiteral<"single">;
1420
+ }, z.core.$strip>, z.ZodObject<{
1421
+ shape: z.ZodLiteral<"batch">;
1422
+ maxKeys: z.ZodNumber;
1423
+ }, z.core.$strip>]>>;
1424
+ function: z.ZodOptional<z.ZodObject<{
1425
+ kind: z.ZodEnum<{
1426
+ managed: "managed";
1427
+ native: "native";
1428
+ }>;
1429
+ id: z.ZodString;
1430
+ }, z.core.$strip>>;
1431
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1432
+ maxStalenessMs: z.ZodNumber;
1433
+ timeoutMs: z.ZodNumber;
1434
+ onError: z.ZodEnum<{
1435
+ fallback: "fallback";
1436
+ fail: "fail";
1437
+ }>;
1438
+ }, z.core.$strip>>;
1439
+ writeback: z.ZodOptional<z.ZodObject<{
1440
+ columns: z.ZodArray<z.ZodString>;
1441
+ defaultMode: z.ZodEnum<{
1442
+ sync: "sync";
1443
+ async: "async";
1444
+ }>;
1445
+ timeoutMs: z.ZodNumber;
1446
+ clearManualOnConfirm: z.ZodBoolean;
1447
+ }, z.core.$strip>>;
1448
+ }, z.core.$strip>>;
1449
+ deletedBy: z.ZodArray<z.ZodString>;
1450
+ materialized: z.ZodOptional<z.ZodObject<{
1451
+ table: z.ZodString;
1452
+ compute: z.ZodString;
1453
+ }, z.core.$strip>>;
1454
+ }, z.core.$strip>>;
934
1455
  constraints: z.ZodArray<z.ZodObject<{
935
1456
  name: z.ZodString;
936
1457
  columns: z.ZodArray<z.ZodString>;
@@ -939,7 +1460,47 @@ declare const compiledArtifactSchema: z.ZodObject<{
939
1460
  dynamicFilterMaxNodes: z.ZodDefault<z.ZodNumber>;
940
1461
  }, z.core.$strip>>;
941
1462
  operations: z.ZodRecord<z.ZodString, z.ZodObject<{
942
- irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
1463
+ language: z.ZodOptional<z.ZodLiteral<"sql">>;
1464
+ sqlQuery: z.ZodOptional<z.ZodObject<{
1465
+ catalog: z.ZodObject<{
1466
+ identity: z.ZodString;
1467
+ objects: z.ZodArray<z.ZodObject<{
1468
+ ref: z.ZodString;
1469
+ table: z.ZodString;
1470
+ columns: z.ZodArray<z.ZodObject<{
1471
+ name: z.ZodString;
1472
+ nullable: z.ZodBoolean;
1473
+ type: z.ZodString;
1474
+ }, z.core.$strip>>;
1475
+ scan: z.ZodString;
1476
+ read: z.ZodArray<z.ZodString>;
1477
+ }, z.core.$strict>>;
1478
+ }, z.core.$strict>;
1479
+ read: z.ZodArray<z.ZodString>;
1480
+ maxRows: z.ZodNumber;
1481
+ }, z.core.$strict>>;
1482
+ sql: z.ZodOptional<z.ZodObject<{
1483
+ text: z.ZodString;
1484
+ columns: z.ZodArray<z.ZodObject<{
1485
+ name: z.ZodString;
1486
+ type: z.ZodEnum<{
1487
+ bigint: "bigint";
1488
+ boolean: "boolean";
1489
+ date: "date";
1490
+ text: "text";
1491
+ timestamptz: "timestamptz";
1492
+ uuid: "uuid";
1493
+ integer: "integer";
1494
+ numeric: "numeric";
1495
+ double: "double";
1496
+ }>;
1497
+ nullable: z.ZodBoolean;
1498
+ }, z.core.$strip>>;
1499
+ parameters: z.ZodArray<z.ZodString>;
1500
+ read: z.ZodArray<z.ZodString>;
1501
+ maxRows: z.ZodNumber;
1502
+ }, z.core.$strict>>;
1503
+ irVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
943
1504
  name: z.ZodString;
944
1505
  opHash: z.ZodString;
945
1506
  kind: z.ZodEnum<{
@@ -957,14 +1518,14 @@ declare const compiledArtifactSchema: z.ZodObject<{
957
1518
  scalar: z.ZodEnum<{
958
1519
  bigint: "bigint";
959
1520
  boolean: "boolean";
960
- uuid: "uuid";
1521
+ date: "date";
961
1522
  text: "text";
1523
+ timestamptz: "timestamptz";
1524
+ jsonb: "jsonb";
1525
+ uuid: "uuid";
962
1526
  integer: "integer";
963
1527
  numeric: "numeric";
964
1528
  double: "double";
965
- timestamptz: "timestamptz";
966
- date: "date";
967
- jsonb: "jsonb";
968
1529
  }>;
969
1530
  }, z.core.$strip>, z.ZodObject<{
970
1531
  kind: z.ZodLiteral<"enum">;
@@ -1029,6 +1590,39 @@ declare const compiledArtifactSchema: z.ZodObject<{
1029
1590
  variable: z.ZodString;
1030
1591
  negated: z.ZodBoolean;
1031
1592
  }, z.core.$strip>>;
1593
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
1594
+ source: z.ZodString;
1595
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
1596
+ key: z.ZodUnion<readonly [z.ZodObject<{
1597
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
1598
+ kind: z.ZodLiteral<"literal">;
1599
+ 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]>>]>;
1600
+ }, z.core.$strip>, z.ZodObject<{
1601
+ kind: z.ZodLiteral<"variable">;
1602
+ name: z.ZodString;
1603
+ }, z.core.$strip>, z.ZodObject<{
1604
+ kind: z.ZodLiteral<"claim">;
1605
+ key: z.ZodEnum<{
1606
+ sub: "sub";
1607
+ org: "org";
1608
+ }>;
1609
+ }, z.core.$strip>], "kind">;
1610
+ }, z.core.$strip>, z.ZodObject<{
1611
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
1612
+ kind: z.ZodLiteral<"literal">;
1613
+ 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]>>]>;
1614
+ }, z.core.$strip>, z.ZodObject<{
1615
+ kind: z.ZodLiteral<"variable">;
1616
+ name: z.ZodString;
1617
+ }, z.core.$strip>, z.ZodObject<{
1618
+ kind: z.ZodLiteral<"claim">;
1619
+ key: z.ZodEnum<{
1620
+ sub: "sub";
1621
+ org: "org";
1622
+ }>;
1623
+ }, z.core.$strip>], "kind">;
1624
+ }, z.core.$strip>]>;
1625
+ }, z.core.$strip>>>;
1032
1626
  }, z.core.$strip>, z.ZodObject<{
1033
1627
  kind: z.ZodLiteral<"byPk">;
1034
1628
  alias: z.ZodString;
@@ -1055,6 +1649,39 @@ declare const compiledArtifactSchema: z.ZodObject<{
1055
1649
  variable: z.ZodString;
1056
1650
  negated: z.ZodBoolean;
1057
1651
  }, z.core.$strip>>;
1652
+ prefetch: z.ZodOptional<z.ZodArray<z.ZodObject<{
1653
+ source: z.ZodString;
1654
+ maxStalenessMs: z.ZodOptional<z.ZodNumber>;
1655
+ key: z.ZodUnion<readonly [z.ZodObject<{
1656
+ one: z.ZodDiscriminatedUnion<[z.ZodObject<{
1657
+ kind: z.ZodLiteral<"literal">;
1658
+ 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]>>]>;
1659
+ }, z.core.$strip>, z.ZodObject<{
1660
+ kind: z.ZodLiteral<"variable">;
1661
+ name: z.ZodString;
1662
+ }, z.core.$strip>, z.ZodObject<{
1663
+ kind: z.ZodLiteral<"claim">;
1664
+ key: z.ZodEnum<{
1665
+ sub: "sub";
1666
+ org: "org";
1667
+ }>;
1668
+ }, z.core.$strip>], "kind">;
1669
+ }, z.core.$strip>, z.ZodObject<{
1670
+ many: z.ZodDiscriminatedUnion<[z.ZodObject<{
1671
+ kind: z.ZodLiteral<"literal">;
1672
+ 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]>>]>;
1673
+ }, z.core.$strip>, z.ZodObject<{
1674
+ kind: z.ZodLiteral<"variable">;
1675
+ name: z.ZodString;
1676
+ }, z.core.$strip>, z.ZodObject<{
1677
+ kind: z.ZodLiteral<"claim">;
1678
+ key: z.ZodEnum<{
1679
+ sub: "sub";
1680
+ org: "org";
1681
+ }>;
1682
+ }, z.core.$strip>], "kind">;
1683
+ }, z.core.$strip>]>;
1684
+ }, z.core.$strip>>>;
1058
1685
  }, z.core.$strip>, z.ZodObject<{
1059
1686
  kind: z.ZodLiteral<"aggregate">;
1060
1687
  alias: z.ZodString;
@@ -1122,7 +1749,23 @@ declare const compiledArtifactSchema: z.ZodObject<{
1122
1749
  deleteByPk: "deleteByPk";
1123
1750
  cowOverride: "cowOverride";
1124
1751
  cowRevert: "cowRevert";
1752
+ resolvedWrite: "resolvedWrite";
1125
1753
  }>;
1754
+ resolvedAction: z.ZodOptional<z.ZodEnum<{
1755
+ insert: "insert";
1756
+ update: "update";
1757
+ revert: "revert";
1758
+ delete: "delete";
1759
+ }>>;
1760
+ revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1761
+ writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
1762
+ source: z.ZodString;
1763
+ mode: z.ZodEnum<{
1764
+ sync: "sync";
1765
+ async: "async";
1766
+ }>;
1767
+ }, z.core.$strip>>>;
1768
+ localOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
1126
1769
  alias: z.ZodString;
1127
1770
  table: z.ZodString;
1128
1771
  cowSynced: z.ZodOptional<z.ZodString>;
@@ -1272,4 +1915,4 @@ declare function normalizeIr(raw: unknown): CompiledArtifact;
1272
1915
  /** Index an artifact's operations by opHash (the wire selector). */
1273
1916
  declare function indexByHash(artifact: CompiledArtifact): Map<string, CompiledOperation>;
1274
1917
 
1275
- export { CLAIMS_CONTRACT, CMP_OPS, 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 RootIr, type SelectionIr, type TableMetaIr, type ValueIr, type VariableDefaultIr, type VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, requiredArtifactIrVersion, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema };
1918
+ export { CLAIMS_CONTRACT, CMP_OPS, COMPOSED_IR_VERSION, type CellSelectionIr, type ClaimKey, type CmpOp, type CompiledArtifact, type CompiledOperation, DATE_BUCKETS, type DateBucket, GUARDED_IR_VERSION, type GroupByKeyIr, INPUT_REF_KINDS, IR_VERSION, type InputRefKind, IrVersionError, LEGACY_IR_VERSION, type LimitIr, type OrderIr, type PredIr, type PrefetchPlanIr, RUNTIME_SQL_IR_VERSION, type ResolvedMetaIr, type ResolvedSourceIr, type RootIr, SQL_IR_VERSION, 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 };