@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,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_component.h
|
|
3
|
+
* @brief RunAnywhere Commons - STT Capability Component
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's STTCapability.swift from:
|
|
6
|
+
* Sources/RunAnywhere/Features/STT/STTCapability.swift
|
|
7
|
+
*
|
|
8
|
+
* Actor-based STT capability that owns model lifecycle and transcription.
|
|
9
|
+
* Uses lifecycle manager for unified lifecycle + analytics handling.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef RAC_STT_COMPONENT_H
|
|
13
|
+
#define RAC_STT_COMPONENT_H
|
|
14
|
+
|
|
15
|
+
#include "rac/core/capabilities/rac_lifecycle.h"
|
|
16
|
+
#include "rac/core/rac_error.h"
|
|
17
|
+
#include "rac/features/stt/rac_stt_types.h"
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// NOTE: rac_stt_config_t is defined in rac_stt_types.h (included above)
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// STT COMPONENT API - Mirrors Swift's STTCapability
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @brief Create an STT capability component
|
|
31
|
+
*
|
|
32
|
+
* @param out_handle Output: Handle to the component
|
|
33
|
+
* @return RAC_SUCCESS or error code
|
|
34
|
+
*/
|
|
35
|
+
RAC_API rac_result_t rac_stt_component_create(rac_handle_t* out_handle);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief Configure the STT component
|
|
39
|
+
*
|
|
40
|
+
* @param handle Component handle
|
|
41
|
+
* @param config Configuration
|
|
42
|
+
* @return RAC_SUCCESS or error code
|
|
43
|
+
*/
|
|
44
|
+
RAC_API rac_result_t rac_stt_component_configure(rac_handle_t handle,
|
|
45
|
+
const rac_stt_config_t* config);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief Check if model is loaded
|
|
49
|
+
*
|
|
50
|
+
* @param handle Component handle
|
|
51
|
+
* @return RAC_TRUE if loaded, RAC_FALSE otherwise
|
|
52
|
+
*/
|
|
53
|
+
RAC_API rac_bool_t rac_stt_component_is_loaded(rac_handle_t handle);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @brief Get current model ID
|
|
57
|
+
*
|
|
58
|
+
* @param handle Component handle
|
|
59
|
+
* @return Current model ID (NULL if not loaded)
|
|
60
|
+
*/
|
|
61
|
+
RAC_API const char* rac_stt_component_get_model_id(rac_handle_t handle);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @brief Load a model
|
|
65
|
+
*
|
|
66
|
+
* @param handle Component handle
|
|
67
|
+
* @param model_path File path to the model (used for loading) - REQUIRED
|
|
68
|
+
* @param model_id Model identifier for telemetry (e.g., "sherpa-onnx-whisper-tiny.en")
|
|
69
|
+
* Optional: if NULL, defaults to model_path
|
|
70
|
+
* @param model_name Human-readable model name (e.g., "Sherpa Whisper Tiny (ONNX)")
|
|
71
|
+
* Optional: if NULL, defaults to model_id
|
|
72
|
+
* @return RAC_SUCCESS or error code
|
|
73
|
+
*/
|
|
74
|
+
RAC_API rac_result_t rac_stt_component_load_model(rac_handle_t handle, const char* model_path,
|
|
75
|
+
const char* model_id, const char* model_name);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @brief Unload the current model
|
|
79
|
+
*
|
|
80
|
+
* @param handle Component handle
|
|
81
|
+
* @return RAC_SUCCESS or error code
|
|
82
|
+
*/
|
|
83
|
+
RAC_API rac_result_t rac_stt_component_unload(rac_handle_t handle);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @brief Cleanup and reset the component
|
|
87
|
+
*
|
|
88
|
+
* @param handle Component handle
|
|
89
|
+
* @return RAC_SUCCESS or error code
|
|
90
|
+
*/
|
|
91
|
+
RAC_API rac_result_t rac_stt_component_cleanup(rac_handle_t handle);
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @brief Transcribe audio data (batch mode)
|
|
95
|
+
*
|
|
96
|
+
* @param handle Component handle
|
|
97
|
+
* @param audio_data Audio data buffer
|
|
98
|
+
* @param audio_size Size of audio data in bytes
|
|
99
|
+
* @param options Transcription options (can be NULL for defaults)
|
|
100
|
+
* @param out_result Output: Transcription result
|
|
101
|
+
* @return RAC_SUCCESS or error code
|
|
102
|
+
*/
|
|
103
|
+
RAC_API rac_result_t rac_stt_component_transcribe(rac_handle_t handle, const void* audio_data,
|
|
104
|
+
size_t audio_size,
|
|
105
|
+
const rac_stt_options_t* options,
|
|
106
|
+
rac_stt_result_t* out_result);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @brief Check if streaming is supported
|
|
110
|
+
*
|
|
111
|
+
* @param handle Component handle
|
|
112
|
+
* @return RAC_TRUE if streaming supported, RAC_FALSE otherwise
|
|
113
|
+
*/
|
|
114
|
+
RAC_API rac_bool_t rac_stt_component_supports_streaming(rac_handle_t handle);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @brief Transcribe audio with streaming
|
|
118
|
+
*
|
|
119
|
+
* @param handle Component handle
|
|
120
|
+
* @param audio_data Audio chunk data
|
|
121
|
+
* @param audio_size Size of audio chunk
|
|
122
|
+
* @param options Transcription options
|
|
123
|
+
* @param callback Callback for partial results
|
|
124
|
+
* @param user_data User context passed to callback
|
|
125
|
+
* @return RAC_SUCCESS or error code
|
|
126
|
+
*/
|
|
127
|
+
RAC_API rac_result_t rac_stt_component_transcribe_stream(rac_handle_t handle,
|
|
128
|
+
const void* audio_data, size_t audio_size,
|
|
129
|
+
const rac_stt_options_t* options,
|
|
130
|
+
rac_stt_stream_callback_t callback,
|
|
131
|
+
void* user_data);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @brief Get lifecycle state
|
|
135
|
+
*
|
|
136
|
+
* @param handle Component handle
|
|
137
|
+
* @return Current lifecycle state
|
|
138
|
+
*/
|
|
139
|
+
RAC_API rac_lifecycle_state_t rac_stt_component_get_state(rac_handle_t handle);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @brief Get lifecycle metrics
|
|
143
|
+
*
|
|
144
|
+
* @param handle Component handle
|
|
145
|
+
* @param out_metrics Output: Lifecycle metrics
|
|
146
|
+
* @return RAC_SUCCESS or error code
|
|
147
|
+
*/
|
|
148
|
+
RAC_API rac_result_t rac_stt_component_get_metrics(rac_handle_t handle,
|
|
149
|
+
rac_lifecycle_metrics_t* out_metrics);
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @brief Destroy the STT component
|
|
153
|
+
*
|
|
154
|
+
* @param handle Component handle
|
|
155
|
+
*/
|
|
156
|
+
RAC_API void rac_stt_component_destroy(rac_handle_t handle);
|
|
157
|
+
|
|
158
|
+
#ifdef __cplusplus
|
|
159
|
+
}
|
|
160
|
+
#endif
|
|
161
|
+
|
|
162
|
+
#endif /* RAC_STT_COMPONENT_H */
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_events.h
|
|
3
|
+
* @brief STT-specific event types - 1:1 port of STTEvent.swift
|
|
4
|
+
*
|
|
5
|
+
* Swift Source: Sources/RunAnywhere/Features/STT/Analytics/STTEvent.swift
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef RAC_STT_EVENTS_H
|
|
9
|
+
#define RAC_STT_EVENTS_H
|
|
10
|
+
|
|
11
|
+
#include "rac/core/rac_types.h"
|
|
12
|
+
#include "rac/infrastructure/events/rac_events.h"
|
|
13
|
+
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
extern "C" {
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// STT EVENT TYPES
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
typedef enum rac_stt_event_type {
|
|
23
|
+
RAC_STT_EVENT_TRANSCRIPTION_STARTED = 0,
|
|
24
|
+
RAC_STT_EVENT_PARTIAL_TRANSCRIPT,
|
|
25
|
+
RAC_STT_EVENT_FINAL_TRANSCRIPT,
|
|
26
|
+
RAC_STT_EVENT_TRANSCRIPTION_COMPLETED,
|
|
27
|
+
RAC_STT_EVENT_TRANSCRIPTION_FAILED,
|
|
28
|
+
RAC_STT_EVENT_LANGUAGE_DETECTED,
|
|
29
|
+
} rac_stt_event_type_t;
|
|
30
|
+
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// EVENT PUBLISHING FUNCTIONS
|
|
33
|
+
// =============================================================================
|
|
34
|
+
|
|
35
|
+
RAC_API rac_result_t rac_stt_event_transcription_started(
|
|
36
|
+
const char* transcription_id, const char* model_id, double audio_length_ms,
|
|
37
|
+
int32_t audio_size_bytes, const char* language, rac_bool_t is_streaming,
|
|
38
|
+
rac_inference_framework_t framework);
|
|
39
|
+
|
|
40
|
+
RAC_API rac_result_t rac_stt_event_partial_transcript(const char* text, int32_t word_count);
|
|
41
|
+
|
|
42
|
+
RAC_API rac_result_t rac_stt_event_final_transcript(const char* text, float confidence);
|
|
43
|
+
|
|
44
|
+
RAC_API rac_result_t rac_stt_event_transcription_completed(
|
|
45
|
+
const char* transcription_id, const char* model_id, const char* text, float confidence,
|
|
46
|
+
double duration_ms, double audio_length_ms, int32_t word_count, double real_time_factor,
|
|
47
|
+
const char* language, rac_bool_t is_streaming, rac_inference_framework_t framework);
|
|
48
|
+
|
|
49
|
+
RAC_API rac_result_t rac_stt_event_transcription_failed(const char* transcription_id,
|
|
50
|
+
const char* model_id,
|
|
51
|
+
rac_result_t error_code,
|
|
52
|
+
const char* error_message);
|
|
53
|
+
|
|
54
|
+
RAC_API rac_result_t rac_stt_event_language_detected(const char* language, float confidence);
|
|
55
|
+
|
|
56
|
+
RAC_API const char* rac_stt_event_type_string(rac_stt_event_type_t event_type);
|
|
57
|
+
|
|
58
|
+
#ifdef __cplusplus
|
|
59
|
+
}
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
#endif /* RAC_STT_EVENTS_H */
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_service.h
|
|
3
|
+
* @brief RunAnywhere Commons - STT Service Interface
|
|
4
|
+
*
|
|
5
|
+
* Defines the generic STT service API and vtable for multi-backend dispatch.
|
|
6
|
+
* Backends (ONNX, Whisper, etc.) implement the vtable and register
|
|
7
|
+
* with the service registry.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#ifndef RAC_STT_SERVICE_H
|
|
11
|
+
#define RAC_STT_SERVICE_H
|
|
12
|
+
|
|
13
|
+
#include "rac/core/rac_error.h"
|
|
14
|
+
#include "rac/features/stt/rac_stt_types.h"
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
extern "C" {
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// SERVICE VTABLE - Backend implementations provide this
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* STT Service operations vtable.
|
|
26
|
+
* Each backend implements these functions and provides a static vtable.
|
|
27
|
+
*/
|
|
28
|
+
typedef struct rac_stt_service_ops {
|
|
29
|
+
/** Initialize the service with a model path */
|
|
30
|
+
rac_result_t (*initialize)(void* impl, const char* model_path);
|
|
31
|
+
|
|
32
|
+
/** Transcribe audio (batch mode) */
|
|
33
|
+
rac_result_t (*transcribe)(void* impl, const void* audio_data, size_t audio_size,
|
|
34
|
+
const rac_stt_options_t* options, rac_stt_result_t* out_result);
|
|
35
|
+
|
|
36
|
+
/** Stream transcription for real-time processing */
|
|
37
|
+
rac_result_t (*transcribe_stream)(void* impl, const void* audio_data, size_t audio_size,
|
|
38
|
+
const rac_stt_options_t* options,
|
|
39
|
+
rac_stt_stream_callback_t callback, void* user_data);
|
|
40
|
+
|
|
41
|
+
/** Get service info */
|
|
42
|
+
rac_result_t (*get_info)(void* impl, rac_stt_info_t* out_info);
|
|
43
|
+
|
|
44
|
+
/** Cleanup/unload model (keeps service alive) */
|
|
45
|
+
rac_result_t (*cleanup)(void* impl);
|
|
46
|
+
|
|
47
|
+
/** Destroy the service */
|
|
48
|
+
void (*destroy)(void* impl);
|
|
49
|
+
} rac_stt_service_ops_t;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* STT Service instance.
|
|
53
|
+
* Contains vtable pointer and backend-specific implementation.
|
|
54
|
+
*/
|
|
55
|
+
typedef struct rac_stt_service {
|
|
56
|
+
/** Vtable with backend operations */
|
|
57
|
+
const rac_stt_service_ops_t* ops;
|
|
58
|
+
|
|
59
|
+
/** Backend-specific implementation handle */
|
|
60
|
+
void* impl;
|
|
61
|
+
|
|
62
|
+
/** Model ID for reference */
|
|
63
|
+
const char* model_id;
|
|
64
|
+
} rac_stt_service_t;
|
|
65
|
+
|
|
66
|
+
// =============================================================================
|
|
67
|
+
// PUBLIC API - Generic service functions
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @brief Create an STT service
|
|
72
|
+
*
|
|
73
|
+
* Routes through service registry to find appropriate backend.
|
|
74
|
+
*
|
|
75
|
+
* @param model_path Path to the model file (can be NULL for some providers)
|
|
76
|
+
* @param out_handle Output: Handle to the created service
|
|
77
|
+
* @return RAC_SUCCESS or error code
|
|
78
|
+
*/
|
|
79
|
+
RAC_API rac_result_t rac_stt_create(const char* model_path, rac_handle_t* out_handle);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @brief Initialize an STT service
|
|
83
|
+
*
|
|
84
|
+
* @param handle Service handle
|
|
85
|
+
* @param model_path Path to the model file (can be NULL)
|
|
86
|
+
* @return RAC_SUCCESS or error code
|
|
87
|
+
*/
|
|
88
|
+
RAC_API rac_result_t rac_stt_initialize(rac_handle_t handle, const char* model_path);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @brief Transcribe audio data (batch mode)
|
|
92
|
+
*
|
|
93
|
+
* @param handle Service handle
|
|
94
|
+
* @param audio_data Audio data buffer
|
|
95
|
+
* @param audio_size Size of audio data in bytes
|
|
96
|
+
* @param options Transcription options (can be NULL for defaults)
|
|
97
|
+
* @param out_result Output: Transcription result (caller must free with rac_stt_result_free)
|
|
98
|
+
* @return RAC_SUCCESS or error code
|
|
99
|
+
*/
|
|
100
|
+
RAC_API rac_result_t rac_stt_transcribe(rac_handle_t handle, const void* audio_data,
|
|
101
|
+
size_t audio_size, const rac_stt_options_t* options,
|
|
102
|
+
rac_stt_result_t* out_result);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @brief Stream transcription for real-time processing
|
|
106
|
+
*
|
|
107
|
+
* @param handle Service handle
|
|
108
|
+
* @param audio_data Audio chunk data
|
|
109
|
+
* @param audio_size Size of audio chunk
|
|
110
|
+
* @param options Transcription options
|
|
111
|
+
* @param callback Callback for partial results
|
|
112
|
+
* @param user_data User context passed to callback
|
|
113
|
+
* @return RAC_SUCCESS or error code
|
|
114
|
+
*/
|
|
115
|
+
RAC_API rac_result_t rac_stt_transcribe_stream(rac_handle_t handle, const void* audio_data,
|
|
116
|
+
size_t audio_size, const rac_stt_options_t* options,
|
|
117
|
+
rac_stt_stream_callback_t callback, void* user_data);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @brief Get service information
|
|
121
|
+
*
|
|
122
|
+
* @param handle Service handle
|
|
123
|
+
* @param out_info Output: Service information
|
|
124
|
+
* @return RAC_SUCCESS or error code
|
|
125
|
+
*/
|
|
126
|
+
RAC_API rac_result_t rac_stt_get_info(rac_handle_t handle, rac_stt_info_t* out_info);
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @brief Cleanup and release resources
|
|
130
|
+
*
|
|
131
|
+
* @param handle Service handle
|
|
132
|
+
* @return RAC_SUCCESS or error code
|
|
133
|
+
*/
|
|
134
|
+
RAC_API rac_result_t rac_stt_cleanup(rac_handle_t handle);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @brief Destroy an STT service instance
|
|
138
|
+
*
|
|
139
|
+
* @param handle Service handle to destroy
|
|
140
|
+
*/
|
|
141
|
+
RAC_API void rac_stt_destroy(rac_handle_t handle);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief Free an STT result
|
|
145
|
+
*
|
|
146
|
+
* @param result Result to free
|
|
147
|
+
*/
|
|
148
|
+
RAC_API void rac_stt_result_free(rac_stt_result_t* result);
|
|
149
|
+
|
|
150
|
+
#ifdef __cplusplus
|
|
151
|
+
}
|
|
152
|
+
#endif
|
|
153
|
+
|
|
154
|
+
#endif /* RAC_STT_SERVICE_H */
|