@nicia-ai/typegraph 0.44.0 → 0.46.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 (392) hide show
  1. package/dist/backend/drizzle/indexes.cjs +11 -11
  2. package/dist/backend/drizzle/indexes.d.cts +1 -1
  3. package/dist/backend/drizzle/indexes.d.ts +1 -1
  4. package/dist/backend/drizzle/indexes.js +7 -7
  5. package/dist/backend/index.cjs +53 -54
  6. package/dist/backend/index.d.cts +3 -3
  7. package/dist/backend/index.d.ts +3 -3
  8. package/dist/backend/index.js +13 -14
  9. package/dist/backend/postgres/index.cjs +29 -30
  10. package/dist/backend/postgres/index.d.cts +7 -7
  11. package/dist/backend/postgres/index.d.ts +7 -7
  12. package/dist/backend/postgres/index.js +16 -17
  13. package/dist/backend/postgres/pglite-store.cjs +48 -43
  14. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  15. package/dist/backend/postgres/pglite-store.d.cts +15 -9
  16. package/dist/backend/postgres/pglite-store.d.ts +15 -9
  17. package/dist/backend/postgres/pglite-store.js +44 -39
  18. package/dist/backend/postgres/pglite-store.js.map +1 -1
  19. package/dist/backend/postgres/pglite.cjs +18 -19
  20. package/dist/backend/postgres/pglite.d.cts +4 -4
  21. package/dist/backend/postgres/pglite.d.ts +4 -4
  22. package/dist/backend/postgres/pglite.js +17 -18
  23. package/dist/backend/sqlite/index.cjs +26 -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 +14 -15
  27. package/dist/backend/sqlite/libsql.cjs +21 -22
  28. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  29. package/dist/backend/sqlite/libsql.d.cts +15 -8
  30. package/dist/backend/sqlite/libsql.d.ts +15 -8
  31. package/dist/backend/sqlite/libsql.js +17 -18
  32. package/dist/backend/sqlite/libsql.js.map +1 -1
  33. package/dist/backend/sqlite/local-store.cjs +49 -44
  34. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  35. package/dist/backend/sqlite/local-store.d.cts +15 -10
  36. package/dist/backend/sqlite/local-store.d.ts +15 -10
  37. package/dist/backend/sqlite/local-store.js +45 -40
  38. package/dist/backend/sqlite/local-store.js.map +1 -1
  39. package/dist/backend/sqlite/local.cjs +19 -20
  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 +17 -18
  43. package/dist/{chunk-XMYJY7NI.js → chunk-2LG2XB2M.js} +3 -3
  44. package/dist/{chunk-XMYJY7NI.js.map → chunk-2LG2XB2M.js.map} +1 -1
  45. package/dist/{chunk-QGKILWGZ.cjs → chunk-2NA5DYLO.cjs} +4 -4
  46. package/dist/{chunk-QGKILWGZ.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
  47. package/dist/{chunk-5MUSU4ZP.cjs → chunk-3DHZCOT7.cjs} +20 -20
  48. package/dist/chunk-3DHZCOT7.cjs.map +1 -0
  49. package/dist/{chunk-OVUUTCPJ.cjs → chunk-4UGOKMI5.cjs} +268 -150
  50. package/dist/chunk-4UGOKMI5.cjs.map +1 -0
  51. package/dist/{chunk-FRHHDHKH.js → chunk-5262ZMTR.js} +26 -5
  52. package/dist/chunk-5262ZMTR.js.map +1 -0
  53. package/dist/{chunk-HOIFFY4M.js → chunk-5763DULU.js} +248 -76
  54. package/dist/chunk-5763DULU.js.map +1 -0
  55. package/dist/{chunk-7G32LIQM.js → chunk-5UVRGXD3.js} +277 -7
  56. package/dist/chunk-5UVRGXD3.js.map +1 -0
  57. package/dist/{chunk-IIT5K7SK.cjs → chunk-62ZP23AW.cjs} +15 -15
  58. package/dist/{chunk-IIT5K7SK.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
  59. package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
  60. package/dist/chunk-775A4ZMN.js.map +1 -0
  61. package/dist/{chunk-QYWINYEA.cjs → chunk-7BQXPCGN.cjs} +830 -170
  62. package/dist/chunk-7BQXPCGN.cjs.map +1 -0
  63. package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
  64. package/dist/chunk-7EO3TCQB.cjs.map +1 -0
  65. package/dist/chunk-7GT72YHH.cjs +1979 -0
  66. package/dist/chunk-7GT72YHH.cjs.map +1 -0
  67. package/dist/{chunk-SQRD2CYF.js → chunk-7VQXLT5O.js} +717 -76
  68. package/dist/chunk-7VQXLT5O.js.map +1 -0
  69. package/dist/{chunk-BCP7LLOY.js → chunk-7Z5OR7KO.js} +2706 -625
  70. package/dist/chunk-7Z5OR7KO.js.map +1 -0
  71. package/dist/chunk-A4OC4DVN.cjs +12 -0
  72. package/dist/{chunk-4SZ6XPTG.cjs.map → chunk-A4OC4DVN.cjs.map} +1 -1
  73. package/dist/{chunk-TDXIBCGY.cjs → chunk-A7J2YDDI.cjs} +5 -3
  74. package/dist/chunk-A7J2YDDI.cjs.map +1 -0
  75. package/dist/{chunk-FMMIX6N4.js → chunk-AKLS3BYZ.js} +56 -5
  76. package/dist/chunk-AKLS3BYZ.js.map +1 -0
  77. package/dist/{chunk-D7PG5D5K.js → chunk-AMKPPFUO.js} +32 -6
  78. package/dist/chunk-AMKPPFUO.js.map +1 -0
  79. package/dist/{chunk-PAW2XUZN.js → chunk-ASTI57H3.js} +3 -3
  80. package/dist/{chunk-PAW2XUZN.js.map → chunk-ASTI57H3.js.map} +1 -1
  81. package/dist/{chunk-FMGEZBAQ.js → chunk-BKCUOV7A.js} +27 -5
  82. package/dist/chunk-BKCUOV7A.js.map +1 -0
  83. package/dist/chunk-BSFJMMV3.cjs +268 -0
  84. package/dist/chunk-BSFJMMV3.cjs.map +1 -0
  85. package/dist/{chunk-63KCKSSH.js → chunk-C23WSN5E.js} +209 -24
  86. package/dist/chunk-C23WSN5E.js.map +1 -0
  87. package/dist/{chunk-JRP3VGHS.js → chunk-CBTIUB76.js} +3 -3
  88. package/dist/{chunk-JRP3VGHS.js.map → chunk-CBTIUB76.js.map} +1 -1
  89. package/dist/chunk-CNV4TXJG.js +58 -0
  90. package/dist/chunk-CNV4TXJG.js.map +1 -0
  91. package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
  92. package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
  93. package/dist/{chunk-46GDII45.js → chunk-DCQVHAYQ.js} +5 -5
  94. package/dist/{chunk-46GDII45.js.map → chunk-DCQVHAYQ.js.map} +1 -1
  95. package/dist/chunk-DLNROMQ7.js +306 -0
  96. package/dist/chunk-DLNROMQ7.js.map +1 -0
  97. package/dist/chunk-DYATYRY4.js +47 -0
  98. package/dist/chunk-DYATYRY4.js.map +1 -0
  99. package/dist/chunk-E4WNQBEF.cjs +217 -0
  100. package/dist/chunk-E4WNQBEF.cjs.map +1 -0
  101. package/dist/{chunk-G6Q5UM7U.js → chunk-FWJKWH6U.js} +5 -3
  102. package/dist/chunk-FWJKWH6U.js.map +1 -0
  103. package/dist/{chunk-BNUFUFAU.js → chunk-HFHTMECK.js} +7 -7
  104. package/dist/chunk-HFHTMECK.js.map +1 -0
  105. package/dist/{chunk-TFMVL4QH.js → chunk-I5MOXA4H.js} +20 -14
  106. package/dist/chunk-I5MOXA4H.js.map +1 -0
  107. package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
  108. package/dist/chunk-J3WZ3FA2.js.map +1 -0
  109. package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
  110. package/dist/chunk-JBQQ7THH.js.map +1 -0
  111. package/dist/chunk-JIVMTW7W.js +3393 -0
  112. package/dist/chunk-JIVMTW7W.js.map +1 -0
  113. package/dist/{chunk-2Y4IFKW7.js → chunk-JXA2ZP2Q.js} +6 -17
  114. package/dist/chunk-JXA2ZP2Q.js.map +1 -0
  115. package/dist/{chunk-GYA4JRP5.js → chunk-JXXDZTMN.js} +2 -2
  116. package/dist/chunk-JXXDZTMN.js.map +1 -0
  117. package/dist/chunk-JZUR7ZWE.js +254 -0
  118. package/dist/chunk-JZUR7ZWE.js.map +1 -0
  119. package/dist/chunk-K5ELX2GT.js +248 -0
  120. package/dist/chunk-K5ELX2GT.js.map +1 -0
  121. package/dist/chunk-LBJKZXDE.cjs +257 -0
  122. package/dist/chunk-LBJKZXDE.cjs.map +1 -0
  123. package/dist/{chunk-FGO5JFVJ.cjs → chunk-M4BDU5RX.cjs} +12 -12
  124. package/dist/{chunk-FGO5JFVJ.cjs.map → chunk-M4BDU5RX.cjs.map} +1 -1
  125. package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
  126. package/dist/chunk-MSY7FSX4.js.map +1 -0
  127. package/dist/{chunk-ST3LPB2V.cjs → chunk-MUK4BU7K.cjs} +788 -146
  128. package/dist/chunk-MUK4BU7K.cjs.map +1 -0
  129. package/dist/{chunk-MCHP7RHZ.cjs → chunk-MXJDTH5B.cjs} +64 -41
  130. package/dist/chunk-MXJDTH5B.cjs.map +1 -0
  131. package/dist/{chunk-2VLBGQBY.cjs → chunk-N3257XE6.cjs} +724 -577
  132. package/dist/chunk-N3257XE6.cjs.map +1 -0
  133. package/dist/chunk-N66HCGCY.cjs +57 -0
  134. package/dist/chunk-N66HCGCY.cjs.map +1 -0
  135. package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
  136. package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
  137. package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
  138. package/dist/chunk-NI72YOJB.cjs.map +1 -0
  139. package/dist/{chunk-EE7N5XXQ.cjs → chunk-NK5Q7UNE.cjs} +10 -21
  140. package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
  141. package/dist/{chunk-PHXITZE4.js → chunk-NMWDXFPH.js} +4 -4
  142. package/dist/{chunk-PHXITZE4.js.map → chunk-NMWDXFPH.js.map} +1 -1
  143. package/dist/{chunk-FSXTPBRN.js → chunk-NQ6BRJBE.js} +416 -850
  144. package/dist/chunk-NQ6BRJBE.js.map +1 -0
  145. package/dist/chunk-OH5E5KIO.js +2057 -0
  146. package/dist/chunk-OH5E5KIO.js.map +1 -0
  147. package/dist/chunk-ONU3HIED.cjs +2082 -0
  148. package/dist/chunk-ONU3HIED.cjs.map +1 -0
  149. package/dist/{chunk-STQ3BSED.cjs → chunk-PNN7RHVR.cjs} +66 -44
  150. package/dist/chunk-PNN7RHVR.cjs.map +1 -0
  151. package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
  152. package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
  153. package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
  154. package/dist/chunk-PWLJ77UV.cjs.map +1 -0
  155. package/dist/chunk-Q7Q4WSLJ.cjs +328 -0
  156. package/dist/chunk-Q7Q4WSLJ.cjs.map +1 -0
  157. package/dist/{chunk-BEFM74L2.js → chunk-QLRESYPU.js} +637 -493
  158. package/dist/chunk-QLRESYPU.js.map +1 -0
  159. package/dist/{chunk-SBPC5IP3.js → chunk-QWX5YA3K.js} +784 -202
  160. package/dist/chunk-QWX5YA3K.js.map +1 -0
  161. package/dist/{chunk-TCRIQMBU.js → chunk-RJS7DECT.js} +8 -9
  162. package/dist/chunk-RJS7DECT.js.map +1 -0
  163. package/dist/{chunk-6JZUSDY2.cjs → chunk-RMQLSPA2.cjs} +297 -27
  164. package/dist/chunk-RMQLSPA2.cjs.map +1 -0
  165. package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
  166. package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
  167. package/dist/{chunk-IJTLXNGJ.js → chunk-T4XNKYXB.js} +780 -127
  168. package/dist/chunk-T4XNKYXB.js.map +1 -0
  169. package/dist/{chunk-PDGEXGS6.cjs → chunk-TQR4KBY2.cjs} +354 -182
  170. package/dist/chunk-TQR4KBY2.cjs.map +1 -0
  171. package/dist/chunk-TTAITEPJ.cjs +755 -0
  172. package/dist/chunk-TTAITEPJ.cjs.map +1 -0
  173. package/dist/{chunk-NN3QSOVS.cjs → chunk-U5SON7R2.cjs} +27 -27
  174. package/dist/{chunk-NN3QSOVS.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
  175. package/dist/{chunk-A2I2XO52.cjs → chunk-U63GDNRC.cjs} +32 -26
  176. package/dist/chunk-U63GDNRC.cjs.map +1 -0
  177. package/dist/{chunk-YNULOIR5.cjs → chunk-UDISNXDL.cjs} +64 -43
  178. package/dist/chunk-UDISNXDL.cjs.map +1 -0
  179. package/dist/{chunk-GWEDD3DH.js → chunk-UV3SN74I.js} +5 -5
  180. package/dist/{chunk-GWEDD3DH.js.map → chunk-UV3SN74I.js.map} +1 -1
  181. package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
  182. package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
  183. package/dist/{chunk-EFELJVLA.js → chunk-VGTJPTIC.js} +28 -5
  184. package/dist/chunk-VGTJPTIC.js.map +1 -0
  185. package/dist/chunk-VQH4VAWD.cjs +12 -0
  186. package/dist/{chunk-EPTSMFH7.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
  187. package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
  188. package/dist/chunk-W6OG3HDG.js.map +1 -0
  189. package/dist/chunk-WDGA7IYB.js +207 -0
  190. package/dist/chunk-WDGA7IYB.js.map +1 -0
  191. package/dist/chunk-WEVQJ5LH.js +736 -0
  192. package/dist/chunk-WEVQJ5LH.js.map +1 -0
  193. package/dist/{chunk-3PRKZW6D.cjs → chunk-XBYVV3MP.cjs} +60 -5
  194. package/dist/chunk-XBYVV3MP.cjs.map +1 -0
  195. package/dist/{chunk-GFRGG2US.cjs → chunk-XCAGZAKP.cjs} +7 -7
  196. package/dist/{chunk-GFRGG2US.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
  197. package/dist/{chunk-XR4YZFKW.cjs → chunk-XDF2UPEQ.cjs} +3864 -1783
  198. package/dist/chunk-XDF2UPEQ.cjs.map +1 -0
  199. package/dist/{chunk-7V2FGGI2.cjs → chunk-XMQSEJCF.cjs} +632 -1080
  200. package/dist/chunk-XMQSEJCF.cjs.map +1 -0
  201. package/dist/chunk-XNLIZYRZ.cjs +3432 -0
  202. package/dist/chunk-XNLIZYRZ.cjs.map +1 -0
  203. package/dist/{chunk-66UVLHQA.cjs → chunk-XNSI2FJO.cjs} +99 -100
  204. package/dist/chunk-XNSI2FJO.cjs.map +1 -0
  205. package/dist/chunk-XQSCL77R.cjs +60 -0
  206. package/dist/chunk-XQSCL77R.cjs.map +1 -0
  207. package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
  208. package/dist/chunk-XUO3KQFO.cjs.map +1 -0
  209. package/dist/{chunk-HJH3RMXG.cjs → chunk-YAAM3M2S.cjs} +10 -10
  210. package/dist/{chunk-HJH3RMXG.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
  211. package/dist/{chunk-ATLN63JA.js → chunk-YBFHZUXX.js} +6 -6
  212. package/dist/{chunk-ATLN63JA.js.map → chunk-YBFHZUXX.js.map} +1 -1
  213. package/dist/{chunk-K3BUWSFR.js → chunk-YDFDBE6D.js} +119 -6
  214. package/dist/chunk-YDFDBE6D.js.map +1 -0
  215. package/dist/{chunk-OSZPLZIV.cjs → chunk-YVWGEQJE.cjs} +318 -132
  216. package/dist/chunk-YVWGEQJE.cjs.map +1 -0
  217. package/dist/{chunk-QT6V3YRH.js → chunk-YWGVVALJ.js} +3 -3
  218. package/dist/{chunk-QT6V3YRH.js.map → chunk-YWGVVALJ.js.map} +1 -1
  219. package/dist/core/index.cjs +40 -41
  220. package/dist/core/index.d.cts +4 -5
  221. package/dist/core/index.d.ts +4 -5
  222. package/dist/core/index.js +8 -9
  223. package/dist/{ddl-eWg7hx6R.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
  224. package/dist/{ddl-D5369kOY.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
  225. package/dist/graph-extension/index.cjs +26 -23
  226. package/dist/graph-extension/index.d.cts +16 -6
  227. package/dist/graph-extension/index.d.ts +16 -6
  228. package/dist/graph-extension/index.js +7 -8
  229. package/dist/graph-merge/index.cjs +2459 -655
  230. package/dist/graph-merge/index.cjs.map +1 -1
  231. package/dist/graph-merge/index.d.cts +170 -33
  232. package/dist/graph-merge/index.d.ts +170 -33
  233. package/dist/graph-merge/index.js +2269 -468
  234. package/dist/graph-merge/index.js.map +1 -1
  235. package/dist/{index-By89Sezh.d.ts → index-BSHvKfok.d.ts} +221 -10
  236. package/dist/{index-DcQ3Sxs-.d.cts → index-DxaYCv8Y.d.cts} +221 -10
  237. package/dist/index.cjs +330 -269
  238. package/dist/index.cjs.map +1 -1
  239. package/dist/index.d.cts +590 -576
  240. package/dist/index.d.ts +590 -576
  241. package/dist/index.js +73 -50
  242. package/dist/index.js.map +1 -1
  243. package/dist/indexes/index.cjs +17 -17
  244. package/dist/indexes/index.d.cts +4 -4
  245. package/dist/indexes/index.d.ts +4 -4
  246. package/dist/indexes/index.js +10 -10
  247. package/dist/interchange/index.cjs +165 -50
  248. package/dist/interchange/index.cjs.map +1 -1
  249. package/dist/interchange/index.d.cts +261 -16
  250. package/dist/interchange/index.d.ts +261 -16
  251. package/dist/interchange/index.js +128 -24
  252. package/dist/interchange/index.js.map +1 -1
  253. package/dist/{manager-B0KjKE93.d.ts → manager-CfZAimti.d.ts} +36 -5
  254. package/dist/{manager-Cn0NFIhN.d.cts → manager-HGk6E_HW.d.cts} +36 -5
  255. package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
  256. package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
  257. package/dist/{postgres-DaEWvN4x.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
  258. package/dist/{postgres-u0a0HN2D.d.ts → postgres-e7a9TdvR.d.ts} +1961 -439
  259. package/dist/profiler/index.cjs +15 -15
  260. package/dist/profiler/index.d.cts +9 -10
  261. package/dist/profiler/index.d.ts +9 -10
  262. package/dist/profiler/index.js +4 -4
  263. package/dist/provenance/index.cjs +46 -48
  264. package/dist/provenance/index.cjs.map +1 -1
  265. package/dist/provenance/index.d.cts +7 -7
  266. package/dist/provenance/index.d.ts +7 -7
  267. package/dist/provenance/index.js +12 -14
  268. package/dist/provenance/index.js.map +1 -1
  269. package/dist/schema/index.cjs +50 -49
  270. package/dist/schema/index.d.cts +9 -16
  271. package/dist/schema/index.d.ts +9 -16
  272. package/dist/schema/index.js +23 -22
  273. package/dist/{searchable-CnYEancP.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
  274. package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIje5XYD.d.cts} +1 -2
  275. package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
  276. package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
  277. package/dist/{store-view-Bvdku0Ht.d.ts → store-DawaWWjJ.d.ts} +3145 -2556
  278. package/dist/{store-view-w-md0nQ4.d.cts → store-RwTJx8LX.d.cts} +3145 -2556
  279. package/dist/{temporal-BCORwUau.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
  280. package/dist/{temporal--x9T8K4S.d.ts → temporal-BtM4UALv.d.ts} +1 -1
  281. package/dist/{types-6-WJmSD4.d.cts → types-CoIx8HX5.d.cts} +1 -1
  282. package/dist/{types-Cjvkj0jA.d.ts → types-HkveCCx0.d.cts} +866 -21
  283. package/dist/{types-Cjvkj0jA.d.cts → types-HkveCCx0.d.ts} +866 -21
  284. package/dist/{types-COODtTJU.d.ts → types-KFfk-8Ah.d.ts} +1 -1
  285. package/dist/{where-CUQmCR6d.d.cts → where--fk7_0kv.d.cts} +1 -1
  286. package/dist/{where-5xVawAwL.d.ts → where-ws5hf-Ov.d.ts} +1 -1
  287. package/package.json +1 -1
  288. package/dist/chunk-2BIG7U6E.cjs +0 -83
  289. package/dist/chunk-2BIG7U6E.cjs.map +0 -1
  290. package/dist/chunk-2L54C2C2.js +0 -144
  291. package/dist/chunk-2L54C2C2.js.map +0 -1
  292. package/dist/chunk-2VLBGQBY.cjs.map +0 -1
  293. package/dist/chunk-2WDD2NO3.js +0 -59
  294. package/dist/chunk-2WDD2NO3.js.map +0 -1
  295. package/dist/chunk-2Y4IFKW7.js.map +0 -1
  296. package/dist/chunk-35S6P5ZU.js +0 -27
  297. package/dist/chunk-35S6P5ZU.js.map +0 -1
  298. package/dist/chunk-3PRKZW6D.cjs.map +0 -1
  299. package/dist/chunk-4MB3AQAQ.js.map +0 -1
  300. package/dist/chunk-4SZ6XPTG.cjs +0 -12
  301. package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
  302. package/dist/chunk-63KCKSSH.js.map +0 -1
  303. package/dist/chunk-66UVLHQA.cjs.map +0 -1
  304. package/dist/chunk-6JZUSDY2.cjs.map +0 -1
  305. package/dist/chunk-764JHTLT.cjs +0 -15
  306. package/dist/chunk-764JHTLT.cjs.map +0 -1
  307. package/dist/chunk-7G32LIQM.js.map +0 -1
  308. package/dist/chunk-7V2FGGI2.cjs.map +0 -1
  309. package/dist/chunk-A2I2XO52.cjs.map +0 -1
  310. package/dist/chunk-A4PBRX4C.cjs +0 -100
  311. package/dist/chunk-A4PBRX4C.cjs.map +0 -1
  312. package/dist/chunk-ACSVZPK7.cjs.map +0 -1
  313. package/dist/chunk-ALFUGRYB.cjs +0 -1282
  314. package/dist/chunk-ALFUGRYB.cjs.map +0 -1
  315. package/dist/chunk-B75XRV3O.js +0 -125
  316. package/dist/chunk-B75XRV3O.js.map +0 -1
  317. package/dist/chunk-BCP7LLOY.js.map +0 -1
  318. package/dist/chunk-BEFM74L2.js.map +0 -1
  319. package/dist/chunk-BNUFUFAU.js.map +0 -1
  320. package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
  321. package/dist/chunk-CPEL3YIR.cjs.map +0 -1
  322. package/dist/chunk-D7PG5D5K.js.map +0 -1
  323. package/dist/chunk-DI74SMXS.cjs +0 -29
  324. package/dist/chunk-DI74SMXS.cjs.map +0 -1
  325. package/dist/chunk-DK2S42XB.js +0 -77
  326. package/dist/chunk-DK2S42XB.js.map +0 -1
  327. package/dist/chunk-DRACN6XG.js +0 -27
  328. package/dist/chunk-DRACN6XG.js.map +0 -1
  329. package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
  330. package/dist/chunk-EFELJVLA.js.map +0 -1
  331. package/dist/chunk-EPTSMFH7.cjs +0 -12
  332. package/dist/chunk-EQ7JKLZO.cjs +0 -157
  333. package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
  334. package/dist/chunk-FJMPR3OH.cjs.map +0 -1
  335. package/dist/chunk-FMGEZBAQ.js.map +0 -1
  336. package/dist/chunk-FMMIX6N4.js.map +0 -1
  337. package/dist/chunk-FRHHDHKH.js.map +0 -1
  338. package/dist/chunk-FSXTPBRN.js.map +0 -1
  339. package/dist/chunk-G6Q5UM7U.js.map +0 -1
  340. package/dist/chunk-GYA4JRP5.js.map +0 -1
  341. package/dist/chunk-HOHAJ2NR.cjs +0 -61
  342. package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
  343. package/dist/chunk-HOIFFY4M.js.map +0 -1
  344. package/dist/chunk-IIMQJYAM.js +0 -81
  345. package/dist/chunk-IIMQJYAM.js.map +0 -1
  346. package/dist/chunk-IJTLXNGJ.js.map +0 -1
  347. package/dist/chunk-ITE4IXAK.js +0 -25
  348. package/dist/chunk-ITE4IXAK.js.map +0 -1
  349. package/dist/chunk-K3BUWSFR.js.map +0 -1
  350. package/dist/chunk-KCO5EFJU.js +0 -79
  351. package/dist/chunk-KCO5EFJU.js.map +0 -1
  352. package/dist/chunk-KKYELPZ2.cjs +0 -83
  353. package/dist/chunk-KKYELPZ2.cjs.map +0 -1
  354. package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
  355. package/dist/chunk-MIJKEVV7.js.map +0 -1
  356. package/dist/chunk-NCX65HBY.cjs +0 -1396
  357. package/dist/chunk-NCX65HBY.cjs.map +0 -1
  358. package/dist/chunk-OSZPLZIV.cjs.map +0 -1
  359. package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
  360. package/dist/chunk-PDGEXGS6.cjs.map +0 -1
  361. package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
  362. package/dist/chunk-QMQLUA66.js +0 -12
  363. package/dist/chunk-QMQLUA66.js.map +0 -1
  364. package/dist/chunk-QYWINYEA.cjs.map +0 -1
  365. package/dist/chunk-S4KQ5LV4.js.map +0 -1
  366. package/dist/chunk-SBPC5IP3.js.map +0 -1
  367. package/dist/chunk-SJDMVITW.cjs.map +0 -1
  368. package/dist/chunk-SNXVDZAJ.js.map +0 -1
  369. package/dist/chunk-SQRD2CYF.js.map +0 -1
  370. package/dist/chunk-ST3LPB2V.cjs.map +0 -1
  371. package/dist/chunk-STQ3BSED.cjs.map +0 -1
  372. package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
  373. package/dist/chunk-TCRIQMBU.js.map +0 -1
  374. package/dist/chunk-TDXIBCGY.cjs.map +0 -1
  375. package/dist/chunk-TFMVL4QH.js.map +0 -1
  376. package/dist/chunk-TRF4EBJT.cjs +0 -30
  377. package/dist/chunk-TRF4EBJT.cjs.map +0 -1
  378. package/dist/chunk-TVLKA4AY.js +0 -94
  379. package/dist/chunk-TVLKA4AY.js.map +0 -1
  380. package/dist/chunk-UR7W5YQK.js.map +0 -1
  381. package/dist/chunk-VITTKBWF.js +0 -1263
  382. package/dist/chunk-VITTKBWF.js.map +0 -1
  383. package/dist/chunk-WBUFJ7BS.cjs +0 -131
  384. package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
  385. package/dist/chunk-XR4YZFKW.cjs.map +0 -1
  386. package/dist/chunk-YNULOIR5.cjs.map +0 -1
  387. package/dist/chunk-ZDH3DX3C.cjs +0 -30
  388. package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
  389. package/dist/chunk-ZTAJL4DT.cjs +0 -85
  390. package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
  391. package/dist/define-graph-DVF-oN1i.d.cts +0 -173
  392. package/dist/define-graph-SvYXOl78.d.ts +0 -173
@@ -1,11 +1,11 @@
1
- export { C as ContributionDiagnostic, a as ContributionDiagnosticState } from '../types-Cjvkj0jA.js';
1
+ import { d as GraphDef } from '../types-HkveCCx0.js';
2
+ export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult } from '../types-HkveCCx0.js';
2
3
  import { z } from 'zod';
3
- import { G as GraphDef } from '../define-graph-SvYXOl78.js';
4
- import { a as Store } from '../store-view-Bvdku0Ht.js';
5
- import '../temporal--x9T8K4S.js';
6
- import '../manager-B0KjKE93.js';
7
- import '../materialize-indexes-BD4V3svD.js';
8
- import '../searchable-CnYEancP.js';
4
+ import { a as Store } from '../store-DawaWWjJ.js';
5
+ import '../temporal-BtM4UALv.js';
6
+ import '../searchable-9OQoPuRs.js';
7
+ import '../manager-CfZAimti.js';
8
+ import '../materialize-indexes-BMJP6Tms.js';
9
9
 
10
10
  /**
11
11
  * Graph interchange format types.
@@ -18,10 +18,17 @@ import '../searchable-CnYEancP.js';
18
18
  */
19
19
 
20
20
  /**
21
- * Current interchange format version.
22
- * Increment for breaking changes to the format.
21
+ * Current interchange format version — the value every export writes.
22
+ *
23
+ * Read-side compatibility policy: the format is versioned separately from what
24
+ * it *accepts*. A 1.0 document is a structurally valid 2.0 document — the only
25
+ * 2.0 addition is the optional `identity` section — so import and
26
+ * {@link GraphDataSchema} accept both `"1.0"` and `"2.0"` (see
27
+ * {@link AcceptedFormatVersionSchema}), while exports keep writing this
28
+ * constant. Bump this only when exports must emit a new version; add the old
29
+ * value to the accepted set rather than dropping read compatibility.
23
30
  */
24
- declare const FORMAT_VERSION: "1.0";
31
+ declare const FORMAT_VERSION: "2.0";
25
32
  /**
26
33
  * Interchange format for a node.
27
34
  *
@@ -67,6 +74,62 @@ declare const InterchangeEdgeSchema: z.ZodObject<{
67
74
  }, z.core.$strip>>;
68
75
  }, z.core.$strip>;
69
76
  type InterchangeEdge = z.infer<typeof InterchangeEdgeSchema>;
77
+ declare const IdentityInterchangeModeSchema: z.ZodEnum<{
78
+ state: "state";
79
+ archival: "archival";
80
+ }>;
81
+ type IdentityInterchangeMode = z.infer<typeof IdentityInterchangeModeSchema>;
82
+ declare const InterchangeIdentityAssertionSchema: z.ZodObject<{
83
+ id: z.ZodString;
84
+ relation: z.ZodEnum<{
85
+ same: "same";
86
+ different: "different";
87
+ }>;
88
+ a: z.ZodObject<{
89
+ kind: z.ZodString;
90
+ id: z.ZodString;
91
+ }, z.core.$strip>;
92
+ b: z.ZodObject<{
93
+ kind: z.ZodString;
94
+ id: z.ZodString;
95
+ }, z.core.$strip>;
96
+ validFrom: z.ZodISODateTime;
97
+ validTo: z.ZodOptional<z.ZodISODateTime>;
98
+ endedBy: z.ZodOptional<z.ZodObject<{
99
+ kind: z.ZodString;
100
+ id: z.ZodString;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>;
103
+ type InterchangeIdentityAssertion = z.infer<typeof InterchangeIdentityAssertionSchema>;
104
+ declare const InterchangeIdentitySchema: z.ZodObject<{
105
+ profile: z.ZodLiteral<"typegraph-identity-v1">;
106
+ mode: z.ZodEnum<{
107
+ state: "state";
108
+ archival: "archival";
109
+ }>;
110
+ assertions: z.ZodArray<z.ZodObject<{
111
+ id: z.ZodString;
112
+ relation: z.ZodEnum<{
113
+ same: "same";
114
+ different: "different";
115
+ }>;
116
+ a: z.ZodObject<{
117
+ kind: z.ZodString;
118
+ id: z.ZodString;
119
+ }, z.core.$strip>;
120
+ b: z.ZodObject<{
121
+ kind: z.ZodString;
122
+ id: z.ZodString;
123
+ }, z.core.$strip>;
124
+ validFrom: z.ZodISODateTime;
125
+ validTo: z.ZodOptional<z.ZodISODateTime>;
126
+ endedBy: z.ZodOptional<z.ZodObject<{
127
+ kind: z.ZodString;
128
+ id: z.ZodString;
129
+ }, z.core.$strip>>;
130
+ }, z.core.$strip>>;
131
+ }, z.core.$strip>;
132
+ type InterchangeIdentity = z.infer<typeof InterchangeIdentitySchema>;
70
133
  /**
71
134
  * Strategy for handling conflicts when a node/edge ID already exists.
72
135
  *
@@ -144,7 +207,10 @@ type GraphDataSource = z.infer<typeof GraphDataSourceSchema>;
144
207
  * plus arrays of nodes and edges to import.
145
208
  */
146
209
  declare const GraphDataSchema: z.ZodObject<{
147
- formatVersion: z.ZodLiteral<"1.0">;
210
+ formatVersion: z.ZodEnum<{
211
+ "2.0": "2.0";
212
+ "1.0": "1.0";
213
+ }>;
148
214
  exportedAt: z.ZodISODateTime;
149
215
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
216
  type: z.ZodLiteral<"typegraph-export">;
@@ -185,6 +251,34 @@ declare const GraphDataSchema: z.ZodObject<{
185
251
  updatedAt: z.ZodOptional<z.ZodISODateTime>;
186
252
  }, z.core.$strip>>;
187
253
  }, z.core.$strip>>;
254
+ identity: z.ZodOptional<z.ZodObject<{
255
+ profile: z.ZodLiteral<"typegraph-identity-v1">;
256
+ mode: z.ZodEnum<{
257
+ state: "state";
258
+ archival: "archival";
259
+ }>;
260
+ assertions: z.ZodArray<z.ZodObject<{
261
+ id: z.ZodString;
262
+ relation: z.ZodEnum<{
263
+ same: "same";
264
+ different: "different";
265
+ }>;
266
+ a: z.ZodObject<{
267
+ kind: z.ZodString;
268
+ id: z.ZodString;
269
+ }, z.core.$strip>;
270
+ b: z.ZodObject<{
271
+ kind: z.ZodString;
272
+ id: z.ZodString;
273
+ }, z.core.$strip>;
274
+ validFrom: z.ZodISODateTime;
275
+ validTo: z.ZodOptional<z.ZodISODateTime>;
276
+ endedBy: z.ZodOptional<z.ZodObject<{
277
+ kind: z.ZodString;
278
+ id: z.ZodString;
279
+ }, z.core.$strip>>;
280
+ }, z.core.$strip>>;
281
+ }, z.core.$strip>>;
188
282
  }, z.core.$strip>;
189
283
  type GraphData = z.infer<typeof GraphDataSchema>;
190
284
  /** The metadata envelope emitted before streamed graph entities. */
@@ -197,8 +291,18 @@ declare const GraphDataHeaderSchema: z.ZodObject<{
197
291
  type: z.ZodLiteral<"external">;
198
292
  description: z.ZodOptional<z.ZodString>;
199
293
  }, z.core.$strip>], "type">;
200
- formatVersion: z.ZodLiteral<"1.0">;
294
+ formatVersion: z.ZodEnum<{
295
+ "2.0": "2.0";
296
+ "1.0": "1.0";
297
+ }>;
201
298
  exportedAt: z.ZodISODateTime;
299
+ identity: z.ZodOptional<z.ZodObject<{
300
+ mode: z.ZodEnum<{
301
+ state: "state";
302
+ archival: "archival";
303
+ }>;
304
+ profile: z.ZodLiteral<"typegraph-identity-v1">;
305
+ }, z.core.$strip>>;
202
306
  }, z.core.$strip>;
203
307
  type GraphDataHeader = z.infer<typeof GraphDataHeaderSchema>;
204
308
  /**
@@ -217,8 +321,18 @@ declare const GraphInterchangeChunkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
217
321
  type: z.ZodLiteral<"external">;
218
322
  description: z.ZodOptional<z.ZodString>;
219
323
  }, z.core.$strip>], "type">;
220
- formatVersion: z.ZodLiteral<"1.0">;
324
+ formatVersion: z.ZodEnum<{
325
+ "2.0": "2.0";
326
+ "1.0": "1.0";
327
+ }>;
221
328
  exportedAt: z.ZodISODateTime;
329
+ identity: z.ZodOptional<z.ZodObject<{
330
+ mode: z.ZodEnum<{
331
+ state: "state";
332
+ archival: "archival";
333
+ }>;
334
+ profile: z.ZodLiteral<"typegraph-identity-v1">;
335
+ }, z.core.$strip>>;
222
336
  }, z.core.$strip>;
223
337
  }, z.core.$strip>, z.ZodObject<{
224
338
  type: z.ZodLiteral<"nodes">;
@@ -255,6 +369,29 @@ declare const GraphInterchangeChunkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
255
369
  updatedAt: z.ZodOptional<z.ZodISODateTime>;
256
370
  }, z.core.$strip>>;
257
371
  }, z.core.$strip>>;
372
+ }, z.core.$strip>, z.ZodObject<{
373
+ type: z.ZodLiteral<"identity">;
374
+ assertions: z.ZodArray<z.ZodObject<{
375
+ id: z.ZodString;
376
+ relation: z.ZodEnum<{
377
+ same: "same";
378
+ different: "different";
379
+ }>;
380
+ a: z.ZodObject<{
381
+ kind: z.ZodString;
382
+ id: z.ZodString;
383
+ }, z.core.$strip>;
384
+ b: z.ZodObject<{
385
+ kind: z.ZodString;
386
+ id: z.ZodString;
387
+ }, z.core.$strip>;
388
+ validFrom: z.ZodISODateTime;
389
+ validTo: z.ZodOptional<z.ZodISODateTime>;
390
+ endedBy: z.ZodOptional<z.ZodObject<{
391
+ kind: z.ZodString;
392
+ id: z.ZodString;
393
+ }, z.core.$strip>>;
394
+ }, z.core.$strip>>;
258
395
  }, z.core.$strip>], "type">;
259
396
  type GraphInterchangeChunk = z.infer<typeof GraphInterchangeChunkSchema>;
260
397
  /**
@@ -264,6 +401,7 @@ declare const ImportErrorSchema: z.ZodObject<{
264
401
  entityType: z.ZodEnum<{
265
402
  node: "node";
266
403
  edge: "edge";
404
+ identity: "identity";
267
405
  }>;
268
406
  kind: z.ZodString;
269
407
  id: z.ZodString;
@@ -287,10 +425,15 @@ declare const ImportResultSchema: z.ZodObject<{
287
425
  updated: z.ZodNumber;
288
426
  skipped: z.ZodNumber;
289
427
  }, z.core.$strip>;
428
+ identity: z.ZodObject<{
429
+ created: z.ZodNumber;
430
+ skipped: z.ZodNumber;
431
+ }, z.core.$strip>;
290
432
  errors: z.ZodArray<z.ZodObject<{
291
433
  entityType: z.ZodEnum<{
292
434
  node: "node";
293
435
  edge: "edge";
436
+ identity: "identity";
294
437
  }>;
295
438
  kind: z.ZodString;
296
439
  id: z.ZodString;
@@ -307,6 +450,11 @@ declare const ExportOptionsSchema: z.ZodObject<{
307
450
  includeTemporal: z.ZodDefault<z.ZodBoolean>;
308
451
  includeMeta: z.ZodDefault<z.ZodBoolean>;
309
452
  includeDeleted: z.ZodDefault<z.ZodBoolean>;
453
+ identityMode: z.ZodDefault<z.ZodEnum<{
454
+ state: "state";
455
+ archival: "archival";
456
+ }>>;
457
+ signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
310
458
  }, z.core.$strip>;
311
459
  /** Export options with defaults applied (output type) */
312
460
  type ExportOptions = z.infer<typeof ExportOptionsSchema>;
@@ -322,6 +470,11 @@ declare const ExportStreamOptionsSchema: z.ZodObject<{
322
470
  includeTemporal: z.ZodDefault<z.ZodBoolean>;
323
471
  includeMeta: z.ZodDefault<z.ZodBoolean>;
324
472
  includeDeleted: z.ZodDefault<z.ZodBoolean>;
473
+ identityMode: z.ZodDefault<z.ZodEnum<{
474
+ state: "state";
475
+ archival: "archival";
476
+ }>>;
477
+ signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
325
478
  batchSize: z.ZodDefault<z.ZodNumber>;
326
479
  }, z.core.$strip>;
327
480
  type ExportStreamOptions = z.infer<typeof ExportStreamOptionsSchema>;
@@ -351,6 +504,54 @@ declare function exportGraph<G extends GraphDef>(store: Store<G>, options?: Expo
351
504
  * header, then every node chunk, then every edge chunk. Consumers that write to
352
505
  * a network, file, or fresh working copy can process one chunk at a time rather
353
506
  * than materializing a graph-sized {@link GraphData} value.
507
+ *
508
+ * ## One snapshot, WHERE THE BACKEND HAS TRANSACTIONS
509
+ *
510
+ * On a backend reporting `capabilities.transactions`, the whole export —
511
+ * header, every node page, every edge page, every identity page — is read
512
+ * inside ONE `repeatable_read` / `read_only` transaction, so a slow consumer
513
+ * still gets one point in time rather than a mixture of the graph as it was at
514
+ * the first chunk and as it is at the last.
515
+ *
516
+ * A backend WITHOUT transactions (SQLite `transactionMode: "none"`, the
517
+ * session-less HTTP Postgres drivers) opens no such transaction: its export
518
+ * paginates statement by statement, and a write committed mid-stream can appear
519
+ * in the pages that follow. There is no way to offer the guarantee on an engine
520
+ * that cannot frame the reads, so it is a declared capability gap rather than
521
+ * something the stream pretends to. Callers needing a coherent export from such
522
+ * a backend must quiesce writes for its duration.
523
+ *
524
+ * ## Stopping a stream you will not finish
525
+ *
526
+ * While a transactional stream is open it holds that snapshot transaction, and
527
+ * on a serialized connection it holds the connection's one EXCLUSIVE stream
528
+ * lease with it. Every cooperative exit settles both, because each runs the
529
+ * generator's `finally`: `break` or `throw` out of a `for await`, and an
530
+ * explicit `iterator.return()`. (A non-transactional stream holds neither, so
531
+ * it has nothing to strand — but it still owes its consumer an answer, which
532
+ * the same cancellation path gives it.)
533
+ *
534
+ * A consumer that pulls `next()` and then simply DROPS the iterator has no
535
+ * cooperative exit — async-generator `finally` blocks do not run on garbage
536
+ * collection — so it must pass {@link ExportOptions.signal} and abort it.
537
+ * Without that, the snapshot transaction stays open for the life of the
538
+ * process and every later interchange stream on that connection is refused on
539
+ * behalf of a stream nobody is reading.
540
+ *
541
+ * ### Why there is no garbage-collection safety net (#429)
542
+ *
543
+ * A `FinalizationRegistry` on the iterable cannot close this: it is not merely
544
+ * unreliable here, it can never fire. The producer is interruptible in exactly
545
+ * one place — it is parked in {@link RendezvousChannel.push} waiting for the
546
+ * consumer, not in the database — so any cleanup state capable of settling an
547
+ * abandoned stream has to reach that channel. A registry holds its held value
548
+ * STRONGLY, and holding anything that reaches the channel's scope keeps the
549
+ * abandoned generator permanently reachable: measured on Node 24, publishing
550
+ * just `channel.abort` is enough to stop the stream being collected, while
551
+ * publishing an unrelated object is not. The net's own bookkeeping would
552
+ * therefore be what kept the entry from ever firing — a safety promise that
553
+ * reads as protection and is not there. The signal is the mechanism, and it is
554
+ * a contract rather than a hint.
354
555
  */
355
556
  declare function exportGraphStream<G extends GraphDef>(store: Store<G>, options?: ExportStreamOptionsInput): AsyncIterable<GraphInterchangeChunk>;
356
557
 
@@ -360,6 +561,14 @@ declare function exportGraphStream<G extends GraphDef>(store: Store<G>, options?
360
561
  * Nodes are imported first to satisfy edge reference validation.
361
562
  * The import runs within a transaction for atomicity when supported.
362
563
  *
564
+ * Refused with a typed {@link ConfigurationError} when the target writes through
565
+ * a serialized database connection another long-lived interchange operation
566
+ * holds — the same refusal, codes and `details.heldBy` / `details.requested` as
567
+ * {@link importGraphStream}. Hand-rolling a stream as `for await (const chunk of
568
+ * exportGraphStream(source)) await importGraph(target, ...)` on one such
569
+ * connection is therefore refused on the first chunk instead of nesting a write
570
+ * transaction inside the export's open snapshot.
571
+ *
363
572
  * @param store - The graph store to import into
364
573
  * @param data - Graph data in interchange format
365
574
  * @param options - Import configuration
@@ -379,14 +588,39 @@ declare function importGraph<G extends GraphDef>(store: Store<G>, data: GraphDat
379
588
  /**
380
589
  * Imports a header-first stream of bounded interchange chunks.
381
590
  *
382
- * Each chunk is committed through the same {@link importGraph} implementation
383
- * as an in-memory import, so validation and conflict semantics stay identical.
591
+ * Each chunk is committed through the same implementation as an in-memory
592
+ * {@link importGraph}, so validation and conflict semantics stay identical; the
593
+ * chunk calls skip only that function's own lease claim, which this loop already
594
+ * holds on their behalf.
384
595
  * Chunks are individually atomic on transactional backends; a consumer needing
385
596
  * all-or-nothing behavior can import into a disposable working-copy backend and
386
597
  * publish it only after this function succeeds.
387
598
  *
388
599
  * Nodes must precede edges. Once a node chunk commits, edge validation reads the
389
600
  * target store rather than retaining every imported node id in memory.
601
+ *
602
+ * Refused with a typed {@link ConfigurationError} when the target writes through
603
+ * a serialized database connection that another long-lived interchange stream
604
+ * already holds — either because this stream came from a snapshot export on that
605
+ * connection, or because ANY export snapshot or streaming import holds it when
606
+ * the first chunk arrives (which covers a stream the caller has wrapped). The
607
+ * error's `details.heldBy` names the holder's kind and `details.code` the
608
+ * condition: `INTERCHANGE_SHARED_SERIALIZED_BACKEND_SNAPSHOT` (or
609
+ * `INTERCHANGE_SAME_SQLITE_BACKEND_SNAPSHOT`) behind an export snapshot,
610
+ * `INTERCHANGE_SERIALIZED_IMPORT_IN_PROGRESS` behind another import.
611
+ *
612
+ * Once accepted, the import holds that connection's one stream lease for the
613
+ * whole call — every chunk AND the trailing statistics refresh, which is a
614
+ * write like any other — so any export snapshot or second import that tries to
615
+ * start while a write of this import is still to come is the side refused, and
616
+ * this import keeps running instead of stalling against a transaction it can
617
+ * never write past.
618
+ *
619
+ * Connections we cannot observe are not detected: two clients dialed at one
620
+ * server, or two SQLite handles on one file, are independent and are not
621
+ * refused. Neither is a connection whose driver we cannot positively identify as
622
+ * single-connection — see the residual gap documented in
623
+ * `backend/transaction-resource.ts`.
390
624
  */
391
625
  declare function importGraphStream<G extends GraphDef>(store: Store<G>, chunks: AsyncIterable<GraphInterchangeChunk>, rawOptions: ImportOptions): Promise<ImportResult>;
392
626
 
@@ -402,9 +636,20 @@ type TrustedImportResult = Readonly<{
402
636
  * names, but it does not validate properties, references, cardinality, or
403
637
  * conflicts. The caller must guarantee those invariants. Use
404
638
  * {@link importGraphStream} for untrusted data.
639
+ *
640
+ * Trusted of the DATA, not of the connection: this holds ONE write transaction
641
+ * open for the entire stream, which makes it a long-lived import holder exactly
642
+ * like {@link importGraphStream}, and it is guarded the same way — the source
643
+ * stream's own backend is checked against the target before the first chunk, and
644
+ * the target connection's exclusive stream lease is held for the whole import.
645
+ * `trustedImportGraphStream(target, exportGraphStream(source))` over one
646
+ * serialized connection is therefore refused with the shared typed
647
+ * {@link ConfigurationError} (codes and `details.heldBy` / `details.requested`
648
+ * as documented on `importGraphStream`) rather than reaching the driver as a
649
+ * nested BEGIN.
405
650
  */
406
651
  declare function trustedImportGraphStream<G extends GraphDef>(store: Store<G>, chunks: AsyncIterable<GraphInterchangeChunk> | Iterable<GraphInterchangeChunk>): Promise<TrustedImportResult>;
407
652
  /** In-memory convenience wrapper around {@link trustedImportGraphStream}. */
408
653
  declare function trustedImportGraph<G extends GraphDef>(store: Store<G>, data: GraphData): Promise<TrustedImportResult>;
409
654
 
410
- export { type ConflictStrategy, ConflictStrategySchema, type ExportOptions, type ExportOptionsInput, ExportOptionsSchema, type ExportStreamOptions, type ExportStreamOptionsInput, ExportStreamOptionsSchema, FORMAT_VERSION, type GraphData, type GraphDataHeader, GraphDataHeaderSchema, GraphDataSchema, type GraphDataSource, GraphDataSourceSchema, type GraphInterchangeChunk, GraphInterchangeChunkSchema, type ImportError, ImportErrorSchema, type ImportOptions, ImportOptionsSchema, type ImportResult, ImportResultSchema, type InterchangeEdge, InterchangeEdgeSchema, type InterchangeNode, InterchangeNodeSchema, type TrustedImportResult, type UnknownPropertyStrategy, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream, trustedImportGraph, trustedImportGraphStream };
655
+ export { type ConflictStrategy, ConflictStrategySchema, type ExportOptions, type ExportOptionsInput, ExportOptionsSchema, type ExportStreamOptions, type ExportStreamOptionsInput, ExportStreamOptionsSchema, FORMAT_VERSION, type GraphData, type GraphDataHeader, GraphDataHeaderSchema, GraphDataSchema, type GraphDataSource, GraphDataSourceSchema, type GraphInterchangeChunk, GraphInterchangeChunkSchema, type IdentityInterchangeMode, IdentityInterchangeModeSchema, type ImportError, ImportErrorSchema, type ImportOptions, ImportOptionsSchema, type ImportResult, ImportResultSchema, type InterchangeEdge, InterchangeEdgeSchema, type InterchangeIdentity, type InterchangeIdentityAssertion, InterchangeIdentityAssertionSchema, InterchangeIdentitySchema, type InterchangeNode, InterchangeNodeSchema, type TrustedImportResult, type UnknownPropertyStrategy, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream, trustedImportGraph, trustedImportGraphStream };
@@ -1,24 +1,25 @@
1
- export { ConflictStrategySchema, ExportOptionsSchema, ExportStreamOptionsSchema, FORMAT_VERSION, GraphDataHeaderSchema, GraphDataSchema, GraphDataSourceSchema, GraphInterchangeChunkSchema, ImportErrorSchema, ImportOptionsSchema, ImportResultSchema, InterchangeEdgeSchema, InterchangeNodeSchema, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream } from '../chunk-VITTKBWF.js';
2
- import '../chunk-SBPC5IP3.js';
3
- import { storeBackend } from '../chunk-FSXTPBRN.js';
4
- import '../chunk-35S6P5ZU.js';
5
- import '../chunk-MIJKEVV7.js';
6
- import '../chunk-FMMIX6N4.js';
7
- import '../chunk-2L54C2C2.js';
8
- import '../chunk-DK2S42XB.js';
9
- import '../chunk-UR7W5YQK.js';
10
- import '../chunk-B75XRV3O.js';
11
- import '../chunk-S4KQ5LV4.js';
12
- import '../chunk-KCO5EFJU.js';
1
+ import { exportStreamBackend, serializedStreamRefusal, withImportStreamLease } from '../chunk-OH5E5KIO.js';
2
+ export { ConflictStrategySchema, ExportOptionsSchema, ExportStreamOptionsSchema, FORMAT_VERSION, GraphDataHeaderSchema, GraphDataSchema, GraphDataSourceSchema, GraphInterchangeChunkSchema, IdentityInterchangeModeSchema, ImportErrorSchema, ImportOptionsSchema, ImportResultSchema, InterchangeEdgeSchema, InterchangeIdentityAssertionSchema, InterchangeIdentitySchema, InterchangeNodeSchema, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, importGraph, importGraphStream } from '../chunk-OH5E5KIO.js';
3
+ import '../chunk-QWX5YA3K.js';
4
+ import { storeBackend } from '../chunk-WEVQJ5LH.js';
5
+ import '../chunk-JIVMTW7W.js';
6
+ import '../chunk-NQ6BRJBE.js';
7
+ import '../chunk-JBQQ7THH.js';
8
+ import '../chunk-JZUR7ZWE.js';
9
+ import '../chunk-MSY7FSX4.js';
10
+ import { snapshotExportContention } from '../chunk-AKLS3BYZ.js';
11
+ import '../chunk-775A4ZMN.js';
12
+ import '../chunk-WDGA7IYB.js';
13
+ import { isInvertedValidityWindow, isCanonicalIsoDate } from '../chunk-DLNROMQ7.js';
13
14
  import '../chunk-2EBMPJBO.js';
14
- import '../chunk-K3BUWSFR.js';
15
- import '../chunk-6DCB664D.js';
16
- import '../chunk-SNXVDZAJ.js';
17
- import '../chunk-QMQLUA66.js';
15
+ import '../chunk-YDFDBE6D.js';
16
+ import '../chunk-PQBQG7IM.js';
17
+ import '../chunk-W6OG3HDG.js';
18
18
  import { getSearchableFields, resolveGraphVectorSlots } from '../chunk-PC2UBAUB.js';
19
- import '../chunk-TVLKA4AY.js';
20
- import { TrustedImportError } from '../chunk-4MB3AQAQ.js';
21
- import '../chunk-G6Q5UM7U.js';
19
+ import '../chunk-K5ELX2GT.js';
20
+ import { TrustedImportError } from '../chunk-J3WZ3FA2.js';
21
+ import '../chunk-FWJKWH6U.js';
22
+ import '../chunk-DYATYRY4.js';
22
23
 
23
24
  // src/interchange/trusted-import.ts
24
25
  function rejectUnsupportedStoreFeatures(store) {
@@ -36,6 +37,13 @@ function rejectUnsupportedStoreFeatures(store) {
36
37
  { graphId: store.graphId }
37
38
  );
38
39
  }
40
+ if (store.graph.identity !== void 0) {
41
+ throw new TrustedImportError(
42
+ "Trusted import does not maintain Operational Identity assertions or closure.",
43
+ "identity_unsupported",
44
+ { graphId: store.graphId }
45
+ );
46
+ }
39
47
  const uniqueKinds = Object.values(store.graph.nodes).filter((registration) => (registration.unique?.length ?? 0) > 0).map((registration) => registration.type.kind);
40
48
  if (uniqueKinds.length > 0) {
41
49
  throw new TrustedImportError(
@@ -69,6 +77,32 @@ function rejectUnsupportedStoreFeatures(store) {
69
77
  function invalidStream(message) {
70
78
  return new TrustedImportError(message, "invalid_stream");
71
79
  }
80
+ function nonCanonicalWindowOf(entity) {
81
+ const { validFrom, validTo } = entity;
82
+ if (typeof validFrom === "string" && !isCanonicalIsoDate(validFrom)) {
83
+ return { field: "validFrom", value: validFrom };
84
+ }
85
+ if (typeof validTo === "string" && !isCanonicalIsoDate(validTo)) {
86
+ return { field: "validTo", value: validTo };
87
+ }
88
+ return void 0;
89
+ }
90
+ function findNonCanonicalWindow(entities) {
91
+ for (const entity of entities) {
92
+ const nonCanonical = nonCanonicalWindowOf(entity);
93
+ if (nonCanonical !== void 0) return { entity, ...nonCanonical };
94
+ }
95
+ return void 0;
96
+ }
97
+ function nonCanonicalWindowMessage(subject, field, value) {
98
+ return `Non-canonical ${field} in trusted import: ${subject} states "${value}". Expected canonical fixed-width UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ), which is what makes a stored timestamp sort chronologically against an asOf coordinate. Convert with new Date(value).toISOString().`;
99
+ }
100
+ function hasInvertedWindow(entity) {
101
+ return isInvertedValidityWindow(
102
+ entity.validFrom ?? void 0,
103
+ entity.validTo
104
+ );
105
+ }
72
106
  function nodeParams(graphId, node) {
73
107
  return {
74
108
  graphId,
@@ -116,6 +150,11 @@ async function consumeTrustedChunks(store, session, chunks) {
116
150
  "Trusted graph interchange stream emitted more than one header."
117
151
  );
118
152
  }
153
+ if (chunk.header.identity !== void 0) {
154
+ throw invalidStream(
155
+ "Trusted graph interchange import does not support identity data. Use importGraphStream() for an identity export."
156
+ );
157
+ }
119
158
  receivedHeader = true;
120
159
  break;
121
160
  }
@@ -138,6 +177,25 @@ async function consumeTrustedChunks(store, session, chunks) {
138
177
  `Unknown node kind in trusted import: ${unknownKind}`
139
178
  );
140
179
  }
180
+ const nonCanonicalNode = findNonCanonicalWindow(chunk.nodes);
181
+ if (nonCanonicalNode !== void 0) {
182
+ const { entity, field, value } = nonCanonicalNode;
183
+ throw invalidStream(
184
+ nonCanonicalWindowMessage(
185
+ `${entity.kind} "${entity.id}"`,
186
+ field,
187
+ value
188
+ )
189
+ );
190
+ }
191
+ const invertedNode = chunk.nodes.find(
192
+ (node) => hasInvertedWindow(node)
193
+ );
194
+ if (invertedNode !== void 0) {
195
+ throw invalidStream(
196
+ `Inverted validity window in trusted import: ${invertedNode.kind} "${invertedNode.id}" ends at "${String(invertedNode.validTo)}", before its validFrom "${String(invertedNode.validFrom)}".`
197
+ );
198
+ }
141
199
  await session.insertNodes(
142
200
  chunk.nodes.map((node) => nodeParams(store.graphId, node))
143
201
  );
@@ -159,12 +217,36 @@ async function consumeTrustedChunks(store, session, chunks) {
159
217
  `Unknown edge or endpoint kind in trusted import: ${invalidEdge.kind}`
160
218
  );
161
219
  }
220
+ const nonCanonicalEdge = findNonCanonicalWindow(chunk.edges);
221
+ if (nonCanonicalEdge !== void 0) {
222
+ const { entity, field, value } = nonCanonicalEdge;
223
+ throw invalidStream(
224
+ nonCanonicalWindowMessage(
225
+ `${entity.kind} edge "${entity.id}"`,
226
+ field,
227
+ value
228
+ )
229
+ );
230
+ }
231
+ const invertedEdge = chunk.edges.find(
232
+ (edge) => hasInvertedWindow(edge)
233
+ );
234
+ if (invertedEdge !== void 0) {
235
+ throw invalidStream(
236
+ `Inverted validity window in trusted import: ${invertedEdge.kind} edge "${invertedEdge.id}" ends at "${String(invertedEdge.validTo)}", before its validFrom "${String(invertedEdge.validFrom)}".`
237
+ );
238
+ }
162
239
  await session.insertEdges(
163
240
  chunk.edges.map((edge) => edgeParams(store.graphId, edge))
164
241
  );
165
242
  edgeCount += chunk.edges.length;
166
243
  break;
167
244
  }
245
+ case "identity": {
246
+ throw invalidStream(
247
+ "Trusted graph interchange import does not support identity assertions. Use importGraphStream() for an export that carries identity truth."
248
+ );
249
+ }
168
250
  }
169
251
  }
170
252
  if (!receivedHeader) {
@@ -185,6 +267,16 @@ async function trustedImportGraphStream(store, chunks) {
185
267
  { dialect: backend.dialect }
186
268
  );
187
269
  }
270
+ const sourceBackend = Symbol.asyncIterator in chunks ? exportStreamBackend(chunks) : void 0;
271
+ const contention = sourceBackend === void 0 ? void 0 : snapshotExportContention(sourceBackend, backend);
272
+ if (contention !== void 0) {
273
+ throw serializedStreamRefusal({
274
+ graphId: store.graphId,
275
+ requested: "import-stream",
276
+ heldBy: "export-snapshot",
277
+ detector: contention
278
+ });
279
+ }
188
280
  const schemaVersion = store.introspect().schemaVersion;
189
281
  const options = schemaVersion === void 0 ? void 0 : {
190
282
  schemaWrite: {
@@ -192,16 +284,28 @@ async function trustedImportGraphStream(store, chunks) {
192
284
  expectedVersion: schemaVersion
193
285
  }
194
286
  };
195
- return trustedImport(
196
- (session) => consumeTrustedChunks(store, session, chunks),
197
- options
287
+ return withImportStreamLease(
288
+ store,
289
+ () => trustedImport(
290
+ (session) => consumeTrustedChunks(store, session, chunks),
291
+ options
292
+ )
198
293
  );
199
294
  }
200
295
  function* graphDataChunks(data) {
201
- const { nodes, edges, ...header } = data;
202
- yield { type: "header", header };
296
+ const { nodes, edges, identity, ...header } = data;
297
+ yield {
298
+ type: "header",
299
+ header: identity === void 0 ? header : {
300
+ ...header,
301
+ identity: { profile: identity.profile, mode: identity.mode }
302
+ }
303
+ };
203
304
  yield { type: "nodes", nodes };
204
305
  yield { type: "edges", edges };
306
+ if (identity !== void 0) {
307
+ yield { type: "identity", assertions: identity.assertions };
308
+ }
205
309
  }
206
310
  function trustedImportGraph(store, data) {
207
311
  return trustedImportGraphStream(store, graphDataChunks(data));