@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
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ // src/utils/object.ts
4
+ function isPlainObject(value) {
5
+ if (typeof value !== "object" || value === null) return false;
6
+ const prototype = Object.getPrototypeOf(value);
7
+ return prototype === Object.prototype || prototype === null;
8
+ }
9
+ function hasOwnKey(bag, key) {
10
+ return Object.hasOwn(bag, key);
11
+ }
12
+ function readOwnProperty(bag, key) {
13
+ return hasOwnKey(bag, key) ? bag[key] : void 0;
14
+ }
15
+ function createDataKeyedBag() {
16
+ return /* @__PURE__ */ Object.create(null);
17
+ }
18
+ var INTEROP_PROBE_KEYS = /* @__PURE__ */ new Set(["then", "toJSON"]);
19
+ function isInteropProbeKey(key) {
20
+ return INTEROP_PROBE_KEYS.has(key);
21
+ }
22
+ function compactUndefined(value) {
23
+ const result = {};
24
+ for (const [key, fieldValue] of Object.entries(value)) {
25
+ if (fieldValue !== void 0) result[key] = fieldValue;
26
+ }
27
+ return result;
28
+ }
29
+ function freezeDeep(value) {
30
+ if (value === null || typeof value !== "object") return value;
31
+ if (Object.isFrozen(value)) return value;
32
+ for (const nested of Object.values(value)) {
33
+ freezeDeep(nested);
34
+ }
35
+ return Object.freeze(value);
36
+ }
37
+
38
+ // src/utils/presence.ts
39
+ function isPresent(value) {
40
+ return value !== null && value !== void 0;
41
+ }
42
+ function requireDefined(value, message = "Expected a defined value.") {
43
+ if (value === void 0 || value === null) throw new TypeError(message);
44
+ return value;
45
+ }
46
+
47
+ exports.compactUndefined = compactUndefined;
48
+ exports.createDataKeyedBag = createDataKeyedBag;
49
+ exports.freezeDeep = freezeDeep;
50
+ exports.hasOwnKey = hasOwnKey;
51
+ exports.isInteropProbeKey = isInteropProbeKey;
52
+ exports.isPlainObject = isPlainObject;
53
+ exports.isPresent = isPresent;
54
+ exports.readOwnProperty = readOwnProperty;
55
+ exports.requireDefined = requireDefined;
56
+ //# sourceMappingURL=chunk-N66HCGCY.cjs.map
57
+ //# sourceMappingURL=chunk-N66HCGCY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/object.ts","../src/utils/presence.ts"],"names":[],"mappings":";;;AAMO,SAAS,cACd,KAAA,EACkC;AAClC,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,SAAA,GAAqB,MAAA,CAAO,cAAA,CAAe,KAAK,CAAA;AACtD,EAAA,OAAO,SAAA,KAAc,MAAA,CAAO,SAAA,IAAa,SAAA,KAAc,IAAA;AACzD;AAyBO,SAAS,SAAA,CACd,KACA,GAAA,EACS;AACT,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,GAAG,CAAA;AAC/B;AASO,SAAS,eAAA,CACd,KACA,GAAA,EACS;AACT,EAAA,OAAO,UAAU,GAAA,EAAK,GAAG,CAAA,GAAI,GAAA,CAAI,GAAG,CAAA,GAAI,MAAA;AAC1C;AAqCO,SAAS,kBAAA,GAA2C;AACzD,EAAA,uBAAO,MAAA,CAAO,OAAO,IAAI,CAAA;AAC3B;AASA,IAAM,qCAA0C,IAAI,GAAA,CAAI,CAAC,MAAA,EAAQ,QAAQ,CAAC,CAAA;AAuBnE,SAAS,kBAAkB,GAAA,EAAsB;AACtD,EAAA,OAAO,kBAAA,CAAmB,IAAI,GAAG,CAAA;AACnC;AAWO,SAAS,iBAAmC,KAAA,EAE7C;AACJ,EAAA,MAAM,SAAkC,EAAC;AACzC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,UAAU,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AACrD,IAAA,IAAI,UAAA,KAAe,MAAA,EAAW,MAAA,CAAO,GAAG,CAAA,GAAI,UAAA;AAAA,EAC9C;AACA,EAAA,OAAO,MAAA;AACT;AAUO,SAAS,WAAc,KAAA,EAAa;AACzC,EAAA,IAAI,KAAA,KAAU,IAAA,IAAQ,OAAO,KAAA,KAAU,UAAU,OAAO,KAAA;AACxD,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,KAAA;AACnC,EAAA,KAAA,MAAW,MAAA,IAAU,MAAA,CAAO,MAAA,CAAO,KAAgC,CAAA,EAAG;AACpE,IAAA,UAAA,CAAW,MAAM,CAAA;AAAA,EACnB;AACA,EAAA,OAAO,MAAA,CAAO,OAAO,KAAK,CAAA;AAC5B;;;AClKO,SAAS,UAAU,KAAA,EAAyB;AACjD,EAAA,OAAO,KAAA,KAAU,QAAQ,KAAA,KAAU,MAAA;AACrC;AAOO,SAAS,cAAA,CACd,KAAA,EACA,OAAA,GAAU,2BAAA,EACM;AAChB,EAAA,IAAI,UAAU,MAAA,IAAa,KAAA,KAAU,MAAM,MAAM,IAAI,UAAU,OAAO,CAAA;AACtE,EAAA,OAAO,KAAA;AACT","file":"chunk-N66HCGCY.cjs","sourcesContent":["/**\n * Plain-object predicate. Excludes class instances (Date, Map, Set,\n * RegExp, Buffer, …) and arrays. Used wherever the caller needs to\n * distinguish a literal `{}` from anything else — e.g. JSON-value\n * validation and runtime-document structural checks.\n */\nexport function isPlainObject(\n value: unknown,\n): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const prototype: unknown = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\n/**\n * Own-key membership for a bag whose KEYS ARE DATA — a props record parsed out\n * of a JSON column, a JSON-Schema `properties` map, a serialized-schema kind\n * table. The single owner of that question; every path asking it calls here.\n *\n * `in` is the wrong operator for these bags because it also finds inherited\n * members: `\"toString\" in {}` is `true`, as are `\"constructor\"`, `\"valueOf\"`,\n * `\"__proto__\"`, and the rest of `Object.prototype`. A bag that does NOT carry\n * the key therefore reads as if it does, and the `bag[key]` read that follows\n * yields the inherited member instead of stored data.\n *\n * Reachable, and not through anything exotic: a schema may DECLARE a field named\n * after a prototype member — `z.object({ toString: z.string() })` is an ordinary\n * schema — and such a field survives validation, storage, and the JSON round-trip\n * as normal data. (`__proto__` is the narrower case: Zod drops an own `__proto__`\n * key and `bag[\"__proto__\"] = value` assigns a prototype rather than creating one,\n * so no validated write produces it — but the unvalidated trusted import writes a\n * caller's bag verbatim, and JSON parses `__proto__` back as an own key.)\n *\n * `in` remains correct — and stays in use — where the key set is statically\n * known: a discriminated union's tag, a capability probe, a brand check. The\n * distinction is whether the key came from data or from the code.\n */\nexport function hasOwnKey(\n bag: Readonly<Record<string, unknown>>,\n key: string,\n): boolean {\n return Object.hasOwn(bag, key);\n}\n\n/**\n * Own-key read of a data-keyed bag: an absent key reads `undefined`, never an\n * inherited `Object.prototype` member. The read companion to {@link hasOwnKey}\n * (see its doc for why `bag[key]` alone is wrong for these bags), and like it\n * the single owner — every path reading a data-keyed bag by a data-supplied\n * key calls here rather than re-spelling the guard.\n */\nexport function readOwnProperty(\n bag: Readonly<Record<string, unknown>>,\n key: string,\n): unknown {\n return hasOwnKey(bag, key) ? bag[key] : undefined;\n}\n\n/**\n * Creates an accumulator whose KEYS ARE DATA — a kind name, a property name, a\n * JSON-Schema keyword, an entity's property bag. The write-side companion to\n * {@link hasOwnKey} / {@link readOwnProperty}, and like them the single owner\n * of the question: every accumulator keyed by data is built here.\n *\n * Null-prototype, because `bag[key] = value` on a `{}` literal does NOT create\n * an entry when `key` is `__proto__`: it invokes `Object.prototype`'s\n * `__proto__` SETTER, which either reparents the bag (object value) or does\n * nothing at all (primitive value). Either way the value is silently dropped,\n * and every later own-key read answers as if the writer never wrote it — the\n * write-side mirror of the inherited-member read `hasOwnKey` exists to prevent.\n *\n * Reachable, and not through anything exotic: kind names are validated against\n * `/^[A-Za-z_][A-Za-z0-9_]*$/`, which admits `__proto__` (as it does\n * `toString` and `constructor`); extension property names are unrestricted\n * apart from a reserved list; and `JSON.parse` yields `__proto__` as an\n * ordinary own key, so any document read off disk or the wire can carry one.\n *\n * A plain `{}` remains correct — and stays in use — for records whose keys are\n * statically known: an options object, a discriminated-union member, a fixed\n * lookup table.\n *\n * ## Spread it at the boundary\n *\n * The null prototype is an INTERNAL write-side protection, not something a\n * caller asked for. A bag that escapes into a value this library RETURNS must\n * be copied with a spread — `return { ...bag }` — at that boundary: returned\n * as-is it has no `toString`, no `hasOwnProperty`, and answers `false` to\n * `instanceof Object`, which is a public behavior change against every other\n * object the library hands back. The spread is safe precisely where a\n * key-by-key rebuild would not be: it copies own properties with\n * CreateDataProperty rather than Set, so an own `__proto__` key survives the\n * copy while `Object.prototype` is restored.\n */\nexport function createDataKeyedBag<T>(): Record<string, T> {\n return Object.create(null) as Record<string, T>;\n}\n\n/**\n * The two property names JavaScript itself probes on an arbitrary object:\n * `then` (the thenable check promise adoption performs) and `toJSON` (the hook\n * `JSON.stringify` looks for). A proxy standing in for data resolves them to\n * `undefined` so it is not mistaken for a promise and does not break\n * serialization.\n */\nconst INTEROP_PROBE_KEYS: ReadonlySet<string> = new Set([\"then\", \"toJSON\"]);\n\n/**\n * True if `key` is a name the language probes for a protocol rather than a name\n * a caller asked for. The single owner of WHICH names those are — the companion\n * to, not a substitute for, the question of whether the name is data\n * (`hasOwnKey` for a materialized bag, `SchemaIntrospector.hasDeclaredField`\n * for a proxy whose key set is the schema).\n *\n * **This predicate is a fallback, never a short-circuit.** `then` and `toJSON`\n * are ordinary identifiers: `z.object({ toJSON: z.string() })` is a legal\n * schema, and such a field is stored, validated, and round-tripped as data like\n * any other. A trap that answers `undefined` for these names BEFORE consulting\n * the data it fronts therefore drops a declared field — the read side of the\n * same mistake `hasOwnKey` fixes on the write side. Ask the data question\n * first; reach for this only once the answer is \"not data\", where resolving to\n * `undefined` keeps `await` and `JSON.stringify` working on a partial object.\n *\n * Returning stored data for an own `then` is safe as well as correct: props\n * come from a JSON column, so the value can never be callable, and the thenable\n * check ignores a non-callable `then` exactly as it does on the plain objects\n * the non-selective path returns.\n */\nexport function isInteropProbeKey(key: string): boolean {\n return INTEROP_PROBE_KEYS.has(key);\n}\n\n/**\n * Builds an object dropping any keys whose value is `undefined`.\n *\n * Lets callers construct discriminated-union members and `defineNode` /\n * `defineEdge` option objects without tripping over\n * `exactOptionalPropertyTypes: true` — which forbids setting `optional:\n * undefined` on a type that declares `optional?: boolean`. The cast keeps\n * call sites readable; this helper is the single typed seam.\n */\nexport function compactUndefined<T extends object>(value: {\n [K in keyof T]: T[K] | undefined;\n}): T {\n const result: Record<string, unknown> = {};\n for (const [key, fieldValue] of Object.entries(value)) {\n if (fieldValue !== undefined) result[key] = fieldValue;\n }\n return result as T;\n}\n\n/**\n * Recursively `Object.freeze` every plain object / array reachable from\n * `value`. Already-frozen branches are skipped. Returns the input for\n * convenient chaining; the freeze is in-place.\n *\n * Class instances and other non-plain values are left alone — only their\n * containers freeze.\n */\nexport function freezeDeep<T>(value: T): T {\n if (value === null || typeof value !== \"object\") return value;\n if (Object.isFrozen(value)) return value;\n for (const nested of Object.values(value as Record<string, unknown>)) {\n freezeDeep(nested);\n }\n return Object.freeze(value);\n}\n","/**\n * Predicate for values that are materially present in database rows.\n */\nexport function isPresent(value: unknown): boolean {\n return value !== null && value !== undefined;\n}\n\n/**\n * Narrows a value after a runtime presence check. Prefer this to a non-null\n * assertion: an invalid invariant fails at the point where it is assumed,\n * with a stable error instead of propagating `undefined` into unrelated code.\n */\nexport function requireDefined<T>(\n value: T,\n message = \"Expected a defined value.\",\n): NonNullable<T> {\n if (value === undefined || value === null) throw new TypeError(message);\n return value;\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkNAUA4PW5_cjs = require('./chunk-NAUA4PW5.cjs');
4
- var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.cjs');
5
- var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
4
+ var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
5
+ var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
6
6
 
