@nicia-ai/typegraph 0.42.1 → 0.44.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 (289) hide show
  1. package/dist/backend/drizzle/indexes.cjs +9 -9
  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 +5 -5
  5. package/dist/backend/index.cjs +50 -50
  6. package/dist/backend/index.d.cts +3 -3
  7. package/dist/backend/index.d.ts +3 -3
  8. package/dist/backend/index.js +11 -11
  9. package/dist/backend/postgres/index.cjs +26 -26
  10. package/dist/backend/postgres/index.d.cts +6 -5
  11. package/dist/backend/postgres/index.d.ts +6 -5
  12. package/dist/backend/postgres/index.js +13 -13
  13. package/dist/backend/postgres/pglite-store.cjs +33 -33
  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 +29 -29
  18. package/dist/backend/postgres/pglite-store.js.map +1 -1
  19. package/dist/backend/postgres/pglite.cjs +15 -15
  20. package/dist/backend/postgres/pglite.d.cts +3 -2
  21. package/dist/backend/postgres/pglite.d.ts +3 -2
  22. package/dist/backend/postgres/pglite.js +14 -14
  23. package/dist/backend/sqlite/index.cjs +23 -23
  24. package/dist/backend/sqlite/index.d.cts +7 -6
  25. package/dist/backend/sqlite/index.d.ts +7 -6
  26. package/dist/backend/sqlite/index.js +11 -11
  27. package/dist/backend/sqlite/libsql.cjs +17 -17
  28. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  29. package/dist/backend/sqlite/libsql.d.cts +3 -2
  30. package/dist/backend/sqlite/libsql.d.ts +3 -2
  31. package/dist/backend/sqlite/libsql.js +13 -13
  32. package/dist/backend/sqlite/libsql.js.map +1 -1
  33. package/dist/backend/sqlite/local-store.cjs +34 -34
  34. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  35. package/dist/backend/sqlite/local-store.d.cts +8 -7
  36. package/dist/backend/sqlite/local-store.d.ts +8 -7
  37. package/dist/backend/sqlite/local-store.js +30 -30
  38. package/dist/backend/sqlite/local-store.js.map +1 -1
  39. package/dist/backend/sqlite/local.cjs +16 -16
  40. package/dist/backend/sqlite/local.d.cts +3 -2
  41. package/dist/backend/sqlite/local.d.ts +3 -2
  42. package/dist/backend/sqlite/local.js +14 -14
  43. package/dist/{chunk-3RPQDGUE.cjs → chunk-2BIG7U6E.cjs} +5 -5
  44. package/dist/{chunk-3RPQDGUE.cjs.map → chunk-2BIG7U6E.cjs.map} +1 -1
  45. package/dist/{chunk-2OOY4OYT.js → chunk-2L54C2C2.js} +4 -4
  46. package/dist/{chunk-2OOY4OYT.js.map → chunk-2L54C2C2.js.map} +1 -1
  47. package/dist/{chunk-V2GZBPY2.cjs → chunk-2VLBGQBY.cjs} +310 -61
  48. package/dist/chunk-2VLBGQBY.cjs.map +1 -0
  49. package/dist/{chunk-RXOAXO3R.js → chunk-2WDD2NO3.js} +3 -3
  50. package/dist/{chunk-RXOAXO3R.js.map → chunk-2WDD2NO3.js.map} +1 -1
  51. package/dist/{chunk-2HKIID5K.js → chunk-2Y4IFKW7.js} +5 -5
  52. package/dist/{chunk-2HKIID5K.js.map → chunk-2Y4IFKW7.js.map} +1 -1
  53. package/dist/{chunk-ECU53PMN.cjs → chunk-3PRKZW6D.cjs} +5 -5
  54. package/dist/chunk-3PRKZW6D.cjs.map +1 -0
  55. package/dist/{chunk-2G6ZEGYO.js → chunk-46GDII45.js} +4 -4
  56. package/dist/{chunk-2G6ZEGYO.js.map → chunk-46GDII45.js.map} +1 -1
  57. package/dist/{chunk-OYJSYDIH.js → chunk-4MB3AQAQ.js} +13 -3
  58. package/dist/chunk-4MB3AQAQ.js.map +1 -0
  59. package/dist/chunk-4SZ6XPTG.cjs +12 -0
  60. package/dist/{chunk-VGMNGWBR.cjs.map → chunk-4SZ6XPTG.cjs.map} +1 -1
  61. package/dist/{chunk-FY4VY5EV.cjs → chunk-5MUSU4ZP.cjs} +20 -20
  62. package/dist/chunk-5MUSU4ZP.cjs.map +1 -0
  63. package/dist/{chunk-ZIRC2U6G.js → chunk-63KCKSSH.js} +78 -16
  64. package/dist/chunk-63KCKSSH.js.map +1 -0
  65. package/dist/{chunk-7Y6BV3TK.cjs → chunk-66UVLHQA.cjs} +100 -100
  66. package/dist/{chunk-7Y6BV3TK.cjs.map → chunk-66UVLHQA.cjs.map} +1 -1
  67. package/dist/{chunk-M4GYQF2H.js → chunk-6DCB664D.js} +7 -4
  68. package/dist/chunk-6DCB664D.js.map +1 -0
  69. package/dist/{chunk-OMQ2NBOR.cjs → chunk-6JZUSDY2.cjs} +27 -27
  70. package/dist/{chunk-OMQ2NBOR.cjs.map → chunk-6JZUSDY2.cjs.map} +1 -1
  71. package/dist/{chunk-Z3WIL6S3.js → chunk-7G32LIQM.js} +5 -5
  72. package/dist/{chunk-Z3WIL6S3.js.map → chunk-7G32LIQM.js.map} +1 -1
  73. package/dist/{chunk-2SO5I5AI.cjs → chunk-7V2FGGI2.cjs} +250 -198
  74. package/dist/chunk-7V2FGGI2.cjs.map +1 -0
  75. package/dist/{chunk-I73ATSAH.cjs → chunk-A2I2XO52.cjs} +4 -4
  76. package/dist/{chunk-I73ATSAH.cjs.map → chunk-A2I2XO52.cjs.map} +1 -1
  77. package/dist/{chunk-O2GZM7UK.cjs → chunk-A4PBRX4C.cjs} +7 -7
  78. package/dist/{chunk-O2GZM7UK.cjs.map → chunk-A4PBRX4C.cjs.map} +1 -1
  79. package/dist/{chunk-5P6IPIT6.cjs → chunk-ALFUGRYB.cjs} +75 -65
  80. package/dist/chunk-ALFUGRYB.cjs.map +1 -0
  81. package/dist/{chunk-NXIZL7ZZ.js → chunk-ATLN63JA.js} +6 -6
  82. package/dist/chunk-ATLN63JA.js.map +1 -0
  83. package/dist/{chunk-CUPJL6TS.js → chunk-B75XRV3O.js} +3 -3
  84. package/dist/{chunk-CUPJL6TS.js.map → chunk-B75XRV3O.js.map} +1 -1
  85. package/dist/{chunk-DP7KC6CL.js → chunk-BCP7LLOY.js} +754 -476
  86. package/dist/chunk-BCP7LLOY.js.map +1 -0
  87. package/dist/{chunk-RAWG2FEU.js → chunk-BEFM74L2.js} +264 -18
  88. package/dist/chunk-BEFM74L2.js.map +1 -0
  89. package/dist/{chunk-LQLVJWUH.js → chunk-BNUFUFAU.js} +7 -7
  90. package/dist/chunk-BNUFUFAU.js.map +1 -0
  91. package/dist/{chunk-KTBTSHU6.cjs → chunk-C4F7VJ5D.cjs} +13 -3
  92. package/dist/chunk-C4F7VJ5D.cjs.map +1 -0
  93. package/dist/{chunk-CVK4T34X.cjs → chunk-CPEL3YIR.cjs} +22 -22
  94. package/dist/{chunk-CVK4T34X.cjs.map → chunk-CPEL3YIR.cjs.map} +1 -1
  95. package/dist/{chunk-O3USVVWS.js → chunk-DK2S42XB.js} +3 -3
  96. package/dist/{chunk-O3USVVWS.js.map → chunk-DK2S42XB.js.map} +1 -1
  97. package/dist/{chunk-DMZEVJGL.cjs → chunk-EE7N5XXQ.cjs} +13 -13
  98. package/dist/{chunk-DMZEVJGL.cjs.map → chunk-EE7N5XXQ.cjs.map} +1 -1
  99. package/dist/{chunk-ZGOUVMVS.js → chunk-EFELJVLA.js} +5 -5
  100. package/dist/{chunk-ZGOUVMVS.js.map → chunk-EFELJVLA.js.map} +1 -1
  101. package/dist/chunk-EPTSMFH7.cjs +12 -0
  102. package/dist/{chunk-U3YRCZ5L.cjs.map → chunk-EPTSMFH7.cjs.map} +1 -1
  103. package/dist/{chunk-FSCJOTHF.cjs → chunk-EQ7JKLZO.cjs} +10 -10
  104. package/dist/{chunk-FSCJOTHF.cjs.map → chunk-EQ7JKLZO.cjs.map} +1 -1
  105. package/dist/{chunk-5Q3P6OIC.cjs → chunk-FGO5JFVJ.cjs} +12 -12
  106. package/dist/chunk-FGO5JFVJ.cjs.map +1 -0
  107. package/dist/{chunk-VC26BUNP.js → chunk-FMGEZBAQ.js} +5 -5
  108. package/dist/{chunk-VC26BUNP.js.map → chunk-FMGEZBAQ.js.map} +1 -1
  109. package/dist/{chunk-UZLEQFTV.js → chunk-FMMIX6N4.js} +4 -4
  110. package/dist/chunk-FMMIX6N4.js.map +1 -0
  111. package/dist/{chunk-5C75HQYQ.js → chunk-FRHHDHKH.js} +5 -5
  112. package/dist/{chunk-5C75HQYQ.js.map → chunk-FRHHDHKH.js.map} +1 -1
  113. package/dist/{chunk-EVFL2ZY5.js → chunk-FSXTPBRN.js} +63 -12
  114. package/dist/chunk-FSXTPBRN.js.map +1 -0
  115. package/dist/{chunk-TRC646QQ.cjs → chunk-GFRGG2US.cjs} +7 -7
  116. package/dist/{chunk-TRC646QQ.cjs.map → chunk-GFRGG2US.cjs.map} +1 -1
  117. package/dist/{chunk-UJRWOV5B.js → chunk-GWEDD3DH.js} +5 -5
  118. package/dist/{chunk-UJRWOV5B.js.map → chunk-GWEDD3DH.js.map} +1 -1
  119. package/dist/{chunk-AQR6BHB3.cjs → chunk-HJH3RMXG.cjs} +10 -10
  120. package/dist/{chunk-AQR6BHB3.cjs.map → chunk-HJH3RMXG.cjs.map} +1 -1
  121. package/dist/{chunk-F7TDKSVB.cjs → chunk-HOHAJ2NR.cjs} +4 -4
  122. package/dist/{chunk-F7TDKSVB.cjs.map → chunk-HOHAJ2NR.cjs.map} +1 -1
  123. package/dist/{chunk-YPVQYM3L.js → chunk-HOIFFY4M.js} +100 -20
  124. package/dist/chunk-HOIFFY4M.js.map +1 -0
  125. package/dist/{chunk-LDCWO5B6.js → chunk-IIMQJYAM.js} +3 -3
  126. package/dist/{chunk-LDCWO5B6.js.map → chunk-IIMQJYAM.js.map} +1 -1
  127. package/dist/{chunk-OM6RIOA5.cjs → chunk-IIT5K7SK.cjs} +13 -13
  128. package/dist/{chunk-OM6RIOA5.cjs.map → chunk-IIT5K7SK.cjs.map} +1 -1
  129. package/dist/{chunk-EQOQOT55.js → chunk-IJTLXNGJ.js} +5 -5
  130. package/dist/{chunk-EQOQOT55.js.map → chunk-IJTLXNGJ.js.map} +1 -1
  131. package/dist/{chunk-4XRP2N6B.js → chunk-JRP3VGHS.js} +3 -3
  132. package/dist/{chunk-4XRP2N6B.js.map → chunk-JRP3VGHS.js.map} +1 -1
  133. package/dist/{chunk-42XYPKZU.js → chunk-K3BUWSFR.js} +41 -3
  134. package/dist/chunk-K3BUWSFR.js.map +1 -0
  135. package/dist/{chunk-GT7NEXSU.js → chunk-KCO5EFJU.js} +3 -3
  136. package/dist/{chunk-GT7NEXSU.js.map → chunk-KCO5EFJU.js.map} +1 -1
  137. package/dist/{chunk-ARN3ZODS.cjs → chunk-KKYELPZ2.cjs} +6 -6
  138. package/dist/{chunk-ARN3ZODS.cjs.map → chunk-KKYELPZ2.cjs.map} +1 -1
  139. package/dist/{chunk-33PAKPED.cjs → chunk-MCHP7RHZ.cjs} +41 -41
  140. package/dist/{chunk-33PAKPED.cjs.map → chunk-MCHP7RHZ.cjs.map} +1 -1
  141. package/dist/{chunk-CDYRPI5U.js → chunk-MIJKEVV7.js} +4 -4
  142. package/dist/{chunk-CDYRPI5U.js.map → chunk-MIJKEVV7.js.map} +1 -1
  143. package/dist/{chunk-K2HHCWZO.cjs → chunk-NCX65HBY.cjs} +137 -108
  144. package/dist/chunk-NCX65HBY.cjs.map +1 -0
  145. package/dist/{chunk-6TJ6PKPS.cjs → chunk-NN3QSOVS.cjs} +27 -27
  146. package/dist/{chunk-6TJ6PKPS.cjs.map → chunk-NN3QSOVS.cjs.map} +1 -1
  147. package/dist/{chunk-F2KVJ6FF.cjs → chunk-OSZPLZIV.cjs} +179 -117
  148. package/dist/chunk-OSZPLZIV.cjs.map +1 -0
  149. package/dist/{chunk-UTTW2Q3M.cjs → chunk-OVUUTCPJ.cjs} +171 -133
  150. package/dist/chunk-OVUUTCPJ.cjs.map +1 -0
  151. package/dist/{chunk-FMPZPOUD.js → chunk-PAW2XUZN.js} +3 -3
  152. package/dist/{chunk-FMPZPOUD.js.map → chunk-PAW2XUZN.js.map} +1 -1
  153. package/dist/{chunk-5ZPRE4CV.cjs → chunk-PDGEXGS6.cjs} +204 -124
  154. package/dist/chunk-PDGEXGS6.cjs.map +1 -0
  155. package/dist/{chunk-CVNGKTHO.js → chunk-PHXITZE4.js} +4 -4
  156. package/dist/{chunk-CVNGKTHO.js.map → chunk-PHXITZE4.js.map} +1 -1
  157. package/dist/{chunk-ZPCKPLMX.cjs → chunk-QB6VMOJ2.cjs} +8 -8
  158. package/dist/{chunk-ZPCKPLMX.cjs.map → chunk-QB6VMOJ2.cjs.map} +1 -1
  159. package/dist/{chunk-5AERZSHC.cjs → chunk-QGKILWGZ.cjs} +4 -4
  160. package/dist/{chunk-5AERZSHC.cjs.map → chunk-QGKILWGZ.cjs.map} +1 -1
  161. package/dist/{chunk-ZOHCFYXE.js → chunk-QT6V3YRH.js} +3 -3
  162. package/dist/{chunk-ZOHCFYXE.js.map → chunk-QT6V3YRH.js.map} +1 -1
  163. package/dist/{chunk-XDMPDUKL.cjs → chunk-QYWINYEA.cjs} +9 -9
  164. package/dist/{chunk-XDMPDUKL.cjs.map → chunk-QYWINYEA.cjs.map} +1 -1
  165. package/dist/{chunk-3V6D5DEC.js → chunk-S4KQ5LV4.js} +3 -3
  166. package/dist/{chunk-3V6D5DEC.js.map → chunk-S4KQ5LV4.js.map} +1 -1
  167. package/dist/{chunk-6NB73BXV.js → chunk-SBPC5IP3.js} +40 -12
  168. package/dist/chunk-SBPC5IP3.js.map +1 -0
  169. package/dist/{chunk-HHBKGPEI.js → chunk-SQRD2CYF.js} +264 -21
  170. package/dist/chunk-SQRD2CYF.js.map +1 -0
  171. package/dist/{chunk-O7XVCLXW.cjs → chunk-ST3LPB2V.cjs} +324 -77
  172. package/dist/chunk-ST3LPB2V.cjs.map +1 -0
  173. package/dist/{chunk-FFQGI67R.cjs → chunk-STQ3BSED.cjs} +44 -44
  174. package/dist/{chunk-FFQGI67R.cjs.map → chunk-STQ3BSED.cjs.map} +1 -1
  175. package/dist/{chunk-JOYPNY33.js → chunk-TCRIQMBU.js} +9 -9
  176. package/dist/{chunk-JOYPNY33.js.map → chunk-TCRIQMBU.js.map} +1 -1
  177. package/dist/{chunk-ZP2KPDNN.js → chunk-TFMVL4QH.js} +3 -3
  178. package/dist/{chunk-ZP2KPDNN.js.map → chunk-TFMVL4QH.js.map} +1 -1
  179. package/dist/{chunk-4WYFRACU.js → chunk-TVLKA4AY.js} +3 -3
  180. package/dist/{chunk-4WYFRACU.js.map → chunk-TVLKA4AY.js.map} +1 -1
  181. package/dist/{chunk-X2XOQZT3.cjs → chunk-U5W4LKZV.cjs} +13 -9
  182. package/dist/chunk-U5W4LKZV.cjs.map +1 -0
  183. package/dist/{chunk-WYQILW5V.js → chunk-VITTKBWF.js} +43 -33
  184. package/dist/chunk-VITTKBWF.js.map +1 -0
  185. package/dist/{chunk-AO2WPYFZ.cjs → chunk-WBUFJ7BS.cjs} +4 -4
  186. package/dist/{chunk-AO2WPYFZ.cjs.map → chunk-WBUFJ7BS.cjs.map} +1 -1
  187. package/dist/{chunk-CI5NPLXX.js → chunk-XMYJY7NI.js} +3 -3
  188. package/dist/{chunk-CI5NPLXX.js.map → chunk-XMYJY7NI.js.map} +1 -1
  189. package/dist/{chunk-277UZV7X.cjs → chunk-XR4YZFKW.cjs} +1803 -1525
  190. package/dist/chunk-XR4YZFKW.cjs.map +1 -0
  191. package/dist/{chunk-5GV4JQNA.cjs → chunk-YNULOIR5.cjs} +43 -43
  192. package/dist/{chunk-5GV4JQNA.cjs.map → chunk-YNULOIR5.cjs.map} +1 -1
  193. package/dist/{chunk-ZBV4LQD2.cjs → chunk-ZTAJL4DT.cjs} +4 -4
  194. package/dist/{chunk-ZBV4LQD2.cjs.map → chunk-ZTAJL4DT.cjs.map} +1 -1
  195. package/dist/core/index.cjs +28 -28
  196. package/dist/core/index.d.cts +5 -5
  197. package/dist/core/index.d.ts +5 -5
  198. package/dist/core/index.js +8 -8
  199. package/dist/{ddl-Bc4Dl8fu.d.ts → ddl-D5369kOY.d.ts} +3 -3
  200. package/dist/{ddl-3unqC-kg.d.cts → ddl-eWg7hx6R.d.cts} +3 -3
  201. package/dist/{define-graph-Byslw2OO.d.cts → define-graph-DVF-oN1i.d.cts} +1 -1
  202. package/dist/{define-graph-DBFnc7u_.d.ts → define-graph-SvYXOl78.d.ts} +1 -1
  203. package/dist/graph-extension/index.cjs +20 -20
  204. package/dist/graph-extension/index.d.cts +4 -4
  205. package/dist/graph-extension/index.d.ts +4 -4
  206. package/dist/graph-extension/index.js +5 -5
  207. package/dist/graph-merge/index.cjs +104 -104
  208. package/dist/graph-merge/index.d.cts +9 -8
  209. package/dist/graph-merge/index.d.ts +9 -8
  210. package/dist/graph-merge/index.js +24 -24
  211. package/dist/{index-DQzVJBHa.d.ts → index-By89Sezh.d.ts} +37 -7
  212. package/dist/{index-DHXw7QAl.d.cts → index-DcQ3Sxs-.d.cts} +37 -7
  213. package/dist/index.cjs +210 -202
  214. package/dist/index.d.cts +13 -13
  215. package/dist/index.d.ts +13 -13
  216. package/dist/index.js +34 -34
  217. package/dist/indexes/index.cjs +13 -13
  218. package/dist/indexes/index.d.cts +4 -4
  219. package/dist/indexes/index.d.ts +4 -4
  220. package/dist/indexes/index.js +6 -6
  221. package/dist/interchange/index.cjs +49 -41
  222. package/dist/interchange/index.cjs.map +1 -1
  223. package/dist/interchange/index.d.cts +11 -11
  224. package/dist/interchange/index.d.ts +11 -11
  225. package/dist/interchange/index.js +23 -15
  226. package/dist/interchange/index.js.map +1 -1
  227. package/dist/{manager-Dl0-er1G.d.ts → manager-B0KjKE93.d.ts} +44 -6
  228. package/dist/{manager-U9_zopqr.d.cts → manager-Cn0NFIhN.d.cts} +44 -6
  229. package/dist/{materialize-indexes-BM3u0aXE.d.ts → materialize-indexes-BD4V3svD.d.ts} +1 -1
  230. package/dist/{materialize-indexes-DzMCetZe.d.cts → materialize-indexes-DVRhd5h4.d.cts} +1 -1
  231. package/dist/{postgres-C5-WMKFA.d.ts → postgres-DaEWvN4x.d.cts} +1 -1
  232. package/dist/{postgres-DpJqtbSX.d.cts → postgres-u0a0HN2D.d.ts} +1 -1
  233. package/dist/profiler/index.d.cts +10 -9
  234. package/dist/profiler/index.d.ts +10 -9
  235. package/dist/provenance/index.cjs +38 -38
  236. package/dist/provenance/index.cjs.map +1 -1
  237. package/dist/provenance/index.d.cts +7 -7
  238. package/dist/provenance/index.d.ts +7 -7
  239. package/dist/provenance/index.js +8 -8
  240. package/dist/provenance/index.js.map +1 -1
  241. package/dist/schema/index.cjs +41 -41
  242. package/dist/schema/index.d.cts +7 -7
  243. package/dist/schema/index.d.ts +7 -7
  244. package/dist/schema/index.js +14 -14
  245. package/dist/{searchable-B4mUXZT6.d.cts → searchable-BT7j9_IK.d.cts} +2 -2
  246. package/dist/{searchable-C7jmPNLT.d.ts → searchable-CnYEancP.d.ts} +2 -2
  247. package/dist/{sqlite-Da7jiYu9.d.cts → sqlite-BrMoSsI7.d.cts} +1 -1
  248. package/dist/{sqlite-Ch5tSYQY.d.ts → sqlite-CHhZUyO5.d.ts} +1 -1
  249. package/dist/{store-view-CNcOG8bQ.d.cts → store-view-Bvdku0Ht.d.ts} +199 -35
  250. package/dist/{store-view-6C2vTWqf.d.ts → store-view-w-md0nQ4.d.cts} +199 -35
  251. package/dist/{temporal-BtrTYTiB.d.ts → temporal--x9T8K4S.d.ts} +1 -1
  252. package/dist/{temporal-CMpigMCW.d.cts → temporal-BCORwUau.d.cts} +1 -1
  253. package/dist/{types-G4sVM-76.d.cts → types-6-WJmSD4.d.cts} +1 -1
  254. package/dist/{types-D2rU5Taq.d.ts → types-COODtTJU.d.ts} +1 -1
  255. package/dist/{types-Dh-EgT-w.d.ts → types-Cjvkj0jA.d.cts} +351 -12
  256. package/dist/{types-Dh-EgT-w.d.cts → types-Cjvkj0jA.d.ts} +351 -12
  257. package/dist/{where-B8Y21kig.d.ts → where-5xVawAwL.d.ts} +1 -1
  258. package/dist/{where-DbZ9XDOI.d.cts → where-CUQmCR6d.d.cts} +1 -1
  259. package/package.json +1 -1
  260. package/dist/chunk-277UZV7X.cjs.map +0 -1
  261. package/dist/chunk-2SO5I5AI.cjs.map +0 -1
  262. package/dist/chunk-42XYPKZU.js.map +0 -1
  263. package/dist/chunk-5P6IPIT6.cjs.map +0 -1
  264. package/dist/chunk-5Q3P6OIC.cjs.map +0 -1
  265. package/dist/chunk-5ZPRE4CV.cjs.map +0 -1
  266. package/dist/chunk-6NB73BXV.js.map +0 -1
  267. package/dist/chunk-DP7KC6CL.js.map +0 -1
  268. package/dist/chunk-ECU53PMN.cjs.map +0 -1
  269. package/dist/chunk-EVFL2ZY5.js.map +0 -1
  270. package/dist/chunk-F2KVJ6FF.cjs.map +0 -1
  271. package/dist/chunk-FY4VY5EV.cjs.map +0 -1
  272. package/dist/chunk-HHBKGPEI.js.map +0 -1
  273. package/dist/chunk-K2HHCWZO.cjs.map +0 -1
  274. package/dist/chunk-KTBTSHU6.cjs.map +0 -1
  275. package/dist/chunk-LQLVJWUH.js.map +0 -1
  276. package/dist/chunk-M4GYQF2H.js.map +0 -1
  277. package/dist/chunk-NXIZL7ZZ.js.map +0 -1
  278. package/dist/chunk-O7XVCLXW.cjs.map +0 -1
  279. package/dist/chunk-OYJSYDIH.js.map +0 -1
  280. package/dist/chunk-RAWG2FEU.js.map +0 -1
  281. package/dist/chunk-U3YRCZ5L.cjs +0 -12
  282. package/dist/chunk-UTTW2Q3M.cjs.map +0 -1
  283. package/dist/chunk-UZLEQFTV.js.map +0 -1
  284. package/dist/chunk-V2GZBPY2.cjs.map +0 -1
  285. package/dist/chunk-VGMNGWBR.cjs +0 -12
  286. package/dist/chunk-WYQILW5V.js.map +0 -1
  287. package/dist/chunk-X2XOQZT3.cjs.map +0 -1
  288. package/dist/chunk-YPVQYM3L.js.map +0 -1
  289. package/dist/chunk-ZIRC2U6G.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  import { compareStrings } from './chunk-DRACN6XG.js';
