@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,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_events.h
|
|
3
|
+
* @brief RunAnywhere Commons - Cross-Platform Event System
|
|
4
|
+
*
|
|
5
|
+
* C++ is the canonical source of truth for all analytics events.
|
|
6
|
+
* Platform SDKs (Swift, Kotlin, Flutter) register callbacks to receive
|
|
7
|
+
* these events and forward them to their native event systems.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* 1. Platform SDK registers callback via rac_events_set_callback()
|
|
11
|
+
* 2. C++ components emit events via rac_event_emit()
|
|
12
|
+
* 3. Platform SDK receives events in callback and converts to native events
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#ifndef RAC_EVENTS_H
|
|
16
|
+
#define RAC_EVENTS_H
|
|
17
|
+
|
|
18
|
+
#include "rac/core/rac_types.h"
|
|
19
|
+
#include "rac/infrastructure/model_management/rac_model_types.h"
|
|
20
|
+
|
|
21
|
+
#ifdef __cplusplus
|
|
22
|
+
extern "C" {
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// EVENT TYPES
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @brief Event type enumeration
|
|
31
|
+
*/
|
|
32
|
+
typedef enum rac_event_type {
|
|
33
|
+
// LLM Events
|
|
34
|
+
RAC_EVENT_LLM_MODEL_LOAD_STARTED = 100,
|
|
35
|
+
RAC_EVENT_LLM_MODEL_LOAD_COMPLETED = 101,
|
|
36
|
+
RAC_EVENT_LLM_MODEL_LOAD_FAILED = 102,
|
|
37
|
+
RAC_EVENT_LLM_MODEL_UNLOADED = 103,
|
|
38
|
+
RAC_EVENT_LLM_GENERATION_STARTED = 110,
|
|
39
|
+
RAC_EVENT_LLM_GENERATION_COMPLETED = 111,
|
|
40
|
+
RAC_EVENT_LLM_GENERATION_FAILED = 112,
|
|
41
|
+
RAC_EVENT_LLM_FIRST_TOKEN = 113,
|
|
42
|
+
RAC_EVENT_LLM_STREAMING_UPDATE = 114,
|
|
43
|
+
|
|
44
|
+
// STT Events
|
|
45
|
+
RAC_EVENT_STT_MODEL_LOAD_STARTED = 200,
|
|
46
|
+
RAC_EVENT_STT_MODEL_LOAD_COMPLETED = 201,
|
|
47
|
+
RAC_EVENT_STT_MODEL_LOAD_FAILED = 202,
|
|
48
|
+
RAC_EVENT_STT_MODEL_UNLOADED = 203,
|
|
49
|
+
RAC_EVENT_STT_TRANSCRIPTION_STARTED = 210,
|
|
50
|
+
RAC_EVENT_STT_TRANSCRIPTION_COMPLETED = 211,
|
|
51
|
+
RAC_EVENT_STT_TRANSCRIPTION_FAILED = 212,
|
|
52
|
+
RAC_EVENT_STT_PARTIAL_TRANSCRIPT = 213,
|
|
53
|
+
|
|
54
|
+
// TTS Events
|
|
55
|
+
RAC_EVENT_TTS_VOICE_LOAD_STARTED = 300,
|
|
56
|
+
RAC_EVENT_TTS_VOICE_LOAD_COMPLETED = 301,
|
|
57
|
+
RAC_EVENT_TTS_VOICE_LOAD_FAILED = 302,
|
|
58
|
+
RAC_EVENT_TTS_VOICE_UNLOADED = 303,
|
|
59
|
+
RAC_EVENT_TTS_SYNTHESIS_STARTED = 310,
|
|
60
|
+
RAC_EVENT_TTS_SYNTHESIS_COMPLETED = 311,
|
|
61
|
+
RAC_EVENT_TTS_SYNTHESIS_FAILED = 312,
|
|
62
|
+
RAC_EVENT_TTS_SYNTHESIS_CHUNK = 313,
|
|
63
|
+
|
|
64
|
+
// VAD Events
|
|
65
|
+
RAC_EVENT_VAD_STARTED = 400,
|
|
66
|
+
RAC_EVENT_VAD_STOPPED = 401,
|
|
67
|
+
RAC_EVENT_VAD_SPEECH_STARTED = 402,
|
|
68
|
+
RAC_EVENT_VAD_SPEECH_ENDED = 403,
|
|
69
|
+
RAC_EVENT_VAD_PAUSED = 404,
|
|
70
|
+
RAC_EVENT_VAD_RESUMED = 405,
|
|
71
|
+
|
|
72
|
+
// VoiceAgent Events
|
|
73
|
+
RAC_EVENT_VOICE_AGENT_TURN_STARTED = 500,
|
|
74
|
+
RAC_EVENT_VOICE_AGENT_TURN_COMPLETED = 501,
|
|
75
|
+
RAC_EVENT_VOICE_AGENT_TURN_FAILED = 502,
|
|
76
|
+
} rac_event_type_t;
|
|
77
|
+
|
|
78
|
+
// =============================================================================
|
|
79
|
+
// EVENT DATA STRUCTURES
|
|
80
|
+
// =============================================================================
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @brief LLM generation event data
|
|
84
|
+
* Used for: GENERATION_STARTED, GENERATION_COMPLETED, GENERATION_FAILED
|
|
85
|
+
*/
|
|
86
|
+
typedef struct rac_llm_generation_event {
|
|
87
|
+
/** Unique generation identifier */
|
|
88
|
+
const char* generation_id;
|
|
89
|
+
/** Model ID used for generation */
|
|
90
|
+
const char* model_id;
|
|
91
|
+
/** Number of input/prompt tokens */
|
|
92
|
+
int32_t input_tokens;
|
|
93
|
+
/** Number of output/completion tokens */
|
|
94
|
+
int32_t output_tokens;
|
|
95
|
+
/** Total duration in milliseconds */
|
|
96
|
+
double duration_ms;
|
|
97
|
+
/** Tokens generated per second */
|
|
98
|
+
double tokens_per_second;
|
|
99
|
+
/** Whether this was a streaming generation */
|
|
100
|
+
rac_bool_t is_streaming;
|
|
101
|
+
/** Time to first token in ms (0 if not streaming or not yet received) */
|
|
102
|
+
double time_to_first_token_ms;
|
|
103
|
+
/** Inference framework used */
|
|
104
|
+
rac_inference_framework_t framework;
|
|
105
|
+
/** Generation temperature (0 if not set) */
|
|
106
|
+
float temperature;
|
|
107
|
+
/** Max tokens setting (0 if not set) */
|
|
108
|
+
int32_t max_tokens;
|
|
109
|
+
/** Context length (0 if not set) */
|
|
110
|
+
int32_t context_length;
|
|
111
|
+
/** Error code (RAC_SUCCESS if no error) */
|
|
112
|
+
rac_result_t error_code;
|
|
113
|
+
/** Error message (NULL if no error) */
|
|
114
|
+
const char* error_message;
|
|
115
|
+
} rac_llm_generation_event_t;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @brief LLM model load event data
|
|
119
|
+
* Used for: MODEL_LOAD_STARTED, MODEL_LOAD_COMPLETED, MODEL_LOAD_FAILED
|
|
120
|
+
*/
|
|
121
|
+
typedef struct rac_llm_model_event {
|
|
122
|
+
/** Model ID */
|
|
123
|
+
const char* model_id;
|
|
124
|
+
/** Model size in bytes (0 if unknown) */
|
|
125
|
+
int64_t model_size_bytes;
|
|
126
|
+
/** Load duration in milliseconds (for completed event) */
|
|
127
|
+
double duration_ms;
|
|
128
|
+
/** Inference framework */
|
|
129
|
+
rac_inference_framework_t framework;
|
|
130
|
+
/** Error code (RAC_SUCCESS if no error) */
|
|
131
|
+
rac_result_t error_code;
|
|
132
|
+
/** Error message (NULL if no error) */
|
|
133
|
+
const char* error_message;
|
|
134
|
+
} rac_llm_model_event_t;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @brief STT transcription event data
|
|
138
|
+
* Used for: TRANSCRIPTION_STARTED, TRANSCRIPTION_COMPLETED, TRANSCRIPTION_FAILED
|
|
139
|
+
*/
|
|
140
|
+
typedef struct rac_stt_transcription_event {
|
|
141
|
+
/** Unique transcription identifier */
|
|
142
|
+
const char* transcription_id;
|
|
143
|
+
/** Model ID used */
|
|
144
|
+
const char* model_id;
|
|
145
|
+
/** Transcribed text (for completed event) */
|
|
146
|
+
const char* text;
|
|
147
|
+
/** Confidence score (0.0 - 1.0) */
|
|
148
|
+
float confidence;
|
|
149
|
+
/** Processing duration in milliseconds */
|
|
150
|
+
double duration_ms;
|
|
151
|
+
/** Audio length in milliseconds */
|
|
152
|
+
double audio_length_ms;
|
|
153
|
+
/** Audio size in bytes */
|
|
154
|
+
int32_t audio_size_bytes;
|
|
155
|
+
/** Word count in result */
|
|
156
|
+
int32_t word_count;
|
|
157
|
+
/** Real-time factor (audio_length / processing_time) */
|
|
158
|
+
double real_time_factor;
|
|
159
|
+
/** Language code */
|
|
160
|
+
const char* language;
|
|
161
|
+
/** Sample rate */
|
|
162
|
+
int32_t sample_rate;
|
|
163
|
+
/** Whether streaming transcription */
|
|
164
|
+
rac_bool_t is_streaming;
|
|
165
|
+
/** Inference framework */
|
|
166
|
+
rac_inference_framework_t framework;
|
|
167
|
+
/** Error code (RAC_SUCCESS if no error) */
|
|
168
|
+
rac_result_t error_code;
|
|
169
|
+
/** Error message (NULL if no error) */
|
|
170
|
+
const char* error_message;
|
|
171
|
+
} rac_stt_transcription_event_t;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @brief TTS synthesis event data
|
|
175
|
+
* Used for: SYNTHESIS_STARTED, SYNTHESIS_COMPLETED, SYNTHESIS_FAILED
|
|
176
|
+
*/
|
|
177
|
+
typedef struct rac_tts_synthesis_event {
|
|
178
|
+
/** Unique synthesis identifier */
|
|
179
|
+
const char* synthesis_id;
|
|
180
|
+
/** Voice/Model ID used */
|
|
181
|
+
const char* model_id;
|
|
182
|
+
/** Character count of input text */
|
|
183
|
+
int32_t character_count;
|
|
184
|
+
/** Audio duration in milliseconds */
|
|
185
|
+
double audio_duration_ms;
|
|
186
|
+
/** Audio size in bytes */
|
|
187
|
+
int32_t audio_size_bytes;
|
|
188
|
+
/** Processing duration in milliseconds */
|
|
189
|
+
double processing_duration_ms;
|
|
190
|
+
/** Characters processed per second */
|
|
191
|
+
double characters_per_second;
|
|
192
|
+
/** Sample rate */
|
|
193
|
+
int32_t sample_rate;
|
|
194
|
+
/** Inference framework */
|
|
195
|
+
rac_inference_framework_t framework;
|
|
196
|
+
/** Error code (RAC_SUCCESS if no error) */
|
|
197
|
+
rac_result_t error_code;
|
|
198
|
+
/** Error message (NULL if no error) */
|
|
199
|
+
const char* error_message;
|
|
200
|
+
} rac_tts_synthesis_event_t;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @brief VAD event data
|
|
204
|
+
* Used for: VAD_STARTED, VAD_STOPPED, VAD_SPEECH_STARTED, VAD_SPEECH_ENDED
|
|
205
|
+
*/
|
|
206
|
+
typedef struct rac_vad_event {
|
|
207
|
+
/** Speech duration in milliseconds (for SPEECH_ENDED) */
|
|
208
|
+
double speech_duration_ms;
|
|
209
|
+
/** Energy level (for speech events) */
|
|
210
|
+
float energy_level;
|
|
211
|
+
} rac_vad_event_t;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @brief Union of all event data types
|
|
215
|
+
*/
|
|
216
|
+
typedef struct rac_event_data {
|
|
217
|
+
rac_event_type_t type;
|
|
218
|
+
union {
|
|
219
|
+
rac_llm_generation_event_t llm_generation;
|
|
220
|
+
rac_llm_model_event_t llm_model;
|
|
221
|
+
rac_stt_transcription_event_t stt_transcription;
|
|
222
|
+
rac_tts_synthesis_event_t tts_synthesis;
|
|
223
|
+
rac_vad_event_t vad;
|
|
224
|
+
} data;
|
|
225
|
+
} rac_event_data_t;
|
|
226
|
+
|
|
227
|
+
// =============================================================================
|
|
228
|
+
// EVENT CALLBACK API
|
|
229
|
+
// =============================================================================
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @brief Event callback function type
|
|
233
|
+
*
|
|
234
|
+
* Platform SDKs implement this callback to receive events from C++.
|
|
235
|
+
*
|
|
236
|
+
* @param type Event type
|
|
237
|
+
* @param data Event data (lifetime: only valid during callback)
|
|
238
|
+
* @param user_data User data provided during registration
|
|
239
|
+
*/
|
|
240
|
+
typedef void (*rac_event_callback_fn)(rac_event_type_t type, const rac_event_data_t* data,
|
|
241
|
+
void* user_data);
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @brief Register event callback
|
|
245
|
+
*
|
|
246
|
+
* Called by platform SDKs at initialization to receive events.
|
|
247
|
+
* Only one callback can be registered at a time.
|
|
248
|
+
*
|
|
249
|
+
* @param callback Callback function (NULL to unregister)
|
|
250
|
+
* @param user_data User data passed to callback
|
|
251
|
+
* @return RAC_SUCCESS or error code
|
|
252
|
+
*/
|
|
253
|
+
RAC_API rac_result_t rac_events_set_callback(rac_event_callback_fn callback, void* user_data);
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @brief Emit an event
|
|
257
|
+
*
|
|
258
|
+
* Called internally by C++ components to emit events.
|
|
259
|
+
* If no callback is registered, event is silently discarded.
|
|
260
|
+
*
|
|
261
|
+
* @param type Event type
|
|
262
|
+
* @param data Event data
|
|
263
|
+
*/
|
|
264
|
+
RAC_API void rac_event_emit(rac_event_type_t type, const rac_event_data_t* data);
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @brief Check if event callback is registered
|
|
268
|
+
*
|
|
269
|
+
* @return RAC_TRUE if callback is registered, RAC_FALSE otherwise
|
|
270
|
+
*/
|
|
271
|
+
RAC_API rac_bool_t rac_events_has_callback(void);
|
|
272
|
+
|
|
273
|
+
// =============================================================================
|
|
274
|
+
// DEFAULT EVENT DATA
|
|
275
|
+
// =============================================================================
|
|
276
|
+
|
|
277
|
+
/** Default LLM generation event */
|
|
278
|
+
static const rac_llm_generation_event_t RAC_LLM_GENERATION_EVENT_DEFAULT = {
|
|
279
|
+
.generation_id = RAC_NULL,
|
|
280
|
+
.model_id = RAC_NULL,
|
|
281
|
+
.input_tokens = 0,
|
|
282
|
+
.output_tokens = 0,
|
|
283
|
+
.duration_ms = 0.0,
|
|
284
|
+
.tokens_per_second = 0.0,
|
|
285
|
+
.is_streaming = RAC_FALSE,
|
|
286
|
+
.time_to_first_token_ms = 0.0,
|
|
287
|
+
.framework = RAC_FRAMEWORK_UNKNOWN,
|
|
288
|
+
.temperature = 0.0f,
|
|
289
|
+
.max_tokens = 0,
|
|
290
|
+
.context_length = 0,
|
|
291
|
+
.error_code = RAC_SUCCESS,
|
|
292
|
+
.error_message = RAC_NULL};
|
|
293
|
+
|
|
294
|
+
/** Default STT transcription event */
|
|
295
|
+
static const rac_stt_transcription_event_t RAC_STT_TRANSCRIPTION_EVENT_DEFAULT = {
|
|
296
|
+
.transcription_id = RAC_NULL,
|
|
297
|
+
.model_id = RAC_NULL,
|
|
298
|
+
.text = RAC_NULL,
|
|
299
|
+
.confidence = 0.0f,
|
|
300
|
+
.duration_ms = 0.0,
|
|
301
|
+
.audio_length_ms = 0.0,
|
|
302
|
+
.audio_size_bytes = 0,
|
|
303
|
+
.word_count = 0,
|
|
304
|
+
.real_time_factor = 0.0,
|
|
305
|
+
.language = RAC_NULL,
|
|
306
|
+
.sample_rate = 0,
|
|
307
|
+
.is_streaming = RAC_FALSE,
|
|
308
|
+
.framework = RAC_FRAMEWORK_UNKNOWN,
|
|
309
|
+
.error_code = RAC_SUCCESS,
|
|
310
|
+
.error_message = RAC_NULL};
|
|
311
|
+
|
|
312
|
+
/** Default TTS synthesis event */
|
|
313
|
+
static const rac_tts_synthesis_event_t RAC_TTS_SYNTHESIS_EVENT_DEFAULT = {
|
|
314
|
+
.synthesis_id = RAC_NULL,
|
|
315
|
+
.model_id = RAC_NULL,
|
|
316
|
+
.character_count = 0,
|
|
317
|
+
.audio_duration_ms = 0.0,
|
|
318
|
+
.audio_size_bytes = 0,
|
|
319
|
+
.processing_duration_ms = 0.0,
|
|
320
|
+
.characters_per_second = 0.0,
|
|
321
|
+
.sample_rate = 0,
|
|
322
|
+
.framework = RAC_FRAMEWORK_UNKNOWN,
|
|
323
|
+
.error_code = RAC_SUCCESS,
|
|
324
|
+
.error_message = RAC_NULL};
|
|
325
|
+
|
|
326
|
+
/** Default VAD event */
|
|
327
|
+
static const rac_vad_event_t RAC_VAD_EVENT_DEFAULT = {.speech_duration_ms = 0.0,
|
|
328
|
+
.energy_level = 0.0f};
|
|
329
|
+
|
|
330
|
+
#ifdef __cplusplus
|
|
331
|
+
}
|
|
332
|
+
#endif
|
|
333
|
+
|
|
334
|
+
#endif /* RAC_EVENTS_H */
|