@nicia-ai/typegraph 0.40.0 → 0.42.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 (266) hide show
  1. package/dist/backend/drizzle/indexes.cjs +9 -9
  2. package/dist/backend/drizzle/indexes.d.cts +1 -2
  3. package/dist/backend/drizzle/indexes.d.ts +1 -2
  4. package/dist/backend/drizzle/indexes.js +5 -5
  5. package/dist/backend/index.cjs +50 -50
  6. package/dist/backend/index.d.cts +3 -4
  7. package/dist/backend/index.d.ts +3 -4
  8. package/dist/backend/index.js +11 -11
  9. package/dist/backend/postgres/index.cjs +26 -26
  10. package/dist/backend/postgres/index.d.cts +5 -6
  11. package/dist/backend/postgres/index.d.ts +5 -6
  12. package/dist/backend/postgres/index.js +13 -13
  13. package/dist/backend/postgres/pglite-store.cjs +34 -34
  14. package/dist/backend/postgres/pglite-store.d.cts +7 -8
  15. package/dist/backend/postgres/pglite-store.d.ts +7 -8
  16. package/dist/backend/postgres/pglite-store.js +30 -30
  17. package/dist/backend/postgres/pglite.cjs +15 -15
  18. package/dist/backend/postgres/pglite.d.cts +2 -3
  19. package/dist/backend/postgres/pglite.d.ts +2 -3
  20. package/dist/backend/postgres/pglite.js +14 -14
  21. package/dist/backend/sqlite/index.cjs +23 -23
  22. package/dist/backend/sqlite/index.d.cts +5 -6
  23. package/dist/backend/sqlite/index.d.ts +5 -6
  24. package/dist/backend/sqlite/index.js +11 -11
  25. package/dist/backend/sqlite/libsql.cjs +17 -17
  26. package/dist/backend/sqlite/libsql.d.cts +2 -3
  27. package/dist/backend/sqlite/libsql.d.ts +2 -3
  28. package/dist/backend/sqlite/libsql.js +13 -13
  29. package/dist/backend/sqlite/local-store.cjs +35 -35
  30. package/dist/backend/sqlite/local-store.d.cts +7 -8
  31. package/dist/backend/sqlite/local-store.d.ts +7 -8
  32. package/dist/backend/sqlite/local-store.js +31 -31
  33. package/dist/backend/sqlite/local.cjs +16 -16
  34. package/dist/backend/sqlite/local.d.cts +2 -3
  35. package/dist/backend/sqlite/local.d.ts +2 -3
  36. package/dist/backend/sqlite/local.js +14 -14
  37. package/dist/{chunk-H6I36MGT.cjs → chunk-277UZV7X.cjs} +1191 -1090
  38. package/dist/chunk-277UZV7X.cjs.map +1 -0
  39. package/dist/{chunk-2I3DNNBU.js → chunk-2G6ZEGYO.js} +4 -4
  40. package/dist/{chunk-2I3DNNBU.js.map → chunk-2G6ZEGYO.js.map} +1 -1
  41. package/dist/{chunk-76HE7DJP.js → chunk-2HKIID5K.js} +5 -5
  42. package/dist/{chunk-76HE7DJP.js.map → chunk-2HKIID5K.js.map} +1 -1
  43. package/dist/{chunk-QOHTVDHU.js → chunk-2OOY4OYT.js} +4 -4
  44. package/dist/{chunk-QOHTVDHU.js.map → chunk-2OOY4OYT.js.map} +1 -1
  45. package/dist/{chunk-UCHW2MGP.cjs → chunk-2SO5I5AI.cjs} +196 -196
  46. package/dist/{chunk-UCHW2MGP.cjs.map → chunk-2SO5I5AI.cjs.map} +1 -1
  47. package/dist/{chunk-LFFVD5ZR.cjs → chunk-33PAKPED.cjs} +41 -41
  48. package/dist/{chunk-LFFVD5ZR.cjs.map → chunk-33PAKPED.cjs.map} +1 -1
  49. package/dist/chunk-3RPQDGUE.cjs +83 -0
  50. package/dist/chunk-3RPQDGUE.cjs.map +1 -0
  51. package/dist/{chunk-PH4IJ3V5.js → chunk-3V6D5DEC.js} +3 -3
  52. package/dist/{chunk-PH4IJ3V5.js.map → chunk-3V6D5DEC.js.map} +1 -1
  53. package/dist/{chunk-Y5UC3IXF.js → chunk-42XYPKZU.js} +3 -3
  54. package/dist/{chunk-Y5UC3IXF.js.map → chunk-42XYPKZU.js.map} +1 -1
  55. package/dist/{chunk-XZA3Y4YH.js → chunk-4WYFRACU.js} +3 -3
  56. package/dist/{chunk-XZA3Y4YH.js.map → chunk-4WYFRACU.js.map} +1 -1
  57. package/dist/{chunk-AQVDAKXH.js → chunk-4XRP2N6B.js} +3 -3
  58. package/dist/{chunk-AQVDAKXH.js.map → chunk-4XRP2N6B.js.map} +1 -1
  59. package/dist/{chunk-PWXGB77L.cjs → chunk-5AERZSHC.cjs} +4 -4
  60. package/dist/{chunk-PWXGB77L.cjs.map → chunk-5AERZSHC.cjs.map} +1 -1
  61. package/dist/{chunk-K6CD6W5J.js → chunk-5C75HQYQ.js} +5 -5
  62. package/dist/{chunk-K6CD6W5J.js.map → chunk-5C75HQYQ.js.map} +1 -1
  63. package/dist/{chunk-2J5NMMVR.cjs → chunk-5GV4JQNA.cjs} +43 -43
  64. package/dist/{chunk-2J5NMMVR.cjs.map → chunk-5GV4JQNA.cjs.map} +1 -1
  65. package/dist/{chunk-KHNKYSGP.cjs → chunk-5P6IPIT6.cjs} +41 -41
  66. package/dist/{chunk-KHNKYSGP.cjs.map → chunk-5P6IPIT6.cjs.map} +1 -1
  67. package/dist/{chunk-53BSOG3O.js → chunk-6NB73BXV.js} +11 -11
  68. package/dist/{chunk-53BSOG3O.js.map → chunk-6NB73BXV.js.map} +1 -1
  69. package/dist/{chunk-SE422RES.cjs → chunk-6TJ6PKPS.cjs} +27 -27
  70. package/dist/{chunk-SE422RES.cjs.map → chunk-6TJ6PKPS.cjs.map} +1 -1
  71. package/dist/{chunk-QXKVUJLI.cjs → chunk-7TOT7RKY.cjs} +120 -120
  72. package/dist/{chunk-QXKVUJLI.cjs.map → chunk-7TOT7RKY.cjs.map} +1 -1
  73. package/dist/{chunk-7WLEQIHA.cjs → chunk-7Y6BV3TK.cjs} +100 -100
  74. package/dist/{chunk-7WLEQIHA.cjs.map → chunk-7Y6BV3TK.cjs.map} +1 -1
  75. package/dist/{chunk-HP6LWBLB.cjs → chunk-AO2WPYFZ.cjs} +4 -4
  76. package/dist/{chunk-HP6LWBLB.cjs.map → chunk-AO2WPYFZ.cjs.map} +1 -1
  77. package/dist/{chunk-7UTUKH4E.cjs → chunk-AQR6BHB3.cjs} +10 -10
  78. package/dist/{chunk-7UTUKH4E.cjs.map → chunk-AQR6BHB3.cjs.map} +1 -1
  79. package/dist/{chunk-X4PVHAZ6.cjs → chunk-ARN3ZODS.cjs} +6 -6
  80. package/dist/{chunk-X4PVHAZ6.cjs.map → chunk-ARN3ZODS.cjs.map} +1 -1
  81. package/dist/{chunk-EFZ4S22A.js → chunk-BGXKXGDI.js} +12 -12
  82. package/dist/{chunk-EFZ4S22A.js.map → chunk-BGXKXGDI.js.map} +1 -1
  83. package/dist/{chunk-YYLMXERH.js → chunk-CDYRPI5U.js} +4 -4
  84. package/dist/{chunk-YYLMXERH.js.map → chunk-CDYRPI5U.js.map} +1 -1
  85. package/dist/{chunk-3LKL3S6X.js → chunk-CI5NPLXX.js} +3 -3
  86. package/dist/{chunk-3LKL3S6X.js.map → chunk-CI5NPLXX.js.map} +1 -1
  87. package/dist/{chunk-UUIBACKJ.js → chunk-CUPJL6TS.js} +3 -3
  88. package/dist/{chunk-UUIBACKJ.js.map → chunk-CUPJL6TS.js.map} +1 -1
  89. package/dist/{chunk-JZYMOHHM.cjs → chunk-CVK4T34X.cjs} +22 -22
  90. package/dist/{chunk-JZYMOHHM.cjs.map → chunk-CVK4T34X.cjs.map} +1 -1
  91. package/dist/{chunk-L3DDZUZP.js → chunk-CVNGKTHO.js} +4 -4
  92. package/dist/{chunk-L3DDZUZP.js.map → chunk-CVNGKTHO.js.map} +1 -1
  93. package/dist/{chunk-RW24SAHI.cjs → chunk-DMZEVJGL.cjs} +13 -13
  94. package/dist/{chunk-RW24SAHI.cjs.map → chunk-DMZEVJGL.cjs.map} +1 -1
  95. package/dist/{chunk-3BL3JFHL.js → chunk-DP7KC6CL.js} +126 -25
  96. package/dist/{chunk-3BL3JFHL.js.map → chunk-DP7KC6CL.js.map} +1 -1
  97. package/dist/{chunk-QYDUCWD2.cjs → chunk-ECU53PMN.cjs} +4 -4
  98. package/dist/{chunk-QYDUCWD2.cjs.map → chunk-ECU53PMN.cjs.map} +1 -1
  99. package/dist/{chunk-SCTZRFW5.js → chunk-EQOQOT55.js} +5 -5
  100. package/dist/{chunk-SCTZRFW5.js.map → chunk-EQOQOT55.js.map} +1 -1
  101. package/dist/{chunk-JHK6NPFV.js → chunk-EVFL2ZY5.js} +9 -9
  102. package/dist/{chunk-JHK6NPFV.js.map → chunk-EVFL2ZY5.js.map} +1 -1
  103. package/dist/{chunk-SAMJLDGG.cjs → chunk-F2KVJ6FF.cjs} +112 -112
  104. package/dist/{chunk-SAMJLDGG.cjs.map → chunk-F2KVJ6FF.cjs.map} +1 -1
  105. package/dist/{chunk-NMQ6C6TS.cjs → chunk-F7TDKSVB.cjs} +4 -4
  106. package/dist/{chunk-NMQ6C6TS.cjs.map → chunk-F7TDKSVB.cjs.map} +1 -1
  107. package/dist/{chunk-HQRZEYYB.cjs → chunk-FFQGI67R.cjs} +44 -44
  108. package/dist/{chunk-HQRZEYYB.cjs.map → chunk-FFQGI67R.cjs.map} +1 -1
  109. package/dist/{chunk-YIRLBUNN.js → chunk-FMPZPOUD.js} +3 -3
  110. package/dist/{chunk-YIRLBUNN.js.map → chunk-FMPZPOUD.js.map} +1 -1
  111. package/dist/{chunk-LL5D5T5W.cjs → chunk-FSCJOTHF.cjs} +10 -10
  112. package/dist/{chunk-LL5D5T5W.cjs.map → chunk-FSCJOTHF.cjs.map} +1 -1
  113. package/dist/{chunk-2X73QTIC.cjs → chunk-FY4VY5EV.cjs} +20 -20
  114. package/dist/{chunk-2X73QTIC.cjs.map → chunk-FY4VY5EV.cjs.map} +1 -1
  115. package/dist/{chunk-3SHAUJRB.js → chunk-GT7NEXSU.js} +3 -3
  116. package/dist/{chunk-3SHAUJRB.js.map → chunk-GT7NEXSU.js.map} +1 -1
  117. package/dist/{chunk-W66YCXWT.js → chunk-HHBKGPEI.js} +11 -10
  118. package/dist/chunk-HHBKGPEI.js.map +1 -0
  119. package/dist/{chunk-CKFBZ4LV.cjs → chunk-I73ATSAH.cjs} +4 -4
  120. package/dist/{chunk-CKFBZ4LV.cjs.map → chunk-I73ATSAH.cjs.map} +1 -1
  121. package/dist/{chunk-ELA3V6UN.js → chunk-JOYPNY33.js} +9 -9
  122. package/dist/{chunk-ELA3V6UN.js.map → chunk-JOYPNY33.js.map} +1 -1
  123. package/dist/{chunk-YIX3BEBR.cjs → chunk-K2HHCWZO.cjs} +108 -108
  124. package/dist/{chunk-YIX3BEBR.cjs.map → chunk-K2HHCWZO.cjs.map} +1 -1
  125. package/dist/{chunk-SAFZ6JTI.cjs → chunk-KTBTSHU6.cjs} +19 -2
  126. package/dist/chunk-KTBTSHU6.cjs.map +1 -0
  127. package/dist/chunk-LDCWO5B6.js +81 -0
  128. package/dist/chunk-LDCWO5B6.js.map +1 -0
  129. package/dist/{chunk-I5CRUPKO.js → chunk-LQLVJWUH.js} +7 -7
  130. package/dist/{chunk-I5CRUPKO.js.map → chunk-LQLVJWUH.js.map} +1 -1
  131. package/dist/{chunk-ZE7E46IZ.js → chunk-LTVBD56M.js} +6 -6
  132. package/dist/{chunk-ZE7E46IZ.js.map → chunk-LTVBD56M.js.map} +1 -1
  133. package/dist/{chunk-6N7QBIWN.js → chunk-M4GYQF2H.js} +3 -3
  134. package/dist/{chunk-6N7QBIWN.js.map → chunk-M4GYQF2H.js.map} +1 -1
  135. package/dist/{chunk-XRU7V7FF.cjs → chunk-O2GZM7UK.cjs} +7 -7
  136. package/dist/{chunk-XRU7V7FF.cjs.map → chunk-O2GZM7UK.cjs.map} +1 -1
  137. package/dist/{chunk-ZE6NVENI.js → chunk-O3USVVWS.js} +3 -3
  138. package/dist/{chunk-ZE6NVENI.js.map → chunk-O3USVVWS.js.map} +1 -1
  139. package/dist/{chunk-UDS5DZNY.cjs → chunk-O7XVCLXW.cjs} +68 -67
  140. package/dist/chunk-O7XVCLXW.cjs.map +1 -0
  141. package/dist/{chunk-KLR77R5A.cjs → chunk-OM6RIOA5.cjs} +13 -13
  142. package/dist/{chunk-KLR77R5A.cjs.map → chunk-OM6RIOA5.cjs.map} +1 -1
  143. package/dist/{chunk-LLHMAHG4.cjs → chunk-OMQ2NBOR.cjs} +27 -27
  144. package/dist/{chunk-LLHMAHG4.cjs.map → chunk-OMQ2NBOR.cjs.map} +1 -1
  145. package/dist/{chunk-DPNA466P.js → chunk-OYJSYDIH.js} +19 -3
  146. package/dist/chunk-OYJSYDIH.js.map +1 -0
  147. package/dist/{chunk-CU3LPYNB.js → chunk-RAWG2FEU.js} +138 -22
  148. package/dist/chunk-RAWG2FEU.js.map +1 -0
  149. package/dist/{chunk-M2RPZS7J.cjs → chunk-RTUCOEIO.cjs} +12 -12
  150. package/dist/{chunk-M2RPZS7J.cjs.map → chunk-RTUCOEIO.cjs.map} +1 -1
  151. package/dist/{chunk-TAUGGLNQ.js → chunk-RXOAXO3R.js} +3 -3
  152. package/dist/{chunk-TAUGGLNQ.js.map → chunk-RXOAXO3R.js.map} +1 -1
  153. package/dist/{chunk-LLE25NRD.cjs → chunk-TRC646QQ.cjs} +7 -7
  154. package/dist/{chunk-LLE25NRD.cjs.map → chunk-TRC646QQ.cjs.map} +1 -1
  155. package/dist/chunk-U3YRCZ5L.cjs +12 -0
  156. package/dist/{chunk-IMQKXL4E.cjs.map → chunk-U3YRCZ5L.cjs.map} +1 -1
  157. package/dist/{chunk-ZVME6OSV.js → chunk-UJRWOV5B.js} +5 -5
  158. package/dist/{chunk-ZVME6OSV.js.map → chunk-UJRWOV5B.js.map} +1 -1
  159. package/dist/{chunk-HAQVISUF.cjs → chunk-UTTW2Q3M.cjs} +133 -133
  160. package/dist/{chunk-HAQVISUF.cjs.map → chunk-UTTW2Q3M.cjs.map} +1 -1
  161. package/dist/{chunk-L5ET7FYQ.js → chunk-UZLEQFTV.js} +3 -3
  162. package/dist/{chunk-L5ET7FYQ.js.map → chunk-UZLEQFTV.js.map} +1 -1
  163. package/dist/{chunk-K4FB2RMO.cjs → chunk-V2GZBPY2.cjs} +184 -65
  164. package/dist/chunk-V2GZBPY2.cjs.map +1 -0
  165. package/dist/{chunk-BUZWMDNL.js → chunk-VC26BUNP.js} +5 -5
  166. package/dist/{chunk-BUZWMDNL.js.map → chunk-VC26BUNP.js.map} +1 -1
  167. package/dist/chunk-VGMNGWBR.cjs +12 -0
  168. package/dist/{chunk-5YBDB7UG.cjs.map → chunk-VGMNGWBR.cjs.map} +1 -1
  169. package/dist/{chunk-XMEYZYGE.js → chunk-WYQILW5V.js} +8 -8
  170. package/dist/{chunk-XMEYZYGE.js.map → chunk-WYQILW5V.js.map} +1 -1
  171. package/dist/{chunk-YX3H63VV.cjs → chunk-X2XOQZT3.cjs} +9 -9
  172. package/dist/{chunk-YX3H63VV.cjs.map → chunk-X2XOQZT3.cjs.map} +1 -1
  173. package/dist/{chunk-N2V3HJFV.cjs → chunk-XDMPDUKL.cjs} +9 -9
  174. package/dist/{chunk-N2V3HJFV.cjs.map → chunk-XDMPDUKL.cjs.map} +1 -1
  175. package/dist/{chunk-5J4VNCUD.js → chunk-Z3WIL6S3.js} +5 -5
  176. package/dist/{chunk-5J4VNCUD.js.map → chunk-Z3WIL6S3.js.map} +1 -1
  177. package/dist/{chunk-MNURF4RF.cjs → chunk-ZBV4LQD2.cjs} +4 -4
  178. package/dist/{chunk-MNURF4RF.cjs.map → chunk-ZBV4LQD2.cjs.map} +1 -1
  179. package/dist/{chunk-YGX4PMG6.js → chunk-ZGOUVMVS.js} +5 -5
  180. package/dist/{chunk-YGX4PMG6.js.map → chunk-ZGOUVMVS.js.map} +1 -1
  181. package/dist/{chunk-QZYGZVUI.js → chunk-ZIRC2U6G.js} +11 -11
  182. package/dist/{chunk-QZYGZVUI.js.map → chunk-ZIRC2U6G.js.map} +1 -1
  183. package/dist/{chunk-6QP4QXBR.js → chunk-ZOHCFYXE.js} +3 -3
  184. package/dist/{chunk-6QP4QXBR.js.map → chunk-ZOHCFYXE.js.map} +1 -1
  185. package/dist/{chunk-VWEFXG73.js → chunk-ZP2KPDNN.js} +3 -3
  186. package/dist/{chunk-VWEFXG73.js.map → chunk-ZP2KPDNN.js.map} +1 -1
  187. package/dist/{chunk-NT6ILURI.cjs → chunk-ZPCKPLMX.cjs} +8 -8
  188. package/dist/{chunk-NT6ILURI.cjs.map → chunk-ZPCKPLMX.cjs.map} +1 -1
  189. package/dist/core/index.cjs +28 -28
  190. package/dist/core/index.d.cts +5 -6
  191. package/dist/core/index.d.ts +5 -6
  192. package/dist/core/index.js +8 -8
  193. package/dist/{ddl-KnCdF_le.d.cts → ddl-3unqC-kg.d.cts} +3 -3
  194. package/dist/{ddl-BLEzHw6j.d.ts → ddl-Bc4Dl8fu.d.ts} +3 -3
  195. package/dist/{define-graph-DQnj3fNH.d.ts → define-graph-Byslw2OO.d.cts} +1 -2
  196. package/dist/{define-graph-Cv3CFwKm.d.cts → define-graph-DBFnc7u_.d.ts} +1 -2
  197. package/dist/graph-extension/index.cjs +20 -20
  198. package/dist/graph-extension/index.d.cts +4 -4
  199. package/dist/graph-extension/index.d.ts +4 -4
  200. package/dist/graph-extension/index.js +5 -5
  201. package/dist/graph-merge/index.cjs +105 -105
  202. package/dist/graph-merge/index.d.cts +8 -9
  203. package/dist/graph-merge/index.d.ts +8 -9
  204. package/dist/graph-merge/index.js +25 -25
  205. package/dist/{index-BD_3TCgh.d.ts → index-DHXw7QAl.d.cts} +19 -4
  206. package/dist/{index-BihFPsPu.d.cts → index-DQzVJBHa.d.ts} +19 -4
  207. package/dist/index.cjs +209 -200
  208. package/dist/index.cjs.map +1 -1
  209. package/dist/index.d.cts +13 -15
  210. package/dist/index.d.ts +13 -15
  211. package/dist/index.js +35 -34
  212. package/dist/index.js.map +1 -1
  213. package/dist/indexes/index.cjs +13 -13
  214. package/dist/indexes/index.d.cts +4 -5
  215. package/dist/indexes/index.d.ts +4 -5
  216. package/dist/indexes/index.js +6 -6
  217. package/dist/interchange/index.cjs +40 -40
  218. package/dist/interchange/index.d.cts +9 -10
  219. package/dist/interchange/index.d.ts +9 -10
  220. package/dist/interchange/index.js +14 -14
  221. package/dist/{manager-DjE6Mhag.d.ts → manager-Dl0-er1G.d.ts} +45 -156
  222. package/dist/{manager-mqee5MVB.d.cts → manager-U9_zopqr.d.cts} +45 -156
  223. package/dist/materialize-indexes-BM3u0aXE.d.ts +258 -0
  224. package/dist/materialize-indexes-DzMCetZe.d.cts +258 -0
  225. package/dist/{postgres-Bm4DyFQU.d.cts → postgres-C5-WMKFA.d.ts} +1 -1
  226. package/dist/{postgres-DtaVALOZ.d.ts → postgres-DpJqtbSX.d.cts} +1 -1
  227. package/dist/profiler/index.d.cts +9 -10
  228. package/dist/profiler/index.d.ts +9 -10
  229. package/dist/provenance/index.cjs +39 -39
  230. package/dist/provenance/index.d.cts +7 -8
  231. package/dist/provenance/index.d.ts +7 -8
  232. package/dist/provenance/index.js +9 -9
  233. package/dist/schema/index.cjs +55 -112
  234. package/dist/schema/index.cjs.map +1 -1
  235. package/dist/schema/index.d.cts +57 -58
  236. package/dist/schema/index.d.ts +57 -58
  237. package/dist/schema/index.js +15 -92
  238. package/dist/schema/index.js.map +1 -1
  239. package/dist/{searchable-BxlJQVFw.d.cts → searchable-B4mUXZT6.d.cts} +2 -2
  240. package/dist/{searchable-ChJ29MCd.d.ts → searchable-C7jmPNLT.d.ts} +2 -2
  241. package/dist/{sqlite-m9Izphk_.d.ts → sqlite-Ch5tSYQY.d.ts} +1 -1
  242. package/dist/{sqlite-DT6tTHOG.d.cts → sqlite-Da7jiYu9.d.cts} +1 -1
  243. package/dist/{store-view-CagdeyNn.d.ts → store-view-6C2vTWqf.d.ts} +68 -16
  244. package/dist/{store-view-C-buB8Q8.d.cts → store-view-CNcOG8bQ.d.cts} +68 -16
  245. package/dist/{temporal-CyFsSPe8.d.ts → temporal-BtrTYTiB.d.ts} +1 -1
  246. package/dist/{temporal-Dn_JADWY.d.cts → temporal-CMpigMCW.d.cts} +1 -1
  247. package/dist/{types-CYdXzZef.d.ts → types-D2rU5Taq.d.ts} +1 -2
  248. package/dist/{types-D8szWDUo.d.ts → types-Dh-EgT-w.d.cts} +569 -2
  249. package/dist/{types-C5pZeKTl.d.cts → types-Dh-EgT-w.d.ts} +569 -2
  250. package/dist/{types-CqSfMRW3.d.cts → types-G4sVM-76.d.cts} +1 -2
  251. package/dist/{where-sQL4u5h-.d.ts → where-B8Y21kig.d.ts} +1 -2
  252. package/dist/{where-C3-HRgUq.d.cts → where-DbZ9XDOI.d.cts} +1 -2
  253. package/package.json +1 -1
  254. package/dist/chunk-5YBDB7UG.cjs +0 -12
  255. package/dist/chunk-CU3LPYNB.js.map +0 -1
  256. package/dist/chunk-DPNA466P.js.map +0 -1
  257. package/dist/chunk-H6I36MGT.cjs.map +0 -1
  258. package/dist/chunk-IMQKXL4E.cjs +0 -12
  259. package/dist/chunk-K4FB2RMO.cjs.map +0 -1
  260. package/dist/chunk-SAFZ6JTI.cjs.map +0 -1
  261. package/dist/chunk-UDS5DZNY.cjs.map +0 -1
  262. package/dist/chunk-W66YCXWT.js.map +0 -1
  263. package/dist/extension-types-BLEVH4SG.d.cts +0 -571
  264. package/dist/extension-types-BLEVH4SG.d.ts +0 -571
  265. package/dist/materialize-indexes-D4iei4Kp.d.ts +0 -90
  266. package/dist/materialize-indexes-ExQ6OrAh.d.cts +0 -90
