@nicia-ai/typegraph 0.33.0 → 0.35.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 (284) hide show
  1. package/README.md +20 -0
  2. package/dist/backend/postgres/index.cjs +30 -26
  3. package/dist/backend/postgres/index.d.cts +39 -7
  4. package/dist/backend/postgres/index.d.ts +39 -7
  5. package/dist/backend/postgres/index.js +17 -13
  6. package/dist/backend/postgres/pglite.cjs +22 -18
  7. package/dist/backend/postgres/pglite.cjs.map +1 -1
  8. package/dist/backend/postgres/pglite.d.cts +4 -4
  9. package/dist/backend/postgres/pglite.d.ts +4 -4
  10. package/dist/backend/postgres/pglite.js +17 -13
  11. package/dist/backend/postgres/pglite.js.map +1 -1
  12. package/dist/backend/sqlite/index.cjs +26 -23
  13. package/dist/backend/sqlite/index.d.cts +8 -8
  14. package/dist/backend/sqlite/index.d.ts +8 -8
  15. package/dist/backend/sqlite/index.js +14 -11
  16. package/dist/backend/sqlite/libsql.cjs +21 -17
  17. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  18. package/dist/backend/sqlite/libsql.d.cts +13 -6
  19. package/dist/backend/sqlite/libsql.d.ts +13 -6
  20. package/dist/backend/sqlite/libsql.js +17 -13
  21. package/dist/backend/sqlite/libsql.js.map +1 -1
  22. package/dist/backend/sqlite/local.cjs +102 -18
  23. package/dist/backend/sqlite/local.cjs.map +1 -1
  24. package/dist/backend/sqlite/local.d.cts +95 -5
  25. package/dist/backend/sqlite/local.d.ts +95 -5
  26. package/dist/backend/sqlite/local.js +96 -13
  27. package/dist/backend/sqlite/local.js.map +1 -1
  28. package/dist/{chunk-JHOBXD7O.js → chunk-3TWF3SH4.js} +332 -64
  29. package/dist/chunk-3TWF3SH4.js.map +1 -0
  30. package/dist/chunk-4JEZZJ6S.cjs +1271 -0
  31. package/dist/chunk-4JEZZJ6S.cjs.map +1 -0
  32. package/dist/{chunk-I4W7MKVG.cjs → chunk-4TOD4LBZ.cjs} +249 -294
  33. package/dist/chunk-4TOD4LBZ.cjs.map +1 -0
  34. package/dist/chunk-55MZDDZV.js +239 -0
  35. package/dist/chunk-55MZDDZV.js.map +1 -0
  36. package/dist/{chunk-LM2IC4ZJ.cjs → chunk-5A6FNS6N.cjs} +75 -19
  37. package/dist/chunk-5A6FNS6N.cjs.map +1 -0
  38. package/dist/{chunk-FDN43KXV.cjs → chunk-5AQIKK56.cjs} +65 -24
  39. package/dist/chunk-5AQIKK56.cjs.map +1 -0
  40. package/dist/{chunk-IZ4PCL47.js → chunk-5SEGFTZX.js} +4 -66
  41. package/dist/chunk-5SEGFTZX.js.map +1 -0
  42. package/dist/{chunk-CWFPJ3RC.js → chunk-6FR2MMS6.js} +7 -7
  43. package/dist/chunk-6FR2MMS6.js.map +1 -0
  44. package/dist/chunk-7YSP4V4R.cjs +69 -0
  45. package/dist/chunk-7YSP4V4R.cjs.map +1 -0
  46. package/dist/chunk-A42GCBGX.cjs +28 -0
  47. package/dist/chunk-A42GCBGX.cjs.map +1 -0
  48. package/dist/chunk-ACSVZPK7.cjs +21 -0
  49. package/dist/chunk-ACSVZPK7.cjs.map +1 -0
  50. package/dist/{chunk-OIE2UPVG.cjs → chunk-BLZDPRXT.cjs} +52 -21
  51. package/dist/chunk-BLZDPRXT.cjs.map +1 -0
  52. package/dist/chunk-BYPOGQWK.js +25 -0
  53. package/dist/chunk-BYPOGQWK.js.map +1 -0
  54. package/dist/{chunk-NG5N7R45.cjs → chunk-CK5BVQOW.cjs} +325 -213
  55. package/dist/chunk-CK5BVQOW.cjs.map +1 -0
  56. package/dist/chunk-CTTSDJLY.cjs +261 -0
  57. package/dist/chunk-CTTSDJLY.cjs.map +1 -0
  58. package/dist/chunk-CUHM5CWJ.cjs +12 -0
  59. package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
  60. package/dist/chunk-CZQ3FO2Q.js +2320 -0
  61. package/dist/chunk-CZQ3FO2Q.js.map +1 -0
  62. package/dist/{chunk-CFNT3ITG.cjs → chunk-D7ZEOS56.cjs} +25 -52
  63. package/dist/chunk-D7ZEOS56.cjs.map +1 -0
  64. package/dist/chunk-DFVLCOP6.js +10 -0
  65. package/dist/chunk-DFVLCOP6.js.map +1 -0
  66. package/dist/chunk-DI74SMXS.cjs +29 -0
  67. package/dist/chunk-DI74SMXS.cjs.map +1 -0
  68. package/dist/{chunk-KY5SDVA7.cjs → chunk-EM3CWPND.cjs} +442 -113
  69. package/dist/chunk-EM3CWPND.cjs.map +1 -0
  70. package/dist/chunk-EMF62TZG.cjs +1176 -0
  71. package/dist/chunk-EMF62TZG.cjs.map +1 -0
  72. package/dist/chunk-EOLERH7Y.cjs +40 -0
  73. package/dist/chunk-EOLERH7Y.cjs.map +1 -0
  74. package/dist/{chunk-3QRBXYT5.cjs → chunk-FACJJWGF.cjs} +24 -6
  75. package/dist/chunk-FACJJWGF.cjs.map +1 -0
  76. package/dist/{chunk-KTIEB7VH.cjs → chunk-FL472AMI.cjs} +49 -165
  77. package/dist/chunk-FL472AMI.cjs.map +1 -0
  78. package/dist/{chunk-4RBAJVEC.cjs → chunk-FN35DLCN.cjs} +31 -9
  79. package/dist/chunk-FN35DLCN.cjs.map +1 -0
  80. package/dist/{chunk-C4C4Q7A6.js → chunk-FPIZFYHE.js} +12 -35
  81. package/dist/chunk-FPIZFYHE.js.map +1 -0
  82. package/dist/{chunk-XKNAK27R.js → chunk-FRV5Q5IO.js} +64 -8
  83. package/dist/chunk-FRV5Q5IO.js.map +1 -0
  84. package/dist/{chunk-K5P5OZXS.js → chunk-G6Q5UM7U.js} +2 -2
  85. package/dist/{chunk-K5P5OZXS.js.map → chunk-G6Q5UM7U.js.map} +1 -1
  86. package/dist/chunk-GSQ6NPH6.cjs +100 -0
  87. package/dist/chunk-GSQ6NPH6.cjs.map +1 -0
  88. package/dist/chunk-GUR2FNB5.cjs +12 -0
  89. package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-GUR2FNB5.cjs.map} +1 -1
  90. package/dist/{chunk-ZFWNO3GE.cjs → chunk-H7YNSMA7.cjs} +107 -2
  91. package/dist/chunk-H7YNSMA7.cjs.map +1 -0
  92. package/dist/{chunk-GYVBEZAO.js → chunk-I7ZUZKFD.js} +47 -19
  93. package/dist/chunk-I7ZUZKFD.js.map +1 -0
  94. package/dist/chunk-ITE4IXAK.js +25 -0
  95. package/dist/chunk-ITE4IXAK.js.map +1 -0
  96. package/dist/{chunk-D3EWZ67S.cjs → chunk-J7WFGBJR.cjs} +3372 -4970
  97. package/dist/chunk-J7WFGBJR.cjs.map +1 -0
  98. package/dist/{chunk-PYD3UCDU.js → chunk-JBTOYDMN.js} +202 -251
  99. package/dist/chunk-JBTOYDMN.js.map +1 -0
  100. package/dist/{chunk-XVUJY72M.js → chunk-K3PPLHY7.js} +234 -118
  101. package/dist/chunk-K3PPLHY7.js.map +1 -0
  102. package/dist/{chunk-454I6GDF.js → chunk-KBGQIPRQ.js} +102 -3
  103. package/dist/chunk-KBGQIPRQ.js.map +1 -0
  104. package/dist/chunk-KMI7LYAF.js +1252 -0
  105. package/dist/chunk-KMI7LYAF.js.map +1 -0
  106. package/dist/{chunk-JIEJCTDS.cjs → chunk-LGEALRC6.cjs} +21 -4
  107. package/dist/chunk-LGEALRC6.cjs.map +1 -0
  108. package/dist/{chunk-TQOYM4LN.js → chunk-MP2JQKSG.js} +21 -5
  109. package/dist/chunk-MP2JQKSG.js.map +1 -0
  110. package/dist/{chunk-3642VBVC.cjs → chunk-O7UN7OXA.cjs} +389 -121
  111. package/dist/chunk-O7UN7OXA.cjs.map +1 -0
  112. package/dist/chunk-OHMP6N2J.js +47 -0
  113. package/dist/chunk-OHMP6N2J.js.map +1 -0
  114. package/dist/{chunk-6NRFUHMS.js → chunk-OR5ZA5WP.js} +135 -24
  115. package/dist/chunk-OR5ZA5WP.js.map +1 -0
  116. package/dist/{chunk-PRMKPFN5.js → chunk-Q5TEXCTB.js} +61 -6
  117. package/dist/chunk-Q5TEXCTB.js.map +1 -0
  118. package/dist/chunk-QNKSQTKQ.js +1312 -0
  119. package/dist/chunk-QNKSQTKQ.js.map +1 -0
  120. package/dist/{chunk-YCV72E6L.js → chunk-QOTI55H7.js} +7 -116
  121. package/dist/chunk-QOTI55H7.js.map +1 -0
  122. package/dist/{chunk-QBYTJSAY.js → chunk-QWEUYILR.js} +99 -34
  123. package/dist/chunk-QWEUYILR.js.map +1 -0
  124. package/dist/{chunk-OS6KS3HV.js → chunk-RGP33ZJ5.js} +485 -82
  125. package/dist/chunk-RGP33ZJ5.js.map +1 -0
  126. package/dist/chunk-RGPG7EOJ.js +94 -0
  127. package/dist/chunk-RGPG7EOJ.js.map +1 -0
  128. package/dist/{chunk-WWVV44DY.cjs → chunk-S55OV6PW.cjs} +15 -15
  129. package/dist/chunk-S55OV6PW.cjs.map +1 -0
  130. package/dist/{chunk-3E7SNSIA.cjs → chunk-SJDMVITW.cjs} +4 -4
  131. package/dist/{chunk-3E7SNSIA.cjs.map → chunk-SJDMVITW.cjs.map} +1 -1
  132. package/dist/{chunk-XLUNB2TZ.js → chunk-SNXVDZAJ.js} +3 -3
  133. package/dist/{chunk-XLUNB2TZ.js.map → chunk-SNXVDZAJ.js.map} +1 -1
  134. package/dist/{chunk-CEF2QOTO.js → chunk-T2WUSPDA.js} +49 -8
  135. package/dist/chunk-T2WUSPDA.js.map +1 -0
  136. package/dist/{chunk-YW7GHMF4.cjs → chunk-TCOCYN2P.cjs} +75 -20
  137. package/dist/chunk-TCOCYN2P.cjs.map +1 -0
  138. package/dist/{chunk-FLRCVI2G.cjs → chunk-TDXIBCGY.cjs} +2 -2
  139. package/dist/{chunk-FLRCVI2G.cjs.map → chunk-TDXIBCGY.cjs.map} +1 -1
  140. package/dist/chunk-TEDRJXOG.cjs +32 -0
  141. package/dist/chunk-TEDRJXOG.cjs.map +1 -0
  142. package/dist/{chunk-WLP6TKFB.js → chunk-UES55P7G.js} +2809 -4398
  143. package/dist/chunk-UES55P7G.js.map +1 -0
  144. package/dist/{chunk-EF3Z645U.cjs → chunk-UMDVATGY.cjs} +6 -72
  145. package/dist/chunk-UMDVATGY.cjs.map +1 -0
  146. package/dist/chunk-UR7W5YQK.js +18 -0
  147. package/dist/chunk-UR7W5YQK.js.map +1 -0
  148. package/dist/chunk-UT3S4SEN.js +31 -0
  149. package/dist/chunk-UT3S4SEN.js.map +1 -0
  150. package/dist/{chunk-3IR2GEMJ.cjs → chunk-UUT7UN2N.cjs} +149 -38
  151. package/dist/chunk-UUT7UN2N.cjs.map +1 -0
  152. package/dist/{chunk-PIHXFF73.js → chunk-UZV3AZKF.js} +21 -3
  153. package/dist/chunk-UZV3AZKF.js.map +1 -0
  154. package/dist/{chunk-DJYRRDHA.js → chunk-VHMPG6UL.js} +29 -7
  155. package/dist/chunk-VHMPG6UL.js.map +1 -0
  156. package/dist/{chunk-MBLXCV2Y.cjs → chunk-VPYHY3LJ.cjs} +111 -43
  157. package/dist/chunk-VPYHY3LJ.cjs.map +1 -0
  158. package/dist/{chunk-WYTUF3QO.js → chunk-VSPCZAXF.js} +3 -3
  159. package/dist/{chunk-WYTUF3QO.js.map → chunk-VSPCZAXF.js.map} +1 -1
  160. package/dist/chunk-W63OVYY4.js +29 -0
  161. package/dist/chunk-W63OVYY4.js.map +1 -0
  162. package/dist/{chunk-UPDMJEW6.js → chunk-WDBCBWC4.js} +356 -30
  163. package/dist/chunk-WDBCBWC4.js.map +1 -0
  164. package/dist/chunk-WJT7OU7E.cjs +1334 -0
  165. package/dist/chunk-WJT7OU7E.cjs.map +1 -0
  166. package/dist/chunk-XOX22WHL.cjs +2383 -0
  167. package/dist/chunk-XOX22WHL.cjs.map +1 -0
  168. package/dist/{ddl-CVnHJcar.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
  169. package/dist/{ddl-Dxt_fBHr.d.cts → ddl-CZz7a0E8.d.cts} +4 -4
  170. package/dist/{extension-types-YGFJPrzK.d.cts → extension-types-ixRpJVUp.d.cts} +24 -1
  171. package/dist/{extension-types-YGFJPrzK.d.ts → extension-types-ixRpJVUp.d.ts} +24 -1
  172. package/dist/{types-DGylBhWo.d.ts → fulltext-strategy-B57yvC5Q.d.ts} +2558 -2125
  173. package/dist/{types-C_UnQOQp.d.cts → fulltext-strategy-CDkSSYhq.d.cts} +2558 -2125
  174. package/dist/graph-extension/index.cjs +21 -19
  175. package/dist/graph-extension/index.d.cts +4 -4
  176. package/dist/graph-extension/index.d.ts +4 -4
  177. package/dist/graph-extension/index.js +6 -4
  178. package/dist/graph-merge/index.cjs +408 -169
  179. package/dist/graph-merge/index.cjs.map +1 -1
  180. package/dist/graph-merge/index.d.cts +63 -33
  181. package/dist/graph-merge/index.d.ts +63 -33
  182. package/dist/graph-merge/index.js +286 -47
  183. package/dist/graph-merge/index.js.map +1 -1
  184. package/dist/{index-DGX6D9j1.d.ts → index-6CSUAq-x.d.ts} +234 -93
  185. package/dist/{index-SEvUHDA6.d.cts → index-Bks_3HHK.d.cts} +234 -93
  186. package/dist/index.cjs +240 -211
  187. package/dist/index.cjs.map +1 -1
  188. package/dist/index.d.cts +11 -11
  189. package/dist/index.d.ts +11 -11
  190. package/dist/index.js +35 -27
  191. package/dist/index.js.map +1 -1
  192. package/dist/indexes/index.cjs +28 -27
  193. package/dist/indexes/index.d.cts +5 -5
  194. package/dist/indexes/index.d.ts +5 -5
  195. package/dist/indexes/index.js +10 -9
  196. package/dist/interchange/index.cjs +47 -17
  197. package/dist/interchange/index.d.cts +126 -12
  198. package/dist/interchange/index.d.ts +126 -12
  199. package/dist/interchange/index.js +14 -4
  200. package/dist/{manager-BYl_zyZR.d.cts → manager-DwQi8eV0.d.cts} +9 -2
  201. package/dist/{manager-C0_r0ALf.d.ts → manager-ejUCB52T.d.ts} +9 -2
  202. package/dist/{materialize-indexes-D20xNluI.d.cts → materialize-indexes-B4e9360H.d.cts} +20 -4
  203. package/dist/{materialize-indexes-CAkIYFV-.d.ts → materialize-indexes-te9TPMMJ.d.ts} +20 -4
  204. package/dist/{postgres-_9psmVGm.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
  205. package/dist/{postgres-MzBPkYzq.d.ts → postgres-DQ5R6rzV.d.ts} +152 -1
  206. package/dist/profiler/index.cjs +11 -11
  207. package/dist/profiler/index.d.cts +7 -7
  208. package/dist/profiler/index.d.ts +7 -7
  209. package/dist/profiler/index.js +4 -4
  210. package/dist/provenance/index.cjs +590 -0
  211. package/dist/provenance/index.cjs.map +1 -0
  212. package/dist/provenance/index.d.cts +73 -0
  213. package/dist/provenance/index.d.ts +73 -0
  214. package/dist/provenance/index.js +588 -0
  215. package/dist/provenance/index.js.map +1 -0
  216. package/dist/schema/index.cjs +55 -38
  217. package/dist/schema/index.cjs.map +1 -1
  218. package/dist/schema/index.d.cts +57 -57
  219. package/dist/schema/index.d.ts +57 -57
  220. package/dist/schema/index.js +30 -13
  221. package/dist/schema/index.js.map +1 -1
  222. package/dist/{sqlite-gm44dShb.d.ts → sqlite-D7zBinNR.d.cts} +92 -1
  223. package/dist/{sqlite-BfksSb45.d.cts → sqlite-DvQndLky.d.ts} +92 -1
  224. package/dist/{store-view-FfE5_7eo.d.ts → store-view-BSpqvAxK.d.cts} +445 -46
  225. package/dist/{store-view-9jQ2rPum.d.cts → store-view-CKbHFRnn.d.ts} +445 -46
  226. package/dist/{types-B6mhrcLv.d.cts → types-Bv9DcS_E.d.cts} +2 -2
  227. package/dist/{types-CdWxK-nD.d.ts → types-CoxuV7EJ.d.ts} +2 -2
  228. package/dist/{where-Bpp2ul_z.d.cts → where-7RKFOsXt.d.ts} +2 -2
  229. package/dist/{where-BsEXraKW.d.ts → where-DdMIXOtH.d.cts} +2 -2
  230. package/package.json +21 -14
  231. package/dist/chunk-2YMGNYXY.js +0 -40
  232. package/dist/chunk-2YMGNYXY.js.map +0 -1
  233. package/dist/chunk-3642VBVC.cjs.map +0 -1
  234. package/dist/chunk-3EUKJEQ3.js +0 -77
  235. package/dist/chunk-3EUKJEQ3.js.map +0 -1
  236. package/dist/chunk-3IR2GEMJ.cjs.map +0 -1
  237. package/dist/chunk-3QRBXYT5.cjs.map +0 -1
  238. package/dist/chunk-454I6GDF.js.map +0 -1
  239. package/dist/chunk-4RBAJVEC.cjs.map +0 -1
  240. package/dist/chunk-6NRFUHMS.js.map +0 -1
  241. package/dist/chunk-6ZR4QC3O.cjs +0 -12
  242. package/dist/chunk-73KASJGO.cjs +0 -52
  243. package/dist/chunk-73KASJGO.cjs.map +0 -1
  244. package/dist/chunk-BF3ZDEUE.cjs +0 -773
  245. package/dist/chunk-BF3ZDEUE.cjs.map +0 -1
  246. package/dist/chunk-C4C4Q7A6.js.map +0 -1
  247. package/dist/chunk-CEF2QOTO.js.map +0 -1
  248. package/dist/chunk-CFNT3ITG.cjs.map +0 -1
  249. package/dist/chunk-CWFPJ3RC.js.map +0 -1
  250. package/dist/chunk-D3EWZ67S.cjs.map +0 -1
  251. package/dist/chunk-DJYRRDHA.js.map +0 -1
  252. package/dist/chunk-EF3Z645U.cjs.map +0 -1
  253. package/dist/chunk-FDN43KXV.cjs.map +0 -1
  254. package/dist/chunk-GYVBEZAO.js.map +0 -1
  255. package/dist/chunk-HTGDWIDE.cjs +0 -89
  256. package/dist/chunk-HTGDWIDE.cjs.map +0 -1
  257. package/dist/chunk-I4W7MKVG.cjs.map +0 -1
  258. package/dist/chunk-IZ4PCL47.js.map +0 -1
  259. package/dist/chunk-JHOBXD7O.js.map +0 -1
  260. package/dist/chunk-JIEJCTDS.cjs.map +0 -1
  261. package/dist/chunk-KTIEB7VH.cjs.map +0 -1
  262. package/dist/chunk-KY5SDVA7.cjs.map +0 -1
  263. package/dist/chunk-LM2IC4ZJ.cjs.map +0 -1
  264. package/dist/chunk-MBLXCV2Y.cjs.map +0 -1
  265. package/dist/chunk-NG5N7R45.cjs.map +0 -1
  266. package/dist/chunk-OIE2UPVG.cjs.map +0 -1
  267. package/dist/chunk-OS6KS3HV.js.map +0 -1
  268. package/dist/chunk-PIHXFF73.js.map +0 -1
  269. package/dist/chunk-PRMKPFN5.js.map +0 -1
  270. package/dist/chunk-PYD3UCDU.js.map +0 -1
  271. package/dist/chunk-QBYTJSAY.js.map +0 -1
  272. package/dist/chunk-SPT5JMME.js +0 -610
  273. package/dist/chunk-SPT5JMME.js.map +0 -1
  274. package/dist/chunk-SST7XDY6.cjs +0 -624
  275. package/dist/chunk-SST7XDY6.cjs.map +0 -1
  276. package/dist/chunk-TQOYM4LN.js.map +0 -1
  277. package/dist/chunk-UPDMJEW6.js.map +0 -1
  278. package/dist/chunk-WLP6TKFB.js.map +0 -1
  279. package/dist/chunk-WWVV44DY.cjs.map +0 -1
  280. package/dist/chunk-XKNAK27R.js.map +0 -1
  281. package/dist/chunk-XVUJY72M.js.map +0 -1
  282. package/dist/chunk-YCV72E6L.js.map +0 -1
  283. package/dist/chunk-YW7GHMF4.cjs.map +0 -1
  284. package/dist/chunk-ZFWNO3GE.cjs.map +0 -1
@@ -1,11 +1,13 @@
1
- import { NODE_TYPE_BRAND, EDGE_TYPE_BRAND, nowIso, getNodeKinds, getEdgeKinds, autoDeriveVectorIndexes, mergeVectorIndexes } from './chunk-QBYTJSAY.js';
2
- import { defineNodeIndex, defineEdgeIndex } from './chunk-6NRFUHMS.js';
3
- import { searchable } from './chunk-IZ4PCL47.js';
4
- import { embedding } from './chunk-454I6GDF.js';
5
- 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, assertJsonValue, isReachable, computeTransitiveClosure, invertClosure, LEGACY_GRAPH_EXTENSION_VERSION, unwrap, validateGraphExtension, compactUndefined, KindCollisionError, GraphExtensionUnresolvedEndpointError, freezeDeep, assertSchemaKeysAreFree, RESERVED_NODE_KEYS, RESERVED_EDGE_KEYS } from './chunk-YCV72E6L.js';
6
- import { canonicalEqual, sortedReplacer, isMissingTableError } from './chunk-GYVBEZAO.js';
7
- import { sha256Hex } from './chunk-2YMGNYXY.js';
8
- import { ConfigurationError, KindNotFoundError, DatabaseOperationError, MigrationError, ValidationError } from './chunk-TQOYM4LN.js';
1
+ import { canonicalEqual, sortedReplacer } from './chunk-UR7W5YQK.js';
2
+ import { NODE_TYPE_BRAND, EDGE_TYPE_BRAND, getNodeKinds, getEdgeKinds, autoDeriveVectorIndexes, mergeVectorIndexes } from './chunk-QWEUYILR.js';
3
+ import { defineNodeIndex, defineEdgeIndex } from './chunk-OR5ZA5WP.js';
4
+ import { sha256Hex } from './chunk-W63OVYY4.js';
5
+ 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, assertJsonValue, isReachable, LEGACY_GRAPH_EXTENSION_VERSION, unwrap, validateGraphExtension, KindCollisionError, GraphExtensionUnresolvedEndpointError, computeTransitiveClosure, invertClosure } from './chunk-QOTI55H7.js';
6
+ import { assertSchemaKeysAreFree, RESERVED_NODE_KEYS, RESERVED_EDGE_KEYS } from './chunk-RGPG7EOJ.js';
7
+ import { nowIso, isMissingTableError } from './chunk-I7ZUZKFD.js';
8
+ import { embedding, searchable } from './chunk-KBGQIPRQ.js';
9
+ import { compactUndefined, freezeDeep } from './chunk-ITE4IXAK.js';
10
+ import { ConfigurationError, KindNotFoundError, DatabaseOperationError, MigrationError } from './chunk-MP2JQKSG.js';
9
11
  import { z } from 'zod';
