cactus-react-native 0.2.11 → 1.0.1
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/Cactus.podspec +34 -0
- package/LICENSE +38 -0
- package/README.md +354 -69
- package/android/CMakeLists.txt +40 -0
- package/android/build.gradle +68 -44
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/cactus/CactusPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusFileSystem.kt +227 -0
- package/android/src/main/jniLibs/arm64-v8a/{libcactus_v8_2_dotprod.so → libcactus.a} +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/cpp/HybridCactus.cpp +123 -0
- package/cpp/HybridCactus.hpp +35 -0
- package/cpp/HybridCactusUtil.cpp +45 -0
- package/cpp/HybridCactusUtil.hpp +26 -0
- package/cpp/cactus_ffi.h +55 -0
- package/cpp/cactus_util.h +25 -0
- package/ios/HybridCactusCrypto.swift +37 -0
- package/ios/HybridCactusDeviceInfo.swift +32 -0
- package/ios/HybridCactusFileSystem.swift +234 -0
- package/ios/cactus.xcframework/{info.plist → Info.plist} +2 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +8 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +28 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +347 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +286 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +319 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +254 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +11 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +55 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +347 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +286 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +319 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +254 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/{tvos-arm64_x86_64-simulator → ios-arm64-simulator}/cactus.framework/_CodeSignature/CodeResources +1 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus_util.xcframework/Info.plist +39 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/Info.plist +0 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/_CodeSignature/CodeResources +36 -2
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +60 -0
- package/lib/module/api/Database.js.map +1 -0
- package/lib/module/classes/CactusLM.js +149 -0
- package/lib/module/classes/CactusLM.js.map +1 -0
- package/lib/module/config/CactusConfig.js +6 -0
- package/lib/module/config/CactusConfig.js.map +1 -0
- package/lib/module/constants/packageVersion.js +4 -0
- package/lib/module/constants/packageVersion.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +233 -0
- package/lib/module/hooks/useCactusLM.js.map +1 -0
- package/lib/module/index.js +9 -409
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/Cactus.js +50 -0
- package/lib/module/native/Cactus.js.map +1 -0
- package/lib/module/native/CactusCrypto.js +10 -0
- package/lib/module/native/CactusCrypto.js.map +1 -0
- package/lib/module/native/CactusDeviceInfo.js +13 -0
- package/lib/module/native/CactusDeviceInfo.js.map +1 -0
- package/lib/module/native/CactusFileSystem.js +35 -0
- package/lib/module/native/CactusFileSystem.js.map +1 -0
- package/lib/module/native/CactusUtil.js +23 -0
- package/lib/module/native/CactusUtil.js.map +1 -0
- package/lib/module/native/index.js +8 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/specs/Cactus.nitro.js +4 -0
- package/lib/module/specs/Cactus.nitro.js.map +1 -0
- package/lib/module/specs/CactusCrypto.nitro.js +4 -0
- package/lib/module/specs/CactusCrypto.nitro.js.map +1 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js +4 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js.map +1 -0
- package/lib/module/specs/CactusFileSystem.nitro.js +4 -0
- package/lib/module/specs/CactusFileSystem.nitro.js.map +1 -0
- package/lib/module/specs/CactusUtil.nitro.js +4 -0
- package/lib/module/specs/CactusUtil.nitro.js.map +1 -0
- package/lib/module/telemetry/Telemetry.js +100 -0
- package/lib/module/telemetry/Telemetry.js.map +1 -0
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusLM.js.map +1 -0
- package/lib/module/types/CactusModel.js +2 -0
- package/lib/module/types/CactusModel.js.map +1 -0
- package/lib/module/utils/error.js +4 -0
- package/lib/module/utils/error.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/api/Database.d.ts +11 -0
- package/lib/typescript/src/api/Database.d.ts.map +1 -0
- package/lib/typescript/src/classes/CactusLM.d.ts +25 -0
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/config/CactusConfig.d.ts +5 -0
- package/lib/typescript/src/config/CactusConfig.d.ts.map +1 -0
- package/lib/typescript/src/constants/packageVersion.d.ts +2 -0
- package/lib/typescript/src/constants/packageVersion.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +20 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +11 -0
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts +5 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts +7 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts +13 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusUtil.d.ts +6 -0
- package/lib/typescript/src/native/CactusUtil.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +6 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +13 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +8 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +1 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts +30 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusLM.d.ts +65 -0
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusModel.d.ts +12 -0
- package/lib/typescript/src/types/CactusModel.d.ts.map +1 -0
- package/lib/typescript/src/utils/error.d.ts +2 -0
- package/lib/typescript/src/utils/error.d.ts.map +1 -0
- package/nitro.json +31 -0
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +85 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.cpp +192 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/android/cactus+autolinking.cmake +87 -0
- package/nitrogen/generated/android/cactus+autolinking.gradle +27 -0
- package/nitrogen/generated/android/cactusOnLoad.cpp +86 -0
- package/nitrogen/generated/android/cactusOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusFileSystemSpec.kt +95 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/cactusOnLoad.kt +35 -0
- package/nitrogen/generated/ios/Cactus+autolinking.rb +60 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +122 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +373 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +60 -0
- package/nitrogen/generated/ios/CactusAutolinking.mm +69 -0
- package/nitrogen/generated/ios/CactusAutolinking.swift +55 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +77 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.hpp +143 -0
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +98 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +139 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +164 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec_cxx.swift +303 -0
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +66 -0
- package/package.json +84 -143
- package/src/api/Database.ts +83 -0
- package/src/classes/CactusLM.ts +203 -0
- package/src/config/CactusConfig.ts +4 -0
- package/src/constants/packageVersion.ts +1 -0
- package/src/hooks/useCactusLM.ts +282 -0
- package/src/index.tsx +23 -0
- package/src/native/Cactus.ts +79 -0
- package/src/native/CactusCrypto.ts +11 -0
- package/src/native/CactusDeviceInfo.ts +18 -0
- package/src/native/CactusFileSystem.ts +47 -0
- package/src/native/CactusUtil.ts +27 -0
- package/src/native/index.ts +5 -0
- package/src/specs/Cactus.nitro.ts +16 -0
- package/src/specs/CactusCrypto.nitro.ts +6 -0
- package/src/specs/CactusDeviceInfo.nitro.ts +15 -0
- package/src/specs/CactusFileSystem.nitro.ts +21 -0
- package/src/specs/CactusUtil.nitro.ts +8 -0
- package/src/telemetry/Telemetry.ts +159 -0
- package/src/types/CactusLM.ts +71 -0
- package/src/types/CactusModel.ts +14 -0
- package/src/utils/error.ts +2 -0
- package/LICENSE.txt +0 -20
- package/android/src/main/CMakeLists.txt +0 -140
- package/android/src/main/java/com/cactus/Cactus.java +0 -1190
- package/android/src/main/java/com/cactus/CactusPackage.java +0 -48
- package/android/src/main/java/com/cactus/LlamaContext.java +0 -748
- package/android/src/main/jni-utils.h +0 -100
- package/android/src/main/jni.cpp +0 -1605
- package/android/src/main/jniLibs/arm64-v8a/libcactus.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod_i8mm.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_i8mm.so +0 -0
- package/android/src/newarch/java/com/cactus/CactusModule.java +0 -204
- package/android/src/oldarch/java/com/cactus/CactusModule.java +0 -205
- package/cactus-react-native.podspec +0 -42
- package/ios/CMakeLists.txt +0 -131
- package/ios/Cactus.h +0 -6
- package/ios/Cactus.mm +0 -681
- package/ios/CactusContext.h +0 -81
- package/ios/CactusContext.mm +0 -1032
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/lib/commonjs/NativeCactus.js +0 -9
- package/lib/commonjs/NativeCactus.js.map +0 -1
- package/lib/commonjs/agent.js +0 -73
- package/lib/commonjs/agent.js.map +0 -1
- package/lib/commonjs/chat.js +0 -73
- package/lib/commonjs/chat.js.map +0 -1
- package/lib/commonjs/index.js +0 -523
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/lm.js +0 -272
- package/lib/commonjs/lm.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/projectId.js +0 -9
- package/lib/commonjs/projectId.js.map +0 -1
- package/lib/commonjs/remote.js +0 -100
- package/lib/commonjs/remote.js.map +0 -1
- package/lib/commonjs/telemetry.js +0 -102
- package/lib/commonjs/telemetry.js.map +0 -1
- package/lib/commonjs/tools.js +0 -72
- package/lib/commonjs/tools.js.map +0 -1
- package/lib/commonjs/tts.js +0 -141
- package/lib/commonjs/tts.js.map +0 -1
- package/lib/commonjs/vlm.js +0 -221
- package/lib/commonjs/vlm.js.map +0 -1
- package/lib/module/NativeCactus.js +0 -5
- package/lib/module/NativeCactus.js.map +0 -1
- package/lib/module/agent.js +0 -68
- package/lib/module/agent.js.map +0 -1
- package/lib/module/chat.js +0 -67
- package/lib/module/chat.js.map +0 -1
- package/lib/module/lm.js +0 -267
- package/lib/module/lm.js.map +0 -1
- package/lib/module/projectId.js +0 -5
- package/lib/module/projectId.js.map +0 -1
- package/lib/module/remote.js +0 -91
- package/lib/module/remote.js.map +0 -1
- package/lib/module/telemetry.js +0 -97
- package/lib/module/telemetry.js.map +0 -1
- package/lib/module/tools.js +0 -66
- package/lib/module/tools.js.map +0 -1
- package/lib/module/tts.js +0 -135
- package/lib/module/tts.js.map +0 -1
- package/lib/module/vlm.js +0 -216
- package/lib/module/vlm.js.map +0 -1
- package/lib/typescript/NativeCactus.d.ts +0 -252
- package/lib/typescript/NativeCactus.d.ts.map +0 -1
- package/lib/typescript/agent.d.ts +0 -31
- package/lib/typescript/agent.d.ts.map +0 -1
- package/lib/typescript/chat.d.ts +0 -23
- package/lib/typescript/chat.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -114
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/lm.d.ts +0 -36
- package/lib/typescript/lm.d.ts.map +0 -1
- package/lib/typescript/projectId.d.ts +0 -2
- package/lib/typescript/projectId.d.ts.map +0 -1
- package/lib/typescript/remote.d.ts +0 -8
- package/lib/typescript/remote.d.ts.map +0 -1
- package/lib/typescript/telemetry.d.ts +0 -25
- package/lib/typescript/telemetry.d.ts.map +0 -1
- package/lib/typescript/tools.d.ts +0 -36
- package/lib/typescript/tools.d.ts.map +0 -1
- package/lib/typescript/tts.d.ts +0 -54
- package/lib/typescript/tts.d.ts.map +0 -1
- package/lib/typescript/vlm.d.ts +0 -33
- package/lib/typescript/vlm.d.ts.map +0 -1
- package/scripts/postInstall.js +0 -33
- package/src/NativeCactus.ts +0 -317
- package/src/agent.ts +0 -112
- package/src/chat.ts +0 -91
- package/src/index.ts +0 -663
- package/src/lm.ts +0 -324
- package/src/projectId.ts +0 -1
- package/src/remote.ts +0 -113
- package/src/telemetry.ts +0 -137
- package/src/tools.ts +0 -94
- package/src/tts.ts +0 -236
- package/src/vlm.ts +0 -276
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CactusLM } from './lm';
|
|
2
|
-
import type { ContextParams, CompletionParams, CactusOAICompatibleMessage, NativeCompletionResult, TokenData } from './index';
|
|
3
|
-
import { Tools } from './tools';
|
|
4
|
-
interface Parameter {
|
|
5
|
-
type: string;
|
|
6
|
-
description: string;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface CactusAgentReturn {
|
|
10
|
-
agent: CactusAgent | null;
|
|
11
|
-
error: Error | null;
|
|
12
|
-
lm: CactusAgent | null;
|
|
13
|
-
}
|
|
14
|
-
export interface AgentCompletionParams extends CompletionParams {
|
|
15
|
-
tools?: Tools;
|
|
16
|
-
}
|
|
17
|
-
export declare class CactusAgent extends CactusLM {
|
|
18
|
-
private tools;
|
|
19
|
-
static init(params: ContextParams, onProgress?: (progress: number) => void, cactusToken?: string, retryOptions?: {
|
|
20
|
-
maxRetries?: number;
|
|
21
|
-
delayMs?: number;
|
|
22
|
-
}): Promise<CactusAgentReturn>;
|
|
23
|
-
addTool(func: Function, description: string, parameters: {
|
|
24
|
-
[key: string]: Parameter;
|
|
25
|
-
}): Function;
|
|
26
|
-
getTools(): Tools;
|
|
27
|
-
completionWithTools(messages: CactusOAICompatibleMessage[], params?: AgentCompletionParams, callback?: (data: TokenData) => void, recursionCount?: number, recursionLimit?: number): Promise<NativeCompletionResult>;
|
|
28
|
-
isJinjaSupported(): boolean;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAE/B,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,EACV,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IACzB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,EAAE,EAAE,WAAW,GAAG,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,qBAAa,WAAY,SAAQ,QAAQ;IACvC,OAAO,CAAC,KAAK,CAAQ;WAER,IAAI,CACf,MAAM,EAAE,aAAa,EACrB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACvC,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACvD,OAAO,CAAC,iBAAiB,CAAC;IAY7B,OAAO,CACL,IAAI,EAAE,QAAQ,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACvC,QAAQ;IAIX,QAAQ,IAAI,KAAK;IAIX,mBAAmB,CACvB,QAAQ,EAAE,0BAA0B,EAAE,EACtC,MAAM,GAAE,qBAA0B,EAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,EACpC,cAAc,GAAE,MAAU,EAC1B,cAAc,GAAE,MAAU,GACzB,OAAO,CAAC,sBAAsB,CAAC;IA0ClC,gBAAgB,IAAI,OAAO;CAG5B"}
|
package/lib/typescript/chat.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { NativeLlamaChatMessage } from './NativeCactus';
|
|
2
|
-
export type CactusMessagePart = {
|
|
3
|
-
text?: string;
|
|
4
|
-
};
|
|
5
|
-
export type CactusOAICompatibleMessage = {
|
|
6
|
-
role: string;
|
|
7
|
-
content?: string | CactusMessagePart[] | any;
|
|
8
|
-
tool_calls?: any[];
|
|
9
|
-
tool_call_id?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function formatChat(messages: CactusOAICompatibleMessage[]): NativeLlamaChatMessage[];
|
|
12
|
-
export interface ProcessedMessages {
|
|
13
|
-
newMessages: CactusOAICompatibleMessage[];
|
|
14
|
-
requiresReset: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare class ConversationHistoryManager {
|
|
17
|
-
private history;
|
|
18
|
-
processNewMessages(fullMessageHistory: CactusOAICompatibleMessage[]): ProcessedMessages;
|
|
19
|
-
update(newMessages: CactusOAICompatibleMessage[], assistantResponse: CactusOAICompatibleMessage): void;
|
|
20
|
-
reset(): void;
|
|
21
|
-
getMessages(): CactusOAICompatibleMessage[];
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAE5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,EAAE,GAAG,GAAG,CAAA;IAC5C,UAAU,CAAC,EAAE,GAAG,EAAE,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,0BAA0B,EAAE,GACrC,sBAAsB,EAAE,CA8B1B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,0BAA0B;IACrC,OAAO,CAAC,OAAO,CAAoC;IAE5C,kBAAkB,CACvB,kBAAkB,EAAE,0BAA0B,EAAE,GAC/C,iBAAiB;IAmBb,MAAM,CACX,WAAW,EAAE,0BAA0B,EAAE,EACzC,iBAAiB,EAAE,0BAA0B;IAKxC,KAAK;IAIL,WAAW,IAAI,0BAA0B,EAAE;CAGnD"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { NativeContextParams, NativeLlamaContext, NativeCompletionParams, NativeCompletionTokenProb, NativeCompletionResult, NativeTokenizeResult, NativeEmbeddingResult, NativeSessionLoadResult, NativeEmbeddingParams, NativeCompletionTokenProbItem, NativeCompletionResultTimings, JinjaFormattedChatResult, NativeTTSType, NativeAudioCompletionResult, NativeAudioTokensResult, NativeAudioDecodeResult, NativeDeviceInfo } from './NativeCactus';
|
|
2
|
-
import type { CactusMessagePart, CactusOAICompatibleMessage } from './chat';
|
|
3
|
-
import { Tools } from './tools';
|
|
4
|
-
export type { NativeContextParams, NativeLlamaContext, NativeCompletionParams, NativeCompletionTokenProb, NativeCompletionResult, NativeTokenizeResult, NativeEmbeddingResult, NativeSessionLoadResult, NativeEmbeddingParams, NativeCompletionTokenProbItem, NativeCompletionResultTimings, CactusMessagePart, CactusOAICompatibleMessage, JinjaFormattedChatResult, NativeAudioDecodeResult, NativeTTSType, };
|
|
5
|
-
export * from './remote';
|
|
6
|
-
export { Tools, parseAndExecuteTool } from './tools';
|
|
7
|
-
export type TokenData = {
|
|
8
|
-
token: string;
|
|
9
|
-
completion_probabilities?: Array<NativeCompletionTokenProb>;
|
|
10
|
-
};
|
|
11
|
-
export type ContextParams = Omit<NativeContextParams, 'cache_type_k' | 'cache_type_v' | 'pooling_type'> & {
|
|
12
|
-
cache_type_k?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1';
|
|
13
|
-
cache_type_v?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1';
|
|
14
|
-
pooling_type?: 'none' | 'mean' | 'cls' | 'last' | 'rank';
|
|
15
|
-
};
|
|
16
|
-
export type EmbeddingParams = NativeEmbeddingParams;
|
|
17
|
-
export type CompletionResponseFormat = {
|
|
18
|
-
type: 'text' | 'json_object' | 'json_schema';
|
|
19
|
-
json_schema?: {
|
|
20
|
-
strict?: boolean;
|
|
21
|
-
schema: object;
|
|
22
|
-
};
|
|
23
|
-
schema?: object;
|
|
24
|
-
};
|
|
25
|
-
export type CompletionBaseParams = {
|
|
26
|
-
prompt?: string;
|
|
27
|
-
messages?: CactusOAICompatibleMessage[];
|
|
28
|
-
chatTemplate?: string;
|
|
29
|
-
chat_template?: string;
|
|
30
|
-
jinja?: boolean;
|
|
31
|
-
tools?: object;
|
|
32
|
-
parallel_tool_calls?: object;
|
|
33
|
-
tool_choice?: string;
|
|
34
|
-
response_format?: CompletionResponseFormat;
|
|
35
|
-
};
|
|
36
|
-
export type CompletionParams = Omit<NativeCompletionParams, 'emit_partial_completion' | 'prompt'> & CompletionBaseParams;
|
|
37
|
-
export type BenchResult = {
|
|
38
|
-
modelDesc: string;
|
|
39
|
-
modelSize: number;
|
|
40
|
-
modelNParams: number;
|
|
41
|
-
ppAvg: number;
|
|
42
|
-
ppStd: number;
|
|
43
|
-
tgAvg: number;
|
|
44
|
-
tgStd: number;
|
|
45
|
-
};
|
|
46
|
-
export declare class LlamaContext {
|
|
47
|
-
id: number;
|
|
48
|
-
gpu: boolean;
|
|
49
|
-
reasonNoGPU: string;
|
|
50
|
-
model: NativeLlamaContext['model'];
|
|
51
|
-
constructor({ contextId, gpu, reasonNoGPU, model }: NativeLlamaContext);
|
|
52
|
-
loadSession(filepath: string): Promise<NativeSessionLoadResult>;
|
|
53
|
-
saveSession(filepath: string, options?: {
|
|
54
|
-
tokenSize: number;
|
|
55
|
-
}): Promise<number>;
|
|
56
|
-
isLlamaChatSupported(): boolean;
|
|
57
|
-
isJinjaSupported(): boolean;
|
|
58
|
-
getFormattedChat(messages: CactusOAICompatibleMessage[], template?: string | null, params?: {
|
|
59
|
-
jinja?: boolean;
|
|
60
|
-
response_format?: CompletionResponseFormat;
|
|
61
|
-
tools?: object;
|
|
62
|
-
parallel_tool_calls?: object;
|
|
63
|
-
tool_choice?: string;
|
|
64
|
-
}): Promise<JinjaFormattedChatResult | string>;
|
|
65
|
-
completionWithTools(params: CompletionParams & {
|
|
66
|
-
tools: Tools;
|
|
67
|
-
}, callback?: (data: TokenData) => void, recursionCount?: number, recursionLimit?: number): Promise<NativeCompletionResult>;
|
|
68
|
-
completion(params: CompletionParams, callback?: (data: TokenData) => void): Promise<NativeCompletionResult>;
|
|
69
|
-
stopCompletion(): Promise<void>;
|
|
70
|
-
tokenize(text: string): Promise<NativeTokenizeResult>;
|
|
71
|
-
detokenize(tokens: number[]): Promise<string>;
|
|
72
|
-
embedding(text: string, params?: EmbeddingParams): Promise<NativeEmbeddingResult>;
|
|
73
|
-
bench(pp: number, tg: number, pl: number, nr: number): Promise<BenchResult>;
|
|
74
|
-
applyLoraAdapters(loraList: Array<{
|
|
75
|
-
path: string;
|
|
76
|
-
scaled?: number;
|
|
77
|
-
}>): Promise<void>;
|
|
78
|
-
removeLoraAdapters(): Promise<void>;
|
|
79
|
-
getLoadedLoraAdapters(): Promise<Array<{
|
|
80
|
-
path: string;
|
|
81
|
-
scaled?: number;
|
|
82
|
-
}>>;
|
|
83
|
-
release(): Promise<void>;
|
|
84
|
-
rewind(): Promise<void>;
|
|
85
|
-
}
|
|
86
|
-
export declare function toggleNativeLog(enabled: boolean): Promise<void>;
|
|
87
|
-
export declare function addNativeLogListener(listener: (level: string, text: string) => void): {
|
|
88
|
-
remove: () => void;
|
|
89
|
-
};
|
|
90
|
-
export declare function setContextLimit(limit: number): Promise<void>;
|
|
91
|
-
export declare function loadLlamaModelInfo(model: string): Promise<Object>;
|
|
92
|
-
export declare function initLlama({ model, is_model_asset: isModelAsset, pooling_type: poolingType, lora, lora_list: loraList, ...rest }: ContextParams, onProgress?: (progress: number) => void): Promise<LlamaContext>;
|
|
93
|
-
export declare function releaseAllLlama(): Promise<void>;
|
|
94
|
-
export declare const initContext: (params: NativeContextParams) => Promise<NativeLlamaContext>;
|
|
95
|
-
export declare const initMultimodal: (contextId: number, mmprojPath: string, useGpu?: boolean) => Promise<boolean>;
|
|
96
|
-
export declare const isMultimodalEnabled: (contextId: number) => Promise<boolean>;
|
|
97
|
-
export declare const isMultimodalSupportVision: (contextId: number) => Promise<boolean>;
|
|
98
|
-
export declare const isMultimodalSupportAudio: (contextId: number) => Promise<boolean>;
|
|
99
|
-
export declare const releaseMultimodal: (contextId: number) => Promise<void>;
|
|
100
|
-
export declare const multimodalCompletion: (contextId: number, prompt: string, mediaPaths: string[], params: NativeCompletionParams) => Promise<NativeCompletionResult>;
|
|
101
|
-
export declare const initVocoder: (contextId: number, vocoderModelPath: string) => Promise<boolean>;
|
|
102
|
-
export declare const isVocoderEnabled: (contextId: number) => Promise<boolean>;
|
|
103
|
-
export declare const getTTSType: (contextId: number) => Promise<NativeTTSType>;
|
|
104
|
-
export declare const getFormattedAudioCompletion: (contextId: number, speakerJsonStr: string, textToSpeak: string) => Promise<NativeAudioCompletionResult>;
|
|
105
|
-
export declare const getAudioCompletionGuideTokens: (contextId: number, textToSpeak: string) => Promise<NativeAudioTokensResult>;
|
|
106
|
-
export declare const decodeAudioTokens: (contextId: number, tokens: number[]) => Promise<NativeAudioDecodeResult>;
|
|
107
|
-
export declare const releaseVocoder: (contextId: number) => Promise<void>;
|
|
108
|
-
export declare const tokenize: (contextId: number, text: string, mediaPaths?: string[]) => Promise<NativeTokenizeResult>;
|
|
109
|
-
export declare const getDeviceInfo: (contextId: number) => Promise<NativeDeviceInfo>;
|
|
110
|
-
export { CactusLM } from './lm';
|
|
111
|
-
export { CactusVLM } from './vlm';
|
|
112
|
-
export { CactusTTS } from './tts';
|
|
113
|
-
export { CactusAgent } from './agent';
|
|
114
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,aAAa,EACb,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAA;AAE3E,OAAO,EAAE,KAAK,EAAuB,MAAM,SAAS,CAAA;AAEpD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,iBAAiB,EACjB,0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,YAAY,MAAM,EAAE,EAAE,QAAQ,sBAAsB,KAAG,OAAO,CAAC,sBAAsB,CAalK,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,WAAW,MAAM,EAAE,kBAAkB,MAAM,qBAE5E,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,WAAW,MAAM,qBAEvD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,aAAa,CAEzE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAU,WAAW,MAAM,EAAE,gBAAgB,MAAM,EAAE,aAAa,MAAM,KAAG,OAAO,CAAC,2BAA2B,CAErJ,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAU,WAAW,MAAM,EAAE,aAAa,MAAM,KAAG,OAAO,CAAC,uBAAuB,CAE3H,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,WAAW,MAAM,EAAE,QAAQ,MAAM,EAAE,KAAG,OAAO,CAAC,uBAAuB,CAE5G,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,WAAW,MAAM,kBAErD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAU,WAAW,MAAM,EAAE,MAAM,MAAM,EAAE,aAAa,MAAM,EAAE,KAAG,OAAO,CAAC,oBAAoB,CAMnH,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,gBAAgB,CAE/E,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/lib/typescript/lm.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { LlamaContext } from './index';
|
|
2
|
-
import type { ContextParams, CompletionParams, CactusOAICompatibleMessage, NativeCompletionResult, EmbeddingParams, NativeEmbeddingResult } from './index';
|
|
3
|
-
import { ConversationHistoryManager } from './chat';
|
|
4
|
-
interface CactusLMReturn {
|
|
5
|
-
lm: CactusLM | null;
|
|
6
|
-
error: Error | null;
|
|
7
|
-
}
|
|
8
|
-
export declare class CactusLM {
|
|
9
|
-
protected context: LlamaContext;
|
|
10
|
-
protected conversationHistoryManager: ConversationHistoryManager;
|
|
11
|
-
private initParams;
|
|
12
|
-
private static _initCache;
|
|
13
|
-
private static getCacheKey;
|
|
14
|
-
protected constructor(context: LlamaContext, initParams: ContextParams);
|
|
15
|
-
private static isContextNotFoundError;
|
|
16
|
-
private reinit;
|
|
17
|
-
private run;
|
|
18
|
-
static init(params: ContextParams, onProgress?: (progress: number) => void, cactusToken?: string, retryOptions?: {
|
|
19
|
-
maxRetries?: number;
|
|
20
|
-
delayMs?: number;
|
|
21
|
-
}): Promise<CactusLMReturn>;
|
|
22
|
-
completion: (messages: CactusOAICompatibleMessage[], params?: CompletionParams & {
|
|
23
|
-
mode?: string;
|
|
24
|
-
}, callback?: (data: any) => void) => Promise<NativeCompletionResult>;
|
|
25
|
-
private _handleLocalCompletion;
|
|
26
|
-
private _handleRemoteCompletion;
|
|
27
|
-
embedding(text: string, params?: EmbeddingParams, mode?: string): Promise<NativeEmbeddingResult>;
|
|
28
|
-
protected _handleLocalEmbedding(text: string, params?: EmbeddingParams): Promise<NativeEmbeddingResult>;
|
|
29
|
-
protected _handleRemoteEmbedding(text: string): Promise<NativeEmbeddingResult>;
|
|
30
|
-
rewind: () => Promise<void>;
|
|
31
|
-
release(): Promise<void>;
|
|
32
|
-
stopCompletion(): Promise<void>;
|
|
33
|
-
isJinjaSupported(): boolean;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=lm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lm.d.ts","sourceRoot":"","sources":["../../src/lm.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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E,eAAe,EACxB,IAAI,GAAE,MAAgB,GACrB,OAAO,CAAC,qBAAqB,CAAC;cAoCjB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;cAI7F,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAOpF,MAAM,QAAa,OAAO,CAAC,IAAI,CAAC,CAE/B;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUxB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,gBAAgB,IAAI,OAAO;CAG5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectId.d.ts","sourceRoot":"","sources":["../../src/projectId.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,yCAAyC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CactusOAICompatibleMessage } from "./chat";
|
|
2
|
-
export declare function setCactusToken(token: string | null): void;
|
|
3
|
-
export declare function getVertexAIEmbedding(text: string): Promise<number[]>;
|
|
4
|
-
export declare function getVertexAICompletion(messages: CactusOAICompatibleMessage[], imageData?: string, imagePath?: string, mimeType?: string): Promise<string>;
|
|
5
|
-
export declare function getTextCompletion(messages: CactusOAICompatibleMessage[]): Promise<string>;
|
|
6
|
-
export declare function getVisionCompletion(messages: CactusOAICompatibleMessage[], imagePath: string): Promise<string>;
|
|
7
|
-
export declare function getVisionCompletionFromData(messages: CactusOAICompatibleMessage[], imageData: string, mimeType?: string): Promise<string>;
|
|
8
|
-
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAIzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEzD;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAG1E;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,0BAA0B,EAAE,EACtC,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAiEjB;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/F;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpH;AAED,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,0BAA0B,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/I"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface TelemetryParams {
|
|
2
|
-
n_gpu_layers: number | null;
|
|
3
|
-
n_ctx: number | null;
|
|
4
|
-
model: string | null;
|
|
5
|
-
}
|
|
6
|
-
interface TelemetryConfig {
|
|
7
|
-
supabaseUrl: string;
|
|
8
|
-
supabaseKey: string;
|
|
9
|
-
table?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class Telemetry {
|
|
12
|
-
private static instance;
|
|
13
|
-
private config;
|
|
14
|
-
private constructor();
|
|
15
|
-
private static getFilename;
|
|
16
|
-
static autoInit(): void;
|
|
17
|
-
static init(config: TelemetryConfig): void;
|
|
18
|
-
static track(payload: Record<string, any>, options: TelemetryParams, deviceMetadata?: Record<string, any>): void;
|
|
19
|
-
static error(error: Error, options: TelemetryParams): void;
|
|
20
|
-
private trackInternal;
|
|
21
|
-
private errorInternal;
|
|
22
|
-
private sendRecord;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAmBD,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA0B;IACjD,OAAO,CAAC,MAAM,CAA4B;IAE1C,OAAO;IAOP,OAAO,CAAC,MAAM,CAAC,WAAW;IAQ1B,MAAM,CAAC,QAAQ,IAAI,IAAI;IASvB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAM1C,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAOhH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAO1D,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,aAAa;YAuBP,UAAU;CAYzB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { NativeCompletionResult } from "./NativeCactus";
|
|
2
|
-
export type OpenAIToolSchema = {
|
|
3
|
-
type: "function";
|
|
4
|
-
function: {
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
parameters: {
|
|
8
|
-
type: "object";
|
|
9
|
-
properties: {
|
|
10
|
-
[key: string]: Parameter;
|
|
11
|
-
};
|
|
12
|
-
required: string[];
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
interface Parameter {
|
|
17
|
-
type: string;
|
|
18
|
-
description: string;
|
|
19
|
-
required?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare class Tools {
|
|
22
|
-
private tools;
|
|
23
|
-
add(func: Function, description: string, parameters: {
|
|
24
|
-
[key: string]: Parameter;
|
|
25
|
-
}): Function;
|
|
26
|
-
getSchemas(): OpenAIToolSchema[];
|
|
27
|
-
execute(name: string, args: any): Promise<any>;
|
|
28
|
-
}
|
|
29
|
-
export declare function parseAndExecuteTool(result: NativeCompletionResult, tools: Tools): Promise<{
|
|
30
|
-
toolCalled: boolean;
|
|
31
|
-
toolName?: string;
|
|
32
|
-
toolInput?: any;
|
|
33
|
-
toolOutput?: any;
|
|
34
|
-
}>;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ,CAAC;YACf,UAAU,EAAE;gBAAC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;aAAC,CAAC;YACvC,QAAQ,EAAE,MAAM,EAAE,CAAA;SACnB,CAAA;KACF,CAAA;CACF,CAAA;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AASD,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAA2B;IAExC,GAAG,CACC,IAAI,EAAE,QAAQ,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC;IAa1C,UAAU,IAAI,gBAAgB,EAAE;IAe1B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;CAKtC;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,GAAG,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAC,CAAC,CAwB5K"}
|
package/lib/typescript/tts.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { LlamaContext } from './index';
|
|
2
|
-
import type { NativeAudioDecodeResult, NativeTTSType } from './index';
|
|
3
|
-
export interface TTSOptions {
|
|
4
|
-
voiceId?: string;
|
|
5
|
-
speed?: number;
|
|
6
|
-
pitch?: number;
|
|
7
|
-
volume?: number;
|
|
8
|
-
format?: 'wav' | 'mp3' | 'ogg';
|
|
9
|
-
sampleRate?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface TTSGenerationResult extends NativeAudioDecodeResult {
|
|
12
|
-
metadata?: {
|
|
13
|
-
duration?: number;
|
|
14
|
-
sampleRate?: number;
|
|
15
|
-
channels?: number;
|
|
16
|
-
format?: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface TTSSpeaker {
|
|
20
|
-
id: string;
|
|
21
|
-
name?: string;
|
|
22
|
-
language?: string;
|
|
23
|
-
gender?: 'male' | 'female' | 'neutral';
|
|
24
|
-
config: Record<string, any>;
|
|
25
|
-
}
|
|
26
|
-
export declare class TTSError extends Error {
|
|
27
|
-
code?: string | undefined;
|
|
28
|
-
contextId?: number | undefined;
|
|
29
|
-
constructor(message: string, code?: string | undefined, contextId?: number | undefined);
|
|
30
|
-
}
|
|
31
|
-
export declare class CactusTTS {
|
|
32
|
-
private context;
|
|
33
|
-
private isInitialized;
|
|
34
|
-
private isReleased;
|
|
35
|
-
private vocoderPath?;
|
|
36
|
-
private ttsType?;
|
|
37
|
-
private constructor();
|
|
38
|
-
static init(context: LlamaContext, vocoderModelPath: string): Promise<CactusTTS>;
|
|
39
|
-
generate(textToSpeak: string, speaker: TTSSpeaker | string, options?: TTSOptions): Promise<TTSGenerationResult>;
|
|
40
|
-
isVocoderReady(): Promise<boolean>;
|
|
41
|
-
getTTSType(): NativeTTSType | undefined;
|
|
42
|
-
getContextId(): number;
|
|
43
|
-
getVocoderPath(): string | undefined;
|
|
44
|
-
isReady(): boolean;
|
|
45
|
-
static createSpeaker(id: string, config: Record<string, any>, metadata?: {
|
|
46
|
-
name?: string;
|
|
47
|
-
language?: string;
|
|
48
|
-
gender?: 'male' | 'female' | 'neutral';
|
|
49
|
-
}): TTSSpeaker;
|
|
50
|
-
private validateState;
|
|
51
|
-
private validateInputs;
|
|
52
|
-
release(): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=tts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tts.d.ts","sourceRoot":"","sources":["../../src/tts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAOb,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAErE,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,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c,IAAI,OAAO,CAAC,OAAO,CAAC;IAaxC,UAAU,IAAI,aAAa,GAAG,SAAS;IAKvC,YAAY,IAAI,MAAM;IAItB,cAAc,IAAI,MAAM,GAAG,SAAS;IAKpC,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,aAAa,CAClB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;KACvC,GACA,UAAU;IASb,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,cAAc;IAmBhB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB/B"}
|
package/lib/typescript/vlm.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type ContextParams, type CompletionParams, type CactusOAICompatibleMessage, type NativeCompletionResult } from './index';
|
|
2
|
-
import { ConversationHistoryManager } from './chat';
|
|
3
|
-
interface CactusVLMReturn {
|
|
4
|
-
vlm: CactusVLM | null;
|
|
5
|
-
error: Error | null;
|
|
6
|
-
}
|
|
7
|
-
export type VLMContextParams = ContextParams & {
|
|
8
|
-
mmproj: string;
|
|
9
|
-
};
|
|
10
|
-
export type VLMCompletionParams = Omit<CompletionParams, 'prompt'> & {
|
|
11
|
-
images?: string[];
|
|
12
|
-
mode?: string;
|
|
13
|
-
};
|
|
14
|
-
export declare class CactusVLM {
|
|
15
|
-
private context;
|
|
16
|
-
protected conversationHistoryManager: ConversationHistoryManager;
|
|
17
|
-
private static _initCache;
|
|
18
|
-
private static getCacheKey;
|
|
19
|
-
private constructor();
|
|
20
|
-
static init(params: VLMContextParams, onProgress?: (progress: number) => void, cactusToken?: string, retryOptions?: {
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
delayMs?: number;
|
|
23
|
-
}): Promise<CactusVLMReturn>;
|
|
24
|
-
completion(messages: CactusOAICompatibleMessage[], params?: VLMCompletionParams, callback?: (data: any) => void): Promise<NativeCompletionResult>;
|
|
25
|
-
private _handleLocalCompletion;
|
|
26
|
-
private _handleRemoteCompletion;
|
|
27
|
-
rewind(): Promise<void>;
|
|
28
|
-
release(): Promise<void>;
|
|
29
|
-
stopCompletion(): Promise<void>;
|
|
30
|
-
isJinjaSupported(): boolean;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=vlm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vlm.d.ts","sourceRoot":"","sources":["../../src/vlm.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,SAAS,CAAA;AAIhB,OAAO,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAA;AAEnD,UAAU,eAAe;IACvB,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAc;IAC7B,SAAS,CAAC,0BAA0B,EAAE,0BAA0B,CAAA;IAEhE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAoD;IAE7E,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO;WAKM,IAAI,CACf,MAAM,EAAE,gBAAgB,EACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACvC,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACvD,OAAO,CAAC,eAAe,CAAC;IA8ErB,UAAU,CACd,QAAQ,EAAE,0BAA0B,EAAE,EACtC,MAAM,GAAE,mBAAwB,EAChC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAuClC,OAAO,CAAC,sBAAsB,CAyC7B;YAEa,uBAAuB;IA+C/B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,gBAAgB,IAAI,OAAO;CAG5B"}
|
package/scripts/postInstall.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const crypto = require('crypto');
|
|
4
|
-
|
|
5
|
-
const projectRoot = process.env.INIT_CWD;
|
|
6
|
-
|
|
7
|
-
if (!projectRoot || projectRoot === process.cwd()) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const rootIdPath = path.join(projectRoot, '.projectId.json');
|
|
12
|
-
const internalIdPath = path.join(__dirname, '..', 'src', 'projectId.ts');
|
|
13
|
-
|
|
14
|
-
let projectId;
|
|
15
|
-
try {
|
|
16
|
-
if (fs.existsSync(rootIdPath)) {
|
|
17
|
-
projectId = JSON.parse(fs.readFileSync(rootIdPath, 'utf8'));
|
|
18
|
-
} else {
|
|
19
|
-
projectId = crypto.randomUUID();
|
|
20
|
-
fs.writeFileSync(rootIdPath, JSON.stringify(projectId), 'utf8');
|
|
21
|
-
}
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.error('Failed to read or create project ID.', error);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const fileContent = `// DO NOT EDIT. This file is automatically generated by a post-install script.\nexport const PROJECT_ID = '${projectId}';`;
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
fs.writeFileSync(internalIdPath, fileContent, 'utf8');
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error('Failed to sync project ID into the framework.', error);
|
|
33
|
-
}
|