@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,627 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RunAnywhereCore Nitrogen Spec
|
|
3
|
+
*
|
|
4
|
+
* Core SDK interface - includes:
|
|
5
|
+
* - SDK Lifecycle (init, destroy)
|
|
6
|
+
* - Authentication
|
|
7
|
+
* - Device Registration
|
|
8
|
+
* - Model Registry
|
|
9
|
+
* - Download Service
|
|
10
|
+
* - Storage
|
|
11
|
+
* - Events
|
|
12
|
+
* - HTTP Client
|
|
13
|
+
* - Utilities
|
|
14
|
+
* - LLM/STT/TTS/VAD capabilities (backend-agnostic via rac_*_component_* APIs)
|
|
15
|
+
*
|
|
16
|
+
* The capability methods (LLM, STT, TTS, VAD) are BACKEND-AGNOSTIC.
|
|
17
|
+
* They call the C++ rac_*_component_* APIs which work with any registered backend.
|
|
18
|
+
* Apps must install a backend package to register the actual implementation:
|
|
19
|
+
* - @runanywhere/llamacpp registers the LLM backend
|
|
20
|
+
* - @runanywhere/onnx registers the STT/TTS/VAD backends
|
|
21
|
+
*
|
|
22
|
+
* Matches Swift SDK: RunAnywhere.swift + CppBridge extensions
|
|
23
|
+
*/
|
|
24
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Core RunAnywhere native interface
|
|
28
|
+
*
|
|
29
|
+
* This interface provides all SDK functionality using backend-agnostic C++ APIs.
|
|
30
|
+
* Install backend packages to enable specific capabilities:
|
|
31
|
+
* - @runanywhere/llamacpp for text generation (LLM)
|
|
32
|
+
* - @runanywhere/onnx for speech processing (STT, TTS, VAD)
|
|
33
|
+
*/
|
|
34
|
+
export interface RunAnywhereCore
|
|
35
|
+
extends HybridObject<{
|
|
36
|
+
ios: 'c++';
|
|
37
|
+
android: 'c++';
|
|
38
|
+
}> {
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// SDK Lifecycle
|
|
41
|
+
// Matches Swift: CppBridge+Init.swift
|
|
42
|
+
// ============================================================================
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initialize the SDK with configuration
|
|
46
|
+
* @param configJson JSON string with apiKey, baseURL, environment
|
|
47
|
+
* @returns true if initialized successfully
|
|
48
|
+
*/
|
|
49
|
+
initialize(configJson: string): Promise<boolean>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Destroy the SDK and clean up resources
|
|
53
|
+
*/
|
|
54
|
+
destroy(): Promise<void>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if SDK is initialized
|
|
58
|
+
*/
|
|
59
|
+
isInitialized(): Promise<boolean>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get backend info as JSON string
|
|
63
|
+
*/
|
|
64
|
+
getBackendInfo(): Promise<string>;
|
|
65
|
+
|
|
66
|
+
// ============================================================================
|
|
67
|
+
// Authentication
|
|
68
|
+
// Matches Swift: CppBridge+Auth.swift
|
|
69
|
+
// ============================================================================
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Authenticate with API key
|
|
73
|
+
* @param apiKey API key
|
|
74
|
+
* @returns true if authenticated successfully
|
|
75
|
+
*/
|
|
76
|
+
authenticate(apiKey: string): Promise<boolean>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if currently authenticated
|
|
80
|
+
*/
|
|
81
|
+
isAuthenticated(): Promise<boolean>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get current user ID
|
|
85
|
+
* @returns User ID or empty if not authenticated
|
|
86
|
+
*/
|
|
87
|
+
getUserId(): Promise<string>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get current organization ID
|
|
91
|
+
* @returns Organization ID or empty if not authenticated
|
|
92
|
+
*/
|
|
93
|
+
getOrganizationId(): Promise<string>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Set authentication tokens directly (after JS-side authentication)
|
|
97
|
+
* This stores the tokens in C++ AuthBridge for use by telemetry/device registration
|
|
98
|
+
* @param authResponseJson JSON string with access_token, refresh_token, expires_in, etc.
|
|
99
|
+
* @returns true if tokens were set successfully
|
|
100
|
+
*/
|
|
101
|
+
setAuthTokens(authResponseJson: string): Promise<boolean>;
|
|
102
|
+
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// Device Registration
|
|
105
|
+
// Matches Swift: CppBridge+Device.swift
|
|
106
|
+
// ============================================================================
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Register device with backend
|
|
110
|
+
* @param environmentJson Environment configuration JSON
|
|
111
|
+
* @returns true if registered successfully
|
|
112
|
+
*/
|
|
113
|
+
registerDevice(environmentJson: string): Promise<boolean>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Check if device is registered
|
|
117
|
+
*/
|
|
118
|
+
isDeviceRegistered(): Promise<boolean>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Clear device registration flag (for testing)
|
|
122
|
+
* Forces re-registration on next SDK init
|
|
123
|
+
*/
|
|
124
|
+
clearDeviceRegistration(): Promise<boolean>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get the device ID
|
|
128
|
+
* @returns Device ID or empty if not registered
|
|
129
|
+
*/
|
|
130
|
+
getDeviceId(): Promise<string>;
|
|
131
|
+
|
|
132
|
+
// ============================================================================
|
|
133
|
+
// Model Registry
|
|
134
|
+
// Matches Swift: CppBridge+ModelRegistry.swift
|
|
135
|
+
// ============================================================================
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get list of available models
|
|
139
|
+
* @returns JSON array of model info
|
|
140
|
+
*/
|
|
141
|
+
getAvailableModels(): Promise<string>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get info for a specific model
|
|
145
|
+
* @param modelId Model identifier
|
|
146
|
+
* @returns JSON with model info
|
|
147
|
+
*/
|
|
148
|
+
getModelInfo(modelId: string): Promise<string>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Check if a model is downloaded
|
|
152
|
+
* @param modelId Model identifier
|
|
153
|
+
* @returns true if model exists locally
|
|
154
|
+
*/
|
|
155
|
+
isModelDownloaded(modelId: string): Promise<boolean>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get local path for a model
|
|
159
|
+
* @param modelId Model identifier
|
|
160
|
+
* @returns Local file path or empty if not downloaded
|
|
161
|
+
*/
|
|
162
|
+
getModelPath(modelId: string): Promise<string>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Register a custom model with the registry
|
|
166
|
+
* @param modelJson JSON with model definition
|
|
167
|
+
* @returns true if registered successfully
|
|
168
|
+
*/
|
|
169
|
+
registerModel(modelJson: string): Promise<boolean>;
|
|
170
|
+
|
|
171
|
+
// ============================================================================
|
|
172
|
+
// Download Service
|
|
173
|
+
// Matches Swift: CppBridge+Download.swift
|
|
174
|
+
// ============================================================================
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Download a model
|
|
178
|
+
* @param modelId Model identifier
|
|
179
|
+
* @param url Download URL
|
|
180
|
+
* @param destPath Destination path
|
|
181
|
+
* @returns true if download started successfully
|
|
182
|
+
*/
|
|
183
|
+
downloadModel(
|
|
184
|
+
modelId: string,
|
|
185
|
+
url: string,
|
|
186
|
+
destPath: string
|
|
187
|
+
): Promise<boolean>;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Cancel an ongoing download
|
|
191
|
+
* @param modelId Model identifier
|
|
192
|
+
* @returns true if cancelled
|
|
193
|
+
*/
|
|
194
|
+
cancelDownload(modelId: string): Promise<boolean>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get download progress
|
|
198
|
+
* @param modelId Model identifier
|
|
199
|
+
* @returns JSON with progress info (bytes, total, percentage)
|
|
200
|
+
*/
|
|
201
|
+
getDownloadProgress(modelId: string): Promise<string>;
|
|
202
|
+
|
|
203
|
+
// ============================================================================
|
|
204
|
+
// Storage
|
|
205
|
+
// Matches Swift: RunAnywhere+Storage.swift
|
|
206
|
+
// ============================================================================
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get storage info (disk usage, available space)
|
|
210
|
+
* @returns JSON with storage info
|
|
211
|
+
*/
|
|
212
|
+
getStorageInfo(): Promise<string>;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Clear model cache
|
|
216
|
+
* @returns true if cleared successfully
|
|
217
|
+
*/
|
|
218
|
+
clearCache(): Promise<boolean>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Delete a specific model
|
|
222
|
+
* @param modelId Model identifier
|
|
223
|
+
* @returns true if deleted successfully
|
|
224
|
+
*/
|
|
225
|
+
deleteModel(modelId: string): Promise<boolean>;
|
|
226
|
+
|
|
227
|
+
// ============================================================================
|
|
228
|
+
// Events
|
|
229
|
+
// Matches Swift: CppBridge+Events.swift
|
|
230
|
+
// ============================================================================
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Emit an event to the native event system
|
|
234
|
+
* @param eventJson Event JSON with type, category, data
|
|
235
|
+
*/
|
|
236
|
+
emitEvent(eventJson: string): Promise<void>;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Poll for pending events from native
|
|
240
|
+
* @returns JSON array of events
|
|
241
|
+
*/
|
|
242
|
+
pollEvents(): Promise<string>;
|
|
243
|
+
|
|
244
|
+
// ============================================================================
|
|
245
|
+
// HTTP Client
|
|
246
|
+
// Matches Swift: CppBridge+HTTP.swift
|
|
247
|
+
// ============================================================================
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Configure HTTP client
|
|
251
|
+
* @param baseUrl Base URL for API
|
|
252
|
+
* @param apiKey API key for authentication
|
|
253
|
+
* @returns true if configured successfully
|
|
254
|
+
*/
|
|
255
|
+
configureHttp(baseUrl: string, apiKey: string): Promise<boolean>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Make HTTP POST request
|
|
259
|
+
* @param path API path
|
|
260
|
+
* @param bodyJson Request body JSON
|
|
261
|
+
* @returns Response JSON
|
|
262
|
+
*/
|
|
263
|
+
httpPost(path: string, bodyJson: string): Promise<string>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Make HTTP GET request
|
|
267
|
+
* @param path API path
|
|
268
|
+
* @returns Response JSON
|
|
269
|
+
*/
|
|
270
|
+
httpGet(path: string): Promise<string>;
|
|
271
|
+
|
|
272
|
+
// ============================================================================
|
|
273
|
+
// Utility Functions
|
|
274
|
+
// ============================================================================
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get the last error message
|
|
278
|
+
*/
|
|
279
|
+
getLastError(): Promise<string>;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Extract an archive (tar.bz2, tar.gz, zip)
|
|
283
|
+
* @param archivePath Path to the archive
|
|
284
|
+
* @param destPath Destination directory
|
|
285
|
+
*/
|
|
286
|
+
extractArchive(archivePath: string, destPath: string): Promise<boolean>;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Get device capabilities
|
|
290
|
+
* @returns JSON string with device info
|
|
291
|
+
*/
|
|
292
|
+
getDeviceCapabilities(): Promise<string>;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Get memory usage
|
|
296
|
+
* @returns Current memory usage in bytes
|
|
297
|
+
*/
|
|
298
|
+
getMemoryUsage(): Promise<number>;
|
|
299
|
+
|
|
300
|
+
// ============================================================================
|
|
301
|
+
// LLM Capability (Backend-Agnostic)
|
|
302
|
+
// Matches Swift: CppBridge+LLM.swift - calls rac_llm_component_* APIs
|
|
303
|
+
// Requires a backend (e.g., @runanywhere/llamacpp) to be registered
|
|
304
|
+
// ============================================================================
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Load a text generation model
|
|
308
|
+
* @param modelPath Path to the model file
|
|
309
|
+
* @param configJson Optional configuration JSON
|
|
310
|
+
* @returns true if model loaded successfully
|
|
311
|
+
*/
|
|
312
|
+
loadTextModel(modelPath: string, configJson?: string): Promise<boolean>;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Check if a text model is loaded
|
|
316
|
+
*/
|
|
317
|
+
isTextModelLoaded(): Promise<boolean>;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Unload the current text model
|
|
321
|
+
*/
|
|
322
|
+
unloadTextModel(): Promise<boolean>;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Generate text from a prompt
|
|
326
|
+
* @param prompt Input prompt
|
|
327
|
+
* @param optionsJson Generation options JSON
|
|
328
|
+
* @returns Generated text result as JSON
|
|
329
|
+
*/
|
|
330
|
+
generate(prompt: string, optionsJson?: string): Promise<string>;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Generate text with streaming (callback-based)
|
|
334
|
+
* @param prompt Input prompt
|
|
335
|
+
* @param optionsJson Generation options JSON
|
|
336
|
+
* @param callback Token callback (token: string, isComplete: boolean) => void
|
|
337
|
+
* @returns Final result as JSON
|
|
338
|
+
*/
|
|
339
|
+
generateStream(
|
|
340
|
+
prompt: string,
|
|
341
|
+
optionsJson: string,
|
|
342
|
+
callback: (token: string, isComplete: boolean) => void
|
|
343
|
+
): Promise<string>;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Cancel ongoing text generation
|
|
347
|
+
*/
|
|
348
|
+
cancelGeneration(): Promise<boolean>;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Generate structured output (JSON) from a prompt
|
|
352
|
+
* @param prompt Input prompt
|
|
353
|
+
* @param schema JSON schema for output
|
|
354
|
+
* @param optionsJson Generation options JSON
|
|
355
|
+
* @returns Structured output as JSON
|
|
356
|
+
*/
|
|
357
|
+
generateStructured(
|
|
358
|
+
prompt: string,
|
|
359
|
+
schema: string,
|
|
360
|
+
optionsJson?: string
|
|
361
|
+
): Promise<string>;
|
|
362
|
+
|
|
363
|
+
// ============================================================================
|
|
364
|
+
// STT Capability (Backend-Agnostic)
|
|
365
|
+
// Matches Swift: CppBridge+STT.swift - calls rac_stt_component_* APIs
|
|
366
|
+
// Requires a backend (e.g., @runanywhere/onnx) to be registered
|
|
367
|
+
// ============================================================================
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Load a speech-to-text model
|
|
371
|
+
* @param modelPath Path to the model file
|
|
372
|
+
* @param modelType Model type identifier
|
|
373
|
+
* @param configJson Optional configuration JSON
|
|
374
|
+
* @returns true if model loaded successfully
|
|
375
|
+
*/
|
|
376
|
+
loadSTTModel(
|
|
377
|
+
modelPath: string,
|
|
378
|
+
modelType: string,
|
|
379
|
+
configJson?: string
|
|
380
|
+
): Promise<boolean>;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Check if an STT model is loaded
|
|
384
|
+
*/
|
|
385
|
+
isSTTModelLoaded(): Promise<boolean>;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Unload the current STT model
|
|
389
|
+
*/
|
|
390
|
+
unloadSTTModel(): Promise<boolean>;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Transcribe audio data
|
|
394
|
+
* @param audioBase64 Base64 encoded audio data
|
|
395
|
+
* @param sampleRate Audio sample rate
|
|
396
|
+
* @param language Language code (optional)
|
|
397
|
+
* @returns Transcription result as JSON
|
|
398
|
+
*/
|
|
399
|
+
transcribe(
|
|
400
|
+
audioBase64: string,
|
|
401
|
+
sampleRate: number,
|
|
402
|
+
language?: string
|
|
403
|
+
): Promise<string>;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Transcribe an audio file
|
|
407
|
+
* @param filePath Path to the audio file
|
|
408
|
+
* @param language Language code (optional)
|
|
409
|
+
* @returns Transcription result as JSON
|
|
410
|
+
*/
|
|
411
|
+
transcribeFile(filePath: string, language?: string): Promise<string>;
|
|
412
|
+
|
|
413
|
+
// ============================================================================
|
|
414
|
+
// TTS Capability (Backend-Agnostic)
|
|
415
|
+
// Matches Swift: CppBridge+TTS.swift - calls rac_tts_component_* APIs
|
|
416
|
+
// Requires a backend (e.g., @runanywhere/onnx) to be registered
|
|
417
|
+
// ============================================================================
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Load a text-to-speech model/voice
|
|
421
|
+
* @param modelPath Path to the model file
|
|
422
|
+
* @param modelType Model type identifier
|
|
423
|
+
* @param configJson Optional configuration JSON
|
|
424
|
+
* @returns true if model loaded successfully
|
|
425
|
+
*/
|
|
426
|
+
loadTTSModel(
|
|
427
|
+
modelPath: string,
|
|
428
|
+
modelType: string,
|
|
429
|
+
configJson?: string
|
|
430
|
+
): Promise<boolean>;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Check if a TTS model is loaded
|
|
434
|
+
*/
|
|
435
|
+
isTTSModelLoaded(): Promise<boolean>;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Unload the current TTS model
|
|
439
|
+
*/
|
|
440
|
+
unloadTTSModel(): Promise<boolean>;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Synthesize speech from text
|
|
444
|
+
* @param text Text to synthesize
|
|
445
|
+
* @param voiceId Voice ID to use
|
|
446
|
+
* @param speedRate Speech speed rate (1.0 = normal)
|
|
447
|
+
* @param pitchShift Pitch shift (-1.0 to 1.0)
|
|
448
|
+
* @returns Synthesized audio as base64 encoded JSON
|
|
449
|
+
*/
|
|
450
|
+
synthesize(
|
|
451
|
+
text: string,
|
|
452
|
+
voiceId: string,
|
|
453
|
+
speedRate: number,
|
|
454
|
+
pitchShift: number
|
|
455
|
+
): Promise<string>;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Get available TTS voices
|
|
459
|
+
* @returns JSON array of voice info
|
|
460
|
+
*/
|
|
461
|
+
getTTSVoices(): Promise<string>;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Cancel ongoing TTS synthesis
|
|
465
|
+
*/
|
|
466
|
+
cancelTTS(): Promise<boolean>;
|
|
467
|
+
|
|
468
|
+
// ============================================================================
|
|
469
|
+
// VAD Capability (Backend-Agnostic)
|
|
470
|
+
// Matches Swift: CppBridge+VAD.swift - calls rac_vad_component_* APIs
|
|
471
|
+
// Requires a backend (e.g., @runanywhere/onnx) to be registered
|
|
472
|
+
// ============================================================================
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Load a voice activity detection model
|
|
476
|
+
* @param modelPath Path to the model file
|
|
477
|
+
* @param configJson Optional configuration JSON
|
|
478
|
+
* @returns true if model loaded successfully
|
|
479
|
+
*/
|
|
480
|
+
loadVADModel(modelPath: string, configJson?: string): Promise<boolean>;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Check if a VAD model is loaded
|
|
484
|
+
*/
|
|
485
|
+
isVADModelLoaded(): Promise<boolean>;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Unload the current VAD model
|
|
489
|
+
*/
|
|
490
|
+
unloadVADModel(): Promise<boolean>;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Process audio for voice activity detection
|
|
494
|
+
* @param audioBase64 Base64 encoded audio data
|
|
495
|
+
* @param optionsJson VAD options JSON
|
|
496
|
+
* @returns VAD result as JSON
|
|
497
|
+
*/
|
|
498
|
+
processVAD(audioBase64: string, optionsJson?: string): Promise<string>;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Reset VAD state
|
|
502
|
+
*/
|
|
503
|
+
resetVAD(): Promise<void>;
|
|
504
|
+
|
|
505
|
+
// ============================================================================
|
|
506
|
+
// Secure Storage
|
|
507
|
+
// Matches Swift: KeychainManager.swift
|
|
508
|
+
// Uses platform secure storage (Keychain on iOS, Keystore on Android)
|
|
509
|
+
// ============================================================================
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Store a string value securely
|
|
513
|
+
* @param key Storage key (e.g., "com.runanywhere.sdk.apiKey")
|
|
514
|
+
* @param value String value to store
|
|
515
|
+
* @returns true if stored successfully
|
|
516
|
+
*/
|
|
517
|
+
secureStorageSet(key: string, value: string): Promise<boolean>;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Retrieve a string value from secure storage
|
|
521
|
+
* @param key Storage key
|
|
522
|
+
* @returns Stored value or null if not found
|
|
523
|
+
*/
|
|
524
|
+
secureStorageGet(key: string): Promise<string | null>;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Delete a value from secure storage
|
|
528
|
+
* @param key Storage key
|
|
529
|
+
* @returns true if deleted successfully
|
|
530
|
+
*/
|
|
531
|
+
secureStorageDelete(key: string): Promise<boolean>;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Check if a key exists in secure storage
|
|
535
|
+
* @param key Storage key
|
|
536
|
+
* @returns true if key exists
|
|
537
|
+
*/
|
|
538
|
+
secureStorageExists(key: string): Promise<boolean>;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Get persistent device UUID
|
|
542
|
+
* This UUID survives app reinstalls (stored in Keychain/Keystore)
|
|
543
|
+
* Matches Swift: DeviceIdentity.persistentUUID
|
|
544
|
+
* @returns Persistent device UUID
|
|
545
|
+
*/
|
|
546
|
+
getPersistentDeviceUUID(): Promise<string>;
|
|
547
|
+
|
|
548
|
+
// ============================================================================
|
|
549
|
+
// Telemetry
|
|
550
|
+
// Matches Swift: CppBridge+Telemetry.swift
|
|
551
|
+
// C++ handles all telemetry logic - batching, JSON building, routing
|
|
552
|
+
// ============================================================================
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Flush pending telemetry events immediately
|
|
556
|
+
* Sends all queued events to the backend
|
|
557
|
+
*/
|
|
558
|
+
flushTelemetry(): Promise<void>;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Check if telemetry is initialized
|
|
562
|
+
*/
|
|
563
|
+
isTelemetryInitialized(): Promise<boolean>;
|
|
564
|
+
|
|
565
|
+
// ============================================================================
|
|
566
|
+
// Voice Agent Capability (Backend-Agnostic)
|
|
567
|
+
// Matches Swift: CppBridge+VoiceAgent.swift - calls rac_voice_agent_* APIs
|
|
568
|
+
// Requires STT, LLM, and TTS backends to be registered
|
|
569
|
+
// ============================================================================
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Initialize voice agent with configuration
|
|
573
|
+
* @param configJson Configuration JSON
|
|
574
|
+
* @returns true if initialized successfully
|
|
575
|
+
*/
|
|
576
|
+
initializeVoiceAgent(configJson: string): Promise<boolean>;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Initialize voice agent using already loaded models
|
|
580
|
+
* @returns true if initialized successfully
|
|
581
|
+
*/
|
|
582
|
+
initializeVoiceAgentWithLoadedModels(): Promise<boolean>;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Check if voice agent is ready
|
|
586
|
+
*/
|
|
587
|
+
isVoiceAgentReady(): Promise<boolean>;
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Get voice agent component states
|
|
591
|
+
* @returns JSON with component states
|
|
592
|
+
*/
|
|
593
|
+
getVoiceAgentComponentStates(): Promise<string>;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Process a voice turn (STT -> LLM -> TTS)
|
|
597
|
+
* @param audioBase64 Base64 encoded audio input
|
|
598
|
+
* @returns Voice agent result as JSON
|
|
599
|
+
*/
|
|
600
|
+
processVoiceTurn(audioBase64: string): Promise<string>;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Transcribe audio using voice agent
|
|
604
|
+
* @param audioBase64 Base64 encoded audio data
|
|
605
|
+
* @returns Transcription text
|
|
606
|
+
*/
|
|
607
|
+
voiceAgentTranscribe(audioBase64: string): Promise<string>;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Generate response using voice agent
|
|
611
|
+
* @param prompt Text prompt
|
|
612
|
+
* @returns Generated response text
|
|
613
|
+
*/
|
|
614
|
+
voiceAgentGenerateResponse(prompt: string): Promise<string>;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Synthesize speech using voice agent
|
|
618
|
+
* @param text Text to synthesize
|
|
619
|
+
* @returns Synthesized audio as base64
|
|
620
|
+
*/
|
|
621
|
+
voiceAgentSynthesizeSpeech(text: string): Promise<string>;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Cleanup voice agent resources
|
|
625
|
+
*/
|
|
626
|
+
cleanupVoiceAgent(): Promise<void>;
|
|
627
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Device information interface for RunAnywhere SDK.
|
|
5
|
+
* Provides device capabilities, memory info, and battery status.
|
|
6
|
+
*/
|
|
7
|
+
export interface RunAnywhereDeviceInfo
|
|
8
|
+
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
9
|
+
/**
|
|
10
|
+
* Get device model name
|
|
11
|
+
*/
|
|
12
|
+
getDeviceModel(): Promise<string>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get OS version
|
|
16
|
+
*/
|
|
17
|
+
getOSVersion(): Promise<string>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get platform name (ios/android)
|
|
21
|
+
*/
|
|
22
|
+
getPlatform(): Promise<string>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get total RAM in bytes
|
|
26
|
+
*/
|
|
27
|
+
getTotalRAM(): Promise<number>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get available RAM in bytes
|
|
31
|
+
*/
|
|
32
|
+
getAvailableRAM(): Promise<number>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get number of CPU cores
|
|
36
|
+
*/
|
|
37
|
+
getCPUCores(): Promise<number>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if device has GPU
|
|
41
|
+
*/
|
|
42
|
+
hasGPU(): Promise<boolean>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if device has NPU (Neural Processing Unit)
|
|
46
|
+
*/
|
|
47
|
+
hasNPU(): Promise<boolean>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get chip/processor name
|
|
51
|
+
*/
|
|
52
|
+
getChipName(): Promise<string>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get thermal state (0=nominal, 1=fair, 2=serious, 3=critical)
|
|
56
|
+
*/
|
|
57
|
+
getThermalState(): Promise<number>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get battery level (0.0 to 1.0)
|
|
61
|
+
*/
|
|
62
|
+
getBatteryLevel(): Promise<number>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if device is charging
|
|
66
|
+
*/
|
|
67
|
+
isCharging(): Promise<boolean>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Check if low power mode is enabled
|
|
71
|
+
*/
|
|
72
|
+
isLowPowerMode(): Promise<boolean>;
|
|
73
|
+
}
|