@qvac/sdk 0.22.0 → 0.24.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 (284) hide show
  1. package/NOTICE +194 -97
  2. package/README.md +29 -470
  3. package/dist/examples/asr/parakeet-sortformer.js +24 -14
  4. package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
  5. package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +105 -0
  6. package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
  7. package/dist/examples/asr/whispercpp-prompt.js +9 -5
  8. package/dist/examples/assess-model-fit.d.ts +7 -9
  9. package/dist/examples/assess-model-fit.js +22 -43
  10. package/dist/examples/calc-tokens.d.ts +2 -0
  11. package/dist/examples/calc-tokens.js +21 -0
  12. package/dist/examples/classification/classify-image.js +11 -5
  13. package/dist/examples/completion-stop-reason.d.ts +3 -3
  14. package/dist/examples/completion-stop-reason.js +4 -4
  15. package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
  16. package/dist/examples/diffusion-flux3-klein.js +102 -0
  17. package/dist/examples/diffusion-img2vid-ltx.js +7 -14
  18. package/dist/examples/diffusion-moss-image.d.ts +2 -0
  19. package/dist/examples/diffusion-moss-image.js +126 -0
  20. package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
  21. package/dist/examples/diffusion-qwen-image-21.js +115 -0
  22. package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
  23. package/dist/examples/embed-multimodal.d.ts +2 -0
  24. package/dist/examples/embed-multimodal.js +80 -0
  25. package/dist/examples/embed-p2p.js +2 -2
  26. package/dist/examples/finetune/llamacpp-finetune.js +9 -4
  27. package/dist/examples/image/megaloc.d.ts +2 -0
  28. package/dist/examples/image/megaloc.js +37 -0
  29. package/dist/examples/llamacpp-multimodal.js +21 -1
  30. package/dist/examples/mcp-websearch.js +1 -1
  31. package/dist/examples/plugins.js +1 -1
  32. package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
  33. package/dist/examples/rag/rag-turbovec.js +2 -2
  34. package/dist/examples/rerank.d.ts +2 -0
  35. package/dist/examples/rerank.js +33 -0
  36. package/dist/examples/sessions.d.ts +17 -0
  37. package/dist/examples/sessions.js +63 -0
  38. package/dist/examples/tools/llamacpp-deferred-tools.js +12 -8
  39. package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
  40. package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
  41. package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
  42. package/dist/scripts/check-resource-collectors-packaging.js +7 -6
  43. package/dist/scripts/contract/build-contract.d.ts +2 -1
  44. package/dist/scripts/contract/build-contract.js +13 -1
  45. package/dist/scripts/contract/constants-registry.d.ts +19 -0
  46. package/dist/scripts/contract/constants-registry.js +9 -2
  47. package/dist/scripts/contract/method-shapes.d.ts +5 -0
  48. package/dist/scripts/contract/method-shapes.js +5 -0
  49. package/dist/scripts/enforce-inference-versions.d.ts +1 -1
  50. package/dist/scripts/enforce-inference-versions.js +28 -18
  51. package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
  52. package/dist/src/client/api/assess-model-fit.d.ts +17 -17
  53. package/dist/src/client/api/assess-model-fit.js +19 -32
  54. package/dist/src/client/api/audio-edit.d.ts +5 -3
  55. package/dist/src/client/api/audio-edit.js +7 -5
  56. package/dist/src/client/api/audio-gen-result.js +136 -47
  57. package/dist/src/client/api/audio-gen.d.ts +40 -3
  58. package/dist/src/client/api/audio-gen.js +42 -5
  59. package/dist/src/client/api/audio-understand.d.ts +2 -2
  60. package/dist/src/client/api/audio-understand.js +4 -4
  61. package/dist/src/client/api/batch-completion.js +4 -3
  62. package/dist/src/client/api/bci-transcribe.js +3 -3
  63. package/dist/src/client/api/calc-tokens.d.ts +33 -0
  64. package/dist/src/client/api/calc-tokens.js +44 -0
  65. package/dist/src/client/api/cancel.d.ts +2 -2
  66. package/dist/src/client/api/cancel.js +3 -3
  67. package/dist/src/client/api/classify.d.ts +12 -5
  68. package/dist/src/client/api/classify.js +18 -6
  69. package/dist/src/client/api/client-request-id.d.ts +0 -15
  70. package/dist/src/client/api/client-request-id.js +15 -12
  71. package/dist/src/client/api/completion-stream.d.ts +9 -1
  72. package/dist/src/client/api/completion-stream.js +14 -3
  73. package/dist/src/client/api/decide.d.ts +1 -1
  74. package/dist/src/client/api/decide.js +3 -3
  75. package/dist/src/client/api/delete-cache.d.ts +9 -2
  76. package/dist/src/client/api/delete-cache.js +14 -4
  77. package/dist/src/client/api/diffusion.d.ts +38 -5
  78. package/dist/src/client/api/diffusion.js +42 -7
  79. package/dist/src/client/api/download-asset.js +3 -3
  80. package/dist/src/client/api/embed.d.ts +82 -29
  81. package/dist/src/client/api/embed.js +66 -21
  82. package/dist/src/client/api/finetune.js +3 -3
  83. package/dist/src/client/api/get-loaded-model-info.js +1 -1
  84. package/dist/src/client/api/get-model-info.d.ts +2 -2
  85. package/dist/src/client/api/get-model-info.js +3 -3
  86. package/dist/src/client/api/get-system-resources.d.ts +2 -2
  87. package/dist/src/client/api/get-system-resources.js +3 -3
  88. package/dist/src/client/api/heartbeat.d.ts +3 -2
  89. package/dist/src/client/api/heartbeat.js +4 -3
  90. package/dist/src/client/api/index.d.ts +8 -6
  91. package/dist/src/client/api/index.js +6 -4
  92. package/dist/src/client/api/invoke-plugin.d.ts +8 -2
  93. package/dist/src/client/api/invoke-plugin.js +18 -3
  94. package/dist/src/client/api/load-model.js +9 -6
  95. package/dist/src/client/api/logging-stream.d.ts +11 -2
  96. package/dist/src/client/api/logging-stream.js +12 -3
  97. package/dist/src/client/api/ocr.d.ts +5 -3
  98. package/dist/src/client/api/ocr.js +45 -22
  99. package/dist/src/client/api/rag.d.ts +1 -1
  100. package/dist/src/client/api/rag.js +3 -3
  101. package/dist/src/client/api/registry.d.ts +19 -8
  102. package/dist/src/client/api/registry.js +43 -17
  103. package/dist/src/client/api/rerank.d.ts +22 -0
  104. package/dist/src/client/api/rerank.js +39 -0
  105. package/dist/src/client/api/resume.d.ts +2 -1
  106. package/dist/src/client/api/resume.js +3 -3
  107. package/dist/src/client/api/rpc-server.d.ts +4 -4
  108. package/dist/src/client/api/rpc-server.js +12 -12
  109. package/dist/src/client/api/state.d.ts +2 -2
  110. package/dist/src/client/api/state.js +3 -3
  111. package/dist/src/client/api/subscribe-logs.d.ts +2 -2
  112. package/dist/src/client/api/subscribe-logs.js +4 -3
  113. package/dist/src/client/api/suspend.d.ts +4 -2
  114. package/dist/src/client/api/suspend.js +5 -4
  115. package/dist/src/client/api/text-to-speech.d.ts +14 -5
  116. package/dist/src/client/api/text-to-speech.js +86 -32
  117. package/dist/src/client/api/transcribe.d.ts +7 -3
  118. package/dist/src/client/api/transcribe.js +9 -3
  119. package/dist/src/client/api/translate.js +2 -2
  120. package/dist/src/client/api/unload-model.d.ts +19 -7
  121. package/dist/src/client/api/unload-model.js +31 -13
  122. package/dist/src/client/api/upscale.d.ts +6 -3
  123. package/dist/src/client/api/upscale.js +10 -5
  124. package/dist/src/client/api/vector-index.d.ts +51 -17
  125. package/dist/src/client/api/vector-index.js +101 -49
  126. package/dist/src/client/api/video-request.d.ts +5 -5
  127. package/dist/src/client/api/video.d.ts +3 -2
  128. package/dist/src/client/api/video.js +6 -5
  129. package/dist/src/client/api/vla.d.ts +9 -5
  130. package/dist/src/client/api/vla.js +17 -8
  131. package/dist/src/client/api/world-result.js +2 -2
  132. package/dist/src/client/api/world.d.ts +6 -6
  133. package/dist/src/client/api/world.js +6 -6
  134. package/dist/src/client/init-hooks.d.ts +6 -4
  135. package/dist/src/client/init-hooks.js +12 -15
  136. package/dist/src/client/logging-stream-registry.d.ts +6 -3
  137. package/dist/src/client/logging-stream-registry.js +36 -14
  138. package/dist/src/client/plugins-factory.d.ts +1 -1
  139. package/dist/src/client/plugins-factory.js +1 -1
  140. package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
  141. package/dist/src/client/rpc/bundle-stamp.js +75 -0
  142. package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
  143. package/dist/src/client/rpc/expo-home-dir.js +4 -0
  144. package/dist/src/client/rpc/expo-rpc-client.js +192 -138
  145. package/dist/src/client/rpc/node-rpc-client.js +324 -426
  146. package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
  147. package/dist/src/client/rpc/pear-runtime.js +12 -0
  148. package/dist/src/client/rpc/rpc-client.d.ts +6 -4
  149. package/dist/src/client/rpc/rpc-client.js +168 -31
  150. package/dist/src/client/rpc/rpc-error.js +24 -2
  151. package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
  152. package/dist/src/client/rpc/unbundled-harness.js +27 -0
  153. package/dist/src/client/rpc/worker-failure.d.ts +27 -0
  154. package/dist/src/client/rpc/worker-failure.js +61 -0
  155. package/dist/src/client/session-registry.d.ts +75 -0
  156. package/dist/src/client/session-registry.js +149 -0
  157. package/dist/src/client/session.d.ts +125 -0
  158. package/dist/src/client/session.js +148 -0
  159. package/dist/src/commands/bundle/addons.d.ts +14 -0
  160. package/dist/src/commands/bundle/addons.js +65 -0
  161. package/dist/src/commands/bundle/constants.js +2 -0
  162. package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
  163. package/dist/src/commands/bundle/entry-gen.js +18 -51
  164. package/dist/src/commands/bundle/index.d.ts +60 -14
  165. package/dist/src/commands/bundle/index.js +350 -126
  166. package/dist/src/commands/bundle/link.d.ts +58 -0
  167. package/dist/src/commands/bundle/link.js +135 -0
  168. package/dist/src/commands/bundle/node-support.d.ts +13 -0
  169. package/dist/src/commands/bundle/node-support.js +23 -0
  170. package/dist/src/commands/bundle/plugins.js +1 -1
  171. package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
  172. package/dist/src/commands/bundle/read-bundle.js +27 -0
  173. package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
  174. package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
  175. package/dist/src/commands/bundle/scratch.d.ts +35 -0
  176. package/dist/src/commands/bundle/scratch.js +178 -0
  177. package/dist/src/commands/bundle/targets.d.ts +14 -0
  178. package/dist/src/commands/bundle/targets.js +37 -0
  179. package/dist/src/commands/host-prebuilds/index.d.ts +8 -7
  180. package/dist/src/commands/host-prebuilds/index.js +13 -11
  181. package/dist/src/commands/index.d.ts +13 -12
  182. package/dist/src/commands/index.js +7 -7
  183. package/dist/src/commands/verify/abi.d.ts +21 -15
  184. package/dist/src/commands/verify/abi.js +12 -80
  185. package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
  186. package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
  187. package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
  188. package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
  189. package/dist/src/commands/verify/bundle-source.d.ts +1 -1
  190. package/dist/src/commands/verify/bundle-source.js +27 -23
  191. package/dist/src/commands/verify/engines-advice.d.ts +6 -12
  192. package/dist/src/commands/verify/engines-advice.js +9 -56
  193. package/dist/src/commands/verify/index.d.ts +34 -33
  194. package/dist/src/commands/verify/index.js +96 -204
  195. package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
  196. package/dist/src/commands/verify/node-modules-source.js +1 -1
  197. package/dist/src/commands/verify/prebuilds.d.ts +4 -6
  198. package/dist/src/commands/verify/prebuilds.js +3 -4
  199. package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
  200. package/dist/src/commands/verify/resource-collectors.js +3 -52
  201. package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
  202. package/dist/src/commands/verify/sidecar-runtime.js +51 -0
  203. package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
  204. package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  205. package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  206. package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
  207. package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
  208. package/dist/src/expo/plugins/withBareKit.js +204 -0
  209. package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
  210. package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
  211. package/dist/src/expo/plugins/withMobileBundle.d.ts +5 -12
  212. package/dist/src/expo/plugins/withMobileBundle.js +38 -59
  213. package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
  214. package/dist/src/expo/plugins/withQvacSDK.d.ts +2 -1
  215. package/dist/src/expo/plugins/withQvacSDK.js +3 -0
  216. package/dist/src/index.d.ts +6 -5
  217. package/dist/src/index.js +10 -14
  218. package/dist/src/logging/addon.d.ts +1 -1
  219. package/dist/src/logging/base-logger.js +1 -1
  220. package/dist/src/logging/utils.js +11 -3
  221. package/dist/src/plugin-ids.d.ts +3 -1
  222. package/dist/src/plugin-ids.js +4 -0
  223. package/dist/src/schemas/public.d.ts +1 -1
  224. package/dist/src/schemas/public.js +1 -1
  225. package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
  226. package/dist/src/schemas/sdk-errors-client.js +30 -36
  227. package/dist/src/schemas/sdk-errors-server.d.ts +12 -1
  228. package/dist/src/schemas/sdk-errors-server.js +65 -2
  229. package/dist/src/server/rpc/rpc-utils.d.ts +26 -0
  230. package/dist/src/server/rpc/rpc-utils.js +41 -0
  231. package/dist/src/utils/aggregate-events.d.ts +1 -1
  232. package/dist/src/utils/aggregate-events.js +2 -2
  233. package/dist/src/utils/errors-client.d.ts +37 -29
  234. package/dist/src/utils/errors-client.js +50 -41
  235. package/dist/src/utils/errors-server.d.ts +65 -1
  236. package/dist/src/utils/errors-server.js +122 -1
  237. package/dist/src/utils/mcp-adapter.d.ts +1 -1
  238. package/dist/src/utils/mcp-adapter.js +1 -1
  239. package/dist/src/utils/tool-helpers.js +1 -1
  240. package/dist/src/utils/withTimeout.js +34 -17
  241. package/dist/src/worker/handle-request.js +26 -21
  242. package/dist/src/worker/handler-utils.d.ts +2 -6
  243. package/dist/src/worker/handler-utils.js +2 -20
  244. package/dist/src/worker/index.d.ts +2 -4
  245. package/dist/src/worker/index.js +24 -34
  246. package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
  247. package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
  248. package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
  249. package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
  250. package/dist/src/worker/shim.d.ts +4 -0
  251. package/dist/src/worker/shim.js +7 -0
  252. package/dist/src/worker/start.d.ts +9 -0
  253. package/dist/src/worker/start.js +16 -0
  254. package/dist/src/worker/unbundled-shim.d.ts +2 -0
  255. package/dist/src/worker/unbundled-shim.js +4 -0
  256. package/docs/system-resources-support-matrix.md +27 -19
  257. package/package.json +91 -74
  258. package/src/electron-forge/index.cjs +65 -91
  259. package/dist/examples/model-fit-ui/server.d.ts +0 -24
  260. package/dist/examples/model-fit-ui/server.js +0 -221
  261. package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
  262. package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
  263. package/dist/src/client/rpc/init-timeout.d.ts +0 -26
  264. package/dist/src/client/rpc/init-timeout.js +0 -25
  265. package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
  266. package/dist/src/client/rpc/worker-startup-error.js +0 -13
  267. package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
  268. package/dist/src/commands/bundle/bare-pack.js +0 -77
  269. package/dist/src/commands/bundle/manifest.d.ts +0 -25
  270. package/dist/src/commands/bundle/manifest.js +0 -192
  271. package/dist/src/expo/plugins/link-addons.d.ts +0 -18
  272. package/dist/src/expo/plugins/link-addons.js +0 -65
  273. package/dist/src/pear/pre.d.ts +0 -21
  274. package/dist/src/pear/pre.js +0 -448
  275. package/dist/src/server/env.d.ts +0 -22
  276. package/dist/src/server/env.js +0 -59
  277. package/dist/src/server/utils/qvac-paths.d.ts +0 -2
  278. package/dist/src/server/utils/qvac-paths.js +0 -5
  279. package/dist/src/server/utils/worker-lock.d.ts +0 -3
  280. package/dist/src/server/utils/worker-lock.js +0 -67
  281. package/dist/src/worker/create-server.d.ts +0 -8
  282. package/dist/src/worker/create-server.js +0 -51
  283. package/dist/src/worker/lifecycle.d.ts +0 -23
  284. package/dist/src/worker/lifecycle.js +0 -149
