@nicia-ai/typegraph 0.39.0 → 0.40.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 (247) hide show
  1. package/dist/backend/drizzle/indexes.cjs +8 -10
  2. package/dist/backend/drizzle/indexes.d.cts +2 -2
  3. package/dist/backend/drizzle/indexes.d.ts +2 -2
  4. package/dist/backend/drizzle/indexes.js +4 -6
  5. package/dist/backend/index.cjs +60 -39
  6. package/dist/backend/index.d.cts +60 -1
  7. package/dist/backend/index.d.ts +60 -1
  8. package/dist/backend/index.js +12 -3
  9. package/dist/backend/postgres/index.cjs +24 -26
  10. package/dist/backend/postgres/index.d.cts +6 -6
  11. package/dist/backend/postgres/index.d.ts +6 -6
  12. package/dist/backend/postgres/index.js +11 -13
  13. package/dist/backend/postgres/pglite-store.cjs +25 -26
  14. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  15. package/dist/backend/postgres/pglite-store.d.cts +6 -5
  16. package/dist/backend/postgres/pglite-store.d.ts +6 -5
  17. package/dist/backend/postgres/pglite-store.js +21 -22
  18. package/dist/backend/postgres/pglite-store.js.map +1 -1
  19. package/dist/backend/postgres/pglite.cjs +13 -15
  20. package/dist/backend/postgres/pglite.d.cts +3 -3
  21. package/dist/backend/postgres/pglite.d.ts +3 -3
  22. package/dist/backend/postgres/pglite.js +12 -14
  23. package/dist/backend/sqlite/index.cjs +25 -27
  24. package/dist/backend/sqlite/index.d.cts +6 -6
  25. package/dist/backend/sqlite/index.d.ts +6 -6
  26. package/dist/backend/sqlite/index.js +9 -11
  27. package/dist/backend/sqlite/libsql.cjs +15 -17
  28. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  29. package/dist/backend/sqlite/libsql.d.cts +3 -3
  30. package/dist/backend/sqlite/libsql.d.ts +3 -3
  31. package/dist/backend/sqlite/libsql.js +14 -16
  32. package/dist/backend/sqlite/libsql.js.map +1 -1
  33. package/dist/backend/sqlite/local-store.cjs +26 -27
  34. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  35. package/dist/backend/sqlite/local-store.d.cts +6 -5
  36. package/dist/backend/sqlite/local-store.d.ts +6 -5
  37. package/dist/backend/sqlite/local-store.js +22 -23
  38. package/dist/backend/sqlite/local-store.js.map +1 -1
  39. package/dist/backend/sqlite/local.cjs +14 -16
  40. package/dist/backend/sqlite/local.d.cts +3 -3
  41. package/dist/backend/sqlite/local.d.ts +3 -3
  42. package/dist/backend/sqlite/local.js +12 -14
  43. package/dist/{chunk-U4JDJKPD.js → chunk-2I3DNNBU.js} +4 -4
  44. package/dist/{chunk-U4JDJKPD.js.map → chunk-2I3DNNBU.js.map} +1 -1
  45. package/dist/{chunk-NPWACFQJ.cjs → chunk-2J5NMMVR.cjs} +43 -43
  46. package/dist/{chunk-NPWACFQJ.cjs.map → chunk-2J5NMMVR.cjs.map} +1 -1
  47. package/dist/{chunk-3YFDFOYB.cjs → chunk-2X73QTIC.cjs} +12 -13
  48. package/dist/chunk-2X73QTIC.cjs.map +1 -0
  49. package/dist/{chunk-CBK2IVI2.js → chunk-3BL3JFHL.js} +40 -30
  50. package/dist/chunk-3BL3JFHL.js.map +1 -0
  51. package/dist/chunk-3SHAUJRB.js +79 -0
  52. package/dist/chunk-3SHAUJRB.js.map +1 -0
  53. package/dist/{chunk-3SK4SVTW.js → chunk-53BSOG3O.js} +8 -7
  54. package/dist/chunk-53BSOG3O.js.map +1 -0
  55. package/dist/chunk-5J4VNCUD.js +856 -0
  56. package/dist/chunk-5J4VNCUD.js.map +1 -0
  57. package/dist/chunk-5YBDB7UG.cjs +12 -0
  58. package/dist/{chunk-FMNUSGZ4.cjs.map → chunk-5YBDB7UG.cjs.map} +1 -1
  59. package/dist/{chunk-6XDBRDZE.js → chunk-6N7QBIWN.js} +7 -3
  60. package/dist/chunk-6N7QBIWN.js.map +1 -0
  61. package/dist/{chunk-EZH7FNUS.js → chunk-6QP4QXBR.js} +3 -3
  62. package/dist/{chunk-EZH7FNUS.js.map → chunk-6QP4QXBR.js.map} +1 -1
  63. package/dist/{chunk-E6TXEISH.cjs → chunk-7UTUKH4E.cjs} +4 -4
  64. package/dist/{chunk-E6TXEISH.cjs.map → chunk-7UTUKH4E.cjs.map} +1 -1
  65. package/dist/chunk-7WLEQIHA.cjs +605 -0
  66. package/dist/chunk-7WLEQIHA.cjs.map +1 -0
  67. package/dist/{chunk-BQITNFQJ.js → chunk-AQVDAKXH.js} +3 -3
  68. package/dist/{chunk-BQITNFQJ.js.map → chunk-AQVDAKXH.js.map} +1 -1
  69. package/dist/{chunk-X6CNEA32.js → chunk-BUZWMDNL.js} +5 -5
  70. package/dist/{chunk-X6CNEA32.js.map → chunk-BUZWMDNL.js.map} +1 -1
  71. package/dist/{chunk-7M3NACL3.cjs → chunk-CKFBZ4LV.cjs} +4 -4
  72. package/dist/{chunk-7M3NACL3.cjs.map → chunk-CKFBZ4LV.cjs.map} +1 -1
  73. package/dist/{chunk-SU7VQOJ3.js → chunk-CU3LPYNB.js} +4 -4
  74. package/dist/{chunk-SU7VQOJ3.js.map → chunk-CU3LPYNB.js.map} +1 -1
  75. package/dist/{chunk-IFRPHG7O.js → chunk-EFZ4S22A.js} +10 -9
  76. package/dist/chunk-EFZ4S22A.js.map +1 -0
  77. package/dist/chunk-ELA3V6UN.js +601 -0
  78. package/dist/chunk-ELA3V6UN.js.map +1 -0
  79. package/dist/{chunk-6SRLCSAV.cjs → chunk-H6I36MGT.cjs} +883 -873
  80. package/dist/chunk-H6I36MGT.cjs.map +1 -0
  81. package/dist/chunk-HAQVISUF.cjs +1098 -0
  82. package/dist/chunk-HAQVISUF.cjs.map +1 -0
  83. package/dist/{chunk-BKAKAVRW.cjs → chunk-HQRZEYYB.cjs} +44 -44
  84. package/dist/{chunk-BKAKAVRW.cjs.map → chunk-HQRZEYYB.cjs.map} +1 -1
  85. package/dist/{chunk-KAFXPB2L.js → chunk-I5CRUPKO.js} +9 -10
  86. package/dist/{chunk-KAFXPB2L.js.map → chunk-I5CRUPKO.js.map} +1 -1
  87. package/dist/{chunk-IFDXG2YJ.js → chunk-JHK6NPFV.js} +217 -305
  88. package/dist/chunk-JHK6NPFV.js.map +1 -0
  89. package/dist/chunk-JZYMOHHM.cjs +226 -0
  90. package/dist/chunk-JZYMOHHM.cjs.map +1 -0
  91. package/dist/{chunk-VXAFOF6Z.cjs → chunk-K4FB2RMO.cjs} +7 -7
  92. package/dist/{chunk-VXAFOF6Z.cjs.map → chunk-K4FB2RMO.cjs.map} +1 -1
  93. package/dist/{chunk-ERZ4QPQX.js → chunk-K6CD6W5J.js} +5 -5
  94. package/dist/{chunk-ERZ4QPQX.js.map → chunk-K6CD6W5J.js.map} +1 -1
  95. package/dist/{chunk-JD2YC62H.cjs → chunk-KHNKYSGP.cjs} +34 -34
  96. package/dist/{chunk-JD2YC62H.cjs.map → chunk-KHNKYSGP.cjs.map} +1 -1
  97. package/dist/{chunk-CWX77JB4.cjs → chunk-KLR77R5A.cjs} +13 -13
  98. package/dist/{chunk-CWX77JB4.cjs.map → chunk-KLR77R5A.cjs.map} +1 -1
  99. package/dist/{chunk-AOL64O4Z.js → chunk-L3DDZUZP.js} +3 -3
  100. package/dist/{chunk-AOL64O4Z.js.map → chunk-L3DDZUZP.js.map} +1 -1
  101. package/dist/{chunk-PZHC5GCD.js → chunk-L5ET7FYQ.js} +3 -3
  102. package/dist/{chunk-PZHC5GCD.js.map → chunk-L5ET7FYQ.js.map} +1 -1
  103. package/dist/{chunk-B63IFHXR.cjs → chunk-LFFVD5ZR.cjs} +41 -41
  104. package/dist/{chunk-B63IFHXR.cjs.map → chunk-LFFVD5ZR.cjs.map} +1 -1
  105. package/dist/chunk-LL5D5T5W.cjs +157 -0
  106. package/dist/chunk-LL5D5T5W.cjs.map +1 -0
  107. package/dist/{chunk-GUUWKPTK.cjs → chunk-LLE25NRD.cjs} +7 -7
  108. package/dist/{chunk-GUUWKPTK.cjs.map → chunk-LLE25NRD.cjs.map} +1 -1
  109. package/dist/chunk-LLHMAHG4.cjs +886 -0
  110. package/dist/chunk-LLHMAHG4.cjs.map +1 -0
  111. package/dist/{chunk-KIZSHRUI.cjs → chunk-M2RPZS7J.cjs} +10 -10
  112. package/dist/{chunk-KIZSHRUI.cjs.map → chunk-M2RPZS7J.cjs.map} +1 -1
  113. package/dist/chunk-MNURF4RF.cjs +85 -0
  114. package/dist/chunk-MNURF4RF.cjs.map +1 -0
  115. package/dist/chunk-QOHTVDHU.js +144 -0
  116. package/dist/chunk-QOHTVDHU.js.map +1 -0
  117. package/dist/{chunk-HTQOBY75.cjs → chunk-QXKVUJLI.cjs} +110 -109
  118. package/dist/chunk-QXKVUJLI.cjs.map +1 -0
  119. package/dist/{chunk-GNPGGLAE.cjs → chunk-QYDUCWD2.cjs} +4 -4
  120. package/dist/{chunk-GNPGGLAE.cjs.map → chunk-QYDUCWD2.cjs.map} +1 -1
  121. package/dist/{chunk-DOKUXLFH.js → chunk-QZYGZVUI.js} +34 -34
  122. package/dist/chunk-QZYGZVUI.js.map +1 -0
  123. package/dist/{chunk-GKQU44SQ.cjs → chunk-SAMJLDGG.cjs} +103 -103
  124. package/dist/{chunk-GKQU44SQ.cjs.map → chunk-SAMJLDGG.cjs.map} +1 -1
  125. package/dist/{chunk-DOVMTPKE.cjs → chunk-SE422RES.cjs} +27 -27
  126. package/dist/{chunk-DOVMTPKE.cjs.map → chunk-SE422RES.cjs.map} +1 -1
  127. package/dist/{chunk-5ELKD2FQ.cjs → chunk-UCHW2MGP.cjs} +330 -431
  128. package/dist/chunk-UCHW2MGP.cjs.map +1 -0
  129. package/dist/{chunk-Y6UA55YS.cjs → chunk-UDS5DZNY.cjs} +495 -1095
  130. package/dist/chunk-UDS5DZNY.cjs.map +1 -0
  131. package/dist/{chunk-VDYA2HMS.js → chunk-VWEFXG73.js} +3 -3
  132. package/dist/{chunk-VDYA2HMS.js.map → chunk-VWEFXG73.js.map} +1 -1
  133. package/dist/{chunk-KXFUQNF2.js → chunk-W66YCXWT.js} +463 -1047
  134. package/dist/chunk-W66YCXWT.js.map +1 -0
  135. package/dist/{chunk-NQBYTLPW.js → chunk-XMEYZYGE.js} +6 -6
  136. package/dist/{chunk-NQBYTLPW.js.map → chunk-XMEYZYGE.js.map} +1 -1
  137. package/dist/{chunk-G3CSQLLT.js → chunk-Y5UC3IXF.js} +461 -6
  138. package/dist/chunk-Y5UC3IXF.js.map +1 -0
  139. package/dist/{chunk-SDHV2MWU.js → chunk-YGX4PMG6.js} +5 -5
  140. package/dist/{chunk-SDHV2MWU.js.map → chunk-YGX4PMG6.js.map} +1 -1
  141. package/dist/{chunk-E2Q7SP2K.cjs → chunk-YIX3BEBR.cjs} +86 -85
  142. package/dist/chunk-YIX3BEBR.cjs.map +1 -0
  143. package/dist/{chunk-X6RDQ5NB.cjs → chunk-YX3H63VV.cjs} +8 -2
  144. package/dist/chunk-YX3H63VV.cjs.map +1 -0
  145. package/dist/chunk-YYLMXERH.js +211 -0
  146. package/dist/chunk-YYLMXERH.js.map +1 -0
  147. package/dist/{chunk-YPUNPG2T.js → chunk-ZE7E46IZ.js} +5 -5
  148. package/dist/{chunk-YPUNPG2T.js.map → chunk-ZE7E46IZ.js.map} +1 -1
  149. package/dist/{chunk-Z2PPIVOO.js → chunk-ZVME6OSV.js} +5 -5
  150. package/dist/{chunk-Z2PPIVOO.js.map → chunk-ZVME6OSV.js.map} +1 -1
  151. package/dist/core/index.cjs +15 -3
  152. package/dist/core/index.d.cts +4 -3
  153. package/dist/core/index.d.ts +4 -3
  154. package/dist/core/index.js +2 -2
  155. package/dist/{ddl-Dx3Z0_WC.d.ts → ddl-BLEzHw6j.d.ts} +3 -3
  156. package/dist/{ddl-J6sDyABg.d.cts → ddl-KnCdF_le.d.cts} +3 -3
  157. package/dist/{define-graph-CzEvA_8F.d.cts → define-graph-Cv3CFwKm.d.cts} +1 -1
  158. package/dist/{define-graph-DRo9xpYN.d.ts → define-graph-DQnj3fNH.d.ts} +1 -1
  159. package/dist/graph-merge/index.cjs +37 -38
  160. package/dist/graph-merge/index.cjs.map +1 -1
  161. package/dist/graph-merge/index.d.cts +6 -5
  162. package/dist/graph-merge/index.d.ts +6 -5
  163. package/dist/graph-merge/index.js +15 -16
  164. package/dist/graph-merge/index.js.map +1 -1
  165. package/dist/index.cjs +141 -117
  166. package/dist/index.d.cts +12 -10
  167. package/dist/index.d.ts +12 -10
  168. package/dist/index.js +22 -22
  169. package/dist/indexes/index.cjs +12 -14
  170. package/dist/indexes/index.d.cts +5 -5
  171. package/dist/indexes/index.d.ts +5 -5
  172. package/dist/indexes/index.js +5 -7
  173. package/dist/interchange/index.cjs +28 -29
  174. package/dist/interchange/index.cjs.map +1 -1
  175. package/dist/interchange/index.d.cts +6 -5
  176. package/dist/interchange/index.d.ts +6 -5
  177. package/dist/interchange/index.js +9 -10
  178. package/dist/interchange/index.js.map +1 -1
  179. package/dist/{manager-CASfhmzV.d.ts → manager-DjE6Mhag.d.ts} +2 -2
  180. package/dist/{manager-nCEJiYBb.d.cts → manager-mqee5MVB.d.cts} +2 -2
  181. package/dist/{postgres-DMgIKQU-.d.cts → postgres-Bm4DyFQU.d.cts} +100 -49
  182. package/dist/{postgres-Cl1ZAN1G.d.ts → postgres-DtaVALOZ.d.ts} +100 -49
  183. package/dist/profiler/index.d.cts +8 -7
  184. package/dist/profiler/index.d.ts +8 -7
  185. package/dist/provenance/index.cjs +19 -19
  186. package/dist/provenance/index.d.cts +6 -5
  187. package/dist/provenance/index.d.ts +6 -5
  188. package/dist/provenance/index.js +6 -6
  189. package/dist/schema/index.cjs +25 -27
  190. package/dist/schema/index.cjs.map +1 -1
  191. package/dist/schema/index.d.cts +5 -5
  192. package/dist/schema/index.d.ts +5 -5
  193. package/dist/schema/index.js +6 -8
  194. package/dist/schema/index.js.map +1 -1
  195. package/dist/{temporal-DqtOEo_B.d.ts → searchable-BxlJQVFw.d.cts} +3 -58
  196. package/dist/{temporal-BC_NQV5Y.d.cts → searchable-ChJ29MCd.d.ts} +3 -58
  197. package/dist/{sqlite-BDkW39aa.d.cts → sqlite-DT6tTHOG.d.cts} +124 -97
  198. package/dist/{sqlite-CYfhvESj.d.ts → sqlite-m9Izphk_.d.ts} +124 -97
  199. package/dist/{store-view-BJd6Vwpt.d.cts → store-view-C-buB8Q8.d.cts} +7 -14
  200. package/dist/{store-view-CLIhwMMX.d.ts → store-view-CagdeyNn.d.ts} +7 -14
  201. package/dist/temporal-CyFsSPe8.d.ts +73 -0
  202. package/dist/temporal-Dn_JADWY.d.cts +73 -0
  203. package/dist/{types-CUevi_D1.d.ts → types-CYdXzZef.d.ts} +1 -1
  204. package/dist/{types-COq3-vMC.d.cts → types-CqSfMRW3.d.cts} +1 -1
  205. package/dist/{where-C92TXCzT.d.cts → where-C3-HRgUq.d.cts} +1 -1
  206. package/dist/{where-BdE_cYtx.d.ts → where-sQL4u5h-.d.ts} +1 -1
  207. package/package.json +1 -1
  208. package/dist/chunk-3SK4SVTW.js.map +0 -1
  209. package/dist/chunk-3YFDFOYB.cjs.map +0 -1
  210. package/dist/chunk-5ELKD2FQ.cjs.map +0 -1
  211. package/dist/chunk-6SRLCSAV.cjs.map +0 -1
  212. package/dist/chunk-6XDBRDZE.js.map +0 -1
  213. package/dist/chunk-CBK2IVI2.js.map +0 -1
  214. package/dist/chunk-DDCIXXOO.js +0 -9
  215. package/dist/chunk-DDCIXXOO.js.map +0 -1
  216. package/dist/chunk-DDCYVIVV.cjs +0 -44
  217. package/dist/chunk-DDCYVIVV.cjs.map +0 -1
  218. package/dist/chunk-DOKUXLFH.js.map +0 -1
  219. package/dist/chunk-E2Q7SP2K.cjs.map +0 -1
  220. package/dist/chunk-EOJFGECD.cjs +0 -284
  221. package/dist/chunk-EOJFGECD.cjs.map +0 -1
  222. package/dist/chunk-FMNUSGZ4.cjs +0 -12
  223. package/dist/chunk-G3CSQLLT.js.map +0 -1
  224. package/dist/chunk-HTQOBY75.cjs.map +0 -1
  225. package/dist/chunk-I6FX7AAG.js +0 -39
  226. package/dist/chunk-I6FX7AAG.js.map +0 -1
  227. package/dist/chunk-IFDXG2YJ.js.map +0 -1
  228. package/dist/chunk-IFRPHG7O.js.map +0 -1
  229. package/dist/chunk-J6IJARLG.js +0 -94
  230. package/dist/chunk-J6IJARLG.js.map +0 -1
  231. package/dist/chunk-KXFUQNF2.js.map +0 -1
  232. package/dist/chunk-MTNEGGM2.js +0 -273
  233. package/dist/chunk-MTNEGGM2.js.map +0 -1
  234. package/dist/chunk-SVUKGWSN.cjs +0 -102
  235. package/dist/chunk-SVUKGWSN.cjs.map +0 -1
  236. package/dist/chunk-UH2USOMG.cjs +0 -627
  237. package/dist/chunk-UH2USOMG.cjs.map +0 -1
  238. package/dist/chunk-X6RDQ5NB.cjs.map +0 -1
  239. package/dist/chunk-Y6UA55YS.cjs.map +0 -1
  240. package/dist/chunk-Y7M44XEK.js +0 -462
  241. package/dist/chunk-Y7M44XEK.js.map +0 -1
  242. package/dist/chunk-Z5QHVL5U.cjs +0 -12
  243. package/dist/chunk-Z5QHVL5U.cjs.map +0 -1
  244. package/dist/chunk-ZKZAIX42.cjs +0 -479
  245. package/dist/chunk-ZKZAIX42.cjs.map +0 -1
  246. package/dist/{index-CrFL_ENI.d.cts → types-C5pZeKTl.d.cts} +1 -1
  247. package/dist/{index-Bq7vSPHy.d.ts → types-D8szWDUo.d.ts} +1 -1
