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
@@ -0,0 +1,217 @@
1
+ import {
2
+ AbstractSqlEngine,
3
+ initCoreSchemas
4
+ } from "./chunk-BFD4WSWU.js";
5
+ import {
6
+ createPage
7
+ } from "./chunk-3EIBJPNF.js";
8
+ import {
9
+ Handle_exports,
10
+ init_Handle
11
+ } from "./chunk-ADV52544.js";
12
+ import {
13
+ DEFAULT_PAGE_SIZE,
14
+ SQLITE_BUSY_TIMEOUT_MS
15
+ } from "./chunk-A5S2PI37.js";
16
+ import {
17
+ MCard
18
+ } from "./chunk-2NFGZ6PA.js";
19
+ import {
20
+ __toCommonJS
21
+ } from "./chunk-PNKVD2UK.js";
22
+
23
+ // src/storage/engines/SqliteNodeEngine.ts
24
+ var SqliteNodeEngine = class _SqliteNodeEngine extends AbstractSqlEngine {
25
+ db;
26
+ dbPath;
27
+ /**
28
+ * Convert a database row into an MCard instance.
29
+ */
30
+ rowToCard(row) {
31
+ const rawContent = row.content;
32
+ const content = rawContent instanceof Buffer ? new Uint8Array(rawContent) : new Uint8Array(rawContent);
33
+ return MCard.fromData(content, String(row.hash), String(row.g_time));
34
+ }
35
+ /**
36
+ * Create a new SqliteNodeEngine via async factory.
37
+ * @param dbPath Path to database file, or ':memory:' for in-memory database
38
+ */
39
+ static async create(dbPath = ":memory:") {
40
+ const engine = new _SqliteNodeEngine(dbPath);
41
+ await engine.init();
42
+ return engine;
43
+ }
44
+ constructor(dbPath) {
45
+ super();
46
+ this.dbPath = dbPath;
47
+ }
48
+ async init() {
49
+ try {
50
+ const mod = await import("better-sqlite3");
51
+ const Database = mod.default || mod;
52
+ this.db = new Database(this.dbPath);
53
+ this.setupDatabase();
54
+ } catch (e) {
55
+ console.error(`SqliteNodeEngine: Failed to load better-sqlite3: ${e.message}`);
56
+ throw e;
57
+ }
58
+ }
59
+ /**
60
+ * Initialize database schema
61
+ */
62
+ setupDatabase() {
63
+ this.db.pragma("journal_mode = WAL");
64
+ this.db.pragma(`busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
65
+ this.db.pragma("synchronous = NORMAL");
66
+ initCoreSchemas(this.db);
67
+ }
68
+ // ======================================================================
69
+ // AbstractSqlEngine primitives
70
+ // ======================================================================
71
+ async queryRows(sql, ...params) {
72
+ const stmt = this.db.prepare(sql);
73
+ return stmt.all(...params);
74
+ }
75
+ async execSql(sql, ...params) {
76
+ if (params.length === 0) {
77
+ this.db.exec(sql);
78
+ return 0;
79
+ }
80
+ const stmt = this.db.prepare(sql);
81
+ const result = stmt.run(...params);
82
+ return result.changes;
83
+ }
84
+ /**
85
+ * Close the database connection
86
+ */
87
+ close() {
88
+ this.db.close();
89
+ }
90
+ /**
91
+ * Get the database path
92
+ */
93
+ getDbPath() {
94
+ return this.dbPath;
95
+ }
96
+ // =========== Card Operations (overrides to use Buffer.from for better-sqlite3) ===========
97
+ async add(card) {
98
+ const stmt = this.db.prepare(
99
+ "INSERT OR REPLACE INTO card (hash, content, g_time) VALUES (?, ?, ?)"
100
+ );
101
+ stmt.run(card.hash, Buffer.from(card.content), card.g_time);
102
+ return card.hash;
103
+ }
104
+ // =========== Sync card operations (for performance-critical callers) ===========
105
+ addSync(card) {
106
+ const stmt = this.db.prepare(
107
+ "INSERT OR REPLACE INTO card (hash, content, g_time) VALUES (?, ?, ?)"
108
+ );
109
+ stmt.run(card.hash, Buffer.from(card.content), card.g_time);
110
+ return card.hash;
111
+ }
112
+ getSync(hash) {
113
+ const stmt = this.db.prepare("SELECT hash, content, g_time FROM card WHERE hash = ?");
114
+ const row = stmt.get(hash);
115
+ if (!row) return null;
116
+ return this.rowToCard(row);
117
+ }
118
+ deleteSync(hash) {
119
+ const stmt = this.db.prepare("DELETE FROM card WHERE hash = ?");
120
+ const result = stmt.run(hash);
121
+ return result.changes > 0;
122
+ }
123
+ getPageSync(pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
124
+ if (pageNumber < 1) throw new Error("Page number must be >= 1");
125
+ if (pageSize < 1) throw new Error("Page size must be >= 1");
126
+ const totalItems = this.countSync();
127
+ const offset = (pageNumber - 1) * pageSize;
128
+ const stmt = this.db.prepare(
129
+ "SELECT hash, content, g_time FROM card ORDER BY g_time DESC LIMIT ? OFFSET ?"
130
+ );
131
+ const rows = stmt.all(pageSize, offset);
132
+ const items = rows.map((row) => this.rowToCard(row));
133
+ return createPage(items, totalItems, pageNumber, pageSize);
134
+ }
135
+ countSync() {
136
+ const stmt = this.db.prepare("SELECT COUNT(*) as cnt FROM card");
137
+ const row = stmt.get();
138
+ return row.cnt;
139
+ }
140
+ clearSync() {
141
+ this.db.exec("DELETE FROM handle_history");
142
+ this.db.exec("DELETE FROM handle_registry");
143
+ this.db.exec("DELETE FROM card");
144
+ }
145
+ // =========== Additional sync search operations ===========
146
+ searchByString(searchString, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
147
+ if (pageNumber < 1) throw new Error("Page number must be >= 1");
148
+ if (pageSize < 1) throw new Error("Page size must be >= 1");
149
+ const pattern = `%${searchString}%`;
150
+ const offset = (pageNumber - 1) * pageSize;
151
+ const countStmt = this.db.prepare(`
152
+ SELECT COUNT(*) as cnt FROM card
153
+ WHERE hash LIKE ? OR g_time LIKE ? OR CAST(content AS TEXT) LIKE ?
154
+ `);
155
+ const countRow = countStmt.get(pattern, pattern, pattern);
156
+ const totalItems = countRow.cnt;
157
+ const stmt = this.db.prepare(`
158
+ SELECT hash, content, g_time FROM card
159
+ WHERE hash LIKE ? OR g_time LIKE ? OR CAST(content AS TEXT) LIKE ?
160
+ ORDER BY g_time DESC LIMIT ? OFFSET ?
161
+ `);
162
+ const rows = stmt.all(pattern, pattern, pattern, pageSize, offset);
163
+ const items = rows.map((row) => this.rowToCard(row));
164
+ return createPage(items, totalItems, pageNumber, pageSize);
165
+ }
166
+ searchByContent(searchPattern, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
167
+ if (pageNumber < 1) throw new Error("Page number must be >= 1");
168
+ if (pageSize < 1) throw new Error("Page size must be >= 1");
169
+ if (!searchPattern || typeof searchPattern === "string" && searchPattern.length === 0) {
170
+ throw new Error("Search pattern cannot be empty");
171
+ }
172
+ const searchBytes = typeof searchPattern === "string" ? Buffer.from(searchPattern, "utf-8") : Buffer.from(searchPattern);
173
+ const offset = (pageNumber - 1) * pageSize;
174
+ const countStmt = this.db.prepare("SELECT COUNT(*) as cnt FROM card WHERE INSTR(content, ?) > 0");
175
+ const countRow = countStmt.get(searchBytes);
176
+ const totalItems = countRow.cnt;
177
+ const stmt = this.db.prepare(`
178
+ SELECT hash, content, g_time FROM card
179
+ WHERE INSTR(content, ?) > 0
180
+ ORDER BY g_time DESC LIMIT ? OFFSET ?
181
+ `);
182
+ const rows = stmt.all(searchBytes, pageSize, offset);
183
+ const items = rows.map((row) => this.rowToCard(row));
184
+ return createPage(items, totalItems, pageNumber, pageSize);
185
+ }
186
+ getAllCards() {
187
+ const stmt = this.db.prepare("SELECT hash, content, g_time FROM card ORDER BY g_time DESC");
188
+ const rows = stmt.all();
189
+ const items = rows.map((row) => this.rowToCard(row));
190
+ return createPage(items, items.length, 1, items.length || 1);
191
+ }
192
+ // =========== Unique sync method (not in AbstractSqlEngine) ===========
193
+ deleteHistoryEntrySync(handle, previousHash) {
194
+ const { validateHandle } = (init_Handle(), __toCommonJS(Handle_exports));
195
+ const normalized = validateHandle(handle);
196
+ const performStitch = this.db.transaction(() => {
197
+ const rOut = this.db.prepare(
198
+ "SELECT id, previous_hash FROM handle_history WHERE handle = ? AND previous_hash = ? ORDER BY id DESC LIMIT 1"
199
+ ).get(normalized, previousHash);
200
+ if (!rOut) return;
201
+ const rIn = this.db.prepare(
202
+ "SELECT id, previous_hash FROM handle_history WHERE handle = ? AND id < ? ORDER BY id DESC LIMIT 1"
203
+ ).get(normalized, rOut.id);
204
+ if (rIn) {
205
+ this.db.prepare("UPDATE handle_history SET previous_hash = ? WHERE id = ?").run(rIn.previous_hash, rOut.id);
206
+ this.db.prepare("DELETE FROM handle_history WHERE id = ?").run(rIn.id);
207
+ } else {
208
+ this.db.prepare("DELETE FROM handle_history WHERE id = ?").run(rOut.id);
209
+ }
210
+ });
211
+ performStitch();
212
+ }
213
+ };
214
+
215
+ export {
216
+ SqliteNodeEngine
217
+ };
@@ -0,0 +1,112 @@
1
+ import {
2
+ AbstractSqlEngine,
3
+ CORE_SCHEMAS
4
+ } from "./chunk-4VWWTGRW.js";
5
+ import {
6
+ DEFAULT_SQLJS_WASM_URL
7
+ } from "./chunk-BSEFN25Q.js";
8
+ import {
9
+ MCard
10
+ } from "./chunk-2NFGZ6PA.js";
11
+
12
+ // src/storage/engines/SqliteWasmEngine.ts
13
+ var SqliteWasmEngine = class extends AbstractSqlEngine {
14
+ db = null;
15
+ SQL = null;
16
+ /**
17
+ * Initialize the database
18
+ * @param wasmUrl URL to sql-wasm.wasm file (optional, defaults to CDN)
19
+ * @param existingData Optional existing database as Uint8Array
20
+ */
21
+ async init(wasmUrl, existingData) {
22
+ const initSqlJs = (await import("sql.js")).default;
23
+ const SQL = await initSqlJs({
24
+ locateFile: (file) => wasmUrl || `${DEFAULT_SQLJS_WASM_URL}${file}`
25
+ });
26
+ this.SQL = SQL;
27
+ this.db = existingData ? new SQL.Database(existingData) : new SQL.Database();
28
+ this.db.run(CORE_SCHEMAS.card);
29
+ this.db.run(CORE_SCHEMAS.handleRegistry);
30
+ this.db.run(CORE_SCHEMAS.handleHistory);
31
+ this.db.run(CORE_SCHEMAS.handleIndex);
32
+ }
33
+ ensureDb() {
34
+ if (!this.db) throw new Error("Database not initialized. Call init() first.");
35
+ return this.db;
36
+ }
37
+ // ======================================================================
38
+ // AbstractSqlEngine primitives
39
+ // ======================================================================
40
+ async queryRows(sql, ...params) {
41
+ const db = this.ensureDb();
42
+ const stmt = db.prepare(sql);
43
+ if (params.length > 0) stmt.bind(params);
44
+ const results = [];
45
+ while (stmt.step()) {
46
+ const row = stmt.getAsObject();
47
+ results.push(row);
48
+ }
49
+ stmt.free();
50
+ return results;
51
+ }
52
+ async execSql(sql, ...params) {
53
+ const db = this.ensureDb();
54
+ if (params.length === 0) {
55
+ db.run(sql);
56
+ } else {
57
+ db.run(sql, params);
58
+ }
59
+ return 0;
60
+ }
61
+ // ======================================================================
62
+ // Row → MCard conversion (sql.js returns Uint8Array for BLOBs)
63
+ // ======================================================================
64
+ rowToCard(row) {
65
+ const rawContent = row.content;
66
+ const content = rawContent instanceof Uint8Array ? rawContent : typeof rawContent === "string" ? new TextEncoder().encode(rawContent) : new Uint8Array(0);
67
+ return MCard.fromData(content, String(row.hash), String(row.g_time));
68
+ }
69
+ // ======================================================================
70
+ // sql.js-specific helpers
71
+ // ======================================================================
72
+ /**
73
+ * Export database as Uint8Array (for persistence)
74
+ */
75
+ export() {
76
+ return this.ensureDb().export();
77
+ }
78
+ /**
79
+ * Get raw sql.js Database for use with VectorStore adapter.
80
+ */
81
+ getRawDb() {
82
+ return this.ensureDb();
83
+ }
84
+ // =========== pruneHandleHistory override (needs count before delete) ===========
85
+ async pruneHandleHistory(handle, options = {}) {
86
+ const { validateHandle } = await import("./Handle-3N4QOA3U.js");
87
+ const db = this.ensureDb();
88
+ const normalized = validateHandle(handle);
89
+ if (options.deleteAll) {
90
+ const stmt = db.prepare("SELECT COUNT(*) FROM handle_history WHERE handle = ?");
91
+ stmt.bind([normalized]);
92
+ stmt.step();
93
+ const count = stmt.get()[0];
94
+ stmt.free();
95
+ db.run("DELETE FROM handle_history WHERE handle = ?", [normalized]);
96
+ return count;
97
+ } else if (options.olderThan) {
98
+ const stmt = db.prepare("SELECT COUNT(*) FROM handle_history WHERE handle = ? AND changed_at < ?");
99
+ stmt.bind([normalized, options.olderThan]);
100
+ stmt.step();
101
+ const count = stmt.get()[0];
102
+ stmt.free();
103
+ db.run("DELETE FROM handle_history WHERE handle = ? AND changed_at < ?", [normalized, options.olderThan]);
104
+ return count;
105
+ }
106
+ return 0;
107
+ }
108
+ };
109
+
110
+ export {
111
+ SqliteWasmEngine
112
+ };
@@ -739,92 +739,6 @@ var TextValidator = class _TextValidator extends BaseValidator {
739
739
  }
740
740
  };
741
741
 
742
- // src/model/detectors/BinarySignatureDetector.ts
743
- var BinarySignatureDetector = class _BinarySignatureDetector {
744
- // Dictionary of binary signatures mapped to MIME types
745
- // Note: In TS, we use numbers or number arrays for bytes
746
- static SIGNATURES = {
747
- // Images
748
- "89504e470d0a1a0a": "image/png",
749
- // \x89PNG\r\n\x1a\n
750
- "ffd8ff": "image/jpeg",
751
- "474946383761": "image/gif",
752
- // GIF87a
753
- "474946383961": "image/gif",
754
- // GIF89a
755
- "424d": "image/bmp",
756
- // BM
757
- "00000100": "image/x-icon",
758
- "00000200": "image/x-icon",
759
- // MP4
760
- "00000018667479706d703432": "video/mp4",
761
- // ...ftypmp42
762
- "000000186674797069736f6d": "video/mp4",
763
- // ...ftypisom
764
- // ... (simplified for key common ones)
765
- // Documents
766
- "25504446": "application/pdf",
767
- // %PDF
768
- // Archives
769
- "504b0304": "application/zip",
770
- // PK\x03\x04
771
- "1f8b08": "application/gzip",
772
- "526172211a0700": "application/x-rar-compressed",
773
- // Rar!
774
- "377abcaf271c": "application/x-7z-compressed",
775
- // 7z...
776
- // Database
777
- "53514c69746520666f726d6174203300": "application/x-sqlite3"
778
- // SQLite format 3\0
779
- };
780
- static OLE_SIGNATURE = "d0cf11e0a1b11ae1";
781
- /**
782
- * Helper to convert hex string to Uint8Array for easy comparison if needed,
783
- * but we will convert input bytes to hex for lookup.
784
- */
785
- detect(content) {
786
- return this.detectFromBytes(content);
787
- }
788
- detectFromBytes(content) {
789
- if (this.startsWithAscii(content, "RIFF")) {
790
- return this.detectRiffFormat(content);
791
- }
792
- const hexHeader = this.toHex(content.slice(0, 32));
793
- for (const [signature, mimeType] of Object.entries(_BinarySignatureDetector.SIGNATURES)) {
794
- if (hexHeader.startsWith(signature)) {
795
- if (signature === _BinarySignatureDetector.OLE_SIGNATURE) {
796
- return "application/oleobject";
797
- }
798
- if (signature === "504b0304") {
799
- return "application/zip";
800
- }
801
- return mimeType;
802
- }
803
- }
804
- return "application/octet-stream";
805
- }
806
- detectRiffFormat(content) {
807
- if (content.length < 12) return "application/octet-stream";
808
- const formatType = this.toAscii(content.slice(8, 12));
809
- if (formatType === "WAVE") return "audio/wav";
810
- if (formatType === "WEBP") return "image/webp";
811
- return "application/octet-stream";
812
- }
813
- startsWithAscii(content, str) {
814
- if (content.length < str.length) return false;
815
- for (let i = 0; i < str.length; i++) {
816
- if (content[i] !== str.charCodeAt(i)) return false;
817
- }
818
- return true;
819
- }
820
- toAscii(content) {
821
- return Array.from(content).map((b) => String.fromCharCode(b)).join("");
822
- }
823
- toHex(content) {
824
- return Array.from(content).map((b) => b.toString(16).padStart(2, "0")).join("");
825
- }
826
- };
827
-
828
742
  // src/model/validators/BinaryValidator.ts
829
743
  var BinaryValidator = class _BinaryValidator extends BaseValidator {
830
744
  static BINARY_MIME_TYPES = /* @__PURE__ */ new Set([
@@ -838,7 +752,6 @@ var BinaryValidator = class _BinaryValidator extends BaseValidator {
838
752
  "audio/wav",
839
753
  "application/octet-stream"
840
754
  ]);
841
- detector = new BinarySignatureDetector();
842
755
  canValidate(mimeType) {
843
756
  return _BinaryValidator.BINARY_MIME_TYPES.has(mimeType) || mimeType.startsWith("image/") || mimeType.startsWith("audio/") || mimeType.startsWith("video/");
844
757
  }
@@ -866,29 +779,19 @@ var BinaryValidator = class _BinaryValidator extends BaseValidator {
866
779
  } else if (mimeType === "image/gif" && content.length <= 6) {
867
780
  throw new ValidationError("Invalid GIF content: truncated file");
868
781
  }
869
- const signatures = BinarySignatureDetector.SIGNATURES;
870
- let expectedSig = null;
871
- for (const [sig, mime] of Object.entries(signatures)) {
872
- if (mime === mimeType) {
873
- expectedSig = sig;
874
- }
875
- }
876
- if (expectedSig) {
877
- const contentHex = this.toHex(content.slice(0, expectedSig.length / 2));
878
- if (contentHex !== expectedSig) {
879
- let hasMatch = false;
880
- for (const [sig, mime] of Object.entries(signatures)) {
881
- if (mime === mimeType) {
882
- const currentHex = this.toHex(content.slice(0, sig.length / 2));
883
- if (currentHex === sig) {
884
- hasMatch = true;
885
- break;
886
- }
887
- }
888
- }
889
- if (!hasMatch) {
890
- throw new ValidationError(`Invalid ${mimeType} content: missing proper header`);
891
- }
782
+ const signatures = {
783
+ "image/png": "89504e470d0a1a0a",
784
+ // \x89PNG\r\n\x1a\n
785
+ "image/jpeg": "ffd8ff",
786
+ // \xff\xd8\xff
787
+ "image/gif": "47494638"
788
+ // GIF8
789
+ };
790
+ if (signatures[mimeType]) {
791
+ const expectedSig = signatures[mimeType];
792
+ const currentHex = this.toHex(content.slice(0, expectedSig.length / 2));
793
+ if (!currentHex.startsWith(expectedSig) && currentHex !== expectedSig) {
794
+ throw new ValidationError(`Invalid ${mimeType} content: missing proper header`);
892
795
  }
893
796
  }
894
797
  }
@@ -0,0 +1,112 @@
1
+ import {
2
+ AbstractSqlEngine,
3
+ CORE_SCHEMAS
4
+ } from "./chunk-4VWWTGRW.js";
5
+ import {
6
+ DEFAULT_SQLJS_WASM_URL
7
+ } from "./chunk-BSEFN25Q.js";
8
+ import {
9
+ MCard
10
+ } from "./chunk-OKWBHCKC.js";
11
+
12
+ // src/storage/engines/SqliteWasmEngine.ts
13
+ var SqliteWasmEngine = class extends AbstractSqlEngine {
14
+ db = null;
15
+ SQL = null;
16
+ /**
17
+ * Initialize the database
18
+ * @param wasmUrl URL to sql-wasm.wasm file (optional, defaults to CDN)
19
+ * @param existingData Optional existing database as Uint8Array
20
+ */
21
+ async init(wasmUrl, existingData) {
22
+ const initSqlJs = (await import("sql.js")).default;
23
+ const SQL = await initSqlJs({
24
+ locateFile: (file) => wasmUrl || `${DEFAULT_SQLJS_WASM_URL}${file}`
25
+ });
26
+ this.SQL = SQL;
27
+ this.db = existingData ? new SQL.Database(existingData) : new SQL.Database();
28
+ this.db.run(CORE_SCHEMAS.card);
29
+ this.db.run(CORE_SCHEMAS.handleRegistry);
30
+ this.db.run(CORE_SCHEMAS.handleHistory);
31
+ this.db.run(CORE_SCHEMAS.handleIndex);
32
+ }
33
+ ensureDb() {
34
+ if (!this.db) throw new Error("Database not initialized. Call init() first.");
35
+ return this.db;
36
+ }
37
+ // ======================================================================
38
+ // AbstractSqlEngine primitives
39
+ // ======================================================================
40
+ async queryRows(sql, ...params) {
41
+ const db = this.ensureDb();
42
+ const stmt = db.prepare(sql);
43
+ if (params.length > 0) stmt.bind(params);
44
+ const results = [];
45
+ while (stmt.step()) {
46
+ const row = stmt.getAsObject();
47
+ results.push(row);
48
+ }
49
+ stmt.free();
50
+ return results;
51
+ }
52
+ async execSql(sql, ...params) {
53
+ const db = this.ensureDb();
54
+ if (params.length === 0) {
55
+ db.run(sql);
56
+ } else {
57
+ db.run(sql, params);
58
+ }
59
+ return 0;
60
+ }
61
+ // ======================================================================
62
+ // Row → MCard conversion (sql.js returns Uint8Array for BLOBs)
63
+ // ======================================================================
64
+ rowToCard(row) {
65
+ const rawContent = row.content;
66
+ const content = rawContent instanceof Uint8Array ? rawContent : typeof rawContent === "string" ? new TextEncoder().encode(rawContent) : new Uint8Array(0);
67
+ return MCard.fromData(content, String(row.hash), String(row.g_time));
68
+ }
69
+ // ======================================================================
70
+ // sql.js-specific helpers
71
+ // ======================================================================
72
+ /**
73
+ * Export database as Uint8Array (for persistence)
74
+ */
75
+ export() {
76
+ return this.ensureDb().export();
77
+ }
78
+ /**
79
+ * Get raw sql.js Database for use with VectorStore adapter.
80
+ */
81
+ getRawDb() {
82
+ return this.ensureDb();
83
+ }
84
+ // =========== pruneHandleHistory override (needs count before delete) ===========
85
+ async pruneHandleHistory(handle, options = {}) {
86
+ const { validateHandle } = await import("./Handle-3N4QOA3U.js");
87
+ const db = this.ensureDb();
88
+ const normalized = validateHandle(handle);
89
+ if (options.deleteAll) {
90
+ const stmt = db.prepare("SELECT COUNT(*) FROM handle_history WHERE handle = ?");
91
+ stmt.bind([normalized]);
92
+ stmt.step();
93
+ const count = stmt.get()[0];
94
+ stmt.free();
95
+ db.run("DELETE FROM handle_history WHERE handle = ?", [normalized]);
96
+ return count;
97
+ } else if (options.olderThan) {
98
+ const stmt = db.prepare("SELECT COUNT(*) FROM handle_history WHERE handle = ? AND changed_at < ?");
99
+ stmt.bind([normalized, options.olderThan]);
100
+ stmt.step();
101
+ const count = stmt.get()[0];
102
+ stmt.free();
103
+ db.run("DELETE FROM handle_history WHERE handle = ? AND changed_at < ?", [normalized, options.olderThan]);
104
+ return count;
105
+ }
106
+ return 0;
107
+ }
108
+ };
109
+
110
+ export {
111
+ SqliteWasmEngine
112
+ };
@@ -1,6 +1,9 @@
1
+ import {
2
+ DEFAULT_PAGE_SIZE
3
+ } from "./chunk-BSEFN25Q.js";
1
4
  import {
2
5
  MCard
3
- } from "./chunk-QPZ2HNSU.js";
6
+ } from "./chunk-OKWBHCKC.js";
4
7
 
5
8
  // src/monads/Maybe.ts
6
9
  var Maybe = class _Maybe {
@@ -84,13 +87,13 @@ var CardCollection = class {
84
87
  if (existingCard) {
85
88
  const isDuplicate = this.areContentsEqual(existingCard.content, card.content);
86
89
  if (isDuplicate) {
87
- const { generateDuplicationEvent } = await import("./EventProducer-MW6QF4IO.js");
90
+ const { generateDuplicationEvent } = await import("./EventProducer-AWD6YMZR.js");
88
91
  const eventStr = generateDuplicationEvent(card);
89
92
  const eventCard = await MCard.create(eventStr);
90
93
  await this.engine.add(eventCard);
91
94
  return card.hash;
92
95
  } else {
93
- const { generateCollisionEvent } = await import("./EventProducer-MW6QF4IO.js");
96
+ const { generateCollisionEvent } = await import("./EventProducer-AWD6YMZR.js");
94
97
  const eventStr = await generateCollisionEvent(card);
95
98
  const eventCard = await MCard.create(eventStr);
96
99
  await this.engine.add(eventCard);
@@ -127,7 +130,7 @@ var CardCollection = class {
127
130
  /**
128
131
  * Get a page of cards
129
132
  */
130
- async getPage(pageNumber = 1, pageSize = 10) {
133
+ async getPage(pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
131
134
  return this.engine.getPage(pageNumber, pageSize);
132
135
  }
133
136
  /**
@@ -217,10 +220,10 @@ var CardCollection = class {
217
220
  async clear() {
218
221
  return this.engine.clear();
219
222
  }
220
- async searchByString(query, pageNumber = 1, pageSize = 10) {
223
+ async searchByString(query, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
221
224
  return this.engine.search(query, pageNumber, pageSize);
222
225
  }
223
- async searchByContent(query, pageNumber = 1, pageSize = 10) {
226
+ async searchByContent(query, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
224
227
  return this.engine.search(query, pageNumber, pageSize);
225
228
  }
226
229
  async searchByHash(hashPrefix) {
@@ -229,7 +232,7 @@ var CardCollection = class {
229
232
  async getAllMCardsRaw() {
230
233
  return this.engine.getAll();
231
234
  }
232
- async getAllCards(pageSize = 10, processCallback) {
235
+ async getAllCards(pageSize = DEFAULT_PAGE_SIZE, processCallback) {
233
236
  const cards = [];
234
237
  let pageNumber = 1;
235
238
  let total = 0;
@@ -233,6 +233,11 @@ var OllamaProvider = class extends BaseLLMProvider {
233
233
  timeout: this.timeout
234
234
  };
235
235
  return new Promise((resolve) => {
236
+ let payload;
237
+ if (data) {
238
+ payload = JSON.stringify(data);
239
+ options.headers["Content-Length"] = Buffer.byteLength(payload);
240
+ }
236
241
  const req = client.request(url, options, (res) => {
237
242
  let body = "";
238
243
  res.on("data", (chunk) => {
@@ -270,18 +275,21 @@ var OllamaProvider = class extends BaseLLMProvider {
270
275
  req.destroy();
271
276
  resolve(Either.left(`Ollama request timed out after ${this.timeout}ms`));
272
277
  });
273
- if (data) {
274
- req.write(JSON.stringify(data));
278
+ if (payload) {
279
+ req.write(payload);
275
280
  }
276
281
  req.end();
277
282
  });
278
283
  }
279
- async complete(prompt, params) {
284
+ async complete(prompt, params, images) {
280
285
  const data = {
281
286
  model: typeof params.model === "string" ? params.model : this.config.default_model,
282
287
  prompt,
283
288
  stream: false
284
289
  };
290
+ if (images && images.length > 0) {
291
+ data.images = images;
292
+ }
285
293
  if (params.options) {
286
294
  data.options = params.options;
287
295
  }