@runanywhere/core 0.16.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/RunAnywhereCore.podspec +130 -0
- package/android/CMakeLists.txt +92 -0
- package/android/build.gradle +321 -0
- package/android/consumer-rules.pro +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +271 -0
- package/android/src/main/include/rac/backends/rac_llm_llamacpp.h +218 -0
- package/android/src/main/include/rac/backends/rac_stt_onnx.h +99 -0
- package/android/src/main/include/rac/backends/rac_stt_whispercpp.h +153 -0
- package/android/src/main/include/rac/backends/rac_tts_onnx.h +71 -0
- package/android/src/main/include/rac/backends/rac_vad_onnx.h +84 -0
- package/android/src/main/include/rac/core/capabilities/rac_lifecycle.h +290 -0
- package/android/src/main/include/rac/core/rac_analytics_events.h +610 -0
- package/android/src/main/include/rac/core/rac_audio_utils.h +88 -0
- package/android/src/main/include/rac/core/rac_component_types.h +160 -0
- package/android/src/main/include/rac/core/rac_core.h +331 -0
- package/android/src/main/include/rac/core/rac_error.h +469 -0
- package/android/src/main/include/rac/core/rac_events.h +334 -0
- package/android/src/main/include/rac/core/rac_logger.h +416 -0
- package/android/src/main/include/rac/core/rac_platform_adapter.h +340 -0
- package/android/src/main/include/rac/core/rac_sdk_state.h +292 -0
- package/android/src/main/include/rac/core/rac_structured_error.h +594 -0
- package/android/src/main/include/rac/core/rac_types.h +264 -0
- package/android/src/main/include/rac/features/llm/rac_llm.h +17 -0
- package/android/src/main/include/rac/features/llm/rac_llm_analytics.h +188 -0
- package/android/src/main/include/rac/features/llm/rac_llm_component.h +228 -0
- package/android/src/main/include/rac/features/llm/rac_llm_events.h +215 -0
- package/android/src/main/include/rac/features/llm/rac_llm_metrics.h +402 -0
- package/android/src/main/include/rac/features/llm/rac_llm_service.h +163 -0
- package/android/src/main/include/rac/features/llm/rac_llm_structured_output.h +141 -0
- package/android/src/main/include/rac/features/llm/rac_llm_types.h +384 -0
- package/android/src/main/include/rac/features/platform/rac_llm_platform.h +204 -0
- package/android/src/main/include/rac/features/platform/rac_tts_platform.h +197 -0
- package/android/src/main/include/rac/features/stt/rac_stt.h +17 -0
- package/android/src/main/include/rac/features/stt/rac_stt_analytics.h +204 -0
- package/android/src/main/include/rac/features/stt/rac_stt_component.h +162 -0
- package/android/src/main/include/rac/features/stt/rac_stt_events.h +62 -0
- package/android/src/main/include/rac/features/stt/rac_stt_service.h +154 -0
- package/android/src/main/include/rac/features/stt/rac_stt_types.h +389 -0
- package/android/src/main/include/rac/features/tts/rac_tts.h +17 -0
- package/android/src/main/include/rac/features/tts/rac_tts_analytics.h +181 -0
- package/android/src/main/include/rac/features/tts/rac_tts_component.h +158 -0
- package/android/src/main/include/rac/features/tts/rac_tts_events.h +54 -0
- package/android/src/main/include/rac/features/tts/rac_tts_service.h +162 -0
- package/android/src/main/include/rac/features/tts/rac_tts_types.h +374 -0
- package/android/src/main/include/rac/features/vad/rac_vad.h +17 -0
- package/android/src/main/include/rac/features/vad/rac_vad_analytics.h +236 -0
- package/android/src/main/include/rac/features/vad/rac_vad_component.h +185 -0
- package/android/src/main/include/rac/features/vad/rac_vad_energy.h +443 -0
- package/android/src/main/include/rac/features/vad/rac_vad_events.h +76 -0
- package/android/src/main/include/rac/features/vad/rac_vad_service.h +167 -0
- package/android/src/main/include/rac/features/vad/rac_vad_types.h +244 -0
- package/android/src/main/include/rac/features/voice_agent/rac_voice_agent.h +612 -0
- package/android/src/main/include/rac/infrastructure/device/rac_device_manager.h +176 -0
- package/android/src/main/include/rac/infrastructure/download/rac_download.h +418 -0
- package/android/src/main/include/rac/infrastructure/events/rac_events.h +177 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_assignment.h +169 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_paths.h +258 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_registry.h +357 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_strategy.h +374 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_types.h +613 -0
- package/android/src/main/include/rac/infrastructure/network/rac_api_types.h +335 -0
- package/android/src/main/include/rac/infrastructure/network/rac_auth_manager.h +252 -0
- package/android/src/main/include/rac/infrastructure/network/rac_dev_config.h +85 -0
- package/android/src/main/include/rac/infrastructure/network/rac_endpoints.h +102 -0
- package/android/src/main/include/rac/infrastructure/network/rac_environment.h +220 -0
- package/android/src/main/include/rac/infrastructure/network/rac_http_client.h +233 -0
- package/android/src/main/include/rac/infrastructure/storage/rac_storage_analyzer.h +286 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_manager.h +206 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_types.h +234 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/ArchiveUtility.kt +308 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfo.kt +229 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/PlatformAdapterBridge.kt +392 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/RunAnywhereCorePackage.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SDKLogger.kt +357 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SecureStorageManager.kt +147 -0
- package/android/src/main/jniLibs/arm64-v8a/libc++_shared.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libomp.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librac_commons.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librunanywhere_jni.so +0 -0
- package/cpp/HybridRunAnywhereCore.cpp +2505 -0
- package/cpp/HybridRunAnywhereCore.hpp +271 -0
- package/cpp/bridges/AuthBridge.cpp +209 -0
- package/cpp/bridges/AuthBridge.hpp +157 -0
- package/cpp/bridges/DeviceBridge.cpp +257 -0
- package/cpp/bridges/DeviceBridge.hpp +155 -0
- package/cpp/bridges/DownloadBridge.cpp +299 -0
- package/cpp/bridges/DownloadBridge.hpp +197 -0
- package/cpp/bridges/EventBridge.cpp +125 -0
- package/cpp/bridges/EventBridge.hpp +139 -0
- package/cpp/bridges/HTTPBridge.cpp +96 -0
- package/cpp/bridges/HTTPBridge.hpp +144 -0
- package/cpp/bridges/InitBridge.cpp +1273 -0
- package/cpp/bridges/InitBridge.hpp +306 -0
- package/cpp/bridges/ModelRegistryBridge.cpp +394 -0
- package/cpp/bridges/ModelRegistryBridge.hpp +177 -0
- package/cpp/bridges/StorageBridge.cpp +269 -0
- package/cpp/bridges/StorageBridge.hpp +172 -0
- package/cpp/bridges/TelemetryBridge.cpp +352 -0
- package/cpp/bridges/TelemetryBridge.hpp +126 -0
- package/ios/.testlocal +0 -0
- package/ios/ArchiveUtility.swift +526 -0
- package/ios/ArchiveUtilityBridge.m +52 -0
- package/ios/AudioDecoder.h +38 -0
- package/ios/AudioDecoder.m +162 -0
- package/ios/Binaries/RACommons.xcframework/Info.plist +44 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/RACommons +0 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons +0 -0
- package/ios/HybridRunAnywhereDeviceInfo.swift +214 -0
- package/ios/KeychainManager.swift +116 -0
- package/ios/PlatformAdapter.swift +100 -0
- package/ios/PlatformAdapterBridge.h +152 -0
- package/ios/PlatformAdapterBridge.m +570 -0
- package/ios/RNSDKLoggerBridge.h +41 -0
- package/ios/RNSDKLoggerBridge.m +66 -0
- package/ios/SDKLogger.swift +329 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.cpp +257 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.hpp +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfoSpec.kt +106 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/runanywherecoreOnLoad.kt +35 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.cmake +82 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.gradle +27 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.cpp +54 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/RunAnywhereCore+autolinking.rb +60 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.cpp +65 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.hpp +197 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Umbrella.hpp +45 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.mm +43 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.hpp +173 -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__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec.swift +68 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec_cxx.swift +366 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp +92 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +138 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.hpp +75 -0
- package/package.json +76 -0
- package/react-native.config.js +14 -0
- package/src/Features/VoiceSession/AudioCaptureManager.ts +286 -0
- package/src/Features/VoiceSession/AudioPlaybackManager.ts +300 -0
- package/src/Features/VoiceSession/VoiceSessionHandle.ts +530 -0
- package/src/Features/VoiceSession/index.ts +20 -0
- package/src/Features/index.ts +7 -0
- package/src/Foundation/Constants/SDKConstants.ts +47 -0
- package/src/Foundation/Constants/index.ts +8 -0
- package/src/Foundation/DependencyInjection/ServiceContainer.ts +154 -0
- package/src/Foundation/DependencyInjection/ServiceRegistry.ts +51 -0
- package/src/Foundation/DependencyInjection/index.ts +6 -0
- package/src/Foundation/ErrorTypes/ErrorCategory.ts +184 -0
- package/src/Foundation/ErrorTypes/ErrorCodes.ts +151 -0
- package/src/Foundation/ErrorTypes/ErrorContext.ts +201 -0
- package/src/Foundation/ErrorTypes/SDKError.ts +507 -0
- package/src/Foundation/ErrorTypes/index.ts +57 -0
- package/src/Foundation/Initialization/InitializationPhase.ts +85 -0
- package/src/Foundation/Initialization/InitializationState.ts +168 -0
- package/src/Foundation/Initialization/index.ts +26 -0
- package/src/Foundation/Logging/Destinations/NativeLogBridge.ts +147 -0
- package/src/Foundation/Logging/Destinations/SentryDestination.ts +209 -0
- package/src/Foundation/Logging/Logger/SDKLogger.ts +232 -0
- package/src/Foundation/Logging/Models/LogLevel.ts +36 -0
- package/src/Foundation/Logging/Models/LoggingConfiguration.ts +117 -0
- package/src/Foundation/Logging/Services/LoggingManager.ts +407 -0
- package/src/Foundation/Logging/index.ts +59 -0
- package/src/Foundation/Security/DeviceIdentity.ts +92 -0
- package/src/Foundation/Security/SecureStorageError.ts +132 -0
- package/src/Foundation/Security/SecureStorageKeys.ts +35 -0
- package/src/Foundation/Security/SecureStorageService.ts +449 -0
- package/src/Foundation/Security/index.ts +17 -0
- package/src/Foundation/index.ts +26 -0
- package/src/Infrastructure/Events/EventPublisher.ts +165 -0
- package/src/Infrastructure/Events/SDKEvent.ts +214 -0
- package/src/Infrastructure/Events/index.ts +15 -0
- package/src/Infrastructure/index.ts +9 -0
- package/src/Public/Events/EventBus.ts +488 -0
- package/src/Public/Events/index.ts +8 -0
- package/src/Public/Extensions/RunAnywhere+Logging.ts +51 -0
- package/src/Public/Extensions/RunAnywhere+Models.ts +392 -0
- package/src/Public/Extensions/RunAnywhere+STT.ts +424 -0
- package/src/Public/Extensions/RunAnywhere+Storage.ts +151 -0
- package/src/Public/Extensions/RunAnywhere+StructuredOutput.ts +316 -0
- package/src/Public/Extensions/RunAnywhere+TTS.ts +430 -0
- package/src/Public/Extensions/RunAnywhere+TextGeneration.ts +320 -0
- package/src/Public/Extensions/RunAnywhere+VAD.ts +359 -0
- package/src/Public/Extensions/RunAnywhere+VoiceAgent.ts +225 -0
- package/src/Public/Extensions/RunAnywhere+VoiceSession.ts +155 -0
- package/src/Public/Extensions/index.ts +126 -0
- package/src/Public/RunAnywhere.ts +695 -0
- package/src/index.ts +238 -0
- package/src/native/NativeRunAnywhereCore.ts +291 -0
- package/src/native/NativeRunAnywhereModule.ts +32 -0
- package/src/native/index.ts +21 -0
- package/src/services/DownloadService.ts +282 -0
- package/src/services/FileSystem.ts +810 -0
- package/src/services/ModelRegistry.ts +246 -0
- package/src/services/Network/APIEndpoints.ts +84 -0
- package/src/services/Network/HTTPService.ts +479 -0
- package/src/services/Network/NetworkConfiguration.ts +130 -0
- package/src/services/Network/TelemetryService.ts +318 -0
- package/src/services/Network/index.ts +29 -0
- package/src/services/SystemTTSService.ts +130 -0
- package/src/services/index.ts +66 -0
- package/src/specs/RunAnywhereCore.nitro.ts +627 -0
- package/src/specs/RunAnywhereDeviceInfo.nitro.ts +73 -0
- package/src/types/LLMTypes.ts +127 -0
- package/src/types/STTTypes.ts +124 -0
- package/src/types/StructuredOutputTypes.ts +156 -0
- package/src/types/TTSTypes.ts +126 -0
- package/src/types/VADTypes.ts +70 -0
- package/src/types/VoiceAgentTypes.ts +182 -0
- package/src/types/enums.ts +258 -0
- package/src/types/events.ts +337 -0
- package/src/types/external.d.ts +142 -0
- package/src/types/index.ts +146 -0
- package/src/types/models.ts +579 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Version Constants (MUST match Swift Package.swift)
|
|
7
|
+
# =============================================================================
|
|
8
|
+
COMMONS_VERSION = "0.1.4"
|
|
9
|
+
|
|
10
|
+
# =============================================================================
|
|
11
|
+
# Binary Source - RACommons from runanywhere-sdks
|
|
12
|
+
# =============================================================================
|
|
13
|
+
GITHUB_ORG = "RunanywhereAI"
|
|
14
|
+
COMMONS_REPO = "runanywhere-sdks"
|
|
15
|
+
|
|
16
|
+
# =============================================================================
|
|
17
|
+
# testLocal Toggle
|
|
18
|
+
# Set RA_TEST_LOCAL=1 or create .testlocal file to use local binaries
|
|
19
|
+
# =============================================================================
|
|
20
|
+
TEST_LOCAL = ENV['RA_TEST_LOCAL'] == '1' || File.exist?(File.join(__dir__, '.testlocal'))
|
|
21
|
+
|
|
22
|
+
Pod::Spec.new do |s|
|
|
23
|
+
s.name = "RunAnywhereCore"
|
|
24
|
+
s.module_name = "RunAnywhereCore"
|
|
25
|
+
s.version = package["version"]
|
|
26
|
+
s.summary = package["description"]
|
|
27
|
+
s.homepage = "https://runanywhere.com"
|
|
28
|
+
s.license = package["license"]
|
|
29
|
+
s.authors = "RunAnywhere AI"
|
|
30
|
+
|
|
31
|
+
s.platforms = { :ios => "15.1" }
|
|
32
|
+
s.source = { :git => "https://github.com/RunanywhereAI/sdks.git", :tag => "#{s.version}" }
|
|
33
|
+
|
|
34
|
+
# =============================================================================
|
|
35
|
+
# Core SDK - RACommons Only
|
|
36
|
+
# No LLM/STT/TTS/VAD backends - those are in @runanywhere/llamacpp and @runanywhere/onnx
|
|
37
|
+
# =============================================================================
|
|
38
|
+
if TEST_LOCAL
|
|
39
|
+
puts "[RunAnywhereCore] Using LOCAL RACommons from ios/Binaries/"
|
|
40
|
+
s.vendored_frameworks = "ios/Binaries/RACommons.xcframework"
|
|
41
|
+
else
|
|
42
|
+
s.prepare_command = <<-CMD
|
|
43
|
+
set -e
|
|
44
|
+
|
|
45
|
+
FRAMEWORK_DIR="ios/Frameworks"
|
|
46
|
+
VERSION="#{COMMONS_VERSION}"
|
|
47
|
+
VERSION_FILE="$FRAMEWORK_DIR/.version"
|
|
48
|
+
|
|
49
|
+
# Check if already downloaded with correct version
|
|
50
|
+
if [ -f "$VERSION_FILE" ] && [ -d "$FRAMEWORK_DIR/RACommons.xcframework" ]; then
|
|
51
|
+
CURRENT_VERSION=$(cat "$VERSION_FILE")
|
|
52
|
+
if [ "$CURRENT_VERSION" = "$VERSION" ]; then
|
|
53
|
+
echo "ā
RACommons.xcframework version $VERSION already downloaded"
|
|
54
|
+
exit 0
|
|
55
|
+
fi
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
echo "š¦ Downloading RACommons.xcframework version $VERSION..."
|
|
59
|
+
|
|
60
|
+
mkdir -p "$FRAMEWORK_DIR"
|
|
61
|
+
rm -rf "$FRAMEWORK_DIR/RACommons.xcframework"
|
|
62
|
+
|
|
63
|
+
# Download RACommons from runanywhere-sdks
|
|
64
|
+
DOWNLOAD_URL="https://github.com/#{GITHUB_ORG}/#{COMMONS_REPO}/releases/download/commons-v$VERSION/RACommons-ios-v$VERSION.zip"
|
|
65
|
+
ZIP_FILE="/tmp/RACommons.zip"
|
|
66
|
+
|
|
67
|
+
echo " URL: $DOWNLOAD_URL"
|
|
68
|
+
|
|
69
|
+
curl -L -f -o "$ZIP_FILE" "$DOWNLOAD_URL" || {
|
|
70
|
+
echo "ā Failed to download RACommons from $DOWNLOAD_URL"
|
|
71
|
+
exit 1
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
echo "š Extracting RACommons.xcframework..."
|
|
75
|
+
unzip -q -o "$ZIP_FILE" -d "$FRAMEWORK_DIR/"
|
|
76
|
+
rm -f "$ZIP_FILE"
|
|
77
|
+
|
|
78
|
+
echo "$VERSION" > "$VERSION_FILE"
|
|
79
|
+
|
|
80
|
+
if [ -d "$FRAMEWORK_DIR/RACommons.xcframework" ]; then
|
|
81
|
+
echo "ā
RACommons.xcframework installed successfully"
|
|
82
|
+
else
|
|
83
|
+
echo "ā RACommons.xcframework extraction failed"
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
CMD
|
|
87
|
+
|
|
88
|
+
s.vendored_frameworks = "ios/Frameworks/RACommons.xcframework"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Source files - Core only (no LLM/STT/TTS/VAD bridges)
|
|
92
|
+
s.source_files = [
|
|
93
|
+
"ios/**/*.{swift}",
|
|
94
|
+
"ios/**/*.{h,m,mm}",
|
|
95
|
+
"cpp/HybridRunAnywhereCore.cpp",
|
|
96
|
+
"cpp/HybridRunAnywhereCore.hpp",
|
|
97
|
+
"cpp/bridges/**/*.{cpp,hpp}",
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
# Build settings with header paths for RACommons.xcframework
|
|
101
|
+
s.pod_target_xcconfig = {
|
|
102
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
103
|
+
"HEADER_SEARCH_PATHS" => [
|
|
104
|
+
"$(PODS_TARGET_SRCROOT)/cpp",
|
|
105
|
+
"$(PODS_TARGET_SRCROOT)/cpp/bridges",
|
|
106
|
+
"$(PODS_TARGET_SRCROOT)/ios/Frameworks/RACommons.xcframework/ios-arm64/RACommons.framework/Headers",
|
|
107
|
+
"$(PODS_TARGET_SRCROOT)/ios/Frameworks/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers",
|
|
108
|
+
"$(PODS_TARGET_SRCROOT)/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers",
|
|
109
|
+
"$(PODS_TARGET_SRCROOT)/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers",
|
|
110
|
+
"$(PODS_ROOT)/Headers/Public",
|
|
111
|
+
].join(" "),
|
|
112
|
+
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) HAS_RACOMMONS=1",
|
|
113
|
+
"DEFINES_MODULE" => "YES",
|
|
114
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# Required system libraries and frameworks
|
|
118
|
+
s.libraries = "c++", "archive", "bz2"
|
|
119
|
+
s.frameworks = "Accelerate", "Foundation", "CoreML", "AudioToolbox"
|
|
120
|
+
|
|
121
|
+
# React Native dependencies
|
|
122
|
+
s.dependency 'React-jsi'
|
|
123
|
+
s.dependency 'React-callinvoker'
|
|
124
|
+
|
|
125
|
+
# Load Nitrogen-generated autolinking
|
|
126
|
+
load 'nitrogen/generated/ios/RunAnywhereCore+autolinking.rb'
|
|
127
|
+
add_nitrogen_files(s)
|
|
128
|
+
|
|
129
|
+
install_modules_dependencies(s)
|
|
130
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
project(runanywherecore)
|
|
2
|
+
cmake_minimum_required(VERSION 3.9.0)
|
|
3
|
+
|
|
4
|
+
set(PACKAGE_NAME runanywherecore)
|
|
5
|
+
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
7
|
+
|
|
8
|
+
# Path to pre-built native libraries (downloaded from runanywhere-sdks)
|
|
9
|
+
set(JNILIB_DIR ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI})
|
|
10
|
+
|
|
11
|
+
# Path to RAC headers (downloaded with native libraries)
|
|
12
|
+
set(RAC_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/main/include)
|
|
13
|
+
|
|
14
|
+
# =============================================================================
|
|
15
|
+
# RACommons - Core SDK functionality (rac_* API)
|
|
16
|
+
# This is the ONLY native library in the core package
|
|
17
|
+
# RACommons is REQUIRED - it's downloaded via Gradle downloadNativeLibs task
|
|
18
|
+
# =============================================================================
|
|
19
|
+
if(NOT EXISTS "${JNILIB_DIR}/librac_commons.so")
|
|
20
|
+
message(FATAL_ERROR "[RunAnywhereCore] RACommons not found at ${JNILIB_DIR}/librac_commons.so\n"
|
|
21
|
+
"Run: ./gradlew :runanywhere_core:downloadNativeLibs")
|
|
22
|
+
endif()
|
|
23
|
+
|
|
24
|
+
add_library(rac_commons SHARED IMPORTED)
|
|
25
|
+
set_target_properties(rac_commons PROPERTIES
|
|
26
|
+
IMPORTED_LOCATION "${JNILIB_DIR}/librac_commons.so"
|
|
27
|
+
IMPORTED_NO_SONAME TRUE
|
|
28
|
+
)
|
|
29
|
+
message(STATUS "[RunAnywhereCore] Found RACommons at ${JNILIB_DIR}/librac_commons.so")
|
|
30
|
+
|
|
31
|
+
# =============================================================================
|
|
32
|
+
# Source files - Core bridges only (no LLM/STT/TTS/VAD)
|
|
33
|
+
# =============================================================================
|
|
34
|
+
# Collect core bridge source files
|
|
35
|
+
file(GLOB BRIDGE_SOURCES "../cpp/bridges/*.cpp")
|
|
36
|
+
|
|
37
|
+
add_library(${PACKAGE_NAME} SHARED
|
|
38
|
+
src/main/cpp/cpp-adapter.cpp
|
|
39
|
+
../cpp/HybridRunAnywhereCore.cpp
|
|
40
|
+
${BRIDGE_SOURCES}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Add Nitrogen specs (this handles all React Native linking)
|
|
44
|
+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/runanywherecore+autolinking.cmake)
|
|
45
|
+
|
|
46
|
+
# =============================================================================
|
|
47
|
+
# Include directories
|
|
48
|
+
# =============================================================================
|
|
49
|
+
include_directories(
|
|
50
|
+
"src/main/cpp"
|
|
51
|
+
"../cpp"
|
|
52
|
+
"../cpp/bridges"
|
|
53
|
+
"${CMAKE_SOURCE_DIR}/include"
|
|
54
|
+
# RAC API headers from runanywhere-commons (flat access)
|
|
55
|
+
"${RAC_INCLUDE_DIR}"
|
|
56
|
+
"${RAC_INCLUDE_DIR}/rac"
|
|
57
|
+
"${RAC_INCLUDE_DIR}/rac/core"
|
|
58
|
+
"${RAC_INCLUDE_DIR}/rac/core/capabilities"
|
|
59
|
+
"${RAC_INCLUDE_DIR}/rac/features"
|
|
60
|
+
"${RAC_INCLUDE_DIR}/rac/features/llm"
|
|
61
|
+
"${RAC_INCLUDE_DIR}/rac/features/stt"
|
|
62
|
+
"${RAC_INCLUDE_DIR}/rac/features/tts"
|
|
63
|
+
"${RAC_INCLUDE_DIR}/rac/features/vad"
|
|
64
|
+
"${RAC_INCLUDE_DIR}/rac/features/voice_agent"
|
|
65
|
+
"${RAC_INCLUDE_DIR}/rac/features/platform"
|
|
66
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure"
|
|
67
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/device"
|
|
68
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/download"
|
|
69
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/events"
|
|
70
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/model_management"
|
|
71
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/network"
|
|
72
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/storage"
|
|
73
|
+
"${RAC_INCLUDE_DIR}/rac/infrastructure/telemetry"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# =============================================================================
|
|
77
|
+
# Linking
|
|
78
|
+
# =============================================================================
|
|
79
|
+
find_library(LOG_LIB log)
|
|
80
|
+
|
|
81
|
+
target_link_libraries(
|
|
82
|
+
${PACKAGE_NAME}
|
|
83
|
+
${LOG_LIB}
|
|
84
|
+
android
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Link RACommons - REQUIRED for core functionality
|
|
88
|
+
target_link_libraries(${PACKAGE_NAME} rac_commons)
|
|
89
|
+
target_compile_definitions(${PACKAGE_NAME} PRIVATE HAS_RACOMMONS=1)
|
|
90
|
+
|
|
91
|
+
# NOTE: No LlamaCPP or ONNX linking here
|
|
92
|
+
# Those are in @runanywhere/llamacpp and @runanywhere/onnx packages respectively
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
def getExtOrDefault(name) {
|
|
2
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RunAnywhereCore_' + name]
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
// Only arm64-v8a is supported - native libraries are only built for 64-bit ARM
|
|
6
|
+
def reactNativeArchitectures() {
|
|
7
|
+
return ["arm64-v8a"]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
apply plugin: 'com.android.library'
|
|
11
|
+
apply plugin: 'kotlin-android'
|
|
12
|
+
apply from: '../nitrogen/generated/android/runanywherecore+autolinking.gradle'
|
|
13
|
+
apply plugin: 'com.facebook.react'
|
|
14
|
+
|
|
15
|
+
def getExtOrIntegerDefault(name) {
|
|
16
|
+
if (rootProject.ext.has(name)) {
|
|
17
|
+
return rootProject.ext.get(name)
|
|
18
|
+
} else if (project.properties.containsKey('RunAnywhereCore_' + name)) {
|
|
19
|
+
return (project.properties['RunAnywhereCore_' + name]).toInteger()
|
|
20
|
+
}
|
|
21
|
+
def defaults = [
|
|
22
|
+
'compileSdkVersion': 36,
|
|
23
|
+
'minSdkVersion': 24,
|
|
24
|
+
'targetSdkVersion': 36
|
|
25
|
+
]
|
|
26
|
+
return defaults[name] ?: 36
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Version Constants (MUST match Swift Package.swift and iOS Podspec)
|
|
31
|
+
// RACommons ONLY - no backend binaries
|
|
32
|
+
// =============================================================================
|
|
33
|
+
def commonsVersion = "0.1.4"
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// Binary Source - RACommons from runanywhere-sdks
|
|
37
|
+
// =============================================================================
|
|
38
|
+
def githubOrg = "RunanywhereAI"
|
|
39
|
+
def commonsRepo = "runanywhere-sdks"
|
|
40
|
+
|
|
41
|
+
// =============================================================================
|
|
42
|
+
// testLocal Toggle
|
|
43
|
+
// =============================================================================
|
|
44
|
+
def useLocalBuild = project.findProperty("runanywhere.testLocal")?.toBoolean() ?:
|
|
45
|
+
System.getenv("RA_TEST_LOCAL") == "1" ?: false
|
|
46
|
+
|
|
47
|
+
// Native libraries directory
|
|
48
|
+
def jniLibsDir = file("src/main/jniLibs")
|
|
49
|
+
def downloadedLibsDir = file("build/downloaded-libs")
|
|
50
|
+
def includeDir = file("src/main/include")
|
|
51
|
+
|
|
52
|
+
// Local runanywhere-commons path (for local builds)
|
|
53
|
+
def runAnywhereCommonsDir = file("../../../../runanywhere-commons")
|
|
54
|
+
|
|
55
|
+
android {
|
|
56
|
+
namespace "com.margelo.nitro.runanywhere.core"
|
|
57
|
+
|
|
58
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
59
|
+
|
|
60
|
+
defaultConfig {
|
|
61
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
62
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
63
|
+
|
|
64
|
+
ndk {
|
|
65
|
+
abiFilters 'arm64-v8a'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
externalNativeBuild {
|
|
69
|
+
cmake {
|
|
70
|
+
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
|
71
|
+
arguments "-DANDROID_STL=c++_shared"
|
|
72
|
+
abiFilters 'arm64-v8a'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
externalNativeBuild {
|
|
78
|
+
cmake {
|
|
79
|
+
path "CMakeLists.txt"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
packagingOptions {
|
|
84
|
+
excludes = [
|
|
85
|
+
"META-INF",
|
|
86
|
+
"META-INF/**"
|
|
87
|
+
]
|
|
88
|
+
pickFirsts = [
|
|
89
|
+
"**/libc++_shared.so",
|
|
90
|
+
"**/libjsi.so",
|
|
91
|
+
"**/libfbjni.so",
|
|
92
|
+
"**/libfolly_runtime.so",
|
|
93
|
+
"**/librac_commons.so",
|
|
94
|
+
"**/librunanywhere_jni.so"
|
|
95
|
+
]
|
|
96
|
+
jniLibs {
|
|
97
|
+
useLegacyPackaging = true
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
buildFeatures {
|
|
102
|
+
buildConfig true
|
|
103
|
+
prefab true
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
buildTypes {
|
|
107
|
+
release {
|
|
108
|
+
minifyEnabled false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
lint {
|
|
113
|
+
disable 'GradleCompatible'
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
compileOptions {
|
|
117
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
118
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
kotlinOptions {
|
|
122
|
+
jvmTarget = "17"
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
sourceSets {
|
|
126
|
+
main {
|
|
127
|
+
java.srcDirs += [
|
|
128
|
+
"generated/java",
|
|
129
|
+
"generated/jni"
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
if (useLocalBuild) {
|
|
133
|
+
def commonsDistDir = new File(runAnywhereCommonsDir, "dist/android")
|
|
134
|
+
if (commonsDistDir.exists()) {
|
|
135
|
+
jniLibs.srcDirs = [commonsDistDir]
|
|
136
|
+
logger.lifecycle("[RunAnywhereCore] Using LOCAL native libraries from: $commonsDistDir")
|
|
137
|
+
} else {
|
|
138
|
+
logger.warn("[RunAnywhereCore] Local commons dist not found at: $commonsDistDir")
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
jniLibs.srcDirs = [jniLibsDir]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// =============================================================================
|
|
148
|
+
// Download Native Libraries (RACommons ONLY)
|
|
149
|
+
// Backend modules (LlamaCPP, ONNX) are downloaded by their respective packages
|
|
150
|
+
// =============================================================================
|
|
151
|
+
|
|
152
|
+
task downloadNativeLibs {
|
|
153
|
+
description = "Downloads RACommons from GitHub releases"
|
|
154
|
+
group = "build setup"
|
|
155
|
+
|
|
156
|
+
def versionFile = file("${jniLibsDir}/.version")
|
|
157
|
+
def expectedVersion = commonsVersion
|
|
158
|
+
|
|
159
|
+
outputs.dir(jniLibsDir)
|
|
160
|
+
outputs.upToDateWhen {
|
|
161
|
+
versionFile.exists() && versionFile.text.trim() == expectedVersion
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
doLast {
|
|
165
|
+
if (useLocalBuild) {
|
|
166
|
+
logger.lifecycle("[RunAnywhereCore] Skipping download - using local build mode")
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
def currentVersion = versionFile.exists() ? versionFile.text.trim() : ""
|
|
171
|
+
if (currentVersion == expectedVersion) {
|
|
172
|
+
logger.lifecycle("[RunAnywhereCore] RACommons version $expectedVersion already downloaded")
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
logger.lifecycle("[RunAnywhereCore] Downloading RACommons...")
|
|
177
|
+
logger.lifecycle(" Commons Version: $commonsVersion")
|
|
178
|
+
|
|
179
|
+
downloadedLibsDir.mkdirs()
|
|
180
|
+
jniLibsDir.deleteDir()
|
|
181
|
+
jniLibsDir.mkdirs()
|
|
182
|
+
includeDir.mkdirs()
|
|
183
|
+
|
|
184
|
+
// =============================================================================
|
|
185
|
+
// Download RACommons from runanywhere-sdks
|
|
186
|
+
// =============================================================================
|
|
187
|
+
def commonsUrl = "https://github.com/${githubOrg}/${commonsRepo}/releases/download/commons-v${commonsVersion}/RACommons-android-v${commonsVersion}.zip"
|
|
188
|
+
def commonsZip = file("${downloadedLibsDir}/RACommons.zip")
|
|
189
|
+
|
|
190
|
+
logger.lifecycle("\nš¦ Downloading RACommons...")
|
|
191
|
+
logger.lifecycle(" URL: $commonsUrl")
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
new URL(commonsUrl).withInputStream { input ->
|
|
195
|
+
commonsZip.withOutputStream { output ->
|
|
196
|
+
output << input
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
logger.lifecycle(" Downloaded: ${commonsZip.length() / 1024}KB")
|
|
200
|
+
|
|
201
|
+
// Extract and flatten the archive structure
|
|
202
|
+
// Archive structure: jniLibs/arm64-v8a/*.so
|
|
203
|
+
// Target structure: arm64-v8a/*.so (directly in jniLibsDir)
|
|
204
|
+
copy {
|
|
205
|
+
from zipTree(commonsZip)
|
|
206
|
+
into jniLibsDir
|
|
207
|
+
// IMPORTANT: Exclude libc++_shared.so - React Native provides its own
|
|
208
|
+
// Using a different version causes ABI compatibility issues
|
|
209
|
+
exclude "**/libc++_shared.so"
|
|
210
|
+
eachFile { fileCopyDetails ->
|
|
211
|
+
def pathString = fileCopyDetails.relativePath.pathString
|
|
212
|
+
// Handle jniLibs/ABI/*.so structure -> flatten to ABI/*.so
|
|
213
|
+
if (pathString.startsWith("jniLibs/") && pathString.endsWith(".so")) {
|
|
214
|
+
def newPath = pathString.replaceFirst("^jniLibs/", "")
|
|
215
|
+
fileCopyDetails.relativePath = new RelativePath(true, newPath.split("/"))
|
|
216
|
+
} else if (pathString.endsWith(".so")) {
|
|
217
|
+
// Keep .so files as-is if already in correct structure
|
|
218
|
+
} else {
|
|
219
|
+
// Exclude non-so files from jniLibs
|
|
220
|
+
if (!pathString.contains("include/")) {
|
|
221
|
+
fileCopyDetails.exclude()
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
includeEmptyDirs = false
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Copy headers if present in the archive
|
|
229
|
+
def tempExtract = file("${downloadedLibsDir}/temp-commons")
|
|
230
|
+
tempExtract.deleteDir()
|
|
231
|
+
copy {
|
|
232
|
+
from zipTree(commonsZip)
|
|
233
|
+
into tempExtract
|
|
234
|
+
}
|
|
235
|
+
def headersDir = new File(tempExtract, "include")
|
|
236
|
+
if (headersDir.exists()) {
|
|
237
|
+
copy {
|
|
238
|
+
from headersDir
|
|
239
|
+
into includeDir
|
|
240
|
+
}
|
|
241
|
+
logger.lifecycle(" ā
RACommons headers installed")
|
|
242
|
+
}
|
|
243
|
+
// Also check for nested jniLibs/include structure
|
|
244
|
+
def nestedHeadersDir = new File(tempExtract, "jniLibs/include")
|
|
245
|
+
if (nestedHeadersDir.exists()) {
|
|
246
|
+
copy {
|
|
247
|
+
from nestedHeadersDir
|
|
248
|
+
into includeDir
|
|
249
|
+
}
|
|
250
|
+
logger.lifecycle(" ā
RACommons headers installed (from nested path)")
|
|
251
|
+
}
|
|
252
|
+
tempExtract.deleteDir()
|
|
253
|
+
|
|
254
|
+
logger.lifecycle(" ā
RACommons installed")
|
|
255
|
+
} catch (Exception e) {
|
|
256
|
+
logger.error("ā Failed to download RACommons: ${e.message}")
|
|
257
|
+
throw new GradleException("Failed to download RACommons", e)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// =============================================================================
|
|
261
|
+
// List installed files
|
|
262
|
+
// =============================================================================
|
|
263
|
+
logger.lifecycle("\nš Installed native libraries:")
|
|
264
|
+
jniLibsDir.listFiles()?.findAll { it.isDirectory() }?.each { abiDir ->
|
|
265
|
+
logger.lifecycle(" ${abiDir.name}/")
|
|
266
|
+
abiDir.listFiles()?.findAll { it.name.endsWith(".so") }?.sort()?.each { soFile ->
|
|
267
|
+
logger.lifecycle(" ${soFile.name} (${soFile.length() / 1024}KB)")
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (includeDir.exists() && includeDir.listFiles()?.size() > 0) {
|
|
272
|
+
logger.lifecycle("\nš Installed headers:")
|
|
273
|
+
includeDir.eachFileRecurse { file ->
|
|
274
|
+
if (file.isFile() && file.name.endsWith(".h")) {
|
|
275
|
+
logger.lifecycle(" ${file.relativePath(includeDir)}")
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
versionFile.text = expectedVersion
|
|
281
|
+
logger.lifecycle("\nā
RACommons version $expectedVersion installed")
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (!useLocalBuild) {
|
|
286
|
+
preBuild.dependsOn downloadNativeLibs
|
|
287
|
+
|
|
288
|
+
afterEvaluate {
|
|
289
|
+
tasks.matching {
|
|
290
|
+
it.name.contains("generateCodegen") || it.name.contains("Codegen")
|
|
291
|
+
}.configureEach {
|
|
292
|
+
mustRunAfter downloadNativeLibs
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
task cleanNativeLibs(type: Delete) {
|
|
298
|
+
description = "Removes downloaded native libraries"
|
|
299
|
+
group = "build"
|
|
300
|
+
delete jniLibsDir
|
|
301
|
+
delete downloadedLibsDir
|
|
302
|
+
delete includeDir
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
clean.dependsOn cleanNativeLibs
|
|
306
|
+
|
|
307
|
+
repositories {
|
|
308
|
+
mavenCentral()
|
|
309
|
+
google()
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
dependencies {
|
|
313
|
+
implementation "com.facebook.react:react-android"
|
|
314
|
+
implementation project(":react-native-nitro-modules")
|
|
315
|
+
|
|
316
|
+
// Apache Commons Compress for tar.gz archive extraction
|
|
317
|
+
implementation "org.apache.commons:commons-compress:1.26.0"
|
|
318
|
+
|
|
319
|
+
// AndroidX Security for EncryptedSharedPreferences (device identity persistence)
|
|
320
|
+
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
321
|
+
}
|