package/dist/index.d.ts CHANGED
@@ -1,19 +1,21 @@
1
1
  export { DefineEdgeOptions, DefineNodeOptions, ExternalRefSchema, ExternalRefValue, MetaEdgeOptions, createExternalRef, defineEdge, defineNode, externalRef, getExternalRefTable, isExternalRefSchema, metaEdge } from './core/index.js';
2
- import { E as EmbeddingMetric, a as EmbeddingIndexType } from './temporal-DqtOEo_B.js';
3
- 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';
4
- import { G as GraphDef } from './define-graph-DRo9xpYN.js';
5
- export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from './define-graph-DRo9xpYN.js';
2
+ import { E as EmbeddingMetric, a as EmbeddingIndexType } from './searchable-ChJ29MCd.js';
3
+ export { D as DEFAULT_SEARCHABLE_LANGUAGE, b as EmbeddingSchema, c as EmbeddingValue, S as SearchableMetadata, d as SearchableOptions, e as SearchableSchema, f as embedding, g as getEmbeddingDimensions, h as getSearchableMetadata, i as isEmbeddingSchema, j as isSearchableSchema, r as resolveGraphVectorSlots, s as searchable } from './searchable-ChJ29MCd.js';
4
+ export { R as RecordedInstant, a as asRecordedInstant, c as compareRecordedInstants, r as recordedInstantRevision, b as recordedInstantWallTime } from './temporal-CyFsSPe8.js';
5
+ import { G as GraphDef } from './define-graph-DQnj3fNH.js';
6
+ export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from './define-graph-DQnj3fNH.js';
6
7
  import { a as NodeType, d as EdgeType } from './extension-types-BLEVH4SG.js';