2
- import { META_EDGE_BRAND, getTypeName, defineEdge, defineNode } from './chunk-2HKIID5K.js';
2
+ import { META_EDGE_BRAND, getTypeName, defineEdge, defineNode } from './chunk-2Y4IFKW7.js';
3
3
  import { canonicalEqual, sortedReplacer } from './chunk-UR7W5YQK.js';
4
- import { isMissingTableError } from './chunk-CUPJL6TS.js';
5
- import { getNodeKinds, getEdgeKinds, autoDeriveVectorIndexes, mergeVectorIndexes } from './chunk-3V6D5DEC.js';
6
- import { nowIso } from './chunk-GT7NEXSU.js';
7
- import { defineNodeIndex, defineEdgeIndex } from './chunk-ZP2KPDNN.js';
4
+ import { isMissingTableError } from './chunk-B75XRV3O.js';
5
+ import { getNodeKinds, getEdgeKinds, autoDeriveVectorIndexes, mergeVectorIndexes } from './chunk-S4KQ5LV4.js';
6
+ import { nowIso } from './chunk-KCO5EFJU.js';
7
+ import { defineNodeIndex, defineEdgeIndex } from './chunk-TFMVL4QH.js';
8
8
  import { sha256Hex } from './chunk-K34OPSJK.js';
