cactus-react-native 1.4.0 → 1.7.0
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 +1 -1
- package/README.md +465 -174
- package/android/CMakeLists.txt +24 -5
- package/android/src/main/jniLibs/arm64-v8a/libcactus.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcurl.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedcrypto.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedtls.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedx509.a +0 -0
- package/cpp/HybridCactus.cpp +157 -6
- package/cpp/HybridCactus.hpp +20 -3
- package/cpp/cactus_ffi.h +65 -30
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +0 -1
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +65 -30
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_utils.h +357 -122
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +184 -63
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +153 -27
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +90 -178
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +276 -151
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +0 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +65 -30
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_utils.h +357 -122
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +184 -63
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/gemma_tools.h +549 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +153 -27
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +90 -178
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +276 -151
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/lib/module/classes/CactusLM.js +43 -58
- package/lib/module/classes/CactusLM.js.map +1 -1
- package/lib/module/classes/CactusSTT.js +64 -38
- package/lib/module/classes/CactusSTT.js.map +1 -1
- package/lib/module/classes/CactusVAD.js +95 -0
- package/lib/module/classes/CactusVAD.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +23 -15
- package/lib/module/hooks/useCactusLM.js.map +1 -1
- package/lib/module/hooks/useCactusSTT.js +85 -28
- package/lib/module/hooks/useCactusSTT.js.map +1 -1
- package/lib/module/hooks/useCactusVAD.js +171 -0
- package/lib/module/hooks/useCactusVAD.js.map +1 -0
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/modelRegistry.js +52 -0
- package/lib/module/modelRegistry.js.map +1 -0
- package/lib/module/native/Cactus.js +107 -8
- package/lib/module/native/Cactus.js.map +1 -1
- package/lib/module/native/CactusIndex.js.map +1 -1
- package/lib/module/native/index.js +0 -3
- package/lib/module/native/index.js.map +1 -1
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusSTT.js +2 -0
- package/lib/module/types/CactusVAD.js +4 -0
- package/lib/module/types/{CactusModel.js.map → CactusVAD.js.map} +1 -1
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/{CactusSTTModel.js.map → common.js.map} +1 -1
- package/lib/typescript/src/classes/CactusLM.d.ts +8 -6
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusSTT.d.ts +11 -6
- package/lib/typescript/src/classes/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusVAD.d.ts +20 -0
- package/lib/typescript/src/classes/CactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +3 -3
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusSTT.d.ts +11 -5
- package/lib/typescript/src/hooks/useCactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusVAD.d.ts +15 -0
- package/lib/typescript/src/hooks/useCactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/modelRegistry.d.ts +5 -0
- package/lib/typescript/src/modelRegistry.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +12 -6
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -1
- package/lib/typescript/src/native/CactusIndex.d.ts +2 -2
- package/lib/typescript/src/native/CactusIndex.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +0 -3
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +6 -1
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusIndex.d.ts +2 -2
- package/lib/typescript/src/types/CactusIndex.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusLM.d.ts +19 -9
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusSTT.d.ts +45 -4
- package/lib/typescript/src/types/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusVAD.d.ts +34 -0
- package/lib/typescript/src/types/CactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/types/common.d.ts +23 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -0
- package/nitro.json +0 -11
- package/nitrogen/generated/android/cactus+autolinking.cmake +0 -5
- package/nitrogen/generated/android/cactusOnLoad.cpp +0 -30
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +0 -50
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +9 -147
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +0 -13
- package/nitrogen/generated/ios/CactusAutolinking.mm +0 -26
- package/nitrogen/generated/ios/CactusAutolinking.swift +0 -30
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +5 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +6 -1
- package/package.json +3 -3
- package/src/classes/CactusLM.ts +59 -74
- package/src/classes/CactusSTT.ts +92 -49
- package/src/classes/CactusVAD.ts +129 -0
- package/src/hooks/useCactusLM.ts +26 -9
- package/src/hooks/useCactusSTT.ts +105 -44
- package/src/hooks/useCactusVAD.ts +215 -0
- package/src/index.tsx +20 -10
- package/src/modelRegistry.ts +65 -0
- package/src/native/Cactus.ts +130 -14
- package/src/native/CactusIndex.ts +2 -2
- package/src/native/index.ts +0 -3
- package/src/specs/Cactus.nitro.ts +11 -2
- package/src/types/CactusIndex.ts +2 -2
- package/src/types/CactusLM.ts +20 -9
- package/src/types/CactusSTT.ts +50 -4
- package/src/types/CactusVAD.ts +39 -0
- package/src/types/common.ts +23 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +0 -46
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +0 -27
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.a +0 -0
- package/cpp/HybridCactusUtil.cpp +0 -47
- package/cpp/HybridCactusUtil.hpp +0 -27
- package/cpp/cactus_util.h +0 -25
- package/ios/HybridCactusCrypto.swift +0 -37
- package/ios/HybridCactusDeviceInfo.swift +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_telemetry.h +0 -656
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_telemetry.h +0 -656
- package/ios/cactus_util.xcframework/Info.plist +0 -39
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/database.h +0 -27
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +0 -10
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +0 -25
- 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 +0 -25
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/database.h +0 -27
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +0 -10
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/_CodeSignature/CodeResources +0 -135
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +0 -137
- package/lib/module/api/Database.js.map +0 -1
- package/lib/module/api/RemoteLM.js +0 -201
- package/lib/module/api/RemoteLM.js.map +0 -1
- package/lib/module/config/CactusConfig.js +0 -12
- package/lib/module/config/CactusConfig.js.map +0 -1
- package/lib/module/native/CactusCrypto.js +0 -10
- package/lib/module/native/CactusCrypto.js.map +0 -1
- package/lib/module/native/CactusDeviceInfo.js +0 -13
- package/lib/module/native/CactusDeviceInfo.js.map +0 -1
- package/lib/module/native/CactusUtil.js +0 -36
- package/lib/module/native/CactusUtil.js.map +0 -1
- package/lib/module/specs/CactusCrypto.nitro.js +0 -4
- package/lib/module/specs/CactusCrypto.nitro.js.map +0 -1
- package/lib/module/specs/CactusDeviceInfo.nitro.js +0 -4
- package/lib/module/specs/CactusDeviceInfo.nitro.js.map +0 -1
- package/lib/module/specs/CactusUtil.nitro.js +0 -4
- package/lib/module/specs/CactusUtil.nitro.js.map +0 -1
- package/lib/module/telemetry/Telemetry.js +0 -154
- package/lib/module/telemetry/Telemetry.js.map +0 -1
- package/lib/module/types/CactusModel.js +0 -2
- package/lib/module/types/CactusSTTModel.js +0 -2
- package/lib/typescript/src/api/Database.d.ts +0 -18
- package/lib/typescript/src/api/Database.d.ts.map +0 -1
- package/lib/typescript/src/api/RemoteLM.d.ts +0 -14
- package/lib/typescript/src/api/RemoteLM.d.ts.map +0 -1
- package/lib/typescript/src/config/CactusConfig.d.ts +0 -7
- package/lib/typescript/src/config/CactusConfig.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusCrypto.d.ts +0 -5
- package/lib/typescript/src/native/CactusCrypto.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts +0 -7
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusUtil.d.ts +0 -6
- package/lib/typescript/src/native/CactusUtil.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +0 -8
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +0 -16
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +0 -10
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +0 -1
- package/lib/typescript/src/telemetry/Telemetry.d.ts +0 -34
- package/lib/typescript/src/telemetry/Telemetry.d.ts.map +0 -1
- package/lib/typescript/src/types/CactusModel.d.ts +0 -13
- package/lib/typescript/src/types/CactusModel.d.ts.map +0 -1
- package/lib/typescript/src/types/CactusSTTModel.d.ts +0 -8
- package/lib/typescript/src/types/CactusSTTModel.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +0 -74
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +0 -65
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +0 -65
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +0 -85
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +0 -66
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +0 -50
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +0 -58
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +0 -62
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +0 -77
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +0 -88
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +0 -98
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +0 -54
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +0 -57
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +0 -139
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +0 -164
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +0 -92
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +0 -21
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +0 -63
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +0 -22
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +0 -67
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +0 -23
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +0 -66
- package/src/api/Database.ts +0 -188
- package/src/api/RemoteLM.ts +0 -273
- package/src/config/CactusConfig.ts +0 -11
- package/src/native/CactusCrypto.ts +0 -11
- package/src/native/CactusDeviceInfo.ts +0 -18
- package/src/native/CactusUtil.ts +0 -43
- package/src/specs/CactusCrypto.nitro.ts +0 -6
- package/src/specs/CactusDeviceInfo.nitro.ts +0 -15
- package/src/specs/CactusUtil.nitro.ts +0 -8
- package/src/telemetry/Telemetry.ts +0 -236
- package/src/types/CactusModel.ts +0 -15
- package/src/types/CactusSTTModel.ts +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CactusConfig","CactusImage","RemoteLM","completionsUrl","defaultModel","complete","messages","options","tools","callback","cactusToken","Error","payload","JSON","stringify","model","transformMessages","temperature","top_p","topP","top_k","topK","max_tokens","maxTokens","stop","stopSequences","stream","streamXHR","nonStreamFetch","getMimeType","filePath","extension","toLowerCase","split","pop","transformedMessages","message","content","push","type","text","images","image","imagePath","replace","mimeType","base64Data","base64","image_url","url","role","Promise","resolve","reject","xhr","XMLHttpRequest","timeout","ontimeout","open","setRequestHeader","startTime","performance","now","lastIndex","buffer","response","toolCalls","timeToFirstTokenMs","prefillTokens","decodeTokens","totalTokens","onprogress","chunk","responseText","substring","length","lines","line","startsWith","jsonStr","slice","trim","data","parse","toolCallChunks","choices","delta","tool_calls","toolCallChunk","index","name","arguments","function","usage","prompt_tokens","completion_tokens","total_tokens","onload","totalTimeMs","functionCalls","map","toolCall","success","tokensPerSecond","onerror","send","request","fetch","method","headers","body","ok","json"],"sourceRoot":"../../../src","sources":["api/RemoteLM.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,2BAAwB;AACrD,SAASC,WAAW,QAAQ,0BAAuB;AAQnD,OAAO,MAAMC,QAAQ,CAAC;EACpB,OA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E,EAAE;MACf,MAAM,IAAIpG,KAAK,CAAC,0BAA0B,CAAC;IAC7C;IAEA,MAAMuE,IAAI,GAAG,MAAMwB,OAAO,CAACM,IAAI,CAAC,CAAC;IAEjC,MAAMd,WAAW,GAAGrC,WAAW,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS;IACjD,MAAMS,YAAY,GAAGa,IAAI,CAACW,KAAK,CAACE,iBAAiB;IAEjD,MAAM7B,SASO,GAAGgB,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,CAACjD,OAAO,CAACmD,UAAU;IAElD,MAAMY,aAAa,GAAGjC,SAAS,EAAEkC,GAAG,CAAEC,QAAQ,KAAM;MAClDX,IAAI,EAAEW,QAAQ,CAACT,QAAQ,CAACF,IAAI;MAC5BC,SAAS,EAAEU,QAAQ,CAACT,QAAQ,CAACD;IAC/B,CAAC,CAAC,CAAC;IAEH,OAAO;MACLW,OAAO,EAAE,IAAI;MACbrC,QAAQ,EAAEiB,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,CAACjD,OAAO,CAACC,OAAO;MACzC8D,aAAa;MACbhC,kBAAkB,EAAE+B,WAAW;MAC/BA,WAAW;MACXK,eAAe,EAAGlC,YAAY,GAAG,IAAI,GAAI6B,WAAW;MACpD9B,aAAa,EAAEc,IAAI,CAACW,KAAK,CAACC,aAAa;MACvCzB,YAAY;MACZC,WAAW,EAAEY,IAAI,CAACW,KAAK,CAACG;IAC1B,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CactusConfig","isTelemetryEnabled"],"sourceRoot":"../../../src","sources":["config/CactusConfig.ts"],"mappings":";;AAAA,OAAO,MAAMA,YAAY,CAAC;EACxB;;EAEA,OAAcC,kBAAkB,GAAY,IAAI;;EAEhD;;EAGA;AAEF","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
-
export class CactusCrypto {
|
|
5
|
-
static hybridCactusCrypto = NitroModules.createHybridObject('CactusCrypto');
|
|
6
|
-
static uuidv5(namespaceUuid, name) {
|
|
7
|
-
return this.hybridCactusCrypto.uuidv5(namespaceUuid, name);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=CactusCrypto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","CactusCrypto","hybridCactusCrypto","createHybridObject","uuidv5","namespaceUuid","name"],"sourceRoot":"../../../src","sources":["native/CactusCrypto.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,OAAO,MAAMC,YAAY,CAAC;EACxB,OAAwBC,kBAAkB,GACxCF,YAAY,CAACG,kBAAkB,CAAmB,cAAc,CAAC;EAEnE,OAAcC,MAAMA,CAACC,aAAqB,EAAEC,IAAY,EAAmB;IACzE,OAAO,IAAI,CAACJ,kBAAkB,CAACE,MAAM,CAACC,aAAa,EAAEC,IAAI,CAAC;EAC5D;AACF","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
-
export class CactusDeviceInfo {
|
|
5
|
-
static hybridCactusDeviceInfo = NitroModules.createHybridObject('CactusDeviceInfo');
|
|
6
|
-
static getAppIdentifier() {
|
|
7
|
-
return this.hybridCactusDeviceInfo.getAppIdentifier();
|
|
8
|
-
}
|
|
9
|
-
static getDeviceInfo() {
|
|
10
|
-
return this.hybridCactusDeviceInfo.getDeviceInfo();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=CactusDeviceInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","CactusDeviceInfo","hybridCactusDeviceInfo","createHybridObject","getAppIdentifier","getDeviceInfo"],"sourceRoot":"../../../src","sources":["native/CactusDeviceInfo.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAMzD,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAwBC,sBAAsB,GAC5CF,YAAY,CAACG,kBAAkB,CAAuB,kBAAkB,CAAC;EAE3E,OAAcC,gBAAgBA,CAAA,EAAgC;IAC5D,OAAO,IAAI,CAACF,sBAAsB,CAACE,gBAAgB,CAAC,CAAC;EACvD;EAEA,OAAcC,aAAaA,CAAA,EAAwB;IACjD,OAAO,IAAI,CAACH,sBAAsB,CAACG,aAAa,CAAC,CAAC;EACpD;AACF","ignoreList":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
-
import { Platform } from 'react-native';
|
|
5
|
-
import { CactusFileSystem } from "./CactusFileSystem.js";
|
|
6
|
-
import { CactusConfig } from "../config/CactusConfig.js";
|
|
7
|
-
import { Database } from "../api/Database.js";
|
|
8
|
-
export class CactusUtil {
|
|
9
|
-
static hybridCactusUtil = NitroModules.createHybridObject('CactusUtil');
|
|
10
|
-
static async registerApp(encryptedData) {
|
|
11
|
-
if (Platform.OS === 'android') {
|
|
12
|
-
const cactusDirectory = await CactusFileSystem.getCactusDirectory();
|
|
13
|
-
await this.hybridCactusUtil.setAndroidDataDirectory(cactusDirectory);
|
|
14
|
-
}
|
|
15
|
-
return this.hybridCactusUtil.registerApp(encryptedData);
|
|
16
|
-
}
|
|
17
|
-
static async getDeviceId() {
|
|
18
|
-
if (Platform.OS === 'android') {
|
|
19
|
-
const cactusDirectory = await CactusFileSystem.getCactusDirectory();
|
|
20
|
-
await this.hybridCactusUtil.setAndroidDataDirectory(cactusDirectory);
|
|
21
|
-
}
|
|
22
|
-
const deviceId = await this.hybridCactusUtil.getDeviceId(CactusConfig.cactusProKey);
|
|
23
|
-
if (!deviceId) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
if (deviceId?.indexOf('|') !== -1) {
|
|
27
|
-
const parts = deviceId.split('|');
|
|
28
|
-
CactusConfig.cactusProKey = parts[1];
|
|
29
|
-
return await Database.registerDevice({
|
|
30
|
-
deviceId: parts[0]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return deviceId;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=CactusUtil.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","Platform","CactusFileSystem","CactusConfig","Database","CactusUtil","hybridCactusUtil","createHybridObject","registerApp","encryptedData","OS","cactusDirectory","getCactusDirectory","setAndroidDataDirectory","getDeviceId","deviceId","cactusProKey","indexOf","parts","split","registerDevice"],"sourceRoot":"../../../src","sources":["native/CactusUtil.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,YAAY,QAAQ,2BAAwB;AACrD,SAASC,QAAQ,QAAQ,oBAAiB;AAE1C,OAAO,MAAMC,UAAU,CAAC;EACtB,OAAwBC,gBAAgB,GACtCN,YAAY,CAACO,kBAAkB,CAAiB,YAAY,CAAC;EAE/D,aAAoBC,WAAWA,CAACC,aAAqB,EAAmB;IACtE,IAAIR,QAAQ,CAACS,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMC,eAAe,GAAG,MAAMT,gBAAgB,CAACU,kBAAkB,CAAC,CAAC;MACnE,MAAM,IAAI,CAACN,gBAAgB,CAACO,uBAAuB,CAACF,eAAe,CAAC;IACtE;IAEA,OAAO,IAAI,CAACL,gBAAgB,CAACE,WAAW,CAACC,aAAa,CAAC;EACzD;EAEA,aAAoBK,WAAWA,CAAA,EAA2B;IACxD,IAAIb,QAAQ,CAACS,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMC,eAAe,GAAG,MAAMT,gBAAgB,CAACU,kBAAkB,CAAC,CAAC;MACnE,MAAM,IAAI,CAACN,gBAAgB,CAACO,uBAAuB,CAACF,eAAe,CAAC;IACtE;IAEA,MAAMI,QAAQ,GAAG,MAAM,IAAI,CAACT,gBAAgB,CAACQ,WAAW,CACtDX,YAAY,CAACa,YACf,CAAC;IAED,IAAI,CAACD,QAAQ,EAAE;MACb,OAAO,IAAI;IACb;IAEA,IAAIA,QAAQ,EAAEE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;MACjC,MAAMC,KAAK,GAAGH,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;MACjChB,YAAY,CAACa,YAAY,GAAGE,KAAK,CAAC,CAAC,CAAC;MACpC,OAAO,MAAMd,QAAQ,CAACgB,cAAc,CAAC;QAAEL,QAAQ,EAAEG,KAAK,CAAC,CAAC;MAAE,CAAC,CAAC;IAC9D;IAEA,OAAOH,QAAQ;EACjB;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/CactusCrypto.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/CactusDeviceInfo.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/CactusUtil.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Database } from "../api/Database.js";
|
|
4
|
-
import { CactusCrypto, CactusDeviceInfo, CactusFileSystem, CactusUtil } from "../native/index.js";
|
|
5
|
-
import { CactusConfig } from "../config/CactusConfig.js";
|
|
6
|
-
import { packageVersion } from "../constants/packageVersion.js";
|
|
7
|
-
export class Telemetry {
|
|
8
|
-
static namespaceUrl = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
9
|
-
static logBufferPaths = {
|
|
10
|
-
init: 'logs/init.json',
|
|
11
|
-
completion: 'logs/completion.json',
|
|
12
|
-
transcription: 'logs/transcription.json',
|
|
13
|
-
embedding: 'logs/embedding.json',
|
|
14
|
-
image_embedding: 'logs/image_embedding.json',
|
|
15
|
-
audio_embedding: 'logs/audio_embedding.json'
|
|
16
|
-
};
|
|
17
|
-
static async handleLog(logRecord) {
|
|
18
|
-
if (!this.isInitialized()) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (!CactusConfig.isTelemetryEnabled) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const logBufferPath = this.logBufferPaths[logRecord.event_type];
|
|
25
|
-
let logs = [];
|
|
26
|
-
if (await CactusFileSystem.fileExists(logBufferPath)) {
|
|
27
|
-
try {
|
|
28
|
-
logs = JSON.parse(await CactusFileSystem.readFile(logBufferPath));
|
|
29
|
-
} catch {
|
|
30
|
-
// Delete corrupted log buffer
|
|
31
|
-
await CactusFileSystem.deleteFile(logBufferPath);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
logs.push(logRecord);
|
|
35
|
-
try {
|
|
36
|
-
await Database.sendLogRecords(logs);
|
|
37
|
-
if (await CactusFileSystem.fileExists(logBufferPath)) {
|
|
38
|
-
await CactusFileSystem.deleteFile(logBufferPath);
|
|
39
|
-
}
|
|
40
|
-
} catch {
|
|
41
|
-
await CactusFileSystem.writeFile(logBufferPath, JSON.stringify(logs));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
static isInitialized() {
|
|
45
|
-
return !!(this.projectId && this.deviceId);
|
|
46
|
-
}
|
|
47
|
-
static async init(cactusTelemetryToken) {
|
|
48
|
-
if (this.isInitialized()) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (!CactusConfig.isTelemetryEnabled) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.cactusTelemetryToken = cactusTelemetryToken;
|
|
55
|
-
const appIdentifier = await CactusDeviceInfo.getAppIdentifier();
|
|
56
|
-
const name = `https://cactus-react-native/${appIdentifier}/v1`;
|
|
57
|
-
this.projectId = await CactusCrypto.uuidv5(this.namespaceUrl, name);
|
|
58
|
-
const deviceInfo = await CactusDeviceInfo.getDeviceInfo();
|
|
59
|
-
try {
|
|
60
|
-
this.deviceId = (await CactusUtil.getDeviceId()) ?? (await Database.registerDevice({
|
|
61
|
-
deviceData: deviceInfo
|
|
62
|
-
}));
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.log(error);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static logInit(model, success, message) {
|
|
68
|
-
return this.handleLog({
|
|
69
|
-
framework: 'react-native',
|
|
70
|
-
framework_version: packageVersion,
|
|
71
|
-
event_type: 'init',
|
|
72
|
-
model,
|
|
73
|
-
success,
|
|
74
|
-
message,
|
|
75
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
76
|
-
project_id: this.projectId,
|
|
77
|
-
device_id: this.deviceId
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
static logCompletion(model, success, message, result) {
|
|
81
|
-
return this.handleLog({
|
|
82
|
-
framework: 'react-native',
|
|
83
|
-
framework_version: packageVersion,
|
|
84
|
-
event_type: 'completion',
|
|
85
|
-
model,
|
|
86
|
-
success,
|
|
87
|
-
message,
|
|
88
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
89
|
-
project_id: this.projectId,
|
|
90
|
-
device_id: this.deviceId,
|
|
91
|
-
tokens: result?.totalTokens,
|
|
92
|
-
response_time: result?.totalTimeMs,
|
|
93
|
-
ttft: result?.timeToFirstTokenMs,
|
|
94
|
-
tps: result?.tokensPerSecond
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
static logTranscribe(model, success, message, result) {
|
|
98
|
-
return this.handleLog({
|
|
99
|
-
framework: 'react-native',
|
|
100
|
-
framework_version: packageVersion,
|
|
101
|
-
event_type: 'transcription',
|
|
102
|
-
model,
|
|
103
|
-
success,
|
|
104
|
-
message,
|
|
105
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
106
|
-
project_id: this.projectId,
|
|
107
|
-
device_id: this.deviceId,
|
|
108
|
-
tokens: result?.totalTokens,
|
|
109
|
-
response_time: result?.totalTimeMs,
|
|
110
|
-
ttft: result?.timeToFirstTokenMs,
|
|
111
|
-
tps: result?.tokensPerSecond
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
static logEmbedding(model, success, message) {
|
|
115
|
-
return this.handleLog({
|
|
116
|
-
framework: 'react-native',
|
|
117
|
-
framework_version: packageVersion,
|
|
118
|
-
event_type: 'embedding',
|
|
119
|
-
model,
|
|
120
|
-
success,
|
|
121
|
-
message,
|
|
122
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
123
|
-
project_id: this.projectId,
|
|
124
|
-
device_id: this.deviceId
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
static logImageEmbedding(model, success, message) {
|
|
128
|
-
return this.handleLog({
|
|
129
|
-
framework: 'react-native',
|
|
130
|
-
framework_version: packageVersion,
|
|
131
|
-
event_type: 'image_embedding',
|
|
132
|
-
model,
|
|
133
|
-
success,
|
|
134
|
-
message,
|
|
135
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
136
|
-
project_id: this.projectId,
|
|
137
|
-
device_id: this.deviceId
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
static logAudioEmbedding(model, success, message) {
|
|
141
|
-
return this.handleLog({
|
|
142
|
-
framework: 'react-native',
|
|
143
|
-
framework_version: packageVersion,
|
|
144
|
-
event_type: 'audio_embedding',
|
|
145
|
-
model,
|
|
146
|
-
success,
|
|
147
|
-
message,
|
|
148
|
-
telemetry_token: this.cactusTelemetryToken,
|
|
149
|
-
project_id: this.projectId,
|
|
150
|
-
device_id: this.deviceId
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=Telemetry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Database","CactusCrypto","CactusDeviceInfo","CactusFileSystem","CactusUtil","CactusConfig","packageVersion","Telemetry","namespaceUrl","logBufferPaths","init","completion","transcription","embedding","image_embedding","audio_embedding","handleLog","logRecord","isInitialized","isTelemetryEnabled","logBufferPath","event_type","logs","fileExists","JSON","parse","readFile","deleteFile","push","sendLogRecords","writeFile","stringify","projectId","deviceId","cactusTelemetryToken","appIdentifier","getAppIdentifier","name","uuidv5","deviceInfo","getDeviceInfo","getDeviceId","registerDevice","deviceData","error","console","log","logInit","model","success","message","framework","framework_version","telemetry_token","project_id","device_id","logCompletion","result","tokens","totalTokens","response_time","totalTimeMs","ttft","timeToFirstTokenMs","tps","tokensPerSecond","logTranscribe","logEmbedding","logImageEmbedding","logAudioEmbedding"],"sourceRoot":"../../../src","sources":["telemetry/Telemetry.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,oBAAiB;AAC1C,SACEC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,UAAU,QACL,oBAAW;AAClB,SAASC,YAAY,QAAQ,2BAAwB;AACrD,SAASC,cAAc,QAAQ,gCAA6B;AAiC5D,OAAO,MAAMC,SAAS,CAAC;EAKrB,OAAwBC,YAAY,GAAG,sCAAsC;EAC7E,OAAwBC,cAAc,GAAG;IACvCC,IAAI,EAAE,gBAAgB;IACtBC,UAAU,EAAE,sBAAsB;IAClCC,aAAa,EAAE,yBAAyB;IACxCC,SAAS,EAAE,qBAAqB;IAChCC,eAAe,EAAE,2BAA2B;IAC5CC,eAAe,EAAE;EACnB,CAAC;EAED,aAAqBC,SAASA,CAACC,SAAoB,EAAE;IACnD,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,CAAC,EAAE;MACzB;IACF;IAEA,IAAI,CAACb,YAAY,CAACc,kBAAkB,EAAE;MACpC;IACF;IAEA,MAAMC,aAAa,GAAG,IAAI,CAACX,cAAc,CAACQ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1BuB,SAAS,EAAE,IAAI,CAACtB;IAClB,CAAC,CAAC;EACJ;EAEA,OAAcoC,iBAAiBA,CAC7BrB,KAAa,EACbC,OAAgB,EAChBC,OAAgB,EACD;IACf,OAAO,IAAI,CAAClC,SAAS,CAAC;MACpBmC,SAAS,EAAE,cAAc;MACzBC,iBAAiB,EAAE9C,cAAc;MACjCe,UAAU,EAAE,iBAAiB;MAC7B2B,KAAK;MACLC,OAAO;MACPC,OAAO;MACPG,eAAe,EAAE,IAAI,CAACnB,oBAAoB;MAC1CoB,UAAU,EAAE,IAAI,CAACtB,SAAS;MAC1BuB,SAAS,EAAE,IAAI,CAACtB;IAClB,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DeviceInfo } from '../specs/CactusDeviceInfo.nitro';
|
|
2
|
-
import type { LogRecord } from '../telemetry/Telemetry';
|
|
3
|
-
import type { CactusModel } from '../types/CactusModel';
|
|
4
|
-
import type { CactusSTTModel } from '../types/CactusSTTModel';
|
|
5
|
-
export declare class Database {
|
|
6
|
-
private static readonly url;
|
|
7
|
-
private static readonly key;
|
|
8
|
-
static sendLogRecords(records: LogRecord[]): Promise<void>;
|
|
9
|
-
static registerDevice({ deviceData, deviceId, }: {
|
|
10
|
-
deviceData?: DeviceInfo;
|
|
11
|
-
deviceId?: string;
|
|
12
|
-
}): Promise<string>;
|
|
13
|
-
static getModel(slug: string): Promise<CactusModel>;
|
|
14
|
-
static getSTTModel(slug: string): Promise<CactusSTTModel>;
|
|
15
|
-
static getModels(): Promise<CactusModel[]>;
|
|
16
|
-
static getSTTModels(): Promise<CactusSTTModel[]>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Database.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["../../../../src/api/Database.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAsB9D,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAA8C;IACzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAC0L;WAEjM,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;WAkBnD,cAAc,CAAC,EACjC,UAAU,EACV,QAAQ,GACT,EAAE;QACD,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC;WAqBC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;WA4B5C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;WA+BlD,SAAS,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;WA4BnC,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;CAuB9D"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CactusLMCompleteResult, Message, CompleteOptions, Tool } from '../types/CactusLM';
|
|
2
|
-
export declare class RemoteLM {
|
|
3
|
-
private static readonly completionsUrl;
|
|
4
|
-
private static readonly defaultModel;
|
|
5
|
-
static complete(messages: Message[], options?: CompleteOptions, tools?: {
|
|
6
|
-
type: 'function';
|
|
7
|
-
function: Tool;
|
|
8
|
-
}[], callback?: (token: string) => void): Promise<CactusLMCompleteResult>;
|
|
9
|
-
private static getMimeType;
|
|
10
|
-
private static transformMessages;
|
|
11
|
-
private static streamXHR;
|
|
12
|
-
private static nonStreamFetch;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=RemoteLM.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteLM.d.ts","sourceRoot":"","sources":["../../../../src/api/RemoteLM.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,OAAO,EACP,eAAe,EACf,IAAI,EACL,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CACY;IAElD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkC;WAElD,QAAQ,CAC1B,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,eAAe,EACzB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,EAAE,EAC9C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GACjC,OAAO,CAAC,sBAAsB,CAAC;IAsBlC,OAAO,CAAC,MAAM,CAAC,WAAW;mBAiBL,iBAAiB;IAsCtC,OAAO,CAAC,MAAM,CAAC,SAAS;mBA0HH,cAAc;CAqDpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusConfig.d.ts","sourceRoot":"","sources":["../../../../src/config/CactusConfig.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IAEvB,OAAc,cAAc,CAAC,EAAE,MAAM,CAAC;IACtC,OAAc,kBAAkB,EAAE,OAAO,CAAQ;IAGjD,OAAc,WAAW,CAAC,EAAE,MAAM,CAAC;IAGnC,OAAc,YAAY,CAAC,EAAE,MAAM,CAAC;CACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusCrypto.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusCrypto.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAC0B;WAEtD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG3E"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DeviceInfo } from '../specs/CactusDeviceInfo.nitro';
|
|
2
|
-
export declare class CactusDeviceInfo {
|
|
3
|
-
private static readonly hybridCactusDeviceInfo;
|
|
4
|
-
static getAppIdentifier(): Promise<string | undefined>;
|
|
5
|
-
static getDeviceInfo(): Promise<DeviceInfo>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=CactusDeviceInfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusDeviceInfo.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusDeviceInfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAC8B;WAE9D,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;WAI/C,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;CAGnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusUtil.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusUtil.ts"],"names":[],"mappings":"AAOA,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CACwB;WAE5C,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WASnD,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAsB1D"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface CactusCrypto extends HybridObject<{
|
|
3
|
-
ios: 'swift';
|
|
4
|
-
android: 'kotlin';
|
|
5
|
-
}> {
|
|
6
|
-
uuidv5(namespaceUuid: string, name: string): Promise<string>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=CactusCrypto.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusCrypto.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusCrypto.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,YACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface DeviceInfo {
|
|
3
|
-
brand: string;
|
|
4
|
-
model: string;
|
|
5
|
-
device_id?: string;
|
|
6
|
-
os: string;
|
|
7
|
-
os_version: string;
|
|
8
|
-
}
|
|
9
|
-
export interface CactusDeviceInfo extends HybridObject<{
|
|
10
|
-
ios: 'swift';
|
|
11
|
-
android: 'kotlin';
|
|
12
|
-
}> {
|
|
13
|
-
getAppIdentifier(): Promise<string | undefined>;
|
|
14
|
-
getDeviceInfo(): Promise<DeviceInfo>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=CactusDeviceInfo.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusDeviceInfo.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusDeviceInfo.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface CactusUtil extends HybridObject<{
|
|
3
|
-
ios: 'c++';
|
|
4
|
-
android: 'c++';
|
|
5
|
-
}> {
|
|
6
|
-
registerApp(encryptedData: string): Promise<string>;
|
|
7
|
-
getDeviceId(token?: string): Promise<string | null>;
|
|
8
|
-
setAndroidDataDirectory(dataDir: string): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=CactusUtil.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusUtil.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusUtil.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CactusLMCompleteResult } from '../types/CactusLM';
|
|
2
|
-
import type { CactusSTTTranscribeResult } from '../types/CactusSTT';
|
|
3
|
-
export interface LogRecord {
|
|
4
|
-
framework: 'react-native';
|
|
5
|
-
framework_version: string;
|
|
6
|
-
event_type: 'init' | 'completion' | 'transcription' | 'embedding' | 'image_embedding' | 'audio_embedding';
|
|
7
|
-
model: string;
|
|
8
|
-
success: boolean;
|
|
9
|
-
message?: string;
|
|
10
|
-
telemetry_token?: string;
|
|
11
|
-
project_id?: string;
|
|
12
|
-
device_id?: string;
|
|
13
|
-
tokens?: number;
|
|
14
|
-
response_time?: number;
|
|
15
|
-
ttft?: number;
|
|
16
|
-
tps?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare class Telemetry {
|
|
19
|
-
private static cactusTelemetryToken?;
|
|
20
|
-
private static projectId?;
|
|
21
|
-
private static deviceId?;
|
|
22
|
-
private static readonly namespaceUrl;
|
|
23
|
-
private static readonly logBufferPaths;
|
|
24
|
-
private static handleLog;
|
|
25
|
-
static isInitialized(): boolean;
|
|
26
|
-
static init(cactusTelemetryToken?: string): Promise<void>;
|
|
27
|
-
static logInit(model: string, success: boolean, message?: string): Promise<void>;
|
|
28
|
-
static logCompletion(model: string, success: boolean, message?: string, result?: CactusLMCompleteResult): Promise<void>;
|
|
29
|
-
static logTranscribe(model: string, success: boolean, message?: string, result?: CactusSTTTranscribeResult): Promise<void>;
|
|
30
|
-
static logEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
31
|
-
static logImageEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
32
|
-
static logAudioEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=Telemetry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Telem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;WAcF,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC;WAkBF,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC;WAkBF,YAAY,CACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;WAcF,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;WAcF,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;CAajB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CactusModel {
|
|
2
|
-
name: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
quantization: number;
|
|
5
|
-
sizeMb: number;
|
|
6
|
-
downloadUrl: string;
|
|
7
|
-
supportsToolCalling: boolean;
|
|
8
|
-
supportsVision: boolean;
|
|
9
|
-
supportsCompletion: boolean;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
isDownloaded: boolean;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=CactusModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusSTTModel.d.ts","sourceRoot":"","sources":["../../../../src/types/CactusSTTModel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAE7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAGhB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JDeviceInfo.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "DeviceInfo.hpp"
|
|
12
|
-
|
|
13
|
-
#include <optional>
|
|
14
|
-
#include <string>
|
|
15
|
-
|
|
16
|
-
namespace margelo::nitro::cactus {
|
|
17
|
-
|
|
18
|
-
using namespace facebook;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "DeviceInfo" and the the Kotlin data class "DeviceInfo".
|
|
22
|
-
*/
|
|
23
|
-
struct JDeviceInfo final: public jni::JavaClass<JDeviceInfo> {
|
|
24
|
-
public:
|
|
25
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cactus/DeviceInfo;";
|
|
26
|
-
|
|
27
|
-
public:
|
|
28
|
-
/**
|
|
29
|
-
* Convert this Java/Kotlin-based struct to the C++ struct DeviceInfo by copying all values to C++.
|
|
30
|
-
*/
|
|
31
|
-
[[maybe_unused]]
|
|
32
|
-
[[nodiscard]]
|
|
33
|
-
DeviceInfo toCpp() const {
|
|
34
|
-
static const auto clazz = javaClassStatic();
|
|
35
|
-
static const auto fieldBrand = clazz->getField<jni::JString>("brand");
|
|
36
|
-
jni::local_ref<jni::JString> brand = this->getFieldValue(fieldBrand);
|
|
37
|
-
static const auto fieldModel = clazz->getField<jni::JString>("model");
|
|
38
|
-
jni::local_ref<jni::JString> model = this->getFieldValue(fieldModel);
|
|
39
|
-
static const auto fieldDevice_id = clazz->getField<jni::JString>("device_id");
|
|
40
|
-
jni::local_ref<jni::JString> device_id = this->getFieldValue(fieldDevice_id);
|
|
41
|
-
static const auto fieldOs = clazz->getField<jni::JString>("os");
|
|
42
|
-
jni::local_ref<jni::JString> os = this->getFieldValue(fieldOs);
|
|
43
|
-
static const auto fieldOs_version = clazz->getField<jni::JString>("os_version");
|
|
44
|
-
jni::local_ref<jni::JString> os_version = this->getFieldValue(fieldOs_version);
|
|
45
|
-
return DeviceInfo(
|
|
46
|
-
brand->toStdString(),
|
|
47
|
-
model->toStdString(),
|
|
48
|
-
device_id != nullptr ? std::make_optional(device_id->toStdString()) : std::nullopt,
|
|
49
|
-
os->toStdString(),
|
|
50
|
-
os_version->toStdString()
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
/**
|
|
56
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
57
|
-
*/
|
|
58
|
-
[[maybe_unused]]
|
|
59
|
-
static jni::local_ref<JDeviceInfo::javaobject> fromCpp(const DeviceInfo& value) {
|
|
60
|
-
using JSignature = JDeviceInfo(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
61
|
-
static const auto clazz = javaClassStatic();
|
|
62
|
-
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
63
|
-
return create(
|
|
64
|
-
clazz,
|
|
65
|
-
jni::make_jstring(value.brand),
|
|
66
|
-
jni::make_jstring(value.model),
|
|
67
|
-
value.device_id.has_value() ? jni::make_jstring(value.device_id.value()) : nullptr,
|
|
68
|
-
jni::make_jstring(value.os),
|
|
69
|
-
jni::make_jstring(value.os_version)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
} // namespace margelo::nitro::cactus
|