@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,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_whispercpp.h
|
|
3
|
+
* @brief RunAnywhere Core - WhisperCPP Backend for STT
|
|
4
|
+
*
|
|
5
|
+
* RAC API for WhisperCPP-based speech-to-text.
|
|
6
|
+
* Provides high-quality transcription using whisper.cpp.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: WhisperCPP and LlamaCPP both use GGML, which can cause symbol
|
|
9
|
+
* conflicts if linked together. Use ONNX Whisper for STT when also
|
|
10
|
+
* using LlamaCPP for LLM, or build with symbol prefixing.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef RAC_STT_WHISPERCPP_H
|
|
14
|
+
#define RAC_STT_WHISPERCPP_H
|
|
15
|
+
|
|
16
|
+
#include "rac/core/rac_error.h"
|
|
17
|
+
#include "rac/core/rac_types.h"
|
|
18
|
+
#include "rac/features/stt/rac_stt.h"
|
|
19
|
+
|
|
20
|
+
#ifdef __cplusplus
|
|
21
|
+
extern "C" {
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
// =============================================================================
|
|
25
|
+
// EXPORT MACRO
|
|
26
|
+
// =============================================================================
|
|
27
|
+
|
|
28
|
+
#if defined(RAC_WHISPERCPP_BUILDING)
|
|
29
|
+
#if defined(_WIN32)
|
|
30
|
+
#define RAC_WHISPERCPP_API __declspec(dllexport)
|
|
31
|
+
#elif defined(__GNUC__) || defined(__clang__)
|
|
32
|
+
#define RAC_WHISPERCPP_API __attribute__((visibility("default")))
|
|
33
|
+
#else
|
|
34
|
+
#define RAC_WHISPERCPP_API
|
|
35
|
+
#endif
|
|
36
|
+
#else
|
|
37
|
+
#define RAC_WHISPERCPP_API
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// CONFIGURATION
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* WhisperCPP-specific configuration.
|
|
46
|
+
*/
|
|
47
|
+
typedef struct rac_stt_whispercpp_config {
|
|
48
|
+
/** Number of threads (0 = auto) */
|
|
49
|
+
int32_t num_threads;
|
|
50
|
+
|
|
51
|
+
/** Enable GPU acceleration (Metal on Apple) */
|
|
52
|
+
rac_bool_t use_gpu;
|
|
53
|
+
|
|
54
|
+
/** Enable CoreML acceleration (Apple only) */
|
|
55
|
+
rac_bool_t use_coreml;
|
|
56
|
+
|
|
57
|
+
/** Language code for transcription (NULL = auto-detect) */
|
|
58
|
+
const char* language;
|
|
59
|
+
|
|
60
|
+
/** Translate to English (when source is non-English) */
|
|
61
|
+
rac_bool_t translate;
|
|
62
|
+
} rac_stt_whispercpp_config_t;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Default WhisperCPP configuration.
|
|
66
|
+
*/
|
|
67
|
+
static const rac_stt_whispercpp_config_t RAC_STT_WHISPERCPP_CONFIG_DEFAULT = {
|
|
68
|
+
.num_threads = 0,
|
|
69
|
+
.use_gpu = RAC_TRUE,
|
|
70
|
+
.use_coreml = RAC_TRUE,
|
|
71
|
+
.language = NULL,
|
|
72
|
+
.translate = RAC_FALSE};
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// WHISPERCPP STT API
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Creates a WhisperCPP STT service.
|
|
80
|
+
*
|
|
81
|
+
* @param model_path Path to the Whisper GGML model file (.bin)
|
|
82
|
+
* @param config WhisperCPP-specific configuration (can be NULL for defaults)
|
|
83
|
+
* @param out_handle Output: Handle to the created service
|
|
84
|
+
* @return RAC_SUCCESS or error code
|
|
85
|
+
*/
|
|
86
|
+
RAC_WHISPERCPP_API rac_result_t rac_stt_whispercpp_create(const char* model_path,
|
|
87
|
+
const rac_stt_whispercpp_config_t* config,
|
|
88
|
+
rac_handle_t* out_handle);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Transcribes audio data.
|
|
92
|
+
*
|
|
93
|
+
* @param handle Service handle
|
|
94
|
+
* @param audio_samples Float32 PCM samples (16kHz mono)
|
|
95
|
+
* @param num_samples Number of samples
|
|
96
|
+
* @param options STT options (can be NULL for defaults)
|
|
97
|
+
* @param out_result Output: Transcription result
|
|
98
|
+
* @return RAC_SUCCESS or error code
|
|
99
|
+
*/
|
|
100
|
+
RAC_WHISPERCPP_API rac_result_t rac_stt_whispercpp_transcribe(rac_handle_t handle,
|
|
101
|
+
const float* audio_samples,
|
|
102
|
+
size_t num_samples,
|
|
103
|
+
const rac_stt_options_t* options,
|
|
104
|
+
rac_stt_result_t* out_result);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Gets detected language after transcription.
|
|
108
|
+
*
|
|
109
|
+
* @param handle Service handle
|
|
110
|
+
* @param out_language Output: Language code (caller must free)
|
|
111
|
+
* @return RAC_SUCCESS or error code
|
|
112
|
+
*/
|
|
113
|
+
RAC_WHISPERCPP_API rac_result_t rac_stt_whispercpp_get_language(rac_handle_t handle,
|
|
114
|
+
char** out_language);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Checks if model is loaded and ready.
|
|
118
|
+
*
|
|
119
|
+
* @param handle Service handle
|
|
120
|
+
* @return RAC_TRUE if ready
|
|
121
|
+
*/
|
|
122
|
+
RAC_WHISPERCPP_API rac_bool_t rac_stt_whispercpp_is_ready(rac_handle_t handle);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Destroys a WhisperCPP STT service.
|
|
126
|
+
*
|
|
127
|
+
* @param handle Service handle to destroy
|
|
128
|
+
*/
|
|
129
|
+
RAC_WHISPERCPP_API void rac_stt_whispercpp_destroy(rac_handle_t handle);
|
|
130
|
+
|
|
131
|
+
// =============================================================================
|
|
132
|
+
// BACKEND REGISTRATION
|
|
133
|
+
// =============================================================================
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Registers the WhisperCPP backend with the commons module and service registries.
|
|
137
|
+
*
|
|
138
|
+
* @return RAC_SUCCESS or error code
|
|
139
|
+
*/
|
|
140
|
+
RAC_WHISPERCPP_API rac_result_t rac_backend_whispercpp_register(void);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Unregisters the WhisperCPP backend.
|
|
144
|
+
*
|
|
145
|
+
* @return RAC_SUCCESS or error code
|
|
146
|
+
*/
|
|
147
|
+
RAC_WHISPERCPP_API rac_result_t rac_backend_whispercpp_unregister(void);
|
|
148
|
+
|
|
149
|
+
#ifdef __cplusplus
|
|
150
|
+
}
|
|
151
|
+
#endif
|
|
152
|
+
|
|
153
|
+
#endif /* RAC_STT_WHISPERCPP_H */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_tts_onnx.h
|
|
3
|
+
* @brief RunAnywhere Core - ONNX Backend RAC API for TTS
|
|
4
|
+
*
|
|
5
|
+
* Direct RAC API export from runanywhere-core's ONNX TTS backend.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef RAC_TTS_ONNX_H
|
|
9
|
+
#define RAC_TTS_ONNX_H
|
|
10
|
+
|
|
11
|
+
#include "rac/core/rac_error.h"
|
|
12
|
+
#include "rac/core/rac_types.h"
|
|
13
|
+
#include "rac/features/tts/rac_tts.h"
|
|
14
|
+
|
|
15
|
+
#ifdef __cplusplus
|
|
16
|
+
extern "C" {
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// EXPORT MACRO
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
#if defined(RAC_ONNX_BUILDING)
|
|
24
|
+
#if defined(_WIN32)
|
|
25
|
+
#define RAC_ONNX_API __declspec(dllexport)
|
|
26
|
+
#elif defined(__GNUC__) || defined(__clang__)
|
|
27
|
+
#define RAC_ONNX_API __attribute__((visibility("default")))
|
|
28
|
+
#else
|
|
29
|
+
#define RAC_ONNX_API
|
|
30
|
+
#endif
|
|
31
|
+
#else
|
|
32
|
+
#define RAC_ONNX_API
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// CONFIGURATION
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
typedef struct rac_tts_onnx_config {
|
|
40
|
+
int32_t num_threads;
|
|
41
|
+
rac_bool_t use_coreml;
|
|
42
|
+
int32_t sample_rate;
|
|
43
|
+
} rac_tts_onnx_config_t;
|
|
44
|
+
|
|
45
|
+
static const rac_tts_onnx_config_t RAC_TTS_ONNX_CONFIG_DEFAULT = {
|
|
46
|
+
.num_threads = 0, .use_coreml = RAC_TRUE, .sample_rate = 22050};
|
|
47
|
+
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// ONNX TTS API
|
|
50
|
+
// =============================================================================
|
|
51
|
+
|
|
52
|
+
RAC_ONNX_API rac_result_t rac_tts_onnx_create(const char* model_path,
|
|
53
|
+
const rac_tts_onnx_config_t* config,
|
|
54
|
+
rac_handle_t* out_handle);
|
|
55
|
+
|
|
56
|
+
RAC_ONNX_API rac_result_t rac_tts_onnx_synthesize(rac_handle_t handle, const char* text,
|
|
57
|
+
const rac_tts_options_t* options,
|
|
58
|
+
rac_tts_result_t* out_result);
|
|
59
|
+
|
|
60
|
+
RAC_ONNX_API rac_result_t rac_tts_onnx_get_voices(rac_handle_t handle, char*** out_voices,
|
|
61
|
+
size_t* out_count);
|
|
62
|
+
|
|
63
|
+
RAC_ONNX_API void rac_tts_onnx_stop(rac_handle_t handle);
|
|
64
|
+
|
|
65
|
+
RAC_ONNX_API void rac_tts_onnx_destroy(rac_handle_t handle);
|
|
66
|
+
|
|
67
|
+
#ifdef __cplusplus
|
|
68
|
+
}
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
#endif /* RAC_TTS_ONNX_H */
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_onnx.h
|
|
3
|
+
* @brief RunAnywhere Core - ONNX Backend RAC API for VAD
|
|
4
|
+
*
|
|
5
|
+
* Direct RAC API export from runanywhere-core's ONNX VAD backend.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef RAC_VAD_ONNX_H
|
|
9
|
+
#define RAC_VAD_ONNX_H
|
|
10
|
+
|
|
11
|
+
#include "rac/core/rac_error.h"
|
|
12
|
+
#include "rac/core/rac_types.h"
|
|
13
|
+
#include "rac/features/vad/rac_vad.h"
|
|
14
|
+
|
|
15
|
+
#ifdef __cplusplus
|
|
16
|
+
extern "C" {
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// EXPORT MACRO
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
#if defined(RAC_ONNX_BUILDING)
|
|
24
|
+
#if defined(_WIN32)
|
|
25
|
+
#define RAC_ONNX_API __declspec(dllexport)
|
|
26
|
+
#elif defined(__GNUC__) || defined(__clang__)
|
|
27
|
+
#define RAC_ONNX_API __attribute__((visibility("default")))
|
|
28
|
+
#else
|
|
29
|
+
#define RAC_ONNX_API
|
|
30
|
+
#endif
|
|
31
|
+
#else
|
|
32
|
+
#define RAC_ONNX_API
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// CONFIGURATION
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
typedef struct rac_vad_onnx_config {
|
|
40
|
+
int32_t sample_rate;
|
|
41
|
+
float energy_threshold;
|
|
42
|
+
float frame_length;
|
|
43
|
+
int32_t num_threads;
|
|
44
|
+
} rac_vad_onnx_config_t;
|
|
45
|
+
|
|
46
|
+
static const rac_vad_onnx_config_t RAC_VAD_ONNX_CONFIG_DEFAULT = {
|
|
47
|
+
.sample_rate = 16000, .energy_threshold = 0.5f, .frame_length = 0.032f, .num_threads = 0};
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// ONNX VAD API
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_create(const char* model_path,
|
|
54
|
+
const rac_vad_onnx_config_t* config,
|
|
55
|
+
rac_handle_t* out_handle);
|
|
56
|
+
|
|
57
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_process(rac_handle_t handle, const float* samples,
|
|
58
|
+
size_t num_samples, rac_bool_t* out_is_speech);
|
|
59
|
+
|
|
60
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_start(rac_handle_t handle);
|
|
61
|
+
|
|
62
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_stop(rac_handle_t handle);
|
|
63
|
+
|
|
64
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_reset(rac_handle_t handle);
|
|
65
|
+
|
|
66
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_set_threshold(rac_handle_t handle, float threshold);
|
|
67
|
+
|
|
68
|
+
RAC_ONNX_API rac_bool_t rac_vad_onnx_is_speech_active(rac_handle_t handle);
|
|
69
|
+
|
|
70
|
+
RAC_ONNX_API void rac_vad_onnx_destroy(rac_handle_t handle);
|
|
71
|
+
|
|
72
|
+
// =============================================================================
|
|
73
|
+
// BACKEND REGISTRATION
|
|
74
|
+
// =============================================================================
|
|
75
|
+
|
|
76
|
+
RAC_ONNX_API rac_result_t rac_backend_onnx_register(void);
|
|
77
|
+
|
|
78
|
+
RAC_ONNX_API rac_result_t rac_backend_onnx_unregister(void);
|
|
79
|
+
|
|
80
|
+
#ifdef __cplusplus
|
|
81
|
+
}
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#endif /* RAC_VAD_ONNX_H */
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_lifecycle.h
|
|
3
|
+
* @brief RunAnywhere Commons - Lifecycle Management API
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's ManagedLifecycle.swift from:
|
|
6
|
+
* Sources/RunAnywhere/Core/Capabilities/ManagedLifecycle.swift
|
|
7
|
+
*
|
|
8
|
+
* Provides unified lifecycle management with integrated event tracking.
|
|
9
|
+
* Tracks lifecycle events (load, unload) via EventPublisher.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef RAC_LIFECYCLE_H
|
|
13
|
+
#define RAC_LIFECYCLE_H
|
|
14
|
+
|
|
15
|
+
#include "rac/core/rac_error.h"
|
|
16
|
+
#include "rac/core/rac_types.h"
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// TYPES - Mirrors Swift's CapabilityLoadingState
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @brief Capability loading state
|
|
28
|
+
*
|
|
29
|
+
* Mirrors Swift's CapabilityLoadingState enum.
|
|
30
|
+
*/
|
|
31
|
+
typedef enum rac_lifecycle_state {
|
|
32
|
+
RAC_LIFECYCLE_STATE_IDLE = 0, /**< Not loaded */
|
|
33
|
+
RAC_LIFECYCLE_STATE_LOADING = 1, /**< Currently loading */
|
|
34
|
+
RAC_LIFECYCLE_STATE_LOADED = 2, /**< Successfully loaded */
|
|
35
|
+
RAC_LIFECYCLE_STATE_FAILED = 3 /**< Load failed */
|
|
36
|
+
} rac_lifecycle_state_t;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @brief Resource type for lifecycle tracking
|
|
40
|
+
*
|
|
41
|
+
* Mirrors Swift's CapabilityResourceType enum.
|
|
42
|
+
*/
|
|
43
|
+
typedef enum rac_resource_type {
|
|
44
|
+
RAC_RESOURCE_TYPE_LLM_MODEL = 0,
|
|
45
|
+
RAC_RESOURCE_TYPE_STT_MODEL = 1,
|
|
46
|
+
RAC_RESOURCE_TYPE_TTS_VOICE = 2,
|
|
47
|
+
RAC_RESOURCE_TYPE_VAD_MODEL = 3,
|
|
48
|
+
RAC_RESOURCE_TYPE_DIARIZATION_MODEL = 4
|
|
49
|
+
} rac_resource_type_t;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @brief Lifecycle metrics
|
|
53
|
+
*
|
|
54
|
+
* Mirrors Swift's ModelLifecycleMetrics struct.
|
|
55
|
+
*/
|
|
56
|
+
typedef struct rac_lifecycle_metrics {
|
|
57
|
+
/** Total lifecycle events */
|
|
58
|
+
int32_t total_events;
|
|
59
|
+
|
|
60
|
+
/** Start time (ms since epoch) */
|
|
61
|
+
int64_t start_time_ms;
|
|
62
|
+
|
|
63
|
+
/** Last event time (ms since epoch, 0 if none) */
|
|
64
|
+
int64_t last_event_time_ms;
|
|
65
|
+
|
|
66
|
+
/** Total load attempts */
|
|
67
|
+
int32_t total_loads;
|
|
68
|
+
|
|
69
|
+
/** Successful loads */
|
|
70
|
+
int32_t successful_loads;
|
|
71
|
+
|
|
72
|
+
/** Failed loads */
|
|
73
|
+
int32_t failed_loads;
|
|
74
|
+
|
|
75
|
+
/** Average load time in milliseconds */
|
|
76
|
+
double average_load_time_ms;
|
|
77
|
+
|
|
78
|
+
/** Total unloads */
|
|
79
|
+
int32_t total_unloads;
|
|
80
|
+
} rac_lifecycle_metrics_t;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @brief Lifecycle configuration
|
|
84
|
+
*/
|
|
85
|
+
typedef struct rac_lifecycle_config {
|
|
86
|
+
/** Resource type for event tracking */
|
|
87
|
+
rac_resource_type_t resource_type;
|
|
88
|
+
|
|
89
|
+
/** Logger category (can be NULL for default) */
|
|
90
|
+
const char* logger_category;
|
|
91
|
+
|
|
92
|
+
/** User data for callbacks */
|
|
93
|
+
void* user_data;
|
|
94
|
+
} rac_lifecycle_config_t;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @brief Service creation callback
|
|
98
|
+
*
|
|
99
|
+
* Called by the lifecycle manager to create a service for a given model ID.
|
|
100
|
+
*
|
|
101
|
+
* @param model_id The model ID to load
|
|
102
|
+
* @param user_data User-provided context
|
|
103
|
+
* @param out_service Output: Handle to the created service
|
|
104
|
+
* @return RAC_SUCCESS or error code
|
|
105
|
+
*/
|
|
106
|
+
typedef rac_result_t (*rac_lifecycle_create_service_fn)(const char* model_id, void* user_data,
|
|
107
|
+
rac_handle_t* out_service);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @brief Service destroy callback
|
|
111
|
+
*
|
|
112
|
+
* Called by the lifecycle manager to destroy a service.
|
|
113
|
+
*
|
|
114
|
+
* @param service Handle to the service to destroy
|
|
115
|
+
* @param user_data User-provided context
|
|
116
|
+
*/
|
|
117
|
+
typedef void (*rac_lifecycle_destroy_service_fn)(rac_handle_t service, void* user_data);
|
|
118
|
+
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// LIFECYCLE API - Mirrors Swift's ManagedLifecycle
|
|
121
|
+
// =============================================================================
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @brief Create a lifecycle manager
|
|
125
|
+
*
|
|
126
|
+
* @param config Lifecycle configuration
|
|
127
|
+
* @param create_fn Service creation callback
|
|
128
|
+
* @param destroy_fn Service destruction callback (can be NULL)
|
|
129
|
+
* @param out_handle Output: Handle to the lifecycle manager
|
|
130
|
+
* @return RAC_SUCCESS or error code
|
|
131
|
+
*/
|
|
132
|
+
RAC_API rac_result_t rac_lifecycle_create(const rac_lifecycle_config_t* config,
|
|
133
|
+
rac_lifecycle_create_service_fn create_fn,
|
|
134
|
+
rac_lifecycle_destroy_service_fn destroy_fn,
|
|
135
|
+
rac_handle_t* out_handle);
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @brief Load a model with automatic event tracking
|
|
139
|
+
*
|
|
140
|
+
* Mirrors Swift's ManagedLifecycle.load(_:)
|
|
141
|
+
* If already loaded with same ID, skips duplicate load.
|
|
142
|
+
*
|
|
143
|
+
* @param handle Lifecycle manager handle
|
|
144
|
+
* @param model_path File path to the model (used for loading) - REQUIRED
|
|
145
|
+
* @param model_id Model identifier for telemetry (e.g., "sherpa-onnx-whisper-tiny.en")
|
|
146
|
+
* Optional: if NULL, defaults to model_path
|
|
147
|
+
* @param model_name Human-readable model name (e.g., "Sherpa Whisper Tiny (ONNX)")
|
|
148
|
+
* Optional: if NULL, defaults to model_id
|
|
149
|
+
* @param out_service Output: Handle to the loaded service
|
|
150
|
+
* @return RAC_SUCCESS or error code
|
|
151
|
+
*/
|
|
152
|
+
RAC_API rac_result_t rac_lifecycle_load(rac_handle_t handle, const char* model_path,
|
|
153
|
+
const char* model_id, const char* model_name,
|
|
154
|
+
rac_handle_t* out_service);
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @brief Unload the currently loaded model
|
|
158
|
+
*
|
|
159
|
+
* Mirrors Swift's ManagedLifecycle.unload()
|
|
160
|
+
*
|
|
161
|
+
* @param handle Lifecycle manager handle
|
|
162
|
+
* @return RAC_SUCCESS or error code
|
|
163
|
+
*/
|
|
164
|
+
RAC_API rac_result_t rac_lifecycle_unload(rac_handle_t handle);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief Reset all state
|
|
168
|
+
*
|
|
169
|
+
* Mirrors Swift's ManagedLifecycle.reset()
|
|
170
|
+
*
|
|
171
|
+
* @param handle Lifecycle manager handle
|
|
172
|
+
* @return RAC_SUCCESS or error code
|
|
173
|
+
*/
|
|
174
|
+
RAC_API rac_result_t rac_lifecycle_reset(rac_handle_t handle);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @brief Get current lifecycle state
|
|
178
|
+
*
|
|
179
|
+
* Mirrors Swift's ManagedLifecycle.state
|
|
180
|
+
*
|
|
181
|
+
* @param handle Lifecycle manager handle
|
|
182
|
+
* @return Current state
|
|
183
|
+
*/
|
|
184
|
+
RAC_API rac_lifecycle_state_t rac_lifecycle_get_state(rac_handle_t handle);
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @brief Check if a model is loaded
|
|
188
|
+
*
|
|
189
|
+
* Mirrors Swift's ManagedLifecycle.isLoaded
|
|
190
|
+
*
|
|
191
|
+
* @param handle Lifecycle manager handle
|
|
192
|
+
* @return RAC_TRUE if loaded, RAC_FALSE otherwise
|
|
193
|
+
*/
|
|
194
|
+
RAC_API rac_bool_t rac_lifecycle_is_loaded(rac_handle_t handle);
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @brief Get current model ID
|
|
198
|
+
*
|
|
199
|
+
* Mirrors Swift's ManagedLifecycle.currentModelId
|
|
200
|
+
*
|
|
201
|
+
* @param handle Lifecycle manager handle
|
|
202
|
+
* @return Current model ID (may be NULL if not loaded)
|
|
203
|
+
*/
|
|
204
|
+
RAC_API const char* rac_lifecycle_get_model_id(rac_handle_t handle);
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @brief Get current model name (human-readable)
|
|
208
|
+
*
|
|
209
|
+
* @param handle Lifecycle manager handle
|
|
210
|
+
* @return Current model name (may be NULL if not loaded)
|
|
211
|
+
*/
|
|
212
|
+
RAC_API const char* rac_lifecycle_get_model_name(rac_handle_t handle);
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @brief Get current service handle
|
|
216
|
+
*
|
|
217
|
+
* Mirrors Swift's ManagedLifecycle.currentService
|
|
218
|
+
*
|
|
219
|
+
* @param handle Lifecycle manager handle
|
|
220
|
+
* @return Current service handle (may be NULL if not loaded)
|
|
221
|
+
*/
|
|
222
|
+
RAC_API rac_handle_t rac_lifecycle_get_service(rac_handle_t handle);
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @brief Require service or return error
|
|
226
|
+
*
|
|
227
|
+
* Mirrors Swift's ManagedLifecycle.requireService()
|
|
228
|
+
*
|
|
229
|
+
* @param handle Lifecycle manager handle
|
|
230
|
+
* @param out_service Output: Service handle
|
|
231
|
+
* @return RAC_SUCCESS or RAC_ERROR_NOT_INITIALIZED if not loaded
|
|
232
|
+
*/
|
|
233
|
+
RAC_API rac_result_t rac_lifecycle_require_service(rac_handle_t handle, rac_handle_t* out_service);
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @brief Track an operation error
|
|
237
|
+
*
|
|
238
|
+
* Mirrors Swift's ManagedLifecycle.trackOperationError(_:operation:)
|
|
239
|
+
*
|
|
240
|
+
* @param handle Lifecycle manager handle
|
|
241
|
+
* @param error_code Error code
|
|
242
|
+
* @param operation Operation name
|
|
243
|
+
*/
|
|
244
|
+
RAC_API void rac_lifecycle_track_error(rac_handle_t handle, rac_result_t error_code,
|
|
245
|
+
const char* operation);
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @brief Get lifecycle metrics
|
|
249
|
+
*
|
|
250
|
+
* Mirrors Swift's ManagedLifecycle.getLifecycleMetrics()
|
|
251
|
+
*
|
|
252
|
+
* @param handle Lifecycle manager handle
|
|
253
|
+
* @param out_metrics Output: Lifecycle metrics
|
|
254
|
+
* @return RAC_SUCCESS or error code
|
|
255
|
+
*/
|
|
256
|
+
RAC_API rac_result_t rac_lifecycle_get_metrics(rac_handle_t handle,
|
|
257
|
+
rac_lifecycle_metrics_t* out_metrics);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @brief Destroy a lifecycle manager
|
|
261
|
+
*
|
|
262
|
+
* @param handle Lifecycle manager handle
|
|
263
|
+
*/
|
|
264
|
+
RAC_API void rac_lifecycle_destroy(rac_handle_t handle);
|
|
265
|
+
|
|
266
|
+
// =============================================================================
|
|
267
|
+
// CONVENIENCE STATE HELPERS
|
|
268
|
+
// =============================================================================
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @brief Get state name string
|
|
272
|
+
*
|
|
273
|
+
* @param state Lifecycle state
|
|
274
|
+
* @return Human-readable state name
|
|
275
|
+
*/
|
|
276
|
+
RAC_API const char* rac_lifecycle_state_name(rac_lifecycle_state_t state);
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @brief Get resource type name string
|
|
280
|
+
*
|
|
281
|
+
* @param type Resource type
|
|
282
|
+
* @return Human-readable resource type name
|
|
283
|
+
*/
|
|
284
|
+
RAC_API const char* rac_resource_type_name(rac_resource_type_t type);
|
|
285
|
+
|
|
286
|
+
#ifdef __cplusplus
|
|
287
|
+
}
|
|
288
|
+
#endif
|
|
289
|
+
|
|
290
|
+
#endif /* RAC_LIFECYCLE_H */
|