7
7
  // src/query/compiler/schema.ts
8
- var SQL_SCHEMA_BRAND = chunkU5W4LKZV_cjs.typeGraphGlobalSymbol("sql-schema-v1");
8
+ var SQL_SCHEMA_BRAND = chunkVCRRKBLN_cjs.typeGraphGlobalSymbol("sql-schema-v1");
9
9
  var SqlSchema = class {
10
10
  };
11
11
  var SqlSchemaDescriptor = class extends SqlSchema {
@@ -16,6 +16,10 @@ var SqlSchemaDescriptor = class extends SqlSchema {
16
16
  recordedEdgesTable;
17
17
  recordedClockTable;
18
18
  revisionOriginsTable;
19
+ identityAssertionsTable;
20
+ recordedIdentityAssertionsTable;
21
+ identityClosureTable;
22
+ identitySeparationTable;
19
23
  fulltextTable;
20
24
  constructor(fields) {
21
25
  super();
@@ -32,6 +36,10 @@ var SqlSchemaDescriptor = class extends SqlSchema {
32
36
  this.recordedEdgesTable = fields.recordedEdgesTable;
33
37
  this.recordedClockTable = fields.recordedClockTable;
34
38
  this.revisionOriginsTable = fields.revisionOriginsTable;
39
+ this.identityAssertionsTable = fields.identityAssertionsTable;
40
+ this.recordedIdentityAssertionsTable = fields.recordedIdentityAssertionsTable;
41
+ this.identityClosureTable = fields.identityClosureTable;
42
+ this.identitySeparationTable = fields.identitySeparationTable;
35
43
  this.fulltextTable = fields.fulltextTable;
36
44
  Object.freeze(this);
37
45
  }
@@ -43,6 +51,10 @@ var DEFAULT_TABLE_NAMES = {
43
51
  recordedEdges: "typegraph_recorded_edges",
44
52
  recordedClock: "typegraph_recorded_clock",
45
53
  revisionOrigins: "typegraph_revision_origins",
54
+ identityAssertions: "typegraph_identity_assertions",
55
+ recordedIdentityAssertions: "typegraph_recorded_identity_assertions",
56
+ identityClosure: "typegraph_identity_closure",
57
+ identitySeparation: "typegraph_identity_separation",
46
58
  fulltext: "typegraph_node_fulltext",
47
59
  uniques: "typegraph_node_uniques"
48
60
  };
@@ -54,6 +66,10 @@ function resolveTableNames(names) {
54
66
  recordedEdges: names.recordedEdges ?? DEFAULT_TABLE_NAMES.recordedEdges,
55
67
  recordedClock: names.recordedClock ?? DEFAULT_TABLE_NAMES.recordedClock,
56
68
  revisionOrigins: names.revisionOrigins ?? DEFAULT_TABLE_NAMES.revisionOrigins,
69
+ identityAssertions: names.identityAssertions ?? DEFAULT_TABLE_NAMES.identityAssertions,
70
+ recordedIdentityAssertions: names.recordedIdentityAssertions ?? DEFAULT_TABLE_NAMES.recordedIdentityAssertions,
71
+ identityClosure: names.identityClosure ?? DEFAULT_TABLE_NAMES.identityClosure,
72
+ identitySeparation: names.identitySeparation ?? DEFAULT_TABLE_NAMES.identitySeparation,
57
73
  fulltext: names.fulltext ?? DEFAULT_TABLE_NAMES.fulltext,
58
74
  uniques: names.uniques ?? DEFAULT_TABLE_NAMES.uniques
59
75
  };
@@ -61,15 +77,15 @@ function resolveTableNames(names) {
61
77
  var VALID_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/i;
62
78
  function validateTableName(name, label) {
63
79
  if (!name || name.length === 0) {
64
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(`${label} table name cannot be empty`);
80
+ throw new chunkNI72YOJB_cjs.ConfigurationError(`${label} table name cannot be empty`);
65
81
  }
66
82
  if (name.length > chunkNAUA4PW5_cjs.MAX_PG_IDENTIFIER_LENGTH) {
67
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
83
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
68
84
  `${label} table name exceeds maximum length of ${chunkNAUA4PW5_cjs.MAX_PG_IDENTIFIER_LENGTH} characters`
69
85
  );
70
86
  }
71
87
  if (!VALID_IDENTIFIER_PATTERN.test(name)) {
72
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
88
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
73
89
  `${label} table name "${name}" is not a valid SQL identifier. Table names must start with a letter or underscore and contain only letters, digits, underscores, or dollar signs.`
74
90
  );
75
91
  }
@@ -80,11 +96,11 @@ function freezeSqlSchema(fields) {
80
96
  function isSqlSchema(schema) {
81
97
  if (typeof schema !== "object" || schema === null) return false;
82
98
  const candidate = schema;
83
- return candidate[SQL_SCHEMA_BRAND] === true && typeof candidate["tables"] === "object" && candidate["tables"] !== null && Object.isFrozen(candidate["tables"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["nodesTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["edgesTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["recordedNodesTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["recordedEdgesTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["recordedClockTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["revisionOriginsTable"]) && chunkU5W4LKZV_cjs.isSqlFragment(candidate["fulltextTable"]) && Object.isFrozen(candidate);
99
+ return candidate[SQL_SCHEMA_BRAND] === true && typeof candidate["tables"] === "object" && candidate["tables"] !== null && Object.isFrozen(candidate["tables"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["nodesTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["edgesTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["recordedNodesTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["recordedEdgesTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["recordedClockTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["revisionOriginsTable"]) && chunkVCRRKBLN_cjs.isSqlFragment(candidate["fulltextTable"]) && Object.isFrozen(candidate);
84
100
  }
85
101
  function requireSqlSchema(schema, surface = "SqlSchema") {
86
102
  if (isSqlSchema(schema)) return schema;
87
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
103
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
88
104
  `${surface} must be created with createSqlSchema(...).`,
89
105
  { code: "INVALID_SQL_SCHEMA", surface },
90
106
  {
@@ -100,23 +116,36 @@ function createSqlSchema(names = {}) {
100
116
  validateTableName(tables.recordedEdges, "recordedEdges");
101
117
  validateTableName(tables.recordedClock, "recordedClock");
102
118
  validateTableName(tables.revisionOrigins, "revisionOrigins");
119
+ validateTableName(tables.identityAssertions, "identityAssertions");
120
+ validateTableName(
121
+ tables.recordedIdentityAssertions,
122
+ "recordedIdentityAssertions"
123
+ );
124
+ validateTableName(tables.identityClosure, "identityClosure");
125
+ validateTableName(tables.identitySeparation, "identitySeparation");
103
126
  validateTableName(tables.fulltext, "fulltext");
104
127
  validateTableName(tables.uniques, "uniques");
105
128
  return freezeSqlSchema({
106
129
  tables: Object.freeze(tables),
107
- nodesTable: chunkU5W4LKZV_cjs.sql.identifier(tables.nodes),
108
- edgesTable: chunkU5W4LKZV_cjs.sql.identifier(tables.edges),
109
- recordedNodesTable: chunkU5W4LKZV_cjs.sql.identifier(tables.recordedNodes),
110
- recordedEdgesTable: chunkU5W4LKZV_cjs.sql.identifier(tables.recordedEdges),
111
- recordedClockTable: chunkU5W4LKZV_cjs.sql.identifier(tables.recordedClock),
112
- revisionOriginsTable: chunkU5W4LKZV_cjs.sql.identifier(tables.revisionOrigins),
113
- fulltextTable: chunkU5W4LKZV_cjs.sql.identifier(tables.fulltext)
130
+ nodesTable: chunkVCRRKBLN_cjs.sql.identifier(tables.nodes),
131
+ edgesTable: chunkVCRRKBLN_cjs.sql.identifier(tables.edges),
132
+ recordedNodesTable: chunkVCRRKBLN_cjs.sql.identifier(tables.recordedNodes),
133
+ recordedEdgesTable: chunkVCRRKBLN_cjs.sql.identifier(tables.recordedEdges),
134
+ recordedClockTable: chunkVCRRKBLN_cjs.sql.identifier(tables.recordedClock),
135
+ revisionOriginsTable: chunkVCRRKBLN_cjs.sql.identifier(tables.revisionOrigins),
136
+ identityAssertionsTable: chunkVCRRKBLN_cjs.sql.identifier(tables.identityAssertions),
137
+ recordedIdentityAssertionsTable: chunkVCRRKBLN_cjs.sql.identifier(
138
+ tables.recordedIdentityAssertions
139
+ ),
140
+ identityClosureTable: chunkVCRRKBLN_cjs.sql.identifier(tables.identityClosure),
141
+ identitySeparationTable: chunkVCRRKBLN_cjs.sql.identifier(tables.identitySeparation),
142
+ fulltextTable: chunkVCRRKBLN_cjs.sql.identifier(tables.fulltext)
114
143
  });
115
144
  }
116
- var EXTERNAL_RECORDED_READ_SOURCE = chunkU5W4LKZV_cjs.typeGraphGlobalSymbol(
145
+ var EXTERNAL_RECORDED_READ_SOURCE = chunkVCRRKBLN_cjs.typeGraphGlobalSymbol(
117
146
  "external-recorded-read-source-v1"
118
147
  );
119
- var TYPEGRAPH_RECORDED_READ_SOURCE = chunkU5W4LKZV_cjs.typeGraphGlobalSymbol(
148
+ var TYPEGRAPH_RECORDED_READ_SOURCE = chunkVCRRKBLN_cjs.typeGraphGlobalSymbol(
120
149
  "typegraph-recorded-read-source-v1"
121
150
  );
122
151
  function recordedRelation(options) {
@@ -130,7 +159,7 @@ function recordedRelation(options) {
130
159
  function requireExternalRecordedReadSource(source) {
131
160
  if (source === void 0) return void 0;
132
161
  if (isExternalRecordedReadSource(source)) return source;
133
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
162
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
134
163
  "recordedRead must be created with recordedRelation({ schema }).",
135
164
  { code: "INVALID_RECORDED_READ_SOURCE" },
136
165
  {
@@ -154,7 +183,7 @@ function createRecordedReadBinding(schema) {
154
183
  function requireRecordedReadBinding(binding, surface) {
155
184
  if (isRecordedReadBinding(binding)) return binding;
156
185
  if (binding !== void 0) {
157
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
186
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
158
187
  "Recorded-time reads require a recorded read relation created by TypeGraph.",
159
188
  { code: "INVALID_RECORDED_READ_BINDING", surface },
160
189
  {
@@ -162,7 +191,7 @@ function requireRecordedReadBinding(binding, surface) {
162
191
  }
163
192
  );
164
193
  }
165
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
194
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
166
195
  "Recorded-time reads require a recorded read relation.",
167
196
  { code: "RECORDED_READ_REQUIRES_BINDING", surface },
168
197
  {
@@ -191,6 +220,10 @@ function recordedReadSqlSchema(binding) {
191
220
  recordedEdgesTable: schema.recordedEdgesTable,
192
221
  recordedClockTable: schema.recordedClockTable,
193
222
  revisionOriginsTable: schema.revisionOriginsTable,
223
+ identityAssertionsTable: schema.identityAssertionsTable,
224
+ recordedIdentityAssertionsTable: schema.recordedIdentityAssertionsTable,
225
+ identityClosureTable: schema.identityClosureTable,
226
+ identitySeparationTable: schema.identitySeparationTable,
194
227
  fulltextTable: schema.fulltextTable
195
228
  });
196
229
  }
@@ -222,5 +255,5 @@ exports.requireExternalRecordedReadSource = requireExternalRecordedReadSource;
222
255
  exports.requireRecordedReadBinding = requireRecordedReadBinding;
223
256
  exports.requireSqlSchema = requireSqlSchema;
224
257
  exports.vectorSlotKey = vectorSlotKey;
225
- //# sourceMappingURL=chunk-CPEL3YIR.cjs.map
226
- //# sourceMappingURL=chunk-CPEL3YIR.cjs.map
258
+ //# sourceMappingURL=chunk-NFCVHQ5P.cjs.map
259
+ //# sourceMappingURL=chunk-NFCVHQ5P.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/query/compiler/schema.ts"],"names":["typeGraphGlobalSymbol","ConfigurationError","MAX_PG_IDENTIFIER_LENGTH","isSqlFragment","sql"],"mappings":";;;;;;;AAaA,IAAM,gBAAA,GAAkCA,wCAAsB,eAAe,CAAA;AAiGtE,IAAe,YAAf,MAAoD;AAc3D,CAAA;AAEA,IAAM,mBAAA,GAAN,cAAkC,SAAA,CAAU;AAAA,EAEjC,MAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAA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AAA,CAAO;AAAA,GACvB,CAAA;AACH;AAOO,SAAS,qBAAA,CACd,MAAA,EACA,YAAA,EACA,OAAA,EACA,OAAA,EACW;AACX,EAAA,MAAM,UAAA,GAAa,gBAAA,CAAiB,MAAA,EAAQ,CAAA,EAAG,OAAO,CAAA,OAAA,CAAS,CAAA;AAC/D,EAAA,IAAI,YAAA,KAAiB,QAAW,OAAO,UAAA;AACvC,EAAA,OAAO,qBAAA,CAAsB,0BAAA,CAA2B,OAAA,EAAS,OAAO,CAAC,CAAA;AAC3E;AAKO,IAAM,qBAAgC,eAAA;AA0BtC,SAAS,aAAA,CAAc,UAAkB,SAAA,EAA2B;AACzE,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAS,SAAS,CAAA,CAAA;AACtC;AAOO,IAAM,gBAAA,GAAmB;AACzB,IAAM,oBAAA,GAAuB;AAC7B,IAAM,kBAAA,GAAqB;AAC3B,IAAM,2BAAA,GAA8B","file":"chunk-NFCVHQ5P.cjs","sourcesContent":["/**\n * SQL Schema Configuration for Query Compilation\n *\n * Provides table and column identifiers that the query compiler uses.\n * This allows the compiler to work with custom table names instead of\n * hard-coded defaults.\n */\nimport { type VectorIndexType, type VectorMetric } from \"../../backend/types\";\nimport { MAX_PG_IDENTIFIER_LENGTH } from \"../../constants\";\nimport { ConfigurationError } from \"../../errors\";\nimport { typeGraphGlobalSymbol } from \"../../utils/global-symbol\";\nimport { isSqlFragment, sql, type SqlFragment } from \"../sql-fragment\";\n\nconst SQL_SCHEMA_BRAND: unique symbol = typeGraphGlobalSymbol(\"sql-schema-v1\");\n\n/**\n * Table names for TypeGraph SQL schema.\n *\n * Carries every customizable physical-table name the backend exposes,\n * including the secondary tables (`uniques`) that the query compiler\n * itself doesn't reference but `materializeRemovals` and other\n * cleanup paths need to address by name. Backends without a\n * `uniques` table (custom embeddings-only stores) leave it as the\n * default — the cleanup path is a no-op for kinds with no unique\n * rows.\n */\nexport type SqlTableNames = Readonly<{\n /** Nodes table name (default: \"typegraph_nodes\") */\n nodes: string;\n /** Edges table name (default: \"typegraph_edges\") */\n edges: string;\n /** Recorded node relation table name (default: \"typegraph_recorded_nodes\") */\n recordedNodes?: string | undefined;\n /** Recorded edge relation table name (default: \"typegraph_recorded_edges\") */\n recordedEdges?: string | undefined;\n /** Recorded-time commit clock table name (default: \"typegraph_recorded_clock\") */\n recordedClock?: string | undefined;\n /** Durable per-graph revision-origin table name (default: \"typegraph_revision_origins\") */\n revisionOrigins?: string | undefined;\n /** Identity assertion ledger (default: \"typegraph_identity_assertions\") */\n identityAssertions?: string | undefined;\n /** Recorded identity assertion relation */\n recordedIdentityAssertions?: string | undefined;\n /** Derived current identity closure */\n identityClosure?: string | undefined;\n /** Derived separation relation over identity classes */\n identitySeparation?: string | undefined;\n /** Node fulltext table name (default: \"typegraph_node_fulltext\") */\n fulltext: string;\n /** Node uniques table name (default: \"typegraph_node_uniques\") */\n uniques: string;\n}>;\n\nexport type ResolvedSqlTableNames = Readonly<{\n /** Nodes table name */\n nodes: string;\n /** Edges table name */\n edges: string;\n /** Recorded node relation table name */\n recordedNodes: string;\n /** Recorded edge relation table name */\n recordedEdges: string;\n /** Recorded-time commit clock table name */\n recordedClock: string;\n /** Durable per-graph revision-origin table name */\n revisionOrigins: string;\n identityAssertions: string;\n recordedIdentityAssertions: string;\n identityClosure: string;\n identitySeparation: string;\n /** Node fulltext table name */\n fulltext: string;\n /** Node uniques table name */\n uniques: string;\n}>;\n\ntype SqlSchemaFields = Readonly<{\n /** Table names */\n tables: ResolvedSqlTableNames;\n /** Get a `SqlFragment` reference to the nodes table. */\n nodesTable: SqlFragment;\n /** Get a `SqlFragment` reference to the edges table. */\n edgesTable: SqlFragment;\n /** Get a `SqlFragment` reference to the recorded node relation. */\n recordedNodesTable: SqlFragment;\n /** Get a `SqlFragment` reference to the recorded edge relation. */\n recordedEdgesTable: SqlFragment;\n /** Get a `SqlFragment` reference to the recorded-time commit clock. */\n recordedClockTable: SqlFragment;\n /** Get a `SqlFragment` reference to the durable per-graph revision origins. */\n revisionOriginsTable: SqlFragment;\n /** Get a `SqlFragment` reference to the identity assertion ledger. */\n identityAssertionsTable: SqlFragment;\n /** Get a `SqlFragment` reference to the recorded identity assertion relation. */\n recordedIdentityAssertionsTable: SqlFragment;\n /** Get a `SqlFragment` reference to the derived identity closure. */\n identityClosureTable: SqlFragment;\n /** Get a `SqlFragment` reference to the derived identity separation relation. */\n identitySeparationTable: SqlFragment;\n /** Get a `SqlFragment` reference to the fulltext table. */\n fulltextTable: SqlFragment;\n}>;\n\n/**\n * SQL schema configuration for query compilation.\n * Contains table identifiers and utility methods for generating `SqlFragment` references.\n *\n * Branded and frozen by {@link createSqlSchema}; callers should not construct\n * schema-shaped objects by hand.\n */\nexport abstract class SqlSchema implements SqlSchemaFields {\n declare private readonly typeGraphSqlSchemaBrand: true;\n abstract readonly tables: ResolvedSqlTableNames;\n abstract readonly nodesTable: SqlFragment;\n abstract readonly edgesTable: SqlFragment;\n abstract readonly recordedNodesTable: SqlFragment;\n abstract readonly recordedEdgesTable: SqlFragment;\n abstract readonly recordedClockTable: SqlFragment;\n abstract readonly revisionOriginsTable: SqlFragment;\n abstract readonly identityAssertionsTable: SqlFragment;\n abstract readonly recordedIdentityAssertionsTable: SqlFragment;\n abstract readonly identityClosureTable: SqlFragment;\n abstract readonly identitySeparationTable: SqlFragment;\n abstract readonly fulltextTable: SqlFragment;\n}\n\nclass SqlSchemaDescriptor extends SqlSchema {\n declare readonly [SQL_SCHEMA_BRAND]: true;\n readonly tables: ResolvedSqlTableNames;\n readonly nodesTable: SqlFragment;\n readonly edgesTable: SqlFragment;\n readonly recordedNodesTable: SqlFragment;\n readonly recordedEdgesTable: SqlFragment;\n readonly recordedClockTable: SqlFragment;\n readonly revisionOriginsTable: SqlFragment;\n readonly identityAssertionsTable: SqlFragment;\n readonly recordedIdentityAssertionsTable: SqlFragment;\n readonly identityClosureTable: SqlFragment;\n readonly identitySeparationTable: SqlFragment;\n readonly fulltextTable: SqlFragment;\n\n constructor(fields: SqlSchemaFields) {\n super();\n Object.defineProperty(this, SQL_SCHEMA_BRAND, {\n configurable: false,\n enumerable: false,\n value: true,\n writable: false,\n });\n this.tables = fields.tables;\n this.nodesTable = fields.nodesTable;\n this.edgesTable = fields.edgesTable;\n this.recordedNodesTable = fields.recordedNodesTable;\n this.recordedEdgesTable = fields.recordedEdgesTable;\n this.recordedClockTable = fields.recordedClockTable;\n this.revisionOriginsTable = fields.revisionOriginsTable;\n this.identityAssertionsTable = fields.identityAssertionsTable;\n this.recordedIdentityAssertionsTable =\n fields.recordedIdentityAssertionsTable;\n this.identityClosureTable = fields.identityClosureTable;\n this.identitySeparationTable = fields.identitySeparationTable;\n this.fulltextTable = fields.fulltextTable;\n Object.freeze(this);\n }\n}\n\n/**\n * Default table names matching the standard TypeGraph schema.\n */\nconst DEFAULT_TABLE_NAMES: ResolvedSqlTableNames = {\n nodes: \"typegraph_nodes\",\n edges: \"typegraph_edges\",\n recordedNodes: \"typegraph_recorded_nodes\",\n recordedEdges: \"typegraph_recorded_edges\",\n recordedClock: \"typegraph_recorded_clock\",\n revisionOrigins: \"typegraph_revision_origins\",\n identityAssertions: \"typegraph_identity_assertions\",\n recordedIdentityAssertions: \"typegraph_recorded_identity_assertions\",\n identityClosure: \"typegraph_identity_closure\",\n identitySeparation: \"typegraph_identity_separation\",\n fulltext: \"typegraph_node_fulltext\",\n uniques: \"typegraph_node_uniques\",\n};\n\nfunction resolveTableNames(\n names: Partial<SqlTableNames>,\n): ResolvedSqlTableNames {\n return {\n nodes: names.nodes ?? DEFAULT_TABLE_NAMES.nodes,\n edges: names.edges ?? DEFAULT_TABLE_NAMES.edges,\n recordedNodes: names.recordedNodes ?? DEFAULT_TABLE_NAMES.recordedNodes,\n recordedEdges: names.recordedEdges ?? DEFAULT_TABLE_NAMES.recordedEdges,\n recordedClock: names.recordedClock ?? DEFAULT_TABLE_NAMES.recordedClock,\n revisionOrigins:\n names.revisionOrigins ?? DEFAULT_TABLE_NAMES.revisionOrigins,\n identityAssertions:\n names.identityAssertions ?? DEFAULT_TABLE_NAMES.identityAssertions,\n recordedIdentityAssertions:\n names.recordedIdentityAssertions ??\n DEFAULT_TABLE_NAMES.recordedIdentityAssertions,\n identityClosure:\n names.identityClosure ?? DEFAULT_TABLE_NAMES.identityClosure,\n identitySeparation:\n names.identitySeparation ?? DEFAULT_TABLE_NAMES.identitySeparation,\n fulltext: names.fulltext ?? DEFAULT_TABLE_NAMES.fulltext,\n uniques: names.uniques ?? DEFAULT_TABLE_NAMES.uniques,\n };\n}\n\n/**\n * Regex for valid SQL identifiers.\n * Must start with a letter or underscore.\n * Can contain letters, digits, underscores, and dollar signs.\n * Dollar signs are a PostgreSQL extension but commonly supported.\n */\nconst VALID_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/i;\n\n/**\n * Validates that a table name is a valid SQL identifier.\n *\n * @throws Error if the table name is invalid\n */\nfunction validateTableName(name: string, label: string): void {\n if (!name || name.length === 0) {\n throw new ConfigurationError(`${label} table name cannot be empty`);\n }\n if (name.length > MAX_PG_IDENTIFIER_LENGTH) {\n throw new ConfigurationError(\n `${label} table name exceeds maximum length of ${MAX_PG_IDENTIFIER_LENGTH} characters`,\n );\n }\n if (!VALID_IDENTIFIER_PATTERN.test(name)) {\n throw new ConfigurationError(\n `${label} table name \"${name}\" is not a valid SQL identifier. ` +\n `Table names must start with a letter or underscore and contain only letters, digits, underscores, or dollar signs.`,\n );\n }\n}\n\nfunction freezeSqlSchema(fields: SqlSchemaFields): SqlSchema {\n return new SqlSchemaDescriptor(fields);\n}\n\nfunction isSqlSchema(schema: unknown): schema is SqlSchema {\n if (typeof schema !== \"object\" || schema === null) return false;\n const candidate = schema as Record<PropertyKey, unknown>;\n return (\n candidate[SQL_SCHEMA_BRAND] === true &&\n typeof candidate[\"tables\"] === \"object\" &&\n candidate[\"tables\"] !== null &&\n Object.isFrozen(candidate[\"tables\"]) &&\n isSqlFragment(candidate[\"nodesTable\"]) &&\n isSqlFragment(candidate[\"edgesTable\"]) &&\n isSqlFragment(candidate[\"recordedNodesTable\"]) &&\n isSqlFragment(candidate[\"recordedEdgesTable\"]) &&\n isSqlFragment(candidate[\"recordedClockTable\"]) &&\n isSqlFragment(candidate[\"revisionOriginsTable\"]) &&\n isSqlFragment(candidate[\"fulltextTable\"]) &&\n Object.isFrozen(candidate)\n );\n}\n\nexport function requireSqlSchema(\n schema: unknown,\n surface = \"SqlSchema\",\n): SqlSchema {\n if (isSqlSchema(schema)) return schema;\n throw new ConfigurationError(\n `${surface} must be created with createSqlSchema(...).`,\n { code: \"INVALID_SQL_SCHEMA\", surface },\n {\n suggestion:\n \"Pass the result of createSqlSchema(...) instead of a plain schema-shaped object.\",\n },\n );\n}\n\n/**\n * Creates a SqlSchema configuration from table names.\n *\n * Table names are validated to ensure they are valid SQL identifiers.\n * This prevents SQL injection and ensures compatibility across databases.\n *\n * @param names - Optional custom table names (defaults to standard names)\n * @returns SqlSchema configuration for query compilation\n * @throws Error if any table name is invalid\n *\n * @example\n * ```typescript\n * // Use default table names\n * const schema = createSqlSchema();\n *\n * // Use custom table names\n * const schema = createSqlSchema({\n * nodes: \"myapp_nodes\",\n * edges: \"myapp_edges\",\n * fulltext: \"myapp_fulltext\",\n * });\n * ```\n */\nexport function createSqlSchema(names: Partial<SqlTableNames> = {}): SqlSchema {\n const tables = resolveTableNames(names);\n\n // Validate all table names\n validateTableName(tables.nodes, \"nodes\");\n validateTableName(tables.edges, \"edges\");\n validateTableName(tables.recordedNodes, \"recordedNodes\");\n validateTableName(tables.recordedEdges, \"recordedEdges\");\n validateTableName(tables.recordedClock, \"recordedClock\");\n validateTableName(tables.revisionOrigins, \"revisionOrigins\");\n validateTableName(tables.identityAssertions, \"identityAssertions\");\n validateTableName(\n tables.recordedIdentityAssertions,\n \"recordedIdentityAssertions\",\n );\n validateTableName(tables.identityClosure, \"identityClosure\");\n validateTableName(tables.identitySeparation, \"identitySeparation\");\n validateTableName(tables.fulltext, \"fulltext\");\n validateTableName(tables.uniques, \"uniques\");\n\n return freezeSqlSchema({\n tables: Object.freeze(tables),\n nodesTable: sql.identifier(tables.nodes),\n edgesTable: sql.identifier(tables.edges),\n recordedNodesTable: sql.identifier(tables.recordedNodes),\n recordedEdgesTable: sql.identifier(tables.recordedEdges),\n recordedClockTable: sql.identifier(tables.recordedClock),\n revisionOriginsTable: sql.identifier(tables.revisionOrigins),\n identityAssertionsTable: sql.identifier(tables.identityAssertions),\n recordedIdentityAssertionsTable: sql.identifier(\n tables.recordedIdentityAssertions,\n ),\n identityClosureTable: sql.identifier(tables.identityClosure),\n identitySeparationTable: sql.identifier(tables.identitySeparation),\n fulltextTable: sql.identifier(tables.fulltext),\n });\n}\n\n/**\n * The recorded/system-time relation a read coordinate may reconstruct from.\n *\n * TypeGraph's built-in capture relation is bound by `createStore(..., {\n * history: true })`. Hosts can also bind externally populated row-compatible\n * recorded relations through `recordedRelation({ schema })`. Keeping both as\n * explicit values separates the read contract from the write-capture mechanism\n * so future external/TMS-owned recorded relations can feed the same query\n * machinery without changing StoreView or ReadCoordinate.\n */\nconst EXTERNAL_RECORDED_READ_SOURCE: unique symbol = typeGraphGlobalSymbol(\n \"external-recorded-read-source-v1\",\n);\n\nexport type ExternalRecordedReadSource = Readonly<{\n source: \"external\";\n schema: SqlSchema;\n [EXTERNAL_RECORDED_READ_SOURCE]: true;\n}>;\n\ntype ExternalRecordedReadSourceCandidate = Readonly<{\n source?: unknown;\n schema?: unknown;\n [EXTERNAL_RECORDED_READ_SOURCE]?: unknown;\n}>;\n\nconst TYPEGRAPH_RECORDED_READ_SOURCE: unique symbol = typeGraphGlobalSymbol(\n \"typegraph-recorded-read-source-v1\",\n);\n\nexport type TypeGraphRecordedReadSource = Readonly<{\n source: \"typegraph-capture\";\n schema: SqlSchema;\n [TYPEGRAPH_RECORDED_READ_SOURCE]: true;\n}>;\n\ntype RecordedReadSource =\n ExternalRecordedReadSource | TypeGraphRecordedReadSource;\n\nexport type RecordedReadBinding = RecordedReadSource;\n\nexport type RecordedRelationOptions = Readonly<{\n schema: SqlSchema;\n}>;\n\nexport function recordedRelation(\n options: RecordedRelationOptions,\n): ExternalRecordedReadSource {\n const schema = requireSqlSchema(options.schema, \"recordedRelation schema\");\n return Object.freeze({\n source: \"external\",\n schema,\n [EXTERNAL_RECORDED_READ_SOURCE]: true as const,\n });\n}\n\nexport function requireExternalRecordedReadSource(\n source: unknown,\n): ExternalRecordedReadSource | undefined {\n if (source === undefined) return undefined;\n if (isExternalRecordedReadSource(source)) return source;\n throw new ConfigurationError(\n \"recordedRead must be created with recordedRelation({ schema }).\",\n { code: \"INVALID_RECORDED_READ_SOURCE\" },\n {\n suggestion:\n \"Pass { recordedRead: recordedRelation({ schema }) } for an externally populated recorded relation. Use { history: true } when TypeGraph should capture writes.\",\n },\n );\n}\n\nfunction isExternalRecordedReadSource(\n source: unknown,\n): source is ExternalRecordedReadSource {\n if (typeof source !== \"object\" || source === null) return false;\n const candidate = source as ExternalRecordedReadSourceCandidate;\n return (\n candidate.source === \"external\" &&\n candidate[EXTERNAL_RECORDED_READ_SOURCE] === true &&\n isSqlSchema(candidate.schema) &&\n Object.isFrozen(candidate)\n );\n}\n\nexport function createRecordedReadBinding(\n schema: SqlSchema,\n): TypeGraphRecordedReadSource {\n const readSchema = requireSqlSchema(schema, \"recorded read binding schema\");\n return Object.freeze({\n source: \"typegraph-capture\",\n schema: readSchema,\n [TYPEGRAPH_RECORDED_READ_SOURCE]: true as const,\n });\n}\n\nexport function requireRecordedReadBinding(\n binding: unknown,\n surface: string,\n): RecordedReadBinding {\n if (isRecordedReadBinding(binding)) return binding;\n if (binding !== undefined) {\n throw new ConfigurationError(\n \"Recorded-time reads require a recorded read relation created by TypeGraph.\",\n { code: \"INVALID_RECORDED_READ_BINDING\", surface },\n {\n suggestion:\n \"Use createStore(graph, backend, { history: true }) or { recordedRead: recordedRelation({ schema }) } instead of passing a plain object.\",\n },\n );\n }\n throw new ConfigurationError(\n \"Recorded-time reads require a recorded read relation.\",\n { code: \"RECORDED_READ_REQUIRES_BINDING\", surface },\n {\n suggestion:\n \"Create the store with createStore(graph, backend, { history: true }) to bind TypeGraph's built-in captured relation, or pass { recordedRead: recordedRelation({ schema }) } for an externally populated recorded relation.\",\n },\n );\n}\n\ntype TypeGraphRecordedReadSourceCandidate = Readonly<{\n source?: unknown;\n schema?: unknown;\n [TYPEGRAPH_RECORDED_READ_SOURCE]?: unknown;\n}>;\n\nfunction isTypeGraphRecordedReadSource(\n source: unknown,\n): source is TypeGraphRecordedReadSource {\n if (typeof source !== \"object\" || source === null) return false;\n const candidate = source as TypeGraphRecordedReadSourceCandidate;\n return (\n candidate.source === \"typegraph-capture\" &&\n candidate[TYPEGRAPH_RECORDED_READ_SOURCE] === true &&\n isSqlSchema(candidate.schema) &&\n Object.isFrozen(candidate)\n );\n}\n\nfunction isRecordedReadBinding(\n binding: unknown,\n): binding is RecordedReadBinding {\n return (\n isExternalRecordedReadSource(binding) ||\n isTypeGraphRecordedReadSource(binding)\n );\n}\n\n/**\n * Returns a schema view whose primary node/edge sources are the recorded-time\n * relations. The recorded relations are row-compatible with the live tables\n * for every column the query compiler, subgraph extractor, and algorithms\n * already read; the temporal filter adds the `recorded_from/to` predicate.\n */\nexport function recordedReadSqlSchema(binding: RecordedReadBinding): SqlSchema {\n const { schema } = requireRecordedReadBinding(\n binding,\n \"recorded-read-schema\",\n );\n return freezeSqlSchema({\n tables: schema.tables,\n nodesTable: schema.recordedNodesTable,\n edgesTable: schema.recordedEdgesTable,\n recordedNodesTable: schema.recordedNodesTable,\n recordedEdgesTable: schema.recordedEdgesTable,\n recordedClockTable: schema.recordedClockTable,\n revisionOriginsTable: schema.revisionOriginsTable,\n identityAssertionsTable: schema.identityAssertionsTable,\n recordedIdentityAssertionsTable: schema.recordedIdentityAssertionsTable,\n identityClosureTable: schema.identityClosureTable,\n identitySeparationTable: schema.identitySeparationTable,\n fulltextTable: schema.fulltextTable,\n });\n}\n\n/**\n * Resolves the read schema for a coordinate: the live schema when no recorded\n * pin is set, or the recorded-relation view when `recordedAsOf` is present. The\n * single place every read path decides whether to source the recorded tables.\n */\nexport function recordedReadSchemaFor(\n schema: SqlSchema,\n recordedAsOf: string | undefined,\n binding: RecordedReadBinding | undefined,\n surface: string,\n): SqlSchema {\n const baseSchema = requireSqlSchema(schema, `${surface} schema`);\n if (recordedAsOf === undefined) return baseSchema;\n return recordedReadSqlSchema(requireRecordedReadBinding(binding, surface));\n}\n\n/**\n * Default SqlSchema using standard TypeGraph table names.\n */\nexport const DEFAULT_SQL_SCHEMA: SqlSchema = createSqlSchema();\n\n/**\n * The compiler's resolved view of one declared embedding field — the\n * `(dimensions, metric, indexType)` a {@link VectorStrategy} needs to\n * name and scan the field's typed per-`(kind, field)` storage. Sourced\n * from the registered node schema's `embedding()` declaration when the\n * store builds its compile options.\n */\nexport type VectorSlotDescriptor = Readonly<{\n dimensions: number;\n metric: VectorMetric;\n indexType: VectorIndexType;\n}>;\n\n/**\n * Map of declared embedding slots keyed by {@link vectorSlotKey} -\n * `\"<nodeKind>\\0<fieldPath>\"` (NUL-separated). Carries every `(concrete kind,\n * fieldPath)` that declares an embedding field, so the compiler's\n * `field.similarTo(...)` CTE can UNION ALL the per-field tables for the\n * kinds in an alias that actually declare the field (only\n * `includeSubClasses` yields more than one).\n */\nexport type VectorSlotMap = ReadonlyMap<string, VectorSlotDescriptor>;\n\n/** NUL-delimited composite key for {@link VectorSlotMap}. */\nexport function vectorSlotKey(nodeKind: string, fieldPath: string): string {\n return `${nodeKind}\\u0000${fieldPath}`;\n}\n\n/**\n * CTE aliases used by the standard query emitter. Joining on these names\n * across multiple builder files is fragile when typed as raw strings —\n * import these constants instead.\n */\nexport const ALIAS_CTE_PREFIX = \"cte_\" as const;\nexport const EMBEDDINGS_CTE_ALIAS = \"cte_embeddings\" as const;\nexport const FULLTEXT_CTE_ALIAS = \"cte_fulltext\" as const;\nexport const HYBRID_CANDIDATES_CTE_ALIAS = \"cte_relevance_candidates\" as const;\n"]}
@@ -74,6 +74,10 @@ Suggestion: ${this.suggestion}`;
74
74
  return lines.join("\n");
75
75
  }
76
76
  };
77
+ var INVERTED_VALIDITY_WINDOW_CODE = "INVERTED_VALIDITY_WINDOW";
78
+ var IMMUTABLE_VALIDITY_LOWER_BOUND_CODE = "IMMUTABLE_VALIDITY_LOWER_BOUND";
79
+ var EDGE_IDENTITY_MISMATCH_CODE = "EDGE_IDENTITY_MISMATCH";
80
+ var ENTITY_ALREADY_EXISTS_CODE = "ENTITY_ALREADY_EXISTS";
77
81
  var ValidationError = class extends TypeGraphError {
78
82
  constructor(message, details, options) {
79
83
  const fieldList = details.issues.length > 0 ? details.issues.map((index) => index.path || "(root)").join(", ") : "unknown";
@@ -239,6 +243,36 @@ var DisjointError = class extends TypeGraphError {
239
243
  this.name = "DisjointError";
240
244
  }
241
245
  };
246
+ var IdentityContradictionError = class extends TypeGraphError {
247
+ constructor(details, options) {
248
+ super(
249
+ `Identity contradiction: ${details.a.kind}/${details.a.id} and ${details.b.kind}/${details.b.id} cannot satisfy ${details.operation}.`,
250
+ "IDENTITY_CONTRADICTION",
251
+ {
252
+ details,
253
+ category: "constraint",
254
+ suggestion: "Retract the conflicting identity assertion or correct the graph ontology before retrying.",
255
+ cause: options?.cause
256
+ }
257
+ );
258
+ this.name = "IdentityContradictionError";
259
+ }
260
+ };
261
+ var IdentitySeparationViolationError = class extends TypeGraphError {
262
+ constructor(details, options) {
263
+ super(
264
+ `Identity separation violated: ${details.a.kind}/${details.a.id} and ${details.b.kind}/${details.b.id} are held apart by assertion ${details.assertionId}, but this write would put both in identity class ${details.classKey}.`,
265
+ "IDENTITY_SEPARATION_VIOLATION",
266
+ {
267
+ details,
268
+ category: "constraint",
269
+ suggestion: "Retract the conflicting different assertion before merging these identity classes. If no application call requested this merge, the write reached the ledger through a path that skipped identity validation.",
270
+ cause: options?.cause
271
+ }
272
+ );
273
+ this.name = "IdentitySeparationViolationError";
274
+ }
275
+ };
242
276
  var RestrictedDeleteError = class extends TypeGraphError {
243
277
  constructor(details, options) {
244
278
  const edgeList = details.edgeKinds.join(", ");
@@ -398,6 +432,35 @@ var ConfigurationError = class extends TypeGraphError {
398
432
  this.name = "ConfigurationError";
399
433
  }
400
434
  };
435
+ var CONTRIBUTION_REBUILD_REFUSAL_MESSAGE = {
436
+ "vector-source-unavailable": "Vector contributions cannot be rebuilt: TypeGraph stores the vectors callers supply and never the inputs that produced them, so the embeddings exist only in the storage a rebuild would drop.",
437
+ "no-drop-ddl": "The active strategy declares no teardown DDL for this contribution, so its storage cannot be dropped and recreated.",
438
+ "no-schema-fence": "This backend exposes no transactional schema fence, so a rebuild's drop, recreate, refill, and marker stamp cannot be made atomic.",
439
+ "shared-storage-in-use": "This contribution's storage is provisioned at a different shape than the current declaration, and the only repair \u2014 recreating it \u2014 would destroy fulltext content belonging to other graphs that share the same table and can only be rebuilt from their own processes."
440
+ };
441
+ var CONTRIBUTION_REBUILD_REFUSAL_SUGGESTION = {
442
+ "vector-source-unavailable": "Run store.reembedVectorField(kind, fieldPath, { embed }) instead: it recreates the field's storage and takes the callback that regenerates the embeddings the recreate discards.",
443
+ "no-drop-ddl": "Declare dropDdl on the contribution returned from the strategy's ownedTables(), or drop and recreate the table out of band and then run store.repairContributions() to re-stamp its marker.",
444
+ "no-schema-fence": "Use a backend that implements schemaWriteTransaction, or perform the drop and recreate out of band during a maintenance window and then run store.repairContributions() followed by store.search.rebuildFulltext().",
445
+ "shared-storage-in-use": `Recreate the shared table during a maintenance window with every graph that uses it offline: drop it out of band, then run store.rebuildContribution("fulltext") once per graph on this database. Each run recreates the table from the current DDL and refills that graph's rows from its own nodes.`
446
+ };
447
+ var ContributionRebuildUnsupportedError = class extends TypeGraphError {
448
+ reason;
449
+ constructor(reason, details = {}, options) {
450
+ super(
451
+ CONTRIBUTION_REBUILD_REFUSAL_MESSAGE[reason],
452
+ "CONTRIBUTION_REBUILD_UNSUPPORTED",
453
+ {
454
+ details: { ...details, reason },
455
+ category: "user",
456
+ suggestion: CONTRIBUTION_REBUILD_REFUSAL_SUGGESTION[reason],
457
+ cause: options?.cause
458
+ }
459
+ );
460
+ this.name = "ContributionRebuildUnsupportedError";
461
+ this.reason = reason;
462
+ }
463
+ };
401
464
  var GraphAlgorithmConvergenceError = class extends TypeGraphError {
402
465
  constructor(algorithm, maxIterations, options = {}) {
403
466
  const oscillating = options.oscillating === true;
@@ -474,6 +537,17 @@ var TrustedImportError = class extends TypeGraphError {
474
537
  this.name = "TrustedImportError";
475
538
  }
476
539
  };
540
+ var ExportStreamCancelledError = class extends TypeGraphError {
541
+ constructor(message, details = {}, options) {
542
+ super(message, "INTERCHANGE_EXPORT_STREAM_ABORTED", {
543
+ details,
544
+ category: "user",
545
+ suggestion: options?.suggestion ?? "Start a new export; the aborted one released its snapshot transaction and the connection it held.",
546
+ cause: options?.cause
547
+ });
548
+ this.name = "ExportStreamCancelledError";
549
+ }
550
+ };
477
551
  var RECORDED_CAPTURE_GUARD_CODES = [
478
552
  "RECORDED_CAPTURE_REQUIRES_CALLBACK_TRANSACTION",
479
553
  "RECORDED_CAPTURE_RAW_SQL_DISABLED",
@@ -624,14 +698,22 @@ exports.BackendDisposedError = BackendDisposedError;
624
698
  exports.CardinalityError = CardinalityError;
625
699
  exports.CompilerInvariantError = CompilerInvariantError;
626
700
  exports.ConfigurationError = ConfigurationError;
701
+ exports.ContributionRebuildUnsupportedError = ContributionRebuildUnsupportedError;
627
702
  exports.DatabaseOperationError = DatabaseOperationError;
628
703
  exports.DisjointError = DisjointError;
704
+ exports.EDGE_IDENTITY_MISMATCH_CODE = EDGE_IDENTITY_MISMATCH_CODE;
705
+ exports.ENTITY_ALREADY_EXISTS_CODE = ENTITY_ALREADY_EXISTS_CODE;
629
706
  exports.EagerMaterializationError = EagerMaterializationError;
630
707
  exports.EdgeNotFoundError = EdgeNotFoundError;
631
708
  exports.EmbeddingDimensionChangedError = EmbeddingDimensionChangedError;
632
709
  exports.EndpointError = EndpointError;
633
710
  exports.EndpointNotFoundError = EndpointNotFoundError;
711
+ exports.ExportStreamCancelledError = ExportStreamCancelledError;
634
712
  exports.GraphAlgorithmConvergenceError = GraphAlgorithmConvergenceError;
713
+ exports.IMMUTABLE_VALIDITY_LOWER_BOUND_CODE = IMMUTABLE_VALIDITY_LOWER_BOUND_CODE;
714
+ exports.INVERTED_VALIDITY_WINDOW_CODE = INVERTED_VALIDITY_WINDOW_CODE;
715
+ exports.IdentityContradictionError = IdentityContradictionError;
716
+ exports.IdentitySeparationViolationError = IdentitySeparationViolationError;
635
717
  exports.InvalidEdgeWeightError = InvalidEdgeWeightError;
636
718
  exports.KindNotFoundError = KindNotFoundError;
637
719
  exports.MIGRATION_FAILURE_REASONS = MIGRATION_FAILURE_REASONS;
@@ -659,5 +741,5 @@ exports.isRecordedCaptureGuardError = isRecordedCaptureGuardError;
659
741
  exports.isSystemError = isSystemError;
660
742
  exports.isTypeGraphError = isTypeGraphError;
661
743
  exports.isUserRecoverable = isUserRecoverable;
662
- //# sourceMappingURL=chunk-C4F7VJ5D.cjs.map
663
- //# sourceMappingURL=chunk-C4F7VJ5D.cjs.map
744
+ //# sourceMappingURL=chunk-NI72YOJB.cjs.map
745
+ //# sourceMappingURL=chunk-NI72YOJB.cjs.map