7
8
  export { A as AnyEdgeType, C as CURRENT_GRAPH_EXTENSION_VERSION, 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, G as GraphExtension, k as GraphExtensionVersion, J as JsonValue, l as KindAnnotations, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, N as NodeRegistration, 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';
8
- import { V as VectorStrategy, G as GraphBackend, O as OntologyRelation, D as InferenceType, H as AggregateExpr, K as FieldRef, L as ComparisonOp, M as AggregateComparisonPredicate, T as TraversalDirection } from './index-Bq7vSPHy.js';
9
- export { A as AdapterBackend, P as AdapterBackendTransactions, B as BackendCapabilities, U as BackendIdentity, W as BackendLifecycle, X as BackendMaintenance, Y as BackendTransactions, Z as CommitSchemaVersionExpected, _ as CommitSchemaVersionParams, $ as CompiledRowsSql, a0 as CompiledSelectSql, a1 as CompiledStatementSql, a2 as ContributionMaterializationBackend, a3 as DEFAULT_SQL_SCHEMA, a4 as DeleteFulltextBatchParams, a5 as EdgeEntityReadBackend, a6 as EdgeEntityWriteBackend, a as EdgeIndexConfig, E as EdgeIndexDeclaration, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, a7 as ExternalRecordedReadSource, a8 as FilteredApproximateSearch, a9 as FilteredApproximateSearchMode, aa as FulltextBatchRow, ab as FulltextCapabilities, ac as FulltextOperationBackend, ad as FulltextQueryMode, ae as FulltextSearchParams, af as FulltextSearchResult, F as FulltextStrategy, ag as GraphAnalyticsCapabilities, ah as GraphEntityReadBackend, ai as GraphEntityWriteBackend, aj as GraphLifecycleBackend, ak as HybridFusionOptions, I as IndexDeclaration, al as IndexMaterializationBackend, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, am as IntentSql, J as JsonPointer, an as JsonPointerFor, ao as JsonPointerInput, ap as JsonPointerSegment, aq as JsonPointerSegments, ar as JsonPointerSegmentsFor, as as MAX_JSON_POINTER_DEPTH, at as MetaEdge, au as MetaEdgeProperties, av as NodeEntityReadBackend, aw as NodeEntityWriteBackend, i as NodeIndexConfig, N as NodeIndexDeclaration, j as NodeIndexWhereBuilder, ax as OrderSpec, ay as ParameterRef, az as Placeholder, aA as QueryExecutionBackend, aB as RawQueryExecutionBackend, aC as RawStatementExecutionBackend, aD as RecordedRelationOptions, aE as RemovalMaterializationBackend, aF as RenderedSql, aG as ResolveJsonPointer, aH as ResolveJsonPointerSegments, aI as ResolvedSqlTableNames, aJ as RowProps, aK as SchemaCommitBackend, aL as SchemaReadBackend, C as SchemaVersionRow, aM as SetActiveVersionParams, aN as SortDirection, aO as SqlChunk, S as SqlDialect, aP as SqlFragment, aQ as SqlIdentifierChunk, aR as SqlIntent, aS as SqlParameterChunk, aT as SqlPlaceholderChunk, aU as SqlSchema, aV as SqlTableNames, aW as SqlTag, aX as SqlTextChunk, aY as StrategyTableContribution, aZ as TableContribution, a_ as TransactionBackend, a$ as TransactionOptions, b0 as TransactionReadBackend, b1 as TraversalExpansion, b2 as TrustedImportSession, b3 as UniqueConstraintBackend, b4 as UpsertFulltextBatchParams, b5 as VectorCapabilities, b6 as VectorOperationBackend, p as VectorSlot, b7 as buildVectorCapabilities, b8 as createSqlSchema, b9 as fts5Strategy, ba as isMetaEdge, bb as isSqlFragment, bc as joinJsonPointers, bd as jsonPointer, be as normalizeJsonPointer, bf as parseJsonPointer, bg as recordedRelation, bh as renderPostgres, bi as renderSql, bj as renderSqlInline, bk as renderSqlite, bl as rowPropsToJsonText, bm as rowPropsToObject, bn as sql, bo as tsvectorStrategy } from './index-Bq7vSPHy.js';
9
+ import { V as VectorStrategy, G as GraphBackend, O as OntologyRelation, D as InferenceType, H as AggregateExpr, K as FieldRef, L as ComparisonOp, M as AggregateComparisonPredicate, T as TraversalDirection } from './types-D8szWDUo.js';
10
+ export { A as AdapterBackend, P as AdapterBackendTransactions, B as BackendCapabilities, U as BackendIdentity, W as BackendLifecycle, X as BackendMaintenance, Y as BackendTransactions, Z as CommitSchemaVersionExpected, _ as CommitSchemaVersionParams, $ as CompiledRowsSql, a0 as CompiledSelectSql, a1 as CompiledStatementSql, a2 as ContributionMaterializationBackend, a3 as DEFAULT_SQL_SCHEMA, a4 as DeleteFulltextBatchParams, a5 as EdgeEntityReadBackend, a6 as EdgeEntityWriteBackend, a as EdgeIndexConfig, E as EdgeIndexDeclaration, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, a7 as ExternalRecordedReadSource, a8 as FilteredApproximateSearch, a9 as FilteredApproximateSearchMode, aa as FulltextBatchRow, ab as FulltextCapabilities, ac as FulltextOperationBackend, ad as FulltextQueryMode, ae as FulltextSearchParams, af as FulltextSearchResult, F as FulltextStrategy, ag as GraphAnalyticsCapabilities, ah as GraphEntityReadBackend, ai as GraphEntityWriteBackend, aj as GraphLifecycleBackend, ak as HybridFusionOptions, I as IndexDeclaration, al as IndexMaterializationBackend, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, am as IntentSql, J as JsonPointer, an as JsonPointerFor, ao as JsonPointerInput, ap as JsonPointerSegment, aq as JsonPointerSegments, ar as JsonPointerSegmentsFor, as as MAX_JSON_POINTER_DEPTH, at as MetaEdge, au as MetaEdgeProperties, av as NodeEntityReadBackend, aw as NodeEntityWriteBackend, i as NodeIndexConfig, N as NodeIndexDeclaration, j as NodeIndexWhereBuilder, ax as OrderSpec, ay as ParameterRef, az as Placeholder, aA as QueryExecutionBackend, aB as RawQueryExecutionBackend, aC as RawStatementExecutionBackend, aD as RecordedRelationOptions, aE as RemovalMaterializationBackend, aF as RenderedSql, aG as ResolveJsonPointer, aH as ResolveJsonPointerSegments, aI as ResolvedSqlTableNames, aJ as RowProps, aK as SchemaCommitBackend, aL as SchemaReadBackend, C as SchemaVersionRow, aM as SetActiveVersionParams, aN as SortDirection, aO as SqlChunk, S as SqlDialect, aP as SqlFragment, aQ as SqlIdentifierChunk, aR as SqlIntent, aS as SqlParameterChunk, aT as SqlPlaceholderChunk, aU as SqlSchema, aV as SqlTableNames, aW as SqlTag, aX as SqlTextChunk, aY as StrategyTableContribution, aZ as TableContribution, a_ as TransactionBackend, a$ as TransactionOptions, b0 as TransactionReadBackend, b1 as TraversalExpansion, b2 as TrustedImportSession, b3 as UniqueConstraintBackend, b4 as UpsertFulltextBatchParams, b5 as VectorCapabilities, b6 as VectorOperationBackend, p as VectorSlot, b7 as buildVectorCapabilities, b8 as createSqlSchema, b9 as fts5Strategy, ba as isMetaEdge, bb as isSqlFragment, bc as joinJsonPointers, bd as jsonPointer, be as normalizeJsonPointer, bf as parseJsonPointer, bg as recordedRelation, bh as renderPostgres, bi as renderSql, bj as renderSqlInline, bk as renderSqlite, bl as rowPropsToJsonText, bm as rowPropsToObject, bn as sql, bo as tsvectorStrategy } from './types-D8szWDUo.js';
11
+ export { DeleteLegacyRecordedAnchorMapOptions, MigrateLegacyRecordedTimeOptions, MigrateLegacyRecordedTimeResult, MigrateRecordedAnchorOptions, deleteLegacyRecordedAnchorMap, migrateLegacyRecordedTime, migrateRecordedAnchor } from './backend/index.js';
10
12
  export { B as BackendDisposedError, C as CardinalityError, b as CardinalityErrorDetails, c as CompilerInvariantError, d as ConfigurationError, D as DatabaseOperationError, e as DatabaseOperationErrorDetails, f as DisjointError, g as DisjointErrorDetails, E as EagerMaterializationError, h as EagerMaterializationErrorDetails, i as EdgeNotFoundError, j as EdgeNotFoundErrorDetails, k as EmbeddingDimensionChangedError, l as EmbeddingDimensionChangedErrorDetails, m as EndpointError, n as EndpointErrorDetails, o as EndpointNotFoundError, p as EndpointNotFoundErrorDetails, q as ErrorCategory, G as GraphAlgorithmConvergenceError, I as InvalidEdgeWeightError, r as InvalidEdgeWeightErrorDetails, s as InvalidEdgeWeightReason, K as KindNotFoundError, t as KindNotFoundErrorDetails, M as MigrationError, u as MigrationErrorDetails, N as NodeConstraintNotFoundError, v as NodeConstraintNotFoundErrorDetails, w as NodeIndexNotFoundError, x as NodeIndexNotFoundErrorDetails, y as NodeNotFoundError, z as NodeNotFoundErrorDetails, R as RECORDED_CAPTURE_GUARD_CODES, A as RecordedCaptureGuardCode, F as RecordedCaptureGuardError, H as RestrictedDeleteError, J as RestrictedDeleteErrorDetails, S as SchemaContentConflictError, L as SchemaContentConflictErrorDetails, O as SchemaMismatchError, P as SchemaMismatchErrorDetails, Q as StaleVersionError, T as StaleVersionErrorDetails, U as StoreNotInitializedError, W as StoreNotInitializedErrorDetails, X as StoreNotInitializedReason, Y as TransactionClosedError, Z as TrustedImportError, _ as TrustedImportErrorReason, $ as TypeGraphError, a0 as TypeGraphErrorOptions, a1 as UniquenessError, a2 as UniquenessErrorDetails, a3 as UnsupportedBackendCapabilityError, a4 as UnsupportedPredicateError, a as ValidationError, a5 as ValidationErrorDetails, V as ValidationIssue, a6 as VersionConflictError, a7 as VersionConflictErrorDetails, a8 as getErrorSuggestion, a9 as isConstraintError, aa as isRecordedCaptureGuardError, ab as isSystemError, ac as isTypeGraphError, ad as isUserRecoverable } from './index-BD_3TCgh.js';
11
- import { A as AliasMap, E as EdgeAliasMap, d as RecursiveAliasMap, Q as QueryCoordinateState, e as QueryBuilder, f as EmptyRecursiveAliasMap, T as TraversalBuilder } from './store-view-CLIhwMMX.js';
12
- export { g as AdapterHistoryStore, h as AdapterHistoryTransactionContext, i as AdapterRecordedReadStore, j as AdapterStore, k as AdapterTransactionContext, l as AggregateResult, m as AlgorithmCyclePolicy, n as AnyEdge, o as AnyNode, B as BaseStoreOptions, p as BaseTraversalOptions, q as BatchResults, r as BatchableQuery, C as ConstraintNames, s as CreateEdgeInput, t as CreateNodeInput, D as DegreeOptions, u as DynamicEdgeAccessor, v as DynamicEdgeCollection, w as DynamicEdgeType, x as DynamicFieldBuilder, y as DynamicNodeAccessor, z as DynamicNodeCollection, F as DynamicNodeType, G as DynamicSelectableEdge, I as DynamicSelectableNode, J as Edge, K as EdgeAccessor, M as EdgeBatchReads, N as EdgeCollection, O as EdgeFindByEndpointsOptions, P as EdgeGetOrCreateByEndpointsOptions, V as EdgeGetOrCreateByEndpointsResult, W as EdgeIntrospection, X as EdgeTemporalReads, Y as EdgeWrites, Z as EmptyAliasMap, _ as EmptyEdgeAliasMap, $ as ExecutableAggregateQuery, a0 as ExecutableQuery, a1 as FieldAccessor, a2 as FulltextSearchHit, a3 as FulltextSearchOptions, a4 as GetOrCreateAction, a5 as GraphAlgorithms, a6 as GraphEdgeCollections, a7 as GraphNodeCollections, b as HistoryStore, a8 as HistoryStoreBackend, H as HistoryStoreOptions, a9 as HookContext, aa as HybridFulltextOptions, ab as HybridSearchHit, ac as HybridSearchOptions, ad as HybridVectorOptions, ae as IfExistsMode, af as InitialQueryBuilder, ag as KindIntrospection, ah as LabelPropagationMembership, ai as LabelPropagationOptions, L as LiveStoreOptions, aj as MaterializeRemovalsEntry, ak as MaterializeRemovalsOptions, al as MaterializeRemovalsResult, am as MeasurableAdapterHistoryTransactionContext, an as MeasurableAdapterTransactionContext, ao as MeasurableTransactionContext, ap as NeighborsOptions, aq as NoRecordedCoordinate, ar as Node, as as NodeAccessor, at as NodeAlias, au as NodeBulkFindByIndexOptions, av as NodeCollection, aw as NodeCurrentReads, ax as NodeGetOrCreateByConstraintOptions, ay as NodeGetOrCreateByConstraintResult, az as NodeIdentifier, aA as NodeRef, aB as NodeTemporalReads, aC as NodeWrites, aD as OntologyIntrospection, aE as OperationHookContext, aF as PageRankOptions, aG as PageRankScore, aH as PaginateOptions, aI as PaginatedResult, aJ as PathNode, aK as PersonalizedPageRankOptions, aL as PersonalizedPageRankSeed, aM as Predicate, aN as PreparedQuery, aO as PropsAccessor, aP as QueryHookContext, aQ as QueryOptions, aR as ReachableNode, aS as ReachableOptions, aT as RebuildFulltextOptions, aU as RebuildFulltextResult, aV as ReclaimedVectorFieldEntry, c as RecordedReadStore, R as RecordedReadStoreOptions, aW as RecordedScanOptions, aX as RecordedScanPage, aY as RecordedStoreView, aZ as RecordedStoreViewEdgeCollection, a_ as RecordedStoreViewEdgeCollections, a$ as RecordedStoreViewNodeCollection, b0 as RecordedStoreViewNodeCollections, b1 as RecursiveTraversalOptions, b2 as ReembedFunction, b3 as ReembedVectorFieldOptions, b4 as ReembedVectorFieldResult, b5 as SchemaIntrospection, b6 as ScopedMeasure, b7 as SearchScopeOptions, b8 as SelectContext, b9 as SelectableEdge, ba as SelectableNode, bb as ShortestPathOptions, bc as ShortestPathResult, bd as SqlAvailability, a as Store, be as StoreHooks, S as StoreOptions, bf as StoreProjection, bg as StoreRef, bh as StoreSearch, bi as StoreView, bj as StoreViewCanReachOptions, bk as StoreViewCoordinate, bl as StoreViewDegreeOptions, bm as StoreViewEdgeCollection, bn as StoreViewEdgeCollections, bo as StoreViewGraphAlgorithms, bp as StoreViewLabelPropagationOptions, bq as StoreViewNeighborsOptions, br as StoreViewNodeCollection, bs as StoreViewNodeCollections, bt as StoreViewPageRankOptions, bu as StoreViewPersonalizedPageRankOptions, bv as StoreViewReachableOptions, bw as StoreViewShortestPathOptions, bx as StoreViewSubgraphOptions, by as StoreViewWeaklyConnectedComponentsOptions, bz as StoreViewWeightedShortestPathOptions, bA as StreamOptions, bB as SubgraphEdgeResult, bC as SubgraphNodeResult, bD as SubgraphOptions, bE as SubgraphResult, bF as SubsetEdge, bG as SubsetNode, bH as TemporalAlgorithmOptions, bI as TransactionContext, bJ as TransactionOutcome, bK as TransactionReceipt, bL as TraversalDirection, bM as TypedEdgeCollection, bN as TypedRecordedStoreViewEdgeCollection, bO as TypedStoreViewEdgeCollection, U as UnboundLiveStoreOptions, bP as UnionableQuery, bQ as UniqueIntrospection, bR as UpdateEdgeInput, bS as UpdateNodeInput, bT as VectorSearchHit, bU as VectorSearchOptions, bV as WeaklyConnectedComponentMembership, bW as WeaklyConnectedComponentsOptions, bX as WeightedShortestPathOptions, bY as WeightedShortestPathResult, bZ as createAdapterStore, b_ as createAdapterStoreWithSchema, b$ as createQueryBuilder, c0 as createStore, c1 as createStoreWithSchema, c2 as createVerifiedAdapterStore, c3 as createVerifiedStore, c4 as defineSubgraphProject, c5 as exists, c6 as fieldRef, c7 as inSubquery, c8 as isParameterRef, c9 as notExists, ca as notInSubquery, cb as param } from './store-view-CLIhwMMX.js';
13
+ import { A as AliasMap, E as EdgeAliasMap, d as RecursiveAliasMap, Q as QueryCoordinateState, e as QueryBuilder, f as EmptyRecursiveAliasMap, T as TraversalBuilder } from './store-view-CagdeyNn.js';
14
+ export { g as AdapterHistoryStore, h as AdapterHistoryTransactionContext, i as AdapterRecordedReadStore, j as AdapterStore, k as AdapterTransactionContext, l as AggregateResult, m as AlgorithmCyclePolicy, n as AnyEdge, o as AnyNode, B as BaseStoreOptions, p as BaseTraversalOptions, q as BatchResults, r as BatchableQuery, C as ConstraintNames, s as CreateEdgeInput, t as CreateNodeInput, D as DegreeOptions, u as DynamicEdgeAccessor, v as DynamicEdgeCollection, w as DynamicEdgeType, x as DynamicFieldBuilder, y as DynamicNodeAccessor, z as DynamicNodeCollection, F as DynamicNodeType, G as DynamicSelectableEdge, I as DynamicSelectableNode, J as Edge, K as EdgeAccessor, M as EdgeBatchReads, N as EdgeCollection, O as EdgeFindByEndpointsOptions, P as EdgeGetOrCreateByEndpointsOptions, V as EdgeGetOrCreateByEndpointsResult, W as EdgeIntrospection, X as EdgeTemporalReads, Y as EdgeWrites, Z as EmptyAliasMap, _ as EmptyEdgeAliasMap, $ as ExecutableAggregateQuery, a0 as ExecutableQuery, a1 as FieldAccessor, a2 as FulltextSearchHit, a3 as FulltextSearchOptions, a4 as GetOrCreateAction, a5 as GraphAlgorithms, a6 as GraphEdgeCollections, a7 as GraphNodeCollections, b as HistoryStore, a8 as HistoryStoreBackend, H as HistoryStoreOptions, a9 as HookContext, aa as HybridFulltextOptions, ab as HybridSearchHit, ac as HybridSearchOptions, ad as HybridVectorOptions, ae as IfExistsMode, af as InitialQueryBuilder, ag as KindIntrospection, ah as LabelPropagationMembership, ai as LabelPropagationOptions, L as LiveStoreOptions, aj as MaterializeRemovalsEntry, ak as MaterializeRemovalsOptions, al as MaterializeRemovalsResult, am as MeasurableAdapterHistoryTransactionContext, an as MeasurableAdapterTransactionContext, ao as MeasurableTransactionContext, ap as NeighborsOptions, aq as NoRecordedCoordinate, ar as Node, as as NodeAccessor, at as NodeAlias, au as NodeBulkFindByIndexOptions, av as NodeCollection, aw as NodeCurrentReads, ax as NodeGetOrCreateByConstraintOptions, ay as NodeGetOrCreateByConstraintResult, az as NodeIdentifier, aA as NodeRef, aB as NodeTemporalReads, aC as NodeWrites, aD as OntologyIntrospection, aE as OperationHookContext, aF as PageRankOptions, aG as PageRankScore, aH as PaginateOptions, aI as PaginatedResult, aJ as PathNode, aK as PersonalizedPageRankOptions, aL as PersonalizedPageRankSeed, aM as Predicate, aN as PreparedQuery, aO as PropsAccessor, aP as QueryHookContext, aQ as QueryOptions, aR as ReachableNode, aS as ReachableOptions, aT as RebuildFulltextOptions, aU as RebuildFulltextResult, aV as ReclaimedVectorFieldEntry, c as RecordedReadStore, R as RecordedReadStoreOptions, aW as RecordedScanOptions, aX as RecordedScanPage, aY as RecordedStoreView, aZ as RecordedStoreViewEdgeCollection, a_ as RecordedStoreViewEdgeCollections, a$ as RecordedStoreViewNodeCollection, b0 as RecordedStoreViewNodeCollections, b1 as RecursiveTraversalOptions, b2 as ReembedFunction, b3 as ReembedVectorFieldOptions, b4 as ReembedVectorFieldResult, b5 as SchemaIntrospection, b6 as ScopedMeasure, b7 as SearchScopeOptions, b8 as SelectContext, b9 as SelectableEdge, ba as SelectableNode, bb as ShortestPathOptions, bc as ShortestPathResult, bd as SqlAvailability, a as Store, be as StoreHooks, S as StoreOptions, bf as StoreProjection, bg as StoreRef, bh as StoreSearch, bi as StoreView, bj as StoreViewCanReachOptions, bk as StoreViewCoordinate, bl as StoreViewDegreeOptions, bm as StoreViewEdgeCollection, bn as StoreViewEdgeCollections, bo as StoreViewGraphAlgorithms, bp as StoreViewLabelPropagationOptions, bq as StoreViewNeighborsOptions, br as StoreViewNodeCollection, bs as StoreViewNodeCollections, bt as StoreViewPageRankOptions, bu as StoreViewPersonalizedPageRankOptions, bv as StoreViewReachableOptions, bw as StoreViewShortestPathOptions, bx as StoreViewSubgraphOptions, by as StoreViewWeaklyConnectedComponentsOptions, bz as StoreViewWeightedShortestPathOptions, bA as StreamOptions, bB as SubgraphEdgeResult, bC as SubgraphNodeResult, bD as SubgraphOptions, bE as SubgraphResult, bF as SubsetEdge, bG as SubsetNode, bH as TemporalAlgorithmOptions, bI as TransactionContext, bJ as TransactionOutcome, bK as TransactionReceipt, bL as TraversalDirection, bM as TypedEdgeCollection, bN as TypedRecordedStoreViewEdgeCollection, bO as TypedStoreViewEdgeCollection, U as UnboundLiveStoreOptions, bP as UnionableQuery, bQ as UniqueIntrospection, bR as UpdateEdgeInput, bS as UpdateNodeInput, bT as VectorSearchHit, bU as VectorSearchOptions, bV as WeaklyConnectedComponentMembership, bW as WeaklyConnectedComponentsOptions, bX as WeightedShortestPathOptions, bY as WeightedShortestPathResult, bZ as createAdapterStore, b_ as createAdapterStoreWithSchema, b$ as createQueryBuilder, c0 as createStore, c1 as createStoreWithSchema, c2 as createVerifiedAdapterStore, c3 as createVerifiedStore, c4 as defineSubgraphProject, c5 as exists, c6 as fieldRef, c7 as inSubquery, c8 as isParameterRef, c9 as notExists, ca as notInSubquery, cb as param } from './store-view-CagdeyNn.js';
13
15
  export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult, c as MaterializeSystemIndexesOptions } from './materialize-indexes-D4iei4Kp.js';
