@qvac/sdk 0.11.0 → 0.12.1

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 (211) hide show
  1. package/NOTICE +1423 -43
  2. package/README.md +2 -0
  3. package/dist/client/api/classify.d.ts +23 -0
  4. package/dist/client/api/classify.js +43 -0
  5. package/dist/client/api/get-model-info.d.ts +1 -1
  6. package/dist/client/api/index.d.ts +4 -0
  7. package/dist/client/api/index.js +4 -0
  8. package/dist/client/api/load-model.js +24 -1
  9. package/dist/client/api/transcribe.d.ts +3 -0
  10. package/dist/client/api/transcribe.js +13 -2
  11. package/dist/client/api/video.d.ts +64 -0
  12. package/dist/client/api/video.js +147 -0
  13. package/dist/client/api/vla-helpers.d.ts +45 -0
  14. package/dist/client/api/vla-helpers.js +130 -0
  15. package/dist/client/api/vla.d.ts +65 -0
  16. package/dist/client/api/vla.js +109 -0
  17. package/dist/client/config-loader/resolve-config.node.d.ts +16 -0
  18. package/dist/client/config-loader/resolve-config.node.js +77 -23
  19. package/dist/client/plugins-factory.d.ts +8 -0
  20. package/dist/client/plugins-factory.js +10 -0
  21. package/dist/client/rpc/bare-client.d.ts +1 -0
  22. package/dist/client/rpc/bare-client.js +66 -66
  23. package/dist/client/rpc/ensure-worker-ready.d.ts +9 -0
  24. package/dist/client/rpc/ensure-worker-ready.js +17 -0
  25. package/dist/client/rpc/expo-rpc-client.d.ts +1 -0
  26. package/dist/client/rpc/expo-rpc-client.js +4 -0
  27. package/dist/client/rpc/node-rpc-client.d.ts +1 -0
  28. package/dist/client/rpc/node-rpc-client.js +97 -5
  29. package/dist/client/rpc/rpc-client.js +115 -8
  30. package/dist/client/rpc/rpc-error.js +14 -1
  31. package/dist/commands/bundle/bare-pack.d.ts +13 -0
  32. package/dist/commands/bundle/bare-pack.js +54 -0
  33. package/dist/commands/bundle/constants.d.ts +7 -0
  34. package/dist/commands/bundle/constants.js +23 -0
  35. package/dist/commands/bundle/entry-gen.d.ts +2 -0
  36. package/dist/commands/bundle/entry-gen.js +48 -0
  37. package/dist/commands/bundle/index.d.ts +20 -0
  38. package/dist/commands/bundle/index.js +141 -0
  39. package/dist/commands/bundle/manifest.d.ts +21 -0
  40. package/dist/commands/bundle/manifest.js +193 -0
  41. package/dist/commands/bundle/plugins.d.ts +9 -0
  42. package/dist/commands/bundle/plugins.js +51 -0
  43. package/dist/commands/index.d.ts +5 -0
  44. package/dist/commands/index.js +2 -0
  45. package/dist/commands/verify/abi.d.ts +52 -0
  46. package/dist/commands/verify/abi.js +125 -0
  47. package/dist/commands/verify/addon-source.d.ts +43 -0
  48. package/dist/commands/verify/addon-source.js +75 -0
  49. package/dist/commands/verify/bundle-source.d.ts +12 -0
  50. package/dist/commands/verify/bundle-source.js +53 -0
  51. package/dist/commands/verify/index.d.ts +59 -0
  52. package/dist/commands/verify/index.js +371 -0
  53. package/dist/commands/verify/node-modules-source.d.ts +11 -0
  54. package/dist/commands/verify/node-modules-source.js +76 -0
  55. package/dist/commands/verify/prebuilds.d.ts +15 -0
  56. package/dist/commands/verify/prebuilds.js +39 -0
  57. package/dist/examples/classification/classify-image.d.ts +2 -0
  58. package/dist/examples/classification/classify-image.js +23 -0
  59. package/dist/examples/diffusion-txt2vid.d.ts +2 -0
  60. package/dist/examples/diffusion-txt2vid.js +81 -0
  61. package/dist/examples/plugins.js +3 -7
  62. package/dist/examples/tools/llamacpp-tools-gemma4.js +2 -5
  63. package/dist/examples/tools/llamacpp-tools-qwen35.js +2 -3
  64. package/dist/examples/transcription/parakeet-ctc-filesystem.js +18 -12
  65. package/dist/examples/transcription/parakeet-microphone-record.js +7 -12
  66. package/dist/examples/transcription/parakeet-microphone-stream.d.ts +2 -0
  67. package/dist/examples/transcription/parakeet-microphone-stream.js +79 -0
  68. package/dist/examples/transcription/parakeet-sortformer-streaming.d.ts +2 -0
  69. package/dist/examples/transcription/parakeet-sortformer-streaming.js +121 -0
  70. package/dist/examples/transcription/parakeet-sortformer.js +58 -55
  71. package/dist/examples/transcription/parakeet-tdt-filesystem.js +18 -15
  72. package/dist/examples/transcription/whispercpp-microphone-conversation.js +6 -1
  73. package/dist/examples/tts/chatterbox.js +7 -16
  74. package/dist/examples/tts/llm-to-tts-streaming.js +3 -10
  75. package/dist/examples/tts/supertonic-multilingual.js +4 -12
  76. package/dist/examples/tts/supertonic.js +5 -12
  77. package/dist/examples/vla-smolvla.d.ts +2 -0
  78. package/dist/examples/vla-smolvla.js +75 -0
  79. package/dist/examples/voice-assistant/voice-assistant.js +3 -10
  80. package/dist/expo/plugins/find-in-ancestor-node-modules.d.ts +14 -0
  81. package/dist/expo/plugins/find-in-ancestor-node-modules.js +24 -0
  82. package/dist/expo/plugins/get-project-root.d.ts +22 -0
  83. package/dist/expo/plugins/get-project-root.js +23 -0
  84. package/dist/expo/plugins/index.d.ts +4 -0
  85. package/dist/expo/plugins/index.js +4 -0
  86. package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +9 -2
  87. package/dist/expo/plugins/resolve-sdk-package-dir.js +38 -11
  88. package/dist/expo/plugins/withDeviceInfo.js +2 -1
  89. package/dist/expo/plugins/withMobileBundle.d.ts +2 -17
  90. package/dist/expo/plugins/withMobileBundle.js +31 -85
  91. package/dist/index.d.ts +5 -3
  92. package/dist/index.js +9 -3
  93. package/dist/models/registry/models.d.ts +3711 -368
  94. package/dist/models/registry/models.js +7066 -3562
  95. package/dist/models/update-models/naming.js +22 -8
  96. package/dist/pear/pre.js +6 -2
  97. package/dist/schemas/cancel.d.ts +5 -0
  98. package/dist/schemas/cancel.js +1 -0
  99. package/dist/schemas/classification.d.ts +53 -0
  100. package/dist/schemas/classification.js +33 -0
  101. package/dist/schemas/common.d.ts +1001 -1739
  102. package/dist/schemas/common.js +6 -1
  103. package/dist/schemas/completion-event.d.ts +3 -0
  104. package/dist/schemas/completion-event.js +1 -0
  105. package/dist/schemas/completion-stream.d.ts +1 -0
  106. package/dist/schemas/download-asset.d.ts +13 -3
  107. package/dist/schemas/engine-addon-map.d.ts +3 -0
  108. package/dist/schemas/engine-addon-map.js +18 -5
  109. package/dist/schemas/get-model-info.d.ts +4 -0
  110. package/dist/schemas/get-model-info.js +2 -0
  111. package/dist/schemas/index.d.ts +3 -0
  112. package/dist/schemas/index.js +3 -0
  113. package/dist/schemas/llamacpp-config.d.ts +12 -2
  114. package/dist/schemas/load-model.d.ts +6152 -10764
  115. package/dist/schemas/load-model.js +75 -7
  116. package/dist/schemas/model-src-utils.d.ts +22 -2
  117. package/dist/schemas/model-types.d.ts +46 -6
  118. package/dist/schemas/model-types.js +28 -5
  119. package/dist/schemas/ocr.d.ts +5 -0
  120. package/dist/schemas/plugin.d.ts +20 -5
  121. package/dist/schemas/plugin.js +21 -4
  122. package/dist/schemas/registry.d.ts +44 -0
  123. package/dist/schemas/registry.js +5 -0
  124. package/dist/schemas/reload-config.d.ts +22 -2
  125. package/dist/schemas/sdcpp-config.d.ts +316 -1
  126. package/dist/schemas/sdcpp-config.js +232 -33
  127. package/dist/schemas/sdk-config.d.ts +654 -1324
  128. package/dist/schemas/sdk-config.js +16 -1
  129. package/dist/schemas/sdk-errors-client.d.ts +7 -0
  130. package/dist/schemas/sdk-errors-client.js +36 -1
  131. package/dist/schemas/sdk-errors-server.d.ts +3 -1
  132. package/dist/schemas/sdk-errors-server.js +20 -5
  133. package/dist/schemas/text-to-speech.d.ts +79 -696
  134. package/dist/schemas/text-to-speech.js +46 -19
  135. package/dist/schemas/transcription-config.d.ts +37 -226
  136. package/dist/schemas/transcription-config.js +76 -15
  137. package/dist/schemas/transcription.d.ts +63 -11
  138. package/dist/schemas/transcription.js +56 -2
  139. package/dist/schemas/translation-config.d.ts +60 -10
  140. package/dist/schemas/vla.d.ts +87 -0
  141. package/dist/schemas/vla.js +108 -0
  142. package/dist/scripts/run-unit-tests.js +8 -2
  143. package/dist/server/bare/ops/transcribe.d.ts +2 -1
  144. package/dist/server/bare/ops/transcribe.js +59 -34
  145. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +6 -0
  146. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +30 -0
  147. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +32 -0
  148. package/dist/server/bare/plugins/ggml-classification/plugin.js +55 -0
  149. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +3 -0
  150. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +12 -0
  151. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +3 -0
  152. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +75 -0
  153. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +54 -0
  154. package/dist/server/bare/plugins/ggml-vla/plugin.js +57 -0
  155. package/dist/server/bare/plugins/index.d.ts +3 -1
  156. package/dist/server/bare/plugins/index.js +3 -1
  157. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +3 -0
  158. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +29 -0
  159. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +65 -0
  160. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -0
  161. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +26 -0
  162. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +25 -0
  163. package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +5 -0
  164. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +67 -246
  165. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +66 -97
  166. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -0
  167. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +199 -0
  168. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +200 -2
  169. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +61 -8
  170. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.js +2 -15
  171. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.js +2 -1
  172. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +75 -0
  173. package/dist/server/bare/plugins/tts-ggml/plugin.js +189 -0
  174. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +29 -4
  175. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +12 -1
  176. package/dist/server/bare/registry/model-config-utils.js +7 -0
  177. package/dist/server/bare/runtime/request-context.d.ts +1 -1
  178. package/dist/server/bare/runtime-lifecycle.js +9 -9
  179. package/dist/server/bare/types/addon-responses.d.ts +1 -0
  180. package/dist/server/env.js +4 -1
  181. package/dist/server/plugins/index.d.ts +1 -1
  182. package/dist/server/plugins/index.js +1 -1
  183. package/dist/server/plugins/registry.d.ts +1 -0
  184. package/dist/server/plugins/registry.js +5 -0
  185. package/dist/server/rpc/handler-registry.js +4 -0
  186. package/dist/server/rpc/handler-selection.d.ts +9 -0
  187. package/dist/server/rpc/handler-selection.js +14 -0
  188. package/dist/server/rpc/handler-utils.js +5 -13
  189. package/dist/server/rpc/handlers/classify.d.ts +3 -0
  190. package/dist/server/rpc/handlers/classify.js +4 -0
  191. package/dist/server/rpc/handlers/index.d.ts +2 -0
  192. package/dist/server/rpc/handlers/index.js +2 -0
  193. package/dist/server/rpc/handlers/load-model/handler.js +4 -1
  194. package/dist/server/rpc/handlers/load-model/resolve.js +9 -0
  195. package/dist/server/rpc/handlers/video-stream.d.ts +3 -0
  196. package/dist/server/rpc/handlers/video-stream.js +4 -0
  197. package/dist/server/rpc/profiling/operation-metrics.js +23 -0
  198. package/dist/server/utils/config-transform.js +1 -1
  199. package/dist/server/utils/tools/parsers/qwen35.js +7 -3
  200. package/dist/server/worker.js +14 -11
  201. package/dist/utils/errors-client.d.ts +23 -0
  202. package/dist/utils/errors-client.js +40 -0
  203. package/dist/utils/errors-server.d.ts +30 -2
  204. package/dist/utils/errors-server.js +51 -3
  205. package/package.json +66 -80
  206. package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -490
  207. package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -272
  208. package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
  209. package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
  210. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.d.ts +0 -0
  211. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.d.ts +0 -0
