@sequenceholdings/orm 2.8.5 → 2.10.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 (56) hide show
  1. package/dist/authoring.cjs.map +1 -1
  2. package/dist/authoring.d.cts +2 -2
  3. package/dist/authoring.d.ts +2 -2
  4. package/dist/authoring.js.map +1 -1
  5. package/dist/canonical.cjs.map +1 -1
  6. package/dist/canonical.d.cts +72 -72
  7. package/dist/canonical.d.ts +72 -72
  8. package/dist/canonical.js.map +1 -1
  9. package/dist/cli.cjs +122 -68
  10. package/dist/cli.cjs.map +1 -1
  11. package/dist/cli.d.cts +32 -1
  12. package/dist/cli.d.ts +32 -1
  13. package/dist/cli.js +117 -69
  14. package/dist/cli.js.map +1 -1
  15. package/dist/client.cjs.map +1 -1
  16. package/dist/client.d.cts +1 -1
  17. package/dist/client.d.ts +1 -1
  18. package/dist/client.js.map +1 -1
  19. package/dist/compiler.cjs +259 -18
  20. package/dist/compiler.cjs.map +1 -1
  21. package/dist/compiler.d.cts +183 -3
  22. package/dist/compiler.d.ts +183 -3
  23. package/dist/compiler.js +254 -19
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/{constants-Dou1RkTo.d.cts → constants-D2o0vK6U.d.cts} +8 -1
  26. package/dist/{constants-Dou1RkTo.d.ts → constants-D2o0vK6U.d.ts} +8 -1
  27. package/dist/dynamic-input.d.cts +1 -1
  28. package/dist/dynamic-input.d.ts +1 -1
  29. package/dist/index.cjs +53 -31
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +61 -60
  32. package/dist/index.d.ts +61 -60
  33. package/dist/index.js +51 -32
  34. package/dist/index.js.map +1 -1
  35. package/dist/ir.cjs +9 -7
  36. package/dist/ir.cjs.map +1 -1
  37. package/dist/ir.d.cts +85 -74
  38. package/dist/ir.d.ts +85 -74
  39. package/dist/ir.js +9 -8
  40. package/dist/ir.js.map +1 -1
  41. package/dist/predicate-v2.cjs +9 -7
  42. package/dist/predicate-v2.cjs.map +1 -1
  43. package/dist/predicate-v2.d.cts +3 -1
  44. package/dist/predicate-v2.d.ts +3 -1
  45. package/dist/predicate-v2.js +9 -7
  46. package/dist/predicate-v2.js.map +1 -1
  47. package/dist/sdl.cjs +8 -7
  48. package/dist/sdl.cjs.map +1 -1
  49. package/dist/sdl.d.cts +1 -1
  50. package/dist/sdl.d.ts +1 -1
  51. package/dist/sdl.js +8 -7
  52. package/dist/sdl.js.map +1 -1
  53. package/package.json +3 -3
  54. package/templates/orm-namespace/package.json +2 -1
  55. package/dist/{definition-DjfC7Lll.d.cts → definition-B99BsOAO.d.cts} +4 -4
  56. package/dist/{definition-DjfC7Lll.d.ts → definition-B99BsOAO.d.ts} +4 -4
@@ -5,8 +5,8 @@ export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnC
5
5
  export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyAccess, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.cjs';
6
6
  import { z } from 'zod';
7
7
  export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-BMZKFO0W.cjs';
8
- export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-DjfC7Lll.cjs';
9
- import './constants-Dou1RkTo.cjs';
8
+ export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-B99BsOAO.cjs';
9
+ import './constants-D2o0vK6U.cjs';
10
10
  import './policy-1iZbGnZZ.cjs';
11
11
 
12
12
  type DiagnosticSeverity = 'error' | 'warning';
@@ -522,6 +522,174 @@ declare function compileBuiltinSqlArtifact({ namespace, definitions, read, unbac
522
522
  executionTarget?: string;
523
523
  }): CompiledArtifact;
524
524
 
