@nicia-ai/typegraph 0.44.0 → 0.45.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 (265) hide show
  1. package/dist/backend/drizzle/indexes.cjs +7 -7
  2. package/dist/backend/drizzle/indexes.d.cts +1 -1
  3. package/dist/backend/drizzle/indexes.d.ts +1 -1
  4. package/dist/backend/drizzle/indexes.js +3 -3
  5. package/dist/backend/index.cjs +37 -37
  6. package/dist/backend/index.d.cts +3 -3
  7. package/dist/backend/index.d.ts +3 -3
  8. package/dist/backend/index.js +6 -6
  9. package/dist/backend/postgres/index.cjs +23 -23
  10. package/dist/backend/postgres/index.d.cts +6 -6
  11. package/dist/backend/postgres/index.d.ts +6 -6
  12. package/dist/backend/postgres/index.js +10 -10
  13. package/dist/backend/postgres/pglite-store.cjs +24 -25
  14. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  15. package/dist/backend/postgres/pglite-store.d.cts +7 -7
  16. package/dist/backend/postgres/pglite-store.d.ts +7 -7
  17. package/dist/backend/postgres/pglite-store.js +20 -21
  18. package/dist/backend/postgres/pglite-store.js.map +1 -1
  19. package/dist/backend/postgres/pglite.cjs +12 -12
  20. package/dist/backend/postgres/pglite.d.cts +3 -3
  21. package/dist/backend/postgres/pglite.d.ts +3 -3
  22. package/dist/backend/postgres/pglite.js +11 -11
  23. package/dist/backend/sqlite/index.cjs +21 -21
  24. package/dist/backend/sqlite/index.d.cts +6 -6
  25. package/dist/backend/sqlite/index.d.ts +6 -6
  26. package/dist/backend/sqlite/index.js +9 -9
  27. package/dist/backend/sqlite/libsql.cjs +14 -14
  28. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  29. package/dist/backend/sqlite/libsql.d.cts +3 -3
  30. package/dist/backend/sqlite/libsql.d.ts +3 -3
  31. package/dist/backend/sqlite/libsql.js +10 -10
  32. package/dist/backend/sqlite/libsql.js.map +1 -1
  33. package/dist/backend/sqlite/local-store.cjs +25 -26
  34. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  35. package/dist/backend/sqlite/local-store.d.cts +8 -8
  36. package/dist/backend/sqlite/local-store.d.ts +8 -8
  37. package/dist/backend/sqlite/local-store.js +21 -22
  38. package/dist/backend/sqlite/local-store.js.map +1 -1
  39. package/dist/backend/sqlite/local.cjs +13 -13
  40. package/dist/backend/sqlite/local.d.cts +3 -3
  41. package/dist/backend/sqlite/local.d.ts +3 -3
  42. package/dist/backend/sqlite/local.js +11 -11
  43. package/dist/{chunk-TVLKA4AY.js → chunk-42PYUGLS.js} +57 -3
  44. package/dist/chunk-42PYUGLS.js.map +1 -0
  45. package/dist/{chunk-IJTLXNGJ.js → chunk-4GUBTVPV.js} +3 -4
  46. package/dist/chunk-4GUBTVPV.js.map +1 -0
  47. package/dist/{chunk-63KCKSSH.js → chunk-4GUTQPVO.js} +33 -9
  48. package/dist/chunk-4GUTQPVO.js.map +1 -0
  49. package/dist/{chunk-FGO5JFVJ.cjs → chunk-4MEWSUVM.cjs} +10 -10
  50. package/dist/chunk-4MEWSUVM.cjs.map +1 -0
  51. package/dist/{chunk-FMGEZBAQ.js → chunk-4QIKLIGG.js} +15 -3
  52. package/dist/chunk-4QIKLIGG.js.map +1 -0
  53. package/dist/{chunk-FMMIX6N4.js → chunk-55ITBQJI.js} +2 -2
  54. package/dist/chunk-55ITBQJI.js.map +1 -0
  55. package/dist/{chunk-TCRIQMBU.js → chunk-5EKPX6QU.js} +4 -4
  56. package/dist/{chunk-TCRIQMBU.js.map → chunk-5EKPX6QU.js.map} +1 -1
  57. package/dist/{chunk-GFRGG2US.cjs → chunk-5GAONX5G.cjs} +7 -7
  58. package/dist/{chunk-GFRGG2US.cjs.map → chunk-5GAONX5G.cjs.map} +1 -1
  59. package/dist/{chunk-ALFUGRYB.cjs → chunk-6RYPD3NJ.cjs} +29 -29
  60. package/dist/{chunk-ALFUGRYB.cjs.map → chunk-6RYPD3NJ.cjs.map} +1 -1
  61. package/dist/{chunk-QGKILWGZ.cjs → chunk-7PF2L3H6.cjs} +4 -4
  62. package/dist/{chunk-QGKILWGZ.cjs.map → chunk-7PF2L3H6.cjs.map} +1 -1
  63. package/dist/chunk-B3F2D3SP.cjs +12 -0
  64. package/dist/{chunk-EPTSMFH7.cjs.map → chunk-B3F2D3SP.cjs.map} +1 -1
  65. package/dist/{chunk-7G32LIQM.js → chunk-BGYJW37L.js} +5 -5
  66. package/dist/{chunk-7G32LIQM.js.map → chunk-BGYJW37L.js.map} +1 -1
  67. package/dist/{chunk-EE7N5XXQ.cjs → chunk-BNS75YNF.cjs} +9 -10
  68. package/dist/chunk-BNS75YNF.cjs.map +1 -0
  69. package/dist/{chunk-VITTKBWF.js → chunk-CBKG6HEP.js} +5 -5
  70. package/dist/{chunk-VITTKBWF.js.map → chunk-CBKG6HEP.js.map} +1 -1
  71. package/dist/{chunk-A4PBRX4C.cjs → chunk-D54WH24V.cjs} +57 -2
  72. package/dist/chunk-D54WH24V.cjs.map +1 -0
  73. package/dist/{chunk-MCHP7RHZ.cjs → chunk-D56XG4EI.cjs} +26 -14
  74. package/dist/chunk-D56XG4EI.cjs.map +1 -0
  75. package/dist/{chunk-SQRD2CYF.js → chunk-DXEEHSGN.js} +293 -45
  76. package/dist/chunk-DXEEHSGN.js.map +1 -0
  77. package/dist/{chunk-GWEDD3DH.js → chunk-EFEOOCJ3.js} +4 -4
  78. package/dist/{chunk-GWEDD3DH.js.map → chunk-EFEOOCJ3.js.map} +1 -1
  79. package/dist/{chunk-3PRKZW6D.cjs → chunk-EKFUG4G7.cjs} +2 -2
  80. package/dist/chunk-EKFUG4G7.cjs.map +1 -0
  81. package/dist/{chunk-HJH3RMXG.cjs → chunk-F4NHQHEZ.cjs} +4 -4
  82. package/dist/{chunk-HJH3RMXG.cjs.map → chunk-F4NHQHEZ.cjs.map} +1 -1
  83. package/dist/{chunk-46GDII45.js → chunk-FL5UQRES.js} +3 -3
  84. package/dist/{chunk-46GDII45.js.map → chunk-FL5UQRES.js.map} +1 -1
  85. package/dist/{chunk-TFMVL4QH.js → chunk-FLEQ2HBK.js} +3 -3
  86. package/dist/{chunk-TFMVL4QH.js.map → chunk-FLEQ2HBK.js.map} +1 -1
  87. package/dist/{chunk-BEFM74L2.js → chunk-FQ7ZPOTZ.js} +6 -6
  88. package/dist/{chunk-BEFM74L2.js.map → chunk-FQ7ZPOTZ.js.map} +1 -1
  89. package/dist/{chunk-ST3LPB2V.cjs → chunk-H7VE3FL4.cjs} +318 -70
  90. package/dist/chunk-H7VE3FL4.cjs.map +1 -0
  91. package/dist/{chunk-BCP7LLOY.js → chunk-ID4WXTKL.js} +367 -41
  92. package/dist/{chunk-BCP7LLOY.js.map → chunk-ID4WXTKL.js.map} +1 -1
  93. package/dist/{chunk-EFELJVLA.js → chunk-ISLPNELU.js} +15 -3
  94. package/dist/chunk-ISLPNELU.js.map +1 -0
  95. package/dist/{chunk-A2I2XO52.cjs → chunk-IX64T5OL.cjs} +4 -4
  96. package/dist/{chunk-A2I2XO52.cjs.map → chunk-IX64T5OL.cjs.map} +1 -1
  97. package/dist/{chunk-QYWINYEA.cjs → chunk-J2ICGNHO.cjs} +5 -6
  98. package/dist/chunk-J2ICGNHO.cjs.map +1 -0
  99. package/dist/{chunk-7V2FGGI2.cjs → chunk-J7LXTUTP.cjs} +54 -12
  100. package/dist/chunk-J7LXTUTP.cjs.map +1 -0
  101. package/dist/{chunk-WBUFJ7BS.cjs → chunk-JQXSZHF2.cjs} +12 -2
  102. package/dist/chunk-JQXSZHF2.cjs.map +1 -0
  103. package/dist/{chunk-OVUUTCPJ.cjs → chunk-JXUTCSXX.cjs} +28 -2
  104. package/dist/chunk-JXUTCSXX.cjs.map +1 -0
  105. package/dist/{chunk-66UVLHQA.cjs → chunk-KMXWZLQX.cjs} +14 -14
  106. package/dist/{chunk-66UVLHQA.cjs.map → chunk-KMXWZLQX.cjs.map} +1 -1
  107. package/dist/{chunk-STQ3BSED.cjs → chunk-NAAMUYMS.cjs} +23 -11
  108. package/dist/chunk-NAAMUYMS.cjs.map +1 -0
  109. package/dist/{chunk-NN3QSOVS.cjs → chunk-OOA273IJ.cjs} +14 -14
  110. package/dist/{chunk-NN3QSOVS.cjs.map → chunk-OOA273IJ.cjs.map} +1 -1
  111. package/dist/{chunk-OSZPLZIV.cjs → chunk-P7GTYOLB.cjs} +130 -106
  112. package/dist/chunk-P7GTYOLB.cjs.map +1 -0
  113. package/dist/{chunk-K3BUWSFR.js → chunk-PVUI6KGR.js} +28 -2
  114. package/dist/chunk-PVUI6KGR.js.map +1 -0
  115. package/dist/{chunk-SBPC5IP3.js → chunk-Q6EDCUXV.js} +242 -10
  116. package/dist/chunk-Q6EDCUXV.js.map +1 -0
  117. package/dist/{chunk-2BIG7U6E.cjs → chunk-QC4MCOFV.cjs} +5 -5
  118. package/dist/{chunk-2BIG7U6E.cjs.map → chunk-QC4MCOFV.cjs.map} +1 -1
  119. package/dist/{chunk-JRP3VGHS.js → chunk-QLUXRWKL.js} +3 -3
  120. package/dist/{chunk-JRP3VGHS.js.map → chunk-QLUXRWKL.js.map} +1 -1
  121. package/dist/{chunk-IIT5K7SK.cjs → chunk-QR24DJDF.cjs} +6 -6
  122. package/dist/{chunk-IIT5K7SK.cjs.map → chunk-QR24DJDF.cjs.map} +1 -1
  123. package/dist/{chunk-HOIFFY4M.js → chunk-QRNYDV5Z.js} +48 -21
  124. package/dist/chunk-QRNYDV5Z.js.map +1 -0
  125. package/dist/{chunk-FRHHDHKH.js → chunk-RFRM3Q5K.js} +15 -3
  126. package/dist/chunk-RFRM3Q5K.js.map +1 -0
  127. package/dist/{chunk-ATLN63JA.js → chunk-RUQS6M7G.js} +5 -5
  128. package/dist/chunk-RUQS6M7G.js.map +1 -0
  129. package/dist/{chunk-XMYJY7NI.js → chunk-S3ZRKJHY.js} +3 -3
  130. package/dist/{chunk-XMYJY7NI.js.map → chunk-S3ZRKJHY.js.map} +1 -1
  131. package/dist/{chunk-FSXTPBRN.js → chunk-TKORQCG4.js} +49 -7
  132. package/dist/chunk-TKORQCG4.js.map +1 -0
  133. package/dist/{chunk-2Y4IFKW7.js → chunk-TKP5T34P.js} +3 -4
  134. package/dist/chunk-TKP5T34P.js.map +1 -0
  135. package/dist/{chunk-NCX65HBY.cjs → chunk-UCQ3BFSY.cjs} +301 -68
  136. package/dist/chunk-UCQ3BFSY.cjs.map +1 -0
  137. package/dist/{chunk-B75XRV3O.js → chunk-V34A6R5V.js} +12 -3
  138. package/dist/chunk-V34A6R5V.js.map +1 -0
  139. package/dist/{chunk-BNUFUFAU.js → chunk-VTN3C3CH.js} +6 -6
  140. package/dist/chunk-VTN3C3CH.js.map +1 -0
  141. package/dist/{chunk-5MUSU4ZP.cjs → chunk-VVQM4CZD.cjs} +12 -12
  142. package/dist/chunk-VVQM4CZD.cjs.map +1 -0
  143. package/dist/{chunk-IIMQJYAM.js → chunk-WDAVPX46.js} +3 -3
  144. package/dist/{chunk-IIMQJYAM.js.map → chunk-WDAVPX46.js.map} +1 -1
  145. package/dist/{chunk-YNULOIR5.cjs → chunk-WDBXJOU5.cjs} +28 -16
  146. package/dist/chunk-WDBXJOU5.cjs.map +1 -0
  147. package/dist/{chunk-PAW2XUZN.js → chunk-WUFASQUO.js} +3 -3
  148. package/dist/{chunk-PAW2XUZN.js.map → chunk-WUFASQUO.js.map} +1 -1
  149. package/dist/{chunk-PDGEXGS6.cjs → chunk-YDWLUT5V.cjs} +136 -109
  150. package/dist/chunk-YDWLUT5V.cjs.map +1 -0
  151. package/dist/{chunk-PHXITZE4.js → chunk-YMTXMPV6.js} +3 -3
  152. package/dist/{chunk-PHXITZE4.js.map → chunk-YMTXMPV6.js.map} +1 -1
  153. package/dist/{chunk-XR4YZFKW.cjs → chunk-YOALGKRE.cjs} +690 -364
  154. package/dist/chunk-YOALGKRE.cjs.map +1 -0
  155. package/dist/{chunk-6JZUSDY2.cjs → chunk-Z3WO6MND.cjs} +27 -27
  156. package/dist/{chunk-6JZUSDY2.cjs.map → chunk-Z3WO6MND.cjs.map} +1 -1
  157. package/dist/{chunk-2VLBGQBY.cjs → chunk-ZI6VQSZA.cjs} +37 -37
  158. package/dist/{chunk-2VLBGQBY.cjs.map → chunk-ZI6VQSZA.cjs.map} +1 -1
  159. package/dist/core/index.cjs +10 -11
  160. package/dist/core/index.d.cts +5 -5
  161. package/dist/core/index.d.ts +5 -5
  162. package/dist/core/index.js +3 -4
  163. package/dist/{ddl-eWg7hx6R.d.cts → ddl-BG4J805L.d.cts} +3 -3
  164. package/dist/{ddl-D5369kOY.d.ts → ddl-CgiS9QLj.d.ts} +3 -3
  165. package/dist/{define-graph-SvYXOl78.d.ts → define-graph-BGrJahvp.d.ts} +1 -1
  166. package/dist/{define-graph-DVF-oN1i.d.cts → define-graph-alREY2wj.d.cts} +1 -1
  167. package/dist/graph-extension/index.cjs +18 -19
  168. package/dist/graph-extension/index.d.cts +4 -4
  169. package/dist/graph-extension/index.d.ts +4 -4
  170. package/dist/graph-extension/index.js +3 -4
  171. package/dist/graph-merge/index.cjs +89 -90
  172. package/dist/graph-merge/index.cjs.map +1 -1
  173. package/dist/graph-merge/index.d.cts +9 -9
  174. package/dist/graph-merge/index.d.ts +9 -9
  175. package/dist/graph-merge/index.js +16 -17
  176. package/dist/graph-merge/index.js.map +1 -1
  177. package/dist/{index-By89Sezh.d.ts → index-BBxZCUdu.d.ts} +2 -2
  178. package/dist/{index-DcQ3Sxs-.d.cts → index-C3y_98iN.d.cts} +2 -2
  179. package/dist/index.cjs +124 -125
  180. package/dist/index.cjs.map +1 -1
  181. package/dist/index.d.cts +13 -13
  182. package/dist/index.d.ts +13 -13
  183. package/dist/index.js +23 -24
  184. package/dist/index.js.map +1 -1
  185. package/dist/indexes/index.cjs +11 -11
  186. package/dist/indexes/index.d.cts +4 -4
  187. package/dist/indexes/index.d.ts +4 -4
  188. package/dist/indexes/index.js +4 -4
  189. package/dist/interchange/index.cjs +27 -26
  190. package/dist/interchange/index.cjs.map +1 -1
  191. package/dist/interchange/index.d.cts +7 -7
  192. package/dist/interchange/index.d.ts +7 -7
  193. package/dist/interchange/index.js +8 -7
  194. package/dist/interchange/index.js.map +1 -1
  195. package/dist/{manager-Cn0NFIhN.d.cts → manager-KS7CGQQT.d.cts} +3 -3
  196. package/dist/{manager-B0KjKE93.d.ts → manager-YoLEfcc1.d.ts} +3 -3
  197. package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-Bhhyb1B3.d.ts} +1 -1
  198. package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-OHRWypW6.d.cts} +1 -1
  199. package/dist/{postgres-DaEWvN4x.d.cts → postgres-DpkW3R5Y.d.cts} +1 -1
  200. package/dist/{postgres-u0a0HN2D.d.ts → postgres-DwqyIniy.d.ts} +1 -1
  201. package/dist/profiler/index.d.cts +10 -10
  202. package/dist/profiler/index.d.ts +10 -10
  203. package/dist/provenance/index.cjs +15 -15
  204. package/dist/provenance/index.cjs.map +1 -1
  205. package/dist/provenance/index.d.cts +7 -7
  206. package/dist/provenance/index.d.ts +7 -7
  207. package/dist/provenance/index.js +3 -3
  208. package/dist/provenance/index.js.map +1 -1
  209. package/dist/schema/index.cjs +30 -31
  210. package/dist/schema/index.d.cts +7 -7
  211. package/dist/schema/index.d.ts +7 -7
  212. package/dist/schema/index.js +8 -9
  213. package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIZL8Hyw.d.cts} +2 -2
  214. package/dist/{searchable-CnYEancP.d.ts → searchable-DLWEfC4a.d.ts} +2 -2
  215. package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DY0WODUK.d.cts} +1 -1
  216. package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-L-VIRzqA.d.ts} +1 -1
  217. package/dist/{store-view-Bvdku0Ht.d.ts → store-view-66p92IPi.d.ts} +1887 -1811
  218. package/dist/{store-view-w-md0nQ4.d.cts → store-view-A85FFRnk.d.cts} +1887 -1811
  219. package/dist/{temporal-BCORwUau.d.cts → temporal-BNbjXqer.d.cts} +1 -1
  220. package/dist/{temporal--x9T8K4S.d.ts → temporal-Bob6Nfbp.d.ts} +1 -1
  221. package/dist/{types-Cjvkj0jA.d.ts → types-Ch9a0Dx6.d.cts} +141 -17
  222. package/dist/{types-Cjvkj0jA.d.cts → types-Ch9a0Dx6.d.ts} +141 -17
  223. package/dist/{types-COODtTJU.d.ts → types-ClCzT-dT.d.ts} +1 -1
  224. package/dist/{types-6-WJmSD4.d.cts → types-DeORZhxn.d.cts} +1 -1
  225. package/dist/{where-CUQmCR6d.d.cts → where-DPw52ksb.d.cts} +1 -1
  226. package/dist/{where-5xVawAwL.d.ts → where-kWUZPvEA.d.ts} +1 -1
  227. package/package.json +1 -1
  228. package/dist/chunk-2WDD2NO3.js +0 -59
  229. package/dist/chunk-2WDD2NO3.js.map +0 -1
  230. package/dist/chunk-2Y4IFKW7.js.map +0 -1
  231. package/dist/chunk-3PRKZW6D.cjs.map +0 -1
  232. package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
  233. package/dist/chunk-63KCKSSH.js.map +0 -1
  234. package/dist/chunk-7V2FGGI2.cjs.map +0 -1
  235. package/dist/chunk-A4PBRX4C.cjs.map +0 -1
  236. package/dist/chunk-ATLN63JA.js.map +0 -1
  237. package/dist/chunk-B75XRV3O.js.map +0 -1
  238. package/dist/chunk-BNUFUFAU.js.map +0 -1
  239. package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
  240. package/dist/chunk-EFELJVLA.js.map +0 -1
  241. package/dist/chunk-EPTSMFH7.cjs +0 -12
  242. package/dist/chunk-FGO5JFVJ.cjs.map +0 -1
  243. package/dist/chunk-FMGEZBAQ.js.map +0 -1
  244. package/dist/chunk-FMMIX6N4.js.map +0 -1
  245. package/dist/chunk-FRHHDHKH.js.map +0 -1
  246. package/dist/chunk-FSXTPBRN.js.map +0 -1
  247. package/dist/chunk-HOHAJ2NR.cjs +0 -61
  248. package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
  249. package/dist/chunk-HOIFFY4M.js.map +0 -1
  250. package/dist/chunk-IJTLXNGJ.js.map +0 -1
  251. package/dist/chunk-K3BUWSFR.js.map +0 -1
  252. package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
  253. package/dist/chunk-NCX65HBY.cjs.map +0 -1
  254. package/dist/chunk-OSZPLZIV.cjs.map +0 -1
  255. package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
  256. package/dist/chunk-PDGEXGS6.cjs.map +0 -1
  257. package/dist/chunk-QYWINYEA.cjs.map +0 -1
  258. package/dist/chunk-SBPC5IP3.js.map +0 -1
  259. package/dist/chunk-SQRD2CYF.js.map +0 -1
  260. package/dist/chunk-ST3LPB2V.cjs.map +0 -1
  261. package/dist/chunk-STQ3BSED.cjs.map +0 -1
  262. package/dist/chunk-TVLKA4AY.js.map +0 -1
  263. package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
  264. package/dist/chunk-XR4YZFKW.cjs.map +0 -1
  265. package/dist/chunk-YNULOIR5.cjs.map +0 -1
