mcard-js 2.1.41 → 2.1.43

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 (388) hide show
  1. package/dist/{CardCollection-MXTUJV4J.js → CardCollection-7DKJWKAG.js} +3 -2
  2. package/dist/CardCollection-S4RE3RXP.js +10 -0
  3. package/dist/CardCollection-VPN7AAAX.js +10 -0
  4. package/dist/{IndexedDBEngine-2G5KCISA.js → IndexedDBEngine-7JOGM2MM.js} +3 -2
  5. package/dist/IndexedDBEngine-BGZHJK5L.js +12 -0
  6. package/dist/IndexedDBEngine-ZJ442GI7.js +12 -0
  7. package/dist/{LLMRuntime-GIGDMDEZ.js → LLMRuntime-OZNVAPXJ.js} +4 -3
  8. package/dist/{LLMRuntime-LBWUJ7ON.js → LLMRuntime-UPSEDSIK.js} +2 -2
  9. package/dist/{LambdaRuntime-B6D6IQKZ.js → LambdaRuntime-JZ4Q56TI.js} +6 -5
  10. package/dist/LambdaRuntime-PM3OUFHU.js +19 -0
  11. package/dist/LambdaRuntime-WBEK37AF.js +19 -0
  12. package/dist/LambdaRuntime-YKSBAT65.js +19 -0
  13. package/dist/{Loader-3LSJXJQG.js → Loader-7HQVYDPA.js} +2 -2
  14. package/dist/{Loader-BM56B2TX.js → Loader-NYWTV7CQ.js} +4 -3
  15. package/dist/{Loader-CYLAA4XU.js → Loader-OLKPY6HT.js} +3 -3
  16. package/dist/{MCard-H56VOJLR.js → MCard-OYI73CUI.js} +1 -1
  17. package/dist/{MCard-5LIREV2B.js → MCard-XHG3BZC7.js} +2 -2
  18. package/dist/{NetworkRuntime-IAFHPQSX.js → NetworkRuntime-VYCC5HSY.js} +16 -11
  19. package/dist/{NetworkRuntime-JNGKW3DY.js → NetworkRuntime-XQX3LDDI.js} +61 -33
  20. package/dist/{NetworkRuntime-CXPKIAOQ.js → NetworkRuntime-XZR733M5.js} +17 -12
  21. package/dist/{OllamaProvider-QPX2JXL2.js → OllamaProvider-FBZ5WW72.js} +1 -1
  22. package/dist/OllamaProvider-W6TPZNHD.js +9 -0
  23. package/dist/chunk-2NFGZ6PA.js +170 -0
  24. package/dist/{chunk-VXV35I5J.js → chunk-4TYRTQ4V.js} +48 -17
  25. package/dist/chunk-4VWWTGRW.js +497 -0
  26. package/dist/{chunk-4PDYHPR6.js → chunk-5GHZP7E5.js} +4 -2
  27. package/dist/{chunk-42VF42KH.js → chunk-5HZNWJFT.js} +4 -2
  28. package/dist/{chunk-DEYMHG5A.js → chunk-6MG5ZHAP.js} +58 -22
  29. package/dist/{chunk-7V37AAPK.js → chunk-7B4PABOL.js} +16 -7
  30. package/dist/chunk-A5S2PI37.js +47 -0
  31. package/dist/chunk-BFD4WSWU.js +497 -0
  32. package/dist/chunk-BSEFN25Q.js +32 -0
  33. package/dist/{chunk-3LPY36OG.js → chunk-CBEVE7RG.js} +20 -15
  34. package/dist/{chunk-A5AB4WQN.js → chunk-DPA3ZK4Q.js} +30 -21
  35. package/dist/{chunk-5FA54AMM.js → chunk-EJHX3VZL.js} +54 -21
  36. package/dist/{chunk-QXPHMSPA.js → chunk-GNF4WAPV.js} +22 -9
  37. package/dist/{chunk-XPG6B5IW.js → chunk-JHIA2BQK.js} +26 -13
  38. package/dist/{chunk-4I5IZILN.js → chunk-KGPICAQW.js} +10 -7
  39. package/dist/{chunk-4WBJPHZP.js → chunk-MST5AZXJ.js} +17 -8
  40. package/dist/{chunk-K35KFTEA.js → chunk-N6KDHCBC.js} +58 -33
  41. package/dist/{chunk-2R4ESMZB.js → chunk-NFO5NU6B.js} +5 -3
  42. package/dist/chunk-OKWBHCKC.js +170 -0
  43. package/dist/{chunk-FIE4LAJG.js → chunk-OX3K6UZJ.js} +5 -3
  44. package/dist/{chunk-6SEX42H2.js → chunk-R3K7DG7O.js} +21 -16
  45. package/dist/chunk-RB35Z35T.js +44 -0
  46. package/dist/{chunk-AWGFLRLI.js → chunk-SP4YPKPR.js} +51 -318
  47. package/dist/chunk-U7TSFDKX.js +217 -0
  48. package/dist/chunk-UP3SQX56.js +112 -0
  49. package/dist/{chunk-4EUEU4SM.js → chunk-VGIRC3HX.js} +13 -110
  50. package/dist/chunk-WGG7526Z.js +112 -0
  51. package/dist/{chunk-3JBSRALP.js → chunk-WNKP66IR.js} +10 -7
  52. package/dist/{chunk-DOC55MPG.js → chunk-WR6ISHCS.js} +11 -3
  53. package/dist/{chunk-52UNWVOD.js → chunk-ZVOPQ5BM.js} +54 -21
  54. package/dist/chunk-ZZMOPQER.js +217 -0
  55. package/dist/index.browser.cjs +79 -1454
  56. package/dist/index.browser.d.cts +2 -17
  57. package/dist/index.browser.d.ts +2 -17
  58. package/dist/index.browser.js +7 -6
  59. package/dist/index.cjs +306 -1631
  60. package/dist/index.d.cts +3 -1
  61. package/dist/index.d.ts +3 -1
  62. package/dist/index.js +49 -35
  63. package/dist/storage/SqliteNodeEngine.cjs +59 -1335
  64. package/dist/storage/SqliteNodeEngine.js +4 -3
  65. package/dist/storage/SqliteWasmEngine.cjs +57 -1335
  66. package/dist/storage/SqliteWasmEngine.js +4 -3
  67. package/package.json +12 -8
  68. package/dist/CardCollection-4OFJ6XQJ.js +0 -9
  69. package/dist/CardCollection-7PDWM24F.js +0 -9
  70. package/dist/CardCollection-CEFQ5PA6.js +0 -9
  71. package/dist/CardCollection-GUEYGN2Y.js +0 -9
  72. package/dist/CardCollection-KDO4CQ4B.js +0 -9
  73. package/dist/CardCollection-PB7ZY73E.js +0 -9
  74. package/dist/CardCollection-RK4DVH63.js +0 -9
  75. package/dist/CardCollection-T376E3TS.js +0 -9
  76. package/dist/CardCollection-WGCKKUOD.js +0 -9
  77. package/dist/CardCollection-XON2IWDU.js +0 -9
  78. package/dist/CardCollection-ZEI6FMP3.js +0 -9
  79. package/dist/EventProducer-MW6QF4IO.js +0 -47
  80. package/dist/EventProducer-V7RY2KKR.js +0 -47
  81. package/dist/FileIO.d.ts +0 -44
  82. package/dist/FileIO.d.ts.map +0 -1
  83. package/dist/FileIO.js +0 -203
  84. package/dist/FileIO.js.map +0 -1
  85. package/dist/IndexedDBEngine-7JI2CL32.js +0 -10
  86. package/dist/IndexedDBEngine-7OHQIRTI.js +0 -10
  87. package/dist/IndexedDBEngine-E5YJQG4U.js +0 -10
  88. package/dist/IndexedDBEngine-NV625E7L.js +0 -10
  89. package/dist/IndexedDBEngine-RPQS7ILF.js +0 -10
  90. package/dist/IndexedDBEngine-S3ZWCSI7.js +0 -10
  91. package/dist/IndexedDBEngine-T7OC5GRR.js +0 -10
  92. package/dist/LLMRuntime-BKB3CLXM.js +0 -16
  93. package/dist/LLMRuntime-BQUUFLAB.js +0 -16
  94. package/dist/LLMRuntime-TNBC4JCB.js +0 -16
  95. package/dist/LambdaRuntime-4YILF3G7.js +0 -15
  96. package/dist/LambdaRuntime-53TPVENI.js +0 -16
  97. package/dist/LambdaRuntime-73BSWP2G.js +0 -16
  98. package/dist/LambdaRuntime-AL5SBDCA.js +0 -17
  99. package/dist/LambdaRuntime-BYBUI7H5.js +0 -17
  100. package/dist/LambdaRuntime-JDZP3HIQ.js +0 -17
  101. package/dist/LambdaRuntime-JEI7RVWG.js +0 -16
  102. package/dist/LambdaRuntime-LCTHBYMV.js +0 -17
  103. package/dist/LambdaRuntime-LDA3G7IR.js +0 -16
  104. package/dist/LambdaRuntime-LF4FR6YA.js +0 -16
  105. package/dist/LambdaRuntime-O7JBVHO2.js +0 -16
  106. package/dist/LambdaRuntime-OFOTT464.js +0 -17
  107. package/dist/LambdaRuntime-Q6ISCHAD.js +0 -16
  108. package/dist/LambdaRuntime-TCZ42XCB.js +0 -16
  109. package/dist/LambdaRuntime-UKUOKJIW.js +0 -17
  110. package/dist/LambdaRuntime-VKLON4IB.js +0 -17
  111. package/dist/LambdaRuntime-WNYDBTS6.js +0 -16
  112. package/dist/LambdaRuntime-WPTX76CX.js +0 -17
  113. package/dist/Loader-4P7PEBCL.js +0 -11
  114. package/dist/Loader-HQ3QKMYM.js +0 -11
  115. package/dist/Loader-NCATGB67.js +0 -11
  116. package/dist/Loader-NRHGDQBD.js +0 -11
  117. package/dist/Loader-RT4NI6AT.js +0 -11
  118. package/dist/Loader-SSRY57SS.js +0 -11
  119. package/dist/Loader-W72QZ3T7.js +0 -11
  120. package/dist/Loader-WECRIXQW.js +0 -11
  121. package/dist/Loader-XFBIHCQF.js +0 -11
  122. package/dist/Loader.d.ts +0 -34
  123. package/dist/Loader.d.ts.map +0 -1
  124. package/dist/Loader.js +0 -190
  125. package/dist/Loader.js.map +0 -1
  126. package/dist/MCard-4J6WSBRF.js +0 -8
  127. package/dist/MCard-E3MRPTJF.js +0 -8
  128. package/dist/MCard-FCOIB6BP.js +0 -8
  129. package/dist/MCard-G4HUWHY5.js +0 -8
  130. package/dist/MCard-HFL7AFIH.js +0 -8
  131. package/dist/MCard-JOW6RBSO.js +0 -8
  132. package/dist/MCard-M4LKN4U2.js +0 -8
  133. package/dist/MCard-VB7UDUTN.js +0 -8
  134. package/dist/MCard-WOHE6SX6.js +0 -8
  135. package/dist/NetworkRuntime-2H7AQITA.js +0 -1571
  136. package/dist/NetworkRuntime-3MIUBNOF.js +0 -1571
  137. package/dist/NetworkRuntime-AOE2EJIM.js +0 -1571
  138. package/dist/NetworkRuntime-BQMDBUDO.js +0 -1570
  139. package/dist/NetworkRuntime-GMANLCAB.js +0 -1542
  140. package/dist/NetworkRuntime-L7P4VCGK.js +0 -1542
  141. package/dist/NetworkRuntime-LC7SUAOF.js +0 -1542
  142. package/dist/NetworkRuntime-OJWCWPBI.js +0 -1570
  143. package/dist/NetworkRuntime-ZJ3B4T3A.js +0 -1542
  144. package/dist/OllamaProvider-32RC36HD.js +0 -8
  145. package/dist/OllamaProvider-MQXSXLCA.js +0 -8
  146. package/dist/OllamaProvider-Q45BMOVN.js +0 -8
  147. package/dist/SqliteNodeEngine-WKVFWBNH.js +0 -9
  148. package/dist/StorageAdapter-DdDUiIvH.d.cts +0 -391
  149. package/dist/StorageAdapter-DdDUiIvH.d.ts +0 -391
  150. package/dist/StorageAdapter-Dw1BeOam.d.cts +0 -380
  151. package/dist/StorageAdapter-Dw1BeOam.d.ts +0 -380
  152. package/dist/chunk-23GCCCXB.js +0 -402
  153. package/dist/chunk-2ECISK2I.js +0 -354
  154. package/dist/chunk-2MRBTM72.js +0 -354
  155. package/dist/chunk-2THXO6FH.js +0 -2313
  156. package/dist/chunk-2VNRWIBZ.js +0 -389
  157. package/dist/chunk-2VOQRXWH.js +0 -296
  158. package/dist/chunk-34AYBZRO.js +0 -920
  159. package/dist/chunk-37EEYISR.js +0 -372
  160. package/dist/chunk-3E2TKOCZ.js +0 -354
  161. package/dist/chunk-3MMMJ7NH.js +0 -1068
  162. package/dist/chunk-437JTYVP.js +0 -292
  163. package/dist/chunk-4MQINOOG.js +0 -1218
  164. package/dist/chunk-4UIWXZHY.js +0 -1049
  165. package/dist/chunk-53S2EZCY.js +0 -290
  166. package/dist/chunk-5BIDGXA6.js +0 -987
  167. package/dist/chunk-5HXLTWYN.js +0 -296
  168. package/dist/chunk-5W2FDGUF.js +0 -371
  169. package/dist/chunk-6R4ERZMG.js +0 -1136
  170. package/dist/chunk-74YSNHEM.js +0 -2309
  171. package/dist/chunk-7H2BQZDK.js +0 -270
  172. package/dist/chunk-7KEWCCES.js +0 -1136
  173. package/dist/chunk-7PN2BUYF.js +0 -371
  174. package/dist/chunk-A2ZJA2EV.js +0 -389
  175. package/dist/chunk-ARPIBGRP.js +0 -1236
  176. package/dist/chunk-ATHNEEAG.js +0 -2309
  177. package/dist/chunk-AVXJOPUE.js +0 -354
  178. package/dist/chunk-B7VEU4S2.js +0 -204
  179. package/dist/chunk-C2TKISBR.js +0 -1213
  180. package/dist/chunk-CBH4YKB4.js +0 -2309
  181. package/dist/chunk-DP7HBRDL.js +0 -2309
  182. package/dist/chunk-DV7ZSH4W.js +0 -2309
  183. package/dist/chunk-DWXNZ5AJ.js +0 -642
  184. package/dist/chunk-EFKMZTT2.js +0 -270
  185. package/dist/chunk-FXJYXHG6.js +0 -266
  186. package/dist/chunk-G466I6RT.js +0 -229
  187. package/dist/chunk-GATPBTHL.js +0 -1142
  188. package/dist/chunk-GMQAHPBC.js +0 -292
  189. package/dist/chunk-GMWA2IJJ.js +0 -1105
  190. package/dist/chunk-GVX5LDLH.js +0 -371
  191. package/dist/chunk-HGENNKOJ.js +0 -355
  192. package/dist/chunk-HM2NBYHU.js +0 -292
  193. package/dist/chunk-IZWB5GCG.js +0 -389
  194. package/dist/chunk-J4HOFUKM.js +0 -2309
  195. package/dist/chunk-JIK2G3EH.js +0 -2313
  196. package/dist/chunk-JRXNWGSW.js +0 -1136
  197. package/dist/chunk-KRKK3KP6.js +0 -1081
  198. package/dist/chunk-KYXZHRUG.js +0 -389
  199. package/dist/chunk-L36L2VDL.js +0 -371
  200. package/dist/chunk-L5PZCES6.js +0 -204
  201. package/dist/chunk-L5U77ZEM.js +0 -1142
  202. package/dist/chunk-LQEKGX2T.js +0 -204
  203. package/dist/chunk-LWMUDMMQ.js +0 -1144
  204. package/dist/chunk-MLKGABMK.js +0 -9
  205. package/dist/chunk-NZ6OQ7UT.js +0 -92
  206. package/dist/chunk-O2UMNZGF.js +0 -903
  207. package/dist/chunk-OFHDMLNM.js +0 -355
  208. package/dist/chunk-PDBMNUMB.js +0 -316
  209. package/dist/chunk-PW4XS7M3.js +0 -850
  210. package/dist/chunk-QA2XQMMJ.js +0 -2313
  211. package/dist/chunk-QL2JFNA7.js +0 -389
  212. package/dist/chunk-QPZ2HNSU.js +0 -912
  213. package/dist/chunk-QVGVU6OS.js +0 -296
  214. package/dist/chunk-RCEU7PFH.js +0 -270
  215. package/dist/chunk-RSTKX7WM.js +0 -907
  216. package/dist/chunk-RXL2CW64.js +0 -266
  217. package/dist/chunk-RXUF6Y43.js +0 -2309
  218. package/dist/chunk-SIAA4J6H.js +0 -21
  219. package/dist/chunk-SOJ2UMO2.js +0 -986
  220. package/dist/chunk-T3AG6DXY.js +0 -296
  221. package/dist/chunk-TPCNKMGZ.js +0 -355
  222. package/dist/chunk-TPT3S5AX.js +0 -204
  223. package/dist/chunk-TXWGIEVH.js +0 -2313
  224. package/dist/chunk-TZFI54AU.js +0 -2313
  225. package/dist/chunk-U3FWUPD3.js +0 -717
  226. package/dist/chunk-UFW2VW2D.js +0 -266
  227. package/dist/chunk-UTAOS5Y7.js +0 -2313
  228. package/dist/chunk-V7VX5OJ6.js +0 -389
  229. package/dist/chunk-W2XGNMYB.js +0 -355
  230. package/dist/chunk-W3M4HJ4U.js +0 -2309
  231. package/dist/chunk-WMJGGREP.js +0 -296
  232. package/dist/chunk-WTNVQ5WS.js +0 -732
  233. package/dist/chunk-WVFWNVT2.js +0 -1050
  234. package/dist/chunk-WY7EYSYC.js +0 -1236
  235. package/dist/chunk-X42F7DE3.js +0 -373
  236. package/dist/chunk-XC7Y4I7L.js +0 -290
  237. package/dist/chunk-YFULZTKP.js +0 -270
  238. package/dist/chunk-YSVHXKSZ.js +0 -373
  239. package/dist/chunk-YWGVK5OS.js +0 -292
  240. package/dist/chunk-Z4BRNTO5.js +0 -2313
  241. package/dist/chunk-ZDUXDKPD.js +0 -292
  242. package/dist/chunk-ZXQ2W7LO.js +0 -355
  243. package/dist/chunk-ZXQELXXO.js +0 -378
  244. package/dist/index.browser.d.ts.map +0 -1
  245. package/dist/index.browser.js.map +0 -1
  246. package/dist/index.d.ts.map +0 -1
  247. package/dist/index.js.map +0 -1
  248. package/dist/lib-4XS34IPZ.js +0 -778
  249. package/dist/model/CardCollection.d.ts +0 -147
  250. package/dist/model/CardCollection.d.ts.map +0 -1
  251. package/dist/model/CardCollection.js +0 -272
  252. package/dist/model/CardCollection.js.map +0 -1
  253. package/dist/model/ContentTypeInterpreter.d.ts +0 -28
  254. package/dist/model/ContentTypeInterpreter.d.ts.map +0 -1
  255. package/dist/model/ContentTypeInterpreter.js +0 -147
  256. package/dist/model/ContentTypeInterpreter.js.map +0 -1
  257. package/dist/model/EventProducer.d.ts +0 -10
  258. package/dist/model/EventProducer.d.ts.map +0 -1
  259. package/dist/model/EventProducer.js +0 -46
  260. package/dist/model/EventProducer.js.map +0 -1
  261. package/dist/model/GTime.d.ts +0 -44
  262. package/dist/model/GTime.d.ts.map +0 -1
  263. package/dist/model/GTime.js +0 -91
  264. package/dist/model/GTime.js.map +0 -1
  265. package/dist/model/Handle.d.ts +0 -37
  266. package/dist/model/Handle.d.ts.map +0 -1
  267. package/dist/model/Handle.js +0 -90
  268. package/dist/model/Handle.js.map +0 -1
  269. package/dist/model/MCard.d.ts +0 -145
  270. package/dist/model/MCard.d.ts.map +0 -1
  271. package/dist/model/MCard.js +0 -180
  272. package/dist/model/MCard.js.map +0 -1
  273. package/dist/model/PCard.d.ts +0 -271
  274. package/dist/model/PCard.d.ts.map +0 -1
  275. package/dist/model/PCard.js +0 -558
  276. package/dist/model/PCard.js.map +0 -1
  277. package/dist/model/VCard.d.ts +0 -277
  278. package/dist/model/VCard.d.ts.map +0 -1
  279. package/dist/model/VCard.js +0 -573
  280. package/dist/model/VCard.js.map +0 -1
  281. package/dist/model/constants.d.ts +0 -45
  282. package/dist/model/constants.d.ts.map +0 -1
  283. package/dist/model/constants.js +0 -27
  284. package/dist/model/constants.js.map +0 -1
  285. package/dist/model/vcard_vocabulary.d.ts +0 -174
  286. package/dist/model/vcard_vocabulary.d.ts.map +0 -1
  287. package/dist/model/vcard_vocabulary.js +0 -187
  288. package/dist/model/vcard_vocabulary.js.map +0 -1
  289. package/dist/monads/Either.d.ts +0 -51
  290. package/dist/monads/Either.d.ts.map +0 -1
  291. package/dist/monads/Either.js +0 -82
  292. package/dist/monads/Either.js.map +0 -1
  293. package/dist/monads/IO.d.ts +0 -38
  294. package/dist/monads/IO.d.ts.map +0 -1
  295. package/dist/monads/IO.js +0 -66
  296. package/dist/monads/IO.js.map +0 -1
  297. package/dist/monads/Maybe.d.ts +0 -45
  298. package/dist/monads/Maybe.d.ts.map +0 -1
  299. package/dist/monads/Maybe.js +0 -73
  300. package/dist/monads/Maybe.js.map +0 -1
  301. package/dist/monads/Reader.d.ts +0 -29
  302. package/dist/monads/Reader.d.ts.map +0 -1
  303. package/dist/monads/Reader.js +0 -44
  304. package/dist/monads/Reader.js.map +0 -1
  305. package/dist/monads/State.d.ts +0 -33
  306. package/dist/monads/State.d.ts.map +0 -1
  307. package/dist/monads/State.js +0 -50
  308. package/dist/monads/State.js.map +0 -1
  309. package/dist/monads/Writer.d.ts +0 -29
  310. package/dist/monads/Writer.d.ts.map +0 -1
  311. package/dist/monads/Writer.js +0 -46
  312. package/dist/monads/Writer.js.map +0 -1
  313. package/dist/ptr/Bridgelet.d.ts +0 -180
  314. package/dist/ptr/Bridgelet.d.ts.map +0 -1
  315. package/dist/ptr/Bridgelet.js +0 -296
  316. package/dist/ptr/Bridgelet.js.map +0 -1
  317. package/dist/ptr/CLMIntrospection.d.ts +0 -169
  318. package/dist/ptr/CLMIntrospection.d.ts.map +0 -1
  319. package/dist/ptr/CLMIntrospection.js +0 -329
  320. package/dist/ptr/CLMIntrospection.js.map +0 -1
  321. package/dist/ptr/FaroSidecar.d.ts +0 -56
  322. package/dist/ptr/FaroSidecar.d.ts.map +0 -1
  323. package/dist/ptr/FaroSidecar.js +0 -102
  324. package/dist/ptr/FaroSidecar.js.map +0 -1
  325. package/dist/ptr/LensProtocol.d.ts +0 -84
  326. package/dist/ptr/LensProtocol.d.ts.map +0 -1
  327. package/dist/ptr/LensProtocol.js +0 -98
  328. package/dist/ptr/LensProtocol.js.map +0 -1
  329. package/dist/ptr/OpenTelemetrySidecar.d.ts +0 -144
  330. package/dist/ptr/OpenTelemetrySidecar.d.ts.map +0 -1
  331. package/dist/ptr/OpenTelemetrySidecar.js +0 -232
  332. package/dist/ptr/OpenTelemetrySidecar.js.map +0 -1
  333. package/dist/ptr/SandboxWorker.d.ts +0 -79
  334. package/dist/ptr/SandboxWorker.d.ts.map +0 -1
  335. package/dist/ptr/SandboxWorker.js +0 -298
  336. package/dist/ptr/SandboxWorker.js.map +0 -1
  337. package/dist/ptr/common_types.d.ts +0 -39
  338. package/dist/ptr/common_types.d.ts.map +0 -1
  339. package/dist/ptr/common_types.js +0 -12
  340. package/dist/ptr/common_types.js.map +0 -1
  341. package/dist/rag/GraphRAGEngine.d.ts +0 -26
  342. package/dist/rag/GraphRAGEngine.d.ts.map +0 -1
  343. package/dist/rag/GraphRAGEngine.js +0 -166
  344. package/dist/rag/GraphRAGEngine.js.map +0 -1
  345. package/dist/rag/HandleVectorStore.d.ts +0 -201
  346. package/dist/rag/HandleVectorStore.d.ts.map +0 -1
  347. package/dist/rag/HandleVectorStore.js +0 -527
  348. package/dist/rag/HandleVectorStore.js.map +0 -1
  349. package/dist/rag/PersistentIndexer.d.ts +0 -148
  350. package/dist/rag/PersistentIndexer.d.ts.map +0 -1
  351. package/dist/rag/PersistentIndexer.js +0 -302
  352. package/dist/rag/PersistentIndexer.js.map +0 -1
  353. package/dist/rag/index.d.ts +0 -20
  354. package/dist/rag/index.d.ts.map +0 -1
  355. package/dist/rag/index.js +0 -26
  356. package/dist/rag/index.js.map +0 -1
  357. package/dist/rag/semanticVersioning.d.ts +0 -187
  358. package/dist/rag/semanticVersioning.d.ts.map +0 -1
  359. package/dist/rag/semanticVersioning.js +0 -253
  360. package/dist/rag/semanticVersioning.js.map +0 -1
  361. package/dist/storage/IndexedDBEngine.d.ts +0 -33
  362. package/dist/storage/IndexedDBEngine.d.ts.map +0 -1
  363. package/dist/storage/IndexedDBEngine.js +0 -198
  364. package/dist/storage/IndexedDBEngine.js.map +0 -1
  365. package/dist/storage/SqliteNodeEngine.d.ts.map +0 -1
  366. package/dist/storage/SqliteNodeEngine.js.map +0 -1
  367. package/dist/storage/SqliteWasmEngine.d.ts.map +0 -1
  368. package/dist/storage/SqliteWasmEngine.js.map +0 -1
  369. package/dist/storage/StorageAdapter.d.ts +0 -42
  370. package/dist/storage/StorageAdapter.d.ts.map +0 -1
  371. package/dist/storage/StorageAdapter.js +0 -2
  372. package/dist/storage/StorageAdapter.js.map +0 -1
  373. package/dist/storage/VectorStore.d.ts +0 -202
  374. package/dist/storage/VectorStore.d.ts.map +0 -1
  375. package/dist/storage/VectorStore.js +0 -557
  376. package/dist/storage/VectorStore.js.map +0 -1
  377. package/dist/storage/schema.d.ts +0 -162
  378. package/dist/storage/schema.d.ts.map +0 -1
  379. package/dist/storage/schema.js +0 -335
  380. package/dist/storage/schema.js.map +0 -1
  381. package/dist/storage/schema_constants.d.ts +0 -7
  382. package/dist/storage/schema_constants.d.ts.map +0 -1
  383. package/dist/storage/schema_constants.js +0 -415
  384. package/dist/storage/schema_constants.js.map +0 -1
  385. package/dist/types/dots.d.ts +0 -206
  386. package/dist/types/dots.d.ts.map +0 -1
  387. package/dist/types/dots.js +0 -201
  388. package/dist/types/dots.js.map +0 -1
