@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,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm.h
|
|
3
|
+
* @brief RunAnywhere Commons - LLM 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_llm_types.h for data structures only
|
|
8
|
+
* - rac_llm_service.h for the service interface
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_LLM_H
|
|
12
|
+
#define RAC_LLM_H
|
|
13
|
+
|
|
14
|
+
#include <RACommons/rac_llm_service.h>
|
|
15
|
+
#include <RACommons/rac_llm_types.h>
|
|
16
|
+
|
|
17
|
+
#endif /* RAC_LLM_H */
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm_analytics.h
|
|
3
|
+
* @brief LLM Generation analytics service - 1:1 port of GenerationAnalyticsService.swift
|
|
4
|
+
*
|
|
5
|
+
* Tracks generation operations and metrics.
|
|
6
|
+
* Lifecycle events are handled by the lifecycle manager.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: Token estimation uses ~4 chars/token (approximation, not exact tokenizer count).
|
|
9
|
+
* Actual token counts may vary depending on the model's tokenizer and input content.
|
|
10
|
+
*
|
|
11
|
+
* Swift Source: Sources/RunAnywhere/Features/LLM/Analytics/GenerationAnalyticsService.swift
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef RAC_LLM_ANALYTICS_H
|
|
15
|
+
#define RAC_LLM_ANALYTICS_H
|
|
16
|
+
|
|
17
|
+
#include <RACommons/rac_types.h>
|
|
18
|
+
#include <RACommons/rac_llm_metrics.h>
|
|
19
|
+
#include <RACommons/rac_llm_types.h>
|
|
20
|
+
#include <RACommons/rac_model_types.h>
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
extern "C" {
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// TYPES
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @brief Opaque handle for LLM analytics service
|
|
32
|
+
*/
|
|
33
|
+
typedef struct rac_llm_analytics_s* rac_llm_analytics_handle_t;
|
|
34
|
+
|
|
35
|
+
// Note: rac_generation_metrics_t is defined in rac_llm_metrics.h
|
|
36
|
+
|
|
37
|
+
// =============================================================================
|
|
38
|
+
// LIFECYCLE
|
|
39
|
+
// =============================================================================
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @brief Create an LLM analytics service instance
|
|
43
|
+
*
|
|
44
|
+
* @param out_handle Output: Handle to the created service
|
|
45
|
+
* @return RAC_SUCCESS or error code
|
|
46
|
+
*/
|
|
47
|
+
RAC_API rac_result_t rac_llm_analytics_create(rac_llm_analytics_handle_t* out_handle);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @brief Destroy an LLM analytics service instance
|
|
51
|
+
*
|
|
52
|
+
* @param handle Handle to destroy
|
|
53
|
+
*/
|
|
54
|
+
RAC_API void rac_llm_analytics_destroy(rac_llm_analytics_handle_t handle);
|
|
55
|
+
|
|
56
|
+
// =============================================================================
|
|
57
|
+
// GENERATION TRACKING
|
|
58
|
+
// =============================================================================
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @brief Start tracking a non-streaming generation
|
|
62
|
+
*
|
|
63
|
+
* Mirrors Swift's startGeneration()
|
|
64
|
+
*
|
|
65
|
+
* @param handle Analytics service handle
|
|
66
|
+
* @param model_id The model ID being used
|
|
67
|
+
* @param framework The inference framework type (can be RAC_INFERENCE_FRAMEWORK_UNKNOWN)
|
|
68
|
+
* @param temperature Generation temperature (NULL for default)
|
|
69
|
+
* @param max_tokens Maximum tokens to generate (NULL for default)
|
|
70
|
+
* @param context_length Context window size (NULL for default)
|
|
71
|
+
* @param out_generation_id Output: Generated unique ID (owned, must be freed with rac_free)
|
|
72
|
+
* @return RAC_SUCCESS or error code
|
|
73
|
+
*/
|
|
74
|
+
RAC_API rac_result_t rac_llm_analytics_start_generation(
|
|
75
|
+
rac_llm_analytics_handle_t handle, const char* model_id, rac_inference_framework_t framework,
|
|
76
|
+
const float* temperature, const int32_t* max_tokens, const int32_t* context_length,
|
|
77
|
+
char** out_generation_id);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @brief Start tracking a streaming generation
|
|
81
|
+
*
|
|
82
|
+
* Mirrors Swift's startStreamingGeneration()
|
|
83
|
+
*
|
|
84
|
+
* @param handle Analytics service handle
|
|
85
|
+
* @param model_id The model ID being used
|
|
86
|
+
* @param framework The inference framework type
|
|
87
|
+
* @param temperature Generation temperature (NULL for default)
|
|
88
|
+
* @param max_tokens Maximum tokens to generate (NULL for default)
|
|
89
|
+
* @param context_length Context window size (NULL for default)
|
|
90
|
+
* @param out_generation_id Output: Generated unique ID (owned, must be freed with rac_free)
|
|
91
|
+
* @return RAC_SUCCESS or error code
|
|
92
|
+
*/
|
|
93
|
+
RAC_API rac_result_t rac_llm_analytics_start_streaming_generation(
|
|
94
|
+
rac_llm_analytics_handle_t handle, const char* model_id, rac_inference_framework_t framework,
|
|
95
|
+
const float* temperature, const int32_t* max_tokens, const int32_t* context_length,
|
|
96
|
+
char** out_generation_id);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @brief Track first token for streaming generation (TTFT metric)
|
|
100
|
+
*
|
|
101
|
+
* Only applicable for streaming generations. Call is ignored for non-streaming.
|
|
102
|
+
*
|
|
103
|
+
* @param handle Analytics service handle
|
|
104
|
+
* @param generation_id The generation ID from start_streaming_generation
|
|
105
|
+
* @return RAC_SUCCESS or error code
|
|
106
|
+
*/
|
|
107
|
+
RAC_API rac_result_t rac_llm_analytics_track_first_token(rac_llm_analytics_handle_t handle,
|
|
108
|
+
const char* generation_id);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @brief Track streaming update (analytics only)
|
|
112
|
+
*
|
|
113
|
+
* Only applicable for streaming generations.
|
|
114
|
+
*
|
|
115
|
+
* @param handle Analytics service handle
|
|
116
|
+
* @param generation_id The generation ID
|
|
117
|
+
* @param tokens_generated Number of tokens generated so far
|
|
118
|
+
* @return RAC_SUCCESS or error code
|
|
119
|
+
*/
|
|
120
|
+
RAC_API rac_result_t rac_llm_analytics_track_streaming_update(rac_llm_analytics_handle_t handle,
|
|
121
|
+
const char* generation_id,
|
|
122
|
+
int32_t tokens_generated);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @brief Complete a generation (works for both streaming and non-streaming)
|
|
126
|
+
*
|
|
127
|
+
* @param handle Analytics service handle
|
|
128
|
+
* @param generation_id The generation ID
|
|
129
|
+
* @param input_tokens Number of input tokens processed
|
|
130
|
+
* @param output_tokens Number of output tokens generated
|
|
131
|
+
* @param model_id The model ID used
|
|
132
|
+
* @return RAC_SUCCESS or error code
|
|
133
|
+
*/
|
|
134
|
+
RAC_API rac_result_t rac_llm_analytics_complete_generation(rac_llm_analytics_handle_t handle,
|
|
135
|
+
const char* generation_id,
|
|
136
|
+
int32_t input_tokens,
|
|
137
|
+
int32_t output_tokens,
|
|
138
|
+
const char* model_id);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @brief Track generation failure
|
|
142
|
+
*
|
|
143
|
+
* @param handle Analytics service handle
|
|
144
|
+
* @param generation_id The generation ID
|
|
145
|
+
* @param error_code Error code
|
|
146
|
+
* @param error_message Error message
|
|
147
|
+
* @return RAC_SUCCESS or error code
|
|
148
|
+
*/
|
|
149
|
+
RAC_API rac_result_t rac_llm_analytics_track_generation_failed(rac_llm_analytics_handle_t handle,
|
|
150
|
+
const char* generation_id,
|
|
151
|
+
rac_result_t error_code,
|
|
152
|
+
const char* error_message);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @brief Track an error during LLM operations
|
|
156
|
+
*
|
|
157
|
+
* @param handle Analytics service handle
|
|
158
|
+
* @param error_code Error code
|
|
159
|
+
* @param error_message Error message
|
|
160
|
+
* @param operation Operation that failed
|
|
161
|
+
* @param model_id Model ID (can be NULL)
|
|
162
|
+
* @param generation_id Generation ID (can be NULL)
|
|
163
|
+
* @return RAC_SUCCESS or error code
|
|
164
|
+
*/
|
|
165
|
+
RAC_API rac_result_t rac_llm_analytics_track_error(rac_llm_analytics_handle_t handle,
|
|
166
|
+
rac_result_t error_code,
|
|
167
|
+
const char* error_message, const char* operation,
|
|
168
|
+
const char* model_id, const char* generation_id);
|
|
169
|
+
|
|
170
|
+
// =============================================================================
|
|
171
|
+
// METRICS
|
|
172
|
+
// =============================================================================
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @brief Get current analytics metrics
|
|
176
|
+
*
|
|
177
|
+
* @param handle Analytics service handle
|
|
178
|
+
* @param out_metrics Output: Metrics structure
|
|
179
|
+
* @return RAC_SUCCESS or error code
|
|
180
|
+
*/
|
|
181
|
+
RAC_API rac_result_t rac_llm_analytics_get_metrics(rac_llm_analytics_handle_t handle,
|
|
182
|
+
rac_generation_metrics_t* out_metrics);
|
|
183
|
+
|
|
184
|
+
#ifdef __cplusplus
|
|
185
|
+
}
|
|
186
|
+
#endif
|
|
187
|
+
|
|
188
|
+
#endif /* RAC_LLM_ANALYTICS_H */
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm_component.h
|
|
3
|
+
* @brief RunAnywhere Commons - LLM Capability Component
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's LLMCapability.swift from:
|
|
6
|
+
* Sources/RunAnywhere/Features/LLM/LLMCapability.swift
|
|
7
|
+
*
|
|
8
|
+
* Actor-based LLM capability that owns model lifecycle and generation.
|
|
9
|
+
* Uses lifecycle manager for unified lifecycle + analytics handling.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef RAC_LLM_COMPONENT_H
|
|
13
|
+
#define RAC_LLM_COMPONENT_H
|
|
14
|
+
|
|
15
|
+
#include <RACommons/rac_lifecycle.h>
|
|
16
|
+
#include <RACommons/rac_error.h>
|
|
17
|
+
#include <RACommons/rac_llm_types.h>
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// NOTE: rac_llm_config_t is defined in rac_llm_types.h (included above)
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// STREAMING CALLBACKS - For component-level streaming
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @brief Streaming callback for token-by-token generation
|
|
31
|
+
*
|
|
32
|
+
* @param token The generated token
|
|
33
|
+
* @param user_data User-provided context
|
|
34
|
+
* @return RAC_TRUE to continue, RAC_FALSE to stop
|
|
35
|
+
*/
|
|
36
|
+
typedef rac_bool_t (*rac_llm_component_token_callback_fn)(const char* token, void* user_data);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @brief Streaming completion callback
|
|
40
|
+
*
|
|
41
|
+
* Called when streaming is complete with final metrics.
|
|
42
|
+
*
|
|
43
|
+
* @param result Final generation result with metrics
|
|
44
|
+
* @param user_data User-provided context
|
|
45
|
+
*/
|
|
46
|
+
typedef void (*rac_llm_component_complete_callback_fn)(const rac_llm_result_t* result,
|
|
47
|
+
void* user_data);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @brief Streaming error callback
|
|
51
|
+
*
|
|
52
|
+
* Called if streaming fails.
|
|
53
|
+
*
|
|
54
|
+
* @param error_code Error code
|
|
55
|
+
* @param error_message Error message
|
|
56
|
+
* @param user_data User-provided context
|
|
57
|
+
*/
|
|
58
|
+
typedef void (*rac_llm_component_error_callback_fn)(rac_result_t error_code,
|
|
59
|
+
const char* error_message, void* user_data);
|
|
60
|
+
|
|
61
|
+
// =============================================================================
|
|
62
|
+
// LLM COMPONENT API - Mirrors Swift's LLMCapability
|
|
63
|
+
// =============================================================================
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @brief Create an LLM capability component
|
|
67
|
+
*
|
|
68
|
+
* Mirrors Swift's LLMCapability.init()
|
|
69
|
+
*
|
|
70
|
+
* @param out_handle Output: Handle to the component
|
|
71
|
+
* @return RAC_SUCCESS or error code
|
|
72
|
+
*/
|
|
73
|
+
RAC_API rac_result_t rac_llm_component_create(rac_handle_t* out_handle);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @brief Configure the LLM component
|
|
77
|
+
*
|
|
78
|
+
* Mirrors Swift's LLMCapability.configure(_:)
|
|
79
|
+
*
|
|
80
|
+
* @param handle Component handle
|
|
81
|
+
* @param config Configuration
|
|
82
|
+
* @return RAC_SUCCESS or error code
|
|
83
|
+
*/
|
|
84
|
+
RAC_API rac_result_t rac_llm_component_configure(rac_handle_t handle,
|
|
85
|
+
const rac_llm_config_t* config);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @brief Check if model is loaded
|
|
89
|
+
*
|
|
90
|
+
* Mirrors Swift's LLMCapability.isModelLoaded
|
|
91
|
+
*
|
|
92
|
+
* @param handle Component handle
|
|
93
|
+
* @return RAC_TRUE if loaded, RAC_FALSE otherwise
|
|
94
|
+
*/
|
|
95
|
+
RAC_API rac_bool_t rac_llm_component_is_loaded(rac_handle_t handle);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @brief Get current model ID
|
|
99
|
+
*
|
|
100
|
+
* Mirrors Swift's LLMCapability.currentModelId
|
|
101
|
+
*
|
|
102
|
+
* @param handle Component handle
|
|
103
|
+
* @return Current model ID (NULL if not loaded)
|
|
104
|
+
*/
|
|
105
|
+
RAC_API const char* rac_llm_component_get_model_id(rac_handle_t handle);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @brief Load a model
|
|
109
|
+
*
|
|
110
|
+
* Mirrors Swift's LLMCapability.loadModel(_:)
|
|
111
|
+
*
|
|
112
|
+
* @param handle Component handle
|
|
113
|
+
* @param model_path File path to the model (used for loading) - REQUIRED
|
|
114
|
+
* @param model_id Model identifier for telemetry (e.g., "smollm2-360m-q8_0")
|
|
115
|
+
* Optional: if NULL, defaults to model_path
|
|
116
|
+
* @param model_name Human-readable model name (e.g., "SmolLM2 360M Q8_0")
|
|
117
|
+
* Optional: if NULL, defaults to model_id
|
|
118
|
+
* @return RAC_SUCCESS or error code
|
|
119
|
+
*/
|
|
120
|
+
RAC_API rac_result_t rac_llm_component_load_model(rac_handle_t handle, const char* model_path,
|
|
121
|
+
const char* model_id, const char* model_name);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @brief Unload the current model
|
|
125
|
+
*
|
|
126
|
+
* Mirrors Swift's LLMCapability.unload()
|
|
127
|
+
*
|
|
128
|
+
* @param handle Component handle
|
|
129
|
+
* @return RAC_SUCCESS or error code
|
|
130
|
+
*/
|
|
131
|
+
RAC_API rac_result_t rac_llm_component_unload(rac_handle_t handle);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @brief Cleanup and reset the component
|
|
135
|
+
*
|
|
136
|
+
* Mirrors Swift's LLMCapability.cleanup()
|
|
137
|
+
*
|
|
138
|
+
* @param handle Component handle
|
|
139
|
+
* @return RAC_SUCCESS or error code
|
|
140
|
+
*/
|
|
141
|
+
RAC_API rac_result_t rac_llm_component_cleanup(rac_handle_t handle);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief Cancel ongoing generation
|
|
145
|
+
*
|
|
146
|
+
* Mirrors Swift's LLMCapability.cancel()
|
|
147
|
+
* Best-effort cancellation.
|
|
148
|
+
*
|
|
149
|
+
* @param handle Component handle
|
|
150
|
+
* @return RAC_SUCCESS or error code
|
|
151
|
+
*/
|
|
152
|
+
RAC_API rac_result_t rac_llm_component_cancel(rac_handle_t handle);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @brief Generate text (non-streaming)
|
|
156
|
+
*
|
|
157
|
+
* Mirrors Swift's LLMCapability.generate(_:options:)
|
|
158
|
+
*
|
|
159
|
+
* @param handle Component handle
|
|
160
|
+
* @param prompt Input prompt
|
|
161
|
+
* @param options Generation options (can be NULL for defaults)
|
|
162
|
+
* @param out_result Output: Generation result
|
|
163
|
+
* @return RAC_SUCCESS or error code
|
|
164
|
+
*/
|
|
165
|
+
RAC_API rac_result_t rac_llm_component_generate(rac_handle_t handle, const char* prompt,
|
|
166
|
+
const rac_llm_options_t* options,
|
|
167
|
+
rac_llm_result_t* out_result);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @brief Check if streaming is supported
|
|
171
|
+
*
|
|
172
|
+
* Mirrors Swift's LLMCapability.supportsStreaming
|
|
173
|
+
*
|
|
174
|
+
* @param handle Component handle
|
|
175
|
+
* @return RAC_TRUE if streaming supported, RAC_FALSE otherwise
|
|
176
|
+
*/
|
|
177
|
+
RAC_API rac_bool_t rac_llm_component_supports_streaming(rac_handle_t handle);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @brief Generate text with streaming
|
|
181
|
+
*
|
|
182
|
+
* Mirrors Swift's LLMCapability.generateStream(_:options:)
|
|
183
|
+
*
|
|
184
|
+
* @param handle Component handle
|
|
185
|
+
* @param prompt Input prompt
|
|
186
|
+
* @param options Generation options (can be NULL for defaults)
|
|
187
|
+
* @param token_callback Called for each generated token
|
|
188
|
+
* @param complete_callback Called when generation completes
|
|
189
|
+
* @param error_callback Called on error
|
|
190
|
+
* @param user_data User context passed to callbacks
|
|
191
|
+
* @return RAC_SUCCESS or error code
|
|
192
|
+
*/
|
|
193
|
+
RAC_API rac_result_t rac_llm_component_generate_stream(
|
|
194
|
+
rac_handle_t handle, const char* prompt, const rac_llm_options_t* options,
|
|
195
|
+
rac_llm_component_token_callback_fn token_callback,
|
|
196
|
+
rac_llm_component_complete_callback_fn complete_callback,
|
|
197
|
+
rac_llm_component_error_callback_fn error_callback, void* user_data);
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @brief Get lifecycle state
|
|
201
|
+
*
|
|
202
|
+
* @param handle Component handle
|
|
203
|
+
* @return Current lifecycle state
|
|
204
|
+
*/
|
|
205
|
+
RAC_API rac_lifecycle_state_t rac_llm_component_get_state(rac_handle_t handle);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @brief Get lifecycle metrics
|
|
209
|
+
*
|
|
210
|
+
* @param handle Component handle
|
|
211
|
+
* @param out_metrics Output: Lifecycle metrics
|
|
212
|
+
* @return RAC_SUCCESS or error code
|
|
213
|
+
*/
|
|
214
|
+
RAC_API rac_result_t rac_llm_component_get_metrics(rac_handle_t handle,
|
|
215
|
+
rac_lifecycle_metrics_t* out_metrics);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @brief Destroy the LLM component
|
|
219
|
+
*
|
|
220
|
+
* @param handle Component handle
|
|
221
|
+
*/
|
|
222
|
+
RAC_API void rac_llm_component_destroy(rac_handle_t handle);
|
|
223
|
+
|
|
224
|
+
#ifdef __cplusplus
|
|
225
|
+
}
|
|
226
|
+
#endif
|
|
227
|
+
|
|
228
|
+
#endif /* RAC_LLM_COMPONENT_H */
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_llm_events.h
|
|
3
|
+
* @brief LLM-specific event types - 1:1 port of LLMEvent.swift
|
|
4
|
+
*
|
|
5
|
+
* All LLM-related events in one place.
|
|
6
|
+
* Each event declares its destination (public, analytics, or both).
|
|
7
|
+
*
|
|
8
|
+
* Swift Source: Sources/RunAnywhere/Features/LLM/Analytics/LLMEvent.swift
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_LLM_EVENTS_H
|
|
12
|
+
#define RAC_LLM_EVENTS_H
|
|
13
|
+
|
|
14
|
+
#include <RACommons/rac_types.h>
|
|
15
|
+
#include <RACommons/rac_events.h>
|
|
16
|
+
|
|
17
|
+
#ifdef __cplusplus
|
|
18
|
+
extern "C" {
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// LLM EVENT TYPES
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @brief LLM event types enumeration
|
|
27
|
+
* Mirrors Swift's LLMEvent cases
|
|
28
|
+
*/
|
|
29
|
+
typedef enum rac_llm_event_type {
|
|
30
|
+
RAC_LLM_EVENT_MODEL_LOAD_STARTED = 0,
|
|
31
|
+
RAC_LLM_EVENT_MODEL_LOAD_COMPLETED,
|
|
32
|
+
RAC_LLM_EVENT_MODEL_LOAD_FAILED,
|
|
33
|
+
RAC_LLM_EVENT_MODEL_UNLOADED,
|
|
34
|
+
RAC_LLM_EVENT_MODEL_UNLOAD_STARTED,
|
|
35
|
+
RAC_LLM_EVENT_GENERATION_STARTED,
|
|
36
|
+
RAC_LLM_EVENT_FIRST_TOKEN,
|
|
37
|
+
RAC_LLM_EVENT_STREAMING_UPDATE,
|
|
38
|
+
RAC_LLM_EVENT_GENERATION_COMPLETED,
|
|
39
|
+
RAC_LLM_EVENT_GENERATION_FAILED,
|
|
40
|
+
} rac_llm_event_type_t;
|
|
41
|
+
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// LLM EVENT DATA STRUCTURES
|
|
44
|
+
// =============================================================================
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @brief Model load event data
|
|
48
|
+
*/
|
|
49
|
+
typedef struct rac_llm_model_load_event {
|
|
50
|
+
const char* model_id;
|
|
51
|
+
int64_t model_size_bytes;
|
|
52
|
+
rac_inference_framework_t framework;
|
|
53
|
+
double duration_ms; /**< Only for completed events */
|
|
54
|
+
rac_result_t error_code; /**< Only for failed events */
|
|
55
|
+
const char* error_message; /**< Only for failed events */
|
|
56
|
+
} rac_llm_model_load_event_t;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @brief Generation event data
|
|
60
|
+
*/
|
|
61
|
+
typedef struct rac_llm_generation_event {
|
|
62
|
+
const char* generation_id;
|
|
63
|
+
const char* model_id;
|
|
64
|
+
rac_bool_t is_streaming;
|
|
65
|
+
rac_inference_framework_t framework;
|
|
66
|
+
|
|
67
|
+
/** For completed events */
|
|
68
|
+
int32_t input_tokens;
|
|
69
|
+
int32_t output_tokens;
|
|
70
|
+
double duration_ms;
|
|
71
|
+
double tokens_per_second;
|
|
72
|
+
double time_to_first_token_ms; /**< -1 if not applicable */
|
|
73
|
+
float temperature;
|
|
74
|
+
int32_t max_tokens;
|
|
75
|
+
int32_t context_length;
|
|
76
|
+
|
|
77
|
+
/** For streaming updates */
|
|
78
|
+
int32_t tokens_generated;
|
|
79
|
+
|
|
80
|
+
/** For failed events */
|
|
81
|
+
rac_result_t error_code;
|
|
82
|
+
const char* error_message;
|
|
83
|
+
} rac_llm_generation_event_t;
|
|
84
|
+
|
|
85
|
+
// =============================================================================
|
|
86
|
+
// EVENT PUBLISHING FUNCTIONS
|
|
87
|
+
// =============================================================================
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @brief Publish a model load started event
|
|
91
|
+
*
|
|
92
|
+
* @param model_id Model identifier
|
|
93
|
+
* @param model_size_bytes Size of model in bytes (0 if unknown)
|
|
94
|
+
* @param framework Inference framework
|
|
95
|
+
* @return RAC_SUCCESS or error code
|
|
96
|
+
*/
|
|
97
|
+
RAC_API rac_result_t rac_llm_event_model_load_started(const char* model_id,
|
|
98
|
+
int64_t model_size_bytes,
|
|
99
|
+
rac_inference_framework_t framework);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @brief Publish a model load completed event
|
|
103
|
+
*
|
|
104
|
+
* @param model_id Model identifier
|
|
105
|
+
* @param duration_ms Load duration in milliseconds
|
|
106
|
+
* @param model_size_bytes Size of model in bytes
|
|
107
|
+
* @param framework Inference framework
|
|
108
|
+
* @return RAC_SUCCESS or error code
|
|
109
|
+
*/
|
|
110
|
+
RAC_API rac_result_t rac_llm_event_model_load_completed(const char* model_id, double duration_ms,
|
|
111
|
+
int64_t model_size_bytes,
|
|
112
|
+
rac_inference_framework_t framework);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @brief Publish a model load failed event
|
|
116
|
+
*
|
|
117
|
+
* @param model_id Model identifier
|
|
118
|
+
* @param error_code Error code
|
|
119
|
+
* @param error_message Error message
|
|
120
|
+
* @param framework Inference framework
|
|
121
|
+
* @return RAC_SUCCESS or error code
|
|
122
|
+
*/
|
|
123
|
+
RAC_API rac_result_t rac_llm_event_model_load_failed(const char* model_id, rac_result_t error_code,
|
|
124
|
+
const char* error_message,
|
|
125
|
+
rac_inference_framework_t framework);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @brief Publish a model unloaded event
|
|
129
|
+
*
|
|
130
|
+
* @param model_id Model identifier
|
|
131
|
+
* @return RAC_SUCCESS or error code
|
|
132
|
+
*/
|
|
133
|
+
RAC_API rac_result_t rac_llm_event_model_unloaded(const char* model_id);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @brief Publish a generation started event
|
|
137
|
+
*
|
|
138
|
+
* @param generation_id Generation identifier
|
|
139
|
+
* @param model_id Model identifier
|
|
140
|
+
* @param is_streaming Whether this is streaming generation
|
|
141
|
+
* @param framework Inference framework
|
|
142
|
+
* @return RAC_SUCCESS or error code
|
|
143
|
+
*/
|
|
144
|
+
RAC_API rac_result_t rac_llm_event_generation_started(const char* generation_id,
|
|
145
|
+
const char* model_id, rac_bool_t is_streaming,
|
|
146
|
+
rac_inference_framework_t framework);
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @brief Publish a first token event (streaming only)
|
|
150
|
+
*
|
|
151
|
+
* @param generation_id Generation identifier
|
|
152
|
+
* @param model_id Model identifier
|
|
153
|
+
* @param time_to_first_token_ms Time to first token in milliseconds
|
|
154
|
+
* @param framework Inference framework
|
|
155
|
+
* @return RAC_SUCCESS or error code
|
|
156
|
+
*/
|
|
157
|
+
RAC_API rac_result_t rac_llm_event_first_token(const char* generation_id, const char* model_id,
|
|
158
|
+
double time_to_first_token_ms,
|
|
159
|
+
rac_inference_framework_t framework);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @brief Publish a streaming update event
|
|
163
|
+
*
|
|
164
|
+
* @param generation_id Generation identifier
|
|
165
|
+
* @param tokens_generated Number of tokens generated so far
|
|
166
|
+
* @return RAC_SUCCESS or error code
|
|
167
|
+
*/
|
|
168
|
+
RAC_API rac_result_t rac_llm_event_streaming_update(const char* generation_id,
|
|
169
|
+
int32_t tokens_generated);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @brief Publish a generation completed event
|
|
173
|
+
*
|
|
174
|
+
* @param event Generation event data
|
|
175
|
+
* @return RAC_SUCCESS or error code
|
|
176
|
+
*/
|
|
177
|
+
RAC_API rac_result_t rac_llm_event_generation_completed(const rac_llm_generation_event_t* event);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @brief Publish a generation failed event
|
|
181
|
+
*
|
|
182
|
+
* @param generation_id Generation identifier
|
|
183
|
+
* @param error_code Error code
|
|
184
|
+
* @param error_message Error message
|
|
185
|
+
* @return RAC_SUCCESS or error code
|
|
186
|
+
*/
|
|
187
|
+
RAC_API rac_result_t rac_llm_event_generation_failed(const char* generation_id,
|
|
188
|
+
rac_result_t error_code,
|
|
189
|
+
const char* error_message);
|
|
190
|
+
|
|
191
|
+
// =============================================================================
|
|
192
|
+
// UTILITY FUNCTIONS
|
|
193
|
+
// =============================================================================
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @brief Get the event type string for an LLM event type
|
|
197
|
+
*
|
|
198
|
+
* @param event_type The LLM event type
|
|
199
|
+
* @return Event type string (never NULL)
|
|
200
|
+
*/
|
|
201
|
+
RAC_API const char* rac_llm_event_type_string(rac_llm_event_type_t event_type);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @brief Get the event destination for an LLM event type
|
|
205
|
+
*
|
|
206
|
+
* @param event_type The LLM event type
|
|
207
|
+
* @return Event destination
|
|
208
|
+
*/
|
|
209
|
+
RAC_API rac_event_destination_t rac_llm_event_destination(rac_llm_event_type_t event_type);
|
|
210
|
+
|
|
211
|
+
#ifdef __cplusplus
|
|
212
|
+
}
|
|
213
|
+
#endif
|
|
214
|
+
|
|
215
|
+
#endif /* RAC_LLM_EVENTS_H */
|