@@ -1,30 +1,30 @@
1
- import { createEdgeRowMapper, createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, POSTGRES_ROW_MAPPER_CONFIG } from './chunk-PHXITZE4.js';
2
- import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeUpsertUpdate, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, lockSchemaVersionForStoreWrite, runInWriteTransaction, checkCardinalityConstraint, runHookedWriteOperation, rowToNodeMeta, rowToEdgeMeta } from './chunk-SBPC5IP3.js';
3
- import { isParameterRef, resolveParameterValueType, fieldRef, buildFieldBuilderForTypeInfo, stringField, createFulltextAccessor, storeRuntime, CURRENT_READ_INSTANT_PLACEHOLDER, withPinnedReadInstant, STORE_RUNTIME, assertRevisionTrackableBackend, createRecordedBackend, readRecordedClock, ensureRevisionOrigin, TRANSACTION_RUNTIME, withRecordedFlushObserver, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, createRecordedTransactionScope, lockRecordedGraphWrite, createGraphBackendProjection, generateId, assertCurrentRecordedSchema, baseField, objectField, arrayField, dateField, numberField, computeFulltextContent, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, advanceRevisionClock, runInsertBatch, edgeInsertDispatch, runInsertBatchReturning, projectBackendMembers, sqlValueList, getEmbeddingFields, getNodeRowsByIds, getEdgeRowsByIds, compileKindFilter, currentReadInstant, compileTemporalFilter, validateEdgeEndpoints, closeRecordedHardDeletedKind, buildPredicateIndex, compileFieldValue, recordedBindParamBudget, extractVectorSimilarityPredicates, extractFulltextMatchPredicates, currentReadInstantFor, extractTemporalOptions, compilePredicateExpression, getPredicatesForAlias, getFieldPointer, getNodeKindsForAlias, getHybridTargetAlias, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess, compilePredicateClauses } from './chunk-FSXTPBRN.js';
1
+ import { createEdgeRowMapper, createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, POSTGRES_ROW_MAPPER_CONFIG } from './chunk-YMTXMPV6.js';
2
+ import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeUpsertUpdate, executeNodeUpdateWhere, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, lockSchemaVersionForStoreWrite, runInWriteTransaction, checkCardinalityConstraint, runHookedWriteOperation, rowToNodeMeta, rowToEdgeMeta } from './chunk-Q6EDCUXV.js';
3
+ import { isParameterRef, resolveParameterValueType, fieldRef, buildFieldBuilderForTypeInfo, stringField, createFulltextAccessor, storeRuntime, CURRENT_READ_INSTANT_PLACEHOLDER, withPinnedReadInstant, STORE_RUNTIME, assertRevisionTrackableBackend, createRecordedBackend, readRecordedClock, ensureRevisionOrigin, TRANSACTION_RUNTIME, withRecordedFlushObserver, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, createRecordedTransactionScope, lockRecordedGraphWrite, createGraphBackendProjection, generateId, assertCurrentRecordedSchema, baseField, objectField, arrayField, dateField, numberField, computeFulltextContent, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, advanceRevisionClock, runInsertBatch, edgeInsertDispatch, runInsertBatchReturning, projectBackendMembers, sqlValueList, getEmbeddingFields, getNodeRowsByIds, getEdgeRowsByIds, compileKindFilter, currentReadInstant, compileTemporalFilter, validateEdgeEndpoints, closeRecordedHardDeletedKind, buildPredicateIndex, compileFieldValue, recordedBindParamBudget, extractVectorSimilarityPredicates, extractFulltextMatchPredicates, currentReadInstantFor, extractTemporalOptions, compilePredicateExpression, getPredicatesForAlias, getFieldPointer, getNodeKindsForAlias, getHybridTargetAlias, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess, compilePredicateClauses } from './chunk-TKORQCG4.js';
4
4
  import { chunk, groupBy } from './chunk-35S6P5ZU.js';
