@qvac/sdk 0.11.0 → 0.12.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 (205) hide show
  1. package/NOTICE +1427 -39
  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.js +62 -66
  22. package/dist/client/rpc/ensure-worker-ready.d.ts +9 -0
  23. package/dist/client/rpc/ensure-worker-ready.js +17 -0
  24. package/dist/client/rpc/node-rpc-client.js +4 -1
  25. package/dist/client/rpc/rpc-error.js +14 -1
  26. package/dist/commands/bundle/bare-pack.d.ts +13 -0
  27. package/dist/commands/bundle/bare-pack.js +54 -0
  28. package/dist/commands/bundle/constants.d.ts +7 -0
  29. package/dist/commands/bundle/constants.js +23 -0
  30. package/dist/commands/bundle/entry-gen.d.ts +2 -0
  31. package/dist/commands/bundle/entry-gen.js +48 -0
  32. package/dist/commands/bundle/index.d.ts +20 -0
  33. package/dist/commands/bundle/index.js +141 -0
  34. package/dist/commands/bundle/manifest.d.ts +21 -0
  35. package/dist/commands/bundle/manifest.js +193 -0
  36. package/dist/commands/bundle/plugins.d.ts +9 -0
  37. package/dist/commands/bundle/plugins.js +51 -0
  38. package/dist/commands/index.d.ts +5 -0
  39. package/dist/commands/index.js +2 -0
  40. package/dist/commands/verify/abi.d.ts +52 -0
  41. package/dist/commands/verify/abi.js +125 -0
  42. package/dist/commands/verify/addon-source.d.ts +43 -0
  43. package/dist/commands/verify/addon-source.js +75 -0
  44. package/dist/commands/verify/bundle-source.d.ts +12 -0
  45. package/dist/commands/verify/bundle-source.js +53 -0
  46. package/dist/commands/verify/index.d.ts +59 -0
  47. package/dist/commands/verify/index.js +371 -0
  48. package/dist/commands/verify/node-modules-source.d.ts +11 -0
  49. package/dist/commands/verify/node-modules-source.js +76 -0
  50. package/dist/commands/verify/prebuilds.d.ts +15 -0
  51. package/dist/commands/verify/prebuilds.js +39 -0
  52. package/dist/examples/classification/classify-image.d.ts +2 -0
  53. package/dist/examples/classification/classify-image.js +23 -0
  54. package/dist/examples/diffusion-txt2vid.d.ts +2 -0
  55. package/dist/examples/diffusion-txt2vid.js +81 -0
  56. package/dist/examples/plugins.js +3 -7
  57. package/dist/examples/tools/llamacpp-tools-gemma4.js +2 -5
  58. package/dist/examples/tools/llamacpp-tools-qwen35.js +2 -3
  59. package/dist/examples/transcription/parakeet-ctc-filesystem.js +18 -12
  60. package/dist/examples/transcription/parakeet-microphone-record.js +7 -12
  61. package/dist/examples/transcription/parakeet-microphone-stream.d.ts +2 -0
  62. package/dist/examples/transcription/parakeet-microphone-stream.js +79 -0
  63. package/dist/examples/transcription/parakeet-sortformer-streaming.d.ts +2 -0
  64. package/dist/examples/transcription/parakeet-sortformer-streaming.js +121 -0
  65. package/dist/examples/transcription/parakeet-sortformer.js +58 -55
  66. package/dist/examples/transcription/parakeet-tdt-filesystem.js +18 -15
  67. package/dist/examples/transcription/whispercpp-microphone-conversation.js +6 -1
  68. package/dist/examples/tts/chatterbox.js +7 -16
  69. package/dist/examples/tts/llm-to-tts-streaming.js +3 -10
  70. package/dist/examples/tts/supertonic-multilingual.js +4 -12
  71. package/dist/examples/tts/supertonic.js +5 -12
  72. package/dist/examples/vla-smolvla.d.ts +2 -0
  73. package/dist/examples/vla-smolvla.js +75 -0
  74. package/dist/examples/voice-assistant/voice-assistant.js +3 -10
  75. package/dist/expo/plugins/find-in-ancestor-node-modules.d.ts +14 -0
  76. package/dist/expo/plugins/find-in-ancestor-node-modules.js +24 -0
  77. package/dist/expo/plugins/get-project-root.d.ts +22 -0
  78. package/dist/expo/plugins/get-project-root.js +23 -0
  79. package/dist/expo/plugins/index.d.ts +4 -0
  80. package/dist/expo/plugins/index.js +4 -0
  81. package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +9 -2
  82. package/dist/expo/plugins/resolve-sdk-package-dir.js +38 -11
  83. package/dist/expo/plugins/withDeviceInfo.js +2 -1
  84. package/dist/expo/plugins/withMobileBundle.d.ts +2 -17
  85. package/dist/expo/plugins/withMobileBundle.js +31 -85
  86. package/dist/index.d.ts +4 -3
  87. package/dist/index.js +4 -3
  88. package/dist/models/registry/models.d.ts +3711 -368
  89. package/dist/models/registry/models.js +7066 -3562
  90. package/dist/models/update-models/naming.js +22 -8
  91. package/dist/pear/pre.js +6 -2
  92. package/dist/schemas/cancel.d.ts +5 -0
  93. package/dist/schemas/cancel.js +1 -0
  94. package/dist/schemas/classification.d.ts +53 -0
  95. package/dist/schemas/classification.js +33 -0
  96. package/dist/schemas/common.d.ts +1001 -1739
  97. package/dist/schemas/common.js +6 -1
  98. package/dist/schemas/completion-event.d.ts +3 -0
  99. package/dist/schemas/completion-event.js +1 -0
  100. package/dist/schemas/completion-stream.d.ts +1 -0
  101. package/dist/schemas/download-asset.d.ts +13 -3
  102. package/dist/schemas/engine-addon-map.d.ts +3 -0
  103. package/dist/schemas/engine-addon-map.js +18 -5
  104. package/dist/schemas/get-model-info.d.ts +4 -0
  105. package/dist/schemas/get-model-info.js +2 -0
  106. package/dist/schemas/index.d.ts +3 -0
  107. package/dist/schemas/index.js +3 -0
  108. package/dist/schemas/llamacpp-config.d.ts +12 -2
  109. package/dist/schemas/load-model.d.ts +6152 -10764
  110. package/dist/schemas/load-model.js +75 -7
  111. package/dist/schemas/model-src-utils.d.ts +22 -2
  112. package/dist/schemas/model-types.d.ts +46 -6
  113. package/dist/schemas/model-types.js +28 -5
  114. package/dist/schemas/ocr.d.ts +5 -0
  115. package/dist/schemas/plugin.d.ts +20 -5
  116. package/dist/schemas/plugin.js +21 -4
  117. package/dist/schemas/registry.d.ts +44 -0
  118. package/dist/schemas/registry.js +5 -0
  119. package/dist/schemas/reload-config.d.ts +22 -2
  120. package/dist/schemas/sdcpp-config.d.ts +316 -1
  121. package/dist/schemas/sdcpp-config.js +232 -33
  122. package/dist/schemas/sdk-config.d.ts +654 -1324
  123. package/dist/schemas/sdk-config.js +16 -1
  124. package/dist/schemas/sdk-errors-client.d.ts +5 -0
  125. package/dist/schemas/sdk-errors-client.js +26 -1
  126. package/dist/schemas/sdk-errors-server.d.ts +3 -1
  127. package/dist/schemas/sdk-errors-server.js +20 -5
  128. package/dist/schemas/text-to-speech.d.ts +79 -696
  129. package/dist/schemas/text-to-speech.js +46 -19
  130. package/dist/schemas/transcription-config.d.ts +37 -226
  131. package/dist/schemas/transcription-config.js +76 -15
  132. package/dist/schemas/transcription.d.ts +63 -11
  133. package/dist/schemas/transcription.js +56 -2
  134. package/dist/schemas/translation-config.d.ts +60 -10
  135. package/dist/schemas/vla.d.ts +87 -0
  136. package/dist/schemas/vla.js +108 -0
  137. package/dist/scripts/run-unit-tests.js +8 -2
  138. package/dist/server/bare/ops/transcribe.d.ts +2 -1
  139. package/dist/server/bare/ops/transcribe.js +59 -34
  140. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +6 -0
  141. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +30 -0
  142. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +32 -0
  143. package/dist/server/bare/plugins/ggml-classification/plugin.js +55 -0
  144. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +3 -0
  145. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +12 -0
  146. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +3 -0
  147. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +75 -0
  148. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +54 -0
  149. package/dist/server/bare/plugins/ggml-vla/plugin.js +57 -0
  150. package/dist/server/bare/plugins/index.d.ts +3 -1
  151. package/dist/server/bare/plugins/index.js +3 -1
  152. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +3 -0
  153. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +29 -0
  154. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +65 -0
  155. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -0
  156. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +26 -0
  157. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +25 -0
  158. package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +5 -0
  159. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +67 -246
  160. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +66 -97
  161. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -0
  162. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +199 -0
  163. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +200 -2
  164. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +61 -8
  165. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.js +2 -15
  166. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.js +2 -1
  167. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +75 -0
  168. package/dist/server/bare/plugins/tts-ggml/plugin.js +189 -0
  169. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +29 -4
  170. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +12 -1
  171. package/dist/server/bare/registry/model-config-utils.js +7 -0
  172. package/dist/server/bare/runtime/request-context.d.ts +1 -1
  173. package/dist/server/bare/runtime-lifecycle.js +9 -9
  174. package/dist/server/bare/types/addon-responses.d.ts +1 -0
  175. package/dist/server/env.js +4 -1
  176. package/dist/server/plugins/index.d.ts +1 -1
  177. package/dist/server/plugins/index.js +1 -1
  178. package/dist/server/plugins/registry.d.ts +1 -0
  179. package/dist/server/plugins/registry.js +5 -0
  180. package/dist/server/rpc/handler-registry.js +4 -0
  181. package/dist/server/rpc/handler-selection.d.ts +9 -0
  182. package/dist/server/rpc/handler-selection.js +14 -0
  183. package/dist/server/rpc/handler-utils.js +5 -13
  184. package/dist/server/rpc/handlers/classify.d.ts +3 -0
  185. package/dist/server/rpc/handlers/classify.js +4 -0
  186. package/dist/server/rpc/handlers/index.d.ts +2 -0
  187. package/dist/server/rpc/handlers/index.js +2 -0
  188. package/dist/server/rpc/handlers/load-model/handler.js +4 -1
  189. package/dist/server/rpc/handlers/load-model/resolve.js +9 -0
  190. package/dist/server/rpc/handlers/video-stream.d.ts +3 -0
  191. package/dist/server/rpc/handlers/video-stream.js +4 -0
  192. package/dist/server/rpc/profiling/operation-metrics.js +23 -0
  193. package/dist/server/utils/config-transform.js +1 -1
  194. package/dist/server/worker.js +14 -11
  195. package/dist/utils/errors-client.d.ts +15 -0
  196. package/dist/utils/errors-client.js +26 -0
  197. package/dist/utils/errors-server.d.ts +30 -2
  198. package/dist/utils/errors-server.js +51 -3
  199. package/package.json +66 -80
  200. package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -490
  201. package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -272
  202. package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
  203. package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
  204. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.d.ts +0 -0
  205. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.d.ts +0 -0
