cactus-react-native 0.2.11 → 1.0.2
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 +550 -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.so → libcactus.a} +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/cpp/HybridCactus.cpp +135 -0
- package/cpp/HybridCactus.hpp +42 -0
- package/cpp/HybridCactusUtil.cpp +47 -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 +545 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +275 -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 +545 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +275 -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 +151 -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 +238 -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 +26 -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 +67 -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 +205 -0
- package/src/config/CactusConfig.ts +4 -0
- package/src/constants/packageVersion.ts +1 -0
- package/src/hooks/useCactusLM.ts +285 -0
- package/src/index.tsx +23 -0
- package/src/native/Cactus.ts +83 -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 +20 -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 +73 -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_2.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod.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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CactusAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "Cactus-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridCactus.hpp"
|
|
14
|
+
#include "HybridCactusUtil.hpp"
|
|
15
|
+
#include "HybridCactusFileSystemSpecSwift.hpp"
|
|
16
|
+
#include "HybridCactusCryptoSpecSwift.hpp"
|
|
17
|
+
#include "HybridCactusDeviceInfoSpecSwift.hpp"
|
|
18
|
+
|
|
19
|
+
@interface CactusAutolinking : NSObject
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
@implementation CactusAutolinking
|
|
23
|
+
|
|
24
|
+
+ (void) load {
|
|
25
|
+
using namespace margelo::nitro;
|
|
26
|
+
using namespace margelo::nitro::cactus;
|
|
27
|
+
|
|
28
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
29
|
+
"Cactus",
|
|
30
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
31
|
+
static_assert(std::is_default_constructible_v<HybridCactus>,
|
|
32
|
+
"The HybridObject \"HybridCactus\" is not default-constructible! "
|
|
33
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
34
|
+
return std::make_shared<HybridCactus>();
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
38
|
+
"CactusUtil",
|
|
39
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
40
|
+
static_assert(std::is_default_constructible_v<HybridCactusUtil>,
|
|
41
|
+
"The HybridObject \"HybridCactusUtil\" is not default-constructible! "
|
|
42
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
43
|
+
return std::make_shared<HybridCactusUtil>();
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
47
|
+
"CactusFileSystem",
|
|
48
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
49
|
+
std::shared_ptr<HybridCactusFileSystemSpec> hybridObject = Cactus::CactusAutolinking::createCactusFileSystem();
|
|
50
|
+
return hybridObject;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
54
|
+
"CactusCrypto",
|
|
55
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
56
|
+
std::shared_ptr<HybridCactusCryptoSpec> hybridObject = Cactus::CactusAutolinking::createCactusCrypto();
|
|
57
|
+
return hybridObject;
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
61
|
+
"CactusDeviceInfo",
|
|
62
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
63
|
+
std::shared_ptr<HybridCactusDeviceInfoSpec> hybridObject = Cactus::CactusAutolinking::createCactusDeviceInfo();
|
|
64
|
+
return hybridObject;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CactusAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
public final class CactusAutolinking {
|
|
9
|
+
public typealias bridge = margelo.nitro.cactus.bridge.swift
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a Swift class that implements `HybridCactusFileSystemSpec`,
|
|
13
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridCactusFileSystemSpec_cxx`)
|
|
14
|
+
*
|
|
15
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridCactusFileSystem`).
|
|
17
|
+
*/
|
|
18
|
+
public static func createCactusFileSystem() -> bridge.std__shared_ptr_HybridCactusFileSystemSpec_ {
|
|
19
|
+
let hybridObject = HybridCactusFileSystem()
|
|
20
|
+
return { () -> bridge.std__shared_ptr_HybridCactusFileSystemSpec_ in
|
|
21
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
+
return __cxxWrapped.getCxxPart()
|
|
23
|
+
}()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates an instance of a Swift class that implements `HybridCactusCryptoSpec`,
|
|
28
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridCactusCryptoSpec_cxx`)
|
|
29
|
+
*
|
|
30
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
31
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridCactusCrypto`).
|
|
32
|
+
*/
|
|
33
|
+
public static func createCactusCrypto() -> bridge.std__shared_ptr_HybridCactusCryptoSpec_ {
|
|
34
|
+
let hybridObject = HybridCactusCrypto()
|
|
35
|
+
return { () -> bridge.std__shared_ptr_HybridCactusCryptoSpec_ in
|
|
36
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
37
|
+
return __cxxWrapped.getCxxPart()
|
|
38
|
+
}()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of a Swift class that implements `HybridCactusDeviceInfoSpec`,
|
|
43
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridCactusDeviceInfoSpec_cxx`)
|
|
44
|
+
*
|
|
45
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
46
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `HybridCactusDeviceInfo`).
|
|
47
|
+
*/
|
|
48
|
+
public static func createCactusDeviceInfo() -> bridge.std__shared_ptr_HybridCactusDeviceInfoSpec_ {
|
|
49
|
+
let hybridObject = HybridCactusDeviceInfo()
|
|
50
|
+
return { () -> bridge.std__shared_ptr_HybridCactusDeviceInfoSpec_ in
|
|
51
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
52
|
+
return __cxxWrapped.getCxxPart()
|
|
53
|
+
}()
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusCryptoSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridCactusCryptoSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::cactus {
|
|
11
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusCryptoSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridCactusCryptoSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridCactusCryptoSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace Cactus { class HybridCactusCryptoSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <NitroModules/Promise.hpp>
|
|
19
|
+
|
|
20
|
+
#include "Cactus-Swift-Cxx-Umbrella.hpp"
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::cactus {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ part of HybridCactusCryptoSpec_cxx.swift.
|
|
26
|
+
*
|
|
27
|
+
* HybridCactusCryptoSpecSwift (C++) accesses HybridCactusCryptoSpec_cxx (Swift), and might
|
|
28
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
29
|
+
*
|
|
30
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
31
|
+
* the future, HybridCactusCryptoSpec_cxx can directly inherit from the C++ class HybridCactusCryptoSpec
|
|
32
|
+
* to simplify the whole structure and memory management.
|
|
33
|
+
*/
|
|
34
|
+
class HybridCactusCryptoSpecSwift: public virtual HybridCactusCryptoSpec {
|
|
35
|
+
public:
|
|
36
|
+
// Constructor from a Swift instance
|
|
37
|
+
explicit HybridCactusCryptoSpecSwift(const Cactus::HybridCactusCryptoSpec_cxx& swiftPart):
|
|
38
|
+
HybridObject(HybridCactusCryptoSpec::TAG),
|
|
39
|
+
_swiftPart(swiftPart) { }
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
// Get the Swift part
|
|
43
|
+
inline Cactus::HybridCactusCryptoSpec_cxx& getSwiftPart() noexcept {
|
|
44
|
+
return _swiftPart;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
49
|
+
return _swiftPart.getMemorySize();
|
|
50
|
+
}
|
|
51
|
+
void dispose() noexcept override {
|
|
52
|
+
_swiftPart.dispose();
|
|
53
|
+
}
|
|
54
|
+
std::string toString() override {
|
|
55
|
+
return _swiftPart.toString();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
// Properties
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
// Methods
|
|
64
|
+
inline std::shared_ptr<Promise<std::string>> uuidv5(const std::string& namespaceUuid, const std::string& name) override {
|
|
65
|
+
auto __result = _swiftPart.uuidv5(namespaceUuid, name);
|
|
66
|
+
if (__result.hasError()) [[unlikely]] {
|
|
67
|
+
std::rethrow_exception(__result.error());
|
|
68
|
+
}
|
|
69
|
+
auto __value = std::move(__result.value());
|
|
70
|
+
return __value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
Cactus::HybridCactusCryptoSpec_cxx _swiftPart;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusDeviceInfoSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridCactusDeviceInfoSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::cactus {
|
|
11
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusDeviceInfoSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridCactusDeviceInfoSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridCactusDeviceInfoSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace Cactus { class HybridCactusDeviceInfoSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `DeviceInfo` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::cactus { struct DeviceInfo; }
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include <NitroModules/Promise.hpp>
|
|
21
|
+
#include "DeviceInfo.hpp"
|
|
22
|
+
|
|
23
|
+
#include "Cactus-Swift-Cxx-Umbrella.hpp"
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::cactus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ part of HybridCactusDeviceInfoSpec_cxx.swift.
|
|
29
|
+
*
|
|
30
|
+
* HybridCactusDeviceInfoSpecSwift (C++) accesses HybridCactusDeviceInfoSpec_cxx (Swift), and might
|
|
31
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
32
|
+
*
|
|
33
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
34
|
+
* the future, HybridCactusDeviceInfoSpec_cxx can directly inherit from the C++ class HybridCactusDeviceInfoSpec
|
|
35
|
+
* to simplify the whole structure and memory management.
|
|
36
|
+
*/
|
|
37
|
+
class HybridCactusDeviceInfoSpecSwift: public virtual HybridCactusDeviceInfoSpec {
|
|
38
|
+
public:
|
|
39
|
+
// Constructor from a Swift instance
|
|
40
|
+
explicit HybridCactusDeviceInfoSpecSwift(const Cactus::HybridCactusDeviceInfoSpec_cxx& swiftPart):
|
|
41
|
+
HybridObject(HybridCactusDeviceInfoSpec::TAG),
|
|
42
|
+
_swiftPart(swiftPart) { }
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
// Get the Swift part
|
|
46
|
+
inline Cactus::HybridCactusDeviceInfoSpec_cxx& getSwiftPart() noexcept {
|
|
47
|
+
return _swiftPart;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
52
|
+
return _swiftPart.getMemorySize();
|
|
53
|
+
}
|
|
54
|
+
void dispose() noexcept override {
|
|
55
|
+
_swiftPart.dispose();
|
|
56
|
+
}
|
|
57
|
+
std::string toString() override {
|
|
58
|
+
return _swiftPart.toString();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
// Properties
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
// Methods
|
|
67
|
+
inline std::shared_ptr<Promise<std::optional<std::string>>> getAppIdentifier() override {
|
|
68
|
+
auto __result = _swiftPart.getAppIdentifier();
|
|
69
|
+
if (__result.hasError()) [[unlikely]] {
|
|
70
|
+
std::rethrow_exception(__result.error());
|
|
71
|
+
}
|
|
72
|
+
auto __value = std::move(__result.value());
|
|
73
|
+
return __value;
|
|
74
|
+
}
|
|
75
|
+
inline std::shared_ptr<Promise<DeviceInfo>> getDeviceInfo() override {
|
|
76
|
+
auto __result = _swiftPart.getDeviceInfo();
|
|
77
|
+
if (__result.hasError()) [[unlikely]] {
|
|
78
|
+
std::rethrow_exception(__result.error());
|
|
79
|
+
}
|
|
80
|
+
auto __value = std::move(__result.value());
|
|
81
|
+
return __value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private:
|
|
85
|
+
Cactus::HybridCactusDeviceInfoSpec_cxx _swiftPart;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusFileSystemSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridCactusFileSystemSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::cactus {
|
|
11
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCactusFileSystemSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridCactusFileSystemSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridCactusFileSystemSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace Cactus { class HybridCactusFileSystemSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <NitroModules/Promise.hpp>
|
|
19
|
+
#include <functional>
|
|
20
|
+
#include <optional>
|
|
21
|
+
|
|
22
|
+
#include "Cactus-Swift-Cxx-Umbrella.hpp"
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::cactus {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The C++ part of HybridCactusFileSystemSpec_cxx.swift.
|
|
28
|
+
*
|
|
29
|
+
* HybridCactusFileSystemSpecSwift (C++) accesses HybridCactusFileSystemSpec_cxx (Swift), and might
|
|
30
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
31
|
+
*
|
|
32
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
33
|
+
* the future, HybridCactusFileSystemSpec_cxx can directly inherit from the C++ class HybridCactusFileSystemSpec
|
|
34
|
+
* to simplify the whole structure and memory management.
|
|
35
|
+
*/
|
|
36
|
+
class HybridCactusFileSystemSpecSwift: public virtual HybridCactusFileSystemSpec {
|
|
37
|
+
public:
|
|
38
|
+
// Constructor from a Swift instance
|
|
39
|
+
explicit HybridCactusFileSystemSpecSwift(const Cactus::HybridCactusFileSystemSpec_cxx& swiftPart):
|
|
40
|
+
HybridObject(HybridCactusFileSystemSpec::TAG),
|
|
41
|
+
_swiftPart(swiftPart) { }
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
// Get the Swift part
|
|
45
|
+
inline Cactus::HybridCactusFileSystemSpec_cxx& getSwiftPart() noexcept {
|
|
46
|
+
return _swiftPart;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
51
|
+
return _swiftPart.getMemorySize();
|
|
52
|
+
}
|
|
53
|
+
void dispose() noexcept override {
|
|
54
|
+
_swiftPart.dispose();
|
|
55
|
+
}
|
|
56
|
+
std::string toString() override {
|
|
57
|
+
return _swiftPart.toString();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
// Properties
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
// Methods
|
|
66
|
+
inline std::shared_ptr<Promise<std::string>> getCactusDirectory() override {
|
|
67
|
+
auto __result = _swiftPart.getCactusDirectory();
|
|
68
|
+
if (__result.hasError()) [[unlikely]] {
|
|
69
|
+
std::rethrow_exception(__result.error());
|
|
70
|
+
}
|
|
71
|
+
auto __value = std::move(__result.value());
|
|
72
|
+
return __value;
|
|
73
|
+
}
|
|
74
|
+
inline std::shared_ptr<Promise<bool>> fileExists(const std::string& path) override {
|
|
75
|
+
auto __result = _swiftPart.fileExists(path);
|
|
76
|
+
if (__result.hasError()) [[unlikely]] {
|
|
77
|
+
std::rethrow_exception(__result.error());
|
|
78
|
+
}
|
|
79
|
+
auto __value = std::move(__result.value());
|
|
80
|
+
return __value;
|
|
81
|
+
}
|
|
82
|
+
inline std::shared_ptr<Promise<void>> writeFile(const std::string& path, const std::string& content) override {
|
|
83
|
+
auto __result = _swiftPart.writeFile(path, content);
|
|
84
|
+
if (__result.hasError()) [[unlikely]] {
|
|
85
|
+
std::rethrow_exception(__result.error());
|
|
86
|
+
}
|
|
87
|
+
auto __value = std::move(__result.value());
|
|
88
|
+
return __value;
|
|
89
|
+
}
|
|
90
|
+
inline std::shared_ptr<Promise<std::string>> readFile(const std::string& path) override {
|
|
91
|
+
auto __result = _swiftPart.readFile(path);
|
|
92
|
+
if (__result.hasError()) [[unlikely]] {
|
|
93
|
+
std::rethrow_exception(__result.error());
|
|
94
|
+
}
|
|
95
|
+
auto __value = std::move(__result.value());
|
|
96
|
+
return __value;
|
|
97
|
+
}
|
|
98
|
+
inline std::shared_ptr<Promise<void>> deleteFile(const std::string& path) override {
|
|
99
|
+
auto __result = _swiftPart.deleteFile(path);
|
|
100
|
+
if (__result.hasError()) [[unlikely]] {
|
|
101
|
+
std::rethrow_exception(__result.error());
|
|
102
|
+
}
|
|
103
|
+
auto __value = std::move(__result.value());
|
|
104
|
+
return __value;
|
|
105
|
+
}
|
|
106
|
+
inline std::shared_ptr<Promise<bool>> modelExists(const std::string& model) override {
|
|
107
|
+
auto __result = _swiftPart.modelExists(model);
|
|
108
|
+
if (__result.hasError()) [[unlikely]] {
|
|
109
|
+
std::rethrow_exception(__result.error());
|
|
110
|
+
}
|
|
111
|
+
auto __value = std::move(__result.value());
|
|
112
|
+
return __value;
|
|
113
|
+
}
|
|
114
|
+
inline std::shared_ptr<Promise<std::string>> getModelPath(const std::string& model) override {
|
|
115
|
+
auto __result = _swiftPart.getModelPath(model);
|
|
116
|
+
if (__result.hasError()) [[unlikely]] {
|
|
117
|
+
std::rethrow_exception(__result.error());
|
|
118
|
+
}
|
|
119
|
+
auto __value = std::move(__result.value());
|
|
120
|
+
return __value;
|
|
121
|
+
}
|
|
122
|
+
inline std::shared_ptr<Promise<void>> downloadModel(const std::string& model, const std::string& from, const std::optional<std::function<void(double /* progress */)>>& callback) override {
|
|
123
|
+
auto __result = _swiftPart.downloadModel(model, from, callback);
|
|
124
|
+
if (__result.hasError()) [[unlikely]] {
|
|
125
|
+
std::rethrow_exception(__result.error());
|
|
126
|
+
}
|
|
127
|
+
auto __value = std::move(__result.value());
|
|
128
|
+
return __value;
|
|
129
|
+
}
|
|
130
|
+
inline std::shared_ptr<Promise<void>> deleteModel(const std::string& model) override {
|
|
131
|
+
auto __result = _swiftPart.deleteModel(model);
|
|
132
|
+
if (__result.hasError()) [[unlikely]] {
|
|
133
|
+
std::rethrow_exception(__result.error());
|
|
134
|
+
}
|
|
135
|
+
auto __value = std::move(__result.value());
|
|
136
|
+
return __value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private:
|
|
140
|
+
Cactus::HybridCactusFileSystemSpec_cxx _swiftPart;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
} // namespace margelo::nitro::cactus
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// DeviceInfo.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `DeviceInfo`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias DeviceInfo = margelo.nitro.cactus.DeviceInfo
|
|
14
|
+
|
|
15
|
+
public extension DeviceInfo {
|
|
16
|
+
private typealias bridge = margelo.nitro.cactus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `DeviceInfo`.
|
|
20
|
+
*/
|
|
21
|
+
init(brand: String, model: String, device_id: String?, os: String, os_version: String) {
|
|
22
|
+
self.init(std.string(brand), std.string(model), { () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = device_id {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), std.string(os), std.string(os_version))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var brand: String {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return String(self.__brand)
|
|
35
|
+
}
|
|
36
|
+
@inline(__always)
|
|
37
|
+
set {
|
|
38
|
+
self.__brand = std.string(newValue)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var model: String {
|
|
43
|
+
@inline(__always)
|
|
44
|
+
get {
|
|
45
|
+
return String(self.__model)
|
|
46
|
+
}
|
|
47
|
+
@inline(__always)
|
|
48
|
+
set {
|
|
49
|
+
self.__model = std.string(newValue)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var device_id: String? {
|
|
54
|
+
@inline(__always)
|
|
55
|
+
get {
|
|
56
|
+
return { () -> String? in
|
|
57
|
+
if bridge.has_value_std__optional_std__string_(self.__device_id) {
|
|
58
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__device_id)
|
|
59
|
+
return String(__unwrapped)
|
|
60
|
+
} else {
|
|
61
|
+
return nil
|
|
62
|
+
}
|
|
63
|
+
}()
|
|
64
|
+
}
|
|
65
|
+
@inline(__always)
|
|
66
|
+
set {
|
|
67
|
+
self.__device_id = { () -> bridge.std__optional_std__string_ in
|
|
68
|
+
if let __unwrappedValue = newValue {
|
|
69
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
70
|
+
} else {
|
|
71
|
+
return .init()
|
|
72
|
+
}
|
|
73
|
+
}()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var os: String {
|
|
78
|
+
@inline(__always)
|
|
79
|
+
get {
|
|
80
|
+
return String(self.__os)
|
|
81
|
+
}
|
|
82
|
+
@inline(__always)
|
|
83
|
+
set {
|
|
84
|
+
self.__os = std.string(newValue)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var os_version: String {
|
|
89
|
+
@inline(__always)
|
|
90
|
+
get {
|
|
91
|
+
return String(self.__os_version)
|
|
92
|
+
}
|
|
93
|
+
@inline(__always)
|
|
94
|
+
set {
|
|
95
|
+
self.__os_version = std.string(newValue)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `() -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void {
|
|
16
|
+
public typealias bridge = margelo.nitro.cactus.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: () -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping () -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call() -> Void {
|
|
26
|
+
self.closure()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
45
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_DeviceInfo.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: DeviceInfo) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_DeviceInfo {
|
|
16
|
+
public typealias bridge = margelo.nitro.cactus.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: DeviceInfo) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: DeviceInfo) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: DeviceInfo) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_DeviceInfo`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_DeviceInfo>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_DeviceInfo {
|
|
45
|
+
return Unmanaged<Func_void_DeviceInfo>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|