@nicia-ai/typegraph 0.47.0 → 0.49.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 (211) hide show
  1. package/dist/backend/drizzle/indexes.d.cts +1 -1
  2. package/dist/backend/drizzle/indexes.d.ts +1 -1
  3. package/dist/backend/index.cjs +27 -19
  4. package/dist/backend/index.d.cts +37 -55
  5. package/dist/backend/index.d.ts +37 -55
  6. package/dist/backend/index.js +4 -4
  7. package/dist/backend/postgres/index.cjs +7 -7
  8. package/dist/backend/postgres/index.d.cts +21 -7
  9. package/dist/backend/postgres/index.d.ts +21 -7
  10. package/dist/backend/postgres/index.js +6 -6
  11. package/dist/backend/postgres/pglite-store.cjs +17 -17
  12. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  13. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  14. package/dist/backend/postgres/pglite-store.js +14 -14
  15. package/dist/backend/postgres/pglite.cjs +8 -8
  16. package/dist/backend/postgres/pglite.d.cts +3 -3
  17. package/dist/backend/postgres/pglite.d.ts +3 -3
  18. package/dist/backend/postgres/pglite.js +7 -7
  19. package/dist/backend/sqlite/index.cjs +7 -7
  20. package/dist/backend/sqlite/index.d.cts +20 -7
  21. package/dist/backend/sqlite/index.d.ts +20 -7
  22. package/dist/backend/sqlite/index.js +6 -6
  23. package/dist/backend/sqlite/libsql.cjs +8 -8
  24. package/dist/backend/sqlite/libsql.d.cts +3 -3
  25. package/dist/backend/sqlite/libsql.d.ts +3 -3
  26. package/dist/backend/sqlite/libsql.js +6 -6
  27. package/dist/backend/sqlite/local-store.cjs +18 -18
  28. package/dist/backend/sqlite/local-store.d.cts +8 -8
  29. package/dist/backend/sqlite/local-store.d.ts +8 -8
  30. package/dist/backend/sqlite/local-store.js +15 -15
  31. package/dist/backend/sqlite/local.cjs +9 -9
  32. package/dist/backend/sqlite/local.d.cts +3 -3
  33. package/dist/backend/sqlite/local.d.ts +3 -3
  34. package/dist/backend/sqlite/local.js +7 -7
  35. package/dist/{chunk-5FBRVORR.cjs → chunk-2O4PCIZ6.cjs} +8 -7
  36. package/dist/chunk-2O4PCIZ6.cjs.map +1 -0
  37. package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
  38. package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
  39. package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
  40. package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
  41. package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
  42. package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
  43. package/dist/{chunk-U5EDAVOJ.cjs → chunk-3G5W2U2L.cjs} +82 -51
  44. package/dist/chunk-3G5W2U2L.cjs.map +1 -0
  45. package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
  46. package/dist/chunk-3KOY4FH3.cjs.map +1 -0
  47. package/dist/{chunk-UPAJHMW3.cjs → chunk-3QNZ5SAJ.cjs} +55 -58
  48. package/dist/chunk-3QNZ5SAJ.cjs.map +1 -0
  49. package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
  50. package/dist/chunk-5K2BKEBD.js.map +1 -0
  51. package/dist/chunk-5PRKMB24.cjs +124 -0
  52. package/dist/chunk-5PRKMB24.cjs.map +1 -0
  53. package/dist/chunk-6LN7FIVU.js +107 -0
  54. package/dist/chunk-6LN7FIVU.js.map +1 -0
  55. package/dist/{chunk-M35DF33T.js → chunk-7LZJNLA5.js} +29 -16
  56. package/dist/chunk-7LZJNLA5.js.map +1 -0
  57. package/dist/{chunk-I4G3SQPF.cjs → chunk-7UOLHNWC.cjs} +7 -7
  58. package/dist/chunk-7UOLHNWC.cjs.map +1 -0
  59. package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
  60. package/dist/chunk-BRRP76WO.js.map +1 -0
  61. package/dist/{chunk-5FT3TLPK.js → chunk-D4QLTJSM.js} +16 -13
  62. package/dist/chunk-D4QLTJSM.js.map +1 -0
  63. package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
  64. package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
  65. package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
  66. package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
  67. package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
  68. package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
  69. package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
  70. package/dist/chunk-I4GAZH5Z.js.map +1 -0
  71. package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
  72. package/dist/chunk-JB6T4GLL.cjs.map +1 -0
  73. package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
  74. package/dist/chunk-JFRT7S3B.cjs.map +1 -0
  75. package/dist/{chunk-5UMTUOM5.js → chunk-JPD2CTC3.js} +5 -4
  76. package/dist/chunk-JPD2CTC3.js.map +1 -0
  77. package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
  78. package/dist/chunk-KF6K7TGH.js.map +1 -0
  79. package/dist/{chunk-QS3NQZVC.js → chunk-LTXQOEIC.js} +44 -14
  80. package/dist/chunk-LTXQOEIC.js.map +1 -0
  81. package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
  82. package/dist/chunk-NACVVDWB.js.map +1 -0
  83. package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
  84. package/dist/chunk-S5TERQVW.js.map +1 -0
  85. package/dist/chunk-SIT26LAZ.cjs +614 -0
  86. package/dist/chunk-SIT26LAZ.cjs.map +1 -0
  87. package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
  88. package/dist/chunk-SR725PWF.cjs.map +1 -0
  89. package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
  90. package/dist/chunk-TQHGE7UC.cjs.map +1 -0
  91. package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
  92. package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
  93. package/dist/chunk-UGHG7PGX.js +592 -0
  94. package/dist/chunk-UGHG7PGX.js.map +1 -0
  95. package/dist/{chunk-BCQ76AXA.cjs → chunk-UGHQV7MP.cjs} +107 -94
  96. package/dist/chunk-UGHQV7MP.cjs.map +1 -0
  97. package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
  98. package/dist/chunk-UMGZDVOA.cjs.map +1 -0
  99. package/dist/{chunk-6FWSNSRE.js → chunk-WIC7DRXW.js} +4 -4
  100. package/dist/chunk-WIC7DRXW.js.map +1 -0
  101. package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
  102. package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
  103. package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
  104. package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
  105. package/dist/{chunk-EMIB2RXD.cjs → chunk-YYUHLYM2.cjs} +99 -96
  106. package/dist/chunk-YYUHLYM2.cjs.map +1 -0
  107. package/dist/{chunk-KH7XW7VV.js → chunk-Z2JCLZFJ.js} +25 -28
  108. package/dist/chunk-Z2JCLZFJ.js.map +1 -0
  109. package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
  110. package/dist/chunk-ZFMCDJGB.js.map +1 -0
  111. package/dist/core/index.cjs +6 -6
  112. package/dist/core/index.d.cts +4 -4
  113. package/dist/core/index.d.ts +4 -4
  114. package/dist/core/index.js +2 -2
  115. package/dist/ddl-BL1NZLMY.d.cts +78 -0
  116. package/dist/ddl-D_oW-EVO.d.ts +78 -0
  117. package/dist/graph-extension/index.d.cts +4 -4
  118. package/dist/graph-extension/index.d.ts +4 -4
  119. package/dist/graph-merge/index.cjs +357 -191
  120. package/dist/graph-merge/index.cjs.map +1 -1
  121. package/dist/graph-merge/index.d.cts +68 -15
  122. package/dist/graph-merge/index.d.ts +68 -15
  123. package/dist/graph-merge/index.js +197 -32
  124. package/dist/graph-merge/index.js.map +1 -1
  125. package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
  126. package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
  127. package/dist/index.cjs +90 -86
  128. package/dist/index.cjs.map +1 -1
  129. package/dist/index.d.cts +12 -12
  130. package/dist/index.d.ts +12 -12
  131. package/dist/index.js +13 -13
  132. package/dist/index.js.map +1 -1
  133. package/dist/indexes/index.d.cts +4 -4
  134. package/dist/indexes/index.d.ts +4 -4
  135. package/dist/ingestion-import-target-XPxZYw89.d.cts +17 -0
  136. package/dist/ingestion-import-target-dNeL7iAv.d.ts +17 -0
  137. package/dist/interchange/index.cjs +38 -38
  138. package/dist/interchange/index.d.cts +15 -12
  139. package/dist/interchange/index.d.ts +15 -12
  140. package/dist/interchange/index.js +10 -10
  141. package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
  142. package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
  143. package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
  144. package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
  145. package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
  146. package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
  147. package/dist/profiler/index.d.cts +9 -9
  148. package/dist/profiler/index.d.ts +9 -9
  149. package/dist/provenance/index.cjs +25 -26
  150. package/dist/provenance/index.cjs.map +1 -1
  151. package/dist/provenance/index.d.cts +7 -7
  152. package/dist/provenance/index.d.ts +7 -7
  153. package/dist/provenance/index.js +9 -10
  154. package/dist/provenance/index.js.map +1 -1
  155. package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
  156. package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
  157. package/dist/schema/index.cjs +35 -35
  158. package/dist/schema/index.d.cts +6 -6
  159. package/dist/schema/index.d.ts +6 -6
  160. package/dist/schema/index.js +8 -8
  161. package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
  162. package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
  163. package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
  164. package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
  165. package/dist/{store-5j-w5onJ.d.ts → store-DRrFCx5x.d.ts} +122 -27
  166. package/dist/{store-CFedKGU5.d.cts → store-bphCSo7z.d.cts} +122 -27
  167. package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
  168. package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
  169. package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
  170. package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
  171. package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
  172. package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
  173. package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
  174. package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
  175. package/package.json +2 -3
  176. package/dist/chunk-3HGRTCDU.cjs +0 -269
  177. package/dist/chunk-3HGRTCDU.cjs.map +0 -1
  178. package/dist/chunk-425IZOQ5.cjs.map +0 -1
  179. package/dist/chunk-5FBRVORR.cjs.map +0 -1
  180. package/dist/chunk-5FT3TLPK.js.map +0 -1
  181. package/dist/chunk-5UMTUOM5.js.map +0 -1
  182. package/dist/chunk-6FWSNSRE.js.map +0 -1
  183. package/dist/chunk-AVGUJWVX.js.map +0 -1
  184. package/dist/chunk-BCQ76AXA.cjs.map +0 -1
  185. package/dist/chunk-BR7SHKGM.cjs.map +0 -1
  186. package/dist/chunk-DJZTXBWY.js.map +0 -1
  187. package/dist/chunk-EMIB2RXD.cjs.map +0 -1
  188. package/dist/chunk-FNOMT74T.js.map +0 -1
  189. package/dist/chunk-I4G3SQPF.cjs.map +0 -1
  190. package/dist/chunk-JR6SX5RH.cjs +0 -268
  191. package/dist/chunk-JR6SX5RH.cjs.map +0 -1
  192. package/dist/chunk-KABFHAL7.cjs.map +0 -1
  193. package/dist/chunk-KH7XW7VV.js.map +0 -1
  194. package/dist/chunk-M35DF33T.js.map +0 -1
  195. package/dist/chunk-MFZR4QKM.cjs.map +0 -1
  196. package/dist/chunk-MX4DHSQP.cjs.map +0 -1
  197. package/dist/chunk-NAZ2RA4L.js +0 -254
  198. package/dist/chunk-NAZ2RA4L.js.map +0 -1
  199. package/dist/chunk-NG2RB5WL.js.map +0 -1
  200. package/dist/chunk-NNQ6A3RM.js.map +0 -1
  201. package/dist/chunk-OIFSOPSR.cjs.map +0 -1
  202. package/dist/chunk-QS3NQZVC.js.map +0 -1
  203. package/dist/chunk-SE6EGQSD.js.map +0 -1
  204. package/dist/chunk-SHSSRCFR.js +0 -246
  205. package/dist/chunk-SHSSRCFR.js.map +0 -1
  206. package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
  207. package/dist/chunk-UPAJHMW3.cjs.map +0 -1
  208. package/dist/chunk-WGX7JH7E.cjs.map +0 -1
  209. package/dist/chunk-ZHNXLS3C.js.map +0 -1
  210. package/dist/ddl-CprnMXJ-.d.ts +0 -38
  211. package/dist/ddl-DJA7Lci5.d.cts +0 -38
