@qvac/sdk 0.21.1 → 0.22.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 (167) hide show
  1. package/NOTICE +84 -55
  2. package/README.md +167 -24
  3. package/dist/examples/abot-world.js +1 -1
  4. package/dist/examples/advisory-model-fit.d.ts +0 -58
  5. package/dist/examples/advisory-model-fit.js +23 -150
  6. package/dist/examples/asr/moss-transcribe-filesystem.d.ts +2 -0
  7. package/dist/examples/asr/moss-transcribe-filesystem.js +84 -0
  8. package/dist/examples/asr/moss-transcribe-fit.d.ts +2 -0
  9. package/dist/examples/asr/moss-transcribe-fit.js +40 -0
  10. package/dist/examples/asr/nemotron-diarization-filesystem.d.ts +2 -0
  11. package/dist/examples/asr/nemotron-diarization-filesystem.js +64 -0
  12. package/dist/examples/asr/parakeet-ctc-filesystem.js +2 -2
  13. package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +2 -2
  14. package/dist/examples/asr/parakeet-microphone-record.js +1 -1
  15. package/dist/examples/asr/parakeet-microphone-stream.js +1 -1
  16. package/dist/examples/asr/parakeet-nemotron-filesystem.js +3 -3
  17. package/dist/examples/asr/parakeet-sortformer-streaming.js +2 -2
  18. package/dist/examples/asr/parakeet-sortformer.js +1 -1
  19. package/dist/examples/asr/parakeet-tdt-filesystem-chunked.js +2 -2
  20. package/dist/examples/asr/parakeet-tdt-filesystem.js +2 -2
  21. package/dist/examples/asr/parakeet-unified-coreml.js +2 -2
  22. package/dist/examples/asr/parakeet-unified-filesystem.js +2 -2
  23. package/dist/examples/asr/whispercpp-filesystem-streaming.js +1 -1
  24. package/dist/examples/asr/whispercpp-filesystem.js +1 -1
  25. package/dist/examples/asr/whispercpp-microphone-record.js +1 -1
  26. package/dist/examples/asr/whispercpp-prompt.js +1 -1
  27. package/dist/examples/assess-model-fit.js +3 -6
  28. package/dist/examples/audiogen/edit-music.js +2 -2
  29. package/dist/examples/audiogen/generate-cover.js +2 -2
  30. package/dist/examples/audiogen/generate-music-minimax.js +1 -1
  31. package/dist/examples/audiogen/generate-music.js +1 -1
  32. package/dist/examples/audiogen/understand-music.js +2 -2
  33. package/dist/examples/batch-completion.d.ts +1 -1
  34. package/dist/examples/batch-completion.js +1 -1
  35. package/dist/examples/bci/bci-filesystem-streaming.js +2 -2
  36. package/dist/examples/bci/bci-filesystem.js +2 -2
  37. package/dist/examples/concurrent-completion-collision.js +1 -1
  38. package/dist/examples/config-reload.js +1 -1
  39. package/dist/examples/decisions.d.ts +2 -0
  40. package/dist/examples/decisions.js +38 -0
  41. package/dist/examples/diffusion-esrgan-upscale.js +1 -1
  42. package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
  43. package/dist/examples/diffusion-img2img.js +1 -1
  44. package/dist/examples/diffusion-img2vid-ltx.js +1 -1
  45. package/dist/examples/diffusion-img2vid-minimax-h3.d.ts +2 -0
  46. package/dist/examples/diffusion-img2vid-minimax-h3.js +72 -0
  47. package/dist/examples/diffusion-img2vid.js +1 -1
  48. package/dist/examples/llamacpp-filesystem.js +1 -1
  49. package/dist/examples/llamacpp-multi-gpu.js +2 -2
  50. package/dist/examples/llamacpp-structured-output.js +1 -1
  51. package/dist/examples/mcp-websearch.d.ts +2 -2
  52. package/dist/examples/mcp-websearch.js +3 -3
  53. package/dist/examples/model-fit-ui/server.d.ts +1 -1
  54. package/dist/examples/model-fit-ui/server.js +1 -1
  55. package/dist/examples/multi-job-completion.d.ts +1 -1
  56. package/dist/examples/multi-job-completion.js +1 -1
  57. package/dist/examples/ocr-fasttext.js +1 -1
  58. package/dist/examples/tools/llamacpp-tools-auto-dialect.js +1 -1
  59. package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
  60. package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
  61. package/dist/examples/tts/llm-to-tts-streaming.d.ts +2 -2
  62. package/dist/examples/tts/llm-to-tts-streaming.js +2 -2
  63. package/dist/examples/tts/moss-sound-effect-controls.d.ts +2 -0
  64. package/dist/examples/tts/moss-sound-effect-controls.js +88 -0
  65. package/dist/examples/tts/moss-sound-effect.d.ts +2 -0
  66. package/dist/examples/tts/moss-sound-effect.js +86 -0
  67. package/dist/examples/tts/moss-speech-audio.d.ts +2 -0
  68. package/dist/examples/tts/moss-speech-audio.js +159 -0
  69. package/dist/examples/tts/moss-speech.d.ts +2 -0
  70. package/dist/examples/tts/moss-speech.js +70 -0
  71. package/dist/examples/vla-groot.js +2 -2
  72. package/dist/examples/vla-pi05.js +2 -2
  73. package/dist/examples/vla-smolvla.js +2 -2
  74. package/dist/examples/voice-assistant/voice-assistant.js +1 -1
  75. package/dist/scripts/contract/build-contract.d.ts +3 -1
  76. package/dist/scripts/contract/build-contract.js +40 -2
  77. package/dist/scripts/contract/build-model-type-maps.d.ts +6 -1
  78. package/dist/scripts/contract/build-model-type-maps.js +3 -2
  79. package/dist/scripts/contract/constants-registry.d.ts +4 -0
  80. package/dist/scripts/contract/constants-registry.js +3 -1
  81. package/dist/scripts/contract/method-shapes.d.ts +1 -0
  82. package/dist/scripts/contract/method-shapes.js +1 -0
  83. package/dist/scripts/export-contract.js +20 -7
  84. package/dist/scripts/run-unit-tests.js +10 -5
  85. package/dist/src/client/api/assess-model-fit.d.ts +5 -5
  86. package/dist/src/client/api/assess-model-fit.js +5 -6
  87. package/dist/src/client/api/audio-edit.d.ts +14 -2
  88. package/dist/src/client/api/audio-edit.js +14 -2
  89. package/dist/src/client/api/audio-gen.d.ts +10 -2
  90. package/dist/src/client/api/audio-gen.js +10 -2
  91. package/dist/src/client/api/audio-understand.d.ts +1 -1
  92. package/dist/src/client/api/audio-understand.js +1 -1
  93. package/dist/src/client/api/batch-completion.js +1 -1
  94. package/dist/src/client/api/completion-stream.js +1 -1
  95. package/dist/src/client/api/decide.d.ts +31 -0
  96. package/dist/src/client/api/decide.js +29 -0
  97. package/dist/src/client/api/index.d.ts +1 -0
  98. package/dist/src/client/api/index.js +1 -0
  99. package/dist/src/client/api/load-model.d.ts +1 -0
  100. package/dist/src/client/api/text-to-speech.d.ts +1 -0
  101. package/dist/src/client/api/text-to-speech.js +15 -22
  102. package/dist/src/client/api/transcribe.js +5 -2
  103. package/dist/src/client/api/video-request.d.ts +5 -5
  104. package/dist/src/client/api/video.d.ts +23 -3
  105. package/dist/src/client/api/video.js +23 -3
  106. package/dist/src/commands/bundle/bare-pack.d.ts +8 -0
  107. package/dist/src/commands/bundle/bare-pack.js +28 -5
  108. package/dist/src/commands/bundle/constants.js +2 -0
  109. package/dist/src/commands/bundle/index.d.ts +7 -6
  110. package/dist/src/commands/bundle/index.js +126 -43
  111. package/dist/src/commands/bundle/manifest.d.ts +2 -0
  112. package/dist/src/commands/bundle/manifest.js +3 -2
  113. package/dist/src/commands/host-prebuilds/index.d.ts +15 -7
  114. package/dist/src/commands/host-prebuilds/index.js +35 -16
  115. package/dist/src/commands/index.d.ts +1 -1
  116. package/dist/src/commands/index.js +1 -1
  117. package/dist/src/commands/verify/addon-source.d.ts +12 -0
  118. package/dist/src/commands/verify/addon-source.js +36 -3
  119. package/dist/src/commands/verify/bare-kit-runtimes.js +2 -1
  120. package/dist/src/commands/verify/node-modules-source.js +10 -1
  121. package/dist/src/{expo/plugins/patches/qvac-platform-addons.d.ts → commands/verify/platform-addons.d.ts} +6 -10
  122. package/dist/src/{expo/plugins/patches/qvac-platform-addons.js → commands/verify/platform-addons.js} +2 -45
  123. package/dist/src/commands/verify/prebuilds.d.ts +7 -10
  124. package/dist/src/commands/verify/prebuilds.js +43 -34
  125. package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
  126. package/dist/src/expo/plugins/link-addons.d.ts +18 -0
  127. package/dist/src/expo/plugins/link-addons.js +65 -0
  128. package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  129. package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  130. package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
  131. package/dist/src/expo/plugins/withMobileBundle.d.ts +11 -21
  132. package/dist/src/expo/plugins/withMobileBundle.js +22 -112
  133. package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
  134. package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -1
  135. package/dist/src/index.d.ts +3 -3
  136. package/dist/src/index.js +2 -2
  137. package/dist/src/logging/base-logger.js +1 -1
  138. package/dist/src/logging/utils.js +1 -1
  139. package/dist/src/pear/pre.js +2 -0
  140. package/dist/src/plugin-ids.d.ts +3 -1
  141. package/dist/src/plugin-ids.js +4 -0
  142. package/dist/src/schemas/public.d.ts +2 -1
  143. package/dist/src/schemas/public.js +2 -1
  144. package/dist/src/schemas/sdk-errors-client.d.ts +3 -0
  145. package/dist/src/schemas/sdk-errors-client.js +16 -0
  146. package/dist/src/schemas/sdk-errors-server.d.ts +1 -0
  147. package/dist/src/schemas/sdk-errors-server.js +5 -0
  148. package/dist/src/utils/errors-client.d.ts +10 -0
  149. package/dist/src/utils/errors-client.js +18 -0
  150. package/dist/src/utils/mcp-adapter.js +12 -8
  151. package/dist/src/utils/tool-helpers.d.ts +1 -1
  152. package/dist/src/utils/tool-helpers.js +20 -52
  153. package/dist/src/worker/create-server.d.ts +1 -0
  154. package/dist/src/worker/create-server.js +5 -0
  155. package/dist/src/worker/index.js +4 -0
  156. package/dist/src/worker/lifecycle.js +9 -1
  157. package/dist/src/worker/plugins/llamacpp-decision.d.ts +2 -0
  158. package/dist/src/worker/plugins/llamacpp-decision.js +1 -0
  159. package/dist/src/worker/plugins/moss-transcribe.d.ts +2 -0
  160. package/dist/src/worker/plugins/moss-transcribe.js +1 -0
  161. package/package.json +39 -35
  162. package/src/electron-forge/index.cjs +12 -71
  163. package/dist/scripts/link-workspace-inference.d.ts +0 -2
  164. package/dist/scripts/link-workspace-inference.js +0 -31
  165. package/src/expo/plugins/patches/android-link.mjs +0 -67
  166. package/src/expo/plugins/patches/ios-link.mjs +0 -67
  167. package/src/expo/plugins/patches/qvac-platform-addons.ts +0 -124
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Public API exports only
2
- export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, video, upscale, worldCreateScene, worldStep, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand } from './client/api/index.js';
2
+ export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, decide, video, upscale, worldCreateScene, worldStep, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand } from './client/api/index.js';
3
3
  export { close } from './client/index.js';
