@nicia-ai/typegraph 0.50.0 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/README.md +12 -0
  2. package/dist/backend/drizzle/indexes.cjs +10 -8
  3. package/dist/backend/drizzle/indexes.d.cts +1 -1
  4. package/dist/backend/drizzle/indexes.d.ts +1 -1
  5. package/dist/backend/drizzle/indexes.js +6 -4
  6. package/dist/backend/index.cjs +183 -50
  7. package/dist/backend/index.d.cts +90 -4
  8. package/dist/backend/index.d.ts +90 -4
  9. package/dist/backend/index.js +6 -9
  10. package/dist/backend/postgres/index.cjs +30 -28
  11. package/dist/backend/postgres/index.d.cts +7 -7
  12. package/dist/backend/postgres/index.d.ts +7 -7
  13. package/dist/backend/postgres/index.js +16 -14
  14. package/dist/backend/postgres/pglite-store.cjs +6 -62
  15. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  16. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  17. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  18. package/dist/backend/postgres/pglite-store.js +6 -62
  19. package/dist/backend/postgres/pglite-store.js.map +1 -1
  20. package/dist/backend/postgres/pglite.cjs +18 -16
  21. package/dist/backend/postgres/pglite.d.cts +3 -3
  22. package/dist/backend/postgres/pglite.d.ts +3 -3
  23. package/dist/backend/postgres/pglite.js +17 -15
  24. package/dist/backend/sqlite/index.cjs +27 -25
  25. package/dist/backend/sqlite/index.d.cts +7 -7
  26. package/dist/backend/sqlite/index.d.ts +7 -7
  27. package/dist/backend/sqlite/index.js +14 -12
  28. package/dist/backend/sqlite/libsql.cjs +21 -19
  29. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  30. package/dist/backend/sqlite/libsql.d.cts +3 -3
  31. package/dist/backend/sqlite/libsql.d.ts +3 -3
  32. package/dist/backend/sqlite/libsql.js +16 -14
  33. package/dist/backend/sqlite/libsql.js.map +1 -1
  34. package/dist/backend/sqlite/local-store.cjs +8 -64
  35. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  36. package/dist/backend/sqlite/local-store.d.cts +8 -8
  37. package/dist/backend/sqlite/local-store.d.ts +8 -8
  38. package/dist/backend/sqlite/local-store.js +7 -64
  39. package/dist/backend/sqlite/local-store.js.map +1 -1
  40. package/dist/backend/sqlite/local.cjs +22 -19
  41. package/dist/backend/sqlite/local.d.cts +3 -3
  42. package/dist/backend/sqlite/local.d.ts +3 -3
  43. package/dist/backend/sqlite/local.js +18 -15
  44. package/dist/{chunk-TUVD4DFR.cjs → chunk-2CVDZCXH.cjs} +122 -51
  45. package/dist/chunk-2CVDZCXH.cjs.map +1 -0
  46. package/dist/{chunk-I5C6OTKR.js → chunk-2DWTBNSH.js} +3 -3
  47. package/dist/{chunk-I5C6OTKR.js.map → chunk-2DWTBNSH.js.map} +1 -1
  48. package/dist/{chunk-C76WFIVZ.cjs → chunk-2KCTP3U2.cjs} +180 -127
  49. package/dist/chunk-2KCTP3U2.cjs.map +1 -0
  50. package/dist/{chunk-BYBDM423.cjs → chunk-322TBTOQ.cjs} +48 -48
  51. package/dist/{chunk-BYBDM423.cjs.map → chunk-322TBTOQ.cjs.map} +1 -1
  52. package/dist/chunk-36SX6QXP.cjs +186 -0
  53. package/dist/chunk-36SX6QXP.cjs.map +1 -0
  54. package/dist/{chunk-H3XP6BAV.js → chunk-36VYWVQU.js} +3 -3
  55. package/dist/{chunk-H3XP6BAV.js.map → chunk-36VYWVQU.js.map} +1 -1
  56. package/dist/{chunk-VTJVMP4I.js → chunk-4DKY6RIU.js} +102 -31
  57. package/dist/chunk-4DKY6RIU.js.map +1 -0
  58. package/dist/chunk-4QKOZYMV.js +9 -0
  59. package/dist/chunk-4QKOZYMV.js.map +1 -0
  60. package/dist/{chunk-U3Z7XKAG.js → chunk-57JM6NW3.js} +8 -18
  61. package/dist/chunk-57JM6NW3.js.map +1 -0
  62. package/dist/{chunk-WCLMKNQE.cjs → chunk-5FVZSE3B.cjs} +1356 -1108
  63. package/dist/chunk-5FVZSE3B.cjs.map +1 -0
  64. package/dist/{chunk-XMY2SXOH.cjs → chunk-5WWEYV4H.cjs} +2208 -579
  65. package/dist/chunk-5WWEYV4H.cjs.map +1 -0
  66. package/dist/{chunk-WQBAQZHR.js → chunk-6NLYIMJO.js} +4 -4
  67. package/dist/{chunk-WQBAQZHR.js.map → chunk-6NLYIMJO.js.map} +1 -1
  68. package/dist/{chunk-G2TLHH6T.cjs → chunk-7B7I7YAW.cjs} +6 -6
  69. package/dist/{chunk-G2TLHH6T.cjs.map → chunk-7B7I7YAW.cjs.map} +1 -1
  70. package/dist/{chunk-EDLKIQRI.js → chunk-7G5IYROL.js} +6 -548
  71. package/dist/chunk-7G5IYROL.js.map +1 -0
  72. package/dist/{chunk-46UGOVRW.js → chunk-7QFRK6PU.js} +3 -7
  73. package/dist/chunk-7QFRK6PU.js.map +1 -0
  74. package/dist/chunk-A4C4NJ5U.cjs +12 -0
  75. package/dist/chunk-A4C4NJ5U.cjs.map +1 -0
  76. package/dist/{chunk-7CCMCMJO.cjs → chunk-AOGOC6JF.cjs} +77 -68
  77. package/dist/chunk-AOGOC6JF.cjs.map +1 -0
  78. package/dist/{chunk-TYGGUWMS.cjs → chunk-B3MN7EJR.cjs} +177 -137
  79. package/dist/chunk-B3MN7EJR.cjs.map +1 -0
  80. package/dist/{chunk-K6VKTBST.cjs → chunk-BZ5MVITP.cjs} +4 -4
  81. package/dist/{chunk-K6VKTBST.cjs.map → chunk-BZ5MVITP.cjs.map} +1 -1
  82. package/dist/{chunk-ZAQUKCUC.js → chunk-CBOD7TXH.js} +5 -5
  83. package/dist/{chunk-ZAQUKCUC.js.map → chunk-CBOD7TXH.js.map} +1 -1
  84. package/dist/{chunk-LLVOQOWE.cjs → chunk-CRZ56SZU.cjs} +6 -5
  85. package/dist/chunk-CRZ56SZU.cjs.map +1 -0
  86. package/dist/{chunk-ON47CBE4.cjs → chunk-D3GWARN7.cjs} +47 -47
  87. package/dist/{chunk-ON47CBE4.cjs.map → chunk-D3GWARN7.cjs.map} +1 -1
  88. package/dist/{chunk-W5SOCUBL.js → chunk-D3OUDFU7.js} +5 -5
  89. package/dist/{chunk-W5SOCUBL.js.map → chunk-D3OUDFU7.js.map} +1 -1
  90. package/dist/chunk-EKG2UXNX.cjs +23 -0
  91. package/dist/chunk-EKG2UXNX.cjs.map +1 -0
  92. package/dist/{chunk-2Q45FAIE.js → chunk-EVYW3532.js} +28 -19
  93. package/dist/chunk-EVYW3532.js.map +1 -0
  94. package/dist/{chunk-7PRMDZIA.cjs → chunk-FMMW3KX7.cjs} +21 -55
  95. package/dist/chunk-FMMW3KX7.cjs.map +1 -0
  96. package/dist/chunk-H2VWDQWC.cjs +571 -0
  97. package/dist/chunk-H2VWDQWC.cjs.map +1 -0
  98. package/dist/chunk-H4FY6OZK.js +13 -0
  99. package/dist/chunk-H4FY6OZK.js.map +1 -0
  100. package/dist/{chunk-OJHD3LXJ.cjs → chunk-H5IJSROF.cjs} +2 -8
  101. package/dist/chunk-H5IJSROF.cjs.map +1 -0
  102. package/dist/{chunk-U5EL6JUV.js → chunk-I5IOSA27.js} +101 -103
  103. package/dist/chunk-I5IOSA27.js.map +1 -0
  104. package/dist/{chunk-SHC7BCG5.cjs → chunk-I7YAY2VQ.cjs} +7 -7
  105. package/dist/{chunk-SHC7BCG5.cjs.map → chunk-I7YAY2VQ.cjs.map} +1 -1
  106. package/dist/chunk-IRCWIA3R.js +20 -0
  107. package/dist/chunk-IRCWIA3R.js.map +1 -0
  108. package/dist/chunk-IVQBLXBK.cjs +55 -0
  109. package/dist/chunk-IVQBLXBK.cjs.map +1 -0
  110. package/dist/{chunk-5PP4KRPV.js → chunk-IZD4HTCP.js} +5 -5
  111. package/dist/{chunk-5PP4KRPV.js.map → chunk-IZD4HTCP.js.map} +1 -1
  112. package/dist/{chunk-RDP6ZRSM.cjs → chunk-JQKMEKKW.cjs} +261 -204
  113. package/dist/chunk-JQKMEKKW.cjs.map +1 -0
  114. package/dist/chunk-JVA3KDEA.cjs +691 -0
  115. package/dist/chunk-JVA3KDEA.cjs.map +1 -0
  116. package/dist/{chunk-JG5XIJDY.js → chunk-K67P5DLL.js} +62 -22
  117. package/dist/chunk-K67P5DLL.js.map +1 -0
  118. package/dist/{chunk-MX7EKQPM.js → chunk-K6OZIHKI.js} +345 -97
  119. package/dist/chunk-K6OZIHKI.js.map +1 -0
  120. package/dist/{chunk-CS6JTQQ2.cjs → chunk-KACEYDYV.cjs} +94 -62
  121. package/dist/chunk-KACEYDYV.cjs.map +1 -0
  122. package/dist/{chunk-5OWHU7Z7.cjs → chunk-L6EVYIID.cjs} +248 -210
  123. package/dist/chunk-L6EVYIID.cjs.map +1 -0
  124. package/dist/{chunk-7OWE7WD6.js → chunk-LI4K2KEJ.js} +4 -4
  125. package/dist/{chunk-7OWE7WD6.js.map → chunk-LI4K2KEJ.js.map} +1 -1
  126. package/dist/chunk-LKZDQ2B4.js +1581 -0
  127. package/dist/chunk-LKZDQ2B4.js.map +1 -0
  128. package/dist/{chunk-45YZXI6X.cjs → chunk-LLFPQOBA.cjs} +27 -27
  129. package/dist/{chunk-45YZXI6X.cjs.map → chunk-LLFPQOBA.cjs.map} +1 -1
  130. package/dist/{chunk-ZRJTM7MT.js → chunk-LZMQ3SFK.js} +3 -3
  131. package/dist/{chunk-ZRJTM7MT.js.map → chunk-LZMQ3SFK.js.map} +1 -1
  132. package/dist/{chunk-DI6VC62F.js → chunk-M3VTS3F6.js} +3 -3
  133. package/dist/{chunk-DI6VC62F.js.map → chunk-M3VTS3F6.js.map} +1 -1
  134. package/dist/{chunk-MZ34E2GN.js → chunk-NBOS7BY3.js} +60 -21
  135. package/dist/chunk-NBOS7BY3.js.map +1 -0
  136. package/dist/{chunk-YA36ABIL.js → chunk-NGQDGL5X.js} +14 -48
  137. package/dist/chunk-NGQDGL5X.js.map +1 -0
  138. package/dist/{chunk-ZBFZGLZE.cjs → chunk-NLX5OWK7.cjs} +6 -2
  139. package/dist/chunk-NLX5OWK7.cjs.map +1 -0
  140. package/dist/chunk-NUQ2YFFH.cjs +1637 -0
  141. package/dist/chunk-NUQ2YFFH.cjs.map +1 -0
  142. package/dist/{chunk-TTCOPKUL.cjs → chunk-OGL4X4PH.cjs} +182 -184
  143. package/dist/chunk-OGL4X4PH.cjs.map +1 -0
  144. package/dist/{chunk-HY5BNOUN.cjs → chunk-OTNTGEXR.cjs} +4 -4
  145. package/dist/{chunk-HY5BNOUN.cjs.map → chunk-OTNTGEXR.cjs.map} +1 -1
  146. package/dist/chunk-OTWE63BW.js +53 -0
  147. package/dist/chunk-OTWE63BW.js.map +1 -0
  148. package/dist/chunk-PC5NGH5A.js +549 -0
  149. package/dist/chunk-PC5NGH5A.js.map +1 -0
  150. package/dist/{chunk-IPRP6TDL.cjs → chunk-PS3TUWJM.cjs} +7 -7
  151. package/dist/{chunk-IPRP6TDL.cjs.map → chunk-PS3TUWJM.cjs.map} +1 -1
  152. package/dist/{chunk-V76FGHY3.js → chunk-PVFFH7TL.js} +5 -5
  153. package/dist/{chunk-V76FGHY3.js.map → chunk-PVFFH7TL.js.map} +1 -1
  154. package/dist/chunk-QCD5JKU4.cjs +15 -0
  155. package/dist/chunk-QCD5JKU4.cjs.map +1 -0
  156. package/dist/{chunk-IRPYOHRC.js → chunk-QG5VEOKX.js} +6 -2
  157. package/dist/chunk-QG5VEOKX.js.map +1 -0
  158. package/dist/{chunk-2CYI5HRH.js → chunk-RI7RJH4G.js} +49 -17
  159. package/dist/chunk-RI7RJH4G.js.map +1 -0
  160. package/dist/{chunk-5LKOVCPP.js → chunk-RVUL2HXY.js} +6 -5
  161. package/dist/chunk-RVUL2HXY.js.map +1 -0
  162. package/dist/{chunk-WK23PGTP.cjs → chunk-S5GU4LUN.cjs} +11 -11
  163. package/dist/{chunk-WK23PGTP.cjs.map → chunk-S5GU4LUN.cjs.map} +1 -1
  164. package/dist/{chunk-S33YQEL7.js → chunk-SDPWO2Z5.js} +6 -6
  165. package/dist/{chunk-S33YQEL7.js.map → chunk-SDPWO2Z5.js.map} +1 -1
  166. package/dist/{chunk-6S3PTHL4.js → chunk-SLGGT2XD.js} +3 -3
  167. package/dist/{chunk-6S3PTHL4.js.map → chunk-SLGGT2XD.js.map} +1 -1
  168. package/dist/{chunk-HSEZ7X6Y.cjs → chunk-TIJUA4I6.cjs} +45 -45
  169. package/dist/{chunk-HSEZ7X6Y.cjs.map → chunk-TIJUA4I6.cjs.map} +1 -1
  170. package/dist/{chunk-CSNOYIB4.cjs → chunk-TM54OBHX.cjs} +13 -13
  171. package/dist/{chunk-CSNOYIB4.cjs.map → chunk-TM54OBHX.cjs.map} +1 -1
  172. package/dist/{chunk-MM3JHVKZ.cjs → chunk-TUWSVL6I.cjs} +4 -4
  173. package/dist/{chunk-MM3JHVKZ.cjs.map → chunk-TUWSVL6I.cjs.map} +1 -1
  174. package/dist/{chunk-2GIV5X4P.js → chunk-TYEYRCXL.js} +86 -33
  175. package/dist/chunk-TYEYRCXL.js.map +1 -0
  176. package/dist/{chunk-MJPZNEJZ.js → chunk-UKOVGCRN.js} +2095 -496
  177. package/dist/chunk-UKOVGCRN.js.map +1 -0
  178. package/dist/chunk-UYKDYE5D.cjs +12 -0
  179. package/dist/{chunk-KWNWG4RC.cjs.map → chunk-UYKDYE5D.cjs.map} +1 -1
  180. package/dist/{chunk-FX5ZW6PN.js → chunk-VAAC7L57.js} +95 -40
  181. package/dist/chunk-VAAC7L57.js.map +1 -0
  182. package/dist/{chunk-ISKCIQF2.cjs → chunk-VKHXYVN7.cjs} +14 -25
  183. package/dist/chunk-VKHXYVN7.cjs.map +1 -0
  184. package/dist/chunk-VUQZNUHU.js +171 -0
  185. package/dist/chunk-VUQZNUHU.js.map +1 -0
  186. package/dist/{chunk-K2XYLVVB.cjs → chunk-WDM5WQK4.cjs} +175 -136
  187. package/dist/chunk-WDM5WQK4.cjs.map +1 -0
  188. package/dist/{chunk-GVYVGGPJ.js → chunk-WFSYYU4W.js} +66 -28
  189. package/dist/chunk-WFSYYU4W.js.map +1 -0
  190. package/dist/{chunk-R7MRFE5P.js → chunk-WS5MT2UJ.js} +3 -3
  191. package/dist/{chunk-R7MRFE5P.js.map → chunk-WS5MT2UJ.js.map} +1 -1
  192. package/dist/chunk-XORONCV3.js +202 -0
  193. package/dist/chunk-XORONCV3.js.map +1 -0
  194. package/dist/chunk-ZGVTNKTX.cjs +217 -0
  195. package/dist/chunk-ZGVTNKTX.cjs.map +1 -0
  196. package/dist/core/index.cjs +20 -20
  197. package/dist/core/index.d.cts +4 -4
  198. package/dist/core/index.d.ts +4 -4
  199. package/dist/core/index.js +4 -4
  200. package/dist/{ddl-B49O7dB_.d.ts → ddl-BvcbgzHo.d.ts} +3 -3
  201. package/dist/{ddl-DcZG660s.d.cts → ddl-Ufebz5q5.d.cts} +3 -3
  202. package/dist/graph-extension/index.d.cts +2 -4
  203. package/dist/graph-extension/index.d.ts +2 -4
  204. package/dist/graph-merge/index.cjs +140 -125
  205. package/dist/graph-merge/index.cjs.map +1 -1
  206. package/dist/graph-merge/index.d.cts +8 -9
  207. package/dist/graph-merge/index.d.ts +8 -9
  208. package/dist/graph-merge/index.js +42 -27
  209. package/dist/graph-merge/index.js.map +1 -1
  210. package/dist/index.cjs +144 -143
  211. package/dist/index.cjs.map +1 -1
  212. package/dist/index.d.cts +11 -12
  213. package/dist/index.d.ts +11 -12
  214. package/dist/index.js +30 -29
  215. package/dist/index.js.map +1 -1
  216. package/dist/indexes/index.cjs +14 -12
  217. package/dist/indexes/index.d.cts +4 -4
  218. package/dist/indexes/index.d.ts +4 -4
  219. package/dist/indexes/index.js +7 -5
  220. package/dist/{ingestion-import-target-CI8OWIkM.d.ts → ingestion-import-target-CAs1OX-l.d.cts} +1 -1
  221. package/dist/{ingestion-import-target-DCpfM1PX.d.cts → ingestion-import-target-DCQSPfNx.d.ts} +1 -1
  222. package/dist/interchange/index.cjs +41 -39
  223. package/dist/interchange/index.cjs.map +1 -1
  224. package/dist/interchange/index.d.cts +8 -8
  225. package/dist/interchange/index.d.ts +8 -8
  226. package/dist/interchange/index.js +16 -14
  227. package/dist/interchange/index.js.map +1 -1
  228. package/dist/local-store-impl-JC7OBRAW.js +75 -0
  229. package/dist/local-store-impl-JC7OBRAW.js.map +1 -0
  230. package/dist/local-store-impl-UOS2LUIG.cjs +77 -0
  231. package/dist/local-store-impl-UOS2LUIG.cjs.map +1 -0
  232. package/dist/{manager-Cfg1ENj1.d.ts → manager-B68OrPR2.d.ts} +1 -2
  233. package/dist/{manager-D348fa6W.d.cts → manager-D_t7oK69.d.cts} +1 -2
  234. package/dist/pglite-store-impl-J5J5AA52.cjs +75 -0
  235. package/dist/pglite-store-impl-J5J5AA52.cjs.map +1 -0
  236. package/dist/pglite-store-impl-LDRH2DUH.js +73 -0
  237. package/dist/pglite-store-impl-LDRH2DUH.js.map +1 -0
  238. package/dist/{postgres-UStOycLI.d.ts → postgres-BPLSVyHM.d.ts} +1 -1
  239. package/dist/{postgres-CH1kkM5J.d.cts → postgres-CqvtFC2y.d.cts} +1 -1
  240. package/dist/profiler/index.d.cts +9 -9
  241. package/dist/profiler/index.d.ts +9 -9
  242. package/dist/provenance/index.cjs +33 -20
  243. package/dist/provenance/index.cjs.map +1 -1
  244. package/dist/provenance/index.d.cts +7 -7
  245. package/dist/provenance/index.d.ts +7 -7
  246. package/dist/provenance/index.js +24 -11
  247. package/dist/provenance/index.js.map +1 -1
  248. package/dist/{repair-validity-windows-aWX7VNvv.d.cts → repair-validity-windows-DEzCKAdy.d.cts} +7 -3
  249. package/dist/{repair-validity-windows-BtOEe2pS.d.ts → repair-validity-windows-GMdaS2AH.d.ts} +7 -3
  250. package/dist/resolve-D_H8MHtq.d.ts +1805 -0
  251. package/dist/resolve-WEW8gWws.d.cts +1805 -0
  252. package/dist/schema/index.cjs +42 -40
  253. package/dist/schema/index.d.cts +4 -6
  254. package/dist/schema/index.d.ts +4 -6
  255. package/dist/schema/index.js +15 -13
  256. package/dist/{searchable-z4BiFfHI.d.ts → searchable-C_UREI9K.d.ts} +1 -1
  257. package/dist/{searchable-C8-RrL3l.d.cts → searchable-ClgET_i7.d.cts} +1 -1
  258. package/dist/{sqlite-axLw5Lo5.d.ts → sqlite-D1mXO9Kp.d.cts} +2 -1
  259. package/dist/{sqlite-Cyx9j9o6.d.cts → sqlite-MZA3oZNB.d.ts} +2 -1
  260. package/dist/{store-CTfQ9taw.d.ts → store-CuFX7fCx.d.cts} +38 -41
  261. package/dist/{store-DR9J7JVB.d.cts → store-D-ZjXQpW.d.ts} +38 -41
  262. package/dist/{temporal-CBOrERz5.d.ts → temporal-CpyEiRY8.d.cts} +1 -1
  263. package/dist/{temporal-B4Ky4wzh.d.cts → temporal-y0Aep9Su.d.ts} +1 -1
  264. package/dist/{types-CWg4dTjj.d.ts → types-6yf0Vv-_.d.cts} +1672 -1
  265. package/dist/{types-CWg4dTjj.d.cts → types-6yf0Vv-_.d.ts} +1672 -1
  266. package/dist/{types-BScHXVM7.d.ts → types-DzJ4dlzk.d.cts} +1 -1
  267. package/dist/{types-BE921wRl.d.cts → types-_vVSB9k-.d.ts} +1 -1
  268. package/dist/{where-BWXUPV3C.d.ts → where-DuG2LCLe.d.ts} +1 -1
  269. package/dist/{where-CNtx1aLc.d.cts → where-Mhf_yyKX.d.cts} +1 -1
  270. package/package.json +5 -1
  271. package/dist/chunk-2CYI5HRH.js.map +0 -1
  272. package/dist/chunk-2GIV5X4P.js.map +0 -1
  273. package/dist/chunk-2Q45FAIE.js.map +0 -1
  274. package/dist/chunk-46UGOVRW.js.map +0 -1
  275. package/dist/chunk-5LKOVCPP.js.map +0 -1
  276. package/dist/chunk-5OWHU7Z7.cjs.map +0 -1
  277. package/dist/chunk-6LEOAIIB.js +0 -1160
  278. package/dist/chunk-6LEOAIIB.js.map +0 -1
  279. package/dist/chunk-7CCMCMJO.cjs.map +0 -1
  280. package/dist/chunk-7PRMDZIA.cjs.map +0 -1
  281. package/dist/chunk-C76WFIVZ.cjs.map +0 -1
  282. package/dist/chunk-CS6JTQQ2.cjs.map +0 -1
  283. package/dist/chunk-EDLKIQRI.js.map +0 -1
  284. package/dist/chunk-EH3JZJUM.cjs +0 -567
  285. package/dist/chunk-EH3JZJUM.cjs.map +0 -1
  286. package/dist/chunk-FX5ZW6PN.js.map +0 -1
  287. package/dist/chunk-GHZPZNFC.cjs +0 -132
  288. package/dist/chunk-GHZPZNFC.cjs.map +0 -1
  289. package/dist/chunk-GVYVGGPJ.js.map +0 -1
  290. package/dist/chunk-IHK5KA2Q.cjs +0 -262
  291. package/dist/chunk-IHK5KA2Q.cjs.map +0 -1
  292. package/dist/chunk-IRPYOHRC.js.map +0 -1
  293. package/dist/chunk-ISKCIQF2.cjs.map +0 -1
  294. package/dist/chunk-JG5XIJDY.js.map +0 -1
  295. package/dist/chunk-K2XYLVVB.cjs.map +0 -1
  296. package/dist/chunk-KWNWG4RC.cjs +0 -12
  297. package/dist/chunk-LLVOQOWE.cjs.map +0 -1
  298. package/dist/chunk-MJPZNEJZ.js.map +0 -1
  299. package/dist/chunk-MX7EKQPM.js.map +0 -1
  300. package/dist/chunk-MZ34E2GN.js.map +0 -1
  301. package/dist/chunk-OJHD3LXJ.cjs.map +0 -1
  302. package/dist/chunk-PALYTHGM.js +0 -114
  303. package/dist/chunk-PALYTHGM.js.map +0 -1
  304. package/dist/chunk-RDP6ZRSM.cjs.map +0 -1
  305. package/dist/chunk-S3SDEQMC.js +0 -532
  306. package/dist/chunk-S3SDEQMC.js.map +0 -1
  307. package/dist/chunk-TEC24ZDA.cjs +0 -1254
  308. package/dist/chunk-TEC24ZDA.cjs.map +0 -1
  309. package/dist/chunk-TP4NJTI3.cjs +0 -1192
  310. package/dist/chunk-TP4NJTI3.cjs.map +0 -1
  311. package/dist/chunk-TTCOPKUL.cjs.map +0 -1
  312. package/dist/chunk-TUVD4DFR.cjs.map +0 -1
  313. package/dist/chunk-TYGGUWMS.cjs.map +0 -1
  314. package/dist/chunk-U3Z7XKAG.js.map +0 -1
  315. package/dist/chunk-U5EL6JUV.js.map +0 -1
  316. package/dist/chunk-VTJVMP4I.js.map +0 -1
  317. package/dist/chunk-WCLMKNQE.cjs.map +0 -1
  318. package/dist/chunk-XMY2SXOH.cjs.map +0 -1
  319. package/dist/chunk-Y55DLLEG.js +0 -247
  320. package/dist/chunk-Y55DLLEG.js.map +0 -1
  321. package/dist/chunk-YA36ABIL.js.map +0 -1
  322. package/dist/chunk-ZBFZGLZE.cjs.map +0 -1
  323. package/dist/index-B0PrmE3K.d.cts +0 -1146
  324. package/dist/index-CwcXsL5R.d.ts +0 -1146
  325. package/dist/materialize-indexes-C9GG3O3C.d.ts +0 -266
  326. package/dist/materialize-indexes-CrSiW_lT.d.cts +0 -266