@@ -2,21 +2,24 @@
2
2
  * Default worker entry point that registers ALL built-in plugins.
3
3
  */
4
4
  import { initializeWorkerCore, ensureRPCSetup } from "./worker-core.js";
5
- import { registerPlugin } from "./plugins/index.js";
5
+ import { registerPlugins } from "./plugins/index.js";
6
6
  import { getServerLogger } from "../logging/index.js";
7
- import { llmPlugin, embeddingsPlugin, whisperPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, } from "./bare/plugins/index.js";
7
+ import { llmPlugin, embeddingsPlugin, whisperPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, vlaPlugin, classificationPlugin, } from "./bare/plugins/index.js";
8
8
  const { hasRPCConfig } = initializeWorkerCore();
9
9
  const logger = getServerLogger();
10
10
  logger.info("🐻 Hello from Bare");
11
- // Register all built-in plugins
12
- registerPlugin(llmPlugin);
13
- registerPlugin(embeddingsPlugin);
14
- registerPlugin(whisperPlugin);
15
- registerPlugin(parakeetPlugin);
16
- registerPlugin(nmtPlugin);
17
- registerPlugin(ttsPlugin);
18
- registerPlugin(ocrPlugin);
19
- registerPlugin(diffusionPlugin);
11
+ registerPlugins([
12
+ llmPlugin,
13
+ embeddingsPlugin,
14
+ whisperPlugin,
15
+ parakeetPlugin,
16
+ nmtPlugin,
17
+ ttsPlugin,
18
+ ocrPlugin,
19
+ diffusionPlugin,
20
+ vlaPlugin,
21
+ classificationPlugin,
22
+ ]);
20
23
  logger.info(hasRPCConfig
21
24
  ? "Parsed RPC configuration from arguments"
22
25
  : "Using default configuration (direct mode)");
