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.
- package/dist/{CardCollection-MXTUJV4J.js → CardCollection-7DKJWKAG.js} +3 -2
- package/dist/CardCollection-S4RE3RXP.js +10 -0
- package/dist/CardCollection-VPN7AAAX.js +10 -0
- package/dist/{IndexedDBEngine-2G5KCISA.js → IndexedDBEngine-7JOGM2MM.js} +3 -2
- package/dist/IndexedDBEngine-BGZHJK5L.js +12 -0
- package/dist/IndexedDBEngine-ZJ442GI7.js +12 -0
- package/dist/{LLMRuntime-GIGDMDEZ.js → LLMRuntime-OZNVAPXJ.js} +4 -3
- package/dist/{LLMRuntime-LBWUJ7ON.js → LLMRuntime-UPSEDSIK.js} +2 -2
- package/dist/{LambdaRuntime-B6D6IQKZ.js → LambdaRuntime-JZ4Q56TI.js} +6 -5
- package/dist/LambdaRuntime-PM3OUFHU.js +19 -0
- package/dist/LambdaRuntime-WBEK37AF.js +19 -0
- package/dist/LambdaRuntime-YKSBAT65.js +19 -0
- package/dist/{Loader-3LSJXJQG.js → Loader-7HQVYDPA.js} +2 -2
- package/dist/{Loader-BM56B2TX.js → Loader-NYWTV7CQ.js} +4 -3
- package/dist/{Loader-CYLAA4XU.js → Loader-OLKPY6HT.js} +3 -3
- package/dist/{MCard-H56VOJLR.js → MCard-OYI73CUI.js} +1 -1
- package/dist/{MCard-5LIREV2B.js → MCard-XHG3BZC7.js} +2 -2
- package/dist/{NetworkRuntime-IAFHPQSX.js → NetworkRuntime-VYCC5HSY.js} +16 -11
- package/dist/{NetworkRuntime-JNGKW3DY.js → NetworkRuntime-XQX3LDDI.js} +61 -33
- package/dist/{NetworkRuntime-CXPKIAOQ.js → NetworkRuntime-XZR733M5.js} +17 -12
- package/dist/{OllamaProvider-QPX2JXL2.js → OllamaProvider-FBZ5WW72.js} +1 -1
- package/dist/OllamaProvider-W6TPZNHD.js +9 -0
- package/dist/chunk-2NFGZ6PA.js +170 -0
- package/dist/{chunk-VXV35I5J.js → chunk-4TYRTQ4V.js} +48 -17
- package/dist/chunk-4VWWTGRW.js +497 -0
- package/dist/{chunk-4PDYHPR6.js → chunk-5GHZP7E5.js} +4 -2
- package/dist/{chunk-42VF42KH.js → chunk-5HZNWJFT.js} +4 -2
- package/dist/{chunk-DEYMHG5A.js → chunk-6MG5ZHAP.js} +58 -22
- package/dist/{chunk-7V37AAPK.js → chunk-7B4PABOL.js} +16 -7
- package/dist/chunk-A5S2PI37.js +47 -0
- package/dist/chunk-BFD4WSWU.js +497 -0
- package/dist/chunk-BSEFN25Q.js +32 -0
- package/dist/{chunk-3LPY36OG.js → chunk-CBEVE7RG.js} +20 -15
- package/dist/{chunk-A5AB4WQN.js → chunk-DPA3ZK4Q.js} +30 -21
- package/dist/{chunk-5FA54AMM.js → chunk-EJHX3VZL.js} +54 -21
- package/dist/{chunk-QXPHMSPA.js → chunk-GNF4WAPV.js} +22 -9
- package/dist/{chunk-XPG6B5IW.js → chunk-JHIA2BQK.js} +26 -13
- package/dist/{chunk-4I5IZILN.js → chunk-KGPICAQW.js} +10 -7
- package/dist/{chunk-4WBJPHZP.js → chunk-MST5AZXJ.js} +17 -8
- package/dist/{chunk-K35KFTEA.js → chunk-N6KDHCBC.js} +58 -33
- package/dist/{chunk-2R4ESMZB.js → chunk-NFO5NU6B.js} +5 -3
- package/dist/chunk-OKWBHCKC.js +170 -0
- package/dist/{chunk-FIE4LAJG.js → chunk-OX3K6UZJ.js} +5 -3
- package/dist/{chunk-6SEX42H2.js → chunk-R3K7DG7O.js} +21 -16
- package/dist/chunk-RB35Z35T.js +44 -0
- package/dist/{chunk-AWGFLRLI.js → chunk-SP4YPKPR.js} +51 -318
- package/dist/chunk-U7TSFDKX.js +217 -0
- package/dist/chunk-UP3SQX56.js +112 -0
- package/dist/{chunk-4EUEU4SM.js → chunk-VGIRC3HX.js} +13 -110
- package/dist/chunk-WGG7526Z.js +112 -0
- package/dist/{chunk-3JBSRALP.js → chunk-WNKP66IR.js} +10 -7
- package/dist/{chunk-DOC55MPG.js → chunk-WR6ISHCS.js} +11 -3
- package/dist/{chunk-52UNWVOD.js → chunk-ZVOPQ5BM.js} +54 -21
- package/dist/chunk-ZZMOPQER.js +217 -0
- package/dist/index.browser.cjs +79 -1454
- package/dist/index.browser.d.cts +2 -17
- package/dist/index.browser.d.ts +2 -17
- package/dist/index.browser.js +7 -6
- package/dist/index.cjs +306 -1631
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +49 -35
- package/dist/storage/SqliteNodeEngine.cjs +59 -1335
- package/dist/storage/SqliteNodeEngine.js +4 -3
- package/dist/storage/SqliteWasmEngine.cjs +57 -1335
- package/dist/storage/SqliteWasmEngine.js +4 -3
- package/package.json +12 -8
- package/dist/CardCollection-4OFJ6XQJ.js +0 -9
- package/dist/CardCollection-7PDWM24F.js +0 -9
- package/dist/CardCollection-CEFQ5PA6.js +0 -9
- package/dist/CardCollection-GUEYGN2Y.js +0 -9
- package/dist/CardCollection-KDO4CQ4B.js +0 -9
- package/dist/CardCollection-PB7ZY73E.js +0 -9
- package/dist/CardCollection-RK4DVH63.js +0 -9
- package/dist/CardCollection-T376E3TS.js +0 -9
- package/dist/CardCollection-WGCKKUOD.js +0 -9
- package/dist/CardCollection-XON2IWDU.js +0 -9
- package/dist/CardCollection-ZEI6FMP3.js +0 -9
- package/dist/EventProducer-MW6QF4IO.js +0 -47
- package/dist/EventProducer-V7RY2KKR.js +0 -47
- package/dist/FileIO.d.ts +0 -44
- package/dist/FileIO.d.ts.map +0 -1
- package/dist/FileIO.js +0 -203
- package/dist/FileIO.js.map +0 -1
- package/dist/IndexedDBEngine-7JI2CL32.js +0 -10
- package/dist/IndexedDBEngine-7OHQIRTI.js +0 -10
- package/dist/IndexedDBEngine-E5YJQG4U.js +0 -10
- package/dist/IndexedDBEngine-NV625E7L.js +0 -10
- package/dist/IndexedDBEngine-RPQS7ILF.js +0 -10
- package/dist/IndexedDBEngine-S3ZWCSI7.js +0 -10
- package/dist/IndexedDBEngine-T7OC5GRR.js +0 -10
- package/dist/LLMRuntime-BKB3CLXM.js +0 -16
- package/dist/LLMRuntime-BQUUFLAB.js +0 -16
- package/dist/LLMRuntime-TNBC4JCB.js +0 -16
- package/dist/LambdaRuntime-4YILF3G7.js +0 -15
- package/dist/LambdaRuntime-53TPVENI.js +0 -16
- package/dist/LambdaRuntime-73BSWP2G.js +0 -16
- package/dist/LambdaRuntime-AL5SBDCA.js +0 -17
- package/dist/LambdaRuntime-BYBUI7H5.js +0 -17
- package/dist/LambdaRuntime-JDZP3HIQ.js +0 -17
- package/dist/LambdaRuntime-JEI7RVWG.js +0 -16
- package/dist/LambdaRuntime-LCTHBYMV.js +0 -17
- package/dist/LambdaRuntime-LDA3G7IR.js +0 -16
- package/dist/LambdaRuntime-LF4FR6YA.js +0 -16
- package/dist/LambdaRuntime-O7JBVHO2.js +0 -16
- package/dist/LambdaRuntime-OFOTT464.js +0 -17
- package/dist/LambdaRuntime-Q6ISCHAD.js +0 -16
- package/dist/LambdaRuntime-TCZ42XCB.js +0 -16
- package/dist/LambdaRuntime-UKUOKJIW.js +0 -17
- package/dist/LambdaRuntime-VKLON4IB.js +0 -17
- package/dist/LambdaRuntime-WNYDBTS6.js +0 -16
- package/dist/LambdaRuntime-WPTX76CX.js +0 -17
- package/dist/Loader-4P7PEBCL.js +0 -11
- package/dist/Loader-HQ3QKMYM.js +0 -11
- package/dist/Loader-NCATGB67.js +0 -11
- package/dist/Loader-NRHGDQBD.js +0 -11
- package/dist/Loader-RT4NI6AT.js +0 -11
- package/dist/Loader-SSRY57SS.js +0 -11
- package/dist/Loader-W72QZ3T7.js +0 -11
- package/dist/Loader-WECRIXQW.js +0 -11
- package/dist/Loader-XFBIHCQF.js +0 -11
- package/dist/Loader.d.ts +0 -34
- package/dist/Loader.d.ts.map +0 -1
- package/dist/Loader.js +0 -190
- package/dist/Loader.js.map +0 -1
- package/dist/MCard-4J6WSBRF.js +0 -8
- package/dist/MCard-E3MRPTJF.js +0 -8
- package/dist/MCard-FCOIB6BP.js +0 -8
- package/dist/MCard-G4HUWHY5.js +0 -8
- package/dist/MCard-HFL7AFIH.js +0 -8
- package/dist/MCard-JOW6RBSO.js +0 -8
- package/dist/MCard-M4LKN4U2.js +0 -8
- package/dist/MCard-VB7UDUTN.js +0 -8
- package/dist/MCard-WOHE6SX6.js +0 -8
- package/dist/NetworkRuntime-2H7AQITA.js +0 -1571
- package/dist/NetworkRuntime-3MIUBNOF.js +0 -1571
- package/dist/NetworkRuntime-AOE2EJIM.js +0 -1571
- package/dist/NetworkRuntime-BQMDBUDO.js +0 -1570
- package/dist/NetworkRuntime-GMANLCAB.js +0 -1542
- package/dist/NetworkRuntime-L7P4VCGK.js +0 -1542
- package/dist/NetworkRuntime-LC7SUAOF.js +0 -1542
- package/dist/NetworkRuntime-OJWCWPBI.js +0 -1570
- package/dist/NetworkRuntime-ZJ3B4T3A.js +0 -1542
- package/dist/OllamaProvider-32RC36HD.js +0 -8
- package/dist/OllamaProvider-MQXSXLCA.js +0 -8
- package/dist/OllamaProvider-Q45BMOVN.js +0 -8
- package/dist/SqliteNodeEngine-WKVFWBNH.js +0 -9
- package/dist/StorageAdapter-DdDUiIvH.d.cts +0 -391
- package/dist/StorageAdapter-DdDUiIvH.d.ts +0 -391
- package/dist/StorageAdapter-Dw1BeOam.d.cts +0 -380
- package/dist/StorageAdapter-Dw1BeOam.d.ts +0 -380
- package/dist/chunk-23GCCCXB.js +0 -402
- package/dist/chunk-2ECISK2I.js +0 -354
- package/dist/chunk-2MRBTM72.js +0 -354
- package/dist/chunk-2THXO6FH.js +0 -2313
- package/dist/chunk-2VNRWIBZ.js +0 -389
- package/dist/chunk-2VOQRXWH.js +0 -296
- package/dist/chunk-34AYBZRO.js +0 -920
- package/dist/chunk-37EEYISR.js +0 -372
- package/dist/chunk-3E2TKOCZ.js +0 -354
- package/dist/chunk-3MMMJ7NH.js +0 -1068
- package/dist/chunk-437JTYVP.js +0 -292
- package/dist/chunk-4MQINOOG.js +0 -1218
- package/dist/chunk-4UIWXZHY.js +0 -1049
- package/dist/chunk-53S2EZCY.js +0 -290
- package/dist/chunk-5BIDGXA6.js +0 -987
- package/dist/chunk-5HXLTWYN.js +0 -296
- package/dist/chunk-5W2FDGUF.js +0 -371
- package/dist/chunk-6R4ERZMG.js +0 -1136
- package/dist/chunk-74YSNHEM.js +0 -2309
- package/dist/chunk-7H2BQZDK.js +0 -270
- package/dist/chunk-7KEWCCES.js +0 -1136
- package/dist/chunk-7PN2BUYF.js +0 -371
- package/dist/chunk-A2ZJA2EV.js +0 -389
- package/dist/chunk-ARPIBGRP.js +0 -1236
- package/dist/chunk-ATHNEEAG.js +0 -2309
- package/dist/chunk-AVXJOPUE.js +0 -354
- package/dist/chunk-B7VEU4S2.js +0 -204
- package/dist/chunk-C2TKISBR.js +0 -1213
- package/dist/chunk-CBH4YKB4.js +0 -2309
- package/dist/chunk-DP7HBRDL.js +0 -2309
- package/dist/chunk-DV7ZSH4W.js +0 -2309
- package/dist/chunk-DWXNZ5AJ.js +0 -642
- package/dist/chunk-EFKMZTT2.js +0 -270
- package/dist/chunk-FXJYXHG6.js +0 -266
- package/dist/chunk-G466I6RT.js +0 -229
- package/dist/chunk-GATPBTHL.js +0 -1142
- package/dist/chunk-GMQAHPBC.js +0 -292
- package/dist/chunk-GMWA2IJJ.js +0 -1105
- package/dist/chunk-GVX5LDLH.js +0 -371
- package/dist/chunk-HGENNKOJ.js +0 -355
- package/dist/chunk-HM2NBYHU.js +0 -292
- package/dist/chunk-IZWB5GCG.js +0 -389
- package/dist/chunk-J4HOFUKM.js +0 -2309
- package/dist/chunk-JIK2G3EH.js +0 -2313
- package/dist/chunk-JRXNWGSW.js +0 -1136
- package/dist/chunk-KRKK3KP6.js +0 -1081
- package/dist/chunk-KYXZHRUG.js +0 -389
- package/dist/chunk-L36L2VDL.js +0 -371
- package/dist/chunk-L5PZCES6.js +0 -204
- package/dist/chunk-L5U77ZEM.js +0 -1142
- package/dist/chunk-LQEKGX2T.js +0 -204
- package/dist/chunk-LWMUDMMQ.js +0 -1144
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-NZ6OQ7UT.js +0 -92
- package/dist/chunk-O2UMNZGF.js +0 -903
- package/dist/chunk-OFHDMLNM.js +0 -355
- package/dist/chunk-PDBMNUMB.js +0 -316
- package/dist/chunk-PW4XS7M3.js +0 -850
- package/dist/chunk-QA2XQMMJ.js +0 -2313
- package/dist/chunk-QL2JFNA7.js +0 -389
- package/dist/chunk-QPZ2HNSU.js +0 -912
- package/dist/chunk-QVGVU6OS.js +0 -296
- package/dist/chunk-RCEU7PFH.js +0 -270
- package/dist/chunk-RSTKX7WM.js +0 -907
- package/dist/chunk-RXL2CW64.js +0 -266
- package/dist/chunk-RXUF6Y43.js +0 -2309
- package/dist/chunk-SIAA4J6H.js +0 -21
- package/dist/chunk-SOJ2UMO2.js +0 -986
- package/dist/chunk-T3AG6DXY.js +0 -296
- package/dist/chunk-TPCNKMGZ.js +0 -355
- package/dist/chunk-TPT3S5AX.js +0 -204
- package/dist/chunk-TXWGIEVH.js +0 -2313
- package/dist/chunk-TZFI54AU.js +0 -2313
- package/dist/chunk-U3FWUPD3.js +0 -717
- package/dist/chunk-UFW2VW2D.js +0 -266
- package/dist/chunk-UTAOS5Y7.js +0 -2313
- package/dist/chunk-V7VX5OJ6.js +0 -389
- package/dist/chunk-W2XGNMYB.js +0 -355
- package/dist/chunk-W3M4HJ4U.js +0 -2309
- package/dist/chunk-WMJGGREP.js +0 -296
- package/dist/chunk-WTNVQ5WS.js +0 -732
- package/dist/chunk-WVFWNVT2.js +0 -1050
- package/dist/chunk-WY7EYSYC.js +0 -1236
- package/dist/chunk-X42F7DE3.js +0 -373
- package/dist/chunk-XC7Y4I7L.js +0 -290
- package/dist/chunk-YFULZTKP.js +0 -270
- package/dist/chunk-YSVHXKSZ.js +0 -373
- package/dist/chunk-YWGVK5OS.js +0 -292
- package/dist/chunk-Z4BRNTO5.js +0 -2313
- package/dist/chunk-ZDUXDKPD.js +0 -292
- package/dist/chunk-ZXQ2W7LO.js +0 -355
- package/dist/chunk-ZXQELXXO.js +0 -378
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib-4XS34IPZ.js +0 -778
- package/dist/model/CardCollection.d.ts +0 -147
- package/dist/model/CardCollection.d.ts.map +0 -1
- package/dist/model/CardCollection.js +0 -272
- package/dist/model/CardCollection.js.map +0 -1
- package/dist/model/ContentTypeInterpreter.d.ts +0 -28
- package/dist/model/ContentTypeInterpreter.d.ts.map +0 -1
- package/dist/model/ContentTypeInterpreter.js +0 -147
- package/dist/model/ContentTypeInterpreter.js.map +0 -1
- package/dist/model/EventProducer.d.ts +0 -10
- package/dist/model/EventProducer.d.ts.map +0 -1
- package/dist/model/EventProducer.js +0 -46
- package/dist/model/EventProducer.js.map +0 -1
- package/dist/model/GTime.d.ts +0 -44
- package/dist/model/GTime.d.ts.map +0 -1
- package/dist/model/GTime.js +0 -91
- package/dist/model/GTime.js.map +0 -1
- package/dist/model/Handle.d.ts +0 -37
- package/dist/model/Handle.d.ts.map +0 -1
- package/dist/model/Handle.js +0 -90
- package/dist/model/Handle.js.map +0 -1
- package/dist/model/MCard.d.ts +0 -145
- package/dist/model/MCard.d.ts.map +0 -1
- package/dist/model/MCard.js +0 -180
- package/dist/model/MCard.js.map +0 -1
- package/dist/model/PCard.d.ts +0 -271
- package/dist/model/PCard.d.ts.map +0 -1
- package/dist/model/PCard.js +0 -558
- package/dist/model/PCard.js.map +0 -1
- package/dist/model/VCard.d.ts +0 -277
- package/dist/model/VCard.d.ts.map +0 -1
- package/dist/model/VCard.js +0 -573
- package/dist/model/VCard.js.map +0 -1
- package/dist/model/constants.d.ts +0 -45
- package/dist/model/constants.d.ts.map +0 -1
- package/dist/model/constants.js +0 -27
- package/dist/model/constants.js.map +0 -1
- package/dist/model/vcard_vocabulary.d.ts +0 -174
- package/dist/model/vcard_vocabulary.d.ts.map +0 -1
- package/dist/model/vcard_vocabulary.js +0 -187
- package/dist/model/vcard_vocabulary.js.map +0 -1
- package/dist/monads/Either.d.ts +0 -51
- package/dist/monads/Either.d.ts.map +0 -1
- package/dist/monads/Either.js +0 -82
- package/dist/monads/Either.js.map +0 -1
- package/dist/monads/IO.d.ts +0 -38
- package/dist/monads/IO.d.ts.map +0 -1
- package/dist/monads/IO.js +0 -66
- package/dist/monads/IO.js.map +0 -1
- package/dist/monads/Maybe.d.ts +0 -45
- package/dist/monads/Maybe.d.ts.map +0 -1
- package/dist/monads/Maybe.js +0 -73
- package/dist/monads/Maybe.js.map +0 -1
- package/dist/monads/Reader.d.ts +0 -29
- package/dist/monads/Reader.d.ts.map +0 -1
- package/dist/monads/Reader.js +0 -44
- package/dist/monads/Reader.js.map +0 -1
- package/dist/monads/State.d.ts +0 -33
- package/dist/monads/State.d.ts.map +0 -1
- package/dist/monads/State.js +0 -50
- package/dist/monads/State.js.map +0 -1
- package/dist/monads/Writer.d.ts +0 -29
- package/dist/monads/Writer.d.ts.map +0 -1
- package/dist/monads/Writer.js +0 -46
- package/dist/monads/Writer.js.map +0 -1
- package/dist/ptr/Bridgelet.d.ts +0 -180
- package/dist/ptr/Bridgelet.d.ts.map +0 -1
- package/dist/ptr/Bridgelet.js +0 -296
- package/dist/ptr/Bridgelet.js.map +0 -1
- package/dist/ptr/CLMIntrospection.d.ts +0 -169
- package/dist/ptr/CLMIntrospection.d.ts.map +0 -1
- package/dist/ptr/CLMIntrospection.js +0 -329
- package/dist/ptr/CLMIntrospection.js.map +0 -1
- package/dist/ptr/FaroSidecar.d.ts +0 -56
- package/dist/ptr/FaroSidecar.d.ts.map +0 -1
- package/dist/ptr/FaroSidecar.js +0 -102
- package/dist/ptr/FaroSidecar.js.map +0 -1
- package/dist/ptr/LensProtocol.d.ts +0 -84
- package/dist/ptr/LensProtocol.d.ts.map +0 -1
- package/dist/ptr/LensProtocol.js +0 -98
- package/dist/ptr/LensProtocol.js.map +0 -1
- package/dist/ptr/OpenTelemetrySidecar.d.ts +0 -144
- package/dist/ptr/OpenTelemetrySidecar.d.ts.map +0 -1
- package/dist/ptr/OpenTelemetrySidecar.js +0 -232
- package/dist/ptr/OpenTelemetrySidecar.js.map +0 -1
- package/dist/ptr/SandboxWorker.d.ts +0 -79
- package/dist/ptr/SandboxWorker.d.ts.map +0 -1
- package/dist/ptr/SandboxWorker.js +0 -298
- package/dist/ptr/SandboxWorker.js.map +0 -1
- package/dist/ptr/common_types.d.ts +0 -39
- package/dist/ptr/common_types.d.ts.map +0 -1
- package/dist/ptr/common_types.js +0 -12
- package/dist/ptr/common_types.js.map +0 -1
- package/dist/rag/GraphRAGEngine.d.ts +0 -26
- package/dist/rag/GraphRAGEngine.d.ts.map +0 -1
- package/dist/rag/GraphRAGEngine.js +0 -166
- package/dist/rag/GraphRAGEngine.js.map +0 -1
- package/dist/rag/HandleVectorStore.d.ts +0 -201
- package/dist/rag/HandleVectorStore.d.ts.map +0 -1
- package/dist/rag/HandleVectorStore.js +0 -527
- package/dist/rag/HandleVectorStore.js.map +0 -1
- package/dist/rag/PersistentIndexer.d.ts +0 -148
- package/dist/rag/PersistentIndexer.d.ts.map +0 -1
- package/dist/rag/PersistentIndexer.js +0 -302
- package/dist/rag/PersistentIndexer.js.map +0 -1
- package/dist/rag/index.d.ts +0 -20
- package/dist/rag/index.d.ts.map +0 -1
- package/dist/rag/index.js +0 -26
- package/dist/rag/index.js.map +0 -1
- package/dist/rag/semanticVersioning.d.ts +0 -187
- package/dist/rag/semanticVersioning.d.ts.map +0 -1
- package/dist/rag/semanticVersioning.js +0 -253
- package/dist/rag/semanticVersioning.js.map +0 -1
- package/dist/storage/IndexedDBEngine.d.ts +0 -33
- package/dist/storage/IndexedDBEngine.d.ts.map +0 -1
- package/dist/storage/IndexedDBEngine.js +0 -198
- package/dist/storage/IndexedDBEngine.js.map +0 -1
- package/dist/storage/SqliteNodeEngine.d.ts.map +0 -1
- package/dist/storage/SqliteNodeEngine.js.map +0 -1
- package/dist/storage/SqliteWasmEngine.d.ts.map +0 -1
- package/dist/storage/SqliteWasmEngine.js.map +0 -1
- package/dist/storage/StorageAdapter.d.ts +0 -42
- package/dist/storage/StorageAdapter.d.ts.map +0 -1
- package/dist/storage/StorageAdapter.js +0 -2
- package/dist/storage/StorageAdapter.js.map +0 -1
- package/dist/storage/VectorStore.d.ts +0 -202
- package/dist/storage/VectorStore.d.ts.map +0 -1
- package/dist/storage/VectorStore.js +0 -557
- package/dist/storage/VectorStore.js.map +0 -1
- package/dist/storage/schema.d.ts +0 -162
- package/dist/storage/schema.d.ts.map +0 -1
- package/dist/storage/schema.js +0 -335
- package/dist/storage/schema.js.map +0 -1
- package/dist/storage/schema_constants.d.ts +0 -7
- package/dist/storage/schema_constants.d.ts.map +0 -1
- package/dist/storage/schema_constants.js +0 -415
- package/dist/storage/schema_constants.js.map +0 -1
- package/dist/types/dots.d.ts +0 -206
- package/dist/types/dots.d.ts.map +0 -1
- package/dist/types/dots.js +0 -201
- package/dist/types/dots.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { EVENT_CONSTANTS, ALGORITHM_HIERARCHY } from './constants';
|
|
2
|
-
import { GTime } from './GTime';
|
|
3
|
-
import { HashValidator } from './hash/HashValidator';
|
|
4
|
-
/**
|
|
5
|
-
* Generate a collision event for the given card.
|
|
6
|
-
*/
|
|
7
|
-
export async function generateCollisionEvent(card) {
|
|
8
|
-
const currentHashFunction = GTime.getHashAlgorithm(card.g_time);
|
|
9
|
-
const nextAlgo = nextHashFunction(currentHashFunction);
|
|
10
|
-
// Compute upgraded hash
|
|
11
|
-
const upgradedHash = await HashValidator.computeHash(card.content, nextAlgo);
|
|
12
|
-
const event = {
|
|
13
|
-
[EVENT_CONSTANTS.TYPE]: EVENT_CONSTANTS.COLLISION_EVENT_TYPE,
|
|
14
|
-
[EVENT_CONSTANTS.HASH]: card.hash,
|
|
15
|
-
[EVENT_CONSTANTS.FIRST_G_TIME]: card.g_time,
|
|
16
|
-
[EVENT_CONSTANTS.COLLISION_TIME]: card.g_time, // Using original card's time as per Python logic reference
|
|
17
|
-
[EVENT_CONSTANTS.CONTENT_SIZE]: card.content.length,
|
|
18
|
-
[EVENT_CONSTANTS.UPGRADED_FUNCTION]: nextAlgo,
|
|
19
|
-
[EVENT_CONSTANTS.UPGRADED_HASH]: upgradedHash
|
|
20
|
-
};
|
|
21
|
-
return JSON.stringify(event);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Generate a duplication event for the given card.
|
|
25
|
-
*/
|
|
26
|
-
export function generateDuplicationEvent(card) {
|
|
27
|
-
const event = {
|
|
28
|
-
[EVENT_CONSTANTS.TYPE]: EVENT_CONSTANTS.DUPLICATE_EVENT_TYPE,
|
|
29
|
-
[EVENT_CONSTANTS.HASH]: card.hash,
|
|
30
|
-
[EVENT_CONSTANTS.DUPLICATE_TIME]: card.g_time
|
|
31
|
-
};
|
|
32
|
-
return JSON.stringify(event);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get the next hash function in the hierarchy.
|
|
36
|
-
*/
|
|
37
|
-
function nextHashFunction(current) {
|
|
38
|
-
const currentLower = current.toLowerCase();
|
|
39
|
-
const entry = ALGORITHM_HIERARCHY[currentLower];
|
|
40
|
-
if (entry && entry.next) {
|
|
41
|
-
return entry.next;
|
|
42
|
-
}
|
|
43
|
-
// Fallback logic
|
|
44
|
-
return 'sha256';
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=EventProducer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventProducer.js","sourceRoot":"","sources":["../../src/model/EventProducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,C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AACjC,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACrC,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAI,mBAA2B,CAAC,YAAY,CAAC,CAAC;IAEzD,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,iBAAiB;IACjB,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
package/dist/model/GTime.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export declare class GTime {
|
|
2
|
-
private static readonly DEFAULT_ALGORITHM;
|
|
3
|
-
/**
|
|
4
|
-
* Generate a GTime stamp for the current moment
|
|
5
|
-
* Format: HASH_ALGO|TIMESTAMP|REGION_CODE
|
|
6
|
-
*/
|
|
7
|
-
static stampNow(hashAlgorithm?: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Parse a GTime string
|
|
10
|
-
*/
|
|
11
|
-
static parse(gtime: string): {
|
|
12
|
-
timestamp: Date;
|
|
13
|
-
algorithm: string;
|
|
14
|
-
region: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Get the hash algorithm from a GTime string
|
|
18
|
-
*/
|
|
19
|
-
static getHashAlgorithm(gtime: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Get the timestamp from a GTime string
|
|
22
|
-
*/
|
|
23
|
-
static getTimestamp(gtime: string): Date;
|
|
24
|
-
/**
|
|
25
|
-
* Get the region code from a GTime string
|
|
26
|
-
*/
|
|
27
|
-
static getRegionCode(gtime: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* Check if the provided hash function is valid.
|
|
30
|
-
* Matches Python's GTime.is_valid_hash_function()
|
|
31
|
-
*/
|
|
32
|
-
static isValidHashFunction(hashFunction: string): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Check if the provided region code is valid.
|
|
35
|
-
* Matches Python's GTime.is_valid_region_code()
|
|
36
|
-
*/
|
|
37
|
-
static isValidRegionCode(regionCode: string): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Check if the provided timestamp is in ISO format.
|
|
40
|
-
* Matches Python's GTime.is_iso_format()
|
|
41
|
-
*/
|
|
42
|
-
static isIsoFormat(timestamp: string): boolean;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=GTime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GTime.d.ts","sourceRoot":"","sources":["../../src/model/GTime.ts"],"names":[],"mappings":"AAKA,qBAAa,KAAK;IACd,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAY;IAErD;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAE,MAA+B,GAAG,MAAM;IAQvE;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAYnF;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI9C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3C;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAOzD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIrD;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAkBjD"}
|
package/dist/model/GTime.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Valid hash algorithms supported by the system
|
|
3
|
-
*/
|
|
4
|
-
const VALID_HASH_ALGORITHMS = ['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'];
|
|
5
|
-
export class GTime {
|
|
6
|
-
static DEFAULT_ALGORITHM = 'sha256';
|
|
7
|
-
/**
|
|
8
|
-
* Generate a GTime stamp for the current moment
|
|
9
|
-
* Format: HASH_ALGO|TIMESTAMP|REGION_CODE
|
|
10
|
-
*/
|
|
11
|
-
static stampNow(hashAlgorithm = this.DEFAULT_ALGORITHM) {
|
|
12
|
-
const algo = hashAlgorithm.toLowerCase();
|
|
13
|
-
// Use ISO string for timestamp (UTC)
|
|
14
|
-
const timestamp = new Date().toISOString();
|
|
15
|
-
const region = 'UTC'; // Defaulting to UTC for JS implementation
|
|
16
|
-
return `${algo}|${timestamp}|${region}`;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Parse a GTime string
|
|
20
|
-
*/
|
|
21
|
-
static parse(gtime) {
|
|
22
|
-
const parts = gtime.split('|');
|
|
23
|
-
if (parts.length !== 3) {
|
|
24
|
-
throw new Error(`Invalid GTime format: ${gtime}`);
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
algorithm: parts[0],
|
|
28
|
-
timestamp: new Date(parts[1]),
|
|
29
|
-
region: parts[2]
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get the hash algorithm from a GTime string
|
|
34
|
-
*/
|
|
35
|
-
static getHashAlgorithm(gtime) {
|
|
36
|
-
return this.parse(gtime).algorithm;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get the timestamp from a GTime string
|
|
40
|
-
*/
|
|
41
|
-
static getTimestamp(gtime) {
|
|
42
|
-
return this.parse(gtime).timestamp;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get the region code from a GTime string
|
|
46
|
-
*/
|
|
47
|
-
static getRegionCode(gtime) {
|
|
48
|
-
return this.parse(gtime).region;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Check if the provided hash function is valid.
|
|
52
|
-
* Matches Python's GTime.is_valid_hash_function()
|
|
53
|
-
*/
|
|
54
|
-
static isValidHashFunction(hashFunction) {
|
|
55
|
-
if (!hashFunction || typeof hashFunction !== 'string') {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return VALID_HASH_ALGORITHMS.includes(hashFunction.toLowerCase());
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Check if the provided region code is valid.
|
|
62
|
-
* Matches Python's GTime.is_valid_region_code()
|
|
63
|
-
*/
|
|
64
|
-
static isValidRegionCode(regionCode) {
|
|
65
|
-
return Boolean(regionCode && regionCode === regionCode.toUpperCase());
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Check if the provided timestamp is in ISO format.
|
|
69
|
-
* Matches Python's GTime.is_iso_format()
|
|
70
|
-
*/
|
|
71
|
-
static isIsoFormat(timestamp) {
|
|
72
|
-
if (!timestamp || typeof timestamp !== 'string') {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
const date = new Date(timestamp);
|
|
77
|
-
// Check if it's a valid date and the string contains expected ISO patterns
|
|
78
|
-
if (isNaN(date.getTime())) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
// ISO format should have 'T' separator or be a valid date string
|
|
82
|
-
// Accept formats like: 2024-12-04T12:00:00.000Z or 2024-12-04T12:00:00
|
|
83
|
-
const isoPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
|
|
84
|
-
return isoPattern.test(timestamp);
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=GTime.js.map
|
package/dist/model/GTime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GTime.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supports international characters (文檔, مستند, ドキュメント, документ)
|
|
5
|
-
* Uses Unicode categories for validation
|
|
6
|
-
*/
|
|
7
|
-
export declare class HandleValidationError extends Error {
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Validate and normalize a handle string
|
|
12
|
-
* @returns Normalized handle (NFC + lowercase)
|
|
13
|
-
* @throws HandleValidationError if invalid
|
|
14
|
-
*/
|
|
15
|
-
export declare function validateHandle(handle: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* ContentHandle - Mutable pointer to immutable MCard hash
|
|
18
|
-
*/
|
|
19
|
-
export declare class ContentHandle {
|
|
20
|
-
readonly handle: string;
|
|
21
|
-
currentHash: string;
|
|
22
|
-
readonly createdAt: Date;
|
|
23
|
-
updatedAt: Date;
|
|
24
|
-
constructor(handle: string, currentHash: string, createdAt?: Date, updatedAt?: Date);
|
|
25
|
-
/**
|
|
26
|
-
* Update handle to point to new hash
|
|
27
|
-
* @returns Previous hash for history tracking
|
|
28
|
-
*/
|
|
29
|
-
update(newHash: string): string;
|
|
30
|
-
toObject(): {
|
|
31
|
-
handle: string;
|
|
32
|
-
currentHash: string;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=Handle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../src/model/Handle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,qBAAa,qBAAsB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI9B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmCrD;AAED;;GAEG;AACH,qBAAa,aAAa;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;gBAEJ,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI;IAOnF;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAO/B,QAAQ;;;;;;CAQX"}
|
package/dist/model/Handle.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ContentHandle - UTF-8 aware handle validation and management
|
|
3
|
-
*
|
|
4
|
-
* Supports international characters (文檔, مستند, ドキュメント, документ)
|
|
5
|
-
* Uses Unicode categories for validation
|
|
6
|
-
*/
|
|
7
|
-
const MAX_HANDLE_LENGTH = 255;
|
|
8
|
-
/**
|
|
9
|
-
* Check if character is a valid starting character (Unicode letter)
|
|
10
|
-
*/
|
|
11
|
-
function isValidStartChar(char) {
|
|
12
|
-
// Unicode letter categories: L (Letter)
|
|
13
|
-
return /^\p{L}$/u.test(char);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Check if character is valid in handle body
|
|
17
|
-
*/
|
|
18
|
-
function isValidBodyChar(char) {
|
|
19
|
-
// Letters, numbers, underscore, hyphen, period, forward slash, space
|
|
20
|
-
return /^[\p{L}\p{N}_./ -]$/u.test(char);
|
|
21
|
-
}
|
|
22
|
-
export class HandleValidationError extends Error {
|
|
23
|
-
constructor(message) {
|
|
24
|
-
super(message);
|
|
25
|
-
this.name = 'HandleValidationError';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Validate and normalize a handle string
|
|
30
|
-
* @returns Normalized handle (NFC + lowercase)
|
|
31
|
-
* @throws HandleValidationError if invalid
|
|
32
|
-
*/
|
|
33
|
-
export function validateHandle(handle) {
|
|
34
|
-
if (!handle) {
|
|
35
|
-
throw new HandleValidationError('Handle cannot be empty.');
|
|
36
|
-
}
|
|
37
|
-
// Normalize: NFC + trim + lowercase
|
|
38
|
-
const normalized = handle.trim().normalize('NFC').toLowerCase();
|
|
39
|
-
if (normalized.length === 0) {
|
|
40
|
-
throw new HandleValidationError('Handle cannot be empty after normalization.');
|
|
41
|
-
}
|
|
42
|
-
if (normalized.length > MAX_HANDLE_LENGTH) {
|
|
43
|
-
throw new HandleValidationError(`Handle '${handle}' is too long (${normalized.length} chars). Maximum is ${MAX_HANDLE_LENGTH}.`);
|
|
44
|
-
}
|
|
45
|
-
// Validate first character
|
|
46
|
-
if (!isValidStartChar(normalized[0])) {
|
|
47
|
-
throw new HandleValidationError(`Invalid handle '${handle}'. Must start with a letter (any language).`);
|
|
48
|
-
}
|
|
49
|
-
// Validate remaining characters
|
|
50
|
-
for (let i = 1; i < normalized.length; i++) {
|
|
51
|
-
if (!isValidBodyChar(normalized[i])) {
|
|
52
|
-
throw new HandleValidationError(`Invalid character '${normalized[i]}' at position ${i} in handle '${handle}'.`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return normalized;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* ContentHandle - Mutable pointer to immutable MCard hash
|
|
59
|
-
*/
|
|
60
|
-
export class ContentHandle {
|
|
61
|
-
handle;
|
|
62
|
-
currentHash;
|
|
63
|
-
createdAt;
|
|
64
|
-
updatedAt;
|
|
65
|
-
constructor(handle, currentHash, createdAt, updatedAt) {
|
|
66
|
-
this.handle = validateHandle(handle);
|
|
67
|
-
this.currentHash = currentHash;
|
|
68
|
-
this.createdAt = createdAt ?? new Date();
|
|
69
|
-
this.updatedAt = updatedAt ?? this.createdAt;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Update handle to point to new hash
|
|
73
|
-
* @returns Previous hash for history tracking
|
|
74
|
-
*/
|
|
75
|
-
update(newHash) {
|
|
76
|
-
const previousHash = this.currentHash;
|
|
77
|
-
this.currentHash = newHash;
|
|
78
|
-
this.updatedAt = new Date();
|
|
79
|
-
return previousHash;
|
|
80
|
-
}
|
|
81
|
-
toObject() {
|
|
82
|
-
return {
|
|
83
|
-
handle: this.handle,
|
|
84
|
-
currentHash: this.currentHash,
|
|
85
|
-
createdAt: this.createdAt.toISOString(),
|
|
86
|
-
updatedAt: this.updatedAt.toISOString()
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=Handle.js.map
|
package/dist/model/Handle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Handle.js","sourceRoot":"","sources":["../../src/model/Handle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAY;IAClC,wCAAwC;IACxC,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACjC,qEAAqE;IACrE,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACxC,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,IAAI,qBAAqB,CAAC,yBAAyB,CAAC,CAAC;IAC/D,CAAC;IAED,oCAAoC;IACpC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAEhE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,qBAAqB,CAAC,6CAA6C,CAAC,CAAC;IACnF,CAAC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AAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,QAAQ;QACJ,OAAO;YACH,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YACvC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;SAC1C,CAAC;IACN,CAAC;CACJ"}
|
package/dist/model/MCard.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { DOTSMetadata } from '../types/dots';
|
|
2
|
-
/**
|
|
3
|
-
* MCard - Content-addressable data container (The Monad)
|
|
4
|
-
*
|
|
5
|
-
* ## Category Theory Role: MONAD
|
|
6
|
-
*
|
|
7
|
-
* MCard is the **Monad** in the MVP Cards categorical hierarchy:
|
|
8
|
-
* - **MCard (Monad)**: Data container with `unit` (create) and `bind` (chain)
|
|
9
|
-
* - **PCard (Functor)**: Pure transformation, `fmap` over MCard content
|
|
10
|
-
* - **VCard (Applicative)**: Context-aware application with pre-conditions
|
|
11
|
-
*
|
|
12
|
-
* ## Scale-Free Monadic Infrastructure: Spinoza-Leibniz Synthesis
|
|
13
|
-
*
|
|
14
|
-
* MCard implements the dual philosophical foundation:
|
|
15
|
-
*
|
|
16
|
-
* | Philosopher | Contribution | MCard Implementation |
|
|
17
|
-
* |-------------|--------------|---------------------|
|
|
18
|
-
* | **Spinoza** | One Substance (Deus sive Natura) | Fixed 3-field schema (Terminal Object) |
|
|
19
|
-
* | **Leibniz** | Infinite Monads (Pre-Established Harmony) | Infinite content-addressed entries |
|
|
20
|
-
* | **Both** | No windows / Internal causation | Content-addressing (same hash = same truth) |
|
|
21
|
-
*
|
|
22
|
-
* This enables **Experimental-Operational Symmetry (EOS)**: same behavior from
|
|
23
|
-
* a single user's PKC (100MB) to a planetary LLM registry (1PB).
|
|
24
|
-
*
|
|
25
|
-
* ## DOTS Vocabulary Role: CARRIER
|
|
26
|
-
*
|
|
27
|
-
* MCard is the **Carrier** in the Double Operadic Theory of Systems (DOTS).
|
|
28
|
-
* - Each MCard is an **Object** in the Carrier category Car(S)
|
|
29
|
-
* - Hash-links between MCards are **Morphisms** in Car(S)
|
|
30
|
-
* - The Carrier is the category of all actual data/systems
|
|
31
|
-
*
|
|
32
|
-
* ## Petri Net Role: TOKEN CONTENT
|
|
33
|
-
*
|
|
34
|
-
* In the Categorical Petri Net model:
|
|
35
|
-
* - **MCard content** is what tokens carry
|
|
36
|
-
* - **VCard** is the token type (Applicative wrapper)
|
|
37
|
-
* - **PCard** is the transition that transforms tokens
|
|
38
|
-
*
|
|
39
|
-
* ## MVP Cards Architecture: Data Plane
|
|
40
|
-
*
|
|
41
|
-
* ```
|
|
42
|
-
* ┌───────────────────────────────────────────────────────┐
|
|
43
|
-
* │ APPLICATION PLANE (VCard) │
|
|
44
|
-
* │ Petri Net Token / AuthN/AuthZ / Side Effects │
|
|
45
|
-
* └─────────────────────────┬─────────────────────────────┘
|
|
46
|
-
* │ (Pre-Condition Check)
|
|
47
|
-
* ┌─────────────────────────▼─────────────────────────────┐
|
|
48
|
-
* │ CONTROL PLANE (PCard) │
|
|
49
|
-
* │ Petri Net Transition / CLM Logic / Pure Function │
|
|
50
|
-
* └─────────────────────────┬─────────────────────────────┘
|
|
51
|
-
* │ (Content Transformation)
|
|
52
|
-
* ┌─────────────────────────▼─────────────────────────────┐
|
|
53
|
-
* │ DATA PLANE (MCard) ◀── YOU ARE HERE │
|
|
54
|
-
* │ Monad / Content-Addressable / Scale-Free Substrate │
|
|
55
|
-
* └───────────────────────────────────────────────────────┘
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* ## The Empty Schema Principle (Kenosis)
|
|
59
|
-
*
|
|
60
|
-
* MCard embodies the Empty Schema Principle:
|
|
61
|
-
* - Schema contains NO domain-specific terms (only hash, content, g_time)
|
|
62
|
-
* - Domain customization happens via data (INSERT), not schema changes
|
|
63
|
-
* - Universal applicability: same structure for ANY domain
|
|
64
|
-
* - This emptiness enables universality (Kenosis in code)
|
|
65
|
-
*
|
|
66
|
-
* ## Three Tables as Irreducible Semiotic Triad
|
|
67
|
-
*
|
|
68
|
-
* The MCard infrastructure uses three tables (Peirce's semiotics):
|
|
69
|
-
* - `card` (Object/Referent): what the content means
|
|
70
|
-
* - `handle_registry` (Representamen/Sign): which concept is named
|
|
71
|
-
* - `handle_history` (Interpretant): how understanding evolved
|
|
72
|
-
*
|
|
73
|
-
* ## Functional Requirements
|
|
74
|
-
*
|
|
75
|
-
* | ID | Requirement | Implementation |
|
|
76
|
-
* |----|-------------|----------------|
|
|
77
|
-
* | M-1 | Content-addressable via hash | `this.hash = SHA-256(content)` |
|
|
78
|
-
* | M-2 | CRD-only (no UPDATE) | Immutable class, `readonly` fields |
|
|
79
|
-
* | M-3 | Include g_time for ordering | `this.g_time` field |
|
|
80
|
-
* | M-4 | Human-readable content | `getContentAsText()` method |
|
|
81
|
-
* | MONAD-1 | Unit (pure) operation | `MCard.create(content)` |
|
|
82
|
-
* | MONAD-2 | Bind (chain) operation | `MCard.bind(f)` via hash reference |
|
|
83
|
-
* | EOS-M1 | Hash is pure function | No side effects in hash computation |
|
|
84
|
-
* | EOS-M2 | Content is immutable | All fields are `readonly` |
|
|
85
|
-
*
|
|
86
|
-
* @see {@link DOTSRole.CARRIER} for DOTS vocabulary definition
|
|
87
|
-
* @see {@link EOSRole.INVARIANT_CONTENT} for EOS role definition
|
|
88
|
-
* @see docs/MCard_Impl.md for full implementation specification
|
|
89
|
-
*/
|
|
90
|
-
export declare class MCard {
|
|
91
|
-
readonly content: Uint8Array;
|
|
92
|
-
readonly hash: string;
|
|
93
|
-
readonly g_time: string;
|
|
94
|
-
readonly contentType: string;
|
|
95
|
-
readonly hashFunction: string;
|
|
96
|
-
protected constructor(content: Uint8Array, hash: string, g_time: string, contentType: string, hashFunction: string);
|
|
97
|
-
/**
|
|
98
|
-
* Create a new MCard from content
|
|
99
|
-
*/
|
|
100
|
-
static create(content: string | Uint8Array, hashAlgorithm?: string): Promise<MCard>;
|
|
101
|
-
/**
|
|
102
|
-
* Create an MCard from existing data (e.g., from database)
|
|
103
|
-
*/
|
|
104
|
-
static fromData(content: Uint8Array, hash: string, g_time: string): MCard;
|
|
105
|
-
/**
|
|
106
|
-
* Get content as text (UTF-8 decoded)
|
|
107
|
-
*/
|
|
108
|
-
getContentAsText(): string;
|
|
109
|
-
/**
|
|
110
|
-
* Get content as raw bytes
|
|
111
|
-
*/
|
|
112
|
-
getContent(): Uint8Array;
|
|
113
|
-
/**
|
|
114
|
-
* Convert to plain object
|
|
115
|
-
*/
|
|
116
|
-
toObject(): {
|
|
117
|
-
hash: string;
|
|
118
|
-
content: string;
|
|
119
|
-
g_time: string;
|
|
120
|
-
contentType: string;
|
|
121
|
-
hashFunction: string;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Get DOTS vocabulary metadata for this MCard
|
|
125
|
-
*
|
|
126
|
-
* Returns the DOTS role information that positions this MCard
|
|
127
|
-
* in the Double Operadic Theory of Systems framework.
|
|
128
|
-
*
|
|
129
|
-
* MCard is always a CARRIER object in the Data Plane.
|
|
130
|
-
*
|
|
131
|
-
* @param tightRefs - Optional array of prerequisite MCard hashes (vertical composition)
|
|
132
|
-
* @param looseRefs - Optional array of alternative MCard hashes (horizontal composition)
|
|
133
|
-
* @returns DOTSMetadata describing this card's role in the compositional system
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* const card = await MCard.create('Hello World');
|
|
138
|
-
* const meta = card.getDOTSMetadata();
|
|
139
|
-
* console.log(meta.role); // 'Carrier'
|
|
140
|
-
* console.log(meta.plane); // 'Data'
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
getDOTSMetadata(tightRefs?: string[], looseRefs?: string[]): DOTSMetadata;
|
|
144
|
-
}
|
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CAAC,SAAS,GAAE,MAAM,EAAO,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,YAAY;CAGpF"}
|
package/dist/model/MCard.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { HashValidator } from './hash/HashValidator';
|
|
2
|
-
import { GTime } from './GTime';
|
|
3
|
-
import { ContentTypeInterpreter } from './ContentTypeInterpreter';
|
|
4
|
-
import { createMCardDOTSMetadata } from '../types/dots';
|
|
5
|
-
/**
|
|
6
|
-
* MCard - Content-addressable data container (The Monad)
|
|
7
|
-
*
|
|
8
|
-
* ## Category Theory Role: MONAD
|
|
9
|
-
*
|
|
10
|
-
* MCard is the **Monad** in the MVP Cards categorical hierarchy:
|
|
11
|
-
* - **MCard (Monad)**: Data container with `unit` (create) and `bind` (chain)
|
|
12
|
-
* - **PCard (Functor)**: Pure transformation, `fmap` over MCard content
|
|
13
|
-
* - **VCard (Applicative)**: Context-aware application with pre-conditions
|
|
14
|
-
*
|
|
15
|
-
* ## Scale-Free Monadic Infrastructure: Spinoza-Leibniz Synthesis
|
|
16
|
-
*
|
|
17
|
-
* MCard implements the dual philosophical foundation:
|
|
18
|
-
*
|
|
19
|
-
* | Philosopher | Contribution | MCard Implementation |
|
|
20
|
-
* |-------------|--------------|---------------------|
|
|
21
|
-
* | **Spinoza** | One Substance (Deus sive Natura) | Fixed 3-field schema (Terminal Object) |
|
|
22
|
-
* | **Leibniz** | Infinite Monads (Pre-Established Harmony) | Infinite content-addressed entries |
|
|
23
|
-
* | **Both** | No windows / Internal causation | Content-addressing (same hash = same truth) |
|
|
24
|
-
*
|
|
25
|
-
* This enables **Experimental-Operational Symmetry (EOS)**: same behavior from
|
|
26
|
-
* a single user's PKC (100MB) to a planetary LLM registry (1PB).
|
|
27
|
-
*
|
|
28
|
-
* ## DOTS Vocabulary Role: CARRIER
|
|
29
|
-
*
|
|
30
|
-
* MCard is the **Carrier** in the Double Operadic Theory of Systems (DOTS).
|
|
31
|
-
* - Each MCard is an **Object** in the Carrier category Car(S)
|
|
32
|
-
* - Hash-links between MCards are **Morphisms** in Car(S)
|
|
33
|
-
* - The Carrier is the category of all actual data/systems
|
|
34
|
-
*
|
|
35
|
-
* ## Petri Net Role: TOKEN CONTENT
|
|
36
|
-
*
|
|
37
|
-
* In the Categorical Petri Net model:
|
|
38
|
-
* - **MCard content** is what tokens carry
|
|
39
|
-
* - **VCard** is the token type (Applicative wrapper)
|
|
40
|
-
* - **PCard** is the transition that transforms tokens
|
|
41
|
-
*
|
|
42
|
-
* ## MVP Cards Architecture: Data Plane
|
|
43
|
-
*
|
|
44
|
-
* ```
|
|
45
|
-
* ┌───────────────────────────────────────────────────────┐
|
|
46
|
-
* │ APPLICATION PLANE (VCard) │
|
|
47
|
-
* │ Petri Net Token / AuthN/AuthZ / Side Effects │
|
|
48
|
-
* └─────────────────────────┬─────────────────────────────┘
|
|
49
|
-
* │ (Pre-Condition Check)
|
|
50
|
-
* ┌─────────────────────────▼─────────────────────────────┐
|
|
51
|
-
* │ CONTROL PLANE (PCard) │
|
|
52
|
-
* │ Petri Net Transition / CLM Logic / Pure Function │
|
|
53
|
-
* └─────────────────────────┬─────────────────────────────┘
|
|
54
|
-
* │ (Content Transformation)
|
|
55
|
-
* ┌─────────────────────────▼─────────────────────────────┐
|
|
56
|
-
* │ DATA PLANE (MCard) ◀── YOU ARE HERE │
|
|
57
|
-
* │ Monad / Content-Addressable / Scale-Free Substrate │
|
|
58
|
-
* └───────────────────────────────────────────────────────┘
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* ## The Empty Schema Principle (Kenosis)
|
|
62
|
-
*
|
|
63
|
-
* MCard embodies the Empty Schema Principle:
|
|
64
|
-
* - Schema contains NO domain-specific terms (only hash, content, g_time)
|
|
65
|
-
* - Domain customization happens via data (INSERT), not schema changes
|
|
66
|
-
* - Universal applicability: same structure for ANY domain
|
|
67
|
-
* - This emptiness enables universality (Kenosis in code)
|
|
68
|
-
*
|
|
69
|
-
* ## Three Tables as Irreducible Semiotic Triad
|
|
70
|
-
*
|
|
71
|
-
* The MCard infrastructure uses three tables (Peirce's semiotics):
|
|
72
|
-
* - `card` (Object/Referent): what the content means
|
|
73
|
-
* - `handle_registry` (Representamen/Sign): which concept is named
|
|
74
|
-
* - `handle_history` (Interpretant): how understanding evolved
|
|
75
|
-
*
|
|
76
|
-
* ## Functional Requirements
|
|
77
|
-
*
|
|
78
|
-
* | ID | Requirement | Implementation |
|
|
79
|
-
* |----|-------------|----------------|
|
|
80
|
-
* | M-1 | Content-addressable via hash | `this.hash = SHA-256(content)` |
|
|
81
|
-
* | M-2 | CRD-only (no UPDATE) | Immutable class, `readonly` fields |
|
|
82
|
-
* | M-3 | Include g_time for ordering | `this.g_time` field |
|
|
83
|
-
* | M-4 | Human-readable content | `getContentAsText()` method |
|
|
84
|
-
* | MONAD-1 | Unit (pure) operation | `MCard.create(content)` |
|
|
85
|
-
* | MONAD-2 | Bind (chain) operation | `MCard.bind(f)` via hash reference |
|
|
86
|
-
* | EOS-M1 | Hash is pure function | No side effects in hash computation |
|
|
87
|
-
* | EOS-M2 | Content is immutable | All fields are `readonly` |
|
|
88
|
-
*
|
|
89
|
-
* @see {@link DOTSRole.CARRIER} for DOTS vocabulary definition
|
|
90
|
-
* @see {@link EOSRole.INVARIANT_CONTENT} for EOS role definition
|
|
91
|
-
* @see docs/MCard_Impl.md for full implementation specification
|
|
92
|
-
*/
|
|
93
|
-
export class MCard {
|
|
94
|
-
content;
|
|
95
|
-
hash;
|
|
96
|
-
g_time;
|
|
97
|
-
contentType; // Defaulting to specific string or null
|
|
98
|
-
hashFunction;
|
|
99
|
-
constructor(content, hash, g_time, contentType, hashFunction) {
|
|
100
|
-
this.content = content;
|
|
101
|
-
this.hash = hash;
|
|
102
|
-
this.g_time = g_time;
|
|
103
|
-
this.contentType = contentType;
|
|
104
|
-
this.hashFunction = hashFunction;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Create a new MCard from content
|
|
108
|
-
*/
|
|
109
|
-
static async create(content, hashAlgorithm = 'sha256') {
|
|
110
|
-
if (content === null || content === undefined) {
|
|
111
|
-
throw new Error('Content cannot be null or undefined');
|
|
112
|
-
}
|
|
113
|
-
const bytes = typeof content === 'string'
|
|
114
|
-
? new TextEncoder().encode(content)
|
|
115
|
-
: content;
|
|
116
|
-
if (bytes.length === 0) {
|
|
117
|
-
throw new Error('Content cannot be empty');
|
|
118
|
-
}
|
|
119
|
-
const hash = await HashValidator.computeHash(bytes, hashAlgorithm);
|
|
120
|
-
const g_time = GTime.stampNow(hashAlgorithm);
|
|
121
|
-
const contentType = ContentTypeInterpreter.detect(bytes);
|
|
122
|
-
return new MCard(bytes, hash, g_time, contentType, hashAlgorithm);
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Create an MCard from existing data (e.g., from database)
|
|
126
|
-
*/
|
|
127
|
-
static fromData(content, hash, g_time) {
|
|
128
|
-
const alg = GTime.getHashAlgorithm(g_time);
|
|
129
|
-
const contentType = ContentTypeInterpreter.detect(content);
|
|
130
|
-
return new MCard(content, hash, g_time, contentType, alg);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Get content as text (UTF-8 decoded)
|
|
134
|
-
*/
|
|
135
|
-
getContentAsText() {
|
|
136
|
-
return new TextDecoder().decode(this.content);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Get content as raw bytes
|
|
140
|
-
*/
|
|
141
|
-
getContent() {
|
|
142
|
-
return this.content;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Convert to plain object
|
|
146
|
-
*/
|
|
147
|
-
toObject() {
|
|
148
|
-
return {
|
|
149
|
-
hash: this.hash,
|
|
150
|
-
content: this.getContentAsText(),
|
|
151
|
-
g_time: this.g_time,
|
|
152
|
-
contentType: this.contentType,
|
|
153
|
-
hashFunction: this.hashFunction
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get DOTS vocabulary metadata for this MCard
|
|
158
|
-
*
|
|
159
|
-
* Returns the DOTS role information that positions this MCard
|
|
160
|
-
* in the Double Operadic Theory of Systems framework.
|
|
161
|
-
*
|
|
162
|
-
* MCard is always a CARRIER object in the Data Plane.
|
|
163
|
-
*
|
|
164
|
-
* @param tightRefs - Optional array of prerequisite MCard hashes (vertical composition)
|
|
165
|
-
* @param looseRefs - Optional array of alternative MCard hashes (horizontal composition)
|
|
166
|
-
* @returns DOTSMetadata describing this card's role in the compositional system
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* const card = await MCard.create('Hello World');
|
|
171
|
-
* const meta = card.getDOTSMetadata();
|
|
172
|
-
* console.log(meta.role); // 'Carrier'
|
|
173
|
-
* console.log(meta.plane); // 'Data'
|
|
174
|
-
* ```
|
|
175
|
-
*/
|
|
176
|
-
getDOTSMetadata(tightRefs = [], looseRefs = []) {
|
|
177
|
-
return createMCardDOTSMetadata(tightRefs, looseRefs);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=MCard.js.map
|