@@ -1,10 +1,10 @@
1
1
  import { promises as fsp } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import semver from 'semver';
4
- import { createCommandLogger } from '../command-logger.js';
5
- import { readAddonPackageJson } from '../verify/addon-source.js';
6
- import { checkPrebuilds, isMobileHost } from '../verify/prebuilds.js';
7
- import { checkPackageManagerSupport, detectPackageManager, installArgs, isPackageManagerName, isWorkspaceMember, runPackageManager } from './package-manager.js';
4
+ import { createCommandLogger } from '../../commands/command-logger.js';
5
+ import { readAddonPackageJson } from '../../commands/verify/addon-source.js';
6
+ import { checkPrebuilds, isMobileHost } from '../../commands/verify/prebuilds.js';
7
+ import { checkPackageManagerSupport, detectPackageManager, installArgs, isPackageManagerName, isWorkspaceMember, runPackageManager } from '../../commands/host-prebuilds/package-manager.js';
8
8
  import { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError } from '../../utils/errors-client.js';
9
9
  /** npm's package-name grammar. On Windows the names pass through a shell. */
10
10
  const PACKAGE_NAME = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
@@ -69,18 +69,20 @@ export async function installMissingHostPrebuilds(options) {
69
69
  logger.info(` Installed ${missing.length} platform package${missing.length === 1 ? '' : 's'}`);
70
70
  return { installed: missing, packageManager: manager };
71
71
  }
