@nicia-ai/typegraph 0.28.1 → 0.29.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 (172) hide show
  1. package/dist/backend/postgres/index.cjs +23 -761
  2. package/dist/backend/postgres/index.cjs.map +1 -1
  3. package/dist/backend/postgres/index.d.cts +24 -5
  4. package/dist/backend/postgres/index.d.ts +24 -5
  5. package/dist/backend/postgres/index.js +10 -752
  6. package/dist/backend/postgres/index.js.map +1 -1
  7. package/dist/backend/postgres/pglite.cjs +52 -0
  8. package/dist/backend/postgres/pglite.cjs.map +1 -0
  9. package/dist/backend/postgres/pglite.d.cts +116 -0
  10. package/dist/backend/postgres/pglite.d.ts +116 -0
  11. package/dist/backend/postgres/pglite.js +50 -0
  12. package/dist/backend/postgres/pglite.js.map +1 -0
  13. package/dist/backend/sqlite/index.cjs +22 -26
  14. package/dist/backend/sqlite/index.d.cts +17 -15
  15. package/dist/backend/sqlite/index.d.ts +17 -15
  16. package/dist/backend/sqlite/index.js +9 -9
  17. package/dist/backend/sqlite/libsql.cjs +17 -13
  18. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  19. package/dist/backend/sqlite/libsql.d.cts +3 -3
  20. package/dist/backend/sqlite/libsql.d.ts +3 -3
  21. package/dist/backend/sqlite/libsql.js +16 -12
  22. package/dist/backend/sqlite/libsql.js.map +1 -1
  23. package/dist/backend/sqlite/local.cjs +17 -16
  24. package/dist/backend/sqlite/local.cjs.map +1 -1
  25. package/dist/backend/sqlite/local.d.cts +3 -3
  26. package/dist/backend/sqlite/local.d.ts +3 -3
  27. package/dist/backend/sqlite/local.js +15 -14
  28. package/dist/backend/sqlite/local.js.map +1 -1
  29. package/dist/{chunk-TKM2WDT4.js → chunk-3DTLDGIM.js} +386 -1093
  30. package/dist/chunk-3DTLDGIM.js.map +1 -0
  31. package/dist/{chunk-WVQXAFP3.js → chunk-454I6GDF.js} +46 -5
  32. package/dist/chunk-454I6GDF.js.map +1 -0
  33. package/dist/chunk-4K6IHUW6.cjs +183 -0
  34. package/dist/chunk-4K6IHUW6.cjs.map +1 -0
  35. package/dist/{chunk-ZTREJOGB.js → chunk-7KLVFWXR.js} +113 -68
  36. package/dist/chunk-7KLVFWXR.js.map +1 -0
  37. package/dist/{chunk-PGU2XKMA.js → chunk-A4H6QMV4.js} +110 -102
  38. package/dist/chunk-A4H6QMV4.js.map +1 -0
  39. package/dist/{chunk-E5ROA3MN.js → chunk-BMDF2S7S.js} +3 -3
  40. package/dist/{chunk-E5ROA3MN.js.map → chunk-BMDF2S7S.js.map} +1 -1
  41. package/dist/{chunk-PN37HVAV.cjs → chunk-C2RWFIYP.cjs} +121 -67
  42. package/dist/chunk-C2RWFIYP.cjs.map +1 -0
  43. package/dist/chunk-CUZGBWFT.js +206 -0
  44. package/dist/chunk-CUZGBWFT.js.map +1 -0
  45. package/dist/chunk-F2Q76CQ4.cjs +266 -0
  46. package/dist/chunk-F2Q76CQ4.cjs.map +1 -0
  47. package/dist/{chunk-YEDQLNVE.cjs → chunk-G6P3OVDY.cjs} +14 -2
  48. package/dist/chunk-G6P3OVDY.cjs.map +1 -0
  49. package/dist/chunk-GPUNAJFH.js +181 -0
  50. package/dist/chunk-GPUNAJFH.js.map +1 -0
  51. package/dist/chunk-HKN622O4.js +254 -0
  52. package/dist/chunk-HKN622O4.js.map +1 -0
  53. package/dist/{chunk-PYJOBZR3.cjs → chunk-HM6XMR3E.cjs} +52 -52
  54. package/dist/chunk-HM6XMR3E.cjs.map +1 -0
  55. package/dist/chunk-IE2TPFBT.js +305 -0
  56. package/dist/chunk-IE2TPFBT.js.map +1 -0
  57. package/dist/chunk-KGAJ5HFO.cjs +319 -0
  58. package/dist/chunk-KGAJ5HFO.cjs.map +1 -0
  59. package/dist/{chunk-O57GYGYK.js → chunk-M6OC455F.js} +32 -18
  60. package/dist/chunk-M6OC455F.js.map +1 -0
  61. package/dist/{chunk-U5ROKVRF.js → chunk-MB363HT5.js} +14 -3
  62. package/dist/chunk-MB363HT5.js.map +1 -0
  63. package/dist/{chunk-5MTOKWDA.js → chunk-MRMD7S7E.js} +9 -9
  64. package/dist/{chunk-5MTOKWDA.js.map → chunk-MRMD7S7E.js.map} +1 -1
  65. package/dist/{chunk-OOS2RKRH.js → chunk-N3VVQDMA.js} +3 -3
  66. package/dist/{chunk-OOS2RKRH.js.map → chunk-N3VVQDMA.js.map} +1 -1
  67. package/dist/{chunk-EJCDOA37.js → chunk-OGUH56BB.js} +4 -4
  68. package/dist/{chunk-EJCDOA37.js.map → chunk-OGUH56BB.js.map} +1 -1
  69. package/dist/chunk-Q3ZZLU3O.cjs +12 -0
  70. package/dist/{chunk-4FJVSF3K.cjs.map → chunk-Q3ZZLU3O.cjs.map} +1 -1
  71. package/dist/chunk-Q5ASTPM4.cjs +208 -0
  72. package/dist/chunk-Q5ASTPM4.cjs.map +1 -0
  73. package/dist/{chunk-WFUN6DCM.cjs → chunk-R2LA6MKR.cjs} +11 -11
  74. package/dist/chunk-R2LA6MKR.cjs.map +1 -0
  75. package/dist/{chunk-FFHW2JEK.cjs → chunk-RP7YITHX.cjs} +32 -17
  76. package/dist/chunk-RP7YITHX.cjs.map +1 -0
  77. package/dist/{chunk-NMOE2ZEU.cjs → chunk-RU5BBUU2.cjs} +132 -124
  78. package/dist/chunk-RU5BBUU2.cjs.map +1 -0
  79. package/dist/{chunk-TSGBRPNE.js → chunk-SFNUHFON.js} +45 -45
  80. package/dist/chunk-SFNUHFON.js.map +1 -0
  81. package/dist/chunk-UP4QAJND.cjs +740 -0
  82. package/dist/chunk-UP4QAJND.cjs.map +1 -0
  83. package/dist/{chunk-CTHNVU6K.cjs → chunk-UPBXUOW7.cjs} +8 -8
  84. package/dist/{chunk-CTHNVU6K.cjs.map → chunk-UPBXUOW7.cjs.map} +1 -1
  85. package/dist/{chunk-EK6RJ373.cjs → chunk-VGU26WIU.cjs} +5 -5
  86. package/dist/{chunk-EK6RJ373.cjs.map → chunk-VGU26WIU.cjs.map} +1 -1
  87. package/dist/{chunk-WZH2MKHW.cjs → chunk-XTQHSOIC.cjs} +101 -101
  88. package/dist/{chunk-WZH2MKHW.cjs.map → chunk-XTQHSOIC.cjs.map} +1 -1
  89. package/dist/chunk-Y52UNT66.js +738 -0
  90. package/dist/chunk-Y52UNT66.js.map +1 -0
  91. package/dist/{chunk-OYLF3IC7.js → chunk-Z36W5WUM.js} +4 -4
  92. package/dist/chunk-Z36W5WUM.js.map +1 -0
  93. package/dist/{chunk-X3244EKP.cjs → chunk-ZFWNO3GE.cjs} +48 -4
  94. package/dist/chunk-ZFWNO3GE.cjs.map +1 -0
  95. package/dist/{chunk-NYQFPGYP.cjs → chunk-ZYQEXGYC.cjs} +423 -1139
  96. package/dist/chunk-ZYQEXGYC.cjs.map +1 -0
  97. package/dist/ddl-BwH00BB6.d.ts +38 -0
  98. package/dist/ddl-D3o-RmsV.d.cts +38 -0
  99. package/dist/{extension-types-B78CZfA5.d.cts → extension-types-CwHV-Uk4.d.cts} +4 -4
  100. package/dist/{extension-types-B78CZfA5.d.ts → extension-types-CwHV-Uk4.d.ts} +4 -4
  101. package/dist/graph-extension/index.cjs +18 -18
  102. package/dist/graph-extension/index.d.cts +4 -4
  103. package/dist/graph-extension/index.d.ts +4 -4
  104. package/dist/graph-extension/index.js +3 -3
  105. package/dist/{index-CWdBFWbI.d.ts → index-CapHwi1a.d.ts} +22 -3
  106. package/dist/{index-Bilw0pYm.d.cts → index-jPPexxM5.d.cts} +22 -3
  107. package/dist/index.cjs +1211 -945
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +142 -12
  110. package/dist/index.d.ts +142 -12
  111. package/dist/index.js +778 -544
  112. package/dist/index.js.map +1 -1
  113. package/dist/indexes/index.cjs +18 -18
  114. package/dist/indexes/index.d.cts +9 -9
  115. package/dist/indexes/index.d.ts +9 -9
  116. package/dist/indexes/index.js +4 -4
  117. package/dist/interchange/index.cjs +8 -14
  118. package/dist/interchange/index.cjs.map +1 -1
  119. package/dist/interchange/index.d.cts +5 -16
  120. package/dist/interchange/index.d.ts +5 -16
  121. package/dist/interchange/index.js +3 -9
  122. package/dist/interchange/index.js.map +1 -1
  123. package/dist/{manager-ehLTTNq0.d.ts → manager-BUugwCYz.d.ts} +2 -2
  124. package/dist/{manager-c1MGaVVR.d.cts → manager-DpIpn1HQ.d.cts} +2 -2
  125. package/dist/{materialize-indexes-DFavFQah.d.ts → materialize-indexes-lkawaDor.d.ts} +1 -1
  126. package/dist/{materialize-indexes-BQfaAZKA.d.cts → materialize-indexes-oanE3RU0.d.cts} +1 -1
  127. package/dist/{ddl-0Ooc2dpL.d.ts → postgres-CQL9UIn2.d.cts} +2 -471
  128. package/dist/{ddl-Dza3kDrI.d.cts → postgres-CcRLaxz0.d.ts} +2 -471
  129. package/dist/profiler/index.cjs +4 -4
  130. package/dist/profiler/index.d.cts +7 -7
  131. package/dist/profiler/index.d.ts +7 -7
  132. package/dist/profiler/index.js +2 -2
  133. package/dist/schema/index.cjs +32 -32
  134. package/dist/schema/index.d.cts +7 -7
  135. package/dist/schema/index.d.ts +7 -7
  136. package/dist/schema/index.js +9 -9
  137. package/dist/{sqlite-BxZUPbyD.d.ts → sqlite-CZDFUfHS.d.ts} +2 -468
  138. package/dist/{sqlite-mvpXjEeB.d.cts → sqlite-Rj3xu4It.d.cts} +2 -468
  139. package/dist/{store-D7YEMg2v.d.cts → store-B43FpOVX.d.cts} +84 -5
  140. package/dist/{store-Ufc1Eoey.d.ts → store-De0Y33wP.d.ts} +84 -5
  141. package/dist/{types-B-sJJ4GQ.d.ts → types-B5GSeE3t.d.ts} +2 -2
  142. package/dist/{types-CmUA9sal.d.cts → types-Bwlp_yvu.d.cts} +2 -2
  143. package/dist/{types-CMQymcwk.d.cts → types-CmAT-Z47.d.ts} +250 -46
  144. package/dist/{types-CQ7xXJMP.d.ts → types-DXCSyxac.d.cts} +250 -46
  145. package/dist/{where-5zf15aFZ.d.cts → where-2dsyYt3d.d.cts} +2 -2
  146. package/dist/{where-CtrLu1Zf.d.ts → where-CP4qGIHd.d.ts} +2 -2
  147. package/package.json +20 -5
  148. package/dist/chunk-3EUKJEQ3.js +0 -77
  149. package/dist/chunk-3EUKJEQ3.js.map +0 -1
  150. package/dist/chunk-4FJVSF3K.cjs +0 -12
  151. package/dist/chunk-FFHW2JEK.cjs.map +0 -1
  152. package/dist/chunk-HTGDWIDE.cjs +0 -89
  153. package/dist/chunk-HTGDWIDE.cjs.map +0 -1
  154. package/dist/chunk-LYRUNG6E.cjs +0 -52
  155. package/dist/chunk-LYRUNG6E.cjs.map +0 -1
  156. package/dist/chunk-NMOE2ZEU.cjs.map +0 -1
  157. package/dist/chunk-NYQFPGYP.cjs.map +0 -1
  158. package/dist/chunk-O57GYGYK.js.map +0 -1
  159. package/dist/chunk-OYLF3IC7.js.map +0 -1
  160. package/dist/chunk-PCHTTG42.js +0 -47
  161. package/dist/chunk-PCHTTG42.js.map +0 -1
  162. package/dist/chunk-PGU2XKMA.js.map +0 -1
  163. package/dist/chunk-PN37HVAV.cjs.map +0 -1
  164. package/dist/chunk-PYJOBZR3.cjs.map +0 -1
  165. package/dist/chunk-TKM2WDT4.js.map +0 -1
  166. package/dist/chunk-TSGBRPNE.js.map +0 -1
  167. package/dist/chunk-U5ROKVRF.js.map +0 -1
  168. package/dist/chunk-WFUN6DCM.cjs.map +0 -1
  169. package/dist/chunk-WVQXAFP3.js.map +0 -1
  170. package/dist/chunk-X3244EKP.cjs.map +0 -1
  171. package/dist/chunk-YEDQLNVE.cjs.map +0 -1
  172. package/dist/chunk-ZTREJOGB.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { d as KindAnnotations, N as NodeType, e as EdgeType } from './extension-types-B78CZfA5.cjs';