@@ -1,18 +1,18 @@
1
- import { createEdgeRowMapper, createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, POSTGRES_ROW_MAPPER_CONFIG, normalizeRowTimestamp, normalizeRequiredRowTimestamp } from './chunk-LEWHMOUY.js';
2
- import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDeleteBatch, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeUpsertUpdate, executeNodeUpdateWhere, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, assertValidityEndMutation, assertClearValidToSupported, edgeWriteNeedsConstraintFence, withAlreadyExistsTranslation, rowToNodeMeta, rowToEdgeMeta, validityEndAfterMutation, checkCardinalityConstraint } from './chunk-SE6EGQSD.js';
3
- import { storeRuntime, STORE_RUNTIME, TRANSACTION_RUNTIME, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, getEmbeddingFields, computeFulltextContent } from './chunk-FNOMT74T.js';
4
- import { loadAndMergeGraphExtensionDocument, serializeSchema, buildKindRegistry, ensureIdentitySchemaStorage, loadAndVerifyGraph, identitySchemaCommitPreflight, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, commitNewSchemaVersionWithPreflight, planRemovals, stripGraphExtension, applyDeprecatedKinds, identityKindCascadeNeeded, ensureSchema, loadActiveSchemaWithBootstrap, parseSerializedSchema, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-XYBQI6LE.js';
1
+ import { createEdgeRowMapper, createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, POSTGRES_ROW_MAPPER_CONFIG, normalizeRowTimestamp, normalizeRequiredRowTimestamp } from './chunk-YIURNGXI.js';
2
+ import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDeleteBatch, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeUpsertUpdate, executeNodeUpdateWhere, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, assertValidityEndMutation, assertClearValidToSupported, edgeWriteNeedsConstraintFence, withAlreadyExistsTranslation, rowToNodeMeta, rowToEdgeMeta, validityEndAfterMutation, checkCardinalityConstraint } from './chunk-KF6K7TGH.js';
3
+ import { storeRuntime, STORE_RUNTIME, applyResolvedNodeUniqueness, createUniquenessContext, TRANSACTION_RUNTIME, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, getEmbeddingFields, computeFulltextContent } from './chunk-I4GAZH5Z.js';
4
+ import { loadAndMergeGraphExtensionDocument, serializeSchema, buildKindRegistry, ensureIdentitySchemaStorage, loadAndVerifyGraph, identitySchemaCommitPreflight, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, commitNewSchemaVersionWithPreflight, planRemovals, stripGraphExtension, applyDeprecatedKinds, identityKindCascadeNeeded, ensureSchema, loadActiveSchemaWithBootstrap, parseSerializedSchema, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-2TYSSBU5.js';
5
5
  import { getTypeName } from './chunk-SHFBB23Q.js';
6
- import { rebuildIdentityClosureForContext, loadCurrentStructuralClasses, loadAssertionsByIds, toTransferAssertion, liveNodeKindsSharingIds, createIdentityFacade, createIdentityReadFacade, runInWriteTransaction, validateIdentityForContext, removeIdentityKindsForContext, readIdentityAssertionsForInterchange, readIdentityAssertionPageAtTarget, lockIdentityGraph, foldIdentityForCreatedNodes, importIdentityAssertionsIntoTarget, assertAffectedIdentityClassesConsistent, applyIdentityChangesForContext, withWriteTransactionSession, lockSchemaVersionForStoreWrite, refKey, requireNodeValidityEndCompatible, detachIdentityForNode, validateEdgeProps, runHookedWriteOperation, encodeTupleKey } from './chunk-NNQ6A3RM.js';
7
- import { isParameterRef, resolveParameterValueType, fieldRef, compareStrings, buildFieldBuilderForTypeInfo, stringField, createFulltextAccessor, CURRENT_READ_INSTANT_PLACEHOLDER, withPinnedReadInstant, compareCodePoints, assertRevisionTrackableBackend, createRecordedBackend, createRecordedTransactionScope, readRecordedClock, ensureRevisionOrigin, withRecordedFlushObserver, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, lockRecordedGraphWrite, createGraphBackendProjection, generateId, assertCurrentRecordedSchema, baseField, objectField, arrayField, dateField, numberField, advanceRevisionClock, runInsertBatch, edgeInsertDispatch, runInsertBatchReturning, projectBackendMembers, sqlValueList, getNodeRowsByIds, getEdgeRowsByIds, compileKindFilter, runInsertNoReturn, currentReadInstant, compileTemporalFilter, closeRecordedHardDeletedKind, buildPredicateIndex, historicalIdentityPeerClassQuery, IDENTITY_PEER_CLASS_COLUMNS, compileFieldValue, recordedBindParamBudget, extractVectorSimilarityPredicates, extractFulltextMatchPredicates, currentReadInstantFor, extractTemporalOptions, compilePredicateExpression, getPredicatesForAlias, getFieldPointer, getNodeKindsForAlias, getHybridTargetAlias, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess, compilePredicateClauses } from './chunk-AVGUJWVX.js';
6
+ import { rebuildIdentityClosureForContext, loadCurrentStructuralClasses, loadAssertionsByIds, toTransferAssertion, liveNodeKindsSharingIds, createIdentityFacade, createIdentityReadFacade, runInWriteTransaction, validateIdentityForContext, removeIdentityKindsForContext, readIdentityAssertionsForInterchange, readIdentityAssertionPageAtTarget, lockIdentityGraph, foldIdentityForCreatedNodes, importIdentityAssertionsIntoTarget, assertAffectedIdentityClassesConsistent, applyIdentityChangesForContext, withWriteTransactionSession, lockSchemaVersionForStoreWrite, refKey, requireNodeValidityEndCompatible, detachIdentityForNode, validateEdgeProps, runHookedWriteOperation } from './chunk-ZFMCDJGB.js';
7
+ import { isParameterRef, resolveParameterValueType, fieldRef, compareStrings, buildFieldBuilderForTypeInfo, stringField, createFulltextAccessor, CURRENT_READ_INSTANT_PLACEHOLDER, withPinnedReadInstant, compareCodePoints, assertRevisionTrackableBackend, createRecordedBackend, createRecordedTransactionScope, readRecordedClock, ensureRevisionOrigin, withRecordedFlushObserver, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, lockRecordedGraphWrite, generateId, assertCurrentRecordedSchema, baseField, objectField, arrayField, dateField, numberField, advanceRevisionClock, runInsertBatch, edgeInsertDispatch, runInsertBatchReturning, sqlValueList, getNodeRowsByIds, getEdgeRowsByIds, compileKindFilter, encodeTupleKey, runInsertNoReturn, currentReadInstant, compileTemporalFilter, closeRecordedHardDeletedKind, buildPredicateIndex, historicalIdentityPeerClassQuery, IDENTITY_PEER_CLASS_COLUMNS, compileFieldValue, recordedBindParamBudget, extractVectorSimilarityPredicates, extractFulltextMatchPredicates, currentReadInstantFor, extractTemporalOptions, compilePredicateExpression, getPredicatesForAlias, getFieldPointer, getNodeKindsForAlias, getHybridTargetAlias, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess, compilePredicateClauses } from './chunk-S5TERQVW.js';
8
8
  import { canonicalEqual, sortedReplacer } from './chunk-JBQQ7THH.js';
9
- import { withRecordedRelationsPrecondition, chunk, postgresReadWriteRefusedSqlState, isMissingTableError, groupBy, postgresTemporaryTableUnavailableSqlState, isPostgresConcurrentDdlRaceError } from './chunk-NAZ2RA4L.js';
9
+ import { withRecordedRelationsPrecondition, projectGraphBackend, deriveBackend, projectBackend, chunk, postgresReadWriteRefusedSqlState, isMissingTableError, groupBy, postgresTemporaryTableUnavailableSqlState, isPostgresConcurrentDdlRaceError } from './chunk-UGHG7PGX.js';
10
10
  import { createSqlSchema, requireSqlSchema, DEFAULT_SQL_SCHEMA, recordedReadSchemaFor, requireExternalRecordedReadSource, createRecordedReadBinding, vectorSlotKey, recordedReadSqlSchema, requireRecordedReadBinding, ALIAS_CTE_PREFIX, EMBEDDINGS_CTE_ALIAS, FULLTEXT_CTE_ALIAS, HYBRID_CANDIDATES_CTE_ALIAS } from './chunk-NVY5CJFP.js';
11
- import { runOptionallyInTransaction, createTransactionReadBackend, createBackendOverlay, rowPropsToObject, INTERNAL_TEMPORARY_WRITES } from './chunk-SHSSRCFR.js';
11
+ import { runOptionallyInTransaction, createTransactionReadBackend, rowPropsToObject, INTERNAL_TEMPORARY_WRITES } from './chunk-6LN7FIVU.js';
12
12
  import { isKnownKind } from './chunk-HEV35TGT.js';
13
13
  import { validateEdgeEndpoints } from './chunk-GLHXM7C4.js';
14
- import { resolveReadCoordinate, withRecordedCoordinate, describeCoordinate, coordinateContext, recordedInstantWallTime, asRecordedInstant, assertValidRecordedInstant, optionalRecordedInstantParts } from './chunk-XY5OMOJD.js';
15
- import { nowIso, validateOptionalCanonicalIsoDate, assertOrderedValidityWindow, preservesImmutableLowerBound, assertWritableValidityWindow, isCanonicalIsoDate, statedBoundMatchesStored } from './chunk-NG2RB5WL.js';
14
+ import { resolveReadCoordinate, withRecordedCoordinate, describeCoordinate, coordinateContext, recordedInstantWallTime, asRecordedInstant, assertValidRecordedInstant, optionalRecordedInstantParts } from './chunk-DZAICA5J.js';
15
+ import { nowIso, validityWindowContainsInstant, validateOptionalCanonicalIsoDate, assertOrderedValidityWindow, preservesImmutableLowerBound, assertWritableValidityWindow, isCanonicalIsoDate, statedBoundMatchesStored } from './chunk-5K2BKEBD.js';
16
16
  import { generateIndexDDL } from './chunk-KKBDXCLQ.js';
17
17
  import { SYSTEM_INDEX_DECLARATIONS, resolveSystemIndexTableName, systemIndexName, resolveSystemIndexNames, generateSystemIndexDDL } from './chunk-SDBBMD4N.js';
18
18
  import { NODE_META_KEYS, EDGE_META_KEYS } from './chunk-P6YLZTRE.js';
@@ -15224,9 +15224,7 @@ var HISTORY_STORE_BACKEND_KEYS = [
15224
15224
  "verifyContributions"
15225
15225
  ];
15226
15226
  function createHistoryStoreBackendProjection(backend) {
15227
- return Object.freeze(
15228
- projectBackendMembers(backend, HISTORY_STORE_BACKEND_KEYS)
15229
- );
15227
+ return Object.freeze(projectBackend(backend, HISTORY_STORE_BACKEND_KEYS));
15230
15228
  }
15231
15229
 
15232
15230
  // src/store/introspect.ts
@@ -16575,7 +16573,7 @@ function createEdgeBatchValidationBackend(backend) {
16575
16573
  pendingUniquePairs.add(uniqueCacheKey);
16576
16574
  }
16577
16575
  }