525
+ /** Bump whenever policy/compiler semantics change. Old projections fall back to
526
+ * authoritative namespace compilation until republished or backfilled. */
527
+ declare const OBJECT_METADATA_FORMAT = 1;
528
+ declare const objectSqlBundleSchema: z.ZodObject<{
529
+ format: z.ZodLiteral<1>;
530
+ dependencies: z.ZodRecord<z.ZodString, z.ZodString>;
531
+ object: z.ZodObject<{
532
+ ref: z.ZodString;
533
+ table: z.ZodString;
534
+ columns: z.ZodArray<z.ZodObject<{
535
+ name: z.ZodString;
536
+ nullable: z.ZodBoolean;
537
+ type: z.ZodString;
538
+ }, z.core.$strip>>;
539
+ scan: z.ZodString;
540
+ read: z.ZodArray<z.ZodString>;
541
+ }, z.core.$strict>;
542
+ tables: z.ZodRecord<z.ZodString, z.ZodObject<{
543
+ table: z.ZodString;
544
+ namespace: z.ZodOptional<z.ZodString>;
545
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
546
+ foreignReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
547
+ column: z.ZodString;
548
+ target: z.ZodString;
549
+ targetColumn: z.ZodString;
550
+ }, z.core.$strip>>>;
551
+ exportRead: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
552
+ capability: z.ZodString;
553
+ }, z.core.$strip>, z.ZodObject<{
554
+ role: z.ZodString;
555
+ }, z.core.$strip>]>>;
556
+ exportWrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
557
+ capability: z.ZodString;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ role: z.ZodString;
560
+ }, z.core.$strip>]>>;
561
+ schema: z.ZodString;
562
+ typename: z.ZodString;
563
+ claimsGated: z.ZodDefault<z.ZodBoolean>;
564
+ columns: z.ZodArray<z.ZodObject<{
565
+ name: z.ZodString;
566
+ columnName: z.ZodString;
567
+ type: z.ZodUnion<readonly [z.ZodEnum<{
568
+ bigint: "bigint";
569
+ boolean: "boolean";
570
+ date: "date";
571
+ uuid: "uuid";
572
+ text: "text";
573
+ integer: "integer";
574
+ numeric: "numeric";
575
+ double: "double";
576
+ timestamptz: "timestamptz";
577
+ jsonb: "jsonb";
578
+ }>, z.ZodObject<{
579
+ enum: z.ZodString;
580
+ values: z.ZodArray<z.ZodString>;
581
+ }, z.core.$strip>]>;
582
+ nullable: z.ZodBoolean;
583
+ }, z.core.$strip>>;
584
+ primaryKey: z.ZodArray<z.ZodString>;
585
+ links: z.ZodArray<z.ZodObject<{
586
+ name: z.ZodString;
587
+ kind: z.ZodEnum<{
588
+ toOne: "toOne";
589
+ toMany: "toMany";
590
+ toPlatformUser: "toPlatformUser";
591
+ }>;
592
+ target: z.ZodString;
593
+ on: z.ZodString;
594
+ references: z.ZodString;
595
+ }, z.core.$strip>>;
596
+ filterable: z.ZodArray<z.ZodString>;
597
+ orderable: z.ZodArray<z.ZodString>;
598
+ insertable: z.ZodArray<z.ZodString>;
599
+ settable: z.ZodArray<z.ZodString>;
600
+ appendable: z.ZodArray<z.ZodString>;
601
+ touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
602
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
603
+ at: z.ZodOptional<z.ZodString>;
604
+ by: z.ZodOptional<z.ZodString>;
605
+ rev: z.ZodOptional<z.ZodString>;
606
+ source: z.ZodOptional<z.ZodString>;
607
+ conflicts: z.ZodOptional<z.ZodString>;
608
+ }, z.core.$strict>>>;
609
+ resolved: z.ZodOptional<z.ZodObject<{
610
+ pk: z.ZodOptional<z.ZodString>;
611
+ manual: z.ZodString;
612
+ sources: z.ZodArray<z.ZodObject<{
613
+ name: z.ZodString;
614
+ kind: z.ZodEnum<{
615
+ manual: "manual";
616
+ etl: "etl";
617
+ prefetch: "prefetch";
618
+ }>;
619
+ table: z.ZodString;
620
+ columns: z.ZodArray<z.ZodString>;
621
+ key: z.ZodOptional<z.ZodString>;
622
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
623
+ shape: z.ZodLiteral<"single">;
624
+ }, z.core.$strip>, z.ZodObject<{
625
+ shape: z.ZodLiteral<"batch">;
626
+ maxKeys: z.ZodNumber;
627
+ }, z.core.$strip>]>>;
628
+ function: z.ZodOptional<z.ZodObject<{
629
+ kind: z.ZodEnum<{
630
+ managed: "managed";
631
+ native: "native";
632
+ }>;
633
+ id: z.ZodString;
634
+ }, z.core.$strip>>;
635
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
636
+ maxStalenessMs: z.ZodNumber;
637
+ timeoutMs: z.ZodNumber;
638
+ onError: z.ZodEnum<{
639
+ fallback: "fallback";
640
+ fail: "fail";
641
+ }>;
642
+ }, z.core.$strip>>;
643
+ writeback: z.ZodOptional<z.ZodObject<{
644
+ columns: z.ZodArray<z.ZodString>;
645
+ defaultMode: z.ZodEnum<{
646
+ sync: "sync";
647
+ async: "async";
648
+ }>;
649
+ timeoutMs: z.ZodNumber;
650
+ clearManualOnConfirm: z.ZodBoolean;
651
+ }, z.core.$strip>>;
652
+ }, z.core.$strip>>;
653
+ deletedBy: z.ZodArray<z.ZodString>;
654
+ materialized: z.ZodOptional<z.ZodObject<{
655
+ table: z.ZodString;
656
+ compute: z.ZodString;
657
+ }, z.core.$strip>>;
658
+ }, z.core.$strip>>;
659
+ constraints: z.ZodArray<z.ZodObject<{
660
+ name: z.ZodString;
661
+ columns: z.ZodArray<z.ZodString>;
662
+ }, z.core.$strip>>;
663
+ dynamicFilterMaxDepth: z.ZodDefault<z.ZodNumber>;
664
+ dynamicFilterMaxNodes: z.ZodDefault<z.ZodNumber>;
665
+ }, z.core.$strip>>;
666
+ readPolicies: z.ZodRecord<z.ZodString, z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>;
667
+ }, z.core.$strict>;
668
+ type ObjectSqlBundle = z.infer<typeof objectSqlBundleSchema>;
669
+ interface ObjectMetadataProjection {
670
+ format: typeof OBJECT_METADATA_FORMAT;
671
+ /** Compact owner/RLS inventory, independent of query compilation metadata. */
672
+ relations: Array<{
673
+ schema: string;
674
+ table: string;
675
+ }>;
676
+ objects: Array<{
677
+ name: string;
678
+ contractHash: string;
679
+ bundle: ObjectSqlBundle | null;
680
+ }>;
681
+ }
682
+ /** Compile once at publication, then split the trusted result by SQL object.
683
+ * The full canonical document remains the authoring and migration contract. */
684
+ declare function compileObjectMetadata({ canonical: raw }: {
685
+ canonical: CanonicalDefinition;
686
+ }): Promise<ObjectMetadataProjection>;
687
+ /** Compose already-validated object catalogs. No full namespace parse/compile. */
688
+ declare function composeObjectSqlArtifact({ namespace, bundles }: {
689
+ namespace: string;
690
+ bundles: readonly ObjectSqlBundle[];
691
+ }): CompiledArtifact;
692
+
525
693
  declare const DATASET_PREVIEW_LIMIT = 100;