4
4
  export { plugins } from './client/plugins-factory.js';
5
5
  export { VERBOSITY, ASR_BACKEND_IDS, TTS_ENGINES, TTS_PARLER_EMOTIONS, TTS_PACES, TTS_SENTENCE_DELIMITER_PRESETS, TTS_CHATTERBOX_LANGUAGES, TTS_SUPERTONIC_LANGUAGES, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, RAG_ERROR_CODES, VectorIndexStorage, DEFAULT_VECTOR_INDEX_STORAGE, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, AUDIOGEN_ENGINES, AUDIOGEN_TASK_TYPES, AUDIOGEN_TRACKS, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, AUDIOGEN_MAX_AUDIO_CODES, AUDIOGEN_EDIT_OPERATIONS, AUDIOGEN_REPAINT_MODES, definePlugin, defineHandler, defineDuplexHandler, PluginDefinitionInvalidError } from '@qvac/inference/surface';
@@ -10,7 +10,7 @@ export { VERBOSITY, ASR_BACKEND_IDS, TTS_ENGINES, TTS_PARLER_EMOTIONS, TTS_PACES
10
10
  export { SDK_CLIENT_ERROR_CODES } from './schemas/sdk-errors-client.js';
11
11
  export { SDK_SERVER_ERROR_CODES } from './schemas/sdk-errors-server.js';
12
12
  // Built-in plugin ids under the public @qvac/sdk name (see `@/plugin-ids`).
13
- export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './plugin-ids.js';
13
+ export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_DECISION, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_MOSS_TRANSCRIBE, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './plugin-ids.js';
14
14
  export {} from './utils/tool-helpers.js';
15
15
  // Model types - canonical naming with backward-compatible aliases
16
16
  export { MODEL_TYPES, ModelType } from '@qvac/inference/surface';
@@ -1,5 +1,5 @@
1
1
  import QvacLogger, {} from '@qvac/logging';
2
- import { LOG_LEVELS } from '@qvac/logging/constants';
2
+ import { LOG_LEVELS } from '@qvac/logging/constants.js';
3
3
  import { isLevelEnabled, formatArg } from './utils.js';
4
4
  import { registerLogger } from './registry.js';
5
5
  export function createBaseLogger(namespace, options, extensions) {
@@ -1,4 +1,4 @@
1
- import { LEVEL_PRIORITIES, LOG_LEVELS } from '@qvac/logging/constants';
1
+ import { LEVEL_PRIORITIES, LOG_LEVELS } from '@qvac/logging/constants.js';
2
2
  import stringify from 'fast-safe-stringify';
3
3
  export function isLevelEnabled(messageLevel, currentLevel) {
4
4
  // "off" suppresses every emission (console, streams, and transports alike),
@@ -30,6 +30,7 @@ const CONFIG_CANDIDATES = [
30
30
  const BUILTIN_PLUGINS = [
31
31
  '@qvac/sdk/llamacpp-completion/plugin',
32
32
  '@qvac/sdk/llamacpp-embedding/plugin',
33
+ '@qvac/sdk/llamacpp-decision/plugin',
33
34
  '@qvac/sdk/whispercpp-transcription/plugin',
34
35
  '@qvac/sdk/bci-whispercpp-transcription/plugin',
35
36
  '@qvac/sdk/nmtcpp-translation/plugin',
@@ -43,6 +44,7 @@ const BUILTIN_PLUGINS = [
43
44
  const BUILTIN_PLUGIN_EXPORTS = {
44
45
  'llamacpp-completion': 'llmPlugin',
45
46
  'llamacpp-embedding': 'embeddingsPlugin',
47
+ 'llamacpp-decision': 'decisionPlugin',
46
48
  'whispercpp-transcription': 'whisperPlugin',
47
49
  'bci-whispercpp-transcription': 'bciPlugin',
48
50
  'nmtcpp-translation': 'nmtPlugin',
@@ -1,7 +1,9 @@
1
1
  export declare const PLUGIN_LLM: "@qvac/sdk/llamacpp-completion/plugin";
2
+ export declare const PLUGIN_DECISION: "@qvac/sdk/llamacpp-decision/plugin";
2
3
  export declare const PLUGIN_EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
3
4
  export declare const PLUGIN_WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
4
5
  export declare const PLUGIN_BCI: "@qvac/sdk/bci-whispercpp-transcription/plugin";
6
+ export declare const PLUGIN_MOSS_TRANSCRIBE: "@qvac/sdk/moss-transcribe/plugin";
5
7
  export declare const PLUGIN_NMT: "@qvac/sdk/nmtcpp-translation/plugin";
6
8
  export declare const PLUGIN_TTS: "@qvac/sdk/tts-ggml/plugin";
7
9
  export declare const PLUGIN_OCR: "@qvac/sdk/ggml-ocr/plugin";
@@ -9,6 +11,6 @@ export declare const PLUGIN_DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
9
11
  export declare const PLUGIN_AUDIOGEN: "@qvac/sdk/audiogen-ggml/plugin";
10
12
  export declare const PLUGIN_VLA: "@qvac/sdk/ggml-vla/plugin";
11
13
  export declare const PLUGIN_CLASSIFICATION: "@qvac/sdk/ggml-classification/plugin";
12
- export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/bci-whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/plugin", "@qvac/sdk/nmtcpp-translation/plugin", "@qvac/sdk/tts-ggml/plugin", "@qvac/sdk/ggml-ocr/plugin", "@qvac/sdk/sdcpp-generation/plugin", "@qvac/sdk/audiogen-ggml/plugin", "@qvac/sdk/ggml-vla/plugin", "@qvac/sdk/ggml-classification/plugin"];
14
+ export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/llamacpp-decision/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/bci-whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/plugin", "@qvac/sdk/moss-transcribe/plugin", "@qvac/sdk/nmtcpp-translation/plugin", "@qvac/sdk/tts-ggml/plugin", "@qvac/sdk/ggml-ocr/plugin", "@qvac/sdk/sdcpp-generation/plugin", "@qvac/sdk/audiogen-ggml/plugin", "@qvac/sdk/ggml-vla/plugin", "@qvac/sdk/ggml-classification/plugin"];
13
15
  export type BuiltinPlugin = (typeof SDK_DEFAULT_PLUGINS)[number];
14
16
  //# sourceMappingURL=plugin-ids.d.ts.map
@@ -1,8 +1,10 @@
1
1
  // Built-in plugin ids under the public @qvac/sdk name.
2
2
  export const PLUGIN_LLM = '@qvac/sdk/llamacpp-completion/plugin';
3
+ export const PLUGIN_DECISION = '@qvac/sdk/llamacpp-decision/plugin';
3
4
  export const PLUGIN_EMBEDDING = '@qvac/sdk/llamacpp-embedding/plugin';
4
5
  export const PLUGIN_WHISPER = '@qvac/sdk/whispercpp-transcription/plugin';
5
6
  export const PLUGIN_BCI = '@qvac/sdk/bci-whispercpp-transcription/plugin';
7
+ export const PLUGIN_MOSS_TRANSCRIBE = '@qvac/sdk/moss-transcribe/plugin';
6
8
  const PLUGIN_PARAKEET = '@qvac/sdk/parakeet-transcription/plugin';
7
9
  export const PLUGIN_NMT = '@qvac/sdk/nmtcpp-translation/plugin';
8
10
  export const PLUGIN_TTS = '@qvac/sdk/tts-ggml/plugin';
@@ -14,9 +16,11 @@ export const PLUGIN_CLASSIFICATION = '@qvac/sdk/ggml-classification/plugin';
14
16
  export const SDK_DEFAULT_PLUGINS = [
15
17
  PLUGIN_LLM,
16
18
  PLUGIN_EMBEDDING,
19
+ PLUGIN_DECISION,
17
20
  PLUGIN_WHISPER,
18
21
  PLUGIN_BCI,
19
22
  PLUGIN_PARAKEET,
23
+ PLUGIN_MOSS_TRANSCRIBE,
20
24
  PLUGIN_NMT,
21
25
  PLUGIN_TTS,
22
26
  PLUGIN_OCR,
@@ -1,3 +1,4 @@
1
- export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, modelSrcInputSchema as modelSourceSchema, type LlmConfigInput as LlamacppCompletionConfig, type EmbedConfigInput as LlamacppEmbeddingConfig, type ModelSrcInput as ModelSource } from '@qvac/inference/surface';
1
+ export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, modelSrcInputSchema as modelSourceSchema, type LlmConfigInput as LlamacppCompletionConfig, type EmbedConfigInput as LlamacppEmbeddingConfig, type DecisionConfigInput as LlamacppDecisionConfig, type ModelSrcInput as ModelSource } from '@qvac/inference/surface';
2
2
  export { configSchemaForModelType, MODEL_CONFIG_SCHEMA_BY_TYPE } from '@qvac/inference/surface';
3
+ export { modelFitPolicySchema, type ModelFitPolicy } from '@qvac/inference/surface';
3
4
  //# sourceMappingURL=public.d.ts.map
@@ -2,10 +2,11 @@
2
2
  // (aliased from @qvac/inference's schemas) so consumers such as the CLI can import
3
3
  // a model's `modelConfig` schema and read its field descriptions without depending
4
4
  // on internal identifiers.
5
- export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, modelSrcInputSchema as modelSourceSchema } from '@qvac/inference/surface';
5
+ export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, modelSrcInputSchema as modelSourceSchema } from '@qvac/inference/surface';
6
6
  // Resolve any model's `modelConfig` schema by model type (canonical, alias, or
7
7
  // engine string) and read its field descriptions — the map is the single source
8
8
  // of truth, so a newly added model type is available here automatically. Lets
9
9
  // tools such as the CLI's `qvac configure` document every addon's config
10
10
  // without a hand-maintained per-addon list.
11
11
  export { configSchemaForModelType, MODEL_CONFIG_SCHEMA_BY_TYPE } from '@qvac/inference/surface';
12
+ export { modelFitPolicySchema } from '@qvac/inference/surface';
@@ -36,6 +36,9 @@ export declare const SDK_CLIENT_ERROR_CODES: {
36
36
  readonly BARE_RUNTIME_BINARY_NOT_FOUND: 50614;
37
37
  readonly HOST_PREBUILDS_INSTALL_REFUSED: 50615;
38
38
  readonly HOST_PREBUILDS_INSTALL_FAILED: 50616;
39
+ readonly ADDON_LINK_FAILED: 50617;
40
+ readonly BARE_PACK_NODE_UNSUPPORTED: 50618;
41
+ readonly HOST_PREBUILDS_MISSING: 50619;
39
42
  readonly PROFILER_INVALID_CAPACITY: 50800;
40
43
  };
41
44
  declare const clientErrorDefinitions: ErrorCodesMap;
@@ -42,6 +42,9 @@ export const SDK_CLIENT_ERROR_CODES = {
42
42
  BARE_RUNTIME_BINARY_NOT_FOUND: 50614,
43
43
  HOST_PREBUILDS_INSTALL_REFUSED: 50615,
44
44
  HOST_PREBUILDS_INSTALL_FAILED: 50616,
45
+ ADDON_LINK_FAILED: 50617,
46
+ BARE_PACK_NODE_UNSUPPORTED: 50618,
47
+ HOST_PREBUILDS_MISSING: 50619,
45
48
  // Profiler Errors (50,800-50,899)
46
49
  PROFILER_INVALID_CAPACITY: 50800
47
50
  };
@@ -171,6 +174,10 @@ const clientErrorDefinitions = {
171
174
  name: 'BARE_PACK_ERROR',
172
175
  message: (exitCode, entryPath, outputPath) => `bare-pack exited with code ${exitCode}\n\n Entry file: ${entryPath}\n Output file: ${outputPath}\n\n Run bare-pack manually for more details.`
173
176
  },
177
+ [SDK_CLIENT_ERROR_CODES.BARE_PACK_NODE_UNSUPPORTED]: {
178
+ name: 'BARE_PACK_NODE_UNSUPPORTED',
179
+ message: (nodeVersion, requiredRange) => `bare-pack needs Node ${requiredRange}; found Node v${nodeVersion}. Upgrade Node and run the bundle again.`
180
+ },
174
181
  [SDK_CLIENT_ERROR_CODES.INVALID_PLUGIN_SPECIFIER]: {
175
182
  name: 'INVALID_PLUGIN_SPECIFIER',
176
183
  message: (specifiers) => `Invalid plugin specifiers (must end with /plugin):\n${specifiers}`
@@ -197,6 +204,15 @@ const clientErrorDefinitions = {
197
204
  ? `\n\n Fix the error, or add them to the dependencies in package.json, pinned to these exact versions, and reinstall:\n${dependencies}`
198
205
  : '')
199
206
  },
207
+ [SDK_CLIENT_ERROR_CODES.ADDON_LINK_FAILED]: {
208
+ name: 'ADDON_LINK_FAILED',
209
+ message: (hosts, reason) => `Linking the native addons failed\n\n Hosts: ${hosts}\n Reason: ${reason}`
210
+ },
211
+ [SDK_CLIENT_ERROR_CODES.HOST_PREBUILDS_MISSING]: {
212
+ name: 'HOST_PREBUILDS_MISSING',
213
+ message: (dependencies) => "Bundling failed: split addons resolve their native code through `#host-addon`, which needs each mobile host's platform package installed." +
214
+ `\n\n Add them to the dependencies in package.json, pinned to these exact versions, and reinstall (or bundle with installMissingPrebuilds):\n${dependencies}`
215
+ },
200
216
  // Profiler Errors (50,800-50,899)
201
217
  [SDK_CLIENT_ERROR_CODES.PROFILER_INVALID_CAPACITY]: {
202
218
  name: 'PROFILER_INVALID_CAPACITY',
@@ -15,6 +15,7 @@ export declare const SDK_SERVER_ERROR_CODES: {
15
15
  readonly TTS_REFERENCE_AUDIO_REQUIRED: 52209;
16
16
  readonly LEGACY_PARAKEET_MODEL_DEPRECATED: 52210;
17
17
  readonly LEGACY_TTS_MODEL_DEPRECATED: 52211;
18
+ readonly MODEL_FIT_REFUSED: 52212;
18
19
  readonly RPC_SERVER_OPERATION_FAILED: 52423;
19
20
  readonly MODEL_UNLOAD_FAILED: 52400;
20
21
  readonly EMBED_FAILED: 52401;
@@ -20,6 +20,7 @@ export const SDK_SERVER_ERROR_CODES = {
20
20
  TTS_REFERENCE_AUDIO_REQUIRED: 52209,
21
21
  LEGACY_PARAKEET_MODEL_DEPRECATED: 52210,
22
22
  LEGACY_TTS_MODEL_DEPRECATED: 52211,
23
+ MODEL_FIT_REFUSED: 52212,
23
24
  // Model Operations (52,400-52,799)
24
25
  RPC_SERVER_OPERATION_FAILED: 52423,
25
26
  MODEL_UNLOAD_FAILED: 52400,
@@ -178,6 +179,10 @@ const serverErrorDefinitions = {
178
179
  name: 'LEGACY_TTS_MODEL_DEPRECATED',
179
180
  message: (legacyFields) => `Legacy ONNX TTS modelConfig fields are no longer supported (${legacyFields ?? 'unknown fields'}). As of @qvac/tts-ggml the addon uses GGUF bundles: supply the primary GGUF via modelSrc, set language in modelConfig, and for Chatterbox add s3genModelSrc (e.g. loadModel({ modelSrc: TTS_T3_TURBO_EN_CHATTERBOX_Q8_0, modelType: "tts", modelConfig: { ttsEngine: "chatterbox", language: "en", s3genModelSrc: TTS_S3GEN_EN_CHATTERBOX } })). Supertonic multilingual mode is selected by the GGUF (e.g. TTS_MULTILINGUAL_SUPERTONIC2_Q8_0) plus language — not ttsSupertonicMultilingual.`
180
181
  },
182
+ [SDK_SERVER_ERROR_CODES.MODEL_FIT_REFUSED]: {
183
+ name: 'MODEL_FIT_REFUSED',
184
+ message: (modelType, reason, detail) => `${modelType}: the engine fitter projects this load will not fit (${reason})${detail ? `: ${detail}` : ''}`
185
+ },
181
186
  // Model Operations (52,400-52,799)
182
187
  [SDK_SERVER_ERROR_CODES.RPC_SERVER_OPERATION_FAILED]: {
183
188
  name: 'RPC_SERVER_OPERATION_FAILED',
@@ -91,6 +91,9 @@ export declare class BarePackNotInstalledError extends QvacErrorBase {
91
91
  export declare class BarePackError extends QvacErrorBase {
92
92
  constructor(exitCode: number, entryPath: string, outputPath: string, cause?: unknown);
93
93
  }
94
+ export declare class BarePackNodeUnsupportedError extends QvacErrorBase {
95
+ constructor(nodeVersion: string, requiredRange: string, cause?: unknown);
96
+ }
94
97
  export declare class InvalidPluginSpecifierError extends QvacErrorBase {
95
98
  constructor(specifiers: string[], cause?: unknown);
96
99
  }
@@ -115,6 +118,13 @@ export declare class HostPrebuildsInstallFailedError extends QvacErrorBase {
115
118
  readonly dependencies: Record<string, string>;
116
119
  constructor(details: string, dependencies: Record<string, string>, cause?: unknown);
117
120
  }
121
+ export declare class AddonLinkFailedError extends QvacErrorBase {
122
+ constructor(hosts: string[], cause: unknown);
123
+ }
124
+ export declare class HostPrebuildsMissingError extends QvacErrorBase {
125
+ readonly dependencies: Record<string, string>;
126
+ constructor(dependencies: Record<string, string>, cause?: unknown);
127
+ }
118
128
  export declare class ConfigFileNotFoundError extends QvacErrorBase {
119
129
  constructor(searchPaths: string, cause?: unknown);
120
130
  }
@@ -150,6 +150,11 @@ export class BarePackError extends QvacErrorBase {
150
150
  super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_ERROR, [exitCode, entryPath, outputPath], cause));
151
151
  }
152
152
  }
153
+ export class BarePackNodeUnsupportedError extends QvacErrorBase {
154
+ constructor(nodeVersion, requiredRange, cause) {
155
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_NODE_UNSUPPORTED, [nodeVersion, requiredRange], cause));
156
+ }
157
+ }
153
158
  export class InvalidPluginSpecifierError extends QvacErrorBase {
154
159
  constructor(specifiers, cause) {
155
160
  const list = specifiers.map((s) => ` - ${s}`).join('\n');
@@ -187,6 +192,19 @@ export class HostPrebuildsInstallFailedError extends QvacErrorBase {
187
192
  this.dependencies = dependencies;
188
193
  }
189
194
  }
195
+ export class AddonLinkFailedError extends QvacErrorBase {
196
+ constructor(hosts, cause) {
197
+ const reason = cause instanceof Error ? cause.message : String(cause);
198
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.ADDON_LINK_FAILED, [hosts.join(', '), reason], cause));
199
+ }
200
+ }
201
+ export class HostPrebuildsMissingError extends QvacErrorBase {
202
+ dependencies;
203
+ constructor(dependencies, cause) {
204
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.HOST_PREBUILDS_MISSING, [formatDependencyPins(dependencies)], cause));
205
+ this.dependencies = dependencies;
206
+ }
207
+ }
190
208
  function formatDependencyPins(dependencies) {
191
209
  return Object.entries(dependencies)
192
210
  .map(([name, version]) => ` "${name}": "${version}"`)
@@ -1,25 +1,29 @@
1
1
  import { mapValues } from './object.js';
2
- const VALID_TYPES = ['string', 'number', 'integer', 'boolean', 'object', 'array'];
2
+ const VALID_TYPES = ['string', 'number', 'integer', 'boolean', 'object', 'array', 'null'];
3
3
  function isValidType(value) {
4
+ if (Array.isArray(value))
5
+ return value.length > 0 && value.every(isValidType);
4
6
  return typeof value === 'string' && VALID_TYPES.includes(value);
5
7
  }
6
8
  function convertMcpToolToTool(mcpTool) {
7
- const inputSchema = mcpTool.inputSchema;
9
+ // `$defs` and other top-level keywords stay, so a nested `$ref` still resolves.
10
+ const { $schema: _schema, title: _title, ...inputSchema } = mcpTool.inputSchema;
8
11
  const properties = inputSchema.properties ?? {};
9
12
  const required = inputSchema.required ?? [];
13
+ // Only an unrecognised `type` is replaced; a missing one is left alone because
14
+ // `anyOf`/`oneOf` properties carry their types in the branches.
10
15
  const convertedProperties = mapValues(properties, (prop) => {
11
- const { type, description, enum: enumVal } = prop;
12
- return {
13
- type: isValidType(type) ? type : 'string',
14
- ...(description && { description }),
15
- ...(enumVal && { enum: enumVal })
16
- };
16
+ const { type } = prop;
17
+ return type === undefined || isValidType(type)
18
+ ? prop
19
+ : { ...prop, type: 'string' };
17
20
  });
18
21
  return {
19
22
  type: 'function',
20
23
  name: mcpTool.name,
21
24
  description: mcpTool.description ?? '',
22
25
  parameters: {
26
+ ...inputSchema,
23
27
  type: 'object',
24
28
  properties: convertedProperties,
25
29
  required: required.length > 0 ? required : undefined
@@ -1,4 +1,4 @@
1
- import type { z } from 'zod';
1
+ import { z } from 'zod';
2
2
  import { type Tool, type ToolCall, type ToolCallWithCall } from '@qvac/inference/surface';
3
3
  type ZodObjectType = z.ZodObject<z.ZodRawShape>;
4
4
  export type ToolHandler = (args: Record<string, unknown>) => Promise<unknown>;
@@ -1,66 +1,34 @@
1
+ import { z } from 'zod';
1
2
  import { toolSchema } from '@qvac/inference/surface';
2
3
  import { InvalidToolsArrayError, InvalidToolSchemaError } from './errors-client.js';
3
- function zodTypeToJsonSchemaType(type) {
4
- switch (type) {
5
- case 'string':
6
- return 'string';
7
- case 'number':
8
- return 'number';
9
- case 'boolean':
10
- return 'boolean';
11
- case 'object':
12
- return 'object';
13
- case 'array':
14
- return 'array';
15
- case 'optional':
16
- default:
17
- return 'string';
4
+ // Zod's integer bounds; they add nothing a tool grammar needs.
5
+ const SAFE_INTEGER_BOUNDS = new Set([Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]);
6
+ function dropSafeIntegerBounds(node) {
7
+ if (Array.isArray(node))
8
+ return node.map(dropSafeIntegerBounds);
9
+ if (!node || typeof node !== 'object')
10
+ return node;
11
+ const out = {};
12
+ for (const [key, value] of Object.entries(node)) {
13
+ if ((key === 'minimum' || key === 'maximum') && SAFE_INTEGER_BOUNDS.has(value)) {
14
+ continue;
15
+ }
16
+ out[key] = dropSafeIntegerBounds(value);
18
17
  }
18
+ return out;
19
+ }
20
+ function zodToToolParameters(schema) {
21
+ const { $schema: _schema, ...json } = dropSafeIntegerBounds(z.toJSONSchema(schema, { io: 'input', unrepresentable: 'any' }));
22
+ return { ...json, type: 'object', properties: json['properties'] ?? {} };
19
23
  }
20
24
  export function convertToolInput(input) {
21
- const zodSchema = input.parameters;
22
- // Try both shape and def.shape for Zod v4 compatibility
23
- const shape = zodSchema.shape || (typeof zodSchema.def?.shape === 'object' ? zodSchema.def.shape : {});
24
- const properties = {};
25
- const required = [];
26
- for (const [key, value] of Object.entries(shape)) {
27
- const field = value;
28
- const fieldType = field.type || field.def?.type || 'string';
29
- const isOptional = fieldType === 'optional';
30
- let actualType = isOptional ? 'string' : fieldType;
31
- let actualDescription = field.description;
32
- if (isOptional && field.def?.innerType) {
33
- const innerType = field.def.innerType;
34
- actualType = innerType.type || innerType.def?.type || 'string';
35
- // Get description from inner type if not on wrapper
36
- if (!actualDescription && innerType.description) {
37
- actualDescription = innerType.description;
38
- }
39
- }
40
- properties[key] = {
41
- type: zodTypeToJsonSchemaType(actualType)
42
- };
43
- if (actualDescription) {
44
- properties[key].description = actualDescription;
45
- }
46
- if (field.def?.values) {
47
- properties[key].enum = field.def.values;
48
- }
49
- if (!isOptional) {
50
- required.push(key);
51
- }
52
- }
53
25
  const tool = {
54
26
  type: 'function',
55
27
  name: input.name,
56
28
  description: input.description,
57
29
  ...(input.deferLoading !== undefined && { deferLoading: input.deferLoading }),
58
30
  ...(input.group !== undefined && { group: input.group }),
59
- parameters: {
60
- type: 'object',
61
- properties,
62
- required: required.length > 0 ? required : undefined
63
- }
31
+ parameters: zodToToolParameters(input.parameters)
64
32
  };
65
33
  return toolSchema.parse(tool);
66
34
  }
@@ -2,6 +2,7 @@ import RPC from 'bare-rpc';
2
2
  export declare function createBareKitRPCServer(): RPC;
3
3
  export interface IPCClientOptions {
4
4
  onDisconnect?: () => void;
5
+ authToken?: string | undefined;
5
6
  }
6
7
  export declare function createIPCClient(socketPath: string, options?: IPCClientOptions): RPC;
7
8
  //# sourceMappingURL=create-server.d.ts.map
@@ -42,5 +42,10 @@ export function createIPCClient(socketPath, options) {
42
42
  logger.warn('IPC socket closed — parent process likely terminated');
43
43
  options?.onDisconnect?.();
44
44
  });
45
+ // Pipe and Unix-socket clients have no reader for this line, so a token
46
+ // inherited from the parent's environment must not reach them.
47
+ if (options?.authToken && socketPath.startsWith('tcp://')) {
48
+ socket.write(options.authToken + '\n');
49
+ }
45
50
  return new RPC(socket, handleRequest);
46
51
  }
@@ -5,9 +5,11 @@ import { initializeWorker, ensureRPCSetup } from './lifecycle.js';
5
5
  import { getServerLogger } from '../logging/index.js';
6
6
  import { registerPlugins } from '@qvac/inference/plugins';
7
7
  import { llmPlugin } from '@qvac/inference/llamacpp-completion/plugin';
8
+ import { decisionPlugin } from '@qvac/inference/llamacpp-decision/plugin';
8
9
  import { embeddingsPlugin } from '@qvac/inference/llamacpp-embedding/plugin';
9
10
  import { whisperPlugin } from '@qvac/inference/whispercpp-transcription/plugin';
10
11
  import { bciPlugin } from '@qvac/inference/bci-whispercpp-transcription/plugin';
12
+ import { mossTranscribePlugin } from '@qvac/inference/moss-transcribe/plugin';
11
13
  import { parakeetPlugin } from '@qvac/inference/parakeet-transcription/plugin';
12
14
  import { nmtPlugin } from '@qvac/inference/nmtcpp-translation/plugin';
13
15
  import { ttsPlugin } from '@qvac/inference/tts-ggml/plugin';
@@ -22,9 +24,11 @@ logger.info('🐻 Hello from Bare');
22
24
  registerPlugins([
23
25
  llmPlugin,
24
26
  embeddingsPlugin,
27
+ decisionPlugin,
25
28
  whisperPlugin,
26
29
  bciPlugin,
27
30
  parakeetPlugin,
31
+ mossTranscribePlugin,
28
32
  nmtPlugin,
29
33
  ttsPlugin,
30
34
  ocrPlugin,
@@ -50,6 +50,13 @@ export function initializeWorker() {
50
50
  logger.debug('Arguments to worker:', Bare.argv);
51
51
  return { hasRPCConfig };
52
52
  }
53
+ // Read once and unset so processes the worker spawns don't inherit it.
54
+ function takeIPCAuthToken() {
55
+ const token = os.getEnv('QVAC_IPC_AUTH_TOKEN');
56
+ if (token !== undefined)
57
+ os.unsetEnv('QVAC_IPC_AUTH_TOKEN');
58
+ return token;
59
+ }
53
60
  export function ensureRPCSetup() {
54
61
  if (rpcInitialized)
55
62
  return;
@@ -62,7 +69,8 @@ export function ensureRPCSetup() {
62
69
  if (ipcSocketPath) {
63
70
  logger.info(`Running in desktop mode, connecting to IPC socket: ${ipcSocketPath}`);
64
71
  const rpc = createIPCClient(ipcSocketPath, {
65
- onDisconnect: () => void shutdownWorker('ipc-disconnect')
72
+ onDisconnect: () => void shutdownWorker('ipc-disconnect'),
73
+ authToken: takeIPCAuthToken()
66
74
  });
67
75
  logger.debug('Desktop IPC client created?', !!rpc);
68
76
  }
@@ -0,0 +1,2 @@
1
+ export * from '@qvac/inference/llamacpp-decision/plugin';
2
+ //# sourceMappingURL=llamacpp-decision.d.ts.map
@@ -0,0 +1 @@
1
+ export * from '@qvac/inference/llamacpp-decision/plugin';
@@ -0,0 +1,2 @@
1
+ export * from '@qvac/inference/moss-transcribe/plugin';
2
+ //# sourceMappingURL=moss-transcribe.d.ts.map
@@ -0,0 +1 @@
1
+ export * from '@qvac/inference/moss-transcribe/plugin';