@nicia-ai/typegraph 0.37.1 → 0.39.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 (372) hide show
  1. package/README.md +12 -10
  2. package/dist/backend/drizzle/indexes.cjs +32 -0
  3. package/dist/backend/drizzle/indexes.cjs.map +1 -0
  4. package/dist/backend/drizzle/indexes.d.cts +43 -0
  5. package/dist/backend/drizzle/indexes.d.ts +43 -0
  6. package/dist/backend/drizzle/indexes.js +11 -0
  7. package/dist/backend/drizzle/indexes.js.map +1 -0
  8. package/dist/backend/index.cjs +161 -0
  9. package/dist/backend/index.cjs.map +1 -0
  10. package/dist/backend/index.d.cts +3 -0
  11. package/dist/backend/index.d.ts +3 -0
  12. package/dist/backend/index.js +8 -0
  13. package/dist/backend/index.js.map +1 -0
  14. package/dist/backend/postgres/index.cjs +32 -28
  15. package/dist/backend/postgres/index.d.cts +13 -12
  16. package/dist/backend/postgres/index.d.ts +13 -12
  17. package/dist/backend/postgres/index.js +19 -15
  18. package/dist/backend/postgres/pglite-store.cjs +67 -0
  19. package/dist/backend/postgres/pglite-store.cjs.map +1 -0
  20. package/dist/backend/postgres/pglite-store.d.cts +38 -0
  21. package/dist/backend/postgres/pglite-store.d.ts +38 -0
  22. package/dist/backend/postgres/pglite-store.js +65 -0
  23. package/dist/backend/postgres/pglite-store.js.map +1 -0
  24. package/dist/backend/postgres/pglite.cjs +25 -50
  25. package/dist/backend/postgres/pglite.cjs.map +1 -1
  26. package/dist/backend/postgres/pglite.d.cts +10 -9
  27. package/dist/backend/postgres/pglite.d.ts +10 -9
  28. package/dist/backend/postgres/pglite.js +20 -52
  29. package/dist/backend/postgres/pglite.js.map +1 -1
  30. package/dist/backend/sqlite/index.cjs +29 -25
  31. package/dist/backend/sqlite/index.d.cts +11 -11
  32. package/dist/backend/sqlite/index.d.ts +11 -11
  33. package/dist/backend/sqlite/index.js +17 -13
  34. package/dist/backend/sqlite/libsql.cjs +23 -19
  35. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  36. package/dist/backend/sqlite/libsql.d.cts +9 -10
  37. package/dist/backend/sqlite/libsql.d.ts +9 -10
  38. package/dist/backend/sqlite/libsql.js +19 -15
  39. package/dist/backend/sqlite/libsql.js.map +1 -1
  40. package/dist/backend/sqlite/local-store.cjs +72 -0
  41. package/dist/backend/sqlite/local-store.cjs.map +1 -0
  42. package/dist/backend/sqlite/local-store.d.cts +42 -0
  43. package/dist/backend/sqlite/local-store.d.ts +42 -0
  44. package/dist/backend/sqlite/local-store.js +67 -0
  45. package/dist/backend/sqlite/local-store.js.map +1 -0
  46. package/dist/backend/sqlite/local.cjs +28 -183
  47. package/dist/backend/sqlite/local.cjs.map +1 -1
  48. package/dist/backend/sqlite/local.d.cts +8 -81
  49. package/dist/backend/sqlite/local.d.ts +8 -81
  50. package/dist/backend/sqlite/local.js +20 -180
  51. package/dist/backend/sqlite/local.js.map +1 -1
  52. package/dist/chunk-2EBMPJBO.js +16 -0
  53. package/dist/chunk-2EBMPJBO.js.map +1 -0
  54. package/dist/chunk-35S6P5ZU.js +27 -0
  55. package/dist/chunk-35S6P5ZU.js.map +1 -0
  56. package/dist/chunk-3LKL3S6X.js +50 -0
  57. package/dist/chunk-3LKL3S6X.js.map +1 -0
  58. package/dist/{chunk-RCVLFTCT.js → chunk-3SK4SVTW.js} +13 -12
  59. package/dist/chunk-3SK4SVTW.js.map +1 -0
  60. package/dist/chunk-3YFDFOYB.cjs +192 -0
  61. package/dist/chunk-3YFDFOYB.cjs.map +1 -0
  62. package/dist/{chunk-WOJMKB3N.cjs → chunk-5ELKD2FQ.cjs} +1677 -308
  63. package/dist/chunk-5ELKD2FQ.cjs.map +1 -0
  64. package/dist/{chunk-5AVRFNP4.cjs → chunk-6SRLCSAV.cjs} +3012 -1513
  65. package/dist/chunk-6SRLCSAV.cjs.map +1 -0
  66. package/dist/chunk-6XDBRDZE.js +312 -0
  67. package/dist/chunk-6XDBRDZE.js.map +1 -0
  68. package/dist/chunk-764JHTLT.cjs +15 -0
  69. package/dist/chunk-764JHTLT.cjs.map +1 -0
  70. package/dist/chunk-76HE7DJP.js +68 -0
  71. package/dist/chunk-76HE7DJP.js.map +1 -0
  72. package/dist/{chunk-VGDDG3XJ.cjs → chunk-7M3NACL3.cjs} +12 -12
  73. package/dist/{chunk-VGDDG3XJ.cjs.map → chunk-7M3NACL3.cjs.map} +1 -1
  74. package/dist/chunk-AOL64O4Z.js +165 -0
  75. package/dist/chunk-AOL64O4Z.js.map +1 -0
  76. package/dist/{chunk-27SSDCEP.cjs → chunk-B63IFHXR.cjs} +53 -74
  77. package/dist/chunk-B63IFHXR.cjs.map +1 -0
  78. package/dist/{chunk-3XXGYU62.cjs → chunk-BKAKAVRW.cjs} +56 -53
  79. package/dist/chunk-BKAKAVRW.cjs.map +1 -0
  80. package/dist/{chunk-YTSN73ND.js → chunk-BQITNFQJ.js} +3 -3
  81. package/dist/{chunk-YTSN73ND.js.map → chunk-BQITNFQJ.js.map} +1 -1
  82. package/dist/{chunk-GA4TT3DH.js → chunk-CBK2IVI2.js} +1999 -503
  83. package/dist/chunk-CBK2IVI2.js.map +1 -0
  84. package/dist/{chunk-6EEO3OVU.cjs → chunk-CWX77JB4.cjs} +22 -59
  85. package/dist/chunk-CWX77JB4.cjs.map +1 -0
  86. package/dist/{chunk-UGZUAYAR.js → chunk-D7PG5D5K.js} +4 -3
  87. package/dist/chunk-D7PG5D5K.js.map +1 -0
  88. package/dist/chunk-DDCIXXOO.js +9 -0
  89. package/dist/chunk-DDCIXXOO.js.map +1 -0
  90. package/dist/chunk-DDCYVIVV.cjs +44 -0
  91. package/dist/chunk-DDCYVIVV.cjs.map +1 -0
  92. package/dist/{chunk-UV3WP5WZ.js → chunk-DOKUXLFH.js} +61 -29
  93. package/dist/chunk-DOKUXLFH.js.map +1 -0
  94. package/dist/{chunk-XPCZADMT.cjs → chunk-DOVMTPKE.cjs} +89 -27
  95. package/dist/chunk-DOVMTPKE.cjs.map +1 -0
  96. package/dist/{chunk-5PNMDJ7J.js → chunk-DPNA466P.js} +14 -9
  97. package/dist/chunk-DPNA466P.js.map +1 -0
  98. package/dist/{chunk-BYPOGQWK.js → chunk-DRACN6XG.js} +6 -4
  99. package/dist/chunk-DRACN6XG.js.map +1 -0
  100. package/dist/{chunk-TGOMW4MB.cjs → chunk-E2Q7SP2K.cjs} +110 -109
  101. package/dist/chunk-E2Q7SP2K.cjs.map +1 -0
  102. package/dist/chunk-E6TXEISH.cjs +175 -0
  103. package/dist/chunk-E6TXEISH.cjs.map +1 -0
  104. package/dist/{chunk-3C2RYI6L.cjs → chunk-EOJFGECD.cjs} +11 -11
  105. package/dist/chunk-EOJFGECD.cjs.map +1 -0
  106. package/dist/{chunk-XWV4JT34.js → chunk-ERZ4QPQX.js} +27 -22
  107. package/dist/chunk-ERZ4QPQX.js.map +1 -0
  108. package/dist/{chunk-DFVLCOP6.js → chunk-EZH7FNUS.js} +3 -3
  109. package/dist/{chunk-DFVLCOP6.js.map → chunk-EZH7FNUS.js.map} +1 -1
  110. package/dist/{chunk-WWFHO375.cjs → chunk-FJMPR3OH.cjs} +4 -3
  111. package/dist/chunk-FJMPR3OH.cjs.map +1 -0
  112. package/dist/chunk-FMNUSGZ4.cjs +12 -0
  113. package/dist/chunk-FMNUSGZ4.cjs.map +1 -0
  114. package/dist/{chunk-EXU3RASM.js → chunk-G3CSQLLT.js} +20 -474
  115. package/dist/chunk-G3CSQLLT.js.map +1 -0
  116. package/dist/{chunk-EJYMTO3K.cjs → chunk-GKQU44SQ.cjs} +150 -118
  117. package/dist/chunk-GKQU44SQ.cjs.map +1 -0
  118. package/dist/chunk-GNPGGLAE.cjs +212 -0
  119. package/dist/chunk-GNPGGLAE.cjs.map +1 -0
  120. package/dist/{chunk-QARBLBXT.cjs → chunk-GUUWKPTK.cjs} +7 -7
  121. package/dist/{chunk-QARBLBXT.cjs.map → chunk-GUUWKPTK.cjs.map} +1 -1
  122. package/dist/chunk-GYA4JRP5.js +31 -0
  123. package/dist/chunk-GYA4JRP5.js.map +1 -0
  124. package/dist/{chunk-3GH67G4Z.cjs → chunk-HP6LWBLB.cjs} +16 -42
  125. package/dist/chunk-HP6LWBLB.cjs.map +1 -0
  126. package/dist/{chunk-NXQFATMF.cjs → chunk-HTQOBY75.cjs} +153 -123
  127. package/dist/chunk-HTQOBY75.cjs.map +1 -0
  128. package/dist/chunk-I6FX7AAG.js +39 -0
  129. package/dist/chunk-I6FX7AAG.js.map +1 -0
  130. package/dist/{chunk-VKGKDOKR.js → chunk-IFDXG2YJ.js} +1539 -206
  131. package/dist/chunk-IFDXG2YJ.js.map +1 -0
  132. package/dist/{chunk-IXGYRP2P.js → chunk-IFRPHG7O.js} +79 -49
  133. package/dist/chunk-IFRPHG7O.js.map +1 -0
  134. package/dist/chunk-IMQKXL4E.cjs +12 -0
  135. package/dist/{chunk-QSXTWU4U.cjs.map → chunk-IMQKXL4E.cjs.map} +1 -1
  136. package/dist/chunk-J6IJARLG.js +94 -0
  137. package/dist/chunk-J6IJARLG.js.map +1 -0
  138. package/dist/{chunk-3DS7Z4T4.cjs → chunk-JD2YC62H.cjs} +44 -43
  139. package/dist/chunk-JD2YC62H.cjs.map +1 -0
  140. package/dist/{chunk-W63OVYY4.js → chunk-K34OPSJK.js} +3 -3
  141. package/dist/{chunk-W63OVYY4.js.map → chunk-K34OPSJK.js.map} +1 -1
  142. package/dist/chunk-KAFXPB2L.js +184 -0
  143. package/dist/chunk-KAFXPB2L.js.map +1 -0
  144. package/dist/chunk-KIZSHRUI.cjs +49 -0
  145. package/dist/chunk-KIZSHRUI.cjs.map +1 -0
  146. package/dist/{chunk-K3Q3LJY3.js → chunk-KXFUQNF2.js} +201 -100
  147. package/dist/chunk-KXFUQNF2.js.map +1 -0
  148. package/dist/{chunk-UXLSNRYL.js → chunk-MTNEGGM2.js} +4 -4
  149. package/dist/chunk-MTNEGGM2.js.map +1 -0
  150. package/dist/{chunk-IP3CGGPA.cjs → chunk-N2V3HJFV.cjs} +92 -185
  151. package/dist/chunk-N2V3HJFV.cjs.map +1 -0
  152. package/dist/chunk-NAUA4PW5.cjs +28 -0
  153. package/dist/chunk-NAUA4PW5.cjs.map +1 -0
  154. package/dist/chunk-NMQ6C6TS.cjs +61 -0
  155. package/dist/chunk-NMQ6C6TS.cjs.map +1 -0
  156. package/dist/{chunk-2N6EOBTH.cjs → chunk-NPWACFQJ.cjs} +58 -53
  157. package/dist/chunk-NPWACFQJ.cjs.map +1 -0
  158. package/dist/{chunk-TKT2XHED.js → chunk-NQBYTLPW.js} +13 -12
  159. package/dist/chunk-NQBYTLPW.js.map +1 -0
  160. package/dist/{chunk-5KEQ74YU.cjs → chunk-NT6ILURI.cjs} +9 -86
  161. package/dist/chunk-NT6ILURI.cjs.map +1 -0
  162. package/dist/{chunk-3SLPDKHQ.js → chunk-PH4IJ3V5.js} +5 -77
  163. package/dist/chunk-PH4IJ3V5.js.map +1 -0
  164. package/dist/chunk-PWXGB77L.cjs +56 -0
  165. package/dist/chunk-PWXGB77L.cjs.map +1 -0
  166. package/dist/chunk-PZHC5GCD.js +193 -0
  167. package/dist/chunk-PZHC5GCD.js.map +1 -0
  168. package/dist/chunk-QMQLUA66.js +12 -0
  169. package/dist/chunk-QMQLUA66.js.map +1 -0
  170. package/dist/{chunk-5WWVZMVX.js → chunk-QZ7A6HBM.js} +2 -2
  171. package/dist/{chunk-5WWVZMVX.js.map → chunk-QZ7A6HBM.js.map} +1 -1
  172. package/dist/chunk-RW24SAHI.cjs +74 -0
  173. package/dist/chunk-RW24SAHI.cjs.map +1 -0
  174. package/dist/{chunk-BVRDGYXQ.cjs → chunk-SAFZ6JTI.cjs} +14 -9
  175. package/dist/chunk-SAFZ6JTI.cjs.map +1 -0
  176. package/dist/{chunk-L7HQ2OSI.js → chunk-SCTZRFW5.js} +87 -166
  177. package/dist/chunk-SCTZRFW5.js.map +1 -0
  178. package/dist/{chunk-5KPNWT6X.js → chunk-SDHV2MWU.js} +24 -45
  179. package/dist/chunk-SDHV2MWU.js.map +1 -0
  180. package/dist/{chunk-3RWZPJKV.js → chunk-SU7VQOJ3.js} +21 -78
  181. package/dist/chunk-SU7VQOJ3.js.map +1 -0
  182. package/dist/chunk-SVJ5GEXW.cjs +45 -0
  183. package/dist/chunk-SVJ5GEXW.cjs.map +1 -0
  184. package/dist/chunk-SVUKGWSN.cjs +102 -0
  185. package/dist/chunk-SVUKGWSN.cjs.map +1 -0
  186. package/dist/chunk-TAUGGLNQ.js +59 -0
  187. package/dist/chunk-TAUGGLNQ.js.map +1 -0
  188. package/dist/{chunk-A42GCBGX.cjs → chunk-TRF4EBJT.cjs} +6 -4
  189. package/dist/chunk-TRF4EBJT.cjs.map +1 -0
  190. package/dist/{chunk-KQJ54OG5.js → chunk-U4JDJKPD.js} +19 -56
  191. package/dist/chunk-U4JDJKPD.js.map +1 -0
  192. package/dist/chunk-UH2USOMG.cjs +627 -0
  193. package/dist/chunk-UH2USOMG.cjs.map +1 -0
  194. package/dist/{chunk-XGPUQ56G.js → chunk-UUIBACKJ.js} +15 -38
  195. package/dist/chunk-UUIBACKJ.js.map +1 -0
  196. package/dist/{chunk-5VQM6VWP.cjs → chunk-UWG5GX6E.cjs} +2 -2
  197. package/dist/{chunk-5VQM6VWP.cjs.map → chunk-UWG5GX6E.cjs.map} +1 -1
  198. package/dist/{chunk-K5UBVGJN.js → chunk-VDYA2HMS.js} +6 -6
  199. package/dist/{chunk-K5UBVGJN.js.map → chunk-VDYA2HMS.js.map} +1 -1
  200. package/dist/{chunk-NUIG3BCV.cjs → chunk-VXAFOF6Z.cjs} +93 -155
  201. package/dist/chunk-VXAFOF6Z.cjs.map +1 -0
  202. package/dist/chunk-X4PVHAZ6.cjs +83 -0
  203. package/dist/chunk-X4PVHAZ6.cjs.map +1 -0
  204. package/dist/{chunk-UYQMBBWJ.js → chunk-X6CNEA32.js} +23 -20
  205. package/dist/chunk-X6CNEA32.js.map +1 -0
  206. package/dist/chunk-X6RDQ5NB.cjs +335 -0
  207. package/dist/chunk-X6RDQ5NB.cjs.map +1 -0
  208. package/dist/{chunk-DEFQM7JU.cjs → chunk-XRU7V7FF.cjs} +7 -7
  209. package/dist/{chunk-DEFQM7JU.cjs.map → chunk-XRU7V7FF.cjs.map} +1 -1
  210. package/dist/{chunk-TPF25IG6.js → chunk-XZA3Y4YH.js} +3 -3
  211. package/dist/{chunk-TPF25IG6.js.map → chunk-XZA3Y4YH.js.map} +1 -1
  212. package/dist/{chunk-DIQ3AV5W.cjs → chunk-Y6UA55YS.cjs} +324 -224
  213. package/dist/chunk-Y6UA55YS.cjs.map +1 -0
  214. package/dist/chunk-Y7M44XEK.js +462 -0
  215. package/dist/chunk-Y7M44XEK.js.map +1 -0
  216. package/dist/{chunk-RRSNR3TP.js → chunk-YIRLBUNN.js} +3 -3
  217. package/dist/{chunk-RRSNR3TP.js.map → chunk-YIRLBUNN.js.map} +1 -1
  218. package/dist/chunk-YPUNPG2T.js +47 -0
  219. package/dist/chunk-YPUNPG2T.js.map +1 -0
  220. package/dist/{chunk-QERAIDRJ.js → chunk-Z2PPIVOO.js} +82 -22
  221. package/dist/chunk-Z2PPIVOO.js.map +1 -0
  222. package/dist/chunk-Z5QHVL5U.cjs +12 -0
  223. package/dist/chunk-Z5QHVL5U.cjs.map +1 -0
  224. package/dist/chunk-ZDH3DX3C.cjs +30 -0
  225. package/dist/chunk-ZDH3DX3C.cjs.map +1 -0
  226. package/dist/chunk-ZE6NVENI.js +77 -0
  227. package/dist/chunk-ZE6NVENI.js.map +1 -0
  228. package/dist/chunk-ZKZAIX42.cjs +479 -0
  229. package/dist/chunk-ZKZAIX42.cjs.map +1 -0
  230. package/dist/{chunk-TEDRJXOG.cjs → chunk-ZY4GXIVN.cjs} +5 -5
  231. package/dist/{chunk-TEDRJXOG.cjs.map → chunk-ZY4GXIVN.cjs.map} +1 -1
  232. package/dist/core/index.cjs +117 -0
  233. package/dist/core/index.cjs.map +1 -0
  234. package/dist/core/index.d.cts +225 -0
  235. package/dist/core/index.d.ts +225 -0
  236. package/dist/core/index.js +12 -0
  237. package/dist/core/index.js.map +1 -0
  238. package/dist/{ddl-CS0KUVwB.d.ts → ddl-Dx3Z0_WC.d.ts} +3 -3
  239. package/dist/{ddl-BD-ZfKeX.d.cts → ddl-J6sDyABg.d.cts} +3 -3
  240. package/dist/define-graph-CzEvA_8F.d.cts +174 -0
  241. package/dist/define-graph-DRo9xpYN.d.ts +174 -0
  242. package/dist/{extension-types-BM2ACfYO.d.cts → extension-types-BLEVH4SG.d.cts} +1 -1
  243. package/dist/{extension-types-BM2ACfYO.d.ts → extension-types-BLEVH4SG.d.ts} +1 -1
  244. package/dist/graph-extension/index.cjs +21 -19
  245. package/dist/graph-extension/index.d.cts +4 -4
  246. package/dist/graph-extension/index.d.ts +4 -4
  247. package/dist/graph-extension/index.js +6 -4
  248. package/dist/graph-merge/index.cjs +267 -218
  249. package/dist/graph-merge/index.cjs.map +1 -1
  250. package/dist/graph-merge/index.d.cts +17 -93
  251. package/dist/graph-merge/index.d.ts +17 -93
  252. package/dist/graph-merge/index.js +143 -94
  253. package/dist/graph-merge/index.js.map +1 -1
  254. package/dist/{index-BeacbPoe.d.ts → index-BD_3TCgh.d.ts} +6 -4
  255. package/dist/{index-BPM59vsg.d.cts → index-BihFPsPu.d.cts} +6 -4
  256. package/dist/{fulltext-strategy-C27vXaeB.d.cts → index-Bq7vSPHy.d.ts} +3195 -2646
  257. package/dist/{fulltext-strategy-DebsMrqg.d.ts → index-CrFL_ENI.d.cts} +3195 -2646
  258. package/dist/index.cjs +326 -315
  259. package/dist/index.cjs.map +1 -1
  260. package/dist/index.d.cts +59 -240
  261. package/dist/index.d.ts +59 -240
  262. package/dist/index.js +46 -79
  263. package/dist/index.js.map +1 -1
  264. package/dist/indexes/index.cjs +26 -38
  265. package/dist/indexes/index.d.cts +6 -41
  266. package/dist/indexes/index.d.ts +6 -41
  267. package/dist/indexes/index.js +14 -10
  268. package/dist/interchange/index.cjs +48 -39
  269. package/dist/interchange/index.cjs.map +1 -1
  270. package/dist/interchange/index.d.cts +7 -8
  271. package/dist/interchange/index.d.ts +7 -8
  272. package/dist/interchange/index.js +23 -14
  273. package/dist/interchange/index.js.map +1 -1
  274. package/dist/local-options-CZ1BnIoF.d.cts +29 -0
  275. package/dist/local-options-CZ1BnIoF.d.ts +29 -0
  276. package/dist/{manager-D00_NXvT.d.ts → manager-CASfhmzV.d.ts} +4 -173
  277. package/dist/{manager-nU1vTJLy.d.cts → manager-nCEJiYBb.d.cts} +4 -173
  278. package/dist/{materialize-indexes-zK2J_flP.d.ts → materialize-indexes-D4iei4Kp.d.ts} +1 -1
  279. package/dist/{materialize-indexes-CuR3gAZb.d.cts → materialize-indexes-ExQ6OrAh.d.cts} +1 -1
  280. package/dist/{postgres-IaBA4RgE.d.ts → postgres-Cl1ZAN1G.d.ts} +1 -1
  281. package/dist/{postgres-YrYmPlaU.d.cts → postgres-DMgIKQU-.d.cts} +1 -1
  282. package/dist/postgres-execution-fKW0qRiN.d.cts +14 -0
  283. package/dist/postgres-execution-fKW0qRiN.d.ts +14 -0
  284. package/dist/profiler/index.cjs +9 -8
  285. package/dist/profiler/index.cjs.map +1 -1
  286. package/dist/profiler/index.d.cts +9 -17
  287. package/dist/profiler/index.d.ts +9 -17
  288. package/dist/profiler/index.js +8 -7
  289. package/dist/profiler/index.js.map +1 -1
  290. package/dist/provenance/index.cjs +61 -55
  291. package/dist/provenance/index.cjs.map +1 -1
  292. package/dist/provenance/index.d.cts +7 -8
  293. package/dist/provenance/index.d.ts +7 -8
  294. package/dist/provenance/index.js +34 -28
  295. package/dist/provenance/index.js.map +1 -1
  296. package/dist/schema/index.cjs +46 -37
  297. package/dist/schema/index.cjs.map +1 -1
  298. package/dist/schema/index.d.cts +8 -10
  299. package/dist/schema/index.d.ts +8 -10
  300. package/dist/schema/index.js +22 -13
  301. package/dist/schema/index.js.map +1 -1
  302. package/dist/{sqlite-BUOHPx7p.d.ts → sqlite-BDkW39aa.d.cts} +1 -1
  303. package/dist/{sqlite-Pp8O19WE.d.cts → sqlite-CYfhvESj.d.ts} +1 -1
  304. package/dist/sqlite-execution-DwbE2a9y.d.cts +32 -0
  305. package/dist/sqlite-execution-DwbE2a9y.d.ts +32 -0
  306. package/dist/{store-view-X96Rd00T.d.cts → store-view-BJd6Vwpt.d.cts} +427 -1404
  307. package/dist/{store-view-ANL6mTph.d.ts → store-view-CLIhwMMX.d.ts} +427 -1404
  308. package/dist/temporal-BC_NQV5Y.d.cts +281 -0
  309. package/dist/temporal-DqtOEo_B.d.ts +281 -0
  310. package/dist/{types-r-Zyq2Hz.d.cts → types-COq3-vMC.d.cts} +2 -2
  311. package/dist/{types-wsvuBgPK.d.ts → types-CUevi_D1.d.ts} +2 -2
  312. package/dist/{where-CJOpJj3a.d.ts → where-BdE_cYtx.d.ts} +5 -5
  313. package/dist/{where-K3uBP33l.d.cts → where-C92TXCzT.d.cts} +5 -5
  314. package/package.json +37 -6
  315. package/dist/chunk-27SSDCEP.cjs.map +0 -1
  316. package/dist/chunk-2N6EOBTH.cjs.map +0 -1
  317. package/dist/chunk-3C2RYI6L.cjs.map +0 -1
  318. package/dist/chunk-3DS7Z4T4.cjs.map +0 -1
  319. package/dist/chunk-3GH67G4Z.cjs.map +0 -1
  320. package/dist/chunk-3RWZPJKV.js.map +0 -1
  321. package/dist/chunk-3SLPDKHQ.js.map +0 -1
  322. package/dist/chunk-3XXGYU62.cjs.map +0 -1
  323. package/dist/chunk-44TA22QT.js +0 -1478
  324. package/dist/chunk-44TA22QT.js.map +0 -1
  325. package/dist/chunk-5AVRFNP4.cjs.map +0 -1
  326. package/dist/chunk-5KEQ74YU.cjs.map +0 -1
  327. package/dist/chunk-5KPNWT6X.js.map +0 -1
  328. package/dist/chunk-5PNMDJ7J.js.map +0 -1
  329. package/dist/chunk-6EEO3OVU.cjs.map +0 -1
  330. package/dist/chunk-7YSP4V4R.cjs +0 -69
  331. package/dist/chunk-7YSP4V4R.cjs.map +0 -1
  332. package/dist/chunk-A42GCBGX.cjs.map +0 -1
  333. package/dist/chunk-BVRDGYXQ.cjs.map +0 -1
  334. package/dist/chunk-BYPOGQWK.js.map +0 -1
  335. package/dist/chunk-CUHM5CWJ.cjs +0 -12
  336. package/dist/chunk-CUHM5CWJ.cjs.map +0 -1
  337. package/dist/chunk-DIQ3AV5W.cjs.map +0 -1
  338. package/dist/chunk-EJYMTO3K.cjs.map +0 -1
  339. package/dist/chunk-EXU3RASM.js.map +0 -1
  340. package/dist/chunk-GA4TT3DH.js.map +0 -1
  341. package/dist/chunk-IP3CGGPA.cjs.map +0 -1
  342. package/dist/chunk-IPSVVTWT.cjs +0 -1540
  343. package/dist/chunk-IPSVVTWT.cjs.map +0 -1
  344. package/dist/chunk-IXGYRP2P.js.map +0 -1
  345. package/dist/chunk-K3Q3LJY3.js.map +0 -1
  346. package/dist/chunk-KQJ54OG5.js.map +0 -1
  347. package/dist/chunk-L7HQ2OSI.js.map +0 -1
  348. package/dist/chunk-M6VES7V6.js +0 -239
  349. package/dist/chunk-M6VES7V6.js.map +0 -1
  350. package/dist/chunk-NUIG3BCV.cjs.map +0 -1
  351. package/dist/chunk-NXQFATMF.cjs.map +0 -1
  352. package/dist/chunk-OHMP6N2J.js +0 -47
  353. package/dist/chunk-OHMP6N2J.js.map +0 -1
  354. package/dist/chunk-QERAIDRJ.js.map +0 -1
  355. package/dist/chunk-QSXTWU4U.cjs +0 -12
  356. package/dist/chunk-RCVLFTCT.js.map +0 -1
  357. package/dist/chunk-TGOMW4MB.cjs.map +0 -1
  358. package/dist/chunk-TKT2XHED.js.map +0 -1
  359. package/dist/chunk-UGZUAYAR.js.map +0 -1
  360. package/dist/chunk-UV3WP5WZ.js.map +0 -1
  361. package/dist/chunk-UXLSNRYL.js.map +0 -1
  362. package/dist/chunk-UYQMBBWJ.js.map +0 -1
  363. package/dist/chunk-VKGKDOKR.js.map +0 -1
  364. package/dist/chunk-VL2V6PEN.cjs +0 -261
  365. package/dist/chunk-VL2V6PEN.cjs.map +0 -1
  366. package/dist/chunk-WOJMKB3N.cjs.map +0 -1
  367. package/dist/chunk-WWFHO375.cjs.map +0 -1
  368. package/dist/chunk-XGPUQ56G.js.map +0 -1
  369. package/dist/chunk-XGU7DZDA.cjs +0 -1095
  370. package/dist/chunk-XGU7DZDA.cjs.map +0 -1
  371. package/dist/chunk-XPCZADMT.cjs.map +0 -1
  372. package/dist/chunk-XWV4JT34.js.map +0 -1