@@ -1,28 +1,31 @@
1
- import { loadModel, unloadModel, transcribe, PARAKEET_TDT_ENCODER_FP32, PARAKEET_TDT_DECODER_FP32, PARAKEET_TDT_VOCAB, PARAKEET_TDT_PREPROCESSOR_FP32, } from "@qvac/sdk";
1
+ /**
2
+ * Parakeet TDT transcription from a WAV file.
3
+ *
4
+ * Usage:
5
+ * bun run examples/transcription/parakeet-tdt-filesystem.ts <wav-file> [parakeet-tdt-gguf]
6
+ *
7
+ * Loads a single GGUF checkpoint (`PARAKEET_TDT_0_6B_V3_Q8_0` by default) and
8
+ * transcribes the file with the batch `transcribe` API. Omit the model
9
+ * argument to use the registry constant.
10
+ *
11
+ * Audio should be 16 kHz mono PCM in a WAV container.
12
+ */
13
+ import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0, } from "@qvac/sdk";
2
14
  const args = process.argv.slice(2);
3
15
  if (!args[0]) {
4
16
  console.error("Usage: bun run examples/transcription/parakeet-tdt-filesystem.ts <wav-file-path> " +
5
- "[encoder-onnx] [decoder-onnx] [vocab-txt] [preprocessor-onnx]");
6
- console.error("\nIf model paths are omitted, defaults to registry models.");
17
+ "[parakeet-tdt-gguf]");
18
+ console.error("\nIf the model path is omitted, defaults to the registry model.");
7
19
  process.exit(1);
