@nicia-ai/typegraph 0.49.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 (370) hide show
  1. package/README.md +12 -0
  2. package/dist/backend/drizzle/indexes.cjs +11 -9
  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 +7 -5
  6. package/dist/backend/index.cjs +190 -53
  7. package/dist/backend/index.d.cts +90 -4
  8. package/dist/backend/index.d.ts +90 -4
  9. package/dist/backend/index.js +9 -12
  10. package/dist/backend/postgres/index.cjs +36 -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 +19 -15
  14. package/dist/backend/postgres/pglite-store.cjs +7 -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 +7 -62
  19. package/dist/backend/postgres/pglite-store.js.map +1 -1
  20. package/dist/backend/postgres/pglite.cjs +21 -17
  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 +20 -16
  24. package/dist/backend/sqlite/index.cjs +33 -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 +17 -13
  28. package/dist/backend/sqlite/libsql.cjs +24 -20
  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 +19 -15
  33. package/dist/backend/sqlite/libsql.js.map +1 -1
  34. package/dist/backend/sqlite/local-store.cjs +9 -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 +8 -64
  39. package/dist/backend/sqlite/local-store.js.map +1 -1
  40. package/dist/backend/sqlite/local.cjs +25 -20
  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 +21 -16
  44. package/dist/chunk-2CVDZCXH.cjs +1278 -0
  45. package/dist/chunk-2CVDZCXH.cjs.map +1 -0
  46. package/dist/{chunk-MYKHJI2J.js → chunk-2DWTBNSH.js} +3 -3
  47. package/dist/{chunk-MYKHJI2J.js.map → chunk-2DWTBNSH.js.map} +1 -1
  48. package/dist/{chunk-JB6T4GLL.cjs → chunk-2KCTP3U2.cjs} +870 -528
  49. package/dist/chunk-2KCTP3U2.cjs.map +1 -0
  50. package/dist/{chunk-OORXGFL5.cjs → chunk-322TBTOQ.cjs} +48 -48
  51. package/dist/{chunk-OORXGFL5.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
  52. package/dist/{chunk-FA2AFWLP.cjs → chunk-36SX6QXP.cjs} +31 -12
  53. package/dist/chunk-36SX6QXP.cjs.map +1 -0
  54. package/dist/{chunk-SDBBMD4N.js → chunk-36VYWVQU.js} +3 -3
  55. package/dist/{chunk-SDBBMD4N.js.map → chunk-36VYWVQU.js.map} +1 -1
  56. package/dist/chunk-4DKY6RIU.js +1253 -0
  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-WIC7DRXW.js → chunk-57JM6NW3.js} +9 -19
  61. package/dist/chunk-57JM6NW3.js.map +1 -0
  62. package/dist/chunk-5WWEYV4H.cjs +5113 -0
  63. package/dist/chunk-5WWEYV4H.cjs.map +1 -0
  64. package/dist/chunk-6KQEICJ6.cjs +12 -0
  65. package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
  66. package/dist/{chunk-DZAICA5J.js → chunk-6NKSE5AU.js} +4 -4
  67. package/dist/{chunk-DZAICA5J.js.map → chunk-6NKSE5AU.js.map} +1 -1
  68. package/dist/{chunk-KKBDXCLQ.js → chunk-6NLYIMJO.js} +4 -4
  69. package/dist/{chunk-KKBDXCLQ.js.map → chunk-6NLYIMJO.js.map} +1 -1
  70. package/dist/{chunk-BFUOME67.cjs → chunk-7B7I7YAW.cjs} +20 -11
  71. package/dist/chunk-7B7I7YAW.cjs.map +1 -0
  72. package/dist/{chunk-ZDKTPBGV.js → chunk-7G5IYROL.js} +6 -548
  73. package/dist/chunk-7G5IYROL.js.map +1 -0
  74. package/dist/{chunk-3DMMGT6S.js → chunk-7QFRK6PU.js} +4 -8
  75. package/dist/chunk-7QFRK6PU.js.map +1 -0
  76. package/dist/chunk-A4C4NJ5U.cjs +12 -0
  77. package/dist/chunk-A4C4NJ5U.cjs.map +1 -0
  78. package/dist/{chunk-CHAOFCHV.js → chunk-AH2A74OZ.js} +3 -3
  79. package/dist/{chunk-CHAOFCHV.js.map → chunk-AH2A74OZ.js.map} +1 -1
  80. package/dist/{chunk-UGHQV7MP.cjs → chunk-B3MN7EJR.cjs} +228 -162
  81. package/dist/chunk-B3MN7EJR.cjs.map +1 -0
  82. package/dist/{chunk-TZEGUG6D.cjs → chunk-BZ5MVITP.cjs} +4 -4
  83. package/dist/{chunk-TZEGUG6D.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
  84. package/dist/{chunk-YVF2EM7B.js → chunk-CAI6SMP6.js} +3 -3
  85. package/dist/{chunk-YVF2EM7B.js.map → chunk-CAI6SMP6.js.map} +1 -1
  86. package/dist/{chunk-JONXFAPO.js → chunk-CBOD7TXH.js} +5 -5
  87. package/dist/{chunk-JONXFAPO.js.map → chunk-CBOD7TXH.js.map} +1 -1
  88. package/dist/{chunk-FQPEMEWX.cjs → chunk-CRZ56SZU.cjs} +81 -32
  89. package/dist/chunk-CRZ56SZU.cjs.map +1 -0
  90. package/dist/{chunk-DO7SAMEK.cjs → chunk-D3GWARN7.cjs} +47 -47
  91. package/dist/{chunk-DO7SAMEK.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
  92. package/dist/{chunk-QTD6HX4O.js → chunk-D3OUDFU7.js} +5 -5
  93. package/dist/{chunk-QTD6HX4O.js.map → chunk-D3OUDFU7.js.map} +1 -1
  94. package/dist/{chunk-2QGYQBS2.cjs → chunk-DWUDZ66O.cjs} +10 -10
  95. package/dist/{chunk-2QGYQBS2.cjs.map → chunk-DWUDZ66O.cjs.map} +1 -1
  96. package/dist/chunk-EKG2UXNX.cjs +23 -0
  97. package/dist/chunk-EKG2UXNX.cjs.map +1 -0
  98. package/dist/chunk-FMMW3KX7.cjs +148 -0
  99. package/dist/chunk-FMMW3KX7.cjs.map +1 -0
  100. package/dist/{chunk-XVWOYKIK.js → chunk-FZHF5UWR.js} +3 -3
  101. package/dist/{chunk-XVWOYKIK.js.map → chunk-FZHF5UWR.js.map} +1 -1
  102. package/dist/chunk-H2VWDQWC.cjs +571 -0
  103. package/dist/chunk-H2VWDQWC.cjs.map +1 -0
  104. package/dist/chunk-H4FY6OZK.js +13 -0
  105. package/dist/chunk-H4FY6OZK.js.map +1 -0
  106. package/dist/{chunk-EDN4Y4ZG.cjs → chunk-H5IJSROF.cjs} +9 -15
  107. package/dist/chunk-H5IJSROF.cjs.map +1 -0
  108. package/dist/chunk-HZUB5CON.js +27 -0
  109. package/dist/chunk-HZUB5CON.js.map +1 -0
  110. package/dist/{chunk-NACVVDWB.js → chunk-I5IOSA27.js} +103 -105
  111. package/dist/chunk-I5IOSA27.js.map +1 -0
  112. package/dist/{chunk-OI2GQ25X.cjs → chunk-I7YAY2VQ.cjs} +7 -7
  113. package/dist/{chunk-OI2GQ25X.cjs.map → chunk-I7YAY2VQ.cjs.map} +1 -1
  114. package/dist/chunk-IRCWIA3R.js +20 -0
  115. package/dist/chunk-IRCWIA3R.js.map +1 -0
  116. package/dist/chunk-IVQBLXBK.cjs +55 -0
  117. package/dist/chunk-IVQBLXBK.cjs.map +1 -0
  118. package/dist/{chunk-7SQSZN2J.js → chunk-IZD4HTCP.js} +5 -5
  119. package/dist/{chunk-7SQSZN2J.js.map → chunk-IZD4HTCP.js.map} +1 -1
  120. package/dist/{chunk-3FPR224C.cjs → chunk-JHRUZ73O.cjs} +116 -107
  121. package/dist/chunk-JHRUZ73O.cjs.map +1 -0
  122. package/dist/{chunk-EZEEWCFJ.cjs → chunk-JQKMEKKW.cjs} +525 -298
  123. package/dist/chunk-JQKMEKKW.cjs.map +1 -0
  124. package/dist/chunk-JVA3KDEA.cjs +691 -0
  125. package/dist/chunk-JVA3KDEA.cjs.map +1 -0
  126. package/dist/{chunk-5K2BKEBD.js → chunk-K46SDNQD.js} +10 -4
  127. package/dist/chunk-K46SDNQD.js.map +1 -0
  128. package/dist/{chunk-7LZJNLA5.js → chunk-K67P5DLL.js} +108 -42
  129. package/dist/chunk-K67P5DLL.js.map +1 -0
  130. package/dist/{chunk-3G5W2U2L.cjs → chunk-KACEYDYV.cjs} +335 -258
  131. package/dist/chunk-KACEYDYV.cjs.map +1 -0
  132. package/dist/{chunk-JFRT7S3B.cjs → chunk-L6EVYIID.cjs} +318 -478
  133. package/dist/chunk-L6EVYIID.cjs.map +1 -0
  134. package/dist/{chunk-SHFBB23Q.js → chunk-LI4K2KEJ.js} +6 -4
  135. package/dist/chunk-LI4K2KEJ.js.map +1 -0
  136. package/dist/chunk-LKZDQ2B4.js +1581 -0
  137. package/dist/chunk-LKZDQ2B4.js.map +1 -0
  138. package/dist/{chunk-WODMN3Q2.cjs → chunk-LLFPQOBA.cjs} +27 -27
  139. package/dist/{chunk-WODMN3Q2.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
  140. package/dist/{chunk-P6YLZTRE.js → chunk-LZMQ3SFK.js} +3 -3
  141. package/dist/{chunk-P6YLZTRE.js.map → chunk-LZMQ3SFK.js.map} +1 -1
  142. package/dist/{chunk-HEV35TGT.js → chunk-M3VTS3F6.js} +13 -4
  143. package/dist/chunk-M3VTS3F6.js.map +1 -0
  144. package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
  145. package/dist/chunk-M5MSP3BI.cjs.map +1 -0
  146. package/dist/{chunk-D4QLTJSM.js → chunk-NBOS7BY3.js} +63 -23
  147. package/dist/chunk-NBOS7BY3.js.map +1 -0
  148. package/dist/chunk-NGQDGL5X.js +140 -0
  149. package/dist/chunk-NGQDGL5X.js.map +1 -0
  150. package/dist/{chunk-SIT26LAZ.cjs → chunk-NLX5OWK7.cjs} +33 -5
  151. package/dist/chunk-NLX5OWK7.cjs.map +1 -0
  152. package/dist/chunk-NUQ2YFFH.cjs +1637 -0
  153. package/dist/chunk-NUQ2YFFH.cjs.map +1 -0
  154. package/dist/{chunk-UMGZDVOA.cjs → chunk-OGL4X4PH.cjs} +206 -208
  155. package/dist/chunk-OGL4X4PH.cjs.map +1 -0
  156. package/dist/{chunk-LRQKXRXO.cjs → chunk-OTNTGEXR.cjs} +4 -4
  157. package/dist/{chunk-LRQKXRXO.cjs.map → chunk-OTNTGEXR.cjs.map} +1 -1
  158. package/dist/chunk-OTWE63BW.js +53 -0
  159. package/dist/chunk-OTWE63BW.js.map +1 -0
  160. package/dist/chunk-PC5NGH5A.js +549 -0
  161. package/dist/chunk-PC5NGH5A.js.map +1 -0
  162. package/dist/{chunk-26YKDNUD.cjs → chunk-PS3TUWJM.cjs} +12 -10
  163. package/dist/chunk-PS3TUWJM.cjs.map +1 -0
  164. package/dist/{chunk-OMZ37BM2.js → chunk-PVFFH7TL.js} +5 -5
  165. package/dist/{chunk-OMZ37BM2.js.map → chunk-PVFFH7TL.js.map} +1 -1
  166. package/dist/chunk-QCD5JKU4.cjs +15 -0
  167. package/dist/chunk-QCD5JKU4.cjs.map +1 -0
  168. package/dist/{chunk-UGHG7PGX.js → chunk-QG5VEOKX.js} +30 -4
  169. package/dist/chunk-QG5VEOKX.js.map +1 -0
  170. package/dist/{chunk-TUNPBZY3.cjs → chunk-QLLZM5I3.cjs} +4 -4
  171. package/dist/{chunk-TUNPBZY3.cjs.map → chunk-QLLZM5I3.cjs.map} +1 -1
  172. package/dist/{chunk-BRRP76WO.js → chunk-RCBG6YMT.js} +781 -375
  173. package/dist/chunk-RCBG6YMT.js.map +1 -0
  174. package/dist/{chunk-LTXQOEIC.js → chunk-RI7RJH4G.js} +281 -204
  175. package/dist/chunk-RI7RJH4G.js.map +1 -0
  176. package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
  177. package/dist/chunk-RJMHU2MG.cjs.map +1 -0
  178. package/dist/{chunk-GLHXM7C4.js → chunk-RVUL2HXY.js} +61 -23
  179. package/dist/chunk-RVUL2HXY.js.map +1 -0
  180. package/dist/chunk-RWUWTJQY.cjs +30 -0
  181. package/dist/chunk-RWUWTJQY.cjs.map +1 -0
  182. package/dist/{chunk-2O4PCIZ6.cjs → chunk-S5GU4LUN.cjs} +13 -13
  183. package/dist/{chunk-2O4PCIZ6.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
  184. package/dist/{chunk-JPD2CTC3.js → chunk-SDPWO2Z5.js} +7 -7
  185. package/dist/{chunk-JPD2CTC3.js.map → chunk-SDPWO2Z5.js.map} +1 -1
  186. package/dist/{chunk-OVI7IXYX.js → chunk-SLGGT2XD.js} +3 -3
  187. package/dist/{chunk-OVI7IXYX.js.map → chunk-SLGGT2XD.js.map} +1 -1
  188. package/dist/{chunk-ROR5ZR6A.cjs → chunk-TIJUA4I6.cjs} +45 -45
  189. package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
  190. package/dist/{chunk-AOSSQDVO.cjs → chunk-TM54OBHX.cjs} +13 -13
  191. package/dist/{chunk-AOSSQDVO.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
  192. package/dist/{chunk-KF6K7TGH.js → chunk-TYEYRCXL.js} +766 -433
  193. package/dist/chunk-TYEYRCXL.js.map +1 -0
  194. package/dist/{chunk-Z2JCLZFJ.js → chunk-UKOVGCRN.js} +2151 -570
  195. package/dist/chunk-UKOVGCRN.js.map +1 -0
  196. package/dist/chunk-UYKDYE5D.cjs +12 -0
  197. package/dist/{chunk-CICO5GXD.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
  198. package/dist/{chunk-S5TERQVW.js → chunk-VAAC7L57.js} +284 -66
  199. package/dist/chunk-VAAC7L57.js.map +1 -0
  200. package/dist/{chunk-7UOLHNWC.cjs → chunk-VKHXYVN7.cjs} +22 -33
  201. package/dist/chunk-VKHXYVN7.cjs.map +1 -0
  202. package/dist/{chunk-6NGW27EO.cjs → chunk-VLBTRXA2.cjs} +10 -10
  203. package/dist/{chunk-6NGW27EO.cjs.map → chunk-VLBTRXA2.cjs.map} +1 -1
  204. package/dist/{chunk-YIURNGXI.js → chunk-VUQZNUHU.js} +22 -6
  205. package/dist/chunk-VUQZNUHU.js.map +1 -0
  206. package/dist/{chunk-YYUHLYM2.cjs → chunk-WDM5WQK4.cjs} +183 -143
  207. package/dist/chunk-WDM5WQK4.cjs.map +1 -0
  208. package/dist/{chunk-ZFMCDJGB.js → chunk-WFSYYU4W.js} +70 -220
  209. package/dist/chunk-WFSYYU4W.js.map +1 -0
  210. package/dist/{chunk-SR725PWF.cjs → chunk-WRBV2FNH.cjs} +2065 -1659
  211. package/dist/chunk-WRBV2FNH.cjs.map +1 -0
  212. package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
  213. package/dist/chunk-X4GDXBOP.cjs.map +1 -0
  214. package/dist/chunk-XORONCV3.js +202 -0
  215. package/dist/chunk-XORONCV3.js.map +1 -0
  216. package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
  217. package/dist/chunk-XZW2CTNO.js.map +1 -0
  218. package/dist/{chunk-ZLONH2UD.js → chunk-YDEJQWOL.js} +2 -2
  219. package/dist/chunk-YDEJQWOL.js.map +1 -0
  220. package/dist/{chunk-2TYSSBU5.js → chunk-YT2IVFAI.js} +30 -21
  221. package/dist/chunk-YT2IVFAI.js.map +1 -0
  222. package/dist/chunk-ZGVTNKTX.cjs +217 -0
  223. package/dist/chunk-ZGVTNKTX.cjs.map +1 -0
  224. package/dist/core/index.cjs +29 -28
  225. package/dist/core/index.d.cts +4 -4
  226. package/dist/core/index.d.ts +4 -4
  227. package/dist/core/index.js +9 -8
  228. package/dist/{ddl-D_oW-EVO.d.ts → ddl-BvcbgzHo.d.ts} +3 -3
  229. package/dist/{ddl-BL1NZLMY.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
  230. package/dist/graph-extension/index.cjs +21 -20
  231. package/dist/graph-extension/index.d.cts +2 -4
  232. package/dist/graph-extension/index.d.ts +2 -4
  233. package/dist/graph-extension/index.js +5 -4
  234. package/dist/graph-merge/index.cjs +324 -307
  235. package/dist/graph-merge/index.cjs.map +1 -1
  236. package/dist/graph-merge/index.d.cts +8 -9
  237. package/dist/graph-merge/index.d.ts +8 -9
  238. package/dist/graph-merge/index.js +51 -34
  239. package/dist/graph-merge/index.js.map +1 -1
  240. package/dist/index.cjs +224 -222
  241. package/dist/index.cjs.map +1 -1
  242. package/dist/index.d.cts +11 -12
  243. package/dist/index.d.ts +11 -12
  244. package/dist/index.js +38 -36
  245. package/dist/index.js.map +1 -1
  246. package/dist/indexes/index.cjs +15 -13
  247. package/dist/indexes/index.d.cts +4 -4
  248. package/dist/indexes/index.d.ts +4 -4
  249. package/dist/indexes/index.js +8 -6
  250. package/dist/{ingestion-import-target-dNeL7iAv.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
  251. package/dist/{ingestion-import-target-XPxZYw89.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
  252. package/dist/interchange/index.cjs +57 -54
  253. package/dist/interchange/index.cjs.map +1 -1
  254. package/dist/interchange/index.d.cts +19 -8
  255. package/dist/interchange/index.d.ts +19 -8
  256. package/dist/interchange/index.js +21 -18
  257. package/dist/interchange/index.js.map +1 -1
  258. package/dist/local-store-impl-6DDTFM32.cjs +77 -0
  259. package/dist/local-store-impl-6DDTFM32.cjs.map +1 -0
  260. package/dist/local-store-impl-OXTOVU2J.js +75 -0
  261. package/dist/local-store-impl-OXTOVU2J.js.map +1 -0
  262. package/dist/{manager-CYaff3n3.d.cts → manager-B68OrPR2.d.ts} +29 -2
  263. package/dist/{manager-D9eRT_ns.d.ts → manager-D_t7oK69.d.cts} +29 -2
  264. package/dist/pglite-store-impl-6EMZGL7K.js +73 -0
  265. package/dist/pglite-store-impl-6EMZGL7K.js.map +1 -0
  266. package/dist/pglite-store-impl-GJG3Y7RP.cjs +75 -0
  267. package/dist/pglite-store-impl-GJG3Y7RP.cjs.map +1 -0
  268. package/dist/{postgres-CcL4bAHS.d.ts → postgres-BPLSVyHM.d.ts} +279 -2
  269. package/dist/{postgres-DMj39MEu.d.cts → postgres-CqvtFC2y.d.cts} +279 -2
  270. package/dist/profiler/index.d.cts +9 -9
  271. package/dist/profiler/index.d.ts +9 -9
  272. package/dist/provenance/index.cjs +59 -44
  273. package/dist/provenance/index.cjs.map +1 -1
  274. package/dist/provenance/index.d.cts +7 -7
  275. package/dist/provenance/index.d.ts +7 -7
  276. package/dist/provenance/index.js +28 -13
  277. package/dist/provenance/index.js.map +1 -1
  278. package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
  279. package/dist/{repair-validity-windows-DlUSqwCg.d.ts → repair-validity-windows-GMdaS2AH.d.ts} +7 -3
  280. package/dist/resolve-D_H8MHtq.d.ts +1805 -0
  281. package/dist/resolve-WEW8gWws.d.cts +1805 -0
  282. package/dist/schema/index.cjs +48 -46
  283. package/dist/schema/index.d.cts +4 -6
  284. package/dist/schema/index.d.ts +4 -6
  285. package/dist/schema/index.js +21 -19
  286. package/dist/{searchable-bpE1bBfc.d.ts → searchable-C_UREI9K.d.ts} +1 -1
  287. package/dist/{searchable-DHJMh_nj.d.cts → searchable-ClgET_i7.d.cts} +1 -1
  288. package/dist/{sqlite-YppHrNFb.d.cts → sqlite-D1mXO9Kp.d.cts} +310 -2
  289. package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-MZA3oZNB.d.ts} +310 -2
  290. package/dist/{store-bphCSo7z.d.cts → store-CuFX7fCx.d.cts} +117 -31
  291. package/dist/{store-DRrFCx5x.d.ts → store-D-ZjXQpW.d.ts} +117 -31
  292. package/dist/{temporal-CbnLzTmM.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
  293. package/dist/{temporal-5GqpYCk2.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
  294. package/dist/{types-BqFZTQmV.d.cts → types-6yf0Vv-_.d.cts} +2016 -94
  295. package/dist/{types-BqFZTQmV.d.ts → types-6yf0Vv-_.d.ts} +2016 -94
  296. package/dist/{types-Bx74kaTt.d.ts → types-DzJ4dlzk.d.cts} +1 -1
  297. package/dist/{types-CXAhpW-c.d.cts → types-_vVSB9k-.d.ts} +1 -1
  298. package/dist/{where-O-k2wgYm.d.ts → where-DuG2LCLe.d.ts} +1 -1
  299. package/dist/{where-DI_Fqz-X.d.cts → where-Mhf_yyKX.d.cts} +1 -1
  300. package/package.json +7 -2
  301. package/dist/chunk-26YKDNUD.cjs.map +0 -1
  302. package/dist/chunk-2TYSSBU5.js.map +0 -1
  303. package/dist/chunk-3DMMGT6S.js.map +0 -1
  304. package/dist/chunk-3FPR224C.cjs.map +0 -1
  305. package/dist/chunk-3G5W2U2L.cjs.map +0 -1
  306. package/dist/chunk-3KOY4FH3.cjs +0 -934
  307. package/dist/chunk-3KOY4FH3.cjs.map +0 -1
  308. package/dist/chunk-3QNZ5SAJ.cjs +0 -3502
  309. package/dist/chunk-3QNZ5SAJ.cjs.map +0 -1
  310. package/dist/chunk-3U5ABFDW.cjs +0 -259
  311. package/dist/chunk-3U5ABFDW.cjs.map +0 -1
  312. package/dist/chunk-5K2BKEBD.js.map +0 -1
  313. package/dist/chunk-5PRKMB24.cjs +0 -124
  314. package/dist/chunk-5PRKMB24.cjs.map +0 -1
  315. package/dist/chunk-6LN7FIVU.js +0 -107
  316. package/dist/chunk-6LN7FIVU.js.map +0 -1
  317. package/dist/chunk-6SWPJEYN.js +0 -1126
  318. package/dist/chunk-6SWPJEYN.js.map +0 -1
  319. package/dist/chunk-7LZJNLA5.js.map +0 -1
  320. package/dist/chunk-7UOLHNWC.cjs.map +0 -1
  321. package/dist/chunk-BFUOME67.cjs.map +0 -1
  322. package/dist/chunk-BRRP76WO.js.map +0 -1
  323. package/dist/chunk-CICO5GXD.cjs +0 -12
  324. package/dist/chunk-D4QLTJSM.js.map +0 -1
  325. package/dist/chunk-D5R42W5D.js.map +0 -1
  326. package/dist/chunk-EDN4Y4ZG.cjs.map +0 -1
  327. package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
  328. package/dist/chunk-FA2AFWLP.cjs.map +0 -1
  329. package/dist/chunk-FQPEMEWX.cjs.map +0 -1
  330. package/dist/chunk-GLHXM7C4.js.map +0 -1
  331. package/dist/chunk-GYEG3ZLZ.cjs.map +0 -1
  332. package/dist/chunk-HDL2ARHX.cjs +0 -1156
  333. package/dist/chunk-HDL2ARHX.cjs.map +0 -1
  334. package/dist/chunk-HEV35TGT.js.map +0 -1
  335. package/dist/chunk-I4GAZH5Z.js +0 -913
  336. package/dist/chunk-I4GAZH5Z.js.map +0 -1
  337. package/dist/chunk-JB6T4GLL.cjs.map +0 -1
  338. package/dist/chunk-JBQQ7THH.js +0 -20
  339. package/dist/chunk-JBQQ7THH.js.map +0 -1
  340. package/dist/chunk-JFRT7S3B.cjs.map +0 -1
  341. package/dist/chunk-KF6K7TGH.js.map +0 -1
  342. package/dist/chunk-L3LQNR34.cjs +0 -1254
  343. package/dist/chunk-L3LQNR34.cjs.map +0 -1
  344. package/dist/chunk-LTXQOEIC.js.map +0 -1
  345. package/dist/chunk-MKJ4KXL5.cjs +0 -12
  346. package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
  347. package/dist/chunk-NACVVDWB.js.map +0 -1
  348. package/dist/chunk-NVY5CJFP.js +0 -244
  349. package/dist/chunk-NVY5CJFP.js.map +0 -1
  350. package/dist/chunk-PWLJ77UV.cjs +0 -23
  351. package/dist/chunk-PWLJ77UV.cjs.map +0 -1
  352. package/dist/chunk-S5TERQVW.js.map +0 -1
  353. package/dist/chunk-SHFBB23Q.js.map +0 -1
  354. package/dist/chunk-SIT26LAZ.cjs.map +0 -1
  355. package/dist/chunk-SR725PWF.cjs.map +0 -1
  356. package/dist/chunk-TQHGE7UC.cjs.map +0 -1
  357. package/dist/chunk-UGHG7PGX.js.map +0 -1
  358. package/dist/chunk-UGHQV7MP.cjs.map +0 -1
  359. package/dist/chunk-UMGZDVOA.cjs.map +0 -1
  360. package/dist/chunk-WIC7DRXW.js.map +0 -1
  361. package/dist/chunk-YIURNGXI.js.map +0 -1
  362. package/dist/chunk-YYUHLYM2.cjs.map +0 -1
  363. package/dist/chunk-Z2JCLZFJ.js.map +0 -1
  364. package/dist/chunk-ZDKTPBGV.js.map +0 -1
  365. package/dist/chunk-ZFMCDJGB.js.map +0 -1
  366. package/dist/chunk-ZLONH2UD.js.map +0 -1
  367. package/dist/index-COs_z6nV.d.cts +0 -1132
  368. package/dist/index-D7d1u2gr.d.ts +0 -1132
  369. package/dist/materialize-indexes-DJ3ykH59.d.ts +0 -266
  370. package/dist/materialize-indexes-DTtAnvfY.d.cts +0 -266
@@ -1068,7 +1068,7 @@ declare function renderSqlInline(fragment: SqlFragment, dialect: SqlDialect): st
1068
1068
  * Table names for TypeGraph SQL schema.
1069
1069
  *
1070
1070
  * Carries every customizable physical-table name the backend exposes,
1071
- * including the secondary tables (`uniques`) that the query compiler
1071
+ * including the secondary tables (`uniques`, `edgeClaims`) that the query compiler
1072
1072
  * itself doesn't reference but `materializeRemovals` and other
1073
1073
  * cleanup paths need to address by name. Backends without a
1074
1074
  * `uniques` table (custom embeddings-only stores) leave it as the
@@ -1100,6 +1100,8 @@ type SqlTableNames = Readonly<{
1100
1100
  fulltext: string;
1101
1101
  /** Node uniques table name (default: "typegraph_node_uniques") */
1102
1102
  uniques: string;
1103
+ /** Edge cardinality claim table name (default: "typegraph_edge_claims") */
1104
+ edgeClaims?: string | undefined;
1103
1105
  }>;
1104
1106
  type ResolvedSqlTableNames = Readonly<{
1105
1107
  /** Nodes table name */
@@ -1122,6 +1124,8 @@ type ResolvedSqlTableNames = Readonly<{
1122
1124
  fulltext: string;
1123
1125
  /** Node uniques table name */
1124
1126
  uniques: string;
1127
+ /** Edge cardinality claim table name */
1128
+ edgeClaims: string;
1125
1129
  }>;
1126
1130
  type SqlSchemaFields = Readonly<{
1127
1131
  /** Table names */
@@ -1838,6 +1842,182 @@ type GraphExtension = Readonly<{
1838
1842
  declare const GRAPH_EXTENSION_TOP_LEVEL_KEYS: readonly ["version", "nodes", "edges", "ontology", "indexes"];
1839
1843
  type GraphExtensionTopLevelKey = (typeof GRAPH_EXTENSION_TOP_LEVEL_KEYS)[number];
1840
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
+
1841
2021
  /** Brand key for MetaEdge */
1842
2022
  declare const META_EDGE_BRAND: "__metaEdge";
1843
2023
  /**
@@ -1950,122 +2130,1423 @@ type GraphDefConfig<TNodes extends Record<string, NodeRegistration>, TEdges exte
1950
2130
  * This is a compile-time artifact that describes the structure of a graph.
1951
2131
  * Use `createStore()` to create a runtime store from this definition.
1952
2132
  */
1953
- type GraphDef<TNodes extends Record<string, NodeRegistration> = Record<string, NodeRegistration>, TEdges extends Record<string, EdgeRegistration> = Record<string, EdgeRegistration>, TOntology extends readonly OntologyRelation[] = readonly OntologyRelation[], TIdentity extends GraphIdentityConfig | undefined = GraphIdentityConfig | undefined> = Readonly<{
1954
- [GRAPH_DEF_BRAND]: true;
1955
- id: string;
1956
- nodes: TNodes;
1957
- edges: TEdges;
1958
- ontology: TOntology;
1959
- /** Durable graph-level opt-in to the TypeGraph Identity Profile. */
1960
- identity: TIdentity;
1961
- defaults: Readonly<{
1962
- onNodeDelete: DeleteBehavior;
1963
- temporalMode: TemporalMode;
1964
- }>;
1965
- /**
1966
- * Index declarations attached to this graph. Preserves whatever the
1967
- * caller passed to `defineGraph` (including an explicit empty array)
1968
- * for introspection purposes.
1969
- *
1970
- * The serialized canonical form is order-canonicalized (sorted by
1971
- * `name`) and treats `undefined` and `[]` as the same "no slice" form
1972
- * — an empty array does not bump the schema hash, since indexes are
1973
- * an unordered set keyed by name and `[]` carries no semantic meaning
1974
- * that an absent slice doesn't.
1975
- */
1976
- indexes: readonly IndexDeclaration[] | undefined;
2133
+ type GraphDef<TNodes extends Record<string, NodeRegistration> = Record<string, NodeRegistration>, TEdges extends Record<string, EdgeRegistration> = Record<string, EdgeRegistration>, TOntology extends readonly OntologyRelation[] = readonly OntologyRelation[], TIdentity extends GraphIdentityConfig | undefined = GraphIdentityConfig | undefined> = Readonly<{
2134
+ [GRAPH_DEF_BRAND]: true;
2135
+ id: string;
2136
+ nodes: TNodes;
2137
+ edges: TEdges;
2138
+ ontology: TOntology;
2139
+ /** Durable graph-level opt-in to the TypeGraph Identity Profile. */
2140
+ identity: TIdentity;
2141
+ defaults: Readonly<{
2142
+ onNodeDelete: DeleteBehavior;
2143
+ temporalMode: TemporalMode;
2144
+ }>;
2145
+ /**
2146
+ * Index declarations attached to this graph. Preserves whatever the
2147
+ * caller passed to `defineGraph` (including an explicit empty array)
2148
+ * for introspection purposes.
2149
+ *
2150
+ * The serialized canonical form is order-canonicalized (sorted by
2151
+ * `name`) and treats `undefined` and `[]` as the same "no slice" form
2152
+ * — an empty array does not bump the schema hash, since indexes are
2153
+ * an unordered set keyed by name and `[]` carries no semantic meaning
2154
+ * that an absent slice doesn't.
2155
+ */
2156
+ indexes: readonly IndexDeclaration[] | undefined;
2157
+ /**
2158
+ * Graph extension this graph was merged with, if any. Set by
2159
+ * `mergeGraphExtension`; never set by `defineGraph` directly.
2160
+ * Exists solely so re-serialization is stable — the rest of the
2161
+ * system reads the merged kinds through `nodes` / `edges` /
2162
+ * `ontology` and never inspects this field. Absent on graphs that
2163
+ * have never been extended; legacy graphs hash byte-identically.
2164
+ */
2165
+ extension: GraphExtension | undefined;
2166
+ /**
2167
+ * Soft-deprecated kind names attached to this graph. Set by the
2168
+ * loader from the persisted schema and by `store.deprecateKinds(...)`
2169
+ * / `store.undeprecateKinds(...)`. A purely informational signal
2170
+ * surfaced for introspection — does not gate reads, writes, or
2171
+ * queries. Defaults to the empty set on freshly-defined graphs.
2172
+ */
2173
+ deprecatedKinds: ReadonlySet<string>;
2174
+ }>;
2175
+ /**
2176
+ * Extract node kind names from a GraphDef.
2177
+ */
2178
+ type NodeKinds<G extends GraphDef> = keyof G["nodes"] & string;
2179
+ /**
2180
+ * Extract edge kind names from a GraphDef.
2181
+ */
2182
+ type EdgeKinds<G extends GraphDef> = keyof G["edges"] & string;
2183
+ /**
2184
+ * Get a NodeType from a GraphDef by kind name.
2185
+ */
2186
+ type GetNodeType<G extends GraphDef, K extends NodeKinds<G>> = G["nodes"][K]["type"];
2187
+ /**
2188
+ * Get an EdgeType from a GraphDef by kind name.
2189
+ */
2190
+ type GetEdgeType<G extends GraphDef, K extends EdgeKinds<G>> = G["edges"][K]["type"];
2191
+ /**
2192
+ * Get all NodeTypes from a GraphDef.
2193
+ */
2194
+ type AllNodeTypes<G extends GraphDef> = {
2195
+ [K in NodeKinds<G>]: G["nodes"][K]["type"];
2196
+ }[NodeKinds<G>];
2197
+ /**
2198
+ * Get all EdgeTypes from a GraphDef.
2199
+ */
2200
+ type AllEdgeTypes<G extends GraphDef> = {
2201
+ [K in EdgeKinds<G>]: G["edges"][K]["type"];
2202
+ }[EdgeKinds<G>];
2203
+ /**
2204
+ * Creates a graph definition.
2205
+ *
2206
+ * @example
2207
+ * ```typescript
2208
+ * const graph = defineGraph({
2209
+ * id: "my_graph",
2210
+ * nodes: {
2211
+ * Person: { type: Person },
2212
+ * Company: { type: Company },
2213
+ * },
2214
+ * edges: {
2215
+ * // Traditional EdgeRegistration syntax
2216
+ * worksAt: {
2217
+ * type: worksAt,
2218
+ * from: [Person],
2219
+ * to: [Company],
2220
+ * cardinality: "many",
2221
+ * },
2222
+ * // Or use EdgeType directly if it has from/to defined
2223
+ * knows, // EdgeType with built-in domain/range
2224
+ * },
2225
+ * ontology: [
2226
+ * subClassOf(Company, Organization),
2227
+ * disjointWith(Person, Organization),
2228
+ * ],
2229
+ * defaults: {
2230
+ * onNodeDelete: "restrict",
2231
+ * temporalMode: "current",
2232
+ * },
2233
+ * });
2234
+ * ```
2235
+ */
2236
+ declare function defineGraph<const TNodes extends Record<string, NodeRegistration<NodeType>>, const TEdges extends Record<string, EdgeEntry>, const TOntology extends readonly OntologyRelation[], const TIdentity extends GraphIdentityConfig | undefined = undefined>(config: GraphDefConfig<TNodes, TEdges, TOntology, TIdentity>): GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology, TIdentity>;
2237
+ /**
2238
+ * Checks if a value is a GraphDef.
2239
+ */
2240
+ declare function isGraphDef(value: unknown): value is GraphDef;
2241
+ /**
2242
+ * Gets all node kind names from a GraphDef.
2243
+ */
2244
+ declare function getNodeKinds<G extends GraphDef>(graph: G): readonly (keyof G["nodes"] & string)[];
2245
+ /**
2246
+ * Gets all edge kind names from a GraphDef.
2247
+ */
2248
+ declare function getEdgeKinds<G extends GraphDef>(graph: G): readonly (keyof G["edges"] & string)[];
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;
1977
3313
  /**
1978
- * Graph extension this graph was merged with, if any. Set by
1979
- * `mergeGraphExtension`; never set by `defineGraph` directly.
1980
- * Exists solely so re-serialization is stable — the rest of the
1981
- * system reads the merged kinds through `nodes` / `edges` /
1982
- * `ontology` and never inspects this field. Absent on graphs that
1983
- * have never been extended; legacy graphs hash byte-identically.
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.
1984
3320
  */
1985
- extension: GraphExtension | undefined;
3321
+ reason?: "no_row_returned" | "duplicate_key";
1986
3322
  /**
1987
- * Soft-deprecated kind names attached to this graph. Set by the
1988
- * loader from the persisted schema and by `store.deprecateKinds(...)`
1989
- * / `store.undeprecateKinds(...)`. A purely informational signal
1990
- * surfaced for introspection — does not gate reads, writes, or
1991
- * queries. Defaults to the empty set on freshly-defined graphs.
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.
1992
3327
  */
1993
- deprecatedKinds: ReadonlySet<string>;
3328
+ attempted?: readonly Readonly<{
3329
+ kind: string;
3330
+ id: string;
3331
+ }>[];
1994
3332
  }>;
1995
3333
  /**
1996
- * Extract node kind names from a GraphDef.
1997
- */
1998
- type NodeKinds<G extends GraphDef> = keyof G["nodes"] & string;
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
+ }
1999
3345
  /**
2000
- * Extract edge kind names from a GraphDef.
3346
+ * Details for EmbeddingDimensionChangedError.
2001
3347
  */
2002
- type EdgeKinds<G extends GraphDef> = keyof G["edges"] & string;
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
+ }
2003
3369
  /**
2004
- * Get a NodeType from a GraphDef by kind name.
3370
+ * Thrown when a query predicate cannot be compiled for the target database.
2005
3371
  */
2006
- type GetNodeType<G extends GraphDef, K extends NodeKinds<G>> = G["nodes"][K]["type"];
3372
+ declare class UnsupportedPredicateError extends TypeGraphError {
3373
+ constructor(message: string, details?: Readonly<Record<string, unknown>>, options?: {
3374
+ cause?: unknown;
3375
+ suggestion?: string;
3376
+ });
3377
+ }
2007
3378
  /**
2008
- * Get an EdgeType from a GraphDef by kind name.
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.
2009
3383
  */
2010
- type GetEdgeType<G extends GraphDef, K extends EdgeKinds<G>> = G["edges"][K]["type"];
3384
+ declare class CompilerInvariantError extends TypeGraphError {
3385
+ constructor(message: string, details?: Readonly<Record<string, unknown>>, options?: {
3386
+ cause?: unknown;
3387
+ });
3388
+ }
2011
3389
  /**
2012
- * Get all NodeTypes from a GraphDef.
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.
2013
3422
  */
2014
- type AllNodeTypes<G extends GraphDef> = {
2015
- [K in NodeKinds<G>]: G["nodes"][K]["type"];
2016
- }[NodeKinds<G>];
3423
+ declare class TransactionClosedError extends TypeGraphError {
3424
+ constructor(options?: {
3425
+ cause?: unknown;
3426
+ });
3427
+ }
2017
3428
  /**
2018
- * Get all EdgeTypes from a GraphDef.
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
+ * ```
2019
3441
  */
2020
- type AllEdgeTypes<G extends GraphDef> = {
2021
- [K in EdgeKinds<G>]: G["edges"][K]["type"];
2022
- }[EdgeKinds<G>];
3442
+ declare function isTypeGraphError(error: unknown): error is TypeGraphError;
2023
3443
  /**
2024
- * Creates a graph definition.
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
2025
3450
  *
2026
3451
  * @example
2027
3452
  * ```typescript
2028
- * const graph = defineGraph({
2029
- * id: "my_graph",
2030
- * nodes: {
2031
- * Person: { type: Person },
2032
- * Company: { type: Company },
2033
- * },
2034
- * edges: {
2035
- * // Traditional EdgeRegistration syntax
2036
- * worksAt: {
2037
- * type: worksAt,
2038
- * from: [Person],
2039
- * to: [Company],
2040
- * cardinality: "many",
2041
- * },
2042
- * // Or use EdgeType directly if it has from/to defined
2043
- * knows, // EdgeType with built-in domain/range
2044
- * },
2045
- * ontology: [
2046
- * subClassOf(Company, Organization),
2047
- * disjointWith(Person, Organization),
2048
- * ],
2049
- * defaults: {
2050
- * onNodeDelete: "restrict",
2051
- * temporalMode: "current",
2052
- * },
2053
- * });
3453
+ * if (isUserRecoverable(error)) {
3454
+ * showErrorToUser(error.toUserMessage());
3455
+ * } else {
3456
+ * logAndAlertOps(error);
3457
+ * }
2054
3458
  * ```
2055
3459
  */
2056
- declare function defineGraph<const TNodes extends Record<string, NodeRegistration<NodeType>>, const TEdges extends Record<string, EdgeEntry>, const TOntology extends readonly OntologyRelation[], const TIdentity extends GraphIdentityConfig | undefined = undefined>(config: GraphDefConfig<TNodes, TEdges, TOntology, TIdentity>): GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology, TIdentity>;
3460
+ declare function isUserRecoverable(error: unknown): boolean;
2057
3461
  /**
2058
- * Checks if a value is a GraphDef.
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
2059
3468
  */
2060
- declare function isGraphDef(value: unknown): value is GraphDef;
3469
+ declare function isSystemError(error: unknown): boolean;
2061
3470
  /**
2062
- * Gets all node kind names from a GraphDef.
3471
+ * Check if error is a constraint violation.
2063
3472
  */
2064
- declare function getNodeKinds<G extends GraphDef>(graph: G): readonly (keyof G["nodes"] & string)[];
3473
+ declare function isConstraintError(error: unknown): boolean;
2065
3474
  /**
2066
- * Gets all edge kind names from a GraphDef.
3475
+ * Extract suggestion from error if available.
2067
3476
  */
2068
- declare function getEdgeKinds<G extends GraphDef>(graph: G): readonly (keyof G["edges"] & string)[];
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
+ }>;
2069
3550
 
2070
3551
  /**
2071
3552
  * JSON Schema type (subset used by Zod toJSONSchema).
@@ -2235,6 +3716,91 @@ type SerializedSchema = Readonly<{
2235
3716
  */
2236
3717
  type SchemaHash = string;
2237
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
+
2238
3804
  /**
2239
3805
  * Backend interface types for TypeGraph storage.
2240
3806
  *
@@ -2501,6 +4067,20 @@ type BackendCapabilities = Readonly<{
2501
4067
  * budget applies.
2502
4068
  */
2503
4069
  maxBindParameters?: number;
4070
+ /**
4071
+ * Whether this backend supplies the claim relations that fence declared
4072
+ * constraints (`uniques`, re-keyed onto claim axes, plus
4073
+ * `typegraph_edge_claims`) AND implements the claim members.
4074
+ *
4075
+ * Absent means `false`: the backend predates the claim relations, keeps every
4076
+ * fence it has today, and is listed as such in the parity matrix. Never
4077
+ * INFERRED from member presence — a projection that forwarded `capabilities`
4078
+ * while dropping a method would otherwise yield a verdict read from a
4079
+ * different object than the write goes to. `claimSupport`
4080
+ * (`store/claims/backing.ts`) is the one reader, and it refuses a backend
4081
+ * whose declaration and surface disagree in either direction.
4082
+ */
4083
+ readonly constraintClaims?: boolean;
2504
4084
  /** Vector search capabilities (undefined if not configured) */
2505
4085
  vector?: VectorCapabilities | undefined;
2506
4086
  /** Fulltext search capabilities (undefined if not configured) */
@@ -2513,6 +4093,50 @@ type BackendCapabilities = Readonly<{
2513
4093
  * equivalent to every member `false`).
2514
4094
  */
2515
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";
2516
4140
  }>;
2517
4141
  /** Keeps session-scoped analytics honest when a required SQL feature is absent. */
2518
4142
  declare function normalizeGraphAnalyticsCapabilities(capabilities: BackendCapabilities): BackendCapabilities;
@@ -3659,6 +5283,67 @@ type IdentityTableNames = Readonly<{
3659
5283
  identityClosure: string;
3660
5284
  identitySeparation: string;
3661
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
+ }>;
5336
+ /**
5337
+ * The database-global extensions TypeGraph installs on a caller's behalf.
5338
+ *
5339
+ * The extent is closed on purpose: {@link GraphBackend.ensureExtension}
5340
+ * interpolates the name into DDL, so the allowlist — not the caller — is what
5341
+ * decides the identifier can be trusted. `pg_trgm` backs `method: "trigram"`
5342
+ * index materialization; `vector` backs pgvector storage.
5343
+ */
5344
+ declare const DATABASE_EXTENSION_NAMES: readonly ["pg_trgm", "vector"];
5345
+ /** A name {@link GraphBackend.ensureExtension} accepts. */
5346
+ type DatabaseExtensionName = (typeof DATABASE_EXTENSION_NAMES)[number];
3662
5347
  /**
3663
5348
  * The GraphBackend interface abstracts database operations.
3664
5349
  *
@@ -3769,8 +5454,70 @@ type GraphBackend = Readonly<{
3769
5454
  * rebuild reservations from the returned node after-images.
3770
5455
  */
3771
5456
  hardDeleteUniquesByNodeIds?: (this: void, params: HardDeleteUniquesByNodeIdsParams) => Promise<void>;
5457
+ /**
5458
+ * Permanently removes every uniqueness claim owned by nodes of one concrete
5459
+ * kind, at whatever axis each claim sits on. THE definition of "the claims
5460
+ * this kind owns" — kind removal reaps through it so it can neither leak a
5461
+ * claim whose axis is a sibling kind nor delete a surviving sibling's claim.
5462
+ * Optional capability.
5463
+ */
5464
+ hardDeleteUniquesByConcreteKind?: (this: void, params: HardDeleteUniquesByConcreteKindParams) => Promise<void>;
3772
5465
  checkUnique: (this: void, params: CheckUniqueParams) => Promise<UniqueRow | undefined>;
3773
5466
  checkUniqueBatch?: (this: void, params: CheckUniqueBatchParams) => Promise<readonly UniqueRow[]>;
5467
+ /**
5468
+ * Takes the claim on one edge cardinality axis, in two statements: a
5469
+ * decision-free create-or-lock that reports the committed holder, and — only
5470
+ * when that holder is a different edge — a conditional takeover that succeeds
5471
+ * exactly when the incumbent is no longer an edge the axis and key describe.
5472
+ *
5473
+ * The claim is the FENCE for a declared cardinality: `(kind, from)` and
5474
+ * `(kind, from, to)` are predicates the edges primary key `(graph_id, id)`
5475
+ * cannot enforce, so without this relation two concurrent writers can both
5476
+ * pass the probe and both commit. Read through the `constraintClaims`
5477
+ * capability, never through member presence — see `claimSupport`
5478
+ * (`store/claims/backing.ts`).
5479
+ */
5480
+ claimEdgeCardinality?: (this: void, params: ClaimEdgeCardinalityParams) => Promise<EdgeClaimOutcome>;
5481
+ /**
5482
+ * Batched variant of `claimEdgeCardinality`: one multi-row create-or-lock
5483
+ * statement, then a takeover statement only for the entries a different edge
5484
+ * holds. Outcomes are returned positionally, one per entry.
5485
+ *
5486
+ * Callers must not pass two entries with the same conflict target
5487
+ * (`axis`, `key`): a multi-row upsert cannot affect one row twice.
5488
+ */
5489
+ claimEdgeCardinalityBatch?: (this: void, entries: readonly ClaimEdgeCardinalityParams[]) => Promise<readonly EdgeClaimOutcome[]>;
5490
+ /**
5491
+ * Housekeeping only: drops the claim rows named edges hold, so hard deletes,
5492
+ * kind removal and `clearGraph` do not grow the relation without bound. The
5493
+ * FENCE never depends on it having run — a claim whose holder is no longer
5494
+ * live (or, for `oneActive`, no longer active) is taken over in place.
5495
+ */
5496
+ purgeEdgeClaims?: (this: void, params: PurgeEdgeClaimsParams) => Promise<void>;
5497
+ /**
5498
+ * Read-only diagnostic: the rows that make a declared constraint currently
5499
+ * violated, for a caller (`store.verifyConstraintFences()`) that folds them
5500
+ * onto the claim axes they contend for.
5501
+ *
5502
+ * It reads the ENTITY relations for the two families whose pre-upgrade
5503
+ * violations no claim row records — a database written before the claim
5504
+ * relations existed holds no edge claims at all — and the `uniques` relation
5505
+ * for uniqueness, where a pre-upgrade duplicate is exactly two live rows
5506
+ * sitting at two different `node_kind`s. A scan of a claim relation's primary
5507
+ * key can find neither, which is why this is not one.
5508
+ *
5509
+ * Returns the contending ROWS, not the verdict: the axis a `uniques` row
5510
+ * belongs to is a fold over the graph's subclass component, and the key an
5511
+ * edge's claim sits on is `EDGE_CARDINALITY_SPECS`' — both of which live
5512
+ * above the backend, so a backend that decided either would be a second
5513
+ * spelling of a decision the fence already owns.
5514
+ *
5515
+ * Writes nothing: no DDL, no claim writes. Safe on a replica and under a
5516
+ * least-privilege role. Present only on backends that can run the audit;
5517
+ * `store.verifyConstraintFences()` refuses with a typed error when absent
5518
+ * rather than reporting an empty (and therefore reassuring) result.
5519
+ */
5520
+ readConstraintFenceViolations?: (this: void, params: ReadConstraintFenceViolationsParams) => Promise<ConstraintFenceViolationRows>;
3774
5521
  getActiveSchema: (this: void, graphId: string) => Promise<SchemaVersionRow | undefined>;
3775
5522
  getSchemaVersion: (this: void, graphId: string, version: number) => Promise<SchemaVersionRow | undefined>;
3776
5523
  /**
@@ -3951,6 +5698,12 @@ type GraphBackend = Readonly<{
3951
5698
  * Install the PostgreSQL `pg_trgm` extension under a database-global
3952
5699
  * concurrency fence. Relational trigram index materialization calls this
3953
5700
  * before emitting its index DDL; non-PostgreSQL backends omit it.
5701
+ *
5702
+ * @deprecated The `pg_trgm`-only spelling of {@link GraphBackend.ensureExtension},
5703
+ * which says the same thing for every extension the library installs. It is
5704
+ * retained — and still consulted, after `ensureExtension` — so a backend
5705
+ * written against 0.47 keeps its fence; the bundled PostgreSQL backend
5706
+ * implements it by delegating. Implement `ensureExtension` in new backends.
3954
5707
  */
3955
5708
  ensureTrigramExtension?: (this: void) => Promise<void>;
3956
5709
  /**
@@ -4011,6 +5764,21 @@ type GraphBackend = Readonly<{
4011
5764
  * @internal
4012
5765
  */
4013
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>>;
4014
5782
  /**
4015
5783
  * Look up a recorded materialization for a declared index by its
4016
5784
  * physical SQL index name. Returns `undefined` if no row exists.
@@ -4394,6 +6162,30 @@ type GraphBackend = Readonly<{
4394
6162
  * statement outside `transaction(...)`.
4395
6163
  */
4396
6164
  executeDdl?: (this: void, ddl: string) => Promise<void>;
6165
+ /**
6166
+ * Installs a database-global extension idempotently, tolerating the
6167
+ * concurrent-install race.
6168
+ *
6169
+ * `CREATE EXTENSION IF NOT EXISTS` is not a concurrency primitive on
6170
+ * PostgreSQL: the existence check cannot see another session's uncommitted
6171
+ * `pg_extension` row, so the loser of a race waits for the winner and is
6172
+ * then handed SQLSTATE 23505 instead of the harmless "already exists"
6173
+ * notice (#446). A backend implementing this member owns that retry, and
6174
+ * may additionally serialize same-extension installers behind a fence of its
6175
+ * own (the bundled PostgreSQL backend takes a transaction advisory lock
6176
+ * keyed on the extension, #475).
6177
+ *
6178
+ * This is the one member the library asks for an extension install; it
6179
+ * supersedes {@link GraphBackend.ensureTrigramExtension}, which said the same
6180
+ * thing for one extension.
6181
+ *
6182
+ * Like `executeDdl`, implementations MUST run the statement at the
6183
+ * top-level backend, never inside `transaction(...)`: the 23505 aborts the
6184
+ * enclosing transaction, so a retry issued inside one would only collect
6185
+ * `25P02` on the way out. That is why this member is absent from
6186
+ * {@link TransactionBackend}.
6187
+ */
6188
+ ensureExtension?: (this: void, name: DatabaseExtensionName) => Promise<void>;
4397
6189
  /** Runs TypeGraph operations inside a backend-owned transaction. */
4398
6190
  transaction: <T>(this: void, fn: (tx: TransactionBackend) => Promise<T>, options?: TransactionOptions) => Promise<T>;
4399
6191
  close: (this: void) => Promise<void>;
@@ -4418,7 +6210,7 @@ type EdgeEntityReadBackend = Pick<GraphBackend, "getEdge" | "getEdges" | "countE
4418
6210
  type EdgeEntityWriteBackend = Pick<GraphBackend, "insertEdge" | "insertEdgeNoReturn" | "insertEdgesBatch" | "insertEdgesBatchReturning" | "updateEdge" | "deleteEdge" | "deleteEdgesBatch" | "hardDeleteEdge" | "hardDeleteEdgesBatch">;
4419
6211
  type GraphEntityReadBackend = NodeEntityReadBackend & EdgeEntityReadBackend;
4420
6212
  type GraphEntityWriteBackend = NodeEntityWriteBackend & EdgeEntityWriteBackend;
4421
- type UniqueConstraintBackend = Pick<GraphBackend, "insertUnique" | "insertUniqueBatch" | "deleteUnique" | "hardDeleteUniquesByNodeIds" | "checkUnique" | "checkUniqueBatch">;
6213
+ type UniqueConstraintBackend = Pick<GraphBackend, "insertUnique" | "insertUniqueBatch" | "deleteUnique" | "hardDeleteUniquesByNodeIds" | "hardDeleteUniquesByConcreteKind" | "checkUnique" | "checkUniqueBatch">;
4422
6214
  type SchemaReadBackend = Pick<GraphBackend, "getActiveSchema" | "getSchemaVersion">;
4423
6215
  type SchemaCommitBackend = Pick<GraphBackend, "commitSchemaVersion" | "commitSchemaVersionIfKindsEmpty" | "setActiveVersion">;
4424
6216
  type SchemaWriteFenceBackend = Pick<GraphBackend, "lockSchemaVersionForWrite">;
@@ -4453,7 +6245,7 @@ type TransactionReadBackend = Readonly<BackendIdentity & GraphEntityReadBackend
4453
6245
  * deliberately absent: their guarantees depend on the top-level backend or
4454
6246
  * lifecycle owner rather than an already-open transaction.
4455
6247
  */
4456
- type TransactionBackend = Readonly<BackendIdentity & GraphEntityReadBackend & GraphEntityWriteBackend & UniqueConstraintBackend & SchemaReadBackend & Pick<GraphBackend, "lockSchemaVersionForWrite"> & VectorOperationBackend & FulltextOperationBackend & IndexMaterializationBackend & ContributionMaterializationBackend & RemovalMaterializationBackend & GraphLifecycleBackend & QueryExecutionBackend & RawQueryExecutionBackend & RawStatementExecutionBackend>;
6248
+ type TransactionBackend = Readonly<BackendIdentity & GraphEntityReadBackend & GraphEntityWriteBackend & UniqueConstraintBackend & Pick<GraphBackend, "claimEdgeCardinality" | "claimEdgeCardinalityBatch" | "purgeEdgeClaims"> & SchemaReadBackend & Pick<GraphBackend, "lockSchemaVersionForWrite"> & VectorOperationBackend & FulltextOperationBackend & IndexMaterializationBackend & ContributionMaterializationBackend & RemovalMaterializationBackend & GraphLifecycleBackend & QueryExecutionBackend & RawQueryExecutionBackend & RawStatementExecutionBackend>;
4457
6249
  /**
4458
6250
  * The target a schema-commit preflight runs against: a transaction backend
4459
6251
  * that MAY also carry the schema-write DDL primitive.
@@ -4483,13 +6275,34 @@ type InsertUniqueParams = Readonly<{
4483
6275
  concreteKind: string;
4484
6276
  }>;
4485
6277
  /**
4486
- * Parameters for deleting a unique constraint entry.
6278
+ * Parameters for releasing a unique constraint entry.
6279
+ *
6280
+ * Every release is scoped to the claim's OWNER — the pair
6281
+ * `(concreteKind, nodeId)`, because a node id is unique only within its kind.
6282
+ * The two shapes differ only in whether the claim AXIS participates:
6283
+ *
6284
+ * - **Lifecycle release** (`nodeKind` absent) — "give up every claim this node
6285
+ * holds for this constraint and key, whatever axis it sits on". Soft delete,
6286
+ * an update's key-change release and the resurrect diff use it, so a claim
6287
+ * written under an older axis is still released by newer code.
6288
+ * - **Compensating release** (`nodeKind` present) — "undo exactly the row I
6289
+ * just claimed, at the axis I claimed it on". A failed write's rollback uses
6290
+ * it, so it touches neither a row that predates the write nor one another
6291
+ * node holds.
4487
6292
  */
4488
6293
  type DeleteUniqueParams = Readonly<{
4489
6294
  graphId: string;
4490
- nodeKind: string;
6295
+ /**
6296
+ * The claim axis (`uniques.node_kind`) the release is restricted to. Absent
6297
+ * releases the owner's claims at every axis — see the two shapes above.
6298
+ */
6299
+ nodeKind?: string;
4491
6300
  constraintName: string;
4492
6301
  key: string;
6302
+ /** The claim owner's concrete kind (`uniques.concrete_kind`). */
6303
+ concreteKind: string;
6304
+ /** The claim owner's node id (`uniques.node_id`). */
6305
+ nodeId: string;
4493
6306
  }>;
4494
6307
  /** Parameters for permanently clearing uniqueness sidecars by node identity. */
4495
6308
  type HardDeleteUniquesByNodeIdsParams = Readonly<{
@@ -4497,6 +6310,115 @@ type HardDeleteUniquesByNodeIdsParams = Readonly<{
4497
6310
  concreteKind: string;
4498
6311
  nodeIds: readonly string[];
4499
6312
  }>;
6313
+ /** Parameters for permanently clearing every uniqueness claim a kind owns. */
6314
+ type HardDeleteUniquesByConcreteKindParams = Readonly<{
6315
+ graphId: string;
6316
+ concreteKind: string;
6317
+ }>;
6318
+ /**
6319
+ * One edge cardinality claim, named by the components its axis, its key and its
6320
+ * holder-liveness predicate are all built from.
6321
+ *
6322
+ * The components are passed RAW rather than pre-rendered: `EDGE_CARDINALITY_SPECS`
6323
+ * (`store/claims/edge-claims.ts`) is the one table that decides which endpoints
6324
+ * the key covers and what a holder must still be, and both the TypeScript probe
6325
+ * and the SQL builder read it. A caller that rendered the axis and key itself
6326
+ * would be a second spelling of that decision.
6327
+ */
6328
+ type ClaimEdgeCardinalityParams = Readonly<{
6329
+ graphId: string;
6330
+ /** The declared cardinality; `many` declares nothing and never claims. */
6331
+ cardinality: Exclude<Cardinality, "many">;
6332
+ edgeKind: string;
6333
+ /** The edge that will hold the axis if this claim lands. */
6334
+ edgeId: string;
6335
+ fromKind: string;
6336
+ fromId: string;
6337
+ toKind: string;
6338
+ toId: string;
6339
+ }>;
6340
+ /**
6341
+ * What a claim statement decided.
6342
+ *
6343
+ * `refused` carries the incumbent so the caller can say which edge holds the
6344
+ * axis; the typed refusal itself is the store's, built from the same
6345
+ * `checkCardinality` / `checkUniqueEdge` owners the probe uses, so a caller
6346
+ * cannot tell which layer refused.
6347
+ */
6348
+ type EdgeClaimOutcome = Readonly<{
6349
+ status: "claimed";
6350
+ }> | Readonly<{
6351
+ status: "refused";
6352
+ holderEdgeId: string;
6353
+ }>;
6354
+ /** Parameters for the housekeeping purge of claims held by named edges. */
6355
+ type PurgeEdgeClaimsParams = Readonly<{
6356
+ graphId: string;
6357
+ edgeIds: readonly string[];
6358
+ }>;
6359
+ /** One edge kind's declared cardinality, as the fence audit reads it. */
6360
+ type EdgeCardinalityDeclaration = Readonly<{
6361
+ edgeKind: string;
6362
+ /** `many` declares nothing, so it is unrepresentable here. */
6363
+ cardinality: Exclude<Cardinality, "many">;
6364
+ }>;
6365
+ /**
6366
+ * What a constraint-fence audit asks the database about: the declarations the
6367
+ * graph carries, one list per family.
6368
+ *
6369
+ * The declarations are passed rather than discovered because the backend holds
6370
+ * no schema — and because the `uniqueConstraintNames` restriction is
6371
+ * load-bearing rather than an optimization: the `uniques` relation also holds
6372
+ * disjointness claims, whose `node_kind` is a pair label rather than a kind and
6373
+ * for which no uniqueness axis can be computed. Those rows are covered by
6374
+ * `disjointKindPairs`, from the nodes relation.
6375
+ */
6376
+ type ReadConstraintFenceViolationsParams = Readonly<{
6377
+ graphId: string;
6378
+ /** Every unique constraint name the graph declares, in any scope. */
6379
+ uniqueConstraintNames: readonly string[];
6380
+ /** Every declared `disjointWith` pair, each read as one intersection. */
6381
+ disjointKindPairs: readonly (readonly [string, string])[];
6382
+ /** Every edge kind declaring a cardinality other than `many`. */
6383
+ edgeCardinalities: readonly EdgeCardinalityDeclaration[];
6384
+ }>;
6385
+ /**
6386
+ * One live `uniques` row that shares its `(constraint_name, key)` with at least
6387
+ * one other live row — a candidate, not a verdict: two rows contend only when
6388
+ * their `node_kind`s fold onto ONE claim axis, which the caller decides.
6389
+ */
6390
+ type ContendedUniqueRow = Readonly<{
6391
+ nodeKind: string;
6392
+ constraintName: string;
6393
+ key: string;
6394
+ concreteKind: string;
6395
+ nodeId: string;
6396
+ }>;
6397
+ /**
6398
+ * One live edge that shares its declared cardinality's population with at least
6399
+ * one other live edge. The endpoints are returned whole so the caller can name
6400
+ * the claim key through the one builder that renders it.
6401
+ */
6402
+ type ContendedEdgeRow = Readonly<{
6403
+ edgeKind: string;
6404
+ cardinality: Exclude<Cardinality, "many">;
6405
+ edgeId: string;
6406
+ fromKind: string;
6407
+ fromId: string;
6408
+ toKind: string;
6409
+ toId: string;
6410
+ }>;
6411
+ /** One node id live under BOTH kinds of a declared disjoint pair. */
6412
+ type DisjointOverlapRow = Readonly<{
6413
+ kinds: readonly [string, string];
6414
+ nodeId: string;
6415
+ }>;
6416
+ /** Everything one constraint-fence audit read, per family. */
6417
+ type ConstraintFenceViolationRows = Readonly<{
6418
+ contendedUniqueRows: readonly ContendedUniqueRow[];
6419
+ contendedEdgeRows: readonly ContendedEdgeRow[];
6420
+ disjointOverlaps: readonly DisjointOverlapRow[];
6421
+ }>;
4500
6422
  /**
4501
6423
  * Parameters for checking a unique constraint.
4502
6424
  */
@@ -5653,4 +7575,4 @@ type RelationalIndexDeclaration = NodeIndexDeclaration | EdgeIndexDeclaration;
5653
7575
  type IndexDeclaration = RelationalIndexDeclaration | VectorIndexDeclaration;
5654
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";
5655
7577
 
5656
- export { type DialectCapabilities as $, ALL_FULLTEXT_MODES as A, BASE_CONTRIBUTION_OWNER as B, type Cardinality as C, type ContributionProbeEntry as D, type ContributionProbeResult as E, type ContributionProbeState as F, type ContributionRebuildResult as G, type ContributionRebuildScope as H, type IndexDeclaration as I, type ContributionRepairEntry as J, type ContributionRepairResult as K, type ContributionRepopulationStats as L, type CountEdgesByKindParams as M, type CountEdgesFromParams as N, type CountNodesByKindParams as O, type CreateVectorIndexParams as P, D1_MAX_BIND_PARAMETERS as Q, DURABLE_OBJECT_MAX_BIND_PARAMETERS as R, type DeleteBehavior as S, type DeleteEdgeParams as T, type DeleteEdgesBatchParams as U, type DeleteEmbeddingParams as V, type DeleteFulltextBatchParams as W, type DeleteFulltextParams as X, type DeleteNodeParams as Y, type DeleteUniqueParams as Z, type DialectAdapter as _, ALL_META_EDGE_NAMES as a, type IndexDeclarationBase as a$, type DialectRecursiveQueryStrategy as a0, type DialectStandardQueryStrategy as a1, type DialectVectorPredicateStrategy as a2, type DropVectorIndexParams as a3, type EdgeEntityReadBackend as a4, type EdgeEntityWriteBackend as a5, type EdgeExistsBetweenParams as a6, type EdgeIndexDeclaration as a7, type EdgeIndexDirection as a8, type EdgeRow as a9, type FindEdgesByHeterogeneousEndpointSetParams as aA, type FindEdgesByKindParams as aB, type FindEdgesConnectedToParams as aC, type FindNodesByKindParams as aD, type FulltextBatchRow as aE, type FulltextCapabilities as aF, type FulltextOperationBackend as aG, type FulltextQueryMode as aH, type FulltextSearchParams as aI, type FulltextSearchResult as aJ, type FulltextStrategy as aK, type GraphAnalyticsCapabilities as aL, type GraphBackend as aM, type GraphEntityReadBackend as aN, type GraphEntityWriteBackend as aO, type GraphExtension as aP, type GraphExtensionVersion as aQ, type GraphIdentityConfig as aR, type GraphLifecycleBackend as aS, type GraphReadBackend as aT, type HardDeleteEdgeParams as aU, type HardDeleteNodeParams as aV, type HardDeleteUniquesByNodeIdsParams as aW, type HybridSearchParams as aX, type HybridSearchRow as aY, type IdentityTableNames as aZ, type InListParameterOptions as a_, type EndpointExistence as aa, type ExtensionArrayItemType as ab, type ExtensionArrayProperty as ac, type ExtensionBooleanProperty as ad, type ExtensionEdgeDef as ae, type ExtensionEdgeIndex as af, type ExtensionEmbeddingModifier as ag, type ExtensionEnumProperty as ah, type ExtensionIndex as ai, type ExtensionIndexWhere as aj, type ExtensionNodeDef as ak, type ExtensionNodeIndex as al, type ExtensionNumberProperty as am, type ExtensionObjectFieldProperty as an, type ExtensionObjectProperty as ao, type ExtensionOntologyRelation as ap, type ExtensionPropertyModifiers as aq, type ExtensionPropertyType as ar, type ExtensionSearchableModifier as as, type ExtensionStringProperty as at, type ExtensionUniqueConstraint as au, type ExtensionUniqueWhere as av, FULLTEXT_CONTRIBUTION_NAME as aw, type FilteredApproximateSearch as ax, type FilteredApproximateSearchMode as ay, type FindEdgesByEndpointSetParams as az, type AdapterBackend as b, type SetActiveVersionParams as b$, type IndexEntity as b0, type IndexMaterializationBackend as b1, type IndexMaterializationRow as b2, type IndexOrigin as b3, type IndexScope as b4, type IndexWhereExpression as b5, type IndexWhereLiteral as b6, type IndexWhereOp as b7, type IndexWhereOperand as b8, type InferenceType as b9, type RawStatementExecutionBackend as bA, type RecordContributionMaterializationParams as bB, type RecordIndexMaterializationParams as bC, type RecordKindRemovalParams as bD, type RelationalIndexDeclaration as bE, type RelationalIndexMethod as bF, type ReleaseIndexMaterializationClaimParams as bG, type RemovalMaterializationBackend as bH, type RenderedSql as bI, type ResolvedSqlTableNames as bJ, type RowProps as bK, SQLITE_CAPABILITIES as bL, SQLITE_MAX_BIND_PARAMETERS as bM, type SchemaCommitBackend as bN, type SchemaCommitPreflightBackend as bO, type SchemaKindEmptinessProbe as bP, type SchemaReadBackend as bQ, type SchemaVersionRow as bR, type SchemaWriteFenceBackend as bS, type SerializedClosures as bT, type SerializedEdgeDef as bU, type SerializedMetaEdge as bV, type SerializedNodeDef as bW, type SerializedOntology as bX, type SerializedOntologyRelation as bY, type SerializedSchema as bZ, type SerializedUniqueConstraint as b_, type InsertEdgeParams as ba, type InsertNodeParams as bb, type InsertSchemaParams as bc, type InsertUniqueParams as bd, type IntentSql as be, type JsonPointer as bf, type JsonSchema as bg, type JsonValue as bh, type KindAnnotations as bi, type KindEntity as bj, type KindRemovalRow as bk, type LiveNodeRow as bl, type LockSchemaVersionForWriteParams as bm, MODERN_SQLITE_MAX_BIND_PARAMETERS as bn, type MetaEdgeName as bo, type NodeEntityReadBackend as bp, type NodeEntityWriteBackend as bq, type NodeIndexDeclaration as br, type NodeRow as bs, type NullCheckOp as bt, POSTGRES_CAPABILITIES as bu, POSTGRES_MAX_BIND_PARAMETERS as bv, Placeholder as bw, type PopulatedSchemaKind as bx, type QueryExecutionBackend as by, type RawQueryExecutionBackend as bz, type AdapterBackendTransactions as c, renderSqlite as c$, type SqlChunk as c0, type SqlCompilationBackend as c1, type SqlDialect as c2, type SqlFragment as c3, type SqlIdentifierChunk as c4, type SqlIntent as c5, type SqlParameterChunk as c6, type SqlPlaceholderChunk as c7, type SqlTableNames as c8, type SqlTag as c9, type VectorIndexDeclaration as cA, type VectorIndexImplementation as cB, type VectorIndexMetric as cC, type VectorIndexParams as cD, type VectorIndexType as cE, type VectorMetric as cF, type VectorOperationBackend as cG, type VectorSearchFrontierTuning as cH, type VectorSearchParams as cI, type VectorSearchResult as cJ, type VectorSlot as cK, type VectorStrategy as cL, assertFiniteEmbedding as cM, assertVectorMinScore as cN, assertVectorSearchLimit as cO, buildFulltextCapabilities as cP, buildVectorCapabilities as cQ, fts5Strategy as cR, isLiveNodeRow as cS, isSqlFragment as cT, isSqlPlaceholder as cU, isTombstonedNodeRow as cV, normalizeGraphAnalyticsCapabilities as cW, quoteIdentifier as cX, renderPostgres as cY, renderSql as cZ, renderSqlInline as c_, type SqlTextChunk as ca, type StrategyTableContribution as cb, type SystemColumnName as cc, type TableContribution as cd, type TemporalMode as ce, type TombstonedNodeRow as cf, type TransactionBackend as cg, type TransactionOptions as ch, type TransactionReadBackend as ci, type TrustedImportOptions as cj, type TrustedImportSession as ck, type UniqueConstraintBackend as cl, type UniqueRow as cm, type UniquenessScope as cn, type UpdateEdgeParams as co, type UpdateNodeParams as cp, type UpdateNodeSetParams as cq, type UpdateNodeSetResult as cr, type UpsertEmbeddingBatchParams as cs, type UpsertEmbeddingBatchRow as ct, type UpsertEmbeddingParams as cu, type UpsertFulltextBatchParams as cv, type UpsertFulltextParams as cw, VECTOR_CONTRIBUTION_PREFIX as cx, type ValueType as cy, type VectorCapabilities as cz, type BackendCapabilities as d, asEdgeId as d$, rowPropsToJsonText as d0, rowPropsToObject as d1, shortHash as d2, sql as d3, tsvectorStrategy as d4, vectorMinScoreCondition as d5, vectorPhysicalName as d6, vectorScoreExpression as d7, type GraphDef as d8, type QueryAst as d9, type EdgeTypeWithEndpoints as dA, type ExternalRecordedReadSource as dB, type GetEdgeType as dC, type GetNodeType as dD, type GraphDefaults as dE, type HybridFusionOptions as dF, type JsonPointerFor as dG, type JsonPointerInput as dH, type JsonPointerSegment as dI, type JsonPointerSegments as dJ, type JsonPointerSegmentsFor as dK, LEGACY_GRAPH_EXTENSION_VERSION as dL, MAX_JSON_POINTER_DEPTH as dM, type MetaEdge as dN, type MetaEdgeProperties as dO, type NodeId as dP, type NodeKinds as dQ, type NodeProps as dR, type NodeRegistration as dS, type OrderSpec as dT, type ParameterRef as dU, type RecordedRelationOptions as dV, type ResolveJsonPointer as dW, type ResolveJsonPointerSegments as dX, type SortDirection as dY, type TraversalExpansion as dZ, type UniqueConstraint as d_, type EdgeIndexConfig as da, type EdgeIndexWhereBuilder as db, type IndexWhereFieldBuilder as dc, type IndexWhereInput as dd, type NodeIndexConfig as de, type NodeIndexWhereBuilder as df, type NodeType as dg, type AnyEdgeType as dh, SqlSchema as di, type SchemaHash as dj, type AggregateExpr as dk, type FieldRef as dl, type ComparisonOp as dm, type AggregateComparisonPredicate as dn, type TraversalDirection as dp, type OntologyRelation as dq, type EdgeType as dr, type AllEdgeTypes as ds, type AllNodeTypes as dt, CURRENT_GRAPH_EXTENSION_VERSION as du, DEFAULT_SQL_SCHEMA as dv, type EdgeId as dw, type EdgeKinds as dx, type EdgeProps as dy, type EdgeRegistration as dz, type BackendIdentity as e, asNodeId as e0, createSqlSchema as e1, defineGraph as e2, getEdgeKinds as e3, getNodeKinds as e4, isEdgeType as e5, isEdgeTypeWithEndpoints as e6, isGraphDef as e7, isMetaEdge as e8, isNodeType as e9, joinJsonPointers as ea, jsonPointer as eb, normalizeJsonPointer as ec, parseJsonPointer as ed, recordedRelation as ee, type PredicateExpression as ef, type VectorMetricType as eg, type Traversal as eh, type NodePredicate as ei, type ProjectedField as ej, type AggregateOrderSpec as ek, type GroupBySpec as el, type RecursiveCyclePolicy as em, type VectorSlotMap as en, type RecordedReadBinding as eo, type SelectiveField as ep, type ComposableQuery as eq, type SetOperationType as er, type SetOperation as es, type BackendValidityEndMutation as et, GRAPH_EXTENSION_TOP_LEVEL_KEYS as eu, type GraphExtensionTopLevelKey as ev, type BackendLifecycle as f, type BackendMaintenance as g, type BackendTransactions as h, type CheckUniqueBatchParams as i, type CheckUniqueParams as j, type ClaimIndexMaterializationParams as k, type Collation as l, type CommitSchemaVersionExpected as m, type CommitSchemaVersionIfKindsEmptyResult as n, type CommitSchemaVersionParams as o, type CompiledRowsSql as p, type CompiledSelectSql as q, type CompiledStatementSql as r, type CompiledTemporaryStatementSql as s, type ContributionCapabilities as t, type ContributionDiagnostic as u, type ContributionDiagnosticState as v, type ContributionMaterializationBackend as w, type ContributionMaterializationIdentity as x, type ContributionMaterializationRow as y, type ContributionProbeContribution 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 };