@@ -1,28 +1,39 @@
1
- import { createStoreWithSchema } from '../chunk-GA4TT3DH.js';
2
- import '../chunk-M6VES7V6.js';
3
- import { importGraphStream, exportGraphStream } from '../chunk-TKT2XHED.js';
4
- import '../chunk-RCVLFTCT.js';
5
- import { defineNode, computeSchemaHash, serializeSchema } from '../chunk-3RWZPJKV.js';
6
- import { getNodeKinds, getEdgeKinds, defineGraph } from '../chunk-3SLPDKHQ.js';
1
+ import { createStoreWithSchema } from '../chunk-CBK2IVI2.js';
2
+ import { compareStrings } from '../chunk-DRACN6XG.js';
3
+ import '../chunk-AOL64O4Z.js';
4
+ import { importGraphStream, exportGraphStream } from '../chunk-NQBYTLPW.js';
5
+ import '../chunk-3SK4SVTW.js';
6
+ import { storeBackend, generateId, computeUniqueKey, transactionBackend, lockRecordedGraphWrite, readRevisionOrigin, readRecordedClock } from '../chunk-IFDXG2YJ.js';
7
+ import '../chunk-35S6P5ZU.js';
8
+ import '../chunk-PZHC5GCD.js';
9
+ import '../chunk-J6IJARLG.js';
10
+ import { computeSchemaHash, serializeSchema } from '../chunk-SU7VQOJ3.js';
11
+ import { defineNode } from '../chunk-76HE7DJP.js';
12
+ import '../chunk-ZE6NVENI.js';
7
13
  import { sortedReplacer } from '../chunk-UR7W5YQK.js';
