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,850 +0,0 @@
1
- import {
2
- GTime,
3
- HashValidator
4
- } from "./chunk-7NKII2JA.js";
5
-
6
- // src/model/detectors/BinaryDetector.ts
7
- var BinarySignatureDetector = class _BinarySignatureDetector {
8
- contentTypeName = "binary";
9
- // Signatures map: [Signature Bytes, Mime Type]
10
- static SIGNATURES = [
11
- [new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), "image/png"],
12
- [new Uint8Array([255, 216, 255]), "image/jpeg"],
13
- [new Uint8Array([71, 73, 70, 56, 55, 97]), "image/gif"],
14
- // GIF87a
15
- [new Uint8Array([71, 73, 70, 56, 57, 97]), "image/gif"],
16
- // GIF89a
17
- [new Uint8Array([66, 77]), "image/bmp"],
18
- // BM
19
- [new Uint8Array([0, 0, 1, 0]), "image/x-icon"],
20
- [new Uint8Array([0, 0, 2, 0]), "image/x-icon"],
21
- [new Uint8Array([37, 80, 68, 70]), "application/pdf"],
22
- // %PDF
23
- [new Uint8Array([80, 75, 3, 4]), "application/zip"],
24
- // PK..
25
- [new Uint8Array([31, 139, 8]), "application/gzip"],
26
- [new Uint8Array([82, 97, 114, 33, 26, 7, 0]), "application/x-rar-compressed"],
27
- [new Uint8Array([55, 122, 188, 175, 39, 28]), "application/x-7z-compressed"],
28
- [new Uint8Array([83, 81, 76, 105, 116, 101, 32, 102, 111, 114, 109, 97, 116, 32, 51, 0]), "application/x-sqlite3"]
29
- ];
30
- detect(contentSample, lines, firstLine, fileExtension) {
31
- const mime = this.getMimeType(contentSample, lines, firstLine, fileExtension);
32
- return mime && mime !== "application/octet-stream" ? 0.95 : 0;
33
- }
34
- getMimeType(contentSample, lines, firstLine, fileExtension) {
35
- const bytes = this.toBytes(contentSample);
36
- const detected = this.detectFromBytes(bytes);
37
- if (detected === "application/octet-stream") {
38
- return "application/octet-stream";
39
- }
40
- return detected;
41
- }
42
- /**
43
- * Detect MIME type directly from bytes.
44
- */
45
- detectFromBytes(bytes) {
46
- if (this.startsWith(bytes, new Uint8Array([82, 73, 70, 70]))) {
47
- return this.detectRiffFormat(bytes);
48
- }
49
- for (const [sig, mime] of _BinarySignatureDetector.SIGNATURES) {
50
- if (this.startsWith(bytes, sig)) {
51
- if (mime === "application/zip") {
52
- return this.detectZipType(bytes);
53
- }
54
- return mime;
55
- }
56
- }
57
- return "application/octet-stream";
58
- }
59
- toBytes(content) {
60
- if (content instanceof Uint8Array) return content;
61
- return new TextEncoder().encode(content);
62
- }
63
- startsWith(data, prefix) {
64
- if (data.length < prefix.length) return false;
65
- for (let i = 0; i < prefix.length; i++) {
66
- if (data[i] !== prefix[i]) return false;
67
- }
68
- return true;
69
- }
70
- detectRiffFormat(bytes) {
71
- if (bytes.length < 12) return "application/octet-stream";
72
- const format = new TextDecoder().decode(bytes.slice(8, 12));
73
- if (format === "WAVE") return "audio/wav";
74
- if (format === "WEBP") return "image/webp";
75
- return "application/octet-stream";
76
- }
77
- detectZipType(bytes) {
78
- const header = new TextDecoder().decode(bytes.slice(0, 2048));
79
- if (header.includes("[Content_Types].xml") && header.includes("_rels/.rels")) {
80
- if (header.includes("word/")) return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
81
- if (header.includes("xl/")) return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
82
- if (header.includes("ppt/")) return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
83
- }
84
- return "application/zip";
85
- }
86
- };
87
-
88
- // src/model/detectors/LanguageDetector.ts
89
- var ProgrammingLanguageDetector = class {
90
- contentTypeName = "code";
91
- detect(contentSample, lines, firstLine, fileExtension) {
92
- const mime = this.getMimeType(contentSample, lines, firstLine, fileExtension);
93
- return mime && mime !== "text/plain" ? 0.95 : 0;
94
- }
95
- getMimeType(contentSample, lines, firstLine, fileExtension) {
96
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
97
- if (this.isPython(firstLine, text, lines)) {
98
- return "text/x-python";
99
- }
100
- const cType = this.detectCFamily(text);
101
- if (cType) return cType;
102
- const jsType = this.detectJsType(text);
103
- if (jsType) return jsType;
104
- if (this.isTypescript(text)) {
105
- return "text/typescript";
106
- }
107
- return "text/plain";
108
- }
109
- isPython(firstLine, text, lines) {
110
- if (/^\s*import\s+(\w+|\w+\.\w+)/m.test(text) || /^\s*from\s+(\w+|\w+\.\w+)\s+import\s+/m.test(text)) {
111
- const stdLibs = ["os", "sys", "re", "json", "math", "random", "datetime"];
112
- if (stdLibs.some((lib) => text.includes(`import ${lib}`) || text.includes(`from ${lib}`))) {
113
- return true;
114
- }
115
- }
116
- if (firstLine.startsWith("#!") && firstLine.toLowerCase().includes("python")) return true;
117
- if (text.includes("if __name__ ==") && text.includes("__main__")) return true;
118
- if (/^\s*def\s+\w+\s*\(/.test(text) && !text.includes("function")) return true;
119
- if (/^\s*class\s+\w+\s*[\(:]/m.test(text)) return true;
120
- if (/^\s*@\w+/m.test(text)) return true;
121
- let count = 0;
122
- const patterns = [
123
- /\bif\b.*?:/,
124
- /\belif\b.*?:/,
125
- /\belse\s*:/,
126
- /\bfor\b.*?\bin\b.*?:/,
127
- /\bwhile\b.*?:/,
128
- /\btry\s*:/,
129
- /\bexcept\b.*?:/,
130
- /\bfinally\s*:/,
131
- /\bNone\b/,
132
- /\bTrue\b/,
133
- /\bFalse\b/,
134
- /f["'].*?\{.*?\}["']/,
135
- // f-string
136
- /\bdef\b/,
137
- /\bclass\b/,
138
- /\bimport\b/,
139
- /\bfrom\b/,
140
- /\blambda\b.*?:/
141
- ];
142
- for (const p of patterns) {
143
- if (p.test(text)) count++;
144
- }
145
- const nonEmptyLines = lines.filter((l) => l.trim().length > 0).length;
146
- if (nonEmptyLines <= 5 && count >= 1) {
147
- return true;
148
- }
149
- return count >= 3;
150
- }
151
- detectCFamily(text) {
152
- const cPatterns = [
153
- /#include\s*<.*?>/,
154
- /#include\s*".*?"/,
155
- /\b(int|void|char|float|double)\s+main\s*\(.*\)\s*\{/,
156
- /\bstruct\s+\w+\s*\{/,
157
- /#define\s+\w+/,
158
- /printf\(.*?\);/,
159
- /scanf\(.*?\);/
160
- ];
161
- const cppPatterns = [
162
- /\bclass\s+\w+\s*\{/,
163
- /\bnamespace\s+\w+\s*\{/,
164
- /\btemplate\s*<.*?>/,
165
- /::/,
166
- /\bstd::/,
167
- /\bcout\s*<</,
168
- /\bcin\s*>>/,
169
- /\bnew\s+\w+/,
170
- /\bdelete\s+\w+/,
171
- /#include\s*<iostream>/
172
- ];
173
- let cCount = 0;
174
- let cppCount = 0;
175
- cPatterns.forEach((p) => {
176
- if (p.test(text)) cCount++;
177
- });
178
- cppPatterns.forEach((p) => {
179
- if (p.test(text)) cppCount++;
180
- });
181
- if (cppCount >= 2 || cppCount >= 1 && text.includes("std::")) return "text/x-c++";
182
- if (cCount >= 2) return "text/x-c";
183
- return null;
184
- }
185
- detectJsType(text) {
186
- const jsPatterns = [
187
- /function\s+\w+\s*\(/.test(text),
188
- // function foo(
189
- /\bconst\s+\w+\s*=/.test(text),
190
- /\blet\s+\w+\s*=/.test(text),
191
- /\bvar\s+\w+\s*=/.test(text),
192
- /\bimport\s+.*\s+from/.test(text),
193
- /\bexport\s+/.test(text),
194
- /\=\>\s*\{/.test(text),
195
- // Arrow func
196
- /console\.log\(/.test(text)
197
- ];
198
- const jsxPatterns = [
199
- /<\w+(>|\s+.*?>)[\s\S]*?<\/\w+>/m.test(text),
200
- /<\w+\s+\/>/m.test(text),
201
- /className=/.test(text),
202
- /React\.createElement/.test(text)
203
- ];
204
- const jsCount = jsPatterns.filter(Boolean).length;
205
- const jsxCount = jsxPatterns.filter(Boolean).length;
206
- if (jsxCount > 0 && (text.includes("import React") || text.includes('from "react"'))) return "text/jsx";
207
- if (jsxCount >= 2) return "text/jsx";
208
- if (jsCount >= 2) {
209
- const stripped = text.trim();
210
- if (stripped.startsWith("{") && stripped.endsWith("}") || stripped.startsWith("[") && stripped.endsWith("]")) {
211
- try {
212
- JSON.parse(text);
213
- if (jsCount < 2) return null;
214
- } catch {
215
- }
216
- }
217
- return "text/javascript";
218
- }
219
- return null;
220
- }
221
- isTypescript(text) {
222
- const tsPatterns = [
223
- /:\s*(string|number|boolean|any|void|null|undefined)\b/,
224
- /\binterface\s+\w+\s*\{/,
225
- /\bclass\s+\w+\s+implements\s+\w+/,
226
- /\btype\s+\w+\s*=/,
227
- /\b(public|private|protected)\s+/,
228
- /\bnamespace\s+\w+\s*\{/,
229
- /<\w+>/
230
- // Generics (simple check)
231
- ];
232
- let count = 0;
233
- tsPatterns.forEach((p) => {
234
- if (p.test(text)) count++;
235
- });
236
- return count >= 2;
237
- }
238
- };
239
-
240
- // src/model/detectors/MarkupDetectors.ts
241
- var XMLDetector = class _XMLDetector {
242
- contentTypeName = "xml";
243
- static XML_DECLARATION = /^\s*<\?xml/i;
244
- static BASIC_TAG_PAIR = /<(\w+)[^>]*>.*?<\/\1>/s;
245
- detect(contentSample, lines, firstLine, fileExtension) {
246
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
247
- let confidence = 0;
248
- if (fileExtension && fileExtension.toLowerCase() === ".xml") {
249
- confidence = Math.max(confidence, 0.95);
250
- }
251
- if (_XMLDetector.XML_DECLARATION.test(firstLine) || text.trim().startsWith("<?xml")) {
252
- confidence = Math.max(confidence, 0.95);
253
- }
254
- if (text.includes("<") && text.includes(">") && text.includes("</")) {
255
- confidence = Math.max(confidence, 0.5);
256
- if (_XMLDetector.BASIC_TAG_PAIR.test(text)) {
257
- confidence = Math.max(confidence, 0.7);
258
- }
259
- }
260
- if (text.toLowerCase().includes("<!doctype html")) {
261
- if (confidence > 0.3) confidence -= 0.4;
262
- }
263
- return Math.min(Math.max(confidence, 0), 1);
264
- }
265
- getMimeType(contentSample, lines, firstLine, fileExtension) {
266
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
267
- if (fileExtension === ".xml") return "application/xml";
268
- if (text.toLowerCase().includes("<svg")) return "image/svg+xml";
269
- if (text.toLowerCase().includes("<html") || text.toLowerCase().includes("<!doctype html")) return "text/html";
270
- if (this.detect(contentSample, lines, firstLine, fileExtension) > 0.5) return "application/xml";
271
- return "text/plain";
272
- }
273
- };
274
- var MarkdownDetector = class _MarkdownDetector {
275
- contentTypeName = "markdown";
276
- static MD_PATTERNS = [
277
- /^#{1,6}\s+\S+/,
278
- // ATX Headers
279
- /^\s*[\*\+\-]\s+\S+/,
280
- // List items
281
- /^\s*\d+\.\s+\S+/,
282
- // Ordered list items
283
- /`{1,3}[^`]+`{1,3}/,
284
- // Inline code
285
- /\[[^\]]+\]\([^\)]+\)/,
286
- // Links
287
- /!\[[^\]]+\]\([^\)]+\)/,
288
- // Images
289
- /^\s*>.*/
290
- // Blockquotes
291
- ];
292
- static SETEXT_HEADER = /^.*\n(?:={3,}|-{3,})\s*$/m;
293
- detect(contentSample, lines, firstLine, fileExtension) {
294
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
295
- let confidence = 0;
296
- if (fileExtension && [".md", ".markdown"].includes(fileExtension.toLowerCase())) {
297
- confidence = Math.max(confidence, 0.95);
298
- }
299
- let mdFeatures = 0;
300
- if (_MarkdownDetector.SETEXT_HEADER.test(text)) mdFeatures += 2;
301
- for (const line of lines.slice(0, 20)) {
302
- if (_MarkdownDetector.MD_PATTERNS.some((p) => p.test(line))) {
303
- mdFeatures++;
304
- }
305
- }
306
- const hasCodeFence = text.includes("```");
307
- if (hasCodeFence) mdFeatures++;
308
- if (mdFeatures > 1 && hasCodeFence) confidence = Math.max(confidence, 0.85);
309
- if (mdFeatures > 3 && hasCodeFence) confidence = Math.max(confidence, 0.95);
310
- else if (mdFeatures > 1) confidence = Math.max(confidence, 0.6);
311
- else if (mdFeatures > 3) confidence = Math.max(confidence, 0.8);
312
- else if (mdFeatures > 5) confidence = Math.max(confidence, 0.9);
313
- const stripped = text.trim();
314
- if (stripped.startsWith("{") && stripped.endsWith("}") || stripped.startsWith("[") && stripped.endsWith("]")) {
315
- try {
316
- JSON.parse(text);
317
- if (confidence > 0.3) confidence -= 0.4;
318
- } catch {
319
- }
320
- }
321
- if (stripped.startsWith("<") && text.includes("<?xml")) {
322
- if (confidence > 0.3) confidence -= 0.4;
323
- }
324
- return Math.min(Math.max(confidence, 0), 1);
325
- }
326
- getMimeType(contentSample, lines, firstLine, fileExtension) {
327
- return this.detect(contentSample, lines, firstLine, fileExtension) > 0.5 ? "text/markdown" : "text/plain";
328
- }
329
- };
330
- var PlainTextDetector = class _PlainTextDetector {
331
- contentTypeName = "text";
332
- static IMAGE_EXTS = [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"];
333
- detect(contentSample, lines, firstLine, fileExtension) {
334
- if (!contentSample && lines.length === 0) return 0.1;
335
- if (fileExtension) {
336
- const ext = fileExtension.toLowerCase();
337
- if (_PlainTextDetector.IMAGE_EXTS.includes(ext) || ext === ".pdf") return 0;
338
- }
339
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
340
- if (text.includes(",") && lines.length < 5) {
341
- const commaLines = lines.filter((l) => l.includes(",")).length;
342
- if (commaLines > 0 && commaLines === lines.length) {
343
- return 0.8;
344
- }
345
- }
346
- return 0.15;
347
- }
348
- getMimeType(contentSample, lines, firstLine, fileExtension) {
349
- return "text/plain";
350
- }
351
- };
352
-
353
- // src/model/detectors/DataFormatDetectors.ts
354
- var SQLDetector = class _SQLDetector {
355
- contentTypeName = "sql";
356
- // Keywords (case insensitive checking handled in method)
357
- static KEYWORDS = [
358
- "SELECT ",
359
- "INSERT ",
360
- "UPDATE ",
361
- "DELETE ",
362
- "CREATE ",
363
- "DROP ",
364
- "ALTER ",
365
- "FROM ",
366
- "WHERE ",
367
- "JOIN ",
368
- "TABLE ",
369
- "INTO ",
370
- "VALUES ",
371
- "SET ",
372
- "PRIMARY KEY"
373
- ];
374
- detect(contentSample, lines, firstLine, fileExtension) {
375
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
376
- let confidence = 0;
377
- if (fileExtension && fileExtension.toLowerCase() === ".sql") {
378
- confidence = Math.max(confidence, 0.95);
379
- }
380
- let hits = 0;
381
- const upperText = text.toUpperCase();
382
- for (const line of lines.slice(0, 10)) {
383
- const upperLine = line.toUpperCase();
384
- for (const kw of _SQLDetector.KEYWORDS) {
385
- if (upperLine.includes(kw)) {
386
- hits++;
387
- }
388
- }
389
- }
390
- if (hits >= 2) confidence = Math.max(confidence, 0.85);
391
- else if (hits === 1) confidence = Math.max(confidence, 0.6);
392
- return Math.min(confidence, 1);
393
- }
394
- getMimeType(contentSample, lines, firstLine, fileExtension) {
395
- return this.detect(contentSample, lines, firstLine, fileExtension) > 0.5 ? "text/x-sql" : "text/plain";
396
- }
397
- };
398
- var JSONDetector = class {
399
- contentTypeName = "json";
400
- detect(contentSample, lines, firstLine, fileExtension) {
401
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
402
- if (fileExtension && fileExtension.toLowerCase() === ".json") {
403
- return this.verifyJsonStructure(text) ? 0.95 : 0.6;
404
- }
405
- const stripped = text.trim();
406
- if (!(stripped.startsWith("{") && stripped.endsWith("}") || stripped.startsWith("[") && stripped.endsWith("]"))) {
407
- return 0;
408
- }
409
- for (const line of lines.slice(0, 5)) {
410
- const l = line.trim();
411
- if (l.startsWith("//") || l.startsWith("/*")) return 0;
412
- }
413
- try {
414
- JSON.parse(text);
415
- return 0.9;
416
- } catch (e) {
417
- return 0;
418
- }
419
- }
420
- getMimeType(contentSample, lines, firstLine, fileExtension) {
421
- return this.detect(contentSample, lines, firstLine, fileExtension) > 0.5 ? "application/json" : "text/plain";
422
- }
423
- verifyJsonStructure(text) {
424
- try {
425
- JSON.parse(text);
426
- return true;
427
- } catch {
428
- return false;
429
- }
430
- }
431
- };
432
- var YAMLDetector = class _YAMLDetector {
433
- contentTypeName = "yaml";
434
- static YAML_START_PATTERNS = [/^---\s*$/, /^%YAML/];
435
- static KEY_VALUE_PATTERN = /^\s*[\w.-]+:\s+(?![=\{\[])/;
436
- static LIST_ITEM_PATTERN = /^\s*-\s+[\w\'\"]/;
437
- detect(contentSample, lines, firstLine, fileExtension) {
438
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
439
- let confidence = 0;
440
- if (fileExtension && [".yaml", ".yml"].includes(fileExtension.toLowerCase())) {
441
- confidence = Math.max(confidence, 0.95);
442
- }
443
- if (_YAMLDetector.YAML_START_PATTERNS.some((p) => p.test(firstLine))) {
444
- confidence = Math.max(confidence, 0.9);
445
- }
446
- let yamlFeatures = 0;
447
- if (_YAMLDetector.YAML_START_PATTERNS.some((p) => new RegExp(p.source, "m").test(text))) {
448
- yamlFeatures += 2;
449
- }
450
- for (const line of lines.slice(0, 20)) {
451
- const stripped = line.trim();
452
- if (_YAMLDetector.KEY_VALUE_PATTERN.test(stripped)) yamlFeatures++;
453
- else if (_YAMLDetector.LIST_ITEM_PATTERN.test(stripped)) yamlFeatures++;
454
- }
455
- const firstNonEmpty = lines.find((l) => l.trim().length > 0) || "";
456
- if (firstNonEmpty.trim() === "---") {
457
- if (yamlFeatures > 1) confidence = Math.max(confidence, 0.5);
458
- if (yamlFeatures > 3) confidence = Math.max(confidence, 0.75);
459
- if (yamlFeatures > 5) confidence = Math.max(confidence, 0.9);
460
- } else {
461
- if (fileExtension && [".yaml", ".yml"].includes(fileExtension.toLowerCase())) {
462
- }
463
- }
464
- return Math.min(Math.max(confidence, 0), 1);
465
- }
466
- getMimeType(contentSample, lines, firstLine, fileExtension) {
467
- const conf = this.detect(contentSample, lines, firstLine, fileExtension);
468
- return conf > 0.5 ? "application/x-yaml" : "text/plain";
469
- }
470
- };
471
- var CSVDetector = class {
472
- contentTypeName = "csv";
473
- detect(contentSample, lines, firstLine, fileExtension) {
474
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
475
- if (fileExtension && fileExtension.toLowerCase() === ".csv") {
476
- return this.verifyCsvStructure(lines) ? 0.95 : 0.6;
477
- }
478
- return this.analyzeCsvContent(lines);
479
- }
480
- getMimeType(contentSample, lines, firstLine, fileExtension) {
481
- return this.detect(contentSample, lines, firstLine, fileExtension) > 0.5 ? "text/csv" : "text/plain";
482
- }
483
- verifyCsvStructure(lines) {
484
- const sampleLines = lines.slice(0, 10).filter((l) => l.trim().length > 0);
485
- if (sampleLines.length === 0) return false;
486
- if (!sampleLines.every((l) => l.includes(","))) return false;
487
- const counts = sampleLines.map((l) => (l.match(/,/g) || []).length);
488
- const uniqueCounts = [...new Set(counts)];
489
- if (uniqueCounts.length === 1 && uniqueCounts[0] > 0) return true;
490
- if (sampleLines.length > 1) {
491
- const dataCounts = counts.slice(1);
492
- const uniqueData = [...new Set(dataCounts)];
493
- if (uniqueData.length === 1 && uniqueData[0] > 0) return true;
494
- }
495
- return false;
496
- }
497
- analyzeCsvContent(lines) {
498
- if (!lines || lines.length === 0) return 0;
499
- const sampleLines = lines.slice(0, 10).filter((l) => l.trim().length > 0);
500
- if (sampleLines.length === 0 || !sampleLines.every((l) => l.includes(","))) return 0;
501
- const counts = sampleLines.map((l) => (l.match(/,/g) || []).length);
502
- const uniqueCounts = [...new Set(counts)];
503
- if (uniqueCounts.length === 1 && uniqueCounts[0] > 0) return 0.9;
504
- if (sampleLines.length > 1) {
505
- const dataCounts = counts.slice(1);
506
- const uniqueData = [...new Set(dataCounts)];
507
- if (uniqueData.length === 1 && uniqueData[0] > 0) return 0.8;
508
- }
509
- if (counts.every((c) => c > 0)) return 0.5;
510
- return 0;
511
- }
512
- };
513
-
514
- // src/model/detectors/OBJDetector.ts
515
- var OBJDetector = class _OBJDetector {
516
- contentTypeName = "obj";
517
- // Check for 'v ' (vertex), 'f ' (face), 'vn ', 'vt '
518
- static COMMANDS = ["v ", "vt ", "vn ", "f ", "g ", "o ", "s ", "mtllib ", "usemtl "];
519
- detect(contentSample, lines, firstLine, fileExtension) {
520
- const text = typeof contentSample === "string" ? contentSample : new TextDecoder().decode(contentSample);
521
- let confidence = 0;
522
- if (fileExtension && fileExtension.toLowerCase() === ".obj") {
523
- confidence = Math.max(confidence, 0.95);
524
- }
525
- const validLines = lines.filter((l) => l.trim().length > 0 && !l.trim().startsWith("#"));
526
- let commandCount = 0;
527
- for (const line of validLines.slice(0, 20)) {
528
- const trimmed = line.trim();
529
- for (const cmd of _OBJDetector.COMMANDS) {
530
- if (trimmed.startsWith(cmd)) {
531
- commandCount++;
532
- break;
533
- }
534
- }
535
- }
536
- if (commandCount >= 2) {
537
- if (commandCount > 10) confidence = Math.max(confidence, 0.9);
538
- else if (commandCount > 5) confidence = Math.max(confidence, 0.8);
539
- else confidence = Math.max(confidence, 0.7);
540
- }
541
- const codeKeywords = ["def ", "class ", "import ", "function ", "var ", "let ", "const "];
542
- if (codeKeywords.some((k) => text.includes(k))) {
543
- return 0;
544
- }
545
- return Math.min(confidence, 1);
546
- }
547
- getMimeType(contentSample, lines, firstLine, fileExtension) {
548
- return this.detect(contentSample, lines, firstLine, fileExtension) > 0.5 ? "application/3d-obj" : "text/plain";
549
- }
550
- };
551
-
552
- // src/model/detectors/registry.ts
553
- var DetectorRegistry = class {
554
- detectors;
555
- constructor() {
556
- this.detectors = [
557
- new BinarySignatureDetector(),
558
- // Programming languages
559
- new ProgrammingLanguageDetector(),
560
- // Structured data
561
- new XMLDetector(),
562
- new JSONDetector(),
563
- new OBJDetector(),
564
- // Markup
565
- new MarkdownDetector(),
566
- // Data formats (lower priority)
567
- new SQLDetector(),
568
- new CSVDetector(),
569
- new YAMLDetector(),
570
- // Fallback
571
- new PlainTextDetector()
572
- ];
573
- }
574
- /**
575
- * Detect content type and return the most likely MIME type.
576
- */
577
- detect(contentSample, lines, firstLine, fileExtension) {
578
- const hasComma = lines.some((l) => l.includes(","));
579
- if (hasComma) {
580
- if (lines.length < 3) {
581
- const commaLines = lines.filter((l) => l.includes(",")).length;
582
- if (commaLines > 0 && commaLines === lines.length) {
583
- const delimCounts = lines.filter((l) => l.trim()).map((l) => (l.match(/,/g) || []).length);
584
- if (delimCounts.length > 0 && delimCounts.every((c) => c <= 2)) {
585
- return "text/plain";
586
- }
587
- }
588
- }
589
- }
590
- let bestConfidence = 0;
591
- let bestMime = "text/plain";
592
- for (const detector of this.detectors) {
593
- const confidence = detector.detect(contentSample, lines, firstLine, fileExtension);
594
- if (confidence > bestConfidence) {
595
- const mime = detector.getMimeType(contentSample, lines, firstLine, fileExtension);
596
- if (mime) {
597
- bestConfidence = confidence;
598
- bestMime = mime;
599
- if (confidence >= 0.99) break;
600
- }
601
- }
602
- }
603
- return bestMime;
604
- }
605
- };
606
- var registry = new DetectorRegistry();
607
-
608
- // src/model/ContentTypeInterpreter.ts
609
- var ContentTypeInterpreter = class {
610
- static MIME_TO_EXT = {
611
- "text/plain": ".txt",
612
- "application/json": ".json",
613
- "text/csv": ".csv",
614
- "text/x-python": ".py",
615
- "text/javascript": ".js",
616
- "text/jsx": ".jsx",
617
- "text/typescript": ".ts",
618
- "text/x-c": ".c",
619
- "text/x-c++": ".cpp",
620
- "application/xml": ".xml",
621
- "text/html": ".html",
622
- "application/x-yaml": ".yaml",
623
- "text/markdown": ".md",
624
- "text/x-sql": ".sql",
625
- "image/png": ".png",
626
- "image/jpeg": ".jpg",
627
- "image/gif": ".gif",
628
- "image/bmp": ".bmp",
629
- "image/x-icon": ".ico",
630
- "image/webp": ".webp",
631
- "image/svg+xml": ".svg",
632
- "application/pdf": ".pdf",
633
- "application/zip": ".zip",
634
- "application/gzip": ".gz",
635
- "application/x-rar-compressed": ".rar",
636
- "application/x-7z-compressed": ".7z",
637
- "application/x-sqlite3": ".db",
638
- "audio/wav": ".wav"
639
- // Add more as needed
640
- };
641
- /**
642
- * Convenience method to detect MIME type only.
643
- * Matches the API expected by MCard/PCard/VCard.
644
- */
645
- static detect(content) {
646
- return this.detectContentType(content).mimeType;
647
- }
648
- /**
649
- * Detect content type and suggest extension.
650
- *
651
- * @param content Content string or binary buffer
652
- * @param fileExtension Optional file extension hint
653
- * @returns Object containing detected mimeType and suggested extension
654
- */
655
- static detectContentType(content, fileExtension) {
656
- let lines = [];
657
- let firstLine = "";
658
- let textSample = "";
659
- if (typeof content === "string") {
660
- textSample = content.slice(0, 8192);
661
- } else {
662
- textSample = new TextDecoder("utf-8", { fatal: false }).decode(content.slice(0, 8192));
663
- }
664
- lines = textSample.split("\n").slice(0, 20);
665
- firstLine = lines[0] || "";
666
- const mimeType = registry.detect(content, lines, firstLine, fileExtension);
667
- let extension = this.getExtension(mimeType);
668
- if (fileExtension && extension) {
669
- if (fileExtension.toLowerCase() === extension || fileExtension.toLowerCase() === `.${extension}`) {
670
- extension = fileExtension;
671
- }
672
- }
673
- if (!extension && fileExtension) {
674
- extension = fileExtension;
675
- }
676
- if (!extension) {
677
- extension = ".txt";
678
- }
679
- return { mimeType, extension };
680
- }
681
- static getExtension(mimeType) {
682
- return this.MIME_TO_EXT[mimeType] || "";
683
- }
684
- /**
685
- * Check if content should be treated as binary.
686
- */
687
- static isBinaryContent(content, mimeType) {
688
- if (mimeType) {
689
- if (mimeType.startsWith("text/") || mimeType.includes("json") || mimeType.includes("xml") || mimeType.includes("javascript") || mimeType.includes("ecmascript")) {
690
- return false;
691
- }
692
- return true;
693
- }
694
- if (typeof content === "string") return false;
695
- const detection = this.detectContentType(content);
696
- return !detection.mimeType.startsWith("text/") && !detection.mimeType.includes("json") && !detection.mimeType.includes("xml");
697
- }
698
- static isKnownLongLineExtension(extension) {
699
- if (!extension) return false;
700
- const ext = extension.toLowerCase();
701
- return [".min.js", ".min.css", ".map", ".svg", ".json", ".geojson"].some((e) => ext.endsWith(e));
702
- }
703
- static isUnstructuredBinary(sample) {
704
- if (sample.length < 512) return false;
705
- let nullCount = 0;
706
- let controlCount = 0;
707
- const len = Math.min(sample.length, 32 * 1024);
708
- for (let i = 0; i < len; i++) {
709
- const byte = sample[i];
710
- if (byte === 0) {
711
- nullCount++;
712
- }
713
- if (byte < 32 && byte !== 9 && byte !== 10 && byte !== 13) {
714
- controlCount++;
715
- }
716
- }
717
- const nullRatio = nullCount / len;
718
- const controlRatio = controlCount / len;
719
- return nullRatio > 0.1 || controlRatio > 0.2;
720
- }
721
- static hasPathologicalLines(sample, isKnownType) {
722
- if (isKnownType || sample.length < 32768) return false;
723
- for (let i = 0; i < sample.length; i++) {
724
- if (sample[i] === 10 || sample[i] === 13) return false;
725
- }
726
- return true;
727
- }
728
- };
729
-
730
- // src/types/dots.ts
731
- function createMCardDOTSMetadata(tightRefs = [], looseRefs = []) {
732
- return {
733
- role: "Carrier" /* CARRIER */,
734
- eosRole: "InvariantContent" /* INVARIANT_CONTENT */,
735
- plane: "Data" /* DATA */,
736
- tightRefs,
737
- looseRefs
738
- };
739
- }
740
- function createPCardDOTSMetadata(isLens, tightRefs = [], looseRefs = []) {
741
- return {
742
- role: isLens ? "Lens" /* LENS */ : "Chart" /* CHART */,
743
- eosRole: "GenerativeLens" /* GENERATIVE_LENS */,
744
- plane: "Control" /* CONTROL */,
745
- tightRefs,
746
- looseRefs
747
- };
748
- }
749
- function createVCardDOTSMetadata() {
750
- return {
751
- role: "Arena" /* ARENA */,
752
- eosRole: "SovereignDecision" /* SOVEREIGN_DECISION */,
753
- plane: "Application" /* APPLICATION */
754
- };
755
- }
756
-
757
- // src/model/MCard.ts
758
- var MCard = class _MCard {
759
- content;
760
- hash;
761
- g_time;
762
- contentType;
763
- // Defaulting to specific string or null
764
- hashFunction;
765
- constructor(content, hash, g_time, contentType, hashFunction) {
766
- this.content = content;
767
- this.hash = hash;
768
- this.g_time = g_time;
769
- this.contentType = contentType;
770
- this.hashFunction = hashFunction;
771
- }
772
- /**
773
- * Create a new MCard from content
774
- */
775
- static async create(content, hashAlgorithm = "sha256") {
776
- if (content === null || content === void 0) {
777
- throw new Error("Content cannot be null or undefined");
778
- }
779
- const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
780
- if (bytes.length === 0) {
781
- throw new Error("Content cannot be empty");
782
- }
783
- const hash = await HashValidator.computeHash(bytes, hashAlgorithm);
784
- const g_time = GTime.stampNow(hashAlgorithm);
785
- const contentType = ContentTypeInterpreter.detect(bytes);
786
- return new _MCard(bytes, hash, g_time, contentType, hashAlgorithm);
787
- }
788
- /**
789
- * Create an MCard from existing data (e.g., from database)
790
- */
791
- static fromData(content, hash, g_time) {
792
- const alg = GTime.getHashAlgorithm(g_time);
793
- const contentType = ContentTypeInterpreter.detect(content);
794
- return new _MCard(content, hash, g_time, contentType, alg);
795
- }
796
- /**
797
- * Get content as text (UTF-8 decoded)
798
- */
799
- getContentAsText() {
800
- return new TextDecoder().decode(this.content);
801
- }
802
- /**
803
- * Get content as raw bytes
804
- */
805
- getContent() {
806
- return this.content;
807
- }
808
- /**
809
- * Convert to plain object
810
- */
811
- toObject() {
812
- return {
813
- hash: this.hash,
814
- content: this.getContentAsText(),
815
- g_time: this.g_time,
816
- contentType: this.contentType,
817
- hashFunction: this.hashFunction
818
- };
819
- }
820
- /**
821
- * Get DOTS vocabulary metadata for this MCard
822
- *
823
- * Returns the DOTS role information that positions this MCard
824
- * in the Double Operadic Theory of Systems framework.
825
- *
826
- * MCard is always a CARRIER object in the Data Plane.
827
- *
828
- * @param tightRefs - Optional array of prerequisite MCard hashes (vertical composition)
829
- * @param looseRefs - Optional array of alternative MCard hashes (horizontal composition)
830
- * @returns DOTSMetadata describing this card's role in the compositional system
831
- *
832
- * @example
833
- * ```typescript
834
- * const card = await MCard.create('Hello World');
835
- * const meta = card.getDOTSMetadata();
836
- * console.log(meta.role); // 'Carrier'
837
- * console.log(meta.plane); // 'Data'
838
- * ```
839
- */
840
- getDOTSMetadata(tightRefs = [], looseRefs = []) {
841
- return createMCardDOTSMetadata(tightRefs, looseRefs);
842
- }
843
- };
844
-
845
- export {
846
- ContentTypeInterpreter,
847
- createPCardDOTSMetadata,
848
- createVCardDOTSMetadata,
849
- MCard
850
- };