14
- export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, n as notWhere, o as orWhere } from './where-BdE_cYtx.js';
16
+ export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, n as notWhere, o as orWhere } from './where-sQL4u5h-.js';
15
17
  export { GraphExtensionError, GraphExtensionIssue, GraphExtensionIssueCode, GraphExtensionUnresolvedEndpointError, GraphExtensionValidationError, GraphExtensionVersionUnsupportedError, IncompatibleChange, IncompatibleChangeError, KindCollisionError, KindHasReferentsError, KindReferent, RemoveCompileTimeKindError, defineGraphExtension, validateGraphExtension } from './graph-extension/index.js';
16
- export { S as SchemaManagerOptions, d as SchemaValidationResult } from './manager-CASfhmzV.js';
18
+ export { S as SchemaManagerOptions, d as SchemaValidationResult } from './manager-DjE6Mhag.js';
17
19
  import 'zod';
18
20
  import './result-DWo6mUVz.js';
19
21
 
package/dist/index.js CHANGED
@@ -1,36 +1,36 @@
1
- export { ExecutableAggregateQuery, ExecutableQuery, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, PreparedQuery, QueryBuilder, RecordedStoreView, StoreSearch, StoreView, UnionableQuery, avg, composeFragments, count, countDistinct, countDistinctEdges, countEdges, createAdapterStore, createAdapterStoreWithSchema, createFragment, createQueryBuilder, createStore, createStoreWithSchema, createVerifiedAdapterStore, createVerifiedStore, defineSubgraphProject, field, having, havingEq, havingGt, havingGte, havingLt, havingLte, limitFragment, max, min, offsetFragment, orderByFragment, sum } from './chunk-CBK2IVI2.js';
1
+ export { ExecutableAggregateQuery, ExecutableQuery, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, PreparedQuery, QueryBuilder, RecordedStoreView, StoreSearch, StoreView, UnionableQuery, avg, composeFragments, count, countDistinct, countDistinctEdges, countEdges, createAdapterStore, createAdapterStoreWithSchema, createFragment, createQueryBuilder, createStore, createStoreWithSchema, createVerifiedAdapterStore, createVerifiedStore, defineSubgraphProject, field, having, havingEq, havingGt, havingGte, havingLt, havingLte, limitFragment, max, min, offsetFragment, orderByFragment, sum } from './chunk-3BL3JFHL.js';
2
2
  import './chunk-DRACN6XG.js';
3
- export { sqliteVecStrategy } from './chunk-X6CNEA32.js';
4
- export { libsqlVectorStrategy } from './chunk-ERZ4QPQX.js';
5
- export { pgvectorStrategy } from './chunk-SDHV2MWU.js';
6
- import './chunk-EZH7FNUS.js';
7
- import { LEGACY_EMBEDDINGS_TABLE_NAME } from './chunk-MTNEGGM2.js';
8
- import './chunk-AOL64O4Z.js';
9
- import './chunk-Z2PPIVOO.js';
3
+ export { sqliteVecStrategy } from './chunk-BUZWMDNL.js';
4
+ export { libsqlVectorStrategy } from './chunk-K6CD6W5J.js';
5
+ export { pgvectorStrategy } from './chunk-YGX4PMG6.js';
6
+ import './chunk-6QP4QXBR.js';
7
+ import './chunk-L3DDZUZP.js';
8
+ export { deleteLegacyRecordedAnchorMap, migrateLegacyRecordedTime, migrateRecordedAnchor } from './chunk-ELA3V6UN.js';
9
+ import { LEGACY_EMBEDDINGS_TABLE_NAME } from './chunk-5J4VNCUD.js';
10
+ import './chunk-ZVME6OSV.js';
10
11
  export { createExternalRef, externalRef, getExternalRefTable, isExternalRefSchema, metaEdge } from './chunk-3LKL3S6X.js';
11
- import './chunk-3SK4SVTW.js';
12
- export { DEFAULT_SQL_SCHEMA, createSqlSchema, exists, fieldRef, generateId, inSubquery, isParameterRef, notExists, notInSubquery, param, recordedRelation } from './chunk-IFDXG2YJ.js';
12
+ import './chunk-53BSOG3O.js';
13
+ export { exists, fieldRef, generateId, inSubquery, isParameterRef, notExists, notInSubquery, param } from './chunk-JHK6NPFV.js';
13
14
  import './chunk-35S6P5ZU.js';
14
- export { rowPropsToJsonText, rowPropsToObject } from './chunk-PZHC5GCD.js';
15
- export { asRecordedInstant } from './chunk-J6IJARLG.js';
16
- export { broader, core, differentFrom, disjointWith, equivalentTo, hasPart, implies, inverseOf, narrower, partOf, relatedTo, sameAs, subClassOf } from './chunk-SU7VQOJ3.js';
15
+ export { DEFAULT_SQL_SCHEMA, createSqlSchema, recordedRelation } from './chunk-YYLMXERH.js';
16
+ export { rowPropsToJsonText, rowPropsToObject } from './chunk-L5ET7FYQ.js';
17
+ export { asRecordedInstant, compareRecordedInstants, recordedInstantRevision, recordedInstantWallTime } from './chunk-QOHTVDHU.js';
18
+ export { broader, core, differentFrom, disjointWith, equivalentTo, hasPart, implies, inverseOf, narrower, partOf, relatedTo, sameAs, subClassOf } from './chunk-CU3LPYNB.js';
17
19
  export { defineEdge, defineNode, isMetaEdge } from './chunk-76HE7DJP.js';
18
20
  import './chunk-ZE6NVENI.js';
19
21
  import './chunk-UR7W5YQK.js';
20
22
  import { isMissingTableError } from './chunk-UUIBACKJ.js';
21
23
  export { asEdgeId, asNodeId, defineGraph, getEdgeKinds, getNodeKinds, isEdgeType, isEdgeTypeWithEndpoints, isGraphDef, isNodeType } from './chunk-PH4IJ3V5.js';
22
- import './chunk-I6FX7AAG.js';
24
+ import './chunk-3SHAUJRB.js';
23
25
  export { andWhere, notWhere, orWhere } from './chunk-QZ7A6HBM.js';
24
- import './chunk-U4JDJKPD.js';
25
- export { SYSTEM_INDEX_DECLARATIONS } from './chunk-BQITNFQJ.js';
26
- export { defineEdgeIndex, defineNodeIndex } from './chunk-VDYA2HMS.js';
26
+ import './chunk-2I3DNNBU.js';
27
+ export { SYSTEM_INDEX_DECLARATIONS } from './chunk-AQVDAKXH.js';
28
+ export { defineEdgeIndex, defineNodeIndex } from './chunk-VWEFXG73.js';
27
29
  import './chunk-K34OPSJK.js';
28
30
  import './chunk-2EBMPJBO.js';
29
- import './chunk-G3CSQLLT.js';
30
- import './chunk-DDCIXXOO.js';
31
- export { buildVectorCapabilities, fts5Strategy, tsvectorStrategy } from './chunk-Y7M44XEK.js';
32
- import { sql, asCompiledRowsSql } from './chunk-6XDBRDZE.js';
33
- export { Placeholder, isSqlFragment, renderPostgres, renderSql, renderSqlInline, renderSqlite, sql } from './chunk-6XDBRDZE.js';
31
+ export { buildVectorCapabilities, fts5Strategy, tsvectorStrategy } from './chunk-Y5UC3IXF.js';
32
+ import { sql, asCompiledRowsSql } from './chunk-6N7QBIWN.js';
33
+ export { Placeholder, isSqlFragment, renderPostgres, renderSql, renderSqlInline, renderSqlite, sql } from './chunk-6N7QBIWN.js';
34
34
  import './chunk-D7PG5D5K.js';
35
35
  import './chunk-SNXVDZAJ.js';
