@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
@@ -777,6 +777,13 @@ interface DialectAdapter {
777
777
  * PostgreSQL: jsonb_typeof(column #> path) = 'number'
778
778
  */
779
779
  readonly jsonPathIsNumber: (this: void, column: SqlFragment, pointer: JsonPointer) => SqlFragment;
780
+ /**
781
+ * Replaces top-level JSON object properties while preserving explicit JSON
782
+ * null values. This is the token-level dialect seam used by set-based node
783
+ * mutation; callers validate the patch against the node schema before SQL
784
+ * compilation.
785
+ */
786
+ readonly jsonSetProperties: (this: void, column: SqlFragment, patch: Readonly<Record<string, JsonValue>>, unsetProperties?: readonly string[]) => SqlFragment;
780
787
  /**
781
788
  * Null-safe equality: `TRUE` when both sides are equal OR both are NULL.
782
789
  * Unlike `=`, a NULL on either side does not yield NULL/unknown.
@@ -1311,6 +1318,10 @@ type VectorStrategy = Readonly<{
1311
1318
  buildUpsertBatch?: (this: void, slot: VectorSlot, params: UpsertEmbeddingBatchParams, timestamp: string) => readonly SqlFragment[];
1312
1319
  /** Emits the statement(s) that delete a single embedding from the slot. */
1313
1320
  buildDelete: (this: void, slot: VectorSlot, params: DeleteEmbeddingParams) => readonly SqlFragment[];
1321
+ /** Emits one set-based delete for many node ids in a vector slot. */
1322
+ buildDeleteBatch: (this: void, slot: VectorSlot, params: Omit<DeleteEmbeddingParams, "nodeId"> & Readonly<{
1323
+ nodeIds: readonly string[];
1324
+ }>) => readonly SqlFragment[];
1314
1325
  /**
1315
1326
  * Raw DDL statement(s) that drop the slot's entire physical storage
1316
1327
  * (table + ANN index, and any engine-managed shadow tables). Used by the
@@ -2281,6 +2292,38 @@ type UpdateNodeParams = Readonly<{
2281
2292
  /** If true, clears deleted_at (un-deletes the node). Used by upsert. */
2282
2293
  clearDeleted?: boolean;
2283
2294
  }>;
2295
+ /**
2296
+ * Parameters for updating a set of live nodes selected by a compiled
2297
+ * TypeGraph query.
2298
+ *
2299
+ * The candidate query must expose the named node-id column from the same graph
2300
+ * and kind. The backend independently fences the rows it writes to
2301
+ * `graphId` and `kind`; constructing the matching candidate query remains the
2302
+ * caller's responsibility.
2303
+ * Property values replace top-level keys, including preserving an explicit
2304
+ * JSON `null` value.
2305
+ *
2306
+ * This is a storage primitive: callers that expose it as a graph mutation are
2307
+ * responsible for schema validation and for synchronizing uniqueness,
2308
+ * fulltext, and vector sidecars. The result contains after-images only; callers
2309
+ * that need previous property values must freeze the candidate set and retain
2310
+ * its before-images in the same transaction before invoking this method.
2311
+ */
2312
+ type UpdateNodeSetParams = Readonly<{
2313
+ graphId: string;
2314
+ kind: string;
2315
+ patch: Readonly<Record<string, JsonValue>>;
2316
+ /** Top-level properties to remove (the storage form of an `undefined` patch value). */
2317
+ unsetProperties?: readonly string[];
2318
+ candidateIds: CompiledSelectSql;
2319
+ /** Projected SQL column holding the candidate node id (for example `n_id`). */
2320
+ candidateIdColumn: string;
2321
+ }>;
2322
+ /** The after-images changed by {@link GraphBackend.updateNodeSet}. */
2323
+ type UpdateNodeSetResult = Readonly<{
2324
+ affectedCount: number;
2325
+ rows: readonly NodeRow[];
2326
+ }>;
2284
2327
  /**
2285
2328
  * Parameters for deleting a node (soft delete).
2286
2329
  */
@@ -2888,13 +2931,11 @@ type ContributionDiagnosticState = "orphaned-marker" | "missing-marker" | "faile
2888
2931
  * storage, so applying it to a `missing-marker` — where the table is
2889
2932
  * intact and only the bookkeeping is wrong — discards every embedding
2890
2933
  * to fix a marker, and without an `embed` callback it leaves the field
2891
- * empty. For `missing-marker` and `failed-materialization` prefer
2892
- * `ensureVectorSlotContribution(slot, { force: true })`, whose DDL is
2893
- * `CREATE ... IF NOT EXISTS` and never drops. Note also that
2894
- * `ensureRuntimeContributions` does NOT repair a fulltext
2895
- * `orphaned-marker`: it short-circuits on the marker, which still
2896
- * reads as initialized. See the per-state repair tables in the
2897
- * troubleshooting guide.
2934
+ * empty. Prefer `store.repairContributions()` for `missing-marker` and
2935
+ * `failed-materialization`; it resolves the current strategy declarations
2936
+ * internally and keeps the normal signature-drift guard enabled. It reports
2937
+ * `stale` and `orphaned-marker` as `requires-rebuild`. See the per-state
2938
+ * repair table in the troubleshooting guide.
2898
2939
  */
2899
2940
  type ContributionDiagnostic = Readonly<{
2900
2941
  /** Producing strategy, e.g. `"fts5"` / `"tsvector"` / `"pgvector"`. */
@@ -2924,6 +2965,30 @@ type ContributionDiagnostic = Readonly<{
2924
2965
  */
2925
2966
  lastError?: string;
2926
2967
  }>;
2968
+ /**
2969
+ * Outcome of one contribution considered by
2970
+ * {@link GraphBackend.repairContributions}.
2971
+ *
2972
+ * Repair targets are always resolved from the backend's current strategy
2973
+ * declarations. The diagnostic is returned for operator context only; callers
2974
+ * never pass diagnostics or physical DDL back into the repair API.
2975
+ */
2976
+ type ContributionRepairEntry = Readonly<{
2977
+ diagnostic: ContributionDiagnostic;
2978
+ status: "repaired";
2979
+ }> | Readonly<{
2980
+ diagnostic: ContributionDiagnostic;
2981
+ status: "requires-rebuild";
2982
+ }> | Readonly<{
2983
+ diagnostic: ContributionDiagnostic;
2984
+ status: "failed";
2985
+ error: string;
2986
+ }>;
2987
+ /** Result of a contribution repair pass followed by a fresh verification. */
2988
+ type ContributionRepairResult = Readonly<{
2989
+ results: readonly ContributionRepairEntry[];
2990
+ remaining: readonly ContributionDiagnostic[];
2991
+ }>;
2927
2992
  /**
2928
2993
  * One row of the per-deployment `typegraph_kind_removals` table:
2929
2994
  * a graph-extension kind that has been removed from the schema and whose
@@ -3011,6 +3076,7 @@ type GraphBackend = Readonly<{
3011
3076
  insertNodesBatch?: (this: void, params: readonly InsertNodeParams[]) => Promise<void>;
3012
3077
  insertNodesBatchReturning?: (this: void, params: readonly InsertNodeParams[]) => Promise<readonly NodeRow[]>;
3013
3078
  updateNode: (this: void, params: UpdateNodeParams) => Promise<NodeRow>;
3079
+ updateNodeSet?: (this: void, params: UpdateNodeSetParams) => Promise<UpdateNodeSetResult>;
3014
3080
  deleteNode: (this: void, params: DeleteNodeParams) => Promise<void>;
3015
3081
  hardDeleteNode: (this: void, params: HardDeleteNodeParams) => Promise<void>;
3016
3082
  getNode: (this: void, graphId: string, kind: string, id: string) => Promise<NodeRow | undefined>;
@@ -3055,6 +3121,14 @@ type GraphBackend = Readonly<{
3055
3121
  * path is unaffected.
3056
3122
  */
3057
3123
  findEdgesByEndpointSet?: (this: void, params: FindEdgesByEndpointSetParams) => Promise<readonly EdgeRow[]>;
3124
+ /**
3125
+ * Reads several edge kinds from a heterogeneous set of endpoints without
3126
+ * issuing one statement per licensed `(edge kind, endpoint kind)` pair.
3127
+ *
3128
+ * Optional for custom backends. Store-level heterogeneous bulk reads refuse
3129
+ * when it is absent rather than hiding a per-kind/per-endpoint fallback.
3130
+ */
3131
+ findEdgesByHeterogeneousEndpointSet?: (this: void, params: FindEdgesByHeterogeneousEndpointSetParams) => Promise<readonly EdgeRow[]>;
3058
3132
  countEdgesByKind: (this: void, params: CountEdgesByKindParams) => Promise<number>;
3059
3133
  insertUnique: (this: void, params: InsertUniqueParams) => Promise<void>;
3060
3134
  /**
@@ -3065,6 +3139,12 @@ type GraphBackend = Readonly<{
3065
3139
  */
3066
3140
  insertUniqueBatch?: (this: void, entries: readonly InsertUniqueParams[]) => Promise<void>;
3067
3141
  deleteUnique: (this: void, params: DeleteUniqueParams) => Promise<void>;
3142
+ /**
3143
+ * Permanently removes every uniqueness sidecar owned by the specified
3144
+ * concrete nodes. Optional capability used by set-based updates before they
3145
+ * rebuild reservations from the returned node after-images.
3146
+ */
3147
+ hardDeleteUniquesByNodeIds?: (this: void, params: HardDeleteUniquesByNodeIdsParams) => Promise<void>;
3068
3148
  checkUnique: (this: void, params: CheckUniqueParams) => Promise<UniqueRow | undefined>;
3069
3149
  checkUniqueBatch?: (this: void, params: CheckUniqueBatchParams) => Promise<readonly UniqueRow[]>;
3070
3150
  getActiveSchema: (this: void, graphId: string) => Promise<SchemaVersionRow | undefined>;
@@ -3158,6 +3238,9 @@ type GraphBackend = Readonly<{
3158
3238
  */
3159
3239
  upsertEmbeddingBatch?: (this: void, params: UpsertEmbeddingBatchParams) => Promise<void>;
3160
3240
  deleteEmbedding?: (this: void, params: DeleteEmbeddingParams) => Promise<void>;
3241
+ deleteEmbeddingBatch?: (this: void, params: Omit<DeleteEmbeddingParams, "nodeId"> & Readonly<{
3242
+ nodeIds: readonly string[];
3243
+ }>) => Promise<void>;
3161
3244
  /**
3162
3245
  * KNN search over one `(nodeKind, fieldPath)` slot. Top-k is computed
3163
3246
  * over CURRENT nodes only — non-tombstoned AND inside their validity
@@ -3295,11 +3378,11 @@ type GraphBackend = Readonly<{
3295
3378
  assertRuntimeContributionsInitialized?: (this: void, graphId: string) => Promise<void>;
3296
3379
  /**
3297
3380
  * Bootstraps the per-deployment `typegraph_kind_removals` table so
3298
- * `store.removeKinds()` and `store.materializeRemovals()` can persist
3299
- * removal status. Mirrors the focused-bootstrap rationale documented
3300
- * on `ensureIndexMaterializationsTable` — the full `bootstrapTables`
3301
- * touches every base table and risks Postgres SHARE-lock deadlock
3302
- * under concurrent replica startup.
3381
+ * `store.evolve()` can check pending removals and the removal verbs can
3382
+ * persist and materialize removal status. Mirrors the focused-bootstrap
3383
+ * rationale documented on `ensureIndexMaterializationsTable` — the full
3384
+ * `bootstrapTables` touches every base table and risks Postgres SHARE-lock
3385
+ * deadlock under concurrent replica startup.
3303
3386
  */
3304
3387
  ensureKindRemovalsTable?: (this: void) => Promise<void>;
3305
3388
  /**
@@ -3430,6 +3513,18 @@ type GraphBackend = Readonly<{
3430
3513
  * Present only on backends that can probe their own catalog.
3431
3514
  */
3432
3515
  verifyContributions?: (this: void, graphId: string, vectorSlots: readonly VectorSlot[]) => Promise<readonly ContributionDiagnostic[]>;
3516
+ /**
3517
+ * Re-audit current contribution declarations and non-destructively repair
3518
+ * `missing-marker` and `failed-materialization` findings. The backend must
3519
+ * resolve every target itself; it must not accept caller-provided physical
3520
+ * identities or DDL. `stale` and `orphaned-marker` findings are returned as
3521
+ * `requires-rebuild` because repairing either can require destructive data
3522
+ * reconstruction.
3523
+ *
3524
+ * Present only on backends that can both probe their catalog and run the
3525
+ * strategy-owned contribution DDL.
3526
+ */
3527
+ repairContributions?: (this: void, graphId: string, vectorSlots: readonly VectorSlot[]) => Promise<ContributionRepairResult>;
3433
3528
  /**
3434
3529
  * Bootstraps the fulltext storage table the active `FulltextStrategy`
3435
3530
  * owns. Same focused-bootstrap rationale as the other `ensure*Table`
@@ -3564,16 +3659,16 @@ type AdapterBackend<TNativeTransaction> = GraphBackend & Readonly<{
3564
3659
  }>;
3565
3660
  type BackendIdentity = Pick<GraphBackend, "dialect" | "capabilities" | "tableNames" | "fulltextStrategy" | "vectorStrategy">;
3566
3661
  type NodeEntityReadBackend = Pick<GraphBackend, "getNode" | "getNodes" | "findNodesByKind" | "countNodesByKind">;
3567
- type NodeEntityWriteBackend = Pick<GraphBackend, "insertNode" | "insertNodeNoReturn" | "insertNodesBatch" | "insertNodesBatchReturning" | "updateNode" | "deleteNode" | "hardDeleteNode">;
3568
- type EdgeEntityReadBackend = Pick<GraphBackend, "getEdge" | "getEdges" | "countEdgesFrom" | "edgeExistsBetween" | "findEdgesConnectedTo" | "findEdgesByKind" | "findEdgesByEndpointSet" | "countEdgesByKind">;
3662
+ type NodeEntityWriteBackend = Pick<GraphBackend, "insertNode" | "insertNodeNoReturn" | "insertNodesBatch" | "insertNodesBatchReturning" | "updateNode" | "updateNodeSet" | "deleteNode" | "hardDeleteNode">;
3663
+ type EdgeEntityReadBackend = Pick<GraphBackend, "getEdge" | "getEdges" | "countEdgesFrom" | "edgeExistsBetween" | "findEdgesConnectedTo" | "findEdgesByKind" | "findEdgesByEndpointSet" | "findEdgesByHeterogeneousEndpointSet" | "countEdgesByKind">;
3569
3664
  type EdgeEntityWriteBackend = Pick<GraphBackend, "insertEdge" | "insertEdgeNoReturn" | "insertEdgesBatch" | "insertEdgesBatchReturning" | "updateEdge" | "deleteEdge" | "deleteEdgesBatch" | "hardDeleteEdge" | "hardDeleteEdgesBatch">;
3570
3665
  type GraphEntityReadBackend = NodeEntityReadBackend & EdgeEntityReadBackend;
3571
3666
  type GraphEntityWriteBackend = NodeEntityWriteBackend & EdgeEntityWriteBackend;
3572
- type UniqueConstraintBackend = Pick<GraphBackend, "insertUnique" | "insertUniqueBatch" | "deleteUnique" | "checkUnique" | "checkUniqueBatch">;
3667
+ type UniqueConstraintBackend = Pick<GraphBackend, "insertUnique" | "insertUniqueBatch" | "deleteUnique" | "hardDeleteUniquesByNodeIds" | "checkUnique" | "checkUniqueBatch">;
3573
3668
  type SchemaReadBackend = Pick<GraphBackend, "getActiveSchema" | "getSchemaVersion">;
3574
3669
  type SchemaCommitBackend = Pick<GraphBackend, "commitSchemaVersion" | "commitSchemaVersionIfKindsEmpty" | "setActiveVersion">;
3575
3670
  type SchemaWriteFenceBackend = Pick<GraphBackend, "lockSchemaVersionForWrite">;
3576
- type VectorOperationBackend = Pick<GraphBackend, "upsertEmbedding" | "upsertEmbeddingBatch" | "deleteEmbedding" | "vectorSearch" | "createVectorIndex" | "dropVectorIndex">;
3671
+ type VectorOperationBackend = Pick<GraphBackend, "upsertEmbedding" | "upsertEmbeddingBatch" | "deleteEmbedding" | "deleteEmbeddingBatch" | "vectorSearch" | "createVectorIndex" | "dropVectorIndex">;
3577
3672
  type FulltextOperationBackend = Pick<GraphBackend, "upsertFulltext" | "deleteFulltext" | "upsertFulltextBatch" | "deleteFulltextBatch" | "fulltextSearch">;
3578
3673
  type IndexMaterializationBackend = Pick<GraphBackend, "ensureIndexMaterializationsTable" | "getIndexMaterialization" | "getIndexMaterializations" | "recordIndexMaterialization">;
3579
3674
  type ContributionMaterializationBackend = Pick<GraphBackend, "ensureContributionMaterializationsTable" | "getContributionMaterialization" | "recordContributionMaterialization" | "assertRuntimeContributionsInitialized" | "ensureRuntimeContributions" | "ensureFulltextTable">;
@@ -3625,6 +3720,12 @@ type DeleteUniqueParams = Readonly<{
3625
3720
  constraintName: string;
3626
3721
  key: string;
3627
3722
  }>;
3723
+ /** Parameters for permanently clearing uniqueness sidecars by node identity. */
3724
+ type HardDeleteUniquesByNodeIdsParams = Readonly<{
3725
+ graphId: string;
3726
+ concreteKind: string;
3727
+ nodeIds: readonly string[];
3728
+ }>;
3628
3729
  /**
3629
3730
  * Parameters for checking a unique constraint.
3630
3731
  */
@@ -3906,6 +4007,29 @@ type FindEdgesByEndpointSetParams = Readonly<{
3906
4007
  /** Timestamp for "current" and "asOf" temporal modes. */
3907
4008
  asOf?: string;
3908
4009
  }>;
4010
+ /**
4011
+ * Parameters for reading several edge kinds from several endpoint kinds.
4012
+ *
4013
+ * The endpoint pairs are joined as a relation, so round trips are independent
4014
+ * of the number of licensed edge-kind/endpoint-kind combinations. Large source
4015
+ * sets may still be split to respect the backend's bind-parameter budget.
4016
+ */
4017
+ type FindEdgesByHeterogeneousEndpointSetParams = Readonly<{
4018
+ graphId: string;
4019
+ side: EdgeEndpointSide;
4020
+ endpoints: readonly Readonly<{
4021
+ kind: string;
4022
+ id: string;
4023
+ }>[];
4024
+ edgeKinds: readonly string[];
4025
+ limitPerEndpoint?: number;
4026
+ /** If true, exclude deleted edges. Default true. */
4027
+ excludeDeleted?: boolean;
4028
+ /** Temporal mode for filtering by validity period. */
4029
+ temporalMode?: TemporalMode;
4030
+ /** Timestamp for "current" and "asOf" temporal modes. */
4031
+ asOf?: string;
4032
+ }>;
3909
4033
  /**
3910
4034
  * Parameters for counting edges by kind.
3911
4035
  */
@@ -4756,4 +4880,4 @@ type RelationalIndexDeclaration = NodeIndexDeclaration | EdgeIndexDeclaration;
4756
4880
  type IndexDeclaration = RelationalIndexDeclaration | VectorIndexDeclaration;
4757
4881
  type SystemColumnName = "graph_id" | "kind" | "id" | "from_kind" | "from_id" | "to_kind" | "to_id" | "deleted_at" | "valid_from" | "valid_to" | "created_at" | "updated_at" | "version";
4758
4882
 
4759
- export { type InferenceType as $, type AdapterBackend as A, type BackendCapabilities as B, type ContributionDiagnostic as C, type DeleteBehavior as D, type EdgeRegistration as E, type FulltextStrategy as F, type GraphExtension as G, type SerializedEdgeDef as H, type IndexDeclaration as I, type JsonPointer as J, type KindEntity as K, type IndexEntity as L, type SerializedMetaEdge as M, type NodeRegistration as N, type OntologyRelation as O, type SerializedOntologyRelation as P, type QueryAst as Q, type RelationalIndexDeclaration as R, type SqlDialect as S, type TemporalMode as T, type SerializedClosures as U, type VectorStrategy as V, type SchemaHash as W, type NullCheckOp as X, type JsonSchema as Y, type SerializedOntology as Z, type SerializedUniqueConstraint as _, type ContributionDiagnosticState as a, type ParameterRef as a$, type EdgeType as a0, type AggregateExpr as a1, type FieldRef as a2, type ComparisonOp as a3, type AggregateComparisonPredicate as a4, type TraversalDirection as a5, type AdapterBackendTransactions as a6, type BackendIdentity as a7, type BackendLifecycle as a8, type BackendMaintenance as a9, type FulltextSearchParams as aA, type FulltextSearchResult as aB, type GraphAnalyticsCapabilities as aC, type GraphEntityReadBackend as aD, type GraphEntityWriteBackend as aE, type GraphExtensionVersion as aF, type GraphLifecycleBackend as aG, type HybridFusionOptions as aH, type IndexMaterializationBackend as aI, type IntentSql as aJ, type JsonPointerFor as aK, type JsonPointerInput as aL, type JsonPointerSegment as aM, type JsonPointerSegments as aN, type JsonPointerSegmentsFor as aO, type JsonValue as aP, type KindAnnotations as aQ, LEGACY_GRAPH_EXTENSION_VERSION as aR, type LockSchemaVersionForWriteParams as aS, MAX_JSON_POINTER_DEPTH as aT, type MetaEdge as aU, type MetaEdgeProperties as aV, type NodeEntityReadBackend as aW, type NodeEntityWriteBackend as aX, type NodeId as aY, type NodeProps as aZ, type OrderSpec as a_, type BackendTransactions as aa, CURRENT_GRAPH_EXTENSION_VERSION as ab, type Cardinality as ac, type Collation as ad, type CommitSchemaVersionExpected as ae, type CommitSchemaVersionIfKindsEmptyResult as af, type CommitSchemaVersionParams as ag, type CompiledRowsSql as ah, type CompiledSelectSql as ai, type CompiledStatementSql as aj, type ContributionMaterializationBackend as ak, DEFAULT_SQL_SCHEMA as al, type DeleteFulltextBatchParams as am, type EdgeEntityReadBackend as an, type EdgeEntityWriteBackend as ao, type EdgeId as ap, type EdgeProps as aq, type EdgeTypeWithEndpoints as ar, type EndpointExistence as as, type ExternalRecordedReadSource as at, type FilteredApproximateSearch as au, type FilteredApproximateSearchMode as av, type FulltextBatchRow as aw, type FulltextCapabilities as ax, type FulltextOperationBackend as ay, type FulltextQueryMode as az, type NodeType as b, sql as b$, Placeholder as b0, type PopulatedSchemaKind as b1, type QueryExecutionBackend as b2, type RawQueryExecutionBackend as b3, type RawStatementExecutionBackend as b4, type RecordedRelationOptions as b5, type RemovalMaterializationBackend as b6, type RenderedSql as b7, type ResolveJsonPointer as b8, type ResolveJsonPointerSegments as b9, type UniqueConstraint as bA, type UniqueConstraintBackend as bB, type UniquenessScope as bC, type UpsertFulltextBatchParams as bD, type VectorCapabilities as bE, type VectorOperationBackend as bF, asEdgeId as bG, asNodeId as bH, buildVectorCapabilities as bI, createSqlSchema as bJ, fts5Strategy as bK, isEdgeType as bL, isEdgeTypeWithEndpoints as bM, isMetaEdge as bN, isNodeType as bO, isSqlFragment as bP, joinJsonPointers as bQ, jsonPointer as bR, normalizeJsonPointer as bS, parseJsonPointer as bT, recordedRelation as bU, renderPostgres as bV, renderSql as bW, renderSqlInline as bX, renderSqlite as bY, rowPropsToJsonText as bZ, rowPropsToObject as b_, type ResolvedSqlTableNames as ba, type RowProps as bb, type SchemaCommitBackend as bc, type SchemaKindEmptinessProbe as bd, type SchemaReadBackend as be, type SchemaWriteFenceBackend as bf, type SetActiveVersionParams as bg, type SortDirection as bh, type SqlChunk as bi, type SqlFragment as bj, type SqlIdentifierChunk as bk, type SqlIntent as bl, type SqlParameterChunk as bm, type SqlPlaceholderChunk as bn, SqlSchema as bo, type SqlTableNames as bp, type SqlTag as bq, type SqlTextChunk as br, type StrategyTableContribution as bs, type TableContribution as bt, type TransactionBackend as bu, type TransactionOptions as bv, type TransactionReadBackend as bw, type TraversalExpansion as bx, type TrustedImportOptions as by, type TrustedImportSession as bz, type AnyEdgeType as c, type ExtensionPropertyType as c$, tsvectorStrategy as c0, type ExtensionNodeDef as c1, type ExtensionEdgeDef as c2, type ExtensionOntologyRelation as c3, type ExtensionIndex as c4, type ValueType as c5, type PredicateExpression as c6, type VectorMetricType as c7, type Traversal as c8, type NodePredicate as c9, D1_MAX_BIND_PARAMETERS as cA, DURABLE_OBJECT_MAX_BIND_PARAMETERS as cB, type DeleteEdgeParams as cC, type DeleteEdgesBatchParams as cD, type DeleteEmbeddingParams as cE, type DeleteFulltextParams as cF, type DeleteNodeParams as cG, type DeleteUniqueParams as cH, type DialectAdapter as cI, type DialectCapabilities as cJ, type DialectRecursiveQueryStrategy as cK, type DialectStandardQueryStrategy as cL, type DialectVectorPredicateStrategy as cM, type DropVectorIndexParams as cN, type EdgeExistsBetweenParams as cO, type ExtensionArrayItemType as cP, type ExtensionArrayProperty as cQ, type ExtensionBooleanProperty as cR, type ExtensionEdgeIndex as cS, type ExtensionEmbeddingModifier as cT, type ExtensionEnumProperty as cU, type ExtensionIndexWhere as cV, type ExtensionNodeIndex as cW, type ExtensionNumberProperty as cX, type ExtensionObjectFieldProperty as cY, type ExtensionObjectProperty as cZ, type ExtensionPropertyModifiers as c_, type ProjectedField as ca, type AggregateOrderSpec as cb, type GroupBySpec as cc, type RecursiveCyclePolicy as cd, type NodeRow as ce, type EdgeRow as cf, type VectorSlotMap as cg, type RecordedReadBinding as ch, type SelectiveField as ci, type ComposableQuery as cj, type SetOperationType as ck, type SetOperation as cl, type VectorMetric as cm, ALL_FULLTEXT_MODES as cn, ALL_META_EDGE_NAMES as co, BASE_CONTRIBUTION_OWNER as cp, type CheckUniqueBatchParams as cq, type CheckUniqueParams as cr, type ClaimIndexMaterializationParams as cs, type CompiledTemporaryStatementSql as ct, type ContributionMaterializationIdentity as cu, type ContributionMaterializationRow as cv, type CountEdgesByKindParams as cw, type CountEdgesFromParams as cx, type CountNodesByKindParams as cy, type CreateVectorIndexParams as cz, type GraphDefaults as d, GRAPH_EXTENSION_TOP_LEVEL_KEYS as d$, type ExtensionSearchableModifier as d0, type ExtensionStringProperty as d1, type ExtensionUniqueConstraint as d2, type ExtensionUniqueWhere as d3, FULLTEXT_CONTRIBUTION_NAME as d4, type FindEdgesByKindParams as d5, type FindEdgesConnectedToParams as d6, type FindNodesByKindParams as d7, type GraphReadBackend as d8, type HardDeleteEdgeParams as d9, SQLITE_MAX_BIND_PARAMETERS as dA, type SqlCompilationBackend as dB, type TombstonedNodeRow as dC, type UniqueRow as dD, type UpdateEdgeParams as dE, type UpdateNodeParams as dF, type UpsertEmbeddingBatchParams as dG, type UpsertEmbeddingBatchRow as dH, type UpsertEmbeddingParams as dI, type UpsertFulltextParams as dJ, VECTOR_CONTRIBUTION_PREFIX as dK, type VectorIndexType as dL, type VectorSearchParams as dM, type VectorSearchResult as dN, assertFiniteEmbedding as dO, assertVectorMinScore as dP, assertVectorSearchLimit as dQ, buildFulltextCapabilities as dR, isLiveNodeRow as dS, isSqlPlaceholder as dT, isTombstonedNodeRow as dU, normalizeGraphAnalyticsCapabilities as dV, quoteIdentifier as dW, shortHash as dX, vectorMinScoreCondition as dY, vectorPhysicalName as dZ, vectorScoreExpression as d_, type HardDeleteNodeParams as da, type HybridSearchParams as db, type HybridSearchRow as dc, type InListParameterOptions as dd, type IndexDeclarationBase as de, type IndexMaterializationRow as df, type IndexWhereLiteral as dg, type IndexWhereOp as dh, type IndexWhereOperand as di, type InsertEdgeParams as dj, type InsertNodeParams as dk, type InsertSchemaParams as dl, type InsertUniqueParams as dm, type KindRemovalRow as dn, type LiveNodeRow as dp, MODERN_SQLITE_MAX_BIND_PARAMETERS as dq, type MetaEdgeName as dr, POSTGRES_CAPABILITIES as ds, POSTGRES_MAX_BIND_PARAMETERS as dt, type RecordContributionMaterializationParams as du, type RecordIndexMaterializationParams as dv, type RecordKindRemovalParams as dw, type RelationalIndexMethod as dx, type ReleaseIndexMaterializationClaimParams as dy, SQLITE_CAPABILITIES as dz, type EdgeIndexDeclaration as e, type GraphExtensionTopLevelKey as e0, type NodeIndexDeclaration as f, type EdgeIndexConfig as g, type EdgeIndexDirection as h, type EdgeIndexWhereBuilder as i, type IndexOrigin as j, type IndexScope as k, type IndexWhereExpression as l, type IndexWhereFieldBuilder as m, type IndexWhereInput as n, type NodeIndexConfig as o, type NodeIndexWhereBuilder as p, type SystemColumnName as q, type VectorIndexDeclaration as r, type VectorIndexImplementation as s, type VectorIndexMetric as t, type VectorIndexParams as u, type VectorSlot as v, type SchemaVersionRow as w, type GraphBackend as x, type SerializedSchema as y, type SerializedNodeDef as z };
4883
+ export { type SerializedOntology as $, type AdapterBackend as A, type BackendCapabilities as B, type ContributionDiagnostic as C, type DeleteBehavior as D, type EdgeRegistration as E, type FulltextStrategy as F, type GraphExtension as G, type SerializedSchema as H, type IndexDeclaration as I, type JsonPointer as J, type KindEntity as K, type SerializedNodeDef as L, type SerializedEdgeDef as M, type NodeRegistration as N, type OntologyRelation as O, type IndexEntity as P, type QueryAst as Q, type RelationalIndexDeclaration as R, type SqlDialect as S, type TemporalMode as T, type SerializedMetaEdge as U, type VectorStrategy as V, type SerializedOntologyRelation as W, type SerializedClosures as X, type SchemaHash as Y, type NullCheckOp as Z, type JsonSchema as _, type ContributionDiagnosticState as a, type NodeEntityWriteBackend as a$, type SerializedUniqueConstraint as a0, type InferenceType as a1, type EdgeType as a2, type AggregateExpr as a3, type FieldRef as a4, type ComparisonOp as a5, type AggregateComparisonPredicate as a6, type TraversalDirection as a7, type AdapterBackendTransactions as a8, type BackendIdentity as a9, type FulltextCapabilities as aA, type FulltextOperationBackend as aB, type FulltextQueryMode as aC, type FulltextSearchParams as aD, type FulltextSearchResult as aE, type GraphAnalyticsCapabilities as aF, type GraphEntityReadBackend as aG, type GraphEntityWriteBackend as aH, type GraphExtensionVersion as aI, type GraphLifecycleBackend as aJ, type HardDeleteUniquesByNodeIdsParams as aK, type HybridFusionOptions as aL, type IndexMaterializationBackend as aM, type IntentSql as aN, type JsonPointerFor as aO, type JsonPointerInput as aP, type JsonPointerSegment as aQ, type JsonPointerSegments as aR, type JsonPointerSegmentsFor as aS, type JsonValue as aT, type KindAnnotations as aU, LEGACY_GRAPH_EXTENSION_VERSION as aV, type LockSchemaVersionForWriteParams as aW, MAX_JSON_POINTER_DEPTH as aX, type MetaEdge as aY, type MetaEdgeProperties as aZ, type NodeEntityReadBackend as a_, type BackendLifecycle as aa, type BackendMaintenance as ab, type BackendTransactions as ac, CURRENT_GRAPH_EXTENSION_VERSION as ad, type Cardinality as ae, type Collation as af, type CommitSchemaVersionExpected as ag, type CommitSchemaVersionIfKindsEmptyResult as ah, type CommitSchemaVersionParams as ai, type CompiledRowsSql as aj, type CompiledSelectSql as ak, type CompiledStatementSql as al, type ContributionMaterializationBackend as am, DEFAULT_SQL_SCHEMA as an, type DeleteFulltextBatchParams as ao, type EdgeEntityReadBackend as ap, type EdgeEntityWriteBackend as aq, type EdgeId as ar, type EdgeProps as as, type EdgeTypeWithEndpoints as at, type EndpointExistence as au, type ExternalRecordedReadSource as av, type FilteredApproximateSearch as aw, type FilteredApproximateSearchMode as ax, type FindEdgesByHeterogeneousEndpointSetParams as ay, type FulltextBatchRow as az, type ContributionRepairEntry as b, renderPostgres as b$, type NodeId as b0, type NodeProps as b1, type OrderSpec as b2, type ParameterRef as b3, Placeholder as b4, type PopulatedSchemaKind as b5, type QueryExecutionBackend as b6, type RawQueryExecutionBackend as b7, type RawStatementExecutionBackend as b8, type RecordedRelationOptions as b9, type TransactionReadBackend as bA, type TraversalExpansion as bB, type TrustedImportOptions as bC, type TrustedImportSession as bD, type UniqueConstraint as bE, type UniqueConstraintBackend as bF, type UniquenessScope as bG, type UpdateNodeSetParams as bH, type UpdateNodeSetResult as bI, type UpsertFulltextBatchParams as bJ, type VectorCapabilities as bK, type VectorOperationBackend as bL, asEdgeId as bM, asNodeId as bN, buildVectorCapabilities as bO, createSqlSchema as bP, fts5Strategy as bQ, isEdgeType as bR, isEdgeTypeWithEndpoints as bS, isMetaEdge as bT, isNodeType as bU, isSqlFragment as bV, joinJsonPointers as bW, jsonPointer as bX, normalizeJsonPointer as bY, parseJsonPointer as bZ, recordedRelation as b_, type RemovalMaterializationBackend as ba, type RenderedSql as bb, type ResolveJsonPointer as bc, type ResolveJsonPointerSegments as bd, type ResolvedSqlTableNames as be, type RowProps as bf, type SchemaCommitBackend as bg, type SchemaKindEmptinessProbe as bh, type SchemaReadBackend as bi, type SchemaWriteFenceBackend as bj, type SetActiveVersionParams as bk, type SortDirection as bl, type SqlChunk as bm, type SqlFragment as bn, type SqlIdentifierChunk as bo, type SqlIntent as bp, type SqlParameterChunk as bq, type SqlPlaceholderChunk as br, SqlSchema as bs, type SqlTableNames as bt, type SqlTag as bu, type SqlTextChunk as bv, type StrategyTableContribution as bw, type TableContribution as bx, type TransactionBackend as by, type TransactionOptions as bz, type ContributionRepairResult as c, type ExtensionIndexWhere as c$, renderSql as c0, renderSqlInline as c1, renderSqlite as c2, rowPropsToJsonText as c3, rowPropsToObject as c4, sql as c5, tsvectorStrategy as c6, type ExtensionNodeDef as c7, type ExtensionEdgeDef as c8, type ExtensionOntologyRelation as c9, type ContributionMaterializationIdentity as cA, type ContributionMaterializationRow as cB, type CountEdgesByKindParams as cC, type CountEdgesFromParams as cD, type CountNodesByKindParams as cE, type CreateVectorIndexParams as cF, D1_MAX_BIND_PARAMETERS as cG, DURABLE_OBJECT_MAX_BIND_PARAMETERS as cH, type DeleteEdgeParams as cI, type DeleteEdgesBatchParams as cJ, type DeleteEmbeddingParams as cK, type DeleteFulltextParams as cL, type DeleteNodeParams as cM, type DeleteUniqueParams as cN, type DialectAdapter as cO, type DialectCapabilities as cP, type DialectRecursiveQueryStrategy as cQ, type DialectStandardQueryStrategy as cR, type DialectVectorPredicateStrategy as cS, type DropVectorIndexParams as cT, type EdgeExistsBetweenParams as cU, type ExtensionArrayItemType as cV, type ExtensionArrayProperty as cW, type ExtensionBooleanProperty as cX, type ExtensionEdgeIndex as cY, type ExtensionEmbeddingModifier as cZ, type ExtensionEnumProperty as c_, type ExtensionIndex as ca, type ValueType as cb, type PredicateExpression as cc, type VectorMetricType as cd, type Traversal as ce, type NodePredicate as cf, type ProjectedField as cg, type AggregateOrderSpec as ch, type GroupBySpec as ci, type RecursiveCyclePolicy as cj, type VectorSlotMap as ck, type RecordedReadBinding as cl, type SelectiveField as cm, type ComposableQuery as cn, type SetOperationType as co, type SetOperation as cp, type NodeRow as cq, type EdgeRow as cr, type VectorMetric as cs, ALL_FULLTEXT_MODES as ct, ALL_META_EDGE_NAMES as cu, BASE_CONTRIBUTION_OWNER as cv, type CheckUniqueBatchParams as cw, type CheckUniqueParams as cx, type ClaimIndexMaterializationParams as cy, type CompiledTemporaryStatementSql as cz, type NodeType as d, isTombstonedNodeRow as d$, type ExtensionNodeIndex as d0, type ExtensionNumberProperty as d1, type ExtensionObjectFieldProperty as d2, type ExtensionObjectProperty as d3, type ExtensionPropertyModifiers as d4, type ExtensionPropertyType as d5, type ExtensionSearchableModifier as d6, type ExtensionStringProperty as d7, type ExtensionUniqueConstraint as d8, type ExtensionUniqueWhere as d9, POSTGRES_MAX_BIND_PARAMETERS as dA, type RecordContributionMaterializationParams as dB, type RecordIndexMaterializationParams as dC, type RecordKindRemovalParams as dD, type RelationalIndexMethod as dE, type ReleaseIndexMaterializationClaimParams as dF, SQLITE_CAPABILITIES as dG, SQLITE_MAX_BIND_PARAMETERS as dH, type SqlCompilationBackend as dI, type TombstonedNodeRow as dJ, type UniqueRow as dK, type UpdateEdgeParams as dL, type UpdateNodeParams as dM, type UpsertEmbeddingBatchParams as dN, type UpsertEmbeddingBatchRow as dO, type UpsertEmbeddingParams as dP, type UpsertFulltextParams as dQ, VECTOR_CONTRIBUTION_PREFIX as dR, type VectorIndexType as dS, type VectorSearchParams as dT, type VectorSearchResult as dU, assertFiniteEmbedding as dV, assertVectorMinScore as dW, assertVectorSearchLimit as dX, buildFulltextCapabilities as dY, isLiveNodeRow as dZ, isSqlPlaceholder as d_, FULLTEXT_CONTRIBUTION_NAME as da, type FindEdgesByEndpointSetParams as db, type FindEdgesByKindParams as dc, type FindEdgesConnectedToParams as dd, type FindNodesByKindParams as de, type GraphReadBackend as df, type HardDeleteEdgeParams as dg, type HardDeleteNodeParams as dh, type HybridSearchParams as di, type HybridSearchRow as dj, type InListParameterOptions as dk, type IndexDeclarationBase as dl, type IndexMaterializationRow as dm, type IndexWhereLiteral as dn, type IndexWhereOp as dp, type IndexWhereOperand as dq, type InsertEdgeParams as dr, type InsertNodeParams as ds, type InsertSchemaParams as dt, type InsertUniqueParams as du, type KindRemovalRow as dv, type LiveNodeRow as dw, MODERN_SQLITE_MAX_BIND_PARAMETERS as dx, type MetaEdgeName as dy, POSTGRES_CAPABILITIES as dz, type AnyEdgeType as e, normalizeGraphAnalyticsCapabilities as e0, quoteIdentifier as e1, shortHash as e2, vectorMinScoreCondition as e3, vectorPhysicalName as e4, vectorScoreExpression as e5, GRAPH_EXTENSION_TOP_LEVEL_KEYS as e6, type GraphExtensionTopLevelKey as e7, type GraphDefaults as f, type EdgeIndexDeclaration as g, type NodeIndexDeclaration as h, type EdgeIndexConfig as i, type EdgeIndexDirection as j, type EdgeIndexWhereBuilder as k, type IndexOrigin as l, type IndexScope as m, type IndexWhereExpression as n, type IndexWhereFieldBuilder as o, type IndexWhereInput as p, type NodeIndexConfig as q, type NodeIndexWhereBuilder as r, type SystemColumnName as s, type VectorIndexDeclaration as t, type VectorIndexImplementation as u, type VectorIndexMetric as v, type VectorIndexParams as w, type VectorSlot as x, type SchemaVersionRow as y, type GraphBackend as z };
@@ -1,4 +1,4 @@
1
- import { K as KindEntity, J as JsonPointer } from './types-Cjvkj0jA.js';
1
+ import { K as KindEntity, J as JsonPointer } from './types-Ch9a0Dx6.js';
2
2
 
3
3
  /**
4
4
  * QueryProfiler types.
@@ -1,4 +1,4 @@
1
- import { K as KindEntity, J as JsonPointer } from './types-Cjvkj0jA.cjs';
1
+ import { K as KindEntity, J as JsonPointer } from './types-Ch9a0Dx6.cjs';
2
2
 
3
3
  /**
4
4
  * QueryProfiler types.
@@ -1,4 +1,4 @@
1
- import { c as AnyEdgeType, g as EdgeIndexConfig, e as EdgeIndexDeclaration, b as NodeType, o as NodeIndexConfig, f as NodeIndexDeclaration, l as IndexWhereExpression } from './types-Cjvkj0jA.cjs';
1
+ import { e as AnyEdgeType, i as EdgeIndexConfig, g as EdgeIndexDeclaration, d as NodeType, q as NodeIndexConfig, h as NodeIndexDeclaration, n as IndexWhereExpression } from './types-Ch9a0Dx6.cjs';
2
2
 
3
3
  /** The TypeGraph relations that carry system indexes. */
4
4
  type SystemIndexTable = "nodes" | "edges" | "recordedNodes" | "recordedEdges";
@@ -1,4 +1,4 @@
1
- import { c as AnyEdgeType, g as EdgeIndexConfig, e as EdgeIndexDeclaration, b as NodeType, o as NodeIndexConfig, f as NodeIndexDeclaration, l as IndexWhereExpression } from './types-Cjvkj0jA.js';
1
+ import { e as AnyEdgeType, i as EdgeIndexConfig, g as EdgeIndexDeclaration, d as NodeType, q as NodeIndexConfig, h as NodeIndexDeclaration, n as IndexWhereExpression } from './types-Ch9a0Dx6.js';
2
2
 
3
3
  /** The TypeGraph relations that carry system indexes. */
4
4
  type SystemIndexTable = "nodes" | "edges" | "recordedNodes" | "recordedEdges";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicia-ai/typegraph",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "description": "TypeScript-first embedded knowledge graph library with ontological reasoning",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,59 +0,0 @@
1
- import { isPlainObject } from './chunk-ITE4IXAK.js';
2
- import { ConfigurationError } from './chunk-4MB3AQAQ.js';
3
-
4
- // src/core/json-value.ts
5
- function assertJsonValue(value, rootLabel, ownerKind) {
6
- walk(value, rootLabel, ownerKind);
7
- }
8
- function walk(value, path, ownerKind) {
9
- if (value === null) return;
10
- const valueType = typeof value;
11
- if (valueType === "number") {
12
- if (!Number.isFinite(value)) {
13
- throwInvalid(path, describeNonFinite(value), ownerKind);
14
- }
15
- return;
16
- }
17
- if (valueType === "string" || valueType === "boolean") return;
18
- if (valueType === "bigint" || valueType === "function" || valueType === "symbol" || valueType === "undefined") {
19
- throwInvalid(path, valueType, ownerKind);
20
- }
21
- if (Array.isArray(value)) {
22
- for (const [index, element] of value.entries()) {
23
- walk(element, `${path}[${index}]`, ownerKind);
24
- }
25
- return;
26
- }
27
- if (!isPlainObject(value)) {
28
- throwInvalid(path, describeNonPlain(value), ownerKind);
29
- }
30
- for (const [key, nested] of Object.entries(value)) {
31
- walk(nested, `${path}.${key}`, ownerKind);
32
- }
33
- }
34
- function describeNonFinite(value) {
35
- if (Number.isNaN(value)) return "NaN";
36
- if (value === Number.POSITIVE_INFINITY) return "Infinity";
37
- if (value === Number.NEGATIVE_INFINITY) return "-Infinity";
38
- return "non-finite number";
39
- }
40
- function describeNonPlain(value) {
41
- const constructorName = value?.constructor?.name;
42
- if (typeof constructorName === "string" && constructorName.length > 0) {
43
- return `${constructorName} instance`;
44
- }
45
- return "non-plain object";
46
- }
47
- function throwInvalid(path, kind, ownerKind) {
48
- throw new ConfigurationError(
49
- `${ownerKind} ${path} contains a non-JSON value (${kind}). Annotations must be JSON-serializable.`,
50
- { path, valueKind: kind },
51
- {
52
- suggestion: "Use only strings, numbers, booleans, null, arrays, and plain objects in annotations."
53
- }
54
- );
55
- }
56
-
57
- export { assertJsonValue };
58
- //# sourceMappingURL=chunk-2WDD2NO3.js.map
59
- //# sourceMappingURL=chunk-2WDD2NO3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/json-value.ts"],"names":[],"mappings":";;;;AAyBO,SAAS,eAAA,CACd,KAAA,EACA,SAAA,EACA,SAAA,EACM;AACN,EAAA,IAAA,CAAK,KAAA,EAAO,WAAW,SAAS,CAAA;AAClC;AAEA,SAAS,IAAA,CAAK,KAAA,EAAgB,IAAA,EAAc,SAAA,EAAyB;AACnE,EAAA,IAAI,UAAU,IAAA,EAAM;AACpB,EAAA,MAAM,YAAY,OAAO,KAAA;AACzB,EAAA,IAAI,cAAc,QAAA,EAAU;AAI1B,IAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC3B,MAAA,YAAA,CAAa,IAAA,EAAM,iBAAA,CAAkB,KAAe,CAAA,EAAG,SAAS,CAAA;AAAA,IAClE;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,SAAA,KAAc,QAAA,IAAY,SAAA,KAAc,SAAA,EAAW;AACvD,EAAA,IACE,cAAc,QAAA,IACd,SAAA,KAAc,cACd,SAAA,KAAc,QAAA,IACd,cAAc,WAAA,EACd;AACA,IAAA,YAAA,CAAa,IAAA,EAAM,WAAW,SAAS,CAAA;AAAA,EACzC;AACA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,CAAC,KAAA,EAAO,OAAO,CAAA,IAAK,KAAA,CAAM,SAAQ,EAAG;AAC9C,MAAA,IAAA,CAAK,SAAS,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,KAAK,KAAK,SAAS,CAAA;AAAA,IAC9C;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,aAAA,CAAc,KAAK,CAAA,EAAG;AACzB,IAAA,YAAA,CAAa,IAAA,EAAM,gBAAA,CAAiB,KAAK,CAAA,EAAG,SAAS,CAAA;AAAA,EACvD;AACA,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AACjD,IAAA,IAAA,CAAK,QAAQ,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,GAAG,IAAI,SAAS,CAAA;AAAA,EAC1C;AACF;AAEA,SAAS,kBAAkB,KAAA,EAAuB;AAChD,EAAA,IAAI,MAAA,CAAO,KAAA,CAAM,KAAK,CAAA,EAAG,OAAO,KAAA;AAChC,EAAA,IAAI,KAAA,KAAU,MAAA,CAAO,iBAAA,EAAmB,OAAO,UAAA;AAC/C,EAAA,IAAI,KAAA,KAAU,MAAA,CAAO,iBAAA,EAAmB,OAAO,WAAA;AAC/C,EAAA,OAAO,mBAAA;AACT;AAEA,SAAS,iBAAiB,KAAA,EAAwB;AAChD,EAAA,MAAM,eAAA,GAAmB,OACrB,WAAA,EAAa,IAAA;AACjB,EAAA,IAAI,OAAO,eAAA,KAAoB,QAAA,IAAY,eAAA,CAAgB,SAAS,CAAA,EAAG;AACrE,IAAA,OAAO,GAAG,eAAe,CAAA,SAAA,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,kBAAA;AACT;AAEA,SAAS,YAAA,CAAa,IAAA,EAAc,IAAA,EAAc,SAAA,EAA0B;AAC1E,EAAA,MAAM,IAAI,kBAAA;AAAA,IACR,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,IAAI,+BAA+B,IAAI,CAAA,yCAAA,CAAA;AAAA,IACvD,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAK;AAAA,IACxB;AAAA,MACE,UAAA,EACE;AAAA;AACJ,GACF;AACF","file":"chunk-2WDD2NO3.js","sourcesContent":["/**\n * Runtime validation for JSON-serializable values.\n *\n * Used at definition-time boundaries (e.g., `defineNode`/`defineEdge` annotations)\n * to reject values that would silently break `JSON.stringify` round-trips or\n * throw at hash time. Catches accidental violations from untyped JS callers\n * and `as any` escape hatches that bypass the `JsonValue` type.\n */\nimport { ConfigurationError } from \"../errors\";\nimport { isPlainObject } from \"../utils/object\";\n\n/**\n * Asserts that `value` is JSON-serializable.\n *\n * Throws `ConfigurationError` with a dotted path identifying the offending\n * field. Rejects `bigint`, `function`, `symbol`, `undefined`, and class\n * instances such as `Date`, `Map`, `Set`, regex literals, and Buffers — all\n * of which either throw or silently coerce under `JSON.stringify`.\n *\n * @param value - The value to validate\n * @param rootLabel - Label for the root of the value (e.g., `\"annotations\"`)\n * used as the prefix of the error path\n * @param ownerKind - Human-readable owner identifier for the error message\n * (e.g., `'Node \"Person\"'`)\n */\nexport function assertJsonValue(\n value: unknown,\n rootLabel: string,\n ownerKind: string,\n): void {\n walk(value, rootLabel, ownerKind);\n}\n\nfunction walk(value: unknown, path: string, ownerKind: string): void {\n if (value === null) return;\n const valueType = typeof value;\n if (valueType === \"number\") {\n // NaN/Infinity/-Infinity are not JSON values; JSON.stringify silently\n // coerces them to `null`, which would change the canonical hash input\n // without the consumer noticing.\n if (!Number.isFinite(value)) {\n throwInvalid(path, describeNonFinite(value as number), ownerKind);\n }\n return;\n }\n if (valueType === \"string\" || valueType === \"boolean\") return;\n if (\n valueType === \"bigint\" ||\n valueType === \"function\" ||\n valueType === \"symbol\" ||\n valueType === \"undefined\"\n ) {\n throwInvalid(path, valueType, ownerKind);\n }\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n walk(element, `${path}[${index}]`, ownerKind);\n }\n return;\n }\n if (!isPlainObject(value)) {\n throwInvalid(path, describeNonPlain(value), ownerKind);\n }\n for (const [key, nested] of Object.entries(value)) {\n walk(nested, `${path}.${key}`, ownerKind);\n }\n}\n\nfunction describeNonFinite(value: number): string {\n if (Number.isNaN(value)) return \"NaN\";\n if (value === Number.POSITIVE_INFINITY) return \"Infinity\";\n if (value === Number.NEGATIVE_INFINITY) return \"-Infinity\";\n return \"non-finite number\";\n}\n\nfunction describeNonPlain(value: unknown): string {\n const constructorName = (value as { constructor?: { name?: unknown } } | null)\n ?.constructor?.name;\n if (typeof constructorName === \"string\" && constructorName.length > 0) {\n return `${constructorName} instance`;\n }\n return \"non-plain object\";\n}\n\nfunction throwInvalid(path: string, kind: string, ownerKind: string): never {\n throw new ConfigurationError(\n `${ownerKind} ${path} contains a non-JSON value (${kind}). Annotations must be JSON-serializable.`,\n { path, valueKind: kind },\n {\n suggestion:\n \"Use only strings, numbers, booleans, null, arrays, and plain objects in annotations.\",\n },\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/node.ts","../src/core/edge.ts","../src/ontology/types.ts"],"names":["validateSchemaKeys"],"mappings":";;;;;;AAmCA,SAAS,kBAAA,CACP,QACA,IAAA,EACM;AACN,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA;AAAA,IACxB;AAAA,GACF;AACF;AAgBO,SAAS,UAAA,CAGd,MAAS,OAAA,EAA+C;AACxD,EAAA,kBAAA,CAAmB,OAAA,CAAQ,QAAQ,IAAI,CAAA;AACvC,EAAA,IAAI,OAAA,CAAQ,gBAAgB,MAAA,EAAW;AACrC,IAAA,eAAA,CAAgB,OAAA,CAAQ,WAAA,EAAa,aAAA,EAAe,CAAA,MAAA,EAAS,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACtE;AAEA,EAAA,OAAO,OAAO,MAAA,CAAO;AAAA,IACnB,CAAC,eAAe,GAAG,IAAA;AAAA,IACnB,IAAA,EAAM,IAAA;AAAA,IACN,QAAQ,OAAA,CAAQ,MAAA;AAAA,IAChB,aAAa,OAAA,CAAQ,WAAA;AAAA,IACrB,aAAa,OAAA,CAAQ;AAAA,GACtB,CAAA;AACH;AC7BA,IAAM,YAAA,GAAe,CAAA,CAAE,MAAA,CAAO,EAAE,CAAA;AAOhC,SAASA,mBAAAA,CACP,QACA,IAAA,EACM;AACN,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA;AAAA,IACxB;AAAA,GACF;AACF;AAgDO,SAAS,UAAA,CAMd,MACA,OAAA,EACqD;AACrD,EAAA,MAAM,MAAA,GAAS,SAAS,MAAA,IAAU,YAAA;AAClC,EAAAA,mBAAAA,CAAmB,QAAQ,IAAI,CAAA;AAC/B,EAAA,IAAI,OAAA,EAAS,gBAAgB,MAAA,EAAW;AACtC,IAAA,eAAA,CAAgB,OAAA,CAAQ,WAAA,EAAa,aAAA,EAAe,CAAA,MAAA,EAAS,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACtE;AAEA,EAAA,OAAO,OAAO,MAAA,CAAO;AAAA,IACnB,CAAC,eAAe,GAAG,IAAA;AAAA,IACnB,IAAA,EAAM,IAAA;AAAA,IACN,MAAA;AAAA,IACA,aAAa,OAAA,EAAS,WAAA;AAAA,IACtB,aAAa,OAAA,EAAS,WAAA;AAAA,IACtB,MAAM,OAAA,EAAS,IAAA;AAAA,IACf,IAAI,OAAA,EAAS;AAAA,GACd,CAAA;AACH;;;AClIO,IAAM,eAAA,GAAkB;AA+ExB,SAAS,WAAW,KAAA,EAAmC;AAC5D,EAAA,OACE,OAAO,UAAU,QAAA,IACjB,KAAA,KAAU,QACV,eAAA,IAAmB,KAAA,IAClB,KAAA,CAAkC,eAAe,CAAA,KAAM,IAAA;AAE5D;AAKO,SAAS,YAAY,SAAA,EAAiD;AAC3E,EAAA,IAAI,OAAO,cAAc,QAAA,EAAU;AACjC,IAAA,OAAO,SAAA;AAAA,EACT;AACA,EAAA,OAAO,SAAA,CAAU,IAAA;AACnB","file":"chunk-2Y4IFKW7.js","sourcesContent":["import { type z } from \"zod\";\n\nimport {\n assertSchemaKeysAreFree,\n RESERVED_NODE_KEYS,\n} from \"../store/reserved-keys\";\nimport { assertJsonValue } from \"./json-value\";\nimport { type KindAnnotations, NODE_TYPE_BRAND, type NodeType } from \"./types\";\n\n// ============================================================\n// Node Factory Options\n// ============================================================\n\n/**\n * Options for defining a node type.\n */\nexport type DefineNodeOptions<S extends z.ZodObject<z.ZodRawShape>> = Readonly<{\n /** Zod schema for node properties */\n schema: S;\n /** Optional description for documentation */\n description?: string;\n /**\n * Consumer-owned structured annotations for the kind.\n *\n * Stored in the canonical schema and **participates in schema hashing** —\n * any change bumps the schema version and shows up as a `safe`-severity\n * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.\n */\n annotations?: KindAnnotations;\n}>;\n\n// ============================================================\n// Node Factory\n// ============================================================\n\nfunction validateSchemaKeys(\n schema: z.ZodObject<z.ZodRawShape>,\n name: string,\n): void {\n assertSchemaKeysAreFree(\n \"Node\",\n name,\n Object.keys(schema.shape),\n RESERVED_NODE_KEYS,\n );\n}\n\n/**\n * Creates a node type definition.\n *\n * @example\n * ```typescript\n * const Person = defineNode(\"Person\", {\n * schema: z.object({\n * fullName: z.string().min(1),\n * email: z.string().email().optional(),\n * }),\n * description: \"A person in the system\",\n * });\n * ```\n */\nexport function defineNode<\n K extends string,\n S extends z.ZodObject<z.ZodRawShape>,\n>(name: K, options: DefineNodeOptions<S>): NodeType<K, S> {\n validateSchemaKeys(options.schema, name);\n if (options.annotations !== undefined) {\n assertJsonValue(options.annotations, \"annotations\", `Node \"${name}\"`);\n }\n\n return Object.freeze({\n [NODE_TYPE_BRAND]: true as const,\n kind: name,\n schema: options.schema,\n description: options.description,\n annotations: options.annotations,\n });\n}\n","import { z } from \"zod\";\n\nimport {\n assertSchemaKeysAreFree,\n RESERVED_EDGE_KEYS,\n} from \"../store/reserved-keys\";\nimport { assertJsonValue } from \"./json-value\";\nimport {\n EDGE_TYPE_BRAND,\n type EdgeType,\n type KindAnnotations,\n type NodeType,\n} from \"./types\";\n\n// ============================================================\n// Edge Factory Options\n// ============================================================\n\n/**\n * Options for defining an edge type.\n */\nexport type DefineEdgeOptions<\n S extends z.ZodObject<z.ZodRawShape>,\n From extends readonly NodeType[] | undefined = undefined,\n To extends readonly NodeType[] | undefined = undefined,\n> = Readonly<{\n /** Zod schema for edge properties (defaults to empty object) */\n schema?: S;\n /** Optional description for documentation */\n description?: string;\n /**\n * Consumer-owned structured annotations for the kind.\n *\n * Stored in the canonical schema and **participates in schema hashing** —\n * any change bumps the schema version and shows up as a `safe`-severity\n * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.\n */\n annotations?: KindAnnotations;\n /** Node types that can be the source of this edge (domain constraint) */\n from?: From;\n /** Node types that can be the target of this edge (range constraint) */\n to?: To;\n}>;\n\n// ============================================================\n// Empty Schema\n// ============================================================\n\nconst EMPTY_SCHEMA = z.object({});\ntype EmptySchema = typeof EMPTY_SCHEMA;\n\n// ============================================================\n// Edge Factory\n// ============================================================\n\nfunction validateSchemaKeys(\n schema: z.ZodObject<z.ZodRawShape>,\n name: string,\n): void {\n assertSchemaKeysAreFree(\n \"Edge\",\n name,\n Object.keys(schema.shape),\n RESERVED_EDGE_KEYS,\n );\n}\n\n/**\n * Creates an edge type definition.\n *\n * @example\n * ```typescript\n * // Edge with no properties\n * const hasEpisode = defineEdge(\"hasEpisode\");\n *\n * // Edge with properties\n * const employedAt = defineEdge(\"employedAt\", {\n * schema: z.object({\n * isPrimary: z.boolean().default(true),\n * startedAt: z.date(),\n * }),\n * description: \"Employment relationship\",\n * });\n *\n * // Edge with domain/range constraints (can be used directly in defineGraph)\n * const worksAt = defineEdge(\"worksAt\", {\n * schema: z.object({ role: z.string() }),\n * from: [Person],\n * to: [Company],\n * });\n * ```\n */\n// Overload: no options - returns edge without domain/range\nexport function defineEdge<K extends string>(name: K): EdgeType<K, EmptySchema>;\n\n// Overload: options with both from and to - returns edge with domain/range\nexport function defineEdge<\n K extends string,\n S extends z.ZodObject<z.ZodRawShape>,\n From extends readonly NodeType[],\n To extends readonly NodeType[],\n>(\n name: K,\n options: DefineEdgeOptions<S, From, To> & { from: From; to: To },\n): EdgeType<K, S, From, To>;\n\n// Overload: options without from/to - returns edge without domain/range\nexport function defineEdge<\n K extends string,\n S extends z.ZodObject<z.ZodRawShape>,\n>(name: K, options: DefineEdgeOptions<S>): EdgeType<K, S>;\n\n// Implementation\nexport function defineEdge<\n K extends string,\n S extends z.ZodObject<z.ZodRawShape>,\n From extends readonly NodeType[] | undefined,\n To extends readonly NodeType[] | undefined,\n>(\n name: K,\n options?: DefineEdgeOptions<S, From, To>,\n): EdgeType<K, S, From, To> | EdgeType<K, EmptySchema> {\n const schema = options?.schema ?? EMPTY_SCHEMA;\n validateSchemaKeys(schema, name);\n if (options?.annotations !== undefined) {\n assertJsonValue(options.annotations, \"annotations\", `Edge \"${name}\"`);\n }\n\n return Object.freeze({\n [EDGE_TYPE_BRAND]: true as const,\n kind: name,\n schema,\n description: options?.description,\n annotations: options?.annotations,\n from: options?.from,\n to: options?.to,\n }) as EdgeType<K, S, From, To> | EdgeType<K, EmptySchema>;\n}\n","import { type EdgeType, type NodeType } from \"../core/types\";\n\n// ============================================================\n// Brand Key\n// ============================================================\n\n/** Brand key for MetaEdge */\nexport const META_EDGE_BRAND = \"__metaEdge\" as const;\n\n// ============================================================\n// Inference Types\n// ============================================================\n\n/**\n * How a meta-edge affects queries and validation.\n */\nexport type InferenceType =\n | \"subsumption\" // Query for X includes instances of subclasses\n | \"hierarchy\" // Enables broader/narrower traversal\n | \"substitution\" // Can substitute equivalent types\n | \"constraint\" // Validation rules\n | \"composition\" // Part-whole navigation\n | \"association\" // Discovery/recommendation\n | \"none\"; // No automatic inference\n\n// ============================================================\n// Meta-Edge Properties\n// ============================================================\n\n/**\n * Properties of a meta-edge.\n */\nexport type MetaEdgeProperties = Readonly<{\n transitive: boolean; // A→B, B→C implies A→C\n symmetric: boolean; // A→B implies B→A\n reflexive: boolean; // A→A is always true\n inverse: string | undefined; // Name of inverse meta-edge\n inference: InferenceType; // How this affects queries\n description: string | undefined;\n}>;\n\n// ============================================================\n// Meta-Edge Type\n// ============================================================\n\n/**\n * A meta-edge definition.\n *\n * Meta-edges represent type-level relationships (between kinds),\n * not instance-level relationships (between nodes).\n */\nexport type MetaEdge<K extends string = string> = Readonly<{\n [META_EDGE_BRAND]: true;\n name: K;\n properties: MetaEdgeProperties;\n}>;\n\n// ============================================================\n// Ontology Relation\n// ============================================================\n\n/**\n * A relation in the ontology (instance of meta-edge between types).\n *\n * @example\n * ```typescript\n * // Podcast subClassOf Media\n * subClassOf(Podcast, Media)\n *\n * // Person equivalentTo schema:Person\n * equivalentTo(Person, \"https://schema.org/Person\")\n * ```\n */\nexport type OntologyRelation = Readonly<{\n metaEdge: MetaEdge;\n from: NodeType | EdgeType | string; // string for external IRIs\n to: NodeType | EdgeType | string;\n}>;\n\n// ============================================================\n// Type Guards\n// ============================================================\n\n/**\n * Checks if a value is a MetaEdge.\n */\nexport function isMetaEdge(value: unknown): value is MetaEdge {\n return (\n typeof value === \"object\" &&\n value !== null &&\n META_EDGE_BRAND in value &&\n (value as Record<string, unknown>)[META_EDGE_BRAND] === true\n );\n}\n\n/**\n * Gets the type name from a NodeType, EdgeType, or IRI string.\n */\nexport function getTypeName(typeOrIri: NodeType | EdgeType | string): string {\n if (typeof typeOrIri === \"string\") {\n return typeOrIri;\n }\n return typeOrIri.kind;\n}\n"]}