5
5
  import { DEFAULT_SQL_SCHEMA, requireSqlSchema, recordedReadSchemaFor, createSqlSchema, requireExternalRecordedReadSource, createRecordedReadBinding, vectorSlotKey, recordedReadSqlSchema, requireRecordedReadBinding, ALIAS_CTE_PREFIX, EMBEDDINGS_CTE_ALIAS, FULLTEXT_CTE_ALIAS, HYBRID_CANDIDATES_CTE_ALIAS } from './chunk-MIJKEVV7.js';
6
- import { runOptionallyInTransaction, createTransactionReadBackend, rowPropsToObject, createBackendOverlay, INTERNAL_TEMPORARY_WRITES } from './chunk-FMMIX6N4.js';
6
+ import { runOptionallyInTransaction, createTransactionReadBackend, rowPropsToObject, createBackendOverlay, INTERNAL_TEMPORARY_WRITES } from './chunk-55ITBQJI.js';
7
7
  import { resolveReadCoordinate, withRecordedCoordinate, describeCoordinate, coordinateContext, recordedInstantWallTime, asRecordedInstant, assertValidRecordedInstant } from './chunk-2L54C2C2.js';
8
- import { loadAndMergeGraphExtensionDocument, ensureSchema, loadAndVerifyGraph, buildKindRegistry, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, planRemovals, stripGraphExtension, applyDeprecatedKinds, loadActiveSchemaWithBootstrap, parseSerializedSchema, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-BEFM74L2.js';
8
+ import { loadAndMergeGraphExtensionDocument, ensureSchema, loadAndVerifyGraph, buildKindRegistry, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, planRemovals, stripGraphExtension, applyDeprecatedKinds, loadActiveSchemaWithBootstrap, parseSerializedSchema, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-FQ7ZPOTZ.js';
9
9
  import { compareStrings, compareCodePoints } from './chunk-DRACN6XG.js';
10
- import { getTypeName } from './chunk-2Y4IFKW7.js';
10
+ import { getTypeName } from './chunk-TKP5T34P.js';
11
11
  import { validateEdgeProps } from './chunk-DK2S42XB.js';
12
12
  import { canonicalEqual, sortedReplacer } from './chunk-UR7W5YQK.js';
13
- import { withRecordedRelationsPrecondition, isMissingTableError } from './chunk-B75XRV3O.js';
13
+ import { withRecordedRelationsPrecondition, isMissingTableError } from './chunk-V34A6R5V.js';
14
14
  import { isKnownKind } from './chunk-S4KQ5LV4.js';
15
15
  import { nowIso, validateOptionalCanonicalIsoDate } from './chunk-KCO5EFJU.js';
16
- import { generateIndexDDL } from './chunk-46GDII45.js';
17
- import { SYSTEM_INDEX_DECLARATIONS, resolveSystemIndexTableName, systemIndexName, resolveSystemIndexNames, generateSystemIndexDDL } from './chunk-JRP3VGHS.js';
18
- import { NODE_META_KEYS, EDGE_META_KEYS } from './chunk-TFMVL4QH.js';
16
+ import { generateIndexDDL } from './chunk-FL5UQRES.js';
17
+ import { SYSTEM_INDEX_DECLARATIONS, resolveSystemIndexTableName, systemIndexName, resolveSystemIndexNames, generateSystemIndexDDL } from './chunk-QLUXRWKL.js';
18
+ import { NODE_META_KEYS, EDGE_META_KEYS } from './chunk-FLEQ2HBK.js';
19
19
  import { sha256Hex, fnv1aBase36 } from './chunk-K34OPSJK.js';
20
20
  import { DEFAULT_PAGINATION_LIMIT, DEFAULT_STREAM_BATCH_SIZE, SQLITE_PATH_DELIMITER, PG_ARRAY_START, PG_ARRAY_END, PG_PATH_ELEMENT_SEPARATOR, MAX_PG_IDENTIFIER_LENGTH } from './chunk-2EBMPJBO.js';
21
- import { getDialect, assertVectorMinScore, vectorScoreExpression, vectorMinScoreCondition } from './chunk-K3BUWSFR.js';
21
+ import { getDialect, assertVectorMinScore, vectorScoreExpression, vectorMinScoreCondition } from './chunk-PVUI6KGR.js';
22
22
  import { isSqlPlaceholder, bindSqlValue, markAnnIndexScan, asCompiledSelectSql, isRawExecutable, renderSql, annIndexScanTypes, sql, asCompiledRowsSql, markForceCustomPlan, asCompiledTemporaryStatementSql, asCompiledStatementSql } from './chunk-6DCB664D.js';
23
23
  import { createSchemaIntrospector } from './chunk-D7PG5D5K.js';
24
24
  import { requireDefined, isPresent } from './chunk-QMQLUA66.js';
25
25
  import { getSearchableFields, resolveEmbeddingFields, resolveGraphVectorSlots, resolveDeclaredFulltextLanguage } from './chunk-PC2UBAUB.js';
26
- import { IncompatibleChangeError } from './chunk-IJTLXNGJ.js';
27
- import { validateProjectionField } from './chunk-TVLKA4AY.js';
26
+ import { IncompatibleChangeError } from './chunk-4GUBTVPV.js';
27
+ import { validateProjectionField } from './chunk-42PYUGLS.js';
28
28
  import { ConfigurationError, UnsupportedPredicateError, ValidationError, KindNotFoundError, EndpointError, EagerMaterializationError, CompilerInvariantError, CardinalityError, EdgeNotFoundError, DatabaseOperationError, UnsupportedBackendCapabilityError, GraphAlgorithmConvergenceError, EndpointNotFoundError, InvalidEdgeWeightError } from './chunk-4MB3AQAQ.js';
29
29
  import { jsonPointer, parseJsonPointer, resolveJsonPointer } from './chunk-G6Q5UM7U.js';
30
30
 
@@ -38,6 +38,7 @@ var NODE_WRITE_NAMES = [
38
38
  "create",
39
39
  "createFromRecord",
40
40
  "update",
41
+ "updateWhere",
41
42
  "delete",
42
43
  "hardDelete",
43
44
  "upsertById",
@@ -570,6 +571,13 @@ var StoreView = class extends CoordinatePinnedView {
570
571
  );
571
572
  return this.#edges;
572
573
  }
574
+ /** Heterogeneous multi-kind edge read pinned to this view's coordinate. */
575
+ bulkFindEdgesFrom(params, options) {
576
+ return this.store.bulkFindEdgesFrom(params, {
577
+ ...options,
578
+ ...withValidCoordinate(this.coordinate)
579
+ });
580
+ }
573
581
  /**
574
582
  * Read-only search facade. On a `current` view the read methods
575
583
  * (`fulltext` / `vector` / `hybrid`) delegate to the live `store.search`,
@@ -13911,6 +13919,35 @@ function narrowNode(node) {
13911
13919
  function narrowNodes(nodes) {
13912
13920
  return nodes;
13913
13921
  }
13922
+ function createFieldMember(accessor) {
13923
+ const selectField = (name) => accessor.field(name);
13924
+ return new Proxy(selectField, {
13925
+ get(target, property, receiver) {
13926
+ if (Reflect.has(target, property)) {
13927
+ const ownProperty = Reflect.get(target, property, receiver);
13928
+ return ownProperty;
13929
+ }
13930
+ return accessor.field("field")[property];
13931
+ }
13932
+ });
13933
+ }
13934
+ function evaluateNodePredicate(accessor, predicate) {
13935
+ const collectionAccessor = new Proxy(
13936
+ {},
13937
+ {
13938
+ get(_target, property) {
13939
+ if (typeof property === "symbol") return;
13940
+ if (property === "then" || property === "toJSON") return;
13941
+ if (property === "id" || property === "kind" || property === "$fulltext") {
13942
+ return accessor[property];
13943
+ }
13944
+ if (property === "field") return createFieldMember(accessor);
13945
+ return accessor.field(property);
13946
+ }
13947
+ }
13948
+ );
13949
+ return predicate(collectionAccessor);
13950
+ }
13914
13951
  function buildCreateInput(kind, props, options) {
13915
13952
  const input = { kind, props };
13916
13953
  if (options?.id !== void 0) input.id = options.id;
@@ -13937,6 +13974,7 @@ function createNodeCollection(config) {
13937
13974
  executeCreateNoReturnBatch: executeNodeCreateNoReturnBatch2,
13938
13975
  executeCreateBatch: executeNodeCreateBatch2,
13939
13976
  executeUpdate: executeNodeUpdate2,
13977
+ executeUpdateWhere: executeNodeUpdateWhere2,
13940
13978
  executeUpsertUpdate: executeNodeUpsertUpdate2,
13941
13979
  executeDelete: executeNodeDelete2,
13942
13980
  executeHardDelete: executeNodeHardDelete2,
@@ -13983,6 +14021,85 @@ function createNodeCollection(config) {
13983
14021
  );
13984
14022
  return narrowNode(result);
13985
14023
  },
14024
+ async updateWhere(params) {
14025
+ if (createQuery === void 0) {
14026
+ throw new ConfigurationError(
14027
+ `store.nodes.${kind}.updateWhere() requires a query-capable store`,
14028
+ { kind, operation: "updateWhere" }
14029
+ );
14030
+ }
14031
+ const exists = params.exists ?? [];
14032
+ if (params.where === void 0 && exists.length === 0 && !params.all) {
14033
+ throw new ConfigurationError(
14034
+ `store.nodes.${kind}.updateWhere() requires where, exists, or explicit all: true`,
14035
+ { kind, operation: "updateWhere" }
14036
+ );
14037
+ }
14038
+ const rootAlias = "update_candidate";
14039
+ const readInstant = nowIso();
14040
+ let base = createQuery().fromDynamic(kind, rootAlias).temporal("asOf", readInstant);
14041
+ const where = params.where;
14042
+ if (where !== void 0) {
14043
+ base = base.whereNode(
14044
+ rootAlias,
14045
+ (accessor) => evaluateNodePredicate(accessor, where)
14046
+ );
14047
+ }
14048
+ const candidateIdColumn = `${rootAlias}_id`;
14049
+ const compiledBranches = [];
14050
+ for (const [index, relation] of exists.entries()) {
14051
+ const edgeAlias = `update_edge_${index}`;
14052
+ const relatedAlias = `update_related_${index}`;
14053
+ const relationRoot = createQuery().fromDynamic(kind, rootAlias).temporal("asOf", readInstant);
14054
+ let traversal = relationRoot.traverseDynamic(
14055
+ relation.edgeKind,
14056
+ edgeAlias,
14057
+ {
14058
+ direction: relation.direction,
14059
+ expand: "none"
14060
+ }
14061
+ );
14062
+ if (relation.whereEdge !== void 0) {
14063
+ traversal = traversal.whereEdge(edgeAlias, relation.whereEdge);
14064
+ }
14065
+ let related = traversal.toDynamic(relation.relatedKind, relatedAlias);
14066
+ if (relation.whereRelated !== void 0) {
14067
+ related = related.whereNode(relatedAlias, relation.whereRelated);
14068
+ }
14069
+ compiledBranches.push(
14070
+ related.select(
14071
+ (ctx) => ctx[rootAlias]?.id
14072
+ ).compile()
14073
+ );
14074
+ }
14075
+ compiledBranches.unshift(
14076
+ base.select((ctx) => ctx[rootAlias]?.id).compile()
14077
+ );
14078
+ const projectCandidateId = (branch, index) => sql`
14079
+ SELECT ${sql.identifier(candidateIdColumn)}
14080
+ FROM (${branch}) AS ${sql.identifier(`update_branch_${index}`)}
14081
+ `;
14082
+ let combinedCandidates = projectCandidateId(
14083
+ requireDefined(compiledBranches[0]),
14084
+ 0
14085
+ );
14086
+ for (let index = 1; index < compiledBranches.length; index++) {
14087
+ combinedCandidates = sql`${combinedCandidates} INTERSECT ${projectCandidateId(
14088
+ requireDefined(compiledBranches[index]),
14089
+ index
14090
+ )}`;
14091
+ }
14092
+ const compiledCandidates = asCompiledSelectSql(combinedCandidates);
14093
+ const result = await executeNodeUpdateWhere2(
14094
+ kind,
14095
+ params.patch,
14096
+ compiledCandidates,
14097
+ candidateIdColumn,
14098
+ backend
14099
+ );
14100
+ await config.maybeRefreshStatisticsAfterBulk?.(result.affectedCount);
14101
+ return result;
14102
+ },
13986
14103
  async delete(id) {
13987
14104
  await executeNodeDelete2(kind, id, backend);
13988
14105
  },
@@ -14333,10 +14450,12 @@ var HISTORY_STORE_BACKEND_KEYS = [
14333
14450
  "deleteEdge",
14334
14451
  "deleteEdgesBatch",
14335
14452
  "deleteEmbedding",
14453
+ "deleteEmbeddingBatch",
14336
14454
  "deleteFulltext",
14337
14455
  "deleteFulltextBatch",
14338
14456
  "deleteNode",
14339
14457
  "deleteUnique",
14458
+ "hardDeleteUniquesByNodeIds",
14340
14459
  "deleteVectorSlotContribution",
14341
14460
  "dialect",
14342
14461
  "dropVectorIndex",
@@ -14354,6 +14473,7 @@ var HISTORY_STORE_BACKEND_KEYS = [
14354
14473
  "executeTemporaryStatement",
14355
14474
  "findEdgesByKind",
14356
14475
  "findEdgesByEndpointSet",
14476
+ "findEdgesByHeterogeneousEndpointSet",
14357
14477
  "findEdgesConnectedTo",
14358
14478
  "findNodesByKind",
14359
14479
  "fulltextSearch",
@@ -14373,6 +14493,7 @@ var HISTORY_STORE_BACKEND_KEYS = [
14373
14493
  "hardDeleteEdge",
14374
14494
  "hardDeleteEdgesBatch",
14375
14495
  "hardDeleteNode",
14496
+ "hardDeleteUniquesByNodeIds",
14376
14497
  "hybridSearch",
14377
14498
  "insertEdge",
14378
14499
  "insertEdgeNoReturn",
@@ -14394,6 +14515,7 @@ var HISTORY_STORE_BACKEND_KEYS = [
14394
14515
  "tableNames",
14395
14516
  "updateEdge",
14396
14517
  "updateNode",
14518
+ "updateNodeSet",
14397
14519
  "upsertEmbedding",
14398
14520
  "upsertEmbeddingBatch",
14399
14521
  "upsertFulltext",
@@ -16749,6 +16871,7 @@ var NODE_WRITE_INTENT_COUNTERS = {
16749
16871
  create: countSingleWrite,
16750
16872
  createFromRecord: countSingleWrite,
16751
16873
  update: countSingleWrite,
16874
+ updateWhere: countSingleWrite,
16752
16875
  delete: countSingleWrite,
16753
16876
  hardDelete: countSingleWrite,
16754
16877
  upsertById: countSingleWrite,
@@ -16929,6 +17052,10 @@ var CAUGHT_UP_VERB_DETAILS = {
16929
17052
  reembed: {
16930
17053
  phrase: "re-embed a vector field on",
16931
17054
  code: "REEMBED_BEFORE_INITIALIZE"
17055
+ },
17056
+ repair: {
17057
+ phrase: "repair contributions for",
17058
+ code: "REPAIR_CONTRIBUTIONS_BEFORE_INITIALIZE"
16932
17059
  }
16933
17060
  };
16934
17061
  var ROW_MAPPER_CONFIGS = {
@@ -17293,8 +17420,9 @@ var StoreImplementation = class _StoreImplementation {
17293
17420
  * `KindNotFoundError` when the kind is not registered.
17294
17421
  *
17295
17422
  * The dominant graph-extension-kind access pattern: `await store.evolve(...)`
17296
- * returns a new store, the caller immediately operates on the new
17297
- * kind, and the null-check the optional variant requires is busywork.
17423
+ * returns the Store for the resulting schema, the caller immediately
17424
+ * operates on the new kind, and the null-check the optional variant requires
17425
+ * is busywork.
17298
17426
  */
17299
17427
  getNodeCollectionOrThrow(kind) {
17300
17428
  const collection = this.getNodeCollection(kind);
@@ -17457,6 +17585,14 @@ var StoreImplementation = class _StoreImplementation {
17457
17585
  executeCreateBatch: (inputs, backend) => executeNodeCreateBatch(ctx, inputs, backend),
17458
17586
  executeCreateNoReturnBatch: (inputs, backend) => executeNodeCreateNoReturnBatch(ctx, inputs, backend),
17459
17587
  executeUpdate: (input, backend, options) => executeNodeUpdate(ctx, { ...input, id: input.id }, backend, options),
17588
+ executeUpdateWhere: (kind, patch, candidateIds, candidateIdColumn, backend) => executeNodeUpdateWhere(
17589
+ ctx,
17590
+ kind,
17591
+ patch,
17592
+ candidateIds,
17593
+ candidateIdColumn,
17594
+ backend
17595
+ ),
17460
17596
  executeUpsertUpdate: (input, backend, options) => executeNodeUpsertUpdate(
17461
17597
  ctx,
17462
17598
  { ...input, id: input.id },
@@ -17927,6 +18063,96 @@ var StoreImplementation = class _StoreImplementation {
17927
18063
  return results;
17928
18064
  });
17929
18065
  }
18066
+ /**
18067
+ * Reads several edge kinds from heterogeneous source nodes with round trips
18068
+ * independent of the number of licensed edge/source-kind combinations.
18069
+ *
18070
+ * Results are flattened in source-group/id order. Repeated sources receive
18071
+ * independent edge arrays, and sources with no matching edges remain present
18072
+ * with an empty array. Inputs that exceed the backend bind budget are split
18073
+ * into source chunks without splitting one source across statements.
18074
+ */
18075
+ async bulkFindEdgesFrom(params, options) {
18076
+ const sources = params.sources.flatMap(
18077
+ (group) => {
18078
+ if (!Object.hasOwn(this.#graph.nodes, group.kind)) {
18079
+ throw new KindNotFoundError(group.kind, "node", {
18080
+ graphId: this.graphId
18081
+ });
18082
+ }
18083
+ return group.ids.map((id) => ({ kind: group.kind, id }));
18084
+ }
18085
+ );
18086
+ for (const edgeKind of params.edgeKinds) {
18087
+ if (!Object.hasOwn(this.#graph.edges, edgeKind)) {
18088
+ throw new KindNotFoundError(edgeKind, "edge", {
18089
+ graphId: this.graphId
18090
+ });
18091
+ }
18092
+ }
18093
+ if (sources.length === 0 || params.edgeKinds.length === 0) {
18094
+ return sources.map((source) => ({ source, edges: [] }));
18095
+ }
18096
+ const readEndpointSet = this.#baseBackend.findEdgesByHeterogeneousEndpointSet;
18097
+ if (readEndpointSet === void 0) {
18098
+ throw new ConfigurationError(
18099
+ "store.bulkFindEdgesFrom() requires a backend that can read heterogeneous endpoint and edge-kind sets in set-oriented statements.",
18100
+ {
18101
+ backend: this.#baseBackend.dialect,
18102
+ capability: "findEdgesByHeterogeneousEndpointSet",
18103
+ operation: "bulkFindEdgesFrom"
18104
+ },
18105
+ {
18106
+ suggestion: "Use per-edge-kind bulkFindFrom calls explicitly if that round-trip tradeoff is acceptable."
18107
+ }
18108
+ );
18109
+ }
18110
+ const limitPerInput = options?.limitPerInput;
18111
+ if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
18112
+ throw new ValidationError(
18113
+ "bulk endpoint reads require limitPerInput to be a positive integer",
18114
+ {
18115
+ entityType: "edge",
18116
+ kind: params.edgeKinds.join(","),
18117
+ issues: [
18118
+ {
18119
+ path: "limitPerInput",
18120
+ message: `Expected a positive integer, received ${String(limitPerInput)}`,
18121
+ code: "invalid_value"
18122
+ }
18123
+ ]
18124
+ }
18125
+ );
18126
+ }
18127
+ const temporal = resolveTemporalReadParams(
18128
+ options,
18129
+ this.#graph.defaults.temporalMode
18130
+ );
18131
+ const endpoints = sources;
18132
+ const rows = await readEndpointSet({
18133
+ graphId: this.graphId,
18134
+ side: "from",
18135
+ endpoints,
18136
+ edgeKinds: params.edgeKinds,
18137
+ ...limitPerInput !== void 0 && this.#baseBackend.capabilities.windowFunctions && {
18138
+ limitPerEndpoint: limitPerInput
18139
+ },
18140
+ ...temporal
18141
+ });
18142
+ const edgesBySource = /* @__PURE__ */ new Map();
18143
+ for (const row of rows) {
18144
+ const edge = rowToEdge(row);
18145
+ const key = `${edge.fromKind}\0${edge.fromId}`;
18146
+ const bucket = edgesBySource.get(key);
18147
+ if (bucket === void 0) edgesBySource.set(key, [edge]);
18148
+ else bucket.push(edge);
18149
+ }
18150
+ return sources.map((source) => {
18151
+ const bucket = edgesBySource.get(`${source.kind}\0${source.id}`) ?? [];
18152
+ const edges = limitPerInput === void 0 ? [...bucket] : bucket.slice(0, limitPerInput);
18153
+ return { source, edges };
18154
+ });
18155
+ }
17930
18156
  // === Subgraph Extraction ===
17931
18157
  /**
17932
18158
  * Extracts a typed subgraph by traversing from a root node.
@@ -18068,6 +18294,7 @@ var StoreImplementation = class _StoreImplementation {
18068
18294
  }
18069
18295
  const pending = [];
18070
18296
  const runHooks = this.#createBufferedHookRunner(pending);
18297
+ const runBulkHooks = this.#createBufferedBulkHookRunner(pending);
18071
18298
  let recordedByGraph;
18072
18299
  const transactionOptions = receiptRecorder !== void 0 && this.#captureEnabled ? withRecordedFlushObserver(backendOptions, (instants) => {
18073
18300
  recordedByGraph = instants;
@@ -18078,7 +18305,8 @@ var StoreImplementation = class _StoreImplementation {
18078
18305
  txBackend,
18079
18306
  nativeTransaction,
18080
18307
  runHooks,
18081
- receiptRecorder
18308
+ receiptRecorder,
18309
+ runBulkHooks
18082
18310
  )
18083
18311
  );
18084
18312
  const result = this.#captureEnabled || this.#adapterBackend === void 0 ? await this.#backend.transaction(
@@ -18089,9 +18317,16 @@ var StoreImplementation = class _StoreImplementation {
18089
18317
  transactionOptions
18090
18318
  );
18091
18319
  for (const outcome of pending) {
18092
- this.#hooks.onOperationEnd?.(outcome.ctx, {
18093
- durationMs: outcome.durationMs
18094
- });
18320
+ if (outcome.type === "bulkOperation") {
18321
+ this.#hooks.onBulkOperationEnd?.(outcome.ctx, {
18322
+ affectedCount: outcome.affectedCount,
18323
+ durationMs: outcome.durationMs
18324
+ });
18325
+ } else {
18326
+ this.#hooks.onOperationEnd?.(outcome.ctx, {
18327
+ durationMs: outcome.durationMs
18328
+ });
18329
+ }
18095
18330
  }
18096
18331
  return { result, recordedByGraph };
18097
18332
  } catch (error) {
@@ -18281,9 +18516,11 @@ var StoreImplementation = class _StoreImplementation {
18281
18516
  * (#140); when history capture is enabled it is replaced with a fail-loud
18282
18517
  * guard because raw graph writes would bypass recorded-time capture.
18283
18518
  */
18284
- #buildTransactionContext(txBackend, sql2, runHooks = this.#immediateHookRunner(), receiptRecorder) {
18519
+ #buildTransactionContext(txBackend, sql2, runHooks = this.#immediateHookRunner(), receiptRecorder, runBulkHooks = this.#immediateBulkHookRunner()) {
18285
18520
  const txNodeOperations = {
18286
- ...this.#buildNodeOperations(this.#createNodeOperationContext(runHooks)),
18521
+ ...this.#buildNodeOperations(
18522
+ this.#createNodeOperationContext(runHooks, runBulkHooks)
18523
+ ),
18287
18524
  createQuery: () => this.#createQueryForBackend(txBackend),
18288
18525
  maybeRefreshStatisticsAfterBulk: void 0
18289
18526
  };
@@ -18451,12 +18688,14 @@ var StoreImplementation = class _StoreImplementation {
18451
18688
  /**
18452
18689
  * Evolves the graph at runtime by merging a graph extension into the
18453
18690
  * current schema, atomically committing a new schema version, and
18454
- * returning a fresh `Store` constructed against the merged graph.
18691
+ * returning the `Store` for the merged graph.
18455
18692
  *
18456
18693
  * The `Store` is immutable — its registry, collections, and operation
18457
- * contexts close over the graph at construction time — so callers
18458
- * must use the returned store (or pass a `ref` to be re-pointed) for
18459
- * any work involving the new kinds.
18694
+ * contexts close over the graph at construction time. After `evolve()`
18695
+ * resolves, callers must use the returned Store (or the re-pointed
18696
+ * `ref.current`) for every subsequent operation in the same request. A
18697
+ * Store captured before the schema commit remains pinned to the old version,
18698
+ * and its next managed write is rejected by the schema fence.
18460
18699
  *
18461
18700
  * **Cost for purely additive extensions is proportional to schema
18462
18701
  * document size, not row count.** The commit is a single CAS write.
@@ -18474,10 +18713,10 @@ var StoreImplementation = class _StoreImplementation {
18474
18713
  *
18475
18714
  * @param extension - Graph extension produced by
18476
18715
  * `defineGraphExtension(...)`.
18477
- * @param options.ref - Optional handle whose `current` is overwritten
18478
- * atomically with the schema commit. Long-lived consumers
18479
- * (request handlers, background workers) that dereference through
18480
- * the ref see the new kinds on the *next* call.
18716
+ * @param options.ref - Optional handle whose `current` is overwritten with
18717
+ * the replacement before a successful call resolves. Code awaiting this
18718
+ * call can use the returned Store or `ref.current` immediately. A
18719
+ * previously captured Store is not mutated.
18481
18720
  *
18482
18721
  * @throws {GraphExtensionValidationError} when the extension is
18483
18722
  * structurally invalid.
@@ -18561,8 +18800,8 @@ var StoreImplementation = class _StoreImplementation {
18561
18800
  * kind that's already marked is a no-op (no version bump).
18562
18801
  *
18563
18802
  * @param names - Node or edge kind names to mark as deprecated.
18564
- * @param options.ref - Optional handle to be re-pointed atomically
18565
- * with the schema commit, mirroring `evolve()`.
18803
+ * @param options.ref - Optional handle to be re-pointed to the replacement
18804
+ * Store before a successful call resolves, mirroring `evolve()`.
18566
18805
  *
18567
18806
  * @throws {ConfigurationError} on `DEPRECATE_BEFORE_INITIALIZE` (no
18568
18807
  * schema yet) or `DEPRECATE_UNKNOWN_KIND` (name not on the graph).
@@ -18583,8 +18822,8 @@ var StoreImplementation = class _StoreImplementation {
18583
18822
  *
18584
18823
  * @param names - Node or edge kind names to remove from the
18585
18824
  * deprecated set.
18586
- * @param options.ref - Optional handle to be re-pointed atomically
18587
- * with the schema commit.
18825
+ * @param options.ref - Optional handle to be re-pointed to the replacement
18826
+ * Store before a successful call resolves.
18588
18827
  *
18589
18828
  * @throws {ConfigurationError} on `DEPRECATE_BEFORE_INITIALIZE`.
18590
18829
  * @throws {StaleVersionError} on a CAS race with another writer.
@@ -18864,6 +19103,39 @@ var StoreImplementation = class _StoreImplementation {
18864
19103
  const vectorSlots = backend.capabilities.vector?.supported === true ? resolveGraphVectorSlots(this.#graph) : [];
18865
19104
  return verify(this.graphId, vectorSlots);
18866
19105
  }
19106
+ /**
19107
+ * Non-destructively repairs contribution states whose physical storage can
19108
+ * be preserved: `missing-marker` and `failed-materialization`.
19109
+ * `orphaned-marker` and `stale` findings are returned as
19110
+ * `requires-rebuild`; this method never drops contribution tables or
19111
+ * fabricates the data needed to rebuild them.
19112
+ *
19113
+ * The repair re-audits inside the backend and resolves every declaration
19114
+ * from the committed schema. Callers do not supply diagnostics, physical
19115
+ * names, or DDL. A stale Store is caught up to the active persisted graph
19116
+ * before its vector slots are enumerated, so repair does not use declarations
19117
+ * from the Store's stale in-memory graph snapshot.
19118
+ *
19119
+ * @throws {ConfigurationError} when no schema has been initialized or the
19120
+ * backend cannot probe and repair strategy-owned contributions.
19121
+ */
19122
+ async repairContributions() {
19123
+ const backend = this.#baseBackend;
19124
+ const repair = backend.repairContributions;
19125
+ if (repair === void 0) {
19126
+ throw new ConfigurationError(
19127
+ "repairContributions requires a backend that can probe and repair strategy-owned contribution tables.",
19128
+ {
19129
+ backend: backend.dialect,
19130
+ capability: "contributions",
19131
+ operation: "repair"
19132
+ }
19133
+ );
19134
+ }
19135
+ const { baseline } = await this.#loadCaughtUp("repair");
19136
+ const vectorSlots = backend.capabilities.vector?.supported === true ? resolveGraphVectorSlots(baseline) : [];
19137
+ return repair(this.graphId, vectorSlots);
19138
+ }
18867
19139
  /**
18868
19140
  * Removes extension kinds from the schema with cascading edge and
18869
19141
  * ontology cleanup. Two-phase by design:
@@ -18918,9 +19190,10 @@ var StoreImplementation = class _StoreImplementation {
18918
19190
  );
18919
19191
  const recordKindRemoval = this.#backend.recordKindRemoval;
18920
19192
  if (recordKindRemoval !== void 0) {
18921
- if (this.#backend.ensureKindRemovalsTable !== void 0) {
18922
- await this.#backend.ensureKindRemovalsTable();
18923
- }
19193
+ await ensureFocusedStatusTable(
19194
+ this.#backend,
19195
+ this.#backend.ensureKindRemovalsTable
19196
+ );
18924
19197
  const attemptedAt = nowIso();
18925
19198
  const newSchemaVersion = committedRow.version;
18926
19199
  const queue = (kindName, entity) => recordKindRemoval(
@@ -19059,6 +19332,10 @@ var StoreImplementation = class _StoreImplementation {
19059
19332
  (kind) => !(kind in baseline.edges)
19060
19333
  );
19061
19334
  if (addedNodes.length === 0 && addedEdges.length === 0) return;
19335
+ await ensureFocusedStatusTable(
19336
+ this.#backend,
19337
+ this.#backend.ensureKindRemovalsTable
19338
+ );
19062
19339
  const pending = await getPendingKindRemovals(this.graphId);
19063
19340
  if (pending.length === 0) return;
19064
19341
  const blocked = pending.filter(
@@ -19105,7 +19382,10 @@ var StoreImplementation = class _StoreImplementation {
19105
19382
  #immediateHookRunner() {
19106
19383
  return (ctx, fn) => this.#withOperationHooks(ctx, fn);
19107
19384
  }
19108
- #createNodeOperationContext(runHooks = this.#immediateHookRunner()) {
19385
+ #immediateBulkHookRunner() {
19386
+ return (ctx, fn) => this.#withBulkOperationHooks(ctx, fn);
19387
+ }
19388
+ #createNodeOperationContext(runHooks = this.#immediateHookRunner(), runBulkHooks = this.#immediateBulkHookRunner()) {
19109
19389
  return {
19110
19390
  graph: this.#graph,
19111
19391
  graphId: this.graphId,
@@ -19115,7 +19395,14 @@ var StoreImplementation = class _StoreImplementation {
19115
19395
  revisionSchema: this.#sqlSchema(),
19116
19396
  registry: this.#registry,
19117
19397
  createOperationContext: (operation, entity, kind, id) => this.#createOperationContext(operation, entity, kind, id),
19118
- withOperationHooks: runHooks
19398
+ withOperationHooks: runHooks,
19399
+ createBulkOperationContext: (operation, kind) => ({
19400
+ ...this.#createHookContext(),
19401
+ operation,
19402
+ entity: "node",
19403
+ kind
19404
+ }),
19405
+ withBulkOperationHooks: runBulkHooks
19119
19406
  };
19120
19407
  }
19121
19408
  #createEdgeOperationContext(runHooks = this.#immediateHookRunner()) {
@@ -19213,6 +19500,21 @@ var StoreImplementation = class _StoreImplementation {
19213
19500
  throw error;
19214
19501
  }
19215
19502
  }
19503
+ async #withBulkOperationHooks(ctx, fn) {
19504
+ this.#hooks.onBulkOperationStart?.(ctx);
19505
+ const startTime = Date.now();
19506
+ try {
19507
+ const result = await fn();
19508
+ this.#hooks.onBulkOperationEnd?.(ctx, {
19509
+ affectedCount: result.affectedCount,
19510
+ durationMs: Date.now() - startTime
19511
+ });
19512
+ return result;
19513
+ } catch (error) {
19514
+ this.#hooks.onError?.(ctx, asError(error));
19515
+ throw error;
19516
+ }
19517
+ }
19216
19518
  /**
19217
19519
  * A hook runner for operations that execute INSIDE an explicit
19218
19520
  * `store.transaction`: `onOperationStart` (and a failed operation's
@@ -19229,7 +19531,31 @@ var StoreImplementation = class _StoreImplementation {
19229
19531
  const startTime = Date.now();
19230
19532
  try {
19231
19533
  const result = await fn();
19232
- pending.push({ ctx, durationMs: Date.now() - startTime });
19534
+ pending.push({
19535
+ type: "operation",
19536
+ ctx,
19537
+ durationMs: Date.now() - startTime
19538
+ });
19539
+ return result;
19540
+ } catch (error) {
19541
+ this.#hooks.onError?.(ctx, asError(error));
19542
+ throw error;
19543
+ }
19544
+ };
19545
+ }
19546
+ /** Buffered counterpart for set-based operations inside `transaction()`. */
19547
+ #createBufferedBulkHookRunner(pending) {
19548
+ return async (ctx, fn) => {
19549
+ this.#hooks.onBulkOperationStart?.(ctx);
19550
+ const startTime = Date.now();
19551
+ try {
19552
+ const result = await fn();
19553
+ pending.push({
19554
+ type: "bulkOperation",
19555
+ ctx,
19556
+ affectedCount: result.affectedCount,
19557
+ durationMs: Date.now() - startTime
19558
+ });
19233
19559
  return result;
19234
19560
  } catch (error) {
19235
19561
  this.#hooks.onError?.(ctx, asError(error));
@@ -19584,5 +19910,5 @@ async function createVerifiedAdapterStore(graph, backend, options) {
19584
19910
  }
19585
19911
 
19586
19912
  export { ExecutableAggregateQuery, ExecutableQuery, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, PreparedQuery, QueryBuilder, RecordedStoreView, StoreSearch, StoreView, UnionableQuery, avg, composeFragments, count, countDistinct, countDistinctEdges, countEdges, createAdapterStore, createAdapterStoreWithSchema, createFragment, createQueryBuilder, createStore, createStoreWithSchema, createVerifiedAdapterStore, createVerifiedStore, defineSubgraphProject, field, having, havingEq, havingGt, havingGte, havingLt, havingLte, limitFragment, max, min, offsetFragment, orderByFragment, sum };
19587
- //# sourceMappingURL=chunk-BCP7LLOY.js.map
19588
- //# sourceMappingURL=chunk-BCP7LLOY.js.map
19913
+ //# sourceMappingURL=chunk-ID4WXTKL.js.map
19914
+ //# sourceMappingURL=chunk-ID4WXTKL.js.map