cactus-react-native 0.2.11 → 1.0.2

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 (510) hide show
  1. package/Cactus.podspec +34 -0
  2. package/LICENSE +38 -0
  3. package/README.md +550 -69
  4. package/android/CMakeLists.txt +40 -0
  5. package/android/build.gradle +68 -44
  6. package/android/gradle.properties +5 -5
  7. package/android/src/main/AndroidManifest.xml +1 -3
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/cactus/CactusPackage.kt +22 -0
  10. package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +38 -0
  11. package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +24 -0
  12. package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusFileSystem.kt +227 -0
  13. package/android/src/main/jniLibs/arm64-v8a/{libcactus_v8.so → libcactus.a} +0 -0
  14. package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
  15. package/cpp/HybridCactus.cpp +135 -0
  16. package/cpp/HybridCactus.hpp +42 -0
  17. package/cpp/HybridCactusUtil.cpp +47 -0
  18. package/cpp/HybridCactusUtil.hpp +26 -0
  19. package/cpp/cactus_ffi.h +55 -0
  20. package/cpp/cactus_util.h +25 -0
  21. package/ios/HybridCactusCrypto.swift +37 -0
  22. package/ios/HybridCactusDeviceInfo.swift +32 -0
  23. package/ios/HybridCactusFileSystem.swift +234 -0
  24. package/ios/cactus.xcframework/{info.plist → Info.plist} +2 -37
  25. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +8 -229
  26. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +28 -229
  27. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +545 -0
  28. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +400 -0
  29. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +338 -0
  30. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +275 -0
  31. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +343 -0
  32. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
  33. package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
  34. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +11 -0
  35. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +55 -0
  36. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +545 -0
  37. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +400 -0
  38. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +338 -0
  39. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +275 -0
  40. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +343 -0
  41. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
  42. package/ios/cactus.xcframework/{tvos-arm64_x86_64-simulator → ios-arm64-simulator}/cactus.framework/_CodeSignature/CodeResources +1 -1
  43. package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
  44. package/ios/cactus_util.xcframework/Info.plist +39 -0
  45. package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +25 -0
  46. package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +10 -0
  47. package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +25 -0
  48. package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
  49. package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
  50. package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +25 -0
  51. package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +10 -0
  52. package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +25 -0
  53. package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/Info.plist +0 -0
  54. package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/_CodeSignature/CodeResources +36 -2
  55. package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
  56. package/lib/module/api/Database.js +60 -0
  57. package/lib/module/api/Database.js.map +1 -0
  58. package/lib/module/classes/CactusLM.js +151 -0
  59. package/lib/module/classes/CactusLM.js.map +1 -0
  60. package/lib/module/config/CactusConfig.js +6 -0
  61. package/lib/module/config/CactusConfig.js.map +1 -0
  62. package/lib/module/constants/packageVersion.js +4 -0
  63. package/lib/module/constants/packageVersion.js.map +1 -0
  64. package/lib/module/hooks/useCactusLM.js +238 -0
  65. package/lib/module/hooks/useCactusLM.js.map +1 -0
  66. package/lib/module/index.js +9 -409
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/native/Cactus.js +50 -0
  69. package/lib/module/native/Cactus.js.map +1 -0
  70. package/lib/module/native/CactusCrypto.js +10 -0
  71. package/lib/module/native/CactusCrypto.js.map +1 -0
  72. package/lib/module/native/CactusDeviceInfo.js +13 -0
  73. package/lib/module/native/CactusDeviceInfo.js.map +1 -0
  74. package/lib/module/native/CactusFileSystem.js +35 -0
  75. package/lib/module/native/CactusFileSystem.js.map +1 -0
  76. package/lib/module/native/CactusUtil.js +23 -0
  77. package/lib/module/native/CactusUtil.js.map +1 -0
  78. package/lib/module/native/index.js +8 -0
  79. package/lib/module/native/index.js.map +1 -0
  80. package/lib/module/specs/Cactus.nitro.js +4 -0
  81. package/lib/module/specs/Cactus.nitro.js.map +1 -0
  82. package/lib/module/specs/CactusCrypto.nitro.js +4 -0
  83. package/lib/module/specs/CactusCrypto.nitro.js.map +1 -0
  84. package/lib/module/specs/CactusDeviceInfo.nitro.js +4 -0
  85. package/lib/module/specs/CactusDeviceInfo.nitro.js.map +1 -0
  86. package/lib/module/specs/CactusFileSystem.nitro.js +4 -0
  87. package/lib/module/specs/CactusFileSystem.nitro.js.map +1 -0
  88. package/lib/module/specs/CactusUtil.nitro.js +4 -0
  89. package/lib/module/specs/CactusUtil.nitro.js.map +1 -0
  90. package/lib/module/telemetry/Telemetry.js +100 -0
  91. package/lib/module/telemetry/Telemetry.js.map +1 -0
  92. package/lib/module/types/CactusLM.js +2 -0
  93. package/lib/module/types/CactusLM.js.map +1 -0
  94. package/lib/module/types/CactusModel.js +2 -0
  95. package/lib/module/types/CactusModel.js.map +1 -0
  96. package/lib/module/utils/error.js +4 -0
  97. package/lib/module/utils/error.js.map +1 -0
  98. package/lib/typescript/package.json +1 -0
  99. package/lib/typescript/src/api/Database.d.ts +11 -0
  100. package/lib/typescript/src/api/Database.d.ts.map +1 -0
  101. package/lib/typescript/src/classes/CactusLM.d.ts +26 -0
  102. package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -0
  103. package/lib/typescript/src/config/CactusConfig.d.ts +5 -0
  104. package/lib/typescript/src/config/CactusConfig.d.ts.map +1 -0
  105. package/lib/typescript/src/constants/packageVersion.d.ts +2 -0
  106. package/lib/typescript/src/constants/packageVersion.d.ts.map +1 -0
  107. package/lib/typescript/src/hooks/useCactusLM.d.ts +20 -0
  108. package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -0
  109. package/lib/typescript/src/index.d.ts +6 -0
  110. package/lib/typescript/src/index.d.ts.map +1 -0
  111. package/lib/typescript/src/native/Cactus.d.ts +11 -0
  112. package/lib/typescript/src/native/Cactus.d.ts.map +1 -0
  113. package/lib/typescript/src/native/CactusCrypto.d.ts +5 -0
  114. package/lib/typescript/src/native/CactusCrypto.d.ts.map +1 -0
  115. package/lib/typescript/src/native/CactusDeviceInfo.d.ts +7 -0
  116. package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +1 -0
  117. package/lib/typescript/src/native/CactusFileSystem.d.ts +13 -0
  118. package/lib/typescript/src/native/CactusFileSystem.d.ts.map +1 -0
  119. package/lib/typescript/src/native/CactusUtil.d.ts +6 -0
  120. package/lib/typescript/src/native/CactusUtil.d.ts.map +1 -0
  121. package/lib/typescript/src/native/index.d.ts +6 -0
  122. package/lib/typescript/src/native/index.d.ts.map +1 -0
  123. package/lib/typescript/src/specs/Cactus.nitro.d.ts +13 -0
  124. package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -0
  125. package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +8 -0
  126. package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +1 -0
  127. package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +16 -0
  128. package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +1 -0
  129. package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts +16 -0
  130. package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts.map +1 -0
  131. package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +10 -0
  132. package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +1 -0
  133. package/lib/typescript/src/telemetry/Telemetry.d.ts +30 -0
  134. package/lib/typescript/src/telemetry/Telemetry.d.ts.map +1 -0
  135. package/lib/typescript/src/types/CactusLM.d.ts +67 -0
  136. package/lib/typescript/src/types/CactusLM.d.ts.map +1 -0
  137. package/lib/typescript/src/types/CactusModel.d.ts +12 -0
  138. package/lib/typescript/src/types/CactusModel.d.ts.map +1 -0
  139. package/lib/typescript/src/utils/error.d.ts +2 -0
  140. package/lib/typescript/src/utils/error.d.ts.map +1 -0
  141. package/nitro.json +31 -0
  142. package/nitrogen/generated/android/c++/JDeviceInfo.hpp +74 -0
  143. package/nitrogen/generated/android/c++/JFunc_void_double.hpp +74 -0
  144. package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +65 -0
  145. package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +65 -0
  146. package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +85 -0
  147. package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +66 -0
  148. package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.cpp +192 -0
  149. package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.hpp +73 -0
  150. package/nitrogen/generated/android/cactus+autolinking.cmake +87 -0
  151. package/nitrogen/generated/android/cactus+autolinking.gradle +27 -0
  152. package/nitrogen/generated/android/cactusOnLoad.cpp +86 -0
  153. package/nitrogen/generated/android/cactusOnLoad.hpp +25 -0
  154. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +50 -0
  155. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/Func_void_double.kt +80 -0
  156. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +58 -0
  157. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +62 -0
  158. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusFileSystemSpec.kt +95 -0
  159. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/cactusOnLoad.kt +35 -0
  160. package/nitrogen/generated/ios/Cactus+autolinking.rb +60 -0
  161. package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +122 -0
  162. package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +373 -0
  163. package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +60 -0
  164. package/nitrogen/generated/ios/CactusAutolinking.mm +69 -0
  165. package/nitrogen/generated/ios/CactusAutolinking.swift +55 -0
  166. package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +11 -0
  167. package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +77 -0
  168. package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +11 -0
  169. package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +88 -0
  170. package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.cpp +11 -0
  171. package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.hpp +143 -0
  172. package/nitrogen/generated/ios/swift/DeviceInfo.swift +98 -0
  173. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  174. package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +47 -0
  175. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  176. package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  177. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  178. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
  179. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  180. package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +57 -0
  181. package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +139 -0
  182. package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +58 -0
  183. package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +164 -0
  184. package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec.swift +65 -0
  185. package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec_cxx.swift +303 -0
  186. package/nitrogen/generated/shared/c++/DeviceInfo.hpp +92 -0
  187. package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +21 -0
  188. package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +63 -0
  189. package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +22 -0
  190. package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +67 -0
  191. package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.cpp +29 -0
  192. package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.hpp +73 -0
  193. package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +26 -0
  194. package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +71 -0
  195. package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +23 -0
  196. package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +66 -0
  197. package/package.json +84 -143
  198. package/src/api/Database.ts +83 -0
  199. package/src/classes/CactusLM.ts +205 -0
  200. package/src/config/CactusConfig.ts +4 -0
  201. package/src/constants/packageVersion.ts +1 -0
  202. package/src/hooks/useCactusLM.ts +285 -0
  203. package/src/index.tsx +23 -0
  204. package/src/native/Cactus.ts +83 -0
  205. package/src/native/CactusCrypto.ts +11 -0
  206. package/src/native/CactusDeviceInfo.ts +18 -0
  207. package/src/native/CactusFileSystem.ts +47 -0
  208. package/src/native/CactusUtil.ts +27 -0
  209. package/src/native/index.ts +5 -0
  210. package/src/specs/Cactus.nitro.ts +20 -0
  211. package/src/specs/CactusCrypto.nitro.ts +6 -0
  212. package/src/specs/CactusDeviceInfo.nitro.ts +15 -0
  213. package/src/specs/CactusFileSystem.nitro.ts +21 -0
  214. package/src/specs/CactusUtil.nitro.ts +8 -0
  215. package/src/telemetry/Telemetry.ts +159 -0
  216. package/src/types/CactusLM.ts +73 -0
  217. package/src/types/CactusModel.ts +14 -0
  218. package/src/utils/error.ts +2 -0
  219. package/LICENSE.txt +0 -20
  220. package/android/src/main/CMakeLists.txt +0 -140
  221. package/android/src/main/java/com/cactus/Cactus.java +0 -1190
  222. package/android/src/main/java/com/cactus/CactusPackage.java +0 -48
  223. package/android/src/main/java/com/cactus/LlamaContext.java +0 -748
  224. package/android/src/main/jni-utils.h +0 -100
  225. package/android/src/main/jni.cpp +0 -1605
  226. package/android/src/main/jniLibs/arm64-v8a/libcactus.so +0 -0
  227. package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2.so +0 -0
  228. package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod.so +0 -0
  229. package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod_i8mm.so +0 -0
  230. package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_i8mm.so +0 -0
  231. package/android/src/newarch/java/com/cactus/CactusModule.java +0 -204
  232. package/android/src/oldarch/java/com/cactus/CactusModule.java +0 -205
  233. package/cactus-react-native.podspec +0 -42
  234. package/ios/CMakeLists.txt +0 -131
  235. package/ios/Cactus.h +0 -6
  236. package/ios/Cactus.mm +0 -681
  237. package/ios/CactusContext.h +0 -81
  238. package/ios/CactusContext.mm +0 -1032
  239. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/chat.h +0 -145
  240. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/common.h +0 -674
  241. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
  242. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
  243. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
  244. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
  245. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
  246. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
  247. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
  248. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
  249. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
  250. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
  251. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
  252. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
  253. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml.h +0 -2202
  254. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gguf.h +0 -202
  255. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
  256. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json.hpp +0 -24766
  257. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
  258. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-arch.h +0 -437
  259. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-batch.h +0 -89
  260. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-chat.h +0 -58
  261. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-context.h +0 -276
  262. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
  263. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
  264. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
  265. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-graph.h +0 -640
  266. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
  267. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-impl.h +0 -61
  268. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-io.h +0 -35
  269. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
  270. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-memory.h +0 -32
  271. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
  272. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
  273. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
  274. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model.h +0 -425
  275. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
  276. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
  277. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama.h +0 -1376
  278. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/log.h +0 -103
  279. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
  280. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
  281. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/sampling.h +0 -107
  282. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode-data.h +0 -20
  283. package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode.h +0 -66
  284. package/ios/cactus.xcframework/ios-arm64/cactus.framework/ggml-llama.metallib +0 -0
  285. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
  286. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
  287. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
  288. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
  289. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
  290. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
  291. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
  292. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
  293. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
  294. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
  295. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
  296. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
  297. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
  298. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
  299. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
  300. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
  301. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
  302. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
  303. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
  304. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
  305. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
  306. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
  307. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
  308. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
  309. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
  310. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
  311. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
  312. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
  313. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
  314. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
  315. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
  316. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
  317. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
  318. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
  319. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
  320. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
  321. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
  322. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
  323. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
  324. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
  325. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
  326. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
  327. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
  328. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
  329. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
  330. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
  331. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
  332. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
  333. package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
  334. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus.h +0 -232
  335. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus_ffi.h +0 -256
  336. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/chat.h +0 -145
  337. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/common.h +0 -674
  338. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
  339. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
  340. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
  341. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
  342. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
  343. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
  344. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
  345. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
  346. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
  347. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
  348. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
  349. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
  350. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml.h +0 -2202
  351. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/gguf.h +0 -202
  352. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
  353. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json.hpp +0 -24766
  354. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
  355. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-arch.h +0 -437
  356. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-batch.h +0 -89
  357. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-chat.h +0 -58
  358. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-context.h +0 -276
  359. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
  360. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
  361. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
  362. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-graph.h +0 -640
  363. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
  364. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-impl.h +0 -61
  365. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-io.h +0 -35
  366. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
  367. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-memory.h +0 -32
  368. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
  369. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
  370. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
  371. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model.h +0 -425
  372. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
  373. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
  374. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama.h +0 -1376
  375. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/log.h +0 -103
  376. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
  377. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
  378. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/sampling.h +0 -107
  379. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode-data.h +0 -20
  380. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode.h +0 -66
  381. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Info.plist +0 -0
  382. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/cactus +0 -0
  383. package/ios/cactus.xcframework/tvos-arm64/cactus.framework/ggml-llama.metallib +0 -0
  384. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
  385. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
  386. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
  387. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
  388. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
  389. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
  390. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
  391. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
  392. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
  393. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
  394. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
  395. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
  396. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
  397. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
  398. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
  399. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
  400. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
  401. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
  402. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
  403. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
  404. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
  405. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
  406. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
  407. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
  408. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
  409. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
  410. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
  411. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
  412. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
  413. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
  414. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
  415. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
  416. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
  417. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
  418. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
  419. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
  420. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
  421. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
  422. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
  423. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
  424. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
  425. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
  426. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
  427. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
  428. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
  429. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
  430. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
  431. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Info.plist +0 -0
  432. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
  433. package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
  434. package/lib/commonjs/NativeCactus.js +0 -9
  435. package/lib/commonjs/NativeCactus.js.map +0 -1
  436. package/lib/commonjs/agent.js +0 -73
  437. package/lib/commonjs/agent.js.map +0 -1
  438. package/lib/commonjs/chat.js +0 -73
  439. package/lib/commonjs/chat.js.map +0 -1
  440. package/lib/commonjs/index.js +0 -523
  441. package/lib/commonjs/index.js.map +0 -1
  442. package/lib/commonjs/lm.js +0 -272
  443. package/lib/commonjs/lm.js.map +0 -1
  444. package/lib/commonjs/package.json +0 -1
  445. package/lib/commonjs/projectId.js +0 -9
  446. package/lib/commonjs/projectId.js.map +0 -1
  447. package/lib/commonjs/remote.js +0 -100
  448. package/lib/commonjs/remote.js.map +0 -1
  449. package/lib/commonjs/telemetry.js +0 -102
  450. package/lib/commonjs/telemetry.js.map +0 -1
  451. package/lib/commonjs/tools.js +0 -72
  452. package/lib/commonjs/tools.js.map +0 -1
  453. package/lib/commonjs/tts.js +0 -141
  454. package/lib/commonjs/tts.js.map +0 -1
  455. package/lib/commonjs/vlm.js +0 -221
  456. package/lib/commonjs/vlm.js.map +0 -1
  457. package/lib/module/NativeCactus.js +0 -5
  458. package/lib/module/NativeCactus.js.map +0 -1
  459. package/lib/module/agent.js +0 -68
  460. package/lib/module/agent.js.map +0 -1
  461. package/lib/module/chat.js +0 -67
  462. package/lib/module/chat.js.map +0 -1
  463. package/lib/module/lm.js +0 -267
  464. package/lib/module/lm.js.map +0 -1
  465. package/lib/module/projectId.js +0 -5
  466. package/lib/module/projectId.js.map +0 -1
  467. package/lib/module/remote.js +0 -91
  468. package/lib/module/remote.js.map +0 -1
  469. package/lib/module/telemetry.js +0 -97
  470. package/lib/module/telemetry.js.map +0 -1
  471. package/lib/module/tools.js +0 -66
  472. package/lib/module/tools.js.map +0 -1
  473. package/lib/module/tts.js +0 -135
  474. package/lib/module/tts.js.map +0 -1
  475. package/lib/module/vlm.js +0 -216
  476. package/lib/module/vlm.js.map +0 -1
  477. package/lib/typescript/NativeCactus.d.ts +0 -252
  478. package/lib/typescript/NativeCactus.d.ts.map +0 -1
  479. package/lib/typescript/agent.d.ts +0 -31
  480. package/lib/typescript/agent.d.ts.map +0 -1
  481. package/lib/typescript/chat.d.ts +0 -23
  482. package/lib/typescript/chat.d.ts.map +0 -1
  483. package/lib/typescript/index.d.ts +0 -114
  484. package/lib/typescript/index.d.ts.map +0 -1
  485. package/lib/typescript/lm.d.ts +0 -36
  486. package/lib/typescript/lm.d.ts.map +0 -1
  487. package/lib/typescript/projectId.d.ts +0 -2
  488. package/lib/typescript/projectId.d.ts.map +0 -1
  489. package/lib/typescript/remote.d.ts +0 -8
  490. package/lib/typescript/remote.d.ts.map +0 -1
  491. package/lib/typescript/telemetry.d.ts +0 -25
  492. package/lib/typescript/telemetry.d.ts.map +0 -1
  493. package/lib/typescript/tools.d.ts +0 -36
  494. package/lib/typescript/tools.d.ts.map +0 -1
  495. package/lib/typescript/tts.d.ts +0 -54
  496. package/lib/typescript/tts.d.ts.map +0 -1
  497. package/lib/typescript/vlm.d.ts +0 -33
  498. package/lib/typescript/vlm.d.ts.map +0 -1
  499. package/scripts/postInstall.js +0 -33
  500. package/src/NativeCactus.ts +0 -317
  501. package/src/agent.ts +0 -112
  502. package/src/chat.ts +0 -91
  503. package/src/index.ts +0 -663
  504. package/src/lm.ts +0 -324
  505. package/src/projectId.ts +0 -1
  506. package/src/remote.ts +0 -113
  507. package/src/telemetry.ts +0 -137
  508. package/src/tools.ts +0 -94
  509. package/src/tts.ts +0 -236
  510. package/src/vlm.ts +0 -276