8
- import '../chunk-KQJ54OG5.js';
9
- import '../chunk-YTSN73ND.js';
10
- import '../chunk-K5UBVGJN.js';
11
- import { sha256Hex } from '../chunk-W63OVYY4.js';
12
- import '../chunk-EXU3RASM.js';
13
- import '../chunk-UGZUAYAR.js';
14
- import { ok, err, isErr, computeTransitiveClosure, isReachable } from '../chunk-L7HQ2OSI.js';
15
- export { isErr, isOk, unwrap } from '../chunk-L7HQ2OSI.js';
16
- import '../chunk-TPF25IG6.js';
17
- import { compareStrings } from '../chunk-BYPOGQWK.js';
18
- import { generateId, computeUniqueKey, lockRecordedGraphWrite, readRevisionOrigin, readRecordedClock } from '../chunk-VKGKDOKR.js';
19
- import '../chunk-44TA22QT.js';
20
- import '../chunk-XGPUQ56G.js';
21
- import '../chunk-OHMP6N2J.js';
22
- import '../chunk-PC2UBAUB.js';
14
+ import '../chunk-UUIBACKJ.js';
15
+ import { getNodeKinds, getEdgeKinds, defineGraph } from '../chunk-PH4IJ3V5.js';
16
+ import '../chunk-I6FX7AAG.js';
17
+ import '../chunk-U4JDJKPD.js';
18
+ import '../chunk-BQITNFQJ.js';
19
+ import '../chunk-VDYA2HMS.js';
20
+ import { sha256Hex } from '../chunk-K34OPSJK.js';
21
+ import '../chunk-2EBMPJBO.js';
22
+ import '../chunk-G3CSQLLT.js';
23
+ import '../chunk-DDCIXXOO.js';
24
+ import '../chunk-Y7M44XEK.js';
25
+ import '../chunk-6XDBRDZE.js';
26
+ import '../chunk-D7PG5D5K.js';
23
27
  import '../chunk-SNXVDZAJ.js';
