@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,160 @@
1
+ /**
2
+ * @file rac_component_types.h
3
+ * @brief RunAnywhere Commons - Core Component Types
4
+ *
5
+ * C port of Swift's component types from:
6
+ * Sources/RunAnywhere/Core/Types/ComponentTypes.swift
7
+ * Sources/RunAnywhere/Core/Capabilities/Analytics/ResourceTypes.swift
8
+ *
9
+ * These types define SDK components, their configurations, and resource types.
10
+ */
11
+
12
+ #ifndef RAC_COMPONENT_TYPES_H
13
+ #define RAC_COMPONENT_TYPES_H
14
+
15
+ #include <RACommons/rac_types.h>
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // =============================================================================
22
+ // SDK COMPONENT - Mirrors Swift's SDKComponent enum
23
+ // =============================================================================
24
+
25
+ /**
26
+ * @brief SDK component types for identification
27
+ *
28
+ * Mirrors Swift's SDKComponent enum exactly.
29
+ * See: Sources/RunAnywhere/Core/Types/ComponentTypes.swift
30
+ */
31
+ typedef enum rac_sdk_component {
32
+ RAC_COMPONENT_LLM = 0, /**< Large Language Model */
33
+ RAC_COMPONENT_STT = 1, /**< Speech-to-Text */
34
+ RAC_COMPONENT_TTS = 2, /**< Text-to-Speech */
35
+ RAC_COMPONENT_VAD = 3, /**< Voice Activity Detection */
36
+ RAC_COMPONENT_VOICE = 4, /**< Voice Agent */
37
+ RAC_COMPONENT_EMBEDDING = 5, /**< Embedding generation */
38
+ } rac_sdk_component_t;
39
+
40
+ /**
41
+ * @brief Get human-readable display name for SDK component
42
+ *
43
+ * @param component The SDK component type
44
+ * @return Display name string (static, do not free)
45
+ */
46
+ RAC_API const char* rac_sdk_component_display_name(rac_sdk_component_t component);
47
+
48
+ /**
49
+ * @brief Get raw string value for SDK component
50
+ *
51
+ * Mirrors Swift's rawValue property.
52
+ *
53
+ * @param component The SDK component type
54
+ * @return Raw string value (static, do not free)
55
+ */
56
+ RAC_API const char* rac_sdk_component_raw_value(rac_sdk_component_t component);
57
+
58
+ // =============================================================================
59
+ // CAPABILITY RESOURCE TYPE - Mirrors Swift's CapabilityResourceType enum
60
+ // =============================================================================
61
+
62
+ /**
63
+ * @brief Types of resources that can be loaded by capabilities
64
+ *
65
+ * Mirrors Swift's CapabilityResourceType enum exactly.
66
+ * See: Sources/RunAnywhere/Core/Capabilities/Analytics/ResourceTypes.swift
67
+ */
68
+ typedef enum rac_capability_resource_type {
69
+ RAC_RESOURCE_LLM_MODEL = 0, /**< LLM model */
70
+ RAC_RESOURCE_STT_MODEL = 1, /**< STT model */
71
+ RAC_RESOURCE_TTS_VOICE = 2, /**< TTS voice */
72
+ RAC_RESOURCE_VAD_MODEL = 3, /**< VAD model */
73
+ RAC_RESOURCE_DIARIZATION_MODEL = 4, /**< Diarization model */
74
+ } rac_capability_resource_type_t;
75
+
76
+ /**
77
+ * @brief Get raw string value for capability resource type
78
+ *
79
+ * Mirrors Swift's rawValue property.
80
+ *
81
+ * @param type The capability resource type
82
+ * @return Raw string value (static, do not free)
83
+ */
84
+ RAC_API const char* rac_capability_resource_type_raw_value(rac_capability_resource_type_t type);
85
+
86
+ // =============================================================================
87
+ // COMPONENT CONFIGURATION - Mirrors Swift's ComponentConfiguration protocol
88
+ // =============================================================================
89
+
90
+ /**
91
+ * @brief Base component configuration
92
+ *
93
+ * Mirrors Swift's ComponentConfiguration protocol.
94
+ * See: Sources/RunAnywhere/Core/Types/ComponentTypes.swift
95
+ *
96
+ * Note: In C, we use a struct with common fields instead of a protocol.
97
+ * Specific configurations (LLM, STT, TTS, VAD) extend this with their own fields.
98
+ */
99
+ typedef struct rac_component_config_base {
100
+ /** Model identifier (optional - uses default if NULL) */
101
+ const char* model_id;
102
+
103
+ /** Preferred inference framework (use -1 for auto/none) */
104
+ int32_t preferred_framework;
105
+ } rac_component_config_base_t;
106
+
107
+ /**
108
+ * @brief Default base component configuration
109
+ */
110
+ static const rac_component_config_base_t RAC_COMPONENT_CONFIG_BASE_DEFAULT = {
111
+ .model_id = RAC_NULL, .preferred_framework = -1 /* No preference */
112
+ };
113
+
114
+ // =============================================================================
115
+ // COMPONENT INPUT/OUTPUT - Mirrors Swift's ComponentInput/ComponentOutput protocols
116
+ // =============================================================================
117
+
118
+ /**
119
+ * @brief Base component output with timestamp
120
+ *
121
+ * Mirrors Swift's ComponentOutput protocol requirement.
122
+ * All outputs include a timestamp in milliseconds since epoch.
123
+ */
124
+ typedef struct rac_component_output_base {
125
+ /** Timestamp in milliseconds since epoch (1970-01-01 00:00:00 UTC) */
126
+ int64_t timestamp_ms;
127
+ } rac_component_output_base_t;
128
+
129
+ // =============================================================================
130
+ // INFERENCE FRAMEWORK - Mirrors Swift's InferenceFramework enum
131
+ // (Typically defined in model_types, but included here for completeness)
132
+ // =============================================================================
133
+
134
+ /**
135
+ * @brief Get SDK component type from capability resource type
136
+ *
137
+ * Maps resource types to their corresponding SDK components.
138
+ *
139
+ * @param resource_type The capability resource type
140
+ * @return Corresponding SDK component type
141
+ */
142
+ RAC_API rac_sdk_component_t
143
+ rac_resource_type_to_component(rac_capability_resource_type_t resource_type);
144
+
145
+ /**
146
+ * @brief Get capability resource type from SDK component type
147
+ *
148
+ * Maps SDK components to their corresponding resource types.
149
+ *
150
+ * @param component The SDK component type
151
+ * @return Corresponding capability resource type, or -1 if no mapping exists
152
+ */
153
+ RAC_API rac_capability_resource_type_t
154
+ rac_component_to_resource_type(rac_sdk_component_t component);
155
+
156
+ #ifdef __cplusplus
157
+ }
158
+ #endif
159
+
160
+ #endif /* RAC_COMPONENT_TYPES_H */
@@ -0,0 +1,331 @@
1
+ /**
2
+ * @file rac_core.h
3
+ * @brief RunAnywhere Commons - Core Initialization and Module Management
4
+ *
5
+ * This header provides the core API for initializing and shutting down
6
+ * the commons library, as well as module registration and discovery.
7
+ */
8
+
9
+ #ifndef RAC_CORE_H
10
+ #define RAC_CORE_H
11
+
12
+ #include <RACommons/rac_error.h>
13
+ #include <RACommons/rac_types.h>
14
+ #include <RACommons/rac_model_types.h>
15
+ #include <RACommons/rac_environment.h>
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // =============================================================================
22
+ // FORWARD DECLARATIONS
23
+ // =============================================================================
24
+
25
+ /** Platform adapter (see rac_platform_adapter.h) */
26
+ typedef struct rac_platform_adapter rac_platform_adapter_t;
27
+
28
+ // =============================================================================
29
+ // CONFIGURATION
30
+ // =============================================================================
31
+
32
+ /**
33
+ * Configuration for initializing the commons library.
34
+ */
35
+ typedef struct rac_config {
36
+ /** Platform adapter providing file, logging, and other platform callbacks */
37
+ const rac_platform_adapter_t* platform_adapter;
38
+
39
+ /** Log level for internal logging */
40
+ rac_log_level_t log_level;
41
+
42
+ /** Application-specific tag for logging */
43
+ const char* log_tag;
44
+
45
+ /** Reserved for future use (set to NULL) */
46
+ void* reserved;
47
+ } rac_config_t;
48
+
49
+ // =============================================================================
50
+ // INITIALIZATION API
51
+ // =============================================================================
52
+
53
+ /**
54
+ * Initializes the commons library.
55
+ *
56
+ * This must be called before any other RAC functions. The platform adapter
57
+ * is required and provides callbacks for platform-specific operations.
58
+ *
59
+ * @param config Configuration options (platform_adapter is required)
60
+ * @return RAC_SUCCESS on success, or an error code on failure
61
+ *
62
+ * @note HTTP requests return RAC_ERROR_NOT_SUPPORTED - networking should be
63
+ * handled by the SDK layer (Swift/Kotlin), not the C++ layer.
64
+ */
65
+ RAC_API rac_result_t rac_init(const rac_config_t* config);
66
+
67
+ /**
68
+ * Shuts down the commons library.
69
+ *
70
+ * This releases all resources and unregisters all modules. Any active
71
+ * handles become invalid after this call.
72
+ */
73
+ RAC_API void rac_shutdown(void);
74
+
75
+ /**
76
+ * Checks if the commons library is initialized.
77
+ *
78
+ * @return RAC_TRUE if initialized, RAC_FALSE otherwise
79
+ */
80
+ RAC_API rac_bool_t rac_is_initialized(void);
81
+
82
+ /**
83
+ * Gets the version of the commons library.
84
+ *
85
+ * @return Version information structure
86
+ */
87
+ RAC_API rac_version_t rac_get_version(void);
88
+
89
+ /**
90
+ * Configures logging based on the environment.
91
+ *
92
+ * This configures C++ local logging (stderr) based on the environment:
93
+ * - Development: stderr ON, min level DEBUG
94
+ * - Staging: stderr ON, min level INFO
95
+ * - Production: stderr OFF, min level WARNING (logs only go to Swift bridge)
96
+ *
97
+ * Call this during SDK initialization after setting the platform adapter.
98
+ *
99
+ * @param environment The current SDK environment
100
+ * @return RAC_SUCCESS on success
101
+ */
102
+ RAC_API rac_result_t rac_configure_logging(rac_environment_t environment);
103
+
104
+ // =============================================================================
105
+ // MODULE INFORMATION
106
+ // =============================================================================
107
+
108
+ /**
109
+ * Information about a registered module (backend).
110
+ */
111
+ typedef struct rac_module_info {
112
+ const char* id; /**< Unique module identifier */
113
+ const char* name; /**< Human-readable name */
114
+ const char* version; /**< Module version string */
115
+ const char* description; /**< Module description */
116
+
117
+ /** Capabilities provided by this module */
118
+ const rac_capability_t* capabilities;
119
+ size_t num_capabilities;
120
+ } rac_module_info_t;
121
+
122
+ // =============================================================================
123
+ // MODULE REGISTRATION API
124
+ // =============================================================================
125
+
126
+ /**
127
+ * Registers a module with the registry.
128
+ *
129
+ * Modules (backends) call this to register themselves with the commons layer.
130
+ * This allows the SDK to discover available backends at runtime.
131
+ *
132
+ * @param info Module information (copied internally)
133
+ * @return RAC_SUCCESS on success, or an error code on failure
134
+ */
135
+ RAC_API rac_result_t rac_module_register(const rac_module_info_t* info);
136
+
137
+ /**
138
+ * Unregisters a module from the registry.
139
+ *
140
+ * @param module_id The unique ID of the module to unregister
141
+ * @return RAC_SUCCESS on success, or an error code on failure
142
+ */
143
+ RAC_API rac_result_t rac_module_unregister(const char* module_id);
144
+
145
+ /**
146
+ * Gets the list of registered modules.
147
+ *
148
+ * @param out_modules Pointer to receive the module list (do not free)
149
+ * @param out_count Pointer to receive the number of modules
150
+ * @return RAC_SUCCESS on success, or an error code on failure
151
+ *
152
+ * @note The returned list is valid until the next module registration/unregistration.
153
+ */
154
+ RAC_API rac_result_t rac_module_list(const rac_module_info_t** out_modules, size_t* out_count);
155
+
156
+ /**
157
+ * Gets modules that provide a specific capability.
158
+ *
159
+ * @param capability The capability to search for
160
+ * @param out_modules Pointer to receive the module list (do not free)
161
+ * @param out_count Pointer to receive the number of modules
162
+ * @return RAC_SUCCESS on success, or an error code on failure
163
+ */
164
+ RAC_API rac_result_t rac_modules_for_capability(rac_capability_t capability,
165
+ const rac_module_info_t** out_modules,
166
+ size_t* out_count);
167
+
168
+ /**
169
+ * Gets information about a specific module.
170
+ *
171
+ * @param module_id The unique ID of the module
172
+ * @param out_info Pointer to receive the module info (do not free)
173
+ * @return RAC_SUCCESS on success, or RAC_ERROR_MODULE_NOT_FOUND if not found
174
+ */
175
+ RAC_API rac_result_t rac_module_get_info(const char* module_id, const rac_module_info_t** out_info);
176
+
177
+ // =============================================================================
178
+ // SERVICE PROVIDER API - Mirrors Swift's ServiceRegistry
179
+ // =============================================================================
180
+
181
+ /**
182
+ * Service request for creating services.
183
+ * Passed to canHandle and create functions.
184
+ *
185
+ * Mirrors Swift's approach where canHandle receives a model/voice ID.
186
+ */
187
+ typedef struct rac_service_request {
188
+ /** Model or voice ID to check/create for (can be NULL for default) */
189
+ const char* identifier;
190
+
191
+ /** Configuration JSON string (can be NULL) */
192
+ const char* config_json;
193
+
194
+ /** The capability being requested */
195
+ rac_capability_t capability;
196
+
197
+ /** Framework hint for routing (from model registry) */
198
+ rac_inference_framework_t framework;
199
+
200
+ /** Local path to model file (can be NULL if using identifier lookup) */
201
+ const char* model_path;
202
+ } rac_service_request_t;
203
+
204
+ /**
205
+ * canHandle function type.
206
+ * Mirrors Swift's `canHandle: @Sendable (String?) -> Bool`
207
+ *
208
+ * @param request The service request
209
+ * @param user_data Provider-specific context
210
+ * @return RAC_TRUE if this provider can handle the request
211
+ */
212
+ typedef rac_bool_t (*rac_service_can_handle_fn)(const rac_service_request_t* request,
213
+ void* user_data);
214
+
215
+ /**
216
+ * Service factory function type.
217
+ * Mirrors Swift's factory closure.
218
+ *
219
+ * @param request The service request
220
+ * @param user_data Provider-specific context
221
+ * @return Handle to created service, or NULL on failure
222
+ */
223
+ typedef rac_handle_t (*rac_service_create_fn)(const rac_service_request_t* request,
224
+ void* user_data);
225
+
226
+ /**
227
+ * Service provider registration.
228
+ * Mirrors Swift's ServiceRegistration struct.
229
+ */
230
+ typedef struct rac_service_provider {
231
+ /** Provider name (e.g., "LlamaCPPService") */
232
+ const char* name;
233
+
234
+ /** Capability this provider offers */
235
+ rac_capability_t capability;
236
+
237
+ /** Priority (higher = preferred, default 100) */
238
+ int32_t priority;
239
+
240
+ /** Function to check if provider can handle request */
241
+ rac_service_can_handle_fn can_handle;
242
+
243
+ /** Function to create service instance */
244
+ rac_service_create_fn create;
245
+
246
+ /** User data passed to callbacks */
247
+ void* user_data;
248
+ } rac_service_provider_t;
249
+
250
+ /**
251
+ * Registers a service provider.
252
+ *
253
+ * Mirrors Swift's ServiceRegistry.registerSTT/LLM/TTS/VAD methods.
254
+ * Providers are sorted by priority (higher first).
255
+ *
256
+ * @param provider Provider information (copied internally)
257
+ * @return RAC_SUCCESS on success, or an error code on failure
258
+ */
259
+ RAC_API rac_result_t rac_service_register_provider(const rac_service_provider_t* provider);
260
+
261
+ /**
262
+ * Unregisters a service provider.
263
+ *
264
+ * @param name The name of the provider to unregister
265
+ * @param capability The capability the provider was registered for
266
+ * @return RAC_SUCCESS on success, or an error code on failure
267
+ */
268
+ RAC_API rac_result_t rac_service_unregister_provider(const char* name, rac_capability_t capability);
269
+
270
+ /**
271
+ * Creates a service for a specific capability.
272
+ *
273
+ * Mirrors Swift's createSTT/LLM/TTS/VAD methods.
274
+ * Finds first provider that canHandle the request (sorted by priority).
275
+ *
276
+ * @param capability The capability needed
277
+ * @param request The service request (can have identifier and config)
278
+ * @param out_handle Pointer to receive the service handle
279
+ * @return RAC_SUCCESS on success, or an error code on failure
280
+ */
281
+ RAC_API rac_result_t rac_service_create(rac_capability_t capability,
282
+ const rac_service_request_t* request,
283
+ rac_handle_t* out_handle);
284
+
285
+ /**
286
+ * Lists registered providers for a capability.
287
+ *
288
+ * @param capability The capability to list providers for
289
+ * @param out_names Pointer to receive array of provider names
290
+ * @param out_count Pointer to receive count
291
+ * @return RAC_SUCCESS on success
292
+ */
293
+ RAC_API rac_result_t rac_service_list_providers(rac_capability_t capability,
294
+ const char*** out_names, size_t* out_count);
295
+
296
+ // =============================================================================
297
+ // GLOBAL MODEL REGISTRY API
298
+ // =============================================================================
299
+
300
+ /**
301
+ * Gets the global model registry instance.
302
+ * The registry is created automatically on first access.
303
+ *
304
+ * @return Handle to the global model registry
305
+ */
306
+ RAC_API struct rac_model_registry* rac_get_model_registry(void);
307
+
308
+ /**
309
+ * Registers a model with the global registry.
310
+ * Convenience function that calls rac_model_registry_save on the global registry.
311
+ *
312
+ * @param model Model info to register
313
+ * @return RAC_SUCCESS on success, or error code
314
+ */
315
+ RAC_API rac_result_t rac_register_model(const struct rac_model_info* model);
316
+
317
+ /**
318
+ * Gets model info from the global registry.
319
+ * Convenience function that calls rac_model_registry_get on the global registry.
320
+ *
321
+ * @param model_id Model identifier
322
+ * @param out_model Output: Model info (owned, must be freed with rac_model_info_free)
323
+ * @return RAC_SUCCESS on success, RAC_ERROR_NOT_FOUND if not registered
324
+ */
325
+ RAC_API rac_result_t rac_get_model(const char* model_id, struct rac_model_info** out_model);
326
+
327
+ #ifdef __cplusplus
328
+ }
329
+ #endif
330
+
331
+ #endif /* RAC_CORE_H */
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @file rac_dev_config.h
3
+ * @brief Development mode configuration API
4
+ *
5
+ * Provides access to development mode configuration values.
6
+ * The actual values are defined in development_config.cpp which is git-ignored.
7
+ *
8
+ * This allows:
9
+ * - Cross-platform sharing of dev config (iOS, Android, Flutter)
10
+ * - Git-ignored secrets with template for developers
11
+ * - Consistent development environment across SDKs
12
+ *
13
+ * Security Model:
14
+ * - development_config.cpp is in .gitignore (not committed to main branch)
15
+ * - Real values are ONLY in release tags (for SPM/Maven distribution)
16
+ * - Used ONLY when SDK is in .development mode
17
+ * - Backend validates build token via POST /api/v1/devices/register/dev
18
+ */
19
+
20
+ #ifndef RAC_DEV_CONFIG_H
21
+ #define RAC_DEV_CONFIG_H
22
+
23
+ #include <stdbool.h>
24
+
25
+ #include <RACommons/rac_types.h>
26
+
27
+ #ifdef __cplusplus
28
+ extern "C" {
29
+ #endif
30
+
31
+ // =============================================================================
32
+ // Development Configuration API
33
+ // =============================================================================
34
+
35
+ /**
36
+ * @brief Check if development config is available
37
+ * @return true if development config is properly configured
38
+ */
39
+ RAC_API bool rac_dev_config_is_available(void);
40
+
41
+ /**
42
+ * @brief Get Supabase project URL for development mode
43
+ * @return URL string (static, do not free)
44
+ */
45
+ RAC_API const char* rac_dev_config_get_supabase_url(void);
46
+
47
+ /**
48
+ * @brief Get Supabase anon key for development mode
49
+ * @return API key string (static, do not free)
50
+ */
51
+ RAC_API const char* rac_dev_config_get_supabase_key(void);
52
+
53
+ /**
54
+ * @brief Get build token for development mode
55
+ * @return Build token string (static, do not free)
56
+ */
57
+ RAC_API const char* rac_dev_config_get_build_token(void);
58
+
59
+ /**
60
+ * @brief Get Sentry DSN for crash reporting (optional)
61
+ * @return Sentry DSN string, or NULL if not configured
62
+ */
63
+ RAC_API const char* rac_dev_config_get_sentry_dsn(void);
64
+
65
+ // =============================================================================
66
+ // Convenience Functions
67
+ // =============================================================================
68
+
69
+ /**
70
+ * @brief Check if Supabase config is valid
71
+ * @return true if URL and key are non-empty
72
+ */
73
+ RAC_API bool rac_dev_config_has_supabase(void);
74
+
75
+ /**
76
+ * @brief Check if build token is valid
77
+ * @return true if build token is non-empty
78
+ */
79
+ RAC_API bool rac_dev_config_has_build_token(void);
80
+
81
+ #ifdef __cplusplus
82
+ }
83
+ #endif
84
+
85
+ #endif // RAC_DEV_CONFIG_H