526
694
  /**
527
695
  * Fixed runtime-owned reads, separate from the published operation manifest.
@@ -541,4 +709,16 @@ declare function validateManagedViewQueries({ canonical }: {
541
709
  canonical: CanonicalDefinition;
542
710
  }): Promise<void>;
543
711
 
544
- export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, bindNamedParameters, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileBuiltinSqlArtifact, compileDatasetPreviews, compileDefaultOperations, compileNamespace, compileNamespaceOrThrow, compileOperationDocuments, compileRuntimeSql, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, generateDefaultOperations, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, queryRootNames, referencedSqlObjects, restrictOperation, sqlQueryInputSchema, typeNameForTable, validateManagedViewQueries, walkPred };
712
+ /** Bump when the compiler's dependency or policy semantics change. */
713
+ declare const OPERATION_METADATA_FORMAT = 1;
714
+ /** Publication-time execution slice. Static operations retain only their
715
+ * logical, policy, write-reference and physical backing dependencies. Dynamic
716
+ * filters/order can follow caller-selected paths: retain the reachable graph
717
+ * for those input roots rather than silently narrowing accepted inputs. Keys
718
+ * stay identical to the compiled IR; no alias/namespace rewriting occurs. */
719
+ declare function projectOperationMetadata({ artifact, operation }: {
720
+ artifact: CompiledArtifact;
721
+ operation: CompiledOperation;
722
+ }): CompiledArtifact;
723
+
724
+ export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OBJECT_METADATA_FORMAT, OPERATION_METADATA_FORMAT, type ObjectMetadataProjection, type ObjectSqlBundle, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, bindNamedParameters, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileBuiltinSqlArtifact, compileDatasetPreviews, compileDefaultOperations, compileNamespace, compileNamespaceOrThrow, compileObjectMetadata, compileOperationDocuments, compileRuntimeSql, composeObjectSqlArtifact, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, generateDefaultOperations, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, objectSqlBundleSchema, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, projectOperationMetadata, queryRootNames, referencedSqlObjects, restrictOperation, sqlQueryInputSchema, typeNameForTable, validateManagedViewQueries, walkPred };
@@ -5,8 +5,8 @@ export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnC
5
5
  export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyAccess, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.js';