10
12
 
11
13
  // src/core/node.ts
@@ -345,24 +347,10 @@ function diffNodes(before, after) {
345
347
  function diffNodeDef(name, before, after) {
346
348
  const changes = [];
347
349
  if (!canonicalEqual(before.properties, after.properties)) {
348
- const beforeProps = before.properties.properties ?? {};
349
- const afterProps = after.properties.properties ?? {};
350
- const beforeRequired = new Set(before.properties.required);
351
- const afterRequired = new Set(after.properties.required);
352
- const addedProps = Object.keys(afterProps).filter(
353
- (p) => !(p in beforeProps)
354
- );
355
- const removedProps = Object.keys(beforeProps).filter(
356
- (p) => !(p in afterProps)
357
- );
358
- const newRequired = [...afterRequired].filter(
359
- (p) => !beforeRequired.has(p)
360
- );
361
- const { severity, details } = computePropertyChangeSeverity(
350
+ const { severity, details } = classifyPropertyChanges(
362
351
  name,
363
- removedProps,
364
- addedProps,
365
- newRequired
352
+ before.properties,
353
+ after.properties
366
354
  );
367
355
  changes.push({
368
356
  type: "modified",
@@ -405,29 +393,103 @@ function diffNodeDef(name, before, after) {
405
393
  }
406
394
  return changes;
407
395
  }
408
- function computePropertyChangeSeverity(name, removedProps, addedProps, newRequired) {
409
- if (removedProps.length > 0) {
396
+ function propertyTypeSignature(schema) {
397
+ if (schema.type !== void 0) return JSON.stringify(schema.type);
398
+ if (schema.const !== void 0) return "const";
399
+ if (schema.enum !== void 0) return "enum";
400
+ if (schema.anyOf !== void 0) return "anyOf";
401
+ if (schema.oneOf !== void 0) return "oneOf";
402
+ if (schema.allOf !== void 0) return "allOf";
403
+ return "unknown";
404
+ }
405
+ var NON_CONSTRAINING_KEYWORDS = /* @__PURE__ */ new Set([
406
+ "description",
407
+ "title",
408
+ "default",
409
+ "$schema"
410
+ ]);
411
+ function stripSchemaMetadata(schema) {
412
+ const stripped = {};
413
+ for (const [key, value] of Object.entries(schema)) {
414
+ if (!NON_CONSTRAINING_KEYWORDS.has(key)) stripped[key] = value;
415
+ }
416
+ return stripped;
417
+ }
418
+ function isObjectSchema(schema) {
419
+ return schema.type === "object" || schema.properties !== void 0;
420
+ }
421
+ function isBreakingPropertyChange(before, after) {
422
+ if (canonicalEqual(stripSchemaMetadata(before), stripSchemaMetadata(after))) {
423
+ return false;
424
+ }
425
+ if (propertyTypeSignature(before) !== propertyTypeSignature(after)) {
426
+ return true;
427
+ }
428
+ if (isObjectSchema(before) && isObjectSchema(after)) {
429
+ return isBreakingObjectSchemaChange(before, after);
430
+ }
431
+ return true;
432
+ }
433
+ function isBreakingObjectSchemaChange(before, after) {
434
+ const beforeProps = before.properties ?? {};
435
+ const afterProps = after.properties ?? {};
436
+ const beforeRequired = new Set(before.required);
437
+ const afterRequired = new Set(after.required);
438
+ for (const key of Object.keys(beforeProps)) {
439
+ if (!(key in afterProps)) return true;
440
+ }
441
+ for (const key of afterRequired) {
442
+ if (!beforeRequired.has(key)) return true;
443
+ }
444
+ for (const [key, beforeChild] of Object.entries(beforeProps)) {
445
+ const afterChild = afterProps[key];
446
+ if (afterChild === void 0) continue;
447
+ if (isBreakingPropertyChange(beforeChild, afterChild)) return true;
448
+ }
449
+ return false;
450
+ }
451
+ function classifyPropertyChanges(kind, before, after) {
452
+ const beforeProps = before.properties ?? {};
453
+ const afterProps = after.properties ?? {};
454
+ const beforeRequired = new Set(before.required);
455
+ const afterRequired = new Set(after.required);
456
+ const removed = Object.keys(beforeProps).filter((p) => !(p in afterProps));
457
+ const added = Object.keys(afterProps).filter((p) => !(p in beforeProps));
458
+ const newRequired = [...afterRequired].filter((p) => !beforeRequired.has(p));
459
+ const breakingProps = [];
460
+ for (const [property, beforeProperty] of Object.entries(beforeProps)) {
461
+ const afterProperty = afterProps[property];
462
+ if (afterProperty === void 0) continue;
463
+ if (canonicalEqual(beforeProperty, afterProperty)) continue;
464
+ if (isBreakingPropertyChange(beforeProperty, afterProperty)) {
465
+ breakingProps.push(property);
466
+ }
467
+ }
468
+ if (removed.length > 0) {
469
+ return {
470
+ severity: "breaking",
471
+ details: `Properties removed from "${kind}": ${removed.join(", ")}`
472
+ };
473
+ }
474
+ if (breakingProps.length > 0) {
410
475
  return {
411
476
  severity: "breaking",
412
- details: `Properties removed from "${name}": ${removedProps.join(", ")}`
477
+ details: `Property schemas changed incompatibly in "${kind}": ${breakingProps.join(", ")}`
413
478
  };
414
479
  }
415
480
  if (newRequired.length > 0) {
416
481
  return {
417
482
  severity: "breaking",
418
- details: `New required properties in "${name}": ${newRequired.join(", ")}`
483
+ details: `New required properties in "${kind}": ${newRequired.join(", ")}`
419
484
  };
420
485
  }
421
- if (addedProps.length > 0) {
486
+ if (added.length > 0) {
422
487
  return {
423
488
  severity: "safe",
424
- details: `Properties added to "${name}": ${addedProps.join(", ")}`
489
+ details: `Properties added to "${kind}": ${added.join(", ")}`
425
490
  };
426
491
  }
427
- return {
428
- severity: "safe",
429
- details: `Properties changed in "${name}"`
430
- };
492
+ return { severity: "safe", details: `Properties changed in "${kind}"` };
431
493
  }
432
494
  function diffEdges(before, after) {
433
495
  const changes = [];
@@ -498,11 +560,16 @@ function diffEdgeDef(name, before, after) {
498
560
  });
499
561
  }
500
562
  if (!canonicalEqual(before.properties, after.properties)) {
563
+ const { severity, details } = classifyPropertyChanges(
564
+ name,
565
+ before.properties,
566
+ after.properties
567
+ );
501
568
  changes.push({
502
569
  type: "modified",
503
570
  kind: name,
504
- severity: "safe",
505
- details: `Properties changed for "${name}"`,
571
+ severity,
572
+ details,
506
573
  before,
507
574
  after
508
575
  });
@@ -958,6 +1025,17 @@ var KindRegistry = class {
958
1025
  if (concreteKind === targetKind) return true;
959
1026
  return this.isSubClassOf(concreteKind, targetKind);
960
1027
  }
1028
+ /**
1029
+ * Checks if a concrete kind is assignable to at least one of the given
1030
+ * target kinds. Shared by every "is this kind usable where one of these
1031
+ * kinds is expected" check (edge endpoint validation, ontology relation
1032
+ * endpoint compatibility) so they can't independently drift.
1033
+ */
1034
+ isAssignableToAny(concreteKind, targetKinds) {
1035
+ return targetKinds.some(
1036
+ (targetKind) => this.isAssignableTo(concreteKind, targetKind)
1037
+ );
1038
+ }
961
1039
  /**
962
1040
  * Validates that a kind exists in the registry.
963
1041
  */
@@ -1245,6 +1323,16 @@ function serializeNodeIndexDeclaration(declaration) {
1245
1323
  unique: declaration.unique,
1246
1324
  scope: declaration.scope,
1247
1325
  where: declaration.where,
1326
+ // `method: "btree"` is canonicalized by absence, like `origin` below.
1327
+ ...declaration.method === void 0 ? {} : { method: declaration.method },
1328
+ // `keySystemColumns: []` is canonicalized by absence, same rule. Checked
1329
+ // against length, not just `undefined` — `NodeIndexDeclaration` is
1330
+ // exported and `defineGraph` accepts pre-built declarations directly
1331
+ // (bypassing `defineNodeIndex`'s own canonicalization and the
1332
+ // `nodeIndexDeclarationZod` parse boundary, which rejects an explicit
1333
+ // `[]` via `.min(1)`), so an in-memory declaration can still carry a
1334
+ // present-but-empty array that must canonicalize to absent here.
1335
+ ...declaration.keySystemColumns === void 0 || declaration.keySystemColumns.length === 0 ? {} : { keySystemColumns: declaration.keySystemColumns },
1248
1336
  // `origin: "compile-time"` is the default and is omitted from the
1249
1337
  // canonical form (absence == compile-time). Only `runtime` is
1250
1338
  // emitted explicitly so the restart loader can route the declaration
@@ -1265,6 +1353,8 @@ function serializeEdgeIndexDeclaration(declaration) {
1265
1353
  unique: declaration.unique,
1266
1354
  scope: declaration.scope,
1267
1355
  where: declaration.where,
1356
+ // `method: "btree"` is canonicalized by absence, like `origin`.
1357
+ ...declaration.method === void 0 ? {} : { method: declaration.method },
1268
1358
  ...declaration.origin === "runtime" ? { origin: "runtime" } : {}
1269
1359
  };
1270
1360
  }
@@ -1440,11 +1530,7 @@ function mapToRecord(map) {
1440
1530
  return result;
1441
1531
  }
1442
1532
  function mapToSimpleRecord(map) {
1443
- const result = {};
1444
- for (const [key, value] of map) {
1445
- result[key] = value;
1446
- }
1447
- return result;
1533
+ return Object.fromEntries(map);
1448
1534
  }
1449
1535
  var SCHEMA_PROPERTIES_CACHE = /* @__PURE__ */ new WeakMap();
1450
1536
  function serializeSchemaProperties(schema) {
@@ -2008,6 +2094,94 @@ function resolveOntologyEndpoints(relation, nodeKinds) {
2008
2094
  const to = typeof relation.to === "string" ? nodeKinds.get(relation.to) ?? relation.to : relation.to;
2009
2095
  return { ...relation, from, to };
2010
2096
  }
2097
+
2098
+ // src/registry/validate-implies.ts
2099
+ function validateImpliesEndpointCompatibility(edgeEndpoints, registry) {
2100
+ for (const [impliedEdgeKind, impliedEndpoints] of edgeEndpoints) {
2101
+ for (const implyingEdgeKind of registry.expandImplyingEdges(
2102
+ impliedEdgeKind
2103
+ )) {
2104
+ if (implyingEdgeKind === impliedEdgeKind) continue;
2105
+ const implyingEndpoints = edgeEndpoints.get(implyingEdgeKind);
2106
+ if (!implyingEndpoints) continue;
2107
+ assertEndpointCompatible(
2108
+ "from",
2109
+ implyingEdgeKind,
2110
+ implyingEndpoints.from,
2111
+ impliedEdgeKind,
2112
+ impliedEndpoints.from,
2113
+ registry
2114
+ );
2115
+ assertEndpointCompatible(
2116
+ "to",
2117
+ implyingEdgeKind,
2118
+ implyingEndpoints.to,
2119
+ impliedEdgeKind,
2120
+ impliedEndpoints.to,
2121
+ registry
2122
+ );
2123
+ }
2124
+ }
2125
+ }
2126
+ function assertEndpointCompatible(side, implyingEdgeKind, implyingKinds, impliedEdgeKind, impliedKinds, registry) {
2127
+ const incompatibleKinds = implyingKinds.filter(
2128
+ (kind) => !registry.isAssignableToAny(kind, impliedKinds)
2129
+ );
2130
+ if (incompatibleKinds.length === 0) return;
2131
+ throw new ConfigurationError(
2132
+ `implies("${implyingEdgeKind}", "${impliedEdgeKind}") is endpoint-incompatible: ${side} kind(s) [${incompatibleKinds.join(", ")}] declared on "${implyingEdgeKind}" cannot be assigned to any of "${impliedEdgeKind}"'s ${side} kind(s) [${impliedKinds.join(", ")}].`,
2133
+ {
2134
+ metaEdge: META_EDGE_IMPLIES,
2135
+ implyingEdge: implyingEdgeKind,
2136
+ impliedEdge: impliedEdgeKind,
2137
+ endpoint: side,
2138
+ incompatibleKinds,
2139
+ allowedKinds: impliedKinds
2140
+ },
2141
+ {
2142
+ suggestion: `Add a subClassOf relation from each of [${incompatibleKinds.join(", ")}] to one of "${impliedEdgeKind}"'s ${side} kind(s) [${impliedKinds.join(", ")}], narrow "${implyingEdgeKind}"'s ${side} declaration to exclude [${incompatibleKinds.join(", ")}], or remove implies("${implyingEdgeKind}", "${impliedEdgeKind}").`
2143
+ }
2144
+ );
2145
+ }
2146
+
2147
+ // src/registry/builders.ts
2148
+ function buildKindRegistry(graph) {
2149
+ const nodeTypes = extractNodeTypes(graph);
2150
+ const edgeTypes = extractEdgeTypes(graph);
2151
+ const closures = graph.ontology.length > 0 ? computeClosuresFromOntology(graph.ontology) : createEmptyClosures();
2152
+ const registry = new KindRegistry(nodeTypes, edgeTypes, closures);
2153
+ validateImpliesEndpointCompatibility(
2154
+ buildEdgeEndpointKinds(graph.edges),
2155
+ registry
2156
+ );
2157
+ return registry;
2158
+ }
2159
+ function buildEdgeEndpointKinds(edges) {
2160
+ const result = /* @__PURE__ */ new Map();
2161
+ for (const [kind, registration] of Object.entries(edges)) {
2162
+ result.set(kind, {
2163
+ from: registration.from.map((node) => node.kind),
2164
+ to: registration.to.map((node) => node.kind)
2165
+ });
2166
+ }
2167
+ return result;
2168
+ }
2169
+ function extractNodeTypes(graph) {
2170
+ const result = /* @__PURE__ */ new Map();
2171
+ for (const typeName of getNodeKinds(graph)) {
2172
+ const registration = graph.nodes[typeName];
2173
+ result.set(typeName, registration.type);
2174
+ }
2175
+ return result;
2176
+ }
2177
+ function extractEdgeTypes(graph) {
2178
+ const result = /* @__PURE__ */ new Map();
2179
+ for (const typeName of getEdgeKinds(graph)) {
2180
+ const registration = graph.edges[typeName];
2181
+ result.set(typeName, registration.type);
2182
+ }
2183
+ return result;
2184
+ }
2011
2185
  var deleteBehaviorZod = z.enum(["restrict", "cascade", "disconnect"]);
2012
2186
  var cardinalityZod = z.enum(["many", "one", "unique", "oneActive"]);
2013
2187
  var endpointExistenceZod = z.enum(["notDeleted", "currentlyValid", "ever"]);
@@ -2057,6 +2231,12 @@ var systemColumnNameZod = z.enum([
2057
2231
  "updated_at",
2058
2232
  "version"
2059
2233
  ]);
2234
+ var nodeSystemColumnNameZod = systemColumnNameZod.exclude([
2235
+ "from_kind",
2236
+ "from_id",
2237
+ "to_kind",
2238
+ "to_id"
2239
+ ]);
2060
2240
  var indexWhereOperandZod = z.discriminatedUnion("__type", [
2061
2241
  z.object({
2062
2242
  __type: z.literal("index_operand_system"),
@@ -2133,7 +2313,13 @@ var indexDeclarationCommonShape = {
2133
2313
  var nodeIndexDeclarationZod = z.object({
2134
2314
  entity: z.literal("node"),
2135
2315
  kind: z.string(),
2136
- ...indexDeclarationCommonShape
2316
+ ...indexDeclarationCommonShape,
2317
+ // Node-only; canonicalized by absence like `method`, so absent/optional
2318
+ // here matches `defineNodeIndex` only emitting it when non-empty.
2319
+ // `.min(1)` rejects an explicit `[]` at the boundary rather than
2320
+ // silently accepting a present-but-empty array that would have to be
2321
+ // canonicalized away again downstream (see `serializeNodeIndexDeclaration`).
2322
+ keySystemColumns: z.array(nodeSystemColumnNameZod).min(1).optional()
2137
2323
  }).loose();
2138
2324
  var edgeIndexDeclarationZod = z.object({
2139
2325
  entity: z.literal("edge"),
@@ -2532,6 +2718,7 @@ function schemaNotInitializedError(graphId, cause) {
2532
2718
  );
2533
2719
  }
2534
2720
  async function initializeSchema(backend, graph) {
2721
+ buildKindRegistry(graph);
2535
2722
  const schema = serializeSchema(graph, 1);
2536
2723
  const hash = await computeSchemaHash(schema);
2537
2724
  return backend.commitSchemaVersion({
@@ -2551,6 +2738,7 @@ async function migrateSchema(backend, graph, currentVersion) {
2551
2738
  return committed.version;
2552
2739
  }
2553
2740
  async function commitNewSchemaVersion(backend, graph, currentVersion) {
2741
+ buildKindRegistry(graph);
2554
2742
  const newVersion = currentVersion + 1;
2555
2743
  const schema = serializeSchema(graph, newVersion);
2556
2744
  const hash = await computeSchemaHash(schema);
@@ -2593,78 +2781,6 @@ async function getSchemaChanges(backend, graph) {
2593
2781
  return computeSchemaDiff(storedSchema, currentSchema);
2594
2782
  }
2595
2783
 
2596
- // src/errors/validation.ts
2597
- function zodIssuesToValidationIssues(error) {
2598
- return error.issues.map((issue) => ({
2599
- path: issue.path.join("."),
2600
- message: issue.message,
2601
- code: issue.code
2602
- }));
2603
- }
2604
- function buildLocationString(context) {
2605
- if (context.id) {
2606
- return `${context.kind}/${context.id}`;
2607
- }
2608
- return `new ${context.kind}`;
2609
- }
2610
- function validateProps(schema, props, context) {
2611
- const result = schema.safeParse(props);
2612
- if (result.success) {
2613
- return result.data;
2614
- }
2615
- const issues = zodIssuesToValidationIssues(result.error);
2616
- const location = buildLocationString(context);
2617
- throw new ValidationError(
2618
- `Invalid ${context.entityType} props for ${location}: ${result.error.message}`,
2619
- {
2620
- entityType: context.entityType,
2621
- kind: context.kind,
2622
- operation: context.operation,
2623
- ...context.id !== void 0 && { id: context.id },
2624
- issues
2625
- },
2626
- { cause: result.error }
2627
- );
2628
- }
2629
- function validateNodeProps(schema, props, context) {
2630
- return validateProps(schema, props, {
2631
- entityType: "node",
2632
- ...context
2633
- });
2634
- }
2635
- function validateEdgeProps(schema, props, context) {
2636
- return validateProps(schema, props, {
2637
- entityType: "edge",
2638
- ...context
2639
- });
2640
- }
2641
- function wrapZodError(error, context) {
2642
- const issues = zodIssuesToValidationIssues(error);
2643
- const location = buildLocationString(context);
2644
- return new ValidationError(
2645
- `Validation failed for ${context.entityType} ${location}: ${error.message}`,
2646
- {
2647
- entityType: context.entityType,
2648
- kind: context.kind,
2649
- operation: context.operation,
2650
- ...context.id !== void 0 && { id: context.id },
2651
- issues
2652
- },
2653
- { cause: error }
2654
- );
2655
- }
2656
- function createValidationError(message, issues, context) {
2657
- return new ValidationError(message, {
2658
- ...context?.entityType !== void 0 && {
2659
- entityType: context.entityType
2660
- },
2661
- ...context?.kind !== void 0 && { kind: context.kind },
2662
- ...context?.operation !== void 0 && { operation: context.operation },
2663
- ...context?.id !== void 0 && { id: context.id },
2664
- issues
2665
- });
2666
- }
2667
-
2668
- export { KindRegistry, META_EDGE_BRAND, applyDeprecatedKinds, assertSchemaCurrent, broader, buildGraphExtensionOntologyKeySet, commitNewSchemaVersion, compileTimeOntologyKey, computeClosuresFromOntology, computeSchemaDiff, computeSchemaHash, core, createEmptyClosures, createValidationError, defineEdge, defineNode, deserializeWherePredicate, differentFrom, disjointWith, ensureSchema, equivalentTo, extensionKindNames, getActiveSchema, getMigrationActions, getSchemaChanges, getTypeName, hasPart, implies, initializeSchema, inverseOf, isBackwardsCompatible, isMetaEdge, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, loadAndVerifyGraph, mergeGraphExtension, migrateSchema, narrower, parseSerializedSchema, partOf, relatedTo, rollbackSchema, sameAs, serializeSchema, serializeSchemaProperties, subClassOf, validateEdgeProps, validateNodeProps, validateProps, wrapZodError };
2669
- //# sourceMappingURL=chunk-XVUJY72M.js.map
2670
- //# sourceMappingURL=chunk-XVUJY72M.js.map
2784
+ export { KindRegistry, META_EDGE_BRAND, applyDeprecatedKinds, assertSchemaCurrent, broader, buildGraphExtensionOntologyKeySet, buildKindRegistry, commitNewSchemaVersion, compileTimeOntologyKey, computeSchemaDiff, computeSchemaHash, core, defineEdge, defineNode, deserializeWherePredicate, differentFrom, disjointWith, ensureSchema, equivalentTo, extensionKindNames, getActiveSchema, getMigrationActions, getSchemaChanges, getTypeName, hasPart, implies, initializeSchema, inverseOf, isBackwardsCompatible, isMetaEdge, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, loadAndVerifyGraph, mergeGraphExtension, migrateSchema, narrower, parseSerializedSchema, partOf, relatedTo, rollbackSchema, sameAs, serializeIndexDeclaration, serializeSchema, serializeSchemaProperties, subClassOf, validateImpliesEndpointCompatibility };
2785
+ //# sourceMappingURL=chunk-K3PPLHY7.js.map
2786
+ //# sourceMappingURL=chunk-K3PPLHY7.js.map