72
+ export async function findMissingHostPrebuilds(addons, hosts) {
73
+ return findMissingPlatformPackages(addons, hosts.filter(isMobileHost));
74
+ }
72
75
  /**
73
- * The platform packages `addons` still need for the mobile hosts in `hosts`,
74
- * one entry per package. Throws when two installed versions of one addon need
75
- * the same platform package, since only one version of it can be installed.
76
+ * The platform packages `addons` still need for `hosts`, one entry per
77
+ * package. Throws when two installed versions of one addon need the same
78
+ * platform package, since only one version of it can be installed.
76
79
  */
77
- export async function findMissingHostPrebuilds(addons, hosts) {
78
- const mobileHosts = hosts.filter(isMobileHost);
80
+ export async function findMissingPlatformPackages(addons, hosts) {
79
81
  const packages = new Map();
80
- if (mobileHosts.length === 0)
82
+ if (hosts.length === 0)
81
83
  return [];
82
84
  for (const addon of addons) {
83
- for (const issue of await checkPrebuilds({ addon, hosts: mobileHosts })) {
85
+ for (const issue of await checkPrebuilds({ addon, hosts })) {
84
86
  const pin = issue.platformPackage;
85
87
  if (pin === undefined)
86
88
  continue;
@@ -1,14 +1,15 @@
1
- export { bundleSdk } from './bundle/index.js';
2
- export type { BundleSdkOptions, BundleSdkResult } from './bundle/index.js';
3
- export { ensureHostPrebuilds } from './host-prebuilds/index.js';
4
- export type { EnsureHostPrebuildsOptions, EnsureHostPrebuildsResult, HostPrebuildPackage, PackageManagerName } from './host-prebuilds/index.js';
5
- export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from './verify/index.js';
6
- export type { VerifyBundleOptions, VerifyBundleResult, VerifyBundleIssue, RuntimeGroup } from './verify/index.js';
1
+ export { bundleSdk } from '../commands/bundle/index.js';
2
+ export type { BundleSdkOptions, BundleSdkResult } from '../commands/bundle/index.js';
3
+ export { ensureHostPrebuilds } from '../commands/host-prebuilds/index.js';
4
+ export type { EnsureHostPrebuildsOptions, EnsureHostPrebuildsResult, HostPrebuildPackage, PackageManagerName } from '../commands/host-prebuilds/index.js';
5
+ export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '../commands/verify/index.js';
6
+ export type { VerifyBundleOptions, VerifyBundleResult, VerifyBundleIssue, PlatformRuntime } from '../commands/verify/index.js';
7
7
  export { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError, HostPrebuildsMissingError } from '../utils/errors-client.js';
8
- export { formatRuntimeSource } from './verify/abi.js';
9
- export type { BareRuntime, BareRuntimeResolution } from './verify/abi.js';
10
- export { isReactNativeBareKitInstalled } from './verify/bare-kit-runtime.js';
11
- export { isMobileHost } from './verify/prebuilds.js';
12
- export { formatEnginesAdvice } from './verify/engines-advice.js';
13
- export type { EnginesAdvice, EnginesOverride, EnginesUpgrade } from './verify/engines-advice.js';
8
+ export { formatRuntimeSource } from '../commands/verify/abi.js';
9
+ export type { BareKitBinding, BareRuntime, BareRuntimeResolution } from '../commands/verify/abi.js';
10
+ export { isReactNativeBareKitInstalled } from '../commands/verify/bare-kit-runtime.js';
11
+ export type { BareKitPlatform } from '../commands/verify/bare-kit-runtime.js';
12
+ export { isMobileHost } from '../commands/verify/prebuilds.js';
13
+ export { formatEnginesAdvice } from '../commands/verify/engines-advice.js';
14
+ export type { EnginesAdvice, EnginesOverride } from '../commands/verify/engines-advice.js';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
- export { bundleSdk } from './bundle/index.js';
2
- export { ensureHostPrebuilds } from './host-prebuilds/index.js';
3
- export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from './verify/index.js';
1
+ export { bundleSdk } from '../commands/bundle/index.js';
2
+ export { ensureHostPrebuilds } from '../commands/host-prebuilds/index.js';
3
+ export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '../commands/verify/index.js';
4
4
  export { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError, HostPrebuildsMissingError } from '../utils/errors-client.js';
5
- export { formatRuntimeSource } from './verify/abi.js';
6
- export { isReactNativeBareKitInstalled } from './verify/bare-kit-runtime.js';
7
- export { isMobileHost } from './verify/prebuilds.js';
8
- export { formatEnginesAdvice } from './verify/engines-advice.js';
5
+ export { formatRuntimeSource } from '../commands/verify/abi.js';
6
+ export { isReactNativeBareKitInstalled } from '../commands/verify/bare-kit-runtime.js';
7
+ export { isMobileHost } from '../commands/verify/prebuilds.js';
8
+ export { formatEnginesAdvice } from '../commands/verify/engines-advice.js';
@@ -1,20 +1,19 @@
1
- import { type NativeAddon } from './addon-source.js';
1
+ import { type NativeAddon } from '../../commands/verify/addon-source.js';
2
+ /** Bare Kit binding a phone platform links: bare-kit-kotlin on Android, bare-kit-swift on iOS. */
3
+ export type BareKitBinding = 'bare-kit-kotlin' | 'bare-kit-swift';
4
+ /** The Bare build inside the Bare Kit that a phone platform runs. */
2
5
  export interface BareRuntime {
3
6
  version: string;
4
- source: 'flag' | 'config' | 'bare-runtime' | 'bare' | 'react-native-bare-kit';
5
- /** Installed version of the package named by `source`, when it differs from `version`. */
6
- packageVersion?: string;
7
- detail?: string;
7
+ /** The package the Bare comes with: a Bare Kit binding on phones, bare-sidecar on desktop. */
8
+ source: BareKitBinding | 'bare-sidecar';
9
+ /** Version of that package: the binding version bare-stow pins, or the installed bare-sidecar. */
10
+ packageVersion: string;
11
+ detail: string;
8
12
  }
9
13
  export interface UnresolvedBareRuntime {
10
14
  reason: string;
11
15
  triedPaths: string[];
12
16
  }
13
- export interface ResolveBareRuntimeOptions {
14
- projectRoot: string;
15
- explicitVersion?: string;
16
- explicitSource?: 'flag' | 'config';
17
- }
18
17
  export type BareRuntimeResolution = {
19
18
  resolved: true;
20
19
  runtime: BareRuntime;
@@ -29,21 +28,29 @@ export interface AbiMismatchIssue {
29
28
  message: string;
30
29
  enginesBare: string;
31
30
  runtimeVersion: string;
31
+ /** Hosts that run this runtime, when the check was given them. */
32
+ hosts?: string[];
32
33
  }
33
- /** A bundled package that is not an addon but still declares engines.bare. */
34
+ /**
35
+ * A bundled package that is not an addon but still declares engines.bare. It
36
+ * warns: the package's JavaScript may run on the older Bare, whereas an addon
37
+ * built for another ABI does not load.
38
+ */
34
39
  export interface EnginesMismatchIssue {
35
40
  code: 'engines-mismatch';
36
- level: 'error';
41
+ level: 'warning';
37
42
  package: string;
38
43
  message: string;
39
44
  enginesBare: string;
40
45
  runtimeVersion: string;
46
+ hosts?: string[];
41
47
  }
42
48
  export interface UnknownRuntimeIssue {
43
49
  code: 'unknown-runtime-version';
44
50
  level: 'warning';
45
51
  message: string;
46
52
  triedPaths: string[];
53
+ hosts?: string[];
47
54
  }
48
55
  export interface MalformedEnginesBareIssue {
49
56
  code: 'malformed-engines-bare';
@@ -58,15 +65,14 @@ export interface CheckAbiOptions {
58
65
  runtime: BareRuntimeResolution;
59
66
  /** Non-addon packages that declare engines.bare. */
60
67
  packages?: EnginesPackage[] | undefined;
68
+ /** Hosts that run `runtime`, recorded on the issues. */
69
+ hosts?: string[] | undefined;
61
70
  }
62
71
  export interface EnginesPackage {
63
72
  name: string;
64
73
  version?: string;
65
74
  enginesBare: string;
66
75
  }
67
- export declare function resolveBareRuntime(options: ResolveBareRuntimeOptions): Promise<BareRuntimeResolution>;
68
- export declare function normalizeVersion(value: string): string | null;
69
- export declare function formatConfigLabel(projectRoot: string, configPath?: string): string;
70
76
  export declare function formatRuntimeSource(runtime: BareRuntime): string;
71
77
  export declare function checkAbi(options: CheckAbiOptions): AbiIssue[];
72
78
  //# sourceMappingURL=abi.d.ts.map
@@ -1,80 +1,11 @@
1
- import { promises as fsp } from 'node:fs';
2
- import path from 'node:path';
3
1
  import semver from 'semver';
4
- import { formatAddonId } from './addon-source.js';
5
- const RUNTIME_PACKAGES = [
6
- { source: 'bare-runtime', packageName: 'bare-runtime' },
7
- { source: 'bare', packageName: 'bare' }
8
- ];
9
- export async function resolveBareRuntime(options) {
10
- if (options.explicitVersion) {
11
- // Caller (verifyBundle) pre-validates explicitVersion via normalizeVersion.
12
- return {
13
- resolved: true,
14
- runtime: {
15
- version: normalizeVersion(options.explicitVersion),
16
- source: options.explicitSource ?? 'flag'
17
- }
18
- };
19
- }
20
- const tried = [];
21
- for (const candidate of RUNTIME_PACKAGES) {
22
- const pkgJsonPath = path.join(options.projectRoot, 'node_modules', candidate.packageName, 'package.json');
23
- tried.push(pkgJsonPath);
24
- const version = await tryReadRuntimeVersion(pkgJsonPath);
25
- if (version) {
26
- return {
27
- resolved: true,
28
- runtime: { version, source: candidate.source }
29
- };
30
- }
31
- }
32
- return {
33
- resolved: false,
34
- error: {
35
- reason: 'Unable to detect installed Bare runtime version',
36
- triedPaths: tried
37
- }
38
- };
39
- }
40
- async function tryReadRuntimeVersion(pkgJsonPath) {
41
- let raw;
42
- try {
43
- raw = await fsp.readFile(pkgJsonPath, 'utf8');
44
- }
45
- catch {
46
- return null;
47
- }
48
- let parsed;
49
- try {
50
- parsed = JSON.parse(raw);
51
- }
52
- catch {
53
- return null;
54
- }
55
- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
56
- return null;
57
- }
58
- const version = parsed['version'];
59
- return typeof version === 'string' ? normalizeVersion(version) : null;
60
- }
61
- export function normalizeVersion(value) {
62
- const coerced = semver.coerce(value, { includePrerelease: true });
63
- return coerced ? coerced.version : null;
64
- }
65
- export function formatConfigLabel(projectRoot, configPath) {
66
- if (!configPath)
67
- return 'qvac.config';
68
- const rel = path.relative(projectRoot, configPath);
69
- if (!rel || rel.startsWith('..') || path.isAbsolute(rel))
70
- return configPath;
71
- return rel;
72
- }
2
+ import { formatAddonId } from '../../commands/verify/addon-source.js';
73
3
  export function formatRuntimeSource(runtime) {
74
- return runtime.detail === undefined ? runtime.source : `${runtime.source}: ${runtime.detail}`;
4
+ return `${runtime.source}: ${runtime.detail}`;
75
5
  }
76
6
  export function checkAbi(options) {
77
- const { addons, runtime, packages = [] } = options;
7
+ const { addons, runtime, packages = [], hosts } = options;
8
+ const onHosts = hosts === undefined ? {} : { hosts };
78
9
  const constrained = [
79
10
  ...addons.map((addon) => ({
80
11
  id: formatAddonId(addon),
@@ -109,10 +40,9 @@ export function checkAbi(options) {
109
40
  code: 'unknown-runtime-version',
110
41
  level: 'warning',
111
42
  message: `${runtime.error.reason}. ABI checks skipped for ${checkable.length} ` +
112
- `package${checkable.length === 1 ? '' : 's'}. ` +
113
- 'For mobile hosts, install react-native-bare-kit; for a desktop build, ' +
114
- 'install bare-runtime or pass bareRuntimeVersion.',
115
- triedPaths: runtime.error.triedPaths
43
+ `package${checkable.length === 1 ? '' : 's'}.`,
44
+ triedPaths: runtime.error.triedPaths,
45
+ ...onHosts
116
46
  });
117
47
  return issues;
118
48
  }
@@ -129,17 +59,19 @@ export function checkAbi(options) {
129
59
  addon: entry.id,
130
60
  enginesBare: entry.range,
131
61
  runtimeVersion: version,
132
- message
62
+ message,
63
+ ...onHosts
133
64
  });
134
65
  }
135
66
  else {
136
67
  issues.push({
137
68
  code: 'engines-mismatch',
138
- level: 'error',
69
+ level: 'warning',
139
70
  package: entry.id,
140
71
  enginesBare: entry.range,
141
72
  runtimeVersion: version,
142
- message
73
+ message,
74
+ ...onHosts
143
75
  });
144
76
  }
145
77
  }
@@ -1,38 +1,36 @@
1
- import type { BareRuntimeResolution } from './abi.js';
1
+ import type { BareKitBinding, BareRuntimeResolution } from '../../commands/verify/abi.js';
2
2
  export declare const REACT_NATIVE_BARE_KIT = "react-native-bare-kit";
3
3
  export declare const NETWORK_TIMEOUT_MS = 5000;
4
+ export type BareKitPlatform = 'android' | 'ios';
5
+ export declare const BARE_KIT_PLATFORMS: BareKitPlatform[];
4
6
  export type FetchText = (url: string) => Promise<string>;
5
7
  export type ProgressFn = (message: string) => void;
6
- export interface ResolveMobileBareRuntimeOptions {
7
- projectRoot: string;
8
+ export interface ResolveBareKitRuntimeOptions {
9
+ platform: BareKitPlatform;
10
+ /** The project whose `@qvac/sdk` decides which bare-stow's pins are read. */
11
+ projectRoot?: string | undefined;
12
+ /** Directory of the bare-stow package whose pins are read, instead of the project's. */
13
+ bareStowDir?: string | undefined;
8
14
  network?: boolean | undefined;
9
15
  onProgress?: ProgressFn | undefined;
10
16
  fetchText?: FetchText | undefined;
11
17
  }
12
18
  export declare function isReactNativeBareKitInstalled(projectRoot: string): boolean;
19
+ export declare function bareKitPlatformOf(host: string): BareKitPlatform | null;
13
20
  export declare function fetchText(url: string): Promise<string>;
14
- export declare function parseBareKitReleaseVersion(cmakeLists: string): string | null;
15
21
  export declare function parseBareVersion(cmakeLists: string): string | null;
16
- export declare function parseInfoPlistVersion(plist: string): string | null;
17
- export declare function fetchBareKitVersionFromGitHub(reactNativeBareKitVersion: string, fetch?: FetchText): Promise<string | null>;
22
+ export declare function parseBareKitVersion(cmakeLists: string): string | null;
23
+ /** The binding version bare-stow pins for each platform, or null where none is found. */
24
+ export declare function parseBareKitPins(source: string): Record<BareKitPlatform, string | null>;
25
+ export declare function fetchBindingBareKitFromGitHub(binding: BareKitBinding, version: string, fetch?: FetchText): Promise<string | null>;
18
26
  export declare function fetchBareVersionFromGitHub(bareKitVersion: string, fetch?: FetchText): Promise<string | null>;
19
- export declare function bareVersionForBareKit(bareKitVersion: string): string | null;
20
27
  /**
21
- * The oldest react-native-bare-kit release newer than `currentVersion` whose
22
- * embedded Bare satisfies every range, or null if the table has none.
23
- */
24
- export declare function findReactNativeBareKitUpgrade(currentVersion: string, ranges: string[]): {
25
- version: string;
26
- bareKit: string;
27
- bare: string;
28
- } | null;
29
- /**
30
- * Bare version the app runs on mobile: the one compiled into the bare-kit
31
- * binaries that react-native-bare-kit ships, not any `bare-runtime` package
32
- * in node_modules.
28
+ * Bare version a phone platform runs: the one in the bare-kit that the Bare
29
+ * Kit binding pinned by the SDK's bare-stow is built from. Android links
30
+ * bare-kit-kotlin at an exact version. bare-stow names a minimum
31
+ * bare-kit-swift, which the link step writes into the app as an exact version.
33
32
  *
34
- * Checks the built-in table, then the installed iOS framework's Info.plist,
35
- * and only then GitHub.
33
+ * Checks the built-in tables, and only then GitHub.
36
34
  */
37
- export declare function resolveMobileBareRuntime(options: ResolveMobileBareRuntimeOptions): Promise<BareRuntimeResolution>;
35
+ export declare function resolveBareKitRuntime(options: ResolveBareKitRuntimeOptions): Promise<BareRuntimeResolution>;
38
36
  //# sourceMappingURL=bare-kit-runtime.d.ts.map