36
36
  import { requireDefined } from './chunk-QMQLUA66.js';
@@ -1,15 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkUWG5GX6E_cjs = require('../chunk-UWG5GX6E.cjs');
4
- var chunkCWX77JB4_cjs = require('../chunk-CWX77JB4.cjs');
5
- var chunkGUUWKPTK_cjs = require('../chunk-GUUWKPTK.cjs');
6
- var chunk7M3NACL3_cjs = require('../chunk-7M3NACL3.cjs');
4
+ var chunkKLR77R5A_cjs = require('../chunk-KLR77R5A.cjs');
5
+ var chunkLLE25NRD_cjs = require('../chunk-LLE25NRD.cjs');
6
+ var chunkCKFBZ4LV_cjs = require('../chunk-CKFBZ4LV.cjs');
7
7
  require('../chunk-ZY4GXIVN.cjs');
8
8
  require('../chunk-NAUA4PW5.cjs');
9
- require('../chunk-UH2USOMG.cjs');
10
- require('../chunk-Z5QHVL5U.cjs');
11
- require('../chunk-ZKZAIX42.cjs');
12
- require('../chunk-X6RDQ5NB.cjs');
9
+ require('../chunk-HAQVISUF.cjs');
10
+ require('../chunk-YX3H63VV.cjs');
13
11
  require('../chunk-FJMPR3OH.cjs');
14
12
  require('../chunk-SJDMVITW.cjs');
15
13
  require('../chunk-764JHTLT.cjs');
@@ -41,31 +39,31 @@ Object.defineProperty(exports, "toDeclaredIndexes", {
41
39
  });
42
40
  Object.defineProperty(exports, "generateEdgeIndexDDL", {
43
41
  enumerable: true,
44
- get: function () { return chunkCWX77JB4_cjs.generateEdgeIndexDDL; }
42
+ get: function () { return chunkKLR77R5A_cjs.generateEdgeIndexDDL; }
45
43
  });
46
44
  Object.defineProperty(exports, "generateIndexDDL", {
47
45
  enumerable: true,
48
- get: function () { return chunkCWX77JB4_cjs.generateIndexDDL; }
46
+ get: function () { return chunkKLR77R5A_cjs.generateIndexDDL; }
49
47
  });
50
48
  Object.defineProperty(exports, "generateNodeIndexDDL", {
51
49
  enumerable: true,
52
- get: function () { return chunkCWX77JB4_cjs.generateNodeIndexDDL; }
50
+ get: function () { return chunkKLR77R5A_cjs.generateNodeIndexDDL; }
53
51
  });
54
52
  Object.defineProperty(exports, "SYSTEM_INDEX_DECLARATIONS", {
55
53
  enumerable: true,
56
- get: function () { return chunkGUUWKPTK_cjs.SYSTEM_INDEX_DECLARATIONS; }
54
+ get: function () { return chunkLLE25NRD_cjs.SYSTEM_INDEX_DECLARATIONS; }
57
55
  });
58
56
  Object.defineProperty(exports, "generateSystemIndexDDL", {
59
57
  enumerable: true,
60
- get: function () { return chunkGUUWKPTK_cjs.generateSystemIndexDDL; }
58
+ get: function () { return chunkLLE25NRD_cjs.generateSystemIndexDDL; }
61
59
  });
62
60
  Object.defineProperty(exports, "defineEdgeIndex", {
63
61
  enumerable: true,
64
- get: function () { return chunk7M3NACL3_cjs.defineEdgeIndex; }
62
+ get: function () { return chunkCKFBZ4LV_cjs.defineEdgeIndex; }
65
63
  });
66
64
  Object.defineProperty(exports, "defineNodeIndex", {
67
65
  enumerable: true,
68
- get: function () { return chunk7M3NACL3_cjs.defineNodeIndex; }
66
+ get: function () { return chunkCKFBZ4LV_cjs.defineNodeIndex; }
69
67
  });
70
68
  //# sourceMappingURL=index.cjs.map
71
69
  //# sourceMappingURL=index.cjs.map
@@ -1,9 +1,9 @@
1
- import { E as EdgeIndexDeclaration, S as SqlDialect, R as RelationalIndexDeclaration, N as NodeIndexDeclaration, I as IndexDeclaration } from '../index-CrFL_ENI.cjs';
2
- export { a as EdgeIndexConfig, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, i as NodeIndexConfig, j as NodeIndexWhereBuilder, k as SystemColumnName, l as VectorIndexDeclaration, m as VectorIndexImplementation, n as VectorIndexMetric, o as VectorIndexParams } from '../index-CrFL_ENI.cjs';
3
- export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, g as generateSystemIndexDDL, n as notWhere, o as orWhere } from '../where-C92TXCzT.cjs';
4
- import { D as DeclaredIndex } from '../types-COq3-vMC.cjs';
5
- import '../extension-types-BLEVH4SG.cjs';
1
+ import { E as EdgeIndexDeclaration, S as SqlDialect, R as RelationalIndexDeclaration, N as NodeIndexDeclaration, I as IndexDeclaration } from '../types-C5pZeKTl.cjs';
2
+ export { a as EdgeIndexConfig, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, i as NodeIndexConfig, j as NodeIndexWhereBuilder, k as SystemColumnName, l as VectorIndexDeclaration, m as VectorIndexImplementation, n as VectorIndexMetric, o as VectorIndexParams } from '../types-C5pZeKTl.cjs';
3
+ export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, g as generateSystemIndexDDL, n as notWhere, o as orWhere } from '../where-C3-HRgUq.cjs';
4
+ import { D as DeclaredIndex } from '../types-CqSfMRW3.cjs';
6
5
  import 'zod';
6
+ import '../extension-types-BLEVH4SG.cjs';
7
7
 
8
8
  type GenerateIndexDdlOptions = Readonly<{
9
9
  nodesTableName?: string | undefined;
@@ -1,9 +1,9 @@
1
- import { E as EdgeIndexDeclaration, S as SqlDialect, R as RelationalIndexDeclaration, N as NodeIndexDeclaration, I as IndexDeclaration } from '../index-Bq7vSPHy.js';
2
- export { a as EdgeIndexConfig, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, i as NodeIndexConfig, j as NodeIndexWhereBuilder, k as SystemColumnName, l as VectorIndexDeclaration, m as VectorIndexImplementation, n as VectorIndexMetric, o as VectorIndexParams } from '../index-Bq7vSPHy.js';
3
- export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, g as generateSystemIndexDDL, n as notWhere, o as orWhere } from '../where-BdE_cYtx.js';
4
- import { D as DeclaredIndex } from '../types-CUevi_D1.js';
5
- import '../extension-types-BLEVH4SG.js';
1
+ import { E as EdgeIndexDeclaration, S as SqlDialect, R as RelationalIndexDeclaration, N as NodeIndexDeclaration, I as IndexDeclaration } from '../types-D8szWDUo.js';
2
+ export { a as EdgeIndexConfig, b as EdgeIndexDirection, c as EdgeIndexWhereBuilder, d as IndexOrigin, e as IndexScope, f as IndexWhereExpression, g as IndexWhereFieldBuilder, h as IndexWhereInput, i as NodeIndexConfig, j as NodeIndexWhereBuilder, k as SystemColumnName, l as VectorIndexDeclaration, m as VectorIndexImplementation, n as VectorIndexMetric, o as VectorIndexParams } from '../types-D8szWDUo.js';
3
+ export { S as SYSTEM_INDEX_DECLARATIONS, a as SystemIndexDeclaration, b as SystemIndexTable, c as andWhere, d as defineEdgeIndex, e as defineNodeIndex, g as generateSystemIndexDDL, n as notWhere, o as orWhere } from '../where-sQL4u5h-.js';
4
+ import { D as DeclaredIndex } from '../types-CYdXzZef.js';
6
5
  import 'zod';
6
+ import '../extension-types-BLEVH4SG.js';
7
7
 
