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,10 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_FILE_SIZE,
|
|
3
|
+
READ_TIMEOUT_MS
|
|
4
|
+
} from "./chunk-A5S2PI37.js";
|
|
1
5
|
import {
|
|
2
6
|
ContentTypeInterpreter,
|
|
3
7
|
MCard
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2NFGZ6PA.js";
|
|
5
9
|
import {
|
|
6
10
|
__export
|
|
7
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PNKVD2UK.js";
|
|
8
12
|
|
|
9
13
|
// src/Loader.ts
|
|
10
14
|
var Loader_exports = {};
|
|
@@ -85,14 +89,14 @@ async function streamReadNormalizedText(filePath, options) {
|
|
|
85
89
|
originalSha256Prefix: sha.digest("hex").substring(0, 16)
|
|
86
90
|
};
|
|
87
91
|
}
|
|
88
|
-
var
|
|
89
|
-
var
|
|
92
|
+
var MAX_FILE_SIZE2 = MAX_FILE_SIZE;
|
|
93
|
+
var READ_TIMEOUT_MS2 = READ_TIMEOUT_MS;
|
|
90
94
|
async function isProblematicFile(filePath) {
|
|
91
95
|
try {
|
|
92
96
|
const stats = await fs.stat(filePath);
|
|
93
97
|
if (stats.size === 0) return false;
|
|
94
98
|
if (path.basename(filePath).startsWith(".")) return true;
|
|
95
|
-
if (stats.size >
|
|
99
|
+
if (stats.size > MAX_FILE_SIZE2) return true;
|
|
96
100
|
const ext = path.extname(filePath);
|
|
97
101
|
const isKnownType = ContentTypeInterpreter.isKnownLongLineExtension(ext);
|
|
98
102
|
if (isKnownType && stats.size > 1024 * 1024) return true;
|
|
@@ -113,9 +117,9 @@ async function isProblematicFile(filePath) {
|
|
|
113
117
|
}
|
|
114
118
|
async function readFileSafely(filePath, options = {}) {
|
|
115
119
|
const stats = await fs.stat(filePath);
|
|
116
|
-
if (stats.size >
|
|
120
|
+
if (stats.size > MAX_FILE_SIZE2) throw new Error(`File too large: ${stats.size}`);
|
|
117
121
|
const controller = new AbortController();
|
|
118
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
122
|
+
const timeout = setTimeout(() => controller.abort(), READ_TIMEOUT_MS2);
|
|
119
123
|
try {
|
|
120
124
|
const handle = await fs.open(filePath, "r");
|
|
121
125
|
try {
|
|
@@ -183,6 +187,14 @@ async function processFileContent(filePath, options = {}) {
|
|
|
183
187
|
var DEFAULT_MAX_PROBLEM_BYTES = 2 * 1024 * 1024;
|
|
184
188
|
var WRAP_WIDTH_KNOWN = 1e3;
|
|
185
189
|
var WRAP_WIDTH_DEFAULT = 80;
|
|
190
|
+
var Logger = {
|
|
191
|
+
info: (...args) => console.log("[Loader]", ...args),
|
|
192
|
+
warn: (...args) => console.warn("[Loader]", ...args),
|
|
193
|
+
error: (...args) => console.error("[Loader]", ...args),
|
|
194
|
+
debug: (...args) => {
|
|
195
|
+
if (process.env.DEBUG) console.log("[Loader]", ...args);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
186
198
|
async function processAndStoreFile(filePath, collection, options = {}) {
|
|
187
199
|
const {
|
|
188
200
|
allowProblematic = false,
|
|
@@ -194,13 +206,13 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
194
206
|
let fileInfo;
|
|
195
207
|
if (await isProblematicFile(filePath)) {
|
|
196
208
|
if (!allowProblematic) {
|
|
197
|
-
|
|
209
|
+
Logger.warn(`Skipping problematic file: ${filePath}`);
|
|
198
210
|
return null;
|
|
199
211
|
}
|
|
200
212
|
const extension = path2.extname(filePath).toLowerCase();
|
|
201
213
|
const isKnownType = ContentTypeInterpreter.isKnownLongLineExtension(extension);
|
|
202
214
|
const wrapWidth = isKnownType ? WRAP_WIDTH_KNOWN : WRAP_WIDTH_DEFAULT;
|
|
203
|
-
|
|
215
|
+
Logger.warn(`Problematic file detected, processing as safe text: ${filePath}`);
|
|
204
216
|
try {
|
|
205
217
|
const streamed = await streamReadNormalizedText(filePath, {
|
|
206
218
|
byteCap: maxBytesOnProblem,
|
|
@@ -219,7 +231,7 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
219
231
|
wrapWidth
|
|
220
232
|
};
|
|
221
233
|
} catch (e) {
|
|
222
|
-
|
|
234
|
+
Logger.warn(`Safe text processing failed, falling back to capped binary: ${filePath}`, e);
|
|
223
235
|
fileInfo = await processFileContent(filePath, {
|
|
224
236
|
forceBinary: true,
|
|
225
237
|
allowPathological: true,
|
|
@@ -227,15 +239,13 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
227
239
|
});
|
|
228
240
|
}
|
|
229
241
|
} else {
|
|
230
|
-
|
|
242
|
+
Logger.info(`Processing file: ${filePath}`);
|
|
231
243
|
fileInfo = await processFileContent(filePath);
|
|
232
244
|
}
|
|
233
245
|
if (!fileInfo) return null;
|
|
234
246
|
const content = fileInfo.content;
|
|
235
247
|
if (!content || typeof content === "string" && content.length === 0 || content instanceof Uint8Array && content.length === 0) {
|
|
236
|
-
|
|
237
|
-
console.log(`Skipping empty file: ${filePath} (empty files cannot be stored as MCards)`);
|
|
238
|
-
}
|
|
248
|
+
Logger.debug(`Skipping empty file: ${filePath} (empty files cannot be stored as MCards)`);
|
|
239
249
|
return {
|
|
240
250
|
hash: "",
|
|
241
251
|
contentType: fileInfo.mimeType,
|
|
@@ -263,11 +273,9 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
263
273
|
await collection.addWithHandle(mcard, relPath);
|
|
264
274
|
registered = true;
|
|
265
275
|
} catch (e2) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
);
|
|
270
|
-
}
|
|
276
|
+
Logger.debug(
|
|
277
|
+
`Handle name '${handle}' already in use (common for files like README.md, LICENSE). MCard stored successfully with hash ${mcard.hash.slice(0, 8)}... (accessible by hash, not by handle)`
|
|
278
|
+
);
|
|
271
279
|
}
|
|
272
280
|
}
|
|
273
281
|
}
|
|
@@ -275,6 +283,7 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
275
283
|
try {
|
|
276
284
|
await collection.add(mcard);
|
|
277
285
|
} catch (e3) {
|
|
286
|
+
Logger.warn(`Hash fallback also failed for ${handle}:`, e3);
|
|
278
287
|
}
|
|
279
288
|
}
|
|
280
289
|
}
|
|
@@ -292,7 +301,7 @@ async function processAndStoreFile(filePath, collection, options = {}) {
|
|
|
292
301
|
if (metadataOnly && isProblematic) result.metadataOnly = true;
|
|
293
302
|
return result;
|
|
294
303
|
} catch (e) {
|
|
295
|
-
|
|
304
|
+
Logger.error(`Error processing ${filePath}:`, e);
|
|
296
305
|
return null;
|
|
297
306
|
}
|
|
298
307
|
}
|
|
@@ -334,7 +343,7 @@ async function loadFileToCollection(targetPath, collection, options = {}) {
|
|
|
334
343
|
directoriesCount: uniqueDirs.size,
|
|
335
344
|
directoryLevels: maxDepth
|
|
336
345
|
};
|
|
337
|
-
|
|
346
|
+
Logger.info(`About to process ${files.length} files`);
|
|
338
347
|
for (const file of files) {
|
|
339
348
|
const result = await processAndStoreFile(file, collection, {
|
|
340
349
|
allowProblematic: includeProblematic,
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-2KADE3SE.js";
|
|
7
7
|
import {
|
|
8
8
|
SqliteNodeEngine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZZMOPQER.js";
|
|
10
10
|
import {
|
|
11
11
|
CardCollection,
|
|
12
12
|
Maybe
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5GHZP7E5.js";
|
|
14
14
|
import {
|
|
15
15
|
MCard
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2NFGZ6PA.js";
|
|
17
17
|
|
|
18
18
|
// src/ptr/node/runtimes/base.ts
|
|
19
19
|
import * as util from "util";
|
|
@@ -192,7 +192,9 @@ var JavaScriptRuntime = class {
|
|
|
192
192
|
const contextStr = JSON.stringify(context);
|
|
193
193
|
const projectRoot = findProjectRoot();
|
|
194
194
|
const wrapper = `
|
|
195
|
-
|
|
195
|
+
import process from 'process';
|
|
196
|
+
import { createRequire } from 'module';
|
|
197
|
+
const require = createRequire(import.meta.url);
|
|
196
198
|
const context = JSON.parse(process.argv[2]);
|
|
197
199
|
global.context = context;
|
|
198
200
|
let result;
|
|
@@ -277,6 +279,35 @@ Stdout: ${execError.stdout.toString()}` : "";
|
|
|
277
279
|
* Create Python wrapper script with entry point invocation.
|
|
278
280
|
*/
|
|
279
281
|
createWrapper(code, entryPoint) {
|
|
282
|
+
let userLogic = code;
|
|
283
|
+
let actualEntryPoint = entryPoint;
|
|
284
|
+
if (code.startsWith("module://")) {
|
|
285
|
+
const withoutPrefix = code.substring(9);
|
|
286
|
+
const colonIndex = withoutPrefix.indexOf(":");
|
|
287
|
+
let modulePath = withoutPrefix;
|
|
288
|
+
let moduleFunc = "";
|
|
289
|
+
if (colonIndex !== -1) {
|
|
290
|
+
modulePath = withoutPrefix.substring(0, colonIndex);
|
|
291
|
+
moduleFunc = withoutPrefix.substring(colonIndex + 1);
|
|
292
|
+
}
|
|
293
|
+
if (modulePath) {
|
|
294
|
+
if (moduleFunc) {
|
|
295
|
+
actualEntryPoint = moduleFunc;
|
|
296
|
+
}
|
|
297
|
+
userLogic = `
|
|
298
|
+
import importlib
|
|
299
|
+
try:
|
|
300
|
+
_mod = importlib.import_module('${modulePath}')
|
|
301
|
+
for _k in dir(_mod):
|
|
302
|
+
if not _k.startswith('_'):
|
|
303
|
+
globals()[_k] = getattr(_mod, _k)
|
|
304
|
+
except Exception as e:
|
|
305
|
+
import sys, json
|
|
306
|
+
print(json.dumps({"error": f"Failed to import module ${modulePath}: {e}"}))
|
|
307
|
+
sys.exit(1)
|
|
308
|
+
`;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
280
311
|
return `
|
|
281
312
|
import sys
|
|
282
313
|
import json
|
|
@@ -293,7 +324,7 @@ except:
|
|
|
293
324
|
pass
|
|
294
325
|
|
|
295
326
|
# User logic
|
|
296
|
-
${
|
|
327
|
+
${userLogic}
|
|
297
328
|
|
|
298
329
|
# Entry point invocation
|
|
299
330
|
def _is_arg_error(e):
|
|
@@ -302,10 +333,10 @@ def _is_arg_error(e):
|
|
|
302
333
|
|
|
303
334
|
try:
|
|
304
335
|
fn = None
|
|
305
|
-
if '${
|
|
306
|
-
fn = ${
|
|
307
|
-
elif '${
|
|
308
|
-
fn = globals()['${
|
|
336
|
+
if '${actualEntryPoint}' in dir():
|
|
337
|
+
fn = locals()['${actualEntryPoint}']
|
|
338
|
+
elif '${actualEntryPoint}' in globals():
|
|
339
|
+
fn = globals()['${actualEntryPoint}']
|
|
309
340
|
|
|
310
341
|
if fn is not None:
|
|
311
342
|
try:
|
|
@@ -423,8 +454,8 @@ var LeanRuntime = class {
|
|
|
423
454
|
async execute(code, context, config) {
|
|
424
455
|
const contextStr = typeof context === "string" ? context : JSON.stringify(context);
|
|
425
456
|
const sourcePath = await getCachedLeanSource(code);
|
|
426
|
-
const
|
|
427
|
-
const elanPath = path6.join(
|
|
457
|
+
const os2 = await import("os");
|
|
458
|
+
const elanPath = path6.join(os2.homedir(), ".elan", "bin", "elan");
|
|
428
459
|
let stdout;
|
|
429
460
|
if (fs4.existsSync(elanPath)) {
|
|
430
461
|
const result = await execFile2(elanPath, [
|
|
@@ -447,13 +478,14 @@ var LeanRuntime = class {
|
|
|
447
478
|
// src/ptr/node/runtimes/loader.ts
|
|
448
479
|
import * as fs5 from "fs";
|
|
449
480
|
import * as path7 from "path";
|
|
481
|
+
import * as os from "os";
|
|
450
482
|
var LoaderRuntime = class {
|
|
451
483
|
/**
|
|
452
484
|
* Loader runtime: load files using the standardized loadFileToCollection utility.
|
|
453
485
|
* Returns unified metrics and results matching Python's loader builtin.
|
|
454
486
|
*/
|
|
455
487
|
async execute(_code, context, config) {
|
|
456
|
-
const { loadFileToCollection } = await import("./Loader-
|
|
488
|
+
const { loadFileToCollection } = await import("./Loader-OLKPY6HT.js");
|
|
457
489
|
const ctx = context;
|
|
458
490
|
const loaderParams = extractLoaderParams(ctx, { sourceDir: "test_data", dbPath: ":memory:" });
|
|
459
491
|
const { sourceDir, recursive, dbPath } = loaderParams;
|
|
@@ -517,11 +549,12 @@ var CollectionLoaderRuntime = class {
|
|
|
517
549
|
*/
|
|
518
550
|
async execute(_code, context, config) {
|
|
519
551
|
const ctx = context;
|
|
552
|
+
const defaultDbPath = path7.join(os.tmpdir(), "loader_clm.db");
|
|
520
553
|
const loaderParams = extractLoaderParams(ctx, {
|
|
521
554
|
sourceDir: "chapters/chapter_04_load_dir/test_data",
|
|
522
|
-
dbPath:
|
|
555
|
+
dbPath: defaultDbPath
|
|
523
556
|
});
|
|
524
|
-
const { sourceDir, recursive, dbPath =
|
|
557
|
+
const { sourceDir, recursive, dbPath = defaultDbPath } = loaderParams;
|
|
525
558
|
const projectRoot = findProjectRoot();
|
|
526
559
|
const sourcePath = path7.isAbsolute(sourceDir) ? sourceDir : path7.join(projectRoot, sourceDir);
|
|
527
560
|
if (!fs5.existsSync(sourcePath)) {
|
|
@@ -595,7 +628,7 @@ var RuntimeFactory = class {
|
|
|
595
628
|
} else if (r === "wasm") {
|
|
596
629
|
status[r] = typeof WebAssembly !== "undefined";
|
|
597
630
|
} else if (r === "llm") {
|
|
598
|
-
const { OllamaProvider } = await import("./OllamaProvider-
|
|
631
|
+
const { OllamaProvider } = await import("./OllamaProvider-FBZ5WW72.js");
|
|
599
632
|
const provider = new OllamaProvider(null, 5);
|
|
600
633
|
status[r] = await provider.validate_connection();
|
|
601
634
|
} else {
|
|
@@ -634,7 +667,7 @@ var RuntimeFactory = class {
|
|
|
634
667
|
return {
|
|
635
668
|
async execute(code, context, config) {
|
|
636
669
|
if (!_LLMRuntime) {
|
|
637
|
-
const mod = await import("./LLMRuntime-
|
|
670
|
+
const mod = await import("./LLMRuntime-UPSEDSIK.js");
|
|
638
671
|
_LLMRuntime = mod.LLMRuntime;
|
|
639
672
|
}
|
|
640
673
|
const runtime = new _LLMRuntime();
|
|
@@ -649,7 +682,7 @@ var RuntimeFactory = class {
|
|
|
649
682
|
return {
|
|
650
683
|
async execute(code, context, config) {
|
|
651
684
|
if (!_LambdaRuntime) {
|
|
652
|
-
const mod = await import("./LambdaRuntime-
|
|
685
|
+
const mod = await import("./LambdaRuntime-YKSBAT65.js");
|
|
653
686
|
_LambdaRuntime = mod.LambdaRuntime;
|
|
654
687
|
}
|
|
655
688
|
const runtime = new _LambdaRuntime(collection);
|
|
@@ -661,7 +694,7 @@ var RuntimeFactory = class {
|
|
|
661
694
|
return {
|
|
662
695
|
async execute(code, context, config, chapterDir) {
|
|
663
696
|
if (!_NetworkRuntime) {
|
|
664
|
-
const mod = await import("./NetworkRuntime-
|
|
697
|
+
const mod = await import("./NetworkRuntime-XZR733M5.js");
|
|
665
698
|
_NetworkRuntime = mod.NetworkRuntime;
|
|
666
699
|
}
|
|
667
700
|
const runtime = new _NetworkRuntime(netCollection);
|
|
@@ -678,18 +711,18 @@ var RuntimeFactory = class {
|
|
|
678
711
|
static async getRuntimeAsync(runtimeName, options) {
|
|
679
712
|
switch (runtimeName) {
|
|
680
713
|
case "llm": {
|
|
681
|
-
const { LLMRuntime } = await import("./LLMRuntime-
|
|
714
|
+
const { LLMRuntime } = await import("./LLMRuntime-UPSEDSIK.js");
|
|
682
715
|
return new LLMRuntime();
|
|
683
716
|
}
|
|
684
717
|
case "lambda": {
|
|
685
718
|
if (!options?.collection) {
|
|
686
719
|
throw new Error("Lambda runtime requires a CardCollection in options");
|
|
687
720
|
}
|
|
688
|
-
const { LambdaRuntime: LambdaRuntime2 } = await import("./LambdaRuntime-
|
|
721
|
+
const { LambdaRuntime: LambdaRuntime2 } = await import("./LambdaRuntime-YKSBAT65.js");
|
|
689
722
|
return new LambdaRuntime2(options.collection);
|
|
690
723
|
}
|
|
691
724
|
case "network": {
|
|
692
|
-
const { NetworkRuntime } = await import("./NetworkRuntime-
|
|
725
|
+
const { NetworkRuntime } = await import("./NetworkRuntime-XZR733M5.js");
|
|
693
726
|
return new NetworkRuntime(options?.collection);
|
|
694
727
|
}
|
|
695
728
|
default:
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Either
|
|
3
3
|
} from "./chunk-2KADE3SE.js";
|
|
4
|
+
import {
|
|
5
|
+
LLM_DEFAULT_RETRY_COUNT,
|
|
6
|
+
LLM_DEFAULT_RETRY_DELAY_SECS,
|
|
7
|
+
LLM_DEFAULT_TIMEOUT_SECS
|
|
8
|
+
} from "./chunk-A5S2PI37.js";
|
|
4
9
|
|
|
5
10
|
// src/ptr/llm/providers/LLMProvider.ts
|
|
6
11
|
var BaseLLMProvider = class {
|
|
@@ -84,11 +89,11 @@ var DEFAULT_LLM_CONFIG = {
|
|
|
84
89
|
max_tokens: 2048,
|
|
85
90
|
top_p: 1,
|
|
86
91
|
top_k: 40,
|
|
87
|
-
timeout:
|
|
92
|
+
timeout: LLM_DEFAULT_TIMEOUT_SECS,
|
|
88
93
|
stream: false,
|
|
89
94
|
response_format: "text",
|
|
90
|
-
retry_count:
|
|
91
|
-
retry_delay:
|
|
95
|
+
retry_count: LLM_DEFAULT_RETRY_COUNT,
|
|
96
|
+
retry_delay: LLM_DEFAULT_RETRY_DELAY_SECS
|
|
92
97
|
};
|
|
93
98
|
var RESPONSE_FORMATS = ["text", "json", "structured", "markdown"];
|
|
94
99
|
var LLMConfig = class _LLMConfig {
|
|
@@ -214,7 +219,7 @@ var OllamaProvider = class extends BaseLLMProvider {
|
|
|
214
219
|
base_url;
|
|
215
220
|
timeout;
|
|
216
221
|
config;
|
|
217
|
-
constructor(base_url = null, timeout =
|
|
222
|
+
constructor(base_url = null, timeout = LLM_DEFAULT_TIMEOUT_SECS) {
|
|
218
223
|
super();
|
|
219
224
|
this.config = LLM_PROVIDERS["ollama"];
|
|
220
225
|
this.base_url = (base_url || this.config.base_url).replace(/\/$/, "");
|
|
@@ -233,6 +238,11 @@ var OllamaProvider = class extends BaseLLMProvider {
|
|
|
233
238
|
timeout: this.timeout
|
|
234
239
|
};
|
|
235
240
|
return new Promise((resolve) => {
|
|
241
|
+
let payload;
|
|
242
|
+
if (data) {
|
|
243
|
+
payload = JSON.stringify(data);
|
|
244
|
+
options.headers["Content-Length"] = Buffer.byteLength(payload);
|
|
245
|
+
}
|
|
236
246
|
const req = client.request(url, options, (res) => {
|
|
237
247
|
let body = "";
|
|
238
248
|
res.on("data", (chunk) => {
|
|
@@ -270,18 +280,21 @@ var OllamaProvider = class extends BaseLLMProvider {
|
|
|
270
280
|
req.destroy();
|
|
271
281
|
resolve(Either.left(`Ollama request timed out after ${this.timeout}ms`));
|
|
272
282
|
});
|
|
273
|
-
if (
|
|
274
|
-
req.write(
|
|
283
|
+
if (payload) {
|
|
284
|
+
req.write(payload);
|
|
275
285
|
}
|
|
276
286
|
req.end();
|
|
277
287
|
});
|
|
278
288
|
}
|
|
279
|
-
async complete(prompt, params) {
|
|
289
|
+
async complete(prompt, params, images) {
|
|
280
290
|
const data = {
|
|
281
|
-
model: params.model
|
|
291
|
+
model: typeof params.model === "string" ? params.model : this.config.default_model,
|
|
282
292
|
prompt,
|
|
283
293
|
stream: false
|
|
284
294
|
};
|
|
295
|
+
if (images && images.length > 0) {
|
|
296
|
+
data.images = images;
|
|
297
|
+
}
|
|
285
298
|
if (params.options) {
|
|
286
299
|
data.options = params.options;
|
|
287
300
|
}
|
|
@@ -300,7 +313,7 @@ var OllamaProvider = class extends BaseLLMProvider {
|
|
|
300
313
|
}
|
|
301
314
|
async chat(messages, params) {
|
|
302
315
|
const data = {
|
|
303
|
-
model: params.model
|
|
316
|
+
model: typeof params.model === "string" ? params.model : this.config.default_model,
|
|
304
317
|
messages,
|
|
305
318
|
stream: false
|
|
306
319
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
LLMConfig,
|
|
5
5
|
LLM_PROVIDERS,
|
|
6
6
|
OllamaProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WR6ISHCS.js";
|
|
8
8
|
import {
|
|
9
9
|
IO
|
|
10
10
|
} from "./chunk-MPMRBT5R.js";
|
|
@@ -78,7 +78,7 @@ var WebLLMProvider = class extends BaseLLMProvider {
|
|
|
78
78
|
return Either.left(`WebLLM init failed: ${error.message || String(e)}`);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
async complete(prompt, params) {
|
|
81
|
+
async complete(prompt, params, images) {
|
|
82
82
|
const model = typeof params.model === "string" ? params.model : this.config.default_model;
|
|
83
83
|
const engineResult = await this._get_engine(model);
|
|
84
84
|
if (engineResult.isLeft) return Either.left(engineResult.left);
|
|
@@ -211,10 +211,10 @@ var MLCLLMProvider = class extends BaseLLMProvider {
|
|
|
211
211
|
req.end();
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
async complete(prompt, params) {
|
|
214
|
+
async complete(prompt, params, images) {
|
|
215
215
|
const data = {
|
|
216
|
-
model: params.model
|
|
217
|
-
prompt,
|
|
216
|
+
model: typeof params.model === "string" ? params.model : this.config.default_model,
|
|
217
|
+
messages: [{ role: "user", content: prompt }],
|
|
218
218
|
max_tokens: params.max_tokens,
|
|
219
219
|
temperature: params.temperature,
|
|
220
220
|
top_p: params.top_p,
|
|
@@ -310,32 +310,45 @@ var LLMRuntime = class {
|
|
|
310
310
|
this._provider = get_provider(llmConfig.provider, llmConfig.endpoint_url, llmConfig.timeout);
|
|
311
311
|
}
|
|
312
312
|
let prompt = "";
|
|
313
|
+
let images;
|
|
313
314
|
if (typeof context === "string") {
|
|
314
315
|
prompt = context;
|
|
315
|
-
} else {
|
|
316
|
-
|
|
316
|
+
} else if (context && typeof context === "object") {
|
|
317
|
+
const ctx = context;
|
|
318
|
+
if (typeof ctx.prompt === "string") {
|
|
319
|
+
prompt = ctx.prompt;
|
|
320
|
+
if (Array.isArray(ctx.images)) {
|
|
321
|
+
images = ctx.images;
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
prompt = JSON.stringify(context);
|
|
325
|
+
}
|
|
317
326
|
}
|
|
318
327
|
let result;
|
|
319
328
|
if (llmConfig.system_prompt) {
|
|
320
|
-
result = await this._execute_chat(prompt, llmConfig);
|
|
329
|
+
result = await this._execute_chat(prompt, llmConfig, images);
|
|
321
330
|
} else {
|
|
322
|
-
result = await this._execute_completion(prompt, llmConfig);
|
|
331
|
+
result = await this._execute_completion(prompt, llmConfig, images);
|
|
323
332
|
}
|
|
324
333
|
if (result.isLeft) {
|
|
325
334
|
return `Error: ${result.left}`;
|
|
326
335
|
}
|
|
327
336
|
return this._format_response(result.right, llmConfig);
|
|
328
337
|
}
|
|
329
|
-
async _execute_completion(prompt, config) {
|
|
338
|
+
async _execute_completion(prompt, config, images) {
|
|
330
339
|
const params = config.to_provider_params();
|
|
331
|
-
return this.provider.complete(prompt, params);
|
|
340
|
+
return this.provider.complete(prompt, params, images);
|
|
332
341
|
}
|
|
333
|
-
async _execute_chat(prompt, config) {
|
|
342
|
+
async _execute_chat(prompt, config, images) {
|
|
334
343
|
const messages = [];
|
|
335
344
|
if (config.system_prompt) {
|
|
336
345
|
messages.push({ role: "system", content: config.system_prompt });
|
|
337
346
|
}
|
|
338
|
-
|
|
347
|
+
const userMsg = { role: "user", content: prompt };
|
|
348
|
+
if (images && images.length > 0) {
|
|
349
|
+
userMsg.images = images;
|
|
350
|
+
}
|
|
351
|
+
messages.push(userMsg);
|
|
339
352
|
if (config.assistant_instruction) {
|
|
340
353
|
messages.push({ role: "assistant", content: config.assistant_instruction });
|
|
341
354
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_PAGE_SIZE
|
|
3
|
+
} from "./chunk-A5S2PI37.js";
|
|
1
4
|
import {
|
|
2
5
|
MCard
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2NFGZ6PA.js";
|
|
4
7
|
|
|
5
8
|
// src/monads/Maybe.ts
|
|
6
9
|
var Maybe = class _Maybe {
|
|
@@ -84,13 +87,13 @@ var CardCollection = class {
|
|
|
84
87
|
if (existingCard) {
|
|
85
88
|
const isDuplicate = this.areContentsEqual(existingCard.content, card.content);
|
|
86
89
|
if (isDuplicate) {
|
|
87
|
-
const { generateDuplicationEvent } = await import("./EventProducer-
|
|
90
|
+
const { generateDuplicationEvent } = await import("./EventProducer-AWD6YMZR.js");
|
|
88
91
|
const eventStr = generateDuplicationEvent(card);
|
|
89
92
|
const eventCard = await MCard.create(eventStr);
|
|
90
93
|
await this.engine.add(eventCard);
|
|
91
94
|
return card.hash;
|
|
92
95
|
} else {
|
|
93
|
-
const { generateCollisionEvent } = await import("./EventProducer-
|
|
96
|
+
const { generateCollisionEvent } = await import("./EventProducer-AWD6YMZR.js");
|
|
94
97
|
const eventStr = await generateCollisionEvent(card);
|
|
95
98
|
const eventCard = await MCard.create(eventStr);
|
|
96
99
|
await this.engine.add(eventCard);
|
|
@@ -127,7 +130,7 @@ var CardCollection = class {
|
|
|
127
130
|
/**
|
|
128
131
|
* Get a page of cards
|
|
129
132
|
*/
|
|
130
|
-
async getPage(pageNumber = 1, pageSize =
|
|
133
|
+
async getPage(pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
131
134
|
return this.engine.getPage(pageNumber, pageSize);
|
|
132
135
|
}
|
|
133
136
|
/**
|
|
@@ -217,10 +220,10 @@ var CardCollection = class {
|
|
|
217
220
|
async clear() {
|
|
218
221
|
return this.engine.clear();
|
|
219
222
|
}
|
|
220
|
-
async searchByString(query, pageNumber = 1, pageSize =
|
|
223
|
+
async searchByString(query, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
221
224
|
return this.engine.search(query, pageNumber, pageSize);
|
|
222
225
|
}
|
|
223
|
-
async searchByContent(query, pageNumber = 1, pageSize =
|
|
226
|
+
async searchByContent(query, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
224
227
|
return this.engine.search(query, pageNumber, pageSize);
|
|
225
228
|
}
|
|
226
229
|
async searchByHash(hashPrefix) {
|
|
@@ -229,7 +232,7 @@ var CardCollection = class {
|
|
|
229
232
|
async getAllMCardsRaw() {
|
|
230
233
|
return this.engine.getAll();
|
|
231
234
|
}
|
|
232
|
-
async getAllCards(pageSize =
|
|
235
|
+
async getAllCards(pageSize = DEFAULT_PAGE_SIZE, processCallback) {
|
|
233
236
|
const cards = [];
|
|
234
237
|
let pageNumber = 1;
|
|
235
238
|
let total = 0;
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createPage
|
|
2
|
+
createPage
|
|
3
|
+
} from "./chunk-3EIBJPNF.js";
|
|
4
|
+
import {
|
|
5
|
+
init_Handle,
|
|
3
6
|
validateHandle
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ADV52544.js";
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_PAGE_SIZE,
|
|
10
|
+
INDEXEDDB_DEFAULT_DB_NAME,
|
|
11
|
+
INDEXEDDB_DEFAULT_DB_VERSION
|
|
12
|
+
} from "./chunk-A5S2PI37.js";
|
|
5
13
|
import {
|
|
6
14
|
MCard
|
|
7
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2NFGZ6PA.js";
|
|
8
16
|
|
|
9
|
-
// src/storage/IndexedDBEngine.ts
|
|
17
|
+
// src/storage/engines/IndexedDBEngine.ts
|
|
10
18
|
import { openDB } from "idb";
|
|
19
|
+
init_Handle();
|
|
11
20
|
var IndexedDBEngine = class {
|
|
12
21
|
db = null;
|
|
13
22
|
dbName;
|
|
14
|
-
constructor(dbName =
|
|
23
|
+
constructor(dbName = INDEXEDDB_DEFAULT_DB_NAME) {
|
|
15
24
|
this.dbName = dbName;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* Initialize the database connection
|
|
19
28
|
*/
|
|
20
29
|
async init() {
|
|
21
|
-
this.db = await openDB(this.dbName,
|
|
30
|
+
this.db = await openDB(this.dbName, INDEXEDDB_DEFAULT_DB_VERSION, {
|
|
22
31
|
upgrade(db) {
|
|
23
32
|
if (!db.objectStoreNames.contains("cards")) {
|
|
24
33
|
db.createObjectStore("cards", { keyPath: "hash" });
|
|
@@ -63,7 +72,7 @@ var IndexedDBEngine = class {
|
|
|
63
72
|
const db = this.ensureDb();
|
|
64
73
|
await db.delete("cards", hash);
|
|
65
74
|
}
|
|
66
|
-
async getPage(pageNumber, pageSize) {
|
|
75
|
+
async getPage(pageNumber, pageSize = DEFAULT_PAGE_SIZE) {
|
|
67
76
|
const db = this.ensureDb();
|
|
68
77
|
const totalItems = await db.count("cards");
|
|
69
78
|
const allCards = await db.getAll("cards");
|
|
@@ -84,7 +93,7 @@ var IndexedDBEngine = class {
|
|
|
84
93
|
const records = await db.getAll("cards", range);
|
|
85
94
|
return records.map((r) => MCard.fromData(r.content, r.hash, r.g_time));
|
|
86
95
|
}
|
|
87
|
-
async search(query, pageNumber, pageSize) {
|
|
96
|
+
async search(query, pageNumber, pageSize = DEFAULT_PAGE_SIZE) {
|
|
88
97
|
const db = this.ensureDb();
|
|
89
98
|
const records = await db.getAll("cards");
|
|
90
99
|
const decoder = new TextDecoder();
|