@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,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm_platform.h
|
|
3
|
+
* @brief RunAnywhere Commons - Platform LLM Backend (Apple Foundation Models)
|
|
4
|
+
*
|
|
5
|
+
* C API for platform-native LLM services. On Apple platforms, this uses
|
|
6
|
+
* Foundation Models (Apple Intelligence). The actual implementation is in
|
|
7
|
+
* Swift, with C++ providing the registration and callback infrastructure.
|
|
8
|
+
*
|
|
9
|
+
* This backend follows the same pattern as LlamaCPP and ONNX backends,
|
|
10
|
+
* but delegates to Swift via function pointer callbacks since Foundation
|
|
11
|
+
* Models is a Swift-only framework.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef RAC_LLM_PLATFORM_H
|
|
15
|
+
#define RAC_LLM_PLATFORM_H
|
|
16
|
+
|
|
17
|
+
#include "rac/core/rac_types.h"
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// TYPES
|
|
25
|
+
// =============================================================================
|
|
26
|
+
|
|
27
|
+
/** Opaque handle to platform LLM service */
|
|
28
|
+
typedef struct rac_llm_platform* rac_llm_platform_handle_t;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Platform LLM configuration.
|
|
32
|
+
* Passed during initialization.
|
|
33
|
+
*/
|
|
34
|
+
typedef struct rac_llm_platform_config {
|
|
35
|
+
/** Reserved for future use */
|
|
36
|
+
void* reserved;
|
|
37
|
+
} rac_llm_platform_config_t;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Generation options for platform LLM.
|
|
41
|
+
*/
|
|
42
|
+
typedef struct rac_llm_platform_options {
|
|
43
|
+
/** Temperature for sampling (0.0 = deterministic, 1.0 = creative) */
|
|
44
|
+
float temperature;
|
|
45
|
+
/** Maximum tokens to generate */
|
|
46
|
+
int32_t max_tokens;
|
|
47
|
+
/** Reserved for future options */
|
|
48
|
+
void* reserved;
|
|
49
|
+
} rac_llm_platform_options_t;
|
|
50
|
+
|
|
51
|
+
// =============================================================================
|
|
52
|
+
// SWIFT CALLBACK TYPES
|
|
53
|
+
// =============================================================================
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Callback to check if platform LLM can handle a model ID.
|
|
57
|
+
* Implemented in Swift.
|
|
58
|
+
*
|
|
59
|
+
* @param model_id Model identifier to check (can be NULL)
|
|
60
|
+
* @param user_data User-provided context
|
|
61
|
+
* @return RAC_TRUE if this backend can handle the model
|
|
62
|
+
*/
|
|
63
|
+
typedef rac_bool_t (*rac_platform_llm_can_handle_fn)(const char* model_id, void* user_data);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Callback to create platform LLM service.
|
|
67
|
+
* Implemented in Swift.
|
|
68
|
+
*
|
|
69
|
+
* @param model_path Path to model (ignored for built-in)
|
|
70
|
+
* @param config Configuration options
|
|
71
|
+
* @param user_data User-provided context
|
|
72
|
+
* @return Handle to created service (Swift object pointer), or NULL on failure
|
|
73
|
+
*/
|
|
74
|
+
typedef rac_handle_t (*rac_platform_llm_create_fn)(const char* model_path,
|
|
75
|
+
const rac_llm_platform_config_t* config,
|
|
76
|
+
void* user_data);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Callback to generate text.
|
|
80
|
+
* Implemented in Swift.
|
|
81
|
+
*
|
|
82
|
+
* @param handle Service handle from create
|
|
83
|
+
* @param prompt Input prompt
|
|
84
|
+
* @param options Generation options
|
|
85
|
+
* @param out_response Output: Generated text (caller must free)
|
|
86
|
+
* @param user_data User-provided context
|
|
87
|
+
* @return RAC_SUCCESS or error code
|
|
88
|
+
*/
|
|
89
|
+
typedef rac_result_t (*rac_platform_llm_generate_fn)(rac_handle_t handle, const char* prompt,
|
|
90
|
+
const rac_llm_platform_options_t* options,
|
|
91
|
+
char** out_response, void* user_data);
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Callback to destroy platform LLM service.
|
|
95
|
+
* Implemented in Swift.
|
|
96
|
+
*
|
|
97
|
+
* @param handle Service handle to destroy
|
|
98
|
+
* @param user_data User-provided context
|
|
99
|
+
*/
|
|
100
|
+
typedef void (*rac_platform_llm_destroy_fn)(rac_handle_t handle, void* user_data);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Swift callbacks for platform LLM operations.
|
|
104
|
+
*/
|
|
105
|
+
typedef struct rac_platform_llm_callbacks {
|
|
106
|
+
rac_platform_llm_can_handle_fn can_handle;
|
|
107
|
+
rac_platform_llm_create_fn create;
|
|
108
|
+
rac_platform_llm_generate_fn generate;
|
|
109
|
+
rac_platform_llm_destroy_fn destroy;
|
|
110
|
+
void* user_data;
|
|
111
|
+
} rac_platform_llm_callbacks_t;
|
|
112
|
+
|
|
113
|
+
// =============================================================================
|
|
114
|
+
// CALLBACK REGISTRATION
|
|
115
|
+
// =============================================================================
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Sets the Swift callbacks for platform LLM operations.
|
|
119
|
+
* Must be called before using platform LLM services.
|
|
120
|
+
*
|
|
121
|
+
* @param callbacks Callback functions (copied internally)
|
|
122
|
+
* @return RAC_SUCCESS on success
|
|
123
|
+
*/
|
|
124
|
+
RAC_API rac_result_t rac_platform_llm_set_callbacks(const rac_platform_llm_callbacks_t* callbacks);
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Gets the current Swift callbacks.
|
|
128
|
+
*
|
|
129
|
+
* @return Pointer to callbacks, or NULL if not set
|
|
130
|
+
*/
|
|
131
|
+
RAC_API const rac_platform_llm_callbacks_t* rac_platform_llm_get_callbacks(void);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Checks if Swift callbacks are registered.
|
|
135
|
+
*
|
|
136
|
+
* @return RAC_TRUE if callbacks are available
|
|
137
|
+
*/
|
|
138
|
+
RAC_API rac_bool_t rac_platform_llm_is_available(void);
|
|
139
|
+
|
|
140
|
+
// =============================================================================
|
|
141
|
+
// SERVICE API
|
|
142
|
+
// =============================================================================
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Creates a platform LLM service.
|
|
146
|
+
*
|
|
147
|
+
* @param model_path Path to model (ignored for built-in, can be NULL)
|
|
148
|
+
* @param config Configuration options (can be NULL for defaults)
|
|
149
|
+
* @param out_handle Output: Service handle
|
|
150
|
+
* @return RAC_SUCCESS on success, or error code
|
|
151
|
+
*/
|
|
152
|
+
RAC_API rac_result_t rac_llm_platform_create(const char* model_path,
|
|
153
|
+
const rac_llm_platform_config_t* config,
|
|
154
|
+
rac_llm_platform_handle_t* out_handle);
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Destroys a platform LLM service.
|
|
158
|
+
*
|
|
159
|
+
* @param handle Service handle to destroy
|
|
160
|
+
*/
|
|
161
|
+
RAC_API void rac_llm_platform_destroy(rac_llm_platform_handle_t handle);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Generates text using platform LLM.
|
|
165
|
+
*
|
|
166
|
+
* @param handle Service handle
|
|
167
|
+
* @param prompt Input prompt
|
|
168
|
+
* @param options Generation options (can be NULL for defaults)
|
|
169
|
+
* @param out_response Output: Generated text (caller must free with free())
|
|
170
|
+
* @return RAC_SUCCESS on success, or error code
|
|
171
|
+
*/
|
|
172
|
+
RAC_API rac_result_t rac_llm_platform_generate(rac_llm_platform_handle_t handle, const char* prompt,
|
|
173
|
+
const rac_llm_platform_options_t* options,
|
|
174
|
+
char** out_response);
|
|
175
|
+
|
|
176
|
+
// =============================================================================
|
|
177
|
+
// BACKEND REGISTRATION
|
|
178
|
+
// =============================================================================
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Registers the Platform backend with the module and service registries.
|
|
182
|
+
*
|
|
183
|
+
* This registers:
|
|
184
|
+
* - Module: "platform" with TEXT_GENERATION and TTS capabilities
|
|
185
|
+
* - LLM Provider: "AppleFoundationModels" (priority 50)
|
|
186
|
+
* - TTS Provider: "SystemTTS" (priority 10)
|
|
187
|
+
* - Built-in model entries for Foundation Models and System TTS
|
|
188
|
+
*
|
|
189
|
+
* @return RAC_SUCCESS on success, or an error code
|
|
190
|
+
*/
|
|
191
|
+
RAC_API rac_result_t rac_backend_platform_register(void);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Unregisters the Platform backend.
|
|
195
|
+
*
|
|
196
|
+
* @return RAC_SUCCESS on success, or an error code
|
|
197
|
+
*/
|
|
198
|
+
RAC_API rac_result_t rac_backend_platform_unregister(void);
|
|
199
|
+
|
|
200
|
+
#ifdef __cplusplus
|
|
201
|
+
}
|
|
202
|
+
#endif
|
|
203
|
+
|
|
204
|
+
#endif /* RAC_LLM_PLATFORM_H */
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_tts_platform.h
|
|
3
|
+
* @brief RunAnywhere Commons - Platform TTS Backend (System TTS)
|
|
4
|
+
*
|
|
5
|
+
* C API for platform-native TTS services. On Apple platforms, this uses
|
|
6
|
+
* AVSpeechSynthesizer. The actual implementation is in Swift, with C++
|
|
7
|
+
* providing the registration and callback infrastructure.
|
|
8
|
+
*
|
|
9
|
+
* This backend follows the same pattern as ONNX TTS backend, but delegates
|
|
10
|
+
* to Swift via function pointer callbacks since AVSpeechSynthesizer is
|
|
11
|
+
* an Apple-only framework.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef RAC_TTS_PLATFORM_H
|
|
15
|
+
#define RAC_TTS_PLATFORM_H
|
|
16
|
+
|
|
17
|
+
#include "rac/core/rac_types.h"
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// TYPES
|
|
25
|
+
// =============================================================================
|
|
26
|
+
|
|
27
|
+
/** Opaque handle to platform TTS service */
|
|
28
|
+
typedef struct rac_tts_platform* rac_tts_platform_handle_t;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Platform TTS configuration.
|
|
32
|
+
*/
|
|
33
|
+
typedef struct rac_tts_platform_config {
|
|
34
|
+
/** Voice identifier (can be NULL for default) */
|
|
35
|
+
const char* voice_id;
|
|
36
|
+
/** Language code (e.g., "en-US") */
|
|
37
|
+
const char* language;
|
|
38
|
+
/** Reserved for future use */
|
|
39
|
+
void* reserved;
|
|
40
|
+
} rac_tts_platform_config_t;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Synthesis options for platform TTS.
|
|
44
|
+
*/
|
|
45
|
+
typedef struct rac_tts_platform_options {
|
|
46
|
+
/** Speech rate (0.5 = half speed, 1.0 = normal, 2.0 = double) */
|
|
47
|
+
float rate;
|
|
48
|
+
/** Pitch multiplier (0.5 = low, 1.0 = normal, 2.0 = high) */
|
|
49
|
+
float pitch;
|
|
50
|
+
/** Volume (0.0 = silent, 1.0 = full) */
|
|
51
|
+
float volume;
|
|
52
|
+
/** Voice identifier override (can be NULL) */
|
|
53
|
+
const char* voice_id;
|
|
54
|
+
/** Reserved for future options */
|
|
55
|
+
void* reserved;
|
|
56
|
+
} rac_tts_platform_options_t;
|
|
57
|
+
|
|
58
|
+
// =============================================================================
|
|
59
|
+
// SWIFT CALLBACK TYPES
|
|
60
|
+
// =============================================================================
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Callback to check if platform TTS can handle a voice ID.
|
|
64
|
+
* Implemented in Swift.
|
|
65
|
+
*
|
|
66
|
+
* @param voice_id Voice identifier to check (can be NULL)
|
|
67
|
+
* @param user_data User-provided context
|
|
68
|
+
* @return RAC_TRUE if this backend can handle the voice
|
|
69
|
+
*/
|
|
70
|
+
typedef rac_bool_t (*rac_platform_tts_can_handle_fn)(const char* voice_id, void* user_data);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Callback to create platform TTS service.
|
|
74
|
+
* Implemented in Swift.
|
|
75
|
+
*
|
|
76
|
+
* @param config Configuration options
|
|
77
|
+
* @param user_data User-provided context
|
|
78
|
+
* @return Handle to created service (Swift object pointer), or NULL on failure
|
|
79
|
+
*/
|
|
80
|
+
typedef rac_handle_t (*rac_platform_tts_create_fn)(const rac_tts_platform_config_t* config,
|
|
81
|
+
void* user_data);
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Callback to synthesize speech.
|
|
85
|
+
* Implemented in Swift.
|
|
86
|
+
*
|
|
87
|
+
* @param handle Service handle from create
|
|
88
|
+
* @param text Text to synthesize
|
|
89
|
+
* @param options Synthesis options
|
|
90
|
+
* @param user_data User-provided context
|
|
91
|
+
* @return RAC_SUCCESS or error code
|
|
92
|
+
*/
|
|
93
|
+
typedef rac_result_t (*rac_platform_tts_synthesize_fn)(rac_handle_t handle, const char* text,
|
|
94
|
+
const rac_tts_platform_options_t* options,
|
|
95
|
+
void* user_data);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Callback to stop speech.
|
|
99
|
+
* Implemented in Swift.
|
|
100
|
+
*
|
|
101
|
+
* @param handle Service handle
|
|
102
|
+
* @param user_data User-provided context
|
|
103
|
+
*/
|
|
104
|
+
typedef void (*rac_platform_tts_stop_fn)(rac_handle_t handle, void* user_data);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Callback to destroy platform TTS service.
|
|
108
|
+
* Implemented in Swift.
|
|
109
|
+
*
|
|
110
|
+
* @param handle Service handle to destroy
|
|
111
|
+
* @param user_data User-provided context
|
|
112
|
+
*/
|
|
113
|
+
typedef void (*rac_platform_tts_destroy_fn)(rac_handle_t handle, void* user_data);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Swift callbacks for platform TTS operations.
|
|
117
|
+
*/
|
|
118
|
+
typedef struct rac_platform_tts_callbacks {
|
|
119
|
+
rac_platform_tts_can_handle_fn can_handle;
|
|
120
|
+
rac_platform_tts_create_fn create;
|
|
121
|
+
rac_platform_tts_synthesize_fn synthesize;
|
|
122
|
+
rac_platform_tts_stop_fn stop;
|
|
123
|
+
rac_platform_tts_destroy_fn destroy;
|
|
124
|
+
void* user_data;
|
|
125
|
+
} rac_platform_tts_callbacks_t;
|
|
126
|
+
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// CALLBACK REGISTRATION
|
|
129
|
+
// =============================================================================
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Sets the Swift callbacks for platform TTS operations.
|
|
133
|
+
* Must be called before using platform TTS services.
|
|
134
|
+
*
|
|
135
|
+
* @param callbacks Callback functions (copied internally)
|
|
136
|
+
* @return RAC_SUCCESS on success
|
|
137
|
+
*/
|
|
138
|
+
RAC_API rac_result_t rac_platform_tts_set_callbacks(const rac_platform_tts_callbacks_t* callbacks);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Gets the current Swift callbacks.
|
|
142
|
+
*
|
|
143
|
+
* @return Pointer to callbacks, or NULL if not set
|
|
144
|
+
*/
|
|
145
|
+
RAC_API const rac_platform_tts_callbacks_t* rac_platform_tts_get_callbacks(void);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Checks if Swift callbacks are registered.
|
|
149
|
+
*
|
|
150
|
+
* @return RAC_TRUE if callbacks are available
|
|
151
|
+
*/
|
|
152
|
+
RAC_API rac_bool_t rac_platform_tts_is_available(void);
|
|
153
|
+
|
|
154
|
+
// =============================================================================
|
|
155
|
+
// SERVICE API
|
|
156
|
+
// =============================================================================
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Creates a platform TTS service.
|
|
160
|
+
*
|
|
161
|
+
* @param config Configuration options (can be NULL for defaults)
|
|
162
|
+
* @param out_handle Output: Service handle
|
|
163
|
+
* @return RAC_SUCCESS on success, or error code
|
|
164
|
+
*/
|
|
165
|
+
RAC_API rac_result_t rac_tts_platform_create(const rac_tts_platform_config_t* config,
|
|
166
|
+
rac_tts_platform_handle_t* out_handle);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Destroys a platform TTS service.
|
|
170
|
+
*
|
|
171
|
+
* @param handle Service handle to destroy
|
|
172
|
+
*/
|
|
173
|
+
RAC_API void rac_tts_platform_destroy(rac_tts_platform_handle_t handle);
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Synthesizes speech using platform TTS.
|
|
177
|
+
*
|
|
178
|
+
* @param handle Service handle
|
|
179
|
+
* @param text Text to synthesize
|
|
180
|
+
* @param options Synthesis options (can be NULL for defaults)
|
|
181
|
+
* @return RAC_SUCCESS on success, or error code
|
|
182
|
+
*/
|
|
183
|
+
RAC_API rac_result_t rac_tts_platform_synthesize(rac_tts_platform_handle_t handle, const char* text,
|
|
184
|
+
const rac_tts_platform_options_t* options);
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Stops current speech synthesis.
|
|
188
|
+
*
|
|
189
|
+
* @param handle Service handle
|
|
190
|
+
*/
|
|
191
|
+
RAC_API void rac_tts_platform_stop(rac_tts_platform_handle_t handle);
|
|
192
|
+
|
|
193
|
+
#ifdef __cplusplus
|
|
194
|
+
}
|
|
195
|
+
#endif
|
|
196
|
+
|
|
197
|
+
#endif /* RAC_TTS_PLATFORM_H */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt.h
|
|
3
|
+
* @brief RunAnywhere Commons - STT API (Convenience Header)
|
|
4
|
+
*
|
|
5
|
+
* This header includes both types and service interface for convenience.
|
|
6
|
+
* For better separation of concerns, prefer including:
|
|
7
|
+
* - rac_stt_types.h for data structures only
|
|
8
|
+
* - rac_stt_service.h for the service interface
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_STT_H
|
|
12
|
+
#define RAC_STT_H
|
|
13
|
+
|
|
14
|
+
#include "rac/features/stt/rac_stt_service.h"
|
|
15
|
+
#include "rac/features/stt/rac_stt_types.h"
|
|
16
|
+
|
|
17
|
+
#endif /* RAC_STT_H */
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_analytics.h
|
|
3
|
+
* @brief STT analytics service - 1:1 port of STTAnalyticsService.swift
|
|
4
|
+
*
|
|
5
|
+
* Tracks transcription operations and metrics.
|
|
6
|
+
* Lifecycle events are handled by the lifecycle manager.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: Audio length estimation assumes 16-bit PCM @ 16kHz (standard for STT).
|
|
9
|
+
* Formula: audioLengthMs = (bytes / 2) / 16000 * 1000
|
|
10
|
+
*
|
|
11
|
+
* NOTE: Real-Time Factor (RTF) will be 0 or undefined for streaming transcription
|
|
12
|
+
* since audioLengthMs = 0 when audio is processed in chunks of unknown total length.
|
|
13
|
+
*
|
|
14
|
+
* Swift Source: Sources/RunAnywhere/Features/STT/Analytics/STTAnalyticsService.swift
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#ifndef RAC_STT_ANALYTICS_H
|
|
18
|
+
#define RAC_STT_ANALYTICS_H
|
|
19
|
+
|
|
20
|
+
#include "rac/core/rac_types.h"
|
|
21
|
+
#include "rac/features/stt/rac_stt_types.h"
|
|
22
|
+
#include "rac/infrastructure/model_management/rac_model_types.h"
|
|
23
|
+
|
|
24
|
+
#ifdef __cplusplus
|
|
25
|
+
extern "C" {
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// TYPES
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @brief Opaque handle for STT analytics service
|
|
34
|
+
*/
|
|
35
|
+
typedef struct rac_stt_analytics_s* rac_stt_analytics_handle_t;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief STT metrics structure
|
|
39
|
+
* Mirrors Swift's STTMetrics struct
|
|
40
|
+
*/
|
|
41
|
+
typedef struct rac_stt_metrics {
|
|
42
|
+
/** Total number of events tracked */
|
|
43
|
+
int32_t total_events;
|
|
44
|
+
|
|
45
|
+
/** Start time (milliseconds since epoch) */
|
|
46
|
+
int64_t start_time_ms;
|
|
47
|
+
|
|
48
|
+
/** Last event time (milliseconds since epoch, 0 if no events) */
|
|
49
|
+
int64_t last_event_time_ms;
|
|
50
|
+
|
|
51
|
+
/** Total number of transcriptions */
|
|
52
|
+
int32_t total_transcriptions;
|
|
53
|
+
|
|
54
|
+
/** Average confidence score across all transcriptions (0.0 to 1.0) */
|
|
55
|
+
float average_confidence;
|
|
56
|
+
|
|
57
|
+
/** Average processing latency in milliseconds */
|
|
58
|
+
double average_latency_ms;
|
|
59
|
+
|
|
60
|
+
/** Average real-time factor (processing time / audio length) */
|
|
61
|
+
double average_real_time_factor;
|
|
62
|
+
|
|
63
|
+
/** Total audio processed in milliseconds */
|
|
64
|
+
double total_audio_processed_ms;
|
|
65
|
+
} rac_stt_metrics_t;
|
|
66
|
+
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// LIFECYCLE
|
|
69
|
+
// =============================================================================
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief Create an STT analytics service instance
|
|
73
|
+
*
|
|
74
|
+
* @param out_handle Output: Handle to the created service
|
|
75
|
+
* @return RAC_SUCCESS or error code
|
|
76
|
+
*/
|
|
77
|
+
RAC_API rac_result_t rac_stt_analytics_create(rac_stt_analytics_handle_t* out_handle);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @brief Destroy an STT analytics service instance
|
|
81
|
+
*
|
|
82
|
+
* @param handle Handle to destroy
|
|
83
|
+
*/
|
|
84
|
+
RAC_API void rac_stt_analytics_destroy(rac_stt_analytics_handle_t handle);
|
|
85
|
+
|
|
86
|
+
// =============================================================================
|
|
87
|
+
// TRANSCRIPTION TRACKING
|
|
88
|
+
// =============================================================================
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @brief Start tracking a transcription
|
|
92
|
+
*
|
|
93
|
+
* @param handle Analytics service handle
|
|
94
|
+
* @param model_id The STT model identifier
|
|
95
|
+
* @param audio_length_ms Duration of audio in milliseconds
|
|
96
|
+
* @param audio_size_bytes Size of audio data in bytes
|
|
97
|
+
* @param language Language code for transcription
|
|
98
|
+
* @param is_streaming Whether this is a streaming transcription
|
|
99
|
+
* @param sample_rate Audio sample rate in Hz (default: 16000)
|
|
100
|
+
* @param framework The inference framework being used
|
|
101
|
+
* @param out_transcription_id Output: Generated unique ID (owned, must be freed with rac_free)
|
|
102
|
+
* @return RAC_SUCCESS or error code
|
|
103
|
+
*/
|
|
104
|
+
RAC_API rac_result_t rac_stt_analytics_start_transcription(
|
|
105
|
+
rac_stt_analytics_handle_t handle, const char* model_id, double audio_length_ms,
|
|
106
|
+
int32_t audio_size_bytes, const char* language, rac_bool_t is_streaming, int32_t sample_rate,
|
|
107
|
+
rac_inference_framework_t framework, char** out_transcription_id);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @brief Track partial transcript (for streaming transcription)
|
|
111
|
+
*
|
|
112
|
+
* @param handle Analytics service handle
|
|
113
|
+
* @param text Partial transcript text
|
|
114
|
+
* @return RAC_SUCCESS or error code
|
|
115
|
+
*/
|
|
116
|
+
RAC_API rac_result_t rac_stt_analytics_track_partial_transcript(rac_stt_analytics_handle_t handle,
|
|
117
|
+
const char* text);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @brief Track final transcript (for streaming transcription)
|
|
121
|
+
*
|
|
122
|
+
* @param handle Analytics service handle
|
|
123
|
+
* @param text Final transcript text
|
|
124
|
+
* @param confidence Confidence score (0.0 to 1.0)
|
|
125
|
+
* @return RAC_SUCCESS or error code
|
|
126
|
+
*/
|
|
127
|
+
RAC_API rac_result_t rac_stt_analytics_track_final_transcript(rac_stt_analytics_handle_t handle,
|
|
128
|
+
const char* text, float confidence);
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @brief Complete a transcription
|
|
132
|
+
*
|
|
133
|
+
* @param handle Analytics service handle
|
|
134
|
+
* @param transcription_id The transcription ID
|
|
135
|
+
* @param text The transcribed text
|
|
136
|
+
* @param confidence Confidence score (0.0 to 1.0)
|
|
137
|
+
* @return RAC_SUCCESS or error code
|
|
138
|
+
*/
|
|
139
|
+
RAC_API rac_result_t rac_stt_analytics_complete_transcription(rac_stt_analytics_handle_t handle,
|
|
140
|
+
const char* transcription_id,
|
|
141
|
+
const char* text, float confidence);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief Track transcription failure
|
|
145
|
+
*
|
|
146
|
+
* @param handle Analytics service handle
|
|
147
|
+
* @param transcription_id The transcription ID
|
|
148
|
+
* @param error_code Error code
|
|
149
|
+
* @param error_message Error message
|
|
150
|
+
* @return RAC_SUCCESS or error code
|
|
151
|
+
*/
|
|
152
|
+
RAC_API rac_result_t rac_stt_analytics_track_transcription_failed(rac_stt_analytics_handle_t handle,
|
|
153
|
+
const char* transcription_id,
|
|
154
|
+
rac_result_t error_code,
|
|
155
|
+
const char* error_message);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @brief Track language detection
|
|
159
|
+
*
|
|
160
|
+
* @param handle Analytics service handle
|
|
161
|
+
* @param language Detected language code
|
|
162
|
+
* @param confidence Detection confidence (0.0 to 1.0)
|
|
163
|
+
* @return RAC_SUCCESS or error code
|
|
164
|
+
*/
|
|
165
|
+
RAC_API rac_result_t rac_stt_analytics_track_language_detection(rac_stt_analytics_handle_t handle,
|
|
166
|
+
const char* language,
|
|
167
|
+
float confidence);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @brief Track an error during STT operations
|
|
171
|
+
*
|
|
172
|
+
* @param handle Analytics service handle
|
|
173
|
+
* @param error_code Error code
|
|
174
|
+
* @param error_message Error message
|
|
175
|
+
* @param operation Operation that failed
|
|
176
|
+
* @param model_id Model ID (can be NULL)
|
|
177
|
+
* @param transcription_id Transcription ID (can be NULL)
|
|
178
|
+
* @return RAC_SUCCESS or error code
|
|
179
|
+
*/
|
|
180
|
+
RAC_API rac_result_t rac_stt_analytics_track_error(rac_stt_analytics_handle_t handle,
|
|
181
|
+
rac_result_t error_code,
|
|
182
|
+
const char* error_message, const char* operation,
|
|
183
|
+
const char* model_id,
|
|
184
|
+
const char* transcription_id);
|
|
185
|
+
|
|
186
|
+
// =============================================================================
|
|
187
|
+
// METRICS
|
|
188
|
+
// =============================================================================
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @brief Get current analytics metrics
|
|
192
|
+
*
|
|
193
|
+
* @param handle Analytics service handle
|
|
194
|
+
* @param out_metrics Output: Metrics structure
|
|
195
|
+
* @return RAC_SUCCESS or error code
|
|
196
|
+
*/
|
|
197
|
+
RAC_API rac_result_t rac_stt_analytics_get_metrics(rac_stt_analytics_handle_t handle,
|
|
198
|
+
rac_stt_metrics_t* out_metrics);
|
|
199
|
+
|
|
200
|
+
#ifdef __cplusplus
|
|
201
|
+
}
|
|
202
|
+
#endif
|
|
203
|
+
|
|
204
|
+
#endif /* RAC_STT_ANALYTICS_H */
|