@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,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_device_manager.h
|
|
3
|
+
* @brief Device Registration Manager - C++ Business Logic Layer
|
|
4
|
+
*
|
|
5
|
+
* Handles device registration orchestration with all business logic in C++.
|
|
6
|
+
* Platform SDKs (Swift, Kotlin) provide callbacks for:
|
|
7
|
+
* - Device info gathering (platform-specific APIs)
|
|
8
|
+
* - Device ID retrieval (Keychain/Keystore)
|
|
9
|
+
* - Registration persistence (UserDefaults/SharedPreferences)
|
|
10
|
+
* - HTTP transport (URLSession/OkHttp)
|
|
11
|
+
*
|
|
12
|
+
* Events are emitted via rac_analytics_event_emit().
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#ifndef RAC_DEVICE_MANAGER_H
|
|
16
|
+
#define RAC_DEVICE_MANAGER_H
|
|
17
|
+
|
|
18
|
+
#include <RACommons/rac_types.h>
|
|
19
|
+
#include <RACommons/rac_environment.h>
|
|
20
|
+
#include <RACommons/rac_telemetry_types.h>
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
extern "C" {
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// CALLBACK TYPES
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @brief HTTP response for device registration
|
|
32
|
+
*/
|
|
33
|
+
typedef struct rac_device_http_response {
|
|
34
|
+
rac_result_t result; // RAC_SUCCESS on success
|
|
35
|
+
int32_t status_code; // HTTP status code (200, 400, etc.)
|
|
36
|
+
const char* response_body; // Response JSON (can be NULL)
|
|
37
|
+
const char* error_message; // Error message (can be NULL)
|
|
38
|
+
} rac_device_http_response_t;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @brief Callback function types for platform-specific operations
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get device information (Swift calls DeviceInfo.current)
|
|
46
|
+
* @param out_info Output parameter for device info
|
|
47
|
+
* @param user_data User-provided context
|
|
48
|
+
*/
|
|
49
|
+
typedef void (*rac_device_get_info_fn)(rac_device_registration_info_t* out_info, void* user_data);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get persistent device ID (Swift calls DeviceIdentity.persistentUUID)
|
|
53
|
+
* @param user_data User-provided context
|
|
54
|
+
* @return Device ID string (must remain valid during callback)
|
|
55
|
+
*/
|
|
56
|
+
typedef const char* (*rac_device_get_id_fn)(void* user_data);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Check if device is already registered (Swift checks UserDefaults)
|
|
60
|
+
* @param user_data User-provided context
|
|
61
|
+
* @return RAC_TRUE if registered, RAC_FALSE otherwise
|
|
62
|
+
*/
|
|
63
|
+
typedef rac_bool_t (*rac_device_is_registered_fn)(void* user_data);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Mark device as registered/unregistered (Swift sets UserDefaults)
|
|
67
|
+
* @param registered RAC_TRUE to mark as registered, RAC_FALSE to clear
|
|
68
|
+
* @param user_data User-provided context
|
|
69
|
+
*/
|
|
70
|
+
typedef void (*rac_device_set_registered_fn)(rac_bool_t registered, void* user_data);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Make HTTP POST request for device registration
|
|
74
|
+
* @param endpoint Full endpoint URL
|
|
75
|
+
* @param json_body JSON body to POST
|
|
76
|
+
* @param requires_auth Whether authentication header is required
|
|
77
|
+
* @param out_response Output parameter for response
|
|
78
|
+
* @param user_data User-provided context
|
|
79
|
+
* @return RAC_SUCCESS on success, error code otherwise
|
|
80
|
+
*/
|
|
81
|
+
typedef rac_result_t (*rac_device_http_post_fn)(const char* endpoint, const char* json_body,
|
|
82
|
+
rac_bool_t requires_auth,
|
|
83
|
+
rac_device_http_response_t* out_response,
|
|
84
|
+
void* user_data);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @brief Callback structure for platform-specific operations
|
|
88
|
+
*
|
|
89
|
+
* Platform SDKs set these callbacks at initialization.
|
|
90
|
+
* C++ device manager calls these to access platform services.
|
|
91
|
+
*/
|
|
92
|
+
typedef struct rac_device_callbacks {
|
|
93
|
+
/** Get device hardware/OS information */
|
|
94
|
+
rac_device_get_info_fn get_device_info;
|
|
95
|
+
|
|
96
|
+
/** Get persistent device UUID (Keychain/Keystore) */
|
|
97
|
+
rac_device_get_id_fn get_device_id;
|
|
98
|
+
|
|
99
|
+
/** Check if device is registered (UserDefaults/SharedPreferences) */
|
|
100
|
+
rac_device_is_registered_fn is_registered;
|
|
101
|
+
|
|
102
|
+
/** Set registration status */
|
|
103
|
+
rac_device_set_registered_fn set_registered;
|
|
104
|
+
|
|
105
|
+
/** Make HTTP POST request */
|
|
106
|
+
rac_device_http_post_fn http_post;
|
|
107
|
+
|
|
108
|
+
/** User data passed to all callbacks */
|
|
109
|
+
void* user_data;
|
|
110
|
+
} rac_device_callbacks_t;
|
|
111
|
+
|
|
112
|
+
// =============================================================================
|
|
113
|
+
// DEVICE MANAGER API
|
|
114
|
+
// =============================================================================
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @brief Set callbacks for device manager operations
|
|
118
|
+
*
|
|
119
|
+
* Must be called before any other device manager functions.
|
|
120
|
+
* Typically called during SDK initialization.
|
|
121
|
+
*
|
|
122
|
+
* @param callbacks Callback structure (copied internally)
|
|
123
|
+
* @return RAC_SUCCESS or error code
|
|
124
|
+
*/
|
|
125
|
+
RAC_API rac_result_t rac_device_manager_set_callbacks(const rac_device_callbacks_t* callbacks);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @brief Register device with backend if not already registered
|
|
129
|
+
*
|
|
130
|
+
* This is the main entry point for device registration.
|
|
131
|
+
* Business logic:
|
|
132
|
+
* 1. Check if already registered (via callback)
|
|
133
|
+
* 2. If not, gather device info (via callback)
|
|
134
|
+
* 3. Build JSON payload (C++ implementation)
|
|
135
|
+
* 4. POST to backend (via callback)
|
|
136
|
+
* 5. On success, mark as registered (via callback)
|
|
137
|
+
* 6. Emit appropriate analytics event
|
|
138
|
+
*
|
|
139
|
+
* @param env Current SDK environment
|
|
140
|
+
* @param build_token Optional build token for development mode (can be NULL)
|
|
141
|
+
* @return RAC_SUCCESS on success or if already registered, error code otherwise
|
|
142
|
+
*/
|
|
143
|
+
RAC_API rac_result_t rac_device_manager_register_if_needed(rac_environment_t env,
|
|
144
|
+
const char* build_token);
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @brief Check if device is registered
|
|
148
|
+
*
|
|
149
|
+
* Delegates to the is_registered callback.
|
|
150
|
+
*
|
|
151
|
+
* @return RAC_TRUE if registered, RAC_FALSE otherwise
|
|
152
|
+
*/
|
|
153
|
+
RAC_API rac_bool_t rac_device_manager_is_registered(void);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @brief Clear device registration status
|
|
157
|
+
*
|
|
158
|
+
* Delegates to the set_registered callback with RAC_FALSE.
|
|
159
|
+
* Useful for testing or user-initiated reset.
|
|
160
|
+
*/
|
|
161
|
+
RAC_API void rac_device_manager_clear_registration(void);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @brief Get the current device ID
|
|
165
|
+
*
|
|
166
|
+
* Delegates to the get_device_id callback.
|
|
167
|
+
*
|
|
168
|
+
* @return Device ID string or NULL if callbacks not set
|
|
169
|
+
*/
|
|
170
|
+
RAC_API const char* rac_device_manager_get_device_id(void);
|
|
171
|
+
|
|
172
|
+
#ifdef __cplusplus
|
|
173
|
+
}
|
|
174
|
+
#endif
|
|
175
|
+
|
|
176
|
+
#endif /* RAC_DEVICE_MANAGER_H */
|
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_download.h
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_download.h
|
|
3
|
+
* @brief Download Manager - Model Download Orchestration
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's DownloadService protocol and related types.
|
|
6
|
+
* Swift Source: Sources/RunAnywhere/Infrastructure/Download/
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This is a direct translation of the Swift implementation.
|
|
9
|
+
* Do NOT add features not present in the Swift code.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: The actual HTTP download is delegated to the platform adapter
|
|
12
|
+
* (Swift/Kotlin/etc). This C layer handles orchestration logic:
|
|
13
|
+
* - Progress tracking
|
|
14
|
+
* - State management
|
|
15
|
+
* - Retry logic
|
|
16
|
+
* - Post-download extraction
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef RAC_DOWNLOAD_H
|
|
20
|
+
#define RAC_DOWNLOAD_H
|
|
21
|
+
|
|
22
|
+
#include <RACommons/rac_error.h>
|
|
23
|
+
#include <RACommons/rac_types.h>
|
|
24
|
+
|
|
25
|
+
#ifdef __cplusplus
|
|
26
|
+
extern "C" {
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// TYPES - Mirrors Swift's DownloadState, DownloadStage, DownloadProgress
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @brief Download state enumeration.
|
|
35
|
+
* Mirrors Swift's DownloadState enum.
|
|
36
|
+
*/
|
|
37
|
+
typedef enum rac_download_state {
|
|
38
|
+
RAC_DOWNLOAD_STATE_PENDING = 0, /**< Download is pending */
|
|
39
|
+
RAC_DOWNLOAD_STATE_DOWNLOADING = 1, /**< Currently downloading */
|
|
40
|
+
RAC_DOWNLOAD_STATE_EXTRACTING = 2, /**< Extracting archive contents */
|
|
41
|
+
RAC_DOWNLOAD_STATE_RETRYING = 3, /**< Retrying after failure */
|
|
42
|
+
RAC_DOWNLOAD_STATE_COMPLETED = 4, /**< Download completed successfully */
|
|
43
|
+
RAC_DOWNLOAD_STATE_FAILED = 5, /**< Download failed */
|
|
44
|
+
RAC_DOWNLOAD_STATE_CANCELLED = 6 /**< Download was cancelled */
|
|
45
|
+
} rac_download_state_t;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief Download stage enumeration.
|
|
49
|
+
* Mirrors Swift's DownloadStage enum.
|
|
50
|
+
*/
|
|
51
|
+
typedef enum rac_download_stage {
|
|
52
|
+
RAC_DOWNLOAD_STAGE_DOWNLOADING = 0, /**< Downloading the file(s) */
|
|
53
|
+
RAC_DOWNLOAD_STAGE_EXTRACTING = 1, /**< Extracting archive contents */
|
|
54
|
+
RAC_DOWNLOAD_STAGE_VALIDATING = 2, /**< Validating downloaded files */
|
|
55
|
+
RAC_DOWNLOAD_STAGE_COMPLETED = 3 /**< Download and processing complete */
|
|
56
|
+
} rac_download_stage_t;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @brief Get display name for download stage.
|
|
60
|
+
*
|
|
61
|
+
* @param stage The download stage
|
|
62
|
+
* @return Display name string (static, do not free)
|
|
63
|
+
*/
|
|
64
|
+
RAC_API const char* rac_download_stage_display_name(rac_download_stage_t stage);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @brief Get progress range for download stage.
|
|
68
|
+
* Download: 0-80%, Extraction: 80-95%, Validation: 95-99%, Completed: 100%
|
|
69
|
+
*
|
|
70
|
+
* @param stage The download stage
|
|
71
|
+
* @param out_start Output: Start of progress range (0.0-1.0)
|
|
72
|
+
* @param out_end Output: End of progress range (0.0-1.0)
|
|
73
|
+
*/
|
|
74
|
+
RAC_API void rac_download_stage_progress_range(rac_download_stage_t stage, double* out_start,
|
|
75
|
+
double* out_end);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @brief Download progress information.
|
|
79
|
+
* Mirrors Swift's DownloadProgress struct.
|
|
80
|
+
*/
|
|
81
|
+
typedef struct rac_download_progress {
|
|
82
|
+
/** Current stage of the download pipeline */
|
|
83
|
+
rac_download_stage_t stage;
|
|
84
|
+
|
|
85
|
+
/** Bytes downloaded (for download stage) */
|
|
86
|
+
int64_t bytes_downloaded;
|
|
87
|
+
|
|
88
|
+
/** Total bytes to download */
|
|
89
|
+
int64_t total_bytes;
|
|
90
|
+
|
|
91
|
+
/** Progress within current stage (0.0 to 1.0) */
|
|
92
|
+
double stage_progress;
|
|
93
|
+
|
|
94
|
+
/** Overall progress across all stages (0.0 to 1.0) */
|
|
95
|
+
double overall_progress;
|
|
96
|
+
|
|
97
|
+
/** Current state */
|
|
98
|
+
rac_download_state_t state;
|
|
99
|
+
|
|
100
|
+
/** Download speed in bytes per second (0 if unknown) */
|
|
101
|
+
double speed;
|
|
102
|
+
|
|
103
|
+
/** Estimated time remaining in seconds (-1 if unknown) */
|
|
104
|
+
double estimated_time_remaining;
|
|
105
|
+
|
|
106
|
+
/** Retry attempt number (for RETRYING state) */
|
|
107
|
+
int32_t retry_attempt;
|
|
108
|
+
|
|
109
|
+
/** Error code (for FAILED state) */
|
|
110
|
+
rac_result_t error_code;
|
|
111
|
+
|
|
112
|
+
/** Error message (for FAILED state, can be NULL) */
|
|
113
|
+
const char* error_message;
|
|
114
|
+
} rac_download_progress_t;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @brief Default download progress values.
|
|
118
|
+
*/
|
|
119
|
+
static const rac_download_progress_t RAC_DOWNLOAD_PROGRESS_DEFAULT = {
|
|
120
|
+
.stage = RAC_DOWNLOAD_STAGE_DOWNLOADING,
|
|
121
|
+
.bytes_downloaded = 0,
|
|
122
|
+
.total_bytes = 0,
|
|
123
|
+
.stage_progress = 0.0,
|
|
124
|
+
.overall_progress = 0.0,
|
|
125
|
+
.state = RAC_DOWNLOAD_STATE_PENDING,
|
|
126
|
+
.speed = 0.0,
|
|
127
|
+
.estimated_time_remaining = -1.0,
|
|
128
|
+
.retry_attempt = 0,
|
|
129
|
+
.error_code = RAC_SUCCESS,
|
|
130
|
+
.error_message = RAC_NULL};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief Download task information.
|
|
134
|
+
* Mirrors Swift's DownloadTask struct.
|
|
135
|
+
*/
|
|
136
|
+
typedef struct rac_download_task {
|
|
137
|
+
/** Unique task ID */
|
|
138
|
+
char* task_id;
|
|
139
|
+
|
|
140
|
+
/** Model ID being downloaded */
|
|
141
|
+
char* model_id;
|
|
142
|
+
|
|
143
|
+
/** Download URL */
|
|
144
|
+
char* url;
|
|
145
|
+
|
|
146
|
+
/** Destination path */
|
|
147
|
+
char* destination_path;
|
|
148
|
+
|
|
149
|
+
/** Whether extraction is required */
|
|
150
|
+
rac_bool_t requires_extraction;
|
|
151
|
+
|
|
152
|
+
/** Current progress */
|
|
153
|
+
rac_download_progress_t progress;
|
|
154
|
+
} rac_download_task_t;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @brief Download configuration.
|
|
158
|
+
* Mirrors Swift's DownloadConfiguration struct.
|
|
159
|
+
*/
|
|
160
|
+
typedef struct rac_download_config {
|
|
161
|
+
/** Maximum concurrent downloads (default: 1) */
|
|
162
|
+
int32_t max_concurrent_downloads;
|
|
163
|
+
|
|
164
|
+
/** Request timeout in seconds (default: 60) */
|
|
165
|
+
int32_t request_timeout_seconds;
|
|
166
|
+
|
|
167
|
+
/** Maximum retry attempts (default: 3) */
|
|
168
|
+
int32_t max_retry_attempts;
|
|
169
|
+
|
|
170
|
+
/** Retry delay in seconds (default: 5) */
|
|
171
|
+
int32_t retry_delay_seconds;
|
|
172
|
+
|
|
173
|
+
/** Whether to allow cellular downloads (default: true) */
|
|
174
|
+
rac_bool_t allow_cellular;
|
|
175
|
+
|
|
176
|
+
/** Whether to allow downloads on low data mode (default: false) */
|
|
177
|
+
rac_bool_t allow_constrained_network;
|
|
178
|
+
} rac_download_config_t;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @brief Default download configuration.
|
|
182
|
+
*/
|
|
183
|
+
static const rac_download_config_t RAC_DOWNLOAD_CONFIG_DEFAULT = {.max_concurrent_downloads = 1,
|
|
184
|
+
.request_timeout_seconds = 60,
|
|
185
|
+
.max_retry_attempts = 3,
|
|
186
|
+
.retry_delay_seconds = 5,
|
|
187
|
+
.allow_cellular = RAC_TRUE,
|
|
188
|
+
.allow_constrained_network =
|
|
189
|
+
RAC_FALSE};
|
|
190
|
+
|
|
191
|
+
// =============================================================================
|
|
192
|
+
// CALLBACKS
|
|
193
|
+
// =============================================================================
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @brief Callback for download progress updates.
|
|
197
|
+
* Mirrors Swift's AsyncStream<DownloadProgress> pattern.
|
|
198
|
+
*
|
|
199
|
+
* @param progress Current progress information
|
|
200
|
+
* @param user_data User-provided context
|
|
201
|
+
*/
|
|
202
|
+
typedef void (*rac_download_progress_callback_fn)(const rac_download_progress_t* progress,
|
|
203
|
+
void* user_data);
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @brief Callback for download completion.
|
|
207
|
+
*
|
|
208
|
+
* @param task_id The task ID
|
|
209
|
+
* @param result RAC_SUCCESS or error code
|
|
210
|
+
* @param final_path Path to the downloaded/extracted file (NULL on failure)
|
|
211
|
+
* @param user_data User-provided context
|
|
212
|
+
*/
|
|
213
|
+
typedef void (*rac_download_complete_callback_fn)(const char* task_id, rac_result_t result,
|
|
214
|
+
const char* final_path, void* user_data);
|
|
215
|
+
|
|
216
|
+
// =============================================================================
|
|
217
|
+
// OPAQUE HANDLE
|
|
218
|
+
// =============================================================================
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @brief Opaque handle for download manager instance.
|
|
222
|
+
*/
|
|
223
|
+
typedef struct rac_download_manager* rac_download_manager_handle_t;
|
|
224
|
+
|
|
225
|
+
// =============================================================================
|
|
226
|
+
// LIFECYCLE API
|
|
227
|
+
// =============================================================================
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @brief Create a download manager instance.
|
|
231
|
+
*
|
|
232
|
+
* @param config Configuration (can be NULL for defaults)
|
|
233
|
+
* @param out_handle Output: Handle to the created manager
|
|
234
|
+
* @return RAC_SUCCESS or error code
|
|
235
|
+
*/
|
|
236
|
+
RAC_API rac_result_t rac_download_manager_create(const rac_download_config_t* config,
|
|
237
|
+
rac_download_manager_handle_t* out_handle);
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @brief Destroy a download manager instance.
|
|
241
|
+
*
|
|
242
|
+
* @param handle Manager handle
|
|
243
|
+
*/
|
|
244
|
+
RAC_API void rac_download_manager_destroy(rac_download_manager_handle_t handle);
|
|
245
|
+
|
|
246
|
+
// =============================================================================
|
|
247
|
+
// DOWNLOAD API
|
|
248
|
+
// =============================================================================
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @brief Start downloading a model.
|
|
252
|
+
*
|
|
253
|
+
* Mirrors Swift's DownloadService.downloadModel(_:).
|
|
254
|
+
* The actual HTTP download is performed by the platform adapter.
|
|
255
|
+
*
|
|
256
|
+
* @param handle Manager handle
|
|
257
|
+
* @param model_id Model identifier
|
|
258
|
+
* @param url Download URL
|
|
259
|
+
* @param destination_path Path where the model should be saved
|
|
260
|
+
* @param requires_extraction Whether the download needs to be extracted
|
|
261
|
+
* @param progress_callback Callback for progress updates (can be NULL)
|
|
262
|
+
* @param complete_callback Callback for completion (can be NULL)
|
|
263
|
+
* @param user_data User context passed to callbacks
|
|
264
|
+
* @param out_task_id Output: Task ID for tracking (owned, must be freed with rac_free)
|
|
265
|
+
* @return RAC_SUCCESS or error code
|
|
266
|
+
*/
|
|
267
|
+
RAC_API rac_result_t rac_download_manager_start(rac_download_manager_handle_t handle,
|
|
268
|
+
const char* model_id, const char* url,
|
|
269
|
+
const char* destination_path,
|
|
270
|
+
rac_bool_t requires_extraction,
|
|
271
|
+
rac_download_progress_callback_fn progress_callback,
|
|
272
|
+
rac_download_complete_callback_fn complete_callback,
|
|
273
|
+
void* user_data, char** out_task_id);
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @brief Cancel a download.
|
|
277
|
+
*
|
|
278
|
+
* Mirrors Swift's DownloadService.cancelDownload(taskId:).
|
|
279
|
+
*
|
|
280
|
+
* @param handle Manager handle
|
|
281
|
+
* @param task_id Task ID to cancel
|
|
282
|
+
* @return RAC_SUCCESS or error code
|
|
283
|
+
*/
|
|
284
|
+
RAC_API rac_result_t rac_download_manager_cancel(rac_download_manager_handle_t handle,
|
|
285
|
+
const char* task_id);
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @brief Pause all active downloads.
|
|
289
|
+
*
|
|
290
|
+
* Mirrors Swift's AlamofireDownloadService.pauseAll().
|
|
291
|
+
*
|
|
292
|
+
* @param handle Manager handle
|
|
293
|
+
* @return RAC_SUCCESS or error code
|
|
294
|
+
*/
|
|
295
|
+
RAC_API rac_result_t rac_download_manager_pause_all(rac_download_manager_handle_t handle);
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @brief Resume all paused downloads.
|
|
299
|
+
*
|
|
300
|
+
* Mirrors Swift's AlamofireDownloadService.resumeAll().
|
|
301
|
+
*
|
|
302
|
+
* @param handle Manager handle
|
|
303
|
+
* @return RAC_SUCCESS or error code
|
|
304
|
+
*/
|
|
305
|
+
RAC_API rac_result_t rac_download_manager_resume_all(rac_download_manager_handle_t handle);
|
|
306
|
+
|
|
307
|
+
// =============================================================================
|
|
308
|
+
// STATUS API
|
|
309
|
+
// =============================================================================
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @brief Get current progress for a download task.
|
|
313
|
+
*
|
|
314
|
+
* @param handle Manager handle
|
|
315
|
+
* @param task_id Task ID
|
|
316
|
+
* @param out_progress Output: Current progress
|
|
317
|
+
* @return RAC_SUCCESS or error code (RAC_ERROR_NOT_FOUND if task doesn't exist)
|
|
318
|
+
*/
|
|
319
|
+
RAC_API rac_result_t rac_download_manager_get_progress(rac_download_manager_handle_t handle,
|
|
320
|
+
const char* task_id,
|
|
321
|
+
rac_download_progress_t* out_progress);
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @brief Get list of active download task IDs.
|
|
325
|
+
*
|
|
326
|
+
* @param handle Manager handle
|
|
327
|
+
* @param out_task_ids Output: Array of task IDs (owned, each must be freed with rac_free)
|
|
328
|
+
* @param out_count Output: Number of tasks
|
|
329
|
+
* @return RAC_SUCCESS or error code
|
|
330
|
+
*/
|
|
331
|
+
RAC_API rac_result_t rac_download_manager_get_active_tasks(rac_download_manager_handle_t handle,
|
|
332
|
+
char*** out_task_ids, size_t* out_count);
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @brief Check if the download service is healthy.
|
|
336
|
+
*
|
|
337
|
+
* Mirrors Swift's AlamofireDownloadService.isHealthy().
|
|
338
|
+
*
|
|
339
|
+
* @param handle Manager handle
|
|
340
|
+
* @param out_is_healthy Output: RAC_TRUE if healthy
|
|
341
|
+
* @return RAC_SUCCESS or error code
|
|
342
|
+
*/
|
|
343
|
+
RAC_API rac_result_t rac_download_manager_is_healthy(rac_download_manager_handle_t handle,
|
|
344
|
+
rac_bool_t* out_is_healthy);
|
|
345
|
+
|
|
346
|
+
// =============================================================================
|
|
347
|
+
// PROGRESS HELPERS
|
|
348
|
+
// =============================================================================
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @brief Update download progress from HTTP callback.
|
|
352
|
+
*
|
|
353
|
+
* Called by platform adapter when download progress updates.
|
|
354
|
+
*
|
|
355
|
+
* @param handle Manager handle
|
|
356
|
+
* @param task_id Task ID
|
|
357
|
+
* @param bytes_downloaded Bytes downloaded so far
|
|
358
|
+
* @param total_bytes Total bytes to download
|
|
359
|
+
* @return RAC_SUCCESS or error code
|
|
360
|
+
*/
|
|
361
|
+
RAC_API rac_result_t rac_download_manager_update_progress(rac_download_manager_handle_t handle,
|
|
362
|
+
const char* task_id,
|
|
363
|
+
int64_t bytes_downloaded,
|
|
364
|
+
int64_t total_bytes);
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @brief Mark download as completed.
|
|
368
|
+
*
|
|
369
|
+
* Called by platform adapter when HTTP download finishes.
|
|
370
|
+
*
|
|
371
|
+
* @param handle Manager handle
|
|
372
|
+
* @param task_id Task ID
|
|
373
|
+
* @param downloaded_path Path to the downloaded file
|
|
374
|
+
* @return RAC_SUCCESS or error code
|
|
375
|
+
*/
|
|
376
|
+
RAC_API rac_result_t rac_download_manager_mark_complete(rac_download_manager_handle_t handle,
|
|
377
|
+
const char* task_id,
|
|
378
|
+
const char* downloaded_path);
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @brief Mark download as failed.
|
|
382
|
+
*
|
|
383
|
+
* Called by platform adapter when HTTP download fails.
|
|
384
|
+
*
|
|
385
|
+
* @param handle Manager handle
|
|
386
|
+
* @param task_id Task ID
|
|
387
|
+
* @param error_code Error code
|
|
388
|
+
* @param error_message Error message (can be NULL)
|
|
389
|
+
* @return RAC_SUCCESS or error code
|
|
390
|
+
*/
|
|
391
|
+
RAC_API rac_result_t rac_download_manager_mark_failed(rac_download_manager_handle_t handle,
|
|
392
|
+
const char* task_id, rac_result_t error_code,
|
|
393
|
+
const char* error_message);
|
|
394
|
+
|
|
395
|
+
// =============================================================================
|
|
396
|
+
// MEMORY MANAGEMENT
|
|
397
|
+
// =============================================================================
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @brief Free a download task.
|
|
401
|
+
*
|
|
402
|
+
* @param task Task to free
|
|
403
|
+
*/
|
|
404
|
+
RAC_API void rac_download_task_free(rac_download_task_t* task);
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @brief Free an array of task IDs.
|
|
408
|
+
*
|
|
409
|
+
* @param task_ids Array of task IDs
|
|
410
|
+
* @param count Number of task IDs
|
|
411
|
+
*/
|
|
412
|
+
RAC_API void rac_download_task_ids_free(char** task_ids, size_t count);
|
|
413
|
+
|
|
414
|
+
#ifdef __cplusplus
|
|
415
|
+
}
|
|
416
|
+
#endif
|
|
417
|
+
|
|
418
|
+
#endif /* RAC_DOWNLOAD_H */
|
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_endpoints.h
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_endpoints.h
|
|
3
|
+
* @brief API endpoint definitions
|
|
4
|
+
*
|
|
5
|
+
* Defines all API endpoint paths as constants.
|
|
6
|
+
* This is the canonical source of truth - platform SDKs should not duplicate these.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#ifndef RAC_ENDPOINTS_H
|
|
10
|
+
#define RAC_ENDPOINTS_H
|
|
11
|
+
|
|
12
|
+
#include <RACommons/rac_environment.h>
|
|
13
|
+
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
extern "C" {
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// Authentication & Health Endpoints
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
#define RAC_ENDPOINT_AUTHENTICATE "/api/v1/auth/sdk/authenticate"
|
|
23
|
+
#define RAC_ENDPOINT_REFRESH "/api/v1/auth/sdk/refresh"
|
|
24
|
+
#define RAC_ENDPOINT_HEALTH "/v1/health"
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// Device Management - Production/Staging
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
#define RAC_ENDPOINT_DEVICE_REGISTER "/api/v1/devices/register"
|
|
31
|
+
#define RAC_ENDPOINT_TELEMETRY "/api/v1/sdk/telemetry"
|
|
32
|
+
|
|
33
|
+
// =============================================================================
|
|
34
|
+
// Device Management - Development (Supabase REST API)
|
|
35
|
+
// =============================================================================
|
|
36
|
+
|
|
37
|
+
#define RAC_ENDPOINT_DEV_DEVICE_REGISTER "/rest/v1/sdk_devices"
|
|
38
|
+
#define RAC_ENDPOINT_DEV_TELEMETRY "/rest/v1/telemetry_events"
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Model Management
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
#define RAC_ENDPOINT_MODELS_AVAILABLE "/api/v1/models/available"
|
|
45
|
+
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// Environment-Based Endpoint Selection
|
|
48
|
+
// =============================================================================
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @brief Get device registration endpoint for environment
|
|
52
|
+
* @param env The environment
|
|
53
|
+
* @return Endpoint path string
|
|
54
|
+
*/
|
|
55
|
+
const char* rac_endpoint_device_registration(rac_environment_t env);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @brief Get telemetry endpoint for environment
|
|
59
|
+
* @param env The environment
|
|
60
|
+
* @return Endpoint path string
|
|
61
|
+
*/
|
|
62
|
+
const char* rac_endpoint_telemetry(rac_environment_t env);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @brief Build model assignments endpoint with query params
|
|
66
|
+
* @param device_type Device type (e.g., "iphone", "android_phone")
|
|
67
|
+
* @param platform Platform (e.g., "ios", "android")
|
|
68
|
+
* @param out_buffer Buffer to write endpoint path
|
|
69
|
+
* @param buffer_size Size of buffer
|
|
70
|
+
* @return Length of written string, or -1 on error
|
|
71
|
+
*/
|
|
72
|
+
int rac_endpoint_model_assignments(const char* device_type, const char* platform, char* out_buffer,
|
|
73
|
+
size_t buffer_size);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @brief Build model download endpoint
|
|
77
|
+
* @param model_id The model ID
|
|
78
|
+
* @param out_buffer Buffer to write endpoint path
|
|
79
|
+
* @param buffer_size Size of buffer
|
|
80
|
+
* @return Length of written string, or -1 on error
|
|
81
|
+
*/
|
|
82
|
+
int rac_endpoint_model_download(const char* model_id, char* out_buffer, size_t buffer_size);
|
|
83
|
+
|
|
84
|
+
// =============================================================================
|
|
85
|
+
// Full URL Building
|
|
86
|
+
// =============================================================================
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @brief Build full URL from base URL and endpoint
|
|
90
|
+
* @param base_url The base URL (e.g., "https://api.runanywhere.ai")
|
|
91
|
+
* @param endpoint The endpoint path (e.g., "/api/v1/health")
|
|
92
|
+
* @param out_buffer Buffer to write full URL
|
|
93
|
+
* @param buffer_size Size of buffer
|
|
94
|
+
* @return Length of written string, or -1 on error
|
|
95
|
+
*/
|
|
96
|
+
int rac_build_url(const char* base_url, const char* endpoint, char* out_buffer, size_t buffer_size);
|
|
97
|
+
|
|
98
|
+
#ifdef __cplusplus
|
|
99
|
+
}
|
|
100
|
+
#endif
|
|
101
|
+
|
|
102
|
+
#endif // RAC_ENDPOINTS_H
|