@@ -68,9 +68,24 @@ export declare class WorkerFileNotFoundError extends QvacErrorBase {
68
68
  export declare class PearWorkerEntryRequiredError extends QvacErrorBase {
69
69
  constructor(workerEntry: string, cause?: unknown);
70
70
  }
71
+ export declare class WorkerPluginsNotRegisteredError extends QvacErrorBase {
72
+ constructor(cause?: unknown);
73
+ }
71
74
  export declare class BundleVerificationFailedError extends QvacErrorBase {
72
75
  constructor(bundlePath: string, cause?: unknown);
73
76
  }
77
+ export declare class BarePackNotInstalledError extends QvacErrorBase {
78
+ constructor(cause?: unknown);
79
+ }
80
+ export declare class BarePackError extends QvacErrorBase {
81
+ constructor(exitCode: number, entryPath: string, outputPath: string, cause?: unknown);
82
+ }
83
+ export declare class InvalidPluginSpecifierError extends QvacErrorBase {
84
+ constructor(specifiers: string[], cause?: unknown);
85
+ }
86
+ export declare class BareImportsMapNotFoundError extends QvacErrorBase {
87
+ constructor(sdkName: string, expectedPath: string, cause?: unknown);
88
+ }
74
89
  export declare class ConfigFileNotFoundError extends QvacErrorBase {
75
90
  constructor(searchPaths: string, cause?: unknown);
76
91
  }
@@ -121,11 +121,37 @@ export class PearWorkerEntryRequiredError extends QvacErrorBase {
121
121
  super(createErrorOptions(SDK_CLIENT_ERROR_CODES.PEAR_WORKER_ENTRY_REQUIRED, [workerEntry], cause));
122
122
  }
123
123
  }
