@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.
Files changed (354) hide show
  1. package/RunAnywhereCore.podspec +130 -0
  2. package/android/CMakeLists.txt +92 -0
  3. package/android/build.gradle +321 -0
  4. package/android/consumer-rules.pro +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/cpp/cpp-adapter.cpp +271 -0
  7. package/android/src/main/include/rac/backends/rac_llm_llamacpp.h +218 -0
  8. package/android/src/main/include/rac/backends/rac_stt_onnx.h +99 -0
  9. package/android/src/main/include/rac/backends/rac_stt_whispercpp.h +153 -0
  10. package/android/src/main/include/rac/backends/rac_tts_onnx.h +71 -0
  11. package/android/src/main/include/rac/backends/rac_vad_onnx.h +84 -0
  12. package/android/src/main/include/rac/core/capabilities/rac_lifecycle.h +290 -0
  13. package/android/src/main/include/rac/core/rac_analytics_events.h +610 -0
  14. package/android/src/main/include/rac/core/rac_audio_utils.h +88 -0
  15. package/android/src/main/include/rac/core/rac_component_types.h +160 -0
  16. package/android/src/main/include/rac/core/rac_core.h +331 -0
  17. package/android/src/main/include/rac/core/rac_error.h +469 -0
  18. package/android/src/main/include/rac/core/rac_events.h +334 -0
  19. package/android/src/main/include/rac/core/rac_logger.h +416 -0
  20. package/android/src/main/include/rac/core/rac_platform_adapter.h +340 -0
  21. package/android/src/main/include/rac/core/rac_sdk_state.h +292 -0
  22. package/android/src/main/include/rac/core/rac_structured_error.h +594 -0
  23. package/android/src/main/include/rac/core/rac_types.h +264 -0
  24. package/android/src/main/include/rac/features/llm/rac_llm.h +17 -0
  25. package/android/src/main/include/rac/features/llm/rac_llm_analytics.h +188 -0
  26. package/android/src/main/include/rac/features/llm/rac_llm_component.h +228 -0
  27. package/android/src/main/include/rac/features/llm/rac_llm_events.h +215 -0
  28. package/android/src/main/include/rac/features/llm/rac_llm_metrics.h +402 -0
  29. package/android/src/main/include/rac/features/llm/rac_llm_service.h +163 -0
  30. package/android/src/main/include/rac/features/llm/rac_llm_structured_output.h +141 -0
  31. package/android/src/main/include/rac/features/llm/rac_llm_types.h +384 -0
  32. package/android/src/main/include/rac/features/platform/rac_llm_platform.h +204 -0
  33. package/android/src/main/include/rac/features/platform/rac_tts_platform.h +197 -0
  34. package/android/src/main/include/rac/features/stt/rac_stt.h +17 -0
  35. package/android/src/main/include/rac/features/stt/rac_stt_analytics.h +204 -0
  36. package/android/src/main/include/rac/features/stt/rac_stt_component.h +162 -0
  37. package/android/src/main/include/rac/features/stt/rac_stt_events.h +62 -0
  38. package/android/src/main/include/rac/features/stt/rac_stt_service.h +154 -0
  39. package/android/src/main/include/rac/features/stt/rac_stt_types.h +389 -0
  40. package/android/src/main/include/rac/features/tts/rac_tts.h +17 -0
  41. package/android/src/main/include/rac/features/tts/rac_tts_analytics.h +181 -0
  42. package/android/src/main/include/rac/features/tts/rac_tts_component.h +158 -0
  43. package/android/src/main/include/rac/features/tts/rac_tts_events.h +54 -0
  44. package/android/src/main/include/rac/features/tts/rac_tts_service.h +162 -0
  45. package/android/src/main/include/rac/features/tts/rac_tts_types.h +374 -0
  46. package/android/src/main/include/rac/features/vad/rac_vad.h +17 -0
  47. package/android/src/main/include/rac/features/vad/rac_vad_analytics.h +236 -0
  48. package/android/src/main/include/rac/features/vad/rac_vad_component.h +185 -0
  49. package/android/src/main/include/rac/features/vad/rac_vad_energy.h +443 -0
  50. package/android/src/main/include/rac/features/vad/rac_vad_events.h +76 -0
  51. package/android/src/main/include/rac/features/vad/rac_vad_service.h +167 -0
  52. package/android/src/main/include/rac/features/vad/rac_vad_types.h +244 -0
  53. package/android/src/main/include/rac/features/voice_agent/rac_voice_agent.h +612 -0
  54. package/android/src/main/include/rac/infrastructure/device/rac_device_manager.h +176 -0
  55. package/android/src/main/include/rac/infrastructure/download/rac_download.h +418 -0
  56. package/android/src/main/include/rac/infrastructure/events/rac_events.h +177 -0
  57. package/android/src/main/include/rac/infrastructure/model_management/rac_model_assignment.h +169 -0
  58. package/android/src/main/include/rac/infrastructure/model_management/rac_model_paths.h +258 -0
  59. package/android/src/main/include/rac/infrastructure/model_management/rac_model_registry.h +357 -0
  60. package/android/src/main/include/rac/infrastructure/model_management/rac_model_strategy.h +374 -0
  61. package/android/src/main/include/rac/infrastructure/model_management/rac_model_types.h +613 -0
  62. package/android/src/main/include/rac/infrastructure/network/rac_api_types.h +335 -0
  63. package/android/src/main/include/rac/infrastructure/network/rac_auth_manager.h +252 -0
  64. package/android/src/main/include/rac/infrastructure/network/rac_dev_config.h +85 -0
  65. package/android/src/main/include/rac/infrastructure/network/rac_endpoints.h +102 -0
  66. package/android/src/main/include/rac/infrastructure/network/rac_environment.h +220 -0
  67. package/android/src/main/include/rac/infrastructure/network/rac_http_client.h +233 -0
  68. package/android/src/main/include/rac/infrastructure/storage/rac_storage_analyzer.h +286 -0
  69. package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_manager.h +206 -0
  70. package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_types.h +234 -0
  71. package/android/src/main/java/com/margelo/nitro/runanywhere/ArchiveUtility.kt +308 -0
  72. package/android/src/main/java/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfo.kt +229 -0
  73. package/android/src/main/java/com/margelo/nitro/runanywhere/PlatformAdapterBridge.kt +392 -0
  74. package/android/src/main/java/com/margelo/nitro/runanywhere/RunAnywhereCorePackage.kt +28 -0
  75. package/android/src/main/java/com/margelo/nitro/runanywhere/SDKLogger.kt +357 -0
  76. package/android/src/main/java/com/margelo/nitro/runanywhere/SecureStorageManager.kt +147 -0
  77. package/android/src/main/jniLibs/arm64-v8a/libc++_shared.so +0 -0
  78. package/android/src/main/jniLibs/arm64-v8a/libomp.so +0 -0
  79. package/android/src/main/jniLibs/arm64-v8a/librac_commons.so +0 -0
  80. package/android/src/main/jniLibs/arm64-v8a/librunanywhere_jni.so +0 -0
  81. package/cpp/HybridRunAnywhereCore.cpp +2505 -0
  82. package/cpp/HybridRunAnywhereCore.hpp +271 -0
  83. package/cpp/bridges/AuthBridge.cpp +209 -0
  84. package/cpp/bridges/AuthBridge.hpp +157 -0
  85. package/cpp/bridges/DeviceBridge.cpp +257 -0
  86. package/cpp/bridges/DeviceBridge.hpp +155 -0
  87. package/cpp/bridges/DownloadBridge.cpp +299 -0
  88. package/cpp/bridges/DownloadBridge.hpp +197 -0
  89. package/cpp/bridges/EventBridge.cpp +125 -0
  90. package/cpp/bridges/EventBridge.hpp +139 -0
  91. package/cpp/bridges/HTTPBridge.cpp +96 -0
  92. package/cpp/bridges/HTTPBridge.hpp +144 -0
  93. package/cpp/bridges/InitBridge.cpp +1273 -0
  94. package/cpp/bridges/InitBridge.hpp +306 -0
  95. package/cpp/bridges/ModelRegistryBridge.cpp +394 -0
  96. package/cpp/bridges/ModelRegistryBridge.hpp +177 -0
  97. package/cpp/bridges/StorageBridge.cpp +269 -0
  98. package/cpp/bridges/StorageBridge.hpp +172 -0
  99. package/cpp/bridges/TelemetryBridge.cpp +352 -0
  100. package/cpp/bridges/TelemetryBridge.hpp +126 -0
  101. package/ios/.testlocal +0 -0
  102. package/ios/ArchiveUtility.swift +526 -0
  103. package/ios/ArchiveUtilityBridge.m +52 -0
  104. package/ios/AudioDecoder.h +38 -0
  105. package/ios/AudioDecoder.m +162 -0
  106. package/ios/Binaries/RACommons.xcframework/Info.plist +44 -0
  107. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h +67 -0
  108. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_analytics_events.h +610 -0
  109. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_api_types.h +335 -0
  110. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_audio_utils.h +88 -0
  111. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_auth_manager.h +252 -0
  112. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_component_types.h +160 -0
  113. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_core.h +331 -0
  114. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_dev_config.h +85 -0
  115. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_device_manager.h +176 -0
  116. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_download.h +418 -0
  117. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_endpoints.h +102 -0
  118. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_environment.h +220 -0
  119. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_error.h +469 -0
  120. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_events.h +177 -0
  121. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_http_client.h +233 -0
  122. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_lifecycle.h +290 -0
  123. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm.h +17 -0
  124. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
  125. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_component.h +228 -0
  126. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_events.h +215 -0
  127. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
  128. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
  129. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_platform.h +204 -0
  130. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_service.h +163 -0
  131. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
  132. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_types.h +384 -0
  133. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_logger.h +416 -0
  134. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_assignment.h +169 -0
  135. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_paths.h +258 -0
  136. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_registry.h +357 -0
  137. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_strategy.h +374 -0
  138. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_types.h +613 -0
  139. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
  140. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_sdk_state.h +292 -0
  141. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
  142. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_structured_error.h +594 -0
  143. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt.h +17 -0
  144. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
  145. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_component.h +162 -0
  146. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_events.h +62 -0
  147. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
  148. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_service.h +154 -0
  149. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_types.h +389 -0
  150. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
  151. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
  152. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
  153. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts.h +17 -0
  154. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
  155. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_component.h +158 -0
  156. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_events.h +54 -0
  157. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
  158. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_platform.h +197 -0
  159. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_service.h +162 -0
  160. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_types.h +374 -0
  161. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_types.h +264 -0
  162. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad.h +17 -0
  163. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
  164. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_component.h +185 -0
  165. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_energy.h +443 -0
  166. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_events.h +76 -0
  167. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
  168. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_service.h +167 -0
  169. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_types.h +244 -0
  170. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_voice_agent.h +612 -0
  171. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Info.plist +11 -0
  172. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Modules/module.modulemap +5 -0
  173. package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/RACommons +0 -0
  174. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/RACommons.h +67 -0
  175. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_analytics_events.h +610 -0
  176. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_api_types.h +335 -0
  177. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_audio_utils.h +88 -0
  178. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_auth_manager.h +252 -0
  179. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_component_types.h +160 -0
  180. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_core.h +331 -0
  181. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_dev_config.h +85 -0
  182. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_device_manager.h +176 -0
  183. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_download.h +418 -0
  184. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_endpoints.h +102 -0
  185. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_environment.h +220 -0
  186. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_error.h +469 -0
  187. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_events.h +177 -0
  188. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_http_client.h +233 -0
  189. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_lifecycle.h +290 -0
  190. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm.h +17 -0
  191. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
  192. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_component.h +228 -0
  193. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_events.h +215 -0
  194. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
  195. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
  196. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_platform.h +204 -0
  197. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_service.h +163 -0
  198. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
  199. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_types.h +384 -0
  200. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_logger.h +416 -0
  201. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_assignment.h +169 -0
  202. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_paths.h +258 -0
  203. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_registry.h +357 -0
  204. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_strategy.h +374 -0
  205. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_types.h +613 -0
  206. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
  207. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_sdk_state.h +292 -0
  208. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
  209. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_structured_error.h +594 -0
  210. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt.h +17 -0
  211. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
  212. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_component.h +162 -0
  213. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_events.h +62 -0
  214. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
  215. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_service.h +154 -0
  216. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_types.h +389 -0
  217. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
  218. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
  219. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
  220. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts.h +17 -0
  221. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
  222. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_component.h +158 -0
  223. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_events.h +54 -0
  224. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
  225. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_platform.h +197 -0
  226. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_service.h +162 -0
  227. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_types.h +374 -0
  228. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_types.h +264 -0
  229. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad.h +17 -0
  230. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
  231. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_component.h +185 -0
  232. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_energy.h +443 -0
  233. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_events.h +76 -0
  234. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
  235. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_service.h +167 -0
  236. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_types.h +244 -0
  237. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_voice_agent.h +612 -0
  238. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Info.plist +11 -0
  239. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Modules/module.modulemap +5 -0
  240. package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons +0 -0
  241. package/ios/HybridRunAnywhereDeviceInfo.swift +214 -0
  242. package/ios/KeychainManager.swift +116 -0
  243. package/ios/PlatformAdapter.swift +100 -0
  244. package/ios/PlatformAdapterBridge.h +152 -0
  245. package/ios/PlatformAdapterBridge.m +570 -0
  246. package/ios/RNSDKLoggerBridge.h +41 -0
  247. package/ios/RNSDKLoggerBridge.m +66 -0
  248. package/ios/SDKLogger.swift +329 -0
  249. package/nitro.json +20 -0
  250. package/nitrogen/generated/.gitattributes +1 -0
  251. package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.cpp +257 -0
  252. package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.hpp +77 -0
  253. package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfoSpec.kt +106 -0
  254. package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/runanywherecoreOnLoad.kt +35 -0
  255. package/nitrogen/generated/android/runanywherecore+autolinking.cmake +82 -0
  256. package/nitrogen/generated/android/runanywherecore+autolinking.gradle +27 -0
  257. package/nitrogen/generated/android/runanywherecoreOnLoad.cpp +54 -0
  258. package/nitrogen/generated/android/runanywherecoreOnLoad.hpp +25 -0
  259. package/nitrogen/generated/ios/RunAnywhereCore+autolinking.rb +60 -0
  260. package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.cpp +65 -0
  261. package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.hpp +197 -0
  262. package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Umbrella.hpp +45 -0
  263. package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.mm +43 -0
  264. package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.swift +25 -0
  265. package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.cpp +11 -0
  266. package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.hpp +173 -0
  267. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  268. package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  269. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  270. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  271. package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec.swift +68 -0
  272. package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec_cxx.swift +366 -0
  273. package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp +92 -0
  274. package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +138 -0
  275. package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.cpp +33 -0
  276. package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.hpp +75 -0
  277. package/package.json +76 -0
  278. package/react-native.config.js +14 -0
  279. package/src/Features/VoiceSession/AudioCaptureManager.ts +286 -0
  280. package/src/Features/VoiceSession/AudioPlaybackManager.ts +300 -0
  281. package/src/Features/VoiceSession/VoiceSessionHandle.ts +530 -0
  282. package/src/Features/VoiceSession/index.ts +20 -0
  283. package/src/Features/index.ts +7 -0
  284. package/src/Foundation/Constants/SDKConstants.ts +47 -0
  285. package/src/Foundation/Constants/index.ts +8 -0
  286. package/src/Foundation/DependencyInjection/ServiceContainer.ts +154 -0
  287. package/src/Foundation/DependencyInjection/ServiceRegistry.ts +51 -0
  288. package/src/Foundation/DependencyInjection/index.ts +6 -0
  289. package/src/Foundation/ErrorTypes/ErrorCategory.ts +184 -0
  290. package/src/Foundation/ErrorTypes/ErrorCodes.ts +151 -0
  291. package/src/Foundation/ErrorTypes/ErrorContext.ts +201 -0
  292. package/src/Foundation/ErrorTypes/SDKError.ts +507 -0
  293. package/src/Foundation/ErrorTypes/index.ts +57 -0
  294. package/src/Foundation/Initialization/InitializationPhase.ts +85 -0
  295. package/src/Foundation/Initialization/InitializationState.ts +168 -0
  296. package/src/Foundation/Initialization/index.ts +26 -0
  297. package/src/Foundation/Logging/Destinations/NativeLogBridge.ts +147 -0
  298. package/src/Foundation/Logging/Destinations/SentryDestination.ts +209 -0
  299. package/src/Foundation/Logging/Logger/SDKLogger.ts +232 -0
  300. package/src/Foundation/Logging/Models/LogLevel.ts +36 -0
  301. package/src/Foundation/Logging/Models/LoggingConfiguration.ts +117 -0
  302. package/src/Foundation/Logging/Services/LoggingManager.ts +407 -0
  303. package/src/Foundation/Logging/index.ts +59 -0
  304. package/src/Foundation/Security/DeviceIdentity.ts +92 -0
  305. package/src/Foundation/Security/SecureStorageError.ts +132 -0
  306. package/src/Foundation/Security/SecureStorageKeys.ts +35 -0
  307. package/src/Foundation/Security/SecureStorageService.ts +449 -0
  308. package/src/Foundation/Security/index.ts +17 -0
  309. package/src/Foundation/index.ts +26 -0
  310. package/src/Infrastructure/Events/EventPublisher.ts +165 -0
  311. package/src/Infrastructure/Events/SDKEvent.ts +214 -0
  312. package/src/Infrastructure/Events/index.ts +15 -0
  313. package/src/Infrastructure/index.ts +9 -0
  314. package/src/Public/Events/EventBus.ts +488 -0
  315. package/src/Public/Events/index.ts +8 -0
  316. package/src/Public/Extensions/RunAnywhere+Logging.ts +51 -0
  317. package/src/Public/Extensions/RunAnywhere+Models.ts +392 -0
  318. package/src/Public/Extensions/RunAnywhere+STT.ts +424 -0
  319. package/src/Public/Extensions/RunAnywhere+Storage.ts +151 -0
  320. package/src/Public/Extensions/RunAnywhere+StructuredOutput.ts +316 -0
  321. package/src/Public/Extensions/RunAnywhere+TTS.ts +430 -0
  322. package/src/Public/Extensions/RunAnywhere+TextGeneration.ts +320 -0
  323. package/src/Public/Extensions/RunAnywhere+VAD.ts +359 -0
  324. package/src/Public/Extensions/RunAnywhere+VoiceAgent.ts +225 -0
  325. package/src/Public/Extensions/RunAnywhere+VoiceSession.ts +155 -0
  326. package/src/Public/Extensions/index.ts +126 -0
  327. package/src/Public/RunAnywhere.ts +695 -0
  328. package/src/index.ts +238 -0
  329. package/src/native/NativeRunAnywhereCore.ts +291 -0
  330. package/src/native/NativeRunAnywhereModule.ts +32 -0
  331. package/src/native/index.ts +21 -0
  332. package/src/services/DownloadService.ts +282 -0
  333. package/src/services/FileSystem.ts +810 -0
  334. package/src/services/ModelRegistry.ts +246 -0
  335. package/src/services/Network/APIEndpoints.ts +84 -0
  336. package/src/services/Network/HTTPService.ts +479 -0
  337. package/src/services/Network/NetworkConfiguration.ts +130 -0
  338. package/src/services/Network/TelemetryService.ts +318 -0
  339. package/src/services/Network/index.ts +29 -0
  340. package/src/services/SystemTTSService.ts +130 -0
  341. package/src/services/index.ts +66 -0
  342. package/src/specs/RunAnywhereCore.nitro.ts +627 -0
  343. package/src/specs/RunAnywhereDeviceInfo.nitro.ts +73 -0
  344. package/src/types/LLMTypes.ts +127 -0
  345. package/src/types/STTTypes.ts +124 -0
  346. package/src/types/StructuredOutputTypes.ts +156 -0
  347. package/src/types/TTSTypes.ts +126 -0
  348. package/src/types/VADTypes.ts +70 -0
  349. package/src/types/VoiceAgentTypes.ts +182 -0
  350. package/src/types/enums.ts +258 -0
  351. package/src/types/events.ts +337 -0
  352. package/src/types/external.d.ts +142 -0
  353. package/src/types/index.ts +146 -0
  354. package/src/types/models.ts +579 -0