16578
- const validationBackend = createBackendOverlay(backend, {
16576
+ const validationBackend = deriveBackend(backend, {
16579
16577
  getNode: getNodeCached,
16580
16578
  countEdgesFrom: countEdgesFromCached,
16581
16579
  edgeExistsBetween: edgeExistsBetweenCached
@@ -17788,8 +17786,8 @@ function withRelationsPrecondition(backend, promise, surface) {
17788
17786
  );
17789
17787
  }
17790
17788
  function createRecordedReadBackend(backend, surface) {
17791
- const projectedBackend = createGraphBackendProjection(backend);
17792
- return createBackendOverlay(projectedBackend, {
17789
+ const projectedBackend = projectGraphBackend(backend);
17790
+ return deriveBackend(projectedBackend, {
17793
17791
  execute: (query) => withRelationsPrecondition(backend, backend.execute(query), surface),
17794
17792
  ...backend.executeRaw === void 0 ? {} : {
17795
17793
  executeRaw: (sqlText, params) => withRelationsPrecondition(
@@ -18495,6 +18493,10 @@ var StoreImplementation = class _StoreImplementation {
18495
18493
  this.#schemaMetadata = schemaMetadata ?? UNKNOWN_SCHEMA_METADATA;
18496
18494
  this[STORE_RUNTIME] = {
18497
18495
  backend: this.#backend,
18496
+ // The query path's own construction, not a second spelling of it: a
18497
+ // caller that could only rebuild this object could not observe the one
18498
+ // the queries actually run on.
18499
+ queryBackend: (target) => this.#createHookedQueryBackend(target ?? this[STORE_RUNTIME].backend),
18498
18500
  sealedQuery: (coordinate) => this.sealedQuery(coordinate),
18499
18501
  recordedNodeGetById: (kind, id, coordinate) => this.recordedNodeGetById(kind, id, coordinate),
18500
18502
  recordedNodeGetByIds: (kind, ids, coordinate) => this.recordedNodeGetByIds(kind, ids, coordinate),
@@ -18507,6 +18509,47 @@ var StoreImplementation = class _StoreImplementation {
18507
18509
  identityAtCoordinate: (coordinate) => this.identityAtCoordinate(coordinate),
18508
18510
  rebuildIdentityClosure: () => this.rebuildIdentityClosure(),
18509
18511
  validateIdentity: () => this.validateIdentity(),
18512
+ applyResolvedNodeUniqueness: async (target, writes, apply) => {
18513
+ const upserts = writes.upserts.map((upsert) => {
18514
+ if (!hasOwnKey(this.#graph.nodes, upsert.kind)) {
18515
+ throw new KindNotFoundError(upsert.kind, "node", {
18516
+ graphId: this.graphId
18517
+ });
18518
+ }
18519
+ const registration = this.#graph.nodes[upsert.kind];
18520
+ if (registration === void 0) {
18521
+ throw new KindNotFoundError(upsert.kind, "node", {
18522
+ graphId: this.graphId
18523
+ });
18524
+ }
18525
+ return {
18526
+ ...upsert,
18527
+ constraints: registration.unique ?? []
18528
+ };
18529
+ });
18530
+ const constrainedKinds = new Set(
18531
+ Object.entries(this.#graph.nodes).filter(
18532
+ ([, registration]) => (registration.unique ?? []).length > 0
18533
+ ).map(([kind]) => kind)
18534
+ );
18535
+ const releases = writes.releases.filter((release) => {
18536
+ if (!Object.hasOwn(this.#graph.nodes, release.kind)) {
18537
+ throw new KindNotFoundError(release.kind, "node", {
18538
+ graphId: this.graphId
18539
+ });
18540
+ }
18541
+ return constrainedKinds.has(release.kind);
18542
+ });
18543
+ if (upserts.every((upsert) => upsert.constraints.length === 0) && releases.length === 0) {
18544
+ return apply();
18545
+ }
18546
+ return applyResolvedNodeUniqueness(
18547
+ createUniquenessContext(this.graphId, this.#registry, target),
18548
+ upserts,
18549
+ releases,
18550
+ apply
18551
+ );
18552
+ },
18510
18553
  liveNodesSharingIds: async (ids, target) => {
18511
18554
  const backend2 = target ?? this.#baseBackend;
18512
18555
  const liveKindsById = await liveNodeKindsSharingIds(
@@ -21342,7 +21385,7 @@ var StoreImplementation = class _StoreImplementation {
21342
21385
  * query builder submits to the backend. A selective-projection retry
21343
21386
  * therefore emits two independent start/end pairs with their actual SQL.
21344
21387
  *
21345
- * Decoration goes through {@link createBackendOverlay}, which carries the
21388
+ * Decoration goes through {@link deriveBackend}, which carries the
21346
21389
  * projection's serialized-resource ownership: the hooked backend still
21347
21390
  * executes on the source's connection, so it must answer the same "shares one
21348
21391
  * serialized connection" question as its source.
@@ -21353,8 +21396,8 @@ var StoreImplementation = class _StoreImplementation {
21353
21396
  }
21354
21397
  const executeRaw = backend.executeRaw;
21355
21398
  const compileSql = backend.compileSql;
21356
- const projected = createGraphBackendProjection(backend);
21357
- return createBackendOverlay(projected, {
21399
+ const projected = projectGraphBackend(backend);
21400
+ return deriveBackend(projected, {
21358
21401
  execute: (query) => {
21359
21402
  const compiled = compileSql === void 0 ? renderSql(query, backend.dialect) : compileSql(query);
21360
21403
  return this.#withQueryHooks(
@@ -21495,12 +21538,12 @@ var StoreImplementation = class _StoreImplementation {
21495
21538
  switch (temporalMode) {
21496
21539
  case "current":
21497
21540
  case "asOf": {
21498
- if (row.deleted_at) return false;
21499
- if (asOf !== void 0 && row.valid_from && asOf < row.valid_from)
21500
- return false;
21501
- if (asOf !== void 0 && row.valid_to && asOf >= row.valid_to)
21502
- return false;
21503
- return true;
21541
+ if (row.deleted_at || asOf === void 0) return false;
21542
+ return validityWindowContainsInstant(
21543
+ row.valid_from,
21544
+ row.valid_to,
21545
+ asOf
21546
+ );
21504
21547
  }
21505
21548
  case "includeEnded": {
21506
21549
  return !row.deleted_at;
@@ -21535,9 +21578,7 @@ var AdapterStoreImplementation = class _AdapterStoreImplementation extends Store
21535
21578
  backend;
21536
21579
  constructor(graph, backend, options, schemaMetadata) {
21537
21580
  super(graph, backend, options, schemaMetadata, backend);
21538
- this.backend = options?.history === true ? createHistoryStoreBackendProjection(this[STORE_RUNTIME].backend) : Object.freeze(
21539
- createGraphBackendProjection(this[STORE_RUNTIME].backend)
21540
- );
21581
+ this.backend = options?.history === true ? createHistoryStoreBackendProjection(this[STORE_RUNTIME].backend) : Object.freeze(projectGraphBackend(this[STORE_RUNTIME].backend));
21541
21582
  }
21542
21583
  /**
21543
21584
  * Rebind this store's already-reconciled schema onto a fresh backend/
@@ -21947,5 +21988,5 @@ async function createVerifiedAdapterStore(graph, backend, options) {
21947
21988
  }
21948
21989
 
21949
21990
  export { ExecutableAggregateQuery, ExecutableQuery, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, PreparedQuery, QueryBuilder, RecordedStoreView, StoreSearch, StoreView, UnionableQuery, avg, composeFragments, count, countDistinct, countDistinctEdges, countEdges, createAdapterStore, createAdapterStoreWithSchema, createFragment, createQueryBuilder, createStore, createStoreWithSchema, createVerifiedAdapterStore, createVerifiedStore, defineSubgraphProject, field, having, havingEq, havingGt, havingGte, havingLt, havingLte, limitFragment, max, min, offsetFragment, orderByFragment, sum };
21950
- //# sourceMappingURL=chunk-DJZTXBWY.js.map
21951
- //# sourceMappingURL=chunk-DJZTXBWY.js.map
21991
+ //# sourceMappingURL=chunk-BRRP76WO.js.map
21992
+ //# sourceMappingURL=chunk-BRRP76WO.js.map