6
6
  import { z } from 'zod';
7
7
  export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-DUk7AcXs.js';
8
- export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-DjfC7Lll.js';
9
- import './constants-Dou1RkTo.js';
8
+ export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-B99BsOAO.js';
9
+ import './constants-D2o0vK6U.js';
10
10
  import './policy-1iZbGnZZ.js';
11
11
 
12
12
  type DiagnosticSeverity = 'error' | 'warning';
@@ -522,6 +522,174 @@ declare function compileBuiltinSqlArtifact({ namespace, definitions, read, unbac
522
522
  executionTarget?: string;
523
523
  }): CompiledArtifact;
524
524
 
525
+ /** Bump whenever policy/compiler semantics change. Old projections fall back to
526
+ * authoritative namespace compilation until republished or backfilled. */
527
+ declare const OBJECT_METADATA_FORMAT = 1;
528
+ declare const objectSqlBundleSchema: z.ZodObject<{
529
+ format: z.ZodLiteral<1>;
530
+ dependencies: z.ZodRecord<z.ZodString, z.ZodString>;
531
+ object: z.ZodObject<{
532
+ ref: z.ZodString;
533
+ table: z.ZodString;
534
+ columns: z.ZodArray<z.ZodObject<{
535
+ name: z.ZodString;
536
+ nullable: z.ZodBoolean;
537
+ type: z.ZodString;
538
+ }, z.core.$strip>>;
539
+ scan: z.ZodString;
540
+ read: z.ZodArray<z.ZodString>;
541
+ }, z.core.$strict>;
542
+ tables: z.ZodRecord<z.ZodString, z.ZodObject<{
543
+ table: z.ZodString;
544
+ namespace: z.ZodOptional<z.ZodString>;
545
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
546
+ foreignReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
547
+ column: z.ZodString;
548
+ target: z.ZodString;
549
+ targetColumn: z.ZodString;
550
+ }, z.core.$strip>>>;
551
+ exportRead: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
552
+ capability: z.ZodString;
553
+ }, z.core.$strip>, z.ZodObject<{
554
+ role: z.ZodString;
555
+ }, z.core.$strip>]>>;
556
+ exportWrite: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
557
+ capability: z.ZodString;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ role: z.ZodString;
560
+ }, z.core.$strip>]>>;
561
+ schema: z.ZodString;
562
+ typename: z.ZodString;
563
+ claimsGated: z.ZodDefault<z.ZodBoolean>;
564
+ columns: z.ZodArray<z.ZodObject<{
565
+ name: z.ZodString;
566
+ columnName: z.ZodString;
567
+ type: z.ZodUnion<readonly [z.ZodEnum<{
568
+ bigint: "bigint";
569
+ boolean: "boolean";
570
+ date: "date";
571
+ uuid: "uuid";
572
+ text: "text";
573
+ integer: "integer";
574
+ numeric: "numeric";
575
+ double: "double";
576
+ timestamptz: "timestamptz";
577
+ jsonb: "jsonb";
578
+ }>, z.ZodObject<{
579
+ enum: z.ZodString;
580
+ values: z.ZodArray<z.ZodString>;
581
+ }, z.core.$strip>]>;
582
+ nullable: z.ZodBoolean;
583
+ }, z.core.$strip>>;
584
+ primaryKey: z.ZodArray<z.ZodString>;
585
+ links: z.ZodArray<z.ZodObject<{
586
+ name: z.ZodString;
587
+ kind: z.ZodEnum<{
588
+ toOne: "toOne";
589
+ toMany: "toMany";
590
+ toPlatformUser: "toPlatformUser";
591
+ }>;
592
+ target: z.ZodString;
593
+ on: z.ZodString;
594
+ references: z.ZodString;
595
+ }, z.core.$strip>>;
596
+ filterable: z.ZodArray<z.ZodString>;
597
+ orderable: z.ZodArray<z.ZodString>;
598
+ insertable: z.ZodArray<z.ZodString>;
599
+ settable: z.ZodArray<z.ZodString>;
600
+ appendable: z.ZodArray<z.ZodString>;
601
+ touchOnUpdate: z.ZodOptional<z.ZodArray<z.ZodString>>;
602
+ cells: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
603
+ at: z.ZodOptional<z.ZodString>;
604
+ by: z.ZodOptional<z.ZodString>;
605
+ rev: z.ZodOptional<z.ZodString>;
606
+ source: z.ZodOptional<z.ZodString>;
607
+ conflicts: z.ZodOptional<z.ZodString>;
608
+ }, z.core.$strict>>>;
609
+ resolved: z.ZodOptional<z.ZodObject<{
610
+ pk: z.ZodOptional<z.ZodString>;
611
+ manual: z.ZodString;
612
+ sources: z.ZodArray<z.ZodObject<{
613
+ name: z.ZodString;
614
+ kind: z.ZodEnum<{
615
+ manual: "manual";
616
+ etl: "etl";
617
+ prefetch: "prefetch";
618
+ }>;
619
+ table: z.ZodString;
620
+ columns: z.ZodArray<z.ZodString>;
621
+ key: z.ZodOptional<z.ZodString>;
622
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
623
+ shape: z.ZodLiteral<"single">;
624
+ }, z.core.$strip>, z.ZodObject<{
625
+ shape: z.ZodLiteral<"batch">;
626
+ maxKeys: z.ZodNumber;
627
+ }, z.core.$strip>]>>;
628
+ function: z.ZodOptional<z.ZodObject<{
629
+ kind: z.ZodEnum<{
630
+ managed: "managed";
631
+ native: "native";
632
+ }>;
633
+ id: z.ZodString;
634
+ }, z.core.$strip>>;
635
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
636
+ maxStalenessMs: z.ZodNumber;
637
+ timeoutMs: z.ZodNumber;
638
+ onError: z.ZodEnum<{
639
+ fallback: "fallback";
640
+ fail: "fail";
641
+ }>;
642
+ }, z.core.$strip>>;
643
+ writeback: z.ZodOptional<z.ZodObject<{
644
+ columns: z.ZodArray<z.ZodString>;
645
+ defaultMode: z.ZodEnum<{
646
+ sync: "sync";
647
+ async: "async";
648
+ }>;
649
+ timeoutMs: z.ZodNumber;
650
+ clearManualOnConfirm: z.ZodBoolean;
651
+ }, z.core.$strip>>;
652
+ }, z.core.$strip>>;
653
+ deletedBy: z.ZodArray<z.ZodString>;
654
+ materialized: z.ZodOptional<z.ZodObject<{
655
+ table: z.ZodString;
656
+ compute: z.ZodString;
657
+ }, z.core.$strip>>;
658
+ }, z.core.$strip>>;
659
+ constraints: z.ZodArray<z.ZodObject<{
660
+ name: z.ZodString;
661
+ columns: z.ZodArray<z.ZodString>;
662
+ }, z.core.$strip>>;
663
+ dynamicFilterMaxDepth: z.ZodDefault<z.ZodNumber>;
664
+ dynamicFilterMaxNodes: z.ZodDefault<z.ZodNumber>;
665
+ }, z.core.$strip>>;
666
+ readPolicies: z.ZodRecord<z.ZodString, z.ZodType<PredIr, unknown, z.core.$ZodTypeInternals<PredIr, unknown>>>;
667
+ }, z.core.$strict>;
668
+ type ObjectSqlBundle = z.infer<typeof objectSqlBundleSchema>;
669
+ interface ObjectMetadataProjection {
670
+ format: typeof OBJECT_METADATA_FORMAT;
671
+ /** Compact owner/RLS inventory, independent of query compilation metadata. */
672
+ relations: Array<{
673
+ schema: string;
674
+ table: string;
675
+ }>;
676
+ objects: Array<{
677
+ name: string;
678
+ contractHash: string;
679
+ bundle: ObjectSqlBundle | null;
680
+ }>;
681
+ }
682
+ /** Compile once at publication, then split the trusted result by SQL object.
683
+ * The full canonical document remains the authoring and migration contract. */
684
+ declare function compileObjectMetadata({ canonical: raw }: {
685
+ canonical: CanonicalDefinition;
686
+ }): Promise<ObjectMetadataProjection>;
687
+ /** Compose already-validated object catalogs. No full namespace parse/compile. */
688
+ declare function composeObjectSqlArtifact({ namespace, bundles }: {
689
+ namespace: string;
690
+ bundles: readonly ObjectSqlBundle[];
691
+ }): CompiledArtifact;
692
+
525
693
  declare const DATASET_PREVIEW_LIMIT = 100;