@@ -0,0 +1,204 @@
1
+ /**
2
+ * @file rac_stt_analytics.h
3
+ * @brief STT analytics service - 1:1 port of STTAnalyticsService.swift
4
+ *
5
+ * Tracks transcription operations and metrics.
6
+ * Lifecycle events are handled by the lifecycle manager.
7
+ *
8
+ * NOTE: Audio length estimation assumes 16-bit PCM @ 16kHz (standard for STT).
9
+ * Formula: audioLengthMs = (bytes / 2) / 16000 * 1000
10
+ *
11
+ * NOTE: Real-Time Factor (RTF) will be 0 or undefined for streaming transcription
12
+ * since audioLengthMs = 0 when audio is processed in chunks of unknown total length.
13
+ *
14
+ * Swift Source: Sources/RunAnywhere/Features/STT/Analytics/STTAnalyticsService.swift
15
+ */
16
+
17
+ #ifndef RAC_STT_ANALYTICS_H
18
+ #define RAC_STT_ANALYTICS_H
19
+
20
+ #include <RACommons/rac_types.h>
21
+ #include <RACommons/rac_stt_types.h>
22
+ #include <RACommons/rac_model_types.h>
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ // =============================================================================
29
+ // TYPES
30
+ // =============================================================================
31
+
32
+ /**
33
+ * @brief Opaque handle for STT analytics service
34
+ */
35
+ typedef struct rac_stt_analytics_s* rac_stt_analytics_handle_t;
36
+
37
+ /**
38
+ * @brief STT metrics structure
39
+ * Mirrors Swift's STTMetrics struct
40
+ */
41
+ typedef struct rac_stt_metrics {
42
+ /** Total number of events tracked */
43
+ int32_t total_events;
44
+
45
+ /** Start time (milliseconds since epoch) */
46
+ int64_t start_time_ms;
47
+
48
+ /** Last event time (milliseconds since epoch, 0 if no events) */
49
+ int64_t last_event_time_ms;
50
+
51
+ /** Total number of transcriptions */
52
+ int32_t total_transcriptions;
53
+
54
+ /** Average confidence score across all transcriptions (0.0 to 1.0) */
55
+ float average_confidence;
56
+
57
+ /** Average processing latency in milliseconds */
58
+ double average_latency_ms;
59
+
60
+ /** Average real-time factor (processing time / audio length) */
61
+ double average_real_time_factor;
62
+
63
+ /** Total audio processed in milliseconds */
64
+ double total_audio_processed_ms;
65
+ } rac_stt_metrics_t;
66
+
67
+ // =============================================================================
68
+ // LIFECYCLE
69
+ // =============================================================================
70
+
71
+ /**
72
+ * @brief Create an STT analytics service instance
73
+ *
74
+ * @param out_handle Output: Handle to the created service
75
+ * @return RAC_SUCCESS or error code
76
+ */
77
+ RAC_API rac_result_t rac_stt_analytics_create(rac_stt_analytics_handle_t* out_handle);
78
+
79
+ /**
80
+ * @brief Destroy an STT analytics service instance
81
+ *
82
+ * @param handle Handle to destroy
83
+ */
84
+ RAC_API void rac_stt_analytics_destroy(rac_stt_analytics_handle_t handle);
85
+
86
+ // =============================================================================
87
+ // TRANSCRIPTION TRACKING
88
+ // =============================================================================
89
+
90
+ /**
91
+ * @brief Start tracking a transcription
92
+ *
93
+ * @param handle Analytics service handle
94
+ * @param model_id The STT model identifier
95
+ * @param audio_length_ms Duration of audio in milliseconds
96
+ * @param audio_size_bytes Size of audio data in bytes
97
+ * @param language Language code for transcription
98
+ * @param is_streaming Whether this is a streaming transcription
99
+ * @param sample_rate Audio sample rate in Hz (default: 16000)
100
+ * @param framework The inference framework being used
101
+ * @param out_transcription_id Output: Generated unique ID (owned, must be freed with rac_free)
102
+ * @return RAC_SUCCESS or error code
103
+ */
104
+ RAC_API rac_result_t rac_stt_analytics_start_transcription(
105
+ rac_stt_analytics_handle_t handle, const char* model_id, double audio_length_ms,
106
+ int32_t audio_size_bytes, const char* language, rac_bool_t is_streaming, int32_t sample_rate,
107
+ rac_inference_framework_t framework, char** out_transcription_id);
108
+
109
+ /**
110
+ * @brief Track partial transcript (for streaming transcription)
111
+ *
112
+ * @param handle Analytics service handle
113
+ * @param text Partial transcript text
114
+ * @return RAC_SUCCESS or error code
115
+ */
116
+ RAC_API rac_result_t rac_stt_analytics_track_partial_transcript(rac_stt_analytics_handle_t handle,
117
+ const char* text);
118
+
119
+ /**
120
+ * @brief Track final transcript (for streaming transcription)
121
+ *
122
+ * @param handle Analytics service handle
123
+ * @param text Final transcript text
124
+ * @param confidence Confidence score (0.0 to 1.0)
125
+ * @return RAC_SUCCESS or error code
126
+ */
127
+ RAC_API rac_result_t rac_stt_analytics_track_final_transcript(rac_stt_analytics_handle_t handle,
128
+ const char* text, float confidence);
129
+
130
+ /**
131
+ * @brief Complete a transcription
132
+ *
133
+ * @param handle Analytics service handle
134
+ * @param transcription_id The transcription ID
135
+ * @param text The transcribed text
136
+ * @param confidence Confidence score (0.0 to 1.0)
137
+ * @return RAC_SUCCESS or error code
138
+ */
139
+ RAC_API rac_result_t rac_stt_analytics_complete_transcription(rac_stt_analytics_handle_t handle,
140
+ const char* transcription_id,
141
+ const char* text, float confidence);
142
+
143
+ /**
144
+ * @brief Track transcription failure
145
+ *
146
+ * @param handle Analytics service handle
147
+ * @param transcription_id The transcription ID
148
+ * @param error_code Error code
149
+ * @param error_message Error message
150
+ * @return RAC_SUCCESS or error code
151
+ */
152
+ RAC_API rac_result_t rac_stt_analytics_track_transcription_failed(rac_stt_analytics_handle_t handle,
153
+ const char* transcription_id,
154
+ rac_result_t error_code,
155
+ const char* error_message);
156
+
157
+ /**
158
+ * @brief Track language detection
159
+ *
160
+ * @param handle Analytics service handle
161
+ * @param language Detected language code
162
+ * @param confidence Detection confidence (0.0 to 1.0)
163
+ * @return RAC_SUCCESS or error code
164
+ */
165
+ RAC_API rac_result_t rac_stt_analytics_track_language_detection(rac_stt_analytics_handle_t handle,
166
+ const char* language,
167
+ float confidence);
168
+
169
+ /**
170
+ * @brief Track an error during STT operations
171
+ *
172
+ * @param handle Analytics service handle
173
+ * @param error_code Error code
174
+ * @param error_message Error message
175
+ * @param operation Operation that failed
176
+ * @param model_id Model ID (can be NULL)
177
+ * @param transcription_id Transcription ID (can be NULL)
178
+ * @return RAC_SUCCESS or error code
179
+ */
180
+ RAC_API rac_result_t rac_stt_analytics_track_error(rac_stt_analytics_handle_t handle,
181
+ rac_result_t error_code,
182
+ const char* error_message, const char* operation,
183
+ const char* model_id,
184
+ const char* transcription_id);
185
+
186
+ // =============================================================================
187
+ // METRICS
188
+ // =============================================================================
189
+
190
+ /**
191
+ * @brief Get current analytics metrics
192
+ *
193
+ * @param handle Analytics service handle
194
+ * @param out_metrics Output: Metrics structure
195
+ * @return RAC_SUCCESS or error code
196
+ */
197
+ RAC_API rac_result_t rac_stt_analytics_get_metrics(rac_stt_analytics_handle_t handle,
198
+ rac_stt_metrics_t* out_metrics);
199
+
200
+ #ifdef __cplusplus
201
+ }
202
+ #endif
203
+
204
+ #endif /* RAC_STT_ANALYTICS_H */
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @file rac_stt_component.h
3
+ * @brief RunAnywhere Commons - STT Capability Component
4
+ *
5
+ * C port of Swift's STTCapability.swift from:
6
+ * Sources/RunAnywhere/Features/STT/STTCapability.swift
7
+ *
8
+ * Actor-based STT capability that owns model lifecycle and transcription.
9
+ * Uses lifecycle manager for unified lifecycle + analytics handling.
10
+ */
11
+
12
+ #ifndef RAC_STT_COMPONENT_H
13
+ #define RAC_STT_COMPONENT_H
14
+
15
+ #include <RACommons/rac_lifecycle.h>
16
+ #include <RACommons/rac_error.h>
17
+ #include <RACommons/rac_stt_types.h>
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ // NOTE: rac_stt_config_t is defined in rac_stt_types.h (included above)
24
+
25
+ // =============================================================================
26
+ // STT COMPONENT API - Mirrors Swift's STTCapability
27
+ // =============================================================================
28
+
29
+ /**
30
+ * @brief Create an STT capability component
31
+ *
32
+ * @param out_handle Output: Handle to the component
33
+ * @return RAC_SUCCESS or error code
34
+ */
35
+ RAC_API rac_result_t rac_stt_component_create(rac_handle_t* out_handle);
36
+
37
+ /**
38
+ * @brief Configure the STT component
39
+ *
40
+ * @param handle Component handle
41
+ * @param config Configuration
42
+ * @return RAC_SUCCESS or error code
43
+ */
44
+ RAC_API rac_result_t rac_stt_component_configure(rac_handle_t handle,
45
+ const rac_stt_config_t* config);
46
+
47
+ /**
48
+ * @brief Check if model is loaded
49
+ *
50
+ * @param handle Component handle
51
+ * @return RAC_TRUE if loaded, RAC_FALSE otherwise
52
+ */
53
+ RAC_API rac_bool_t rac_stt_component_is_loaded(rac_handle_t handle);
54
+
55
+ /**
56
+ * @brief Get current model ID
57
+ *
58
+ * @param handle Component handle
59
+ * @return Current model ID (NULL if not loaded)
60
+ */
61
+ RAC_API const char* rac_stt_component_get_model_id(rac_handle_t handle);
62
+
63
+ /**
64
+ * @brief Load a model
65
+ *
66
+ * @param handle Component handle
67
+ * @param model_path File path to the model (used for loading) - REQUIRED
68
+ * @param model_id Model identifier for telemetry (e.g., "sherpa-onnx-whisper-tiny.en")
69
+ * Optional: if NULL, defaults to model_path
70
+ * @param model_name Human-readable model name (e.g., "Sherpa Whisper Tiny (ONNX)")
71
+ * Optional: if NULL, defaults to model_id
72
+ * @return RAC_SUCCESS or error code
73
+ */
74
+ RAC_API rac_result_t rac_stt_component_load_model(rac_handle_t handle, const char* model_path,
75
+ const char* model_id, const char* model_name);
76
+
77
+ /**
78
+ * @brief Unload the current model
79
+ *
80
+ * @param handle Component handle
81
+ * @return RAC_SUCCESS or error code
82
+ */
83
+ RAC_API rac_result_t rac_stt_component_unload(rac_handle_t handle);
84
+
85
+ /**
86
+ * @brief Cleanup and reset the component
87
+ *
88
+ * @param handle Component handle
89
+ * @return RAC_SUCCESS or error code
90
+ */
91
+ RAC_API rac_result_t rac_stt_component_cleanup(rac_handle_t handle);
92
+
93
+ /**
94
+ * @brief Transcribe audio data (batch mode)
95
+ *
96
+ * @param handle Component handle
97
+ * @param audio_data Audio data buffer
98
+ * @param audio_size Size of audio data in bytes
99
+ * @param options Transcription options (can be NULL for defaults)
100
+ * @param out_result Output: Transcription result
101
+ * @return RAC_SUCCESS or error code
102
+ */
103
+ RAC_API rac_result_t rac_stt_component_transcribe(rac_handle_t handle, const void* audio_data,
104
+ size_t audio_size,
105
+ const rac_stt_options_t* options,
106
+ rac_stt_result_t* out_result);
107
+
108
+ /**
109
+ * @brief Check if streaming is supported
110
+ *
111
+ * @param handle Component handle
112
+ * @return RAC_TRUE if streaming supported, RAC_FALSE otherwise
113
+ */
114
+ RAC_API rac_bool_t rac_stt_component_supports_streaming(rac_handle_t handle);
115
+
116
+ /**
117
+ * @brief Transcribe audio with streaming
118
+ *
119
+ * @param handle Component handle
120
+ * @param audio_data Audio chunk data
121
+ * @param audio_size Size of audio chunk
122
+ * @param options Transcription options
123
+ * @param callback Callback for partial results
124
+ * @param user_data User context passed to callback
125
+ * @return RAC_SUCCESS or error code
126
+ */
127
+ RAC_API rac_result_t rac_stt_component_transcribe_stream(rac_handle_t handle,
128
+ const void* audio_data, size_t audio_size,
129
+ const rac_stt_options_t* options,
130
+ rac_stt_stream_callback_t callback,
131
+ void* user_data);
132
+
133
+ /**
134
+ * @brief Get lifecycle state
135
+ *
136
+ * @param handle Component handle
137
+ * @return Current lifecycle state
138
+ */
139
+ RAC_API rac_lifecycle_state_t rac_stt_component_get_state(rac_handle_t handle);
140
+
141
+ /**
142
+ * @brief Get lifecycle metrics
143
+ *
144
+ * @param handle Component handle
145
+ * @param out_metrics Output: Lifecycle metrics
146
+ * @return RAC_SUCCESS or error code
147
+ */
148
+ RAC_API rac_result_t rac_stt_component_get_metrics(rac_handle_t handle,
149
+ rac_lifecycle_metrics_t* out_metrics);
150
+
151
+ /**
152
+ * @brief Destroy the STT component
153
+ *
154
+ * @param handle Component handle
155
+ */
156
+ RAC_API void rac_stt_component_destroy(rac_handle_t handle);
157
+
158
+ #ifdef __cplusplus
159
+ }
160
+ #endif
161
+
162
+ #endif /* RAC_STT_COMPONENT_H */
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @file rac_stt_events.h
3
+ * @brief STT-specific event types - 1:1 port of STTEvent.swift
4
+ *
5
+ * Swift Source: Sources/RunAnywhere/Features/STT/Analytics/STTEvent.swift
6
+ */
7
+
8
+ #ifndef RAC_STT_EVENTS_H
9
+ #define RAC_STT_EVENTS_H
10
+
11
+ #include <RACommons/rac_types.h>
12
+ #include <RACommons/rac_events.h>
13
+
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+
18
+ // =============================================================================
19
+ // STT EVENT TYPES
20
+ // =============================================================================
21
+
22
+ typedef enum rac_stt_event_type {
23
+ RAC_STT_EVENT_TRANSCRIPTION_STARTED = 0,
24
+ RAC_STT_EVENT_PARTIAL_TRANSCRIPT,
25
+ RAC_STT_EVENT_FINAL_TRANSCRIPT,
26
+ RAC_STT_EVENT_TRANSCRIPTION_COMPLETED,
27
+ RAC_STT_EVENT_TRANSCRIPTION_FAILED,
28
+ RAC_STT_EVENT_LANGUAGE_DETECTED,
29
+ } rac_stt_event_type_t;
30
+
31
+ // =============================================================================
32
+ // EVENT PUBLISHING FUNCTIONS
33
+ // =============================================================================
34
+
35
+ RAC_API rac_result_t rac_stt_event_transcription_started(
36
+ const char* transcription_id, const char* model_id, double audio_length_ms,
37
+ int32_t audio_size_bytes, const char* language, rac_bool_t is_streaming,
38
+ rac_inference_framework_t framework);
39
+
40
+ RAC_API rac_result_t rac_stt_event_partial_transcript(const char* text, int32_t word_count);
41
+
42
+ RAC_API rac_result_t rac_stt_event_final_transcript(const char* text, float confidence);
43
+
44
+ RAC_API rac_result_t rac_stt_event_transcription_completed(
45
+ const char* transcription_id, const char* model_id, const char* text, float confidence,
46
+ double duration_ms, double audio_length_ms, int32_t word_count, double real_time_factor,
47
+ const char* language, rac_bool_t is_streaming, rac_inference_framework_t framework);
48
+
49
+ RAC_API rac_result_t rac_stt_event_transcription_failed(const char* transcription_id,
50
+ const char* model_id,
51
+ rac_result_t error_code,
52
+ const char* error_message);
53
+
54
+ RAC_API rac_result_t rac_stt_event_language_detected(const char* language, float confidence);
55
+
56
+ RAC_API const char* rac_stt_event_type_string(rac_stt_event_type_t event_type);
57
+
58
+ #ifdef __cplusplus
59
+ }
60
+ #endif
61
+
62
+ #endif /* RAC_STT_EVENTS_H */
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @file rac_stt_onnx.h
3
+ * @brief RunAnywhere Core - ONNX Backend RAC API for STT
4
+ *
5
+ * Direct RAC API export from runanywhere-core's ONNX STT backend.
6
+ * Mirrors Swift's ONNXSTTService implementation pattern.
7
+ */
8
+
9
+ #ifndef RAC_STT_ONNX_H
10
+ #define RAC_STT_ONNX_H
11
+
12
+ #include <RACommons/rac_error.h>
13
+ #include <RACommons/rac_types.h>
14
+ #include <RACommons/rac_stt.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ // =============================================================================
21
+ // EXPORT MACRO
22
+ // =============================================================================
23
+
24
+ #if defined(RAC_ONNX_BUILDING)
25
+ #if defined(_WIN32)
26
+ #define RAC_ONNX_API __declspec(dllexport)
27
+ #elif defined(__GNUC__) || defined(__clang__)
28
+ #define RAC_ONNX_API __attribute__((visibility("default")))
29
+ #else
30
+ #define RAC_ONNX_API
31
+ #endif
32
+ #else
33
+ #define RAC_ONNX_API
34
+ #endif
35
+
36
+ // =============================================================================
37
+ // CONFIGURATION
38
+ // =============================================================================
39
+
40
+ /**
41
+ * ONNX STT model types.
42
+ */
43
+ typedef enum rac_stt_onnx_model_type {
44
+ RAC_STT_ONNX_MODEL_WHISPER = 0,
45
+ RAC_STT_ONNX_MODEL_ZIPFORMER = 1,
46
+ RAC_STT_ONNX_MODEL_PARAFORMER = 2,
47
+ RAC_STT_ONNX_MODEL_AUTO = 99
48
+ } rac_stt_onnx_model_type_t;
49
+
50
+ /**
51
+ * ONNX STT configuration.
52
+ */
53
+ typedef struct rac_stt_onnx_config {
54
+ rac_stt_onnx_model_type_t model_type;
55
+ int32_t num_threads;
56
+ rac_bool_t use_coreml;
57
+ } rac_stt_onnx_config_t;
58
+
59
+ static const rac_stt_onnx_config_t RAC_STT_ONNX_CONFIG_DEFAULT = {
60
+ .model_type = RAC_STT_ONNX_MODEL_AUTO, .num_threads = 0, .use_coreml = RAC_TRUE};
61
+
62
+ // =============================================================================
63
+ // ONNX STT API
64
+ // =============================================================================
65
+
66
+ RAC_ONNX_API rac_result_t rac_stt_onnx_create(const char* model_path,
67
+ const rac_stt_onnx_config_t* config,
68
+ rac_handle_t* out_handle);
69
+
70
+ RAC_ONNX_API rac_result_t rac_stt_onnx_transcribe(rac_handle_t handle, const float* audio_samples,
71
+ size_t num_samples,
72
+ const rac_stt_options_t* options,
73
+ rac_stt_result_t* out_result);
74
+
75
+ RAC_ONNX_API rac_bool_t rac_stt_onnx_supports_streaming(rac_handle_t handle);
76
+
77
+ RAC_ONNX_API rac_result_t rac_stt_onnx_create_stream(rac_handle_t handle, rac_handle_t* out_stream);
78
+
79
+ RAC_ONNX_API rac_result_t rac_stt_onnx_feed_audio(rac_handle_t handle, rac_handle_t stream,
80
+ const float* audio_samples, size_t num_samples);
81
+
82
+ RAC_ONNX_API rac_bool_t rac_stt_onnx_stream_is_ready(rac_handle_t handle, rac_handle_t stream);
83
+
84
+ RAC_ONNX_API rac_result_t rac_stt_onnx_decode_stream(rac_handle_t handle, rac_handle_t stream,
85
+ char** out_text);
86
+
87
+ RAC_ONNX_API void rac_stt_onnx_input_finished(rac_handle_t handle, rac_handle_t stream);
88
+
89
+ RAC_ONNX_API rac_bool_t rac_stt_onnx_is_endpoint(rac_handle_t handle, rac_handle_t stream);
90
+
91
+ RAC_ONNX_API void rac_stt_onnx_destroy_stream(rac_handle_t handle, rac_handle_t stream);
92
+
93
+ RAC_ONNX_API void rac_stt_onnx_destroy(rac_handle_t handle);
94
+
95
+ #ifdef __cplusplus
96
+ }
97
+ #endif
98
+
99
+ #endif /* RAC_STT_ONNX_H */
@@ -0,0 +1,154 @@
1
+ /**
2
+ * @file rac_stt_service.h
3
+ * @brief RunAnywhere Commons - STT Service Interface
4
+ *
5
+ * Defines the generic STT service API and vtable for multi-backend dispatch.
6
+ * Backends (ONNX, Whisper, etc.) implement the vtable and register
7
+ * with the service registry.
8
+ */
9
+
10
+ #ifndef RAC_STT_SERVICE_H
11
+ #define RAC_STT_SERVICE_H
12
+
13
+ #include <RACommons/rac_error.h>
14
+ #include <RACommons/rac_stt_types.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ // =============================================================================
21
+ // SERVICE VTABLE - Backend implementations provide this
22
+ // =============================================================================
23
+
24
+ /**
25
+ * STT Service operations vtable.
26
+ * Each backend implements these functions and provides a static vtable.
27
+ */
28
+ typedef struct rac_stt_service_ops {
29
+ /** Initialize the service with a model path */
30
+ rac_result_t (*initialize)(void* impl, const char* model_path);
31
+
32
+ /** Transcribe audio (batch mode) */
33
+ rac_result_t (*transcribe)(void* impl, const void* audio_data, size_t audio_size,
34
+ const rac_stt_options_t* options, rac_stt_result_t* out_result);
35
+
36
+ /** Stream transcription for real-time processing */
37
+ rac_result_t (*transcribe_stream)(void* impl, const void* audio_data, size_t audio_size,
38
+ const rac_stt_options_t* options,
39
+ rac_stt_stream_callback_t callback, void* user_data);
40
+
41
+ /** Get service info */
42
+ rac_result_t (*get_info)(void* impl, rac_stt_info_t* out_info);
43
+
44
+ /** Cleanup/unload model (keeps service alive) */
45
+ rac_result_t (*cleanup)(void* impl);
46
+
47
+ /** Destroy the service */
48
+ void (*destroy)(void* impl);
49
+ } rac_stt_service_ops_t;
50
+
51
+ /**
52
+ * STT Service instance.
53
+ * Contains vtable pointer and backend-specific implementation.
54
+ */
55
+ typedef struct rac_stt_service {
56
+ /** Vtable with backend operations */
57
+ const rac_stt_service_ops_t* ops;
58
+
59
+ /** Backend-specific implementation handle */
60
+ void* impl;
61
+
62
+ /** Model ID for reference */
63
+ const char* model_id;
64
+ } rac_stt_service_t;
65
+
66
+ // =============================================================================
67
+ // PUBLIC API - Generic service functions
68
+ // =============================================================================
69
+
70
+ /**
71
+ * @brief Create an STT service
72
+ *
73
+ * Routes through service registry to find appropriate backend.
74
+ *
75
+ * @param model_path Path to the model file (can be NULL for some providers)
76
+ * @param out_handle Output: Handle to the created service
77
+ * @return RAC_SUCCESS or error code
78
+ */
79
+ RAC_API rac_result_t rac_stt_create(const char* model_path, rac_handle_t* out_handle);
80
+
81
+ /**
82
+ * @brief Initialize an STT service
83
+ *
84
+ * @param handle Service handle
85
+ * @param model_path Path to the model file (can be NULL)
86
+ * @return RAC_SUCCESS or error code
87
+ */
88
+ RAC_API rac_result_t rac_stt_initialize(rac_handle_t handle, const char* model_path);
89
+
90
+ /**
91
+ * @brief Transcribe audio data (batch mode)
92
+ *
93
+ * @param handle Service handle
94
+ * @param audio_data Audio data buffer
95
+ * @param audio_size Size of audio data in bytes
96
+ * @param options Transcription options (can be NULL for defaults)
97
+ * @param out_result Output: Transcription result (caller must free with rac_stt_result_free)
98
+ * @return RAC_SUCCESS or error code
99
+ */
100
+ RAC_API rac_result_t rac_stt_transcribe(rac_handle_t handle, const void* audio_data,
101
+ size_t audio_size, const rac_stt_options_t* options,
102
+ rac_stt_result_t* out_result);
103
+
104
+ /**
105
+ * @brief Stream transcription for real-time processing
106
+ *
107
+ * @param handle Service handle
108
+ * @param audio_data Audio chunk data
109
+ * @param audio_size Size of audio chunk
110
+ * @param options Transcription options
111
+ * @param callback Callback for partial results
112
+ * @param user_data User context passed to callback
113
+ * @return RAC_SUCCESS or error code
114
+ */
115
+ RAC_API rac_result_t rac_stt_transcribe_stream(rac_handle_t handle, const void* audio_data,
116
+ size_t audio_size, const rac_stt_options_t* options,
117
+ rac_stt_stream_callback_t callback, void* user_data);
118
+
119
+ /**
120
+ * @brief Get service information
121
+ *
122
+ * @param handle Service handle
123
+ * @param out_info Output: Service information
124
+ * @return RAC_SUCCESS or error code
125
+ */
126
+ RAC_API rac_result_t rac_stt_get_info(rac_handle_t handle, rac_stt_info_t* out_info);
127
+
128
+ /**
129
+ * @brief Cleanup and release resources
130
+ *
131
+ * @param handle Service handle
132
+ * @return RAC_SUCCESS or error code
133
+ */
134
+ RAC_API rac_result_t rac_stt_cleanup(rac_handle_t handle);
135
+
136
+ /**
137
+ * @brief Destroy an STT service instance
138
+ *
139
+ * @param handle Service handle to destroy
140
+ */
141
+ RAC_API void rac_stt_destroy(rac_handle_t handle);
142
+
143
+ /**
144
+ * @brief Free an STT result
145
+ *
146
+ * @param result Result to free
147
+ */
148
+ RAC_API void rac_stt_result_free(rac_stt_result_t* result);
149
+
150
+ #ifdef __cplusplus
151
+ }
152
+ #endif
153
+
154
+ #endif /* RAC_STT_SERVICE_H */