28
+ import { requireDefined } from '../chunk-QMQLUA66.js';
29
+ import '../chunk-PC2UBAUB.js';
30
+ import { ok, err, isErr, computeTransitiveClosure, isReachable } from '../chunk-SCTZRFW5.js';
31
+ export { isErr, isOk, unwrap } from '../chunk-SCTZRFW5.js';
32
+ import '../chunk-GYA4JRP5.js';
33
+ import '../chunk-TAUGGLNQ.js';
24
34
  import '../chunk-ITE4IXAK.js';
25
- import { TypeGraphError } from '../chunk-5PNMDJ7J.js';
35
+ import '../chunk-XZA3Y4YH.js';
36
+ import { TypeGraphError } from '../chunk-DPNA466P.js';
26
37
  import '../chunk-G6Q5UM7U.js';
27
38
  import { z } from 'zod';
28
39
 
@@ -112,7 +123,7 @@ async function enumerateAllNodes(backend, graphId, kind) {
112
123
  if (page.length < ENUMERATION_PAGE_SIZE) {
113
124
  break;
114
125
  }
115
- after = page.at(-1).id;
126
+ after = requireDefined(page.at(-1)).id;
116
127
  }
117
128
  return collected;
118
129
  }
@@ -134,7 +145,7 @@ async function enumerateAllEdges(backend, graphId, kind) {
134
145
  if (page.length < ENUMERATION_PAGE_SIZE) {
135
146
  break;
136
147
  }
137
- after = page.at(-1).id;
148
+ after = requireDefined(page.at(-1)).id;
138
149
  }