@@ -1,732 +0,0 @@
1
- // src/model/Handle.ts
2
- var MAX_HANDLE_LENGTH = 255;
3
- function isValidStartChar(char) {
4
- return /^\p{L}$/u.test(char);
5
- }
6
- function isValidBodyChar(char) {
7
- return /^[\p{L}\p{N}_./ -]$/u.test(char);
8
- }
9
- var HandleValidationError = class extends Error {
10
- constructor(message) {
11
- super(message);
12
- this.name = "HandleValidationError";
13
- }
14
- };
15
- function validateHandle(handle) {
16
- if (!handle) {
17
- throw new HandleValidationError("Handle cannot be empty.");
18
- }
19
- const normalized = handle.trim().normalize("NFC").toLowerCase();
20
- if (normalized.length === 0) {
21
- throw new HandleValidationError("Handle cannot be empty after normalization.");
22
- }
23
- if (normalized.length > MAX_HANDLE_LENGTH) {
24
- throw new HandleValidationError(
25
- `Handle '${handle}' is too long (${normalized.length} chars). Maximum is ${MAX_HANDLE_LENGTH}.`
26
- );
27
- }
28
- if (!isValidStartChar(normalized[0])) {
29
- throw new HandleValidationError(
30
- `Invalid handle '${handle}'. Must start with a letter (any language).`
31
- );
32
- }
33
- for (let i = 1; i < normalized.length; i++) {
34
- if (!isValidBodyChar(normalized[i])) {
35
- throw new HandleValidationError(
36
- `Invalid character '${normalized[i]}' at position ${i} in handle '${handle}'.`
37
- );
38
- }
39
- }
40
- return normalized;
41
- }
42
- var ContentHandle = class {
43
- handle;
44
- currentHash;
45
- createdAt;
46
- updatedAt;
47
- constructor(handle, currentHash, createdAt, updatedAt) {
48
- this.handle = validateHandle(handle);
49
- this.currentHash = currentHash;
50
- this.createdAt = createdAt ?? /* @__PURE__ */ new Date();
51
- this.updatedAt = updatedAt ?? this.createdAt;
52
- }
53
- /**
54
- * Update handle to point to new hash
55
- * @returns Previous hash for history tracking
56
- */
57
- update(newHash) {
58
- const previousHash = this.currentHash;
59
- this.currentHash = newHash;
60
- this.updatedAt = /* @__PURE__ */ new Date();
61
- return previousHash;
62
- }
63
- toObject() {
64
- return {
65
- handle: this.handle,
66
- currentHash: this.currentHash,
67
- createdAt: this.createdAt.toISOString(),
68
- updatedAt: this.updatedAt.toISOString()
69
- };
70
- }
71
- };
72
-
73
- // src/storage/StorageAdapter.ts
74
- function createPage(items, totalItems, pageNumber, pageSize) {
75
- const totalPages = Math.ceil(totalItems / pageSize) || 1;
76
- return {
77
- items,
78
- totalItems,
79
- pageNumber,
80
- pageSize,
81
- totalPages,
82
- hasNext: totalItems > (pageNumber - 1) * pageSize + items.length,
83
- hasPrevious: pageNumber > 1
84
- };
85
- }
86
-
87
- // src/storage/schema_constants.ts
88
- var MCARD_SCHEMA_SQL = `-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
89
- -- MCard Unified Database Schema (Monadic Core)
90
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
91
- --
92
- -- STABILITY WARNING: This schema is the invariant "seeding meta-language" for all
93
- -- Domain Specific Languages (DSLs). It must remain as stable as possible.
94
- --
95
- -- THE UNIFICATION THESIS:
96
- -- This design unites three distinct namespaces into a single relational network
97
- -- by leveraging the power of cryptographic hash functions:
98
- -- 1. CONTENT SPACE (Intrinsic Identity): Content-Addressable Storage (CAS).
99
- -- 2. HANDLE SPACE (Reserved Words): Mapping human logic to content hashes.
100
- -- 3. VERSION SPACE (Temporal Evolution): Tracking state transitions via hash history.
101
- --
102
- -- TURING MACHINE ANALOGY (The Infinitely Long Tape):
103
- -- The \`card\` table stores content blobs with unique identities, emulating the
104
- -- "Infinitely Long Tape" of the Turing Machine formalism. By using relational
105
- -- queries, this tape can be dynamically constructed and traversed for different
106
- -- DSLs, providing a flexible substrate for practically all computable languages.
107
- --
108
- -- By using hash values as the universal primitives across content, handles, and
109
- -- time, we create a "Wordless Book" \u2014 a minimal substrate capable of seeding any
110
- -- domain-specific knowledge system without requiring schema changes.
111
- --
112
- -- Monadic Mapping (See: Monadic Justification for Schema Design.md):
113
- -- 1. Card = Monad (Perception/State/Exponent) - Intrinsic Identity
114
- -- 2. Handle = Registry (Appetition/Reader/Sum) - Mutable Reference
115
- -- 3. Version = History (Harmony/Writer/Product) - Coordinated Evolution
116
- --
117
- -- Version: 3.0.2 (Turing Tape Refinement)
118
- -- Last Updated: 2025-12-20
119
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
120
-
121
-
122
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
123
- -- LAYER 1: CORE CONTENT-ADDRESSABLE STORAGE (The Monad / Exponent)
124
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
125
- -- The fundamental MCard storage: content-addressed by cryptographic hash.
126
- -- "Each Monad ... mirrors the universe"
127
-
128
- -- @table card
129
- -- @description Core content-addressable storage table (Monad/State)
130
- -- @column hash - SHA-256 hash of content (primary key)
131
- -- @column content - The actual content (BLOB for binary safety)
132
- -- @column g_time - Generation timestamp (ISO 8601)
133
- CREATE TABLE IF NOT EXISTS card (
134
- hash TEXT PRIMARY KEY,
135
- content BLOB NOT NULL,
136
- g_time TEXT NOT NULL
137
- );
138
-
139
-
140
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
141
- -- LAYER 2: HANDLE SYSTEM (Appetition / Sum)
142
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
143
- -- The mutable pointer that "desires" to reference new content.
144
- -- "Appetition: the tendency to move to new states"
145
-
146
- -- @table handle_registry (Monadic Role: Handle)
147
- -- @description Maps human-readable handles to current content hashes
148
- -- @column handle - UTF-8 handle name (primary key)
149
- -- @column current_hash - FK to card.hash of current version
150
- -- @column created_at - When handle was first created
151
- -- @column updated_at - When handle was last updated
152
- CREATE TABLE IF NOT EXISTS handle_registry (
153
- handle TEXT PRIMARY KEY,
154
- current_hash TEXT NOT NULL,
155
- created_at TEXT NOT NULL,
156
- updated_at TEXT NOT NULL,
157
- FOREIGN KEY (current_hash) REFERENCES card(hash)
158
- );
159
-
160
- -- @index idx_handle_current_hash
161
- -- @description Efficient reverse lookup from hash to handles
162
- CREATE INDEX IF NOT EXISTS idx_handle_current_hash
163
- ON handle_registry(current_hash);
164
-
165
- -- @table handle_history (Monadic Role: Version / Product)
166
- -- @description Audit trail for handle pointer changes (Pre-Established Harmony)
167
- -- @column id - Auto-increment primary key
168
- -- @column handle - The handle that was updated
169
- -- @column previous_hash - Hash it pointed to before update
170
- -- @column changed_at - When the change occurred
171
- CREATE TABLE IF NOT EXISTS handle_history (
172
- id INTEGER PRIMARY KEY AUTOINCREMENT,
173
- handle TEXT NOT NULL,
174
- previous_hash TEXT NOT NULL,
175
- changed_at TEXT NOT NULL,
176
- FOREIGN KEY (handle) REFERENCES handle_registry(handle),
177
- FOREIGN KEY (previous_hash) REFERENCES card(hash)
178
- );
179
-
180
- -- @index idx_handle_history_handle
181
- -- @description Efficient lookup of history by handle
182
- CREATE INDEX IF NOT EXISTS idx_handle_history_handle
183
- ON handle_history(handle);
184
-
185
-
186
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
187
- -- LEGACY SUPPORT: FTS5 Documents Table
188
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
189
- -- KEPT FOR BACKWARD COMPATIBILITY with existing codebase.
190
- -- New implementations should use mcard_vector_schema.sql -> mcard_fts
191
-
192
- -- @virtual_table documents
193
- -- @description Legacy FTS table for backward compatibility
194
- -- @note Synced with card table via triggers
195
- CREATE VIRTUAL TABLE IF NOT EXISTS documents USING fts5(content);
196
-
197
-
198
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
199
- -- SCHEMA METADATA
200
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
201
-
202
- -- @table schema_version
203
- -- @description Tracks schema version for migrations
204
- CREATE TABLE IF NOT EXISTS schema_version (
205
- version TEXT PRIMARY KEY,
206
- applied_at TEXT NOT NULL,
207
- description TEXT
208
- );
209
-
210
- -- Insert current schema version
211
- INSERT OR IGNORE INTO schema_version (version, applied_at, description)
212
- VALUES ('3.0.0', datetime('now'), 'Monadic Core Schema (split vectors to mcard_vector_schema.sql)');
213
- `;
214
- var MCARD_VECTOR_SCHEMA_SQL = `-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
215
- -- MCard Vector Database Schema (mcard_vectors.db)
216
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
217
- --
218
- -- This schema defines the structure for "Secondary Qualities" (Extrinsic Embeddings).
219
- -- It is separated from the core mcard.db (Monadic Intrinsic Properties) to ensure:
220
- -- 1. Separation of Concerns (Intrinsic vs Extrinsic)
221
- -- 2. Linearity (Vectors are observer-dependent and large)
222
- -- 3. Upgradability (Embedding models change frequently)
223
- --
224
- -- See: Monadic Justification for Schema Design.md
225
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
226
-
227
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
228
- -- LAYER 3: VECTOR STORAGE (Semantic Embeddings)
229
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
230
- -- Storage for vector embeddings enabling semantic search.
231
- -- Links to content via hash for content-addressing.
232
-
233
- -- @table mcard_vector_metadata
234
- -- @description Metadata for stored embeddings
235
- -- @column id - Auto-increment primary key
236
- -- @column hash - FK to card.hash
237
- -- @column model_name - Embedding model used (e.g., "nomic-embed-text")
238
- -- @column dimensions - Vector dimensions
239
- -- @column chunk_index - Index for chunked documents (0 = first/whole)
240
- -- @column chunk_total - Total chunks for this document
241
- -- @column chunk_text - Preview text for this chunk
242
- -- @column created_at - When embedding was created
243
- CREATE TABLE IF NOT EXISTS mcard_vector_metadata (
244
- id INTEGER PRIMARY KEY AUTOINCREMENT,
245
- hash TEXT NOT NULL,
246
- model_name TEXT NOT NULL,
247
- dimensions INTEGER NOT NULL,
248
- chunk_index INTEGER DEFAULT 0,
249
- chunk_total INTEGER DEFAULT 1,
250
- chunk_text TEXT,
251
- created_at TEXT NOT NULL,
252
- UNIQUE(hash, chunk_index)
253
- );
254
-
255
- -- @index idx_vector_metadata_hash
256
- -- @description Efficient lookup of embeddings by content hash
257
- CREATE INDEX IF NOT EXISTS idx_vector_metadata_hash
258
- ON mcard_vector_metadata(hash);
259
-
260
- -- @table mcard_embeddings
261
- -- @description Fallback embedding storage when sqlite-vec is unavailable
262
- -- @column id - Auto-increment primary key
263
- -- @column metadata_id - FK to mcard_vector_metadata.id
264
- -- @column embedding - Serialized float32 vector as BLOB
265
- CREATE TABLE IF NOT EXISTS mcard_embeddings (
266
- id INTEGER PRIMARY KEY AUTOINCREMENT,
267
- metadata_id INTEGER NOT NULL,
268
- embedding BLOB NOT NULL,
269
- UNIQUE(metadata_id),
270
- FOREIGN KEY (metadata_id) REFERENCES mcard_vector_metadata(id)
271
- );
272
-
273
- -- @virtual_table mcard_fts
274
- -- @description Full-text search for hybrid retrieval
275
- -- @note Uses Porter stemming with Unicode support
276
- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_fts USING fts5(
277
- hash,
278
- content,
279
- tokenize='porter unicode61'
280
- );
281
-
282
- -- Note: sqlite-vec virtual table is created dynamically with dimensions:
283
- -- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_vec USING vec0(
284
- -- metadata_id INTEGER PRIMARY KEY,
285
- -- embedding float[\${dimensions}]
286
- -- );
287
-
288
-
289
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
290
- -- LAYER 4: SEMANTIC VERSIONING (Handle-Vector Bridge)
291
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
292
- -- Bridges handles to vector embeddings for semantic version comparison.
293
- -- Enables measuring semantic drift between document versions.
294
-
295
- -- @table handle_version_vectors
296
- -- @description Links handle versions to their semantic embeddings
297
- -- @column id - Auto-increment primary key
298
- -- @column handle - FK to handle_registry.handle
299
- -- @column hash - FK to card.hash (this version)
300
- -- @column parent_hash - FK to card.hash (previous version)
301
- -- @column version_order - 0 = current, 1 = previous, etc.
302
- -- @column is_current - TRUE if this is the current version
303
- -- @column embedding_id - FK to mcard_vector_metadata.id
304
- -- @column semantic_delta_from_parent - Cosine similarity to parent [-1, 1]
305
- -- @column upgrade_type - Classification: 'trivial' | 'minor' | 'major' | 'breaking'
306
- -- @column created_at - When this version was linked
307
- CREATE TABLE IF NOT EXISTS handle_version_vectors (
308
- id INTEGER PRIMARY KEY AUTOINCREMENT,
309
- handle TEXT NOT NULL,
310
- hash TEXT NOT NULL,
311
- parent_hash TEXT,
312
- version_order INTEGER NOT NULL,
313
- is_current BOOLEAN DEFAULT FALSE,
314
- embedding_id INTEGER,
315
- semantic_delta_from_parent REAL,
316
- upgrade_type TEXT,
317
- created_at TEXT NOT NULL,
318
- UNIQUE(handle, hash),
319
- FOREIGN KEY (embedding_id) REFERENCES mcard_vector_metadata(id)
320
- );
321
-
322
- -- @index idx_hvv_handle
323
- -- @description Efficient lookup of versions by handle
324
- CREATE INDEX IF NOT EXISTS idx_hvv_handle
325
- ON handle_version_vectors(handle);
326
-
327
- -- @index idx_hvv_hash
328
- -- @description Efficient lookup of versions by hash
329
- CREATE INDEX IF NOT EXISTS idx_hvv_hash
330
- ON handle_version_vectors(hash);
331
-
332
- -- @index idx_hvv_current
333
- -- @description Efficient lookup of current versions
334
- CREATE INDEX IF NOT EXISTS idx_hvv_current
335
- ON handle_version_vectors(is_current);
336
-
337
- -- @index idx_hvv_parent
338
- -- @description Efficient lookup by parent hash
339
- CREATE INDEX IF NOT EXISTS idx_hvv_parent
340
- ON handle_version_vectors(parent_hash);
341
-
342
- -- @table version_similarity_cache
343
- -- @description Precomputed pairwise similarities for performance
344
- -- @column id - Auto-increment primary key
345
- -- @column handle - Handle these versions belong to
346
- -- @column hash_a - First version hash
347
- -- @column hash_b - Second version hash
348
- -- @column similarity_score - Cosine similarity [-1, 1]
349
- -- @column distance_euclidean - L2 distance [0, \u221E)
350
- -- @column computed_at - When similarity was computed
351
- CREATE TABLE IF NOT EXISTS version_similarity_cache (
352
- id INTEGER PRIMARY KEY AUTOINCREMENT,
353
- handle TEXT NOT NULL,
354
- hash_a TEXT NOT NULL,
355
- hash_b TEXT NOT NULL,
356
- similarity_score REAL NOT NULL,
357
- distance_euclidean REAL,
358
- computed_at TEXT NOT NULL,
359
- UNIQUE(handle, hash_a, hash_b)
360
- );
361
-
362
- -- @index idx_vsc_handle
363
- -- @description Efficient lookup of cached similarities by handle
364
- CREATE INDEX IF NOT EXISTS idx_vsc_handle
365
- ON version_similarity_cache(handle);
366
-
367
-
368
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
369
- -- LAYER 5: KNOWLEDGE GRAPH (GraphRAG)
370
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
371
- -- Storage for extracted knowledge graph entities and relationships.
372
-
373
- -- @table graph_entities
374
- -- @description Nodes in the knowledge graph
375
- -- @column id - Auto-increment primary key
376
- -- @column name - Entity name
377
- -- @column type - Entity type (e.g., "Person", "Organization")
378
- -- @column description - Optional description
379
- -- @column source_hash - FK to card.hash where entity was extracted
380
- -- @column embedding - Optional entity embedding
381
- -- @column created_at - When entity was created
382
- CREATE TABLE IF NOT EXISTS graph_entities (
383
- id INTEGER PRIMARY KEY AUTOINCREMENT,
384
- name TEXT NOT NULL,
385
- type TEXT NOT NULL,
386
- description TEXT,
387
- source_hash TEXT NOT NULL,
388
- embedding BLOB,
389
- created_at TEXT NOT NULL,
390
- UNIQUE(name, type, source_hash)
391
- );
392
-
393
- -- @index idx_entity_name
394
- -- @description Efficient entity lookup by name
395
- CREATE INDEX IF NOT EXISTS idx_entity_name
396
- ON graph_entities(name);
397
-
398
- -- @index idx_entity_type
399
- -- @description Efficient entity lookup by type
400
- CREATE INDEX IF NOT EXISTS idx_entity_type
401
- ON graph_entities(type);
402
-
403
- -- @index idx_entity_source
404
- -- @description Efficient entity lookup by source document
405
- CREATE INDEX IF NOT EXISTS idx_entity_source
406
- ON graph_entities(source_hash);
407
-
408
- -- @table graph_relationships
409
- -- @description Edges in the knowledge graph
410
- -- @column id - Auto-increment primary key
411
- -- @column source_entity_id - FK to graph_entities.id (from)
412
- -- @column target_entity_id - FK to graph_entities.id (to)
413
- -- @column relationship - Relationship type/label
414
- -- @column description - Optional description
415
- -- @column weight - Relationship strength
416
- -- @column source_hash - FK to card.hash where relationship was extracted
417
- -- @column created_at - When relationship was created
418
- CREATE TABLE IF NOT EXISTS graph_relationships (
419
- id INTEGER PRIMARY KEY AUTOINCREMENT,
420
- source_entity_id INTEGER NOT NULL,
421
- target_entity_id INTEGER NOT NULL,
422
- relationship TEXT NOT NULL,
423
- description TEXT,
424
- weight REAL DEFAULT 1.0,
425
- source_hash TEXT NOT NULL,
426
- created_at TEXT NOT NULL,
427
- UNIQUE(source_entity_id, target_entity_id, relationship, source_hash),
428
- FOREIGN KEY (source_entity_id) REFERENCES graph_entities(id),
429
- FOREIGN KEY (target_entity_id) REFERENCES graph_entities(id)
430
- );
431
-
432
- -- @index idx_rel_source
433
- -- @description Efficient lookup of relationships by source entity
434
- CREATE INDEX IF NOT EXISTS idx_rel_source
435
- ON graph_relationships(source_entity_id);
436
-
437
- -- @index idx_rel_target
438
- -- @description Efficient lookup of relationships by target entity
439
- CREATE INDEX IF NOT EXISTS idx_rel_target
440
- ON graph_relationships(target_entity_id);
441
-
442
- -- @table graph_communities
443
- -- @description Hierarchical community summaries (GraphRAG)
444
- -- @column id - Auto-increment primary key
445
- -- @column level - Hierarchy level (0 = leaf)
446
- -- @column title - Community title
447
- -- @column summary - AI-generated summary
448
- -- @column embedding - Community embedding
449
- -- @column member_entity_ids - JSON array of entity IDs
450
- -- @column parent_community_id - FK to parent community
451
- -- @column created_at - When community was created
452
- CREATE TABLE IF NOT EXISTS graph_communities (
453
- id INTEGER PRIMARY KEY AUTOINCREMENT,
454
- level INTEGER NOT NULL DEFAULT 0,
455
- title TEXT,
456
- summary TEXT NOT NULL,
457
- embedding BLOB,
458
- member_entity_ids TEXT,
459
- parent_community_id INTEGER,
460
- created_at TEXT NOT NULL,
461
- FOREIGN KEY (parent_community_id) REFERENCES graph_communities(id)
462
- );
463
-
464
- -- @index idx_community_level
465
- -- @description Efficient lookup of communities by level
466
- CREATE INDEX IF NOT EXISTS idx_community_level
467
- ON graph_communities(level);
468
-
469
- -- @table graph_extractions
470
- -- @description Tracks which documents have been processed for entity extraction
471
- -- @column hash - FK to card.hash (primary key)
472
- -- @column entity_count - Number of entities extracted
473
- -- @column relationship_count - Number of relationships extracted
474
- -- @column extracted_at - When extraction was performed
475
- CREATE TABLE IF NOT EXISTS graph_extractions (
476
- hash TEXT PRIMARY KEY,
477
- entity_count INTEGER DEFAULT 0,
478
- relationship_count INTEGER DEFAULT 0,
479
- extracted_at TEXT NOT NULL
480
- );
481
-
482
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
483
- -- SCHEMA METADATA (Vector DB)
484
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
485
-
486
- -- @table schema_version
487
- -- @description Tracks schema version for migrations
488
- CREATE TABLE IF NOT EXISTS vector_schema_version (
489
- version TEXT PRIMARY KEY,
490
- applied_at TEXT NOT NULL,
491
- description TEXT
492
- );
493
-
494
- -- Insert current schema version
495
- INSERT OR IGNORE INTO vector_schema_version (version, applied_at, description)
496
- VALUES ('1.0.0', datetime('now'), 'Initial MCard Vector Schema');
497
- `;
498
-
499
- // src/storage/schema.ts
500
- var TABLE_LAYERS = {
501
- // Layer 1: Core
502
- "card": "core",
503
- // Layer 2: Handle System
504
- "handle_registry": "handle",
505
- "handle_history": "handle",
506
- // Layer 3: Vector Storage
507
- "mcard_vector_metadata": "vector",
508
- "mcard_embeddings": "vector",
509
- "mcard_fts": "vector",
510
- // Layer 4: Semantic Versioning
511
- "handle_version_vectors": "semantic",
512
- "version_similarity_cache": "semantic",
513
- // Layer 5: Knowledge Graph
514
- "graph_entities": "graph",
515
- "graph_relationships": "graph",
516
- "graph_communities": "graph",
517
- "graph_extractions": "graph",
518
- // Metadata
519
- "schema_version": "metadata"
520
- };
521
- var MCardSchema = class _MCardSchema {
522
- static instance = null;
523
- schemaPath = "";
524
- rawSql = "";
525
- statements = [];
526
- tables = /* @__PURE__ */ new Map();
527
- indexes = /* @__PURE__ */ new Map();
528
- loaded = false;
529
- constructor() {
530
- }
531
- /**
532
- * Get the singleton instance.
533
- */
534
- static getInstance() {
535
- if (!_MCardSchema.instance) {
536
- _MCardSchema.instance = new _MCardSchema();
537
- _MCardSchema.instance.load();
538
- }
539
- return _MCardSchema.instance;
540
- }
541
- /**
542
- * Reset the singleton (for testing).
543
- */
544
- static resetInstance() {
545
- _MCardSchema.instance = null;
546
- }
547
- load() {
548
- if (this.loaded) return;
549
- this.schemaPath = "IN_MEMORY_CONSTANTS";
550
- this.rawSql = MCARD_SCHEMA_SQL;
551
- if (MCARD_VECTOR_SCHEMA_SQL) {
552
- this.rawSql += "\n\n" + MCARD_VECTOR_SCHEMA_SQL;
553
- }
554
- this.statements = this.parseStatements(this.rawSql);
555
- for (const stmt of this.statements) {
556
- const name = this.extractName(stmt);
557
- if (name) {
558
- const upper = stmt.toUpperCase();
559
- if (upper.includes("CREATE TABLE") || upper.includes("CREATE VIRTUAL TABLE")) {
560
- this.tables.set(name.toLowerCase(), stmt);
561
- } else if (upper.includes("CREATE INDEX")) {
562
- this.indexes.set(name.toLowerCase(), stmt);
563
- }
564
- }
565
- }
566
- this.loaded = true;
567
- }
568
- parseStatements(sql) {
569
- sql = sql.replace(/\/\*[\s\S]*?\*\//g, "");
570
- const statements = [];
571
- let current = [];
572
- for (const line of sql.split("\n")) {
573
- const stripped = line.split("--")[0].trim();
574
- if (!stripped) continue;
575
- current.push(stripped);
576
- if (stripped.endsWith(";")) {
577
- const statement = current.join(" ");
578
- if (!statement.trim().toUpperCase().startsWith("INSERT")) {
579
- statements.push(statement);
580
- }
581
- current = [];
582
- }
583
- }
584
- return statements.filter((s) => s.trim());
585
- }
586
- extractName(statement) {
587
- let match = statement.match(/CREATE\s+(?:VIRTUAL\s+)?TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)/i);
588
- if (match) return match[1];
589
- match = statement.match(/CREATE\s+INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)/i);
590
- if (match) return match[1];
591
- return null;
592
- }
593
- // ─────────────────────────────────────────────────────────────────────────
594
- // Schema Access
595
- // ─────────────────────────────────────────────────────────────────────────
596
- getSchemaPath() {
597
- return this.schemaPath;
598
- }
599
- getTable(tableName) {
600
- return this.tables.get(tableName.toLowerCase());
601
- }
602
- getIndex(indexName) {
603
- return this.indexes.get(indexName.toLowerCase());
604
- }
605
- getAllTables() {
606
- return new Map(this.tables);
607
- }
608
- getAllIndexes() {
609
- return new Map(this.indexes);
610
- }
611
- getAllStatements() {
612
- return [...this.statements];
613
- }
614
- getTablesByLayer(layer) {
615
- return Object.entries(TABLE_LAYERS).filter(([_, l]) => l === layer).map(([name, _]) => name);
616
- }
617
- getLayerStatements(layer) {
618
- const statements = [];
619
- const tables = this.getTablesByLayer(layer);
620
- for (const table of tables) {
621
- const stmt = this.getTable(table);
622
- if (stmt) statements.push(stmt);
623
- }
624
- for (const [_, stmt] of this.indexes) {
625
- const match = stmt.match(/ON\s+(\w+)/i);
626
- if (match && tables.includes(match[1].toLowerCase())) {
627
- statements.push(stmt);
628
- }
629
- }
630
- return statements;
631
- }
632
- // ─────────────────────────────────────────────────────────────────────────
633
- // Database Initialization
634
- // ─────────────────────────────────────────────────────────────────────────
635
- execStatements(db, statements) {
636
- for (const stmt of statements) {
637
- db.exec(stmt);
638
- }
639
- return statements.length;
640
- }
641
- initLayer(db, layer) {
642
- return this.execStatements(db, this.getLayerStatements(layer));
643
- }
644
- initCoreTables(db) {
645
- return this.initLayer(db, "core");
646
- }
647
- initHandleTables(db) {
648
- return this.initLayer(db, "handle");
649
- }
650
- initVectorTables(db, enableFts = true) {
651
- const statements = this.getLayerStatements("vector").filter((s) => enableFts || !s.toLowerCase().includes("fts"));
652
- return this.execStatements(db, statements);
653
- }
654
- initSemanticTables(db) {
655
- return this.initLayer(db, "semantic");
656
- }
657
- initGraphTables(db) {
658
- return this.initLayer(db, "graph");
659
- }
660
- initAllTables(db, options = {}) {
661
- const { enableFts = true, enableGraph = true, enableSemantic = true } = options;
662
- let count = 0;
663
- count += this.initCoreTables(db);
664
- count += this.initHandleTables(db);
665
- count += this.initVectorTables(db, enableFts);
666
- if (enableSemantic) {
667
- count += this.initSemanticTables(db);
668
- }
669
- if (enableGraph) {
670
- count += this.initGraphTables(db);
671
- }
672
- return count;
673
- }
674
- initVec0Table(db, dimensions) {
675
- db.exec(`
676
- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_vec USING vec0(
677
- metadata_id INTEGER PRIMARY KEY,
678
- embedding float[${dimensions}]
679
- )
680
- `);
681
- }
682
- };
683
- function getSchemaInstance() {
684
- return MCardSchema.getInstance();
685
- }
686
- var CARD_TABLE_SCHEMA = getSchemaInstance().getTable("card") || "";
687
- var HANDLE_REGISTRY_SCHEMA = getSchemaInstance().getTable("handle_registry") || "";
688
- var HANDLE_HISTORY_SCHEMA = getSchemaInstance().getTable("handle_history") || "";
689
- var HANDLE_INDEX_SCHEMA = getSchemaInstance().getIndex("idx_handle_current_hash") || "";
690
- var VECTOR_METADATA_SCHEMA = getSchemaInstance().getTable("mcard_vector_metadata") || "";
691
- var VECTOR_METADATA_INDEX = getSchemaInstance().getIndex("idx_vector_metadata_hash") || "";
692
- var VECTOR_EMBEDDINGS_SCHEMA = getSchemaInstance().getTable("mcard_embeddings") || "";
693
- var VECTOR_FTS_SCHEMA = getSchemaInstance().getTable("mcard_fts") || "";
694
- var HANDLE_VERSION_VECTORS_SCHEMA = getSchemaInstance().getTable("handle_version_vectors") || "";
695
- var HANDLE_VERSION_VECTORS_INDEXES = [
696
- getSchemaInstance().getIndex("idx_hvv_handle"),
697
- getSchemaInstance().getIndex("idx_hvv_hash"),
698
- getSchemaInstance().getIndex("idx_hvv_current"),
699
- getSchemaInstance().getIndex("idx_hvv_parent")
700
- ].filter(Boolean).join("; ");
701
- var VERSION_SIMILARITY_CACHE_SCHEMA = getSchemaInstance().getTable("version_similarity_cache") || "";
702
- var VERSION_SIMILARITY_CACHE_INDEX = getSchemaInstance().getIndex("idx_vsc_handle") || "";
703
- var GRAPH_ENTITY_SCHEMA = getSchemaInstance().getTable("graph_entities") || "";
704
- var GRAPH_ENTITY_INDEX_NAME = getSchemaInstance().getIndex("idx_entity_name") || "";
705
- var GRAPH_ENTITY_INDEX_TYPE = getSchemaInstance().getIndex("idx_entity_type") || "";
706
- var GRAPH_ENTITY_INDEX_SOURCE = getSchemaInstance().getIndex("idx_entity_source") || "";
707
- var GRAPH_RELATIONSHIP_SCHEMA = getSchemaInstance().getTable("graph_relationships") || "";
708
- var GRAPH_RELATIONSHIP_INDEX_SOURCE = getSchemaInstance().getIndex("idx_rel_source") || "";
709
- var GRAPH_RELATIONSHIP_INDEX_TARGET = getSchemaInstance().getIndex("idx_rel_target") || "";
710
- var GRAPH_COMMUNITY_SCHEMA = getSchemaInstance().getTable("graph_communities") || "";
711
- var GRAPH_COMMUNITY_INDEX_LEVEL = getSchemaInstance().getIndex("idx_community_level") || "";
712
- var GRAPH_EXTRACTION_SCHEMA = getSchemaInstance().getTable("graph_extractions") || "";
713
- var CORE_SCHEMAS = {
714
- card: CARD_TABLE_SCHEMA,
715
- handleRegistry: HANDLE_REGISTRY_SCHEMA,
716
- handleHistory: HANDLE_HISTORY_SCHEMA,
717
- handleIndex: HANDLE_INDEX_SCHEMA
718
- };
719
- function initCoreSchemas(db) {
720
- const schema = MCardSchema.getInstance();
721
- schema.initCoreTables(db);
722
- schema.initHandleTables(db);
723
- }
724
-
725
- export {
726
- HandleValidationError,
727
- validateHandle,
728
- ContentHandle,
729
- createPage,
730
- CORE_SCHEMAS,
731
- initCoreSchemas
732
- };