3
- export { A as AnyEdgeType, C as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, g as Collation, D as DeleteBehavior, h as EdgeId, i as EdgeProps, E as EdgeRegistration, j as EdgeTypeWithEndpoints, k as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, U as UniqueConstraint, o as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-B78CZfA5.cjs';
4
- import { H as InferenceType, M as MetaEdge, O as OntologyRelation, K as AggregateExpr, L as FieldRef, P as ComparisonOp, T as AggregateComparisonPredicate } from './types-CMQymcwk.cjs';
5
- export { U as AdoptedTransaction, B as BackendCapabilities, W as CommitSchemaVersionExpected, X as CommitSchemaVersionParams, Y as DEFAULT_SQL_SCHEMA, Z as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, _ as FulltextBatchRow, $ as FulltextCapabilities, a0 as FulltextQueryMode, a1 as FulltextSearchParams, a2 as FulltextSearchResult, F as FulltextStrategy, G as GraphBackend, a3 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a4 as JsonPointerFor, a5 as JsonPointerInput, a6 as JsonPointerSegment, a7 as JsonPointerSegments, a8 as JsonPointerSegmentsFor, a9 as MAX_JSON_POINTER_DEPTH, aa as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ab as OrderSpec, ac as ParameterRef, ad as ResolveJsonPointer, ae as ResolveJsonPointerSegments, D as SchemaVersionRow, af as SetActiveVersionParams, ag as SortDirection, p as SqlDialect, ah as SqlSchema, ai as SqlTableNames, aj as StrategyTableContribution, ak as TableContribution, al as TransactionBackend, am as TraversalExpansion, an as UpsertFulltextBatchParams, ao as VectorCapabilities, ap as createSqlSchema, aq as fts5Strategy, ar as isMetaEdge, as as joinJsonPointers, at as jsonPointer, au as normalizeJsonPointer, av as parseJsonPointer, aw as tsvectorStrategy } from './types-CMQymcwk.cjs';
6
- import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-D7YEMg2v.cjs';
7
- export { a as AggregateResult, b as AlgorithmCyclePolicy, c as AnyEdge, d as AnyNode, B as BaseTraversalOptions, e as BatchResults, f as BatchableQuery, g as ConstraintNames, h as CreateEdgeInput, i as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, j as DegreeOptions, k as DynamicEdgeAccessor, l as DynamicEdgeCollection, m as DynamicEdgeType, n as DynamicFieldBuilder, o as DynamicNodeAccessor, p as DynamicNodeCollection, q as DynamicNodeType, r as DynamicSelectableEdge, s as DynamicSelectableNode, t as Edge, u as EdgeAccessor, v as EdgeCollection, w as EdgeFindByEndpointsOptions, x as EdgeGetOrCreateByEndpointsOptions, y as EdgeGetOrCreateByEndpointsResult, z as EdgeIntrospection, F as EmbeddingSchema, G as EmbeddingValue, H as ExecutableAggregateQuery, I as ExecutableQuery, J as FieldAccessor, K as FulltextSearchHit, L as FulltextSearchOptions, M as GetOrCreateAction, N as GraphAlgorithms, O as GraphEdgeCollections, P as GraphNodeCollections, R as HookContext, U as HybridFulltextOptions, V as HybridSearchHit, W as HybridSearchOptions, X as HybridVectorOptions, Y as IfExistsMode, Z as KindIntrospection, _ as MaterializeRemovalsEntry, $ as MaterializeRemovalsOptions, a0 as MaterializeRemovalsResult, a1 as NeighborsOptions, a2 as Node, a3 as NodeAccessor, a4 as NodeAlias, a5 as NodeCollection, a6 as NodeGetOrCreateByConstraintOptions, a7 as NodeGetOrCreateByConstraintResult, a8 as NodeIdentifier, a9 as NodeRef, aa as OntologyIntrospection, ab as OperationHookContext, ac as PaginateOptions, ad as PaginatedResult, ae as PathNode, af as Predicate, ag as PreparedQuery, ah as PropsAccessor, ai as QueryHookContext, aj as QueryOptions, ak as ReachableNode, al as ReachableOptions, am as RebuildFulltextOptions, an as RebuildFulltextResult, ao as RecursiveTraversalOptions, ap as SchemaIntrospection, aq as SearchableMetadata, ar as SearchableOptions, as as SearchableSchema, at as SelectContext, au as SelectableEdge, av as SelectableNode, aw as ShortestPathOptions, ax as ShortestPathResult, S as Store, ay as StoreHooks, az as StoreOptions, aA as StoreProjection, aB as StoreRef, aC as StoreSearch, aD as StreamOptions, aE as SubgraphEdgeResult, aF as SubgraphNodeResult, aG as SubgraphOptions, aH as SubgraphResult, aI as SubsetEdge, aJ as SubsetNode, aK as TemporalAlgorithmOptions, aL as TransactionContext, aM as TraversalDirection, aN as TypedEdgeCollection, aO as UnionableQuery, aP as UniqueIntrospection, aQ as UpdateEdgeInput, aR as UpdateNodeInput, aS as VectorSearchHit, aT as VectorSearchOptions, aU as createStore, aV as createStoreWithSchema, aW as createVerifiedStore, aX as defineSubgraphProject, aY as embedding, aZ as exists, a_ as fieldRef, a$ as getEmbeddingDimensions, b0 as getSearchableMetadata, b1 as inSubquery, b2 as isEmbeddingSchema, b3 as isParameterRef, b4 as isSearchableSchema, b5 as notExists, b6 as notInSubquery, b7 as param, b8 as searchable } from './store-D7YEMg2v.cjs';
8
- import { G as GraphDef, K as KindRegistry } from './manager-c1MGaVVR.cjs';
9
- export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-c1MGaVVR.cjs';
10
- export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EndpointError, g as EndpointNotFoundError, h as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, i as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, j as SchemaMismatchError, k as StaleVersionError, l as StoreNotInitializedError, m as StoreNotInitializedReason, T as TypeGraphError, n as TypeGraphErrorOptions, U as UniquenessError, o as UnsupportedPredicateError, a as ValidationError, p as ValidationErrorDetails, V as ValidationIssue, q as VersionConflictError, r as getErrorSuggestion, s as isConstraintError, t as isSystemError, u as isTypeGraphError, v as isUserRecoverable } from './index-Bilw0pYm.cjs';
11
- export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-BQfaAZKA.cjs';
12
- export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-5zf15aFZ.cjs';
2
+ import { e as KindAnnotations, N as NodeType, d as EdgeType } from './extension-types-CwHV-Uk4.cjs';
3
+ export { A as AnyEdgeType, h as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, C as Collation, D as DeleteBehavior, i as EdgeId, j as EdgeProps, E as EdgeRegistration, k as EdgeTypeWithEndpoints, g as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, o as UniqueConstraint, U as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-CwHV-Uk4.cjs';
4
+ import { K as InferenceType, M as MetaEdge, V as VectorStrategy, G as GraphBackend, O as OntologyRelation, L as AggregateExpr, P as FieldRef, T as ComparisonOp, U as AggregateComparisonPredicate } from './types-DXCSyxac.cjs';
5
+ export { W as AdoptedTransaction, B as BackendCapabilities, X as CommitSchemaVersionExpected, Y as CommitSchemaVersionParams, Z as DEFAULT_SQL_SCHEMA, _ as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, $ as FulltextBatchRow, a0 as FulltextCapabilities, a1 as FulltextQueryMode, a2 as FulltextSearchParams, a3 as FulltextSearchResult, F as FulltextStrategy, a4 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a5 as JsonPointerFor, a6 as JsonPointerInput, a7 as JsonPointerSegment, a8 as JsonPointerSegments, a9 as JsonPointerSegmentsFor, aa as MAX_JSON_POINTER_DEPTH, ab as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ac as OrderSpec, ad as ParameterRef, ae as ResolveJsonPointer, af as ResolveJsonPointerSegments, H as SchemaVersionRow, ag as SetActiveVersionParams, ah as SortDirection, p as SqlDialect, ai as SqlSchema, aj as SqlTableNames, ak as StrategyTableContribution, al as TableContribution, am as TransactionBackend, an as TraversalExpansion, ao as UpsertFulltextBatchParams, ap as VectorCapabilities, aq as VectorSlot, ar as buildVectorCapabilities, as as createSqlSchema, at as fts5Strategy, au as isMetaEdge, av as joinJsonPointers, aw as jsonPointer, ax as normalizeJsonPointer, ay as parseJsonPointer, az as tsvectorStrategy } from './types-DXCSyxac.cjs';
6
+ import { E as EmbeddingMetric, a as EmbeddingIndexType, A as AliasMap, b as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-B43FpOVX.cjs';
7
+ export { c as AggregateResult, d as AlgorithmCyclePolicy, e as AnyEdge, f as AnyNode, B as BaseTraversalOptions, g as BatchResults, h as BatchableQuery, i as ConstraintNames, j as CreateEdgeInput, k as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, l as DegreeOptions, m as DynamicEdgeAccessor, n as DynamicEdgeCollection, o as DynamicEdgeType, p as DynamicFieldBuilder, q as DynamicNodeAccessor, r as DynamicNodeCollection, s as DynamicNodeType, t as DynamicSelectableEdge, u as DynamicSelectableNode, v as Edge, w as EdgeAccessor, x as EdgeCollection, y as EdgeFindByEndpointsOptions, z as EdgeGetOrCreateByEndpointsOptions, F as EdgeGetOrCreateByEndpointsResult, G as EdgeIntrospection, H as EmbeddingSchema, I as EmbeddingValue, J as ExecutableAggregateQuery, K as ExecutableQuery, L as FieldAccessor, M as FulltextSearchHit, N as FulltextSearchOptions, O as GetOrCreateAction, P as GraphAlgorithms, R as GraphEdgeCollections, U as GraphNodeCollections, V as HookContext, W as HybridFulltextOptions, X as HybridSearchHit, Y as HybridSearchOptions, Z as HybridVectorOptions, _ as IfExistsMode, $ as KindIntrospection, a0 as MaterializeRemovalsEntry, a1 as MaterializeRemovalsOptions, a2 as MaterializeRemovalsResult, a3 as NeighborsOptions, a4 as Node, a5 as NodeAccessor, a6 as NodeAlias, a7 as NodeCollection, a8 as NodeGetOrCreateByConstraintOptions, a9 as NodeGetOrCreateByConstraintResult, aa as NodeIdentifier, ab as NodeRef, ac as OntologyIntrospection, ad as OperationHookContext, ae as PaginateOptions, af as PaginatedResult, ag as PathNode, ah as Predicate, ai as PreparedQuery, aj as PropsAccessor, ak as QueryHookContext, al as QueryOptions, am as ReachableNode, an as ReachableOptions, ao as RebuildFulltextOptions, ap as RebuildFulltextResult, aq as ReclaimedVectorFieldEntry, ar as RecursiveTraversalOptions, as as ReembedFunction, at as ReembedVectorFieldOptions, au as ReembedVectorFieldResult, av as SchemaIntrospection, aw as SearchableMetadata, ax as SearchableOptions, ay as SearchableSchema, az as SelectContext, aA as SelectableEdge, aB as SelectableNode, aC as ShortestPathOptions, aD as ShortestPathResult, S as Store, aE as StoreHooks, aF as StoreOptions, aG as StoreProjection, aH as StoreRef, aI as StoreSearch, aJ as StreamOptions, aK as SubgraphEdgeResult, aL as SubgraphNodeResult, aM as SubgraphOptions, aN as SubgraphResult, aO as SubsetEdge, aP as SubsetNode, aQ as TemporalAlgorithmOptions, aR as TransactionContext, aS as TraversalDirection, aT as TypedEdgeCollection, aU as UnionableQuery, aV as UniqueIntrospection, aW as UpdateEdgeInput, aX as UpdateNodeInput, aY as VectorSearchHit, aZ as VectorSearchOptions, a_ as createStore, a$ as createStoreWithSchema, b0 as createVerifiedStore, b1 as defineSubgraphProject, b2 as embedding, b3 as exists, b4 as fieldRef, b5 as getEmbeddingDimensions, b6 as getSearchableMetadata, b7 as inSubquery, b8 as isEmbeddingSchema, b9 as isParameterRef, ba as isSearchableSchema, bb as notExists, bc as notInSubquery, bd as param, be as searchable } from './store-B43FpOVX.cjs';
8
+ import { G as GraphDef, K as KindRegistry } from './manager-DpIpn1HQ.cjs';
9
+ export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-DpIpn1HQ.cjs';
10
+ export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EmbeddingDimensionChangedError, g as EndpointError, h as EndpointNotFoundError, i as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, j as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, k as SchemaMismatchError, l as StaleVersionError, m as StoreNotInitializedError, n as StoreNotInitializedReason, T as TypeGraphError, o as TypeGraphErrorOptions, U as UniquenessError, p as UnsupportedPredicateError, a as ValidationError, q as ValidationErrorDetails, V as ValidationIssue, r as VersionConflictError, s as getErrorSuggestion, t as isConstraintError, u as isSystemError, v as isTypeGraphError, w as isUserRecoverable } from './index-jPPexxM5.cjs';
11
+ export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-oanE3RU0.cjs';
12
+ export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-2dsyYt3d.cjs';
13
13
  export { GraphExtensionError, GraphExtensionIssue, GraphExtensionIssueCode, GraphExtensionUnresolvedEndpointError, GraphExtensionValidationError, GraphExtensionVersionUnsupportedError, IncompatibleChange, IncompatibleChangeError, KindCollisionError, KindHasReferentsError, KindReferent, RemoveCompileTimeKindError, defineGraphExtension, validateGraphExtension } from './graph-extension/index.cjs';
14
14
  import 'drizzle-orm';
15
15
  import 'drizzle-orm/pg-core';
@@ -232,6 +232,111 @@ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
232
232
  */
233
233
  declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
234
234
 
235
+ declare const libsqlVectorStrategy: VectorStrategy;
236
+
237
+ declare const pgvectorStrategy: VectorStrategy;
238
+
239
+ declare const sqliteVecStrategy: VectorStrategy;
240
+
241
+ /**
242
+ * The resolved storage config for one `(nodeKind, fieldPath)` slot that the
243
+ * legacy table did not record. The legacy shared table stored only the
244
+ * vector and its dimension count — not the metric or index type — so a
245
+ * caller that wants migrated fields to match a specific graph's `embedding()`
246
+ * declarations supplies this resolver.
247
+ */
248
+ type LegacyEmbeddingSlotConfig = Readonly<{
249
+ metric: EmbeddingMetric;
250
+ indexType: EmbeddingIndexType;
251
+ }>;
252
+ /**
253
+ * Options for {@link migrateLegacyEmbeddings}.
254
+ */
255
+ type MigrateLegacyEmbeddingsOptions = Readonly<{
256
+ /**
257
+ * The backend to migrate, wired with the destination `VectorStrategy`
258
+ * (i.e. the post-cutover backend). Its `vectorStrategy` owns the per-field
259
+ * storage rows are written into and its `upsertEmbedding` performs the
260
+ * writes.
261
+ */
262
+ backend: GraphBackend;
263
+ /**
264
+ * Restrict the migration to a single graph. When omitted, every graph's
265
+ * rows in the legacy table are migrated (the table is graph-scoped by its
266
+ * `graph_id` column).
267
+ */
268
+ graphId?: string;
269
+ /**
270
+ * Resolves the metric / index type for a `(nodeKind, fieldPath)` slot the
271
+ * legacy table didn't persist. Return `undefined` to fall back to the
272
+ * cosine / hnsw defaults. Supply this (typically reading the graph's
273
+ * `embedding()` declarations) when migrated fields must match a specific
274
+ * metric — e.g. an `l2` field, which scores incorrectly under the cosine
275
+ * default.
276
+ */
277
+ resolveSlotConfig?: (nodeKind: string, fieldPath: string) => LegacyEmbeddingSlotConfig | undefined;
278
+ /** Rows read per round-trip. Defaults to {@link DEFAULT_BATCH_SIZE}. */
279
+ batchSize?: number;
280
+ /**
281
+ * Physical name of the legacy table to drain. Defaults to
282
+ * {@link LEGACY_EMBEDDINGS_TABLE_NAME}. Override only for a non-default
283
+ * deployment that renamed the embeddings table.
284
+ */
285
+ legacyTableName?: string;
286
+ }>;
287
+ /**
288
+ * Summary of a {@link migrateLegacyEmbeddings} run.
289
+ */
290
+ type MigrateLegacyEmbeddingsResult = Readonly<{
291
+ /** Total embedding rows re-inserted into per-field storage. */
292
+ migrated: number;
293
+ /**
294
+ * Per-`(nodeKind, fieldPath)` counts, keyed `"<nodeKind>.<fieldPath>"`
295
+ * (the strategy's logical-slot key form). Empty when the legacy table was
296
+ * absent or held no rows for the requested scope.
297
+ */
298
+ perField: Readonly<Record<string, number>>;
299
+ /**
300
+ * Rows skipped because their vector length didn't match the per-field
301
+ * table's fixed dimension. The legacy shared column allowed mixed
302
+ * dimensions for one `(nodeKind, fieldPath)` (e.g. an unmigrated model
303
+ * change); the first migrated row fixes the typed table's dimension and
304
+ * any differently-sized rows for that slot are skipped rather than aborting
305
+ * the whole migration. Keyed `"<nodeKind>.<fieldPath>"`. Non-empty here
306
+ * means those fields need a deliberate re-embed at a single dimension.
307
+ */
308
+ skippedDimensionMismatch: Readonly<Record<string, number>>;
309
+ /**
310
+ * Rows skipped because their legacy embedding could not be decoded into a
311
+ * finite-number array — a corrupt value (e.g. a pgvector `vector` column
312
+ * permits `NaN`/`Infinity`, which is not valid JSON). Keyed
313
+ * `"<nodeKind>.<fieldPath>"`. Skipping + reporting keeps one bad row from
314
+ * aborting the whole migration; non-empty here means those rows need manual
315
+ * repair.
316
+ */
317
+ skippedDecodeError: Readonly<Record<string, number>>;
318
+ /**
319
+ * Whether the legacy table existed. `false` means the run was a clean
320
+ * no-op (fresh install, or already-dropped table on a re-run).
321
+ */
322
+ legacyTablePresent: boolean;
323
+ }>;
324
+ /**
325
+ * Re-inserts every embedding from the legacy shared
326
+ * `typegraph_node_embeddings` table into the active
327
+ * `backend.vectorStrategy`'s per-`(nodeKind, fieldPath)` storage.
328
+ *
329
+ * One-time, explicitly-run upgrade step for the shared-table → per-field
330
+ * cutover (#157). Idempotent, batched, and a clean no-op when the legacy
331
+ * table is absent. See the module doc comment for the full contract.
332
+ *
333
+ * @throws Error when the backend exposes no `vectorStrategy` /
334
+ * `upsertEmbedding` (nothing to migrate *into*) — a configuration
335
+ * error the caller must fix by wiring the destination strategy
336
+ * before migrating.
337
+ */
338
+ declare function migrateLegacyEmbeddings(options: MigrateLegacyEmbeddingsOptions): Promise<MigrateLegacyEmbeddingsResult>;
339
+
235
340
  /**
236
341
  * Creates a subClassOf ontology relation.
237
342
  */
@@ -446,6 +551,31 @@ declare const core: {
446
551
  readonly implies: typeof implies;
447
552
  };
448
553
 
554
+ /**
555
+ * Transitive closure computation for ontology relationships.
556
+ *
557
+ * Uses Warshall's algorithm for efficient closure computation.
558
+ */
559
+ /**
560
+ * Computes the transitive closure of a set of directed relations.
561
+ *
562
+ * Given relations like [A→B, B→C], computes all transitive paths [A→B, A→C, B→C].
563
+ *
564
+ * @param relations - Array of [from, to] pairs representing direct relationships
565
+ * @returns Map from each 'from' to the set of all reachable 'to' values
566
+ */
567
+ declare function computeTransitiveClosure(relations: readonly (readonly [string, string])[]): ReadonlyMap<string, ReadonlySet<string>>;
568
+ /**
569
+ * Computes the inverse of a transitive closure map.
570
+ *
571
+ * Given A→{B, C}, returns B→{A}, C→{A}.
572
+ */
573
+ declare function invertClosure(closure: ReadonlyMap<string, ReadonlySet<string>>): ReadonlyMap<string, ReadonlySet<string>>;
574
+ /**
575
+ * Checks if there's a path from source to target in the closure.
576
+ */
577
+ declare function isReachable(closure: ReadonlyMap<string, ReadonlySet<string>>, source: string, target: string): boolean;
578
+
449
579
  /**
450
580
  * Recursive CTE Compilation
451
581
  *
@@ -787,4 +917,4 @@ type IdConfig = Readonly<{
787
917
  edgeIdGenerator: IdGenerator;
788
918
  }>;
789
919
 
790
- export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, avg, broader, composeFragments, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, isExternalRefSchema, limitFragment, max, metaEdge, min, narrower, offsetFragment, orderByFragment, partOf, relatedTo, sameAs, subClassOf, sum };
920
+ export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphBackend, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, type LegacyEmbeddingSlotConfig, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, type MigrateLegacyEmbeddingsOptions, type MigrateLegacyEmbeddingsResult, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, VectorStrategy, avg, broader, composeFragments, computeTransitiveClosure, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, invertClosure, isExternalRefSchema, isReachable, libsqlVectorStrategy, limitFragment, max, metaEdge, migrateLegacyEmbeddings, min, narrower, offsetFragment, orderByFragment, partOf, pgvectorStrategy, relatedTo, sameAs, sqliteVecStrategy, subClassOf, sum };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { d as KindAnnotations, N as NodeType, e as EdgeType } from './extension-types-B78CZfA5.js';
3
- export { A as AnyEdgeType, C as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, g as Collation, D as DeleteBehavior, h as EdgeId, i as EdgeProps, E as EdgeRegistration, j as EdgeTypeWithEndpoints, k as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, U as UniqueConstraint, o as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-B78CZfA5.js';
4
- import { H as InferenceType, M as MetaEdge, O as OntologyRelation, K as AggregateExpr, L as FieldRef, P as ComparisonOp, T as AggregateComparisonPredicate } from './types-CQ7xXJMP.js';
5
- export { U as AdoptedTransaction, B as BackendCapabilities, W as CommitSchemaVersionExpected, X as CommitSchemaVersionParams, Y as DEFAULT_SQL_SCHEMA, Z as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, _ as FulltextBatchRow, $ as FulltextCapabilities, a0 as FulltextQueryMode, a1 as FulltextSearchParams, a2 as FulltextSearchResult, F as FulltextStrategy, G as GraphBackend, a3 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a4 as JsonPointerFor, a5 as JsonPointerInput, a6 as JsonPointerSegment, a7 as JsonPointerSegments, a8 as JsonPointerSegmentsFor, a9 as MAX_JSON_POINTER_DEPTH, aa as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ab as OrderSpec, ac as ParameterRef, ad as ResolveJsonPointer, ae as ResolveJsonPointerSegments, D as SchemaVersionRow, af as SetActiveVersionParams, ag as SortDirection, p as SqlDialect, ah as SqlSchema, ai as SqlTableNames, aj as StrategyTableContribution, ak as TableContribution, al as TransactionBackend, am as TraversalExpansion, an as UpsertFulltextBatchParams, ao as VectorCapabilities, ap as createSqlSchema, aq as fts5Strategy, ar as isMetaEdge, as as joinJsonPointers, at as jsonPointer, au as normalizeJsonPointer, av as parseJsonPointer, aw as tsvectorStrategy } from './types-CQ7xXJMP.js';
6
- import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-Ufc1Eoey.js';
7
- export { a as AggregateResult, b as AlgorithmCyclePolicy, c as AnyEdge, d as AnyNode, B as BaseTraversalOptions, e as BatchResults, f as BatchableQuery, g as ConstraintNames, h as CreateEdgeInput, i as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, j as DegreeOptions, k as DynamicEdgeAccessor, l as DynamicEdgeCollection, m as DynamicEdgeType, n as DynamicFieldBuilder, o as DynamicNodeAccessor, p as DynamicNodeCollection, q as DynamicNodeType, r as DynamicSelectableEdge, s as DynamicSelectableNode, t as Edge, u as EdgeAccessor, v as EdgeCollection, w as EdgeFindByEndpointsOptions, x as EdgeGetOrCreateByEndpointsOptions, y as EdgeGetOrCreateByEndpointsResult, z as EdgeIntrospection, F as EmbeddingSchema, G as EmbeddingValue, H as ExecutableAggregateQuery, I as ExecutableQuery, J as FieldAccessor, K as FulltextSearchHit, L as FulltextSearchOptions, M as GetOrCreateAction, N as GraphAlgorithms, O as GraphEdgeCollections, P as GraphNodeCollections, R as HookContext, U as HybridFulltextOptions, V as HybridSearchHit, W as HybridSearchOptions, X as HybridVectorOptions, Y as IfExistsMode, Z as KindIntrospection, _ as MaterializeRemovalsEntry, $ as MaterializeRemovalsOptions, a0 as MaterializeRemovalsResult, a1 as NeighborsOptions, a2 as Node, a3 as NodeAccessor, a4 as NodeAlias, a5 as NodeCollection, a6 as NodeGetOrCreateByConstraintOptions, a7 as NodeGetOrCreateByConstraintResult, a8 as NodeIdentifier, a9 as NodeRef, aa as OntologyIntrospection, ab as OperationHookContext, ac as PaginateOptions, ad as PaginatedResult, ae as PathNode, af as Predicate, ag as PreparedQuery, ah as PropsAccessor, ai as QueryHookContext, aj as QueryOptions, ak as ReachableNode, al as ReachableOptions, am as RebuildFulltextOptions, an as RebuildFulltextResult, ao as RecursiveTraversalOptions, ap as SchemaIntrospection, aq as SearchableMetadata, ar as SearchableOptions, as as SearchableSchema, at as SelectContext, au as SelectableEdge, av as SelectableNode, aw as ShortestPathOptions, ax as ShortestPathResult, S as Store, ay as StoreHooks, az as StoreOptions, aA as StoreProjection, aB as StoreRef, aC as StoreSearch, aD as StreamOptions, aE as SubgraphEdgeResult, aF as SubgraphNodeResult, aG as SubgraphOptions, aH as SubgraphResult, aI as SubsetEdge, aJ as SubsetNode, aK as TemporalAlgorithmOptions, aL as TransactionContext, aM as TraversalDirection, aN as TypedEdgeCollection, aO as UnionableQuery, aP as UniqueIntrospection, aQ as UpdateEdgeInput, aR as UpdateNodeInput, aS as VectorSearchHit, aT as VectorSearchOptions, aU as createStore, aV as createStoreWithSchema, aW as createVerifiedStore, aX as defineSubgraphProject, aY as embedding, aZ as exists, a_ as fieldRef, a$ as getEmbeddingDimensions, b0 as getSearchableMetadata, b1 as inSubquery, b2 as isEmbeddingSchema, b3 as isParameterRef, b4 as isSearchableSchema, b5 as notExists, b6 as notInSubquery, b7 as param, b8 as searchable } from './store-Ufc1Eoey.js';
8
- import { G as GraphDef, K as KindRegistry } from './manager-ehLTTNq0.js';
9
- export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-ehLTTNq0.js';
10
- export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EndpointError, g as EndpointNotFoundError, h as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, i as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, j as SchemaMismatchError, k as StaleVersionError, l as StoreNotInitializedError, m as StoreNotInitializedReason, T as TypeGraphError, n as TypeGraphErrorOptions, U as UniquenessError, o as UnsupportedPredicateError, a as ValidationError, p as ValidationErrorDetails, V as ValidationIssue, q as VersionConflictError, r as getErrorSuggestion, s as isConstraintError, t as isSystemError, u as isTypeGraphError, v as isUserRecoverable } from './index-CWdBFWbI.js';
11
- export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-DFavFQah.js';
12
- export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-CtrLu1Zf.js';
2
+ import { e as KindAnnotations, N as NodeType, d as EdgeType } from './extension-types-CwHV-Uk4.js';
3
+ export { A as AnyEdgeType, h as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, C as Collation, D as DeleteBehavior, i as EdgeId, j as EdgeProps, E as EdgeRegistration, k as EdgeTypeWithEndpoints, g as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, o as UniqueConstraint, U as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-CwHV-Uk4.js';
4
+ import { K as InferenceType, M as MetaEdge, V as VectorStrategy, G as GraphBackend, O as OntologyRelation, L as AggregateExpr, P as FieldRef, T as ComparisonOp, U as AggregateComparisonPredicate } from './types-CmAT-Z47.js';
5
+ export { W as AdoptedTransaction, B as BackendCapabilities, X as CommitSchemaVersionExpected, Y as CommitSchemaVersionParams, Z as DEFAULT_SQL_SCHEMA, _ as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, $ as FulltextBatchRow, a0 as FulltextCapabilities, a1 as FulltextQueryMode, a2 as FulltextSearchParams, a3 as FulltextSearchResult, F as FulltextStrategy, a4 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a5 as JsonPointerFor, a6 as JsonPointerInput, a7 as JsonPointerSegment, a8 as JsonPointerSegments, a9 as JsonPointerSegmentsFor, aa as MAX_JSON_POINTER_DEPTH, ab as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ac as OrderSpec, ad as ParameterRef, ae as ResolveJsonPointer, af as ResolveJsonPointerSegments, H as SchemaVersionRow, ag as SetActiveVersionParams, ah as SortDirection, p as SqlDialect, ai as SqlSchema, aj as SqlTableNames, ak as StrategyTableContribution, al as TableContribution, am as TransactionBackend, an as TraversalExpansion, ao as UpsertFulltextBatchParams, ap as VectorCapabilities, aq as VectorSlot, ar as buildVectorCapabilities, as as createSqlSchema, at as fts5Strategy, au as isMetaEdge, av as joinJsonPointers, aw as jsonPointer, ax as normalizeJsonPointer, ay as parseJsonPointer, az as tsvectorStrategy } from './types-CmAT-Z47.js';
6
+ import { E as EmbeddingMetric, a as EmbeddingIndexType, A as AliasMap, b as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-De0Y33wP.js';
7
+ export { c as AggregateResult, d as AlgorithmCyclePolicy, e as AnyEdge, f as AnyNode, B as BaseTraversalOptions, g as BatchResults, h as BatchableQuery, i as ConstraintNames, j as CreateEdgeInput, k as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, l as DegreeOptions, m as DynamicEdgeAccessor, n as DynamicEdgeCollection, o as DynamicEdgeType, p as DynamicFieldBuilder, q as DynamicNodeAccessor, r as DynamicNodeCollection, s as DynamicNodeType, t as DynamicSelectableEdge, u as DynamicSelectableNode, v as Edge, w as EdgeAccessor, x as EdgeCollection, y as EdgeFindByEndpointsOptions, z as EdgeGetOrCreateByEndpointsOptions, F as EdgeGetOrCreateByEndpointsResult, G as EdgeIntrospection, H as EmbeddingSchema, I as EmbeddingValue, J as ExecutableAggregateQuery, K as ExecutableQuery, L as FieldAccessor, M as FulltextSearchHit, N as FulltextSearchOptions, O as GetOrCreateAction, P as GraphAlgorithms, R as GraphEdgeCollections, U as GraphNodeCollections, V as HookContext, W as HybridFulltextOptions, X as HybridSearchHit, Y as HybridSearchOptions, Z as HybridVectorOptions, _ as IfExistsMode, $ as KindIntrospection, a0 as MaterializeRemovalsEntry, a1 as MaterializeRemovalsOptions, a2 as MaterializeRemovalsResult, a3 as NeighborsOptions, a4 as Node, a5 as NodeAccessor, a6 as NodeAlias, a7 as NodeCollection, a8 as NodeGetOrCreateByConstraintOptions, a9 as NodeGetOrCreateByConstraintResult, aa as NodeIdentifier, ab as NodeRef, ac as OntologyIntrospection, ad as OperationHookContext, ae as PaginateOptions, af as PaginatedResult, ag as PathNode, ah as Predicate, ai as PreparedQuery, aj as PropsAccessor, ak as QueryHookContext, al as QueryOptions, am as ReachableNode, an as ReachableOptions, ao as RebuildFulltextOptions, ap as RebuildFulltextResult, aq as ReclaimedVectorFieldEntry, ar as RecursiveTraversalOptions, as as ReembedFunction, at as ReembedVectorFieldOptions, au as ReembedVectorFieldResult, av as SchemaIntrospection, aw as SearchableMetadata, ax as SearchableOptions, ay as SearchableSchema, az as SelectContext, aA as SelectableEdge, aB as SelectableNode, aC as ShortestPathOptions, aD as ShortestPathResult, S as Store, aE as StoreHooks, aF as StoreOptions, aG as StoreProjection, aH as StoreRef, aI as StoreSearch, aJ as StreamOptions, aK as SubgraphEdgeResult, aL as SubgraphNodeResult, aM as SubgraphOptions, aN as SubgraphResult, aO as SubsetEdge, aP as SubsetNode, aQ as TemporalAlgorithmOptions, aR as TransactionContext, aS as TraversalDirection, aT as TypedEdgeCollection, aU as UnionableQuery, aV as UniqueIntrospection, aW as UpdateEdgeInput, aX as UpdateNodeInput, aY as VectorSearchHit, aZ as VectorSearchOptions, a_ as createStore, a$ as createStoreWithSchema, b0 as createVerifiedStore, b1 as defineSubgraphProject, b2 as embedding, b3 as exists, b4 as fieldRef, b5 as getEmbeddingDimensions, b6 as getSearchableMetadata, b7 as inSubquery, b8 as isEmbeddingSchema, b9 as isParameterRef, ba as isSearchableSchema, bb as notExists, bc as notInSubquery, bd as param, be as searchable } from './store-De0Y33wP.js';
8
+ import { G as GraphDef, K as KindRegistry } from './manager-BUugwCYz.js';
9
+ export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-BUugwCYz.js';
10
+ export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EmbeddingDimensionChangedError, g as EndpointError, h as EndpointNotFoundError, i as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, j as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, k as SchemaMismatchError, l as StaleVersionError, m as StoreNotInitializedError, n as StoreNotInitializedReason, T as TypeGraphError, o as TypeGraphErrorOptions, U as UniquenessError, p as UnsupportedPredicateError, a as ValidationError, q as ValidationErrorDetails, V as ValidationIssue, r as VersionConflictError, s as getErrorSuggestion, t as isConstraintError, u as isSystemError, v as isTypeGraphError, w as isUserRecoverable } from './index-CapHwi1a.js';
11
+ export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-lkawaDor.js';
12
+ export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-CP4qGIHd.js';
13
13
  export { GraphExtensionError, GraphExtensionIssue, GraphExtensionIssueCode, GraphExtensionUnresolvedEndpointError, GraphExtensionValidationError, GraphExtensionVersionUnsupportedError, IncompatibleChange, IncompatibleChangeError, KindCollisionError, KindHasReferentsError, KindReferent, RemoveCompileTimeKindError, defineGraphExtension, validateGraphExtension } from './graph-extension/index.js';
14
14
  import 'drizzle-orm';
15
15
  import 'drizzle-orm/pg-core';
@@ -232,6 +232,111 @@ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
232
232
  */
233
233
  declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
234
234
 
235
+ declare const libsqlVectorStrategy: VectorStrategy;
236
+
237
+ declare const pgvectorStrategy: VectorStrategy;
238
+
239
+ declare const sqliteVecStrategy: VectorStrategy;
240
+
241
+ /**
242
+ * The resolved storage config for one `(nodeKind, fieldPath)` slot that the
243
+ * legacy table did not record. The legacy shared table stored only the
244
+ * vector and its dimension count — not the metric or index type — so a
245
+ * caller that wants migrated fields to match a specific graph's `embedding()`
246
+ * declarations supplies this resolver.
247
+ */
248
+ type LegacyEmbeddingSlotConfig = Readonly<{
249
+ metric: EmbeddingMetric;
250
+ indexType: EmbeddingIndexType;
251
+ }>;
252
+ /**
253
+ * Options for {@link migrateLegacyEmbeddings}.
254
+ */
255
+ type MigrateLegacyEmbeddingsOptions = Readonly<{
256
+ /**
257
+ * The backend to migrate, wired with the destination `VectorStrategy`
258
+ * (i.e. the post-cutover backend). Its `vectorStrategy` owns the per-field
259
+ * storage rows are written into and its `upsertEmbedding` performs the
260
+ * writes.
261
+ */
262
+ backend: GraphBackend;
263
+ /**
264
+ * Restrict the migration to a single graph. When omitted, every graph's
265
+ * rows in the legacy table are migrated (the table is graph-scoped by its
266
+ * `graph_id` column).
267
+ */
268
+ graphId?: string;
269
+ /**
270
+ * Resolves the metric / index type for a `(nodeKind, fieldPath)` slot the
271
+ * legacy table didn't persist. Return `undefined` to fall back to the
272
+ * cosine / hnsw defaults. Supply this (typically reading the graph's
273
+ * `embedding()` declarations) when migrated fields must match a specific
274
+ * metric — e.g. an `l2` field, which scores incorrectly under the cosine
275
+ * default.
276
+ */
277
+ resolveSlotConfig?: (nodeKind: string, fieldPath: string) => LegacyEmbeddingSlotConfig | undefined;
278
+ /** Rows read per round-trip. Defaults to {@link DEFAULT_BATCH_SIZE}. */
279
+ batchSize?: number;
280
+ /**
281
+ * Physical name of the legacy table to drain. Defaults to
282
+ * {@link LEGACY_EMBEDDINGS_TABLE_NAME}. Override only for a non-default
283
+ * deployment that renamed the embeddings table.
284
+ */
285
+ legacyTableName?: string;
286
+ }>;
287
+ /**
288
+ * Summary of a {@link migrateLegacyEmbeddings} run.
289
+ */
290
+ type MigrateLegacyEmbeddingsResult = Readonly<{
291
+ /** Total embedding rows re-inserted into per-field storage. */
292
+ migrated: number;
293
+ /**
294
+ * Per-`(nodeKind, fieldPath)` counts, keyed `"<nodeKind>.<fieldPath>"`
295
+ * (the strategy's logical-slot key form). Empty when the legacy table was
296
+ * absent or held no rows for the requested scope.
297
+ */
298
+ perField: Readonly<Record<string, number>>;
299
+ /**
300
+ * Rows skipped because their vector length didn't match the per-field
301
+ * table's fixed dimension. The legacy shared column allowed mixed
302
+ * dimensions for one `(nodeKind, fieldPath)` (e.g. an unmigrated model
303
+ * change); the first migrated row fixes the typed table's dimension and
304
+ * any differently-sized rows for that slot are skipped rather than aborting
305
+ * the whole migration. Keyed `"<nodeKind>.<fieldPath>"`. Non-empty here
306
+ * means those fields need a deliberate re-embed at a single dimension.
307
+ */
308
+ skippedDimensionMismatch: Readonly<Record<string, number>>;
309
+ /**
310
+ * Rows skipped because their legacy embedding could not be decoded into a
311
+ * finite-number array — a corrupt value (e.g. a pgvector `vector` column
312
+ * permits `NaN`/`Infinity`, which is not valid JSON). Keyed
313
+ * `"<nodeKind>.<fieldPath>"`. Skipping + reporting keeps one bad row from
314
+ * aborting the whole migration; non-empty here means those rows need manual
315
+ * repair.
316
+ */
317
+ skippedDecodeError: Readonly<Record<string, number>>;
318
+ /**
319
+ * Whether the legacy table existed. `false` means the run was a clean
320
+ * no-op (fresh install, or already-dropped table on a re-run).
321
+ */
322
+ legacyTablePresent: boolean;
323
+ }>;
324
+ /**
325
+ * Re-inserts every embedding from the legacy shared
326
+ * `typegraph_node_embeddings` table into the active
327
+ * `backend.vectorStrategy`'s per-`(nodeKind, fieldPath)` storage.
328
+ *
329
+ * One-time, explicitly-run upgrade step for the shared-table → per-field
330
+ * cutover (#157). Idempotent, batched, and a clean no-op when the legacy
331
+ * table is absent. See the module doc comment for the full contract.
332
+ *
333
+ * @throws Error when the backend exposes no `vectorStrategy` /
334
+ * `upsertEmbedding` (nothing to migrate *into*) — a configuration
335
+ * error the caller must fix by wiring the destination strategy
336
+ * before migrating.
337
+ */
338
+ declare function migrateLegacyEmbeddings(options: MigrateLegacyEmbeddingsOptions): Promise<MigrateLegacyEmbeddingsResult>;
339
+
235
340
  /**
236
341
  * Creates a subClassOf ontology relation.
237
342
  */
@@ -446,6 +551,31 @@ declare const core: {
446
551
  readonly implies: typeof implies;
447
552
  };
448
553
 
554
+ /**
555
+ * Transitive closure computation for ontology relationships.
556
+ *
557
+ * Uses Warshall's algorithm for efficient closure computation.
558
+ */
559
+ /**
560
+ * Computes the transitive closure of a set of directed relations.
561
+ *
562
+ * Given relations like [A→B, B→C], computes all transitive paths [A→B, A→C, B→C].
563
+ *
564
+ * @param relations - Array of [from, to] pairs representing direct relationships
565
+ * @returns Map from each 'from' to the set of all reachable 'to' values
566
+ */
567
+ declare function computeTransitiveClosure(relations: readonly (readonly [string, string])[]): ReadonlyMap<string, ReadonlySet<string>>;
568
+ /**
569
+ * Computes the inverse of a transitive closure map.
570
+ *
571
+ * Given A→{B, C}, returns B→{A}, C→{A}.
572
+ */
573
+ declare function invertClosure(closure: ReadonlyMap<string, ReadonlySet<string>>): ReadonlyMap<string, ReadonlySet<string>>;
574
+ /**
575
+ * Checks if there's a path from source to target in the closure.
576
+ */
577
+ declare function isReachable(closure: ReadonlyMap<string, ReadonlySet<string>>, source: string, target: string): boolean;
578
+
449
579
  /**
450
580
  * Recursive CTE Compilation
451
581
  *
@@ -787,4 +917,4 @@ type IdConfig = Readonly<{
787
917
  edgeIdGenerator: IdGenerator;
788
918
  }>;
789
919
 
790
- export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, avg, broader, composeFragments, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, isExternalRefSchema, limitFragment, max, metaEdge, min, narrower, offsetFragment, orderByFragment, partOf, relatedTo, sameAs, subClassOf, sum };
920
+ export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphBackend, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, type LegacyEmbeddingSlotConfig, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, type MigrateLegacyEmbeddingsOptions, type MigrateLegacyEmbeddingsResult, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, VectorStrategy, avg, broader, composeFragments, computeTransitiveClosure, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, invertClosure, isExternalRefSchema, isReachable, libsqlVectorStrategy, limitFragment, max, metaEdge, migrateLegacyEmbeddings, min, narrower, offsetFragment, orderByFragment, partOf, pgvectorStrategy, relatedTo, sameAs, sqliteVecStrategy, subClassOf, sum };