@@ -1,413 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import { NativeEventEmitter, DeviceEventEmitter, Platform } from 'react-native';
4
- import Cactus from './NativeCactus';
5
- import { formatChat } from './chat';
6
- import { parseAndExecuteTool } from './tools';
7
- import { Telemetry } from './telemetry';
8
- export * from './remote';
9
- export { Tools, parseAndExecuteTool } from './tools';
10
- const EVENT_ON_INIT_CONTEXT_PROGRESS = '@Cactus_onInitContextProgress';
11
- const EVENT_ON_TOKEN = '@Cactus_onToken';
12
- const EVENT_ON_NATIVE_LOG = '@Cactus_onNativeLog';
13
- let EventEmitter;
14
- if (Platform.OS === 'ios') {
15
- // @ts-ignore
16
- EventEmitter = new NativeEventEmitter(Cactus);
17
- }
18
- if (Platform.OS === 'android') {
19
- EventEmitter = DeviceEventEmitter;
20
- }
21
- const logListeners = [];
3
+ // Classes
4
+ export { CactusLM } from "./classes/CactusLM.js";
22
5
 
23
- // @ts-ignore
24
- if (EventEmitter) {
25
- EventEmitter.addListener(EVENT_ON_NATIVE_LOG, evt => {
26
- logListeners.forEach(listener => listener(evt.level, evt.text));
27
- });
28
- Cactus?.toggleNativeLog?.(false)?.catch?.(() => {});
29
- }
30
- const getJsonSchema = responseFormat => {
31
- if (responseFormat?.type === 'json_schema') {
32
- return responseFormat.json_schema?.schema;
33
- }
34
- if (responseFormat?.type === 'json_object') {
35
- return responseFormat.schema || {};
36
- }
37
- return null;
38
- };
39
- const telemetryParams = {
40
- n_gpu_layers: null,
41
- n_ctx: null,
42
- model: null
43
- };
44
- export class LlamaContext {
45
- gpu = false;
46
- reasonNoGPU = '';
47
- constructor({
48
- contextId,
49
- gpu,
50
- reasonNoGPU,
51
- model
52
- }) {
53
- this.id = contextId;
54
- this.gpu = gpu;
55
- this.reasonNoGPU = reasonNoGPU;
56
- this.model = model;
57
- }
58
- async loadSession(filepath) {
59
- let path = filepath;
60
- if (path.startsWith('file://')) path = path.slice(7);
61
- return Cactus.loadSession(this.id, path);
62
- }
63
- async saveSession(filepath, options) {
64
- return Cactus.saveSession(this.id, filepath, options?.tokenSize || -1);
65
- }
66
- isLlamaChatSupported() {
67
- return !!this.model.chatTemplates.llamaChat;
68
- }
69
- isJinjaSupported() {
70
- const {
71
- minja
72
- } = this.model.chatTemplates;
73
- return !!minja?.toolUse || !!minja?.default;
74
- }
75
- async getFormattedChat(messages, template, params) {
76
- const chat = formatChat(messages);
77
- const useJinja = this.isJinjaSupported() && params?.jinja;
78
- let tmpl = this.isLlamaChatSupported() || useJinja ? undefined : 'chatml';
79
- if (template) tmpl = template; // Force replace if provided
80
- const jsonSchema = getJsonSchema(params?.response_format);
81
- return Cactus.getFormattedChat(this.id, JSON.stringify(chat), tmpl, {
82
- jinja: useJinja,
83
- json_schema: jsonSchema ? JSON.stringify(jsonSchema) : undefined,
84
- tools: params?.tools ? JSON.stringify(params.tools) : undefined,
85
- parallel_tool_calls: params?.parallel_tool_calls ? JSON.stringify(params.parallel_tool_calls) : undefined,
86
- tool_choice: params?.tool_choice
87
- });
88
- }
89
- async completionWithTools(params, callback, recursionCount = 0, recursionLimit = 3) {
90
- if (!params.messages) {
91
- return this.completion(params, callback);
92
- }
93
- if (!params.tools) {
94
- return this.completion(params, callback);
95
- }
96
- if (recursionCount >= recursionLimit) {
97
- return this.completion({
98
- ...params,
99
- jinja: true,
100
- tools: params.tools.getSchemas()
101
- }, callback);
102
- }
103
- const messages = [...params.messages];
104
- const result = await this.completion({
105
- ...params,
106
- messages: messages,
107
- jinja: true,
108
- tools: params.tools.getSchemas()
109
- }, callback);
110
- const {
111
- toolCalled,
112
- toolName,
113
- toolInput,
114
- toolOutput
115
- } = await parseAndExecuteTool(result, params.tools);
116
- if (toolCalled && toolName && toolInput) {
117
- const assistantMessage = {
118
- role: 'assistant',
119
- content: result.content,
120
- tool_calls: result.tool_calls
121
- };
122
- messages.push(assistantMessage);
123
- const toolCallId = result.tool_calls?.[0]?.id;
124
- const toolMessage = {
125
- role: 'tool',
126
- content: JSON.stringify(toolOutput),
127
- tool_call_id: toolCallId
128
- };
129
- messages.push(toolMessage);
130
- return await this.completionWithTools({
131
- ...params,
132
- messages: messages
133
- }, callback, recursionCount + 1, recursionLimit);
134
- }
135
- return result;
136
- }
137
- async completion(params, callback) {
138
- const nativeParams = {
139
- ...params,
140
- prompt: params.prompt || '',
141
- emit_partial_completion: !!callback
142
- };
143
- if (params.messages) {
144
- const formattedResult = await this.getFormattedChat(params.messages, params.chat_template || params.chatTemplate, {
145
- jinja: params.jinja,
146
- tools: params.tools,
147
- parallel_tool_calls: params.parallel_tool_calls,
148
- tool_choice: params.tool_choice
149
- });
150
- if (typeof formattedResult === 'string') {
151
- nativeParams.prompt = formattedResult || '';
152
- } else {
153
- nativeParams.prompt = formattedResult.prompt || '';
154
- if (typeof formattedResult.chat_format === 'number') nativeParams.chat_format = formattedResult.chat_format;
155
- if (formattedResult.grammar) nativeParams.grammar = formattedResult.grammar;
156
- if (typeof formattedResult.grammar_lazy === 'boolean') nativeParams.grammar_lazy = formattedResult.grammar_lazy;
157
- if (formattedResult.grammar_triggers) nativeParams.grammar_triggers = formattedResult.grammar_triggers;
158
- if (formattedResult.preserved_tokens) nativeParams.preserved_tokens = formattedResult.preserved_tokens;
159
- if (formattedResult.additional_stops) {
160
- if (!nativeParams.stop) nativeParams.stop = [];
161
- nativeParams.stop.push(...formattedResult.additional_stops);
162
- }
163
- }
164
- } else {
165
- nativeParams.prompt = params.prompt || '';
166
- }
167
- if (nativeParams.response_format && !nativeParams.grammar) {
168
- const jsonSchema = getJsonSchema(params.response_format);
169
- if (jsonSchema) nativeParams.json_schema = JSON.stringify(jsonSchema);
170
- }
171
- const startTime = Date.now();
172
- let firstTokenTime = null;
173
- const deviceInfo = await getDeviceInfo(this.id);
174
- const wrappedCallback = callback ? data => {
175
- if (firstTokenTime === null) firstTokenTime = Date.now();
176
- callback(data);
177
- } : undefined;
178
- let tokenListener = wrappedCallback && EventEmitter.addListener(EVENT_ON_TOKEN, evt => {
179
- const {
180
- contextId,
181
- tokenResult
182
- } = evt;
183
- if (contextId !== this.id) return;
184
- wrappedCallback(tokenResult);
185
- });
186
- if (!nativeParams.prompt) throw new Error('Prompt is required');
187
- const promise = Cactus.completion(this.id, nativeParams);
188
- return promise.then(completionResult => {
189
- Telemetry.track({
190
- event: 'completion',
191
- tok_per_sec: completionResult.timings?.predicted_per_second,
192
- toks_generated: completionResult.timings?.predicted_n,
193
- ttft: firstTokenTime ? firstTokenTime - startTime : null
194
- }, telemetryParams, deviceInfo);
195
- tokenListener?.remove();
196
- tokenListener = null;
197
- return completionResult;
198
- }).catch(err => {
199
- tokenListener?.remove();
200
- tokenListener = null;
201
- throw err;
202
- });
203
- }
204
- stopCompletion() {
205
- return Cactus.stopCompletion(this.id);
206
- }
207
- tokenize(text) {
208
- return Cactus.tokenize(this.id, text);
209
- }
210
- detokenize(tokens) {
211
- return Cactus.detokenize(this.id, tokens);
212
- }
213
- async embedding(text, params) {
214
- const startTime = Date.now();
215
- const embeddingResult = await Cactus.embedding(this.id, text, params || {});
216
- const totalTime = Date.now() - startTime;
217
- const deviceInfo = await getDeviceInfo(this.id);
218
- Telemetry.track({
219
- event: 'embedding',
220
- mode: 'local',
221
- embedding_time: totalTime
222
- }, telemetryParams, deviceInfo);
223
- return embeddingResult;
224
- }
225
- async bench(pp, tg, pl, nr) {
226
- const result = await Cactus.bench(this.id, pp, tg, pl, nr);
227
- const [modelDesc, modelSize, modelNParams, ppAvg, ppStd, tgAvg, tgStd] = JSON.parse(result);
228
- return {
229
- modelDesc,
230
- modelSize,
231
- modelNParams,
232
- ppAvg,
233
- ppStd,
234
- tgAvg,
235
- tgStd
236
- };
237
- }
238
- async applyLoraAdapters(loraList) {
239
- let loraAdapters = [];
240
- if (loraList) loraAdapters = loraList.map(l => ({
241
- path: l.path.replace(/file:\/\//, ''),
242
- scaled: l.scaled
243
- }));
244
- return Cactus.applyLoraAdapters(this.id, loraAdapters);
245
- }
246
- async removeLoraAdapters() {
247
- return Cactus.removeLoraAdapters(this.id);
248
- }
249
- async getLoadedLoraAdapters() {
250
- return Cactus.getLoadedLoraAdapters(this.id);
251
- }
252
- async release() {
253
- return Cactus.releaseContext(this.id);
254
- }
255
- async rewind() {
256
- return Cactus.rewind(this.id);
257
- }
258
- }
259
- export async function toggleNativeLog(enabled) {
260
- return Cactus.toggleNativeLog(enabled);
261
- }
262
- export function addNativeLogListener(listener) {
263
- logListeners.push(listener);
264
- return {
265
- remove: () => {
266
- logListeners.splice(logListeners.indexOf(listener), 1);
267
- }
268
- };
269
- }
270
- export async function setContextLimit(limit) {
271
- return Cactus.setContextLimit(limit);
272
- }
273
- let contextIdCounter = 0;
274
- const contextIdRandom = () => process.env.NODE_ENV === 'test' ? 0 : Math.floor(Math.random() * 100000);
275
- const modelInfoSkip = [
276
- // Large fields
277
- 'tokenizer.ggml.tokens', 'tokenizer.ggml.token_type', 'tokenizer.ggml.merges', 'tokenizer.ggml.scores'];
278
- export async function loadLlamaModelInfo(model) {
279
- let path = model;
280
- if (path.startsWith('file://')) path = path.slice(7);
281
- return Cactus.modelInfo(path, modelInfoSkip);
282
- }
283
- const poolTypeMap = {
284
- none: 0,
285
- mean: 1,
286
- cls: 2,
287
- last: 3,
288
- rank: 4
289
- };
290
- export async function initLlama({
291
- model,
292
- is_model_asset: isModelAsset,
293
- pooling_type: poolingType,
294
- lora,
295
- lora_list: loraList,
296
- ...rest
297
- }, onProgress) {
298
- let path = model;
299
- if (path.startsWith('file://')) path = path.slice(7);
300
- let loraPath = lora;
301
- if (loraPath?.startsWith('file://')) loraPath = loraPath.slice(7);
302
- let loraAdapters = [];
303
- if (loraList) loraAdapters = loraList.map(l => ({
304
- path: l.path.replace(/file:\/\//, ''),
305
- scaled: l.scaled
306
- }));
307
- telemetryParams.n_gpu_layers = rest.n_gpu_layers || null;
308
- telemetryParams.n_ctx = rest.n_ctx || null;
309
- telemetryParams.model = model;
310
- const contextId = contextIdCounter + contextIdRandom();
311
- contextIdCounter += 1;
312
- let removeProgressListener = null;
313
- if (onProgress) {
314
- removeProgressListener = EventEmitter.addListener(EVENT_ON_INIT_CONTEXT_PROGRESS, evt => {
315
- if (evt.contextId !== contextId) return;
316
- onProgress(evt.progress);
317
- });
318
- }
319
- const poolType = poolTypeMap[poolingType];
320
- const {
321
- gpu,
322
- reasonNoGPU,
323
- model: modelDetails,
324
- androidLib
325
- } = await Cactus.initContext(contextId, {
326
- model: path,
327
- is_model_asset: !!isModelAsset,
328
- use_progress_callback: !!onProgress,
329
- pooling_type: poolType,
330
- lora: loraPath,
331
- lora_list: loraAdapters,
332
- ...rest
333
- }).catch(err => {
334
- removeProgressListener?.remove();
335
- throw err;
336
- });
337
- removeProgressListener?.remove();
338
- return new LlamaContext({
339
- contextId,
340
- gpu,
341
- reasonNoGPU,
342
- model: modelDetails,
343
- androidLib
344
- });
345
- }
346
- export async function releaseAllLlama() {
347
- return Cactus.releaseAllContexts();
348
- }
349
- export const initContext = async params => {
350
- return await Cactus.initContext(contextIdCounter++, params);
351
- };
352
- export const initMultimodal = async (contextId, mmprojPath, useGpu = false) => {
353
- return await Cactus.initMultimodal(contextId, mmprojPath, useGpu);
354
- };
355
- export const isMultimodalEnabled = async contextId => {
356
- return await Cactus.isMultimodalEnabled(contextId);
357
- };
358
- export const isMultimodalSupportVision = async contextId => {
359
- return await Cactus.isMultimodalSupportVision(contextId);
360
- };
361
- export const isMultimodalSupportAudio = async contextId => {
362
- return await Cactus.isMultimodalSupportAudio(contextId);
363
- };
364
- export const releaseMultimodal = async contextId => {
365
- return await Cactus.releaseMultimodal(contextId);
366
- };
367
- export const multimodalCompletion = async (contextId, prompt, mediaPaths, params) => {
368
- const result = await Cactus.multimodalCompletion(contextId, prompt, mediaPaths, params);
369
- const deviceInfo = await getDeviceInfo(contextId);
370
- Telemetry.track({
371
- event: 'completion',
372
- tok_per_sec: result.timings?.predicted_per_second,
373
- toks_generated: result.timings?.predicted_n,
374
- num_images: mediaPaths?.length
375
- }, telemetryParams, deviceInfo);
376
- return result;
377
- };
378
- export const initVocoder = async (contextId, vocoderModelPath) => {
379
- return await Cactus.initVocoder(contextId, vocoderModelPath);
380
- };
381
- export const isVocoderEnabled = async contextId => {
382
- return await Cactus.isVocoderEnabled(contextId);
383
- };
384
- export const getTTSType = async contextId => {
385
- return await Cactus.getTTSType(contextId);
386
- };
387
- export const getFormattedAudioCompletion = async (contextId, speakerJsonStr, textToSpeak) => {
388
- return await Cactus.getFormattedAudioCompletion(contextId, speakerJsonStr, textToSpeak);
389
- };
390
- export const getAudioCompletionGuideTokens = async (contextId, textToSpeak) => {
391
- return await Cactus.getAudioCompletionGuideTokens(contextId, textToSpeak);
392
- };
393
- export const decodeAudioTokens = async (contextId, tokens) => {
394
- return await Cactus.decodeAudioTokens(contextId, tokens);
395
- };
396
- export const releaseVocoder = async contextId => {
397
- return await Cactus.releaseVocoder(contextId);
398
- };
399
- export const tokenize = async (contextId, text, mediaPaths) => {
400
- if (mediaPaths && mediaPaths.length > 0) {
401
- return await Cactus.tokenize(contextId, text, mediaPaths);
402
- } else {
403
- return await Cactus.tokenize(contextId, text);
404
- }
405
- };
406
- export const getDeviceInfo = async contextId => {
407
- return await Cactus.getDeviceInfo(contextId);
408
- };
409
- export { CactusLM } from './lm';
410
- export { CactusVLM } from './vlm';
411
- export { CactusTTS } from './tts';
412
- export { CactusAgent } from './agent';
6
+ // Hooks
7
+ export { useCactusLM } from "./hooks/useCactusLM.js";
8
+
9
+ // Types
10
+
11
+ // Config
12
+ export { CactusConfig } from "./config/CactusConfig.js";
413
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","DeviceEventEmitter","Platform","Cactus","formatChat","parseAndExecuteTool","Telemetry","Tools","EVENT_ON_INIT_CONTEXT_PROGRESS","EVENT_ON_TOKEN","EVENT_ON_NATIVE_LOG","EventEmitter","OS","logListeners","addListener","evt","forEach","listener","level","text","toggleNativeLog","catch","getJsonSchema","responseFormat","type","json_schema","schema","telemetryParams","n_gpu_layers","n_ctx","model","LlamaContext","gpu","reasonNoGPU","constructor","contextId","id","loadSession","filepath","path","startsWith","slice","saveSession","options","tokenSize","isLlamaChatSupported","chatTemplates","llamaChat","isJinjaSupported","minja","toolUse","default","getFormattedChat","messages","template","params","chat","useJinja","jinja","tmpl","undefined","jsonSchema","response_format","JSON","stringify","tools","parallel_tool_calls","tool_choice","completionWithTools","callback","recursionCount","recursionLimit","completion","getSchemas","result","toolCalled","toolName","toolInput","toolOutput","assistantMessage","role","content","tool_calls","push","toolCallId","toolMessage","tool_call_id","nativeParams","prompt","emit_partial_completion","formattedResult","chat_template","chatTemplate","chat_format","grammar","grammar_lazy","grammar_triggers","preserved_tokens","additional_stops","stop","startTime","Date","now","firstTokenTime","deviceInfo","getDeviceInfo","wrappedCallback","data","tokenListener","tokenResult","Error","promise","then","completionResult","track","event","tok_per_sec","timings","predicted_per_second","toks_generated","predicted_n","ttft","remove","err","stopCompletion","tokenize","detokenize","tokens","embedding","embeddingResult","totalTime","mode","embedding_time","bench","pp","tg","pl","nr","modelDesc","modelSize","modelNParams","ppAvg","ppStd","tgAvg","tgStd","parse","applyLoraAdapters","loraList","loraAdapters","map","l","replace","scaled","removeLoraAdapters","getLoadedLoraAdapters","release","releaseContext","rewind","enabled","addNativeLogListener","splice","indexOf","setContextLimit","limit","contextIdCounter","contextIdRandom","process","env","NODE_ENV","Math","floor","random","modelInfoSkip","loadLlamaModelInfo","modelInfo","poolTypeMap","none","mean","cls","last","rank","initLlama","is_model_asset","isModelAsset","pooling_type","poolingType","lora","lora_list","rest","onProgress","loraPath","removeProgressListener","progress","poolType","modelDetails","androidLib","initContext","use_progress_callback","releaseAllLlama","releaseAllContexts","initMultimodal","mmprojPath","useGpu","isMultimodalEnabled","isMultimodalSupportVision","isMultimodalSupportAudio","releaseMultimodal","multimodalCompletion","mediaPaths","num_images","length","initVocoder","vocoderModelPath","isVocoderEnabled","getTTSType","getFormattedAudioCompletion","speakerJsonStr","textToSpeak","getAudioCompletionGuideTokens","decodeAudioTokens","releaseVocoder","CactusLM","CactusVLM","CactusTTS","CactusAgent"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAE/E,OAAOC,MAAM,MAAM,gBAAgB;AAwBnC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAAgBC,mBAAmB,QAAQ,SAAS;AACpD,SAASC,SAAS,QAA8B,aAAa;AAmB7D,cAAc,UAAU;AACxB,SACEC,KAAK,EACLF,mBAAmB,QACd,SAAS;AAEhB,MAAMG,8BAA8B,GAAG,+BAA+B;AACtE,MAAMC,cAAc,GAAG,iBAAiB;AACxC,MAAMC,mBAAmB,GAAG,qBAAqB;AAEjD,IAAIC,YAA2D;AAC/D,IAAIT,QAAQ,CAACU,EAAE,KAAK,KAAK,EAAE;EACzB;EACAD,YAAY,GAAG,IAAIX,kBAAkB,CAACG,MAAM,CAAC;AAC/C;AACA,IAAID,QAAQ,CAACU,EAAE,KAAK,SAAS,EAAE;EAC7BD,YAAY,GAAGV,kBAAkB;AACnC;AAEA,MAAMY,YAA0D,GAAG,EAAE;;AAErE;AACA,IAAIF,YAAY,EAAE;EAChBA,YAAY,CAACG,WAAW,CACtBJ,mBAAmB,EAClBK,GAAoC,IAAK;IACxCF,YAAY,CAACG,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ignoreList":[]}
1
+ {"version":3,"names":["CactusLM","useCactusLM","CactusConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,QAAQ,QAAQ,uBAAoB;;AAE7C;AACA,SAASC,WAAW,QAAQ,wBAAqB;;AAEjD;;AAeA;AACA,SAASC,YAAY,QAAQ,0BAAuB","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ import { NitroModules } from 'react-native-nitro-modules';
4
+ export class Cactus {
5
+ hybridCactus = NitroModules.createHybridObject('Cactus');
6
+ init(modelPath, contextSize, corpusDir) {
7
+ return this.hybridCactus.init(modelPath, contextSize, corpusDir);
8
+ }
9
+ async complete(messages, responseBufferSize, options, tools, callback) {
10
+ const messagesJson = JSON.stringify(messages);
11
+ const optionsJson = options ? JSON.stringify({
12
+ temperature: options.temperature,
13
+ top_p: options.topP,
14
+ top_k: options.topK,
15
+ max_tokens: options.maxTokens,
16
+ stop_sequences: options.stopSequences
17
+ }) : undefined;
18
+ const toolsJson = JSON.stringify(tools);
19
+ const response = await this.hybridCactus.complete(messagesJson, responseBufferSize, optionsJson, toolsJson, callback);
20
+ try {
21
+ const parsed = JSON.parse(response);
22
+ return {
23
+ success: parsed.success,
24
+ response: parsed.response,
25
+ functionCalls: parsed.function_calls,
26
+ timeToFirstTokenMs: parsed.time_to_first_token_ms,
27
+ totalTimeMs: parsed.total_time_ms,
28
+ tokensPerSecond: parsed.tokens_per_second,
29
+ prefillTokens: parsed.prefill_tokens,
30
+ decodeTokens: parsed.decode_tokens,
31
+ totalTokens: parsed.total_tokens
32
+ };
33
+ } catch {
34
+ throw new Error('Unable to parse completion response');
35
+ }
36
+ }
37
+ embed(text, embeddingBufferSize) {
38
+ return this.hybridCactus.embed(text, embeddingBufferSize);
39
+ }
40
+ reset() {
41
+ return this.hybridCactus.reset();
42
+ }
43
+ stop() {
44
+ return this.hybridCactus.stop();
45
+ }
46
+ destroy() {
47
+ return this.hybridCactus.destroy();
48
+ }
49
+ }
50
+ //# sourceMappingURL=Cactus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","Cactus","hybridCactus","createHybridObject","init","modelPath","contextSize","corpusDir","complete","messages","responseBufferSize","options","tools","callback","messagesJson","JSON","stringify","optionsJson","temperature","top_p","topP","top_k","topK","max_tokens","maxTokens","stop_sequences","stopSequences","undefined","toolsJson","response","parsed","parse","success","functionCalls","function_calls","timeToFirstTokenMs","time_to_first_token_ms","totalTimeMs","total_time_ms","tokensPerSecond","tokens_per_second","prefillTokens","prefill_tokens","decodeTokens","decode_tokens","totalTokens","total_tokens","Error","embed","text","embeddingBufferSize","reset","stop","destroy"],"sourceRoot":"../../../src","sources":["native/Cactus.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AASzD,OAAO,MAAMC,MAAM,CAAC;EACDC,YAAY,GAC3BF,YAAY,CAACG,kBAAkB,CAAa,QAAQ,CAAC;EAEhDC,IAAIA,CACTC,SAAiB,EACjBC,WAAmB,EACnBC,SAAkB,EACH;IACf,OAAO,IAAI,CAACL,YAAY,CAACE,IAAI,CAACC,SAAS,EAAEC,WAAW,EAAEC,SAAS,CAAC;EAClE;EAEA,MAAaC,QAAQA,CACnBC,QAAmB,EACnBC,kBAA0B,EAC1BC,OAAiB,EACjBC,KAAc,EACdC,QAAmD,EAClB;IACjC,MAAMC,YAAY,GAAGC,IAAI,CAACC,SAAS,CAACP,QAAQ,CAAC;IAC7C,MAAMQ,WAAW,GAAGN,OAAO,GACvBI,IAAI,CAACC,SAAS,CAAC;MACbE,WAAW,EAAEP,OAAO,CAACO,WAAW;MAChCC,KAAK,EAAER,OAAO,CAACS,IAAI;MACnBC,KAAK,EAAEV,OAAO,CAACW,IAAI;MACnBC,UAAU,EAAEZ,OAAO,CAACa,SAAS;MAC7BC,cAAc,EAAEd,OAAO,CAACe;IAC1B,CAAC,CAAC,GACFC,SAAS;IACb,MAAMC,SAAS,GAAGb,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC;IAEvC,MAAMiB,QAAQ,GAAG,MAAM,IAAI,CAAC3B,YAAY,CAACM,QAAQ,CAC/CM,YAAY,EACZJ,kBAAkB,EAClBO,WAAW,EACXW,SAAS,EACTf,QACF,CAAC;IAED,IAAI;MACF,MAAMiB,MAAM,GAAGf,IAAI,CAACgB,KAAK,CAACF,QAAQ,CAAC;MAEnC,OAAO;QACLG,OAAO,EAAEF,MAAM,CAACE,OAAO;QACvBH,QAAQ,EAAEC,MAAM,CAACD,QAAQ;QACzBI,aAAa,EAAEH,MAAM,CAACI,cAAc;QACpCC,kBAAkB,EAAEL,MAAM,CAACM,sBAAsB;QACjDC,WAAW,EAAEP,MAAM,CAACQ,aAAa;QACjCC,eAAe,EAAET,MAAM,CAACU,iBAAiB;QACzCC,aAAa,EAAEX,MAAM,CAACY,cAAc;QACpCC,YAAY,EAAEb,MAAM,CAACc,aAAa;QAClCC,WAAW,EAAEf,MAAM,CAACgB;MACtB,CAAC;IACH,CAAC,CAAC,MAAM;MACN,MAAM,IAAIC,KAAK,CAAC,qCAAqC,CAAC;IACxD;EACF;EAEOC,KAAKA,CAACC,IAAY,EAAEC,mBAA2B,EAAqB;IACzE,OAAO,IAAI,CAAChD,YAAY,CAAC8C,KAAK,CAACC,IAAI,EAAEC,mBAAmB,CAAC;EAC3D;EAEOC,KAAKA,CAAA,EAAkB;IAC5B,OAAO,IAAI,CAACjD,YAAY,CAACiD,KAAK,CAAC,CAAC;EAClC;EAEOC,IAAIA,CAAA,EAAkB;IAC3B,OAAO,IAAI,CAAClD,YAAY,CAACkD,IAAI,CAAC,CAAC;EACjC;EAEOC,OAAOA,CAAA,EAAkB;IAC9B,OAAO,IAAI,CAACnD,YAAY,CAACmD,OAAO,CAAC,CAAC;EACpC;AACF","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import { NitroModules } from 'react-native-nitro-modules';
4
+ export class CactusCrypto {
5
+ static hybridCactusCrypto = NitroModules.createHybridObject('CactusCrypto');
6
+ static uuidv5(namespaceUuid, name) {
7
+ return this.hybridCactusCrypto.uuidv5(namespaceUuid, name);
8
+ }
9
+ }
10
+ //# sourceMappingURL=CactusCrypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","CactusCrypto","hybridCactusCrypto","createHybridObject","uuidv5","namespaceUuid","name"],"sourceRoot":"../../../src","sources":["native/CactusCrypto.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,OAAO,MAAMC,YAAY,CAAC;EACxB,OAAwBC,kBAAkB,GACxCF,YAAY,CAACG,kBAAkB,CAAmB,cAAc,CAAC;EAEnE,OAAcC,MAAMA,CAACC,aAAqB,EAAEC,IAAY,EAAmB;IACzE,OAAO,IAAI,CAACJ,kBAAkB,CAACE,MAAM,CAACC,aAAa,EAAEC,IAAI,CAAC;EAC5D;AACF","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ import { NitroModules } from 'react-native-nitro-modules';
4
+ export class CactusDeviceInfo {
5
+ static hybridCactusDeviceInfo = NitroModules.createHybridObject('CactusDeviceInfo');
6
+ static getAppIdentifier() {
7
+ return this.hybridCactusDeviceInfo.getAppIdentifier();
8
+ }
9
+ static getDeviceInfo() {
10
+ return this.hybridCactusDeviceInfo.getDeviceInfo();
11
+ }
12
+ }
13
+ //# sourceMappingURL=CactusDeviceInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","CactusDeviceInfo","hybridCactusDeviceInfo","createHybridObject","getAppIdentifier","getDeviceInfo"],"sourceRoot":"../../../src","sources":["native/CactusDeviceInfo.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAMzD,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAwBC,sBAAsB,GAC5CF,YAAY,CAACG,kBAAkB,CAAuB,kBAAkB,CAAC;EAE3E,OAAcC,gBAAgBA,CAAA,EAAgC;IAC5D,OAAO,IAAI,CAACF,sBAAsB,CAACE,gBAAgB,CAAC,CAAC;EACvD;EAEA,OAAcC,aAAaA,CAAA,EAAwB;IACjD,OAAO,IAAI,CAACH,sBAAsB,CAACG,aAAa,CAAC,CAAC;EACpD;AACF","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ import { NitroModules } from 'react-native-nitro-modules';
4
+ export class CactusFileSystem {
5
+ static hybridCactusFileSystem = NitroModules.createHybridObject('CactusFileSystem');
6
+ static getCactusDirectory() {
7
+ return this.hybridCactusFileSystem.getCactusDirectory();
8
+ }
9
+ static fileExists(path) {
10
+ return this.hybridCactusFileSystem.fileExists(path);
11
+ }
12
+ static writeFile(path, content) {
13
+ return this.hybridCactusFileSystem.writeFile(path, content);
14
+ }
15
+ static readFile(path) {
16
+ return this.hybridCactusFileSystem.readFile(path);
17
+ }
18
+ static deleteFile(path) {
19
+ return this.hybridCactusFileSystem.deleteFile(path);
20
+ }
21
+ static modelExists(model) {
22
+ return this.hybridCactusFileSystem.modelExists(model);
23
+ }
24
+ static getModelPath(model) {
25
+ return this.hybridCactusFileSystem.getModelPath(model);
26
+ }
27
+ static downloadModel(model, onProgress) {
28
+ const from = `https://vlqqczxwyaodtcdmdmlw.supabase.co/storage/v1/object/public/cactus-models/${model}.zip`;
29
+ return this.hybridCactusFileSystem.downloadModel(model, from, onProgress);
30
+ }
31
+ static deleteModel(model) {
32
+ return this.hybridCactusFileSystem.deleteModel(model);
33
+ }
34
+ }
35
+ //# sourceMappingURL=CactusFileSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","CactusFileSystem","hybridCactusFileSystem","createHybridObject","getCactusDirectory","fileExists","path","writeFile","content","readFile","deleteFile","modelExists","model","getModelPath","downloadModel","onProgress","from","deleteModel"],"sourceRoot":"../../../src","sources":["native/CactusFileSystem.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAw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ro-modules';
4
+ import { Platform } from 'react-native';
5
+ import { CactusFileSystem } from "./CactusFileSystem.js";
6
+ export class CactusUtil {
7
+ static hybridCactusUtil = NitroModules.createHybridObject('CactusUtil');
8
+ static async registerApp(encryptedData) {
9
+ if (Platform.OS === 'android') {
10
+ const cactusDirectory = await CactusFileSystem.getCactusDirectory();
11
+ this.hybridCactusUtil.setAndroidDataDirectory(cactusDirectory);
12
+ }
13
+ return this.hybridCactusUtil.registerApp(encryptedData);
14
+ }
15
+ static async getDeviceId() {
16
+ if (Platform.OS === 'android') {
17
+ const cactusDirectory = await CactusFileSystem.getCactusDirectory();
18
+ this.hybridCactusUtil.setAndroidDataDirectory(cactusDirectory);
19
+ }
20
+ return this.hybridCactusUtil.getDeviceId();
21
+ }
22
+ }
23
+ //# sourceMappingURL=CactusUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","Platform","CactusFileSystem","CactusUtil","hybridCactusUtil","createHybridObject","registerApp","encryptedData","OS","cactusDirectory","getCactusDirectory","setAndroidDataDirectory","getDeviceId"],"sourceRoot":"../../../src","sources":["native/CactusUtil.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAAQ,uBAAoB;AAErD,OAAO,MAAMC,UAAU,CAAC;EACtB,OAAwBC,gBAAgB,GACtCJ,YAAY,CAACK,kBAAkB,CAAiB,YAAY,CAAC;EAE/D,aAAoBC,WAAWA,CAACC,aAAqB,EAAmB;IACtE,IAAIN,QAAQ,CAACO,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMC,eAAe,GAAG,MAAMP,gBAAgB,CAACQ,kBAAkB,CAAC,CAAC;MACnE,IAAI,CAACN,gBAAgB,CAACO,uBAAuB,CAACF,eAAe,CAAC;IAChE;IAEA,OAAO,IAAI,CAACL,gBAAgB,CAACE,WAAW,CAACC,aAAa,CAAC;EACzD;EAEA,aAAoBK,WAAWA,CAAA,EAA2B;IACxD,IAAIX,QAAQ,CAACO,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMC,eAAe,GAAG,MAAMP,gBAAgB,CAACQ,kBAAkB,CAAC,CAAC;MACnE,IAAI,CAACN,gBAAgB,CAACO,uBAAuB,CAACF,eAAe,CAAC;IAChE;IAEA,OAAO,IAAI,CAACL,gBAAgB,CAACQ,WAAW,CAAC,CAAC;EAC5C;AACF","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ export { Cactus } from "./Cactus.js";
4
+ export { CactusCrypto } from "./CactusCrypto.js";
5
+ export { CactusDeviceInfo } from "./CactusDeviceInfo.js";
6
+ export { CactusFileSystem } from "./CactusFileSystem.js";
7
+ export { CactusUtil } from "./CactusUtil.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Cactus","CactusCrypto","CactusDeviceInfo","CactusFileSystem","CactusUtil"],"sourceRoot":"../../../src","sources":["native/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,aAAU;AACjC,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,UAAU,QAAQ,iBAAc","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=Cactus.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/Cactus.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=CactusCrypto.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/CactusCrypto.nitro.ts"],"mappings":"","ignoreList":[]}