9
9
  import { requireDefined } from './chunk-QMQLUA66.js';
10
10
  import { resolveGraphVectorSlots, embedding, searchable } from './chunk-PC2UBAUB.js';
11
- import { isReachable, LEGACY_GRAPH_EXTENSION_VERSION, unwrap, validateGraphExtension, KindCollisionError, GraphExtensionUnresolvedEndpointError, computeTransitiveClosure, invertClosure } from './chunk-EQOQOT55.js';
11
+ import { isReachable, LEGACY_GRAPH_EXTENSION_VERSION, unwrap, validateGraphExtension, KindCollisionError, GraphExtensionUnresolvedEndpointError, RemoveCompileTimeKindError, KindHasReferentsError, computeTransitiveClosure, invertClosure } from './chunk-IJTLXNGJ.js';
12
12
  import { ALL_META_EDGE_NAMES, META_EDGE_IMPLIES, META_EDGE_INVERSE_OF, META_EDGE_PART_OF, META_EDGE_HAS_PART, META_EDGE_DISJOINT_WITH, META_EDGE_DIFFERENT_FROM, META_EDGE_SAME_AS, META_EDGE_EQUIVALENT_TO, META_EDGE_RELATED_TO, META_EDGE_BROADER, META_EDGE_NARROWER, META_EDGE_SUB_CLASS_OF } from './chunk-GYA4JRP5.js';
