@nicia-ai/typegraph 0.55.0 → 0.56.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 (148) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/backend/index.cjs +86 -86
  3. package/dist/backend/index.js +7 -7
  4. package/dist/backend/postgres/index.cjs +22 -22
  5. package/dist/backend/postgres/index.js +8 -8
  6. package/dist/backend/postgres/pglite-store.cjs +1 -1
  7. package/dist/backend/postgres/pglite-store.d.cts +2 -2
  8. package/dist/backend/postgres/pglite-store.d.ts +2 -2
  9. package/dist/backend/postgres/pglite-store.js +1 -1
  10. package/dist/backend/postgres/pglite.cjs +10 -10
  11. package/dist/backend/postgres/pglite.js +9 -9
  12. package/dist/backend/sqlite/index.cjs +21 -21
  13. package/dist/backend/sqlite/index.js +8 -8
  14. package/dist/backend/sqlite/libsql.cjs +12 -12
  15. package/dist/backend/sqlite/libsql.js +8 -8
  16. package/dist/backend/sqlite/local-store.cjs +1 -1
  17. package/dist/backend/sqlite/local-store.d.cts +2 -2
  18. package/dist/backend/sqlite/local-store.d.ts +2 -2
  19. package/dist/backend/sqlite/local-store.js +1 -1
  20. package/dist/backend/sqlite/local.cjs +10 -10
  21. package/dist/backend/sqlite/local.js +9 -9
  22. package/dist/{chunk-S5WG5AFG.cjs → chunk-2XUAUSMI.cjs} +12 -12
  23. package/dist/{chunk-S5WG5AFG.cjs.map → chunk-2XUAUSMI.cjs.map} +1 -1
  24. package/dist/{chunk-MTE255N3.cjs → chunk-36XLQHZA.cjs} +4 -4
  25. package/dist/{chunk-MTE255N3.cjs.map → chunk-36XLQHZA.cjs.map} +1 -1
  26. package/dist/{chunk-FWSGKOBN.js → chunk-6LTRZOUU.js} +6 -6
  27. package/dist/{chunk-FWSGKOBN.js.map → chunk-6LTRZOUU.js.map} +1 -1
  28. package/dist/{chunk-YVKPUSHS.js → chunk-75KH6Y2W.js} +16 -7
  29. package/dist/chunk-75KH6Y2W.js.map +1 -0
  30. package/dist/{chunk-MJXEO7YA.js → chunk-762VPGHN.js} +5 -5
  31. package/dist/{chunk-MJXEO7YA.js.map → chunk-762VPGHN.js.map} +1 -1
  32. package/dist/{chunk-GGDTMBNA.cjs → chunk-7CCVR2QF.cjs} +54 -54
  33. package/dist/{chunk-GGDTMBNA.cjs.map → chunk-7CCVR2QF.cjs.map} +1 -1
  34. package/dist/{chunk-7EOJO6QB.js → chunk-7MHENVRG.js} +3 -3
  35. package/dist/{chunk-7EOJO6QB.js.map → chunk-7MHENVRG.js.map} +1 -1
  36. package/dist/{chunk-7B3DSFX3.cjs → chunk-AUTRK6WM.cjs} +4 -4
  37. package/dist/{chunk-7B3DSFX3.cjs.map → chunk-AUTRK6WM.cjs.map} +1 -1
  38. package/dist/{chunk-SIQ4BFL5.js → chunk-AZP5CCHL.js} +4 -4
  39. package/dist/{chunk-SIQ4BFL5.js.map → chunk-AZP5CCHL.js.map} +1 -1
  40. package/dist/{chunk-WTW7RWAG.cjs → chunk-BYUIOM4L.cjs} +6 -6
  41. package/dist/{chunk-WTW7RWAG.cjs.map → chunk-BYUIOM4L.cjs.map} +1 -1
  42. package/dist/{chunk-74FNI3PT.js → chunk-C3TJU4KQ.js} +6 -6
  43. package/dist/chunk-C3TJU4KQ.js.map +1 -0
  44. package/dist/{chunk-7V2R4MH6.js → chunk-CEQOTZGB.js} +5 -5
  45. package/dist/{chunk-7V2R4MH6.js.map → chunk-CEQOTZGB.js.map} +1 -1
  46. package/dist/{chunk-TKFQLKH2.cjs → chunk-CYKHSH5O.cjs} +36 -36
  47. package/dist/{chunk-TKFQLKH2.cjs.map → chunk-CYKHSH5O.cjs.map} +1 -1
  48. package/dist/{chunk-D5TCKAQT.cjs → chunk-DGIA64DM.cjs} +4 -4
  49. package/dist/{chunk-D5TCKAQT.cjs.map → chunk-DGIA64DM.cjs.map} +1 -1
  50. package/dist/{chunk-FFR3YUY2.js → chunk-E4QYEWVH.js} +5 -5
  51. package/dist/{chunk-FFR3YUY2.js.map → chunk-E4QYEWVH.js.map} +1 -1
  52. package/dist/{chunk-467YITD4.cjs → chunk-ETU5IILQ.cjs} +13 -13
  53. package/dist/{chunk-467YITD4.cjs.map → chunk-ETU5IILQ.cjs.map} +1 -1
  54. package/dist/{chunk-HW3IX2RF.js → chunk-EWRLWI7W.js} +4 -4
  55. package/dist/{chunk-HW3IX2RF.js.map → chunk-EWRLWI7W.js.map} +1 -1
  56. package/dist/{chunk-KZ6OHFDV.js → chunk-F2S5JWCT.js} +3 -3
  57. package/dist/{chunk-KZ6OHFDV.js.map → chunk-F2S5JWCT.js.map} +1 -1
  58. package/dist/{chunk-45WPPI64.js → chunk-FMCPKMQI.js} +3 -3
  59. package/dist/{chunk-45WPPI64.js.map → chunk-FMCPKMQI.js.map} +1 -1
  60. package/dist/{chunk-QM6IQW7B.js → chunk-ILHVYKXJ.js} +7 -7
  61. package/dist/{chunk-QM6IQW7B.js.map → chunk-ILHVYKXJ.js.map} +1 -1
  62. package/dist/{chunk-ECYEWFEH.cjs → chunk-J34FSPSC.cjs} +16 -6
  63. package/dist/chunk-J34FSPSC.cjs.map +1 -0
  64. package/dist/{chunk-GFYCLCGU.cjs → chunk-KM3CLHDB.cjs} +9 -9
  65. package/dist/{chunk-GFYCLCGU.cjs.map → chunk-KM3CLHDB.cjs.map} +1 -1
  66. package/dist/{chunk-SLNH62T3.js → chunk-KQYUKOGX.js} +3 -3
  67. package/dist/{chunk-SLNH62T3.js.map → chunk-KQYUKOGX.js.map} +1 -1
  68. package/dist/{chunk-7I2PYI4U.cjs → chunk-KR3N6Y7O.cjs} +67 -67
  69. package/dist/{chunk-7I2PYI4U.cjs.map → chunk-KR3N6Y7O.cjs.map} +1 -1
  70. package/dist/{chunk-HZCOCNIX.cjs → chunk-L2REUAJB.cjs} +24 -24
  71. package/dist/{chunk-HZCOCNIX.cjs.map → chunk-L2REUAJB.cjs.map} +1 -1
  72. package/dist/{chunk-VU65FXEG.js → chunk-LFXBFPI2.js} +66 -29
  73. package/dist/chunk-LFXBFPI2.js.map +1 -0
  74. package/dist/{chunk-NXRSR6QG.js → chunk-MHM6OGZR.js} +9 -9
  75. package/dist/{chunk-NXRSR6QG.js.map → chunk-MHM6OGZR.js.map} +1 -1
  76. package/dist/{chunk-FCUSVSYX.js → chunk-MRGWM5LE.js} +10 -10
  77. package/dist/{chunk-FCUSVSYX.js.map → chunk-MRGWM5LE.js.map} +1 -1
  78. package/dist/{chunk-WXGMDROJ.js → chunk-QDNEXTON.js} +7 -7
  79. package/dist/{chunk-WXGMDROJ.js.map → chunk-QDNEXTON.js.map} +1 -1
  80. package/dist/{chunk-VYU5H4FO.js → chunk-RXA2D3UR.js} +3 -3
  81. package/dist/{chunk-VYU5H4FO.js.map → chunk-RXA2D3UR.js.map} +1 -1
  82. package/dist/{chunk-XODNY4QI.js → chunk-TIBSLFHR.js} +6 -6
  83. package/dist/{chunk-XODNY4QI.js.map → chunk-TIBSLFHR.js.map} +1 -1
  84. package/dist/{chunk-KZG7HQSN.cjs → chunk-UVMSWO6X.cjs} +173 -173
  85. package/dist/{chunk-KZG7HQSN.cjs.map → chunk-UVMSWO6X.cjs.map} +1 -1
  86. package/dist/{chunk-ORPT5EQW.cjs → chunk-UZ6CJUC5.cjs} +27 -27
  87. package/dist/chunk-UZ6CJUC5.cjs.map +1 -0
  88. package/dist/{chunk-GNF3PHEQ.cjs → chunk-VF2IMMZT.cjs} +17 -17
  89. package/dist/{chunk-GNF3PHEQ.cjs.map → chunk-VF2IMMZT.cjs.map} +1 -1
  90. package/dist/{chunk-PGZV3E3I.cjs → chunk-VXEHEPC4.cjs} +4 -4
  91. package/dist/{chunk-PGZV3E3I.cjs.map → chunk-VXEHEPC4.cjs.map} +1 -1
  92. package/dist/{chunk-OJ47LMOB.cjs → chunk-WIUHN6SZ.cjs} +669 -628
  93. package/dist/chunk-WIUHN6SZ.cjs.map +1 -0
  94. package/dist/{chunk-HNW5IDB3.js → chunk-WIZB5U6N.js} +7 -7
  95. package/dist/{chunk-HNW5IDB3.js.map → chunk-WIZB5U6N.js.map} +1 -1
  96. package/dist/{chunk-IDQZI6GL.js → chunk-XH75W3O5.js} +3 -3
  97. package/dist/{chunk-IDQZI6GL.js.map → chunk-XH75W3O5.js.map} +1 -1
  98. package/dist/{chunk-T7LSSV7J.cjs → chunk-XXEFDJHY.cjs} +45 -45
  99. package/dist/{chunk-T7LSSV7J.cjs.map → chunk-XXEFDJHY.cjs.map} +1 -1
  100. package/dist/{chunk-GORCU2GR.cjs → chunk-Z4NU4MYB.cjs} +123 -123
  101. package/dist/{chunk-GORCU2GR.cjs.map → chunk-Z4NU4MYB.cjs.map} +1 -1
  102. package/dist/{chunk-KFC3OUV4.cjs → chunk-ZHK3HEZ2.cjs} +130 -130
  103. package/dist/{chunk-KFC3OUV4.cjs.map → chunk-ZHK3HEZ2.cjs.map} +1 -1
  104. package/dist/{chunk-FYMYLZGX.cjs → chunk-ZXXGMQC3.cjs} +10 -10
  105. package/dist/{chunk-FYMYLZGX.cjs.map → chunk-ZXXGMQC3.cjs.map} +1 -1
  106. package/dist/graph-merge/index.cjs +577 -99
  107. package/dist/graph-merge/index.cjs.map +1 -1
  108. package/dist/graph-merge/index.d.cts +108 -4
  109. package/dist/graph-merge/index.d.ts +108 -4
  110. package/dist/graph-merge/index.js +495 -21
  111. package/dist/graph-merge/index.js.map +1 -1
  112. package/dist/{graph-templates-qraW63Ry.d.ts → graph-templates-BSA9VU_O.d.ts} +1 -1
  113. package/dist/{graph-templates--hp2U4kn.d.cts → graph-templates-Cg7DpEOF.d.cts} +1 -1
  114. package/dist/index.cjs +95 -95
  115. package/dist/index.d.cts +3 -3
  116. package/dist/index.d.ts +3 -3
  117. package/dist/index.js +16 -16
  118. package/dist/interchange/index.cjs +33 -33
  119. package/dist/interchange/index.d.cts +1 -1
  120. package/dist/interchange/index.d.ts +1 -1
  121. package/dist/interchange/index.js +10 -10
  122. package/dist/{local-store-impl-HXBO3VF4.js → local-store-impl-77DCLAAY.js} +18 -18
  123. package/dist/{local-store-impl-HXBO3VF4.js.map → local-store-impl-77DCLAAY.js.map} +1 -1
  124. package/dist/{local-store-impl-CUQKHHOZ.cjs → local-store-impl-NJCWM3KR.cjs} +22 -22
  125. package/dist/{local-store-impl-CUQKHHOZ.cjs.map → local-store-impl-NJCWM3KR.cjs.map} +1 -1
  126. package/dist/{pglite-store-impl-BD3AVOUH.js → pglite-store-impl-3VFSYLAJ.js} +18 -18
  127. package/dist/{pglite-store-impl-BD3AVOUH.js.map → pglite-store-impl-3VFSYLAJ.js.map} +1 -1
  128. package/dist/{pglite-store-impl-C3MQ72LT.cjs → pglite-store-impl-LHLJ3GBQ.cjs} +22 -22
  129. package/dist/{pglite-store-impl-C3MQ72LT.cjs.map → pglite-store-impl-LHLJ3GBQ.cjs.map} +1 -1
  130. package/dist/profiler/index.d.cts +1 -1
  131. package/dist/profiler/index.d.ts +1 -1
  132. package/dist/provenance/index.cjs +21 -21
  133. package/dist/provenance/index.d.cts +1 -1
  134. package/dist/provenance/index.d.ts +1 -1
  135. package/dist/provenance/index.js +5 -5
  136. package/dist/schema/index.cjs +36 -36
  137. package/dist/schema/index.d.cts +3 -3
  138. package/dist/schema/index.d.ts +3 -3
  139. package/dist/schema/index.js +6 -6
  140. package/dist/{store-stw2AEB4.d.ts → store-CQ3uzXla.d.ts} +58 -27
  141. package/dist/{store-DTEkUQ0k.d.cts → store-DbHAgVMH.d.cts} +58 -27
  142. package/package.json +1 -1
  143. package/dist/chunk-74FNI3PT.js.map +0 -1
  144. package/dist/chunk-ECYEWFEH.cjs.map +0 -1
  145. package/dist/chunk-OJ47LMOB.cjs.map +0 -1
  146. package/dist/chunk-ORPT5EQW.cjs.map +0 -1
  147. package/dist/chunk-VU65FXEG.js.map +0 -1
  148. package/dist/chunk-YVKPUSHS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema/deserializer.ts","../src/schema/graph-templates.ts"],"names":[],"mappings":";;;;;;AAqFO,SAAS,k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A,EAAO,WAAA;AAAA,MACP,OAAA,EAAS,OAAO,GAAA,CAAI,OAAA;AAAA,MACpB,IAAA,EAAM,OAAO,GAAA,CAAI;AAAA,KAClB,CAAA;AAAA,IACD,QAAQ,MAAA,CAAO;AAAA,GAChB,CAAA;AACH;AAEA,SAAS,iCACP,UAAA,EACoB;AACpB,EAAA,OAAO,IAAI,kBAAA;AAAA,IACT,0BAA0B,UAAU,CAAA,gDAAA,CAAA;AAAA,IACpC,EAAE,IAAA,EAAM,gCAAA,EAAkC,UAAA;AAAW,GACvD;AACF;AAGO,SAAS,gBAAA,CACd,SACA,MAAA,EAC4C;AAC5C,EAAA,OAAO,wBAAA,CAAyB,SAAS,MAAM,CAAA;AACjD;AAEA,SAAS,+BACP,OAAA,EACoB;AACpB,EAAA,OAAO,IAAI,kBAAA;AAAA,IACT,CAAA,IAAA,EAAO,QAAQ,OAAO,CAAA,kDAAA,CAAA;AAAA,IACtB,EAAE,IAAA,EAAM,6BAAA,EAA+B,OAAA,EAAS,QAAQ,OAAA;AAAQ,GAClE;AACF","file":"chunk-KZ6OHFDV.js","sourcesContent":["/**\n * Schema deserializer for loading stored schemas.\n *\n * Reconstructs runtime objects from SerializedSchema.\n * Note: Zod schemas cannot be fully reconstructed from JSON Schema,\n * so this provides access to the serialized data for introspection.\n */\nimport { type AnyEdgeType, type NodeType } from \"../core/types\";\nimport { type NamedOntologyRelation } from \"../ontology/validation\";\nimport { buildValidatedKindRegistry } from \"../registry/build-validated\";\nimport type { KindRegistry } from \"../registry/kind-registry\";\nimport { type EdgeEndpointKinds } from \"../registry/validate-implies\";\nimport { hasOwnKey } from \"../utils/object\";\nimport {\n type SerializedClosures,\n type SerializedEdgeDef,\n type SerializedMetaEdge,\n type SerializedNodeDef,\n type SerializedOntologyRelation,\n type SerializedSchema,\n} from \"./types\";\n\n// ============================================================\n// Deserialized Schema\n// ============================================================\n\n/**\n * A deserialized schema provides read-only access to schema metadata.\n *\n * Note: Unlike the original GraphDef, this does not include Zod schemas\n * since those cannot be reconstructed from JSON Schema. Use this for\n * introspection and metadata access only.\n */\nexport type DeserializedSchema = Readonly<{\n graphId: string;\n version: number;\n generatedAt: string;\n\n /** Get node definition by name */\n getNode: (name: string) => SerializedNodeDef | undefined;\n\n /** Get all node names */\n getNodeNames: () => readonly string[];\n\n /** Get edge definition by name */\n getEdge: (name: string) => SerializedEdgeDef | undefined;\n\n /** Get all edge names */\n getEdgeNames: () => readonly string[];\n\n /** Get meta-edge definition by name */\n getMetaEdge: (name: string) => SerializedMetaEdge | undefined;\n\n /** Get all meta-edge names */\n getMetaEdgeNames: () => readonly string[];\n\n /** Get all ontology relations */\n getRelations: () => readonly SerializedOntologyRelation[];\n\n /** Get precomputed closures */\n getClosures: () => SerializedClosures;\n\n /** Get graph defaults */\n getDefaults: () => SerializedSchema[\"defaults\"];\n\n /** Get the durable TypeGraph Identity Profile configuration. */\n getIdentity: () => SerializedSchema[\"identity\"];\n\n /** Get the raw serialized schema */\n getRaw: () => SerializedSchema;\n\n /** Build a validated KindRegistry by recomputing closures from relations */\n buildRegistry: () => KindRegistry;\n}>;\n\n// ============================================================\n// Deserialization\n// ============================================================\n\n/**\n * Deserializes a SerializedSchema into a DeserializedSchema.\n *\n * @param schema - The serialized schema to deserialize\n * @returns A deserialized schema with accessor methods\n */\nexport function deserializeSchema(\n schema: SerializedSchema,\n): DeserializedSchema {\n const nodeNames = Object.keys(schema.nodes);\n const edgeNames = Object.keys(schema.edges);\n const metaEdgeNames = Object.keys(schema.ontology.metaEdges);\n\n return {\n graphId: schema.graphId,\n version: schema.version,\n generatedAt: schema.generatedAt,\n\n // Own-key reads, for the same reason {@link buildEdgeEndpointKinds} below\n // uses a `Map`: `schema` is parsed out of a stored JSON document and the\n // caller supplies the name, so a raw read hands back an `Object.prototype`\n // member typed as a definition for any name no kind is registered under.\n getNode: (name) =>\n hasOwnKey(schema.nodes, name) ? schema.nodes[name] : undefined,\n getNodeNames: () => nodeNames,\n\n getEdge: (name) =>\n hasOwnKey(schema.edges, name) ? schema.edges[name] : undefined,\n getEdgeNames: () => edgeNames,\n\n getMetaEdge: (name) =>\n hasOwnKey(schema.ontology.metaEdges, name) ?\n schema.ontology.metaEdges[name]\n : undefined,\n getMetaEdgeNames: () => metaEdgeNames,\n\n getRelations: () => schema.ontology.relations,\n getClosures: () => schema.ontology.closures,\n\n getDefaults: () => schema.defaults,\n getIdentity: () => schema.identity,\n getRaw: () => schema,\n\n buildRegistry: () => buildRegistryFromRelations(schema),\n };\n}\n\n// ============================================================\n// Registry Building\n// ============================================================\n\n/**\n * Builds a KindRegistry from serialized relations.\n *\n * Persisted closures are a legacy inspection artifact. Relations are validated\n * and closures are recomputed so old schemas gain current hardening rules.\n */\nfunction buildRegistryFromRelations(schema: SerializedSchema): KindRegistry {\n // Build empty node/edge kind maps (we don't have the actual Zod schemas)\n const nodeKinds = new Map<string, NodeType>();\n const edgeKinds = new Map<string, AnyEdgeType>();\n return buildValidatedKindRegistry({\n nodeKinds,\n edgeKinds,\n ontology: schema.ontology.relations.map(\n (relation): NamedOntologyRelation => ({\n metaEdge: relation.metaEdge,\n from: relation.from,\n to: relation.to,\n }),\n ),\n edgeEndpoints: buildEdgeEndpointKinds(schema.edges),\n ...(schema.identity === undefined ? {} : { identity: schema.identity }),\n });\n}\n\n/**\n * Maps each edge kind's serialized definition to its domain/range kind\n * names, for `validateImpliesEndpointCompatibility`. A `Map` (rather than\n * the plain `schema.edges` object) so a lookup for an edge kind literally\n * named \"toString\" or another `Object.prototype` member can't resolve to\n * an inherited member instead of `undefined`.\n */\nfunction buildEdgeEndpointKinds(\n edges: Record<string, SerializedEdgeDef>,\n): ReadonlyMap<string, EdgeEndpointKinds> {\n const result = new Map<string, EdgeEndpointKinds>();\n for (const [kind, def] of Object.entries(edges)) {\n const pairs: { from: string; to: string }[] = [];\n if (def.targetKindsBySource === undefined) {\n for (const fromKind of def.fromKinds) {\n for (const toKind of def.toKinds) {\n pairs.push({ from: fromKind, to: toKind });\n }\n }\n } else {\n for (const [sourceKind, targetKinds] of Object.entries(\n def.targetKindsBySource,\n )) {\n for (const targetKind of targetKinds) {\n pairs.push({ from: sourceKind, to: targetKind });\n }\n }\n }\n result.set(kind, {\n from: def.fromKinds,\n to: def.toKinds,\n pairs,\n });\n }\n return result;\n}\n","import type { GraphBackend, SchemaVersionRow } from \"../backend/types\";\nimport { type GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { ConfigurationError } from \"../errors\";\nimport { type ReconciledSchema } from \"../store/store\";\nimport { computeSchemaHash, serializeSchema } from \"./serializer\";\n\n/** A locally held handle for a durable server-side graph template. */\nexport type GraphTemplate<G extends GraphDef> = Readonly<{\n id: string;\n reconciled: ReconciledSchema<G>;\n schemaHash: string;\n}>;\n\nexport type InstantiateGraphTemplateResult<G extends GraphDef> = Readonly<{\n status: \"ready\";\n reconciled: ReconciledSchema<G>;\n schema: SchemaVersionRow;\n}>;\n\n/**\n * Registers the fully materialized shape of a verified store as a durable\n * template. The original schema version is retained only as snapshot\n * provenance: every instantiated graph starts at v1 with that final shape.\n */\nexport async function registerGraphTemplate<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ templateId: string; reconciled: ReconciledSchema<G> }>,\n): Promise<GraphTemplate<G>> {\n const register = backend.registerGraphTemplate;\n if (register === undefined) throw graphTemplatesUnsupportedError(backend);\n await backend.assertBaseSchemaCurrent?.();\n const { reconciled } = params;\n if (reconciled.version === undefined || reconciled.hash === undefined) {\n throw new ConfigurationError(\n \"A graph template requires a reconciled schema from a managed or verified Store.\",\n { code: \"GRAPH_TEMPLATE_REQUIRES_RECONCILED_SCHEMA\" },\n );\n }\n if (\n resolveGraphVectorSlots(reconciled.graph).length > 0 &&\n backend.capabilities.vector?.supported === true\n ) {\n throw new ConfigurationError(\n \"Graph templates do not support embedding fields because vector storage is graph-scoped and cannot be instantiated schema-only.\",\n {\n code: \"GRAPH_TEMPLATE_VECTOR_UNSUPPORTED\",\n graphId: reconciled.graph.id,\n },\n {\n suggestion:\n \"Provision the graph through createStoreWithSchema until template instantiation can atomically materialize vector contributions.\",\n },\n );\n }\n const schemaDocument = serializeSchema(reconciled.graph, reconciled.version);\n const schemaHash = await computeSchemaHash(schemaDocument);\n if (schemaHash !== reconciled.hash) {\n throw new ConfigurationError(\n \"Reconciled schema hash does not match its graph snapshot.\",\n { code: \"GRAPH_TEMPLATE_RECONCILED_HASH_MISMATCH\" },\n );\n }\n await register({\n templateId: params.templateId,\n schemaHash,\n schemaDoc: schemaDocument,\n });\n return Object.freeze({\n id: params.templateId,\n reconciled,\n schemaHash,\n });\n}\n\n/**\n * Instantiates the template's final graph shape as target schema v1. Only the\n * target hash crosses the wire; the durable source document stays in the\n * backend template registry and is rebound to `graphId` by one SQL statement.\n */\nexport async function instantiateGraphTemplate<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ template: GraphTemplate<G>; graphId: string }>,\n): Promise<InstantiateGraphTemplateResult<G>> {\n const instantiate = backend.instantiateGraphTemplate;\n if (instantiate === undefined) throw graphTemplatesUnsupportedError(backend);\n await backend.assertBaseSchemaCurrent?.();\n const sourceVersion = params.template.reconciled.version;\n const reconciledHash = params.template.reconciled.hash;\n if (sourceVersion === undefined || reconciledHash === undefined) {\n throw graphTemplateHandleMismatchError(params.template.id);\n }\n const sourceHash = await computeSchemaHash(\n serializeSchema(params.template.reconciled.graph, sourceVersion),\n );\n if (\n sourceHash !== params.template.schemaHash ||\n reconciledHash !== params.template.schemaHash\n ) {\n throw graphTemplateHandleMismatchError(params.template.id);\n }\n const targetGraph: G = Object.freeze({\n ...params.template.reconciled.graph,\n id: params.graphId,\n });\n const targetHash = await computeSchemaHash(serializeSchema(targetGraph, 1));\n const result = await instantiate({\n templateId: params.template.id,\n templateSchemaHash: params.template.schemaHash,\n graphId: params.graphId,\n schemaHash: targetHash,\n });\n if (result.status === \"refused\") {\n throw new ConfigurationError(\n `Graph template instantiation was refused for graph \"${params.graphId}\". The template may be absent, or the graph already has a different schema.`,\n {\n code: \"GRAPH_TEMPLATE_INSTANTIATION_REFUSED\",\n graphId: params.graphId,\n templateId: params.template.id,\n },\n );\n }\n if (\n result.row.graph_id !== params.graphId ||\n result.row.version !== 1 ||\n result.row.schema_hash !== targetHash\n ) {\n throw new ConfigurationError(\n \"Graph template backend returned a schema row that does not match the requested target.\",\n { code: \"GRAPH_TEMPLATE_INVALID_RESULT\", graphId: params.graphId },\n );\n }\n return Object.freeze({\n status: \"ready\",\n reconciled: Object.freeze({\n graph: targetGraph,\n version: result.row.version,\n hash: result.row.schema_hash,\n }),\n schema: result.row,\n });\n}\n\nfunction graphTemplateHandleMismatchError(\n templateId: string,\n): ConfigurationError {\n return new ConfigurationError(\n `Graph template handle \"${templateId}\" does not match its reconciled schema snapshot.`,\n { code: \"GRAPH_TEMPLATE_HANDLE_MISMATCH\", templateId },\n );\n}\n\n/** Short public name for {@link instantiateGraphTemplate}. */\nexport function instantiateGraph<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ template: GraphTemplate<G>; graphId: string }>,\n): Promise<InstantiateGraphTemplateResult<G>> {\n return instantiateGraphTemplate(backend, params);\n}\n\nfunction graphTemplatesUnsupportedError(\n backend: GraphBackend,\n): ConfigurationError {\n return new ConfigurationError(\n `The ${backend.dialect} backend does not support durable graph templates.`,\n { code: \"GRAPH_TEMPLATES_UNSUPPORTED\", dialect: backend.dialect },\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/schema/deserializer.ts","../src/schema/graph-templates.ts"],"names":[],"mappings":";;;;;;AAqFO,SAAS,kBACd,MAAA,EACoB;AACpB,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA;AAC1C,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA;AAC1C,EAAA,MAAM,aAAA,GAAgB,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,SAAS,SAAS,CAAA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,CAAA,gDAAA,CAAA;AAAA,IACpC,EAAE,IAAA,EAAM,gCAAA,EAAkC,UAAA;AAAW,GACvD;AACF;AAGO,SAAS,gBAAA,CACd,SACA,MAAA,EAC4C;AAC5C,EAAA,OAAO,wBAAA,CAAyB,SAAS,MAAM,CAAA;AACjD;AAEA,SAAS,+BACP,OAAA,EACoB;AACpB,EAAA,OAAO,IAAI,kBAAA;AAAA,IACT,CAAA,IAAA,EAAO,QAAQ,OAAO,CAAA,kDAAA,CAAA;AAAA,IACtB,EAAE,IAAA,EAAM,6BAAA,EAA+B,OAAA,EAAS,QAAQ,OAAA;AAAQ,GAClE;AACF","file":"chunk-F2S5JWCT.js","sourcesContent":["/**\n * Schema deserializer for loading stored schemas.\n *\n * Reconstructs runtime objects from SerializedSchema.\n * Note: Zod schemas cannot be fully reconstructed from JSON Schema,\n * so this provides access to the serialized data for introspection.\n */\nimport { type AnyEdgeType, type NodeType } from \"../core/types\";\nimport { type NamedOntologyRelation } from \"../ontology/validation\";\nimport { buildValidatedKindRegistry } from \"../registry/build-validated\";\nimport type { KindRegistry } from \"../registry/kind-registry\";\nimport { type EdgeEndpointKinds } from \"../registry/validate-implies\";\nimport { hasOwnKey } from \"../utils/object\";\nimport {\n type SerializedClosures,\n type SerializedEdgeDef,\n type SerializedMetaEdge,\n type SerializedNodeDef,\n type SerializedOntologyRelation,\n type SerializedSchema,\n} from \"./types\";\n\n// ============================================================\n// Deserialized Schema\n// ============================================================\n\n/**\n * A deserialized schema provides read-only access to schema metadata.\n *\n * Note: Unlike the original GraphDef, this does not include Zod schemas\n * since those cannot be reconstructed from JSON Schema. Use this for\n * introspection and metadata access only.\n */\nexport type DeserializedSchema = Readonly<{\n graphId: string;\n version: number;\n generatedAt: string;\n\n /** Get node definition by name */\n getNode: (name: string) => SerializedNodeDef | undefined;\n\n /** Get all node names */\n getNodeNames: () => readonly string[];\n\n /** Get edge definition by name */\n getEdge: (name: string) => SerializedEdgeDef | undefined;\n\n /** Get all edge names */\n getEdgeNames: () => readonly string[];\n\n /** Get meta-edge definition by name */\n getMetaEdge: (name: string) => SerializedMetaEdge | undefined;\n\n /** Get all meta-edge names */\n getMetaEdgeNames: () => readonly string[];\n\n /** Get all ontology relations */\n getRelations: () => readonly SerializedOntologyRelation[];\n\n /** Get precomputed closures */\n getClosures: () => SerializedClosures;\n\n /** Get graph defaults */\n getDefaults: () => SerializedSchema[\"defaults\"];\n\n /** Get the durable TypeGraph Identity Profile configuration. */\n getIdentity: () => SerializedSchema[\"identity\"];\n\n /** Get the raw serialized schema */\n getRaw: () => SerializedSchema;\n\n /** Build a validated KindRegistry by recomputing closures from relations */\n buildRegistry: () => KindRegistry;\n}>;\n\n// ============================================================\n// Deserialization\n// ============================================================\n\n/**\n * Deserializes a SerializedSchema into a DeserializedSchema.\n *\n * @param schema - The serialized schema to deserialize\n * @returns A deserialized schema with accessor methods\n */\nexport function deserializeSchema(\n schema: SerializedSchema,\n): DeserializedSchema {\n const nodeNames = Object.keys(schema.nodes);\n const edgeNames = Object.keys(schema.edges);\n const metaEdgeNames = Object.keys(schema.ontology.metaEdges);\n\n return {\n graphId: schema.graphId,\n version: schema.version,\n generatedAt: schema.generatedAt,\n\n // Own-key reads, for the same reason {@link buildEdgeEndpointKinds} below\n // uses a `Map`: `schema` is parsed out of a stored JSON document and the\n // caller supplies the name, so a raw read hands back an `Object.prototype`\n // member typed as a definition for any name no kind is registered under.\n getNode: (name) =>\n hasOwnKey(schema.nodes, name) ? schema.nodes[name] : undefined,\n getNodeNames: () => nodeNames,\n\n getEdge: (name) =>\n hasOwnKey(schema.edges, name) ? schema.edges[name] : undefined,\n getEdgeNames: () => edgeNames,\n\n getMetaEdge: (name) =>\n hasOwnKey(schema.ontology.metaEdges, name) ?\n schema.ontology.metaEdges[name]\n : undefined,\n getMetaEdgeNames: () => metaEdgeNames,\n\n getRelations: () => schema.ontology.relations,\n getClosures: () => schema.ontology.closures,\n\n getDefaults: () => schema.defaults,\n getIdentity: () => schema.identity,\n getRaw: () => schema,\n\n buildRegistry: () => buildRegistryFromRelations(schema),\n };\n}\n\n// ============================================================\n// Registry Building\n// ============================================================\n\n/**\n * Builds a KindRegistry from serialized relations.\n *\n * Persisted closures are a legacy inspection artifact. Relations are validated\n * and closures are recomputed so old schemas gain current hardening rules.\n */\nfunction buildRegistryFromRelations(schema: SerializedSchema): KindRegistry {\n // Build empty node/edge kind maps (we don't have the actual Zod schemas)\n const nodeKinds = new Map<string, NodeType>();\n const edgeKinds = new Map<string, AnyEdgeType>();\n return buildValidatedKindRegistry({\n nodeKinds,\n edgeKinds,\n ontology: schema.ontology.relations.map(\n (relation): NamedOntologyRelation => ({\n metaEdge: relation.metaEdge,\n from: relation.from,\n to: relation.to,\n }),\n ),\n edgeEndpoints: buildEdgeEndpointKinds(schema.edges),\n ...(schema.identity === undefined ? {} : { identity: schema.identity }),\n });\n}\n\n/**\n * Maps each edge kind's serialized definition to its domain/range kind\n * names, for `validateImpliesEndpointCompatibility`. A `Map` (rather than\n * the plain `schema.edges` object) so a lookup for an edge kind literally\n * named \"toString\" or another `Object.prototype` member can't resolve to\n * an inherited member instead of `undefined`.\n */\nfunction buildEdgeEndpointKinds(\n edges: Record<string, SerializedEdgeDef>,\n): ReadonlyMap<string, EdgeEndpointKinds> {\n const result = new Map<string, EdgeEndpointKinds>();\n for (const [kind, def] of Object.entries(edges)) {\n const pairs: { from: string; to: string }[] = [];\n if (def.targetKindsBySource === undefined) {\n for (const fromKind of def.fromKinds) {\n for (const toKind of def.toKinds) {\n pairs.push({ from: fromKind, to: toKind });\n }\n }\n } else {\n for (const [sourceKind, targetKinds] of Object.entries(\n def.targetKindsBySource,\n )) {\n for (const targetKind of targetKinds) {\n pairs.push({ from: sourceKind, to: targetKind });\n }\n }\n }\n result.set(kind, {\n from: def.fromKinds,\n to: def.toKinds,\n pairs,\n });\n }\n return result;\n}\n","import type { GraphBackend, SchemaVersionRow } from \"../backend/types\";\nimport { type GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { ConfigurationError } from \"../errors\";\nimport { type ReconciledSchema } from \"../store/store\";\nimport { computeSchemaHash, serializeSchema } from \"./serializer\";\n\n/** A locally held handle for a durable server-side graph template. */\nexport type GraphTemplate<G extends GraphDef> = Readonly<{\n id: string;\n reconciled: ReconciledSchema<G>;\n schemaHash: string;\n}>;\n\nexport type InstantiateGraphTemplateResult<G extends GraphDef> = Readonly<{\n status: \"ready\";\n reconciled: ReconciledSchema<G>;\n schema: SchemaVersionRow;\n}>;\n\n/**\n * Registers the fully materialized shape of a verified store as a durable\n * template. The original schema version is retained only as snapshot\n * provenance: every instantiated graph starts at v1 with that final shape.\n */\nexport async function registerGraphTemplate<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ templateId: string; reconciled: ReconciledSchema<G> }>,\n): Promise<GraphTemplate<G>> {\n const register = backend.registerGraphTemplate;\n if (register === undefined) throw graphTemplatesUnsupportedError(backend);\n await backend.assertBaseSchemaCurrent?.();\n const { reconciled } = params;\n if (reconciled.version === undefined || reconciled.hash === undefined) {\n throw new ConfigurationError(\n \"A graph template requires a reconciled schema from a managed or verified Store.\",\n { code: \"GRAPH_TEMPLATE_REQUIRES_RECONCILED_SCHEMA\" },\n );\n }\n if (\n resolveGraphVectorSlots(reconciled.graph).length > 0 &&\n backend.capabilities.vector?.supported === true\n ) {\n throw new ConfigurationError(\n \"Graph templates do not support embedding fields because vector storage is graph-scoped and cannot be instantiated schema-only.\",\n {\n code: \"GRAPH_TEMPLATE_VECTOR_UNSUPPORTED\",\n graphId: reconciled.graph.id,\n },\n {\n suggestion:\n \"Provision the graph through createStoreWithSchema until template instantiation can atomically materialize vector contributions.\",\n },\n );\n }\n const schemaDocument = serializeSchema(reconciled.graph, reconciled.version);\n const schemaHash = await computeSchemaHash(schemaDocument);\n if (schemaHash !== reconciled.hash) {\n throw new ConfigurationError(\n \"Reconciled schema hash does not match its graph snapshot.\",\n { code: \"GRAPH_TEMPLATE_RECONCILED_HASH_MISMATCH\" },\n );\n }\n await register({\n templateId: params.templateId,\n schemaHash,\n schemaDoc: schemaDocument,\n });\n return Object.freeze({\n id: params.templateId,\n reconciled,\n schemaHash,\n });\n}\n\n/**\n * Instantiates the template's final graph shape as target schema v1. Only the\n * target hash crosses the wire; the durable source document stays in the\n * backend template registry and is rebound to `graphId` by one SQL statement.\n */\nexport async function instantiateGraphTemplate<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ template: GraphTemplate<G>; graphId: string }>,\n): Promise<InstantiateGraphTemplateResult<G>> {\n const instantiate = backend.instantiateGraphTemplate;\n if (instantiate === undefined) throw graphTemplatesUnsupportedError(backend);\n await backend.assertBaseSchemaCurrent?.();\n const sourceVersion = params.template.reconciled.version;\n const reconciledHash = params.template.reconciled.hash;\n if (sourceVersion === undefined || reconciledHash === undefined) {\n throw graphTemplateHandleMismatchError(params.template.id);\n }\n const sourceHash = await computeSchemaHash(\n serializeSchema(params.template.reconciled.graph, sourceVersion),\n );\n if (\n sourceHash !== params.template.schemaHash ||\n reconciledHash !== params.template.schemaHash\n ) {\n throw graphTemplateHandleMismatchError(params.template.id);\n }\n const targetGraph: G = Object.freeze({\n ...params.template.reconciled.graph,\n id: params.graphId,\n });\n const targetHash = await computeSchemaHash(serializeSchema(targetGraph, 1));\n const result = await instantiate({\n templateId: params.template.id,\n templateSchemaHash: params.template.schemaHash,\n graphId: params.graphId,\n schemaHash: targetHash,\n });\n if (result.status === \"refused\") {\n throw new ConfigurationError(\n `Graph template instantiation was refused for graph \"${params.graphId}\". The template may be absent, or the graph already has a different schema.`,\n {\n code: \"GRAPH_TEMPLATE_INSTANTIATION_REFUSED\",\n graphId: params.graphId,\n templateId: params.template.id,\n },\n );\n }\n if (\n result.row.graph_id !== params.graphId ||\n result.row.version !== 1 ||\n result.row.schema_hash !== targetHash\n ) {\n throw new ConfigurationError(\n \"Graph template backend returned a schema row that does not match the requested target.\",\n { code: \"GRAPH_TEMPLATE_INVALID_RESULT\", graphId: params.graphId },\n );\n }\n return Object.freeze({\n status: \"ready\",\n reconciled: Object.freeze({\n graph: targetGraph,\n version: result.row.version,\n hash: result.row.schema_hash,\n }),\n schema: result.row,\n });\n}\n\nfunction graphTemplateHandleMismatchError(\n templateId: string,\n): ConfigurationError {\n return new ConfigurationError(\n `Graph template handle \"${templateId}\" does not match its reconciled schema snapshot.`,\n { code: \"GRAPH_TEMPLATE_HANDLE_MISMATCH\", templateId },\n );\n}\n\n/** Short public name for {@link instantiateGraphTemplate}. */\nexport function instantiateGraph<G extends GraphDef>(\n backend: GraphBackend,\n params: Readonly<{ template: GraphTemplate<G>; graphId: string }>,\n): Promise<InstantiateGraphTemplateResult<G>> {\n return instantiateGraphTemplate(backend, params);\n}\n\nfunction graphTemplatesUnsupportedError(\n backend: GraphBackend,\n): ConfigurationError {\n return new ConfigurationError(\n `The ${backend.dialect} backend does not support durable graph templates.`,\n { code: \"GRAPH_TEMPLATES_UNSUPPORTED\", dialect: backend.dialect },\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { supportsAtomicNodeClaims } from './chunk-SLNH62T3.js';
1
+ import { supportsAtomicNodeClaims } from './chunk-KQYUKOGX.js';
2
2
 
3
3
  // src/backend/capabilities/autocommit-single-statement.ts
4
4
  var BUNDLED_ROOT_AUTOCOMMIT_BACKENDS = /* @__PURE__ */ new WeakSet();
@@ -83,5 +83,5 @@ function supportsNodeCreatePlan(target, input) {
83
83
  }
84
84
 
85
85
  export { isBundledRootAutocommitEligible, markBundledRootAutocommitEligible, rephaseAtomicNodeClaimPlan, rephaseNonTransactionalNodeClaimPlan, supportsNodeCreatePlan, supportsNodeInsertProjectionRequirements, supportsNodeInsertProjections };
86
- //# sourceMappingURL=chunk-45WPPI64.js.map
87
- //# sourceMappingURL=chunk-45WPPI64.js.map
86
+ //# sourceMappingURL=chunk-FMCPKMQI.js.map
87
+ //# sourceMappingURL=chunk-FMCPKMQI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/backend/capabilities/autocommit-single-statement.ts","../src/backend/capabilities/node-insert-projections.ts"],"names":[],"mappings":";;;AAaA,IAAM,gCAAA,uBAAuC,OAAA,EAAgB;AAGtD,SAAS,kCACd,MAAA,EACG;AACH,EAAA,gCAAA,CAAiC,IAAI,MAAM,CAAA;AAC3C,EAAA,OAAO,MAAA;AACT;AAGO,SAAS,gCACd,MAAA,EACwB;AACxB,EAAA,OAAO,gCAAA,CAAiC,IAAI,MAAM,CAAA;AACpD;;;ACRO,SAAS,wCAAA,CACd,QACA,YAAA,EACS;AACT,EAAA,OAAA,CACG,CAAC,YAAA,CAAa,QAAA,IACb,MAAA,CAAO,gBAAA,EAAkB,yBAAA,KAA8B,MAAA,MACxD,CAAC,YAAA,CAAa,SAAA,IACb,MAAA,CAAO,cAAA,EAAgB,2BAAA,KAAgC,MAAA,CAAA;AAE7D;AAUO,SAAS,6BAAA,CACd,QACA,WAAA,EACS;AACT,EAAA,IAAI,WAAA,CAAY,MAAA,KAAW,CAAA,EAAG,OAAO,KAAA;AACrC,EAAA,OAAO,yCAAyC,MAAA,EAAQ;AAAA,IACtD,UAAU,WAAA,CAAY,IAAA,CAAK,CAAC,UAAA,KAAe,UAAA,CAAW,SAAS,UAAU,CAAA;AAAA,IACzE,WAAW,WAAA,CAAY,IAAA;AAAA,MACrB,CAAC,UAAA,KAAe,UAAA,CAAW,IAAA,KAAS;AAAA;AACtC,GACD,CAAA;AACH;AAaA,SAAS,yBAAyB,MAAA,EAA6C;AAC7E,EAAA,OACE,EAAE,aAAA,IAAiB,MAAA,CAAA,IACnB,MAAA,CAAO,aAAa,sBAAA,KAA2B,IAAA;AAEnD;AASA,SAAS,sCACP,IAAA,EAIS;AACT,EAAA,OACE,IAAA,CAAK,WAAA,IACL,IAAA,CAAK,IAAA,CAAK,SAAS,UAAA,IACnB,IAAA,CAAK,WAAA,CAAY,MAAA,KAAW,KAC5B,IAAA,CAAK,MAAA,CAAO,MAAA,KAAW,CAAA,IACvB,KAAK,MAAA,CAAO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AQ;AAAA,IAC/C,QAAA,EAAU,MAAM,WAAA,CAAY,IAAA;AAAA,MAC1B,CAAC,UAAA,KAAe,UAAA,CAAW,IAAA,KAAS;AAAA,KACtC;AAAA,IACA,SAAA,EAAW,MAAM,WAAA,CAAY,IAAA;AAAA,MAC3B,CAAC,UAAA,KAAe,UAAA,CAAW,IAAA,KAAS;AAAA;AACtC,GACD,CAAA;AAEL","file":"chunk-45WPPI64.js","sourcesContent":["/**\n * Origin evidence for the managed single-statement autocommit fast path.\n *\n * This is intentionally narrower than schema-fenced-insert eligibility. The\n * latter follows bundled transaction targets and derived wrappers because its\n * statement still runs inside an explicit transaction. Here, omitting that\n * transaction is the optimization, so only the literal root objects produced\n * by the bundled factories may opt in. In particular, this evidence is never\n * carried through `deriveBackend`, an owned transaction, or adoption of a\n * caller-owned transaction.\n */\nimport type { GraphBackend, TransactionBackend } from \"../types\";\n\nconst BUNDLED_ROOT_AUTOCOMMIT_BACKENDS = new WeakSet<object>();\n\n/** @internal Called only by bundled factories after their root backend exists. */\nexport function markBundledRootAutocommitEligible<T extends object>(\n target: T,\n): T {\n BUNDLED_ROOT_AUTOCOMMIT_BACKENDS.add(target);\n return target;\n}\n\n/** Whether this is the exact root backend a bundled factory created. */\nexport function isBundledRootAutocommitEligible(\n target: GraphBackend | TransactionBackend,\n): target is GraphBackend {\n return BUNDLED_ROOT_AUTOCOMMIT_BACKENDS.has(target);\n}\n","import type {\n BackendIdentity,\n GraphBackend,\n ManagedNodeCreatePlan,\n NodeInsertClaim,\n NodeInsertProjection,\n} from \"../types\";\nimport {\n type AtomicNodeClaimSupport,\n supportsAtomicNodeClaims,\n} from \"./atomic-mutation-program\";\n\nexport type NodeProjectionInsertTarget = BackendIdentity &\n Pick<GraphBackend, \"commands\">;\n\nexport type NodeInsertProjectionRequirements = Readonly<{\n fulltext: boolean;\n embedding: boolean;\n}>;\n\nexport function supportsNodeInsertProjectionRequirements(\n target: NodeProjectionInsertTarget,\n requirements: NodeInsertProjectionRequirements,\n): boolean {\n return (\n (!requirements.fulltext ||\n target.fulltextStrategy?.buildSyncFromInsertedNode !== undefined) &&\n (!requirements.embedding ||\n target.vectorStrategy?.buildUpsertFromInsertedNode !== undefined)\n );\n}\n\n/**\n * The single owner of projection-fusion eligibility.\n *\n * A projection plan is all-or-nothing: every requested projection must have\n * an inserted-node builder on the active strategy, and the receiver must\n * expose the atomic executor. Callers use this same predicate before choosing\n * root autocommit and again on the actual transaction callback target.\n */\nexport function supportsNodeInsertProjections(\n target: NodeProjectionInsertTarget,\n projections: readonly NodeInsertProjection[],\n): boolean {\n if (projections.length === 0) return false;\n return supportsNodeInsertProjectionRequirements(target, {\n fulltext: projections.some((projection) => projection.kind === \"fulltext\"),\n embedding: projections.some(\n (projection) => projection.kind === \"embedding\",\n ),\n });\n}\n\n/**\n * Whether the receiver can make uniqueness/disjointness claims authoritative\n * inside the planned node statement.\n *\n * Claims are reported by the statement as a verdict, so the caller must have a\n * transaction boundary around the statement before it can safely defer the\n * application probes. A root backend is deliberately excluded: its\n * command port is also used for projection-only\n * autocommit writes, but a claim refusal must roll back the node and any\n * claims it touched together.\n */\nfunction supportsNodeInsertClaims(target: NodeProjectionInsertTarget): boolean {\n return (\n !(\"transaction\" in target) &&\n target.capabilities.atomicNodeInsertClaims === true\n );\n}\n\n/**\n * The only claim shape that is safe to execute on a root backend without a\n * rollback boundary. A generated id cannot collide with a different node, so\n * the claim is the sole conflict source; same-kind uniqueness has no legacy\n * axis or cross-kind/disjoint probe to consult. Rephasing it before the node\n * insert makes a conflict prevent the node row from being written at all.\n */\nfunction supportsNonTransactionalNodeClaimPlan(\n plan: Pick<\n ManagedNodeCreatePlan,\n \"idGenerated\" | \"mode\" | \"params\" | \"claims\" | \"projections\"\n >,\n): boolean {\n return (\n plan.idGenerated &&\n plan.mode.kind === \"ordinary\" &&\n plan.projections.length === 0 &&\n plan.claims.length === 1 &&\n plan.claims.every(\n (claim) =>\n claim.verdict.kind === \"uniqueness\" &&\n claim.axis === plan.params.kind &&\n claim.verdict.probeAxes.length === 1 &&\n claim.verdict.probeAxes[0] === claim.axis,\n )\n );\n}\n\n/** Rephases the safe root claim shape so a conflict gates the node insert. */\nexport function rephaseNonTransactionalNodeClaimPlan(\n plan: ManagedNodeCreatePlan,\n): ManagedNodeCreatePlan | undefined {\n if (!supportsNonTransactionalNodeClaimPlan(plan)) return;\n return {\n ...plan,\n claims: plan.claims.map((claim) => ({\n ...claim,\n placement: \"pre-insert\",\n })),\n };\n}\n\n/**\n * Normalizes the complete claim envelope accepted by an atomic node program.\n *\n * Unlike the ordinary root insert seam, a closed program can also prove a\n * disjoint claim because it carries the legacy live-node probe and cleanup in\n * the same atomic transport submission. The executor's advertised support is\n * authoritative; an omitted family remains on the portable path.\n */\nexport function rephaseAtomicNodeClaimPlan(\n plan: ManagedNodeCreatePlan,\n support: AtomicNodeClaimSupport | undefined,\n): ManagedNodeCreatePlan | undefined {\n if (\n plan.mode.kind !== \"ordinary\" ||\n plan.claims.length === 0 ||\n !supportsAtomicNodeClaims(support, plan.claims)\n ) {\n return;\n }\n const supported = plan.claims.every((claim) => {\n if (claim.verdict.kind === \"uniqueness\") {\n return (\n claim.verdict.probeAxes.length > 0 &&\n claim.verdict.probeAxes[0] === claim.axis &&\n new Set(claim.verdict.probeAxes).size === claim.verdict.probeAxes.length\n );\n }\n return (\n claim.key === plan.params.id &&\n claim.verdict.conflictingKinds.length > 0 &&\n new Set(claim.verdict.conflictingKinds).size ===\n claim.verdict.conflictingKinds.length\n );\n });\n if (!supported) return;\n return {\n ...plan,\n claims: plan.claims.map((claim) => ({\n ...claim,\n placement: \"pre-insert\",\n })),\n };\n}\n\n/** Whether the receiver can lower this complete insert plan atomically. */\nexport function supportsNodeCreatePlan(\n target: NodeProjectionInsertTarget,\n input: Readonly<{\n params?: ManagedNodeCreatePlan[\"params\"];\n idGenerated?: ManagedNodeCreatePlan[\"idGenerated\"];\n mode?: ManagedNodeCreatePlan[\"mode\"];\n claims: readonly NodeInsertClaim[];\n projections: readonly NodeInsertProjection[];\n /** Store-side proof that no identity/history/revision side effect exists. */\n allowNonTransactionalClaims?: boolean | undefined;\n }>,\n): boolean {\n if (input.claims.length === 0) {\n return supportsNodeInsertProjections(target, input.projections);\n }\n // A claim refusal is discovered from the data-modifying statement's result,\n // so the caller-owned transaction is the rollback boundary. Root graph\n // backends expose `transaction`; transaction-scoped operation backends do\n // not. Keep this exported predicate aligned with the execution contract.\n const ordinaryPlan =\n (\n input.params === undefined ||\n input.mode === undefined ||\n input.idGenerated === undefined\n ) ?\n undefined\n : {\n entity: \"node\" as const,\n params: input.params,\n idGenerated: input.idGenerated,\n mode: input.mode,\n claims: input.claims,\n projections: input.projections,\n };\n const rootClaimFusion =\n input.allowNonTransactionalClaims === true &&\n target.capabilities.atomicNodeInsertClaims === true &&\n ordinaryPlan !== undefined &&\n supportsNonTransactionalNodeClaimPlan(ordinaryPlan);\n return (\n (supportsNodeInsertClaims(target) ||\n (\"transaction\" in target && rootClaimFusion)) &&\n supportsNodeInsertProjectionRequirements(target, {\n fulltext: input.projections.some(\n (projection) => projection.kind === \"fulltext\",\n ),\n embedding: input.projections.some(\n (projection) => projection.kind === \"embedding\",\n ),\n })\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/backend/capabilities/autocommit-single-statement.ts","../src/backend/capabilities/node-insert-projections.ts"],"names":[],"mappings":";;;AAaA,IAAM,gCAAA,uBAAuC,OAAA,EAAgB;AAGtD,SAAS,kCACd,MAAA,EACG;AACH,EAAA,gCAAA,CAAiC,IAAI,MAAM,CAAA;AAC3C,EAAA,OAAO,MAAA;AACT;AAGO,SAAS,gCACd,MAAA,EACwB;AACxB,EAAA,OAAO,gCAAA,CAAiC,IAAI,MAAM,CAAA;AACpD;;;ACRO,SAAS,wCAAA,CACd,QACA,YAAA,EACS;AACT,EAAA,OAAA,CACG,CAAC,YAAA,CAAa,QAAA,IACb,MAAA,CAAO,gBAAA,EAAkB,yBAAA,KAA8B,MAAA,MACxD,CAAC,Y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SAAS,sBAAA,CACd,QACA,KAAA,EASS;AACT,EAAA,IAAI,KAAA,CAAM,MAAA,CAAO,MAAA,KAAW,CAAA,EAAG;AAC7B,IAAA,OAAO,6BAAA,CAA8B,MAAA,EAAQ,KAAA,CAAM,WAAW,CAAA;AAAA,EAChE;AAKA,EAAA,MAAM,YAAA,GAEF,KAAA,CAAM,MAAA,KAAW,MAAA,IACjB,KAAA,CAAM,SAAS,MAAA,IACf,KAAA,CAAM,WAAA,KAAgB,MAAA,GAEtB,MAAA,GACA;AAAA,IAEE,QAAQ,KAAA,CAAM,MAAA;AAAA,IACd,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,QAAQ,KAAA,CAAM,MAAA;AAAA,IACd,aAAa,KAAA,CAAM;AAAA,GACrB;AACJ,EAAA,MAAM,eAAA,GACJ,KAAA,CAAM,2BAAA,KAAgC,IAAA,IACtC,MAAA,CAAO,YAAA,CAAa,sBAAA,KAA2B,IAAA,IAC/C,YAAA,KAAiB,MAAA,IACjB,qCAAA,CAAsC,YAAY,CAAA;AACpD,EAAA,OAAA,CACG,yBAAyB,MAAM,CAAA,IAC7B,iBAAiB,MAAA,IAAU,eAAA,KAC9B,yCAAyC,MAAA,EAAQ;AAAA,IAC/C,QAAA,EAAU,MAAM,WAAA,CAAY,IAAA;AAAA,MAC1B,CAAC,UAAA,KAAe,UAAA,CAAW,IAAA,KAAS;AAAA,KACtC;AAAA,IACA,SAAA,EAAW,MAAM,WAAA,CAAY,IAAA;AAAA,MAC3B,CAAC,UAAA,KAAe,UAAA,CAAW,IAAA,KAAS;AAAA;AACtC,GACD,CAAA;AAEL","file":"chunk-FMCPKMQI.js","sourcesContent":["/**\n * Origin evidence for the managed single-statement autocommit fast path.\n *\n * This is intentionally narrower than schema-fenced-insert eligibility. The\n * latter follows bundled transaction targets and derived wrappers because its\n * statement still runs inside an explicit transaction. Here, omitting that\n * transaction is the optimization, so only the literal root objects produced\n * by the bundled factories may opt in. In particular, this evidence is never\n * carried through `deriveBackend`, an owned transaction, or adoption of a\n * caller-owned transaction.\n */\nimport type { GraphBackend, TransactionBackend } from \"../types\";\n\nconst BUNDLED_ROOT_AUTOCOMMIT_BACKENDS = new WeakSet<object>();\n\n/** @internal Called only by bundled factories after their root backend exists. */\nexport function markBundledRootAutocommitEligible<T extends object>(\n target: T,\n): T {\n BUNDLED_ROOT_AUTOCOMMIT_BACKENDS.add(target);\n return target;\n}\n\n/** Whether this is the exact root backend a bundled factory created. */\nexport function isBundledRootAutocommitEligible(\n target: GraphBackend | TransactionBackend,\n): target is GraphBackend {\n return BUNDLED_ROOT_AUTOCOMMIT_BACKENDS.has(target);\n}\n","import type {\n BackendIdentity,\n GraphBackend,\n ManagedNodeCreatePlan,\n NodeInsertClaim,\n NodeInsertProjection,\n} from \"../types\";\nimport {\n type AtomicNodeClaimSupport,\n supportsAtomicNodeClaims,\n} from \"./atomic-mutation-program\";\n\nexport type NodeProjectionInsertTarget = BackendIdentity &\n Pick<GraphBackend, \"commands\">;\n\nexport type NodeInsertProjectionRequirements = Readonly<{\n fulltext: boolean;\n embedding: boolean;\n}>;\n\nexport function supportsNodeInsertProjectionRequirements(\n target: NodeProjectionInsertTarget,\n requirements: NodeInsertProjectionRequirements,\n): boolean {\n return (\n (!requirements.fulltext ||\n target.fulltextStrategy?.buildSyncFromInsertedNode !== undefined) &&\n (!requirements.embedding ||\n target.vectorStrategy?.buildUpsertFromInsertedNode !== undefined)\n );\n}\n\n/**\n * The single owner of projection-fusion eligibility.\n *\n * A projection plan is all-or-nothing: every requested projection must have\n * an inserted-node builder on the active strategy, and the receiver must\n * expose the atomic executor. Callers use this same predicate before choosing\n * root autocommit and again on the actual transaction callback target.\n */\nexport function supportsNodeInsertProjections(\n target: NodeProjectionInsertTarget,\n projections: readonly NodeInsertProjection[],\n): boolean {\n if (projections.length === 0) return false;\n return supportsNodeInsertProjectionRequirements(target, {\n fulltext: projections.some((projection) => projection.kind === \"fulltext\"),\n embedding: projections.some(\n (projection) => projection.kind === \"embedding\",\n ),\n });\n}\n\n/**\n * Whether the receiver can make uniqueness/disjointness claims authoritative\n * inside the planned node statement.\n *\n * Claims are reported by the statement as a verdict, so the caller must have a\n * transaction boundary around the statement before it can safely defer the\n * application probes. A root backend is deliberately excluded: its\n * command port is also used for projection-only\n * autocommit writes, but a claim refusal must roll back the node and any\n * claims it touched together.\n */\nfunction supportsNodeInsertClaims(target: NodeProjectionInsertTarget): boolean {\n return (\n !(\"transaction\" in target) &&\n target.capabilities.atomicNodeInsertClaims === true\n );\n}\n\n/**\n * The only claim shape that is safe to execute on a root backend without a\n * rollback boundary. A generated id cannot collide with a different node, so\n * the claim is the sole conflict source; same-kind uniqueness has no legacy\n * axis or cross-kind/disjoint probe to consult. Rephasing it before the node\n * insert makes a conflict prevent the node row from being written at all.\n */\nfunction supportsNonTransactionalNodeClaimPlan(\n plan: Pick<\n ManagedNodeCreatePlan,\n \"idGenerated\" | \"mode\" | \"params\" | \"claims\" | \"projections\"\n >,\n): boolean {\n return (\n plan.idGenerated &&\n plan.mode.kind === \"ordinary\" &&\n plan.projections.length === 0 &&\n plan.claims.length === 1 &&\n plan.claims.every(\n (claim) =>\n claim.verdict.kind === \"uniqueness\" &&\n claim.axis === plan.params.kind &&\n claim.verdict.probeAxes.length === 1 &&\n claim.verdict.probeAxes[0] === claim.axis,\n )\n );\n}\n\n/** Rephases the safe root claim shape so a conflict gates the node insert. */\nexport function rephaseNonTransactionalNodeClaimPlan(\n plan: ManagedNodeCreatePlan,\n): ManagedNodeCreatePlan | undefined {\n if (!supportsNonTransactionalNodeClaimPlan(plan)) return;\n return {\n ...plan,\n claims: plan.claims.map((claim) => ({\n ...claim,\n placement: \"pre-insert\",\n })),\n };\n}\n\n/**\n * Normalizes the complete claim envelope accepted by an atomic node program.\n *\n * Unlike the ordinary root insert seam, a closed program can also prove a\n * disjoint claim because it carries the legacy live-node probe and cleanup in\n * the same atomic transport submission. The executor's advertised support is\n * authoritative; an omitted family remains on the portable path.\n */\nexport function rephaseAtomicNodeClaimPlan(\n plan: ManagedNodeCreatePlan,\n support: AtomicNodeClaimSupport | undefined,\n): ManagedNodeCreatePlan | undefined {\n if (\n plan.mode.kind !== \"ordinary\" ||\n plan.claims.length === 0 ||\n !supportsAtomicNodeClaims(support, plan.claims)\n ) {\n return;\n }\n const supported = plan.claims.every((claim) => {\n if (claim.verdict.kind === \"uniqueness\") {\n return (\n claim.verdict.probeAxes.length > 0 &&\n claim.verdict.probeAxes[0] === claim.axis &&\n new Set(claim.verdict.probeAxes).size === claim.verdict.probeAxes.length\n );\n }\n return (\n claim.key === plan.params.id &&\n claim.verdict.conflictingKinds.length > 0 &&\n new Set(claim.verdict.conflictingKinds).size ===\n claim.verdict.conflictingKinds.length\n );\n });\n if (!supported) return;\n return {\n ...plan,\n claims: plan.claims.map((claim) => ({\n ...claim,\n placement: \"pre-insert\",\n })),\n };\n}\n\n/** Whether the receiver can lower this complete insert plan atomically. */\nexport function supportsNodeCreatePlan(\n target: NodeProjectionInsertTarget,\n input: Readonly<{\n params?: ManagedNodeCreatePlan[\"params\"];\n idGenerated?: ManagedNodeCreatePlan[\"idGenerated\"];\n mode?: ManagedNodeCreatePlan[\"mode\"];\n claims: readonly NodeInsertClaim[];\n projections: readonly NodeInsertProjection[];\n /** Store-side proof that no identity/history/revision side effect exists. */\n allowNonTransactionalClaims?: boolean | undefined;\n }>,\n): boolean {\n if (input.claims.length === 0) {\n return supportsNodeInsertProjections(target, input.projections);\n }\n // A claim refusal is discovered from the data-modifying statement's result,\n // so the caller-owned transaction is the rollback boundary. Root graph\n // backends expose `transaction`; transaction-scoped operation backends do\n // not. Keep this exported predicate aligned with the execution contract.\n const ordinaryPlan =\n (\n input.params === undefined ||\n input.mode === undefined ||\n input.idGenerated === undefined\n ) ?\n undefined\n : {\n entity: \"node\" as const,\n params: input.params,\n idGenerated: input.idGenerated,\n mode: input.mode,\n claims: input.claims,\n projections: input.projections,\n };\n const rootClaimFusion =\n input.allowNonTransactionalClaims === true &&\n target.capabilities.atomicNodeInsertClaims === true &&\n ordinaryPlan !== undefined &&\n supportsNonTransactionalNodeClaimPlan(ordinaryPlan);\n return (\n (supportsNodeInsertClaims(target) ||\n (\"transaction\" in target && rootClaimFusion)) &&\n supportsNodeInsertProjectionRequirements(target, {\n fulltext: input.projections.some(\n (projection) => projection.kind === \"fulltext\",\n ),\n embedding: input.projections.some(\n (projection) => projection.kind === \"embedding\",\n ),\n })\n );\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { assertNoLegacyTransactionCapability, tables, assertBundledCapabilityDeclarations, contributionRebuildSupported, createPostgresOperationStrategy, createCachedTableExistence, createContributionMaterializer, createBaseSchemaLifecycle, gateFulltextMethods, lockPostgresTrustedImportTables, assertTrustedImportDatabaseEmpty, suspendPostgresSecondaryIndexes, createPostgresTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, createCommonOperationBackend, mapVectorWriteError, resolveAtomicNodeProjectionRequirements, vectorSlotFromParams, buildLiveNodeCandidates, mapHybridSearchRow, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, postgresIdentifierRegclassName, edgeMatchIdentityPairCheckName, edgeMatchIdentityUniqueIndexName, generatePostgresEdgeMatchIdentityUpgradeDDL, generatePgCreateTableSQL, assertAdoptedDialect, commitSchemaVersionIfKindsEmpty, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, instantiateGraphTemplateSql, generatePostgresDDL, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, assertActiveSchemaVersion, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, gateFulltext, createPostgresTables, postgresContributions, getOrCreateLru } from './chunk-WXGMDROJ.js';
1
+ import { assertNoLegacyTransactionCapability, tables, assertBundledCapabilityDeclarations, contributionRebuildSupported, createPostgresOperationStrategy, createCachedTableExistence, createContributionMaterializer, createBaseSchemaLifecycle, gateFulltextMethods, lockPostgresTrustedImportTables, assertTrustedImportDatabaseEmpty, suspendPostgresSecondaryIndexes, createPostgresTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, createCommonOperationBackend, mapVectorWriteError, resolveAtomicNodeProjectionRequirements, vectorSlotFromParams, buildLiveNodeCandidates, mapHybridSearchRow, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, postgresIdentifierRegclassName, edgeMatchIdentityPairCheckName, edgeMatchIdentityUniqueIndexName, generatePostgresEdgeMatchIdentityUpgradeDDL, generatePgCreateTableSQL, assertAdoptedDialect, commitSchemaVersionIfKindsEmpty, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, instantiateGraphTemplateSql, generatePostgresDDL, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, assertActiveSchemaVersion, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, gateFulltext, createPostgresTables, postgresContributions, getOrCreateLru } from './chunk-QDNEXTON.js';
2
2
  import { toDrizzleSql, compileQueryWithDialect } from './chunk-KHGHOXY2.js';
3
3
  import { pgvectorStrategy, assertPgvectorEfSearch } from './chunk-OAGKRW22.js';
4
- import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-HW3IX2RF.js';
5
- import { markBundledRootAutocommitEligible } from './chunk-45WPPI64.js';
6
- import { createAtomicSqlProgramExecutor, registerAtomicSqlProgram, registerAtomicMutationPrograms, carryAtomicMutationSessionRegistration } from './chunk-SLNH62T3.js';
4
+ import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-EWRLWI7W.js';
5
+ import { markBundledRootAutocommitEligible } from './chunk-FMCPKMQI.js';
6
+ import { createAtomicSqlProgramExecutor, registerAtomicSqlProgram, registerAtomicMutationPrograms, carryAtomicMutationSessionRegistration } from './chunk-KQYUKOGX.js';
7
7
  import { RECORDED_GRAPH_WRITE_ADVISORY_LOCK_NAMESPACE } from './chunk-JYY2EB5K.js';
8
8
  import { isMissingTableError, chunk, isPostgresConcurrentDdlRaceError, isInsufficientResourcesError } from './chunk-U4SGJQKQ.js';
9
- import { resolveDeclaredBackendResource, POSTGRES_CAPABILITIES, POSTGRES_MAX_BIND_PARAMETERS, normalizeGraphAnalyticsCapabilities, markFirstPartyFactory, deriveBackend, auditBackendResource, markSchemaFencedInsertEligible, resolveWriteFencePlan, scopeAtomicBatchToSession, DATABASE_EXTENSION_NAMES, requireWriteFence, INTERNAL_TEMPORARY_WRITES } from './chunk-YVKPUSHS.js';
9
+ import { resolveDeclaredBackendResource, POSTGRES_CAPABILITIES, POSTGRES_MAX_BIND_PARAMETERS, normalizeGraphAnalyticsCapabilities, markFirstPartyFactory, deriveBackend, auditBackendResource, markSchemaFencedInsertEligible, resolveWriteFencePlan, scopeAtomicBatchToSession, DATABASE_EXTENSION_NAMES, requireWriteFence, INTERNAL_TEMPORARY_WRITES } from './chunk-75KH6Y2W.js';
10
10
  import { tsvectorStrategy, assertVectorSearchLimit, buildFulltextCapabilities, buildVectorCapabilities, resolveEfSearchOverride, vectorSearchFrontierTuning } from './chunk-IJCIVEG5.js';
11
11
  import { sql, isSqlFragment, shouldForceCustomPlan, annIndexScanTypes } from './chunk-LFM53HMA.js';
12
12
  import { ConfigurationError, StaleVersionError, CompilerInvariantError, TransactionClosedError } from './chunk-ADOABE3R.js';
@@ -2267,5 +2267,5 @@ function createTransactionBackend(options) {
2267
2267
  }
2268
2268
 
2269
2269
  export { createPostgresBackend };
2270
- //# sourceMappingURL=chunk-QM6IQW7B.js.map
2271
- //# sourceMappingURL=chunk-QM6IQW7B.js.map
2270
+ //# sourceMappingURL=chunk-ILHVYKXJ.js.map
2271
+ //# sourceMappingURL=chunk-ILHVYKXJ.js.map