124
+ export class WorkerPluginsNotRegisteredError extends QvacErrorBase {
125
+ constructor(cause) {
126
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_PLUGINS_NOT_REGISTERED, [], cause));
127
+ }
128
+ }
124
129
  export class BundleVerificationFailedError extends QvacErrorBase {
125
130
  constructor(bundlePath, cause) {
126
131
  super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BUNDLE_VERIFICATION_FAILED, [bundlePath], cause));
127
132
  }
128
133
  }
134
+ export class BarePackNotInstalledError extends QvacErrorBase {
135
+ constructor(cause) {
136
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_NOT_INSTALLED, undefined, cause));
137
+ }
138
+ }
139
+ export class BarePackError extends QvacErrorBase {
140
+ constructor(exitCode, entryPath, outputPath, cause) {
141
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_ERROR, [exitCode, entryPath, outputPath], cause));
142
+ }
143
+ }
144
+ export class InvalidPluginSpecifierError extends QvacErrorBase {
145
+ constructor(specifiers, cause) {
146
+ const list = specifiers.map((s) => ` - ${s}`).join("\n");
147
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.INVALID_PLUGIN_SPECIFIER, [list], cause));
148
+ }
149
+ }
150
+ export class BareImportsMapNotFoundError extends QvacErrorBase {
151
+ constructor(sdkName, expectedPath, cause) {
152
+ super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_IMPORTS_MAP_NOT_FOUND, [sdkName, expectedPath], cause));
153
+ }
154
+ }
129
155
  export class ConfigFileNotFoundError extends QvacErrorBase {
130
156
  constructor(searchPaths, cause) {
131
157
  super(createErrorOptions(SDK_CLIENT_ERROR_CODES.CONFIG_FILE_NOT_FOUND, [searchPaths], cause));
@@ -52,8 +52,11 @@ export declare class TtsArtifactsRequiredError extends QvacErrorBase {
52
52
  export declare class TtsReferenceAudioRequiredError extends QvacErrorBase {
53
53
  constructor(cause?: unknown);
54
54
  }
55
- export declare class ParakeetArtifactsRequiredError extends QvacErrorBase {
56
- constructor(details?: string, cause?: unknown);
55
+ export declare class LegacyParakeetModelDeprecatedError extends QvacErrorBase {
56
+ constructor(legacyFields: readonly string[], cause?: unknown);
57
+ }
58
+ export declare class LegacyTtsModelDeprecatedError extends QvacErrorBase {
59
+ constructor(legacyFields: readonly string[], cause?: unknown);
57
60
  }
58
61
  export declare class ModelUnloadFailedError extends QvacErrorBase {
59
62
  constructor(modelId?: string, cause?: unknown);
@@ -76,6 +79,31 @@ export declare class TranslationFailedError extends QvacErrorBase {
76
79
  export declare class CompletionFailedError extends QvacErrorBase {
77
80
  constructor(details?: string, cause?: unknown);
78
81
  }
82
+ /**
83
+ * Thrown when the prompt exceeds the loaded model's configured context
84
+ * window — distinct from a generic `CompletionFailedError` so consumers
85
+ * can drive UX (truncate, summarize, or surface a "increase ctx_size /
86
+ * start a new thread" CTA) instead of treating it as an opaque failure.
87
+ *
88
+ * Carries the addon-reported prompt size and the model's context window
89
+ * when the addon's error message includes them (the C++ overflow paths
90
+ * in `TextLlmContext.cpp` and `MtmdLlmContext.cpp` format both numbers
91
+ * into the message; the bare `processPromptImpl: context overflow`
92
+ * fallback in `LlamaModel.cpp` carries neither — both fields are
93
+ * therefore optional). `modelId` is supplied by the server-side handler
94
+ * that wraps the addon error.
95
+ *
96
+ * Round-trips the RPC boundary via the typed-error reconstructor in
97
+ * `client/rpc/rpc-error.ts`, so `err instanceof ContextOverflowError`
98
+ * works on the consumer side.
99
+ */
100
+ export declare class ContextOverflowError extends QvacErrorBase {
101
+ readonly promptTokens?: number;
102
+ readonly ctxSize?: number;
103
+ readonly modelId?: string;
104
+ constructor(promptTokens?: number, ctxSize?: number, modelId?: string, cause?: unknown);
105
+ toErrorResponseFields(): Record<string, unknown>;
106
+ }
79
107
  export declare class AttachmentNotFoundError extends QvacErrorBase {
80
108
  constructor(path: string, cause?: unknown);
81
109
  }
@@ -63,9 +63,14 @@ export class TtsReferenceAudioRequiredError extends QvacErrorBase {
63
63
  super(createErrorOptions(SDK_SERVER_ERROR_CODES.TTS_REFERENCE_AUDIO_REQUIRED, undefined, cause));
64
64
  }
65
65
  }
66
- export class ParakeetArtifactsRequiredError extends QvacErrorBase {
67
- constructor(details, cause) {
68
- super(createErrorOptions(SDK_SERVER_ERROR_CODES.PARAKEET_ARTIFACTS_REQUIRED, details ? [details] : undefined, cause));
66
+ export class LegacyParakeetModelDeprecatedError extends QvacErrorBase {
67
+ constructor(legacyFields, cause) {
68
+ super(createErrorOptions(SDK_SERVER_ERROR_CODES.LEGACY_PARAKEET_MODEL_DEPRECATED, [legacyFields.join(", ")], cause));
69
+ }
70
+ }
71
+ export class LegacyTtsModelDeprecatedError extends QvacErrorBase {
72
+ constructor(legacyFields, cause) {
73
+ super(createErrorOptions(SDK_SERVER_ERROR_CODES.LEGACY_TTS_MODEL_DEPRECATED, [legacyFields.join(", ")], cause));
69
74
  }
70
75
  }
71
76
  // ============== Model Unloading Errors ==============
@@ -105,6 +110,49 @@ export class CompletionFailedError extends QvacErrorBase {
105
110
  super(createErrorOptions(SDK_SERVER_ERROR_CODES.COMPLETION_FAILED, details ? [details] : undefined, cause));
106
111
  }
107
112
  }
113
+ /**
114
+ * Thrown when the prompt exceeds the loaded model's configured context
115
+ * window — distinct from a generic `CompletionFailedError` so consumers
116
+ * can drive UX (truncate, summarize, or surface a "increase ctx_size /
117
+ * start a new thread" CTA) instead of treating it as an opaque failure.
118
+ *
119
+ * Carries the addon-reported prompt size and the model's context window
120
+ * when the addon's error message includes them (the C++ overflow paths
121
+ * in `TextLlmContext.cpp` and `MtmdLlmContext.cpp` format both numbers
122
+ * into the message; the bare `processPromptImpl: context overflow`
123
+ * fallback in `LlamaModel.cpp` carries neither — both fields are
124
+ * therefore optional). `modelId` is supplied by the server-side handler
125
+ * that wraps the addon error.
126
+ *
127
+ * Round-trips the RPC boundary via the typed-error reconstructor in
128
+ * `client/rpc/rpc-error.ts`, so `err instanceof ContextOverflowError`
129
+ * works on the consumer side.
130
+ */
131
+ export class ContextOverflowError extends QvacErrorBase {
132
+ promptTokens;
133
+ ctxSize;
134
+ modelId;
135
+ constructor(promptTokens, ctxSize, modelId, cause) {
136
+ super(createErrorOptions(SDK_SERVER_ERROR_CODES.CONTEXT_OVERFLOW, [
137
+ promptTokens !== undefined ? String(promptTokens) : "",
138
+ ctxSize !== undefined ? String(ctxSize) : "",
139
+ modelId ?? "",
140
+ ], cause));
141
+ if (promptTokens !== undefined)
142
+ this.promptTokens = promptTokens;
143
+ if (ctxSize !== undefined)
144
+ this.ctxSize = ctxSize;
145
+ if (modelId !== undefined)
146
+ this.modelId = modelId;
147
+ }
148
+ toErrorResponseFields() {
149
+ return {
150
+ ...(this.promptTokens !== undefined && { promptTokens: this.promptTokens }),
151
+ ...(this.ctxSize !== undefined && { ctxSize: this.ctxSize }),
152
+ ...(this.modelId !== undefined && { modelId: this.modelId }),
153
+ };
154
+ }
155
+ }
108
156
  export class AttachmentNotFoundError extends QvacErrorBase {
109
157
  constructor(path, cause) {
110
158
  super(createErrorOptions(SDK_SERVER_ERROR_CODES.ATTACHMENT_NOT_FOUND, [path], cause));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -88,9 +88,13 @@
88
88
  "types": "./dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts",
89
89
  "import": "./dist/server/bare/plugins/nmtcpp-translation/plugin.js"
90
90
  },
91
+ "./tts-ggml/plugin": {
92
+ "types": "./dist/server/bare/plugins/tts-ggml/plugin.d.ts",
93
+ "import": "./dist/server/bare/plugins/tts-ggml/plugin.js"
94
+ },
91
95
  "./onnx-tts/plugin": {
92
- "types": "./dist/server/bare/plugins/onnx-tts/plugin.d.ts",
93
- "import": "./dist/server/bare/plugins/onnx-tts/plugin.js"
96
+ "types": "./dist/server/bare/plugins/tts-ggml/plugin.d.ts",
97
+ "import": "./dist/server/bare/plugins/tts-ggml/plugin.js"
94
98
  },
95
99
  "./onnx-ocr/plugin": {
96
100
  "types": "./dist/server/bare/plugins/onnx-ocr/plugin.d.ts",
@@ -100,6 +104,14 @@
100
104
  "types": "./dist/server/bare/plugins/sdcpp-generation/plugin.d.ts",
101
105
  "import": "./dist/server/bare/plugins/sdcpp-generation/plugin.js"
102
106
  },
107
+ "./ggml-vla/plugin": {
108
+ "types": "./dist/server/bare/plugins/ggml-vla/plugin.d.ts",
109
+ "import": "./dist/server/bare/plugins/ggml-vla/plugin.js"
110
+ },
111
+ "./ggml-classification/plugin": {
112
+ "types": "./dist/server/bare/plugins/ggml-classification/plugin.d.ts",
113
+ "import": "./dist/server/bare/plugins/ggml-classification/plugin.js"
114
+ },
103
115
  "./plugin-utils": {
104
116
  "types": "./dist/schemas/plugin.d.ts",
105
117
  "import": "./dist/schemas/plugin.js"
@@ -115,6 +127,10 @@
115
127
  "./logging": {
116
128
  "import": "./dist/logging/index.js"
117
129
  },
130
+ "./commands": {
131
+ "types": "./dist/commands/index.d.ts",
132
+ "import": "./dist/commands/index.js"
133
+ },
118
134
  "./pear-pre": "./dist/pear/pre.js"
119
135
  },
120
136
  "imports": {
@@ -151,13 +167,13 @@
151
167
  "test:unit": "bun run scripts/run-unit-tests.ts",
152
168
  "test:security": "bun run scripts/run-security-tests.ts",
153
169
  "test:security:bare": "bun run scripts/run-security-tests-bare.ts",
154
- "lint": "eslint . --max-warnings=0 && bun run typecheck",
170
+ "lint": "eslint . --max-warnings=0 && npm run typecheck",
155
171
  "typecheck": "tsc --noEmit -p tsconfig.json",
156
172
  "lint:fix": "eslint . --fix",
157
173
  "format": "prettier --check .",
158
174
  "format:fix": "prettier --write .",
159
175
  "postcompile:aliases": "node ./scripts/resolve-aliases.mjs",
160
- "build": "rm -rf dist && bun run lint && tsc --project tsconfig.json && bun run postcompile:aliases",
176
+ "build": "rm -rf dist && npm run lint && tsc --project tsconfig.json && npm run postcompile:aliases",
161
177
  "build:pack": "bun run build && bun pm pack --destination dist/",
162
178
  "watch": "nodemon --watch server --ext ts --exec 'bun run build'",
163
179
  "bare:ensureprebuilds:llamacpp": "cp -r node_modules/@qvac/llm-llamacpp/prebuilds/android-arm64 node_modules/@qvac/llm-llamacpp/prebuilds/android-ia32 && cp -r node_modules/@qvac/llm-llamacpp/prebuilds/android-arm64 node_modules/@qvac/llm-llamacpp/prebuilds/android-arm && cp -r node_modules/@qvac/llm-llamacpp/prebuilds/android-arm64 node_modules/@qvac/llm-llamacpp/prebuilds/android-x64",
@@ -172,21 +188,43 @@
172
188
  "changelog:generate": "node ../../scripts/sdk/generate-changelog-sdk-pod.cjs --package=sdk && prettier --write changelog"
173
189
  },
174
190
  "dependencies": {
191
+ "@qvac/classification-ggml": "^0.2.0",
175
192
  "@qvac/decoder-audio": "^0.3.7",
176
- "@qvac/diffusion-cpp": "^0.7.0",
177
- "@qvac/embed-llamacpp": "^0.16.0",
193
+ "@qvac/diffusion-cpp": "^0.10.0",
194
+ "@qvac/embed-llamacpp": "^0.17.0",
178
195
  "@qvac/error": "^0.1.1",
179
196
  "@qvac/langdetect-text": "^0.1.2",
180
- "@qvac/llm-llamacpp": "^0.20.0",
197
+ "@qvac/llm-llamacpp": "^0.22.0",
181
198
  "@qvac/logging": "^0.1.0",
182
199
  "@qvac/ocr-onnx": "^0.5.0",
183
- "@qvac/rag": "^0.5.0",
184
- "@qvac/registry-client": "^0.5.0",
185
- "@qvac/transcription-parakeet": "^0.5.0",
200
+ "@qvac/rag": "^0.6.2",
201
+ "@qvac/registry-client": "^0.6.0",
202
+ "@qvac/transcription-parakeet": "^0.6.0",
186
203
  "@qvac/transcription-whispercpp": "^0.7.0",
187
- "@qvac/translation-nmtcpp": "^3.0.0",
188
- "@qvac/tts-onnx": "^0.9.0",
204
+ "@qvac/translation-nmtcpp": "^4.0.0",
205
+ "@qvac/tts-ggml": "^0.1.4",
206
+ "@qvac/vla-ggml": "^0.2.0",
207
+ "bare-abort-controller": "^1.0.0",
208
+ "bare-crypto": "^1.13.4",
209
+ "bare-events": "^2.8.0",
210
+ "bare-fetch": "^2.5.1",
211
+ "bare-fs": "^4.5.1",
212
+ "bare-net": "^2.2.0",
213
+ "bare-os": "^3.6.2",
214
+ "bare-pack": "^2.0.1",
215
+ "bare-path": "^3.0.0",
216
+ "bare-process": "^4.2.2",
217
+ "bare-rpc": "^1.3.2",
218
+ "bare-runtime": "^1.24.2",
219
+ "bare-stream": "^2.7.0",
220
+ "bare-zlib": "^1.3.1",
221
+ "corestore": "^7.4.5",
189
222
  "fast-safe-stringify": "2.1.1",
223
+ "hyperdrive": "^13.0.1",
224
+ "hyperswarm": "^4.14.0",
225
+ "llm-splitter": "~0.2.0",
226
+ "semver": "^7.8.0",
227
+ "tar-stream": "^3.1.8",
190
228
  "which-runtime": "^1.3.2",
191
229
  "zod": "^4.3.0"
192
230
  },
@@ -194,28 +232,24 @@
194
232
  "@eslint/js": "^9.33.0",
195
233
  "@expo/config-plugins": "^54.0.4",
196
234
  "@lancedb/lancedb": "^0.21.3",
197
- "@modelcontextprotocol/sdk": "^1.12.1",
198
- "@qvac/cli": "^0.4.0",
199
235
  "@sqliteai/sqlite-wasm": "3.50.4-sync.0.8.30-vector.0.9.23",
200
236
  "@types/node": "^24.2.1",
237
+ "@types/semver": "^7.7.1",
201
238
  "@types/tar-stream": "^3.1.4",
202
- "bare-pack": "^2.0.1",
203
239
  "bare-readline": "^1.2.0",
240
+ "bare-subprocess": "^5.2.3",
241
+ "bare-url": "^2.4.3",
204
242
  "brittle": "^3.19.1",
205
243
  "chromadb": "^3.0.14",
206
244
  "eslint": "^9.33.0",
207
245
  "eslint-import-resolver-typescript": "^4.4.4",
208
246
  "eslint-plugin-import": "^2.30.0",
209
247
  "eslint-plugin-react": "^7.37.5",
248
+ "events": "^3.3.0",
210
249
  "expo": "^54.0.33",
211
- "expo-device": "^8.0.10",
212
- "expo-file-system": "^19.0.21",
213
250
  "globals": "^16.3.0",
214
251
  "husky": "^9.1.7",
215
- "hyperdb": "^4.16.1",
216
- "pear-pipe": "^1.0.6",
217
252
  "prettier": "^3.6.2",
218
- "react-native-bare-kit": "0.12.3",
219
253
  "remark-cli": "^12.0.1",
220
254
  "remark-code-import": "^1.2.0",
221
255
  "remark-frontmatter": "^5.0.0",
@@ -224,69 +258,21 @@
224
258
  "typescript": "^5.9.3",
225
259
  "typescript-eslint": "^8.39.0"
226
260
  },
227
- "peerDependencies": {
228
- "@modelcontextprotocol/sdk": "^1.0.0",
229
- "@qvac/cli": "^0.4.0",
230
- "bare-abort-controller": "^1.0.0",
231
- "bare-buffer": "^3.4.2",
232
- "bare-crypto": "^1.13.4",
233
- "bare-dns": "^2.1.4",
234
- "bare-fetch": "^2.5.1",
235
- "bare-fs": "^4.5.1",
236
- "bare-http1": "^4.1.6",
237
- "bare-https": "^2.1.3",
261
+ "optionalDependencies": {
262
+ "@modelcontextprotocol/sdk": "^1.12.1",
238
263
  "bare-link": "^3.2.1",
239
- "bare-net": "^2.2.0",
240
- "bare-os": "^3.6.2",
241
- "bare-path": "^3.0.0",
242
- "bare-process": "^4.2.2",
243
- "bare-rpc": "^1.3.2",
244
- "bare-runtime": "^1.24.2",
245
- "bare-stream": "^2.7.0",
246
- "bare-subprocess": "^5.2.3",
247
- "bare-zlib": "^1.3.1",
248
- "compact-encoding": "^2.19.0",
249
- "corestore": "^7.4.5",
250
- "events": "^3.3.0",
251
- "expo-build-properties": ">=0.12.0",
252
- "expo-device": "^8.0.0",
253
- "expo-file-system": "^19.0.15",
254
- "hyperblobs": "^2.8.0",
255
- "hyperdb": "^4.19.0",
256
- "hyperdht": "^6.23.0",
257
- "hyperdrive": "^13.0.1",
258
- "hyperswarm": "^4.14.0",
259
- "llm-splitter": "~0.2.0",
264
+ "compact-encoding": "^3.0.0",
265
+ "expo-build-properties": "^0.12.0",
266
+ "expo-device": "^8.0.10",
267
+ "expo-file-system": "^19.0.21",
260
268
  "pear-pipe": "^1.0.6",
261
- "react-native-bare-kit": "0.12.3",
262
- "tar-stream": "^3.1.8"
269
+ "react-native-bare-kit": "^0.14.0"
270
+ },
271
+ "peerDependencies": {
272
+ "tsx": "*"
263
273
  },
264
274
  "peerDependenciesMeta": {
265
- "@qvac/cli": {
266
- "optional": true
267
- },
268
- "@modelcontextprotocol/sdk": {
269
- "optional": true
270
- },
271
- "expo-build-properties": {
272
- "optional": true
273
- },
274
- "expo-device": {
275
- "optional": true
276
- },
277
- "expo-file-system": {
278
- "optional": true
279
- },
280
- "react-native-bare-kit": {
281
- "optional": true
282
- },
283
- "compact-encoding": {
284
- "optional": true
285
- },
286
- "hyperdht": {
287
- "optional": true
288
- },
289
- "pear-pipe": {
275
+ "tsx": {
290
276
  "optional": true
291
277
  }
292
278
  },