13
13
  import { compactUndefined, freezeDeep } from './chunk-ITE4IXAK.js';
14
- import { ConfigurationError, KindNotFoundError, DatabaseOperationError, MigrationError } from './chunk-OYJSYDIH.js';
14
+ import { ConfigurationError, KindNotFoundError, DatabaseOperationError, MigrationError, StaleVersionError } from './chunk-4MB3AQAQ.js';
15
15
  import { z } from 'zod';
16
16
 
17
17
  // src/ontology/core-meta-edges.ts
@@ -2133,6 +2133,183 @@ function resolveOntologyEndpoints(relation, nodeKinds) {
2133
2133
  return { ...relation, from, to };
2134
2134
  }
2135
2135
 
2136
+ // src/graph-extension/remove.ts
2137
+ function planRemovals(graph, names) {
2138
+ const document = graph.extension;
2139
+ const namesSet = new Set(names);
2140
+ if (namesSet.size === 0) {
2141
+ return { document, removedNodeKinds: [], removedEdgeKinds: [] };
2142
+ }
2143
+ const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(document);
2144
+ const compileTimeNodeNames = new Set(
2145
+ Object.keys(graph.nodes).filter((name) => !runtimeNodeNames.has(name))
2146
+ );
2147
+ const compileTimeEdgeNames = new Set(
2148
+ Object.keys(graph.edges).filter((name) => !runtimeEdgeNames.has(name))
2149
+ );
2150
+ for (const name of namesSet) {
2151
+ if (compileTimeNodeNames.has(name)) {
2152
+ throw new RemoveCompileTimeKindError(name, "node", graph.id);
2153
+ }
2154
+ if (compileTimeEdgeNames.has(name)) {
2155
+ throw new RemoveCompileTimeKindError(name, "edge", graph.id);
2156
+ }
2157
+ }
2158
+ const removedNodeKinds = [...namesSet].filter(
2159
+ (name) => runtimeNodeNames.has(name)
2160
+ );
2161
+ const explicitlyRemovedEdgeKinds = [...namesSet].filter(
2162
+ (name) => runtimeEdgeNames.has(name)
2163
+ );
2164
+ const referentsByKind = buildCompileTimeReferentIndex(
2165
+ graph,
2166
+ runtimeEdgeNames
2167
+ );
2168
+ for (const kindName of removedNodeKinds) {
2169
+ const referents = referentsByKind.get(kindName);
2170
+ if (referents !== void 0 && referents.length > 0) {
2171
+ throw new KindHasReferentsError(kindName, referents, graph.id);
2172
+ }
2173
+ }
2174
+ if (document === void 0) {
2175
+ return {
2176
+ document: void 0,
2177
+ removedNodeKinds: [],
2178
+ removedEdgeKinds: []
2179
+ };
2180
+ }
2181
+ const removedNodeKindsSet = new Set(removedNodeKinds);
2182
+ const explicitlyRemovedEdgeKindsSet = new Set(explicitlyRemovedEdgeKinds);
2183
+ const cascadeEdges = /* @__PURE__ */ new Set();
2184
+ const updatedEdges = {};
2185
+ for (const [edgeName, edgeDocument] of Object.entries(document.edges ?? {})) {
2186
+ if (explicitlyRemovedEdgeKindsSet.has(edgeName)) {
2187
+ cascadeEdges.add(edgeName);
2188
+ continue;
2189
+ }
2190
+ const newFrom = edgeDocument.from.filter(
2191
+ (kind) => !removedNodeKindsSet.has(kind)
2192
+ );
2193
+ const newTo = edgeDocument.to.filter(
2194
+ (kind) => !removedNodeKindsSet.has(kind)
2195
+ );
2196
+ if (newFrom.length === 0 || newTo.length === 0) {
2197
+ cascadeEdges.add(edgeName);
2198
+ continue;
2199
+ }
2200
+ updatedEdges[edgeName] = {
2201
+ ...edgeDocument,
2202
+ from: newFrom,
2203
+ to: newTo
2204
+ };
2205
+ }
2206
+ const updatedNodes = {};
2207
+ for (const [nodeName, nodeDocument] of Object.entries(document.nodes ?? {})) {
2208
+ if (removedNodeKindsSet.has(nodeName)) continue;
2209
+ updatedNodes[nodeName] = nodeDocument;
2210
+ }
2211
+ const survivingOntology = (document.ontology ?? []).filter(
2212
+ (relation) => !removedNodeKindsSet.has(relation.from) && !removedNodeKindsSet.has(relation.to)
2213
+ );
2214
+ const allRemovedKinds = /* @__PURE__ */ new Set([
2215
+ ...removedNodeKindsSet,
2216
+ ...cascadeEdges,
2217
+ ...explicitlyRemovedEdgeKindsSet
2218
+ ]);
2219
+ const survivingIndexes = (document.indexes ?? []).filter(
2220
+ (index) => !allRemovedKinds.has(index.kind)
2221
+ );
2222
+ const newDocument = Object.freeze({
2223
+ ...document.version === void 0 ? {} : { version: document.version },
2224
+ ...Object.keys(updatedNodes).length === 0 ? {} : { nodes: updatedNodes },
2225
+ ...Object.keys(updatedEdges).length === 0 ? {} : { edges: updatedEdges },
2226
+ ...survivingOntology.length === 0 ? {} : { ontology: survivingOntology },
2227
+ ...survivingIndexes.length === 0 ? {} : { indexes: survivingIndexes }
2228
+ });
2229
+ return {
2230
+ document: newDocument,
2231
+ removedNodeKinds,
2232
+ removedEdgeKinds: [
2233
+ ...explicitlyRemovedEdgeKinds,
2234
+ ...[...cascadeEdges].filter(
2235
+ (name) => !explicitlyRemovedEdgeKindsSet.has(name)
2236
+ )
2237
+ ]
2238
+ };
2239
+ }
2240
+ function stripGraphExtension(graph) {
2241
+ const document = graph.extension;
2242
+ if (document === void 0) return graph;
2243
+ const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(document);
2244
+ const runtimeOntologyKeys = buildGraphExtensionOntologyKeySet(document);
2245
+ const compileNodes = {};
2246
+ for (const [name, registration] of Object.entries(graph.nodes)) {
2247
+ if (runtimeNodeNames.has(name)) continue;
2248
+ compileNodes[name] = registration;
2249
+ }
2250
+ const compileEdges = {};
2251
+ for (const [name, registration] of Object.entries(graph.edges)) {
2252
+ if (runtimeEdgeNames.has(name)) continue;
2253
+ compileEdges[name] = registration;
2254
+ }
2255
+ const compileOntology = graph.ontology.filter(
2256
+ (relation) => !runtimeOntologyKeys.has(compileTimeOntologyKey(relation))
2257
+ );
2258
+ const compileIndexes = (graph.indexes ?? []).filter(
2259
+ (index) => index.origin !== "runtime"
2260
+ );
2261
+ return Object.freeze({
2262
+ ...graph,
2263
+ nodes: compileNodes,
2264
+ edges: compileEdges,
2265
+ ontology: compileOntology,
2266
+ indexes: compileIndexes.length === 0 ? void 0 : compileIndexes,
2267
+ extension: void 0
2268
+ });
2269
+ }
2270
+ function buildCompileTimeReferentIndex(graph, runtimeEdgeNames) {
2271
+ const index = /* @__PURE__ */ new Map();
2272
+ const append = (kindName, referent) => {
2273
+ const existing = index.get(kindName);
2274
+ if (existing === void 0) index.set(kindName, [referent]);
2275
+ else existing.push(referent);
2276
+ };
2277
+ for (const [edgeName, registration] of Object.entries(graph.edges)) {
2278
+ if (runtimeEdgeNames.has(edgeName)) continue;
2279
+ const reg = registration;
2280
+ const referent = {
2281
+ type: "compile-time-edge",
2282
+ name: edgeName
2283
+ };
2284
+ const seen = /* @__PURE__ */ new Set();
2285
+ for (const endpoint of reg.from ?? []) {
2286
+ if (seen.has(endpoint.kind)) continue;
2287
+ seen.add(endpoint.kind);
2288
+ append(endpoint.kind, referent);
2289
+ }
2290
+ for (const endpoint of reg.to ?? []) {
2291
+ if (seen.has(endpoint.kind)) continue;
2292
+ seen.add(endpoint.kind);
2293
+ append(endpoint.kind, referent);
2294
+ }
2295
+ }
2296
+ const runtimeOntologyKeys = buildGraphExtensionOntologyKeySet(
2297
+ graph.extension
2298
+ );
2299
+ for (const relation of graph.ontology) {
2300
+ if (runtimeOntologyKeys.has(compileTimeOntologyKey(relation))) continue;
2301
+ const fromName = getTypeName(relation.from);
2302
+ const toName = getTypeName(relation.to);
2303
+ const referent = {
2304
+ type: "compile-time-ontology",
2305
+ name: `${relation.metaEdge.name}(${fromName}, ${toName})`
2306
+ };
2307
+ append(fromName, referent);
2308
+ if (toName !== fromName) append(toName, referent);
2309
+ }
2310
+ return index;
2311
+ }
2312
+
2136
2313
  // src/registry/validate-implies.ts