526
694
  /**
527
695
  * Fixed runtime-owned reads, separate from the published operation manifest.
@@ -541,4 +709,16 @@ declare function validateManagedViewQueries({ canonical }: {
541
709
  canonical: CanonicalDefinition;
542
710
  }): Promise<void>;
543
711
 
544
- export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, bindNamedParameters, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileBuiltinSqlArtifact, compileDatasetPreviews, compileDefaultOperations, compileNamespace, compileNamespaceOrThrow, compileOperationDocuments, compileRuntimeSql, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, generateDefaultOperations, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, queryRootNames, referencedSqlObjects, restrictOperation, sqlQueryInputSchema, typeNameForTable, validateManagedViewQueries, walkPred };
712
+ /** Bump when the compiler's dependency or policy semantics change. */
713
+ declare const OPERATION_METADATA_FORMAT = 1;
714
+ /** Publication-time execution slice. Static operations retain only their
715
+ * logical, policy, write-reference and physical backing dependencies. Dynamic
716
+ * filters/order can follow caller-selected paths: retain the reachable graph
717
+ * for those input roots rather than silently narrowing accepted inputs. Keys
718
+ * stay identical to the compiled IR; no alias/namespace rewriting occurs. */
719
+ declare function projectOperationMetadata({ artifact, operation }: {
720
+ artifact: CompiledArtifact;
721
+ operation: CompiledOperation;
722
+ }): CompiledArtifact;
723
+
724
+ export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OBJECT_METADATA_FORMAT, OPERATION_METADATA_FORMAT, type ObjectMetadataProjection, type ObjectSqlBundle, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, bindNamedParameters, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileBuiltinSqlArtifact, compileDatasetPreviews, compileDefaultOperations, compileNamespace, compileNamespaceOrThrow, compileObjectMetadata, compileOperationDocuments, compileRuntimeSql, composeObjectSqlArtifact, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, generateDefaultOperations, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, objectSqlBundleSchema, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, projectOperationMetadata, queryRootNames, referencedSqlObjects, restrictOperation, sqlQueryInputSchema, typeNameForTable, validateManagedViewQueries, walkPred };