8
20
  }
9
21
  const audioFilePath = args[0];
10
- const parakeetEncoderSrc = args[1] ?? PARAKEET_TDT_ENCODER_FP32;
11
- const parakeetDecoderSrc = args[2] ?? PARAKEET_TDT_DECODER_FP32;
12
- const parakeetVocabSrc = args[3] ?? PARAKEET_TDT_VOCAB;
13
- const parakeetPreprocessorSrc = args[4] ?? PARAKEET_TDT_PREPROCESSOR_FP32;
22
+ const parakeetModelSrc = args[1] ?? PARAKEET_TDT_0_6B_V3_Q8_0;
14
23
  try {
15
24
  console.log("Starting Parakeet transcription example...");
16
25
  console.log("Loading Parakeet model...");
17
26
  const modelId = await loadModel({
18
- modelSrc: parakeetEncoderSrc,
27
+ modelSrc: parakeetModelSrc,
19
28
  modelType: "parakeet",
20
- modelConfig: {
21
- parakeetEncoderSrc,
22
- parakeetDecoderSrc,
23
- parakeetVocabSrc,
24
- parakeetPreprocessorSrc,
25
- },
26
29
  onProgress: (progress) => {
27
30
  console.log(`Download progress: ${progress.percentage.toFixed(1)}%`);
28
31
  },
@@ -37,6 +40,6 @@ try {
37
40
  console.log("Parakeet model unloaded successfully");
38
41
  }
39
42
  catch (error) {
40
- console.error("Error:", error);
43
+ console.error("❌ Error:", error);
41
44
  process.exit(1);
42
45
  }
@@ -90,7 +90,12 @@ try {
90
90
  }
91
91
  break;
92
92
  case "endOfTurn":
93
- console.log(`[endOfTurn] silence ${event.silenceDurationMs}ms — turn complete\n`);
93
+ if (event.source === "whisper") {
94
+ console.log(`[endOfTurn] silence ${event.silenceDurationMs}ms — turn complete\n`);
95
+ }
96
+ else {
97
+ console.log(`[endOfTurn] turn complete (token-driven EOU)\n`);
98
+ }
94
99
  break;
95
100
  }
96
101
  }
@@ -1,28 +1,19 @@
1
- import { loadModel, textToSpeech, unloadModel, TTS_TOKENIZER_EN_CHATTERBOX, TTS_SPEECH_ENCODER_EN_CHATTERBOX_FP32, TTS_EMBED_TOKENS_EN_CHATTERBOX_FP32, TTS_CONDITIONAL_DECODER_EN_CHATTERBOX_FP32, TTS_LANGUAGE_MODEL_EN_CHATTERBOX_FP32, } from "@qvac/sdk";
1
+ import { loadModel, textToSpeech, unloadModel, TTS_T3_TURBO_EN_CHATTERBOX_Q8_0, TTS_S3GEN_EN_CHATTERBOX, } from "@qvac/sdk";
2
2
  import { createWav, playAudio, int16ArrayToBuffer, createWavHeader, } from "./utils.js";
3
- // Chatterbox TTS: voice cloning with reference audio.
4
- // Uses registry model constants - downloads automatically from QVAC Registry.
5
- // Only reference audio WAV needs to be provided by the user.
6
- // Usage: node chatterbox-filesystem.js <referenceAudioSrc>
3
+ // Chatterbox TTS (GGML): voice cloning with optional reference audio.
4
+ // Uses registry model constants — downloads automatically from QVAC Registry.
5
+ // Usage: node chatterbox.ts [referenceAudioSrc]
7
6
  const [referenceAudioSrc] = process.argv.slice(2);
8
- if (!referenceAudioSrc) {
9
- console.error("Usage: node chatterbox-filesystem.js <referenceAudioSrc>");
10
- process.exit(1);
11
- }
12
7
  const CHATTERBOX_SAMPLE_RATE = 24000;
13
8
  try {
14
9
  const modelId = await loadModel({
15
- modelSrc: TTS_TOKENIZER_EN_CHATTERBOX.src,
10
+ modelSrc: TTS_T3_TURBO_EN_CHATTERBOX_Q8_0.src,
16
11
  modelType: "tts",
17
12
  modelConfig: {
18
13
  ttsEngine: "chatterbox",
19
14
  language: "en",
20
- ttsTokenizerSrc: TTS_TOKENIZER_EN_CHATTERBOX.src,
21
- ttsSpeechEncoderSrc: TTS_SPEECH_ENCODER_EN_CHATTERBOX_FP32.src,
22
- ttsEmbedTokensSrc: TTS_EMBED_TOKENS_EN_CHATTERBOX_FP32.src,
23
- ttsConditionalDecoderSrc: TTS_CONDITIONAL_DECODER_EN_CHATTERBOX_FP32.src,
24
- ttsLanguageModelSrc: TTS_LANGUAGE_MODEL_EN_CHATTERBOX_FP32.src,
25
- referenceAudioSrc,
15
+ s3genModelSrc: TTS_S3GEN_EN_CHATTERBOX.src,
16
+ ...(referenceAudioSrc ? { referenceAudioSrc } : {}),
26
17
  },
27
18
  onProgress: (progress) => {
28
19
  console.log(progress);
@@ -12,7 +12,7 @@
12
12
  * Usage:
13
13
  * bun run examples/tts/llm-to-tts-streaming.ts
14
14
  */
15
- import { completion, loadModel, textToSpeechStream, unloadModel, LLAMA_3_2_1B_INST_Q4_0, TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE, TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE, } from "@qvac/sdk";
15
+ import { completion, loadModel, textToSpeechStream, unloadModel, LLAMA_3_2_1B_INST_Q4_0, TTS_EN_SUPERTONIC_Q8_0, } from "@qvac/sdk";
16
16
  import { createWav, playPcmInt16Chunk } from "./utils.js";
17
17
  const SUPERTONIC_SAMPLE_RATE = 44100;
18
18
  /**
@@ -69,21 +69,14 @@ try {
69
69
  console.log(`LLM ready: ${llmModelId}`);
70
70
  console.log("Loading Supertonic TTS (registry)…");
71
71
  const ttsModelId = await loadModel({
72
- modelSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
72
+ modelSrc: TTS_EN_SUPERTONIC_Q8_0.src,
73
73
  modelType: "tts",
74
74
  modelConfig: {
75
75
  ttsEngine: "supertonic",
76
76
  language: "en",
77
+ voice: "F1",
77
78
  ttsSpeed: 1.05,
78
79
  ttsNumInferenceSteps: 10,
79
- ttsSupertonicMultilingual: true,
80
- ttsTextEncoderSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
81
- ttsDurationPredictorSrc: TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32.src,
82
- ttsVectorEstimatorSrc: TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32.src,
83
- ttsVocoderSrc: TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32.src,
84
- ttsUnicodeIndexerSrc: TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32.src,
85
- ttsTtsConfigSrc: TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE.src,
86
- ttsVoiceStyleSrc: TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE.src,
87
80
  },
88
81
  onProgress: (progress) => console.log(`TTS load: ${progress.percentage.toFixed(1)}%`),
89
82
  });
@@ -1,25 +1,17 @@
1
- import { loadModel, textToSpeech, unloadModel, TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE, TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE, TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32, } from "@qvac/sdk";
1
+ import { loadModel, textToSpeech, unloadModel, TTS_MULTILINGUAL_SUPERTONIC2_Q8_0, } from "@qvac/sdk";
2
2
  import { createWav, playAudio, int16ArrayToBuffer, createWavHeader, } from "./utils.js";
3
- // Supertonic TTS: general-purpose, no voice cloning.
4
- // Uses registry model constants - downloads automatically from QVAC Registry.
3
+ // Supertonic 2 TTS (GGML): multilingual synthesis (en/ko/es/pt/fr).
5
4
  const SUPERTONIC_SAMPLE_RATE = 44100;
6
5
  try {
7
6
  const modelId = await loadModel({
8
- modelSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
7
+ modelSrc: TTS_MULTILINGUAL_SUPERTONIC2_Q8_0.src,
9
8
  modelType: "tts",
10
9
  modelConfig: {
11
10
  ttsEngine: "supertonic",
12
11
  language: "es",
12
+ voice: "F1",
13
13
  ttsSpeed: 1.05,
14
14
  ttsNumInferenceSteps: 5,
15
- ttsSupertonicMultilingual: true, //false for English quality.
16
- ttsTextEncoderSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
17
- ttsDurationPredictorSrc: TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32.src,
18
- ttsVectorEstimatorSrc: TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32.src,
19
- ttsVocoderSrc: TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32.src,
20
- ttsUnicodeIndexerSrc: TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32.src,
21
- ttsTtsConfigSrc: TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE.src,
22
- ttsVoiceStyleSrc: TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE.src,
23
15
  },
24
16
  onProgress: (progress) => {
25
17
  console.log(progress);
@@ -1,25 +1,18 @@
1
- import { loadModel, textToSpeech, unloadModel, TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE, TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE, } from "@qvac/sdk";
1
+ import { loadModel, textToSpeech, unloadModel, TTS_EN_SUPERTONIC_Q8_0, } from "@qvac/sdk";
2
2
  import { createWav, playAudio, int16ArrayToBuffer, createWavHeader, } from "./utils.js";
3
- // Supertonic TTS: general-purpose, no voice cloning.
4
- // Uses registry model constants - downloads automatically from QVAC Registry.
3
+ // Supertonic TTS (GGML): fast English synthesis with baked-in voices.
4
+ // Uses registry model constants — downloads automatically from QVAC Registry.
5
5
  const SUPERTONIC_SAMPLE_RATE = 44100;
6
6
  try {
7
7
  const modelId = await loadModel({
8
- modelSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
8
+ modelSrc: TTS_EN_SUPERTONIC_Q8_0.src,
9
9
  modelType: "tts",
10
10
  modelConfig: {
11
11
  ttsEngine: "supertonic",
12
12
  language: "en",
13
+ voice: "F1",
13
14
  ttsSpeed: 1.05,
14
15
  ttsNumInferenceSteps: 5,
15
- ttsSupertonicMultilingual: true,
16
- ttsTextEncoderSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
17
- ttsDurationPredictorSrc: TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32.src,
18
- ttsVectorEstimatorSrc: TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32.src,
19
- ttsVocoderSrc: TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32.src,
20
- ttsUnicodeIndexerSrc: TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32.src,
21
- ttsTtsConfigSrc: TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE.src,
22
- ttsVoiceStyleSrc: TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE.src,
23
16
  },
24
17
  onProgress: (progress) => {
25
18
  console.log(progress);
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=vla-smolvla.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * SmolVLA (vision-language-action) example using the QVAC SDK.
3
+ *
4
+ * Loads the SmolVLA-LIBERO GGUF model, runs a single inference pass with
5
+ * synthetic inputs (zero-filled gray images + BOS-only tokens + zero state +
6
+ * zero noise), and prints the produced action chunk + per-stage timings.
7
+ *
8
+ * Usage:
9
+ * bun examples/vla-smolvla.ts [path-to-smolvla.gguf]
10
+ *
11
+ * By default the example pulls the registry-baked SmolVLA-LIBERO GGUF
12
+ * (~1.9 GB) on first run and caches it locally. Pass an absolute path on
13
+ * the command line to override and load a local GGUF instead.
14
+ */
15
+ import { close, loadModel, SMOLVLA_LIBERO_VISION_Q8, unloadModel, vla, vlaHparams, vlaPadState, vlaPreprocessImage, } from "@qvac/sdk";
16
+ const modelSrcOverride = process.argv[2];
17
+ const modelSrc = modelSrcOverride ?? SMOLVLA_LIBERO_VISION_Q8;
18
+ try {
19
+ console.log("Loading SmolVLA model...");
20
+ const modelId = await loadModel({
21
+ modelSrc,
22
+ modelType: "vla",
23
+ modelConfig: { backend: "cpu" },
24
+ onProgress: (p) => typeof modelSrc === "string"
25
+ ? undefined
26
+ : process.stdout.write(`\rDownloading: ${p.percentage.toFixed(1)}%`),
27
+ });
28
+ if (typeof modelSrc !== "string")
29
+ process.stdout.write("\n");
30
+ console.log(`Model loaded: ${modelId}`);
31
+ const { hparams, backendName } = await vlaHparams({ modelId });
32
+ console.log(`Backend: ${backendName ?? "(unknown)"}`);
33
+ console.log("Hparams:", hparams);
34
+ // Build synthetic inputs sized to the model's expectations. A real
35
+ // consumer would: read camera frames, tokenize the instruction with the
36
+ // SmolVLM2 tokenizer, and read the robot's current end-effector pose.
37
+ const size = hparams.visionImageSize;
38
+ const dummyPixels = new Uint8Array(size * size * 3).fill(128);
39
+ const front = vlaPreprocessImage(dummyPixels, size, size, { size });
40
+ const wrist = vlaPreprocessImage(dummyPixels, size, size, { size });
41
+ const tokens = new Int32Array(hparams.tokenizerMaxLength);
42
+ const mask = new Uint8Array(hparams.tokenizerMaxLength);
43
+ // BOS-only "instruction" for the smoke test.
44
+ tokens[0] = 1;
45
+ mask[0] = 1;
46
+ const state = vlaPadState([0, 0, 0, 0, 0, 0], hparams.maxStateDim);
47
+ const noise = new Float32Array(hparams.chunkSize * hparams.maxActionDim);
48
+ console.log("Running VLA inference...");
49
+ const { actions, actionDim, chunkSize, stats } = await vla({
50
+ modelId,
51
+ images: [front, wrist],
52
+ imgWidth: size,
53
+ imgHeight: size,
54
+ state,
55
+ tokens,
56
+ mask,
57
+ noise,
58
+ });
59
+ console.log(`Got ${chunkSize} action steps of dim ${actionDim}.`);
60
+ console.log("First step:", Array.from(actions.subarray(0, actionDim)));
61
+ if (stats) {
62
+ console.log(`Timing: vision=${stats.vision_ms?.toFixed(0)}ms ` +
63
+ `smollm2=${stats.smollm2_total_ms?.toFixed(0)}ms ` +
64
+ `ode=${stats.ode_ms?.toFixed(0)}ms ` +
65
+ `total=${stats.total_ms?.toFixed(0)}ms`);
66
+ }
67
+ await unloadModel({ modelId, clearStorage: false });
68
+ console.log("Model unloaded.");
69
+ process.exit(0);
70
+ }
71
+ catch (error) {
72
+ console.error("VLA example failed:", error);
73
+ await close();
74
+ process.exit(1);
75
+ }
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Requirements: FFmpeg installed, microphone access, speakers.
12
12
  */
13
- import { loadModel, unloadModel, transcribeStream, completion, textToSpeech, WHISPER_TINY, VAD_SILERO_5_1_2, LLAMA_3_2_1B_INST_Q4_0, TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32, TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE, TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE, } from "@qvac/sdk";
13
+ import { loadModel, unloadModel, transcribeStream, completion, textToSpeech, WHISPER_TINY, VAD_SILERO_5_1_2, LLAMA_3_2_1B_INST_Q4_0, TTS_EN_SUPERTONIC_Q8_0, } from "@qvac/sdk";
14
14
  import { spawnSync } from "child_process";
15
15
  import { startMicrophone } from "../audio/mic-input";
16
16
  import { createWavHeader, int16ArrayToBuffer, playAudio } from "../tts/utils";
@@ -100,21 +100,14 @@ const llmModelId = await loadModel({
100
100
  });
101
101
  console.log("Loading Supertonic TTS...");
102
102
  const ttsModelId = await loadModel({
103
- modelSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
103
+ modelSrc: TTS_EN_SUPERTONIC_Q8_0.src,
104
104
  modelType: "tts",
105
105
  modelConfig: {
106
106
  ttsEngine: "supertonic",
107
107
  language: "en",
108
+ voice: "F1",
108
109
  ttsSpeed: 1.05,
109
110
  ttsNumInferenceSteps: 5,
110
- ttsSupertonicMultilingual: false,
111
- ttsTextEncoderSrc: TTS_SUPERTONIC2_OFFICIAL_TEXT_ENCODER_SUPERTONE_FP32.src,
112
- ttsDurationPredictorSrc: TTS_SUPERTONIC2_OFFICIAL_DURATION_PREDICTOR_SUPERTONE_FP32.src,
113
- ttsVectorEstimatorSrc: TTS_SUPERTONIC2_OFFICIAL_VECTOR_ESTIMATOR_SUPERTONE_FP32.src,
114
- ttsVocoderSrc: TTS_SUPERTONIC2_OFFICIAL_VOCODER_SUPERTONE_FP32.src,
115
- ttsUnicodeIndexerSrc: TTS_SUPERTONIC2_OFFICIAL_UNICODE_INDEXER_SUPERTONE_FP32.src,
116
- ttsTtsConfigSrc: TTS_SUPERTONIC2_OFFICIAL_TTS_CONFIG_SUPERTONE.src,
117
- ttsVoiceStyleSrc: TTS_SUPERTONIC2_OFFICIAL_VOICE_STYLE_SUPERTONE.src,
118
111
  },
119
112
  });
120
113
  console.log("All models loaded.\n");
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Walks from `startDir` up to the filesystem root, returning the first
3
+ * `<dir>/node_modules/<name>` that exists, or `null`. Matches Node's own
4
+ * module resolution so packages hoisted to a monorepo root (e.g. by bun or
5
+ * yarn workspaces) are found from a nested project directory.
6
+ *
7
+ * Use this as the building block for any plugin lookup that historically
8
+ * checked only `<projectRoot>/node_modules`. For SDK resolution specifically
9
+ * use `resolveSDKPackageDir`, which layers multi-package disambiguation and
10
+ * shadowed-copy warnings on top of this.
11
+ */
12
+ declare function findInAncestorNodeModules(startDir: string, name: string): string | null;
13
+ export { findInAncestorNodeModules };
14
+ //# sourceMappingURL=find-in-ancestor-node-modules.d.ts.map
@@ -0,0 +1,24 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ /**
4
+ * Walks from `startDir` up to the filesystem root, returning the first
5
+ * `<dir>/node_modules/<name>` that exists, or `null`. Matches Node's own
6
+ * module resolution so packages hoisted to a monorepo root (e.g. by bun or
7
+ * yarn workspaces) are found from a nested project directory.
8
+ *
9
+ * Use this as the building block for any plugin lookup that historically
10
+ * checked only `<projectRoot>/node_modules`. For SDK resolution specifically
11
+ * use `resolveSDKPackageDir`, which layers multi-package disambiguation and
12
+ * shadowed-copy warnings on top of this.
13
+ */
14
+ function findInAncestorNodeModules(startDir, name) {
15
+ let dir = startDir;
16
+ let parent = path.dirname(dir);
17
+ for (; dir !== parent; dir = parent, parent = path.dirname(dir)) {
18
+ const candidate = path.join(dir, "node_modules", name);
19
+ if (fs.existsSync(candidate))
20
+ return candidate;
21
+ }
22
+ return null;
23
+ }
24
+ export { findInAncestorNodeModules };
@@ -0,0 +1,22 @@
1
+ import type { ExportedConfigWithProps } from "@expo/config-plugins";
2
+ import type { ExpoConfig } from "expo/config";
3
+ /**
4
+ * `projectRoot` resolution in Expo plugins depends on plugin type:
5
+ *
6
+ * - **Mod plugins** (callbacks passed to `withDangerousMod` etc.) receive an
7
+ * `ExportedConfigWithProps<...>` whose `modRequest.projectRoot` is the
8
+ * documented public API for the consumer's project directory.
9
+ * - **Base plugins** (called with the bare `ExpoConfig`) run before any mod
10
+ * cycle and have no `modRequest`. The only way to recover the project root
11
+ * is the (undocumented but stable) `_internal.projectRoot` escape hatch
12
+ * Expo's config-plugins runtime attaches to the config it hands plugins.
13
+ *
14
+ * Both helpers exist so the two access patterns are picked deliberately —
15
+ * call the one that matches the plugin shape you're in. Don't reach into the
16
+ * raw fields directly; that's how `withMobileBundle` and `withDeviceInfo`
17
+ * silently disagreed on which directory they were resolving against.
18
+ */
19
+ declare function getProjectRootFromMod(config: ExportedConfigWithProps<unknown>): string;
20
+ declare function getProjectRootFromBaseConfig(config: ExpoConfig): string | undefined;
21
+ export { getProjectRootFromMod, getProjectRootFromBaseConfig };
22
+ //# sourceMappingURL=get-project-root.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `projectRoot` resolution in Expo plugins depends on plugin type:
3
+ *
4
+ * - **Mod plugins** (callbacks passed to `withDangerousMod` etc.) receive an
5
+ * `ExportedConfigWithProps<...>` whose `modRequest.projectRoot` is the
6
+ * documented public API for the consumer's project directory.
7
+ * - **Base plugins** (called with the bare `ExpoConfig`) run before any mod
8
+ * cycle and have no `modRequest`. The only way to recover the project root
9
+ * is the (undocumented but stable) `_internal.projectRoot` escape hatch
10
+ * Expo's config-plugins runtime attaches to the config it hands plugins.
11
+ *
12
+ * Both helpers exist so the two access patterns are picked deliberately —
13
+ * call the one that matches the plugin shape you're in. Don't reach into the
14
+ * raw fields directly; that's how `withMobileBundle` and `withDeviceInfo`
15
+ * silently disagreed on which directory they were resolving against.
16
+ */
17
+ function getProjectRootFromMod(config) {
18
+ return config.modRequest.projectRoot;
19
+ }
20
+ function getProjectRootFromBaseConfig(config) {
21
+ return config._internal?.["projectRoot"];
22
+ }
23
+ export { getProjectRootFromMod, getProjectRootFromBaseConfig };
@@ -4,5 +4,9 @@ export { default as withDeviceInfo } from "./withDeviceInfo";
4
4
  export { default as withMobileBundle } from "./withMobileBundle";
5
5
  export { default as withOpenCL } from "./withOpenCL";
6
6
  export { default as withQvacSDK } from "./withQvacSDK";
7
+ export { getProjectRootFromMod, getProjectRootFromBaseConfig, } from "./get-project-root";
8
+ export { resolveSDKPackageDir, SDK_PACKAGE_NAMES, } from "./resolve-sdk-package-dir";
9
+ export type { SDKPackageInfo } from "./resolve-sdk-package-dir";
10
+ export { findInAncestorNodeModules } from "./find-in-ancestor-node-modules";
7
11
  export { default } from "./withQvacSDK";
8
12
  //# sourceMappingURL=index.d.ts.map
@@ -4,5 +4,9 @@ export { default as withDeviceInfo } from "./withDeviceInfo.js";
4
4
  export { default as withMobileBundle } from "./withMobileBundle.js";
5
5
  export { default as withOpenCL } from "./withOpenCL.js";
6
6
  export { default as withQvacSDK } from "./withQvacSDK.js";
7
+ // Helpers for downstream plugin authors composing on top of these plugins.
8
+ export { getProjectRootFromMod, getProjectRootFromBaseConfig, } from "./get-project-root.js";
9
+ export { resolveSDKPackageDir, SDK_PACKAGE_NAMES, } from "./resolve-sdk-package-dir.js";
10
+ export { findInAncestorNodeModules } from "./find-in-ancestor-node-modules.js";
7
11
  // Export the main plugin as default for easy usage
8
12
  export { default } from "./withQvacSDK.js";
@@ -6,8 +6,15 @@ type SDKPackageInfo = {
6
6
  /**
7
7
  * Resolves the installed SDK package directory from node_modules.
8
8
  *
9
- * Checks all known published package names and returns the one that exists.
10
- * Throws if none found or if multiple are found (ambiguous installation).
9
+ * Walks from `projectRoot` up to the filesystem root, checking each
10
+ * `node_modules` directory along the way. This matches Node's own module
11
+ * resolution so packages hoisted to a monorepo root (e.g. by bun or yarn
12
+ * workspaces) are found correctly.
13
+ *
14
+ * When multiple SDK installs are found across the tree, the one closest to
15
+ * `projectRoot` wins and a warning lists the others. Only throws
16
+ * `MultipleSDKInstallationsError` when two *different* SDK package names
17
+ * coexist at the same nesting level (a real ambiguity in package selection).
11
18
  */
12
19
  declare function resolveSDKPackageDir(projectRoot: string): SDKPackageInfo;
13
20
  export { resolveSDKPackageDir, SDK_PACKAGE_NAMES };
@@ -6,26 +6,53 @@ const SDK_PACKAGE_NAMES = [
6
6
  "@tetherto/sdk-mono",
7
7
  "@tetherto/sdk-dev",
8
8
  ];
9
+ function findAllInAncestorNodeModules(startDir, name) {
10
+ const matches = [];
11
+ let dir = startDir;
12
+ let parent = path.dirname(dir);
13
+ let depth = 0;
14
+ for (; dir !== parent; dir = parent, parent = path.dirname(dir), depth++) {
15
+ const candidate = path.join(dir, "node_modules", name);
16
+ if (fs.existsSync(candidate)) {
17
+ matches.push({ name, dir: candidate, depth });
18
+ }
19
+ }
20
+ return matches;
21
+ }
9
22
  /**
10
23
  * Resolves the installed SDK package directory from node_modules.
11
24
  *
12
- * Checks all known published package names and returns the one that exists.
13
- * Throws if none found or if multiple are found (ambiguous installation).
25
+ * Walks from `projectRoot` up to the filesystem root, checking each
26
+ * `node_modules` directory along the way. This matches Node's own module
27
+ * resolution so packages hoisted to a monorepo root (e.g. by bun or yarn
28
+ * workspaces) are found correctly.
29
+ *
30
+ * When multiple SDK installs are found across the tree, the one closest to
31
+ * `projectRoot` wins and a warning lists the others. Only throws
32
+ * `MultipleSDKInstallationsError` when two *different* SDK package names
33
+ * coexist at the same nesting level (a real ambiguity in package selection).
14
34
  */
15
35
  function resolveSDKPackageDir(projectRoot) {
16
- const found = [];
36
+ const allMatches = [];
17
37
  for (const name of SDK_PACKAGE_NAMES) {
18
- const dir = path.join(projectRoot, "node_modules", name);
19
- if (fs.existsSync(dir)) {
20
- found.push({ name, dir });
21
- }
38
+ allMatches.push(...findAllInAncestorNodeModules(projectRoot, name));
22
39
  }
23
- if (found.length === 0) {
40
+ if (allMatches.length === 0) {
24
41
  throw new SDKNotFoundInNodeModulesError();
25
42
  }
26
- if (found.length > 1) {
27
- throw new MultipleSDKInstallationsError(found.map((f) => f.name).join(", "));
43
+ const minDepth = Math.min(...allMatches.map((m) => m.depth));
44
+ const closest = allMatches.filter((m) => m.depth === minDepth);
45
+ if (closest.length > 1) {
46
+ throw new MultipleSDKInstallationsError(closest.map((m) => m.name).join(", "));
47
+ }
48
+ const winner = closest[0];
49
+ const shadowed = allMatches.filter((m) => m !== winner);
50
+ if (shadowed.length > 0) {
51
+ const others = shadowed.map((m) => `"${m.name}" at "${m.dir}"`).join(", ");
52
+ console.warn(`[resolveSDKPackageDir] Multiple SDK installations found; using ` +
53
+ `"${winner.name}" at "${winner.dir}" (closest to projectRoot). ` +
54
+ `Ignoring: ${others}.`);
28
55
  }
29
- return found[0];
56
+ return { name: winner.name, dir: winner.dir };
30
57
  }
31
58
  export { resolveSDKPackageDir, SDK_PACKAGE_NAMES };
@@ -1,6 +1,7 @@
1
1
  import * as fs from "fs";
2
2
  import * as path from "path";
3
3
  import { resolveSDKPackageDir } from "./resolve-sdk-package-dir.js";
4
+ import { getProjectRootFromBaseConfig } from "./get-project-root.js";
4
5
  let didRun = false;
5
6
  /**
6
7
  * Expo plugin that stubs expo-device-info when expo-device is not a declared
@@ -13,7 +14,7 @@ function withDeviceInfo(config) {
13
14
  return config;
14
15
  }
15
16
  didRun = true;
16
- const projectRoot = config._internal?.["projectRoot"];
17
+ const projectRoot = getProjectRootFromBaseConfig(config);
17
18
  if (!projectRoot) {
18
19
  return config;
19
20
  }
@@ -3,25 +3,10 @@ declare const MOBILE_HOSTS: string[];
3
3
  /**
4
4
  * Expo plugin: bundle, verify, then copy the mobile worker bundle.
5
5
  *
6
- * Flow: `bundle sdk` -> assert `qvac/worker.bundle.js` exists ->
7
- * `verify bundle` -> copy to `<sdkPackageDir>/dist/worker.mobile.bundle.js`.
8
- * Requires a local `@qvac/cli` install. Uses `qvac.config.*` if present.
6
+ * Flow: bundleSdk -> verifyBundle -> copy to `<sdkPackageDir>/dist/worker.mobile.bundle.js`.
7
+ * Uses `qvac.config.*` if present.
9
8
  */
10
9
  declare function withMobileBundle(config: ExpoConfig): ExpoConfig;
11
- /**
12
- * Resolves the qvac CLI command.
13
- *
14
- * Prefers local @qvac/cli installation for version consistency,
15
- * falls back to npx for convenience when CLI is not installed.
16
- */
17
- export declare function resolveCliCommand(projectRoot: string): string;
18
- /** Builds the `qvac verify bundle` command string (pure helper for tests). */
19
- export declare function buildVerifyBundleCommand(opts: {
20
- cliCommand: string;
21
- bundlePath: string;
22
- hosts: string[];
23
- configPath?: string;
24
- }): string;
25
10
  export { MOBILE_HOSTS };
26
11
  export default withMobileBundle;
27
12
  //# sourceMappingURL=withMobileBundle.d.ts.map