2137
2314
  function validateImpliesEndpointCompatibility(edgeEndpoints, registry) {
2138
2315
  for (const [impliedEdgeKind, impliedEndpoints] of edgeEndpoints) {
@@ -2607,7 +2784,8 @@ async function loadAndMergeGraphExtensionDocument(backend, graph) {
2607
2784
  }
2608
2785
  function mergeStoredGraphExtension(graph, activeRow) {
2609
2786
  const storedSchema = parseSerializedSchema(activeRow.schema_doc);
2610
- const merged = storedSchema.extension === void 0 ? graph : mergeGraphExtension(graph, storedSchema.extension);
2787
+ const compileTimeGraph = stripGraphExtension(graph);
2788
+ const merged = storedSchema.extension === void 0 ? compileTimeGraph : mergeGraphExtension(compileTimeGraph, storedSchema.extension);
2611
2789
  return {
2612
2790
  graph: applyDeprecatedKinds(merged, storedSchema.deprecatedKinds),
2613
2791
  storedSchema
@@ -2681,8 +2859,11 @@ async function ensureSchema(backend, graph, options) {
2681
2859
  }
2682
2860
  const actions = getMigrationActions(diff);
2683
2861
  if (throwOnBreaking) {
2862
+ const removesKind = [...diff.nodes, ...diff.edges].some(
2863
+ (change) => change.type === "removed"
2864
+ );
2684
2865
  throw new MigrationError(
2685
- `Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.`,
2866
+ `Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.` + (removesKind ? ` This diff removes a kind: migrateSchema() refuses to drop one that still holds rows, so export or delete those rows first and retry.` : ""),
2686
2867
  {
2687
2868
  graphId: graph.id,
2688
2869
  fromVersion: activeSchema.version,
@@ -2786,26 +2967,91 @@ async function initializeSchema(backend, graph) {
2786
2967
  schemaDoc: schema
2787
2968
  });
2788
2969
  }
2789
- async function migrateSchema(backend, graph, currentVersion) {
2790
- const committed = await commitNewSchemaVersion(
2970
+ async function migrateSchema(backend, graph, currentVersion, options) {
2971
+ const {
2972
+ graph: target,
2973
+ storedSchema,
2974
+ activeRow
2975
+ } = await loadAndMergeGraphExtensionDocument(backend, graph);
2976
+ if (activeRow !== void 0 && activeRow.version !== currentVersion) {
2977
+ throw new StaleVersionError({
2978
+ graphId: graph.id,
2979
+ expected: currentVersion,
2980
+ actual: activeRow.version
2981
+ });
2982
+ }
2983
+ const dropped = storedSchema === void 0 ? [] : [
2984
+ ...droppedKinds(storedSchema.nodes, getNodeKinds(target), "node"),
2985
+ ...droppedKinds(storedSchema.edges, getEdgeKinds(target), "edge")
2986
+ ];
2987
+ const committed = dropped.length > 0 && options?.discardDroppedKindRows !== true ? await commitDroppedKindsOnlyWhenEmpty(
2988
+ backend,
2989
+ target,
2990
+ currentVersion,
2991
+ dropped
2992
+ ) : await commitNewSchemaVersion(backend, target, currentVersion);
2993
+ return committed.version;
2994
+ }
2995
+ async function commitDroppedKindsOnlyWhenEmpty(backend, graph, currentVersion, dropped) {
2996
+ const result = await commitNewSchemaVersionIfKindsEmpty(
2791
2997
  backend,
2792
2998
  graph,
2793
- currentVersion
2999
+ currentVersion,
3000
+ dropped
3001
+ );
3002
+ if (result.status === "committed") return result.row;
3003
+ throwPopulatedKindRemovalError(graph.id, currentVersion, result.kinds);
3004
+ }
3005
+ function throwPopulatedKindRemovalError(graphId, currentVersion, populated) {
3006
+ const named = populated.map((entry) => `${entry.entity} "${entry.kind}" (${String(entry.count)})`).join(", ");
3007
+ throw new MigrationError(
3008
+ `Refusing to commit a schema for graph "${graphId}" that drops kinds still holding rows: ${named}. Committing would make those rows unreachable, and the next materializeRemovals() would delete them. Export or delete those rows, then retry. Pass { discardDroppedKindRows: true } if losing them is the intent.`,
3009
+ {
3010
+ graphId,
3011
+ fromVersion: currentVersion,
3012
+ toVersion: currentVersion + 1,
3013
+ reason: "kind-removal",
3014
+ droppedKinds: {
3015
+ nodes: populated.filter((entry) => entry.entity === "node").map((entry) => entry.kind),
3016
+ edges: populated.filter((entry) => entry.entity === "edge").map((entry) => entry.kind)
3017
+ }
3018
+ }
2794
3019
  );
2795
- return committed.version;
3020
+ }
3021
+ function droppedKinds(committed, present, entity) {
3022
+ const kinds = new Set(present);
3023
+ return Object.keys(committed).filter((name) => !kinds.has(name)).toSorted().map((kind) => ({ kind, entity }));
2796
3024
  }
2797
3025
  async function commitNewSchemaVersion(backend, graph, currentVersion) {
3026
+ const params = await buildNewSchemaVersionCommit(graph, currentVersion);
3027
+ return backend.commitSchemaVersion(params);
3028
+ }
3029
+ async function commitNewSchemaVersionIfKindsEmpty(backend, graph, currentVersion, probes) {
3030
+ const params = await buildNewSchemaVersionCommit(graph, currentVersion);
3031
+ const commitIfKindsEmpty = backend.commitSchemaVersionIfKindsEmpty;
3032
+ if (commitIfKindsEmpty === void 0) {
3033
+ throw new ConfigurationError(
3034
+ "This backend cannot atomically fence entity writes while checking schema kind emptiness.",
3035
+ {
3036
+ code: "SCHEMA_KIND_EMPTINESS_FENCE_UNSUPPORTED",
3037
+ graphId: graph.id
3038
+ }
3039
+ );
3040
+ }
3041
+ return commitIfKindsEmpty(params, probes);
3042
+ }
3043
+ async function buildNewSchemaVersionCommit(graph, currentVersion) {
2798
3044
  buildKindRegistry(graph);
2799
3045
  const newVersion = currentVersion + 1;
2800
3046
  const schema = serializeSchema(graph, newVersion);
2801
3047
  const hash = await computeSchemaHash(schema);
2802
- return backend.commitSchemaVersion({
3048
+ return {
2803
3049
  graphId: graph.id,
2804
3050
  expected: { kind: "active", version: currentVersion },
2805
3051
  version: newVersion,
2806
3052
  schemaHash: hash,
2807
3053
  schemaDoc: schema
2808
- });
3054
+ };
2809
3055
  }
2810
3056
  async function rollbackSchema(backend, graphId, targetVersion) {
2811
3057
  const activeRow = await backend.getActiveSchema(graphId);
@@ -2855,6 +3101,6 @@ async function getCommittedSchemaVersion(backend, graphId) {
2855
3101
  return row?.version;
2856
3102
  }
2857
3103
 
2858
- export { KindRegistry, applyDeprecatedKinds, assertSchemaCurrent, broader, buildGraphExtensionOntologyKeySet, buildKindRegistry, classifySchemaChanges, commitNewSchemaVersion, compileTimeOntologyKey, computeSchemaDiff, computeSchemaHash, core, deserializeWherePredicate, differentFrom, disjointWith, ensureSchema, equivalentTo, extensionKindNames, getActiveSchema, getCommittedSchemaVersion, getMigrationActions, getSchemaChanges, hasPart, implies, initializeSchema, inverseOf, isBackwardsCompatible, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, loadAndVerifyGraph, mergeGraphExtension, migrateSchema, narrower, parseSerializedSchema, partOf, relatedTo, requiresMigration, rollbackSchema, sameAs, serializeIndexDeclaration, serializeSchema, serializeSchemaProperties, subClassOf, validateImpliesEndpointCompatibility };
2859
- //# sourceMappingURL=chunk-RAWG2FEU.js.map
2860
- //# sourceMappingURL=chunk-RAWG2FEU.js.map
3104
+ export { KindRegistry, applyDeprecatedKinds, assertSchemaCurrent, broader, buildGraphExtensionOntologyKeySet, buildKindRegistry, classifySchemaChanges, commitNewSchemaVersion, commitNewSchemaVersionIfKindsEmpty, compileTimeOntologyKey, computeSchemaDiff, computeSchemaHash, core, deserializeWherePredicate, differentFrom, disjointWith, ensureSchema, equivalentTo, extensionKindNames, getActiveSchema, getCommittedSchemaVersion, getMigrationActions, getSchemaChanges, hasPart, implies, initializeSchema, inverseOf, isBackwardsCompatible, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, loadAndVerifyGraph, mergeGraphExtension, migrateSchema, narrower, parseSerializedSchema, partOf, planRemovals, relatedTo, requiresMigration, rollbackSchema, sameAs, serializeIndexDeclaration, serializeSchema, serializeSchemaProperties, stripGraphExtension, subClassOf, validateImpliesEndpointCompatibility };
3105
+ //# sourceMappingURL=chunk-BEFM74L2.js.map
3106
+ //# sourceMappingURL=chunk-BEFM74L2.js.map