8
8
  type GenerateIndexDdlOptions = Readonly<{
9
9
  nodesTableName?: string | undefined;
@@ -1,13 +1,11 @@
1
1
  export { andWhere, notWhere, orWhere, toDeclaredIndex, toDeclaredIndexes } from '../chunk-QZ7A6HBM.js';
2
- export { generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL } from '../chunk-U4JDJKPD.js';
3
- export { SYSTEM_INDEX_DECLARATIONS, generateSystemIndexDDL } from '../chunk-BQITNFQJ.js';
4
- export { defineEdgeIndex, defineNodeIndex } from '../chunk-VDYA2HMS.js';
2
+ export { generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL } from '../chunk-2I3DNNBU.js';
3
+ export { SYSTEM_INDEX_DECLARATIONS, generateSystemIndexDDL } from '../chunk-AQVDAKXH.js';
4
+ export { defineEdgeIndex, defineNodeIndex } from '../chunk-VWEFXG73.js';
5
5
  import '../chunk-K34OPSJK.js';
6
6
  import '../chunk-2EBMPJBO.js';
7
- import '../chunk-G3CSQLLT.js';
8
- import '../chunk-DDCIXXOO.js';
9
- import '../chunk-Y7M44XEK.js';
10
- import '../chunk-6XDBRDZE.js';
7
+ import '../chunk-Y5UC3IXF.js';
8
+ import '../chunk-6N7QBIWN.js';
11
9
  import '../chunk-D7PG5D5K.js';
12
10
  import '../chunk-SNXVDZAJ.js';
13
11
  import '../chunk-QMQLUA66.js';
@@ -1,21 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkJD2YC62H_cjs = require('../chunk-JD2YC62H.cjs');
4
- require('../chunk-E2Q7SP2K.cjs');
5
- var chunk5ELKD2FQ_cjs = require('../chunk-5ELKD2FQ.cjs');
3
+ var chunkKHNKYSGP_cjs = require('../chunk-KHNKYSGP.cjs');
4
+ require('../chunk-YIX3BEBR.cjs');
5
+ var chunkUCHW2MGP_cjs = require('../chunk-UCHW2MGP.cjs');
6
6
  require('../chunk-ZDH3DX3C.cjs');
7
- require('../chunk-GNPGGLAE.cjs');
8
- require('../chunk-SVUKGWSN.cjs');
7
+ require('../chunk-JZYMOHHM.cjs');
8
+ require('../chunk-QYDUCWD2.cjs');
9
+ require('../chunk-LL5D5T5W.cjs');
9
10
  require('../chunk-X4PVHAZ6.cjs');
10
11
  require('../chunk-ACSVZPK7.cjs');
11
12
  require('../chunk-HP6LWBLB.cjs');
12
13
  require('../chunk-NT6ILURI.cjs');
13
- require('../chunk-DDCYVIVV.cjs');
14
+ require('../chunk-MNURF4RF.cjs');
14
15
  require('../chunk-NAUA4PW5.cjs');
15
- require('../chunk-UH2USOMG.cjs');
16
- require('../chunk-Z5QHVL5U.cjs');
17
- require('../chunk-ZKZAIX42.cjs');
18
- require('../chunk-X6RDQ5NB.cjs');
16
+ require('../chunk-HAQVISUF.cjs');
17
+ require('../chunk-YX3H63VV.cjs');
19
18
  require('../chunk-SJDMVITW.cjs');
20
19
  require('../chunk-764JHTLT.cjs');
21
20
  var chunkHAHNRASW_cjs = require('../chunk-HAHNRASW.cjs');
@@ -179,7 +178,7 @@ async function consumeTrustedChunks(store, session, chunks) {
179
178
  }
180
179
  async function trustedImportGraphStream(store, chunks) {
181
180
  rejectUnsupportedStoreFeatures(store);
182
- const backend = chunk5ELKD2FQ_cjs.storeBackend(store);
181
+ const backend = chunkUCHW2MGP_cjs.storeBackend(store);
183
182
  const trustedImport = backend.trustedImport;
184
183
  if (trustedImport === void 0) {
185
184
  throw new chunkSAFZ6JTI_cjs.TrustedImportError(
@@ -204,75 +203,75 @@ function trustedImportGraph(store, data) {
204
203
 
205
204
  Object.defineProperty(exports, "ConflictStrategySchema", {
206
205
  enumerable: true,
207
- get: function () { return chunkJD2YC62H_cjs.ConflictStrategySchema; }
206
+ get: function () { return chunkKHNKYSGP_cjs.ConflictStrategySchema; }
208
207
  });
209
208
  Object.defineProperty(exports, "ExportOptionsSchema", {
210
209
  enumerable: true,
211
- get: function () { return chunkJD2YC62H_cjs.ExportOptionsSchema; }
210
+ get: function () { return chunkKHNKYSGP_cjs.ExportOptionsSchema; }
212
211
  });
213
212
  Object.defineProperty(exports, "ExportStreamOptionsSchema", {
214
213
  enumerable: true,
215
- get: function () { return chunkJD2YC62H_cjs.ExportStreamOptionsSchema; }
214
+ get: function () { return chunkKHNKYSGP_cjs.ExportStreamOptionsSchema; }
216
215
  });
217
216
  Object.defineProperty(exports, "FORMAT_VERSION", {
218
217
  enumerable: true,
219
- get: function () { return chunkJD2YC62H_cjs.FORMAT_VERSION; }
218
+ get: function () { return chunkKHNKYSGP_cjs.FORMAT_VERSION; }
220
219
  });
221
220
  Object.defineProperty(exports, "GraphDataHeaderSchema", {
222
221
  enumerable: true,
223
- get: function () { return chunkJD2YC62H_cjs.GraphDataHeaderSchema; }
222
+ get: function () { return chunkKHNKYSGP_cjs.GraphDataHeaderSchema; }
224
223
  });
225
224
  Object.defineProperty(exports, "GraphDataSchema", {
226
225
  enumerable: true,
227
- get: function () { return chunkJD2YC62H_cjs.GraphDataSchema; }
226
+ get: function () { return chunkKHNKYSGP_cjs.GraphDataSchema; }
228
227
  });
229
228
  Object.defineProperty(exports, "GraphDataSourceSchema", {
230
229
  enumerable: true,
231
- get: function () { return chunkJD2YC62H_cjs.GraphDataSourceSchema; }
230
+ get: function () { return chunkKHNKYSGP_cjs.GraphDataSourceSchema; }
232
231
  });
233
232
  Object.defineProperty(exports, "GraphInterchangeChunkSchema", {
234
233
  enumerable: true,
235
- get: function () { return chunkJD2YC62H_cjs.GraphInterchangeChunkSchema; }
234
+ get: function () { return chunkKHNKYSGP_cjs.GraphInterchangeChunkSchema; }
236
235
  });
237
236
  Object.defineProperty(exports, "ImportErrorSchema", {
238
237
  enumerable: true,
239
- get: function () { return chunkJD2YC62H_cjs.ImportErrorSchema; }
238
+ get: function () { return chunkKHNKYSGP_cjs.ImportErrorSchema; }
240
239
  });
241
240
  Object.defineProperty(exports, "ImportOptionsSchema", {
242
241
  enumerable: true,
243
- get: function () { return chunkJD2YC62H_cjs.ImportOptionsSchema; }
242
+ get: function () { return chunkKHNKYSGP_cjs.ImportOptionsSchema; }
244
243
  });
245
244
  Object.defineProperty(exports, "ImportResultSchema", {
246
245
  enumerable: true,
247
- get: function () { return chunkJD2YC62H_cjs.ImportResultSchema; }
246
+ get: function () { return chunkKHNKYSGP_cjs.ImportResultSchema; }
248
247
  });
249
248
  Object.defineProperty(exports, "InterchangeEdgeSchema", {
250
249
  enumerable: true,
251
- get: function () { return chunkJD2YC62H_cjs.InterchangeEdgeSchema; }
250
+ get: function () { return chunkKHNKYSGP_cjs.InterchangeEdgeSchema; }
252
251
  });
253
252
  Object.defineProperty(exports, "InterchangeNodeSchema", {
254
253
  enumerable: true,
255
- get: function () { return chunkJD2YC62H_cjs.InterchangeNodeSchema; }
254
+ get: function () { return chunkKHNKYSGP_cjs.InterchangeNodeSchema; }
256
255
  });
257
256
  Object.defineProperty(exports, "UnknownPropertyStrategySchema", {
258
257
  enumerable: true,
259
- get: function () { return chunkJD2YC62H_cjs.UnknownPropertyStrategySchema; }
258
+ get: function () { return chunkKHNKYSGP_cjs.UnknownPropertyStrategySchema; }
260
259
  });
261
260
  Object.defineProperty(exports, "exportGraph", {
262
261
  enumerable: true,
263
- get: function () { return chunkJD2YC62H_cjs.exportGraph; }
262
+ get: function () { return chunkKHNKYSGP_cjs.exportGraph; }
264
263
  });
265
264
  Object.defineProperty(exports, "exportGraphStream", {
266
265
  enumerable: true,
267
- get: function () { return chunkJD2YC62H_cjs.exportGraphStream; }
266
+ get: function () { return chunkKHNKYSGP_cjs.exportGraphStream; }
268
267
  });
269
268
  Object.defineProperty(exports, "importGraph", {
270
269
  enumerable: true,
271
- get: function () { return chunkJD2YC62H_cjs.importGraph; }
270
+ get: function () { return chunkKHNKYSGP_cjs.importGraph; }
272
271
  });
273
272
  Object.defineProperty(exports, "importGraphStream", {
274
273
  enumerable: true,
275
- get: function () { return chunkJD2YC62H_cjs.importGraphStream; }
274
+ get: function () { return chunkKHNKYSGP_cjs.importGraphStream; }
276
275
  });
277
276
  exports.trustedImportGraph = trustedImportGraph;
278
277
  exports.trustedImportGraphStream = trustedImportGraphStream;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interchange/trusted-import.ts"],"names":["TrustedImportError","getSearchableFields","resolveGraphVectorSlots","storeBackend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,+BACP,KAAA,EACM;AACN,EAAA,IAAI,MAAM,cAAA,EAAgB;AACxB,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,gEAAA;AAAA,MACA,qBAAA;AAAA,MACA,EAAE,OAAA,EAAS,KAAA,CAAM,OAAA;AAAQ,KAC3B;AAAA,EACF;AACA,EAAA,IAAI,MAAM,uBAAA,EAAyB;AACjC,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,oDAAA;AAAA,MACA,+BAAA;AAAA,MACA,EAAE,OAAA,EAAS,KAAA,CAAM,OAAA;AAAQ,KAC3B;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,OAAO,MAAA,CAAO,KAAA,CAAM,MAAM,KAAK,CAAA,CAChD,OAAO,CAAC,YAAA,KAAA,CAAkB,aAAa,MAAA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C,EAAA,MAAM,gBAAgB,OAAA,CAAQ,aAAA;AAC9B,EAAA,IAAI,kBAAkB,MAAA,EAAW;AAC/B,IAAA,MAAM,IAAIH,oCAAA;AAAA,MACR,CAAA,IAAA,EAAO,QAAQ,OAAO,CAAA,yCAAA,CAAA;AAAA,MACtB,qBAAA;AAAA,MACA,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA;AAAQ,KAC7B;AAAA,EACF;AACA,EAAA,OAAO,aAAA;AAAA,IAAc,CAAC,OAAA,KACpB,oBAAA,CAAqB,KAAA,EAAO,SAAS,MAAM;AAAA,GAC7C;AACF;AAEA,UAAU,gBAAgB,IAAA,EAAkD;AAC1E,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,GAAG,QAAO,GAAI,IAAA;AACpC,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAU,MAAA,EAAO;AAC/B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAM;AAC7B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAM;AAC/B;AAGO,SAAS,kBAAA,CACd,OACA,IAAA,EAC8B;AAC9B,EAAA,OAAO,wBAAA,CAAyB,KAAA,EAAO,eAAA,CAAgB,IAAI,CAAC,CAAA;AAC9D","file":"index.cjs","sourcesContent":["import type {\n InsertEdgeParams,\n InsertNodeParams,\n TrustedImportSession,\n} from \"../backend/types\";\nimport type { GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { getSearchableFields } from \"../core/searchable\";\nimport { TrustedImportError } from \"../errors\";\nimport { storeBackend } from \"../store/runtime-port\";\nimport type { Store } from \"../store/store\";\nimport type {\n GraphData,\n GraphInterchangeChunk,\n InterchangeEdge,\n InterchangeNode,\n} from \"./types\";\n\n/** Counts committed by a trusted initial import. */\nexport type TrustedImportResult = Readonly<{\n nodes: number;\n edges: number;\n}>;\n\nfunction rejectUnsupportedStoreFeatures<G extends GraphDef>(\n store: Store<G>,\n): void {\n if (store.historyEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support recorded-time history capture.\",\n \"history_unsupported\",\n { graphId: store.graphId },\n );\n }\n if (store.revisionTrackingEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support revision tracking.\",\n \"revision_tracking_unsupported\",\n { graphId: store.graphId },\n );\n }\n\n const uniqueKinds = Object.values(store.graph.nodes)\n .filter((registration) => (registration.unique?.length ?? 0) > 0)\n .map((registration) => registration.type.kind);\n if (uniqueKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain node uniqueness sidecars.\",\n \"uniqueness_unsupported\",\n { graphId: store.graphId, nodeKinds: uniqueKinds },\n );\n }\n\n const searchableKinds = Object.values(store.graph.nodes)\n .filter(\n (registration) =>\n getSearchableFields(registration.type.schema).length > 0,\n )\n .map((registration) => registration.type.kind);\n if (searchableKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain fulltext sidecars.\",\n \"fulltext_unsupported\",\n { graphId: store.graphId, nodeKinds: searchableKinds },\n );\n }\n\n const vectorSlots = resolveGraphVectorSlots(store.graph);\n if (vectorSlots.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain vector sidecars.\",\n \"vector_unsupported\",\n {\n graphId: store.graphId,\n fields: vectorSlots.map((slot) => `${slot.nodeKind}.${slot.fieldPath}`),\n },\n );\n }\n}\n\nfunction invalidStream(message: string): TrustedImportError {\n return new TrustedImportError(message, \"invalid_stream\");\n}\n\nfunction nodeParams(graphId: string, node: InterchangeNode): InsertNodeParams {\n return {\n graphId,\n kind: node.kind,\n id: node.id,\n props: node.properties,\n ...(node.validFrom === undefined ? {} : { validFrom: node.validFrom }),\n ...(node.validTo === undefined ? {} : { validTo: node.validTo }),\n };\n}\n\nfunction edgeParams(graphId: string, edge: InterchangeEdge): InsertEdgeParams {\n return {\n graphId,\n id: edge.id,\n kind: edge.kind,\n fromKind: edge.from.kind,\n fromId: edge.from.id,\n toKind: edge.to.kind,\n toId: edge.to.id,\n props: edge.properties,\n ...(edge.validFrom === undefined ? {} : { validFrom: edge.validFrom }),\n ...(edge.validTo === undefined ? {} : { validTo: edge.validTo }),\n };\n}\n\nasync function consumeTrustedChunks<G extends GraphDef>(\n store: Store<G>,\n session: TrustedImportSession,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n const nodeKinds = new Set(\n Object.values(store.graph.nodes).map(\n (registration) => registration.type.kind,\n ),\n );\n const edgeKinds = new Set(\n Object.values(store.graph.edges).map(\n (registration) => registration.type.kind,\n ),\n );\n let receivedHeader = false;\n let receivedEdges = false;\n let nodeCount = 0;\n let edgeCount = 0;\n\n for await (const chunk of chunks) {\n switch (chunk.type) {\n case \"header\": {\n if (receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream emitted more than one header.\",\n );\n }\n receivedHeader = true;\n break;\n }\n case \"nodes\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n if (receivedEdges) {\n throw invalidStream(\n \"Trusted graph interchange stream cannot emit nodes after edges.\",\n );\n }\n const unknownKind = chunk.nodes.find(\n (node) => !nodeKinds.has(node.kind),\n )?.kind;\n if (unknownKind !== undefined) {\n throw invalidStream(\n `Unknown node kind in trusted import: ${unknownKind}`,\n );\n }\n await session.insertNodes(\n chunk.nodes.map((node) => nodeParams(store.graphId, node)),\n );\n nodeCount += chunk.nodes.length;\n break;\n }\n case \"edges\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n receivedEdges = true;\n const invalidEdge = chunk.edges.find(\n (edge) =>\n !edgeKinds.has(edge.kind) ||\n !nodeKinds.has(edge.from.kind) ||\n !nodeKinds.has(edge.to.kind),\n );\n if (invalidEdge !== undefined) {\n throw invalidStream(\n `Unknown edge or endpoint kind in trusted import: ${invalidEdge.kind}`,\n );\n }\n await session.insertEdges(\n chunk.edges.map((edge) => edgeParams(store.graphId, edge)),\n );\n edgeCount += chunk.edges.length;\n break;\n }\n }\n }\n\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream ended before emitting a header.\",\n );\n }\n return { nodes: nodeCount, edges: edgeCount };\n}\n\n/**\n * Atomically imports a header-first stream into a fresh, dedicated database.\n *\n * This is an intentionally trusted path. It checks stream ordering and kind\n * names, but it does not validate properties, references, cardinality, or\n * conflicts. The caller must guarantee those invariants. Use\n * {@link importGraphStream} for untrusted data.\n */\nexport async function trustedImportGraphStream<G extends GraphDef>(\n store: Store<G>,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n rejectUnsupportedStoreFeatures(store);\n const backend = storeBackend(store);\n const trustedImport = backend.trustedImport;\n if (trustedImport === undefined) {\n throw new TrustedImportError(\n `The ${backend.dialect} backend does not support trusted import.`,\n \"backend_unsupported\",\n { dialect: backend.dialect },\n );\n }\n return trustedImport((session) =>\n consumeTrustedChunks(store, session, chunks),\n );\n}\n\nfunction* graphDataChunks(data: GraphData): Iterable<GraphInterchangeChunk> {\n const { nodes, edges, ...header } = data;\n yield { type: \"header\", header };\n yield { type: \"nodes\", nodes };\n yield { type: \"edges\", edges };\n}\n\n/** In-memory convenience wrapper around {@link trustedImportGraphStream}. */\nexport function trustedImportGraph<G extends GraphDef>(\n store: Store<G>,\n data: GraphData,\n): Promise<TrustedImportResult> {\n return trustedImportGraphStream(store, graphDataChunks(data));\n}\n"]}
1
+ {"version":3,"sources":["../../src/interchange/trusted-import.ts"],"names":["TrustedImportError","getSearchableFields","resolveGraphVectorSlots","storeBackend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,+BACP,KAAA,EACM;AACN,EAAA,IAAI,MAAM,cAAA,EAAgB;AACxB,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,gEAAA;AAAA,MACA,qBAAA;AAAA,MACA,EAAE,O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"../backend/types\";\nimport type { GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { getSearchableFields } from \"../core/searchable\";\nimport { TrustedImportError } from \"../errors\";\nimport { storeBackend } from \"../store/runtime-port\";\nimport type { Store } from \"../store/store\";\nimport type {\n GraphData,\n GraphInterchangeChunk,\n InterchangeEdge,\n InterchangeNode,\n} from \"./types\";\n\n/** Counts committed by a trusted initial import. */\nexport type TrustedImportResult = Readonly<{\n nodes: number;\n edges: number;\n}>;\n\nfunction rejectUnsupportedStoreFeatures<G extends GraphDef>(\n store: Store<G>,\n): void {\n if (store.historyEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support recorded-time history capture.\",\n \"history_unsupported\",\n { graphId: store.graphId },\n );\n }\n if (store.revisionTrackingEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support revision tracking.\",\n \"revision_tracking_unsupported\",\n { graphId: store.graphId },\n );\n }\n\n const uniqueKinds = Object.values(store.graph.nodes)\n .filter((registration) => (registration.unique?.length ?? 0) > 0)\n .map((registration) => registration.type.kind);\n if (uniqueKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain node uniqueness sidecars.\",\n \"uniqueness_unsupported\",\n { graphId: store.graphId, nodeKinds: uniqueKinds },\n );\n }\n\n const searchableKinds = Object.values(store.graph.nodes)\n .filter(\n (registration) =>\n getSearchableFields(registration.type.schema).length > 0,\n )\n .map((registration) => registration.type.kind);\n if (searchableKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain fulltext sidecars.\",\n \"fulltext_unsupported\",\n { graphId: store.graphId, nodeKinds: searchableKinds },\n );\n }\n\n const vectorSlots = resolveGraphVectorSlots(store.graph);\n if (vectorSlots.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain vector sidecars.\",\n \"vector_unsupported\",\n {\n graphId: store.graphId,\n fields: vectorSlots.map((slot) => `${slot.nodeKind}.${slot.fieldPath}`),\n },\n );\n }\n}\n\nfunction invalidStream(message: string): TrustedImportError {\n return new TrustedImportError(message, \"invalid_stream\");\n}\n\nfunction nodeParams(graphId: string, node: InterchangeNode): InsertNodeParams {\n return {\n graphId,\n kind: node.kind,\n id: node.id,\n props: node.properties,\n ...(node.validFrom === undefined ? {} : { validFrom: node.validFrom }),\n ...(node.validTo === undefined ? {} : { validTo: node.validTo }),\n };\n}\n\nfunction edgeParams(graphId: string, edge: InterchangeEdge): InsertEdgeParams {\n return {\n graphId,\n id: edge.id,\n kind: edge.kind,\n fromKind: edge.from.kind,\n fromId: edge.from.id,\n toKind: edge.to.kind,\n toId: edge.to.id,\n props: edge.properties,\n ...(edge.validFrom === undefined ? {} : { validFrom: edge.validFrom }),\n ...(edge.validTo === undefined ? {} : { validTo: edge.validTo }),\n };\n}\n\nasync function consumeTrustedChunks<G extends GraphDef>(\n store: Store<G>,\n session: TrustedImportSession,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n const nodeKinds = new Set(\n Object.values(store.graph.nodes).map(\n (registration) => registration.type.kind,\n ),\n );\n const edgeKinds = new Set(\n Object.values(store.graph.edges).map(\n (registration) => registration.type.kind,\n ),\n );\n let receivedHeader = false;\n let receivedEdges = false;\n let nodeCount = 0;\n let edgeCount = 0;\n\n for await (const chunk of chunks) {\n switch (chunk.type) {\n case \"header\": {\n if (receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream emitted more than one header.\",\n );\n }\n receivedHeader = true;\n break;\n }\n case \"nodes\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n if (receivedEdges) {\n throw invalidStream(\n \"Trusted graph interchange stream cannot emit nodes after edges.\",\n );\n }\n const unknownKind = chunk.nodes.find(\n (node) => !nodeKinds.has(node.kind),\n )?.kind;\n if (unknownKind !== undefined) {\n throw invalidStream(\n `Unknown node kind in trusted import: ${unknownKind}`,\n );\n }\n await session.insertNodes(\n chunk.nodes.map((node) => nodeParams(store.graphId, node)),\n );\n nodeCount += chunk.nodes.length;\n break;\n }\n case \"edges\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n receivedEdges = true;\n const invalidEdge = chunk.edges.find(\n (edge) =>\n !edgeKinds.has(edge.kind) ||\n !nodeKinds.has(edge.from.kind) ||\n !nodeKinds.has(edge.to.kind),\n );\n if (invalidEdge !== undefined) {\n throw invalidStream(\n `Unknown edge or endpoint kind in trusted import: ${invalidEdge.kind}`,\n );\n }\n await session.insertEdges(\n chunk.edges.map((edge) => edgeParams(store.graphId, edge)),\n );\n edgeCount += chunk.edges.length;\n break;\n }\n }\n }\n\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream ended before emitting a header.\",\n );\n }\n return { nodes: nodeCount, edges: edgeCount };\n}\n\n/**\n * Atomically imports a header-first stream into a fresh, dedicated database.\n *\n * This is an intentionally trusted path. It checks stream ordering and kind\n * names, but it does not validate properties, references, cardinality, or\n * conflicts. The caller must guarantee those invariants. Use\n * {@link importGraphStream} for untrusted data.\n */\nexport async function trustedImportGraphStream<G extends GraphDef>(\n store: Store<G>,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n rejectUnsupportedStoreFeatures(store);\n const backend = storeBackend(store);\n const trustedImport = backend.trustedImport;\n if (trustedImport === undefined) {\n throw new TrustedImportError(\n `The ${backend.dialect} backend does not support trusted import.`,\n \"backend_unsupported\",\n { dialect: backend.dialect },\n );\n }\n return trustedImport((session) =>\n consumeTrustedChunks(store, session, chunks),\n );\n}\n\nfunction* graphDataChunks(data: GraphData): Iterable<GraphInterchangeChunk> {\n const { nodes, edges, ...header } = data;\n yield { type: \"header\", header };\n yield { type: \"nodes\", nodes };\n yield { type: \"edges\", edges };\n}\n\n/** In-memory convenience wrapper around {@link trustedImportGraphStream}. */\nexport function trustedImportGraph<G extends GraphDef>(\n store: Store<G>,\n data: GraphData,\n): Promise<TrustedImportResult> {\n return trustedImportGraphStream(store, graphDataChunks(data));\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { G as GraphDef } from '../define-graph-CzEvA_8F.cjs';
3
- import { a as Store } from '../store-view-BJd6Vwpt.cjs';
2
+ import { G as GraphDef } from '../define-graph-Cv3CFwKm.cjs';
3
+ import { a as Store } from '../store-view-C-buB8Q8.cjs';
4
4
  import '../extension-types-BLEVH4SG.cjs';
5
- import '../index-CrFL_ENI.cjs';
6
- import '../temporal-BC_NQV5Y.cjs';
7
- import '../manager-nCEJiYBb.cjs';
5
+ import '../types-C5pZeKTl.cjs';
6
+ import '../temporal-Dn_JADWY.cjs';
7
+ import '../manager-mqee5MVB.cjs';
8
+ import '../searchable-BxlJQVFw.cjs';
8
9
  import '../materialize-indexes-ExQ6OrAh.cjs';
9
10
 
10
11
  /**
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { G as GraphDef } from '../define-graph-DRo9xpYN.js';
3
- import { a as Store } from '../store-view-CLIhwMMX.js';
2
+ import { G as GraphDef } from '../define-graph-DQnj3fNH.js';
3
+ import { a as Store } from '../store-view-CagdeyNn.js';
4
4
  import '../extension-types-BLEVH4SG.js';
5
- import '../index-Bq7vSPHy.js';
6
- import '../temporal-DqtOEo_B.js';
7
- import '../manager-CASfhmzV.js';
5
+ import '../types-D8szWDUo.js';
6
+ import '../temporal-CyFsSPe8.js';
7
+ import '../manager-DjE6Mhag.js';
8
+ import '../searchable-ChJ29MCd.js';
8
9
  import '../materialize-indexes-D4iei4Kp.js';
9
10
 
10
11
  /**
@@ -1,19 +1,18 @@
1
- export { ConflictStrategySchema, ExportOptionsSchema, ExportStreamOptionsSchema, FORMAT_VERSION, GraphDataHeaderSchema, GraphDataSchema, GraphDataSourceSchema, GraphInterchangeChunkSchema, ImportErrorSchema, ImportOptionsSchema, ImportResultSchema, InterchangeEdgeSchema, InterchangeNodeSchema, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream } from '../chunk-NQBYTLPW.js';
2
- import '../chunk-3SK4SVTW.js';
3
- import { storeBackend } from '../chunk-IFDXG2YJ.js';
1
+ export { ConflictStrategySchema, ExportOptionsSchema, ExportStreamOptionsSchema, FORMAT_VERSION, GraphDataHeaderSchema, GraphDataSchema, GraphDataSourceSchema, GraphInterchangeChunkSchema, ImportErrorSchema, ImportOptionsSchema, ImportResultSchema, InterchangeEdgeSchema, InterchangeNodeSchema, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream } from '../chunk-XMEYZYGE.js';
2
+ import '../chunk-53BSOG3O.js';
3
+ import { storeBackend } from '../chunk-JHK6NPFV.js';
4
4
  import '../chunk-35S6P5ZU.js';
5
- import '../chunk-PZHC5GCD.js';
6
- import '../chunk-J6IJARLG.js';
5
+ import '../chunk-YYLMXERH.js';
6
+ import '../chunk-L5ET7FYQ.js';
7
+ import '../chunk-QOHTVDHU.js';
7
8
  import '../chunk-ZE6NVENI.js';
8
9
  import '../chunk-UR7W5YQK.js';
9
10
  import '../chunk-UUIBACKJ.js';
10
11
  import '../chunk-PH4IJ3V5.js';
11
- import '../chunk-I6FX7AAG.js';
12
+ import '../chunk-3SHAUJRB.js';
12
13
  import '../chunk-2EBMPJBO.js';
13
- import '../chunk-G3CSQLLT.js';
14
- import '../chunk-DDCIXXOO.js';
15
- import '../chunk-Y7M44XEK.js';
16
- import '../chunk-6XDBRDZE.js';
14
+ import '../chunk-Y5UC3IXF.js';
15
+ import '../chunk-6N7QBIWN.js';
17
16
  import '../chunk-SNXVDZAJ.js';
18
17
  import '../chunk-QMQLUA66.js';
19
18
  import { getSearchableFields, resolveGraphVectorSlots } from '../chunk-PC2UBAUB.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interchange/trusted-import.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,+BACP,KAAA,EACM;AACN,EAAA,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gB,IAAI,CAAC,CAAA;AAC9D","file":"index.js","sourcesContent":["import type {\n InsertEdgeParams,\n InsertNodeParams,\n TrustedImportSession,\n} from \"../backend/types\";\nimport type { GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { getSearchableFields } from \"../core/searchable\";\nimport { TrustedImportError } from \"../errors\";\nimport { storeBackend } from \"../store/runtime-port\";\nimport type { Store } from \"../store/store\";\nimport type {\n GraphData,\n GraphInterchangeChunk,\n InterchangeEdge,\n InterchangeNode,\n} from \"./types\";\n\n/** Counts committed by a trusted initial import. */\nexport type TrustedImportResult = Readonly<{\n nodes: number;\n edges: number;\n}>;\n\nfunction rejectUnsupportedStoreFeatures<G extends GraphDef>(\n store: Store<G>,\n): void {\n if (store.historyEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support recorded-time history capture.\",\n \"history_unsupported\",\n { graphId: store.graphId },\n );\n }\n if (store.revisionTrackingEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support revision tracking.\",\n \"revision_tracking_unsupported\",\n { graphId: store.graphId },\n );\n }\n\n const uniqueKinds = Object.values(store.graph.nodes)\n .filter((registration) => (registration.unique?.length ?? 0) > 0)\n .map((registration) => registration.type.kind);\n if (uniqueKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain node uniqueness sidecars.\",\n \"uniqueness_unsupported\",\n { graphId: store.graphId, nodeKinds: uniqueKinds },\n );\n }\n\n const searchableKinds = Object.values(store.graph.nodes)\n .filter(\n (registration) =>\n getSearchableFields(registration.type.schema).length > 0,\n )\n .map((registration) => registration.type.kind);\n if (searchableKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain fulltext sidecars.\",\n \"fulltext_unsupported\",\n { graphId: store.graphId, nodeKinds: searchableKinds },\n );\n }\n\n const vectorSlots = resolveGraphVectorSlots(store.graph);\n if (vectorSlots.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain vector sidecars.\",\n \"vector_unsupported\",\n {\n graphId: store.graphId,\n fields: vectorSlots.map((slot) => `${slot.nodeKind}.${slot.fieldPath}`),\n },\n );\n }\n}\n\nfunction invalidStream(message: string): TrustedImportError {\n return new TrustedImportError(message, \"invalid_stream\");\n}\n\nfunction nodeParams(graphId: string, node: InterchangeNode): InsertNodeParams {\n return {\n graphId,\n kind: node.kind,\n id: node.id,\n props: node.properties,\n ...(node.validFrom === undefined ? {} : { validFrom: node.validFrom }),\n ...(node.validTo === undefined ? {} : { validTo: node.validTo }),\n };\n}\n\nfunction edgeParams(graphId: string, edge: InterchangeEdge): InsertEdgeParams {\n return {\n graphId,\n id: edge.id,\n kind: edge.kind,\n fromKind: edge.from.kind,\n fromId: edge.from.id,\n toKind: edge.to.kind,\n toId: edge.to.id,\n props: edge.properties,\n ...(edge.validFrom === undefined ? {} : { validFrom: edge.validFrom }),\n ...(edge.validTo === undefined ? {} : { validTo: edge.validTo }),\n };\n}\n\nasync function consumeTrustedChunks<G extends GraphDef>(\n store: Store<G>,\n session: TrustedImportSession,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n const nodeKinds = new Set(\n Object.values(store.graph.nodes).map(\n (registration) => registration.type.kind,\n ),\n );\n const edgeKinds = new Set(\n Object.values(store.graph.edges).map(\n (registration) => registration.type.kind,\n ),\n );\n let receivedHeader = false;\n let receivedEdges = false;\n let nodeCount = 0;\n let edgeCount = 0;\n\n for await (const chunk of chunks) {\n switch (chunk.type) {\n case \"header\": {\n if (receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream emitted more than one header.\",\n );\n }\n receivedHeader = true;\n break;\n }\n case \"nodes\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n if (receivedEdges) {\n throw invalidStream(\n \"Trusted graph interchange stream cannot emit nodes after edges.\",\n );\n }\n const unknownKind = chunk.nodes.find(\n (node) => !nodeKinds.has(node.kind),\n )?.kind;\n if (unknownKind !== undefined) {\n throw invalidStream(\n `Unknown node kind in trusted import: ${unknownKind}`,\n );\n }\n await session.insertNodes(\n chunk.nodes.map((node) => nodeParams(store.graphId, node)),\n );\n nodeCount += chunk.nodes.length;\n break;\n }\n case \"edges\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n receivedEdges = true;\n const invalidEdge = chunk.edges.find(\n (edge) =>\n !edgeKinds.has(edge.kind) ||\n !nodeKinds.has(edge.from.kind) ||\n !nodeKinds.has(edge.to.kind),\n );\n if (invalidEdge !== undefined) {\n throw invalidStream(\n `Unknown edge or endpoint kind in trusted import: ${invalidEdge.kind}`,\n );\n }\n await session.insertEdges(\n chunk.edges.map((edge) => edgeParams(store.graphId, edge)),\n );\n edgeCount += chunk.edges.length;\n break;\n }\n }\n }\n\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream ended before emitting a header.\",\n );\n }\n return { nodes: nodeCount, edges: edgeCount };\n}\n\n/**\n * Atomically imports a header-first stream into a fresh, dedicated database.\n *\n * This is an intentionally trusted path. It checks stream ordering and kind\n * names, but it does not validate properties, references, cardinality, or\n * conflicts. The caller must guarantee those invariants. Use\n * {@link importGraphStream} for untrusted data.\n */\nexport async function trustedImportGraphStream<G extends GraphDef>(\n store: Store<G>,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n rejectUnsupportedStoreFeatures(store);\n const backend = storeBackend(store);\n const trustedImport = backend.trustedImport;\n if (trustedImport === undefined) {\n throw new TrustedImportError(\n `The ${backend.dialect} backend does not support trusted import.`,\n \"backend_unsupported\",\n { dialect: backend.dialect },\n );\n }\n return trustedImport((session) =>\n consumeTrustedChunks(store, session, chunks),\n );\n}\n\nfunction* graphDataChunks(data: GraphData): Iterable<GraphInterchangeChunk> {\n const { nodes, edges, ...header } = data;\n yield { type: \"header\", header };\n yield { type: \"nodes\", nodes };\n yield { type: \"edges\", edges };\n}\n\n/** In-memory convenience wrapper around {@link trustedImportGraphStream}. */\nexport function trustedImportGraph<G extends GraphDef>(\n store: Store<G>,\n data: GraphData,\n): Promise<TrustedImportResult> {\n return trustedImportGraphStream(store, graphDataChunks(data));\n}\n"]}
1
+ {"version":3,"sources":["../../src/interchange/trusted-import.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,+BACP,KAAA,EACM;AACN,EAAA,IAAI,MAAM,cAAA,EAAgB;AACxB,IAAA,MAAM,IAAI,kBAAA;AAAA,MACR,gEAAA;AAAA,MACA,qBAAA;AAAA,MACA,EAAE,OAAA,EAAS,KAAA,CAAM,OAAA;AAAQ,KAC3B;AAAA,EACF;AACA,EAAA,IAAI,MAAM,uBAAA,EAAyB;AACjC,IAAA,MAAM,IAAI,kBAAA;AAAA,MACR,oDAAA;AAAA,MACA,+BAAA;AAAA,MACA,EAAE,OAAA,EAAS,KAAA,CAAM,OAAA;AAAQ,KAC3B;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,OAAO,MAAA,CAAO,KAAA,CAAM,MAAM,KAAK,CAAA,CAChD,OAAO,CAAC,YAAA,KAAA,CAAkB,aAAa,MAAA,EAAQ,MAAA,IAAU,KAAK,CAAC,CAAA,CAC/D,IAAI,CAAC,YAAA,KAAiB,YAAA,CAAa,IAAA,CAAK,IAAI,CAAA;AAC/C,EAAA,IAAI,WAAA,CAAY,SAAS,CAAA,EAAG;AAC1B,IAAA,MAAM,IAAI,kBAAA;AAAA,MACR,4DAAA;AAAA,MACA,wBAAA;AAAA,MACA,EAAE,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,WAAW,WAAA;AAAY,KACnD;AAAA,EACF;AAEA,EAAA,MAAM,kBAAkB,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,KAAA,CAAM,KAAK,CAAA,CACpD,MAAA;AAAA,IACC,CAAC,YAAA,KACC,mBAAA,CAAoB,aAAa,IAAA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GAAI,IAAA;AACpC,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAU,MAAA,EAAO;AAC/B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAM;AAC7B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAM;AAC/B;AAGO,SAAS,kBAAA,CACd,OACA,IAAA,EAC8B;AAC9B,EAAA,OAAO,wBAAA,CAAyB,KAAA,EAAO,eAAA,CAAgB,IAAI,CAAC,CAAA;AAC9D","file":"index.js","sourcesContent":["import type {\n InsertEdgeParams,\n InsertNodeParams,\n TrustedImportSession,\n} from \"../backend/types\";\nimport type { GraphDef } from \"../core/define-graph\";\nimport { resolveGraphVectorSlots } from \"../core/embedding\";\nimport { getSearchableFields } from \"../core/searchable\";\nimport { TrustedImportError } from \"../errors\";\nimport { storeBackend } from \"../store/runtime-port\";\nimport type { Store } from \"../store/store\";\nimport type {\n GraphData,\n GraphInterchangeChunk,\n InterchangeEdge,\n InterchangeNode,\n} from \"./types\";\n\n/** Counts committed by a trusted initial import. */\nexport type TrustedImportResult = Readonly<{\n nodes: number;\n edges: number;\n}>;\n\nfunction rejectUnsupportedStoreFeatures<G extends GraphDef>(\n store: Store<G>,\n): void {\n if (store.historyEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support recorded-time history capture.\",\n \"history_unsupported\",\n { graphId: store.graphId },\n );\n }\n if (store.revisionTrackingEnabled) {\n throw new TrustedImportError(\n \"Trusted import does not support revision tracking.\",\n \"revision_tracking_unsupported\",\n { graphId: store.graphId },\n );\n }\n\n const uniqueKinds = Object.values(store.graph.nodes)\n .filter((registration) => (registration.unique?.length ?? 0) > 0)\n .map((registration) => registration.type.kind);\n if (uniqueKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain node uniqueness sidecars.\",\n \"uniqueness_unsupported\",\n { graphId: store.graphId, nodeKinds: uniqueKinds },\n );\n }\n\n const searchableKinds = Object.values(store.graph.nodes)\n .filter(\n (registration) =>\n getSearchableFields(registration.type.schema).length > 0,\n )\n .map((registration) => registration.type.kind);\n if (searchableKinds.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain fulltext sidecars.\",\n \"fulltext_unsupported\",\n { graphId: store.graphId, nodeKinds: searchableKinds },\n );\n }\n\n const vectorSlots = resolveGraphVectorSlots(store.graph);\n if (vectorSlots.length > 0) {\n throw new TrustedImportError(\n \"Trusted import does not maintain vector sidecars.\",\n \"vector_unsupported\",\n {\n graphId: store.graphId,\n fields: vectorSlots.map((slot) => `${slot.nodeKind}.${slot.fieldPath}`),\n },\n );\n }\n}\n\nfunction invalidStream(message: string): TrustedImportError {\n return new TrustedImportError(message, \"invalid_stream\");\n}\n\nfunction nodeParams(graphId: string, node: InterchangeNode): InsertNodeParams {\n return {\n graphId,\n kind: node.kind,\n id: node.id,\n props: node.properties,\n ...(node.validFrom === undefined ? {} : { validFrom: node.validFrom }),\n ...(node.validTo === undefined ? {} : { validTo: node.validTo }),\n };\n}\n\nfunction edgeParams(graphId: string, edge: InterchangeEdge): InsertEdgeParams {\n return {\n graphId,\n id: edge.id,\n kind: edge.kind,\n fromKind: edge.from.kind,\n fromId: edge.from.id,\n toKind: edge.to.kind,\n toId: edge.to.id,\n props: edge.properties,\n ...(edge.validFrom === undefined ? {} : { validFrom: edge.validFrom }),\n ...(edge.validTo === undefined ? {} : { validTo: edge.validTo }),\n };\n}\n\nasync function consumeTrustedChunks<G extends GraphDef>(\n store: Store<G>,\n session: TrustedImportSession,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n const nodeKinds = new Set(\n Object.values(store.graph.nodes).map(\n (registration) => registration.type.kind,\n ),\n );\n const edgeKinds = new Set(\n Object.values(store.graph.edges).map(\n (registration) => registration.type.kind,\n ),\n );\n let receivedHeader = false;\n let receivedEdges = false;\n let nodeCount = 0;\n let edgeCount = 0;\n\n for await (const chunk of chunks) {\n switch (chunk.type) {\n case \"header\": {\n if (receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream emitted more than one header.\",\n );\n }\n receivedHeader = true;\n break;\n }\n case \"nodes\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n if (receivedEdges) {\n throw invalidStream(\n \"Trusted graph interchange stream cannot emit nodes after edges.\",\n );\n }\n const unknownKind = chunk.nodes.find(\n (node) => !nodeKinds.has(node.kind),\n )?.kind;\n if (unknownKind !== undefined) {\n throw invalidStream(\n `Unknown node kind in trusted import: ${unknownKind}`,\n );\n }\n await session.insertNodes(\n chunk.nodes.map((node) => nodeParams(store.graphId, node)),\n );\n nodeCount += chunk.nodes.length;\n break;\n }\n case \"edges\": {\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream must start with a header.\",\n );\n }\n receivedEdges = true;\n const invalidEdge = chunk.edges.find(\n (edge) =>\n !edgeKinds.has(edge.kind) ||\n !nodeKinds.has(edge.from.kind) ||\n !nodeKinds.has(edge.to.kind),\n );\n if (invalidEdge !== undefined) {\n throw invalidStream(\n `Unknown edge or endpoint kind in trusted import: ${invalidEdge.kind}`,\n );\n }\n await session.insertEdges(\n chunk.edges.map((edge) => edgeParams(store.graphId, edge)),\n );\n edgeCount += chunk.edges.length;\n break;\n }\n }\n }\n\n if (!receivedHeader) {\n throw invalidStream(\n \"Trusted graph interchange stream ended before emitting a header.\",\n );\n }\n return { nodes: nodeCount, edges: edgeCount };\n}\n\n/**\n * Atomically imports a header-first stream into a fresh, dedicated database.\n *\n * This is an intentionally trusted path. It checks stream ordering and kind\n * names, but it does not validate properties, references, cardinality, or\n * conflicts. The caller must guarantee those invariants. Use\n * {@link importGraphStream} for untrusted data.\n */\nexport async function trustedImportGraphStream<G extends GraphDef>(\n store: Store<G>,\n chunks:\n AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>,\n): Promise<TrustedImportResult> {\n rejectUnsupportedStoreFeatures(store);\n const backend = storeBackend(store);\n const trustedImport = backend.trustedImport;\n if (trustedImport === undefined) {\n throw new TrustedImportError(\n `The ${backend.dialect} backend does not support trusted import.`,\n \"backend_unsupported\",\n { dialect: backend.dialect },\n );\n }\n return trustedImport((session) =>\n consumeTrustedChunks(store, session, chunks),\n );\n}\n\nfunction* graphDataChunks(data: GraphData): Iterable<GraphInterchangeChunk> {\n const { nodes, edges, ...header } = data;\n yield { type: \"header\", header };\n yield { type: \"nodes\", nodes };\n yield { type: \"edges\", edges };\n}\n\n/** In-memory convenience wrapper around {@link trustedImportGraphStream}. */\nexport function trustedImportGraph<G extends GraphDef>(\n store: Store<G>,\n data: GraphData,\n): Promise<TrustedImportResult> {\n return trustedImportGraphStream(store, graphDataChunks(data));\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { a as NodeType, A as AnyEdgeType, I as IndexEntity } from './extension-types-BLEVH4SG.js';
2
- import { s as SerializedNodeDef, t as SerializedEdgeDef, I as IndexDeclaration, q as SerializedSchema, C as SchemaVersionRow, G as GraphBackend } from './index-Bq7vSPHy.js';
3
- import { G as GraphDef } from './define-graph-DRo9xpYN.js';
2
+ import { s as SerializedNodeDef, t as SerializedEdgeDef, I as IndexDeclaration, q as SerializedSchema, C as SchemaVersionRow, G as GraphBackend } from './types-D8szWDUo.js';
3
+ import { G as GraphDef } from './define-graph-DQnj3fNH.js';
4
4
 
5
5
  /**
6
6
  * KindRegistry holds precomputed closures for ontological reasoning.