@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,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TelemetryService.ts
|
|
3
|
+
*
|
|
4
|
+
* Telemetry service for RunAnywhere SDK - aligned with Swift/Kotlin SDKs.
|
|
5
|
+
*
|
|
6
|
+
* ARCHITECTURE:
|
|
7
|
+
* - C++ telemetry manager handles all event logic (batching, JSON building, routing)
|
|
8
|
+
* - Platform SDK only provides HTTP transport (handled in C++ via platform callbacks)
|
|
9
|
+
* - Events are automatically tracked by C++ when using LLM/STT/TTS/VAD capabilities
|
|
10
|
+
*
|
|
11
|
+
* This TypeScript service provides:
|
|
12
|
+
* - A thin wrapper to flush telemetry via native C++ calls
|
|
13
|
+
* - Convenience methods that match the Swift/Kotlin API
|
|
14
|
+
* - SDK-level events that TypeScript code can emit
|
|
15
|
+
*
|
|
16
|
+
* Reference: sdk/runanywhere-swift/Sources/RunAnywhere/Foundation/Bridge/Extensions/CppBridge+Telemetry.swift
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
20
|
+
import type { RunAnywhereCore } from '../../specs/RunAnywhereCore.nitro';
|
|
21
|
+
import { SDKLogger } from '../../Foundation/Logging/Logger/SDKLogger';
|
|
22
|
+
import { SDKEnvironment } from '../../types/enums';
|
|
23
|
+
|
|
24
|
+
const logger = new SDKLogger('TelemetryService');
|
|
25
|
+
|
|
26
|
+
// Lazy-loaded native module
|
|
27
|
+
let _nativeModule: RunAnywhereCore | null = null;
|
|
28
|
+
|
|
29
|
+
function getNativeModule(): RunAnywhereCore {
|
|
30
|
+
if (!_nativeModule) {
|
|
31
|
+
_nativeModule = NitroModules.createHybridObject<RunAnywhereCore>('RunAnywhereCore');
|
|
32
|
+
}
|
|
33
|
+
return _nativeModule;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Telemetry event categories (matches C++ categories)
|
|
38
|
+
*/
|
|
39
|
+
export enum TelemetryCategory {
|
|
40
|
+
SDK = 'sdk',
|
|
41
|
+
Model = 'model',
|
|
42
|
+
LLM = 'llm',
|
|
43
|
+
STT = 'stt',
|
|
44
|
+
TTS = 'tts',
|
|
45
|
+
VAD = 'vad',
|
|
46
|
+
VoiceAgent = 'voice_agent',
|
|
47
|
+
Error = 'error',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* TelemetryService - Event tracking for RunAnywhere SDK
|
|
52
|
+
*
|
|
53
|
+
* This service delegates to the C++ telemetry manager, which handles:
|
|
54
|
+
* - Batching events
|
|
55
|
+
* - Building JSON payloads
|
|
56
|
+
* - HTTP transport via platform-native callbacks
|
|
57
|
+
*
|
|
58
|
+
* Automatic telemetry:
|
|
59
|
+
* - LLM/STT/TTS/VAD events are tracked automatically by C++ when you use those capabilities
|
|
60
|
+
* - No manual tracking needed for model operations
|
|
61
|
+
*
|
|
62
|
+
* Manual telemetry:
|
|
63
|
+
* - Use track() for SDK-level events (e.g., app lifecycle)
|
|
64
|
+
* - Events are emitted to C++ analytics system which routes them to telemetry
|
|
65
|
+
*
|
|
66
|
+
* Usage:
|
|
67
|
+
* ```typescript
|
|
68
|
+
* // Flush pending events (e.g., on app background)
|
|
69
|
+
* await TelemetryService.shared.flush();
|
|
70
|
+
*
|
|
71
|
+
* // Check if telemetry is ready
|
|
72
|
+
* const isReady = await TelemetryService.shared.isInitialized();
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export class TelemetryService {
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// Singleton
|
|
78
|
+
// ============================================================================
|
|
79
|
+
|
|
80
|
+
private static _instance: TelemetryService | null = null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get shared TelemetryService instance
|
|
84
|
+
*/
|
|
85
|
+
static get shared(): TelemetryService {
|
|
86
|
+
if (!TelemetryService._instance) {
|
|
87
|
+
TelemetryService._instance = new TelemetryService();
|
|
88
|
+
}
|
|
89
|
+
return TelemetryService._instance;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// State
|
|
94
|
+
// ============================================================================
|
|
95
|
+
|
|
96
|
+
private enabled: boolean = true;
|
|
97
|
+
private deviceId: string | null = null;
|
|
98
|
+
private environment: SDKEnvironment = SDKEnvironment.Production;
|
|
99
|
+
|
|
100
|
+
// ============================================================================
|
|
101
|
+
// Initialization
|
|
102
|
+
// ============================================================================
|
|
103
|
+
|
|
104
|
+
private constructor() {}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Configure telemetry service
|
|
108
|
+
*
|
|
109
|
+
* Note: The actual C++ telemetry manager is initialized during SDK init.
|
|
110
|
+
* This method just stores the configuration for reference.
|
|
111
|
+
*/
|
|
112
|
+
configure(deviceId: string, environment: SDKEnvironment): void {
|
|
113
|
+
this.deviceId = deviceId;
|
|
114
|
+
this.environment = environment;
|
|
115
|
+
logger.debug(`Configured for ${environment} environment`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Enable or disable telemetry
|
|
120
|
+
*/
|
|
121
|
+
setEnabled(enabled: boolean): void {
|
|
122
|
+
this.enabled = enabled;
|
|
123
|
+
logger.debug(`Telemetry ${enabled ? 'enabled' : 'disabled'}`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Check if telemetry is enabled
|
|
128
|
+
*/
|
|
129
|
+
isEnabled(): boolean {
|
|
130
|
+
return this.enabled;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ============================================================================
|
|
134
|
+
// Core Telemetry Operations (Delegate to C++)
|
|
135
|
+
// ============================================================================
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Check if telemetry is initialized
|
|
139
|
+
*
|
|
140
|
+
* Returns true if the C++ telemetry manager is ready to accept events.
|
|
141
|
+
*/
|
|
142
|
+
async isInitialized(): Promise<boolean> {
|
|
143
|
+
try {
|
|
144
|
+
return await getNativeModule().isTelemetryInitialized();
|
|
145
|
+
} catch (error) {
|
|
146
|
+
logger.error(`Failed to check telemetry initialization: ${error}`);
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Flush pending telemetry events
|
|
153
|
+
*
|
|
154
|
+
* Sends all queued events to the backend immediately.
|
|
155
|
+
* Call this on app background/exit to ensure events are sent.
|
|
156
|
+
*/
|
|
157
|
+
async flush(): Promise<void> {
|
|
158
|
+
if (!this.enabled) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
try {
|
|
163
|
+
await getNativeModule().flushTelemetry();
|
|
164
|
+
logger.debug('Telemetry flushed');
|
|
165
|
+
} catch (error) {
|
|
166
|
+
logger.error(`Failed to flush telemetry: ${error}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Shutdown telemetry service
|
|
172
|
+
*
|
|
173
|
+
* Flushes any pending events before stopping.
|
|
174
|
+
*/
|
|
175
|
+
async shutdown(): Promise<void> {
|
|
176
|
+
try {
|
|
177
|
+
await this.flush();
|
|
178
|
+
logger.debug('Telemetry shutdown complete');
|
|
179
|
+
} catch (error) {
|
|
180
|
+
logger.error(`Telemetry shutdown error: ${error}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ============================================================================
|
|
185
|
+
// Convenience Methods (for backwards compatibility)
|
|
186
|
+
//
|
|
187
|
+
// Note: These methods exist for API compatibility, but most telemetry
|
|
188
|
+
// is automatically tracked by C++ when using LLM/STT/TTS/VAD capabilities.
|
|
189
|
+
// You typically don't need to call these manually.
|
|
190
|
+
// ============================================================================
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Track an event (emits to C++ analytics system)
|
|
194
|
+
*
|
|
195
|
+
* Note: Most telemetry is automatic. Use this for custom SDK-level events.
|
|
196
|
+
*/
|
|
197
|
+
track(
|
|
198
|
+
_type: string,
|
|
199
|
+
_category: TelemetryCategory = TelemetryCategory.SDK,
|
|
200
|
+
_properties?: Record<string, unknown>
|
|
201
|
+
): void {
|
|
202
|
+
if (!this.enabled) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Note: In the full C++ implementation, this would call native.emitEvent()
|
|
207
|
+
// to route to the C++ analytics system. For now, we log a debug message.
|
|
208
|
+
// The C++ telemetry manager handles actual event tracking.
|
|
209
|
+
logger.debug(`Event tracked: ${_type} (handled by C++ telemetry)`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Track SDK initialization
|
|
214
|
+
*/
|
|
215
|
+
trackSDKInit(environment: string, success: boolean): void {
|
|
216
|
+
this.track('sdk_initialized', TelemetryCategory.SDK, {
|
|
217
|
+
environment,
|
|
218
|
+
success,
|
|
219
|
+
sdkVersion: '0.2.0',
|
|
220
|
+
platform: 'react-native',
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Track model loading
|
|
226
|
+
*
|
|
227
|
+
* Note: Model loading events are automatically tracked by C++ when you
|
|
228
|
+
* call loadTextModel(), loadSTTModel(), etc.
|
|
229
|
+
*/
|
|
230
|
+
trackModelLoad(
|
|
231
|
+
modelId: string,
|
|
232
|
+
modelType: string,
|
|
233
|
+
success: boolean,
|
|
234
|
+
loadTimeMs?: number
|
|
235
|
+
): void {
|
|
236
|
+
this.track('model_loaded', TelemetryCategory.Model, {
|
|
237
|
+
modelId,
|
|
238
|
+
modelType,
|
|
239
|
+
success,
|
|
240
|
+
loadTimeMs,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Track text generation
|
|
246
|
+
*
|
|
247
|
+
* Note: Generation events are automatically tracked by C++ when you
|
|
248
|
+
* call generate() or generateStream().
|
|
249
|
+
*/
|
|
250
|
+
trackGeneration(
|
|
251
|
+
modelId: string,
|
|
252
|
+
promptTokens: number,
|
|
253
|
+
completionTokens: number,
|
|
254
|
+
latencyMs: number
|
|
255
|
+
): void {
|
|
256
|
+
this.track('generation_completed', TelemetryCategory.LLM, {
|
|
257
|
+
modelId,
|
|
258
|
+
promptTokens,
|
|
259
|
+
completionTokens,
|
|
260
|
+
latencyMs,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Track transcription
|
|
266
|
+
*
|
|
267
|
+
* Note: Transcription events are automatically tracked by C++ when you
|
|
268
|
+
* call transcribe() or transcribeFile().
|
|
269
|
+
*/
|
|
270
|
+
trackTranscription(
|
|
271
|
+
modelId: string,
|
|
272
|
+
audioDurationMs: number,
|
|
273
|
+
latencyMs: number
|
|
274
|
+
): void {
|
|
275
|
+
this.track('transcription_completed', TelemetryCategory.STT, {
|
|
276
|
+
modelId,
|
|
277
|
+
audioDurationMs,
|
|
278
|
+
latencyMs,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Track speech synthesis
|
|
284
|
+
*
|
|
285
|
+
* Note: Synthesis events are automatically tracked by C++ when you
|
|
286
|
+
* call synthesize().
|
|
287
|
+
*/
|
|
288
|
+
trackSynthesis(
|
|
289
|
+
voiceId: string,
|
|
290
|
+
textLength: number,
|
|
291
|
+
audioDurationMs: number,
|
|
292
|
+
latencyMs: number
|
|
293
|
+
): void {
|
|
294
|
+
this.track('synthesis_completed', TelemetryCategory.TTS, {
|
|
295
|
+
voiceId,
|
|
296
|
+
textLength,
|
|
297
|
+
audioDurationMs,
|
|
298
|
+
latencyMs,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Track error
|
|
304
|
+
*/
|
|
305
|
+
trackError(
|
|
306
|
+
errorCode: string,
|
|
307
|
+
errorMessage: string,
|
|
308
|
+
context?: Record<string, unknown>
|
|
309
|
+
): void {
|
|
310
|
+
this.track('error', TelemetryCategory.Error, {
|
|
311
|
+
errorCode,
|
|
312
|
+
errorMessage,
|
|
313
|
+
...context,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default TelemetryService;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network Services
|
|
3
|
+
*
|
|
4
|
+
* Centralized network layer for RunAnywhere React Native SDK.
|
|
5
|
+
* Uses React Native's built-in fetch API for HTTP requests.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Core HTTP service
|
|
9
|
+
export { HTTPService, SDKEnvironment } from './HTTPService';
|
|
10
|
+
export type { HTTPServiceConfig, DevModeConfig } from './HTTPService';
|
|
11
|
+
|
|
12
|
+
// Configuration utilities
|
|
13
|
+
export {
|
|
14
|
+
createNetworkConfig,
|
|
15
|
+
getEnvironmentName,
|
|
16
|
+
isDevelopment,
|
|
17
|
+
isProduction,
|
|
18
|
+
DEFAULT_BASE_URL,
|
|
19
|
+
DEFAULT_TIMEOUT_MS,
|
|
20
|
+
} from './NetworkConfiguration';
|
|
21
|
+
export type { NetworkConfig } from './NetworkConfiguration';
|
|
22
|
+
|
|
23
|
+
// API endpoints
|
|
24
|
+
export { APIEndpoints } from './APIEndpoints';
|
|
25
|
+
export type { APIEndpointKey, APIEndpointValue } from './APIEndpoints';
|
|
26
|
+
|
|
27
|
+
// Telemetry
|
|
28
|
+
export { TelemetryService, TelemetryCategory } from './TelemetryService';
|
|
29
|
+
export type { TelemetryEvent } from './TelemetryService';
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SystemTTSService.ts
|
|
3
|
+
*
|
|
4
|
+
* System TTS service wrapper.
|
|
5
|
+
* Delegates to native platform TTS.
|
|
6
|
+
*
|
|
7
|
+
* Reference: sdk/runanywhere-swift/Sources/RunAnywhere/Features/TTS/System/SystemTTSService.swift
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { requireNativeModule, isNativeModuleAvailable } from '../native';
|
|
11
|
+
import { SDKLogger } from '../Foundation/Logging/Logger/SDKLogger';
|
|
12
|
+
|
|
13
|
+
const logger = new SDKLogger('SystemTTSService');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* TTS Voice
|
|
17
|
+
*/
|
|
18
|
+
export interface TTSVoice {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
language: string;
|
|
22
|
+
quality: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Platform-specific voices
|
|
27
|
+
*/
|
|
28
|
+
export const PlatformVoices = {
|
|
29
|
+
ios: [] as TTSVoice[],
|
|
30
|
+
android: [] as TTSVoice[],
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get voices by language
|
|
35
|
+
*/
|
|
36
|
+
export async function getVoicesByLanguage(language: string): Promise<TTSVoice[]> {
|
|
37
|
+
if (!isNativeModuleAvailable()) return [];
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const native = requireNativeModule();
|
|
41
|
+
const json = await native.getTTSVoices();
|
|
42
|
+
const voices: TTSVoice[] = JSON.parse(json);
|
|
43
|
+
return voices.filter(v => v.language.startsWith(language));
|
|
44
|
+
} catch (error) {
|
|
45
|
+
logger.warning('Failed to get voices:', { error });
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get default voice
|
|
52
|
+
*/
|
|
53
|
+
export async function getDefaultVoice(): Promise<TTSVoice | null> {
|
|
54
|
+
if (!isNativeModuleAvailable()) return null;
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const native = requireNativeModule();
|
|
58
|
+
const json = await native.getTTSVoices();
|
|
59
|
+
const voices: TTSVoice[] = JSON.parse(json);
|
|
60
|
+
return voices[0] ?? null;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get platform default voice
|
|
68
|
+
*/
|
|
69
|
+
export function getPlatformDefaultVoice(): TTSVoice | null {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* System TTS Service
|
|
75
|
+
*/
|
|
76
|
+
export class SystemTTSService {
|
|
77
|
+
private static _instance: SystemTTSService | null = null;
|
|
78
|
+
|
|
79
|
+
static get shared(): SystemTTSService {
|
|
80
|
+
if (!SystemTTSService._instance) {
|
|
81
|
+
SystemTTSService._instance = new SystemTTSService();
|
|
82
|
+
}
|
|
83
|
+
return SystemTTSService._instance;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Synthesize text to speech
|
|
88
|
+
*/
|
|
89
|
+
async synthesize(
|
|
90
|
+
text: string,
|
|
91
|
+
voiceId?: string,
|
|
92
|
+
speedRate = 1.0,
|
|
93
|
+
pitchShift = 1.0
|
|
94
|
+
): Promise<string> {
|
|
95
|
+
if (!isNativeModuleAvailable()) {
|
|
96
|
+
throw new Error('Native module not available');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const native = requireNativeModule();
|
|
100
|
+
return native.synthesize(text, voiceId ?? '', speedRate, pitchShift);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Get available voices
|
|
105
|
+
*/
|
|
106
|
+
async getVoices(): Promise<TTSVoice[]> {
|
|
107
|
+
if (!isNativeModuleAvailable()) return [];
|
|
108
|
+
|
|
109
|
+
const native = requireNativeModule();
|
|
110
|
+
const json = await native.getTTSVoices();
|
|
111
|
+
return JSON.parse(json);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Cancel synthesis
|
|
116
|
+
*/
|
|
117
|
+
async cancel(): Promise<void> {
|
|
118
|
+
if (!isNativeModuleAvailable()) return;
|
|
119
|
+
|
|
120
|
+
const native = requireNativeModule();
|
|
121
|
+
await native.cancelTTS();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Reset singleton (for testing)
|
|
126
|
+
*/
|
|
127
|
+
static reset(): void {
|
|
128
|
+
SystemTTSService._instance = null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RunAnywhere React Native SDK - Services
|
|
3
|
+
*
|
|
4
|
+
* Core services for SDK functionality.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Model Registry - Manages model discovery and registration (JS-based)
|
|
8
|
+
export {
|
|
9
|
+
ModelRegistry,
|
|
10
|
+
type ModelCriteria,
|
|
11
|
+
type AddModelFromURLOptions,
|
|
12
|
+
} from './ModelRegistry';
|
|
13
|
+
|
|
14
|
+
// File System - Cross-platform file operations using react-native-fs
|
|
15
|
+
export {
|
|
16
|
+
FileSystem,
|
|
17
|
+
ArchiveType,
|
|
18
|
+
ArchiveStructure,
|
|
19
|
+
type ModelArtifactType,
|
|
20
|
+
type DownloadProgress as FSDownloadProgress,
|
|
21
|
+
type ExtractionResult,
|
|
22
|
+
} from './FileSystem';
|
|
23
|
+
|
|
24
|
+
// Download Service - Native-based download (delegates to native commons)
|
|
25
|
+
export {
|
|
26
|
+
DownloadService,
|
|
27
|
+
DownloadState,
|
|
28
|
+
type DownloadProgress,
|
|
29
|
+
type DownloadTask,
|
|
30
|
+
type DownloadConfiguration,
|
|
31
|
+
type ProgressCallback,
|
|
32
|
+
} from './DownloadService';
|
|
33
|
+
|
|
34
|
+
// TTS Service - Native implementation available
|
|
35
|
+
export {
|
|
36
|
+
SystemTTSService,
|
|
37
|
+
getVoicesByLanguage,
|
|
38
|
+
getDefaultVoice,
|
|
39
|
+
getPlatformDefaultVoice,
|
|
40
|
+
PlatformVoices,
|
|
41
|
+
} from './SystemTTSService';
|
|
42
|
+
|
|
43
|
+
// Network Layer - HTTP service using axios (industry standard)
|
|
44
|
+
export {
|
|
45
|
+
// HTTP Service
|
|
46
|
+
HTTPService,
|
|
47
|
+
SDKEnvironment,
|
|
48
|
+
type HTTPServiceConfig,
|
|
49
|
+
type DevModeConfig,
|
|
50
|
+
// Configuration
|
|
51
|
+
createNetworkConfig,
|
|
52
|
+
getEnvironmentName,
|
|
53
|
+
isDevelopment,
|
|
54
|
+
isProduction,
|
|
55
|
+
DEFAULT_BASE_URL,
|
|
56
|
+
DEFAULT_TIMEOUT_MS,
|
|
57
|
+
type NetworkConfig,
|
|
58
|
+
// Telemetry
|
|
59
|
+
TelemetryService,
|
|
60
|
+
TelemetryCategory,
|
|
61
|
+
type TelemetryEvent,
|
|
62
|
+
// Endpoints
|
|
63
|
+
APIEndpoints,
|
|
64
|
+
type APIEndpointKey,
|
|
65
|
+
type APIEndpointValue,
|
|
66
|
+
} from './Network';
|