@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,612 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_voice_agent.h
|
|
3
|
+
* @brief Voice Agent Capability - Full Voice Conversation Pipeline
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's VoiceAgentCapability.swift
|
|
6
|
+
* Swift Source: Sources/RunAnywhere/Features/VoiceAgent/VoiceAgentCapability.swift
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This is a direct translation of the Swift implementation.
|
|
9
|
+
* Do NOT add features not present in the Swift code.
|
|
10
|
+
*
|
|
11
|
+
* Composes STT, LLM, TTS, and VAD capabilities for end-to-end voice processing.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef RAC_VOICE_AGENT_H
|
|
15
|
+
#define RAC_VOICE_AGENT_H
|
|
16
|
+
|
|
17
|
+
#include "rac/core/rac_error.h"
|
|
18
|
+
#include "rac/core/rac_types.h"
|
|
19
|
+
#include "rac/features/llm/rac_llm_types.h"
|
|
20
|
+
#include "rac/features/stt/rac_stt_types.h"
|
|
21
|
+
#include "rac/features/tts/rac_tts_types.h"
|
|
22
|
+
#include "rac/features/vad/rac_vad_types.h"
|
|
23
|
+
|
|
24
|
+
#ifdef __cplusplus
|
|
25
|
+
extern "C" {
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// CONSTANTS - Voice Agent Timing Defaults
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
/** Default timeout for waiting for speech input (seconds) */
|
|
33
|
+
#define RAC_VOICE_AGENT_DEFAULT_SPEECH_TIMEOUT_SEC 10.0
|
|
34
|
+
|
|
35
|
+
/** Default maximum recording duration (seconds) */
|
|
36
|
+
#define RAC_VOICE_AGENT_DEFAULT_MAX_RECORDING_DURATION_SEC 30.0
|
|
37
|
+
|
|
38
|
+
/** Default pause duration to end recording (seconds) */
|
|
39
|
+
#define RAC_VOICE_AGENT_DEFAULT_END_OF_SPEECH_PAUSE_SEC 1.5
|
|
40
|
+
|
|
41
|
+
/** Maximum time to wait for LLM response (seconds) */
|
|
42
|
+
#define RAC_VOICE_AGENT_LLM_RESPONSE_TIMEOUT_SEC 30.0
|
|
43
|
+
|
|
44
|
+
/** Maximum time to wait for TTS synthesis (seconds) */
|
|
45
|
+
#define RAC_VOICE_AGENT_TTS_RESPONSE_TIMEOUT_SEC 15.0
|
|
46
|
+
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// TYPES - Mirrors Swift's VoiceAgentConfiguration and VoiceAgentResult
|
|
49
|
+
// =============================================================================
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @brief Audio pipeline state - Mirrors Swift's AudioPipelineState enum
|
|
53
|
+
*
|
|
54
|
+
* Represents the current state of the audio pipeline to prevent feedback loops.
|
|
55
|
+
* See: Sources/RunAnywhere/Features/VoiceAgent/Models/AudioPipelineState.swift
|
|
56
|
+
*/
|
|
57
|
+
typedef enum rac_audio_pipeline_state {
|
|
58
|
+
RAC_AUDIO_PIPELINE_IDLE = 0, /**< System is idle, ready to start listening */
|
|
59
|
+
RAC_AUDIO_PIPELINE_LISTENING = 1, /**< Actively listening for speech via VAD */
|
|
60
|
+
RAC_AUDIO_PIPELINE_PROCESSING_SPEECH = 2, /**< Processing detected speech with STT */
|
|
61
|
+
RAC_AUDIO_PIPELINE_GENERATING_RESPONSE = 3, /**< Generating response with LLM */
|
|
62
|
+
RAC_AUDIO_PIPELINE_PLAYING_TTS = 4, /**< Playing TTS output */
|
|
63
|
+
RAC_AUDIO_PIPELINE_COOLDOWN = 5, /**< Cooldown period after TTS to prevent feedback */
|
|
64
|
+
RAC_AUDIO_PIPELINE_ERROR = 6 /**< Error state requiring reset */
|
|
65
|
+
} rac_audio_pipeline_state_t;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @brief Get string representation of audio pipeline state
|
|
69
|
+
*
|
|
70
|
+
* @param state The pipeline state
|
|
71
|
+
* @return State name string (static, do not free)
|
|
72
|
+
*/
|
|
73
|
+
RAC_API const char* rac_audio_pipeline_state_name(rac_audio_pipeline_state_t state);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @brief Voice agent event types.
|
|
77
|
+
* Mirrors Swift's VoiceAgentEvent enum.
|
|
78
|
+
*/
|
|
79
|
+
typedef enum rac_voice_agent_event_type {
|
|
80
|
+
RAC_VOICE_AGENT_EVENT_PROCESSED = 0, /**< Complete processing result */
|
|
81
|
+
RAC_VOICE_AGENT_EVENT_VAD_TRIGGERED = 1, /**< VAD triggered (speech detected/ended) */
|
|
82
|
+
RAC_VOICE_AGENT_EVENT_TRANSCRIPTION = 2, /**< Transcription available from STT */
|
|
83
|
+
RAC_VOICE_AGENT_EVENT_RESPONSE = 3, /**< Response generated from LLM */
|
|
84
|
+
RAC_VOICE_AGENT_EVENT_AUDIO_SYNTHESIZED = 4, /**< Audio synthesized from TTS */
|
|
85
|
+
RAC_VOICE_AGENT_EVENT_ERROR = 5 /**< Error occurred during processing */
|
|
86
|
+
} rac_voice_agent_event_type_t;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @brief VAD configuration for voice agent.
|
|
90
|
+
* Mirrors Swift's VADConfiguration.
|
|
91
|
+
*/
|
|
92
|
+
typedef struct rac_voice_agent_vad_config {
|
|
93
|
+
/** Sample rate (default: 16000) */
|
|
94
|
+
int32_t sample_rate;
|
|
95
|
+
|
|
96
|
+
/** Frame length in seconds (default: 0.1) */
|
|
97
|
+
float frame_length;
|
|
98
|
+
|
|
99
|
+
/** Energy threshold (default: 0.005) */
|
|
100
|
+
float energy_threshold;
|
|
101
|
+
} rac_voice_agent_vad_config_t;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @brief Default VAD configuration.
|
|
105
|
+
*/
|
|
106
|
+
static const rac_voice_agent_vad_config_t RAC_VOICE_AGENT_VAD_CONFIG_DEFAULT = {
|
|
107
|
+
.sample_rate = 16000, .frame_length = 0.1f, .energy_threshold = 0.005f};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @brief STT configuration for voice agent.
|
|
111
|
+
* Mirrors Swift's STTConfiguration.
|
|
112
|
+
*/
|
|
113
|
+
typedef struct rac_voice_agent_stt_config {
|
|
114
|
+
/** Model path - file path used for loading (can be NULL to use already-loaded model) */
|
|
115
|
+
const char* model_path;
|
|
116
|
+
/** Model ID - identifier for telemetry (e.g., "whisper-base") */
|
|
117
|
+
const char* model_id;
|
|
118
|
+
/** Model name - human-readable name (e.g., "Whisper Base") */
|
|
119
|
+
const char* model_name;
|
|
120
|
+
} rac_voice_agent_stt_config_t;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @brief LLM configuration for voice agent.
|
|
124
|
+
* Mirrors Swift's LLMConfiguration.
|
|
125
|
+
*/
|
|
126
|
+
typedef struct rac_voice_agent_llm_config {
|
|
127
|
+
/** Model path - file path used for loading (can be NULL to use already-loaded model) */
|
|
128
|
+
const char* model_path;
|
|
129
|
+
/** Model ID - identifier for telemetry (e.g., "llama-3.2-1b") */
|
|
130
|
+
const char* model_id;
|
|
131
|
+
/** Model name - human-readable name (e.g., "Llama 3.2 1B Instruct") */
|
|
132
|
+
const char* model_name;
|
|
133
|
+
} rac_voice_agent_llm_config_t;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @brief TTS configuration for voice agent.
|
|
137
|
+
* Mirrors Swift's TTSConfiguration.
|
|
138
|
+
*/
|
|
139
|
+
typedef struct rac_voice_agent_tts_config {
|
|
140
|
+
/** Voice path - file path used for loading (can be NULL/empty to use already-loaded voice) */
|
|
141
|
+
const char* voice_path;
|
|
142
|
+
/** Voice ID - identifier for telemetry (e.g., "vits-piper-en_GB-alba-medium") */
|
|
143
|
+
const char* voice_id;
|
|
144
|
+
/** Voice name - human-readable name (e.g., "Piper TTS (British English)") */
|
|
145
|
+
const char* voice_name;
|
|
146
|
+
} rac_voice_agent_tts_config_t;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @brief Voice agent configuration.
|
|
150
|
+
* Mirrors Swift's VoiceAgentConfiguration.
|
|
151
|
+
*/
|
|
152
|
+
typedef struct rac_voice_agent_config {
|
|
153
|
+
/** VAD configuration */
|
|
154
|
+
rac_voice_agent_vad_config_t vad_config;
|
|
155
|
+
|
|
156
|
+
/** STT configuration */
|
|
157
|
+
rac_voice_agent_stt_config_t stt_config;
|
|
158
|
+
|
|
159
|
+
/** LLM configuration */
|
|
160
|
+
rac_voice_agent_llm_config_t llm_config;
|
|
161
|
+
|
|
162
|
+
/** TTS configuration */
|
|
163
|
+
rac_voice_agent_tts_config_t tts_config;
|
|
164
|
+
} rac_voice_agent_config_t;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief Default voice agent configuration.
|
|
168
|
+
*/
|
|
169
|
+
static const rac_voice_agent_config_t RAC_VOICE_AGENT_CONFIG_DEFAULT = {
|
|
170
|
+
.vad_config = {.sample_rate = 16000, .frame_length = 0.1f, .energy_threshold = 0.005f},
|
|
171
|
+
.stt_config = {.model_path = RAC_NULL, .model_id = RAC_NULL, .model_name = RAC_NULL},
|
|
172
|
+
.llm_config = {.model_path = RAC_NULL, .model_id = RAC_NULL, .model_name = RAC_NULL},
|
|
173
|
+
.tts_config = {.voice_path = RAC_NULL, .voice_id = RAC_NULL, .voice_name = RAC_NULL}};
|
|
174
|
+
|
|
175
|
+
// =============================================================================
|
|
176
|
+
// AUDIO PIPELINE STATE MANAGER CONFIG - Mirrors Swift's AudioPipelineStateManager.Configuration
|
|
177
|
+
// =============================================================================
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @brief Audio pipeline state manager configuration
|
|
181
|
+
*
|
|
182
|
+
* Mirrors Swift's AudioPipelineStateManager.Configuration struct.
|
|
183
|
+
* See: Sources/RunAnywhere/Features/VoiceAgent/Models/AudioPipelineState.swift
|
|
184
|
+
*/
|
|
185
|
+
typedef struct rac_audio_pipeline_config {
|
|
186
|
+
/** Duration to wait after TTS before allowing microphone (seconds) */
|
|
187
|
+
float cooldown_duration;
|
|
188
|
+
|
|
189
|
+
/** Whether to enforce strict state transitions */
|
|
190
|
+
rac_bool_t strict_transitions;
|
|
191
|
+
|
|
192
|
+
/** Maximum TTS duration before forced timeout (seconds) */
|
|
193
|
+
float max_tts_duration;
|
|
194
|
+
} rac_audio_pipeline_config_t;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @brief Default audio pipeline configuration
|
|
198
|
+
*/
|
|
199
|
+
static const rac_audio_pipeline_config_t RAC_AUDIO_PIPELINE_CONFIG_DEFAULT = {
|
|
200
|
+
.cooldown_duration = 0.8f, /* 800ms - better feedback prevention */
|
|
201
|
+
.strict_transitions = RAC_TRUE,
|
|
202
|
+
.max_tts_duration = 30.0f};
|
|
203
|
+
|
|
204
|
+
// =============================================================================
|
|
205
|
+
// AUDIO PIPELINE STATE MANAGER API
|
|
206
|
+
// =============================================================================
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @brief Check if microphone can be activated in current state
|
|
210
|
+
*
|
|
211
|
+
* @param current_state Current pipeline state
|
|
212
|
+
* @param last_tts_end_time_ms Last TTS end time in milliseconds since epoch (0 if none)
|
|
213
|
+
* @param cooldown_duration_ms Cooldown duration in milliseconds
|
|
214
|
+
* @return RAC_TRUE if microphone can be activated
|
|
215
|
+
*/
|
|
216
|
+
RAC_API rac_bool_t rac_audio_pipeline_can_activate_microphone(
|
|
217
|
+
rac_audio_pipeline_state_t current_state, int64_t last_tts_end_time_ms,
|
|
218
|
+
int64_t cooldown_duration_ms);
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @brief Check if TTS can be played in current state
|
|
222
|
+
*
|
|
223
|
+
* @param current_state Current pipeline state
|
|
224
|
+
* @return RAC_TRUE if TTS can be played
|
|
225
|
+
*/
|
|
226
|
+
RAC_API rac_bool_t rac_audio_pipeline_can_play_tts(rac_audio_pipeline_state_t current_state);
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @brief Check if a state transition is valid
|
|
230
|
+
*
|
|
231
|
+
* @param from_state Current state
|
|
232
|
+
* @param to_state Target state
|
|
233
|
+
* @return RAC_TRUE if transition is valid
|
|
234
|
+
*/
|
|
235
|
+
RAC_API rac_bool_t rac_audio_pipeline_is_valid_transition(rac_audio_pipeline_state_t from_state,
|
|
236
|
+
rac_audio_pipeline_state_t to_state);
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @brief Voice agent processing result.
|
|
240
|
+
* Mirrors Swift's VoiceAgentResult.
|
|
241
|
+
*/
|
|
242
|
+
typedef struct rac_voice_agent_result {
|
|
243
|
+
/** Whether speech was detected in the input audio */
|
|
244
|
+
rac_bool_t speech_detected;
|
|
245
|
+
|
|
246
|
+
/** Transcribed text from STT (owned, must be freed with rac_free) */
|
|
247
|
+
char* transcription;
|
|
248
|
+
|
|
249
|
+
/** Generated response text from LLM (owned, must be freed with rac_free) */
|
|
250
|
+
char* response;
|
|
251
|
+
|
|
252
|
+
/** Synthesized audio data from TTS (owned, must be freed with rac_free) */
|
|
253
|
+
void* synthesized_audio;
|
|
254
|
+
|
|
255
|
+
/** Size of synthesized audio data in bytes */
|
|
256
|
+
size_t synthesized_audio_size;
|
|
257
|
+
} rac_voice_agent_result_t;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @brief Voice agent event data.
|
|
261
|
+
* Contains union for different event types.
|
|
262
|
+
*/
|
|
263
|
+
typedef struct rac_voice_agent_event {
|
|
264
|
+
/** Event type */
|
|
265
|
+
rac_voice_agent_event_type_t type;
|
|
266
|
+
|
|
267
|
+
union {
|
|
268
|
+
/** For PROCESSED event */
|
|
269
|
+
rac_voice_agent_result_t result;
|
|
270
|
+
|
|
271
|
+
/** For VAD_TRIGGERED event: true if speech started, false if ended */
|
|
272
|
+
rac_bool_t vad_speech_active;
|
|
273
|
+
|
|
274
|
+
/** For TRANSCRIPTION event */
|
|
275
|
+
const char* transcription;
|
|
276
|
+
|
|
277
|
+
/** For RESPONSE event */
|
|
278
|
+
const char* response;
|
|
279
|
+
|
|
280
|
+
/** For AUDIO_SYNTHESIZED event */
|
|
281
|
+
struct {
|
|
282
|
+
const void* audio_data;
|
|
283
|
+
size_t audio_size;
|
|
284
|
+
} audio;
|
|
285
|
+
|
|
286
|
+
/** For ERROR event */
|
|
287
|
+
rac_result_t error_code;
|
|
288
|
+
} data;
|
|
289
|
+
} rac_voice_agent_event_t;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @brief Callback for voice agent events during streaming.
|
|
293
|
+
*
|
|
294
|
+
* @param event The event that occurred
|
|
295
|
+
* @param user_data User-provided context
|
|
296
|
+
*/
|
|
297
|
+
typedef void (*rac_voice_agent_event_callback_fn)(const rac_voice_agent_event_t* event,
|
|
298
|
+
void* user_data);
|
|
299
|
+
|
|
300
|
+
// =============================================================================
|
|
301
|
+
// OPAQUE HANDLE
|
|
302
|
+
// =============================================================================
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @brief Opaque handle for voice agent instance.
|
|
306
|
+
*/
|
|
307
|
+
typedef struct rac_voice_agent* rac_voice_agent_handle_t;
|
|
308
|
+
|
|
309
|
+
// =============================================================================
|
|
310
|
+
// LIFECYCLE API
|
|
311
|
+
// =============================================================================
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @brief Create a standalone voice agent that owns its component handles.
|
|
315
|
+
*
|
|
316
|
+
* This is the recommended API. The voice agent creates and manages its own
|
|
317
|
+
* STT, LLM, TTS, and VAD component handles internally. Use the model loading
|
|
318
|
+
* APIs to load models after creation.
|
|
319
|
+
*
|
|
320
|
+
* @param out_handle Output: Handle to the created voice agent
|
|
321
|
+
* @return RAC_SUCCESS or error code
|
|
322
|
+
*/
|
|
323
|
+
RAC_API rac_result_t rac_voice_agent_create_standalone(rac_voice_agent_handle_t* out_handle);
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @brief Create a voice agent instance with external component handles.
|
|
327
|
+
*
|
|
328
|
+
* DEPRECATED: Prefer rac_voice_agent_create_standalone().
|
|
329
|
+
* This API is for backward compatibility when you need to share handles.
|
|
330
|
+
*
|
|
331
|
+
* @param llm_component_handle Handle to LLM component (rac_llm_component)
|
|
332
|
+
* @param stt_component_handle Handle to STT component (rac_stt_component)
|
|
333
|
+
* @param tts_component_handle Handle to TTS component (rac_tts_component)
|
|
334
|
+
* @param vad_component_handle Handle to VAD component (rac_vad_component)
|
|
335
|
+
* @param out_handle Output: Handle to the created voice agent
|
|
336
|
+
* @return RAC_SUCCESS or error code
|
|
337
|
+
*/
|
|
338
|
+
RAC_API rac_result_t rac_voice_agent_create(rac_handle_t llm_component_handle,
|
|
339
|
+
rac_handle_t stt_component_handle,
|
|
340
|
+
rac_handle_t tts_component_handle,
|
|
341
|
+
rac_handle_t vad_component_handle,
|
|
342
|
+
rac_voice_agent_handle_t* out_handle);
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @brief Destroy a voice agent instance.
|
|
346
|
+
*
|
|
347
|
+
* If created with rac_voice_agent_create_standalone(), this also destroys
|
|
348
|
+
* the owned component handles.
|
|
349
|
+
*
|
|
350
|
+
* @param handle Voice agent handle
|
|
351
|
+
*/
|
|
352
|
+
RAC_API void rac_voice_agent_destroy(rac_voice_agent_handle_t handle);
|
|
353
|
+
|
|
354
|
+
// =============================================================================
|
|
355
|
+
// MODEL LOADING API (for standalone voice agent)
|
|
356
|
+
// =============================================================================
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @brief Load an STT model into the voice agent.
|
|
360
|
+
*
|
|
361
|
+
* @param handle Voice agent handle
|
|
362
|
+
* @param model_path File path to the model (used for loading)
|
|
363
|
+
* @param model_id Model identifier (used for telemetry, e.g., "whisper-base")
|
|
364
|
+
* @param model_name Human-readable model name (e.g., "Whisper Base")
|
|
365
|
+
* @return RAC_SUCCESS or error code
|
|
366
|
+
*/
|
|
367
|
+
RAC_API rac_result_t rac_voice_agent_load_stt_model(rac_voice_agent_handle_t handle,
|
|
368
|
+
const char* model_path, const char* model_id,
|
|
369
|
+
const char* model_name);
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @brief Load an LLM model into the voice agent.
|
|
373
|
+
*
|
|
374
|
+
* @param handle Voice agent handle
|
|
375
|
+
* @param model_path File path to the model (used for loading)
|
|
376
|
+
* @param model_id Model identifier (used for telemetry, e.g., "llama-3.2-1b")
|
|
377
|
+
* @param model_name Human-readable model name (e.g., "Llama 3.2 1B Instruct")
|
|
378
|
+
* @return RAC_SUCCESS or error code
|
|
379
|
+
*/
|
|
380
|
+
RAC_API rac_result_t rac_voice_agent_load_llm_model(rac_voice_agent_handle_t handle,
|
|
381
|
+
const char* model_path, const char* model_id,
|
|
382
|
+
const char* model_name);
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @brief Load a TTS voice into the voice agent.
|
|
386
|
+
*
|
|
387
|
+
* @param handle Voice agent handle
|
|
388
|
+
* @param voice_path File path to the voice (used for loading)
|
|
389
|
+
* @param voice_id Voice identifier (used for telemetry, e.g., "vits-piper-en_GB-alba-medium")
|
|
390
|
+
* @param voice_name Human-readable voice name (e.g., "Piper TTS (British English)")
|
|
391
|
+
* @return RAC_SUCCESS or error code
|
|
392
|
+
*/
|
|
393
|
+
RAC_API rac_result_t rac_voice_agent_load_tts_voice(rac_voice_agent_handle_t handle,
|
|
394
|
+
const char* voice_path, const char* voice_id,
|
|
395
|
+
const char* voice_name);
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @brief Check if STT model is loaded.
|
|
399
|
+
*
|
|
400
|
+
* @param handle Voice agent handle
|
|
401
|
+
* @param out_loaded Output: RAC_TRUE if loaded
|
|
402
|
+
* @return RAC_SUCCESS or error code
|
|
403
|
+
*/
|
|
404
|
+
RAC_API rac_result_t rac_voice_agent_is_stt_loaded(rac_voice_agent_handle_t handle,
|
|
405
|
+
rac_bool_t* out_loaded);
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @brief Check if LLM model is loaded.
|
|
409
|
+
*
|
|
410
|
+
* @param handle Voice agent handle
|
|
411
|
+
* @param out_loaded Output: RAC_TRUE if loaded
|
|
412
|
+
* @return RAC_SUCCESS or error code
|
|
413
|
+
*/
|
|
414
|
+
RAC_API rac_result_t rac_voice_agent_is_llm_loaded(rac_voice_agent_handle_t handle,
|
|
415
|
+
rac_bool_t* out_loaded);
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* @brief Check if TTS voice is loaded.
|
|
419
|
+
*
|
|
420
|
+
* @param handle Voice agent handle
|
|
421
|
+
* @param out_loaded Output: RAC_TRUE if loaded
|
|
422
|
+
* @return RAC_SUCCESS or error code
|
|
423
|
+
*/
|
|
424
|
+
RAC_API rac_result_t rac_voice_agent_is_tts_loaded(rac_voice_agent_handle_t handle,
|
|
425
|
+
rac_bool_t* out_loaded);
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @brief Get the currently loaded STT model ID.
|
|
429
|
+
*
|
|
430
|
+
* @param handle Voice agent handle
|
|
431
|
+
* @return Model ID string (static, do not free) or NULL if not loaded
|
|
432
|
+
*/
|
|
433
|
+
RAC_API const char* rac_voice_agent_get_stt_model_id(rac_voice_agent_handle_t handle);
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* @brief Get the currently loaded LLM model ID.
|
|
437
|
+
*
|
|
438
|
+
* @param handle Voice agent handle
|
|
439
|
+
* @return Model ID string (static, do not free) or NULL if not loaded
|
|
440
|
+
*/
|
|
441
|
+
RAC_API const char* rac_voice_agent_get_llm_model_id(rac_voice_agent_handle_t handle);
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @brief Get the currently loaded TTS voice ID.
|
|
445
|
+
*
|
|
446
|
+
* @param handle Voice agent handle
|
|
447
|
+
* @return Voice ID string (static, do not free) or NULL if not loaded
|
|
448
|
+
*/
|
|
449
|
+
RAC_API const char* rac_voice_agent_get_tts_voice_id(rac_voice_agent_handle_t handle);
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @brief Initialize the voice agent with configuration.
|
|
453
|
+
*
|
|
454
|
+
* Mirrors Swift's VoiceAgentCapability.initialize(_:).
|
|
455
|
+
* This method is smart about reusing already-loaded models.
|
|
456
|
+
*
|
|
457
|
+
* @param handle Voice agent handle
|
|
458
|
+
* @param config Configuration (can be NULL for defaults)
|
|
459
|
+
* @return RAC_SUCCESS or error code
|
|
460
|
+
*/
|
|
461
|
+
RAC_API rac_result_t rac_voice_agent_initialize(rac_voice_agent_handle_t handle,
|
|
462
|
+
const rac_voice_agent_config_t* config);
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @brief Initialize using already-loaded models.
|
|
466
|
+
*
|
|
467
|
+
* Mirrors Swift's VoiceAgentCapability.initializeWithLoadedModels().
|
|
468
|
+
* Verifies all required components are loaded and marks the voice agent as ready.
|
|
469
|
+
*
|
|
470
|
+
* @param handle Voice agent handle
|
|
471
|
+
* @return RAC_SUCCESS or error code
|
|
472
|
+
*/
|
|
473
|
+
RAC_API rac_result_t rac_voice_agent_initialize_with_loaded_models(rac_voice_agent_handle_t handle);
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @brief Cleanup voice agent resources.
|
|
477
|
+
*
|
|
478
|
+
* Mirrors Swift's VoiceAgentCapability.cleanup().
|
|
479
|
+
*
|
|
480
|
+
* @param handle Voice agent handle
|
|
481
|
+
* @return RAC_SUCCESS or error code
|
|
482
|
+
*/
|
|
483
|
+
RAC_API rac_result_t rac_voice_agent_cleanup(rac_voice_agent_handle_t handle);
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @brief Check if voice agent is ready.
|
|
487
|
+
*
|
|
488
|
+
* Mirrors Swift's VoiceAgentCapability.isReady property.
|
|
489
|
+
*
|
|
490
|
+
* @param handle Voice agent handle
|
|
491
|
+
* @param out_is_ready Output: RAC_TRUE if ready
|
|
492
|
+
* @return RAC_SUCCESS or error code
|
|
493
|
+
*/
|
|
494
|
+
RAC_API rac_result_t rac_voice_agent_is_ready(rac_voice_agent_handle_t handle,
|
|
495
|
+
rac_bool_t* out_is_ready);
|
|
496
|
+
|
|
497
|
+
// =============================================================================
|
|
498
|
+
// VOICE PROCESSING API
|
|
499
|
+
// =============================================================================
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* @brief Process a complete voice turn: audio → transcription → LLM response → synthesized speech.
|
|
503
|
+
*
|
|
504
|
+
* Mirrors Swift's VoiceAgentCapability.processVoiceTurn(_:).
|
|
505
|
+
*
|
|
506
|
+
* @param handle Voice agent handle
|
|
507
|
+
* @param audio_data Audio data from user
|
|
508
|
+
* @param audio_size Size of audio data in bytes
|
|
509
|
+
* @param out_result Output: Voice agent result (caller owns memory, must free with
|
|
510
|
+
* rac_voice_agent_result_free)
|
|
511
|
+
* @return RAC_SUCCESS or error code
|
|
512
|
+
*/
|
|
513
|
+
RAC_API rac_result_t rac_voice_agent_process_voice_turn(rac_voice_agent_handle_t handle,
|
|
514
|
+
const void* audio_data, size_t audio_size,
|
|
515
|
+
rac_voice_agent_result_t* out_result);
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* @brief Process audio with streaming events.
|
|
519
|
+
*
|
|
520
|
+
* Mirrors Swift's VoiceAgentCapability.processStream(_:).
|
|
521
|
+
* Events are delivered via the callback as processing progresses.
|
|
522
|
+
*
|
|
523
|
+
* @param handle Voice agent handle
|
|
524
|
+
* @param audio_data Audio data from user
|
|
525
|
+
* @param audio_size Size of audio data in bytes
|
|
526
|
+
* @param callback Event callback function
|
|
527
|
+
* @param user_data User context passed to callback
|
|
528
|
+
* @return RAC_SUCCESS or error code
|
|
529
|
+
*/
|
|
530
|
+
RAC_API rac_result_t rac_voice_agent_process_stream(rac_voice_agent_handle_t handle,
|
|
531
|
+
const void* audio_data, size_t audio_size,
|
|
532
|
+
rac_voice_agent_event_callback_fn callback,
|
|
533
|
+
void* user_data);
|
|
534
|
+
|
|
535
|
+
// =============================================================================
|
|
536
|
+
// INDIVIDUAL COMPONENT ACCESS API
|
|
537
|
+
// =============================================================================
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* @brief Transcribe audio only (without LLM/TTS).
|
|
541
|
+
*
|
|
542
|
+
* Mirrors Swift's VoiceAgentCapability.transcribe(_:).
|
|
543
|
+
*
|
|
544
|
+
* @param handle Voice agent handle
|
|
545
|
+
* @param audio_data Audio data
|
|
546
|
+
* @param audio_size Size of audio data in bytes
|
|
547
|
+
* @param out_transcription Output: Transcribed text (owned, must be freed with rac_free)
|
|
548
|
+
* @return RAC_SUCCESS or error code
|
|
549
|
+
*/
|
|
550
|
+
RAC_API rac_result_t rac_voice_agent_transcribe(rac_voice_agent_handle_t handle,
|
|
551
|
+
const void* audio_data, size_t audio_size,
|
|
552
|
+
char** out_transcription);
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @brief Generate LLM response only.
|
|
556
|
+
*
|
|
557
|
+
* Mirrors Swift's VoiceAgentCapability.generateResponse(_:).
|
|
558
|
+
*
|
|
559
|
+
* @param handle Voice agent handle
|
|
560
|
+
* @param prompt Input prompt
|
|
561
|
+
* @param out_response Output: Generated response (owned, must be freed with rac_free)
|
|
562
|
+
* @return RAC_SUCCESS or error code
|
|
563
|
+
*/
|
|
564
|
+
RAC_API rac_result_t rac_voice_agent_generate_response(rac_voice_agent_handle_t handle,
|
|
565
|
+
const char* prompt, char** out_response);
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* @brief Synthesize speech only.
|
|
569
|
+
*
|
|
570
|
+
* Mirrors Swift's VoiceAgentCapability.synthesizeSpeech(_:).
|
|
571
|
+
*
|
|
572
|
+
* @param handle Voice agent handle
|
|
573
|
+
* @param text Text to synthesize
|
|
574
|
+
* @param out_audio Output: Synthesized audio data (owned, must be freed with rac_free)
|
|
575
|
+
* @param out_audio_size Output: Size of audio data in bytes
|
|
576
|
+
* @return RAC_SUCCESS or error code
|
|
577
|
+
*/
|
|
578
|
+
RAC_API rac_result_t rac_voice_agent_synthesize_speech(rac_voice_agent_handle_t handle,
|
|
579
|
+
const char* text, void** out_audio,
|
|
580
|
+
size_t* out_audio_size);
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* @brief Check if VAD detects speech.
|
|
584
|
+
*
|
|
585
|
+
* Mirrors Swift's VoiceAgentCapability.detectSpeech(_:).
|
|
586
|
+
*
|
|
587
|
+
* @param handle Voice agent handle
|
|
588
|
+
* @param samples Audio samples (float32)
|
|
589
|
+
* @param sample_count Number of samples
|
|
590
|
+
* @param out_speech_detected Output: RAC_TRUE if speech detected
|
|
591
|
+
* @return RAC_SUCCESS or error code
|
|
592
|
+
*/
|
|
593
|
+
RAC_API rac_result_t rac_voice_agent_detect_speech(rac_voice_agent_handle_t handle,
|
|
594
|
+
const float* samples, size_t sample_count,
|
|
595
|
+
rac_bool_t* out_speech_detected);
|
|
596
|
+
|
|
597
|
+
// =============================================================================
|
|
598
|
+
// MEMORY MANAGEMENT
|
|
599
|
+
// =============================================================================
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* @brief Free a voice agent result.
|
|
603
|
+
*
|
|
604
|
+
* @param result Result to free
|
|
605
|
+
*/
|
|
606
|
+
RAC_API void rac_voice_agent_result_free(rac_voice_agent_result_t* result);
|
|
607
|
+
|
|
608
|
+
#ifdef __cplusplus
|
|
609
|
+
}
|
|
610
|
+
#endif
|
|
611
|
+
|
|
612
|
+
#endif /* RAC_VOICE_AGENT_H */
|