@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,220 @@
1
+ /**
2
+ * @file rac_environment.h
3
+ * @brief SDK environment configuration
4
+ *
5
+ * Defines environment types (development, staging, production) and their
6
+ * associated settings like authentication requirements, log levels, etc.
7
+ * This is the canonical source of truth - platform SDKs create thin wrappers.
8
+ */
9
+
10
+ #ifndef RAC_ENVIRONMENT_H
11
+ #define RAC_ENVIRONMENT_H
12
+
13
+ #include <stdbool.h>
14
+ #include <stdint.h>
15
+
16
+ #include <RACommons/rac_types.h> // For rac_log_level_t
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ // =============================================================================
23
+ // Environment Types
24
+ // =============================================================================
25
+
26
+ /**
27
+ * @brief SDK environment mode
28
+ *
29
+ * - DEVELOPMENT: Local/testing mode, no auth required, uses Supabase
30
+ * - STAGING: Testing with real services, requires API key + URL
31
+ * - PRODUCTION: Live environment, requires API key + HTTPS URL
32
+ */
33
+ typedef enum {
34
+ RAC_ENV_DEVELOPMENT = 0,
35
+ RAC_ENV_STAGING = 1,
36
+ RAC_ENV_PRODUCTION = 2
37
+ } rac_environment_t;
38
+
39
+ // Note: rac_log_level_t is defined in rac_types.h
40
+ // We use the existing definition for consistency
41
+
42
+ // =============================================================================
43
+ // SDK Configuration
44
+ // =============================================================================
45
+
46
+ /**
47
+ * @brief SDK initialization configuration
48
+ *
49
+ * Contains all parameters needed to initialize the SDK.
50
+ * Platform SDKs populate this from their native config types.
51
+ */
52
+ typedef struct {
53
+ rac_environment_t environment;
54
+ const char* api_key; // Required for staging/production
55
+ const char* base_url; // Required for staging/production
56
+ const char* device_id; // Set by platform (Keychain UUID, etc.)
57
+ const char* platform; // "ios", "android", "flutter", etc.
58
+ const char* sdk_version; // SDK version string
59
+ } rac_sdk_config_t;
60
+
61
+ /**
62
+ * @brief Development network configuration
63
+ *
64
+ * Contains Supabase credentials for development mode.
65
+ * These are built into the SDK binary.
66
+ */
67
+ typedef struct {
68
+ const char* base_url; // Supabase project URL
69
+ const char* api_key; // Supabase anon key
70
+ const char* build_token; // SDK build token for validation
71
+ } rac_dev_config_t;
72
+
73
+ // =============================================================================
74
+ // Environment Query Functions
75
+ // =============================================================================
76
+
77
+ /**
78
+ * @brief Check if environment requires API authentication
79
+ * @param env The environment to check
80
+ * @return true for staging/production, false for development
81
+ */
82
+ bool rac_env_requires_auth(rac_environment_t env);
83
+
84
+ /**
85
+ * @brief Check if environment requires a backend URL
86
+ * @param env The environment to check
87
+ * @return true for staging/production, false for development
88
+ */
89
+ bool rac_env_requires_backend_url(rac_environment_t env);
90
+
91
+ /**
92
+ * @brief Check if environment is production
93
+ * @param env The environment to check
94
+ * @return true only for production
95
+ */
96
+ bool rac_env_is_production(rac_environment_t env);
97
+
98
+ /**
99
+ * @brief Check if environment is a testing environment
100
+ * @param env The environment to check
101
+ * @return true for development and staging
102
+ */
103
+ bool rac_env_is_testing(rac_environment_t env);
104
+
105
+ /**
106
+ * @brief Get the default log level for an environment
107
+ * @param env The environment
108
+ * @return DEBUG for development, INFO for staging, WARNING for production
109
+ */
110
+ rac_log_level_t rac_env_default_log_level(rac_environment_t env);
111
+
112
+ /**
113
+ * @brief Check if telemetry should be sent for this environment
114
+ * @param env The environment
115
+ * @return true only for production
116
+ */
117
+ bool rac_env_should_send_telemetry(rac_environment_t env);
118
+
119
+ /**
120
+ * @brief Check if environment should sync with backend
121
+ * @param env The environment
122
+ * @return true for staging/production, false for development
123
+ */
124
+ bool rac_env_should_sync_with_backend(rac_environment_t env);
125
+
126
+ /**
127
+ * @brief Get human-readable environment description
128
+ * @param env The environment
129
+ * @return String like "Development Environment"
130
+ */
131
+ const char* rac_env_description(rac_environment_t env);
132
+
133
+ // =============================================================================
134
+ // Validation Functions
135
+ // =============================================================================
136
+
137
+ /**
138
+ * @brief Validation result codes
139
+ */
140
+ typedef enum {
141
+ RAC_VALIDATION_OK = 0,
142
+ RAC_VALIDATION_API_KEY_REQUIRED,
143
+ RAC_VALIDATION_API_KEY_TOO_SHORT,
144
+ RAC_VALIDATION_URL_REQUIRED,
145
+ RAC_VALIDATION_URL_INVALID_SCHEME,
146
+ RAC_VALIDATION_URL_HTTPS_REQUIRED,
147
+ RAC_VALIDATION_URL_INVALID_HOST,
148
+ RAC_VALIDATION_URL_LOCALHOST_NOT_ALLOWED,
149
+ RAC_VALIDATION_PRODUCTION_DEBUG_BUILD
150
+ } rac_validation_result_t;
151
+
152
+ /**
153
+ * @brief Validate API key for the given environment
154
+ * @param api_key The API key to validate (can be NULL)
155
+ * @param env The target environment
156
+ * @return RAC_VALIDATION_OK if valid, error code otherwise
157
+ */
158
+ rac_validation_result_t rac_validate_api_key(const char* api_key, rac_environment_t env);
159
+
160
+ /**
161
+ * @brief Validate base URL for the given environment
162
+ * @param url The URL to validate (can be NULL)
163
+ * @param env The target environment
164
+ * @return RAC_VALIDATION_OK if valid, error code otherwise
165
+ */
166
+ rac_validation_result_t rac_validate_base_url(const char* url, rac_environment_t env);
167
+
168
+ /**
169
+ * @brief Validate complete SDK configuration
170
+ * @param config The configuration to validate
171
+ * @return RAC_VALIDATION_OK if valid, first error code otherwise
172
+ */
173
+ rac_validation_result_t rac_validate_config(const rac_sdk_config_t* config);
174
+
175
+ /**
176
+ * @brief Get error message for validation result
177
+ * @param result The validation result code
178
+ * @return Human-readable error message
179
+ */
180
+ const char* rac_validation_error_message(rac_validation_result_t result);
181
+
182
+ // =============================================================================
183
+ // Global SDK State
184
+ // =============================================================================
185
+
186
+ /**
187
+ * @brief Initialize SDK with configuration
188
+ * @param config The SDK configuration
189
+ * @return RAC_VALIDATION_OK on success, error code on validation failure
190
+ */
191
+ RAC_API rac_validation_result_t rac_sdk_init(const rac_sdk_config_t* config);
192
+
193
+ /**
194
+ * @brief Get current SDK configuration
195
+ * @return Pointer to current config, or NULL if not initialized
196
+ */
197
+ RAC_API const rac_sdk_config_t* rac_sdk_get_config(void);
198
+
199
+ /**
200
+ * @brief Get current environment
201
+ * @return Current environment, or RAC_ENV_DEVELOPMENT if not initialized
202
+ */
203
+ RAC_API rac_environment_t rac_sdk_get_environment(void);
204
+
205
+ /**
206
+ * @brief Check if SDK is initialized
207
+ * @return true if rac_sdk_init has been called successfully
208
+ */
209
+ RAC_API bool rac_sdk_is_initialized(void);
210
+
211
+ /**
212
+ * @brief Reset SDK state (for testing)
213
+ */
214
+ RAC_API void rac_sdk_reset(void);
215
+
216
+ #ifdef __cplusplus
217
+ }
218
+ #endif
219
+
220
+ #endif // RAC_ENVIRONMENT_H
@@ -0,0 +1,469 @@
1
+ /**
2
+ * @file rac_error.h
3
+ * @brief RunAnywhere Commons - Error Codes and Error Handling
4
+ *
5
+ * C port of Swift's ErrorCode enum from Foundation/Errors/ErrorCode.swift.
6
+ *
7
+ * Error codes for runanywhere-commons use the range -100 to -999 to avoid
8
+ * collision with runanywhere-core error codes (0 to -99).
9
+ *
10
+ * IMPORTANT: This is a direct translation of the Swift implementation.
11
+ * Do NOT add error codes not present in the Swift code.
12
+ */
13
+
14
+ #ifndef RAC_ERROR_H
15
+ #define RAC_ERROR_H
16
+
17
+ #include <RACommons/rac_types.h>
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ // =============================================================================
24
+ // ERROR CODE RANGES
25
+ // =============================================================================
26
+ //
27
+ // runanywhere-core (ra_*): 0 to -99
28
+ // runanywhere-commons (rac_*): -100 to -999
29
+ // - Initialization errors: -100 to -109
30
+ // - Model errors: -110 to -129
31
+ // - Generation errors: -130 to -149
32
+ // - Network errors: -150 to -179
33
+ // - Storage errors: -180 to -219
34
+ // - Hardware errors: -220 to -229
35
+ // - Component state errors: -230 to -249
36
+ // - Validation errors: -250 to -279
37
+ // - Audio errors: -280 to -299
38
+ // - Language/Voice errors: -300 to -319
39
+ // - Authentication errors: -320 to -329
40
+ // - Security errors: -330 to -349
41
+ // - Extraction errors: -350 to -369
42
+ // - Calibration errors: -370 to -379
43
+ // - Module/Service errors: -400 to -499
44
+ // - Platform adapter errors: -500 to -599
45
+ // - Backend errors: -600 to -699
46
+ // - Event errors: -700 to -799
47
+ // - Other errors: -800 to -899
48
+ // - Reserved: -900 to -999
49
+
50
+ // =============================================================================
51
+ // INITIALIZATION ERRORS (-100 to -109)
52
+ // Mirrors Swift's ErrorCode: Initialization Errors
53
+ // =============================================================================
54
+
55
+ /** Component or service has not been initialized */
56
+ #define RAC_ERROR_NOT_INITIALIZED ((rac_result_t) - 100)
57
+ /** Component or service is already initialized */
58
+ #define RAC_ERROR_ALREADY_INITIALIZED ((rac_result_t) - 101)
59
+ /** Initialization failed */
60
+ #define RAC_ERROR_INITIALIZATION_FAILED ((rac_result_t) - 102)
61
+ /** Configuration is invalid */
62
+ #define RAC_ERROR_INVALID_CONFIGURATION ((rac_result_t) - 103)
63
+ /** API key is invalid or missing */
64
+ #define RAC_ERROR_INVALID_API_KEY ((rac_result_t) - 104)
65
+ /** Environment mismatch (e.g., dev vs prod) */
66
+ #define RAC_ERROR_ENVIRONMENT_MISMATCH ((rac_result_t) - 105)
67
+ /** Invalid parameter value passed to a function */
68
+ #define RAC_ERROR_INVALID_PARAMETER ((rac_result_t) - 106)
69
+
70
+ // =============================================================================
71
+ // MODEL ERRORS (-110 to -129)
72
+ // Mirrors Swift's ErrorCode: Model Errors
73
+ // =============================================================================
74
+
75
+ /** Requested model was not found */
76
+ #define RAC_ERROR_MODEL_NOT_FOUND ((rac_result_t) - 110)
77
+ /** Failed to load the model */
78
+ #define RAC_ERROR_MODEL_LOAD_FAILED ((rac_result_t) - 111)
79
+ /** Model validation failed */
80
+ #define RAC_ERROR_MODEL_VALIDATION_FAILED ((rac_result_t) - 112)
81
+ /** Model is incompatible with current runtime */
82
+ #define RAC_ERROR_MODEL_INCOMPATIBLE ((rac_result_t) - 113)
83
+ /** Model format is invalid */
84
+ #define RAC_ERROR_INVALID_MODEL_FORMAT ((rac_result_t) - 114)
85
+ /** Model storage is corrupted */
86
+ #define RAC_ERROR_MODEL_STORAGE_CORRUPTED ((rac_result_t) - 115)
87
+ /** Model not loaded (alias for backward compatibility) */
88
+ #define RAC_ERROR_MODEL_NOT_LOADED ((rac_result_t) - 116)
89
+
90
+ // =============================================================================
91
+ // GENERATION ERRORS (-130 to -149)
92
+ // Mirrors Swift's ErrorCode: Generation Errors
93
+ // =============================================================================
94
+
95
+ /** Text/audio generation failed */
96
+ #define RAC_ERROR_GENERATION_FAILED ((rac_result_t) - 130)
97
+ /** Generation timed out */
98
+ #define RAC_ERROR_GENERATION_TIMEOUT ((rac_result_t) - 131)
99
+ /** Context length exceeded maximum */
100
+ #define RAC_ERROR_CONTEXT_TOO_LONG ((rac_result_t) - 132)
101
+ /** Token limit exceeded */
102
+ #define RAC_ERROR_TOKEN_LIMIT_EXCEEDED ((rac_result_t) - 133)
103
+ /** Cost limit exceeded */
104
+ #define RAC_ERROR_COST_LIMIT_EXCEEDED ((rac_result_t) - 134)
105
+ /** Inference failed */
106
+ #define RAC_ERROR_INFERENCE_FAILED ((rac_result_t) - 135)
107
+
108
+ // =============================================================================
109
+ // NETWORK ERRORS (-150 to -179)
110
+ // Mirrors Swift's ErrorCode: Network Errors
111
+ // =============================================================================
112
+
113
+ /** Network is unavailable */
114
+ #define RAC_ERROR_NETWORK_UNAVAILABLE ((rac_result_t) - 150)
115
+ /** Generic network error */
116
+ #define RAC_ERROR_NETWORK_ERROR ((rac_result_t) - 151)
117
+ /** Request failed */
118
+ #define RAC_ERROR_REQUEST_FAILED ((rac_result_t) - 152)
119
+ /** Download failed */
120
+ #define RAC_ERROR_DOWNLOAD_FAILED ((rac_result_t) - 153)
121
+ /** Server returned an error */
122
+ #define RAC_ERROR_SERVER_ERROR ((rac_result_t) - 154)
123
+ /** Request timed out */
124
+ #define RAC_ERROR_TIMEOUT ((rac_result_t) - 155)
125
+ /** Invalid response from server */
126
+ #define RAC_ERROR_INVALID_RESPONSE ((rac_result_t) - 156)
127
+ /** HTTP error with status code */
128
+ #define RAC_ERROR_HTTP_ERROR ((rac_result_t) - 157)
129
+ /** Connection was lost */
130
+ #define RAC_ERROR_CONNECTION_LOST ((rac_result_t) - 158)
131
+ /** Partial download (incomplete) */
132
+ #define RAC_ERROR_PARTIAL_DOWNLOAD ((rac_result_t) - 159)
133
+ /** HTTP request failed */
134
+ #define RAC_ERROR_HTTP_REQUEST_FAILED ((rac_result_t) - 160)
135
+ /** HTTP not supported */
136
+ #define RAC_ERROR_HTTP_NOT_SUPPORTED ((rac_result_t) - 161)
137
+
138
+ // =============================================================================
139
+ // STORAGE ERRORS (-180 to -219)
140
+ // Mirrors Swift's ErrorCode: Storage Errors
141
+ // =============================================================================
142
+
143
+ /** Insufficient storage space */
144
+ #define RAC_ERROR_INSUFFICIENT_STORAGE ((rac_result_t) - 180)
145
+ /** Storage is full */
146
+ #define RAC_ERROR_STORAGE_FULL ((rac_result_t) - 181)
147
+ /** Generic storage error */
148
+ #define RAC_ERROR_STORAGE_ERROR ((rac_result_t) - 182)
149
+ /** File was not found */
150
+ #define RAC_ERROR_FILE_NOT_FOUND ((rac_result_t) - 183)
151
+ /** Failed to read file */
152
+ #define RAC_ERROR_FILE_READ_FAILED ((rac_result_t) - 184)
153
+ /** Failed to write file */
154
+ #define RAC_ERROR_FILE_WRITE_FAILED ((rac_result_t) - 185)
155
+ /** Permission denied for file operation */
156
+ #define RAC_ERROR_PERMISSION_DENIED ((rac_result_t) - 186)
157
+ /** Failed to delete file or directory */
158
+ #define RAC_ERROR_DELETE_FAILED ((rac_result_t) - 187)
159
+ /** Failed to move file */
160
+ #define RAC_ERROR_MOVE_FAILED ((rac_result_t) - 188)
161
+ /** Failed to create directory */
162
+ #define RAC_ERROR_DIRECTORY_CREATION_FAILED ((rac_result_t) - 189)
163
+ /** Directory not found */
164
+ #define RAC_ERROR_DIRECTORY_NOT_FOUND ((rac_result_t) - 190)
165
+ /** Invalid file path */
166
+ #define RAC_ERROR_INVALID_PATH ((rac_result_t) - 191)
167
+ /** Invalid file name */
168
+ #define RAC_ERROR_INVALID_FILE_NAME ((rac_result_t) - 192)
169
+ /** Failed to create temporary file */
170
+ #define RAC_ERROR_TEMP_FILE_CREATION_FAILED ((rac_result_t) - 193)
171
+ /** File delete failed (alias) */
172
+ #define RAC_ERROR_FILE_DELETE_FAILED ((rac_result_t) - 187)
173
+
174
+ // =============================================================================
175
+ // HARDWARE ERRORS (-220 to -229)
176
+ // Mirrors Swift's ErrorCode: Hardware Errors
177
+ // =============================================================================
178
+
179
+ /** Hardware is unsupported */
180
+ #define RAC_ERROR_HARDWARE_UNSUPPORTED ((rac_result_t) - 220)
181
+ /** Insufficient memory */
182
+ #define RAC_ERROR_INSUFFICIENT_MEMORY ((rac_result_t) - 221)
183
+ /** Out of memory (alias) */
184
+ #define RAC_ERROR_OUT_OF_MEMORY ((rac_result_t) - 221)
185
+
186
+ // =============================================================================
187
+ // COMPONENT STATE ERRORS (-230 to -249)
188
+ // Mirrors Swift's ErrorCode: Component State Errors
189
+ // =============================================================================
190
+
191
+ /** Component is not ready */
192
+ #define RAC_ERROR_COMPONENT_NOT_READY ((rac_result_t) - 230)
193
+ /** Component is in invalid state */
194
+ #define RAC_ERROR_INVALID_STATE ((rac_result_t) - 231)
195
+ /** Service is not available */
196
+ #define RAC_ERROR_SERVICE_NOT_AVAILABLE ((rac_result_t) - 232)
197
+ /** Service is busy */
198
+ #define RAC_ERROR_SERVICE_BUSY ((rac_result_t) - 233)
199
+ /** Processing failed */
200
+ #define RAC_ERROR_PROCESSING_FAILED ((rac_result_t) - 234)
201
+ /** Start operation failed */
202
+ #define RAC_ERROR_START_FAILED ((rac_result_t) - 235)
203
+ /** Feature/operation is not supported */
204
+ #define RAC_ERROR_NOT_SUPPORTED ((rac_result_t) - 236)
205
+
206
+ // =============================================================================
207
+ // VALIDATION ERRORS (-250 to -279)
208
+ // Mirrors Swift's ErrorCode: Validation Errors
209
+ // =============================================================================
210
+
211
+ /** Validation failed */
212
+ #define RAC_ERROR_VALIDATION_FAILED ((rac_result_t) - 250)
213
+ /** Input is invalid */
214
+ #define RAC_ERROR_INVALID_INPUT ((rac_result_t) - 251)
215
+ /** Format is invalid */
216
+ #define RAC_ERROR_INVALID_FORMAT ((rac_result_t) - 252)
217
+ /** Input is empty */
218
+ #define RAC_ERROR_EMPTY_INPUT ((rac_result_t) - 253)
219
+ /** Text is too long */
220
+ #define RAC_ERROR_TEXT_TOO_LONG ((rac_result_t) - 254)
221
+ /** Invalid SSML markup */
222
+ #define RAC_ERROR_INVALID_SSML ((rac_result_t) - 255)
223
+ /** Invalid speaking rate */
224
+ #define RAC_ERROR_INVALID_SPEAKING_RATE ((rac_result_t) - 256)
225
+ /** Invalid pitch */
226
+ #define RAC_ERROR_INVALID_PITCH ((rac_result_t) - 257)
227
+ /** Invalid volume */
228
+ #define RAC_ERROR_INVALID_VOLUME ((rac_result_t) - 258)
229
+ /** Invalid argument */
230
+ #define RAC_ERROR_INVALID_ARGUMENT ((rac_result_t) - 259)
231
+ /** Null pointer */
232
+ #define RAC_ERROR_NULL_POINTER ((rac_result_t) - 260)
233
+ /** Buffer too small */
234
+ #define RAC_ERROR_BUFFER_TOO_SMALL ((rac_result_t) - 261)
235
+
236
+ // =============================================================================
237
+ // AUDIO ERRORS (-280 to -299)
238
+ // Mirrors Swift's ErrorCode: Audio Errors
239
+ // =============================================================================
240
+
241
+ /** Audio format is not supported */
242
+ #define RAC_ERROR_AUDIO_FORMAT_NOT_SUPPORTED ((rac_result_t) - 280)
243
+ /** Audio session configuration failed */
244
+ #define RAC_ERROR_AUDIO_SESSION_FAILED ((rac_result_t) - 281)
245
+ /** Microphone permission denied */
246
+ #define RAC_ERROR_MICROPHONE_PERMISSION_DENIED ((rac_result_t) - 282)
247
+ /** Insufficient audio data */
248
+ #define RAC_ERROR_INSUFFICIENT_AUDIO_DATA ((rac_result_t) - 283)
249
+ /** Audio buffer is empty */
250
+ #define RAC_ERROR_EMPTY_AUDIO_BUFFER ((rac_result_t) - 284)
251
+ /** Audio session activation failed */
252
+ #define RAC_ERROR_AUDIO_SESSION_ACTIVATION_FAILED ((rac_result_t) - 285)
253
+
254
+ // =============================================================================
255
+ // LANGUAGE/VOICE ERRORS (-300 to -319)
256
+ // Mirrors Swift's ErrorCode: Language/Voice Errors
257
+ // =============================================================================
258
+
259
+ /** Language is not supported */
260
+ #define RAC_ERROR_LANGUAGE_NOT_SUPPORTED ((rac_result_t) - 300)
261
+ /** Voice is not available */
262
+ #define RAC_ERROR_VOICE_NOT_AVAILABLE ((rac_result_t) - 301)
263
+ /** Streaming is not supported */
264
+ #define RAC_ERROR_STREAMING_NOT_SUPPORTED ((rac_result_t) - 302)
265
+ /** Stream was cancelled */
266
+ #define RAC_ERROR_STREAM_CANCELLED ((rac_result_t) - 303)
267
+
268
+ // =============================================================================
269
+ // AUTHENTICATION ERRORS (-320 to -329)
270
+ // Mirrors Swift's ErrorCode: Authentication Errors
271
+ // =============================================================================
272
+
273
+ /** Authentication failed */
274
+ #define RAC_ERROR_AUTHENTICATION_FAILED ((rac_result_t) - 320)
275
+ /** Unauthorized access */
276
+ #define RAC_ERROR_UNAUTHORIZED ((rac_result_t) - 321)
277
+ /** Access forbidden */
278
+ #define RAC_ERROR_FORBIDDEN ((rac_result_t) - 322)
279
+
280
+ // =============================================================================
281
+ // SECURITY ERRORS (-330 to -349)
282
+ // Mirrors Swift's ErrorCode: Security Errors
283
+ // =============================================================================
284
+
285
+ /** Keychain operation failed */
286
+ #define RAC_ERROR_KEYCHAIN_ERROR ((rac_result_t) - 330)
287
+ /** Encoding error */
288
+ #define RAC_ERROR_ENCODING_ERROR ((rac_result_t) - 331)
289
+ /** Decoding error */
290
+ #define RAC_ERROR_DECODING_ERROR ((rac_result_t) - 332)
291
+ /** Secure storage failed */
292
+ #define RAC_ERROR_SECURE_STORAGE_FAILED ((rac_result_t) - 333)
293
+
294
+ // =============================================================================
295
+ // EXTRACTION ERRORS (-350 to -369)
296
+ // Mirrors Swift's ErrorCode: Extraction Errors
297
+ // =============================================================================
298
+
299
+ /** Extraction failed (JSON, archive, etc.) */
300
+ #define RAC_ERROR_EXTRACTION_FAILED ((rac_result_t) - 350)
301
+ /** Checksum mismatch */
302
+ #define RAC_ERROR_CHECKSUM_MISMATCH ((rac_result_t) - 351)
303
+ /** Unsupported archive format */
304
+ #define RAC_ERROR_UNSUPPORTED_ARCHIVE ((rac_result_t) - 352)
305
+
306
+ // =============================================================================
307
+ // CALIBRATION ERRORS (-370 to -379)
308
+ // Mirrors Swift's ErrorCode: Calibration Errors
309
+ // =============================================================================
310
+
311
+ /** Calibration failed */
312
+ #define RAC_ERROR_CALIBRATION_FAILED ((rac_result_t) - 370)
313
+ /** Calibration timed out */
314
+ #define RAC_ERROR_CALIBRATION_TIMEOUT ((rac_result_t) - 371)
315
+
316
+ // =============================================================================
317
+ // CANCELLATION (-380 to -389)
318
+ // Mirrors Swift's ErrorCode: Cancellation
319
+ // =============================================================================
320
+
321
+ /** Operation was cancelled */
322
+ #define RAC_ERROR_CANCELLED ((rac_result_t) - 380)
323
+
324
+ // =============================================================================
325
+ // MODULE/SERVICE ERRORS (-400 to -499)
326
+ // =============================================================================
327
+
328
+ /** Module not found */
329
+ #define RAC_ERROR_MODULE_NOT_FOUND ((rac_result_t) - 400)
330
+ /** Module already registered */
331
+ #define RAC_ERROR_MODULE_ALREADY_REGISTERED ((rac_result_t) - 401)
332
+ /** Module load failed */
333
+ #define RAC_ERROR_MODULE_LOAD_FAILED ((rac_result_t) - 402)
334
+ /** Service not found */
335
+ #define RAC_ERROR_SERVICE_NOT_FOUND ((rac_result_t) - 410)
336
+ /** Service already registered */
337
+ #define RAC_ERROR_SERVICE_ALREADY_REGISTERED ((rac_result_t) - 411)
338
+ /** Service create failed */
339
+ #define RAC_ERROR_SERVICE_CREATE_FAILED ((rac_result_t) - 412)
340
+ /** Capability not found */
341
+ #define RAC_ERROR_CAPABILITY_NOT_FOUND ((rac_result_t) - 420)
342
+ /** Provider not found */
343
+ #define RAC_ERROR_PROVIDER_NOT_FOUND ((rac_result_t) - 421)
344
+ /** No capable provider */
345
+ #define RAC_ERROR_NO_CAPABLE_PROVIDER ((rac_result_t) - 422)
346
+ /** Generic not found */
347
+ #define RAC_ERROR_NOT_FOUND ((rac_result_t) - 423)
348
+
349
+ // =============================================================================
350
+ // PLATFORM ADAPTER ERRORS (-500 to -599)
351
+ // =============================================================================
352
+
353
+ /** Adapter not set */
354
+ #define RAC_ERROR_ADAPTER_NOT_SET ((rac_result_t) - 500)
355
+
356
+ // =============================================================================
357
+ // BACKEND ERRORS (-600 to -699)
358
+ // =============================================================================
359
+
360
+ /** Backend not found */
361
+ #define RAC_ERROR_BACKEND_NOT_FOUND ((rac_result_t) - 600)
362
+ /** Backend not ready */
363
+ #define RAC_ERROR_BACKEND_NOT_READY ((rac_result_t) - 601)
364
+ /** Backend init failed */
365
+ #define RAC_ERROR_BACKEND_INIT_FAILED ((rac_result_t) - 602)
366
+ /** Backend busy */
367
+ #define RAC_ERROR_BACKEND_BUSY ((rac_result_t) - 603)
368
+ /** Invalid handle */
369
+ #define RAC_ERROR_INVALID_HANDLE ((rac_result_t) - 610)
370
+
371
+ // =============================================================================
372
+ // EVENT ERRORS (-700 to -799)
373
+ // =============================================================================
374
+
375
+ /** Invalid event category */
376
+ #define RAC_ERROR_EVENT_INVALID_CATEGORY ((rac_result_t) - 700)
377
+ /** Event subscription failed */
378
+ #define RAC_ERROR_EVENT_SUBSCRIPTION_FAILED ((rac_result_t) - 701)
379
+ /** Event publish failed */
380
+ #define RAC_ERROR_EVENT_PUBLISH_FAILED ((rac_result_t) - 702)
381
+
382
+ // =============================================================================
383
+ // OTHER ERRORS (-800 to -899)
384
+ // Mirrors Swift's ErrorCode: Other Errors
385
+ // =============================================================================
386
+
387
+ /** Feature is not implemented */
388
+ #define RAC_ERROR_NOT_IMPLEMENTED ((rac_result_t) - 800)
389
+ /** Feature is not available */
390
+ #define RAC_ERROR_FEATURE_NOT_AVAILABLE ((rac_result_t) - 801)
391
+ /** Framework is not available */
392
+ #define RAC_ERROR_FRAMEWORK_NOT_AVAILABLE ((rac_result_t) - 802)
393
+ /** Unsupported modality */
394
+ #define RAC_ERROR_UNSUPPORTED_MODALITY ((rac_result_t) - 803)
395
+ /** Unknown error */
396
+ #define RAC_ERROR_UNKNOWN ((rac_result_t) - 804)
397
+ /** Internal error */
398
+ #define RAC_ERROR_INTERNAL ((rac_result_t) - 805)
399
+
400
+ // =============================================================================
401
+ // ERROR MESSAGE API
402
+ // =============================================================================
403
+
404
+ /**
405
+ * Gets a human-readable error message for an error code.
406
+ *
407
+ * @param error_code The error code to get a message for
408
+ * @return A static string describing the error (never NULL)
409
+ */
410
+ RAC_API const char* rac_error_message(rac_result_t error_code);
411
+
412
+ /**
413
+ * Gets the last detailed error message.
414
+ *
415
+ * This returns additional context beyond the error code, such as file paths
416
+ * or specific failure reasons. Returns NULL if no detailed message is set.
417
+ *
418
+ * @return The last error detail string, or NULL
419
+ *
420
+ * @note The returned string is thread-local and valid until the next
421
+ * RAC function call on the same thread.
422
+ */
423
+ RAC_API const char* rac_error_get_details(void);
424
+
425
+ /**
426
+ * Sets the detailed error message for the current thread.
427
+ *
428
+ * This is typically called internally by RAC functions to provide
429
+ * additional context for errors.
430
+ *
431
+ * @param details The detail string (will be copied internally)
432
+ */
433
+ RAC_API void rac_error_set_details(const char* details);
434
+
435
+ /**
436
+ * Clears the detailed error message for the current thread.
437
+ */
438
+ RAC_API void rac_error_clear_details(void);
439
+
440
+ /**
441
+ * Checks if an error code is in the commons range (-100 to -999).
442
+ *
443
+ * @param error_code The error code to check
444
+ * @return RAC_TRUE if the error is from commons, RAC_FALSE otherwise
445
+ */
446
+ RAC_API rac_bool_t rac_error_is_commons_error(rac_result_t error_code);
447
+
448
+ /**
449
+ * Checks if an error code is in the core range (0 to -99).
450
+ *
451
+ * @param error_code The error code to check
452
+ * @return RAC_TRUE if the error is from core, RAC_FALSE otherwise
453
+ */
454
+ RAC_API rac_bool_t rac_error_is_core_error(rac_result_t error_code);
455
+
456
+ /**
457
+ * Checks if an error is expected/routine (like cancellation).
458
+ * Mirrors Swift's ErrorCode.isExpected property.
459
+ *
460
+ * @param error_code The error code to check
461
+ * @return RAC_TRUE if expected, RAC_FALSE otherwise
462
+ */
463
+ RAC_API rac_bool_t rac_error_is_expected(rac_result_t error_code);
464
+
465
+ #ifdef __cplusplus
466
+ }
467
+ #endif
468
+
469
+ #endif /* RAC_ERROR_H */