@@ -0,0 +1,1581 @@
1
+ import { MAX_PG_IDENTIFIER_LENGTH } from './chunk-2EBMPJBO.js';
2
+ import { typeGraphGlobalSymbol, sql, isSqlFragment } from './chunk-7QFRK6PU.js';
3
+ import { ConfigurationError } from './chunk-YDEJQWOL.js';
4
+ import { createDataKeyedBag } from './chunk-DYATYRY4.js';
5
+
6
+ // src/backend/types.ts
7
+ function normalizeGraphAnalyticsCapabilities(capabilities) {
8
+ if (capabilities.graphAnalytics?.supported !== true || capabilities.transactions && capabilities.windowFunctions && capabilities.returning !== false) {
9
+ return capabilities;
10
+ }
11
+ return {
12
+ ...capabilities,
13
+ graphAnalytics: { ...capabilities.graphAnalytics, supported: false }
14
+ };
15
+ }
16
+ function rowPropsToObject(props) {
17
+ return typeof props === "string" ? JSON.parse(props) : props;
18
+ }
19
+ function rowPropsToJsonText(props) {
20
+ return typeof props === "string" ? props : JSON.stringify(props);
21
+ }
22
+ function isLiveNodeRow(row) {
23
+ return row.deleted_at === void 0;
24
+ }
25
+ function isTombstonedNodeRow(row) {
26
+ return row.deleted_at !== void 0;
27
+ }
28
+ var INTERNAL_TEMPORARY_WRITES = typeGraphGlobalSymbol(
29
+ "internal-temporary-writes-v1"
30
+ );
31
+ var DATABASE_EXTENSION_NAMES = ["pg_trgm", "vector"];
32
+ function createTransactionReadBackend(backend) {
33
+ const getNodes = backend.getNodes;
34
+ const getEdges = backend.getEdges;
35
+ const compileSql = backend.compileSql;
36
+ return Object.freeze({
37
+ dialect: backend.dialect,
38
+ capabilities: backend.capabilities,
39
+ ...backend.tableNames === void 0 ? {} : { tableNames: backend.tableNames },
40
+ ...backend.fulltextStrategy === void 0 ? {} : { fulltextStrategy: backend.fulltextStrategy },
41
+ ...backend.vectorStrategy === void 0 ? {} : { vectorStrategy: backend.vectorStrategy },
42
+ getNode: (graphId, kind, id) => backend.getNode(graphId, kind, id),
43
+ ...getNodes === void 0 ? {} : {
44
+ getNodes: (graphId, kind, ids) => getNodes(graphId, kind, ids)
45
+ },
46
+ getEdge: (graphId, id) => backend.getEdge(graphId, id),
47
+ ...getEdges === void 0 ? {} : {
48
+ getEdges: (graphId, ids) => getEdges(graphId, ids)
49
+ },
50
+ countEdgesFrom: (params) => backend.countEdgesFrom(params),
51
+ edgeExistsBetween: (params) => backend.edgeExistsBetween(params),
52
+ findEdgesConnectedTo: (params) => backend.findEdgesConnectedTo(params),
53
+ findNodesByKind: (params) => backend.findNodesByKind(params),
54
+ countNodesByKind: (params) => backend.countNodesByKind(params),
55
+ findEdgesByKind: (params) => backend.findEdgesByKind(params),
56
+ countEdgesByKind: (params) => backend.countEdgesByKind(params),
57
+ getActiveSchema: (graphId) => backend.getActiveSchema(graphId),
58
+ getSchemaVersion: (graphId, version) => backend.getSchemaVersion(graphId, version),
59
+ execute: (query) => backend.execute(query),
60
+ ...compileSql === void 0 ? {} : { compileSql: (query) => compileSql(query) }
61
+ });
62
+ }
63
+ async function closeAfterFailure(resource, provisioningError) {
64
+ try {
65
+ await resource.close();
66
+ } catch {
67
+ }
68
+ throw provisioningError;
69
+ }
70
+ async function runOptionallyInTransaction(backend, fn, options) {
71
+ if ("transaction" in backend && backend.capabilities.transactions) {
72
+ return backend.transaction(
73
+ (tx) => fn(tx, { atomic: true }),
74
+ options?.transaction
75
+ );
76
+ }
77
+ return fn(options?.fallback ?? backend, { atomic: false });
78
+ }
79
+ var SQLITE_MAX_BIND_PARAMETERS = 999;
80
+ var MODERN_SQLITE_MAX_BIND_PARAMETERS = 32766;
81
+ var D1_MAX_BIND_PARAMETERS = 100;
82
+ var DURABLE_OBJECT_MAX_BIND_PARAMETERS = 100;
83
+ var POSTGRES_MAX_BIND_PARAMETERS = 65533;
84
+ var SQLITE_CAPABILITIES = Object.freeze({
85
+ transactions: true,
86
+ // SQLite supports transactions
87
+ windowFunctions: true,
88
+ // SQLite has supported window functions since 3.25.0
89
+ clearValidTo: true,
90
+ returning: true,
91
+ // SQLite has supported RETURNING since 3.35.0
92
+ // The bundled schema ships both claim relations and the shared operation
93
+ // backend implements every claim member.
94
+ constraintClaims: true,
95
+ maxBindParameters: SQLITE_MAX_BIND_PARAMETERS,
96
+ // Generic SQLite builds do not guarantee ENABLE_MATH_FUNCTIONS. The local
97
+ // better-sqlite3 factory overrides this flag for its bundled build contract.
98
+ graphAnalytics: Object.freeze({ supported: true, mathFunctions: false }),
99
+ recursiveTraversal: Object.freeze({ supported: true }),
100
+ pessimisticLocks: Object.freeze({
101
+ advisoryLocks: false,
102
+ tableLocks: false,
103
+ serializedWriters: true
104
+ })
105
+ });
106
+ var POSTGRES_CAPABILITIES = Object.freeze({
107
+ transactions: true,
108
+ // PostgreSQL supports transactions
109
+ windowFunctions: true,
110
+ // PostgreSQL supports ROW_NUMBER() and related windows
111
+ clearValidTo: true,
112
+ returning: true,
113
+ // PostgreSQL has supported RETURNING since 8.2
114
+ // The bundled schema ships both claim relations and the shared operation
115
+ // backend implements every claim member.
116
+ constraintClaims: true,
117
+ maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS,
118
+ graphAnalytics: Object.freeze({ supported: true, mathFunctions: true }),
119
+ recursiveTraversal: Object.freeze({ supported: true }),
120
+ pessimisticLocks: Object.freeze({
121
+ advisoryLocks: true,
122
+ tableLocks: true,
123
+ serializedWriters: false
124
+ })
125
+ });
126
+
127
+ // src/query/compiler/schema.ts
128
+ var SQL_SCHEMA_BRAND = typeGraphGlobalSymbol("sql-schema-v1");
129
+ var SqlSchema = class {
130
+ };
131
+ var SqlSchemaDescriptor = class extends SqlSchema {
132
+ tables;
133
+ nodesTable;
134
+ edgesTable;
135
+ recordedNodesTable;
136
+ recordedEdgesTable;
137
+ recordedClockTable;
138
+ revisionOriginsTable;
139
+ identityAssertionsTable;
140
+ recordedIdentityAssertionsTable;
141
+ identityClosureTable;
142
+ identitySeparationTable;
143
+ fulltextTable;
144
+ constructor(fields) {
145
+ super();
146
+ Object.defineProperty(this, SQL_SCHEMA_BRAND, {
147
+ configurable: false,
148
+ enumerable: false,
149
+ value: true,
150
+ writable: false
151
+ });
152
+ this.tables = fields.tables;
153
+ this.nodesTable = fields.nodesTable;
154
+ this.edgesTable = fields.edgesTable;
155
+ this.recordedNodesTable = fields.recordedNodesTable;
156
+ this.recordedEdgesTable = fields.recordedEdgesTable;
157
+ this.recordedClockTable = fields.recordedClockTable;
158
+ this.revisionOriginsTable = fields.revisionOriginsTable;
159
+ this.identityAssertionsTable = fields.identityAssertionsTable;
160
+ this.recordedIdentityAssertionsTable = fields.recordedIdentityAssertionsTable;
161
+ this.identityClosureTable = fields.identityClosureTable;
162
+ this.identitySeparationTable = fields.identitySeparationTable;
163
+ this.fulltextTable = fields.fulltextTable;
164
+ Object.freeze(this);
165
+ }
166
+ };
167
+ var DEFAULT_TABLE_NAMES = {
168
+ nodes: "typegraph_nodes",
169
+ edges: "typegraph_edges",
170
+ recordedNodes: "typegraph_recorded_nodes",
171
+ recordedEdges: "typegraph_recorded_edges",
172
+ recordedClock: "typegraph_recorded_clock",
173
+ revisionOrigins: "typegraph_revision_origins",
174
+ identityAssertions: "typegraph_identity_assertions",
175
+ recordedIdentityAssertions: "typegraph_recorded_identity_assertions",
176
+ identityClosure: "typegraph_identity_closure",
177
+ identitySeparation: "typegraph_identity_separation",
178
+ fulltext: "typegraph_node_fulltext",
179
+ uniques: "typegraph_node_uniques",
180
+ edgeClaims: "typegraph_edge_claims"
181
+ };
182
+ function resolveTableNames(names) {
183
+ return {
184
+ nodes: names.nodes ?? DEFAULT_TABLE_NAMES.nodes,
185
+ edges: names.edges ?? DEFAULT_TABLE_NAMES.edges,
186
+ recordedNodes: names.recordedNodes ?? DEFAULT_TABLE_NAMES.recordedNodes,
187
+ recordedEdges: names.recordedEdges ?? DEFAULT_TABLE_NAMES.recordedEdges,
188
+ recordedClock: names.recordedClock ?? DEFAULT_TABLE_NAMES.recordedClock,
189
+ revisionOrigins: names.revisionOrigins ?? DEFAULT_TABLE_NAMES.revisionOrigins,
190
+ identityAssertions: names.identityAssertions ?? DEFAULT_TABLE_NAMES.identityAssertions,
191
+ recordedIdentityAssertions: names.recordedIdentityAssertions ?? DEFAULT_TABLE_NAMES.recordedIdentityAssertions,
192
+ identityClosure: names.identityClosure ?? DEFAULT_TABLE_NAMES.identityClosure,
193
+ identitySeparation: names.identitySeparation ?? DEFAULT_TABLE_NAMES.identitySeparation,
194
+ fulltext: names.fulltext ?? DEFAULT_TABLE_NAMES.fulltext,
195
+ uniques: names.uniques ?? DEFAULT_TABLE_NAMES.uniques,
196
+ edgeClaims: names.edgeClaims ?? DEFAULT_TABLE_NAMES.edgeClaims
197
+ };
198
+ }
199
+ var VALID_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/i;
200
+ function validateTableName(name, label) {
201
+ if (!name || name.length === 0) {
202
+ throw new ConfigurationError(`${label} table name cannot be empty`);
203
+ }
204
+ if (name.length > MAX_PG_IDENTIFIER_LENGTH) {
205
+ throw new ConfigurationError(
206
+ `${label} table name exceeds maximum length of ${MAX_PG_IDENTIFIER_LENGTH} characters`
207
+ );
208
+ }
209
+ if (!VALID_IDENTIFIER_PATTERN.test(name)) {
210
+ throw new ConfigurationError(
211
+ `${label} table name "${name}" is not a valid SQL identifier. Table names must start with a letter or underscore and contain only letters, digits, underscores, or dollar signs.`
212
+ );
213
+ }
214
+ }
215
+ function freezeSqlSchema(fields) {
216
+ return new SqlSchemaDescriptor(fields);
217
+ }
218
+ function isSqlSchema(schema) {
219
+ if (typeof schema !== "object" || schema === null) return false;
220
+ const candidate = schema;
221
+ return candidate[SQL_SCHEMA_BRAND] === true && typeof candidate["tables"] === "object" && candidate["tables"] !== null && Object.isFrozen(candidate["tables"]) && isSqlFragment(candidate["nodesTable"]) && isSqlFragment(candidate["edgesTable"]) && isSqlFragment(candidate["recordedNodesTable"]) && isSqlFragment(candidate["recordedEdgesTable"]) && isSqlFragment(candidate["recordedClockTable"]) && isSqlFragment(candidate["revisionOriginsTable"]) && isSqlFragment(candidate["fulltextTable"]) && Object.isFrozen(candidate);
222
+ }
223
+ function requireSqlSchema(schema, surface = "SqlSchema") {
224
+ if (isSqlSchema(schema)) return schema;
225
+ throw new ConfigurationError(
226
+ `${surface} must be created with createSqlSchema(...).`,
227
+ { code: "INVALID_SQL_SCHEMA", surface },
228
+ {
229
+ suggestion: "Pass the result of createSqlSchema(...) instead of a plain schema-shaped object."
230
+ }
231
+ );
232
+ }
233
+ function createSqlSchema(names = {}) {
234
+ const tables = resolveTableNames(names);
235
+ validateTableName(tables.nodes, "nodes");
236
+ validateTableName(tables.edges, "edges");
237
+ validateTableName(tables.recordedNodes, "recordedNodes");
238
+ validateTableName(tables.recordedEdges, "recordedEdges");
239
+ validateTableName(tables.recordedClock, "recordedClock");
240
+ validateTableName(tables.revisionOrigins, "revisionOrigins");
241
+ validateTableName(tables.identityAssertions, "identityAssertions");
242
+ validateTableName(
243
+ tables.recordedIdentityAssertions,
244
+ "recordedIdentityAssertions"
245
+ );
246
+ validateTableName(tables.identityClosure, "identityClosure");
247
+ validateTableName(tables.identitySeparation, "identitySeparation");
248
+ validateTableName(tables.fulltext, "fulltext");
249
+ validateTableName(tables.uniques, "uniques");
250
+ validateTableName(tables.edgeClaims, "edgeClaims");
251
+ return freezeSqlSchema({
252
+ tables: Object.freeze(tables),
253
+ nodesTable: sql.identifier(tables.nodes),
254
+ edgesTable: sql.identifier(tables.edges),
255
+ recordedNodesTable: sql.identifier(tables.recordedNodes),
256
+ recordedEdgesTable: sql.identifier(tables.recordedEdges),
257
+ recordedClockTable: sql.identifier(tables.recordedClock),
258
+ revisionOriginsTable: sql.identifier(tables.revisionOrigins),
259
+ identityAssertionsTable: sql.identifier(tables.identityAssertions),
260
+ recordedIdentityAssertionsTable: sql.identifier(
261
+ tables.recordedIdentityAssertions
262
+ ),
263
+ identityClosureTable: sql.identifier(tables.identityClosure),
264
+ identitySeparationTable: sql.identifier(tables.identitySeparation),
265
+ fulltextTable: sql.identifier(tables.fulltext)
266
+ });
267
+ }
268
+ var EXTERNAL_RECORDED_READ_SOURCE = typeGraphGlobalSymbol(
269
+ "external-recorded-read-source-v1"
270
+ );
271
+ var TYPEGRAPH_RECORDED_READ_SOURCE = typeGraphGlobalSymbol(
272
+ "typegraph-recorded-read-source-v1"
273
+ );
274
+ function recordedRelation(options) {
275
+ const schema = requireSqlSchema(options.schema, "recordedRelation schema");
276
+ return Object.freeze({
277
+ source: "external",
278
+ schema,
279
+ [EXTERNAL_RECORDED_READ_SOURCE]: true
280
+ });
281
+ }
282
+ function requireExternalRecordedReadSource(source) {
283
+ if (source === void 0) return void 0;
284
+ if (isExternalRecordedReadSource(source)) return source;
285
+ throw new ConfigurationError(
286
+ "recordedRead must be created with recordedRelation({ schema }).",
287
+ { code: "INVALID_RECORDED_READ_SOURCE" },
288
+ {
289
+ suggestion: "Pass { recordedRead: recordedRelation({ schema }) } for an externally populated recorded relation. Use { history: true } when TypeGraph should capture writes."
290
+ }
291
+ );
292
+ }
293
+ function isExternalRecordedReadSource(source) {
294
+ if (typeof source !== "object" || source === null) return false;
295
+ const candidate = source;
296
+ return candidate.source === "external" && candidate[EXTERNAL_RECORDED_READ_SOURCE] === true && isSqlSchema(candidate.schema) && Object.isFrozen(candidate);
297
+ }
298
+ function createRecordedReadBinding(schema) {
299
+ const readSchema = requireSqlSchema(schema, "recorded read binding schema");
300
+ return Object.freeze({
301
+ source: "typegraph-capture",
302
+ schema: readSchema,
303
+ [TYPEGRAPH_RECORDED_READ_SOURCE]: true
304
+ });
305
+ }
306
+ function requireRecordedReadBinding(binding, surface) {
307
+ if (isRecordedReadBinding(binding)) return binding;
308
+ if (binding !== void 0) {
309
+ throw new ConfigurationError(
310
+ "Recorded-time reads require a recorded read relation created by TypeGraph.",
311
+ { code: "INVALID_RECORDED_READ_BINDING", surface },
312
+ {
313
+ suggestion: "Use createStore(graph, backend, { history: true }) or { recordedRead: recordedRelation({ schema }) } instead of passing a plain object."
314
+ }
315
+ );
316
+ }
317
+ throw new ConfigurationError(
318
+ "Recorded-time reads require a recorded read relation.",
319
+ { code: "RECORDED_READ_REQUIRES_BINDING", surface },
320
+ {
321
+ suggestion: "Create the store with createStore(graph, backend, { history: true }) to bind TypeGraph's built-in captured relation, or pass { recordedRead: recordedRelation({ schema }) } for an externally populated recorded relation."
322
+ }
323
+ );
324
+ }
325
+ function isTypeGraphRecordedReadSource(source) {
326
+ if (typeof source !== "object" || source === null) return false;
327
+ const candidate = source;
328
+ return candidate.source === "typegraph-capture" && candidate[TYPEGRAPH_RECORDED_READ_SOURCE] === true && isSqlSchema(candidate.schema) && Object.isFrozen(candidate);
329
+ }
330
+ function isRecordedReadBinding(binding) {
331
+ return isExternalRecordedReadSource(binding) || isTypeGraphRecordedReadSource(binding);
332
+ }
333
+ function recordedReadSqlSchema(binding) {
334
+ const { schema } = requireRecordedReadBinding(
335
+ binding,
336
+ "recorded-read-schema"
337
+ );
338
+ return freezeSqlSchema({
339
+ tables: schema.tables,
340
+ nodesTable: schema.recordedNodesTable,
341
+ edgesTable: schema.recordedEdgesTable,
342
+ recordedNodesTable: schema.recordedNodesTable,
343
+ recordedEdgesTable: schema.recordedEdgesTable,
344
+ recordedClockTable: schema.recordedClockTable,
345
+ revisionOriginsTable: schema.revisionOriginsTable,
346
+ identityAssertionsTable: schema.identityAssertionsTable,
347
+ recordedIdentityAssertionsTable: schema.recordedIdentityAssertionsTable,
348
+ identityClosureTable: schema.identityClosureTable,
349
+ identitySeparationTable: schema.identitySeparationTable,
350
+ fulltextTable: schema.fulltextTable
351
+ });
352
+ }
353
+ function recordedReadSchemaFor(schema, recordedAsOf, binding, surface) {
354
+ const baseSchema = requireSqlSchema(schema, `${surface} schema`);
355
+ if (recordedAsOf === void 0) return baseSchema;
356
+ return recordedReadSqlSchema(requireRecordedReadBinding(binding, surface));
357
+ }
358
+ var DEFAULT_SQL_SCHEMA = createSqlSchema();
359
+ function vectorSlotKey(nodeKind, fieldPath) {
360
+ return `${nodeKind}\0${fieldPath}`;
361
+ }
362
+ var ALIAS_CTE_PREFIX = "cte_";
363
+ var EMBEDDINGS_CTE_ALIAS = "cte_embeddings";
364
+ var FULLTEXT_CTE_ALIAS = "cte_fulltext";
365
+ var HYBRID_CANDIDATES_CTE_ALIAS = "cte_relevance_candidates";
366
+
367
+ // src/backend/capabilities/bundle-registry.ts
368
+ var CLAIMS = {
369
+ id: "claims",
370
+ kind: "gated",
371
+ core: [
372
+ "claimEdgeCardinality",
373
+ "claimEdgeCardinalityBatch",
374
+ "purgeEdgeClaims",
375
+ "hardDeleteUniquesByConcreteKind"
376
+ ],
377
+ declaration: "constraintClaims",
378
+ crossCheck: "bidirectional",
379
+ portSurfaceCode: "CONSTRAINT_CLAIM_SURFACE_MISMATCH",
380
+ disposition: {
381
+ kind: "fallback",
382
+ fallback: "unclaimed writes; the caller's own supported:false branch"
383
+ },
384
+ operations: [
385
+ {
386
+ operation: "edge claim write",
387
+ disposition: {
388
+ kind: "fallback",
389
+ fallback: "unclaimed writes; the caller's own supported:false branch"
390
+ },
391
+ sites: [
392
+ { file: "store/claims/backing.ts", member: "claimEdgeCardinality" },
393
+ {
394
+ file: "store/claims/backing.ts",
395
+ member: "claimEdgeCardinalityBatch"
396
+ },
397
+ { file: "store/claims/backing.ts", member: "purgeEdgeClaims" },
398
+ {
399
+ file: "store/claims/backing.ts",
400
+ member: "hardDeleteUniquesByConcreteKind"
401
+ }
402
+ ]
403
+ }
404
+ ]
405
+ };
406
+ var UNIQUE_SIDECAR_BATCH = {
407
+ id: "uniqueSidecarBatch",
408
+ kind: "graduated",
409
+ crossCheck: "none",
410
+ portSurfaceCode: "BUNDLE_PORT_SURFACE_MISMATCH",
411
+ extras: [
412
+ {
413
+ id: "insertUniqueBatch",
414
+ members: ["insertUniqueBatch"],
415
+ disposition: { kind: "fallback", fallback: "issueClaimsIndividually" }
416
+ },
417
+ {
418
+ id: "checkUniqueBatch",
419
+ members: ["checkUniqueBatch"],
420
+ disposition: {
421
+ kind: "fallback",
422
+ fallback: "per-key checkUnique loop"
423
+ }
424
+ },
425
+ {
426
+ id: "hardDeleteUniquesByNodeIds",
427
+ members: ["hardDeleteUniquesByNodeIds"],
428
+ disposition: {
429
+ kind: "refuse",
430
+ // Registry-assigned: the real throw is `requireDefined`'s generic
431
+ // `TypeError`, which carries no domain code of its own.
432
+ code: "UNIQUE_REAP_BY_NODE_IDS_UNSUPPORTED"
433
+ }
434
+ }
435
+ ],
436
+ operations: [
437
+ {
438
+ operation: "unique batch probe",
439
+ disposition: { kind: "fallback", fallback: "per-key checkUnique loop" },
440
+ requires: ["checkUniqueBatch"],
441
+ sites: [
442
+ {
443
+ file: "store/operations/node-operations.ts",
444
+ member: "checkUniqueBatch",
445
+ lines: [1275, 1320]
446
+ },
447
+ {
448
+ file: "store/operations/node-operations.ts",
449
+ member: "checkUniqueBatch",
450
+ lines: [1575, 1593]
451
+ }
452
+ ]
453
+ },
454
+ {
455
+ operation: "unique claim issue",
456
+ disposition: { kind: "fallback", fallback: "issueClaimsIndividually" },
457
+ requires: ["insertUniqueBatch"],
458
+ sites: [
459
+ { file: "store/claims/node-claims.ts", member: "insertUniqueBatch" }
460
+ ]
461
+ },
462
+ {
463
+ operation: "unique reap by node ids",
464
+ disposition: {
465
+ kind: "refuse",
466
+ code: "UNIQUE_REAP_BY_NODE_IDS_UNSUPPORTED"
467
+ },
468
+ requires: ["hardDeleteUniquesByNodeIds"],
469
+ sites: [
470
+ {
471
+ file: "store/claims/node-claims.ts",
472
+ member: "hardDeleteUniquesByNodeIds"
473
+ }
474
+ ]
475
+ },
476
+ {
477
+ operation: "set-based node update",
478
+ disposition: {
479
+ kind: "refuse",
480
+ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED"
481
+ },
482
+ requires: [
483
+ "hardDeleteUniquesByNodeIds",
484
+ "insertUniqueBatch",
485
+ "checkUniqueBatch"
486
+ ],
487
+ sites: [
488
+ {
489
+ file: "store/operations/node-write-pipeline.ts",
490
+ member: "hardDeleteUniquesByNodeIds"
491
+ },
492
+ {
493
+ file: "store/operations/node-write-pipeline.ts",
494
+ member: "insertUniqueBatch"
495
+ },
496
+ {
497
+ file: "store/operations/node-write-pipeline.ts",
498
+ member: "checkUniqueBatch"
499
+ },
500
+ {
501
+ file: "store/operations/node-operations.ts",
502
+ member: "hardDeleteUniquesByNodeIds"
503
+ },
504
+ {
505
+ file: "store/operations/node-operations.ts",
506
+ member: "insertUniqueBatch"
507
+ },
508
+ {
509
+ file: "store/operations/node-operations.ts",
510
+ member: "checkUniqueBatch",
511
+ lines: [1993]
512
+ }
513
+ ]
514
+ },
515
+ {
516
+ operation: "resolved node write",
517
+ disposition: {
518
+ kind: "refuse",
519
+ code: "RESOLVED_NODE_UNIQUENESS_UNSUPPORTED"
520
+ },
521
+ requires: [
522
+ "hardDeleteUniquesByNodeIds",
523
+ "insertUniqueBatch",
524
+ "checkUniqueBatch"
525
+ ],
526
+ sites: [
527
+ {
528
+ file: "store/claims/resolved-node-claims.ts",
529
+ member: "checkUniqueBatch",
530
+ lines: [211]
531
+ },
532
+ {
533
+ file: "store/claims/resolved-node-claims.ts",
534
+ member: "checkUniqueBatch",
535
+ lines: [292]
536
+ },
537
+ {
538
+ file: "store/claims/resolved-node-claims.ts",
539
+ member: "hardDeleteUniquesByNodeIds"
540
+ },
541
+ {
542
+ file: "store/claims/resolved-node-claims.ts",
543
+ member: "insertUniqueBatch"
544
+ }
545
+ ]
546
+ }
547
+ ]
548
+ };
549
+ var BATCH_POINT_READ = {
550
+ id: "batchPointRead",
551
+ kind: "graduated",
552
+ crossCheck: "none",
553
+ portSurfaceCode: "BUNDLE_PORT_SURFACE_MISMATCH",
554
+ extras: [
555
+ {
556
+ id: "getNodes",
557
+ members: ["getNodes"],
558
+ disposition: { kind: "fallback", fallback: "per-id getNode" }
559
+ },
560
+ {
561
+ id: "getEdges",
562
+ members: ["getEdges"],
563
+ disposition: { kind: "fallback", fallback: "per-id getEdge" }
564
+ }
565
+ ],
566
+ operations: [
567
+ {
568
+ operation: "search hydration",
569
+ disposition: { kind: "fallback", fallback: "per-id getNode" },
570
+ requires: ["getNodes"],
571
+ sites: [{ file: "store/search.ts", member: "getNodes" }]
572
+ },
573
+ {
574
+ operation: "import reference validation",
575
+ disposition: {
576
+ kind: "fallback",
577
+ fallback: "per-row getNode in the routing loop"
578
+ },
579
+ requires: ["getNodes"],
580
+ sites: [{ file: "interchange/import.ts", member: "getNodes" }]
581
+ },
582
+ {
583
+ operation: "import edge endpoint hydration",
584
+ disposition: { kind: "fallback", fallback: "per-row getEdge" },
585
+ requires: ["getEdges"],
586
+ sites: [{ file: "interchange/import.ts", member: "getEdges" }]
587
+ },
588
+ {
589
+ operation: "edge batch endpoint priming",
590
+ disposition: {
591
+ kind: "fallback",
592
+ fallback: "skip the priming pass; endpoint validation reads per-row"
593
+ },
594
+ requires: ["getNodes"],
595
+ sites: [
596
+ { file: "store/operations/edge-operations.ts", member: "getNodes" }
597
+ ]
598
+ },
599
+ {
600
+ operation: "node create batch priming",
601
+ disposition: {
602
+ kind: "fallback",
603
+ fallback: "skip priming; per-row probes"
604
+ },
605
+ requires: ["getNodes"],
606
+ sites: [
607
+ { file: "store/operations/node-operations.ts", member: "getNodes" }
608
+ ]
609
+ },
610
+ {
611
+ operation: "node collection batch load",
612
+ disposition: { kind: "fallback", fallback: "per-id getNode" },
613
+ requires: ["getNodes"],
614
+ sites: [
615
+ { file: "store/collections/node-collection.ts", member: "getNodes" }
616
+ ]
617
+ },
618
+ {
619
+ operation: "node batch fetch",
620
+ disposition: { kind: "fallback", fallback: "per-id getNode" },
621
+ requires: ["getNodes"],
622
+ sites: [{ file: "store/node-fetch.ts", member: "getNodes" }]
623
+ },
624
+ {
625
+ operation: "edge batch fetch",
626
+ disposition: { kind: "fallback", fallback: "per-id getEdge" },
627
+ requires: ["getEdges"],
628
+ sites: [{ file: "store/edge-fetch.ts", member: "getEdges" }]
629
+ },
630
+ {
631
+ operation: "identity member hydration",
632
+ disposition: { kind: "fallback", fallback: "per-id getNode" },
633
+ requires: ["getNodes"],
634
+ sites: [{ file: "store/store.ts", member: "getNodes" }]
635
+ }
636
+ ]
637
+ };
638
+ var STATEMENT_EXECUTION = {
639
+ id: "statementExecution",
640
+ kind: "gated",
641
+ core: ["executeStatement"],
642
+ crossCheck: "none",
643
+ portSurfaceCode: "BUNDLE_PORT_SURFACE_MISMATCH",
644
+ disposition: {
645
+ kind: "refuse",
646
+ code: "IDENTITY_REQUIRES_STATEMENT_EXECUTION"
647
+ },
648
+ operations: [
649
+ {
650
+ operation: "identity statement execution",
651
+ disposition: {
652
+ kind: "refuse",
653
+ code: "IDENTITY_REQUIRES_STATEMENT_EXECUTION"
654
+ },
655
+ sites: [
656
+ {
657
+ file: "identity/sql-target.ts",
658
+ member: "executeStatement",
659
+ rewiring: {
660
+ class: "deferred",
661
+ reason: "requires verdict threading through IdentityServiceContext / the capture session \u2014 WS5b input, measured at ~13 files/~35 signatures"
662
+ }
663
+ }
664
+ ]
665
+ },
666
+ {
667
+ operation: "recorded capture statement",
668
+ disposition: {
669
+ kind: "refuse",
670
+ code: "RECORDED_CAPTURE_STATEMENT_UNSUPPORTED"
671
+ },
672
+ sites: [
673
+ {
674
+ file: "store/recorded-capture/guards.ts",
675
+ member: "executeStatement",
676
+ lines: [62, 79],
677
+ // DUAL-CLASS (file, member) pair: this same "guards.ts#executeStatement"
678
+ // key also carries the "reasoned" rewiring below (the port-surface
679
+ // fallback site). The live scanner (scripts/bundle-member-access-scan.ts)
680
+ // matches rewiring annotations on (file, member) only — it cannot read
681
+ // `lines` to split the pair — so every live executeStatement access in
682
+ // this file classifies as `annotated-residue` once either sibling
683
+ // annotation exists.
684
+ rewiring: {
685
+ class: "deferred",
686
+ reason: "requires verdict threading through IdentityServiceContext / the capture session \u2014 WS5b input, measured at ~13 files/~35 signatures"
687
+ }
688
+ }
689
+ ]
690
+ },
691
+ {
692
+ operation: "history construction gate",
693
+ disposition: {
694
+ kind: "refuse",
695
+ code: "HISTORY_REQUIRES_STATEMENT_EXECUTION"
696
+ },
697
+ sites: [
698
+ {
699
+ file: "store/recorded-capture/guards.ts",
700
+ member: "executeStatement",
701
+ lines: [251]
702
+ }
703
+ ]
704
+ },
705
+ {
706
+ operation: "revision tracking construction gate",
707
+ disposition: {
708
+ kind: "refuse",
709
+ code: "REVISION_TRACKING_REQUIRES_STATEMENT_EXECUTION"
710
+ },
711
+ sites: [
712
+ {
713
+ file: "store/recorded-capture/guards.ts",
714
+ member: "executeStatement",
715
+ lines: [299]
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ operation: "history-unsafe raw write overlay",
721
+ disposition: {
722
+ kind: "fallback",
723
+ fallback: "omit the overriding member; the port's own absence stands"
724
+ },
725
+ sites: [
726
+ {
727
+ file: "store/recorded-capture/guards.ts",
728
+ member: "executeStatement",
729
+ lines: [219],
730
+ // DUAL-CLASS (file, member) pair: this same "guards.ts#executeStatement"
731
+ // key also carries the "deferred" rewiring above (the recorded-capture
732
+ // statement site). The live scanner (scripts/bundle-member-access-scan.ts)
733
+ // matches rewiring annotations on (file, member) only — it cannot read
734
+ // `lines` to split the pair — so every live executeStatement access in
735
+ // this file classifies as `annotated-residue` once either sibling
736
+ // annotation exists.
737
+ rewiring: {
738
+ class: "reasoned",
739
+ reason: "genuinely a port-surface presence test; re-keying it on a verdict changes behavior in both directions (a phantom-rejecting stub one way, a raw-write escape on a history-enabled store the other \u2014 a safety regression), and adding a non-throwing gated accessor to the frozen binder surface for ONE site is the over-generalization anti-pattern"
740
+ }
741
+ }
742
+ ]
743
+ },
744
+ {
745
+ operation: "identity construction gate",
746
+ disposition: {
747
+ kind: "refuse",
748
+ code: "IDENTITY_REQUIRES_ATOMIC_BACKEND"
749
+ },
750
+ sites: [
751
+ { file: "store/store.ts", member: "executeStatement", lines: [921] },
752
+ { file: "store/store.ts", member: "executeStatement", lines: [928] }
753
+ ]
754
+ },
755
+ {
756
+ operation: "validity window repair",
757
+ disposition: {
758
+ kind: "refuse",
759
+ code: "VALIDITY_WINDOW_REPAIR_REQUIRES_STATEMENT_EXECUTION"
760
+ },
761
+ sites: [
762
+ {
763
+ file: "backend/repair-validity-windows.ts",
764
+ member: "executeStatement"
765
+ }
766
+ ]
767
+ },
768
+ {
769
+ operation: "recorded-time migration",
770
+ disposition: {
771
+ kind: "refuse",
772
+ code: "RECORDED_TIME_MIGRATION_REQUIRES_STATEMENT_EXECUTION"
773
+ },
774
+ sites: [
775
+ {
776
+ file: "backend/migrate-recorded-time.ts",
777
+ member: "executeStatement",
778
+ lines: [154, 161, 801],
779
+ rewiring: {
780
+ class: "deferred",
781
+ reason: "the delete path's public Pick-typed backend cannot reach resolveBundle, and the shared module-private helpers make a single-path rewire two owners"
782
+ }
783
+ }
784
+ ]
785
+ }
786
+ ]
787
+ };
788
+ var CONTRIBUTION_HEALTH = {
789
+ id: "contributionHealth",
790
+ kind: "graduated",
791
+ declaration: "contributions",
792
+ crossCheck: "none",
793
+ portSurfaceCode: "BUNDLE_PORT_SURFACE_MISMATCH",
794
+ extras: [
795
+ {
796
+ id: "verifyContributions",
797
+ members: ["verifyContributions"],
798
+ disposition: { kind: "refuse", code: "CONTRIBUTION_VERIFY_UNSUPPORTED" }
799
+ },
800
+ {
801
+ id: "repairContributions",
802
+ members: ["repairContributions"],
803
+ disposition: { kind: "refuse", code: "CONTRIBUTION_REPAIR_UNSUPPORTED" }
804
+ },
805
+ {
806
+ id: "rebuildContribution",
807
+ members: ["rebuildContribution"],
808
+ disposition: {
809
+ kind: "refuse",
810
+ code: "CONTRIBUTION_REBUILD_UNSUPPORTED"
811
+ }
812
+ },
813
+ {
814
+ id: "probeContributions",
815
+ members: ["probeContributions"],
816
+ disposition: { kind: "fallback", fallback: "{entries: []}" }
817
+ }
818
+ ],
819
+ operations: [
820
+ {
821
+ operation: "contribution verify",
822
+ disposition: { kind: "refuse", code: "CONTRIBUTION_VERIFY_UNSUPPORTED" },
823
+ requires: ["verifyContributions"],
824
+ sites: [{ file: "store/store.ts", member: "verifyContributions" }]
825
+ },
826
+ {
827
+ operation: "contribution repair",
828
+ disposition: { kind: "refuse", code: "CONTRIBUTION_REPAIR_UNSUPPORTED" },
829
+ requires: ["repairContributions"],
830
+ sites: [{ file: "store/store.ts", member: "repairContributions" }]
831
+ },
832
+ {
833
+ operation: "contribution rebuild",
834
+ disposition: {
835
+ kind: "refuse",
836
+ code: "CONTRIBUTION_REBUILD_UNSUPPORTED"
837
+ },
838
+ requires: ["rebuildContribution"],
839
+ sites: [{ file: "store/store.ts", member: "rebuildContribution" }]
840
+ },
841
+ {
842
+ operation: "contribution probe",
843
+ disposition: { kind: "fallback", fallback: "{entries: []}" },
844
+ requires: ["probeContributions"],
845
+ sites: [{ file: "store/store.ts", member: "probeContributions" }],
846
+ declarationGate: true
847
+ }
848
+ ]
849
+ };
850
+ var RECORDED_REVISION_ORIGINS = {
851
+ id: "recordedRevisionOrigins",
852
+ kind: "gated",
853
+ core: ["ensureRevisionOriginsTable"],
854
+ crossCheck: "none",
855
+ portSurfaceCode: "BUNDLE_PORT_SURFACE_MISMATCH",
856
+ disposition: {
857
+ kind: "refuse",
858
+ code: "REVISION_TRACKING_REQUIRES_REVISION_ORIGINS"
859
+ },
860
+ operations: [
861
+ {
862
+ operation: "revision tracking construction gate",
863
+ disposition: {
864
+ kind: "refuse",
865
+ code: "REVISION_TRACKING_REQUIRES_REVISION_ORIGINS"
866
+ },
867
+ sites: [
868
+ {
869
+ file: "store/recorded-capture/guards.ts",
870
+ member: "ensureRevisionOriginsTable"
871
+ }
872
+ ]
873
+ },
874
+ {
875
+ operation: "revision origin bootstrap",
876
+ disposition: {
877
+ kind: "refuse",
878
+ code: "REVISION_ORIGIN_BOOTSTRAP_UNSUPPORTED"
879
+ },
880
+ sites: [
881
+ {
882
+ file: "store/recorded-capture/clock.ts",
883
+ member: "ensureRevisionOriginsTable"
884
+ }
885
+ ]
886
+ }
887
+ ]
888
+ };
889
+ var CAPABILITY_BUNDLES = [
890
+ CLAIMS,
891
+ UNIQUE_SIDECAR_BATCH,
892
+ BATCH_POINT_READ,
893
+ STATEMENT_EXECUTION,
894
+ CONTRIBUTION_HEALTH,
895
+ RECORDED_REVISION_ORIGINS
896
+ ];
897
+ var UNBUNDLED_OPTIONAL_MEMBERS = {
898
+ bootstrapTables: {
899
+ kind: "reasoned",
900
+ reason: "One-shot provisioning hook consulted by createStore before any capability question exists; it has no operation that could refuse or degrade.",
901
+ accesses: 3
902
+ },
903
+ tableNames: {
904
+ kind: "reasoned",
905
+ reason: "Not a capability \u2014 a name map the compiler reads on every backend. Absence is impossible in practice and meaningless as a decision.",
906
+ // 23, not the grep tier's 22: store/store.ts holds two `backend.tableNames`
907
+ // accesses on one physical line, which a line-keyed grep counts once but
908
+ // the type-aware scanner counts as two access nodes (§Baselines).
909
+ accesses: 23
910
+ },
911
+ commitSchemaVersionIfKindsEmpty: {
912
+ kind: "reasoned",
913
+ reason: "Schema-version write fence, a SchemaCommitBackend role member. Its absence is dispositioned by the schema manager's own gate, which is a write-pipeline decision, not a feature-family one.",
914
+ accesses: 1
915
+ },
916
+ commitSchemaVersionWithPreflight: {
917
+ kind: "reasoned",
918
+ reason: "Same schema-version write-fence family as commitSchemaVersionIfKindsEmpty.",
919
+ accesses: 2
920
+ },
921
+ lockSchemaVersionForWrite: {
922
+ kind: "reasoned",
923
+ reason: "Same family; also the one schema member on TransactionBackend, so bundling it would re-open the accessor's B-1 port-typing question for no pilot consumer.",
924
+ accesses: 1
925
+ },
926
+ schemaWriteTransaction: {
927
+ kind: "reasoned",
928
+ reason: "Same family \u2014 and it returns a narrowed transaction backend, so it is a port constructor rather than an operation.",
929
+ accesses: 4
930
+ },
931
+ ensureIdentityTables: {
932
+ kind: "reasoned",
933
+ reason: "Identity DDL, gated by the identity construction gate (store.ts:918-935), which is the write-fence design's decision and must stay one owner there.",
934
+ // 4, not the grep tier's 3: identity/schema-transition.ts:228 accesses
935
+ // `input.ensureIdentityTables` through a derived (arm-b) receiver whose
936
+ // property name never matches the grep receiver-name filter
937
+ // (backend|Backend|target|Target|tx|port|source). The type-aware scanner
938
+ // resolves it via the receiver's declared type node, which textually
939
+ // references `GraphBackend["ensureIdentityTables"]` (§Baselines).
940
+ accesses: 4
941
+ },
942
+ identityTableDdl: {
943
+ kind: "reasoned",
944
+ reason: "Same identity-DDL family as ensureIdentityTables.",
945
+ accesses: 2
946
+ },
947
+ recordedTableDdl: {
948
+ kind: "reasoned",
949
+ reason: "Recorded-time migration DDL factory; its only consumer has its own typed capability refusal, so it is a provisioning port rather than a feature-family operation.",
950
+ accesses: 1
951
+ },
952
+ ensureKindRemovalsTable: {
953
+ kind: "reasoned",
954
+ reason: "Kind-removal provisioning; the removal path's own gate is a schema-lifecycle decision with a single consumer (materialize-removals.ts) and no second theory to consolidate.",
955
+ accesses: 3
956
+ },
957
+ getAllKindRemovals: {
958
+ kind: "reasoned",
959
+ reason: "Same kind-removal family as ensureKindRemovalsTable.",
960
+ accesses: 2
961
+ },
962
+ getPendingKindRemovals: {
963
+ kind: "reasoned",
964
+ reason: "Same kind-removal family as ensureKindRemovalsTable.",
965
+ accesses: 4
966
+ },
967
+ recordKindRemoval: {
968
+ kind: "reasoned",
969
+ reason: "Same kind-removal family as ensureKindRemovalsTable.",
970
+ accesses: 4
971
+ },
972
+ ensureReconciliationMarkersTable: {
973
+ kind: "reasoned",
974
+ reason: "Reconciliation-marker family; single consumer, single gate, same reasoning.",
975
+ accesses: 2
976
+ },
977
+ getReconciliationMarker: {
978
+ kind: "reasoned",
979
+ reason: "Same reconciliation-marker family.",
980
+ accesses: 2
981
+ },
982
+ setReconciliationMarker: {
983
+ kind: "reasoned",
984
+ reason: "Same reconciliation-marker family.",
985
+ accesses: 2
986
+ },
987
+ readConstraintFenceViolations: {
988
+ kind: "reasoned",
989
+ reason: 'Read-only fence audit with exactly one caller and a documented "absent \u21D2 the report is unavailable" contract (history-store-backend.ts:105-108); no operation degrades or refuses on it.',
990
+ accesses: 1
991
+ },
992
+ ensureContributionMaterializationsTable: {
993
+ kind: "reasoned",
994
+ reason: "Zero consumers in src/** outside the backend implementations \u2014 measured, not inferred. A member no code path consults has no measurable arity or disposition.",
995
+ accesses: 0
996
+ },
997
+ getContributionMaterialization: {
998
+ kind: "reasoned",
999
+ reason: "Same zero-consumer family as ensureContributionMaterializationsTable.",
1000
+ accesses: 0
1001
+ },
1002
+ recordContributionMaterialization: {
1003
+ kind: "reasoned",
1004
+ reason: "Zero consumers outside the backend implementations; its only in-tree use is a backend implementation calling its own member (backend/drizzle/contribution-materializations.ts:1588), which the scanner excludes by scope.",
1005
+ accesses: 0
1006
+ },
1007
+ assertRuntimeContributionsInitialized: {
1008
+ kind: "deferred",
1009
+ workstream: "WS5b",
1010
+ bundle: "contributionProvisioning",
1011
+ ceiling: 1
1012
+ },
1013
+ assertVectorSlotInitialized: {
1014
+ kind: "deferred",
1015
+ workstream: "WS5b",
1016
+ bundle: "vectorSlotContributions",
1017
+ ceiling: 1
1018
+ },
1019
+ assertVectorSlotsInitialized: {
1020
+ kind: "deferred",
1021
+ workstream: "WS5b",
1022
+ bundle: "vectorSlotContributions",
1023
+ ceiling: 1
1024
+ },
1025
+ claimIndexMaterialization: {
1026
+ kind: "deferred",
1027
+ workstream: "WS5b",
1028
+ bundle: "indexMaterialization",
1029
+ ceiling: 2
1030
+ },
1031
+ compileSql: {
1032
+ kind: "deferred",
1033
+ workstream: "WS5b",
1034
+ bundle: "rawStatementReuse",
1035
+ ceiling: 9
1036
+ },
1037
+ createVectorIndex: {
1038
+ kind: "deferred",
1039
+ workstream: "WS5b",
1040
+ bundle: "vectorOperations",
1041
+ ceiling: 4
1042
+ },
1043
+ deleteEdgesBatch: {
1044
+ kind: "deferred",
1045
+ workstream: "WS5b",
1046
+ bundle: "batchEntityWrite",
1047
+ ceiling: 5
1048
+ },
1049
+ deleteEmbedding: {
1050
+ kind: "deferred",
1051
+ workstream: "WS5b",
1052
+ bundle: "vectorOperations",
1053
+ ceiling: 8
1054
+ },
1055
+ deleteEmbeddingBatch: {
1056
+ kind: "deferred",
1057
+ workstream: "WS5b",
1058
+ bundle: "vectorOperations",
1059
+ ceiling: 4
1060
+ },
1061
+ deleteFulltext: {
1062
+ kind: "deferred",
1063
+ workstream: "WS5b",
1064
+ bundle: "fulltextOperations",
1065
+ ceiling: 11
1066
+ },
1067
+ deleteFulltextBatch: {
1068
+ kind: "deferred",
1069
+ workstream: "WS5b",
1070
+ bundle: "fulltextOperations",
1071
+ ceiling: 6
1072
+ },
1073
+ deleteVectorSlotContribution: {
1074
+ kind: "deferred",
1075
+ workstream: "WS5b",
1076
+ bundle: "vectorSlotContributions",
1077
+ ceiling: 0
1078
+ },
1079
+ dropVectorIndex: {
1080
+ kind: "deferred",
1081
+ workstream: "WS5b",
1082
+ bundle: "vectorOperations",
1083
+ ceiling: 0
1084
+ },
1085
+ ensureExtension: {
1086
+ kind: "deferred",
1087
+ workstream: "WS5b",
1088
+ bundle: "databaseExtensions",
1089
+ ceiling: 2
1090
+ },
1091
+ ensureFulltextTable: {
1092
+ kind: "deferred",
1093
+ workstream: "WS5b",
1094
+ bundle: "fulltextProvisioning",
1095
+ ceiling: 1
1096
+ },
1097
+ ensureIndexMaterializationsTable: {
1098
+ kind: "deferred",
1099
+ workstream: "WS5b",
1100
+ bundle: "indexMaterialization",
1101
+ ceiling: 2
1102
+ },
1103
+ ensureRuntimeContributions: {
1104
+ kind: "deferred",
1105
+ workstream: "WS5b",
1106
+ bundle: "contributionProvisioning",
1107
+ ceiling: 2
1108
+ },
1109
+ ensureTrigramExtension: {
1110
+ kind: "deferred",
1111
+ workstream: "WS5b",
1112
+ bundle: "databaseExtensions",
1113
+ ceiling: 2
1114
+ },
1115
+ ensureVectorSlotContribution: {
1116
+ kind: "deferred",
1117
+ workstream: "WS5b",
1118
+ bundle: "vectorSlotContributions",
1119
+ ceiling: 4
1120
+ },
1121
+ ensureVectorSlotContributions: {
1122
+ kind: "deferred",
1123
+ workstream: "WS5b",
1124
+ bundle: "vectorSlotContributions",
1125
+ ceiling: 1
1126
+ },
1127
+ executeDdl: {
1128
+ kind: "deferred",
1129
+ workstream: "WS5b",
1130
+ bundle: "ddlExecution",
1131
+ ceiling: 13
1132
+ },
1133
+ executeRaw: {
1134
+ kind: "deferred",
1135
+ workstream: "WS5b",
1136
+ bundle: "rawStatementReuse",
1137
+ ceiling: 7
1138
+ },
1139
+ executeTemporaryStatement: {
1140
+ kind: "deferred",
1141
+ workstream: "WS5b",
1142
+ bundle: "temporaryStatements",
1143
+ ceiling: 3
1144
+ },
1145
+ findEdgesByEndpointSet: {
1146
+ kind: "deferred",
1147
+ workstream: "WS5b",
1148
+ bundle: "endpointSetRead",
1149
+ ceiling: 1
1150
+ },
1151
+ findEdgesByHeterogeneousEndpointSet: {
1152
+ kind: "deferred",
1153
+ workstream: "WS5b",
1154
+ bundle: "heterogeneousEndpointSetRead",
1155
+ ceiling: 1
1156
+ },
1157
+ fulltextSearch: {
1158
+ kind: "deferred",
1159
+ workstream: "WS5b",
1160
+ bundle: "fulltextOperations",
1161
+ ceiling: 4
1162
+ },
1163
+ fulltextStrategy: {
1164
+ kind: "deferred",
1165
+ workstream: "WS5b",
1166
+ bundle: "fulltextOperations",
1167
+ ceiling: 2
1168
+ },
1169
+ getIndexMaterialization: {
1170
+ kind: "deferred",
1171
+ workstream: "WS5b",
1172
+ bundle: "indexMaterialization",
1173
+ ceiling: 3
1174
+ },
1175
+ getIndexMaterializations: {
1176
+ kind: "deferred",
1177
+ workstream: "WS5b",
1178
+ bundle: "indexMaterialization",
1179
+ ceiling: 2
1180
+ },
1181
+ hardDeleteEdgesBatch: {
1182
+ kind: "deferred",
1183
+ workstream: "WS5b",
1184
+ bundle: "batchEntityWrite",
1185
+ ceiling: 5
1186
+ },
1187
+ hybridSearch: {
1188
+ kind: "deferred",
1189
+ workstream: "WS5b",
1190
+ bundle: "hybridSearch",
1191
+ ceiling: 2
1192
+ },
1193
+ insertEdgeNoReturn: {
1194
+ kind: "deferred",
1195
+ workstream: "WS5b",
1196
+ bundle: "batchEntityWrite",
1197
+ ceiling: 4
1198
+ },
1199
+ insertEdgesBatch: {
1200
+ kind: "deferred",
1201
+ workstream: "WS5b",
1202
+ bundle: "batchEntityWrite",
1203
+ ceiling: 4
1204
+ },
1205
+ insertEdgesBatchReturning: {
1206
+ kind: "deferred",
1207
+ workstream: "WS5b",
1208
+ bundle: "batchEntityWrite",
1209
+ ceiling: 4
1210
+ },
1211
+ insertNodeNoReturn: {
1212
+ kind: "deferred",
1213
+ workstream: "WS5b",
1214
+ bundle: "batchEntityWrite",
1215
+ ceiling: 4
1216
+ },
1217
+ insertNodesBatch: {
1218
+ kind: "deferred",
1219
+ workstream: "WS5b",
1220
+ bundle: "batchEntityWrite",
1221
+ ceiling: 4
1222
+ },
1223
+ insertNodesBatchReturning: {
1224
+ kind: "deferred",
1225
+ workstream: "WS5b",
1226
+ bundle: "batchEntityWrite",
1227
+ ceiling: 4
1228
+ },
1229
+ recordIndexMaterialization: {
1230
+ kind: "deferred",
1231
+ workstream: "WS5b",
1232
+ bundle: "indexMaterialization",
1233
+ ceiling: 6
1234
+ },
1235
+ releaseIndexMaterializationClaim: {
1236
+ kind: "deferred",
1237
+ workstream: "WS5b",
1238
+ bundle: "indexMaterialization",
1239
+ ceiling: 2
1240
+ },
1241
+ trustedImport: {
1242
+ kind: "deferred",
1243
+ workstream: "WS5b",
1244
+ bundle: "trustedImport",
1245
+ ceiling: 1
1246
+ },
1247
+ updateNodeSet: {
1248
+ kind: "deferred",
1249
+ workstream: "WS5b",
1250
+ bundle: "batchEntityWrite",
1251
+ ceiling: 6
1252
+ },
1253
+ upsertEmbedding: {
1254
+ kind: "deferred",
1255
+ workstream: "WS5b",
1256
+ bundle: "vectorOperations",
1257
+ ceiling: 10
1258
+ },
1259
+ upsertEmbeddingBatch: {
1260
+ kind: "deferred",
1261
+ workstream: "WS5b",
1262
+ bundle: "vectorOperations",
1263
+ ceiling: 4
1264
+ },
1265
+ upsertFulltext: {
1266
+ kind: "deferred",
1267
+ workstream: "WS5b",
1268
+ bundle: "fulltextOperations",
1269
+ ceiling: 9
1270
+ },
1271
+ upsertFulltextBatch: {
1272
+ kind: "deferred",
1273
+ workstream: "WS5b",
1274
+ bundle: "fulltextOperations",
1275
+ ceiling: 6
1276
+ },
1277
+ vectorSearch: {
1278
+ kind: "deferred",
1279
+ workstream: "WS5b",
1280
+ bundle: "vectorOperations",
1281
+ ceiling: 4
1282
+ },
1283
+ vectorStrategy: {
1284
+ kind: "deferred",
1285
+ workstream: "WS5b",
1286
+ bundle: "vectorOperations",
1287
+ ceiling: 9
1288
+ }
1289
+ };
1290
+ var WS5B_SEED_BUNDLES = {
1291
+ batchEntityWrite: [
1292
+ "insertNodesBatch",
1293
+ "insertNodesBatchReturning",
1294
+ "insertEdgesBatch",
1295
+ "insertEdgesBatchReturning",
1296
+ "deleteEdgesBatch",
1297
+ "hardDeleteEdgesBatch",
1298
+ "insertNodeNoReturn",
1299
+ "insertEdgeNoReturn",
1300
+ "updateNodeSet"
1301
+ ],
1302
+ endpointSetRead: ["findEdgesByEndpointSet"],
1303
+ heterogeneousEndpointSetRead: ["findEdgesByHeterogeneousEndpointSet"],
1304
+ vectorOperations: [
1305
+ "upsertEmbedding",
1306
+ "deleteEmbedding",
1307
+ "upsertEmbeddingBatch",
1308
+ "deleteEmbeddingBatch",
1309
+ "vectorSearch",
1310
+ "vectorStrategy",
1311
+ "createVectorIndex",
1312
+ "dropVectorIndex"
1313
+ ],
1314
+ hybridSearch: ["hybridSearch"],
1315
+ vectorSlotContributions: [
1316
+ "assertVectorSlotsInitialized",
1317
+ "assertVectorSlotInitialized",
1318
+ "ensureVectorSlotContributions",
1319
+ "ensureVectorSlotContribution",
1320
+ "deleteVectorSlotContribution"
1321
+ ],
1322
+ fulltextOperations: [
1323
+ "upsertFulltext",
1324
+ "deleteFulltext",
1325
+ "upsertFulltextBatch",
1326
+ "deleteFulltextBatch",
1327
+ "fulltextSearch",
1328
+ "fulltextStrategy"
1329
+ ],
1330
+ fulltextProvisioning: ["ensureFulltextTable"],
1331
+ databaseExtensions: ["ensureExtension", "ensureTrigramExtension"],
1332
+ contributionProvisioning: [
1333
+ "ensureRuntimeContributions",
1334
+ "assertRuntimeContributionsInitialized"
1335
+ ],
1336
+ indexMaterialization: [
1337
+ "getIndexMaterialization",
1338
+ "recordIndexMaterialization",
1339
+ "getIndexMaterializations",
1340
+ "ensureIndexMaterializationsTable",
1341
+ "claimIndexMaterialization",
1342
+ "releaseIndexMaterializationClaim"
1343
+ ],
1344
+ ddlExecution: ["executeDdl"],
1345
+ temporaryStatements: ["executeTemporaryStatement"],
1346
+ rawStatementReuse: ["executeRaw", "compileSql"],
1347
+ trustedImport: ["trustedImport"]
1348
+ };
1349
+
1350
+ // src/backend/capabilities/bind.ts
1351
+ function portSurfaceCodeFor(bundle) {
1352
+ const definition = CAPABILITY_BUNDLES.find(
1353
+ (candidate) => candidate.id === bundle
1354
+ );
1355
+ return definition?.portSurfaceCode ?? "BUNDLE_PORT_SURFACE_MISMATCH";
1356
+ }
1357
+ function findMissingPortMember(port, names) {
1358
+ const portRecord = port;
1359
+ return names.find((name) => portRecord[name] === void 0);
1360
+ }
1361
+ function bindNames(port, names, bundle) {
1362
+ const missing = findMissingPortMember(port, names);
1363
+ if (missing !== void 0) {
1364
+ throw new ConfigurationError(
1365
+ `The port passed to capability bundle "${bundle}" is missing "${missing}", which the resolved verdict says is present.`,
1366
+ {
1367
+ code: portSurfaceCodeFor(bundle),
1368
+ bundle,
1369
+ member: missing
1370
+ }
1371
+ );
1372
+ }
1373
+ const bound = createDataKeyedBag();
1374
+ const portRecord = port;
1375
+ for (const name of names) {
1376
+ bound[name] = portRecord[name];
1377
+ }
1378
+ return bound;
1379
+ }
1380
+ function bindCore(port, verdict, definition) {
1381
+ const bound = bindNames(
1382
+ port,
1383
+ verdict.members,
1384
+ definition.id
1385
+ );
1386
+ return bound;
1387
+ }
1388
+ function bindExtra(port, extraVerdict, bundle) {
1389
+ const bound = bindNames(port, extraVerdict.members, bundle);
1390
+ return bound;
1391
+ }
1392
+ function bindExtraIfReachable(port, extraVerdict, bundle) {
1393
+ if (!extraVerdict.present) return void 0;
1394
+ if (findMissingPortMember(port, extraVerdict.members) !== void 0) {
1395
+ return void 0;
1396
+ }
1397
+ return bindExtra(port, extraVerdict, bundle);
1398
+ }
1399
+ function bindPresentExtraVerdicts(port, extras, bundle) {
1400
+ const bound = createDataKeyedBag();
1401
+ for (const extraVerdict of Object.values(extras)) {
1402
+ if (!extraVerdict.present) continue;
1403
+ Object.assign(bound, bindExtra(port, extraVerdict, bundle));
1404
+ }
1405
+ return bound;
1406
+ }
1407
+ function claimsMembers(port, verdict) {
1408
+ return bindCore(port, verdict, CLAIMS);
1409
+ }
1410
+ function statementExecutionMembers(port, verdict) {
1411
+ return bindCore(port, verdict, STATEMENT_EXECUTION);
1412
+ }
1413
+ function recordedRevisionOriginsMembers(port, verdict) {
1414
+ return bindCore(port, verdict, RECORDED_REVISION_ORIGINS);
1415
+ }
1416
+ function uniqueSidecarBatchMembers(port, verdict) {
1417
+ const bound = bindPresentExtraVerdicts(
1418
+ port,
1419
+ verdict.extras,
1420
+ UNIQUE_SIDECAR_BATCH.id
1421
+ );
1422
+ return bound;
1423
+ }
1424
+ function batchPointReadMembers(port, verdict) {
1425
+ const bound = bindPresentExtraVerdicts(
1426
+ port,
1427
+ verdict.extras,
1428
+ BATCH_POINT_READ.id
1429
+ );
1430
+ return bound;
1431
+ }
1432
+ function contributionHealthMembers(port, verdict) {
1433
+ const bound = bindPresentExtraVerdicts(
1434
+ port,
1435
+ verdict.extras,
1436
+ CONTRIBUTION_HEALTH.id
1437
+ );
1438
+ return bound;
1439
+ }
1440
+
1441
+ // src/backend/capabilities/write-fence.ts
1442
+ var FIRST_PARTY_FACTORY_BACKENDS = /* @__PURE__ */ new WeakSet();
1443
+ function markFirstPartyFactory(target) {
1444
+ FIRST_PARTY_FACTORY_BACKENDS.add(target);
1445
+ return target;
1446
+ }
1447
+ function carryFirstPartyFactoryMark(derived, base) {
1448
+ if (FIRST_PARTY_FACTORY_BACKENDS.has(base)) {
1449
+ FIRST_PARTY_FACTORY_BACKENDS.add(derived);
1450
+ }
1451
+ }
1452
+ function deriveFromDialect(dialect) {
1453
+ switch (dialect) {
1454
+ case "postgres": {
1455
+ return {
1456
+ advisoryLocks: true,
1457
+ tableLocks: true,
1458
+ serializedWriters: false
1459
+ };
1460
+ }
1461
+ case "sqlite": {
1462
+ return {
1463
+ advisoryLocks: false,
1464
+ tableLocks: false,
1465
+ serializedWriters: true
1466
+ };
1467
+ }
1468
+ default: {
1469
+ return dialect;
1470
+ }
1471
+ }
1472
+ }
1473
+ function planFromLockCapabilities(declared) {
1474
+ if (declared.advisoryLocks) {
1475
+ return {
1476
+ kind: "lock",
1477
+ advisoryLocks: true,
1478
+ tableLocks: declared.tableLocks
1479
+ };
1480
+ }
1481
+ if (declared.serializedWriters) return { kind: "engine-serialized" };
1482
+ return { kind: "unfenced" };
1483
+ }
1484
+ function resolveWriteFencePlan(target) {
1485
+ const declared = target.capabilities.pessimisticLocks;
1486
+ if (declared !== void 0) return planFromLockCapabilities(declared);
1487
+ if (FIRST_PARTY_FACTORY_BACKENDS.has(target)) {
1488
+ return planFromLockCapabilities(deriveFromDialect(target.dialect));
1489
+ }
1490
+ return { kind: "unfenced" };
1491
+ }
1492
+ function pessimisticLockDeclarationLine(dialect) {
1493
+ switch (dialect) {
1494
+ case "postgres": {
1495
+ return "pessimisticLocks: { advisoryLocks: true, tableLocks: true, serializedWriters: false }";
1496
+ }
1497
+ case "sqlite": {
1498
+ return "pessimisticLocks: { advisoryLocks: false, tableLocks: false, serializedWriters: true }";
1499
+ }
1500
+ default: {
1501
+ return dialect;
1502
+ }
1503
+ }
1504
+ }
1505
+ function unfencedRefusalMessage(dialect, resource) {
1506
+ const declaredLine = pessimisticLockDeclarationLine(dialect);
1507
+ const otherDialect = dialect === "postgres" ? "sqlite" : "postgres";
1508
+ const otherLine = pessimisticLockDeclarationLine(otherDialect);
1509
+ const dialectDescription = dialect === "postgres" ? "an engine that honors `pg_advisory_xact_lock` and `LOCK TABLE`" : "an engine with a single writer slot";
1510
+ const otherDescription = otherDialect === "postgres" ? "an engine that honors `pg_advisory_xact_lock` and `LOCK TABLE`" : "an engine with a single writer slot";
1511
+ return `This backend declares no usable write fence: \`capabilities.pessimisticLocks\` is absent, or declares neither advisory/table locks nor serialized writers, so TypeGraph cannot know whether it fences concurrent writers, and ${resource} cannot run unfenced. Add ONE line to the capabilities you pass:
1512
+
1513
+ ${declaredLine}
1514
+
1515
+ (that is the correct declaration for ${dialectDescription}; use
1516
+ \`${otherLine}\` for ${otherDescription}). If the engine honors neither, this refusal is correct and ${resource} is unavailable on it.`;
1517
+ }
1518
+ function refuseUnfencedOperationalIdentity(dialect) {
1519
+ throw new ConfigurationError(
1520
+ unfencedRefusalMessage(dialect, "Operational Identity"),
1521
+ { code: "IDENTITY_REQUIRES_WRITE_FENCE", dialect },
1522
+ {
1523
+ suggestion: "Declare `capabilities.pessimisticLocks` on this backend, or construct the store without `identity`."
1524
+ }
1525
+ );
1526
+ }
1527
+ function refuseUnfencedClockAllocation(dialect) {
1528
+ throw new ConfigurationError(
1529
+ unfencedRefusalMessage(
1530
+ dialect,
1531
+ "TypeGraph's recorded-time clock allocation"
1532
+ ),
1533
+ { code: "RECORDED_CLOCK_REQUIRES_WRITE_FENCE", dialect },
1534
+ {
1535
+ suggestion: "Declare `capabilities.pessimisticLocks` on this backend, or construct the store without `history`/`revisionTracking`."
1536
+ }
1537
+ );
1538
+ }
1539
+ function requireWriteFence(plan, operation, requires) {
1540
+ switch (plan.kind) {
1541
+ case "lock": {
1542
+ if (requires === "table-lock" && !plan.tableLocks) {
1543
+ throw new ConfigurationError(
1544
+ `${operation} requires a table lock, but this backend's pessimisticLocks declaration reports tableLocks: false.`,
1545
+ {
1546
+ code: "WRITE_FENCE_UNAVAILABLE",
1547
+ operation,
1548
+ requires,
1549
+ plan
1550
+ },
1551
+ {
1552
+ suggestion: "Declare `pessimisticLocks.tableLocks: true` on this backend, or avoid this operation."
1553
+ }
1554
+ );
1555
+ }
1556
+ return plan;
1557
+ }
1558
+ case "engine-serialized": {
1559
+ return plan;
1560
+ }
1561
+ case "unfenced": {
1562
+ throw new ConfigurationError(
1563
+ `${operation} requires a write fence, but this backend declares no usable write fence (\`capabilities.pessimisticLocks\` is absent, or declares neither advisory/table locks nor serialized writers).`,
1564
+ { code: "WRITE_FENCE_UNAVAILABLE", operation, requires },
1565
+ {
1566
+ suggestion: "Declare `capabilities.pessimisticLocks` on this backend, matching the engine's real locking support."
1567
+ }
1568
+ );
1569
+ }
1570
+ default: {
1571
+ throw new ConfigurationError(
1572
+ `${operation} could not resolve a write-fence plan.`,
1573
+ { code: "WRITE_FENCE_UNAVAILABLE", operation, requires }
1574
+ );
1575
+ }
1576
+ }
1577
+ }
1578
+
1579
+ export { ALIAS_CTE_PREFIX, BATCH_POINT_READ, CAPABILITY_BUNDLES, CLAIMS, CONTRIBUTION_HEALTH, D1_MAX_BIND_PARAMETERS, DATABASE_EXTENSION_NAMES, DEFAULT_SQL_SCHEMA, DURABLE_OBJECT_MAX_BIND_PARAMETERS, EMBEDDINGS_CTE_ALIAS, FULLTEXT_CTE_ALIAS, HYBRID_CANDIDATES_CTE_ALIAS, INTERNAL_TEMPORARY_WRITES, MODERN_SQLITE_MAX_BIND_PARAMETERS, POSTGRES_CAPABILITIES, POSTGRES_MAX_BIND_PARAMETERS, RECORDED_REVISION_ORIGINS, SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, STATEMENT_EXECUTION, UNBUNDLED_OPTIONAL_MEMBERS, UNIQUE_SIDECAR_BATCH, WS5B_SEED_BUNDLES, batchPointReadMembers, bindCore, bindExtra, bindExtraIfReachable, carryFirstPartyFactoryMark, claimsMembers, closeAfterFailure, contributionHealthMembers, createRecordedReadBinding, createSqlSchema, createTransactionReadBackend, isLiveNodeRow, isTombstonedNodeRow, markFirstPartyFactory, normalizeGraphAnalyticsCapabilities, recordedReadSchemaFor, recordedReadSqlSchema, recordedRelation, recordedRevisionOriginsMembers, refuseUnfencedClockAllocation, refuseUnfencedOperationalIdentity, requireExternalRecordedReadSource, requireRecordedReadBinding, requireSqlSchema, requireWriteFence, resolveWriteFencePlan, rowPropsToJsonText, rowPropsToObject, runOptionallyInTransaction, statementExecutionMembers, uniqueSidecarBatchMembers, vectorSlotKey };
1580
+ //# sourceMappingURL=chunk-LKZDQ2B4.js.map
1581
+ //# sourceMappingURL=chunk-LKZDQ2B4.js.map