@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,613 @@
1
+ /**
2
+ * @file rac_model_types.h
3
+ * @brief Model Types - Comprehensive Type Definitions for Model Management
4
+ *
5
+ * C port of Swift's model type definitions from:
6
+ * - ModelCategory.swift
7
+ * - ModelFormat.swift
8
+ * - ModelArtifactType.swift
9
+ * - InferenceFramework.swift
10
+ * - ModelInfo.swift
11
+ *
12
+ * IMPORTANT: This is a direct translation of the Swift implementation.
13
+ * Do NOT add features not present in the Swift code.
14
+ */
15
+
16
+ #ifndef RAC_MODEL_TYPES_H
17
+ #define RAC_MODEL_TYPES_H
18
+
19
+ #include <stddef.h>
20
+ #include <stdint.h>
21
+
22
+ #include <RACommons/rac_error.h>
23
+ #include <RACommons/rac_types.h>
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ // =============================================================================
30
+ // ARCHIVE TYPES - From ModelArtifactType.swift
31
+ // =============================================================================
32
+
33
+ /**
34
+ * @brief Supported archive formats for model packaging.
35
+ * Mirrors Swift's ArchiveType enum.
36
+ */
37
+ typedef enum rac_archive_type {
38
+ RAC_ARCHIVE_TYPE_NONE = -1, /**< No archive - direct file */
39
+ RAC_ARCHIVE_TYPE_ZIP = 0, /**< ZIP archive */
40
+ RAC_ARCHIVE_TYPE_TAR_BZ2 = 1, /**< tar.bz2 archive */
41
+ RAC_ARCHIVE_TYPE_TAR_GZ = 2, /**< tar.gz archive */
42
+ RAC_ARCHIVE_TYPE_TAR_XZ = 3 /**< tar.xz archive */
43
+ } rac_archive_type_t;
44
+
45
+ /**
46
+ * @brief Internal structure of an archive after extraction.
47
+ * Mirrors Swift's ArchiveStructure enum.
48
+ */
49
+ typedef enum rac_archive_structure {
50
+ RAC_ARCHIVE_STRUCTURE_SINGLE_FILE_NESTED =
51
+ 0, /**< Single model file at root or nested in one directory */
52
+ RAC_ARCHIVE_STRUCTURE_DIRECTORY_BASED = 1, /**< Multiple files in a directory */
53
+ RAC_ARCHIVE_STRUCTURE_NESTED_DIRECTORY = 2, /**< Subdirectory structure */
54
+ RAC_ARCHIVE_STRUCTURE_UNKNOWN = 99 /**< Unknown - detected after extraction */
55
+ } rac_archive_structure_t;
56
+
57
+ // =============================================================================
58
+ // EXPECTED MODEL FILES - From ModelArtifactType.swift
59
+ // =============================================================================
60
+
61
+ /**
62
+ * @brief Expected model files after extraction/download.
63
+ * Mirrors Swift's ExpectedModelFiles struct.
64
+ */
65
+ typedef struct rac_expected_model_files {
66
+ /** File patterns that must be present (e.g., "*.onnx", "encoder*.onnx") */
67
+ const char** required_patterns;
68
+ size_t required_pattern_count;
69
+
70
+ /** File patterns that may be present but are optional */
71
+ const char** optional_patterns;
72
+ size_t optional_pattern_count;
73
+
74
+ /** Description of the model files for documentation */
75
+ const char* description;
76
+ } rac_expected_model_files_t;
77
+
78
+ /**
79
+ * @brief Multi-file model descriptor.
80
+ * Mirrors Swift's ModelFileDescriptor struct.
81
+ */
82
+ typedef struct rac_model_file_descriptor {
83
+ /** Relative path from base URL to this file */
84
+ const char* relative_path;
85
+
86
+ /** Destination path relative to model folder */
87
+ const char* destination_path;
88
+
89
+ /** Whether this file is required (vs optional) */
90
+ rac_bool_t is_required;
91
+ } rac_model_file_descriptor_t;
92
+
93
+ // =============================================================================
94
+ // MODEL ARTIFACT TYPE - From ModelArtifactType.swift
95
+ // =============================================================================
96
+
97
+ /**
98
+ * @brief Model artifact type enumeration.
99
+ * Mirrors Swift's ModelArtifactType enum (simplified for C).
100
+ */
101
+ typedef enum rac_artifact_type_kind {
102
+ RAC_ARTIFACT_KIND_SINGLE_FILE = 0, /**< Single file download */
103
+ RAC_ARTIFACT_KIND_ARCHIVE = 1, /**< Archive requiring extraction */
104
+ RAC_ARTIFACT_KIND_MULTI_FILE = 2, /**< Multiple files */
105
+ RAC_ARTIFACT_KIND_CUSTOM = 3, /**< Custom download strategy */
106
+ RAC_ARTIFACT_KIND_BUILT_IN = 4 /**< Built-in model (no download) */
107
+ } rac_artifact_type_kind_t;
108
+
109
+ /**
110
+ * @brief Full model artifact type with associated data.
111
+ * Mirrors Swift's ModelArtifactType enum with associated values.
112
+ */
113
+ typedef struct rac_model_artifact_info {
114
+ /** The kind of artifact */
115
+ rac_artifact_type_kind_t kind;
116
+
117
+ /** For archive type: the archive format */
118
+ rac_archive_type_t archive_type;
119
+
120
+ /** For archive type: the internal structure */
121
+ rac_archive_structure_t archive_structure;
122
+
123
+ /** Expected files after extraction (can be NULL) */
124
+ rac_expected_model_files_t* expected_files;
125
+
126
+ /** For multi-file: descriptors array (can be NULL) */
127
+ rac_model_file_descriptor_t* file_descriptors;
128
+ size_t file_descriptor_count;
129
+
130
+ /** For custom: strategy identifier */
131
+ const char* strategy_id;
132
+ } rac_model_artifact_info_t;
133
+
134
+ // =============================================================================
135
+ // MODEL CATEGORY - From ModelCategory.swift
136
+ // =============================================================================
137
+
138
+ /**
139
+ * @brief Model category based on input/output modality.
140
+ * Mirrors Swift's ModelCategory enum.
141
+ */
142
+ typedef enum rac_model_category {
143
+ RAC_MODEL_CATEGORY_LANGUAGE = 0, /**< Text-to-text models (LLMs) */
144
+ RAC_MODEL_CATEGORY_SPEECH_RECOGNITION = 1, /**< Voice-to-text models (ASR/STT) */
145
+ RAC_MODEL_CATEGORY_SPEECH_SYNTHESIS = 2, /**< Text-to-voice models (TTS) */
146
+ RAC_MODEL_CATEGORY_VISION = 3, /**< Image understanding models */
147
+ RAC_MODEL_CATEGORY_IMAGE_GENERATION = 4, /**< Text-to-image models */
148
+ RAC_MODEL_CATEGORY_MULTIMODAL = 5, /**< Multi-modality models */
149
+ RAC_MODEL_CATEGORY_AUDIO = 6, /**< Audio processing (diarization, etc.) */
150
+ RAC_MODEL_CATEGORY_UNKNOWN = 99 /**< Unknown category */
151
+ } rac_model_category_t;
152
+
153
+ // =============================================================================
154
+ // MODEL FORMAT - From ModelFormat.swift
155
+ // =============================================================================
156
+
157
+ /**
158
+ * @brief Supported model file formats.
159
+ * Mirrors Swift's ModelFormat enum.
160
+ */
161
+ typedef enum rac_model_format {
162
+ RAC_MODEL_FORMAT_ONNX = 0, /**< ONNX format */
163
+ RAC_MODEL_FORMAT_ORT = 1, /**< ONNX Runtime format */
164
+ RAC_MODEL_FORMAT_GGUF = 2, /**< GGUF format (llama.cpp) */
165
+ RAC_MODEL_FORMAT_BIN = 3, /**< Binary format */
166
+ RAC_MODEL_FORMAT_UNKNOWN = 99 /**< Unknown format */
167
+ } rac_model_format_t;
168
+
169
+ // =============================================================================
170
+ // INFERENCE FRAMEWORK - From InferenceFramework.swift
171
+ // =============================================================================
172
+
173
+ /**
174
+ * @brief Supported inference frameworks/runtimes.
175
+ * Mirrors Swift's InferenceFramework enum.
176
+ */
177
+ typedef enum rac_inference_framework {
178
+ RAC_FRAMEWORK_ONNX = 0, /**< ONNX Runtime */
179
+ RAC_FRAMEWORK_LLAMACPP = 1, /**< llama.cpp */
180
+ RAC_FRAMEWORK_FOUNDATION_MODELS = 2, /**< Apple Foundation Models */
181
+ RAC_FRAMEWORK_SYSTEM_TTS = 3, /**< System TTS */
182
+ RAC_FRAMEWORK_FLUID_AUDIO = 4, /**< FluidAudio */
183
+ RAC_FRAMEWORK_BUILTIN = 5, /**< Built-in (e.g., energy VAD) */
184
+ RAC_FRAMEWORK_NONE = 6, /**< No framework needed */
185
+ RAC_FRAMEWORK_UNKNOWN = 99 /**< Unknown framework */
186
+ } rac_inference_framework_t;
187
+
188
+ // =============================================================================
189
+ // MODEL SOURCE
190
+ // =============================================================================
191
+
192
+ /**
193
+ * @brief Model source enumeration.
194
+ * Mirrors Swift's ModelSource enum.
195
+ */
196
+ typedef enum rac_model_source {
197
+ RAC_MODEL_SOURCE_REMOTE = 0, /**< Model from remote API/catalog */
198
+ RAC_MODEL_SOURCE_LOCAL = 1 /**< Model provided locally */
199
+ } rac_model_source_t;
200
+
201
+ // =============================================================================
202
+ // MODEL INFO - From ModelInfo.swift
203
+ // =============================================================================
204
+
205
+ /**
206
+ * @brief Complete model information structure.
207
+ * Mirrors Swift's ModelInfo struct.
208
+ */
209
+ typedef struct rac_model_info {
210
+ /** Unique model identifier */
211
+ char* id;
212
+
213
+ /** Human-readable model name */
214
+ char* name;
215
+
216
+ /** Model category */
217
+ rac_model_category_t category;
218
+
219
+ /** Model format */
220
+ rac_model_format_t format;
221
+
222
+ /** Inference framework */
223
+ rac_inference_framework_t framework;
224
+
225
+ /** Download URL (can be NULL) */
226
+ char* download_url;
227
+
228
+ /** Local path (can be NULL) */
229
+ char* local_path;
230
+
231
+ /** Artifact information */
232
+ rac_model_artifact_info_t artifact_info;
233
+
234
+ /** Download size in bytes (0 if unknown) */
235
+ int64_t download_size;
236
+
237
+ /** Memory required in bytes (0 if unknown) */
238
+ int64_t memory_required;
239
+
240
+ /** Context length (for language models, 0 if not applicable) */
241
+ int32_t context_length;
242
+
243
+ /** Whether model supports thinking/reasoning */
244
+ rac_bool_t supports_thinking;
245
+
246
+ /** Tags (NULL-terminated array of strings, can be NULL) */
247
+ char** tags;
248
+ size_t tag_count;
249
+
250
+ /** Description (can be NULL) */
251
+ char* description;
252
+
253
+ /** Model source */
254
+ rac_model_source_t source;
255
+
256
+ /** Created timestamp (Unix timestamp) */
257
+ int64_t created_at;
258
+
259
+ /** Updated timestamp (Unix timestamp) */
260
+ int64_t updated_at;
261
+
262
+ /** Last used timestamp (0 if never used) */
263
+ int64_t last_used;
264
+
265
+ /** Usage count */
266
+ int32_t usage_count;
267
+ } rac_model_info_t;
268
+
269
+ // =============================================================================
270
+ // HELPER FUNCTIONS
271
+ // =============================================================================
272
+
273
+ /**
274
+ * @brief Get file extension for archive type.
275
+ * Mirrors Swift's ArchiveType.fileExtension.
276
+ *
277
+ * @param type Archive type
278
+ * @return File extension string (e.g., "zip", "tar.bz2")
279
+ */
280
+ RAC_API const char* rac_archive_type_extension(rac_archive_type_t type);
281
+
282
+ /**
283
+ * @brief Detect archive type from URL path.
284
+ * Mirrors Swift's ArchiveType.from(url:).
285
+ *
286
+ * @param url_path URL path string
287
+ * @param out_type Output: Detected archive type
288
+ * @return RAC_TRUE if archive detected, RAC_FALSE otherwise
289
+ */
290
+ RAC_API rac_bool_t rac_archive_type_from_path(const char* url_path, rac_archive_type_t* out_type);
291
+
292
+ /**
293
+ * @brief Check if model category requires context length.
294
+ * Mirrors Swift's ModelCategory.requiresContextLength.
295
+ *
296
+ * @param category Model category
297
+ * @return RAC_TRUE if requires context length
298
+ */
299
+ RAC_API rac_bool_t rac_model_category_requires_context_length(rac_model_category_t category);
300
+
301
+ /**
302
+ * @brief Check if model category supports thinking/reasoning.
303
+ * Mirrors Swift's ModelCategory.supportsThinking.
304
+ *
305
+ * @param category Model category
306
+ * @return RAC_TRUE if supports thinking
307
+ */
308
+ RAC_API rac_bool_t rac_model_category_supports_thinking(rac_model_category_t category);
309
+
310
+ /**
311
+ * @brief Get model category from framework.
312
+ * Mirrors Swift's ModelCategory.from(framework:).
313
+ *
314
+ * @param framework Inference framework
315
+ * @return Model category
316
+ */
317
+ RAC_API rac_model_category_t rac_model_category_from_framework(rac_inference_framework_t framework);
318
+
319
+ /**
320
+ * @brief Get supported formats for a framework.
321
+ * Mirrors Swift's InferenceFramework.supportedFormats.
322
+ *
323
+ * @param framework Inference framework
324
+ * @param out_formats Output: Array of supported formats
325
+ * @param out_count Output: Number of formats
326
+ * @return RAC_SUCCESS or error code
327
+ */
328
+ RAC_API rac_result_t rac_framework_get_supported_formats(rac_inference_framework_t framework,
329
+ rac_model_format_t** out_formats,
330
+ size_t* out_count);
331
+
332
+ /**
333
+ * @brief Check if framework supports a format.
334
+ * Mirrors Swift's InferenceFramework.supports(format:).
335
+ *
336
+ * @param framework Inference framework
337
+ * @param format Model format
338
+ * @return RAC_TRUE if supported
339
+ */
340
+ RAC_API rac_bool_t rac_framework_supports_format(rac_inference_framework_t framework,
341
+ rac_model_format_t format);
342
+
343
+ /**
344
+ * @brief Check if framework uses directory-based models.
345
+ * Mirrors Swift's InferenceFramework.usesDirectoryBasedModels.
346
+ *
347
+ * @param framework Inference framework
348
+ * @return RAC_TRUE if uses directory-based models
349
+ */
350
+ RAC_API rac_bool_t rac_framework_uses_directory_based_models(rac_inference_framework_t framework);
351
+
352
+ /**
353
+ * @brief Check if framework supports LLM.
354
+ * Mirrors Swift's InferenceFramework.supportsLLM.
355
+ *
356
+ * @param framework Inference framework
357
+ * @return RAC_TRUE if supports LLM
358
+ */
359
+ RAC_API rac_bool_t rac_framework_supports_llm(rac_inference_framework_t framework);
360
+
361
+ /**
362
+ * @brief Check if framework supports STT.
363
+ * Mirrors Swift's InferenceFramework.supportsSTT.
364
+ *
365
+ * @param framework Inference framework
366
+ * @return RAC_TRUE if supports STT
367
+ */
368
+ RAC_API rac_bool_t rac_framework_supports_stt(rac_inference_framework_t framework);
369
+
370
+ /**
371
+ * @brief Check if framework supports TTS.
372
+ * Mirrors Swift's InferenceFramework.supportsTTS.
373
+ *
374
+ * @param framework Inference framework
375
+ * @return RAC_TRUE if supports TTS
376
+ */
377
+ RAC_API rac_bool_t rac_framework_supports_tts(rac_inference_framework_t framework);
378
+
379
+ /**
380
+ * @brief Get framework display name.
381
+ * Mirrors Swift's InferenceFramework.displayName.
382
+ *
383
+ * @param framework Inference framework
384
+ * @return Display name string
385
+ */
386
+ RAC_API const char* rac_framework_display_name(rac_inference_framework_t framework);
387
+
388
+ /**
389
+ * @brief Get framework analytics key.
390
+ * Mirrors Swift's InferenceFramework.analyticsKey.
391
+ *
392
+ * @param framework Inference framework
393
+ * @return Analytics key string (snake_case)
394
+ */
395
+ RAC_API const char* rac_framework_analytics_key(rac_inference_framework_t framework);
396
+
397
+ /**
398
+ * @brief Check if artifact requires extraction.
399
+ * Mirrors Swift's ModelArtifactType.requiresExtraction.
400
+ *
401
+ * @param artifact Artifact info
402
+ * @return RAC_TRUE if requires extraction
403
+ */
404
+ RAC_API rac_bool_t rac_artifact_requires_extraction(const rac_model_artifact_info_t* artifact);
405
+
406
+ /**
407
+ * @brief Check if artifact requires download.
408
+ * Mirrors Swift's ModelArtifactType.requiresDownload.
409
+ *
410
+ * @param artifact Artifact info
411
+ * @return RAC_TRUE if requires download
412
+ */
413
+ RAC_API rac_bool_t rac_artifact_requires_download(const rac_model_artifact_info_t* artifact);
414
+
415
+ /**
416
+ * @brief Infer artifact type from URL.
417
+ * Mirrors Swift's ModelArtifactType.infer(from:format:).
418
+ *
419
+ * @param url Download URL (can be NULL)
420
+ * @param format Model format
421
+ * @param out_artifact Output: Inferred artifact info
422
+ * @return RAC_SUCCESS or error code
423
+ */
424
+ RAC_API rac_result_t rac_artifact_infer_from_url(const char* url, rac_model_format_t format,
425
+ rac_model_artifact_info_t* out_artifact);
426
+
427
+ /**
428
+ * @brief Check if model is downloaded and available.
429
+ * Mirrors Swift's ModelInfo.isDownloaded.
430
+ *
431
+ * @param model Model info
432
+ * @return RAC_TRUE if downloaded
433
+ */
434
+ RAC_API rac_bool_t rac_model_info_is_downloaded(const rac_model_info_t* model);
435
+
436
+ // =============================================================================
437
+ // FORMAT DETECTION - From RegistryService.swift
438
+ // =============================================================================
439
+
440
+ /**
441
+ * @brief Detect model format from file extension.
442
+ * Ported from Swift RegistryService.detectFormatFromExtension() (lines 330-338)
443
+ *
444
+ * @param extension File extension (without dot, e.g., "onnx", "gguf")
445
+ * @param out_format Output: Detected format
446
+ * @return RAC_TRUE if format detected, RAC_FALSE if unknown
447
+ */
448
+ RAC_API rac_bool_t rac_model_detect_format_from_extension(const char* extension,
449
+ rac_model_format_t* out_format);
450
+
451
+ /**
452
+ * @brief Detect framework from model format.
453
+ * Ported from Swift RegistryService.detectFramework(for:) (lines 340-343)
454
+ *
455
+ * @param format Model format
456
+ * @param out_framework Output: Detected framework
457
+ * @return RAC_TRUE if framework detected, RAC_FALSE if unknown
458
+ */
459
+ RAC_API rac_bool_t rac_model_detect_framework_from_format(rac_model_format_t format,
460
+ rac_inference_framework_t* out_framework);
461
+
462
+ /**
463
+ * @brief Get file extension string for a model format.
464
+ * Mirrors Swift's ModelFormat.fileExtension.
465
+ *
466
+ * @param format Model format
467
+ * @return Extension string (e.g., "onnx", "gguf") or NULL if unknown
468
+ */
469
+ RAC_API const char* rac_model_format_extension(rac_model_format_t format);
470
+
471
+ // =============================================================================
472
+ // MODEL ID/NAME GENERATION - From RegistryService.swift
473
+ // =============================================================================
474
+
475
+ /**
476
+ * @brief Generate model ID from URL by stripping known extensions.
477
+ * Ported from Swift RegistryService.generateModelId(from:) (lines 311-318)
478
+ *
479
+ * @param url URL path string (e.g., "model.tar.gz", "llama-7b.gguf")
480
+ * @param out_id Output buffer for model ID
481
+ * @param max_len Maximum length of output buffer
482
+ */
483
+ RAC_API void rac_model_generate_id(const char* url, char* out_id, size_t max_len);
484
+
485
+ /**
486
+ * @brief Generate human-readable model name from URL.
487
+ * Ported from Swift RegistryService.generateModelName(from:) (lines 320-324)
488
+ * Replaces underscores and dashes with spaces.
489
+ *
490
+ * @param url URL path string
491
+ * @param out_name Output buffer for model name
492
+ * @param max_len Maximum length of output buffer
493
+ */
494
+ RAC_API void rac_model_generate_name(const char* url, char* out_name, size_t max_len);
495
+
496
+ // =============================================================================
497
+ // MODEL FILTERING - From RegistryService.swift
498
+ // =============================================================================
499
+
500
+ /**
501
+ * @brief Model filtering criteria.
502
+ * Mirrors Swift's ModelCriteria struct.
503
+ */
504
+ typedef struct rac_model_filter {
505
+ /** Filter by framework (RAC_FRAMEWORK_UNKNOWN = any) */
506
+ rac_inference_framework_t framework;
507
+
508
+ /** Filter by format (RAC_MODEL_FORMAT_UNKNOWN = any) */
509
+ rac_model_format_t format;
510
+
511
+ /** Maximum download size in bytes (0 = no limit) */
512
+ int64_t max_size;
513
+
514
+ /** Search query for name/id/description (NULL = no search filter) */
515
+ const char* search_query;
516
+ } rac_model_filter_t;
517
+
518
+ /**
519
+ * @brief Filter models by criteria.
520
+ * Ported from Swift RegistryService.filterModels(by:) (lines 104-126)
521
+ *
522
+ * @param models Array of models to filter
523
+ * @param models_count Number of models in input array
524
+ * @param filter Filter criteria (NULL = no filtering, return all)
525
+ * @param out_models Output array for filtered models (caller allocates)
526
+ * @param out_capacity Maximum capacity of output array
527
+ * @return Number of models that passed the filter (may exceed out_capacity)
528
+ */
529
+ RAC_API size_t rac_model_filter_models(const rac_model_info_t* models, size_t models_count,
530
+ const rac_model_filter_t* filter,
531
+ rac_model_info_t* out_models, size_t out_capacity);
532
+
533
+ /**
534
+ * @brief Check if a model matches filter criteria.
535
+ * Helper function for filtering.
536
+ *
537
+ * @param model Model to check
538
+ * @param filter Filter criteria
539
+ * @return RAC_TRUE if model matches, RAC_FALSE otherwise
540
+ */
541
+ RAC_API rac_bool_t rac_model_matches_filter(const rac_model_info_t* model,
542
+ const rac_model_filter_t* filter);
543
+
544
+ // =============================================================================
545
+ // MEMORY MANAGEMENT
546
+ // =============================================================================
547
+
548
+ /**
549
+ * @brief Allocate expected model files structure.
550
+ *
551
+ * @return Allocated structure (must be freed with rac_expected_model_files_free)
552
+ */
553
+ RAC_API rac_expected_model_files_t* rac_expected_model_files_alloc(void);
554
+
555
+ /**
556
+ * @brief Free expected model files structure.
557
+ *
558
+ * @param files Structure to free
559
+ */
560
+ RAC_API void rac_expected_model_files_free(rac_expected_model_files_t* files);
561
+
562
+ /**
563
+ * @brief Allocate model file descriptor array.
564
+ *
565
+ * @param count Number of descriptors
566
+ * @return Allocated array (must be freed with rac_model_file_descriptors_free)
567
+ */
568
+ RAC_API rac_model_file_descriptor_t* rac_model_file_descriptors_alloc(size_t count);
569
+
570
+ /**
571
+ * @brief Free model file descriptor array.
572
+ *
573
+ * @param descriptors Array to free
574
+ * @param count Number of descriptors
575
+ */
576
+ RAC_API void rac_model_file_descriptors_free(rac_model_file_descriptor_t* descriptors,
577
+ size_t count);
578
+
579
+ /**
580
+ * @brief Allocate model info structure.
581
+ *
582
+ * @return Allocated structure (must be freed with rac_model_info_free)
583
+ */
584
+ RAC_API rac_model_info_t* rac_model_info_alloc(void);
585
+
586
+ /**
587
+ * @brief Free model info structure.
588
+ *
589
+ * @param model Model info to free
590
+ */
591
+ RAC_API void rac_model_info_free(rac_model_info_t* model);
592
+
593
+ /**
594
+ * @brief Free array of model info pointers.
595
+ *
596
+ * @param models Array of model info pointers
597
+ * @param count Number of models
598
+ */
599
+ RAC_API void rac_model_info_array_free(rac_model_info_t** models, size_t count);
600
+
601
+ /**
602
+ * @brief Deep copy model info structure.
603
+ *
604
+ * @param model Model info to copy
605
+ * @return Deep copy (must be freed with rac_model_info_free)
606
+ */
607
+ RAC_API rac_model_info_t* rac_model_info_copy(const rac_model_info_t* model);
608
+
609
+ #ifdef __cplusplus
610
+ }
611
+ #endif
612
+
613
+ #endif /* RAC_MODEL_TYPES_H */