@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,374 @@
1
+ /**
2
+ * @file rac_tts_types.h
3
+ * @brief RunAnywhere Commons - TTS Types and Data Structures
4
+ *
5
+ * C port of Swift's TTS Models from:
6
+ * Sources/RunAnywhere/Features/TTS/Models/TTSConfiguration.swift
7
+ * Sources/RunAnywhere/Features/TTS/Models/TTSOptions.swift
8
+ * Sources/RunAnywhere/Features/TTS/Models/TTSInput.swift
9
+ * Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
10
+ *
11
+ * This header defines data structures only. For the service interface,
12
+ * see rac_tts_service.h.
13
+ */
14
+
15
+ #ifndef RAC_TTS_TYPES_H
16
+ #define RAC_TTS_TYPES_H
17
+
18
+ #include <RACommons/rac_types.h>
19
+ #include <RACommons/rac_stt_types.h> // For rac_audio_format_enum_t
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ // =============================================================================
26
+ // CONSTANTS - Single Source of Truth for TTS
27
+ // Swift references these via CRACommons import
28
+ // =============================================================================
29
+
30
+ // Audio Format Constants
31
+ #define RAC_TTS_DEFAULT_SAMPLE_RATE 22050
32
+ #define RAC_TTS_HIGH_QUALITY_SAMPLE_RATE 24000
33
+ #define RAC_TTS_CD_QUALITY_SAMPLE_RATE 44100
34
+ #define RAC_TTS_MAX_SAMPLE_RATE 48000
35
+ #define RAC_TTS_BYTES_PER_SAMPLE 2
36
+ #define RAC_TTS_CHANNELS 1
37
+
38
+ // Speaking Rate Constants
39
+ #define RAC_TTS_DEFAULT_SPEAKING_RATE 1.0f
40
+ #define RAC_TTS_MIN_SPEAKING_RATE 0.5f
41
+ #define RAC_TTS_MAX_SPEAKING_RATE 2.0f
42
+
43
+ // Streaming Constants
44
+ #define RAC_TTS_DEFAULT_STREAMING_CHUNK_BYTES 4096
45
+
46
+ // =============================================================================
47
+ // CONFIGURATION - Mirrors Swift's TTSConfiguration
48
+ // =============================================================================
49
+
50
+ /**
51
+ * @brief TTS component configuration
52
+ *
53
+ * Mirrors Swift's TTSConfiguration struct exactly.
54
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSConfiguration.swift
55
+ */
56
+ typedef struct rac_tts_config {
57
+ /** Model ID (voice identifier for TTS, optional) */
58
+ const char* model_id;
59
+
60
+ /** Preferred framework (use -1 for auto) */
61
+ int32_t preferred_framework;
62
+
63
+ /** Voice identifier to use for synthesis */
64
+ const char* voice;
65
+
66
+ /** Language for synthesis (BCP-47 format, e.g., "en-US") */
67
+ const char* language;
68
+
69
+ /** Speaking rate (0.5 to 2.0, 1.0 is normal) */
70
+ float speaking_rate;
71
+
72
+ /** Speech pitch (0.5 to 2.0, 1.0 is normal) */
73
+ float pitch;
74
+
75
+ /** Speech volume (0.0 to 1.0) */
76
+ float volume;
77
+
78
+ /** Audio format for output */
79
+ rac_audio_format_enum_t audio_format;
80
+
81
+ /** Whether to use neural/premium voice if available */
82
+ rac_bool_t use_neural_voice;
83
+
84
+ /** Whether to enable SSML markup support */
85
+ rac_bool_t enable_ssml;
86
+ } rac_tts_config_t;
87
+
88
+ /**
89
+ * @brief Default TTS configuration
90
+ */
91
+ static const rac_tts_config_t RAC_TTS_CONFIG_DEFAULT = {.model_id = RAC_NULL,
92
+ .preferred_framework = -1,
93
+ .voice = RAC_NULL,
94
+ .language = "en-US",
95
+ .speaking_rate = 1.0f,
96
+ .pitch = 1.0f,
97
+ .volume = 1.0f,
98
+ .audio_format = RAC_AUDIO_FORMAT_PCM,
99
+ .use_neural_voice = RAC_TRUE,
100
+ .enable_ssml = RAC_FALSE};
101
+
102
+ // =============================================================================
103
+ // OPTIONS - Mirrors Swift's TTSOptions
104
+ // =============================================================================
105
+
106
+ /**
107
+ * @brief TTS synthesis options
108
+ *
109
+ * Mirrors Swift's TTSOptions struct exactly.
110
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSOptions.swift
111
+ */
112
+ typedef struct rac_tts_options {
113
+ /** Voice to use for synthesis (can be NULL for default) */
114
+ const char* voice;
115
+
116
+ /** Language for synthesis (BCP-47 format, e.g., "en-US") */
117
+ const char* language;
118
+
119
+ /** Speech rate (0.0 to 2.0, 1.0 is normal) */
120
+ float rate;
121
+
122
+ /** Speech pitch (0.0 to 2.0, 1.0 is normal) */
123
+ float pitch;
124
+
125
+ /** Speech volume (0.0 to 1.0) */
126
+ float volume;
127
+
128
+ /** Audio format for output */
129
+ rac_audio_format_enum_t audio_format;
130
+
131
+ /** Sample rate for output audio in Hz */
132
+ int32_t sample_rate;
133
+
134
+ /** Whether to use SSML markup */
135
+ rac_bool_t use_ssml;
136
+ } rac_tts_options_t;
137
+
138
+ /**
139
+ * @brief Default TTS options
140
+ */
141
+ static const rac_tts_options_t RAC_TTS_OPTIONS_DEFAULT = {.voice = RAC_NULL,
142
+ .language = "en-US",
143
+ .rate = 1.0f,
144
+ .pitch = 1.0f,
145
+ .volume = 1.0f,
146
+ .audio_format = RAC_AUDIO_FORMAT_PCM,
147
+ .sample_rate =
148
+ RAC_TTS_DEFAULT_SAMPLE_RATE,
149
+ .use_ssml = RAC_FALSE};
150
+
151
+ // =============================================================================
152
+ // INPUT - Mirrors Swift's TTSInput
153
+ // =============================================================================
154
+
155
+ /**
156
+ * @brief TTS input data
157
+ *
158
+ * Mirrors Swift's TTSInput struct exactly.
159
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSInput.swift
160
+ */
161
+ typedef struct rac_tts_input {
162
+ /** Text to synthesize */
163
+ const char* text;
164
+
165
+ /** Optional SSML markup (overrides text if provided, can be NULL) */
166
+ const char* ssml;
167
+
168
+ /** Voice ID override (can be NULL) */
169
+ const char* voice_id;
170
+
171
+ /** Language override (can be NULL) */
172
+ const char* language;
173
+
174
+ /** Custom options override (can be NULL) */
175
+ const rac_tts_options_t* options;
176
+ } rac_tts_input_t;
177
+
178
+ /**
179
+ * @brief Default TTS input
180
+ */
181
+ static const rac_tts_input_t RAC_TTS_INPUT_DEFAULT = {.text = RAC_NULL,
182
+ .ssml = RAC_NULL,
183
+ .voice_id = RAC_NULL,
184
+ .language = RAC_NULL,
185
+ .options = RAC_NULL};
186
+
187
+ // =============================================================================
188
+ // RESULT - Mirrors Swift's TTS result
189
+ // =============================================================================
190
+
191
+ /**
192
+ * @brief TTS synthesis result
193
+ */
194
+ typedef struct rac_tts_result {
195
+ /** Audio data (owned, must be freed with rac_free) */
196
+ void* audio_data;
197
+
198
+ /** Size of audio data in bytes */
199
+ size_t audio_size;
200
+
201
+ /** Audio format */
202
+ rac_audio_format_enum_t audio_format;
203
+
204
+ /** Sample rate */
205
+ int32_t sample_rate;
206
+
207
+ /** Duration in milliseconds */
208
+ int64_t duration_ms;
209
+
210
+ /** Processing time in milliseconds */
211
+ int64_t processing_time_ms;
212
+ } rac_tts_result_t;
213
+
214
+ // =============================================================================
215
+ // INFO - Mirrors Swift's TTSService properties
216
+ // =============================================================================
217
+
218
+ /**
219
+ * @brief TTS service info
220
+ */
221
+ typedef struct rac_tts_info {
222
+ /** Whether the service is ready */
223
+ rac_bool_t is_ready;
224
+
225
+ /** Whether currently synthesizing */
226
+ rac_bool_t is_synthesizing;
227
+
228
+ /** Available voices (null-terminated array) */
229
+ const char* const* available_voices;
230
+ size_t num_voices;
231
+ } rac_tts_info_t;
232
+
233
+ // =============================================================================
234
+ // CALLBACKS
235
+ // =============================================================================
236
+
237
+ /**
238
+ * @brief TTS streaming callback
239
+ *
240
+ * Called for each audio chunk during streaming synthesis.
241
+ *
242
+ * @param audio_data Audio chunk data
243
+ * @param audio_size Size of audio chunk
244
+ * @param user_data User-provided context
245
+ */
246
+ typedef void (*rac_tts_stream_callback_t)(const void* audio_data, size_t audio_size,
247
+ void* user_data);
248
+
249
+ // =============================================================================
250
+ // PHONEME TIMESTAMP - Mirrors Swift's TTSPhonemeTimestamp
251
+ // =============================================================================
252
+
253
+ /**
254
+ * @brief Phoneme timestamp information
255
+ *
256
+ * Mirrors Swift's TTSPhonemeTimestamp struct.
257
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
258
+ */
259
+ typedef struct rac_tts_phoneme_timestamp {
260
+ /** The phoneme */
261
+ const char* phoneme;
262
+
263
+ /** Start time in milliseconds */
264
+ int64_t start_time_ms;
265
+
266
+ /** End time in milliseconds */
267
+ int64_t end_time_ms;
268
+ } rac_tts_phoneme_timestamp_t;
269
+
270
+ // =============================================================================
271
+ // SYNTHESIS METADATA - Mirrors Swift's TTSSynthesisMetadata
272
+ // =============================================================================
273
+
274
+ /**
275
+ * @brief Synthesis metadata
276
+ *
277
+ * Mirrors Swift's TTSSynthesisMetadata struct.
278
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
279
+ */
280
+ typedef struct rac_tts_synthesis_metadata {
281
+ /** Voice used for synthesis */
282
+ const char* voice;
283
+
284
+ /** Language used for synthesis */
285
+ const char* language;
286
+
287
+ /** Processing time in milliseconds */
288
+ int64_t processing_time_ms;
289
+
290
+ /** Number of characters synthesized */
291
+ int32_t character_count;
292
+
293
+ /** Characters processed per second */
294
+ float characters_per_second;
295
+ } rac_tts_synthesis_metadata_t;
296
+
297
+ // =============================================================================
298
+ // OUTPUT - Mirrors Swift's TTSOutput
299
+ // =============================================================================
300
+
301
+ /**
302
+ * @brief TTS output data
303
+ *
304
+ * Mirrors Swift's TTSOutput struct exactly.
305
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
306
+ */
307
+ typedef struct rac_tts_output {
308
+ /** Synthesized audio data (owned, must be freed with rac_free) */
309
+ void* audio_data;
310
+
311
+ /** Size of audio data in bytes */
312
+ size_t audio_size;
313
+
314
+ /** Audio format of the output */
315
+ rac_audio_format_enum_t format;
316
+
317
+ /** Duration of the audio in milliseconds */
318
+ int64_t duration_ms;
319
+
320
+ /** Phoneme timestamps if available (can be NULL) */
321
+ rac_tts_phoneme_timestamp_t* phoneme_timestamps;
322
+ size_t num_phoneme_timestamps;
323
+
324
+ /** Processing metadata */
325
+ rac_tts_synthesis_metadata_t metadata;
326
+
327
+ /** Timestamp in milliseconds since epoch */
328
+ int64_t timestamp_ms;
329
+ } rac_tts_output_t;
330
+
331
+ // =============================================================================
332
+ // SPEAK RESULT - Mirrors Swift's TTSSpeakResult
333
+ // =============================================================================
334
+
335
+ /**
336
+ * @brief Speak result (metadata only, no audio data)
337
+ *
338
+ * Mirrors Swift's TTSSpeakResult struct.
339
+ * The SDK handles audio playback internally when using speak().
340
+ * See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
341
+ */
342
+ typedef struct rac_tts_speak_result {
343
+ /** Duration of the spoken audio in milliseconds */
344
+ int64_t duration_ms;
345
+
346
+ /** Audio format used */
347
+ rac_audio_format_enum_t format;
348
+
349
+ /** Audio size in bytes (0 for system TTS which plays directly) */
350
+ size_t audio_size_bytes;
351
+
352
+ /** Synthesis metadata */
353
+ rac_tts_synthesis_metadata_t metadata;
354
+
355
+ /** Timestamp when speech completed (milliseconds since epoch) */
356
+ int64_t timestamp_ms;
357
+ } rac_tts_speak_result_t;
358
+
359
+ // =============================================================================
360
+ // MEMORY MANAGEMENT
361
+ // =============================================================================
362
+
363
+ /**
364
+ * @brief Free TTS result resources
365
+ *
366
+ * @param result Result to free (can be NULL)
367
+ */
368
+ RAC_API void rac_tts_result_free(rac_tts_result_t* result);
369
+
370
+ #ifdef __cplusplus
371
+ }
372
+ #endif
373
+
374
+ #endif /* RAC_TTS_TYPES_H */
@@ -0,0 +1,264 @@
1
+ /**
2
+ * @file rac_types.h
3
+ * @brief RunAnywhere Commons - Common Types and Definitions
4
+ *
5
+ * This header defines common types, handle types, and macros used throughout
6
+ * the runanywhere-commons library. All types use the RAC_ prefix to distinguish
7
+ * from the underlying runanywhere-core (ra_*) types.
8
+ */
9
+
10
+ #ifndef RAC_TYPES_H
11
+ #define RAC_TYPES_H
12
+
13
+ #include <stddef.h>
14
+ #include <stdint.h>
15
+
16
+ /**
17
+ * Null pointer macro for use in static initializers.
18
+ * Uses nullptr in C++ (preferred by clang-tidy modernize-use-nullptr)
19
+ * and NULL in C for compatibility.
20
+ */
21
+ #ifdef __cplusplus
22
+ #define RAC_NULL nullptr
23
+ #else
24
+ #define RAC_NULL NULL
25
+ #endif
26
+
27
+ #ifdef __cplusplus
28
+ extern "C" {
29
+ #endif
30
+
31
+ // =============================================================================
32
+ // API VISIBILITY MACROS
33
+ // =============================================================================
34
+ //
35
+ // RAC_API marks functions that must be visible to FFI (dlsym).
36
+ //
37
+ // CRITICAL: For iOS/Android Flutter FFI, symbols MUST have public visibility
38
+ // even when statically linked. dlsym(RTLD_DEFAULT, ...) can only find symbols
39
+ // with "external" visibility, not "private external".
40
+ //
41
+ // Without visibility("default"), static library symbols get "private external"
42
+ // visibility (due to -fvisibility=hidden), which becomes "non-external" (local)
43
+ // in the final binary - breaking FFI symbol lookup.
44
+ // =============================================================================
45
+
46
+ #if defined(_WIN32)
47
+ #if defined(RAC_BUILDING_SHARED)
48
+ #define RAC_API __declspec(dllexport)
49
+ #elif defined(RAC_USING_SHARED)
50
+ #define RAC_API __declspec(dllimport)
51
+ #else
52
+ #define RAC_API
53
+ #endif
54
+ #elif defined(__GNUC__) || defined(__clang__)
55
+ // Always use default visibility for FFI compatibility
56
+ // This ensures dlsym() can find symbols even in static libraries
57
+ #define RAC_API __attribute__((visibility("default")))
58
+ #else
59
+ #define RAC_API
60
+ #endif
61
+
62
+ // =============================================================================
63
+ // RESULT TYPE
64
+ // =============================================================================
65
+
66
+ /**
67
+ * Result type for all RAC functions.
68
+ * - 0 indicates success
69
+ * - Negative values indicate errors (see rac_error.h)
70
+ *
71
+ * Error code ranges:
72
+ * - runanywhere-core (ra_*): 0 to -99
73
+ * - runanywhere-commons (rac_*): -100 to -999
74
+ */
75
+ typedef int32_t rac_result_t;
76
+
77
+ /** Success result */
78
+ #define RAC_SUCCESS ((rac_result_t)0)
79
+
80
+ // =============================================================================
81
+ // BOOLEAN TYPE
82
+ // =============================================================================
83
+
84
+ /** Boolean type for C compatibility */
85
+ typedef int32_t rac_bool_t;
86
+
87
+ #define RAC_TRUE ((rac_bool_t)1)
88
+ #define RAC_FALSE ((rac_bool_t)0)
89
+
90
+ // =============================================================================
91
+ // HANDLE TYPES
92
+ // =============================================================================
93
+
94
+ /**
95
+ * Opaque handle for internal objects.
96
+ * Handles should be treated as opaque pointers.
97
+ */
98
+ typedef void* rac_handle_t;
99
+
100
+ /** Invalid handle value */
101
+ #define RAC_INVALID_HANDLE ((rac_handle_t)NULL)
102
+
103
+ // =============================================================================
104
+ // STRING TYPES
105
+ // =============================================================================
106
+
107
+ /**
108
+ * String view (non-owning reference to a string).
109
+ * The string is NOT guaranteed to be null-terminated.
110
+ */
111
+ typedef struct rac_string_view {
112
+ const char* data; /**< Pointer to string data */
113
+ size_t length; /**< Length in bytes (not including any null terminator) */
114
+ } rac_string_view_t;
115
+
116
+ /**
117
+ * Creates a string view from a null-terminated C string.
118
+ */
119
+ #define RAC_STRING_VIEW(s) ((rac_string_view_t){(s), (s) ? strlen(s) : 0})
120
+
121
+ // =============================================================================
122
+ // AUDIO TYPES
123
+ // =============================================================================
124
+
125
+ /**
126
+ * Audio buffer for STT/VAD operations.
127
+ * Contains PCM float samples in the range [-1.0, 1.0].
128
+ */
129
+ typedef struct rac_audio_buffer {
130
+ const float* samples; /**< PCM float samples */
131
+ size_t num_samples; /**< Number of samples */
132
+ int32_t sample_rate; /**< Sample rate in Hz (e.g., 16000) */
133
+ int32_t channels; /**< Number of channels (1 = mono, 2 = stereo) */
134
+ } rac_audio_buffer_t;
135
+
136
+ /**
137
+ * Audio format specification.
138
+ */
139
+ typedef struct rac_audio_format {
140
+ int32_t sample_rate; /**< Sample rate in Hz */
141
+ int32_t channels; /**< Number of channels */
142
+ int32_t bits_per_sample; /**< Bits per sample (16 or 32) */
143
+ } rac_audio_format_t;
144
+
145
+ // =============================================================================
146
+ // MEMORY INFO
147
+ // =============================================================================
148
+
149
+ /**
150
+ * Memory information structure.
151
+ * Used by the platform adapter to report available memory.
152
+ */
153
+ typedef struct rac_memory_info {
154
+ uint64_t total_bytes; /**< Total physical memory in bytes */
155
+ uint64_t available_bytes; /**< Available memory in bytes */
156
+ uint64_t used_bytes; /**< Used memory in bytes */
157
+ } rac_memory_info_t;
158
+
159
+ // =============================================================================
160
+ // CAPABILITY TYPES
161
+ // =============================================================================
162
+
163
+ /**
164
+ * Capability types supported by backends.
165
+ * These match the capabilities defined in runanywhere-core.
166
+ */
167
+ typedef enum rac_capability {
168
+ RAC_CAPABILITY_UNKNOWN = 0,
169
+ RAC_CAPABILITY_TEXT_GENERATION = 1, /**< LLM text generation */
170
+ RAC_CAPABILITY_EMBEDDINGS = 2, /**< Text embeddings */
171
+ RAC_CAPABILITY_STT = 3, /**< Speech-to-text */
172
+ RAC_CAPABILITY_TTS = 4, /**< Text-to-speech */
173
+ RAC_CAPABILITY_VAD = 5, /**< Voice activity detection */
174
+ RAC_CAPABILITY_DIARIZATION = 6, /**< Speaker diarization */
175
+ } rac_capability_t;
176
+
177
+ /**
178
+ * Device type for backend execution.
179
+ */
180
+ typedef enum rac_device {
181
+ RAC_DEVICE_CPU = 0,
182
+ RAC_DEVICE_GPU = 1,
183
+ RAC_DEVICE_NPU = 2,
184
+ RAC_DEVICE_AUTO = 3,
185
+ } rac_device_t;
186
+
187
+ // =============================================================================
188
+ // LOG LEVELS
189
+ // =============================================================================
190
+
191
+ /**
192
+ * Log level for the logging callback.
193
+ */
194
+ typedef enum rac_log_level {
195
+ RAC_LOG_TRACE = 0,
196
+ RAC_LOG_DEBUG = 1,
197
+ RAC_LOG_INFO = 2,
198
+ RAC_LOG_WARNING = 3,
199
+ RAC_LOG_ERROR = 4,
200
+ RAC_LOG_FATAL = 5,
201
+ } rac_log_level_t;
202
+
203
+ // =============================================================================
204
+ // VERSION INFO
205
+ // =============================================================================
206
+
207
+ /**
208
+ * Version information structure.
209
+ */
210
+ typedef struct rac_version {
211
+ uint16_t major;
212
+ uint16_t minor;
213
+ uint16_t patch;
214
+ const char* string; /**< Version string (e.g., "1.0.0") */
215
+ } rac_version_t;
216
+
217
+ // =============================================================================
218
+ // UTILITY MACROS
219
+ // =============================================================================
220
+
221
+ /** Check if a result is a success */
222
+ #define RAC_SUCCEEDED(result) ((result) >= 0)
223
+
224
+ /** Check if a result is an error */
225
+ #define RAC_FAILED(result) ((result) < 0)
226
+
227
+ /** Check if a handle is valid */
228
+ #define RAC_IS_VALID_HANDLE(handle) ((handle) != RAC_INVALID_HANDLE)
229
+
230
+ // =============================================================================
231
+ // MEMORY MANAGEMENT
232
+ // =============================================================================
233
+
234
+ /**
235
+ * Frees memory allocated by RAC functions.
236
+ *
237
+ * Use this to free strings and buffers returned by RAC functions that
238
+ * are marked as "must be freed with rac_free".
239
+ *
240
+ * @param ptr Pointer to memory to free (can be NULL)
241
+ */
242
+ RAC_API void rac_free(void* ptr);
243
+
244
+ /**
245
+ * Allocates memory using the RAC allocator.
246
+ *
247
+ * @param size Number of bytes to allocate
248
+ * @return Pointer to allocated memory, or NULL on failure
249
+ */
250
+ RAC_API void* rac_alloc(size_t size);
251
+
252
+ /**
253
+ * Duplicates a null-terminated string.
254
+ *
255
+ * @param str String to duplicate (can be NULL)
256
+ * @return Duplicated string (must be freed with rac_free), or NULL if str is NULL
257
+ */
258
+ RAC_API char* rac_strdup(const char* str);
259
+
260
+ #ifdef __cplusplus
261
+ }
262
+ #endif
263
+
264
+ #endif /* RAC_TYPES_H */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file rac_vad.h
3
+ * @brief RunAnywhere Commons - VAD 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_vad_types.h for data structures only
8
+ * - rac_vad_service.h for the service interface
9
+ */
10
+
11
+ #ifndef RAC_VAD_H
12
+ #define RAC_VAD_H
13
+
14
+ #include <RACommons/rac_vad_service.h>
15
+ #include <RACommons/rac_vad_types.h>
16
+
17
+ #endif /* RAC_VAD_H */