@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,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_storage_analyzer.h
|
|
3
|
+
* @brief Storage Analyzer - Centralized Storage Analysis Logic
|
|
4
|
+
*
|
|
5
|
+
* Business logic for storage analysis lives here in C++.
|
|
6
|
+
* Platform-specific file operations are provided via callbacks.
|
|
7
|
+
*
|
|
8
|
+
* Storage structure: `{base_dir}/RunAnywhere/Models/{framework}/{modelId}/`
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_STORAGE_ANALYZER_H
|
|
12
|
+
#define RAC_STORAGE_ANALYZER_H
|
|
13
|
+
|
|
14
|
+
#include <stddef.h>
|
|
15
|
+
#include <stdint.h>
|
|
16
|
+
|
|
17
|
+
#include "rac/core/rac_error.h"
|
|
18
|
+
#include "rac/core/rac_types.h"
|
|
19
|
+
#include "rac/infrastructure/model_management/rac_model_registry.h"
|
|
20
|
+
#include "rac/infrastructure/model_management/rac_model_types.h"
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
extern "C" {
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// DATA STRUCTURES
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @brief Storage metrics for a single model
|
|
32
|
+
*/
|
|
33
|
+
typedef struct {
|
|
34
|
+
/** Model ID */
|
|
35
|
+
const char* model_id;
|
|
36
|
+
|
|
37
|
+
/** Model name */
|
|
38
|
+
const char* model_name;
|
|
39
|
+
|
|
40
|
+
/** Inference framework */
|
|
41
|
+
rac_inference_framework_t framework;
|
|
42
|
+
|
|
43
|
+
/** Local path to model */
|
|
44
|
+
const char* local_path;
|
|
45
|
+
|
|
46
|
+
/** Actual size on disk in bytes */
|
|
47
|
+
int64_t size_on_disk;
|
|
48
|
+
|
|
49
|
+
/** Model format */
|
|
50
|
+
rac_model_format_t format;
|
|
51
|
+
|
|
52
|
+
/** Artifact type info */
|
|
53
|
+
rac_model_artifact_info_t artifact_info;
|
|
54
|
+
} rac_model_storage_metrics_t;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @brief Device storage information
|
|
58
|
+
*/
|
|
59
|
+
typedef struct {
|
|
60
|
+
/** Total device storage in bytes */
|
|
61
|
+
int64_t total_space;
|
|
62
|
+
|
|
63
|
+
/** Free space in bytes */
|
|
64
|
+
int64_t free_space;
|
|
65
|
+
|
|
66
|
+
/** Used space in bytes */
|
|
67
|
+
int64_t used_space;
|
|
68
|
+
} rac_device_storage_t;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @brief App storage information
|
|
72
|
+
*/
|
|
73
|
+
typedef struct {
|
|
74
|
+
/** Documents directory size in bytes */
|
|
75
|
+
int64_t documents_size;
|
|
76
|
+
|
|
77
|
+
/** Cache directory size in bytes */
|
|
78
|
+
int64_t cache_size;
|
|
79
|
+
|
|
80
|
+
/** App support directory size in bytes */
|
|
81
|
+
int64_t app_support_size;
|
|
82
|
+
|
|
83
|
+
/** Total app storage */
|
|
84
|
+
int64_t total_size;
|
|
85
|
+
} rac_app_storage_t;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @brief Storage availability result
|
|
89
|
+
*/
|
|
90
|
+
typedef struct {
|
|
91
|
+
/** Whether storage is available */
|
|
92
|
+
rac_bool_t is_available;
|
|
93
|
+
|
|
94
|
+
/** Required space in bytes */
|
|
95
|
+
int64_t required_space;
|
|
96
|
+
|
|
97
|
+
/** Available space in bytes */
|
|
98
|
+
int64_t available_space;
|
|
99
|
+
|
|
100
|
+
/** Whether there's a warning (low space) */
|
|
101
|
+
rac_bool_t has_warning;
|
|
102
|
+
|
|
103
|
+
/** Recommendation message (may be NULL) */
|
|
104
|
+
const char* recommendation;
|
|
105
|
+
} rac_storage_availability_t;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @brief Overall storage info
|
|
109
|
+
*/
|
|
110
|
+
typedef struct {
|
|
111
|
+
/** App storage */
|
|
112
|
+
rac_app_storage_t app_storage;
|
|
113
|
+
|
|
114
|
+
/** Device storage */
|
|
115
|
+
rac_device_storage_t device_storage;
|
|
116
|
+
|
|
117
|
+
/** Array of model storage metrics */
|
|
118
|
+
rac_model_storage_metrics_t* models;
|
|
119
|
+
|
|
120
|
+
/** Number of models */
|
|
121
|
+
size_t model_count;
|
|
122
|
+
|
|
123
|
+
/** Total size of all models */
|
|
124
|
+
int64_t total_models_size;
|
|
125
|
+
} rac_storage_info_t;
|
|
126
|
+
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// PLATFORM CALLBACKS - Swift/Kotlin implements these
|
|
129
|
+
// =============================================================================
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @brief Callback to calculate directory size
|
|
133
|
+
* @param path Directory path
|
|
134
|
+
* @param user_data User context
|
|
135
|
+
* @return Size in bytes
|
|
136
|
+
*/
|
|
137
|
+
typedef int64_t (*rac_calculate_dir_size_fn)(const char* path, void* user_data);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @brief Callback to get file size
|
|
141
|
+
* @param path File path
|
|
142
|
+
* @param user_data User context
|
|
143
|
+
* @return Size in bytes, or -1 if not found
|
|
144
|
+
*/
|
|
145
|
+
typedef int64_t (*rac_get_file_size_fn)(const char* path, void* user_data);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Callback to check if path exists
|
|
149
|
+
* @param path Path to check
|
|
150
|
+
* @param is_directory Output: true if directory
|
|
151
|
+
* @param user_data User context
|
|
152
|
+
* @return true if exists
|
|
153
|
+
*/
|
|
154
|
+
typedef rac_bool_t (*rac_path_exists_fn)(const char* path, rac_bool_t* is_directory,
|
|
155
|
+
void* user_data);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @brief Callback to get available disk space
|
|
159
|
+
* @param user_data User context
|
|
160
|
+
* @return Available space in bytes
|
|
161
|
+
*/
|
|
162
|
+
typedef int64_t (*rac_get_available_space_fn)(void* user_data);
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @brief Callback to get total disk space
|
|
166
|
+
* @param user_data User context
|
|
167
|
+
* @return Total space in bytes
|
|
168
|
+
*/
|
|
169
|
+
typedef int64_t (*rac_get_total_space_fn)(void* user_data);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @brief Platform callbacks for file operations
|
|
173
|
+
*/
|
|
174
|
+
typedef struct {
|
|
175
|
+
rac_calculate_dir_size_fn calculate_dir_size;
|
|
176
|
+
rac_get_file_size_fn get_file_size;
|
|
177
|
+
rac_path_exists_fn path_exists;
|
|
178
|
+
rac_get_available_space_fn get_available_space;
|
|
179
|
+
rac_get_total_space_fn get_total_space;
|
|
180
|
+
void* user_data;
|
|
181
|
+
} rac_storage_callbacks_t;
|
|
182
|
+
|
|
183
|
+
// =============================================================================
|
|
184
|
+
// STORAGE ANALYZER API
|
|
185
|
+
// =============================================================================
|
|
186
|
+
|
|
187
|
+
/** Opaque handle to storage analyzer */
|
|
188
|
+
typedef struct rac_storage_analyzer* rac_storage_analyzer_handle_t;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @brief Create a storage analyzer with platform callbacks
|
|
192
|
+
*
|
|
193
|
+
* @param callbacks Platform-specific file operation callbacks
|
|
194
|
+
* @param out_handle Output: Created analyzer handle
|
|
195
|
+
* @return RAC_SUCCESS or error code
|
|
196
|
+
*/
|
|
197
|
+
RAC_API rac_result_t rac_storage_analyzer_create(const rac_storage_callbacks_t* callbacks,
|
|
198
|
+
rac_storage_analyzer_handle_t* out_handle);
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @brief Destroy a storage analyzer
|
|
202
|
+
*
|
|
203
|
+
* @param handle Analyzer handle to destroy
|
|
204
|
+
*/
|
|
205
|
+
RAC_API void rac_storage_analyzer_destroy(rac_storage_analyzer_handle_t handle);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @brief Analyze overall storage
|
|
209
|
+
*
|
|
210
|
+
* Business logic in C++:
|
|
211
|
+
* - Gets models from rac_model_registry
|
|
212
|
+
* - Calculates paths via rac_model_paths
|
|
213
|
+
* - Calls platform callbacks for sizes
|
|
214
|
+
* - Aggregates results
|
|
215
|
+
*
|
|
216
|
+
* @param handle Analyzer handle
|
|
217
|
+
* @param registry_handle Model registry handle
|
|
218
|
+
* @param out_info Output: Storage info (caller must call rac_storage_info_free)
|
|
219
|
+
* @return RAC_SUCCESS or error code
|
|
220
|
+
*/
|
|
221
|
+
RAC_API rac_result_t rac_storage_analyzer_analyze(rac_storage_analyzer_handle_t handle,
|
|
222
|
+
rac_model_registry_handle_t registry_handle,
|
|
223
|
+
rac_storage_info_t* out_info);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @brief Get storage metrics for a specific model
|
|
227
|
+
*
|
|
228
|
+
* @param handle Analyzer handle
|
|
229
|
+
* @param registry_handle Model registry handle
|
|
230
|
+
* @param model_id Model identifier
|
|
231
|
+
* @param framework Inference framework
|
|
232
|
+
* @param out_metrics Output: Model metrics
|
|
233
|
+
* @return RAC_SUCCESS or RAC_ERROR_NOT_FOUND
|
|
234
|
+
*/
|
|
235
|
+
RAC_API rac_result_t rac_storage_analyzer_get_model_metrics(
|
|
236
|
+
rac_storage_analyzer_handle_t handle, rac_model_registry_handle_t registry_handle,
|
|
237
|
+
const char* model_id, rac_inference_framework_t framework,
|
|
238
|
+
rac_model_storage_metrics_t* out_metrics);
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* @brief Check if storage is available for a download
|
|
242
|
+
*
|
|
243
|
+
* @param handle Analyzer handle
|
|
244
|
+
* @param model_size Size of model to download
|
|
245
|
+
* @param safety_margin Safety margin (e.g., 0.1 for 10% extra)
|
|
246
|
+
* @param out_availability Output: Availability result
|
|
247
|
+
* @return RAC_SUCCESS or error code
|
|
248
|
+
*/
|
|
249
|
+
RAC_API rac_result_t rac_storage_analyzer_check_available(
|
|
250
|
+
rac_storage_analyzer_handle_t handle, int64_t model_size, double safety_margin,
|
|
251
|
+
rac_storage_availability_t* out_availability);
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @brief Calculate size at a path (file or directory)
|
|
255
|
+
*
|
|
256
|
+
* @param handle Analyzer handle
|
|
257
|
+
* @param path Path to calculate size for
|
|
258
|
+
* @param out_size Output: Size in bytes
|
|
259
|
+
* @return RAC_SUCCESS or error code
|
|
260
|
+
*/
|
|
261
|
+
RAC_API rac_result_t rac_storage_analyzer_calculate_size(rac_storage_analyzer_handle_t handle,
|
|
262
|
+
const char* path, int64_t* out_size);
|
|
263
|
+
|
|
264
|
+
// =============================================================================
|
|
265
|
+
// CLEANUP
|
|
266
|
+
// =============================================================================
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @brief Free storage info returned by rac_storage_analyzer_analyze
|
|
270
|
+
*
|
|
271
|
+
* @param info Storage info to free
|
|
272
|
+
*/
|
|
273
|
+
RAC_API void rac_storage_info_free(rac_storage_info_t* info);
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @brief Free storage availability result
|
|
277
|
+
*
|
|
278
|
+
* @param availability Availability result to free
|
|
279
|
+
*/
|
|
280
|
+
RAC_API void rac_storage_availability_free(rac_storage_availability_t* availability);
|
|
281
|
+
|
|
282
|
+
#ifdef __cplusplus
|
|
283
|
+
}
|
|
284
|
+
#endif
|
|
285
|
+
|
|
286
|
+
#endif /* RAC_STORAGE_ANALYZER_H */
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_telemetry_manager.h
|
|
3
|
+
* @brief Telemetry manager - handles event queuing, batching, and serialization
|
|
4
|
+
*
|
|
5
|
+
* C++ handles all telemetry logic:
|
|
6
|
+
* - Convert analytics events to telemetry payloads
|
|
7
|
+
* - Queue and batch events
|
|
8
|
+
* - Group by modality for production
|
|
9
|
+
* - Serialize to JSON (environment-aware)
|
|
10
|
+
* - Callback to platform SDK for HTTP calls
|
|
11
|
+
*
|
|
12
|
+
* Platform SDKs only need to:
|
|
13
|
+
* - Provide device info
|
|
14
|
+
* - Make HTTP calls when callback is invoked
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#ifndef RAC_TELEMETRY_MANAGER_H
|
|
18
|
+
#define RAC_TELEMETRY_MANAGER_H
|
|
19
|
+
|
|
20
|
+
#include "rac/core/rac_analytics_events.h"
|
|
21
|
+
#include "rac/core/rac_types.h"
|
|
22
|
+
#include "rac/infrastructure/network/rac_environment.h"
|
|
23
|
+
#include "rac/infrastructure/telemetry/rac_telemetry_types.h"
|
|
24
|
+
|
|
25
|
+
#ifdef __cplusplus
|
|
26
|
+
extern "C" {
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// TELEMETRY MANAGER
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @brief Opaque telemetry manager handle
|
|
35
|
+
*/
|
|
36
|
+
typedef struct rac_telemetry_manager rac_telemetry_manager_t;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @brief HTTP request callback from C++ to platform SDK
|
|
40
|
+
*
|
|
41
|
+
* C++ builds the JSON and determines the endpoint.
|
|
42
|
+
* Platform SDK just makes the HTTP call.
|
|
43
|
+
*
|
|
44
|
+
* @param user_data User data provided at registration
|
|
45
|
+
* @param endpoint The API endpoint path (e.g., "/api/v1/sdk/telemetry")
|
|
46
|
+
* @param json_body The JSON request body (null-terminated string)
|
|
47
|
+
* @param json_length Length of JSON body
|
|
48
|
+
* @param requires_auth Whether request needs authentication
|
|
49
|
+
*/
|
|
50
|
+
typedef void (*rac_telemetry_http_callback_t)(void* user_data, const char* endpoint,
|
|
51
|
+
const char* json_body, size_t json_length,
|
|
52
|
+
rac_bool_t requires_auth);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @brief HTTP response callback from platform SDK to C++
|
|
56
|
+
*
|
|
57
|
+
* Platform SDK calls this after HTTP completes.
|
|
58
|
+
*
|
|
59
|
+
* @param manager The telemetry manager
|
|
60
|
+
* @param success Whether HTTP call succeeded
|
|
61
|
+
* @param response_json Response JSON (can be NULL on failure)
|
|
62
|
+
* @param error_message Error message if failed (can be NULL)
|
|
63
|
+
*/
|
|
64
|
+
RAC_API void rac_telemetry_manager_http_complete(rac_telemetry_manager_t* manager,
|
|
65
|
+
rac_bool_t success, const char* response_json,
|
|
66
|
+
const char* error_message);
|
|
67
|
+
|
|
68
|
+
// =============================================================================
|
|
69
|
+
// LIFECYCLE
|
|
70
|
+
// =============================================================================
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @brief Create telemetry manager
|
|
74
|
+
*
|
|
75
|
+
* @param env SDK environment (determines endpoint and encoding)
|
|
76
|
+
* @param device_id Persistent device UUID (from Keychain)
|
|
77
|
+
* @param platform Platform string ("ios", "android", etc.)
|
|
78
|
+
* @param sdk_version SDK version string
|
|
79
|
+
* @return Manager handle or NULL on failure
|
|
80
|
+
*/
|
|
81
|
+
RAC_API rac_telemetry_manager_t* rac_telemetry_manager_create(rac_environment_t env,
|
|
82
|
+
const char* device_id,
|
|
83
|
+
const char* platform,
|
|
84
|
+
const char* sdk_version);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @brief Destroy telemetry manager
|
|
88
|
+
*/
|
|
89
|
+
RAC_API void rac_telemetry_manager_destroy(rac_telemetry_manager_t* manager);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @brief Set device info for telemetry payloads
|
|
93
|
+
*
|
|
94
|
+
* Call this after creating the manager to set device details.
|
|
95
|
+
*/
|
|
96
|
+
RAC_API void rac_telemetry_manager_set_device_info(rac_telemetry_manager_t* manager,
|
|
97
|
+
const char* device_model,
|
|
98
|
+
const char* os_version);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @brief Register HTTP callback
|
|
102
|
+
*
|
|
103
|
+
* Platform SDK must register this to receive HTTP requests.
|
|
104
|
+
*/
|
|
105
|
+
RAC_API void rac_telemetry_manager_set_http_callback(rac_telemetry_manager_t* manager,
|
|
106
|
+
rac_telemetry_http_callback_t callback,
|
|
107
|
+
void* user_data);
|
|
108
|
+
|
|
109
|
+
// =============================================================================
|
|
110
|
+
// EVENT TRACKING
|
|
111
|
+
// =============================================================================
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @brief Track a telemetry payload directly
|
|
115
|
+
*
|
|
116
|
+
* Queues the payload for batching and sending.
|
|
117
|
+
*/
|
|
118
|
+
RAC_API rac_result_t rac_telemetry_manager_track(rac_telemetry_manager_t* manager,
|
|
119
|
+
const rac_telemetry_payload_t* payload);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @brief Track from analytics event data
|
|
123
|
+
*
|
|
124
|
+
* Converts analytics event to telemetry payload and queues it.
|
|
125
|
+
*/
|
|
126
|
+
RAC_API rac_result_t rac_telemetry_manager_track_analytics(rac_telemetry_manager_t* manager,
|
|
127
|
+
rac_event_type_t event_type,
|
|
128
|
+
const rac_analytics_event_data_t* data);
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @brief Flush queued events immediately
|
|
132
|
+
*
|
|
133
|
+
* Sends all queued events to the backend.
|
|
134
|
+
*/
|
|
135
|
+
RAC_API rac_result_t rac_telemetry_manager_flush(rac_telemetry_manager_t* manager);
|
|
136
|
+
|
|
137
|
+
// =============================================================================
|
|
138
|
+
// JSON SERIALIZATION
|
|
139
|
+
// =============================================================================
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @brief Serialize telemetry payload to JSON
|
|
143
|
+
*
|
|
144
|
+
* @param payload The payload to serialize
|
|
145
|
+
* @param env Environment (affects field names and which fields to include)
|
|
146
|
+
* @param out_json Output: JSON string (caller must free with rac_free)
|
|
147
|
+
* @param out_length Output: Length of JSON string
|
|
148
|
+
* @return RAC_SUCCESS or error code
|
|
149
|
+
*/
|
|
150
|
+
RAC_API rac_result_t rac_telemetry_manager_payload_to_json(const rac_telemetry_payload_t* payload,
|
|
151
|
+
rac_environment_t env, char** out_json,
|
|
152
|
+
size_t* out_length);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @brief Serialize batch request to JSON
|
|
156
|
+
*
|
|
157
|
+
* @param request The batch request
|
|
158
|
+
* @param env Environment
|
|
159
|
+
* @param out_json Output: JSON string (caller must free with rac_free)
|
|
160
|
+
* @param out_length Output: Length of JSON string
|
|
161
|
+
* @return RAC_SUCCESS or error code
|
|
162
|
+
*/
|
|
163
|
+
RAC_API rac_result_t
|
|
164
|
+
rac_telemetry_manager_batch_to_json(const rac_telemetry_batch_request_t* request,
|
|
165
|
+
rac_environment_t env, char** out_json, size_t* out_length);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @brief Parse batch response from JSON
|
|
169
|
+
*
|
|
170
|
+
* @param json JSON response string
|
|
171
|
+
* @param out_response Output: Parsed response (caller must free)
|
|
172
|
+
* @return RAC_SUCCESS or error code
|
|
173
|
+
*/
|
|
174
|
+
RAC_API rac_result_t rac_telemetry_manager_parse_response(
|
|
175
|
+
const char* json, rac_telemetry_batch_response_t* out_response);
|
|
176
|
+
|
|
177
|
+
// =============================================================================
|
|
178
|
+
// DEVICE REGISTRATION
|
|
179
|
+
// =============================================================================
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @brief Serialize device registration request to JSON
|
|
183
|
+
*
|
|
184
|
+
* @param request The registration request
|
|
185
|
+
* @param env Environment
|
|
186
|
+
* @param out_json Output: JSON string (caller must free with rac_free)
|
|
187
|
+
* @param out_length Output: Length of JSON string
|
|
188
|
+
* @return RAC_SUCCESS or error code
|
|
189
|
+
*/
|
|
190
|
+
RAC_API rac_result_t
|
|
191
|
+
rac_device_registration_to_json(const rac_device_registration_request_t* request,
|
|
192
|
+
rac_environment_t env, char** out_json, size_t* out_length);
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @brief Get device registration endpoint for environment
|
|
196
|
+
*
|
|
197
|
+
* @param env Environment
|
|
198
|
+
* @return Endpoint path string (static, do not free)
|
|
199
|
+
*/
|
|
200
|
+
RAC_API const char* rac_device_registration_endpoint(rac_environment_t env);
|
|
201
|
+
|
|
202
|
+
#ifdef __cplusplus
|
|
203
|
+
}
|
|
204
|
+
#endif
|
|
205
|
+
|
|
206
|
+
#endif // RAC_TELEMETRY_MANAGER_H
|