139
150
  return collected;
140
151
  }
@@ -255,12 +266,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
255
266
  const forkNodeVersions = /* @__PURE__ */ new Map();
256
267
  for (const kind of nodeKinds) {
257
268
  const baseRows = await enumerateAllNodes(
258
- baseStore.backend,
269
+ storeBackend(baseStore),
259
270
  baseStore.graphId,
260
271
  kind
261
272
  );
262
273
  const forkRows = await enumerateAllNodes(
263
- forkStore.backend,
274
+ storeBackend(forkStore),
264
275
  forkStore.graphId,
265
276
  kind
266
277
  );
@@ -286,12 +297,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
286
297
  const forkEdgeSignatures = /* @__PURE__ */ new Map();
287
298
  for (const kind of edgeKinds) {
288
299
  const baseRows = await enumerateAllEdges(
289
- baseStore.backend,
300
+ storeBackend(baseStore),
290
301
  baseStore.graphId,
291
302
  kind
292
303
  );
293
304
  const forkRows = await enumerateAllEdges(
294
- forkStore.backend,
305
+ storeBackend(forkStore),
295
306
  forkStore.graphId,
296
307
  kind
297
308
  );
@@ -356,7 +367,10 @@ async function readActiveSchemaVersion(backend, graphId) {
356
367
  return active?.version ?? FALLBACK_SCHEMA_VERSION;
357
368
  }
358
369
  async function computeSchemaComponent(store) {
359
- const version = await readActiveSchemaVersion(store.backend, store.graphId);
370
+ const version = await readActiveSchemaVersion(
371
+ storeBackend(store),
372
+ store.graphId
373
+ );
360
374
  return computeSchemaHash(serializeSchema(store.graph, version));
361
375
  }
362
376
  function byDigestEntry(left, right) {
@@ -422,7 +436,7 @@ async function computeBaseVersion(store) {
422
436
  }
423
437
  const [schemaComponent, contentComponent] = await Promise.all([
424
438
  computeSchemaComponent(store),
425
- computeContentComponent(store.backend, store.graphId, store.graph)
439
+ computeContentComponent(storeBackend(store), store.graphId, store.graph)
426
440
  ]);
427
441
  return asBaseVersion(
428
442
  `${schemaComponent}${TOKEN_SEPARATOR}${contentComponent}`
@@ -644,7 +658,7 @@ function blockNodes(newNodes, resolveConfig, uniqueConstraints = []) {
644
658
  );
645
659
  const ordered = /* @__PURE__ */ new Map();
646
660
  for (const key of sortedKeys) {
647
- const members = [...buckets.get(key)].sort(
661
+ const members = [...requireDefined(buckets.get(key))].sort(
648
662
  (left, right) => compareStrings(left.id, right.id)
649
663
  );
650
664
  ordered.set(key, members);
@@ -672,7 +686,7 @@ function buildBranchRank(branchOrder, allBranchIds) {
672
686
  return rank;
673
687
  }
674
688
  function pickByPriority(values, branchRank) {
675
- let chosen = values[0];
689
+ let chosen = requireDefined(values[0]);
676
690
  let chosenRank = branchRank.get(chosen.branchId) ?? Number.MAX_SAFE_INTEGER;
677
691
  for (const candidate of values.slice(1)) {
678
692
  const candidateRank = branchRank.get(candidate.branchId) ?? Number.MAX_SAFE_INTEGER;
@@ -686,7 +700,7 @@ function pickByPriority(values, branchRank) {
686
700
  return chosen.value;
687
701
  }
688
702
  function pickByWeight(values, weights, branchRank) {
689
- let chosen = values[0];
703
+ let chosen = requireDefined(values[0]);
690
704
  let chosenWeight = weights.get(chosen.branchId) ?? 0;
691
705
  let chosenRank = branchRank.get(chosen.branchId) ?? Number.MAX_SAFE_INTEGER;
692
706
  for (const candidate of values.slice(1)) {
@@ -713,7 +727,7 @@ function allValuesEqual(values) {
713
727
  if (values.length <= 1) {
714
728
  return true;
715
729
  }
716
- const first = canonicalValueKey(values[0].value);
730
+ const first = canonicalValueKey(requireDefined(values[0]).value);
717
731
  return values.every(
718
732
  (candidate) => canonicalValueKey(candidate.value) === first
719
733
  );
@@ -799,7 +813,7 @@ function pickClusterSurvivor(members, cluster, canonicalOverride, preferKind) {
799
813
  const byKey = (left, right) => compareMergeKeys(mergeKeyOf(left), mergeKeyOf(right));
800
814
  const baseMembers = members.filter((member) => member.origin === "base").sort(byKey);
801
815
  if (baseMembers.length > 0) {
802
- return baseMembers[0];
816
+ return requireDefined(baseMembers[0]);
803
817
  }
804
818
  let canonicalId;
805
819
  if (canonicalOverride !== void 0) {
@@ -812,15 +826,15 @@ function pickClusterSurvivor(members, cluster, canonicalOverride, preferKind) {
812
826
  const minIdentity = [...cluster.members].sort(
813
827
  (left, right) => compareMergeKeys(left, right)
814
828
  )[0];
815
- canonicalId = minIdentity === void 0 ? members[0].id : idOf(minIdentity);
829
+ canonicalId = minIdentity === void 0 ? requireDefined(members[0]).id : idOf(minIdentity);
816
830
  }
817
831
  const membersAtId = members.filter((member) => member.id === canonicalId);
818
832
  if (membersAtId.length === 0) {
819
- return [...members].sort(byKey)[0];
833
+ return requireDefined([...members].sort(byKey)[0]);
820
834
  }
821
835
  const kinds = [...new Set(membersAtId.map((member) => member.kind))];
822
836
  const chosenKind = preferKind !== void 0 && kinds.length > 1 ? preferKind(kinds) : void 0;
823
- return (chosenKind === void 0 ? void 0 : membersAtId.find((member) => member.kind === chosenKind)) ?? [...membersAtId].sort(byKey)[0];
837
+ return (chosenKind === void 0 ? void 0 : membersAtId.find((member) => member.kind === chosenKind)) ?? requireDefined([...membersAtId].sort(byKey)[0]);
824
838
  }
825
839
  function findPreferredMember(members, property, preferredBranchId) {
826
840
  if (preferredBranchId === void 0) {
@@ -847,7 +861,7 @@ function pickCanonicalPropertyValue(canonicalMember, members, property, values,
847
861
  return preferredValue;
848
862
  }
849
863
  const canonicalValue = memberPropertyValue(canonicalMember, property);
850
- return canonicalValue === void 0 ? values[0].value : canonicalValue;
864
+ return canonicalValue === void 0 ? requireDefined(values[0]).value : canonicalValue;
851
865
  }
852
866
  function unionProperties(canonicalMember, members, context, baseContext, branchRank, preferredBranchId) {
853
867
  const canonicalId = canonicalMember.id;
@@ -962,11 +976,11 @@ var UnionFind = class {
962
976
  this.add(value);
963
977
  let root = value;
964
978
  while (this.parent.get(root) !== root) {
965
- root = this.parent.get(root);
979
+ root = requireDefined(this.parent.get(root));
966
980
  }
967
981
  let cursor = value;
968
982
  while (cursor !== root) {
969
- const next = this.parent.get(cursor);
983
+ const next = requireDefined(this.parent.get(cursor));
970
984
  this.parent.set(cursor, root);
971
985
  cursor = next;
972
986
  }
@@ -1152,8 +1166,8 @@ function cosineSimilarity(left, right) {
1152
1166
  let leftMagnitude = 0;
1153
1167
  let rightMagnitude = 0;
1154
1168
  for (let index = 0; index < left.length; index += 1) {
1155
- const leftComponent = left[index];
1156
- const rightComponent = right[index];
1169
+ const leftComponent = requireDefined(left[index]);
1170
+ const rightComponent = requireDefined(right[index]);
1157
1171
  dot += leftComponent * rightComponent;
1158
1172
  leftMagnitude += leftComponent * leftComponent;
1159
1173
  rightMagnitude += rightComponent * rightComponent;
@@ -1387,7 +1401,10 @@ function buildComponents(edges, nodeIds, edgesSorted = false) {
1387
1401
  });
1388
1402
  }
1389
1403
  clusters.sort(
1390
- (left, right) => compareMergeKeys(left.members[0], right.members[0])
1404
+ (left, right) => compareMergeKeys(
1405
+ requireDefined(left.members[0]),
1406
+ requireDefined(right.members[0])
1407
+ )
1391
1408
  );
1392
1409
  return clusters;
1393
1410
  }
@@ -1399,8 +1416,8 @@ function adjacencyOf(members, edges) {
1399
1416
  }
1400
1417
  for (const edge of edges) {
1401
1418
  if (memberSet.has(edge.a) && memberSet.has(edge.b)) {
1402
- adjacency.get(edge.a).add(edge.b);
1403
- adjacency.get(edge.b).add(edge.a);
1419
+ requireDefined(adjacency.get(edge.a)).add(edge.b);
1420
+ requireDefined(adjacency.get(edge.b)).add(edge.a);
1404
1421
  }
1405
1422
  }
1406
1423
  return adjacency;
@@ -1415,10 +1432,10 @@ function exceedsDiameter(members, edges, maxDiameter) {
1415
1432
  const queue = [source];
1416
1433
  let head = 0;
1417
1434
  while (head < queue.length) {
1418
- const current = queue[head];
1435
+ const current = requireDefined(queue[head]);
1419
1436
  head += 1;
1420
- const currentDistance = distance.get(current);
1421
- for (const neighbor of adjacency.get(current)) {
1437
+ const currentDistance = requireDefined(distance.get(current));
1438
+ for (const neighbor of requireDefined(adjacency.get(current))) {
1422
1439
  if (!distance.has(neighbor)) {
1423
1440
  const neighborDistance = currentDistance + 1;
1424
1441
  if (neighborDistance > maxDiameter) {
@@ -1501,7 +1518,10 @@ function enforceDiameter(clusters, candidateEdges, clusterMaxDiameter) {
1501
1518
  }
1502
1519
  }
1503
1520
  guarded.sort(
1504
- (left, right) => compareMergeKeys(left.members[0], right.members[0])
1521
+ (left, right) => compareMergeKeys(
1522
+ requireDefined(left.members[0]),
1523
+ requireDefined(right.members[0])
1524
+ )
1505
1525
  );
1506
1526
  return guarded;
1507
1527
  }
@@ -1546,7 +1566,10 @@ function enforceBaseGuard(clusters, candidateEdges, baseIds) {
1546
1566
  );
1547
1567
  }
1548
1568
  result.sort(
1549
- (left, right) => compareMergeKeys(left.members[0], right.members[0])
1569
+ (left, right) => compareMergeKeys(
1570
+ requireDefined(left.members[0]),
1571
+ requireDefined(right.members[0])
1572
+ )
1550
1573
  );
1551
1574
  return { clusters: result, events };
1552
1575
  }
@@ -1554,7 +1577,7 @@ function enforceBaseGuard(clusters, candidateEdges, baseIds) {
1554
1577
  // src/graph-merge/delete-modify.ts
1555
1578
  var DELETED_NODE_DROP_REASON = "delete-modify:deleteWins";
1556
1579
  function pickHighestPriorityBranch(branchIds, branchRank) {
1557
- let chosen = branchIds[0];
1580
+ let chosen = requireDefined(branchIds[0]);
1558
1581
  let chosenRank = branchRank.get(chosen) ?? Number.MAX_SAFE_INTEGER;
1559
1582
  for (const candidate of branchIds.slice(1)) {
1560
1583
  const candidateRank = branchRank.get(candidate) ?? Number.MAX_SAFE_INTEGER;
@@ -1610,8 +1633,8 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
1610
1633
  }
1611
1634
  continue;
1612
1635
  }
1613
- const deletionsForKey = deletedByKey.get(key);
1614
- const { id, kind } = modifiedEntity(modifications[0]);
1636
+ const deletionsForKey = requireDefined(deletedByKey.get(key));
1637
+ const { id, kind } = modifiedEntity(requireDefined(modifications[0]));
1615
1638
  const deletedBy = pickHighestPriorityBranch(
1616
1639
  deletionsForKey.map((deletion) => deletion.branchId),
1617
1640
  branchRank
@@ -1646,7 +1669,7 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
1646
1669
  if (conflictedKeys.has(key)) {
1647
1670
  continue;
1648
1671
  }
1649
- const { id, kind } = deletedEntity(deletionsForKey[0]);
1672
+ const { id, kind } = deletedEntity(requireDefined(deletionsForKey[0]));
1650
1673
  deletions.push({ id, kind });
1651
1674
  }
1652
1675
  return {
@@ -1678,10 +1701,10 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
1678
1701
  const conflicts = [];
1679
1702
  for (const modifications of grouped.values()) {
1680
1703
  if (modifications.length === 1) {
1681
- out.push(modifications[0]);
1704
+ out.push(requireDefined(modifications[0]));
1682
1705
  continue;
1683
1706
  }
1684
- const first = entityOf(modifications[0]);
1707
+ const first = entityOf(requireDefined(modifications[0]));
1685
1708
  const { props, conflicts: propertyConflicts } = threeWayMergeProps(
1686
1709
  first.id,
1687
1710
  first.kind,
@@ -1700,7 +1723,7 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
1700
1723
  );
1701
1724
  const representative = modifications.find(
1702
1725
  (modification) => modification.branchId === chosenBranch
1703
- ) ?? modifications[0];
1726
+ ) ?? requireDefined(modifications[0]);
1704
1727
  out.push(rebuild(representative, chosenBranch, props));
1705
1728
  for (const conflict of propertyConflicts) {
1706
1729
  conflicts.push(conflict);
@@ -1748,7 +1771,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
1748
1771
  }
1749
1772
  for (const property of [...propertyNames].sort(compareStrings)) {
1750
1773
  const baseHas = property in baseProps;
1751
- const baseKey = baseHas ? canonicalValueKey(baseProps[property]) : void 0;
1774
+ const baseKey = baseHas ? canonicalValueKey(requireDefined(baseProps[property])) : void 0;
1752
1775
  const changed = contributions.filter((contribution) => {
1753
1776
  if (!(property in contribution.forkProps)) {
1754
1777
  return false;
@@ -1765,7 +1788,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
1765
1788
  (contribution) => !(property in contribution.forkProps)
1766
1789
  );
1767
1790
  if (baseHas && !deletedByFork) {
1768
- merged[property] = baseProps[property];
1791
+ merged[property] = requireDefined(baseProps[property]);
1769
1792
  }
1770
1793
  continue;
1771
1794
  }
@@ -1773,13 +1796,13 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
1773
1796
  values.map((candidate) => canonicalValueKey(candidate.value))
1774
1797
  );
1775
1798
  if (distinctValues.size === 1) {
1776
- merged[property] = values[0].value;
1799
+ merged[property] = requireDefined(values[0]).value;
1777
1800
  continue;
1778
1801
  }
1779
1802
  const preferredValue = values.find(
1780
1803
  (value2) => value2.branchId === preferredBranchId
1781
1804
  )?.value;
1782
- const canonicalValue = preferredValue ?? (baseHas ? baseProps[property] : values[0].value);
1805
+ const canonicalValue = preferredValue ?? (baseHas ? requireDefined(baseProps[property]) : requireDefined(values[0]).value);
1783
1806
  const reportedValues = preferredBranchId === void 0 ? values : values.filter((value2) => value2.branchId !== preferredBranchId);
1784
1807
  const { value, conflict } = resolvePropertyUnion(
1785
1808
  { entityId, kind, property, values, reportedValues, canonicalValue },
@@ -1864,7 +1887,7 @@ function groupKey(fromKey, type, toKey) {
1864
1887
  function pickSurvivor(edges, preferredBranchId) {
1865
1888
  const preferred = preferredBranchId === void 0 ? [] : edges.filter((edge) => edge.staged.branchId === preferredBranchId);
1866
1889
  const candidates = preferred.length > 0 ? preferred : edges;
1867
- let survivor = candidates[0];
1890
+ let survivor = requireDefined(candidates[0]);
1868
1891
  for (const candidate of candidates.slice(1)) {
1869
1892
  if (candidate.staged.id < survivor.staged.id) {
1870
1893
  survivor = candidate;
@@ -1889,7 +1912,7 @@ function unionEdgeProps(survivorId, kind, survivor, edges, context, branchRank,
1889
1912
  if (values.length === 0) {
1890
1913
  continue;
1891
1914
  }
1892
- const survivorValue = property in survivor.staged.props ? survivor.staged.props[property] : values[0].value;
1915
+ const survivorValue = property in survivor.staged.props ? survivor.staged.props[property] : requireDefined(values[0]).value;
1893
1916
  const canonicalValue = values.find((value2) => value2.branchId === preferredBranchId)?.value ?? survivorValue;
1894
1917
  const reportedValues = preferredBranchId === void 0 ? values : values.filter((value2) => value2.branchId !== preferredBranchId);
1895
1918
  const { value, conflict } = resolvePropertyUnion(
@@ -1955,10 +1978,10 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
1955
1978
  (left, right) => compareStrings(left, right)
1956
1979
  );
1957
1980
  for (const group of sortedGroups) {
1958
- const dedupeKeys = [...dedupeKeyByGroup.get(group)];
1981
+ const dedupeKeys = [...requireDefined(dedupeKeyByGroup.get(group))];
1959
1982
  const groupEdges = [];
1960
1983
  for (const key of dedupeKeys) {
1961
- for (const edge of liveByDedupeKey.get(key)) {
1984
+ for (const edge of requireDefined(liveByDedupeKey.get(key))) {
1962
1985
  groupEdges.push(edge);
1963
1986
  }
1964
1987
  }
@@ -2167,7 +2190,8 @@ function buildProvenanceGraph(targetGraphId) {
2167
2190
  edges: {}
2168
2191
  });
2169
2192
  }
2170
- async function openProvenanceStore(backend, targetGraphId) {
2193
+ async function openProvenanceStore(...args) {
2194
+ const [backend, targetGraphId] = args.length === 1 ? [storeBackend(args[0]), args[0].graphId] : args;
2171
2195
  const [store] = await createStoreWithSchema(
2172
2196
  buildProvenanceGraph(targetGraphId),
2173
2197
  backend
@@ -2262,7 +2286,12 @@ function windowedPairs(members, config) {
2262
2286
  for (let index = 0; index < keyed.length; index += 1) {
2263
2287
  const last = Math.min(index + config.window, keyed.length - 1);
2264
2288
  for (let index_ = index + 1; index_ <= last; index_ += 1) {
2265
- pairs.push(orderEndpoints(keyed[index].node, keyed[index_].node));
2289
+ pairs.push(
2290
+ orderEndpoints(
2291
+ requireDefined(keyed[index]).node,
2292
+ requireDefined(keyed[index_]).node
2293
+ )
2294
+ );
2266
2295
  }
2267
2296
  }
2268
2297
  return pairs;
@@ -2280,7 +2309,12 @@ function pairsFromBlocks(blocks, keyless) {
2280
2309
  }
2281
2310
  for (let index = 0; index < members.length; index += 1) {
2282
2311
  for (let index_ = index + 1; index_ < members.length; index_ += 1) {
2283
- pairs.push(orderEndpoints(members[index], members[index_]));
2312
+ pairs.push(
2313
+ orderEndpoints(
2314
+ requireDefined(members[index]),
2315
+ requireDefined(members[index_])
2316
+ )
2317
+ );
2284
2318
  }
2285
2319
  }
2286
2320
  }
@@ -2295,7 +2329,10 @@ function forcedEdgesFromBlocks(blocks) {
2295
2329
  const members = sortMembersById(blocks.get(bucketKey) ?? []);
2296
2330
  for (let index = 0; index < members.length; index += 1) {
2297
2331
  for (let index_ = index + 1; index_ < members.length; index_ += 1) {
2298
- const { a, b } = orderEndpoints(members[index], members[index_]);
2332
+ const { a, b } = orderEndpoints(
2333
+ requireDefined(members[index]),
2334
+ requireDefined(members[index_])
2335
+ );
2299
2336
  edges.push({ a, b, score: FORCED_MATCH_SCORE });
2300
2337
  }
2301
2338
  }
@@ -2328,8 +2365,8 @@ function ontologyRetypeEdges(stagedIdentities, isRetypeCompatible) {
2328
2365
  }
2329
2366
  for (let index = 1; index < members.length; index += 1) {
2330
2367
  edges.push({
2331
- a: members[0],
2332
- b: members[index],
2368
+ a: requireDefined(members[0]),
2369
+ b: requireDefined(members[index]),
2333
2370
  score: FORCED_MATCH_SCORE
2334
2371
  });
2335
2372
  }
@@ -2345,10 +2382,13 @@ function unionByCompatibility(identities, isRetypeCompatible) {
2345
2382
  for (let index = 0; index < identities.length; index += 1) {
2346
2383
  for (let index_ = index + 1; index_ < identities.length; index_ += 1) {
2347
2384
  if (isRetypeCompatible([
2348
- kindOf(identities[index]),
2349
- kindOf(identities[index_])
2385
+ kindOf(requireDefined(identities[index])),
2386
+ kindOf(requireDefined(identities[index_]))
2350
2387
  ])) {
2351
- forest.union(identities[index], identities[index_]);
2388
+ forest.union(
2389
+ requireDefined(identities[index]),
2390
+ requireDefined(identities[index_])
2391
+ );
2352
2392
  }
2353
2393
  }
2354
2394
  }
@@ -2359,7 +2399,7 @@ function unionByCompatibility(identities, isRetypeCompatible) {
2359
2399
  function groupsOf(identities, representativeOf) {
2360
2400
  const byRoot = /* @__PURE__ */ new Map();
2361
2401
  for (const identity of identities) {
2362
- const root = representativeOf.get(identity);
2402
+ const root = requireDefined(representativeOf.get(identity));
2363
2403
  const bucket = byRoot.get(root);
2364
2404
  if (bucket === void 0) {
2365
2405
  byRoot.set(root, [identity]);
@@ -2545,7 +2585,7 @@ function groupByKind(items) {
2545
2585
  )) {
2546
2586
  ordered.set(
2547
2587
  kind,
2548
- [...buckets.get(kind)].sort(
2588
+ [...requireDefined(buckets.get(kind))].sort(
2549
2589
  (left, right) => compareByIdThenBranch(left, right)
2550
2590
  )
2551
2591
  );
@@ -2674,7 +2714,9 @@ function mostSpecificCommonKind(closure, kinds) {
2674
2714
  if (qualifiers.length === 0) {
2675
2715
  return void 0;
2676
2716
  }
2677
- return [...qualifiers].sort((left, right) => compareStrings(left, right))[0];
2717
+ return requireDefined(
2718
+ [...qualifiers].sort((left, right) => compareStrings(left, right))[0]
2719
+ );
2678
2720
  }
2679
2721
  function reconcileTypes(clusters, closure, mode) {
2680
2722
  if (mode === "off") {
@@ -2779,7 +2821,7 @@ async function precomputeEmbeddings(byKind, resolve, embedder) {
2779
2821
  );
2780
2822
  }
2781
2823
  for (const [index, text] of orderedTexts.entries()) {
2782
- lookup.set(text, vectors[index]);
2824
+ lookup.set(text, requireDefined(vectors[index]));
2783
2825
  }
2784
2826
  return lookup;
2785
2827
  }
@@ -2816,7 +2858,7 @@ async function embedMissingPairTexts(base, pairs, strategy, embedder) {
2816
2858
  }
2817
2859
  const augmented = new Map(existing);
2818
2860
  for (const [index, text] of orderedTexts.entries()) {
2819
- augmented.set(text, vectors[index]);
2861
+ augmented.set(text, requireDefined(vectors[index]));
2820
2862
  }
2821
2863
  return augmented;
2822
2864
  }
@@ -3265,8 +3307,14 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
3265
3307
  dropped,
3266
3308
  baseAmbiguities: baseAmbiguities.sort(
3267
3309
  (left, right) => compareMergeKeys(
3268
- mergeKey(left.baseIds[0].kind, left.baseIds[0].id),
3269
- mergeKey(right.baseIds[0].kind, right.baseIds[0].id)
3310
+ mergeKey(
3311
+ requireDefined(left.baseIds[0]).kind,
3312
+ requireDefined(left.baseIds[0]).id
3313
+ ),
3314
+ mergeKey(
3315
+ requireDefined(right.baseIds[0]).kind,
3316
+ requireDefined(right.baseIds[0]).id
3317
+ )
3270
3318
  )
3271
3319
  ),
3272
3320
  provenanceRecords,
@@ -3373,7 +3421,7 @@ async function applyMergePlan(plan, nodesApi, edgesApi) {
3373
3421
  return { nodes: committedNodeIds.size, edges: committedEdges };
3374
3422
  }
3375
3423
  async function commitPlan(target, plan, expectedBaseVersion) {
3376
- if (!target.backend.capabilities.transactions) {
3424
+ if (!storeBackend(target).capabilities.transactions) {
3377
3425
  throw new MergeError(
3378
3426
  "merge() requires a transaction-capable target backend. The merged plan (canonical upserts, soft-deletes, edge upserts) must commit atomically; a non-transactional fallback would leave a partially-merged graph on a mid-commit failure. (mergeIncremental() enforces the same requirement.)",
3379
3427
  { details: { capability: "transactions" } }
@@ -3382,7 +3430,11 @@ async function commitPlan(target, plan, expectedBaseVersion) {
3382
3430
  return withTxConflictRetry(
3383
3431
  () => target.transaction(async (tx) => {
3384
3432
  if (expectedBaseVersion !== void 0) {
3385
- await assertTargetUnchanged(tx.backend, target, expectedBaseVersion);
3433
+ await assertTargetUnchanged(
3434
+ transactionBackend(tx),
3435
+ target,
3436
+ expectedBaseVersion
3437
+ );
3386
3438
  }
3387
3439
  return applyMergePlan(
3388
3440
  plan,
@@ -3543,7 +3595,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
3543
3595
  options.embedder
3544
3596
  );
3545
3597
  const ctx = {
3546
- backend: store.backend,
3598
+ backend: storeBackend(store),
3547
3599
  ...embeddings === void 0 ? {} : { embeddings }
3548
3600
  };
3549
3601
  const candidates = await generateAllCandidates(
@@ -3585,10 +3637,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
3585
3637
  let provenancePersisted;
3586
3638
  if (options.persistProvenance) {
3587
3639
  try {
3588
- const provenanceStore = await openProvenanceStore(
3589
- target.backend,
3590
- target.graphId
3591
- );
3640
+ const provenanceStore = await openProvenanceStore(target);
3592
3641
  const count = await persistProvenanceRecords(
3593
3642
  provenanceStore,
3594
3643
  target.graphId,
@@ -3906,12 +3955,12 @@ async function validateIncrementalEdgeWrites(target, edgesApi, plan) {
3906
3955
  );
3907
3956
  }
3908
3957
  throw new MergeError(
3909
- `mergeIncremental() would overwrite committed edge "${id}" (kind "${row.kind}") with a different-kind edge "${plannedKindById.get(id)}" of the same id.`,
3958
+ `mergeIncremental() would overwrite committed edge "${id}" (kind "${row.kind}") with a different-kind edge "${requireDefined(plannedKindById.get(id))}" of the same id.`,
3910
3959
  {
3911
3960
  details: {
3912
3961
  id,
3913
3962
  committedKind: row.kind,
3914
- plannedKind: plannedKindById.get(id)
3963
+ plannedKind: requireDefined(plannedKindById.get(id))
3915
3964
  }
3916
3965
  }
3917
3966
  );
@@ -4031,7 +4080,7 @@ async function assertInheritedUnchanged(args) {
4031
4080
  for (const [kind, ids] of idsByKind) {
4032
4081
  const rows = await args.fetchRows(kind, ids);
4033
4082
  for (const [index, id] of ids.entries()) {
4034
- const expected = args.expected.get(mergeKey(kind, id));
4083
+ const expected = requireDefined(args.expected.get(mergeKey(kind, id)));
4035
4084
  const current = args.deriveValue(rows[index]);
4036
4085
  if (current === expected) {
4037
4086
  continue;
@@ -4102,7 +4151,7 @@ async function assertInheritedEdgesUnchanged(edgesApi, guard, plan) {
4102
4151
  });
4103
4152
  }
4104
4153
  async function commitIncrementalPlan(target, plan, guard) {
4105
- if (!target.backend.capabilities.transactions) {
4154
+ if (!storeBackend(target).capabilities.transactions) {
4106
4155
  throw new MergeError(
4107
4156
  "mergeIncremental() requires a transaction-capable target backend. Incremental writes must preflight existing rows and commit atomically; non-transactional fallback would allow partial graph writes.",
4108
4157
  { details: { capability: "transactions" } }
@@ -4111,7 +4160,7 @@ async function commitIncrementalPlan(target, plan, guard) {
4111
4160
  return withTxConflictRetry(
4112
4161
  () => target.transaction(async (tx) => {
4113
4162
  if (target.revisionTrackingEnabled) {
4114
- await lockRecordedGraphWrite(tx.backend, target.graphId);
4163
+ await lockRecordedGraphWrite(transactionBackend(tx), target.graphId);
4115
4164
  }
4116
4165
  const nodesApi = tx.nodes;
4117
4166
  const edgesApi = tx.edges;