@nicia-ai/typegraph 0.50.0 → 0.51.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 (326) hide show
  1. package/README.md +12 -0
  2. package/dist/backend/drizzle/indexes.cjs +10 -8
  3. package/dist/backend/drizzle/indexes.d.cts +1 -1
  4. package/dist/backend/drizzle/indexes.d.ts +1 -1
  5. package/dist/backend/drizzle/indexes.js +6 -4
  6. package/dist/backend/index.cjs +183 -50
  7. package/dist/backend/index.d.cts +90 -4
  8. package/dist/backend/index.d.ts +90 -4
  9. package/dist/backend/index.js +6 -9
  10. package/dist/backend/postgres/index.cjs +30 -28
  11. package/dist/backend/postgres/index.d.cts +7 -7
  12. package/dist/backend/postgres/index.d.ts +7 -7
  13. package/dist/backend/postgres/index.js +16 -14
  14. package/dist/backend/postgres/pglite-store.cjs +6 -62
  15. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  16. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  17. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  18. package/dist/backend/postgres/pglite-store.js +6 -62
  19. package/dist/backend/postgres/pglite-store.js.map +1 -1
  20. package/dist/backend/postgres/pglite.cjs +18 -16
  21. package/dist/backend/postgres/pglite.d.cts +3 -3
  22. package/dist/backend/postgres/pglite.d.ts +3 -3
  23. package/dist/backend/postgres/pglite.js +17 -15
  24. package/dist/backend/sqlite/index.cjs +27 -25
  25. package/dist/backend/sqlite/index.d.cts +7 -7
  26. package/dist/backend/sqlite/index.d.ts +7 -7
  27. package/dist/backend/sqlite/index.js +14 -12
  28. package/dist/backend/sqlite/libsql.cjs +21 -19
  29. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  30. package/dist/backend/sqlite/libsql.d.cts +3 -3
  31. package/dist/backend/sqlite/libsql.d.ts +3 -3
  32. package/dist/backend/sqlite/libsql.js +16 -14
  33. package/dist/backend/sqlite/libsql.js.map +1 -1
  34. package/dist/backend/sqlite/local-store.cjs +8 -64
  35. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  36. package/dist/backend/sqlite/local-store.d.cts +8 -8
  37. package/dist/backend/sqlite/local-store.d.ts +8 -8
  38. package/dist/backend/sqlite/local-store.js +7 -64
  39. package/dist/backend/sqlite/local-store.js.map +1 -1
  40. package/dist/backend/sqlite/local.cjs +22 -19
  41. package/dist/backend/sqlite/local.d.cts +3 -3
  42. package/dist/backend/sqlite/local.d.ts +3 -3
  43. package/dist/backend/sqlite/local.js +18 -15
  44. package/dist/{chunk-TUVD4DFR.cjs → chunk-2CVDZCXH.cjs} +122 -51
  45. package/dist/chunk-2CVDZCXH.cjs.map +1 -0
  46. package/dist/{chunk-I5C6OTKR.js → chunk-2DWTBNSH.js} +3 -3
  47. package/dist/{chunk-I5C6OTKR.js.map → chunk-2DWTBNSH.js.map} +1 -1
  48. package/dist/{chunk-C76WFIVZ.cjs → chunk-2KCTP3U2.cjs} +180 -127
  49. package/dist/chunk-2KCTP3U2.cjs.map +1 -0
  50. package/dist/{chunk-BYBDM423.cjs → chunk-322TBTOQ.cjs} +48 -48
  51. package/dist/{chunk-BYBDM423.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
  52. package/dist/chunk-36SX6QXP.cjs +186 -0
  53. package/dist/chunk-36SX6QXP.cjs.map +1 -0
  54. package/dist/{chunk-H3XP6BAV.js → chunk-36VYWVQU.js} +3 -3
  55. package/dist/{chunk-H3XP6BAV.js.map → chunk-36VYWVQU.js.map} +1 -1
  56. package/dist/{chunk-VTJVMP4I.js → chunk-4DKY6RIU.js} +102 -31
  57. package/dist/chunk-4DKY6RIU.js.map +1 -0
  58. package/dist/chunk-4QKOZYMV.js +9 -0
  59. package/dist/chunk-4QKOZYMV.js.map +1 -0
  60. package/dist/{chunk-U3Z7XKAG.js → chunk-57JM6NW3.js} +8 -18
  61. package/dist/chunk-57JM6NW3.js.map +1 -0
  62. package/dist/{chunk-XMY2SXOH.cjs → chunk-5WWEYV4H.cjs} +2208 -579
  63. package/dist/chunk-5WWEYV4H.cjs.map +1 -0
  64. package/dist/{chunk-WQBAQZHR.js → chunk-6NLYIMJO.js} +4 -4
  65. package/dist/{chunk-WQBAQZHR.js.map → chunk-6NLYIMJO.js.map} +1 -1
  66. package/dist/{chunk-G2TLHH6T.cjs → chunk-7B7I7YAW.cjs} +6 -6
  67. package/dist/{chunk-G2TLHH6T.cjs.map → chunk-7B7I7YAW.cjs.map} +1 -1
  68. package/dist/{chunk-EDLKIQRI.js → chunk-7G5IYROL.js} +6 -548
  69. package/dist/chunk-7G5IYROL.js.map +1 -0
  70. package/dist/{chunk-46UGOVRW.js → chunk-7QFRK6PU.js} +3 -7
  71. package/dist/chunk-7QFRK6PU.js.map +1 -0
  72. package/dist/chunk-A4C4NJ5U.cjs +12 -0
  73. package/dist/chunk-A4C4NJ5U.cjs.map +1 -0
  74. package/dist/{chunk-TYGGUWMS.cjs → chunk-B3MN7EJR.cjs} +177 -137
  75. package/dist/chunk-B3MN7EJR.cjs.map +1 -0
  76. package/dist/{chunk-K6VKTBST.cjs → chunk-BZ5MVITP.cjs} +4 -4
  77. package/dist/{chunk-K6VKTBST.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
  78. package/dist/{chunk-R7MRFE5P.js → chunk-CAI6SMP6.js} +3 -3
  79. package/dist/{chunk-R7MRFE5P.js.map → chunk-CAI6SMP6.js.map} +1 -1
  80. package/dist/{chunk-ZAQUKCUC.js → chunk-CBOD7TXH.js} +5 -5
  81. package/dist/{chunk-ZAQUKCUC.js.map → chunk-CBOD7TXH.js.map} +1 -1
  82. package/dist/{chunk-LLVOQOWE.cjs → chunk-CRZ56SZU.cjs} +6 -5
  83. package/dist/chunk-CRZ56SZU.cjs.map +1 -0
  84. package/dist/{chunk-ON47CBE4.cjs → chunk-D3GWARN7.cjs} +47 -47
  85. package/dist/{chunk-ON47CBE4.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
  86. package/dist/{chunk-W5SOCUBL.js → chunk-D3OUDFU7.js} +5 -5
  87. package/dist/{chunk-W5SOCUBL.js.map → chunk-D3OUDFU7.js.map} +1 -1
  88. package/dist/chunk-EKG2UXNX.cjs +23 -0
  89. package/dist/chunk-EKG2UXNX.cjs.map +1 -0
  90. package/dist/{chunk-7PRMDZIA.cjs → chunk-FMMW3KX7.cjs} +21 -55
  91. package/dist/chunk-FMMW3KX7.cjs.map +1 -0
  92. package/dist/chunk-H2VWDQWC.cjs +571 -0
  93. package/dist/chunk-H2VWDQWC.cjs.map +1 -0
  94. package/dist/chunk-H4FY6OZK.js +13 -0
  95. package/dist/chunk-H4FY6OZK.js.map +1 -0
  96. package/dist/{chunk-OJHD3LXJ.cjs → chunk-H5IJSROF.cjs} +2 -8
  97. package/dist/chunk-H5IJSROF.cjs.map +1 -0
  98. package/dist/{chunk-U5EL6JUV.js → chunk-I5IOSA27.js} +101 -103
  99. package/dist/chunk-I5IOSA27.js.map +1 -0
  100. package/dist/{chunk-SHC7BCG5.cjs → chunk-I7YAY2VQ.cjs} +7 -7
  101. package/dist/{chunk-SHC7BCG5.cjs.map → chunk-I7YAY2VQ.cjs.map} +1 -1
  102. package/dist/chunk-IRCWIA3R.js +20 -0
  103. package/dist/chunk-IRCWIA3R.js.map +1 -0
  104. package/dist/chunk-IVQBLXBK.cjs +55 -0
  105. package/dist/chunk-IVQBLXBK.cjs.map +1 -0
  106. package/dist/{chunk-5PP4KRPV.js → chunk-IZD4HTCP.js} +5 -5
  107. package/dist/{chunk-5PP4KRPV.js.map → chunk-IZD4HTCP.js.map} +1 -1
  108. package/dist/{chunk-7CCMCMJO.cjs → chunk-JHRUZ73O.cjs} +75 -66
  109. package/dist/chunk-JHRUZ73O.cjs.map +1 -0
  110. package/dist/{chunk-RDP6ZRSM.cjs → chunk-JQKMEKKW.cjs} +261 -204
  111. package/dist/chunk-JQKMEKKW.cjs.map +1 -0
  112. package/dist/chunk-JVA3KDEA.cjs +691 -0
  113. package/dist/chunk-JVA3KDEA.cjs.map +1 -0
  114. package/dist/{chunk-JG5XIJDY.js → chunk-K67P5DLL.js} +62 -22
  115. package/dist/chunk-K67P5DLL.js.map +1 -0
  116. package/dist/{chunk-CS6JTQQ2.cjs → chunk-KACEYDYV.cjs} +94 -62
  117. package/dist/chunk-KACEYDYV.cjs.map +1 -0
  118. package/dist/{chunk-5OWHU7Z7.cjs → chunk-L6EVYIID.cjs} +248 -210
  119. package/dist/chunk-L6EVYIID.cjs.map +1 -0
  120. package/dist/{chunk-7OWE7WD6.js → chunk-LI4K2KEJ.js} +4 -4
  121. package/dist/{chunk-7OWE7WD6.js.map → chunk-LI4K2KEJ.js.map} +1 -1
  122. package/dist/chunk-LKZDQ2B4.js +1581 -0
  123. package/dist/chunk-LKZDQ2B4.js.map +1 -0
  124. package/dist/{chunk-45YZXI6X.cjs → chunk-LLFPQOBA.cjs} +27 -27
  125. package/dist/{chunk-45YZXI6X.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
  126. package/dist/{chunk-ZRJTM7MT.js → chunk-LZMQ3SFK.js} +3 -3
  127. package/dist/{chunk-ZRJTM7MT.js.map → chunk-LZMQ3SFK.js.map} +1 -1
  128. package/dist/{chunk-DI6VC62F.js → chunk-M3VTS3F6.js} +3 -3
  129. package/dist/{chunk-DI6VC62F.js.map → chunk-M3VTS3F6.js.map} +1 -1
  130. package/dist/{chunk-MZ34E2GN.js → chunk-NBOS7BY3.js} +60 -21
  131. package/dist/chunk-NBOS7BY3.js.map +1 -0
  132. package/dist/{chunk-YA36ABIL.js → chunk-NGQDGL5X.js} +14 -48
  133. package/dist/chunk-NGQDGL5X.js.map +1 -0
  134. package/dist/{chunk-ZBFZGLZE.cjs → chunk-NLX5OWK7.cjs} +6 -2
  135. package/dist/chunk-NLX5OWK7.cjs.map +1 -0
  136. package/dist/chunk-NUQ2YFFH.cjs +1637 -0
  137. package/dist/chunk-NUQ2YFFH.cjs.map +1 -0
  138. package/dist/{chunk-TTCOPKUL.cjs → chunk-OGL4X4PH.cjs} +182 -184
  139. package/dist/chunk-OGL4X4PH.cjs.map +1 -0
  140. package/dist/{chunk-HY5BNOUN.cjs → chunk-OTNTGEXR.cjs} +4 -4
  141. package/dist/{chunk-HY5BNOUN.cjs.map → chunk-OTNTGEXR.cjs.map} +1 -1
  142. package/dist/chunk-OTWE63BW.js +53 -0
  143. package/dist/chunk-OTWE63BW.js.map +1 -0
  144. package/dist/chunk-PC5NGH5A.js +549 -0
  145. package/dist/chunk-PC5NGH5A.js.map +1 -0
  146. package/dist/{chunk-IPRP6TDL.cjs → chunk-PS3TUWJM.cjs} +7 -7
  147. package/dist/{chunk-IPRP6TDL.cjs.map → chunk-PS3TUWJM.cjs.map} +1 -1
  148. package/dist/{chunk-V76FGHY3.js → chunk-PVFFH7TL.js} +5 -5
  149. package/dist/{chunk-V76FGHY3.js.map → chunk-PVFFH7TL.js.map} +1 -1
  150. package/dist/chunk-QCD5JKU4.cjs +15 -0
  151. package/dist/chunk-QCD5JKU4.cjs.map +1 -0
  152. package/dist/{chunk-IRPYOHRC.js → chunk-QG5VEOKX.js} +6 -2
  153. package/dist/chunk-QG5VEOKX.js.map +1 -0
  154. package/dist/{chunk-MM3JHVKZ.cjs → chunk-QLLZM5I3.cjs} +4 -4
  155. package/dist/{chunk-MM3JHVKZ.cjs.map → chunk-QLLZM5I3.cjs.map} +1 -1
  156. package/dist/{chunk-MX7EKQPM.js → chunk-RCBG6YMT.js} +345 -97
  157. package/dist/chunk-RCBG6YMT.js.map +1 -0
  158. package/dist/{chunk-2CYI5HRH.js → chunk-RI7RJH4G.js} +49 -17
  159. package/dist/chunk-RI7RJH4G.js.map +1 -0
  160. package/dist/{chunk-5LKOVCPP.js → chunk-RVUL2HXY.js} +6 -5
  161. package/dist/chunk-RVUL2HXY.js.map +1 -0
  162. package/dist/{chunk-WK23PGTP.cjs → chunk-S5GU4LUN.cjs} +11 -11
  163. package/dist/{chunk-WK23PGTP.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
  164. package/dist/{chunk-S33YQEL7.js → chunk-SDPWO2Z5.js} +6 -6
  165. package/dist/{chunk-S33YQEL7.js.map → chunk-SDPWO2Z5.js.map} +1 -1
  166. package/dist/{chunk-6S3PTHL4.js → chunk-SLGGT2XD.js} +3 -3
  167. package/dist/{chunk-6S3PTHL4.js.map → chunk-SLGGT2XD.js.map} +1 -1
  168. package/dist/{chunk-HSEZ7X6Y.cjs → chunk-TIJUA4I6.cjs} +45 -45
  169. package/dist/{chunk-HSEZ7X6Y.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
  170. package/dist/{chunk-CSNOYIB4.cjs → chunk-TM54OBHX.cjs} +13 -13
  171. package/dist/{chunk-CSNOYIB4.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
  172. package/dist/{chunk-2GIV5X4P.js → chunk-TYEYRCXL.js} +86 -33
  173. package/dist/chunk-TYEYRCXL.js.map +1 -0
  174. package/dist/{chunk-MJPZNEJZ.js → chunk-UKOVGCRN.js} +2095 -496
  175. package/dist/chunk-UKOVGCRN.js.map +1 -0
  176. package/dist/chunk-UYKDYE5D.cjs +12 -0
  177. package/dist/{chunk-KWNWG4RC.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
  178. package/dist/{chunk-FX5ZW6PN.js → chunk-VAAC7L57.js} +95 -40
  179. package/dist/chunk-VAAC7L57.js.map +1 -0
  180. package/dist/{chunk-ISKCIQF2.cjs → chunk-VKHXYVN7.cjs} +14 -25
  181. package/dist/chunk-VKHXYVN7.cjs.map +1 -0
  182. package/dist/chunk-VUQZNUHU.js +171 -0
  183. package/dist/chunk-VUQZNUHU.js.map +1 -0
  184. package/dist/{chunk-K2XYLVVB.cjs → chunk-WDM5WQK4.cjs} +175 -136
  185. package/dist/chunk-WDM5WQK4.cjs.map +1 -0
  186. package/dist/{chunk-GVYVGGPJ.js → chunk-WFSYYU4W.js} +66 -28
  187. package/dist/chunk-WFSYYU4W.js.map +1 -0
  188. package/dist/{chunk-WCLMKNQE.cjs → chunk-WRBV2FNH.cjs} +1356 -1108
  189. package/dist/chunk-WRBV2FNH.cjs.map +1 -0
  190. package/dist/chunk-XORONCV3.js +202 -0
  191. package/dist/chunk-XORONCV3.js.map +1 -0
  192. package/dist/{chunk-2Q45FAIE.js → chunk-YT2IVFAI.js} +26 -17
  193. package/dist/chunk-YT2IVFAI.js.map +1 -0
  194. package/dist/chunk-ZGVTNKTX.cjs +217 -0
  195. package/dist/chunk-ZGVTNKTX.cjs.map +1 -0
  196. package/dist/core/index.cjs +20 -20
  197. package/dist/core/index.d.cts +4 -4
  198. package/dist/core/index.d.ts +4 -4
  199. package/dist/core/index.js +4 -4
  200. package/dist/{ddl-B49O7dB_.d.ts → ddl-BvcbgzHo.d.ts} +3 -3
  201. package/dist/{ddl-DcZG660s.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
  202. package/dist/graph-extension/index.d.cts +2 -4
  203. package/dist/graph-extension/index.d.ts +2 -4
  204. package/dist/graph-merge/index.cjs +140 -125
  205. package/dist/graph-merge/index.cjs.map +1 -1
  206. package/dist/graph-merge/index.d.cts +8 -9
  207. package/dist/graph-merge/index.d.ts +8 -9
  208. package/dist/graph-merge/index.js +42 -27
  209. package/dist/graph-merge/index.js.map +1 -1
  210. package/dist/index.cjs +144 -143
  211. package/dist/index.cjs.map +1 -1
  212. package/dist/index.d.cts +11 -12
  213. package/dist/index.d.ts +11 -12
  214. package/dist/index.js +30 -29
  215. package/dist/index.js.map +1 -1
  216. package/dist/indexes/index.cjs +14 -12
  217. package/dist/indexes/index.d.cts +4 -4
  218. package/dist/indexes/index.d.ts +4 -4
  219. package/dist/indexes/index.js +7 -5
  220. package/dist/{ingestion-import-target-CI8OWIkM.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
  221. package/dist/{ingestion-import-target-DCpfM1PX.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
  222. package/dist/interchange/index.cjs +41 -39
  223. package/dist/interchange/index.cjs.map +1 -1
  224. package/dist/interchange/index.d.cts +8 -8
  225. package/dist/interchange/index.d.ts +8 -8
  226. package/dist/interchange/index.js +16 -14
  227. package/dist/interchange/index.js.map +1 -1
  228. package/dist/local-store-impl-6DDTFM32.cjs +77 -0
  229. package/dist/local-store-impl-6DDTFM32.cjs.map +1 -0
  230. package/dist/local-store-impl-OXTOVU2J.js +75 -0
  231. package/dist/local-store-impl-OXTOVU2J.js.map +1 -0
  232. package/dist/{manager-Cfg1ENj1.d.ts → manager-B68OrPR2.d.ts} +1 -2
  233. package/dist/{manager-D348fa6W.d.cts → manager-D_t7oK69.d.cts} +1 -2
  234. package/dist/pglite-store-impl-6EMZGL7K.js +73 -0
  235. package/dist/pglite-store-impl-6EMZGL7K.js.map +1 -0
  236. package/dist/pglite-store-impl-GJG3Y7RP.cjs +75 -0
  237. package/dist/pglite-store-impl-GJG3Y7RP.cjs.map +1 -0
  238. package/dist/{postgres-UStOycLI.d.ts → postgres-BPLSVyHM.d.ts} +1 -1
  239. package/dist/{postgres-CH1kkM5J.d.cts → postgres-CqvtFC2y.d.cts} +1 -1
  240. package/dist/profiler/index.d.cts +9 -9
  241. package/dist/profiler/index.d.ts +9 -9
  242. package/dist/provenance/index.cjs +33 -20
  243. package/dist/provenance/index.cjs.map +1 -1
  244. package/dist/provenance/index.d.cts +7 -7
  245. package/dist/provenance/index.d.ts +7 -7
  246. package/dist/provenance/index.js +24 -11
  247. package/dist/provenance/index.js.map +1 -1
  248. package/dist/{repair-validity-windows-aWX7VNvv.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
  249. package/dist/{repair-validity-windows-BtOEe2pS.d.ts → repair-validity-windows-GMdaS2AH.d.ts} +7 -3
  250. package/dist/resolve-D_H8MHtq.d.ts +1805 -0
  251. package/dist/resolve-WEW8gWws.d.cts +1805 -0
  252. package/dist/schema/index.cjs +42 -40
  253. package/dist/schema/index.d.cts +4 -6
  254. package/dist/schema/index.d.ts +4 -6
  255. package/dist/schema/index.js +15 -13
  256. package/dist/{searchable-z4BiFfHI.d.ts → searchable-C_UREI9K.d.ts} +1 -1
  257. package/dist/{searchable-C8-RrL3l.d.cts → searchable-ClgET_i7.d.cts} +1 -1
  258. package/dist/{sqlite-axLw5Lo5.d.ts → sqlite-D1mXO9Kp.d.cts} +2 -1
  259. package/dist/{sqlite-Cyx9j9o6.d.cts → sqlite-MZA3oZNB.d.ts} +2 -1
  260. package/dist/{store-CTfQ9taw.d.ts → store-CuFX7fCx.d.cts} +38 -41
  261. package/dist/{store-DR9J7JVB.d.cts → store-D-ZjXQpW.d.ts} +38 -41
  262. package/dist/{temporal-CBOrERz5.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
  263. package/dist/{temporal-B4Ky4wzh.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
  264. package/dist/{types-CWg4dTjj.d.ts → types-6yf0Vv-_.d.cts} +1672 -1
  265. package/dist/{types-CWg4dTjj.d.cts → types-6yf0Vv-_.d.ts} +1672 -1
  266. package/dist/{types-BScHXVM7.d.ts → types-DzJ4dlzk.d.cts} +1 -1
  267. package/dist/{types-BE921wRl.d.cts → types-_vVSB9k-.d.ts} +1 -1
  268. package/dist/{where-BWXUPV3C.d.ts → where-DuG2LCLe.d.ts} +1 -1
  269. package/dist/{where-CNtx1aLc.d.cts → where-Mhf_yyKX.d.cts} +1 -1
  270. package/package.json +5 -1
  271. package/dist/chunk-2CYI5HRH.js.map +0 -1
  272. package/dist/chunk-2GIV5X4P.js.map +0 -1
  273. package/dist/chunk-2Q45FAIE.js.map +0 -1
  274. package/dist/chunk-46UGOVRW.js.map +0 -1
  275. package/dist/chunk-5LKOVCPP.js.map +0 -1
  276. package/dist/chunk-5OWHU7Z7.cjs.map +0 -1
  277. package/dist/chunk-6LEOAIIB.js +0 -1160
  278. package/dist/chunk-6LEOAIIB.js.map +0 -1
  279. package/dist/chunk-7CCMCMJO.cjs.map +0 -1
  280. package/dist/chunk-7PRMDZIA.cjs.map +0 -1
  281. package/dist/chunk-C76WFIVZ.cjs.map +0 -1
  282. package/dist/chunk-CS6JTQQ2.cjs.map +0 -1
  283. package/dist/chunk-EDLKIQRI.js.map +0 -1
  284. package/dist/chunk-EH3JZJUM.cjs +0 -567
  285. package/dist/chunk-EH3JZJUM.cjs.map +0 -1
  286. package/dist/chunk-FX5ZW6PN.js.map +0 -1
  287. package/dist/chunk-GHZPZNFC.cjs +0 -132
  288. package/dist/chunk-GHZPZNFC.cjs.map +0 -1
  289. package/dist/chunk-GVYVGGPJ.js.map +0 -1
  290. package/dist/chunk-IHK5KA2Q.cjs +0 -262
  291. package/dist/chunk-IHK5KA2Q.cjs.map +0 -1
  292. package/dist/chunk-IRPYOHRC.js.map +0 -1
  293. package/dist/chunk-ISKCIQF2.cjs.map +0 -1
  294. package/dist/chunk-JG5XIJDY.js.map +0 -1
  295. package/dist/chunk-K2XYLVVB.cjs.map +0 -1
  296. package/dist/chunk-KWNWG4RC.cjs +0 -12
  297. package/dist/chunk-LLVOQOWE.cjs.map +0 -1
  298. package/dist/chunk-MJPZNEJZ.js.map +0 -1
  299. package/dist/chunk-MX7EKQPM.js.map +0 -1
  300. package/dist/chunk-MZ34E2GN.js.map +0 -1
  301. package/dist/chunk-OJHD3LXJ.cjs.map +0 -1
  302. package/dist/chunk-PALYTHGM.js +0 -114
  303. package/dist/chunk-PALYTHGM.js.map +0 -1
  304. package/dist/chunk-RDP6ZRSM.cjs.map +0 -1
  305. package/dist/chunk-S3SDEQMC.js +0 -532
  306. package/dist/chunk-S3SDEQMC.js.map +0 -1
  307. package/dist/chunk-TEC24ZDA.cjs +0 -1254
  308. package/dist/chunk-TEC24ZDA.cjs.map +0 -1
  309. package/dist/chunk-TP4NJTI3.cjs +0 -1192
  310. package/dist/chunk-TP4NJTI3.cjs.map +0 -1
  311. package/dist/chunk-TTCOPKUL.cjs.map +0 -1
  312. package/dist/chunk-TUVD4DFR.cjs.map +0 -1
  313. package/dist/chunk-TYGGUWMS.cjs.map +0 -1
  314. package/dist/chunk-U3Z7XKAG.js.map +0 -1
  315. package/dist/chunk-U5EL6JUV.js.map +0 -1
  316. package/dist/chunk-VTJVMP4I.js.map +0 -1
  317. package/dist/chunk-WCLMKNQE.cjs.map +0 -1
  318. package/dist/chunk-XMY2SXOH.cjs.map +0 -1
  319. package/dist/chunk-Y55DLLEG.js +0 -247
  320. package/dist/chunk-Y55DLLEG.js.map +0 -1
  321. package/dist/chunk-YA36ABIL.js.map +0 -1
  322. package/dist/chunk-ZBFZGLZE.cjs.map +0 -1
  323. package/dist/index-B0PrmE3K.d.cts +0 -1146
  324. package/dist/index-CwcXsL5R.d.ts +0 -1146
  325. package/dist/materialize-indexes-C9GG3O3C.d.ts +0 -266
  326. package/dist/materialize-indexes-CrSiW_lT.d.cts +0 -266
@@ -1842,6 +1842,182 @@ type GraphExtension = Readonly<{
1842
1842
  declare const GRAPH_EXTENSION_TOP_LEVEL_KEYS: readonly ["version", "nodes", "edges", "ontology", "indexes"];
1843
1843
  type GraphExtensionTopLevelKey = (typeof GRAPH_EXTENSION_TOP_LEVEL_KEYS)[number];
1844
1844
 
1845
+ /**
1846
+ * Schema migration utilities.
1847
+ *
1848
+ * Provides diff detection between schema versions to identify
1849
+ * what has changed and what migrations might be needed.
1850
+ */
1851
+
1852
+ /**
1853
+ * Types of changes that can occur in a schema.
1854
+ */
1855
+ type ChangeType = "added" | "removed" | "modified" | "renamed";
1856
+ /**
1857
+ * Severity of a change for migration purposes.
1858
+ */
1859
+ type ChangeSeverity = "safe" | "warning" | "breaking";
1860
+ /**
1861
+ * A change to a node definition.
1862
+ */
1863
+ type NodeChange = Readonly<{
1864
+ type: ChangeType;
1865
+ kind: string;
1866
+ severity: ChangeSeverity;
1867
+ details: string;
1868
+ before?: SerializedNodeDef | undefined;
1869
+ after?: SerializedNodeDef | undefined;
1870
+ }>;
1871
+ /**
1872
+ * A change to an edge definition.
1873
+ */
1874
+ type EdgeChange = Readonly<{
1875
+ type: ChangeType;
1876
+ kind: string;
1877
+ severity: ChangeSeverity;
1878
+ details: string;
1879
+ before?: SerializedEdgeDef | undefined;
1880
+ after?: SerializedEdgeDef | undefined;
1881
+ }>;
1882
+ /**
1883
+ * A change to the ontology.
1884
+ */
1885
+ type OntologyChange = Readonly<{
1886
+ type: ChangeType;
1887
+ entity: "metaEdge" | "relation";
1888
+ name: string;
1889
+ severity: ChangeSeverity;
1890
+ details: string;
1891
+ }>;
1892
+ /** A durable graph-level Operational Identity capability change. */
1893
+ type IdentityChange = Readonly<{
1894
+ type: ChangeType;
1895
+ severity: ChangeSeverity;
1896
+ details: string;
1897
+ }>;
1898
+ /**
1899
+ * A change to an index declaration.
1900
+ *
1901
+ * Index changes are always `safe`-severity: index DDL is materialized
1902
+ * separately and never blocks schema-version commits or migrations.
1903
+ * Adding, removing, or modifying an index never invalidates existing
1904
+ * data — it only changes which physical indexes the deployment will
1905
+ * materialize on its next pass.
1906
+ */
1907
+ type IndexChange = Readonly<{
1908
+ type: ChangeType;
1909
+ /** Index name (the diffing identity key). */
1910
+ name: string;
1911
+ /**
1912
+ * Whether this index is on a node, edge, or vector field. Vector
1913
+ * index changes flow through the same diff classification as
1914
+ * relational ones.
1915
+ */
1916
+ entity: IndexEntity;
1917
+ severity: ChangeSeverity;
1918
+ details: string;
1919
+ before?: IndexDeclaration | undefined;
1920
+ after?: IndexDeclaration | undefined;
1921
+ }>;
1922
+ /**
1923
+ * A change to the persisted graph-extension document.
1924
+ *
1925
+ * Graph-extension document changes are committed only through the
1926
+ * graph-extension lifecycle verbs (`evolve` and `removeKinds`), so the
1927
+ * extension-slice change itself is `safe`-severity. The detailed
1928
+ * per-kind effect is captured in the corresponding node/edge/ontology
1929
+ * changes the merged document produced.
1930
+ */
1931
+ type ExtensionChange = Readonly<{
1932
+ type: ChangeType;
1933
+ severity: ChangeSeverity;
1934
+ details: string;
1935
+ }>;
1936
+ /**
1937
+ * Change to the soft-deprecated kind set. `safe`-severity by
1938
+ * construction — deprecation is a metadata signal that doesn't gate
1939
+ * reads, writes, or queries. The `added` and `removed` arrays carry
1940
+ * the per-name deltas so consumers can render granular diffs.
1941
+ */
1942
+ type DeprecatedKindsChange = Readonly<{
1943
+ added: readonly string[];
1944
+ removed: readonly string[];
1945
+ severity: ChangeSeverity;
1946
+ details: string;
1947
+ }>;
1948
+ /**
1949
+ * A complete diff between two schema versions.
1950
+ */
1951
+ type SchemaDiff = Readonly<{
1952
+ fromVersion: number;
1953
+ toVersion: number;
1954
+ /** Changes to node definitions */
1955
+ nodes: readonly NodeChange[];
1956
+ /** Changes to edge definitions */
1957
+ edges: readonly EdgeChange[];
1958
+ /** Changes to ontology */
1959
+ ontology: readonly OntologyChange[];
1960
+ /** Change to the graph-level identity capability, if any. */
1961
+ identity?: IdentityChange;
1962
+ /** Changes to index declarations */
1963
+ indexes: readonly IndexChange[];
1964
+ /**
1965
+ * Change to the graph-extension document, if any. `undefined` when
1966
+ * the slice is unchanged on both sides (the common case).
1967
+ */
1968
+ extension?: ExtensionChange;
1969
+ /**
1970
+ * Change to the soft-deprecated kind set, if any. `undefined` when
1971
+ * the set is unchanged on both sides.
1972
+ */
1973
+ deprecatedKinds?: DeprecatedKindsChange;
1974
+ /** Whether any breaking changes exist */
1975
+ hasBreakingChanges: boolean;
1976
+ /** Whether the change is backwards compatible (no breaking changes) */
1977
+ isBackwardsCompatible: boolean;
1978
+ /** Whether any changes exist at all */
1979
+ hasChanges: boolean;
1980
+ /** Summary of changes */
1981
+ summary: string;
1982
+ }>;
1983
+ /**
1984
+ * Computes the diff between two schema versions.
1985
+ *
1986
+ * @param before - The previous schema version
1987
+ * @param after - The new schema version
1988
+ * @returns A diff describing all changes
1989
+ */
1990
+ declare function computeSchemaDiff(before: SerializedSchema, after: SerializedSchema): SchemaDiff;
1991
+ /**
1992
+ * Checks if a schema change is backwards compatible.
1993
+ *
1994
+ * A change is backwards compatible if:
1995
+ * - No nodes or edges were removed
1996
+ * - No required properties were added
1997
+ * - No existing properties were removed
1998
+ */
1999
+ declare function isBackwardsCompatible(diff: SchemaDiff): boolean;
2000
+ /**
2001
+ * How a proposed graph relates to the committed schema.
2002
+ *
2003
+ * - `identical` — a semantic no-op; committing it changes nothing.
2004
+ * - `additive` — changes exist and are all backwards compatible.
2005
+ * - `incompatible` — at least one breaking change; needs a deliberate
2006
+ * migration decision.
2007
+ */
2008
+ type SchemaChangeClassification = "identical" | "additive" | "incompatible";
2009
+ /**
2010
+ * Classifies a schema diff into the three outcomes a caller actually branches
2011
+ * on. Pure — no I/O, no DDL. Pair with `getSchemaChanges(backend, graph)` (or
2012
+ * `store.schemaChanges()`) to pre-flight a proposal *before* touching a
2013
+ * privileged, migration-gated path.
2014
+ */
2015
+ declare function classifySchemaChanges(diff: SchemaDiff): SchemaChangeClassification;
2016
+ /**
2017
+ * Gets a list of actions needed for migration.
2018
+ */
2019
+ declare function getMigrationActions(diff: SchemaDiff): readonly string[];
2020
+
1845
2021
  /** Brand key for MetaEdge */
1846
2022
  declare const META_EDGE_BRAND: "__metaEdge";
1847
2023
  /**
@@ -2071,6 +2247,1307 @@ declare function getNodeKinds<G extends GraphDef>(graph: G): readonly (keyof G["
2071
2247
  */
2072
2248
  declare function getEdgeKinds<G extends GraphDef>(graph: G): readonly (keyof G["edges"] & string)[];
2073
2249
 
2250
+ /**
2251
+ * Index materialization — runs declared index DDL against the live
2252
+ * database and tracks per-deployment status in
2253
+ * `typegraph_index_materializations`.
2254
+ *
2255
+ * Reads `IndexDeclaration[]` from `GraphDef.indexes`, generates DDL via
2256
+ * `generateIndexDDL`, executes via `backend.executeDdl` (Postgres path
2257
+ * uses `CREATE INDEX CONCURRENTLY`, which cannot run inside a
2258
+ * transaction — `executeDdl` runs at the top-level backend, never inside
2259
+ * `transaction(...)`), and upserts a status row per index.
2260
+ *
2261
+ * Caveats baked in to the algorithm:
2262
+ *
2263
+ * - SQL index names are physical, database-global identifiers.
2264
+ * Cross-graph collisions (two graphs declaring the same name with
2265
+ * different shapes) surface as a `failed` result with reason
2266
+ * "signature drift", because the existing recorded signature won't
2267
+ * match the new one.
2268
+ * - On Postgres, `CREATE INDEX CONCURRENTLY IF NOT EXISTS` does NOT
2269
+ * prove the existing physical index has the same shape as ours —
2270
+ * only that something with that name exists. Drift detection here
2271
+ * relies on TypeGraph's recorded signature, not on PG metadata.
2272
+ * - Failed `CONCURRENTLY` builds leave invalid indexes behind
2273
+ * (`pg_index.indisvalid = false`). Relational rebuilds self-heal: the
2274
+ * claim-holding materializer drops an invalid leftover with the
2275
+ * declaration's name before rebuilding (see dropInvalidIndexLeftover).
2276
+ * Vector per-field index leftovers remain operator-repair.
2277
+ * - Two materializers racing the SAME index name serialize through a
2278
+ * durable claim in the status table (see materializeWithClaim) —
2279
+ * concurrent same-name expression-index CIC builds deadlock on
2280
+ * Postgres (no safe-snapshot exemption).
2281
+ */
2282
+
2283
+ type MaterializeIndexesOptions = Readonly<{
2284
+ /** Restrict to indexes whose `kind` is in this set. */
2285
+ kinds?: readonly string[];
2286
+ /** Stop on the first failure. Default: false (best-effort). */
2287
+ stopOnError?: boolean;
2288
+ /**
2289
+ * Refresh planner statistics (ANALYZE) after at least one index was
2290
+ * created. A fresh index can be ignored by the planner until statistics
2291
+ * exist. Default: true. Applied on non-concurrent builders (SQLite) and
2292
+ * on concurrent builders that serialize same-index builds via the
2293
+ * cross-caller claim primitive (the bundled Postgres backend); a custom
2294
+ * concurrent backend without the primitive skips the refresh — see
2295
+ * refreshStatisticsAfterCreation — and should call
2296
+ * `store.refreshStatistics()` after materializing.
2297
+ */
2298
+ refreshStatistics?: boolean;
2299
+ }>;
2300
+ /**
2301
+ * Per-index outcome from `materializeIndexes()`.
2302
+ *
2303
+ * Status values:
2304
+ * - `created`: DDL ran successfully and a new physical index now exists.
2305
+ * - `alreadyMaterialized`: status table shows a prior successful
2306
+ * materialization with the same signature; no DDL ran.
2307
+ * - `failed`: the DDL or status write failed; `error` carries the
2308
+ * captured exception. Best-effort mode continues to the next index;
2309
+ * `stopOnError: true` halts.
2310
+ * - `skipped`: the backend can't materialize this index variant in its
2311
+ * current configuration (e.g. vector indexes against SQLite without
2312
+ * sqlite-vec, or `indexType: "none"` declared on an embedding). The
2313
+ * declaration is recognized but intentionally not acted on. Status
2314
+ * table is NOT updated for skipped entries.
2315
+ */
2316
+ type MaterializeIndexesEntry = Readonly<{
2317
+ indexName: string;
2318
+ entity: IndexEntity;
2319
+ kind: string;
2320
+ status: "created" | "alreadyMaterialized" | "failed" | "skipped";
2321
+ error?: Error;
2322
+ /**
2323
+ * Human-readable reason. Required for `skipped`; optional otherwise.
2324
+ */
2325
+ reason?: string;
2326
+ }>;
2327
+ type MaterializeIndexesResult = Readonly<{
2328
+ results: readonly MaterializeIndexesEntry[];
2329
+ }>;
2330
+ type MaterializeSystemIndexesOptions = Readonly<{
2331
+ /** Stop on the first failure. Default: false (best-effort). */
2332
+ stopOnError?: boolean;
2333
+ /** Refresh planner statistics after a creation. Default: true. */
2334
+ refreshStatistics?: boolean;
2335
+ }>;
2336
+
2337
+ /**
2338
+ * TypeGraph Error Hierarchy
2339
+ *
2340
+ * All errors extend TypeGraphError with:
2341
+ * - `code`: Machine-readable error code for programmatic handling
2342
+ * - `category`: Classification for error handling strategies
2343
+ * - `suggestion`: Optional recovery guidance for users
2344
+ * - `details`: Structured context about the error
2345
+ *
2346
+ * @example
2347
+ * ```typescript
2348
+ * try {
2349
+ * await store.nodes.Person.create({ name: "" });
2350
+ * } catch (error) {
2351
+ * if (isTypeGraphError(error)) {
2352
+ * console.error(error.toUserMessage());
2353
+ * if (isUserRecoverable(error)) {
2354
+ * // Show to user for correction
2355
+ * }
2356
+ * }
2357
+ * }
2358
+ * ```
2359
+ */
2360
+
2361
+ /**
2362
+ * Error category for programmatic handling.
2363
+ *
2364
+ * - `user`: Caused by invalid input or incorrect usage. Recoverable by fixing input.
2365
+ * - `constraint`: Business rule or schema constraint violation. Recoverable by changing data.
2366
+ * - `system`: Internal error or infrastructure issue. May require investigation or retry.
2367
+ */
2368
+ type ErrorCategory = "user" | "constraint" | "system";
2369
+ /**
2370
+ * Options for TypeGraphError constructor.
2371
+ */
2372
+ type TypeGraphErrorOptions = Readonly<{
2373
+ /** Structured context about the error */
2374
+ details?: Record<string, unknown>;
2375
+ /** Error category for handling strategies */
2376
+ category: ErrorCategory;
2377
+ /** Recovery guidance for users */
2378
+ suggestion?: string;
2379
+ /** Underlying cause of the error */
2380
+ cause?: unknown;
2381
+ }>;
2382
+ /**
2383
+ * Base error class for all TypeGraph errors.
2384
+ *
2385
+ * Provides structured error information for both programmatic handling
2386
+ * and user-friendly messages.
2387
+ */
2388
+ declare class TypeGraphError extends Error {
2389
+ /** Machine-readable error code (e.g., "VALIDATION_ERROR") */
2390
+ readonly code: string;
2391
+ /** Error category for handling strategies */
2392
+ readonly category: ErrorCategory;
2393
+ /** Structured context about the error */
2394
+ readonly details: Readonly<Record<string, unknown>>;
2395
+ /** Recovery guidance for users */
2396
+ readonly suggestion?: string;
2397
+ constructor(message: string, code: string, options: TypeGraphErrorOptions);
2398
+ /**
2399
+ * Returns a user-friendly error message with suggestion if available.
2400
+ */
2401
+ toUserMessage(): string;
2402
+ /**
2403
+ * Returns a detailed string representation for logging.
2404
+ */
2405
+ toLogString(): string;
2406
+ }
2407
+ /**
2408
+ * Validation issue from Zod or custom validation.
2409
+ */
2410
+ type ValidationIssue = Readonly<{
2411
+ /** Path to the invalid field (e.g., "address.city") */
2412
+ path: string;
2413
+ /** Human-readable error message */
2414
+ message: string;
2415
+ /** Zod error code if from Zod validation */
2416
+ code?: string;
2417
+ /**
2418
+ * The identity assertion the issue is about, carried structurally so
2419
+ * consumers (e.g. interchange import error reporting) never have to parse
2420
+ * the human-readable message for it.
2421
+ */
2422
+ assertionId?: string;
2423
+ }>;
2424
+ /**
2425
+ * The stable {@link ValidationIssue.code} every inverted-validity-window
2426
+ * refusal carries, so a caller can recognize that specific failure without
2427
+ * matching on the message. `ValidationError`'s own code is the family-wide
2428
+ * `VALIDATION_ERROR`, so the discriminator lives on the issue — mirroring the
2429
+ * identity-import window refusal (`IDENTITY_IMPORT_INVALID_WINDOW`).
2430
+ *
2431
+ * A write carrying it was refused because `validTo` precedes the row's
2432
+ * effective `validFrom`: the row would have stopped being true before it
2433
+ * started, observable at no `asOf` coordinate at all. Zero-width windows
2434
+ * (`validTo === validFrom`) are legal and never raise it.
2435
+ */
2436
+ declare const INVERTED_VALIDITY_WINDOW_CODE = "INVERTED_VALIDITY_WINDOW";
2437
+ /**
2438
+ * The stable {@link ValidationIssue.code} carried by a refusal to accept a
2439
+ * `validFrom` the write cannot apply: the target row is LIVE, and an in-place
2440
+ * update never rewrites a live row's lower bound — that bound is history.
2441
+ * `ValidationError`'s own code is the family-wide `VALIDATION_ERROR`, so the
2442
+ * discriminator lives on the issue — mirroring
2443
+ * {@link INVERTED_VALIDITY_WINDOW_CODE}.
2444
+ *
2445
+ * Only a bound naming a DIFFERENT instant than the row already stores raises it.
2446
+ * Restating the stored bound is legal and writes nothing new, and a resurrection
2447
+ * — which does rewrite `valid_from` — applies a stated bound rather than
2448
+ * refusing it.
2449
+ *
2450
+ * The message names both instants: the one stated and the one the row stores, so
2451
+ * the caller can restate the stored bound without a second read.
2452
+ */
2453
+ declare const IMMUTABLE_VALIDITY_LOWER_BOUND_CODE = "IMMUTABLE_VALIDITY_LOWER_BOUND";
2454
+ /**
2455
+ * Stable {@link ValidationIssue.code} for an edge-id ownership mismatch.
2456
+ *
2457
+ * Edge ids are graph-global. A collection-scoped write therefore has to prove
2458
+ * that the stored row has the collection's kind and, when the caller supplies
2459
+ * endpoints, the same immutable endpoints. This refusal prevents a collection
2460
+ * from mutating another kind's row and prevents an upsert from silently
2461
+ * ignoring an attempted repoint.
2462
+ */
2463
+ declare const EDGE_IDENTITY_MISMATCH_CODE = "EDGE_IDENTITY_MISMATCH";
2464
+ /**
2465
+ * The stable {@link ValidationIssue.code} every "this id is already taken"
2466
+ * create refusal carries, whichever way the create found out: its own existence
2467
+ * probe, or the engine refusing the INSERT. `ValidationError`'s own code is the
2468
+ * family-wide `VALIDATION_ERROR`, so the discriminator lives on the issue —
2469
+ * mirroring {@link INVERTED_VALIDITY_WINDOW_CODE}.
2470
+ *
2471
+ * `details.entityType` says whether a node or an edge was refused and
2472
+ * `details.kind` names its kind. `details.id` names the taken id, and is absent
2473
+ * only when the refused statement inserted MORE THAN ONE row: the engine reports
2474
+ * that the statement collided without saying which row did.
2475
+ */
2476
+ declare const ENTITY_ALREADY_EXISTS_CODE = "ENTITY_ALREADY_EXISTS";
2477
+ /**
2478
+ * Details for ValidationError.
2479
+ */
2480
+ type ValidationErrorDetails = Readonly<{
2481
+ /** Type of entity being validated */
2482
+ entityType?: KindEntity;
2483
+ /** Kind/type name of the entity */
2484
+ kind?: string;
2485
+ /** Operation being performed */
2486
+ operation?: "create" | "update" | "delete" | "hardDelete";
2487
+ /** Entity ID if updating */
2488
+ id?: string;
2489
+ /** Individual validation issues */
2490
+ issues: readonly ValidationIssue[];
2491
+ }>;
2492
+ /**
2493
+ * Thrown when schema validation fails during node or edge operations.
2494
+ *
2495
+ * @example
2496
+ * ```typescript
2497
+ * try {
2498
+ * await store.nodes.Person.create({ email: "invalid" });
2499
+ * } catch (error) {
2500
+ * if (error instanceof ValidationError) {
2501
+ * console.log(error.details.issues);
2502
+ * // [{ path: "email", message: "Invalid email" }]
2503
+ * }
2504
+ * }
2505
+ * ```
2506
+ */
2507
+ declare class ValidationError extends TypeGraphError {
2508
+ readonly details: ValidationErrorDetails;
2509
+ constructor(message: string, details: ValidationErrorDetails, options?: {
2510
+ cause?: unknown;
2511
+ suggestion?: string;
2512
+ });
2513
+ }
2514
+ /**
2515
+ * Details for NodeNotFoundError.
2516
+ */
2517
+ type NodeNotFoundErrorDetails = Readonly<{
2518
+ kind: string;
2519
+ id: string;
2520
+ }>;
2521
+ /**
2522
+ * Thrown when a node is not found.
2523
+ *
2524
+ * @example
2525
+ * ```typescript
2526
+ * try {
2527
+ * await store.nodes.Person.get("nonexistent-id");
2528
+ * } catch (error) {
2529
+ * if (error instanceof NodeNotFoundError) {
2530
+ * console.log(error.details.kind, error.details.id);
2531
+ * }
2532
+ * }
2533
+ * ```
2534
+ */
2535
+ declare class NodeNotFoundError extends TypeGraphError {
2536
+ readonly details: NodeNotFoundErrorDetails;
2537
+ constructor(kind: string, id: string, options?: {
2538
+ cause?: unknown;
2539
+ });
2540
+ }
2541
+ /**
2542
+ * Details for EdgeNotFoundError.
2543
+ */
2544
+ type EdgeNotFoundErrorDetails = Readonly<{
2545
+ kind: string;
2546
+ id: string;
2547
+ }>;
2548
+ /**
2549
+ * Thrown when an edge is not found.
2550
+ */
2551
+ declare class EdgeNotFoundError extends TypeGraphError {
2552
+ readonly details: EdgeNotFoundErrorDetails;
2553
+ constructor(kind: string, id: string, options?: {
2554
+ cause?: unknown;
2555
+ });
2556
+ }
2557
+ /**
2558
+ * Details for KindNotFoundError.
2559
+ */
2560
+ type KindNotFoundErrorDetails = Readonly<{
2561
+ kindName: string;
2562
+ entity: KindEntity;
2563
+ graphId?: string;
2564
+ }>;
2565
+ /**
2566
+ * Thrown when an operation references a kind that isn't registered on
2567
+ * the graph — `getNodeCollectionOrThrow` against an unknown kind, a
2568
+ * `materializeIndexes({ kinds })` filter naming a missing kind, an
2569
+ * extension referencing an unresolved endpoint, search facade typos,
2570
+ * etc. Carries the offending `kindName` and `entity` plus the host
2571
+ * `graphId` so logs are unambiguous when multiple stores share a
2572
+ * process.
2573
+ */
2574
+ declare class KindNotFoundError extends TypeGraphError {
2575
+ readonly details: KindNotFoundErrorDetails;
2576
+ readonly kindName: string;
2577
+ readonly entity: KindEntity;
2578
+ constructor(kindName: string, entity: KindEntity, options?: Readonly<{
2579
+ graphId?: string;
2580
+ suggestion?: string;
2581
+ cause?: unknown;
2582
+ }>);
2583
+ }
2584
+ /**
2585
+ * Details for NodeConstraintNotFoundError.
2586
+ */
2587
+ type NodeConstraintNotFoundErrorDetails = Readonly<{
2588
+ constraintName: string;
2589
+ kind: string;
2590
+ }>;
2591
+ /**
2592
+ * Thrown when a uniqueness constraint name is not found on a node kind.
2593
+ */
2594
+ declare class NodeConstraintNotFoundError extends TypeGraphError {
2595
+ readonly details: NodeConstraintNotFoundErrorDetails;
2596
+ constructor(constraintName: string, kind: string, options?: {
2597
+ cause?: unknown;
2598
+ });
2599
+ }
2600
+ /**
2601
+ * Details for NodeIndexNotFoundError.
2602
+ */
2603
+ type NodeIndexNotFoundErrorDetails = Readonly<{
2604
+ indexName: string;
2605
+ kind: string;
2606
+ }>;
2607
+ /**
2608
+ * Thrown when a declared node index name is not found on a node kind.
2609
+ */
2610
+ declare class NodeIndexNotFoundError extends TypeGraphError {
2611
+ readonly details: NodeIndexNotFoundErrorDetails;
2612
+ constructor(indexName: string, kind: string, options?: {
2613
+ cause?: unknown;
2614
+ });
2615
+ }
2616
+ /**
2617
+ * Details for EndpointNotFoundError.
2618
+ */
2619
+ type EndpointNotFoundErrorDetails = Readonly<{
2620
+ edgeKind: string;
2621
+ endpoint: "from" | "to";
2622
+ nodeKind: string;
2623
+ nodeId: string;
2624
+ }>;
2625
+ /**
2626
+ * Thrown when edge endpoint node does not exist or is deleted.
2627
+ */
2628
+ declare class EndpointNotFoundError extends TypeGraphError {
2629
+ readonly details: EndpointNotFoundErrorDetails;
2630
+ constructor(details: EndpointNotFoundErrorDetails, options?: {
2631
+ cause?: unknown;
2632
+ });
2633
+ }
2634
+ /**
2635
+ * Details for EndpointError.
2636
+ */
2637
+ type EndpointErrorDetails = Readonly<{
2638
+ edgeKind: string;
2639
+ endpoint: "from" | "to";
2640
+ actualKind: string;
2641
+ expectedKinds: readonly string[];
2642
+ }>;
2643
+ /**
2644
+ * Thrown when edge endpoint has wrong node type.
2645
+ */
2646
+ declare class EndpointError extends TypeGraphError {
2647
+ readonly details: EndpointErrorDetails;
2648
+ constructor(details: EndpointErrorDetails, options?: {
2649
+ cause?: unknown;
2650
+ });
2651
+ }
2652
+ /**
2653
+ * Details for UniquenessError.
2654
+ */
2655
+ type UniquenessErrorDetails = Readonly<{
2656
+ constraintName: string;
2657
+ kind: string;
2658
+ existingId: string;
2659
+ newId: string;
2660
+ fields: readonly string[];
2661
+ /**
2662
+ * The claim row's `node_kind` — the axis this violation was found at.
2663
+ * Optional so a third-party backend implementing the documented "throws
2664
+ * `UniquenessError`" contract keeps working unchanged; when a throw site
2665
+ * omits it, a caller loses only the disambiguation this field exists for,
2666
+ * never correctness of the refusal itself.
2667
+ *
2668
+ * `constraintName` alone cannot tell two disjoint pairs apart — every
2669
+ * `disjointWith` pair shares the single reserved `DISJOINT_CONSTRAINT_NAME`
2670
+ * — so `mapClaimRefusal` (`store/claims/node-claims.ts`) matches on this
2671
+ * field together with `constraintName` and the key, which is exactly the
2672
+ * claim row's primary key and therefore unambiguous.
2673
+ */
2674
+ axis?: string;
2675
+ }>;
2676
+ /**
2677
+ * Thrown when uniqueness constraint is violated.
2678
+ */
2679
+ declare class UniquenessError extends TypeGraphError {
2680
+ readonly details: UniquenessErrorDetails;
2681
+ constructor(details: UniquenessErrorDetails, options?: {
2682
+ cause?: unknown;
2683
+ });
2684
+ }
2685
+ /**
2686
+ * Details for CardinalityError.
2687
+ */
2688
+ type CardinalityErrorDetails = Readonly<{
2689
+ edgeKind: string;
2690
+ fromKind: string;
2691
+ fromId: string;
2692
+ cardinality: string;
2693
+ existingCount: number;
2694
+ }>;
2695
+ /**
2696
+ * Thrown when cardinality constraint is violated.
2697
+ */
2698
+ declare class CardinalityError extends TypeGraphError {
2699
+ readonly details: CardinalityErrorDetails;
2700
+ constructor(details: CardinalityErrorDetails, options?: {
2701
+ cause?: unknown;
2702
+ });
2703
+ }
2704
+ /**
2705
+ * Details for DisjointError.
2706
+ */
2707
+ type DisjointErrorDetails = Readonly<{
2708
+ nodeId: string;
2709
+ attemptedKind: string;
2710
+ conflictingKind: string;
2711
+ }>;
2712
+ /**
2713
+ * Thrown when disjointness constraint is violated.
2714
+ *
2715
+ * Disjoint types cannot share the same ID - a node cannot be both
2716
+ * a Person and an Organization if they are declared disjoint.
2717
+ */
2718
+ declare class DisjointError extends TypeGraphError {
2719
+ readonly details: DisjointErrorDetails;
2720
+ constructor(details: DisjointErrorDetails, options?: {
2721
+ cause?: unknown;
2722
+ });
2723
+ }
2724
+ type IdentityContradictionErrorDetails = Readonly<{
2725
+ /**
2726
+ * The identity write that could not stand. `merge` is the post-write
2727
+ * affected-class assertion a graph merge runs inside its commit
2728
+ * transaction, which names the whole merge rather than a single assertion
2729
+ * because the contradiction is a property of the state the merge would
2730
+ * leave behind.
2731
+ */
2732
+ operation: "assertSame" | "assertDifferent" | "fold" | "import" | "merge";
2733
+ a: Readonly<{
2734
+ kind: string;
2735
+ id: string;
2736
+ }>;
2737
+ b: Readonly<{
2738
+ kind: string;
2739
+ id: string;
2740
+ }>;
2741
+ reason: "different-assertion" | "same-class" | "disjoint-kinds";
2742
+ conflictingAssertionId?: string;
2743
+ conflictingKinds?: readonly [string, string];
2744
+ }>;
2745
+ /** Thrown when an identity mutation would make the ledger contradictory. */
2746
+ declare class IdentityContradictionError extends TypeGraphError {
2747
+ readonly details: IdentityContradictionErrorDetails;
2748
+ constructor(details: IdentityContradictionErrorDetails, options?: Readonly<{
2749
+ cause?: unknown;
2750
+ }>);
2751
+ }
2752
+ type IdentityValidityWindowErrorDetails = Readonly<{
2753
+ reason: "future-valid-from" | "future-valid-to" | "inverted" | "overlapping-open-window";
2754
+ validFrom: string;
2755
+ validTo?: string;
2756
+ operationInstant: string;
2757
+ }>;
2758
+ /** Thrown when an identity assertion validity window cannot be applied. */
2759
+ declare class IdentityValidityWindowError extends TypeGraphError {
2760
+ readonly details: IdentityValidityWindowErrorDetails;
2761
+ constructor(details: IdentityValidityWindowErrorDetails);
2762
+ }
2763
+ type IdentityEndpointValidityErrorDetails = Readonly<{
2764
+ endpoint: Readonly<{
2765
+ kind: string;
2766
+ id: string;
2767
+ }>;
2768
+ assertionWindow: Readonly<{
2769
+ validFrom: string;
2770
+ validTo?: string;
2771
+ }>;
2772
+ endpointWindow: Readonly<{
2773
+ validFrom?: string;
2774
+ validTo?: string;
2775
+ deletedAt?: string;
2776
+ }>;
2777
+ }>;
2778
+ /** Thrown when an identity endpoint does not exist throughout the assertion window. */
2779
+ declare class IdentityEndpointValidityError extends TypeGraphError {
2780
+ readonly details: IdentityEndpointValidityErrorDetails;
2781
+ constructor(details: IdentityEndpointValidityErrorDetails);
2782
+ }
2783
+ type IdentitySeparationViolationErrorDetails = Readonly<{
2784
+ graphId: string;
2785
+ /**
2786
+ * `"database"` when the CHECK constraint on the separation relation aborted
2787
+ * the write — the backstop firing as designed. `"writer"` when the write was
2788
+ * accepted, which means the relation was provisioned without its constraint
2789
+ * and only the writer's own re-check caught the contradiction.
2790
+ */
2791
+ enforcedBy: "database" | "writer";
2792
+ /** The single class key both endpoints collapsed onto. */
2793
+ classKey: string;
2794
+ /** The `different` assertion whose endpoints landed in one class. */
2795
+ assertionId: string;
2796
+ a: Readonly<{
2797
+ kind: string;
2798
+ id: string;
2799
+ }>;
2800
+ b: Readonly<{
2801
+ kind: string;
2802
+ id: string;
2803
+ }>;
2804
+ }>;
2805
+ /**
2806
+ * Thrown when the derived separation relation refuses a write that would place
2807
+ * both endpoints of a current `different` assertion in one identity class.
2808
+ *
2809
+ * This is the database-level backstop beneath the plan-time simulation and the
2810
+ * applier's validation. Reaching it means an earlier layer let a contradiction
2811
+ * through: the transaction is aborted rather than committed, but the layer that
2812
+ * should have refused it typed and early is worth investigating.
2813
+ */
2814
+ declare class IdentitySeparationViolationError extends TypeGraphError {
2815
+ readonly details: IdentitySeparationViolationErrorDetails;
2816
+ constructor(details: IdentitySeparationViolationErrorDetails, options?: Readonly<{
2817
+ cause?: unknown;
2818
+ }>);
2819
+ }
2820
+ /**
2821
+ * Details for RestrictedDeleteError.
2822
+ */
2823
+ type RestrictedDeleteErrorDetails = Readonly<{
2824
+ nodeKind: string;
2825
+ nodeId: string;
2826
+ edgeCount: number;
2827
+ edgeKinds: readonly string[];
2828
+ }>;
2829
+ /**
2830
+ * Thrown when deletion is blocked due to existing edges (restrict behavior).
2831
+ */
2832
+ declare class RestrictedDeleteError extends TypeGraphError {
2833
+ readonly details: RestrictedDeleteErrorDetails;
2834
+ constructor(details: RestrictedDeleteErrorDetails, options?: {
2835
+ cause?: unknown;
2836
+ });
2837
+ }
2838
+ /**
2839
+ * Details for VersionConflictError.
2840
+ */
2841
+ type VersionConflictErrorDetails = Readonly<{
2842
+ kind: string;
2843
+ id: string;
2844
+ expectedVersion: number;
2845
+ actualVersion: number;
2846
+ }>;
2847
+ /**
2848
+ * Thrown when optimistic locking detects a concurrent modification.
2849
+ *
2850
+ * This occurs when two operations try to update the same entity simultaneously.
2851
+ * The operation with the stale version fails.
2852
+ */
2853
+ declare class VersionConflictError extends TypeGraphError {
2854
+ readonly details: VersionConflictErrorDetails;
2855
+ constructor(details: VersionConflictErrorDetails, options?: {
2856
+ cause?: unknown;
2857
+ });
2858
+ }
2859
+ /**
2860
+ * Details for SchemaMismatchError.
2861
+ */
2862
+ type SchemaMismatchErrorDetails = Readonly<{
2863
+ graphId: string;
2864
+ expectedHash: string;
2865
+ actualHash: string;
2866
+ }>;
2867
+ /**
2868
+ * Thrown when the schema in code doesn't match the schema in the database.
2869
+ */
2870
+ declare class SchemaMismatchError extends TypeGraphError {
2871
+ readonly details: SchemaMismatchErrorDetails;
2872
+ constructor(details: SchemaMismatchErrorDetails, options?: {
2873
+ cause?: unknown;
2874
+ });
2875
+ }
2876
+ /**
2877
+ * Details for MigrationError.
2878
+ */
2879
+ /**
2880
+ * Why a migration operation failed. A stable discriminant so callers can
2881
+ * branch on the outcome instead of matching the message text, which is free
2882
+ * to be reworded in any release.
2883
+ */
2884
+ declare const MIGRATION_FAILURE_REASONS: readonly ["schema-behind", "breaking-change", "no-active-version", "version-not-found", "kind-removal"];
2885
+ type MigrationFailureReason = (typeof MIGRATION_FAILURE_REASONS)[number];
2886
+ /**
2887
+ * Structured context for a {@link MigrationError}, discriminated on `reason`.
2888
+ *
2889
+ * Modelled as a union rather than one shape with optional fields so the
2890
+ * payload a reason promises is the payload it must carry: narrowing on
2891
+ * `reason === "kind-removal"` gives you a non-optional `droppedKinds`, and the
2892
+ * constructor cannot be handed a `kind-removal` without one.
2893
+ *
2894
+ * The common fields are repeated per member rather than factored into a shared
2895
+ * base alias, which would be a hoisted-unexported symbol on the public
2896
+ * entrypoint.
2897
+ */
2898
+ type MigrationErrorDetails = Readonly<{
2899
+ graphId: string;
2900
+ fromVersion: number;
2901
+ toVersion: number;
2902
+ /** Stable discriminant — branch on this, not the message. */
2903
+ reason: "schema-behind" | "breaking-change";
2904
+ /**
2905
+ * The structured diff behind the failure. Carries per-change `severity`
2906
+ * alongside `hasChanges` / `hasBreakingChanges`, so a caller can decide
2907
+ * "additive → proceed, incompatible → ask the user" without re-querying.
2908
+ */
2909
+ diff?: SchemaDiff;
2910
+ }> | Readonly<{
2911
+ graphId: string;
2912
+ fromVersion: number;
2913
+ toVersion: number;
2914
+ reason: "no-active-version" | "version-not-found";
2915
+ }> | Readonly<{
2916
+ graphId: string;
2917
+ fromVersion: number;
2918
+ toVersion: number;
2919
+ reason: "kind-removal";
2920
+ /**
2921
+ * The dropped kinds that still held rows, and so caused the refusal. A
2922
+ * kind the commit drops but that is already empty is permitted and does
2923
+ * NOT appear here. Both lists are sorted; at least one is non-empty.
2924
+ */
2925
+ droppedKinds: Readonly<{
2926
+ nodes: readonly string[];
2927
+ edges: readonly string[];
2928
+ }>;
2929
+ }>;
2930
+ /**
2931
+ * Thrown when schema migration fails.
2932
+ */
2933
+ declare class MigrationError extends TypeGraphError {
2934
+ readonly details: MigrationErrorDetails;
2935
+ constructor(message: string, details: MigrationErrorDetails, options?: {
2936
+ cause?: unknown;
2937
+ });
2938
+ }
2939
+ /**
2940
+ * Details for EagerMaterializationError.
2941
+ */
2942
+ type EagerMaterializationErrorDetails = Readonly<{
2943
+ graphId: string;
2944
+ failedIndexNames: readonly string[];
2945
+ }>;
2946
+ /**
2947
+ * Thrown by `Store.evolve(extension, { eager })` when the schema
2948
+ * commit succeeded but the follow-on `materializeIndexes()` produced
2949
+ * one or more failed entries.
2950
+ *
2951
+ * Recovery: the schema commit is NOT rolled back. The new `Store` is
2952
+ * fully constructed and (when `options.ref` was supplied) `ref.current`
2953
+ * already points to it — the caller can read the new store via the ref
2954
+ * and decide how to handle the failed indexes (retry, skip, alert).
2955
+ * The full `MaterializeIndexesResult` is attached as `.materialization`.
2956
+ *
2957
+ * @example
2958
+ * ```ts
2959
+ * const ref = { current: store };
2960
+ * try {
2961
+ * await store.evolve(extension, { ref, eager: {} });
2962
+ * } catch (error) {
2963
+ * if (error instanceof EagerMaterializationError) {
2964
+ * // schema is committed; ref.current is the new store
2965
+ * log.warn(
2966
+ * { failed: error.failedIndexNames },
2967
+ * "indexes did not materialize; will retry",
2968
+ * );
2969
+ * await ref.current.materializeIndexes();
2970
+ * } else {
2971
+ * throw error;
2972
+ * }
2973
+ * }
2974
+ * ```
2975
+ */
2976
+ declare class EagerMaterializationError extends TypeGraphError {
2977
+ readonly details: EagerMaterializationErrorDetails;
2978
+ /**
2979
+ * The full materialization result, including successful and failed
2980
+ * entries. Same shape as `Store.materializeIndexes()` returns.
2981
+ */
2982
+ readonly materialization: MaterializeIndexesResult;
2983
+ constructor(materialization: MaterializeIndexesResult, graphId: string);
2984
+ /**
2985
+ * Names of just the indexes that failed — derived from
2986
+ * `materialization.results` so the two views can never disagree.
2987
+ */
2988
+ get failedIndexNames(): readonly string[];
2989
+ }
2990
+ /**
2991
+ * Details for StaleVersionError. `actual` is the active version the rejecting
2992
+ * read observed, and is `0` only when the graph genuinely has no active version
2993
+ * (an initial-commit race where another writer initialized first, or a graph
2994
+ * whose schema rows were removed out of band). A concurrent advance always
2995
+ * reports the newly active version, so `0` is a reliable signal of absence
2996
+ * rather than of contention.
2997
+ */
2998
+ type StaleVersionErrorDetails = Readonly<{
2999
+ graphId: string;
3000
+ expected: number;
3001
+ actual: number;
3002
+ }>;
3003
+ /**
3004
+ * Thrown by `commitSchemaVersion`, `setActiveVersion`, and the schema write
3005
+ * fence a schema-managed Store write takes, when the caller's view of the
3006
+ * active schema version is out of date — another writer has already advanced
3007
+ * it.
3008
+ *
3009
+ * Recovery: re-read the active version with `getActiveSchema(graphId)`,
3010
+ * recompute against the new baseline, and retry. This is a routine
3011
+ * concurrency signal, not a bug.
3012
+ */
3013
+ declare class StaleVersionError extends TypeGraphError {
3014
+ readonly details: StaleVersionErrorDetails;
3015
+ constructor(details: StaleVersionErrorDetails, options?: {
3016
+ cause?: unknown;
3017
+ });
3018
+ }
3019
+ /**
3020
+ * Details for SchemaContentConflictError.
3021
+ */
3022
+ type SchemaContentConflictErrorDetails = Readonly<{
3023
+ graphId: string;
3024
+ version: number;
3025
+ existingHash: string;
3026
+ incomingHash: string;
3027
+ }>;
3028
+ /**
3029
+ * Thrown by `commitSchemaVersion` when a row already exists at the
3030
+ * target version with a *different* schema hash — i.e. two writers
3031
+ * committed materially different schemas at the same version number.
3032
+ *
3033
+ * Distinct from `StaleVersionError`: this is not a refetch-and-retry
3034
+ * situation, it's a content disagreement that needs operator
3035
+ * intervention. Typically caused by inconsistent application
3036
+ * deployments writing schemas that hash differently.
3037
+ */
3038
+ declare class SchemaContentConflictError extends TypeGraphError {
3039
+ readonly details: SchemaContentConflictErrorDetails;
3040
+ constructor(details: SchemaContentConflictErrorDetails, options?: {
3041
+ cause?: unknown;
3042
+ });
3043
+ }
3044
+ /**
3045
+ * Thrown when graph configuration is invalid.
3046
+ *
3047
+ * This includes invalid schema definitions, ontology conflicts,
3048
+ * and other configuration issues detected at graph creation time.
3049
+ */
3050
+ declare class ConfigurationError extends TypeGraphError {
3051
+ constructor(message: string, details?: Record<string, unknown>, options?: {
3052
+ cause?: unknown;
3053
+ suggestion?: string;
3054
+ });
3055
+ }
3056
+ /**
3057
+ * Why a destructive contribution rebuild is refused.
3058
+ *
3059
+ * - `vector-source-unavailable` — the projection is vector storage.
3060
+ * TypeGraph stores caller-supplied embeddings and nothing else: the
3061
+ * vectors exist only in the table a rebuild would drop, so there is no
3062
+ * source to reconstruct them from. Dropping anyway would silently
3063
+ * destroy the embeddings and hand back storage that looks healthy and
3064
+ * returns nothing. `store.reembedVectorField(kind, fieldPath, {
3065
+ * embed })` is the sanctioned destructive path — it takes the callback
3066
+ * that can regenerate what the drop destroys.
3067
+ * - `no-drop-ddl` — the active strategy declares no `dropDdl` for the
3068
+ * contribution, so TypeGraph does not know how to tear its storage
3069
+ * down. Synthesizing a `DROP TABLE` from the resolved name would
3070
+ * guess at a teardown the strategy never sanctioned.
3071
+ * - `no-schema-fence` — the backend exposes no transactional schema
3072
+ * fence (`schemaWriteTransaction`), so the drop, recreate, refill, and
3073
+ * stamp could not be made atomic. Running them unfenced could leave
3074
+ * storage attested but empty, or a concurrent schema writer
3075
+ * interleaved with the drop.
3076
+ * - `shared-storage-in-use` — the contribution's recorded shape is stale,
3077
+ * so only recreating its storage repairs it, but that storage is one
3078
+ * table holding other graphs' rows as well. Their content is derived
3079
+ * from their own nodes through their own schemas, so this process cannot
3080
+ * put it back. A rebuild that dropped anyway would leave every other
3081
+ * graph's search silently empty; one that re-stamped this graph's marker
3082
+ * without the drop would bless a physical shape nothing verified.
3083
+ */
3084
+ type ContributionRebuildRefusal = "vector-source-unavailable" | "no-drop-ddl" | "no-schema-fence" | "shared-storage-in-use";
3085
+ /**
3086
+ * Thrown when `store.rebuildContribution()` cannot honor a rebuild.
3087
+ *
3088
+ * A refusal, never a partial attempt: nothing has been dropped when this
3089
+ * throws. The point is that the alternative — proceeding — destroys data
3090
+ * that cannot be reconstructed, so the operation declines instead of
3091
+ * quietly doing less than its name promises.
3092
+ */
3093
+ declare class ContributionRebuildUnsupportedError extends TypeGraphError {
3094
+ readonly reason: ContributionRebuildRefusal;
3095
+ constructor(reason: ContributionRebuildRefusal, details?: Readonly<Record<string, unknown>>, options?: {
3096
+ cause?: unknown;
3097
+ });
3098
+ }
3099
+ /**
3100
+ * Thrown when an iterative graph algorithm exhausts its caller-visible round
3101
+ * budget before reaching its convergence predicate.
3102
+ */
3103
+ declare class GraphAlgorithmConvergenceError extends TypeGraphError {
3104
+ constructor(algorithm: string, maxIterations: number, options?: Readonly<{
3105
+ oscillating?: boolean;
3106
+ }>);
3107
+ }
3108
+ /** Stable reasons a weighted traversal can reject an edge's weight value. */
3109
+ type InvalidEdgeWeightReason = "missing" | "negative" | "non_numeric" | "out_of_range";
3110
+ /** Details for InvalidEdgeWeightError. */
3111
+ type InvalidEdgeWeightErrorDetails = Readonly<{
3112
+ /** Id of the first offending edge, in binary-collation order. */
3113
+ edgeId: string;
3114
+ /** Kind of the offending edge. */
3115
+ edgeKind: string;
3116
+ /** The audited weight property. */
3117
+ property: string;
3118
+ /** Why the weight was rejected. */
3119
+ reason: InvalidEdgeWeightReason;
3120
+ /** The offending value, when one was present and renderable. */
3121
+ value?: string;
3122
+ }>;
3123
+ /**
3124
+ * Thrown when a weighted graph algorithm finds an edge whose weight property
3125
+ * violates the weighted-traversal contract (missing without a default,
3126
+ * non-numeric, or negative). Raised before any traversal rounds run, so a
3127
+ * weighted call either observes a fully valid weight domain or fails fast.
3128
+ */
3129
+ declare class InvalidEdgeWeightError extends TypeGraphError {
3130
+ readonly details: InvalidEdgeWeightErrorDetails;
3131
+ constructor(details: InvalidEdgeWeightErrorDetails);
3132
+ }
3133
+ /** Thrown when an operation requires a backend capability it does not expose. */
3134
+ declare class UnsupportedBackendCapabilityError extends TypeGraphError {
3135
+ constructor(operation: string, capability: string, details?: Readonly<Record<string, unknown>>, suggestion?: string);
3136
+ }
3137
+ /** Stable reasons an intentionally trusted initial import can be rejected. */
3138
+ type TrustedImportErrorReason = "backend_unsupported" | "database_not_empty" | "fulltext_unsupported" | "history_unsupported" | "identity_unsupported" | "invalid_stream" | "revision_tracking_unsupported" | "uniqueness_unsupported" | "vector_unsupported";
3139
+ /** Thrown when the trusted initial-import contract is unavailable or violated. */
3140
+ declare class TrustedImportError extends TypeGraphError {
3141
+ constructor(message: string, reason: TrustedImportErrorReason, details?: Readonly<Record<string, unknown>>, options?: Readonly<{
3142
+ cause?: unknown;
3143
+ suggestion?: string;
3144
+ }>);
3145
+ }
3146
+ /**
3147
+ * Thrown to a graph export stream's consumer when the caller's `AbortSignal`
3148
+ * settled the stream instead of it reaching its end.
3149
+ *
3150
+ * Raised only after the export has given back everything it took, so receiving
3151
+ * it means the connection is already usable again. WHAT it took depends on the
3152
+ * backend: an export on one reporting `capabilities.transactions` holds a
3153
+ * repeatable-read snapshot (and, on a serialized connection, that connection's
3154
+ * stream lease), and both are settled before this is thrown; an export on a
3155
+ * backend without transactions holds neither, and its remaining reads are
3156
+ * simply abandoned — its already-delivered chunks were never one snapshot to
3157
+ * begin with. The message says which case applies. `cause` carries the signal's
3158
+ * own `reason` when the caller supplied one.
3159
+ */
3160
+ declare class ExportStreamCancelledError extends TypeGraphError {
3161
+ constructor(message: string, details?: Readonly<Record<string, unknown>>, options?: Readonly<{
3162
+ cause?: unknown;
3163
+ suggestion?: string;
3164
+ }>);
3165
+ }
3166
+ /**
3167
+ * Thrown when an export stream's consumer leaves a delivered chunk
3168
+ * unacknowledged for longer than its configured idle timeout.
3169
+ *
3170
+ * The timeout measures consumer idleness only: it starts when a chunk is
3171
+ * yielded and stops when the consumer asks for the next one. Receiving this
3172
+ * error means the timed-out export has settled its snapshot transaction and
3173
+ * released any serialized connection lease it held. `details.idleTimeoutMs`
3174
+ * carries the configured bound.
3175
+ */
3176
+ declare class ExportStreamIdleTimeoutError extends TypeGraphError {
3177
+ constructor(graphId: string, idleTimeoutMs: number, transactional: boolean);
3178
+ }
3179
+ /**
3180
+ * The stable `details.code` values raised by the recorded-capture guards on a
3181
+ * history- or revision-tracked store. These are the sanctioned branch points
3182
+ * for a portable caller that must pick a transaction strategy without
3183
+ * substring-matching {@link ConfigurationError} messages.
3184
+ *
3185
+ * - `RECORDED_CAPTURE_REQUIRES_CALLBACK_TRANSACTION`: `store.withTransaction`
3186
+ * was called on a history-enabled store, which has no flush point before the
3187
+ * caller commits — use `store.withRecordedTransaction` instead.
3188
+ * - `RECORDED_CAPTURE_RAW_SQL_DISABLED`: a raw SQL escape (`tx.sql`,
3189
+ * `backend.executeStatement`/`executeDdl`) was reached on a history-enabled
3190
+ * store, where it would bypass recorded-time capture.
3191
+ * - `REVISION_TRACKING_RAW_SQL_DISABLED`: the same raw SQL escape on a
3192
+ * revision-tracked store, where it would bypass the revision anchor.
3193
+ *
3194
+ * @see isRecordedCaptureGuardError
3195
+ */
3196
+ declare const RECORDED_CAPTURE_GUARD_CODES: readonly ["RECORDED_CAPTURE_REQUIRES_CALLBACK_TRANSACTION", "RECORDED_CAPTURE_RAW_SQL_DISABLED", "REVISION_TRACKING_RAW_SQL_DISABLED"];
3197
+ /** A stable, branchable code raised by a recorded-capture guard. */
3198
+ type RecordedCaptureGuardCode = (typeof RECORDED_CAPTURE_GUARD_CODES)[number];
3199
+ /**
3200
+ * A {@link ConfigurationError} narrowed to carry a {@link RecordedCaptureGuardCode}
3201
+ * in `details.code` — the shape {@link isRecordedCaptureGuardError} guarantees.
3202
+ * `C` narrows `details.code` to a single code when the guard was called with a
3203
+ * specific one; it defaults to the full union.
3204
+ */
3205
+ type RecordedCaptureGuardError<C extends RecordedCaptureGuardCode = RecordedCaptureGuardCode> = ConfigurationError & Readonly<{
3206
+ details: Readonly<{
3207
+ code: C;
3208
+ }>;
3209
+ }>;
3210
+ /**
3211
+ * Type guard for the recorded-capture guard errors, so a portable caller can
3212
+ * branch on the invariant a store enforced instead of substring-matching the
3213
+ * message. Pass `code` to narrow to a single guard; omit it to match any.
3214
+ *
3215
+ * Distinguishes "history capture forbids raw SQL here" from "this backend has
3216
+ * no transactions" (the latter carries no guard code — see
3217
+ * `TransactionContext.sqlAvailability` for the capability discriminant).
3218
+ *
3219
+ * Passing `code` also narrows `details.code` to that literal on the guarded
3220
+ * branch, so a caller can read the payload without re-checking.
3221
+ *
3222
+ * @example
3223
+ * ```typescript
3224
+ * // `withTransaction` is a compile error on a history-enabled store, so widen
3225
+ * // to the base Store surface to reach the runtime guard this branches on.
3226
+ * const store: Store<typeof graph> = historyStore;
3227
+ * try {
3228
+ * store.withTransaction(externalTx);
3229
+ * } catch (error) {
3230
+ * if (
3231
+ * isRecordedCaptureGuardError(
3232
+ * error,
3233
+ * "RECORDED_CAPTURE_REQUIRES_CALLBACK_TRANSACTION",
3234
+ * )
3235
+ * ) {
3236
+ * // error.details.code is now the literal, not the union.
3237
+ * await historyStore.withRecordedTransaction(externalTx, run);
3238
+ * } else {
3239
+ * throw error;
3240
+ * }
3241
+ * }
3242
+ * ```
3243
+ */
3244
+ declare function isRecordedCaptureGuardError<C extends RecordedCaptureGuardCode>(error: unknown, code: C): error is RecordedCaptureGuardError<C>;
3245
+ declare function isRecordedCaptureGuardError(error: unknown): error is RecordedCaptureGuardError;
3246
+ /**
3247
+ * Why a store's strategy-owned storage is not usable on the current
3248
+ * connection. Drives the {@link StoreNotInitializedError} message and
3249
+ * is surfaced in `details.reason` for programmatic handling.
3250
+ *
3251
+ * - `missing`: no durable materialization marker exists — the database
3252
+ * was never initialized for this graph's runtime contributions.
3253
+ * - `stale`: a marker exists but its recorded signature no longer
3254
+ * matches the resolved contribution DDL (strategy swap or DDL drift).
3255
+ * The hot path refuses rather than silently re-materializing.
3256
+ * - `failed`: the most recent boot-time materialization attempt
3257
+ * recorded an error. Boot may retry; the hot path refuses.
3258
+ */
3259
+ type StoreNotInitializedReason = "missing" | "stale" | "failed";
3260
+ /**
3261
+ * Details for StoreNotInitializedError. `graphId`/`reason` are always
3262
+ * present; callers may merge additional context (e.g. `logicalName`) via
3263
+ * `options.details`.
3264
+ */
3265
+ type StoreNotInitializedErrorDetails = Readonly<{
3266
+ graphId: string;
3267
+ reason: StoreNotInitializedReason;
3268
+ }> & Readonly<Record<string, unknown>>;
3269
+ /**
3270
+ * Thrown when a fulltext- or vector-dependent operation runs against a
3271
+ * connection whose strategy-owned storage has not been durably materialized.
3272
+ *
3273
+ * `createStore()` is a synchronous, zero-I/O attach: it never creates
3274
+ * tables, repairs DDL, or writes materialization markers. The durable
3275
+ * marker is written exclusively by the async boot path
3276
+ * (`createStoreWithSchema`). When a fulltext or embedding read/write — or
3277
+ * an adopted/business transaction — observes no valid marker, it refuses
3278
+ * loudly here instead of lazily emitting DDL on the hot path.
3279
+ */
3280
+ declare class StoreNotInitializedError extends TypeGraphError {
3281
+ readonly details: StoreNotInitializedErrorDetails;
3282
+ constructor(graphId: string, reason: StoreNotInitializedReason, options?: {
3283
+ cause?: unknown;
3284
+ details?: Readonly<Record<string, unknown>> & Readonly<{
3285
+ graphId?: never;
3286
+ reason?: never;
3287
+ }>;
3288
+ });
3289
+ }
3290
+ /** Details for a runtime contribution whose durable marker outlived storage. */
3291
+ type ContributionUnavailableErrorDetails = Readonly<{
3292
+ graphId: string;
3293
+ logicalName: "fulltext";
3294
+ physicalName: string;
3295
+ state: "physical-storage-missing";
3296
+ }>;
3297
+ /**
3298
+ * Thrown when a gated fulltext operation discovers that materialized storage
3299
+ * disappeared after its durable marker recorded successful initialization.
3300
+ */
3301
+ declare class ContributionUnavailableError extends TypeGraphError {
3302
+ readonly details: ContributionUnavailableErrorDetails;
3303
+ constructor(graphId: string, physicalName: string, options?: Readonly<{
3304
+ cause?: unknown;
3305
+ }>);
3306
+ }
3307
+ /**
3308
+ * Details for DatabaseOperationError.
3309
+ */
3310
+ type DatabaseOperationErrorDetails = Readonly<{
3311
+ operation: string;
3312
+ entity: string;
3313
+ /**
3314
+ * `"duplicate_key"` means the engine refused the write because the entity's
3315
+ * identity is already taken — the shape a concurrent create of the same new id
3316
+ * produces on an engine that does not serialize the two writers. It is a
3317
+ * *classified* driver failure, so callers that own a better error for the
3318
+ * condition (the create paths, which report it as "already exists") translate
3319
+ * it rather than surfacing it.
3320
+ */
3321
+ reason?: "no_row_returned" | "duplicate_key";
3322
+ /**
3323
+ * The entities the failed statement tried to insert, carried structurally so a
3324
+ * translating caller never has to parse the driver's message for them. One
3325
+ * element for a single insert; for a batch, every row in the failing chunk —
3326
+ * the engine reports the collision without saying which row lost.
3327
+ */
3328
+ attempted?: readonly Readonly<{
3329
+ kind: string;
3330
+ id: string;
3331
+ }>[];
3332
+ }>;
3333
+ /**
3334
+ * Thrown when a database operation fails unexpectedly.
3335
+ *
3336
+ * This indicates a system-level failure in the database backend,
3337
+ * not a user-recoverable error.
3338
+ */
3339
+ declare class DatabaseOperationError extends TypeGraphError {
3340
+ readonly details: DatabaseOperationErrorDetails;
3341
+ constructor(message: string, details: DatabaseOperationErrorDetails, options?: {
3342
+ cause?: unknown;
3343
+ });
3344
+ }
3345
+ /**
3346
+ * Details for EmbeddingDimensionChangedError.
3347
+ */
3348
+ type EmbeddingDimensionChangedErrorDetails = Readonly<{
3349
+ kind: string;
3350
+ fieldPath: string;
3351
+ declaredDimensions?: number;
3352
+ storedDimensions?: number;
3353
+ }>;
3354
+ /**
3355
+ * Thrown when an embedding field's declared dimension no longer matches the
3356
+ * dimension of its materialized per-field storage — i.e. a field's
3357
+ * `embedding(N)` was changed to `embedding(M)`. The stored vectors are invalid
3358
+ * under the new dimension and cannot be converted, only recomputed, so this is
3359
+ * a deliberate app-driven migration: call
3360
+ * `store.reembedVectorField(kind, fieldPath, ...)` to recreate the storage at
3361
+ * the new dimension and re-embed existing rows.
3362
+ */
3363
+ declare class EmbeddingDimensionChangedError extends TypeGraphError {
3364
+ readonly details: EmbeddingDimensionChangedErrorDetails;
3365
+ constructor(message: string, details: EmbeddingDimensionChangedErrorDetails, options?: {
3366
+ cause?: unknown;
3367
+ });
3368
+ }
3369
+ /**
3370
+ * Thrown when a query predicate cannot be compiled for the target database.
3371
+ */
3372
+ declare class UnsupportedPredicateError extends TypeGraphError {
3373
+ constructor(message: string, details?: Readonly<Record<string, unknown>>, options?: {
3374
+ cause?: unknown;
3375
+ suggestion?: string;
3376
+ });
3377
+ }
3378
+ /**
3379
+ * Thrown when a compiler invariant is violated.
3380
+ *
3381
+ * This indicates a bug in the query compiler — the compiler reached
3382
+ * a state that should be unreachable. These errors are not user-recoverable.
3383
+ */
3384
+ declare class CompilerInvariantError extends TypeGraphError {
3385
+ constructor(message: string, details?: Readonly<Record<string, unknown>>, options?: {
3386
+ cause?: unknown;
3387
+ });
3388
+ }
3389
+ /**
3390
+ * Thrown when an operation is attempted on a backend that has been disposed.
3391
+ *
3392
+ * This typically occurs during runtime teardown — for example, when a
3393
+ * Cloudflare Workers test runner resets Durable Object storage while
3394
+ * the TypeGraph backend still has queued operations.
3395
+ */
3396
+ declare class BackendDisposedError extends TypeGraphError {
3397
+ constructor(options?: {
3398
+ cause?: unknown;
3399
+ });
3400
+ }
3401
+ /**
3402
+ * Thrown when a statement is issued on a transaction-scoped backend after
3403
+ * its transaction boundary has already returned.
3404
+ *
3405
+ * The usual source is a callback that lets work escape it. `Promise.all`
3406
+ * rejects on its first rejection while its siblings keep running, so
3407
+ *
3408
+ * ```typescript
3409
+ * await store.transaction(async (tx) => {
3410
+ * await Promise.all([tx.nodes.Doc.create(a), tx.nodes.Doc.create(b)]);
3411
+ * });
3412
+ * ```
3413
+ *
3414
+ * leaves `b`'s remaining statements in flight when `a` fails. Those
3415
+ * statements have nowhere safe to go: the driver is about to emit `ROLLBACK`
3416
+ * on the same pinned connection and then hand it back to the pool, where a
3417
+ * late arrival would execute inside somebody else's transaction. TypeGraph
3418
+ * refuses them here instead.
3419
+ *
3420
+ * The error is normally invisible — `Promise.all` has already rejected with
3421
+ * the original failure, and discards this one.
3422
+ */
3423
+ declare class TransactionClosedError extends TypeGraphError {
3424
+ constructor(options?: {
3425
+ cause?: unknown;
3426
+ });
3427
+ }
3428
+ /**
3429
+ * Type guard for TypeGraphError.
3430
+ *
3431
+ * @example
3432
+ * ```typescript
3433
+ * try {
3434
+ * await store.nodes.Person.create({});
3435
+ * } catch (error) {
3436
+ * if (isTypeGraphError(error)) {
3437
+ * console.log(error.code, error.category);
3438
+ * }
3439
+ * }
3440
+ * ```
3441
+ */
3442
+ declare function isTypeGraphError(error: unknown): error is TypeGraphError;
3443
+ /**
3444
+ * Check if error is recoverable by user action (user or constraint error).
3445
+ *
3446
+ * User-recoverable errors can typically be resolved by:
3447
+ * - Fixing invalid input data
3448
+ * - Using different IDs or values
3449
+ * - Deleting conflicting data first
3450
+ *
3451
+ * @example
3452
+ * ```typescript
3453
+ * if (isUserRecoverable(error)) {
3454
+ * showErrorToUser(error.toUserMessage());
3455
+ * } else {
3456
+ * logAndAlertOps(error);
3457
+ * }
3458
+ * ```
3459
+ */
3460
+ declare function isUserRecoverable(error: unknown): boolean;
3461
+ /**
3462
+ * Check if error indicates a system/infrastructure issue.
3463
+ *
3464
+ * System errors typically require:
3465
+ * - Retry logic (for transient failures)
3466
+ * - Investigation (for persistent failures)
3467
+ * - Ops team notification
3468
+ */
3469
+ declare function isSystemError(error: unknown): boolean;
3470
+ /**
3471
+ * Check if error is a constraint violation.
3472
+ */
3473
+ declare function isConstraintError(error: unknown): boolean;
3474
+ /**
3475
+ * Extract suggestion from error if available.
3476
+ */
3477
+ declare function getErrorSuggestion(error: unknown): string | undefined;
3478
+
3479
+ /**
3480
+ * The `recursiveTraversal` capability: whether this engine can compute a
3481
+ * BOUNDED TRANSITIVE CLOSURE of a relation in one round trip — the traversal
3482
+ * primitive, not the SQL syntax.
3483
+ */
3484
+
3485
+ /**
3486
+ * Whether this engine can compute a BOUNDED TRANSITIVE CLOSURE of a relation
3487
+ * in one round trip — the traversal primitive, not the SQL syntax. A SQL
3488
+ * engine satisfies it with `WITH RECURSIVE`; a graph-native engine satisfies
3489
+ * it with a native expansion operator. What the capability promises is the
3490
+ * SEMANTICS: given a seed set, a step relation, and a hop bound, the engine
3491
+ * returns the reachable set (optionally with depth and path) without the
3492
+ * client issuing one statement per hop.
3493
+ *
3494
+ * Absent means SUPPORTED. Every engine TypeGraph ships supports it, and every
3495
+ * custom backend already has the six emission sites run against it
3496
+ * unconditionally: making absence mean `false` would refuse traversals that
3497
+ * work today. This mirrors `returning`, not `constraintClaims` — absence is
3498
+ * only allowed to mean "false" where absence is SAFE, and here it is not. A
3499
+ * backend that genuinely lacks the primitive must say so.
3500
+ */
3501
+ type RecursiveTraversalCapability = Readonly<{
3502
+ supported: boolean;
3503
+ /**
3504
+ * Why the engine lacks it — surfaced in every refusal's details so the
3505
+ * state is named rather than implied. Required when `supported: false` and
3506
+ * forbidden when `true`, so the union cannot carry a dangling reason.
3507
+ */
3508
+ reason?: string;
3509
+ }>;
3510
+ /**
3511
+ * The brand. Declared but never exported, and never assigned at runtime — it
3512
+ * exists only so that an object literal outside this module is not assignable
3513
+ * to {@link RecursiveTraversalVerdict}. Compare `VectorSlot`'s construction
3514
+ * discipline: the type is public, the constructor is the seam.
3515
+ */
3516
+ declare const RECURSIVE_TRAVERSAL_VERDICT: unique symbol;
3517
+ /**
3518
+ * The decision, branded so it can only originate from this module's
3519
+ * constructors. Round 1 made the verdict a required *field*, which forces a
3520
+ * token, not a verdict: any caller could satisfy it by writing
3521
+ * `{ supported: true }` inline, and nothing tied the value to the resolver.
3522
+ * The brand closes that at the type level.
3523
+ */
3524
+ type RecursiveTraversalVerdict = Readonly<{
3525
+ [RECURSIVE_TRAVERSAL_VERDICT]: true;
3526
+ } & ({
3527
+ supported: true;
3528
+ } | {
3529
+ supported: false;
3530
+ reason: string;
3531
+ })>;
3532
+ /** THE one reader of `capabilities.recursiveTraversal`, and THE one constructor. */
3533
+ declare function resolveRecursiveTraversal(capabilities: BackendCapabilities): RecursiveTraversalVerdict;
3534
+ /**
3535
+ * The ONE sanctioned way to obtain a verdict without a backend: the query
3536
+ * compiler's public entry point `compileQuery(ast, graphId, "postgres")`
3537
+ * takes no backend at all, so it has no capabilities to resolve from. The
3538
+ * reason string is required and is echoed in nothing — it exists so the call
3539
+ * site states why it is allowed to assume.
3540
+ */
3541
+ declare function assumeRecursiveTraversalSupported(reason: string): RecursiveTraversalVerdict;
3542
+ /** THE one refusal builder. */
3543
+ declare function recursiveTraversalUnsupportedError(verdict: Extract<RecursiveTraversalVerdict, {
3544
+ supported: false;
3545
+ }>, operation: string): ConfigurationError;
3546
+ /** THE one assertion: refuses when the verdict says the engine cannot. */
3547
+ declare function assertRecursiveTraversal(verdict: RecursiveTraversalVerdict, operation: string): asserts verdict is Extract<RecursiveTraversalVerdict, {
3548
+ supported: true;
3549
+ }>;
3550
+
2074
3551
  /**
2075
3552
  * JSON Schema type (subset used by Zod toJSONSchema).
2076
3553
  *
@@ -2239,6 +3716,91 @@ type SerializedSchema = Readonly<{
2239
3716
  */
2240
3717
  type SchemaHash = string;
2241
3718
 
3719
+ /**
3720
+ * The two independent facts a backend can report about concurrent-writer
3721
+ * serialization.
3722
+ */
3723
+ type PessimisticLockCapabilities = Readonly<{
3724
+ /** `pg_advisory_xact_lock`-style keyed locks scoped to the transaction. */
3725
+ advisoryLocks: boolean;
3726
+ /** `LOCK TABLE … IN … MODE`-style relation locks. */
3727
+ tableLocks: boolean;
3728
+ /**
3729
+ * The engine serializes concurrent writers by construction (SQLite's single
3730
+ * writer slot). This is what makes "take no lock" CORRECT on SQLite and
3731
+ * WRONG on an engine with neither locks nor a slot.
3732
+ */
3733
+ serializedWriters: boolean;
3734
+ }>;
3735
+ /**
3736
+ * The decision every lock site consumes, rather than a flag a caller would
3737
+ * have to re-derive.
3738
+ */
3739
+ type WriteFencePlan =
3740
+ /** Take the keyed/table lock. */
3741
+ Readonly<{
3742
+ kind: "lock";
3743
+ advisoryLocks: true;
3744
+ tableLocks: boolean;
3745
+ }>
3746
+ /** No lock needed: the engine serializes writers. */
3747
+ | Readonly<{
3748
+ kind: "engine-serialized";
3749
+ }>
3750
+ /** Neither. Every non-degradable fence refuses. */
3751
+ | Readonly<{
3752
+ kind: "unfenced";
3753
+ }>;
3754
+ /**
3755
+ * What `resolveWriteFencePlan` needs: the dialect (for the first-party
3756
+ * dialect-derivation arm and for the refusal message) and the declared
3757
+ * capabilities. Structural on purpose — see the module-private first-party
3758
+ * mark below, which is carried out-of-band rather than as a type member.
3759
+ */
3760
+ type WriteFenceTarget = Readonly<{
3761
+ dialect: SqlDialect;
3762
+ capabilities: BackendCapabilities;
3763
+ }>;
3764
+ /**
3765
+ * THE one reader of `capabilities.pessimisticLocks`, and THE one constructor
3766
+ * of a {@link WriteFencePlan}.
3767
+ *
3768
+ * Resolution order:
3769
+ *
3770
+ * 1. **Declared** — use the declaration. Every first-party backend declares
3771
+ * `pessimisticLocks` (`SQLITE_CAPABILITIES` / `POSTGRES_CAPABILITIES`),
3772
+ * and a custom backend takes this path by writing one line.
3773
+ * 2. **Absent, first-party factory** — derive from `dialect`
3774
+ * (`postgres` → `{advisoryLocks:true,tableLocks:true,serializedWriters:false}`,
3775
+ * `sqlite` → `{advisoryLocks:false,tableLocks:false,serializedWriters:true}`),
3776
+ * which is exactly what every lock site used to compute inline. After
3777
+ * A1/A2 land, nothing in-tree reaches this arm — both bundled factories
3778
+ * declare `pessimisticLocks` unconditionally — so it is reachable only
3779
+ * from tests that build a backend object bypassing the factories'
3780
+ * declared capabilities while still carrying the first-party mark.
3781
+ * 3. **Absent, anything else** — `unfenced`. Conservative: an undeclared
3782
+ * custom backend is by definition uncertified, and inferring lock support
3783
+ * from `dialect` alone is the unsound inference this capability replaces
3784
+ * (a Doltgres-shaped backend reporting `dialect: "postgres"` need not
3785
+ * honor `pg_advisory_xact_lock`).
3786
+ */
3787
+ declare function resolveWriteFencePlan(target: WriteFenceTarget): WriteFencePlan;
3788
+ /**
3789
+ * THE refusal for a fence that cannot degrade: `unfenced` always refuses,
3790
+ * and a `lock` plan that lacks the table lock an operation requires refuses
3791
+ * too — the declared-advisory-only posture, which T15 exercises as its own
3792
+ * matrix row.
3793
+ *
3794
+ * `engine-serialized` satisfies both requirements: the writer slot is the
3795
+ * fence, whichever shape of lock the caller would otherwise have taken.
3796
+ *
3797
+ * @throws {ConfigurationError} under `unfenced`, and under
3798
+ * `kind: "lock" && tableLocks === false` when `requires === "table-lock"`.
3799
+ */
3800
+ declare function requireWriteFence(plan: WriteFencePlan, operation: string, requires: "advisory-lock" | "table-lock"): Extract<WriteFencePlan, {
3801
+ kind: "lock" | "engine-serialized";
3802
+ }>;
3803
+
2242
3804
  /**
2243
3805
  * Backend interface types for TypeGraph storage.
2244
3806
  *
@@ -2531,6 +4093,50 @@ type BackendCapabilities = Readonly<{
2531
4093
  * equivalent to every member `false`).
2532
4094
  */
2533
4095
  contributions?: ContributionCapabilities | undefined;
4096
+ /**
4097
+ * Whether this engine can compute a bounded transitive closure of a
4098
+ * relation in one round trip (a recursive CTE, or a graph-native
4099
+ * expansion operator).
4100
+ *
4101
+ * Absent means SUPPORTED. Every engine TypeGraph ships supports it, and
4102
+ * every custom backend on this release already has every recursion site
4103
+ * run against it unconditionally: making absence mean `false` would
4104
+ * refuse traversals that work today. See
4105
+ * {@link RecursiveTraversalCapability} for the full contract.
4106
+ */
4107
+ recursiveTraversal?: RecursiveTraversalCapability | undefined;
4108
+ /**
4109
+ * Whether this engine can serialize concurrent writers, and how: keyed
4110
+ * advisory locks, relation-level table locks, or a single writer slot that
4111
+ * serializes by construction.
4112
+ *
4113
+ * Absent means `unfenced` for any backend the first-party factories did
4114
+ * not build (`resolveWriteFencePlan`, `src/backend/capabilities/write-fence.ts`):
4115
+ * an undeclared custom backend is refused at construction for Operational
4116
+ * Identity and for TypeGraph-owned recorded-clock allocation
4117
+ * (`history` / `revisionTracking`) rather than silently emitting locks the
4118
+ * engine may not honor. Every first-party backend declares this member
4119
+ * (`SQLITE_CAPABILITIES`, `POSTGRES_CAPABILITIES`), so the refusal is
4120
+ * reachable only by a backend this library did not build.
4121
+ */
4122
+ pessimisticLocks?: PessimisticLockCapabilities | undefined;
4123
+ /**
4124
+ * Who allocates recorded-time revisions. `"typegraph-relations"` (the
4125
+ * default, and every first-party backend) means TypeGraph owns a clock row
4126
+ * and performs the read/advance/write that `lockRecordedClock` fences —
4127
+ * which is undegradable, so an `unfenced` engine is refused at
4128
+ * construction. `"engine-native"` means the engine supplies the recorded
4129
+ * axis itself (WS9's ruled BraidDB posture: pinned-handle `AS OF`).
4130
+ *
4131
+ * TODAY THE ENGINE-NATIVE READ/WRITE PATH DOES NOT EXIST YET (follow-up
4132
+ * F8, owned by WS9). The capture path allocates the TypeGraph clock
4133
+ * unconditionally, so declaring `"engine-native"` and enabling
4134
+ * clock-allocating history/revision tracking is refused at construction by
4135
+ * its own typed error naming the interim state
4136
+ * (`refuseEngineNativeRecordedTimeNotYetImplemented`,
4137
+ * `src/backend/capabilities/recorded-time-ownership.ts`).
4138
+ */
4139
+ recordedTimeOwnership?: "typegraph-relations" | "engine-native";
2534
4140
  }>;
2535
4141
  /** Keeps session-scoped analytics honest when a required SQL feature is absent. */
2536
4142
  declare function normalizeGraphAnalyticsCapabilities(capabilities: BackendCapabilities): BackendCapabilities;
@@ -3677,6 +5283,56 @@ type IdentityTableNames = Readonly<{
3677
5283
  identityClosure: string;
3678
5284
  identitySeparation: string;
3679
5285
  }>;
5286
+ /**
5287
+ * The physical names of the three recorded relations. Named once so the
5288
+ * ports that speak about them cannot drift apart — the {@link IdentityTableNames}
5289
+ * precedent.
5290
+ */
5291
+ type RecordedTableNames = Readonly<{
5292
+ recordedClock: string;
5293
+ recordedEdges: string;
5294
+ recordedNodes: string;
5295
+ }>;
5296
+ /**
5297
+ * One recorded relation's provisioning DDL, with the roles the caller needs
5298
+ * SEPARATED rather than positional.
5299
+ */
5300
+ type RecordedRelationDdl = Readonly<{
5301
+ /** The single `CREATE TABLE` statement. */
5302
+ createTable: string;
5303
+ /** Its index/constraint statements, in application order. */
5304
+ indexes: readonly string[];
5305
+ /**
5306
+ * The name the ENGINE will have given this relation's PRIMARY KEY constraint
5307
+ * once `createTable` has executed, or `undefined` on an engine that does not
5308
+ * name PK constraints separately (SQLite).
5309
+ *
5310
+ * NOT "the name the DDL text declares": both bundled emitters push an unnamed
5311
+ * inline `PRIMARY KEY (…)` (`ddl.ts:114-118`, `:441-445`), so on PostgreSQL the
5312
+ * server derives `<table>_pkey`. The point of the field is that the derivation
5313
+ * is an ENGINE convention, and the only honest source of it is whoever authored
5314
+ * the DDL for that engine — a migration that reconstructs it bakes one adapter's
5315
+ * convention in.
5316
+ *
5317
+ * The name is returned UNREDUCED. Reducing an over-long identifier is a
5318
+ * separate decision with a separate owner (`shortenedIdentifier`), and it
5319
+ * applies only to the RENAME's target. The source name is the *temporary*
5320
+ * table's PK name, and temp table names are hash-derived and short BY
5321
+ * CONSTRUCTION (`` `__tg_${role}_${shortHash(tableName)}` ``, an 8-char
5322
+ * hash, so `<temp>_pkey` is at most ~21 bytes for any configured table
5323
+ * name) — nowhere near the 63-byte ceiling. So the split is a structural
5324
+ * fact about the temp-name shape, not a claim about PostgreSQL's
5325
+ * truncation semantics: `shortenedIdentifier` is the identity on the
5326
+ * source for every reachable input, and its effect is observable only on
5327
+ * the target.
5328
+ *
5329
+ * A backend must apply this option consistently across name sets: return a
5330
+ * name for both the temporary and final relation, or `undefined` for both.
5331
+ * The migration refuses a mixed pair because silently dropping either name
5332
+ * would leave the swapped relation with a backend-inconsistent constraint.
5333
+ */
5334
+ primaryKeyConstraintName?: string | undefined;
5335
+ }>;
3680
5336
  /**
3681
5337
  * The database-global extensions TypeGraph installs on a caller's behalf.
3682
5338
  *
@@ -4108,6 +5764,21 @@ type GraphBackend = Readonly<{
4108
5764
  * @internal
4109
5765
  */
4110
5766
  identityTableDdl?: (this: void, tableNames: IdentityTableNames) => readonly string[];
5767
+ /**
5768
+ * The provisioning DDL for the three recorded relations under the given
5769
+ * physical names, keyed by logical relation. Used only by the offline legacy
5770
+ * preview-schema migration, which builds temp tables, copies, and swaps —
5771
+ * so it is called TWICE per migration, once per name set, and the migration
5772
+ * (not the backend) composes the temp `createTable` with the final `indexes`.
5773
+ *
5774
+ * A backend that omits this cannot be migrated FROM the timestamp-only
5775
+ * preview schema — a schema only the bundled Drizzle backends ever created.
5776
+ * `migrateLegacyRecordedTime` REFUSES with `UnsupportedBackendCapabilityError`
5777
+ * naming this port rather than emitting DDL it cannot author.
5778
+ *
5779
+ * @internal
5780
+ */
5781
+ recordedTableDdl?: (this: void, tableNames: RecordedTableNames) => Readonly<Record<keyof RecordedTableNames, RecordedRelationDdl>>;
4111
5782
  /**
4112
5783
  * Look up a recorded materialization for a declared index by its
4113
5784
  * physical SQL index name. Returns `undefined` if no row exists.
@@ -5904,4 +7575,4 @@ type RelationalIndexDeclaration = NodeIndexDeclaration | EdgeIndexDeclaration;
5904
7575
  type IndexDeclaration = RelationalIndexDeclaration | VectorIndexDeclaration;
5905
7576
  type SystemColumnName = "graph_id" | "kind" | "id" | "from_kind" | "from_id" | "to_kind" | "to_id" | "deleted_at" | "valid_from" | "valid_to" | "created_at" | "updated_at" | "version";
5906
7577
 
5907
- export { type DeleteEmbeddingParams as $, ALL_FULLTEXT_MODES as A, BASE_CONTRIBUTION_OWNER as B, type Cardinality as C, type ContributionMaterializationBackend as D, type ContributionMaterializationIdentity as E, type ContributionMaterializationRow as F, type ContributionProbeContribution as G, type ContributionProbeEntry as H, type IndexDeclaration as I, type ContributionProbeResult as J, type ContributionProbeState as K, type ContributionRebuildResult as L, type ContributionRebuildScope as M, type ContributionRepairEntry as N, type ContributionRepairResult as O, type ContributionRepopulationStats as P, type CountEdgesByKindParams as Q, type CountEdgesFromParams as R, type CountNodesByKindParams as S, type CreateVectorIndexParams as T, D1_MAX_BIND_PARAMETERS as U, DATABASE_EXTENSION_NAMES as V, DURABLE_OBJECT_MAX_BIND_PARAMETERS as W, type DatabaseExtensionName as X, type DeleteBehavior as Y, type DeleteEdgeParams as Z, type DeleteEdgesBatchParams as _, ALL_META_EDGE_NAMES as a, type GraphLifecycleBackend as a$, type DeleteFulltextBatchParams as a0, type DeleteFulltextParams as a1, type DeleteNodeParams as a2, type DeleteUniqueParams as a3, type DialectAdapter as a4, type DialectCapabilities as a5, type DialectRecursiveQueryStrategy as a6, type DialectStandardQueryStrategy as a7, type DialectVectorPredicateStrategy as a8, type DisjointOverlapRow as a9, type ExtensionPropertyType as aA, type ExtensionSearchableModifier as aB, type ExtensionStringProperty as aC, type ExtensionUniqueConstraint as aD, type ExtensionUniqueWhere as aE, FULLTEXT_CONTRIBUTION_NAME as aF, type FilteredApproximateSearch as aG, type FilteredApproximateSearchMode as aH, type FindEdgesByEndpointSetParams as aI, type FindEdgesByHeterogeneousEndpointSetParams as aJ, type FindEdgesByKindParams as aK, type FindEdgesConnectedToParams as aL, type FindNodesByKindParams as aM, type FulltextBatchRow as aN, type FulltextCapabilities as aO, type FulltextOperationBackend as aP, type FulltextQueryMode as aQ, type FulltextSearchParams as aR, type FulltextSearchResult as aS, type FulltextStrategy as aT, type GraphAnalyticsCapabilities as aU, type GraphBackend as aV, type GraphEntityReadBackend as aW, type GraphEntityWriteBackend as aX, type GraphExtension as aY, type GraphExtensionVersion as aZ, type GraphIdentityConfig as a_, type DropVectorIndexParams as aa, type EdgeCardinalityDeclaration as ab, type EdgeClaimOutcome as ac, type EdgeEntityReadBackend as ad, type EdgeEntityWriteBackend as ae, type EdgeExistsBetweenParams as af, type EdgeIndexDeclaration as ag, type EdgeIndexDirection as ah, type EdgeRow as ai, type EndpointExistence as aj, type ExtensionArrayItemType as ak, type ExtensionArrayProperty as al, type ExtensionBooleanProperty as am, type ExtensionEdgeDef as an, type ExtensionEdgeIndex as ao, type ExtensionEmbeddingModifier as ap, type ExtensionEnumProperty as aq, type ExtensionIndex as ar, type ExtensionIndexWhere as as, type ExtensionNodeDef as at, type ExtensionNodeIndex as au, type ExtensionNumberProperty as av, type ExtensionObjectFieldProperty as aw, type ExtensionObjectProperty as ax, type ExtensionOntologyRelation as ay, type ExtensionPropertyModifiers as az, type AdapterBackend as b, type SchemaKindEmptinessProbe as b$, type GraphReadBackend as b0, type HardDeleteEdgeParams as b1, type HardDeleteNodeParams as b2, type HardDeleteUniquesByConcreteKindParams as b3, type HardDeleteUniquesByNodeIdsParams as b4, type HybridSearchParams as b5, type HybridSearchRow as b6, type IdentityTableNames as b7, type InListParameterOptions as b8, type IndexDeclarationBase as b9, type NodeEntityWriteBackend as bA, type NodeIndexDeclaration as bB, type NodeRow as bC, type NullCheckOp as bD, POSTGRES_CAPABILITIES as bE, POSTGRES_MAX_BIND_PARAMETERS as bF, Placeholder as bG, type PopulatedSchemaKind as bH, type PurgeEdgeClaimsParams as bI, type QueryExecutionBackend as bJ, type RawQueryExecutionBackend as bK, type RawStatementExecutionBackend as bL, type ReadConstraintFenceViolationsParams as bM, type RecordContributionMaterializationParams as bN, type RecordIndexMaterializationParams as bO, type RecordKindRemovalParams as bP, type RelationalIndexDeclaration as bQ, type RelationalIndexMethod as bR, type ReleaseIndexMaterializationClaimParams as bS, type RemovalMaterializationBackend as bT, type RenderedSql as bU, type ResolvedSqlTableNames as bV, type RowProps as bW, SQLITE_CAPABILITIES as bX, SQLITE_MAX_BIND_PARAMETERS as bY, type SchemaCommitBackend as bZ, type SchemaCommitPreflightBackend as b_, type IndexEntity as ba, type IndexMaterializationBackend as bb, type IndexMaterializationRow as bc, type IndexOrigin as bd, type IndexScope as be, type IndexWhereExpression as bf, type IndexWhereLiteral as bg, type IndexWhereOp as bh, type IndexWhereOperand as bi, type InferenceType as bj, type InsertEdgeParams as bk, type InsertNodeParams as bl, type InsertSchemaParams as bm, type InsertUniqueParams as bn, type IntentSql as bo, type JsonPointer as bp, type JsonSchema as bq, type JsonValue as br, type KindAnnotations as bs, type KindEntity as bt, type KindRemovalRow as bu, type LiveNodeRow as bv, type LockSchemaVersionForWriteParams as bw, MODERN_SQLITE_MAX_BIND_PARAMETERS as bx, type MetaEdgeName as by, type NodeEntityReadBackend as bz, type AdapterBackendTransactions as c, buildFulltextCapabilities as c$, type SchemaReadBackend as c0, type SchemaVersionRow as c1, type SchemaWriteFenceBackend as c2, type SerializedClosures as c3, type SerializedEdgeDef as c4, type SerializedMetaEdge as c5, type SerializedNodeDef as c6, type SerializedOntology as c7, type SerializedOntologyRelation as c8, type SerializedSchema as c9, type UpdateEdgeParams as cA, type UpdateNodeParams as cB, type UpdateNodeSetParams as cC, type UpdateNodeSetResult as cD, type UpsertEmbeddingBatchParams as cE, type UpsertEmbeddingBatchRow as cF, type UpsertEmbeddingParams as cG, type UpsertFulltextBatchParams as cH, type UpsertFulltextParams as cI, VECTOR_CONTRIBUTION_PREFIX as cJ, type ValueType as cK, type VectorCapabilities as cL, type VectorIndexDeclaration as cM, type VectorIndexImplementation as cN, type VectorIndexMetric as cO, type VectorIndexParams as cP, type VectorIndexType as cQ, type VectorMetric as cR, type VectorOperationBackend as cS, type VectorSearchFrontierTuning as cT, type VectorSearchParams as cU, type VectorSearchResult as cV, type VectorSlot as cW, type VectorStrategy as cX, assertFiniteEmbedding as cY, assertVectorMinScore as cZ, assertVectorSearchLimit as c_, type SerializedUniqueConstraint as ca, type SetActiveVersionParams as cb, type SqlChunk as cc, type SqlCompilationBackend as cd, type SqlDialect as ce, type SqlFragment as cf, type SqlIdentifierChunk as cg, type SqlIntent as ch, type SqlParameterChunk as ci, type SqlPlaceholderChunk as cj, type SqlTableNames as ck, type SqlTag as cl, type SqlTextChunk as cm, type StrategyTableContribution as cn, type SystemColumnName as co, type TableContribution as cp, type TemporalMode as cq, type TombstonedNodeRow as cr, type TransactionBackend as cs, type TransactionOptions as ct, type TransactionReadBackend as cu, type TrustedImportOptions as cv, type TrustedImportSession as cw, type UniqueConstraintBackend as cx, type UniqueRow as cy, type UniquenessScope as cz, type BackendCapabilities as d, type NodeId as d$, buildVectorCapabilities as d0, fts5Strategy as d1, isLiveNodeRow as d2, isSqlFragment as d3, isSqlPlaceholder as d4, isTombstonedNodeRow as d5, normalizeGraphAnalyticsCapabilities as d6, quoteIdentifier as d7, renderPostgres as d8, renderSql as d9, type AggregateComparisonPredicate as dA, type TraversalDirection as dB, type OntologyRelation as dC, type EdgeType as dD, type AllEdgeTypes as dE, type AllNodeTypes as dF, CURRENT_GRAPH_EXTENSION_VERSION as dG, DEFAULT_SQL_SCHEMA as dH, type EdgeId as dI, type EdgeKinds as dJ, type EdgeProps as dK, type EdgeRegistration as dL, type EdgeTypeWithEndpoints as dM, type ExternalRecordedReadSource as dN, type GetEdgeType as dO, type GetNodeType as dP, type GraphDefaults as dQ, type HybridFusionOptions as dR, type JsonPointerFor as dS, type JsonPointerInput as dT, type JsonPointerSegment as dU, type JsonPointerSegments as dV, type JsonPointerSegmentsFor as dW, LEGACY_GRAPH_EXTENSION_VERSION as dX, MAX_JSON_POINTER_DEPTH as dY, type MetaEdge as dZ, type MetaEdgeProperties as d_, renderSqlInline as da, renderSqlite as db, rowPropsToJsonText as dc, rowPropsToObject as dd, shortHash as de, sql as df, tsvectorStrategy as dg, vectorMinScoreCondition as dh, vectorPhysicalName as di, vectorScoreExpression as dj, type GraphDef as dk, type QueryAst as dl, type EdgeIndexConfig as dm, type EdgeIndexWhereBuilder as dn, type IndexWhereFieldBuilder as dp, type IndexWhereInput as dq, type NodeIndexConfig as dr, type NodeIndexWhereBuilder as ds, type NodeType as dt, type AnyEdgeType as du, SqlSchema as dv, type SchemaHash as dw, type AggregateExpr as dx, type FieldRef as dy, type ComparisonOp as dz, type BackendIdentity as e, type NodeKinds as e0, type NodeProps as e1, type NodeRegistration as e2, type OrderSpec as e3, type ParameterRef as e4, type RecordedRelationOptions as e5, type ResolveJsonPointer as e6, type ResolveJsonPointerSegments as e7, type SortDirection as e8, type TraversalExpansion as e9, type RecordedReadBinding as eA, type SelectiveField as eB, type ComposableQuery as eC, type SetOperationType as eD, type SetOperation as eE, type BackendValidityEndMutation as eF, GRAPH_EXTENSION_TOP_LEVEL_KEYS as eG, type GraphExtensionTopLevelKey as eH, type UniqueConstraint as ea, asEdgeId as eb, asNodeId as ec, createSqlSchema as ed, defineGraph as ee, getEdgeKinds as ef, getNodeKinds as eg, isEdgeType as eh, isEdgeTypeWithEndpoints as ei, isGraphDef as ej, isMetaEdge as ek, isNodeType as el, joinJsonPointers as em, jsonPointer as en, normalizeJsonPointer as eo, parseJsonPointer as ep, recordedRelation as eq, type PredicateExpression as er, type VectorMetricType as es, type Traversal as et, type NodePredicate as eu, type ProjectedField as ev, type AggregateOrderSpec as ew, type GroupBySpec as ex, type RecursiveCyclePolicy as ey, type VectorSlotMap as ez, type BackendLifecycle as f, type BackendMaintenance as g, type BackendTransactions as h, type CheckUniqueBatchParams as i, type CheckUniqueParams as j, type ClaimEdgeCardinalityParams as k, type ClaimIndexMaterializationParams as l, type Collation as m, type CommitSchemaVersionExpected as n, type CommitSchemaVersionIfKindsEmptyResult as o, type CommitSchemaVersionParams as p, type CompiledRowsSql as q, type CompiledSelectSql as r, type CompiledStatementSql as s, type CompiledTemporaryStatementSql as t, type ConstraintFenceViolationRows as u, type ContendedEdgeRow as v, type ContendedUniqueRow as w, type ContributionCapabilities as x, type ContributionDiagnostic as y, type ContributionDiagnosticState as z };
7578
+ export { type CountNodesByKindParams as $, type AdapterBackend as A, type BackendCapabilities as B, type ContributionDiagnostic as C, type ConstraintFenceViolationRows as D, type ContendedEdgeRow as E, type FulltextStrategy as F, type GraphIdentityConfig as G, type ContendedUniqueRow as H, type IndexDeclaration as I, type JsonPointer as J, type KindEntity as K, type ContributionCapabilities as L, type ContributionMaterializationBackend as M, type ContributionMaterializationIdentity as N, type ContributionMaterializationRow as O, type ContributionProbeContribution as P, type QueryAst as Q, type ContributionProbeEntry as R, type ContributionProbeResult as S, type TemporalMode as T, type ContributionProbeState as U, type VectorStrategy as V, type ContributionRebuildResult as W, type ContributionRebuildScope as X, type ContributionRepopulationStats as Y, type CountEdgesByKindParams as Z, type CountEdgesFromParams as _, type ContributionDiagnosticState as a, type FulltextSearchResult as a$, type CreateVectorIndexParams as a0, D1_MAX_BIND_PARAMETERS as a1, DATABASE_EXTENSION_NAMES as a2, DURABLE_OBJECT_MAX_BIND_PARAMETERS as a3, type DatabaseExtensionName as a4, type DeleteBehavior as a5, type DeleteEdgeParams as a6, type DeleteEdgesBatchParams as a7, type DeleteEmbeddingParams as a8, type DeleteFulltextBatchParams as a9, type ExtensionIndex as aA, type ExtensionIndexWhere as aB, type ExtensionNodeDef as aC, type ExtensionNodeIndex as aD, type ExtensionNumberProperty as aE, type ExtensionObjectFieldProperty as aF, type ExtensionObjectProperty as aG, type ExtensionOntologyRelation as aH, type ExtensionPropertyModifiers as aI, type ExtensionPropertyType as aJ, type ExtensionSearchableModifier as aK, type ExtensionStringProperty as aL, type ExtensionUniqueConstraint as aM, type ExtensionUniqueWhere as aN, FULLTEXT_CONTRIBUTION_NAME as aO, type FilteredApproximateSearch as aP, type FilteredApproximateSearchMode as aQ, type FindEdgesByEndpointSetParams as aR, type FindEdgesByHeterogeneousEndpointSetParams as aS, type FindEdgesByKindParams as aT, type FindEdgesConnectedToParams as aU, type FindNodesByKindParams as aV, type FulltextBatchRow as aW, type FulltextCapabilities as aX, type FulltextOperationBackend as aY, type FulltextQueryMode as aZ, type FulltextSearchParams as a_, type DeleteFulltextParams as aa, type DeleteNodeParams as ab, type DeleteUniqueParams as ac, type DialectAdapter as ad, type DialectCapabilities as ae, type DialectRecursiveQueryStrategy as af, type DialectStandardQueryStrategy as ag, type DialectVectorPredicateStrategy as ah, type DisjointOverlapRow as ai, type DropVectorIndexParams as aj, type EdgeCardinalityDeclaration as ak, type EdgeClaimOutcome as al, type EdgeEntityReadBackend as am, type EdgeEntityWriteBackend as an, type EdgeExistsBetweenParams as ao, type EdgeIndexDeclaration as ap, type EdgeIndexDirection as aq, type EdgeRow as ar, type EndpointExistence as as, type ExtensionArrayItemType as at, type ExtensionArrayProperty as au, type ExtensionBooleanProperty as av, type ExtensionEdgeDef as aw, type ExtensionEdgeIndex as ax, type ExtensionEmbeddingModifier as ay, type ExtensionEnumProperty as az, type ContributionRepairEntry as b, type ReleaseIndexMaterializationClaimParams as b$, type GraphAnalyticsCapabilities as b0, type GraphEntityReadBackend as b1, type GraphEntityWriteBackend as b2, type GraphExtension as b3, type GraphExtensionVersion as b4, type GraphLifecycleBackend as b5, type GraphReadBackend as b6, type HardDeleteEdgeParams as b7, type HardDeleteNodeParams as b8, type HardDeleteUniquesByConcreteKindParams as b9, type LockSchemaVersionForWriteParams as bA, MODERN_SQLITE_MAX_BIND_PARAMETERS as bB, type MetaEdgeName as bC, type NodeEntityReadBackend as bD, type NodeEntityWriteBackend as bE, type NodeIndexDeclaration as bF, type NodeRow as bG, type NullCheckOp as bH, POSTGRES_CAPABILITIES as bI, POSTGRES_MAX_BIND_PARAMETERS as bJ, type PessimisticLockCapabilities as bK, Placeholder as bL, type PopulatedSchemaKind as bM, type PurgeEdgeClaimsParams as bN, type QueryExecutionBackend as bO, type RawQueryExecutionBackend as bP, type RawStatementExecutionBackend as bQ, type ReadConstraintFenceViolationsParams as bR, type RecordContributionMaterializationParams as bS, type RecordIndexMaterializationParams as bT, type RecordKindRemovalParams as bU, type RecordedRelationDdl as bV, type RecordedTableNames as bW, type RecursiveTraversalCapability as bX, type RecursiveTraversalVerdict as bY, type RelationalIndexDeclaration as bZ, type RelationalIndexMethod as b_, type HardDeleteUniquesByNodeIdsParams as ba, type HybridSearchParams as bb, type HybridSearchRow as bc, type IdentityTableNames as bd, type InListParameterOptions as be, type IndexDeclarationBase as bf, type IndexEntity as bg, type IndexMaterializationBackend as bh, type IndexMaterializationRow as bi, type IndexOrigin as bj, type IndexScope as bk, type IndexWhereExpression as bl, type IndexWhereLiteral as bm, type IndexWhereOp as bn, type IndexWhereOperand as bo, type InferenceType as bp, type InsertEdgeParams as bq, type InsertNodeParams as br, type InsertSchemaParams as bs, type InsertUniqueParams as bt, type IntentSql as bu, type JsonSchema as bv, type JsonValue as bw, type KindAnnotations as bx, type KindRemovalRow as by, type LiveNodeRow as bz, type ContributionRepairResult as c, type VectorSearchFrontierTuning as c$, type RemovalMaterializationBackend as c0, type RenderedSql as c1, type ResolvedSqlTableNames as c2, type RowProps as c3, SQLITE_CAPABILITIES as c4, SQLITE_MAX_BIND_PARAMETERS as c5, type SchemaCommitBackend as c6, type SchemaCommitPreflightBackend as c7, type SchemaKindEmptinessProbe as c8, type SchemaReadBackend as c9, type TransactionBackend as cA, type TransactionOptions as cB, type TransactionReadBackend as cC, type TrustedImportOptions as cD, type TrustedImportSession as cE, type UniqueConstraintBackend as cF, type UniqueRow as cG, type UniquenessScope as cH, type UpdateEdgeParams as cI, type UpdateNodeParams as cJ, type UpdateNodeSetParams as cK, type UpdateNodeSetResult as cL, type UpsertEmbeddingBatchParams as cM, type UpsertEmbeddingBatchRow as cN, type UpsertEmbeddingParams as cO, type UpsertFulltextBatchParams as cP, type UpsertFulltextParams as cQ, VECTOR_CONTRIBUTION_PREFIX as cR, type ValueType as cS, type VectorCapabilities as cT, type VectorIndexDeclaration as cU, type VectorIndexImplementation as cV, type VectorIndexMetric as cW, type VectorIndexParams as cX, type VectorIndexType as cY, type VectorMetric as cZ, type VectorOperationBackend as c_, type SchemaVersionRow as ca, type SchemaWriteFenceBackend as cb, type SerializedClosures as cc, type SerializedEdgeDef as cd, type SerializedMetaEdge as ce, type SerializedNodeDef as cf, type SerializedOntology as cg, type SerializedOntologyRelation as ch, type SerializedSchema as ci, type SerializedUniqueConstraint as cj, type SetActiveVersionParams as ck, type SqlChunk as cl, type SqlCompilationBackend as cm, type SqlDialect as cn, type SqlFragment as co, type SqlIdentifierChunk as cp, type SqlIntent as cq, type SqlParameterChunk as cr, type SqlPlaceholderChunk as cs, type SqlTableNames as ct, type SqlTag as cu, type SqlTextChunk as cv, type StrategyTableContribution as cw, type SystemColumnName as cx, type TableContribution as cy, type TombstonedNodeRow as cz, type GraphDef as d, type FieldRef as d$, type VectorSearchParams as d0, type VectorSearchResult as d1, type VectorSlot as d2, type WriteFencePlan as d3, assertFiniteEmbedding as d4, assertRecursiveTraversal as d5, assertVectorMinScore as d6, assertVectorSearchLimit as d7, assumeRecursiveTraversalSupported as d8, buildFulltextCapabilities as d9, type EdgeIndexWhereBuilder as dA, type IndexWhereFieldBuilder as dB, type IndexWhereInput as dC, type NodeIndexConfig as dD, type NodeIndexWhereBuilder as dE, type NodeType as dF, type AnyEdgeType as dG, type SchemaDiff as dH, SqlSchema as dI, type SchemaHash as dJ, type ValidationIssue as dK, ValidationError as dL, type ChangeSeverity as dM, type ChangeType as dN, type DeprecatedKindsChange as dO, type EdgeChange as dP, type ExtensionChange as dQ, type IdentityChange as dR, type IndexChange as dS, type NodeChange as dT, type OntologyChange as dU, type SchemaChangeClassification as dV, classifySchemaChanges as dW, computeSchemaDiff as dX, getMigrationActions as dY, isBackwardsCompatible as dZ, type AggregateExpr as d_, buildVectorCapabilities as da, fts5Strategy as db, isLiveNodeRow as dc, isSqlFragment as dd, isSqlPlaceholder as de, isTombstonedNodeRow as df, normalizeGraphAnalyticsCapabilities as dg, quoteIdentifier as dh, recursiveTraversalUnsupportedError as di, renderPostgres as dj, renderSql as dk, renderSqlInline as dl, renderSqlite as dm, requireWriteFence as dn, resolveRecursiveTraversal as dp, resolveWriteFencePlan as dq, rowPropsToJsonText as dr, rowPropsToObject as ds, shortHash as dt, sql as du, tsvectorStrategy as dv, vectorMinScoreCondition as dw, vectorPhysicalName as dx, vectorScoreExpression as dy, type EdgeIndexConfig as dz, type GraphBackend as e, type JsonPointerSegment as e$, type ComparisonOp as e0, type AggregateComparisonPredicate as e1, type TraversalDirection as e2, type OntologyRelation as e3, type EdgeType as e4, type AllEdgeTypes as e5, type AllNodeTypes as e6, BackendDisposedError as e7, CURRENT_GRAPH_EXTENSION_VERSION as e8, CardinalityError as e9, type EndpointErrorDetails as eA, EndpointNotFoundError as eB, type EndpointNotFoundErrorDetails as eC, type ErrorCategory as eD, ExportStreamCancelledError as eE, ExportStreamIdleTimeoutError as eF, type ExternalRecordedReadSource as eG, type GetEdgeType as eH, type GetNodeType as eI, GraphAlgorithmConvergenceError as eJ, type GraphDefaults as eK, type HybridFusionOptions as eL, IMMUTABLE_VALIDITY_LOWER_BOUND_CODE as eM, INVERTED_VALIDITY_WINDOW_CODE as eN, IdentityContradictionError as eO, type IdentityContradictionErrorDetails as eP, IdentityEndpointValidityError as eQ, type IdentityEndpointValidityErrorDetails as eR, IdentitySeparationViolationError as eS, type IdentitySeparationViolationErrorDetails as eT, IdentityValidityWindowError as eU, type IdentityValidityWindowErrorDetails as eV, InvalidEdgeWeightError as eW, type InvalidEdgeWeightErrorDetails as eX, type InvalidEdgeWeightReason as eY, type JsonPointerFor as eZ, type JsonPointerInput as e_, type CardinalityErrorDetails as ea, CompilerInvariantError as eb, ConfigurationError as ec, type ContributionRebuildRefusal as ed, ContributionRebuildUnsupportedError as ee, ContributionUnavailableError as ef, type ContributionUnavailableErrorDetails as eg, DEFAULT_SQL_SCHEMA as eh, DatabaseOperationError as ei, type DatabaseOperationErrorDetails as ej, DisjointError as ek, type DisjointErrorDetails as el, EDGE_IDENTITY_MISMATCH_CODE as em, ENTITY_ALREADY_EXISTS_CODE as en, EagerMaterializationError as eo, type EagerMaterializationErrorDetails as ep, type EdgeId as eq, type EdgeKinds as er, EdgeNotFoundError as es, type EdgeNotFoundErrorDetails as et, type EdgeProps as eu, type EdgeRegistration as ev, type EdgeTypeWithEndpoints as ew, EmbeddingDimensionChangedError as ex, type EmbeddingDimensionChangedErrorDetails as ey, EndpointError as ez, ALL_FULLTEXT_MODES as f, defineGraph as f$, type JsonPointerSegments as f0, type JsonPointerSegmentsFor as f1, KindNotFoundError as f2, type KindNotFoundErrorDetails as f3, LEGACY_GRAPH_EXTENSION_VERSION as f4, MAX_JSON_POINTER_DEPTH as f5, MIGRATION_FAILURE_REASONS as f6, type MaterializeIndexesEntry as f7, type MaterializeIndexesOptions as f8, type MaterializeIndexesResult as f9, SchemaContentConflictError as fA, type SchemaContentConflictErrorDetails as fB, SchemaMismatchError as fC, type SchemaMismatchErrorDetails as fD, type SortDirection as fE, StaleVersionError as fF, type StaleVersionErrorDetails as fG, StoreNotInitializedError as fH, type StoreNotInitializedErrorDetails as fI, type StoreNotInitializedReason as fJ, TransactionClosedError as fK, type TraversalExpansion as fL, TrustedImportError as fM, type TrustedImportErrorReason as fN, TypeGraphError as fO, type TypeGraphErrorOptions as fP, type UniqueConstraint as fQ, UniquenessError as fR, type UniquenessErrorDetails as fS, UnsupportedBackendCapabilityError as fT, UnsupportedPredicateError as fU, type ValidationErrorDetails as fV, VersionConflictError as fW, type VersionConflictErrorDetails as fX, asEdgeId as fY, asNodeId as fZ, createSqlSchema as f_, type MaterializeSystemIndexesOptions as fa, type MetaEdge as fb, type MetaEdgeProperties as fc, MigrationError as fd, type MigrationErrorDetails as fe, type MigrationFailureReason as ff, NodeConstraintNotFoundError as fg, type NodeConstraintNotFoundErrorDetails as fh, type NodeId as fi, NodeIndexNotFoundError as fj, type NodeIndexNotFoundErrorDetails as fk, type NodeKinds as fl, NodeNotFoundError as fm, type NodeNotFoundErrorDetails as fn, type NodeProps as fo, type NodeRegistration as fp, type OrderSpec as fq, type ParameterRef as fr, RECORDED_CAPTURE_GUARD_CODES as fs, type RecordedCaptureGuardCode as ft, type RecordedCaptureGuardError as fu, type RecordedRelationOptions as fv, type ResolveJsonPointer as fw, type ResolveJsonPointerSegments as fx, RestrictedDeleteError as fy, type RestrictedDeleteErrorDetails as fz, ALL_META_EDGE_NAMES as g, getEdgeKinds as g0, getErrorSuggestion as g1, getNodeKinds as g2, isConstraintError as g3, isEdgeType as g4, isEdgeTypeWithEndpoints as g5, isGraphDef as g6, isMetaEdge as g7, isNodeType as g8, isRecordedCaptureGuardError as g9, isSystemError as ga, isTypeGraphError as gb, isUserRecoverable as gc, joinJsonPointers as gd, jsonPointer as ge, normalizeJsonPointer as gf, parseJsonPointer as gg, recordedRelation as gh, type PredicateExpression as gi, type VectorMetricType as gj, type Traversal as gk, type NodePredicate as gl, type ProjectedField as gm, type AggregateOrderSpec as gn, type GroupBySpec as go, type RecursiveCyclePolicy as gp, type VectorSlotMap as gq, type RecordedReadBinding as gr, type SelectiveField as gs, type ComposableQuery as gt, type SetOperationType as gu, type SetOperation as gv, type BackendValidityEndMutation as gw, GRAPH_EXTENSION_TOP_LEVEL_KEYS as gx, type GraphExtensionTopLevelKey as gy, type AdapterBackendTransactions as h, BASE_CONTRIBUTION_OWNER as i, type BackendIdentity as j, type BackendLifecycle as k, type BackendMaintenance as l, type BackendTransactions as m, type Cardinality as n, type CheckUniqueBatchParams as o, type CheckUniqueParams as p, type ClaimEdgeCardinalityParams as q, type ClaimIndexMaterializationParams as r, type Collation as s, type CommitSchemaVersionExpected as t, type CommitSchemaVersionIfKindsEmptyResult as u, type CommitSchemaVersionParams as v, type CompiledRowsSql as w, type CompiledSelectSql as x, type CompiledStatementSql as y, type CompiledTemporaryStatementSql as z };