@nicia-ai/typegraph 0.37.1 → 0.39.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 (372) hide show
  1. package/README.md +12 -10
  2. package/dist/backend/drizzle/indexes.cjs +32 -0
  3. package/dist/backend/drizzle/indexes.cjs.map +1 -0
  4. package/dist/backend/drizzle/indexes.d.cts +43 -0
  5. package/dist/backend/drizzle/indexes.d.ts +43 -0
  6. package/dist/backend/drizzle/indexes.js +11 -0
  7. package/dist/backend/drizzle/indexes.js.map +1 -0
  8. package/dist/backend/index.cjs +161 -0
  9. package/dist/backend/index.cjs.map +1 -0
  10. package/dist/backend/index.d.cts +3 -0
  11. package/dist/backend/index.d.ts +3 -0
  12. package/dist/backend/index.js +8 -0
  13. package/dist/backend/index.js.map +1 -0
  14. package/dist/backend/postgres/index.cjs +32 -28
  15. package/dist/backend/postgres/index.d.cts +13 -12
  16. package/dist/backend/postgres/index.d.ts +13 -12
  17. package/dist/backend/postgres/index.js +19 -15
  18. package/dist/backend/postgres/pglite-store.cjs +67 -0
  19. package/dist/backend/postgres/pglite-store.cjs.map +1 -0
  20. package/dist/backend/postgres/pglite-store.d.cts +38 -0
  21. package/dist/backend/postgres/pglite-store.d.ts +38 -0
  22. package/dist/backend/postgres/pglite-store.js +65 -0
  23. package/dist/backend/postgres/pglite-store.js.map +1 -0
  24. package/dist/backend/postgres/pglite.cjs +25 -50
  25. package/dist/backend/postgres/pglite.cjs.map +1 -1
  26. package/dist/backend/postgres/pglite.d.cts +10 -9
  27. package/dist/backend/postgres/pglite.d.ts +10 -9
  28. package/dist/backend/postgres/pglite.js +20 -52
  29. package/dist/backend/postgres/pglite.js.map +1 -1
  30. package/dist/backend/sqlite/index.cjs +29 -25
  31. package/dist/backend/sqlite/index.d.cts +11 -11
  32. package/dist/backend/sqlite/index.d.ts +11 -11
  33. package/dist/backend/sqlite/index.js +17 -13
  34. package/dist/backend/sqlite/libsql.cjs +23 -19
  35. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  36. package/dist/backend/sqlite/libsql.d.cts +9 -10
  37. package/dist/backend/sqlite/libsql.d.ts +9 -10
  38. package/dist/backend/sqlite/libsql.js +19 -15
  39. package/dist/backend/sqlite/libsql.js.map +1 -1
  40. package/dist/backend/sqlite/local-store.cjs +72 -0
  41. package/dist/backend/sqlite/local-store.cjs.map +1 -0
  42. package/dist/backend/sqlite/local-store.d.cts +42 -0
  43. package/dist/backend/sqlite/local-store.d.ts +42 -0
  44. package/dist/backend/sqlite/local-store.js +67 -0
  45. package/dist/backend/sqlite/local-store.js.map +1 -0
  46. package/dist/backend/sqlite/local.cjs +28 -183
  47. package/dist/backend/sqlite/local.cjs.map +1 -1
  48. package/dist/backend/sqlite/local.d.cts +8 -81
  49. package/dist/backend/sqlite/local.d.ts +8 -81
  50. package/dist/backend/sqlite/local.js +20 -180
  51. package/dist/backend/sqlite/local.js.map +1 -1
  52. package/dist/chunk-2EBMPJBO.js +16 -0
  53. package/dist/chunk-2EBMPJBO.js.map +1 -0
  54. package/dist/chunk-35S6P5ZU.js +27 -0
  55. package/dist/chunk-35S6P5ZU.js.map +1 -0
  56. package/dist/chunk-3LKL3S6X.js +50 -0
  57. package/dist/chunk-3LKL3S6X.js.map +1 -0
  58. package/dist/{chunk-RCVLFTCT.js → chunk-3SK4SVTW.js} +13 -12
  59. package/dist/chunk-3SK4SVTW.js.map +1 -0
  60. package/dist/chunk-3YFDFOYB.cjs +192 -0
  61. package/dist/chunk-3YFDFOYB.cjs.map +1 -0
  62. package/dist/{chunk-WOJMKB3N.cjs → chunk-5ELKD2FQ.cjs} +1677 -308
  63. package/dist/chunk-5ELKD2FQ.cjs.map +1 -0
  64. package/dist/{chunk-5AVRFNP4.cjs → chunk-6SRLCSAV.cjs} +3012 -1513
  65. package/dist/chunk-6SRLCSAV.cjs.map +1 -0
  66. package/dist/chunk-6XDBRDZE.js +312 -0
  67. package/dist/chunk-6XDBRDZE.js.map +1 -0
  68. package/dist/chunk-764JHTLT.cjs +15 -0
  69. package/dist/chunk-764JHTLT.cjs.map +1 -0
  70. package/dist/chunk-76HE7DJP.js +68 -0
  71. package/dist/chunk-76HE7DJP.js.map +1 -0
  72. package/dist/{chunk-VGDDG3XJ.cjs → chunk-7M3NACL3.cjs} +12 -12
  73. package/dist/{chunk-VGDDG3XJ.cjs.map → chunk-7M3NACL3.cjs.map} +1 -1
  74. package/dist/chunk-AOL64O4Z.js +165 -0
  75. package/dist/chunk-AOL64O4Z.js.map +1 -0
  76. package/dist/{chunk-27SSDCEP.cjs → chunk-B63IFHXR.cjs} +53 -74
  77. package/dist/chunk-B63IFHXR.cjs.map +1 -0
  78. package/dist/{chunk-3XXGYU62.cjs → chunk-BKAKAVRW.cjs} +56 -53
  79. package/dist/chunk-BKAKAVRW.cjs.map +1 -0
  80. package/dist/{chunk-YTSN73ND.js → chunk-BQITNFQJ.js} +3 -3
  81. package/dist/{chunk-YTSN73ND.js.map → chunk-BQITNFQJ.js.map} +1 -1
  82. package/dist/{chunk-GA4TT3DH.js → chunk-CBK2IVI2.js} +1999 -503
  83. package/dist/chunk-CBK2IVI2.js.map +1 -0
  84. package/dist/{chunk-6EEO3OVU.cjs → chunk-CWX77JB4.cjs} +22 -59
  85. package/dist/chunk-CWX77JB4.cjs.map +1 -0
  86. package/dist/{chunk-UGZUAYAR.js → chunk-D7PG5D5K.js} +4 -3
  87. package/dist/chunk-D7PG5D5K.js.map +1 -0
  88. package/dist/chunk-DDCIXXOO.js +9 -0
  89. package/dist/chunk-DDCIXXOO.js.map +1 -0
  90. package/dist/chunk-DDCYVIVV.cjs +44 -0
  91. package/dist/chunk-DDCYVIVV.cjs.map +1 -0
  92. package/dist/{chunk-UV3WP5WZ.js → chunk-DOKUXLFH.js} +61 -29
  93. package/dist/chunk-DOKUXLFH.js.map +1 -0
  94. package/dist/{chunk-XPCZADMT.cjs → chunk-DOVMTPKE.cjs} +89 -27
  95. package/dist/chunk-DOVMTPKE.cjs.map +1 -0
  96. package/dist/{chunk-5PNMDJ7J.js → chunk-DPNA466P.js} +14 -9
  97. package/dist/chunk-DPNA466P.js.map +1 -0
  98. package/dist/{chunk-BYPOGQWK.js → chunk-DRACN6XG.js} +6 -4
  99. package/dist/chunk-DRACN6XG.js.map +1 -0
  100. package/dist/{chunk-TGOMW4MB.cjs → chunk-E2Q7SP2K.cjs} +110 -109
  101. package/dist/chunk-E2Q7SP2K.cjs.map +1 -0
  102. package/dist/chunk-E6TXEISH.cjs +175 -0
  103. package/dist/chunk-E6TXEISH.cjs.map +1 -0
  104. package/dist/{chunk-3C2RYI6L.cjs → chunk-EOJFGECD.cjs} +11 -11
  105. package/dist/chunk-EOJFGECD.cjs.map +1 -0
  106. package/dist/{chunk-XWV4JT34.js → chunk-ERZ4QPQX.js} +27 -22
  107. package/dist/chunk-ERZ4QPQX.js.map +1 -0
  108. package/dist/{chunk-DFVLCOP6.js → chunk-EZH7FNUS.js} +3 -3
  109. package/dist/{chunk-DFVLCOP6.js.map → chunk-EZH7FNUS.js.map} +1 -1
  110. package/dist/{chunk-WWFHO375.cjs → chunk-FJMPR3OH.cjs} +4 -3
  111. package/dist/chunk-FJMPR3OH.cjs.map +1 -0
  112. package/dist/chunk-FMNUSGZ4.cjs +12 -0
  113. package/dist/chunk-FMNUSGZ4.cjs.map +1 -0
  114. package/dist/{chunk-EXU3RASM.js → chunk-G3CSQLLT.js} +20 -474
  115. package/dist/chunk-G3CSQLLT.js.map +1 -0
  116. package/dist/{chunk-EJYMTO3K.cjs → chunk-GKQU44SQ.cjs} +150 -118
  117. package/dist/chunk-GKQU44SQ.cjs.map +1 -0
  118. package/dist/chunk-GNPGGLAE.cjs +212 -0
  119. package/dist/chunk-GNPGGLAE.cjs.map +1 -0
  120. package/dist/{chunk-QARBLBXT.cjs → chunk-GUUWKPTK.cjs} +7 -7
  121. package/dist/{chunk-QARBLBXT.cjs.map → chunk-GUUWKPTK.cjs.map} +1 -1
  122. package/dist/chunk-GYA4JRP5.js +31 -0
  123. package/dist/chunk-GYA4JRP5.js.map +1 -0
  124. package/dist/{chunk-3GH67G4Z.cjs → chunk-HP6LWBLB.cjs} +16 -42
  125. package/dist/chunk-HP6LWBLB.cjs.map +1 -0
  126. package/dist/{chunk-NXQFATMF.cjs → chunk-HTQOBY75.cjs} +153 -123
  127. package/dist/chunk-HTQOBY75.cjs.map +1 -0
  128. package/dist/chunk-I6FX7AAG.js +39 -0
  129. package/dist/chunk-I6FX7AAG.js.map +1 -0
  130. package/dist/{chunk-VKGKDOKR.js → chunk-IFDXG2YJ.js} +1539 -206
  131. package/dist/chunk-IFDXG2YJ.js.map +1 -0
  132. package/dist/{chunk-IXGYRP2P.js → chunk-IFRPHG7O.js} +79 -49
  133. package/dist/chunk-IFRPHG7O.js.map +1 -0
  134. package/dist/chunk-IMQKXL4E.cjs +12 -0
  135. package/dist/{chunk-QSXTWU4U.cjs.map → chunk-IMQKXL4E.cjs.map} +1 -1
  136. package/dist/chunk-J6IJARLG.js +94 -0
  137. package/dist/chunk-J6IJARLG.js.map +1 -0
  138. package/dist/{chunk-3DS7Z4T4.cjs → chunk-JD2YC62H.cjs} +44 -43
  139. package/dist/chunk-JD2YC62H.cjs.map +1 -0
  140. package/dist/{chunk-W63OVYY4.js → chunk-K34OPSJK.js} +3 -3
  141. package/dist/{chunk-W63OVYY4.js.map → chunk-K34OPSJK.js.map} +1 -1
  142. package/dist/chunk-KAFXPB2L.js +184 -0
  143. package/dist/chunk-KAFXPB2L.js.map +1 -0
  144. package/dist/chunk-KIZSHRUI.cjs +49 -0
  145. package/dist/chunk-KIZSHRUI.cjs.map +1 -0
  146. package/dist/{chunk-K3Q3LJY3.js → chunk-KXFUQNF2.js} +201 -100
  147. package/dist/chunk-KXFUQNF2.js.map +1 -0
  148. package/dist/{chunk-UXLSNRYL.js → chunk-MTNEGGM2.js} +4 -4
  149. package/dist/chunk-MTNEGGM2.js.map +1 -0
  150. package/dist/{chunk-IP3CGGPA.cjs → chunk-N2V3HJFV.cjs} +92 -185
  151. package/dist/chunk-N2V3HJFV.cjs.map +1 -0
  152. package/dist/chunk-NAUA4PW5.cjs +28 -0
  153. package/dist/chunk-NAUA4PW5.cjs.map +1 -0
  154. package/dist/chunk-NMQ6C6TS.cjs +61 -0
  155. package/dist/chunk-NMQ6C6TS.cjs.map +1 -0
  156. package/dist/{chunk-2N6EOBTH.cjs → chunk-NPWACFQJ.cjs} +58 -53
  157. package/dist/chunk-NPWACFQJ.cjs.map +1 -0
  158. package/dist/{chunk-TKT2XHED.js → chunk-NQBYTLPW.js} +13 -12
  159. package/dist/chunk-NQBYTLPW.js.map +1 -0
  160. package/dist/{chunk-5KEQ74YU.cjs → chunk-NT6ILURI.cjs} +9 -86
  161. package/dist/chunk-NT6ILURI.cjs.map +1 -0
  162. package/dist/{chunk-3SLPDKHQ.js → chunk-PH4IJ3V5.js} +5 -77
  163. package/dist/chunk-PH4IJ3V5.js.map +1 -0
  164. package/dist/chunk-PWXGB77L.cjs +56 -0
  165. package/dist/chunk-PWXGB77L.cjs.map +1 -0
  166. package/dist/chunk-PZHC5GCD.js +193 -0
  167. package/dist/chunk-PZHC5GCD.js.map +1 -0
  168. package/dist/chunk-QMQLUA66.js +12 -0
  169. package/dist/chunk-QMQLUA66.js.map +1 -0
  170. package/dist/{chunk-5WWVZMVX.js → chunk-QZ7A6HBM.js} +2 -2
  171. package/dist/{chunk-5WWVZMVX.js.map → chunk-QZ7A6HBM.js.map} +1 -1
  172. package/dist/chunk-RW24SAHI.cjs +74 -0
  173. package/dist/chunk-RW24SAHI.cjs.map +1 -0
  174. package/dist/{chunk-BVRDGYXQ.cjs → chunk-SAFZ6JTI.cjs} +14 -9
  175. package/dist/chunk-SAFZ6JTI.cjs.map +1 -0
  176. package/dist/{chunk-L7HQ2OSI.js → chunk-SCTZRFW5.js} +87 -166
  177. package/dist/chunk-SCTZRFW5.js.map +1 -0
  178. package/dist/{chunk-5KPNWT6X.js → chunk-SDHV2MWU.js} +24 -45
  179. package/dist/chunk-SDHV2MWU.js.map +1 -0
  180. package/dist/{chunk-3RWZPJKV.js → chunk-SU7VQOJ3.js} +21 -78
  181. package/dist/chunk-SU7VQOJ3.js.map +1 -0
  182. package/dist/chunk-SVJ5GEXW.cjs +45 -0
  183. package/dist/chunk-SVJ5GEXW.cjs.map +1 -0
  184. package/dist/chunk-SVUKGWSN.cjs +102 -0
  185. package/dist/chunk-SVUKGWSN.cjs.map +1 -0
  186. package/dist/chunk-TAUGGLNQ.js +59 -0
  187. package/dist/chunk-TAUGGLNQ.js.map +1 -0
  188. package/dist/{chunk-A42GCBGX.cjs → chunk-TRF4EBJT.cjs} +6 -4
  189. package/dist/chunk-TRF4EBJT.cjs.map +1 -0
  190. package/dist/{chunk-KQJ54OG5.js → chunk-U4JDJKPD.js} +19 -56
  191. package/dist/chunk-U4JDJKPD.js.map +1 -0
  192. package/dist/chunk-UH2USOMG.cjs +627 -0
  193. package/dist/chunk-UH2USOMG.cjs.map +1 -0
  194. package/dist/{chunk-XGPUQ56G.js → chunk-UUIBACKJ.js} +15 -38
  195. package/dist/chunk-UUIBACKJ.js.map +1 -0
  196. package/dist/{chunk-5VQM6VWP.cjs → chunk-UWG5GX6E.cjs} +2 -2
  197. package/dist/{chunk-5VQM6VWP.cjs.map → chunk-UWG5GX6E.cjs.map} +1 -1
  198. package/dist/{chunk-K5UBVGJN.js → chunk-VDYA2HMS.js} +6 -6
  199. package/dist/{chunk-K5UBVGJN.js.map → chunk-VDYA2HMS.js.map} +1 -1
  200. package/dist/{chunk-NUIG3BCV.cjs → chunk-VXAFOF6Z.cjs} +93 -155
  201. package/dist/chunk-VXAFOF6Z.cjs.map +1 -0
  202. package/dist/chunk-X4PVHAZ6.cjs +83 -0
  203. package/dist/chunk-X4PVHAZ6.cjs.map +1 -0
  204. package/dist/{chunk-UYQMBBWJ.js → chunk-X6CNEA32.js} +23 -20
  205. package/dist/chunk-X6CNEA32.js.map +1 -0
  206. package/dist/chunk-X6RDQ5NB.cjs +335 -0
  207. package/dist/chunk-X6RDQ5NB.cjs.map +1 -0
  208. package/dist/{chunk-DEFQM7JU.cjs → chunk-XRU7V7FF.cjs} +7 -7
  209. package/dist/{chunk-DEFQM7JU.cjs.map → chunk-XRU7V7FF.cjs.map} +1 -1
  210. package/dist/{chunk-TPF25IG6.js → chunk-XZA3Y4YH.js} +3 -3
  211. package/dist/{chunk-TPF25IG6.js.map → chunk-XZA3Y4YH.js.map} +1 -1
  212. package/dist/{chunk-DIQ3AV5W.cjs → chunk-Y6UA55YS.cjs} +324 -224
  213. package/dist/chunk-Y6UA55YS.cjs.map +1 -0
  214. package/dist/chunk-Y7M44XEK.js +462 -0
  215. package/dist/chunk-Y7M44XEK.js.map +1 -0
  216. package/dist/{chunk-RRSNR3TP.js → chunk-YIRLBUNN.js} +3 -3
  217. package/dist/{chunk-RRSNR3TP.js.map → chunk-YIRLBUNN.js.map} +1 -1
  218. package/dist/chunk-YPUNPG2T.js +47 -0
  219. package/dist/chunk-YPUNPG2T.js.map +1 -0
  220. package/dist/{chunk-QERAIDRJ.js → chunk-Z2PPIVOO.js} +82 -22
  221. package/dist/chunk-Z2PPIVOO.js.map +1 -0
  222. package/dist/chunk-Z5QHVL5U.cjs +12 -0
  223. package/dist/chunk-Z5QHVL5U.cjs.map +1 -0
  224. package/dist/chunk-ZDH3DX3C.cjs +30 -0
  225. package/dist/chunk-ZDH3DX3C.cjs.map +1 -0
  226. package/dist/chunk-ZE6NVENI.js +77 -0
  227. package/dist/chunk-ZE6NVENI.js.map +1 -0
  228. package/dist/chunk-ZKZAIX42.cjs +479 -0
  229. package/dist/chunk-ZKZAIX42.cjs.map +1 -0
  230. package/dist/{chunk-TEDRJXOG.cjs → chunk-ZY4GXIVN.cjs} +5 -5
  231. package/dist/{chunk-TEDRJXOG.cjs.map → chunk-ZY4GXIVN.cjs.map} +1 -1
  232. package/dist/core/index.cjs +117 -0
  233. package/dist/core/index.cjs.map +1 -0
  234. package/dist/core/index.d.cts +225 -0
  235. package/dist/core/index.d.ts +225 -0
  236. package/dist/core/index.js +12 -0
  237. package/dist/core/index.js.map +1 -0
  238. package/dist/{ddl-CS0KUVwB.d.ts → ddl-Dx3Z0_WC.d.ts} +3 -3
  239. package/dist/{ddl-BD-ZfKeX.d.cts → ddl-J6sDyABg.d.cts} +3 -3
  240. package/dist/define-graph-CzEvA_8F.d.cts +174 -0
  241. package/dist/define-graph-DRo9xpYN.d.ts +174 -0
  242. package/dist/{extension-types-BM2ACfYO.d.cts → extension-types-BLEVH4SG.d.cts} +1 -1
  243. package/dist/{extension-types-BM2ACfYO.d.ts → extension-types-BLEVH4SG.d.ts} +1 -1
  244. package/dist/graph-extension/index.cjs +21 -19
  245. package/dist/graph-extension/index.d.cts +4 -4
  246. package/dist/graph-extension/index.d.ts +4 -4
  247. package/dist/graph-extension/index.js +6 -4
  248. package/dist/graph-merge/index.cjs +267 -218
  249. package/dist/graph-merge/index.cjs.map +1 -1
  250. package/dist/graph-merge/index.d.cts +17 -93
  251. package/dist/graph-merge/index.d.ts +17 -93
  252. package/dist/graph-merge/index.js +143 -94
  253. package/dist/graph-merge/index.js.map +1 -1
  254. package/dist/{index-BeacbPoe.d.ts → index-BD_3TCgh.d.ts} +6 -4
  255. package/dist/{index-BPM59vsg.d.cts → index-BihFPsPu.d.cts} +6 -4
  256. package/dist/{fulltext-strategy-C27vXaeB.d.cts → index-Bq7vSPHy.d.ts} +3195 -2646
  257. package/dist/{fulltext-strategy-DebsMrqg.d.ts → index-CrFL_ENI.d.cts} +3195 -2646
  258. package/dist/index.cjs +326 -315
  259. package/dist/index.cjs.map +1 -1
  260. package/dist/index.d.cts +59 -240
  261. package/dist/index.d.ts +59 -240
  262. package/dist/index.js +46 -79
  263. package/dist/index.js.map +1 -1
  264. package/dist/indexes/index.cjs +26 -38
  265. package/dist/indexes/index.d.cts +6 -41
  266. package/dist/indexes/index.d.ts +6 -41
  267. package/dist/indexes/index.js +14 -10
  268. package/dist/interchange/index.cjs +48 -39
  269. package/dist/interchange/index.cjs.map +1 -1
  270. package/dist/interchange/index.d.cts +7 -8
  271. package/dist/interchange/index.d.ts +7 -8
  272. package/dist/interchange/index.js +23 -14
  273. package/dist/interchange/index.js.map +1 -1
  274. package/dist/local-options-CZ1BnIoF.d.cts +29 -0
  275. package/dist/local-options-CZ1BnIoF.d.ts +29 -0
  276. package/dist/{manager-D00_NXvT.d.ts → manager-CASfhmzV.d.ts} +4 -173
  277. package/dist/{manager-nU1vTJLy.d.cts → manager-nCEJiYBb.d.cts} +4 -173
  278. package/dist/{materialize-indexes-zK2J_flP.d.ts → materialize-indexes-D4iei4Kp.d.ts} +1 -1
  279. package/dist/{materialize-indexes-CuR3gAZb.d.cts → materialize-indexes-ExQ6OrAh.d.cts} +1 -1
  280. package/dist/{postgres-IaBA4RgE.d.ts → postgres-Cl1ZAN1G.d.ts} +1 -1
  281. package/dist/{postgres-YrYmPlaU.d.cts → postgres-DMgIKQU-.d.cts} +1 -1
  282. package/dist/postgres-execution-fKW0qRiN.d.cts +14 -0
  283. package/dist/postgres-execution-fKW0qRiN.d.ts +14 -0
  284. package/dist/profiler/index.cjs +9 -8
  285. package/dist/profiler/index.cjs.map +1 -1
  286. package/dist/profiler/index.d.cts +9 -17
  287. package/dist/profiler/index.d.ts +9 -17
  288. package/dist/profiler/index.js +8 -7
  289. package/dist/profiler/index.js.map +1 -1
  290. package/dist/provenance/index.cjs +61 -55
  291. package/dist/provenance/index.cjs.map +1 -1
  292. package/dist/provenance/index.d.cts +7 -8
  293. package/dist/provenance/index.d.ts +7 -8
  294. package/dist/provenance/index.js +34 -28
  295. package/dist/provenance/index.js.map +1 -1
  296. package/dist/schema/index.cjs +46 -37
  297. package/dist/schema/index.cjs.map +1 -1
  298. package/dist/schema/index.d.cts +8 -10
  299. package/dist/schema/index.d.ts +8 -10
  300. package/dist/schema/index.js +22 -13
  301. package/dist/schema/index.js.map +1 -1
  302. package/dist/{sqlite-BUOHPx7p.d.ts → sqlite-BDkW39aa.d.cts} +1 -1
  303. package/dist/{sqlite-Pp8O19WE.d.cts → sqlite-CYfhvESj.d.ts} +1 -1
  304. package/dist/sqlite-execution-DwbE2a9y.d.cts +32 -0
  305. package/dist/sqlite-execution-DwbE2a9y.d.ts +32 -0
  306. package/dist/{store-view-X96Rd00T.d.cts → store-view-BJd6Vwpt.d.cts} +427 -1404
  307. package/dist/{store-view-ANL6mTph.d.ts → store-view-CLIhwMMX.d.ts} +427 -1404
  308. package/dist/temporal-BC_NQV5Y.d.cts +281 -0
  309. package/dist/temporal-DqtOEo_B.d.ts +281 -0
  310. package/dist/{types-r-Zyq2Hz.d.cts → types-COq3-vMC.d.cts} +2 -2
  311. package/dist/{types-wsvuBgPK.d.ts → types-CUevi_D1.d.ts} +2 -2
  312. package/dist/{where-CJOpJj3a.d.ts → where-BdE_cYtx.d.ts} +5 -5
  313. package/dist/{where-K3uBP33l.d.cts → where-C92TXCzT.d.cts} +5 -5
  314. package/package.json +37 -6
  315. package/dist/chunk-27SSDCEP.cjs.map +0 -1
  316. package/dist/chunk-2N6EOBTH.cjs.map +0 -1
  317. package/dist/chunk-3C2RYI6L.cjs.map +0 -1
  318. package/dist/chunk-3DS7Z4T4.cjs.map +0 -1
  319. package/dist/chunk-3GH67G4Z.cjs.map +0 -1
  320. package/dist/chunk-3RWZPJKV.js.map +0 -1
  321. package/dist/chunk-3SLPDKHQ.js.map +0 -1
  322. package/dist/chunk-3XXGYU62.cjs.map +0 -1
  323. package/dist/chunk-44TA22QT.js +0 -1478
  324. package/dist/chunk-44TA22QT.js.map +0 -1
  325. package/dist/chunk-5AVRFNP4.cjs.map +0 -1
  326. package/dist/chunk-5KEQ74YU.cjs.map +0 -1
  327. package/dist/chunk-5KPNWT6X.js.map +0 -1
  328. package/dist/chunk-5PNMDJ7J.js.map +0 -1
  329. package/dist/chunk-6EEO3OVU.cjs.map +0 -1
  330. package/dist/chunk-7YSP4V4R.cjs +0 -69
  331. package/dist/chunk-7YSP4V4R.cjs.map +0 -1
  332. package/dist/chunk-A42GCBGX.cjs.map +0 -1
  333. package/dist/chunk-BVRDGYXQ.cjs.map +0 -1
  334. package/dist/chunk-BYPOGQWK.js.map +0 -1
  335. package/dist/chunk-CUHM5CWJ.cjs +0 -12
  336. package/dist/chunk-CUHM5CWJ.cjs.map +0 -1
  337. package/dist/chunk-DIQ3AV5W.cjs.map +0 -1
  338. package/dist/chunk-EJYMTO3K.cjs.map +0 -1
  339. package/dist/chunk-EXU3RASM.js.map +0 -1
  340. package/dist/chunk-GA4TT3DH.js.map +0 -1
  341. package/dist/chunk-IP3CGGPA.cjs.map +0 -1
  342. package/dist/chunk-IPSVVTWT.cjs +0 -1540
  343. package/dist/chunk-IPSVVTWT.cjs.map +0 -1
  344. package/dist/chunk-IXGYRP2P.js.map +0 -1
  345. package/dist/chunk-K3Q3LJY3.js.map +0 -1
  346. package/dist/chunk-KQJ54OG5.js.map +0 -1
  347. package/dist/chunk-L7HQ2OSI.js.map +0 -1
  348. package/dist/chunk-M6VES7V6.js +0 -239
  349. package/dist/chunk-M6VES7V6.js.map +0 -1
  350. package/dist/chunk-NUIG3BCV.cjs.map +0 -1
  351. package/dist/chunk-NXQFATMF.cjs.map +0 -1
  352. package/dist/chunk-OHMP6N2J.js +0 -47
  353. package/dist/chunk-OHMP6N2J.js.map +0 -1
  354. package/dist/chunk-QERAIDRJ.js.map +0 -1
  355. package/dist/chunk-QSXTWU4U.cjs +0 -12
  356. package/dist/chunk-RCVLFTCT.js.map +0 -1
  357. package/dist/chunk-TGOMW4MB.cjs.map +0 -1
  358. package/dist/chunk-TKT2XHED.js.map +0 -1
  359. package/dist/chunk-UGZUAYAR.js.map +0 -1
  360. package/dist/chunk-UV3WP5WZ.js.map +0 -1
  361. package/dist/chunk-UXLSNRYL.js.map +0 -1
  362. package/dist/chunk-UYQMBBWJ.js.map +0 -1
  363. package/dist/chunk-VKGKDOKR.js.map +0 -1
  364. package/dist/chunk-VL2V6PEN.cjs +0 -261
  365. package/dist/chunk-VL2V6PEN.cjs.map +0 -1
  366. package/dist/chunk-WOJMKB3N.cjs.map +0 -1
  367. package/dist/chunk-WWFHO375.cjs.map +0 -1
  368. package/dist/chunk-XGPUQ56G.js.map +0 -1
  369. package/dist/chunk-XGU7DZDA.cjs +0 -1095
  370. package/dist/chunk-XGU7DZDA.cjs.map +0 -1
  371. package/dist/chunk-XPCZADMT.cjs.map +0 -1
  372. package/dist/chunk-XWV4JT34.js.map +0 -1
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ var chunkPWXGB77L_cjs = require('../chunk-PWXGB77L.cjs');
4
+ var chunkSVUKGWSN_cjs = require('../chunk-SVUKGWSN.cjs');
5
+ var chunkRW24SAHI_cjs = require('../chunk-RW24SAHI.cjs');
6
+ var chunkNT6ILURI_cjs = require('../chunk-NT6ILURI.cjs');
7
+ require('../chunk-DDCYVIVV.cjs');
8
+ var chunkHAHNRASW_cjs = require('../chunk-HAHNRASW.cjs');
9
+ require('../chunk-NMQ6C6TS.cjs');
10
+ require('../chunk-DI74SMXS.cjs');
11
+ require('../chunk-XRU7V7FF.cjs');
12
+ require('../chunk-SAFZ6JTI.cjs');
13
+
14
+
15
+
16
+ Object.defineProperty(exports, "createExternalRef", {
17
+ enumerable: true,
18
+ get: function () { return chunkPWXGB77L_cjs.createExternalRef; }
19
+ });
20
+ Object.defineProperty(exports, "externalRef", {
21
+ enumerable: true,
22
+ get: function () { return chunkPWXGB77L_cjs.externalRef; }
23
+ });
24
+ Object.defineProperty(exports, "getExternalRefTable", {
25
+ enumerable: true,
26
+ get: function () { return chunkPWXGB77L_cjs.getExternalRefTable; }
27
+ });
28
+ Object.defineProperty(exports, "isExternalRefSchema", {
29
+ enumerable: true,
30
+ get: function () { return chunkPWXGB77L_cjs.isExternalRefSchema; }
31
+ });
32
+ Object.defineProperty(exports, "metaEdge", {
33
+ enumerable: true,
34
+ get: function () { return chunkPWXGB77L_cjs.metaEdge; }
35
+ });
36
+ Object.defineProperty(exports, "asRecordedInstant", {
37
+ enumerable: true,
38
+ get: function () { return chunkSVUKGWSN_cjs.asRecordedInstant; }
39
+ });
40
+ Object.defineProperty(exports, "defineEdge", {
41
+ enumerable: true,
42
+ get: function () { return chunkRW24SAHI_cjs.defineEdge; }
43
+ });
44
+ Object.defineProperty(exports, "defineNode", {
45
+ enumerable: true,
46
+ get: function () { return chunkRW24SAHI_cjs.defineNode; }
47
+ });
48
+ Object.defineProperty(exports, "asEdgeId", {
49
+ enumerable: true,
50
+ get: function () { return chunkNT6ILURI_cjs.asEdgeId; }
51
+ });
52
+ Object.defineProperty(exports, "asNodeId", {
53
+ enumerable: true,
54
+ get: function () { return chunkNT6ILURI_cjs.asNodeId; }
55
+ });
56
+ Object.defineProperty(exports, "defineGraph", {
57
+ enumerable: true,
58
+ get: function () { return chunkNT6ILURI_cjs.defineGraph; }
59
+ });
60
+ Object.defineProperty(exports, "getEdgeKinds", {
61
+ enumerable: true,
62
+ get: function () { return chunkNT6ILURI_cjs.getEdgeKinds; }
63
+ });
64
+ Object.defineProperty(exports, "getNodeKinds", {
65
+ enumerable: true,
66
+ get: function () { return chunkNT6ILURI_cjs.getNodeKinds; }
67
+ });
68
+ Object.defineProperty(exports, "isEdgeType", {
69
+ enumerable: true,
70
+ get: function () { return chunkNT6ILURI_cjs.isEdgeType; }
71
+ });
72
+ Object.defineProperty(exports, "isEdgeTypeWithEndpoints", {
73
+ enumerable: true,
74
+ get: function () { return chunkNT6ILURI_cjs.isEdgeTypeWithEndpoints; }
75
+ });
76
+ Object.defineProperty(exports, "isGraphDef", {
77
+ enumerable: true,
78
+ get: function () { return chunkNT6ILURI_cjs.isGraphDef; }
79
+ });
80
+ Object.defineProperty(exports, "isNodeType", {
81
+ enumerable: true,
82
+ get: function () { return chunkNT6ILURI_cjs.isNodeType; }
83
+ });
84
+ Object.defineProperty(exports, "DEFAULT_SEARCHABLE_LANGUAGE", {
85
+ enumerable: true,
86
+ get: function () { return chunkHAHNRASW_cjs.DEFAULT_SEARCHABLE_LANGUAGE; }
87
+ });
88
+ Object.defineProperty(exports, "embedding", {
89
+ enumerable: true,
90
+ get: function () { return chunkHAHNRASW_cjs.embedding; }
91
+ });
92
+ Object.defineProperty(exports, "getEmbeddingDimensions", {
93
+ enumerable: true,
94
+ get: function () { return chunkHAHNRASW_cjs.getEmbeddingDimensions; }
95
+ });
96
+ Object.defineProperty(exports, "getSearchableMetadata", {
97
+ enumerable: true,
98
+ get: function () { return chunkHAHNRASW_cjs.getSearchableMetadata; }
99
+ });
100
+ Object.defineProperty(exports, "isEmbeddingSchema", {
101
+ enumerable: true,
102
+ get: function () { return chunkHAHNRASW_cjs.isEmbeddingSchema; }
103
+ });
104
+ Object.defineProperty(exports, "isSearchableSchema", {
105
+ enumerable: true,
106
+ get: function () { return chunkHAHNRASW_cjs.isSearchableSchema; }
107
+ });
108
+ Object.defineProperty(exports, "resolveGraphVectorSlots", {
109
+ enumerable: true,
110
+ get: function () { return chunkHAHNRASW_cjs.resolveGraphVectorSlots; }
111
+ });
112
+ Object.defineProperty(exports, "searchable", {
113
+ enumerable: true,
114
+ get: function () { return chunkHAHNRASW_cjs.searchable; }
115
+ });
116
+ //# sourceMappingURL=index.cjs.map
117
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,225 @@
1
+ import { z } from 'zod';
2
+ import { l as KindAnnotations, a as NodeType, d as EdgeType } from '../extension-types-BLEVH4SG.cjs';
3
+ export { A as AnyEdgeType, e as Cardinality, f as Collation, D as DeleteBehavior, g as EdgeId, h as EdgeProps, E as EdgeRegistration, i as EdgeTypeWithEndpoints, j as EndpointExistence, b as GraphDefaults, I as IndexEntity, J as JsonValue, K as KindEntity, m as NodeId, n as NodeProps, N as NodeRegistration, c as NullCheckOp, T as TemporalMode, U as UniqueConstraint, o as UniquenessScope, p as asEdgeId, q as asNodeId, r as isEdgeType, s as isEdgeTypeWithEndpoints, t as isNodeType } from '../extension-types-BLEVH4SG.cjs';
4
+ import { D as InferenceType, at as MetaEdge } from '../index-CrFL_ENI.cjs';
5
+ export { D as DEFAULT_SEARCHABLE_LANGUAGE, b as EmbeddingSchema, c as EmbeddingValue, R as RecordedInstant, S as SearchableMetadata, d as SearchableOptions, e as SearchableSchema, f as asRecordedInstant, g as embedding, h as getEmbeddingDimensions, i as getSearchableMetadata, j as isEmbeddingSchema, k as isSearchableSchema, r as resolveGraphVectorSlots, s as searchable } from '../temporal-BC_NQV5Y.cjs';
6
+ export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, G as GraphDef, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from '../define-graph-CzEvA_8F.cjs';
7
+
8
+ /**
9
+ * Options for defining a node type.
10
+ */
11
+ type DefineNodeOptions<S extends z.ZodObject<z.ZodRawShape>> = Readonly<{
12
+ /** Zod schema for node properties */
13
+ schema: S;
14
+ /** Optional description for documentation */
15
+ description?: string;
16
+ /**
17
+ * Consumer-owned structured annotations for the kind.
18
+ *
19
+ * Stored in the canonical schema and **participates in schema hashing** —
20
+ * any change bumps the schema version and shows up as a `safe`-severity
21
+ * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.
22
+ */
23
+ annotations?: KindAnnotations;
24
+ }>;
25
+ /**
26
+ * Creates a node type definition.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const Person = defineNode("Person", {
31
+ * schema: z.object({
32
+ * fullName: z.string().min(1),
33
+ * email: z.string().email().optional(),
34
+ * }),
35
+ * description: "A person in the system",
36
+ * });
37
+ * ```
38
+ */
39
+ declare function defineNode<K extends string, S extends z.ZodObject<z.ZodRawShape>>(name: K, options: DefineNodeOptions<S>): NodeType<K, S>;
40
+
41
+ /**
42
+ * Options for defining an edge type.
43
+ */
44
+ type DefineEdgeOptions<S extends z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[] | undefined = undefined, To extends readonly NodeType[] | undefined = undefined> = Readonly<{
45
+ /** Zod schema for edge properties (defaults to empty object) */
46
+ schema?: S;
47
+ /** Optional description for documentation */
48
+ description?: string;
49
+ /**
50
+ * Consumer-owned structured annotations for the kind.
51
+ *
52
+ * Stored in the canonical schema and **participates in schema hashing** —
53
+ * any change bumps the schema version and shows up as a `safe`-severity
54
+ * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.
55
+ */
56
+ annotations?: KindAnnotations;
57
+ /** Node types that can be the source of this edge (domain constraint) */
58
+ from?: From;
59
+ /** Node types that can be the target of this edge (range constraint) */
60
+ to?: To;
61
+ }>;
62
+ declare const EMPTY_SCHEMA: z.ZodObject<{}, z.core.$strip>;
63
+ type EmptySchema = typeof EMPTY_SCHEMA;
64
+ /**
65
+ * Creates an edge type definition.
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * // Edge with no properties
70
+ * const hasEpisode = defineEdge("hasEpisode");
71
+ *
72
+ * // Edge with properties
73
+ * const employedAt = defineEdge("employedAt", {
74
+ * schema: z.object({
75
+ * isPrimary: z.boolean().default(true),
76
+ * startedAt: z.date(),
77
+ * }),
78
+ * description: "Employment relationship",
79
+ * });
80
+ *
81
+ * // Edge with domain/range constraints (can be used directly in defineGraph)
82
+ * const worksAt = defineEdge("worksAt", {
83
+ * schema: z.object({ role: z.string() }),
84
+ * from: [Person],
85
+ * to: [Company],
86
+ * });
87
+ * ```
88
+ */
89
+ declare function defineEdge<K extends string>(name: K): EdgeType<K, EmptySchema>;
90
+ declare function defineEdge<K extends string, S extends z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[], To extends readonly NodeType[]>(name: K, options: DefineEdgeOptions<S, From, To> & {
91
+ from: From;
92
+ to: To;
93
+ }): EdgeType<K, S, From, To>;
94
+ declare function defineEdge<K extends string, S extends z.ZodObject<z.ZodRawShape>>(name: K, options: DefineEdgeOptions<S>): EdgeType<K, S>;
95
+
96
+ /**
97
+ * Options for creating a meta-edge.
98
+ */
99
+ type MetaEdgeOptions = Readonly<{
100
+ /** Whether the relationship is transitive (A→B, B→C implies A→C) */
101
+ transitive?: boolean;
102
+ /** Whether the relationship is symmetric (A→B implies B→A) */
103
+ symmetric?: boolean;
104
+ /** Whether the relationship is reflexive (A→A is always true) */
105
+ reflexive?: boolean;
106
+ /** Name of the inverse meta-edge */
107
+ inverse?: string;
108
+ /** How this meta-edge affects queries and validation */
109
+ inference?: InferenceType;
110
+ /** Optional description */
111
+ description?: string;
112
+ }>;
113
+ /**
114
+ * Creates a custom meta-edge definition.
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * // Custom meta-edge for regulatory relationships
119
+ * const regulatedBy = metaEdge("regulatedBy", {
120
+ * description: "Type X is regulated by authority type Y",
121
+ * transitive: false,
122
+ * symmetric: false,
123
+ * });
124
+ * ```
125
+ */
126
+ declare function metaEdge<K extends string>(name: K, options?: MetaEdgeOptions): MetaEdge<K>;
127
+
128
+ /**
129
+ * External reference type for hybrid overlay patterns.
130
+ *
131
+ * Creates a Zod-compatible schema for referencing entities in external
132
+ * data sources (e.g., existing application tables) from TypeGraph nodes.
133
+ */
134
+
135
+ /**
136
+ * Symbol key for storing external table name on the schema.
137
+ * This allows the schema introspector to detect external reference types
138
+ * and extract source information.
139
+ */
140
+ declare const EXTERNAL_REF_TABLE_KEY: "_externalRefTable";
141
+ /**
142
+ * The shape of an external reference value.
143
+ * Contains the source table identifier and the ID of the referenced record.
144
+ */
145
+ type ExternalRefValue<T extends string = string> = Readonly<{
146
+ table: T;
147
+ id: string;
148
+ }>;
149
+ /**
150
+ * A Zod schema for external references with attached table metadata.
151
+ */
152
+ type ExternalRefSchema<T extends string = string> = z.ZodType<ExternalRefValue<T>> & Readonly<{
153
+ [EXTERNAL_REF_TABLE_KEY]: T;
154
+ }>;
155
+ /**
156
+ * Creates a Zod schema for referencing external data sources.
157
+ *
158
+ * Use this when building a hybrid overlay where TypeGraph stores
159
+ * graph relationships and metadata while your existing tables
160
+ * remain the source of truth for entity data.
161
+ *
162
+ * @param table - The identifier for the external table/source (e.g., "users", "documents")
163
+ * @returns A Zod schema that validates external reference objects
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * import { defineNode, externalRef, embedding } from "@nicia-ai/typegraph";
168
+ *
169
+ * // Reference documents from your existing application database
170
+ * const Document = defineNode("Document", {
171
+ * schema: z.object({
172
+ * source: externalRef("documents"),
173
+ * embedding: embedding(1536).optional(),
174
+ * extractedTopics: z.array(z.string()).optional(),
175
+ * }),
176
+ * });
177
+ *
178
+ * // Create a node referencing an external document
179
+ * await store.nodes.Document.create({
180
+ * source: { table: "documents", id: "doc_abc123" },
181
+ * embedding: await generateEmbedding(docContent),
182
+ * });
183
+ *
184
+ * // Query and hydrate with external data
185
+ * const results = await store
186
+ * .query()
187
+ * .from("Document", "d")
188
+ * .whereNode("d", (d) => d.embedding.similarTo(query, 10))
189
+ * .select((ctx) => ctx.d.source)
190
+ * .execute();
191
+ *
192
+ * // Fetch full data from your app database
193
+ * const externalIds = results.map((r) => r.id);
194
+ * const fullDocs = await appDb.query.documents.findMany({
195
+ * where: inArray(documents.id, externalIds),
196
+ * });
197
+ * ```
198
+ */
199
+ declare function externalRef<T extends string>(table: T): ExternalRefSchema<T>;
200
+ /**
201
+ * Checks if a value is an external reference schema.
202
+ */
203
+ declare function isExternalRefSchema(value: unknown): value is ExternalRefSchema;
204
+ /**
205
+ * Gets the table name from an external reference schema.
206
+ * Returns undefined if the schema is not an external reference schema.
207
+ */
208
+ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
209
+ /**
210
+ * Helper function to create a typed external reference value.
211
+ * Useful when you want to avoid repeating the table name.
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * const docRef = createExternalRef("documents");
216
+ *
217
+ * await store.nodes.Document.create({
218
+ * source: docRef("doc_123"),
219
+ * embedding: [...],
220
+ * });
221
+ * ```
222
+ */
223
+ declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
224
+
225
+ export { type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, KindAnnotations, type MetaEdgeOptions, NodeType, createExternalRef, defineEdge, defineNode, externalRef, getExternalRefTable, isExternalRefSchema, metaEdge };
@@ -0,0 +1,225 @@
1
+ import { z } from 'zod';
2
+ import { l as KindAnnotations, a as NodeType, d as EdgeType } from '../extension-types-BLEVH4SG.js';
3
+ export { A as AnyEdgeType, e as Cardinality, f as Collation, D as DeleteBehavior, g as EdgeId, h as EdgeProps, E as EdgeRegistration, i as EdgeTypeWithEndpoints, j as EndpointExistence, b as GraphDefaults, I as IndexEntity, J as JsonValue, K as KindEntity, m as NodeId, n as NodeProps, N as NodeRegistration, c as NullCheckOp, T as TemporalMode, U as UniqueConstraint, o as UniquenessScope, p as asEdgeId, q as asNodeId, r as isEdgeType, s as isEdgeTypeWithEndpoints, t as isNodeType } from '../extension-types-BLEVH4SG.js';
4
+ import { D as InferenceType, at as MetaEdge } from '../index-Bq7vSPHy.js';
5
+ export { D as DEFAULT_SEARCHABLE_LANGUAGE, b as EmbeddingSchema, c as EmbeddingValue, R as RecordedInstant, S as SearchableMetadata, d as SearchableOptions, e as SearchableSchema, f as asRecordedInstant, g as embedding, h as getEmbeddingDimensions, i as getSearchableMetadata, j as isEmbeddingSchema, k as isSearchableSchema, r as resolveGraphVectorSlots, s as searchable } from '../temporal-DqtOEo_B.js';
6
+ export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, G as GraphDef, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from '../define-graph-DRo9xpYN.js';
7
+
8
+ /**
9
+ * Options for defining a node type.
10
+ */
11
+ type DefineNodeOptions<S extends z.ZodObject<z.ZodRawShape>> = Readonly<{
12
+ /** Zod schema for node properties */
13
+ schema: S;
14
+ /** Optional description for documentation */
15
+ description?: string;
16
+ /**
17
+ * Consumer-owned structured annotations for the kind.
18
+ *
19
+ * Stored in the canonical schema and **participates in schema hashing** —
20
+ * any change bumps the schema version and shows up as a `safe`-severity
21
+ * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.
22
+ */
23
+ annotations?: KindAnnotations;
24
+ }>;
25
+ /**
26
+ * Creates a node type definition.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const Person = defineNode("Person", {
31
+ * schema: z.object({
32
+ * fullName: z.string().min(1),
33
+ * email: z.string().email().optional(),
34
+ * }),
35
+ * description: "A person in the system",
36
+ * });
37
+ * ```
38
+ */
39
+ declare function defineNode<K extends string, S extends z.ZodObject<z.ZodRawShape>>(name: K, options: DefineNodeOptions<S>): NodeType<K, S>;
40
+
41
+ /**
42
+ * Options for defining an edge type.
43
+ */
44
+ type DefineEdgeOptions<S extends z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[] | undefined = undefined, To extends readonly NodeType[] | undefined = undefined> = Readonly<{
45
+ /** Zod schema for edge properties (defaults to empty object) */
46
+ schema?: S;
47
+ /** Optional description for documentation */
48
+ description?: string;
49
+ /**
50
+ * Consumer-owned structured annotations for the kind.
51
+ *
52
+ * Stored in the canonical schema and **participates in schema hashing** —
53
+ * any change bumps the schema version and shows up as a `safe`-severity
54
+ * diff in `getSchemaChanges`. See `KindAnnotations` for the contract.
55
+ */
56
+ annotations?: KindAnnotations;
57
+ /** Node types that can be the source of this edge (domain constraint) */
58
+ from?: From;
59
+ /** Node types that can be the target of this edge (range constraint) */
60
+ to?: To;
61
+ }>;
62
+ declare const EMPTY_SCHEMA: z.ZodObject<{}, z.core.$strip>;
63
+ type EmptySchema = typeof EMPTY_SCHEMA;
64
+ /**
65
+ * Creates an edge type definition.
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * // Edge with no properties
70
+ * const hasEpisode = defineEdge("hasEpisode");
71
+ *
72
+ * // Edge with properties
73
+ * const employedAt = defineEdge("employedAt", {
74
+ * schema: z.object({
75
+ * isPrimary: z.boolean().default(true),
76
+ * startedAt: z.date(),
77
+ * }),
78
+ * description: "Employment relationship",
79
+ * });
80
+ *
81
+ * // Edge with domain/range constraints (can be used directly in defineGraph)
82
+ * const worksAt = defineEdge("worksAt", {
83
+ * schema: z.object({ role: z.string() }),
84
+ * from: [Person],
85
+ * to: [Company],
86
+ * });
87
+ * ```
88
+ */
89
+ declare function defineEdge<K extends string>(name: K): EdgeType<K, EmptySchema>;
90
+ declare function defineEdge<K extends string, S extends z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[], To extends readonly NodeType[]>(name: K, options: DefineEdgeOptions<S, From, To> & {
91
+ from: From;
92
+ to: To;
93
+ }): EdgeType<K, S, From, To>;
94
+ declare function defineEdge<K extends string, S extends z.ZodObject<z.ZodRawShape>>(name: K, options: DefineEdgeOptions<S>): EdgeType<K, S>;
95
+
96
+ /**
97
+ * Options for creating a meta-edge.
98
+ */
99
+ type MetaEdgeOptions = Readonly<{
100
+ /** Whether the relationship is transitive (A→B, B→C implies A→C) */
101
+ transitive?: boolean;
102
+ /** Whether the relationship is symmetric (A→B implies B→A) */
103
+ symmetric?: boolean;
104
+ /** Whether the relationship is reflexive (A→A is always true) */
105
+ reflexive?: boolean;
106
+ /** Name of the inverse meta-edge */
107
+ inverse?: string;
108
+ /** How this meta-edge affects queries and validation */
109
+ inference?: InferenceType;
110
+ /** Optional description */
111
+ description?: string;
112
+ }>;
113
+ /**
114
+ * Creates a custom meta-edge definition.
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * // Custom meta-edge for regulatory relationships
119
+ * const regulatedBy = metaEdge("regulatedBy", {
120
+ * description: "Type X is regulated by authority type Y",
121
+ * transitive: false,
122
+ * symmetric: false,
123
+ * });
124
+ * ```
125
+ */
126
+ declare function metaEdge<K extends string>(name: K, options?: MetaEdgeOptions): MetaEdge<K>;
127
+
128
+ /**
129
+ * External reference type for hybrid overlay patterns.
130
+ *
131
+ * Creates a Zod-compatible schema for referencing entities in external
132
+ * data sources (e.g., existing application tables) from TypeGraph nodes.
133
+ */
134
+
135
+ /**
136
+ * Symbol key for storing external table name on the schema.
137
+ * This allows the schema introspector to detect external reference types
138
+ * and extract source information.
139
+ */
140
+ declare const EXTERNAL_REF_TABLE_KEY: "_externalRefTable";
141
+ /**
142
+ * The shape of an external reference value.
143
+ * Contains the source table identifier and the ID of the referenced record.
144
+ */
145
+ type ExternalRefValue<T extends string = string> = Readonly<{
146
+ table: T;
147
+ id: string;
148
+ }>;
149
+ /**
150
+ * A Zod schema for external references with attached table metadata.
151
+ */
152
+ type ExternalRefSchema<T extends string = string> = z.ZodType<ExternalRefValue<T>> & Readonly<{
153
+ [EXTERNAL_REF_TABLE_KEY]: T;
154
+ }>;
155
+ /**
156
+ * Creates a Zod schema for referencing external data sources.
157
+ *
158
+ * Use this when building a hybrid overlay where TypeGraph stores
159
+ * graph relationships and metadata while your existing tables
160
+ * remain the source of truth for entity data.
161
+ *
162
+ * @param table - The identifier for the external table/source (e.g., "users", "documents")
163
+ * @returns A Zod schema that validates external reference objects
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * import { defineNode, externalRef, embedding } from "@nicia-ai/typegraph";
168
+ *
169
+ * // Reference documents from your existing application database
170
+ * const Document = defineNode("Document", {
171
+ * schema: z.object({
172
+ * source: externalRef("documents"),
173
+ * embedding: embedding(1536).optional(),
174
+ * extractedTopics: z.array(z.string()).optional(),
175
+ * }),
176
+ * });
177
+ *
178
+ * // Create a node referencing an external document
179
+ * await store.nodes.Document.create({
180
+ * source: { table: "documents", id: "doc_abc123" },
181
+ * embedding: await generateEmbedding(docContent),
182
+ * });
183
+ *
184
+ * // Query and hydrate with external data
185
+ * const results = await store
186
+ * .query()
187
+ * .from("Document", "d")
188
+ * .whereNode("d", (d) => d.embedding.similarTo(query, 10))
189
+ * .select((ctx) => ctx.d.source)
190
+ * .execute();
191
+ *
192
+ * // Fetch full data from your app database
193
+ * const externalIds = results.map((r) => r.id);
194
+ * const fullDocs = await appDb.query.documents.findMany({
195
+ * where: inArray(documents.id, externalIds),
196
+ * });
197
+ * ```
198
+ */
199
+ declare function externalRef<T extends string>(table: T): ExternalRefSchema<T>;
200
+ /**
201
+ * Checks if a value is an external reference schema.
202
+ */
203
+ declare function isExternalRefSchema(value: unknown): value is ExternalRefSchema;
204
+ /**
205
+ * Gets the table name from an external reference schema.
206
+ * Returns undefined if the schema is not an external reference schema.
207
+ */
208
+ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
209
+ /**
210
+ * Helper function to create a typed external reference value.
211
+ * Useful when you want to avoid repeating the table name.
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * const docRef = createExternalRef("documents");
216
+ *
217
+ * await store.nodes.Document.create({
218
+ * source: docRef("doc_123"),
219
+ * embedding: [...],
220
+ * });
221
+ * ```
222
+ */
223
+ declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
224
+
225
+ export { type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, KindAnnotations, type MetaEdgeOptions, NodeType, createExternalRef, defineEdge, defineNode, externalRef, getExternalRefTable, isExternalRefSchema, metaEdge };
@@ -0,0 +1,12 @@
1
+ export { createExternalRef, externalRef, getExternalRefTable, isExternalRefSchema, metaEdge } from '../chunk-3LKL3S6X.js';
2
+ export { asRecordedInstant } from '../chunk-J6IJARLG.js';
3
+ export { defineEdge, defineNode } from '../chunk-76HE7DJP.js';
4
+ export { asEdgeId, asNodeId, defineGraph, getEdgeKinds, getNodeKinds, isEdgeType, isEdgeTypeWithEndpoints, isGraphDef, isNodeType } from '../chunk-PH4IJ3V5.js';
5
+ import '../chunk-I6FX7AAG.js';
6
+ export { DEFAULT_SEARCHABLE_LANGUAGE, embedding, getEmbeddingDimensions, getSearchableMetadata, isEmbeddingSchema, isSearchableSchema, resolveGraphVectorSlots, searchable } from '../chunk-PC2UBAUB.js';
7
+ import '../chunk-TAUGGLNQ.js';
8
+ import '../chunk-ITE4IXAK.js';
9
+ import '../chunk-XZA3Y4YH.js';
10
+ import '../chunk-DPNA466P.js';
11
+ //# sourceMappingURL=index.js.map
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,6 +1,6 @@
1
- import { F as FulltextStrategy } from './fulltext-strategy-DebsMrqg.js';
2
- import { P as PostgresTables } from './postgres-IaBA4RgE.js';
3
- import { S as SqliteTables } from './sqlite-BUOHPx7p.js';
1
+ import { F as FulltextStrategy } from './index-Bq7vSPHy.js';
2
+ import { P as PostgresTables } from './postgres-Cl1ZAN1G.js';
3
+ import { S as SqliteTables } from './sqlite-CYfhvESj.js';
4
4
 
5
5
  /**
6
6
  * Generates all DDL statements for the given SQLite tables.
@@ -1,6 +1,6 @@
1
- import { F as FulltextStrategy } from './fulltext-strategy-C27vXaeB.cjs';
2
- import { P as PostgresTables } from './postgres-YrYmPlaU.cjs';
3
- import { S as SqliteTables } from './sqlite-Pp8O19WE.cjs';
1
+ import { F as FulltextStrategy } from './index-CrFL_ENI.cjs';
2
+ import { P as PostgresTables } from './postgres-DMgIKQU-.cjs';
3
+ import { S as SqliteTables } from './sqlite-BDkW39aa.cjs';
4
4
 
5
5
  /**
6
6
  * Generates all DDL statements for the given SQLite tables.