@@ -1,571 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Which side of the bipartite graph a kind lives on. Used everywhere a
5
- * function takes "the entity that owns a kind" — error metadata,
6
- * extension classifiers, removal queues, schema diffs.
7
- */
8
- type KindEntity = "node" | "edge";
9
- /**
10
- * Which physical surface an index targets. Vector indexes don't own a
11
- * kind directly (they back a per-`(kind, field)` typed embedding table
12
- * owned by the active `VectorStrategy`), but they participate in the same
13
- * materialization and diff pipelines, so they share this discriminator.
14
- *
15
- * `"system"` marks TypeGraph's own base-relation indexes
16
- * (`SYSTEM_INDEX_DECLARATIONS`) — graph-independent, but materialized and
17
- * status-tracked through the same pipeline; their status rows carry the
18
- * relation key (e.g. `"recordedNodes"`) in the `kind` column.
19
- */
20
- type IndexEntity = "node" | "edge" | "vector" | "system";
21
- /**
22
- * Field-level null-check operations that round-trip through persisted
23
- * documents (unique-constraint where clauses, index where clauses,
24
- * graph-extension where clauses, IsNullPredicate). Consolidated so a
25
- * single rename or extension touches one site.
26
- */
27
- type NullCheckOp = "isNull" | "isNotNull";
28
- /** Brand key for NodeType */
29
- declare const NODE_TYPE_BRAND: "__nodeType";
30
- /** Brand key for EdgeType */
31
- declare const EDGE_TYPE_BRAND: "__edgeType";
32
- /** Brand symbol for NodeId */
33
- declare const __nodeId: unique symbol;
34
- /** Brand symbol for EdgeId */
35
- declare const __edgeId: unique symbol;
36
- /**
37
- * Any JSON-serializable value.
38
- *
39
- * Mirrors the JSON wire format: primitives, arrays, and string-keyed objects.
40
- * `null` is included because the JSON spec requires it for "no value here";
41
- * this is the one place in the public API that uses `null` over `undefined`.
42
- */
43
- type JsonValue = null | string | number | boolean | readonly JsonValue[] | Readonly<{
44
- [key: string]: JsonValue;
45
- }>;
46
- /**
47
- * Consumer-owned per-kind annotations.
48
- *
49
- * Stable labels attached to a node or edge kind at definition time — UI hints,
50
- * audit policy, provenance pointers, tooling annotations.
51
- *
52
- * **Consumer-owned, fully.** TypeGraph never reads, validates, or interprets
53
- * values in this field. Consumers own the entire namespace; there are no
54
- * reserved keys or extension prefixes. Future library-owned per-kind state,
55
- * if needed, will use a separate sibling field rather than carving out keys
56
- * here.
57
- *
58
- * **Annotations participate in schema hashing.** Any change to an annotation
59
- * value (or adding/removing an annotation key) bumps the canonical schema
60
- * hash and is reported as a `safe`-severity diff by `getSchemaChanges`. If
61
- * you don't want versioning for a piece of state, do not put it here.
62
- *
63
- * Values must be JSON-serializable — `bigint`, `function`, `symbol`, `undefined`,
64
- * `Date`, and other class instances are rejected at definition time so they can
65
- * never silently break schema hashing or storage round-trips.
66
- */
67
- type KindAnnotations = Readonly<Record<string, JsonValue>>;
68
- /**
69
- * A node type definition.
70
- *
71
- * Created via `defineNode()`. Represents a type of node in the graph
72
- * with an associated Zod schema for properties.
73
- */
74
- type NodeType<K extends string = string, S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = Readonly<{
75
- [NODE_TYPE_BRAND]: true;
76
- kind: K;
77
- schema: S;
78
- description: string | undefined;
79
- annotations: KindAnnotations | undefined;
80
- }>;
81
- /**
82
- * Branded node ID type.
83
- *
84
- * Prevents mixing IDs from different node types at compile time.
85
- */
86
- type NodeId<N extends NodeType> = string & Readonly<{
87
- [__nodeId]: N;
88
- }>;
89
- /**
90
- * Brands a non-empty string as a {@link NodeId}.
91
- *
92
- * Use this when a persisted node id has round-tripped through untyped storage
93
- * or an external boundary and must be passed back to read/update/delete
94
- * surfaces such as `getById`, `getByIds`, `update`, or `delete`.
95
- * Write surfaces that mint or claim ids, such as `create({ id })` and
96
- * `upsertById`, intentionally accept plain strings.
97
- *
98
- * @throws {ValidationError} when `value` is empty.
99
- */
100
- declare function asNodeId<N extends NodeType = NodeType>(value: string): NodeId<N>;
101
- /**
102
- * Infer the props type from a NodeType.
103
- */
104
- type NodeProps<N extends NodeType> = z.infer<N["schema"]>;
105
- /**
106
- * An edge type definition.
107
- *
108
- * Created via `defineEdge()`. Represents a type of edge in the graph
109
- * with an optional Zod schema for properties.
110
- *
111
- * Optionally includes `from` and `to` arrays that define the allowed
112
- * source and target node types (domain and range constraints).
113
- */
114
- type EdgeType<K extends string = string, S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[] | undefined = undefined, To extends readonly NodeType[] | undefined = undefined> = Readonly<{
115
- [EDGE_TYPE_BRAND]: true;
116
- kind: K;
117
- schema: S;
118
- description: string | undefined;
119
- annotations: KindAnnotations | undefined;
120
- from: From;
121
- to: To;
122
- }>;
123
- /**
124
- * Base edge type for use in constraints - accepts any from/to configuration.
125
- */
126
- type AnyEdgeType = EdgeType<string, z.ZodObject<z.ZodRawShape>, readonly NodeType[] | undefined, readonly NodeType[] | undefined>;
127
- /**
128
- * An edge type that has both from and to constraints defined.
129
- * Can be used directly in defineGraph without an EdgeRegistration wrapper.
130
- */
131
- type EdgeTypeWithEndpoints = EdgeType<string, z.ZodObject<z.ZodRawShape>, readonly NodeType[], readonly NodeType[]>;
132
- /**
133
- * Branded edge ID type.
134
- *
135
- * Prevents mixing IDs from different edge types at compile time.
136
- */
137
- type EdgeId<E extends AnyEdgeType = AnyEdgeType> = string & Readonly<{
138
- [__edgeId]: E;
139
- }>;
140
- /**
141
- * Brands a non-empty string as an {@link EdgeId}.
142
- *
143
- * Use this when a persisted edge id has round-tripped through untyped storage
144
- * or an external boundary and must be passed back to read/update/delete
145
- * surfaces such as `getById`, `getByIds`, `update`, or `delete`.
146
- * Write surfaces that mint ids intentionally accept plain strings.
147
- *
148
- * @throws {ValidationError} when `value` is empty.
149
- */
150
- declare function asEdgeId<E extends AnyEdgeType = AnyEdgeType>(value: string): EdgeId<E>;
151
- /**
152
- * Infer the props type from an EdgeType.
153
- */
154
- type EdgeProps<E extends AnyEdgeType> = z.infer<E["schema"]>;
155
- /**
156
- * Delete behaviors for nodes.
157
- */
158
- type DeleteBehavior = "restrict" | "cascade" | "disconnect";
159
- /**
160
- * Edge cardinality constraints.
161
- */
162
- type Cardinality = "many" | "one" | "unique" | "oneActive";
163
- /**
164
- * Endpoint existence modes for edge validation.
165
- */
166
- type EndpointExistence = "notDeleted" | "currentlyValid" | "ever";
167
- /**
168
- * Temporal query modes.
169
- */
170
- type TemporalMode = "current" | "asOf" | "includeEnded" | "includeTombstones";
171
- /**
172
- * Uniqueness constraint scope.
173
- */
174
- type UniquenessScope = "kind" | "kindWithSubClasses";
175
- /**
176
- * Collation for uniqueness constraints.
177
- */
178
- type Collation = "binary" | "caseInsensitive";
179
- /**
180
- * Uniqueness constraint definition.
181
- */
182
- type UniqueConstraint<S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = Readonly<{
183
- name: string;
184
- fields: readonly (keyof z.infer<S> & string)[];
185
- where?: (props: UniqueConstraintPredicateBuilder<S>) => UniqueConstraintPredicate;
186
- scope: UniquenessScope;
187
- collation: Collation;
188
- }>;
189
- /**
190
- * Predicate builder for uniqueness constraint where clause.
191
- * Uses -? to make all fields required in the builder, even if optional in the schema.
192
- */
193
- type UniqueConstraintPredicateBuilder<S extends z.ZodObject<z.ZodRawShape>> = Readonly<{
194
- [K in keyof z.infer<S>]-?: UniqueConstraintField;
195
- }>;
196
- /**
197
- * Field operations for uniqueness constraint predicates.
198
- */
199
- type UniqueConstraintField = Readonly<{
200
- isNull: () => UniqueConstraintPredicate;
201
- isNotNull: () => UniqueConstraintPredicate;
202
- }>;
203
- /**
204
- * A uniqueness constraint predicate (internal representation).
205
- */
206
- type UniqueConstraintPredicate = Readonly<{
207
- __type: "unique_predicate";
208
- field: string;
209
- op: NullCheckOp;
210
- }>;
211
- /**
212
- * Node registration in a graph definition.
213
- */
214
- type NodeRegistration<N extends NodeType = NodeType> = Readonly<{
215
- type: N;
216
- unique?: readonly UniqueConstraint<N["schema"]>[];
217
- onDelete?: DeleteBehavior;
218
- }>;
219
- /**
220
- * Edge registration in a graph definition.
221
- */
222
- type EdgeRegistration<E extends AnyEdgeType = AnyEdgeType, FromTypes extends NodeType = NodeType, ToTypes extends NodeType = NodeType> = Readonly<{
223
- type: E;
224
- from: readonly FromTypes[];
225
- to: readonly ToTypes[];
226
- cardinality?: Cardinality;
227
- endpointExistence?: EndpointExistence;
228
- }>;
229
- /**
230
- * Default settings for a graph.
231
- */
232
- type GraphDefaults = Readonly<{
233
- onNodeDelete?: DeleteBehavior;
234
- temporalMode?: TemporalMode;
235
- }>;
236
- /**
237
- * Checks if a value is a NodeType.
238
- */
239
- declare function isNodeType(value: unknown): value is NodeType;
240
- /**
241
- * Checks if a value is an EdgeType.
242
- */
243
- declare function isEdgeType(value: unknown): value is AnyEdgeType;
244
- /**
245
- * Checks if a value is an EdgeType with both from and to constraints defined.
246
- * Such edges can be used directly in defineGraph without an EdgeRegistration wrapper.
247
- */
248
- declare function isEdgeTypeWithEndpoints(value: unknown): value is EdgeTypeWithEndpoints;
249
-
250
- declare const ALL_META_EDGE_NAMES: readonly ["subClassOf", "broader", "narrower", "relatedTo", "equivalentTo", "sameAs", "differentFrom", "disjointWith", "partOf", "hasPart", "inverseOf", "implies"];
251
- type MetaEdgeName = (typeof ALL_META_EDGE_NAMES)[number];
252
-
253
- /**
254
- * Pure-value document format for graph extensions.
255
- *
256
- * A `GraphExtension` is a plain JSON-serializable description of
257
- * additional node kinds, edge kinds, and ontology relations that should
258
- * be merged into a graph at runtime. The document is the canonical
259
- * artifact: every restart re-compiles it back to the same Zod-bearing
260
- * `NodeType` / `EdgeType` / `OntologyRelation` shapes.
261
- *
262
- * The supported property-type subset is intentionally narrower than full
263
- * JSON Schema — only what compiles cleanly to Zod and what real
264
- * agent-induced schemas use in practice. Anything outside this set fails
265
- * loudly at `defineGraphExtension(...)`.
266
- */
267
-
268
- /**
269
- * Per-property modifier: tag the field as fulltext-searchable.
270
- *
271
- * Compiles to a `searchable({ language })`-wrapped Zod string when applied
272
- * to a `string` property. Rejected on any other property type at validation
273
- * time.
274
- */
275
- type ExtensionSearchableModifier = Readonly<{
276
- language?: string;
277
- }>;
278
- /**
279
- * Per-property modifier: declare a vector embedding with the given
280
- * dimensionality. Compiles to `embedding(dimensions)` and is only valid on
281
- * `array` properties whose item type is `number`. Rejected elsewhere.
282
- */
283
- type ExtensionEmbeddingModifier = Readonly<{
284
- dimensions: number;
285
- }>;
286
- /**
287
- * Modifiers shared by every graph-extension property type.
288
- *
289
- * `optional: true` flips the field from required-with-graph-extension-validation
290
- * to `.optional()` and removes it from the parent object's `required`
291
- * list. `searchable` and `embedding` only apply to specific underlying
292
- * types — see the per-modifier docs.
293
- */
294
- type ExtensionPropertyModifiers = Readonly<{
295
- optional?: boolean;
296
- searchable?: ExtensionSearchableModifier;
297
- embedding?: ExtensionEmbeddingModifier;
298
- description?: string;
299
- }>;
300
- /**
301
- * String property. Compiles to `z.string()` plus the requested refinements.
302
- * `format` accepts the two formats motivated by induced schemas in
303
- * practice — covers ISO datetimes, URIs, email addresses, UUIDs, and
304
- * date-only strings. Each format routes to the corresponding Zod
305
- * factory (`z.iso.datetime()`, `z.url()`, `z.email()`, `z.uuid()`,
306
- * `z.iso.date()`); other JSON-Schema formats are deliberately not
307
- * supported in v1.
308
- */
309
- type ExtensionStringProperty = Readonly<{
310
- type: "string";
311
- minLength?: number;
312
- maxLength?: number;
313
- pattern?: string;
314
- format?: "datetime" | "uri" | "email" | "uuid" | "date";
315
- }> & ExtensionPropertyModifiers;
316
- /**
317
- * Number property. `int: true` requires whole numbers; `min` / `max` are
318
- * inclusive bounds. Compiles to `z.number().int()?.min(...)?.max(...)`.
319
- */
320
- type ExtensionNumberProperty = Readonly<{
321
- type: "number";
322
- min?: number;
323
- max?: number;
324
- int?: boolean;
325
- }> & ExtensionPropertyModifiers;
326
- /**
327
- * Boolean property. Compiles to `z.boolean()`.
328
- */
329
- type ExtensionBooleanProperty = Readonly<{
330
- type: "boolean";
331
- }> & ExtensionPropertyModifiers;
332
- /**
333
- * Closed-set string enum. Compiles to `z.enum([...values])`. Must contain
334
- * at least one value; duplicate values are rejected at validation time.
335
- */
336
- type ExtensionEnumProperty = Readonly<{
337
- type: "enum";
338
- values: readonly string[];
339
- }> & ExtensionPropertyModifiers;
340
- /**
341
- * Array property. `items` is any of the scalar property types or an
342
- * object property — nested arrays are forbidden in v1. Compiles to
343
- * `z.array(<items>)`. The `embedding` modifier turns this into a
344
- * vector embedding instead of a generic array.
345
- */
346
- type ExtensionArrayProperty = Readonly<{
347
- type: "array";
348
- items: ExtensionArrayItemType;
349
- }> & ExtensionPropertyModifiers;
350
- /**
351
- * Element types allowed inside an array — every leaf property type plus
352
- * single-level object. Nesting an array inside an array is rejected at
353
- * validation time so the v1 surface stays a flat tree.
354
- */
355
- type ExtensionArrayItemType = ExtensionStringProperty | ExtensionNumberProperty | ExtensionBooleanProperty | ExtensionEnumProperty | ExtensionObjectProperty;
356
- /**
357
- * Object property. `properties` is a single nesting level; deeper objects
358
- * are rejected at validation time so the v1 surface is auditable at a
359
- * glance.
360
- */
361
- type ExtensionObjectProperty = Readonly<{
362
- type: "object";
363
- properties: Readonly<Record<string, ExtensionObjectFieldProperty>>;
364
- }> & ExtensionPropertyModifiers;
365
- /**
366
- * Property types allowed inside an `object`'s `properties` — leaf scalars
367
- * and arrays only. Nested objects are blocked here to enforce the
368
- * single-nesting-level rule.
369
- */
370
- type ExtensionObjectFieldProperty = ExtensionStringProperty | ExtensionNumberProperty | ExtensionBooleanProperty | ExtensionEnumProperty | ExtensionArrayProperty;
371
- /**
372
- * Top-level property descriptor for a node or edge field.
373
- *
374
- * The discriminated union covers every type in the v1 subset; arbitrary
375
- * `unknown` inputs are validated against this set at
376
- * `defineGraphExtension(...)` time.
377
- */
378
- type ExtensionPropertyType = ExtensionStringProperty | ExtensionNumberProperty | ExtensionBooleanProperty | ExtensionEnumProperty | ExtensionArrayProperty | ExtensionObjectProperty;
379
- /**
380
- * Document-side `where` clause for a unique constraint.
381
- *
382
- * Mirrors `serializeWherePredicate`'s capability — the only operations
383
- * round-trippable through the persisted form are `isNull` and `isNotNull`.
384
- * Anything richer (equality, `in`, etc.) is rejected at validation time.
385
- */
386
- type ExtensionUniqueWhere = Readonly<{
387
- field: string;
388
- op: NullCheckOp;
389
- }>;
390
- /**
391
- * Unique constraint declaration. `fields` must reference declared
392
- * properties on the kind. Defaults match the existing `UniqueConstraint`:
393
- * `scope: "kind"`, `collation: "binary"`.
394
- */
395
- type ExtensionUniqueConstraint = Readonly<{
396
- name: string;
397
- fields: readonly string[];
398
- scope?: "kind" | "kindWithSubClasses";
399
- collation?: "binary" | "caseInsensitive";
400
- where?: ExtensionUniqueWhere;
401
- }>;
402
- /**
403
- * Graph-extension declaration of a node kind.
404
- *
405
- * Property names follow the same reserved-key rules as compile-time
406
- * `defineNode` (`id`, `kind`, `meta`, and the `$`-prefix accessor
407
- * namespace are forbidden). Annotation values must be JSON.
408
- */
409
- type ExtensionNodeDef = Readonly<{
410
- description?: string;
411
- annotations?: KindAnnotations;
412
- properties: Readonly<Record<string, ExtensionPropertyType>>;
413
- unique?: readonly ExtensionUniqueConstraint[];
414
- }>;
415
- /**
416
- * Graph-extension declaration of an edge kind.
417
- *
418
- * `from` / `to` reference node kind names — either kinds declared in this
419
- * same document or compile-time kinds the document is being merged into.
420
- * Endpoints that resolve to nothing within the document are flagged as
421
- * soft references at validation time but not rejected; the final
422
- * cross-graph check happens when the document is merged into a host
423
- * `GraphDef`.
424
- */
425
- type ExtensionEdgeDef = Readonly<{
426
- description?: string;
427
- annotations?: KindAnnotations;
428
- from: readonly string[];
429
- to: readonly string[];
430
- properties?: Readonly<Record<string, ExtensionPropertyType>>;
431
- }>;
432
- /**
433
- * Document-level analogue of compile-time `defineNodeIndex` /
434
- * `defineEdgeIndex`. Mirrors `serializeWherePredicate`'s persistence-
435
- * round-trippable subset: only `isNull` / `isNotNull` predicates are
436
- * supported in v1, matching `ExtensionUniqueWhere`.
437
- */
438
- type ExtensionIndexWhere = Readonly<{
439
- field: string;
440
- op: NullCheckOp;
441
- }>;
442
- /**
443
- * Graph-extension-declared node index. `kind` references either a kind
444
- * declared in this same document or a compile-time host kind resolved
445
- * at merge time. `fields` and `coveringFields` are top-level property
446
- * names — JSON-pointer paths are not supported in v1, matching the
447
- * `ExtensionUniqueConstraint` v1 surface.
448
- */
449
- type ExtensionNodeIndex = Readonly<{
450
- entity: "node";
451
- kind: string;
452
- name?: string;
453
- fields: readonly string[];
454
- coveringFields?: readonly string[];
455
- unique?: boolean;
456
- scope?: "graphAndKind" | "graph" | "none";
457
- where?: ExtensionIndexWhere;
458
- }>;
459
- /**
460
- * Graph-extension-declared edge index. `direction` mirrors
461
- * `EdgeIndexDirection`; `kind` references a graph-extension or compile-time
462
- * edge kind.
463
- */
464
- type ExtensionEdgeIndex = Readonly<{
465
- entity: "edge";
466
- kind: string;
467
- name?: string;
468
- direction?: "out" | "in" | "none";
469
- fields: readonly string[];
470
- coveringFields?: readonly string[];
471
- unique?: boolean;
472
- scope?: "graphAndKind" | "graph" | "none";
473
- where?: ExtensionIndexWhere;
474
- }>;
475
- type ExtensionIndex = ExtensionNodeIndex | ExtensionEdgeIndex;
476
- /**
477
- * Graph-extension ontology relation. `metaEdge` is one of the built-in
478
- * meta-edge names (subClassOf, broader, disjointWith, etc.).
479
- *
480
- * `from` / `to` are either node-kind names declared in this document or
481
- * external IRI strings. The pure-value document does not distinguish the
482
- * two — the compiler treats endpoints that match a declared kind as
483
- * `NodeType` references and falls back to passing the raw string for
484
- * IRIs (matching the existing `OntologyRelation` shape, where
485
- * `from`/`to` are `NodeType | EdgeType | string`).
486
- */
487
- type ExtensionOntologyRelation = Readonly<{
488
- metaEdge: MetaEdgeName;
489
- from: string;
490
- to: string;
491
- }>;
492
- /**
493
- * Stable default major used when a stored document omits `version`.
494
- *
495
- * Pinned to `1` permanently. Pre-versioning documents (those persisted
496
- * before the field existed) and documents that explicitly omit
497
- * `version` are interpreted as `1` regardless of which major the
498
- * library currently supports. Splitting this from
499
- * `CURRENT_GRAPH_EXTENSION_VERSION` is load-bearing for future major
500
- * bumps: when v2 ships, `CURRENT` becomes `2` but `LEGACY` stays at
501
- * `1`, so a v1-era stored document still parses as v1 (and the
502
- * version-mismatch path can route it through a migration) rather than
503
- * being silently misinterpreted as v2.
504
- */
505
- declare const LEGACY_GRAPH_EXTENSION_VERSION: 1;
506
- /**
507
- * Current major version of the `GraphExtension` format.
508
- *
509
- * Documents with a higher major version than this constant are
510
- * rejected with `GRAPH_EXTENSION_VERSION_UNSUPPORTED` — there is no
511
- * automatic downgrade path. Minor / additive changes ride forward-
512
- * compat via `.loose()` on every nested object schema.
513
- */
514
- declare const CURRENT_GRAPH_EXTENSION_VERSION: 1;
515
- /**
516
- * Type of the `GraphExtension.version` field. Stays `number`
517
- * rather than `typeof CURRENT_GRAPH_EXTENSION_VERSION` because the
518
- * field can carry any major across the library version range a
519
- * stored document might have been written by — the
520
- * document-vs-supported check happens in the validator, not at the
521
- * type level. Pinning to the current literal would prevent a v1
522
- * v1 library from typing a v2 document at all, which is the wrong
523
- * relationship: we WANT a v1 library to receive v2 documents and
524
- * report `GRAPH_EXTENSION_VERSION_UNSUPPORTED` cleanly.
525
- */
526
- type GraphExtensionVersion = number;
527
- /**
528
- * The canonical pure-value graph-extension document.
529
- *
530
- * Frozen at construction. Round-trips losslessly through `JSON.stringify`
531
- * / `JSON.parse`; the `GraphExtension → CompiledExtension` direction
532
- * is provided by `compileGraphExtension(...)`. There is no
533
- * `Zod → GraphExtension` direction because graph-extension kinds always
534
- * originate as documents.
535
- *
536
- * `version` is the major-version tag for the document format. The
537
- * compiler accepts documents whose version is equal to the current
538
- * supported major (today: 1) or absent (the canonical persisted form
539
- * omits `version` when it equals the legacy default — see
540
- * `serializer.ts` — so the round-trip default is "absent means legacy
541
- * major"). Higher majors surface as
542
- * `GRAPH_EXTENSION_VERSION_UNSUPPORTED` so a newer-version extension
543
- * committed by a future writer can't be silently misread by an older
544
- * runtime. See `graph-extensions.md` for the format-versioning policy.
545
- */
546
- type GraphExtension = Readonly<{
547
- version?: GraphExtensionVersion;
548
- nodes?: Readonly<Record<string, ExtensionNodeDef>>;
549
- edges?: Readonly<Record<string, ExtensionEdgeDef>>;
550
- ontology?: readonly ExtensionOntologyRelation[];
551
- /**
552
- * Graph-extension-declared relational indexes. Each entry references a
553
- * node or edge kind by name — either declared in this document or
554
- * a compile-time host kind that the document is being merged into.
555
- * Vector indexes auto-derive from `embedding()` modifiers on
556
- * graph-extension kinds; this slot is for explicit relational indexes
557
- * (analogue of compile-time `defineGraph({ indexes: [...] })`).
558
- */
559
- indexes?: readonly ExtensionIndex[];
560
- }>;
561
- /**
562
- * Top-level v1 slots a `GraphExtension` document may carry. Single
563
- * source of truth for both the strict-authoring validator (typo rejection
564
- * via `defineGraphExtension`) and the persistence Zod schema (which
565
- * leaves the field set loose for forward compatibility but uses this
566
- * list to drive the Zod object shape).
567
- */
568
- declare const GRAPH_EXTENSION_TOP_LEVEL_KEYS: readonly ["version", "nodes", "edges", "ontology", "indexes"];
569
- type GraphExtensionTopLevelKey = (typeof GRAPH_EXTENSION_TOP_LEVEL_KEYS)[number];
570
-
571
- export { type ExtensionUniqueWhere as $, type AnyEdgeType as A, type ExtensionArrayProperty as B, CURRENT_GRAPH_EXTENSION_VERSION as C, type DeleteBehavior as D, type EdgeRegistration as E, type ExtensionBooleanProperty as F, type GraphExtension as G, type ExtensionEdgeIndex as H, type IndexEntity as I, type JsonValue as J, type KindEntity as K, LEGACY_GRAPH_EXTENSION_VERSION as L, type ExtensionEmbeddingModifier as M, type NodeRegistration as N, type ExtensionEnumProperty as O, type ExtensionIndexWhere as P, type ExtensionNodeIndex as Q, type ExtensionNumberProperty as R, type ExtensionObjectFieldProperty as S, type TemporalMode as T, type UniqueConstraint as U, type ExtensionObjectProperty as V, type ExtensionPropertyModifiers as W, type ExtensionPropertyType as X, type ExtensionSearchableModifier as Y, type ExtensionStringProperty as Z, type ExtensionUniqueConstraint as _, type NodeType as a, type MetaEdgeName as a0, GRAPH_EXTENSION_TOP_LEVEL_KEYS as a1, type GraphExtensionTopLevelKey as a2, type GraphDefaults as b, type NullCheckOp as c, type EdgeType as d, type Cardinality as e, type Collation as f, type EdgeId as g, type EdgeProps as h, type EdgeTypeWithEndpoints as i, type EndpointExistence as j, type GraphExtensionVersion as k, type KindAnnotations as l, type NodeId as m, type NodeProps as n, type UniquenessScope as o, asEdgeId as p, asNodeId as q, isEdgeType as r, isEdgeTypeWithEndpoints as s, isNodeType as t, type ExtensionNodeDef as u, type ExtensionEdgeDef as v, type ExtensionOntologyRelation as w, type ExtensionIndex as x, ALL_META_EDGE_NAMES as y, type ExtensionArrayItemType as z };
@@ -1,90 +0,0 @@
1
- import { I as IndexEntity } from './extension-types-BLEVH4SG.js';
2
-
3
- /**
4
- * Index materialization — runs declared index DDL against the live
5
- * database and tracks per-deployment status in
6
- * `typegraph_index_materializations`.
7
- *
8
- * Reads `IndexDeclaration[]` from `GraphDef.indexes`, generates DDL via
9
- * `generateIndexDDL`, executes via `backend.executeDdl` (Postgres path
10
- * uses `CREATE INDEX CONCURRENTLY`, which cannot run inside a
11
- * transaction — `executeDdl` runs at the top-level backend, never inside
12
- * `transaction(...)`), and upserts a status row per index.
13
- *
14
- * Caveats baked in to the algorithm:
15
- *
16
- * - SQL index names are physical, database-global identifiers.
17
- * Cross-graph collisions (two graphs declaring the same name with
18
- * different shapes) surface as a `failed` result with reason
19
- * "signature drift", because the existing recorded signature won't
20
- * match the new one.
21
- * - On Postgres, `CREATE INDEX CONCURRENTLY IF NOT EXISTS` does NOT
22
- * prove the existing physical index has the same shape as ours —
23
- * only that something with that name exists. Drift detection here
24
- * relies on TypeGraph's recorded signature, not on PG metadata.
25
- * - Failed `CONCURRENTLY` builds leave invalid indexes behind
26
- * (`pg_index.indisvalid = false`). Relational rebuilds self-heal: the
27
- * claim-holding materializer drops an invalid leftover with the
28
- * declaration's name before rebuilding (see dropInvalidIndexLeftover).
29
- * Vector per-field index leftovers remain operator-repair.
30
- * - Two materializers racing the SAME index name serialize through a
31
- * durable claim in the status table (see materializeWithClaim) —
32
- * concurrent same-name expression-index CIC builds deadlock on
33
- * Postgres (no safe-snapshot exemption).
34
- */
35
-
36
- type MaterializeIndexesOptions = Readonly<{
37
- /** Restrict to indexes whose `kind` is in this set. */
38
- kinds?: readonly string[];
39
- /** Stop on the first failure. Default: false (best-effort). */
40
- stopOnError?: boolean;
41
- /**
42
- * Refresh planner statistics (ANALYZE) after at least one index was
43
- * created. A fresh index can be ignored by the planner until statistics
44
- * exist. Default: true. Applied on non-concurrent builders (SQLite) and
45
- * on concurrent builders that serialize same-index builds via the
46
- * cross-caller claim primitive (the bundled Postgres backend); a custom
47
- * concurrent backend without the primitive skips the refresh — see
48
- * refreshStatisticsAfterCreation — and should call
49
- * `store.refreshStatistics()` after materializing.
50
- */
51
- refreshStatistics?: boolean;
52
- }>;
53
- /**
54
- * Per-index outcome from `materializeIndexes()`.
55
- *
56
- * Status values:
57
- * - `created`: DDL ran successfully and a new physical index now exists.
58
- * - `alreadyMaterialized`: status table shows a prior successful
59
- * materialization with the same signature; no DDL ran.
60
- * - `failed`: the DDL or status write failed; `error` carries the
61
- * captured exception. Best-effort mode continues to the next index;
62
- * `stopOnError: true` halts.
63
- * - `skipped`: the backend can't materialize this index variant in its
64
- * current configuration (e.g. vector indexes against SQLite without
65
- * sqlite-vec, or `indexType: "none"` declared on an embedding). The
66
- * declaration is recognized but intentionally not acted on. Status
67
- * table is NOT updated for skipped entries.
68
- */
69
- type MaterializeIndexesEntry = Readonly<{
70
- indexName: string;
71
- entity: IndexEntity;
72
- kind: string;
73
- status: "created" | "alreadyMaterialized" | "failed" | "skipped";
74
- error?: Error;
75
- /**
76
- * Human-readable reason. Required for `skipped`; optional otherwise.
77
- */
78
- reason?: string;
79
- }>;
80
- type MaterializeIndexesResult = Readonly<{
81
- results: readonly MaterializeIndexesEntry[];
82
- }>;
83
- type MaterializeSystemIndexesOptions = Readonly<{
84
- /** Stop on the first failure. Default: false (best-effort). */
85
- stopOnError?: boolean;
86
- /** Refresh planner statistics after a creation. Default: true. */
87
- refreshStatistics?: boolean;
88
- }>;
89
-
90
- export type { MaterializeIndexesResult as M, MaterializeIndexesEntry as a, MaterializeIndexesOptions as b, MaterializeSystemIndexesOptions as c };