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,717 +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/schema_constants.ts
74
- 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
75
- -- MCard Unified Database Schema (Monadic Core)
76
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
77
- --
78
- -- STABILITY WARNING: This schema is the invariant "seeding meta-language" for all
79
- -- Domain Specific Languages (DSLs). It must remain as stable as possible.
80
- --
81
- -- THE UNIFICATION THESIS:
82
- -- This design unites three distinct namespaces into a single relational network
83
- -- by leveraging the power of cryptographic hash functions:
84
- -- 1. CONTENT SPACE (Intrinsic Identity): Content-Addressable Storage (CAS).
85
- -- 2. HANDLE SPACE (Reserved Words): Mapping human logic to content hashes.
86
- -- 3. VERSION SPACE (Temporal Evolution): Tracking state transitions via hash history.
87
- --
88
- -- TURING MACHINE ANALOGY (The Infinitely Long Tape):
89
- -- The \`card\` table stores content blobs with unique identities, emulating the
90
- -- "Infinitely Long Tape" of the Turing Machine formalism. By using relational
91
- -- queries, this tape can be dynamically constructed and traversed for different
92
- -- DSLs, providing a flexible substrate for practically all computable languages.
93
- --
94
- -- By using hash values as the universal primitives across content, handles, and
95
- -- time, we create a "Wordless Book" \u2014 a minimal substrate capable of seeding any
96
- -- domain-specific knowledge system without requiring schema changes.
97
- --
98
- -- Monadic Mapping (See: Monadic Justification for Schema Design.md):
99
- -- 1. Card = Monad (Perception/State/Exponent) - Intrinsic Identity
100
- -- 2. Handle = Registry (Appetition/Reader/Sum) - Mutable Reference
101
- -- 3. Version = History (Harmony/Writer/Product) - Coordinated Evolution
102
- --
103
- -- Version: 3.0.2 (Turing Tape Refinement)
104
- -- Last Updated: 2025-12-20
105
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
106
-
107
-
108
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
109
- -- LAYER 1: CORE CONTENT-ADDRESSABLE STORAGE (The Monad / Exponent)
110
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
111
- -- The fundamental MCard storage: content-addressed by cryptographic hash.
112
- -- "Each Monad ... mirrors the universe"
113
-
114
- -- @table card
115
- -- @description Core content-addressable storage table (Monad/State)
116
- -- @column hash - SHA-256 hash of content (primary key)
117
- -- @column content - The actual content (BLOB for binary safety)
118
- -- @column g_time - Generation timestamp (ISO 8601)
119
- CREATE TABLE IF NOT EXISTS card (
120
- hash TEXT PRIMARY KEY,
121
- content BLOB NOT NULL,
122
- g_time TEXT NOT NULL
123
- );
124
-
125
-
126
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
127
- -- LAYER 2: HANDLE SYSTEM (Appetition / Sum)
128
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
129
- -- The mutable pointer that "desires" to reference new content.
130
- -- "Appetition: the tendency to move to new states"
131
-
132
- -- @table handle_registry (Monadic Role: Handle)
133
- -- @description Maps human-readable handles to current content hashes
134
- -- @column handle - UTF-8 handle name (primary key)
135
- -- @column current_hash - FK to card.hash of current version
136
- -- @column created_at - When handle was first created
137
- -- @column updated_at - When handle was last updated
138
- CREATE TABLE IF NOT EXISTS handle_registry (
139
- handle TEXT PRIMARY KEY,
140
- current_hash TEXT NOT NULL,
141
- created_at TEXT NOT NULL,
142
- updated_at TEXT NOT NULL,
143
- FOREIGN KEY (current_hash) REFERENCES card(hash)
144
- );
145
-
146
- -- @index idx_handle_current_hash
147
- -- @description Efficient reverse lookup from hash to handles
148
- CREATE INDEX IF NOT EXISTS idx_handle_current_hash
149
- ON handle_registry(current_hash);
150
-
151
- -- @table handle_history (Monadic Role: Version / Product)
152
- -- @description Audit trail for handle pointer changes (Pre-Established Harmony)
153
- -- @column id - Auto-increment primary key
154
- -- @column handle - The handle that was updated
155
- -- @column previous_hash - Hash it pointed to before update
156
- -- @column changed_at - When the change occurred
157
- CREATE TABLE IF NOT EXISTS handle_history (
158
- id INTEGER PRIMARY KEY AUTOINCREMENT,
159
- handle TEXT NOT NULL,
160
- previous_hash TEXT NOT NULL,
161
- changed_at TEXT NOT NULL,
162
- FOREIGN KEY (handle) REFERENCES handle_registry(handle),
163
- FOREIGN KEY (previous_hash) REFERENCES card(hash)
164
- );
165
-
166
- -- @index idx_handle_history_handle
167
- -- @description Efficient lookup of history by handle
168
- CREATE INDEX IF NOT EXISTS idx_handle_history_handle
169
- ON handle_history(handle);
170
-
171
-
172
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
173
- -- LEGACY SUPPORT: FTS5 Documents Table
174
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
175
- -- KEPT FOR BACKWARD COMPATIBILITY with existing codebase.
176
- -- New implementations should use mcard_vector_schema.sql -> mcard_fts
177
-
178
- -- @virtual_table documents
179
- -- @description Legacy FTS table for backward compatibility
180
- -- @note Synced with card table via triggers
181
- CREATE VIRTUAL TABLE IF NOT EXISTS documents USING fts5(content);
182
-
183
-
184
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
185
- -- SCHEMA METADATA
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
-
188
- -- @table schema_version
189
- -- @description Tracks schema version for migrations
190
- CREATE TABLE IF NOT EXISTS schema_version (
191
- version TEXT PRIMARY KEY,
192
- applied_at TEXT NOT NULL,
193
- description TEXT
194
- );
195
-
196
- -- Insert current schema version
197
- INSERT OR IGNORE INTO schema_version (version, applied_at, description)
198
- VALUES ('3.0.0', datetime('now'), 'Monadic Core Schema (split vectors to mcard_vector_schema.sql)');
199
- `;
200
- 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
201
- -- MCard Vector Database Schema (mcard_vectors.db)
202
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
203
- --
204
- -- This schema defines the structure for "Secondary Qualities" (Extrinsic Embeddings).
205
- -- It is separated from the core mcard.db (Monadic Intrinsic Properties) to ensure:
206
- -- 1. Separation of Concerns (Intrinsic vs Extrinsic)
207
- -- 2. Linearity (Vectors are observer-dependent and large)
208
- -- 3. Upgradability (Embedding models change frequently)
209
- --
210
- -- See: Monadic Justification for Schema Design.md
211
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
212
-
213
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
214
- -- LAYER 3: VECTOR STORAGE (Semantic Embeddings)
215
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
216
- -- Storage for vector embeddings enabling semantic search.
217
- -- Links to content via hash for content-addressing.
218
-
219
- -- @table mcard_vector_metadata
220
- -- @description Metadata for stored embeddings
221
- -- @column id - Auto-increment primary key
222
- -- @column hash - FK to card.hash
223
- -- @column model_name - Embedding model used (e.g., "nomic-embed-text")
224
- -- @column dimensions - Vector dimensions
225
- -- @column chunk_index - Index for chunked documents (0 = first/whole)
226
- -- @column chunk_total - Total chunks for this document
227
- -- @column chunk_text - Preview text for this chunk
228
- -- @column created_at - When embedding was created
229
- CREATE TABLE IF NOT EXISTS mcard_vector_metadata (
230
- id INTEGER PRIMARY KEY AUTOINCREMENT,
231
- hash TEXT NOT NULL,
232
- model_name TEXT NOT NULL,
233
- dimensions INTEGER NOT NULL,
234
- chunk_index INTEGER DEFAULT 0,
235
- chunk_total INTEGER DEFAULT 1,
236
- chunk_text TEXT,
237
- created_at TEXT NOT NULL,
238
- UNIQUE(hash, chunk_index)
239
- );
240
-
241
- -- @index idx_vector_metadata_hash
242
- -- @description Efficient lookup of embeddings by content hash
243
- CREATE INDEX IF NOT EXISTS idx_vector_metadata_hash
244
- ON mcard_vector_metadata(hash);
245
-
246
- -- @table mcard_embeddings
247
- -- @description Fallback embedding storage when sqlite-vec is unavailable
248
- -- @column id - Auto-increment primary key
249
- -- @column metadata_id - FK to mcard_vector_metadata.id
250
- -- @column embedding - Serialized float32 vector as BLOB
251
- CREATE TABLE IF NOT EXISTS mcard_embeddings (
252
- id INTEGER PRIMARY KEY AUTOINCREMENT,
253
- metadata_id INTEGER NOT NULL,
254
- embedding BLOB NOT NULL,
255
- UNIQUE(metadata_id),
256
- FOREIGN KEY (metadata_id) REFERENCES mcard_vector_metadata(id)
257
- );
258
-
259
- -- @virtual_table mcard_fts
260
- -- @description Full-text search for hybrid retrieval
261
- -- @note Uses Porter stemming with Unicode support
262
- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_fts USING fts5(
263
- hash,
264
- content,
265
- tokenize='porter unicode61'
266
- );
267
-
268
- -- Note: sqlite-vec virtual table is created dynamically with dimensions:
269
- -- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_vec USING vec0(
270
- -- metadata_id INTEGER PRIMARY KEY,
271
- -- embedding float[\${dimensions}]
272
- -- );
273
-
274
-
275
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
276
- -- LAYER 4: SEMANTIC VERSIONING (Handle-Vector Bridge)
277
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
278
- -- Bridges handles to vector embeddings for semantic version comparison.
279
- -- Enables measuring semantic drift between document versions.
280
-
281
- -- @table handle_version_vectors
282
- -- @description Links handle versions to their semantic embeddings
283
- -- @column id - Auto-increment primary key
284
- -- @column handle - FK to handle_registry.handle
285
- -- @column hash - FK to card.hash (this version)
286
- -- @column parent_hash - FK to card.hash (previous version)
287
- -- @column version_order - 0 = current, 1 = previous, etc.
288
- -- @column is_current - TRUE if this is the current version
289
- -- @column embedding_id - FK to mcard_vector_metadata.id
290
- -- @column semantic_delta_from_parent - Cosine similarity to parent [-1, 1]
291
- -- @column upgrade_type - Classification: 'trivial' | 'minor' | 'major' | 'breaking'
292
- -- @column created_at - When this version was linked
293
- CREATE TABLE IF NOT EXISTS handle_version_vectors (
294
- id INTEGER PRIMARY KEY AUTOINCREMENT,
295
- handle TEXT NOT NULL,
296
- hash TEXT NOT NULL,
297
- parent_hash TEXT,
298
- version_order INTEGER NOT NULL,
299
- is_current BOOLEAN DEFAULT FALSE,
300
- embedding_id INTEGER,
301
- semantic_delta_from_parent REAL,
302
- upgrade_type TEXT,
303
- created_at TEXT NOT NULL,
304
- UNIQUE(handle, hash),
305
- FOREIGN KEY (embedding_id) REFERENCES mcard_vector_metadata(id)
306
- );
307
-
308
- -- @index idx_hvv_handle
309
- -- @description Efficient lookup of versions by handle
310
- CREATE INDEX IF NOT EXISTS idx_hvv_handle
311
- ON handle_version_vectors(handle);
312
-
313
- -- @index idx_hvv_hash
314
- -- @description Efficient lookup of versions by hash
315
- CREATE INDEX IF NOT EXISTS idx_hvv_hash
316
- ON handle_version_vectors(hash);
317
-
318
- -- @index idx_hvv_current
319
- -- @description Efficient lookup of current versions
320
- CREATE INDEX IF NOT EXISTS idx_hvv_current
321
- ON handle_version_vectors(is_current);
322
-
323
- -- @index idx_hvv_parent
324
- -- @description Efficient lookup by parent hash
325
- CREATE INDEX IF NOT EXISTS idx_hvv_parent
326
- ON handle_version_vectors(parent_hash);
327
-
328
- -- @table version_similarity_cache
329
- -- @description Precomputed pairwise similarities for performance
330
- -- @column id - Auto-increment primary key
331
- -- @column handle - Handle these versions belong to
332
- -- @column hash_a - First version hash
333
- -- @column hash_b - Second version hash
334
- -- @column similarity_score - Cosine similarity [-1, 1]
335
- -- @column distance_euclidean - L2 distance [0, \u221E)
336
- -- @column computed_at - When similarity was computed
337
- CREATE TABLE IF NOT EXISTS version_similarity_cache (
338
- id INTEGER PRIMARY KEY AUTOINCREMENT,
339
- handle TEXT NOT NULL,
340
- hash_a TEXT NOT NULL,
341
- hash_b TEXT NOT NULL,
342
- similarity_score REAL NOT NULL,
343
- distance_euclidean REAL,
344
- computed_at TEXT NOT NULL,
345
- UNIQUE(handle, hash_a, hash_b)
346
- );
347
-
348
- -- @index idx_vsc_handle
349
- -- @description Efficient lookup of cached similarities by handle
350
- CREATE INDEX IF NOT EXISTS idx_vsc_handle
351
- ON version_similarity_cache(handle);
352
-
353
-
354
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
355
- -- LAYER 5: KNOWLEDGE GRAPH (GraphRAG)
356
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
357
- -- Storage for extracted knowledge graph entities and relationships.
358
-
359
- -- @table graph_entities
360
- -- @description Nodes in the knowledge graph
361
- -- @column id - Auto-increment primary key
362
- -- @column name - Entity name
363
- -- @column type - Entity type (e.g., "Person", "Organization")
364
- -- @column description - Optional description
365
- -- @column source_hash - FK to card.hash where entity was extracted
366
- -- @column embedding - Optional entity embedding
367
- -- @column created_at - When entity was created
368
- CREATE TABLE IF NOT EXISTS graph_entities (
369
- id INTEGER PRIMARY KEY AUTOINCREMENT,
370
- name TEXT NOT NULL,
371
- type TEXT NOT NULL,
372
- description TEXT,
373
- source_hash TEXT NOT NULL,
374
- embedding BLOB,
375
- created_at TEXT NOT NULL,
376
- UNIQUE(name, type, source_hash)
377
- );
378
-
379
- -- @index idx_entity_name
380
- -- @description Efficient entity lookup by name
381
- CREATE INDEX IF NOT EXISTS idx_entity_name
382
- ON graph_entities(name);
383
-
384
- -- @index idx_entity_type
385
- -- @description Efficient entity lookup by type
386
- CREATE INDEX IF NOT EXISTS idx_entity_type
387
- ON graph_entities(type);
388
-
389
- -- @index idx_entity_source
390
- -- @description Efficient entity lookup by source document
391
- CREATE INDEX IF NOT EXISTS idx_entity_source
392
- ON graph_entities(source_hash);
393
-
394
- -- @table graph_relationships
395
- -- @description Edges in the knowledge graph
396
- -- @column id - Auto-increment primary key
397
- -- @column source_entity_id - FK to graph_entities.id (from)
398
- -- @column target_entity_id - FK to graph_entities.id (to)
399
- -- @column relationship - Relationship type/label
400
- -- @column description - Optional description
401
- -- @column weight - Relationship strength
402
- -- @column source_hash - FK to card.hash where relationship was extracted
403
- -- @column created_at - When relationship was created
404
- CREATE TABLE IF NOT EXISTS graph_relationships (
405
- id INTEGER PRIMARY KEY AUTOINCREMENT,
406
- source_entity_id INTEGER NOT NULL,
407
- target_entity_id INTEGER NOT NULL,
408
- relationship TEXT NOT NULL,
409
- description TEXT,
410
- weight REAL DEFAULT 1.0,
411
- source_hash TEXT NOT NULL,
412
- created_at TEXT NOT NULL,
413
- UNIQUE(source_entity_id, target_entity_id, relationship, source_hash),
414
- FOREIGN KEY (source_entity_id) REFERENCES graph_entities(id),
415
- FOREIGN KEY (target_entity_id) REFERENCES graph_entities(id)
416
- );
417
-
418
- -- @index idx_rel_source
419
- -- @description Efficient lookup of relationships by source entity
420
- CREATE INDEX IF NOT EXISTS idx_rel_source
421
- ON graph_relationships(source_entity_id);
422
-
423
- -- @index idx_rel_target
424
- -- @description Efficient lookup of relationships by target entity
425
- CREATE INDEX IF NOT EXISTS idx_rel_target
426
- ON graph_relationships(target_entity_id);
427
-
428
- -- @table graph_communities
429
- -- @description Hierarchical community summaries (GraphRAG)
430
- -- @column id - Auto-increment primary key
431
- -- @column level - Hierarchy level (0 = leaf)
432
- -- @column title - Community title
433
- -- @column summary - AI-generated summary
434
- -- @column embedding - Community embedding
435
- -- @column member_entity_ids - JSON array of entity IDs
436
- -- @column parent_community_id - FK to parent community
437
- -- @column created_at - When community was created
438
- CREATE TABLE IF NOT EXISTS graph_communities (
439
- id INTEGER PRIMARY KEY AUTOINCREMENT,
440
- level INTEGER NOT NULL DEFAULT 0,
441
- title TEXT,
442
- summary TEXT NOT NULL,
443
- embedding BLOB,
444
- member_entity_ids TEXT,
445
- parent_community_id INTEGER,
446
- created_at TEXT NOT NULL,
447
- FOREIGN KEY (parent_community_id) REFERENCES graph_communities(id)
448
- );
449
-
450
- -- @index idx_community_level
451
- -- @description Efficient lookup of communities by level
452
- CREATE INDEX IF NOT EXISTS idx_community_level
453
- ON graph_communities(level);
454
-
455
- -- @table graph_extractions
456
- -- @description Tracks which documents have been processed for entity extraction
457
- -- @column hash - FK to card.hash (primary key)
458
- -- @column entity_count - Number of entities extracted
459
- -- @column relationship_count - Number of relationships extracted
460
- -- @column extracted_at - When extraction was performed
461
- CREATE TABLE IF NOT EXISTS graph_extractions (
462
- hash TEXT PRIMARY KEY,
463
- entity_count INTEGER DEFAULT 0,
464
- relationship_count INTEGER DEFAULT 0,
465
- extracted_at TEXT NOT NULL
466
- );
467
-
468
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
469
- -- SCHEMA METADATA (Vector DB)
470
- -- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
471
-
472
- -- @table schema_version
473
- -- @description Tracks schema version for migrations
474
- CREATE TABLE IF NOT EXISTS vector_schema_version (
475
- version TEXT PRIMARY KEY,
476
- applied_at TEXT NOT NULL,
477
- description TEXT
478
- );
479
-
480
- -- Insert current schema version
481
- INSERT OR IGNORE INTO vector_schema_version (version, applied_at, description)
482
- VALUES ('1.0.0', datetime('now'), 'Initial MCard Vector Schema');
483
- `;
484
-
485
- // src/storage/schema.ts
486
- var TABLE_LAYERS = {
487
- // Layer 1: Core
488
- "card": "core",
489
- // Layer 2: Handle System
490
- "handle_registry": "handle",
491
- "handle_history": "handle",
492
- // Layer 3: Vector Storage
493
- "mcard_vector_metadata": "vector",
494
- "mcard_embeddings": "vector",
495
- "mcard_fts": "vector",
496
- // Layer 4: Semantic Versioning
497
- "handle_version_vectors": "semantic",
498
- "version_similarity_cache": "semantic",
499
- // Layer 5: Knowledge Graph
500
- "graph_entities": "graph",
501
- "graph_relationships": "graph",
502
- "graph_communities": "graph",
503
- "graph_extractions": "graph",
504
- // Metadata
505
- "schema_version": "metadata"
506
- };
507
- var MCardSchema = class _MCardSchema {
508
- static instance = null;
509
- schemaPath = "";
510
- rawSql = "";
511
- statements = [];
512
- tables = /* @__PURE__ */ new Map();
513
- indexes = /* @__PURE__ */ new Map();
514
- loaded = false;
515
- constructor() {
516
- }
517
- /**
518
- * Get the singleton instance.
519
- */
520
- static getInstance() {
521
- if (!_MCardSchema.instance) {
522
- _MCardSchema.instance = new _MCardSchema();
523
- _MCardSchema.instance.load();
524
- }
525
- return _MCardSchema.instance;
526
- }
527
- /**
528
- * Reset the singleton (for testing).
529
- */
530
- static resetInstance() {
531
- _MCardSchema.instance = null;
532
- }
533
- load() {
534
- if (this.loaded) return;
535
- this.schemaPath = "IN_MEMORY_CONSTANTS";
536
- this.rawSql = MCARD_SCHEMA_SQL;
537
- if (MCARD_VECTOR_SCHEMA_SQL) {
538
- this.rawSql += "\n\n" + MCARD_VECTOR_SCHEMA_SQL;
539
- }
540
- this.statements = this.parseStatements(this.rawSql);
541
- for (const stmt of this.statements) {
542
- const name = this.extractName(stmt);
543
- if (name) {
544
- const upper = stmt.toUpperCase();
545
- if (upper.includes("CREATE TABLE") || upper.includes("CREATE VIRTUAL TABLE")) {
546
- this.tables.set(name.toLowerCase(), stmt);
547
- } else if (upper.includes("CREATE INDEX")) {
548
- this.indexes.set(name.toLowerCase(), stmt);
549
- }
550
- }
551
- }
552
- this.loaded = true;
553
- }
554
- parseStatements(sql) {
555
- sql = sql.replace(/\/\*[\s\S]*?\*\//g, "");
556
- const statements = [];
557
- let current = [];
558
- for (const line of sql.split("\n")) {
559
- const stripped = line.split("--")[0].trim();
560
- if (!stripped) continue;
561
- current.push(stripped);
562
- if (stripped.endsWith(";")) {
563
- const statement = current.join(" ");
564
- if (!statement.trim().toUpperCase().startsWith("INSERT")) {
565
- statements.push(statement);
566
- }
567
- current = [];
568
- }
569
- }
570
- return statements.filter((s) => s.trim());
571
- }
572
- extractName(statement) {
573
- let match = statement.match(/CREATE\s+(?:VIRTUAL\s+)?TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)/i);
574
- if (match) return match[1];
575
- match = statement.match(/CREATE\s+INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?(\w+)/i);
576
- if (match) return match[1];
577
- return null;
578
- }
579
- // ─────────────────────────────────────────────────────────────────────────
580
- // Schema Access
581
- // ─────────────────────────────────────────────────────────────────────────
582
- getSchemaPath() {
583
- return this.schemaPath;
584
- }
585
- getTable(tableName) {
586
- return this.tables.get(tableName.toLowerCase());
587
- }
588
- getIndex(indexName) {
589
- return this.indexes.get(indexName.toLowerCase());
590
- }
591
- getAllTables() {
592
- return new Map(this.tables);
593
- }
594
- getAllIndexes() {
595
- return new Map(this.indexes);
596
- }
597
- getAllStatements() {
598
- return [...this.statements];
599
- }
600
- getTablesByLayer(layer) {
601
- return Object.entries(TABLE_LAYERS).filter(([_, l]) => l === layer).map(([name, _]) => name);
602
- }
603
- getLayerStatements(layer) {
604
- const statements = [];
605
- const tables = this.getTablesByLayer(layer);
606
- for (const table of tables) {
607
- const stmt = this.getTable(table);
608
- if (stmt) statements.push(stmt);
609
- }
610
- for (const [_, stmt] of this.indexes) {
611
- const match = stmt.match(/ON\s+(\w+)/i);
612
- if (match && tables.includes(match[1].toLowerCase())) {
613
- statements.push(stmt);
614
- }
615
- }
616
- return statements;
617
- }
618
- // ─────────────────────────────────────────────────────────────────────────
619
- // Database Initialization
620
- // ─────────────────────────────────────────────────────────────────────────
621
- execStatements(db, statements) {
622
- for (const stmt of statements) {
623
- db.exec(stmt);
624
- }
625
- return statements.length;
626
- }
627
- initLayer(db, layer) {
628
- return this.execStatements(db, this.getLayerStatements(layer));
629
- }
630
- initCoreTables(db) {
631
- return this.initLayer(db, "core");
632
- }
633
- initHandleTables(db) {
634
- return this.initLayer(db, "handle");
635
- }
636
- initVectorTables(db, enableFts = true) {
637
- const statements = this.getLayerStatements("vector").filter((s) => enableFts || !s.toLowerCase().includes("fts"));
638
- return this.execStatements(db, statements);
639
- }
640
- initSemanticTables(db) {
641
- return this.initLayer(db, "semantic");
642
- }
643
- initGraphTables(db) {
644
- return this.initLayer(db, "graph");
645
- }
646
- initAllTables(db, options = {}) {
647
- const { enableFts = true, enableGraph = true, enableSemantic = true } = options;
648
- let count = 0;
649
- count += this.initCoreTables(db);
650
- count += this.initHandleTables(db);
651
- count += this.initVectorTables(db, enableFts);
652
- if (enableSemantic) {
653
- count += this.initSemanticTables(db);
654
- }
655
- if (enableGraph) {
656
- count += this.initGraphTables(db);
657
- }
658
- return count;
659
- }
660
- initVec0Table(db, dimensions) {
661
- db.exec(`
662
- CREATE VIRTUAL TABLE IF NOT EXISTS mcard_vec USING vec0(
663
- metadata_id INTEGER PRIMARY KEY,
664
- embedding float[${dimensions}]
665
- )
666
- `);
667
- }
668
- };
669
- function getSchemaInstance() {
670
- return MCardSchema.getInstance();
671
- }
672
- var CARD_TABLE_SCHEMA = getSchemaInstance().getTable("card") || "";
673
- var HANDLE_REGISTRY_SCHEMA = getSchemaInstance().getTable("handle_registry") || "";
674
- var HANDLE_HISTORY_SCHEMA = getSchemaInstance().getTable("handle_history") || "";
675
- var HANDLE_INDEX_SCHEMA = getSchemaInstance().getIndex("idx_handle_current_hash") || "";
676
- var VECTOR_METADATA_SCHEMA = getSchemaInstance().getTable("mcard_vector_metadata") || "";
677
- var VECTOR_METADATA_INDEX = getSchemaInstance().getIndex("idx_vector_metadata_hash") || "";
678
- var VECTOR_EMBEDDINGS_SCHEMA = getSchemaInstance().getTable("mcard_embeddings") || "";
679
- var VECTOR_FTS_SCHEMA = getSchemaInstance().getTable("mcard_fts") || "";
680
- var HANDLE_VERSION_VECTORS_SCHEMA = getSchemaInstance().getTable("handle_version_vectors") || "";
681
- var HANDLE_VERSION_VECTORS_INDEXES = [
682
- getSchemaInstance().getIndex("idx_hvv_handle"),
683
- getSchemaInstance().getIndex("idx_hvv_hash"),
684
- getSchemaInstance().getIndex("idx_hvv_current"),
685
- getSchemaInstance().getIndex("idx_hvv_parent")
686
- ].filter(Boolean).join("; ");
687
- var VERSION_SIMILARITY_CACHE_SCHEMA = getSchemaInstance().getTable("version_similarity_cache") || "";
688
- var VERSION_SIMILARITY_CACHE_INDEX = getSchemaInstance().getIndex("idx_vsc_handle") || "";
689
- var GRAPH_ENTITY_SCHEMA = getSchemaInstance().getTable("graph_entities") || "";
690
- var GRAPH_ENTITY_INDEX_NAME = getSchemaInstance().getIndex("idx_entity_name") || "";
691
- var GRAPH_ENTITY_INDEX_TYPE = getSchemaInstance().getIndex("idx_entity_type") || "";
692
- var GRAPH_ENTITY_INDEX_SOURCE = getSchemaInstance().getIndex("idx_entity_source") || "";
693
- var GRAPH_RELATIONSHIP_SCHEMA = getSchemaInstance().getTable("graph_relationships") || "";
694
- var GRAPH_RELATIONSHIP_INDEX_SOURCE = getSchemaInstance().getIndex("idx_rel_source") || "";
695
- var GRAPH_RELATIONSHIP_INDEX_TARGET = getSchemaInstance().getIndex("idx_rel_target") || "";
696
- var GRAPH_COMMUNITY_SCHEMA = getSchemaInstance().getTable("graph_communities") || "";
697
- var GRAPH_COMMUNITY_INDEX_LEVEL = getSchemaInstance().getIndex("idx_community_level") || "";
698
- var GRAPH_EXTRACTION_SCHEMA = getSchemaInstance().getTable("graph_extractions") || "";
699
- var CORE_SCHEMAS = {
700
- card: CARD_TABLE_SCHEMA,
701
- handleRegistry: HANDLE_REGISTRY_SCHEMA,
702
- handleHistory: HANDLE_HISTORY_SCHEMA,
703
- handleIndex: HANDLE_INDEX_SCHEMA
704
- };
705
- function initCoreSchemas(db) {
706
- const schema = MCardSchema.getInstance();
707
- schema.initCoreTables(db);
708
- schema.initHandleTables(db);
709
- }
710
-
711
- export {
712
- HandleValidationError,
713
- validateHandle,
714
- ContentHandle,
715
- CORE_SCHEMAS,
716
- initCoreSchemas
717
- };