@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.
- package/NOTICE +1423 -43
- package/README.md +2 -0
- package/dist/client/api/classify.d.ts +23 -0
- package/dist/client/api/classify.js +43 -0
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +4 -0
- package/dist/client/api/index.js +4 -0
- package/dist/client/api/load-model.js +24 -1
- package/dist/client/api/transcribe.d.ts +3 -0
- package/dist/client/api/transcribe.js +13 -2
- package/dist/client/api/video.d.ts +64 -0
- package/dist/client/api/video.js +147 -0
- package/dist/client/api/vla-helpers.d.ts +45 -0
- package/dist/client/api/vla-helpers.js +130 -0
- package/dist/client/api/vla.d.ts +65 -0
- package/dist/client/api/vla.js +109 -0
- package/dist/client/config-loader/resolve-config.node.d.ts +16 -0
- package/dist/client/config-loader/resolve-config.node.js +77 -23
- package/dist/client/plugins-factory.d.ts +8 -0
- package/dist/client/plugins-factory.js +10 -0
- package/dist/client/rpc/bare-client.d.ts +1 -0
- package/dist/client/rpc/bare-client.js +66 -66
- package/dist/client/rpc/ensure-worker-ready.d.ts +9 -0
- package/dist/client/rpc/ensure-worker-ready.js +17 -0
- package/dist/client/rpc/expo-rpc-client.d.ts +1 -0
- package/dist/client/rpc/expo-rpc-client.js +4 -0
- package/dist/client/rpc/node-rpc-client.d.ts +1 -0
- package/dist/client/rpc/node-rpc-client.js +97 -5
- package/dist/client/rpc/rpc-client.js +115 -8
- package/dist/client/rpc/rpc-error.js +14 -1
- package/dist/commands/bundle/bare-pack.d.ts +13 -0
- package/dist/commands/bundle/bare-pack.js +54 -0
- package/dist/commands/bundle/constants.d.ts +7 -0
- package/dist/commands/bundle/constants.js +23 -0
- package/dist/commands/bundle/entry-gen.d.ts +2 -0
- package/dist/commands/bundle/entry-gen.js +48 -0
- package/dist/commands/bundle/index.d.ts +20 -0
- package/dist/commands/bundle/index.js +141 -0
- package/dist/commands/bundle/manifest.d.ts +21 -0
- package/dist/commands/bundle/manifest.js +193 -0
- package/dist/commands/bundle/plugins.d.ts +9 -0
- package/dist/commands/bundle/plugins.js +51 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/verify/abi.d.ts +52 -0
- package/dist/commands/verify/abi.js +125 -0
- package/dist/commands/verify/addon-source.d.ts +43 -0
- package/dist/commands/verify/addon-source.js +75 -0
- package/dist/commands/verify/bundle-source.d.ts +12 -0
- package/dist/commands/verify/bundle-source.js +53 -0
- package/dist/commands/verify/index.d.ts +59 -0
- package/dist/commands/verify/index.js +371 -0
- package/dist/commands/verify/node-modules-source.d.ts +11 -0
- package/dist/commands/verify/node-modules-source.js +76 -0
- package/dist/commands/verify/prebuilds.d.ts +15 -0
- package/dist/commands/verify/prebuilds.js +39 -0
- package/dist/examples/classification/classify-image.d.ts +2 -0
- package/dist/examples/classification/classify-image.js +23 -0
- package/dist/examples/diffusion-txt2vid.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid.js +81 -0
- package/dist/examples/plugins.js +3 -7
- package/dist/examples/tools/llamacpp-tools-gemma4.js +2 -5
- package/dist/examples/tools/llamacpp-tools-qwen35.js +2 -3
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +18 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +7 -12
- package/dist/examples/transcription/parakeet-microphone-stream.d.ts +2 -0
- package/dist/examples/transcription/parakeet-microphone-stream.js +79 -0
- package/dist/examples/transcription/parakeet-sortformer-streaming.d.ts +2 -0
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +121 -0
- package/dist/examples/transcription/parakeet-sortformer.js +58 -55
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +18 -15
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +6 -1
- package/dist/examples/tts/chatterbox.js +7 -16
- package/dist/examples/tts/llm-to-tts-streaming.js +3 -10
- package/dist/examples/tts/supertonic-multilingual.js +4 -12
- package/dist/examples/tts/supertonic.js +5 -12
- package/dist/examples/vla-smolvla.d.ts +2 -0
- package/dist/examples/vla-smolvla.js +75 -0
- package/dist/examples/voice-assistant/voice-assistant.js +3 -10
- package/dist/expo/plugins/find-in-ancestor-node-modules.d.ts +14 -0
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +24 -0
- package/dist/expo/plugins/get-project-root.d.ts +22 -0
- package/dist/expo/plugins/get-project-root.js +23 -0
- package/dist/expo/plugins/index.d.ts +4 -0
- package/dist/expo/plugins/index.js +4 -0
- package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +9 -2
- package/dist/expo/plugins/resolve-sdk-package-dir.js +38 -11
- package/dist/expo/plugins/withDeviceInfo.js +2 -1
- package/dist/expo/plugins/withMobileBundle.d.ts +2 -17
- package/dist/expo/plugins/withMobileBundle.js +31 -85
- package/dist/index.d.ts +5 -3
- package/dist/index.js +9 -3
- package/dist/models/registry/models.d.ts +3711 -368
- package/dist/models/registry/models.js +7066 -3562
- package/dist/models/update-models/naming.js +22 -8
- package/dist/pear/pre.js +6 -2
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/classification.d.ts +53 -0
- package/dist/schemas/classification.js +33 -0
- package/dist/schemas/common.d.ts +1001 -1739
- package/dist/schemas/common.js +6 -1
- package/dist/schemas/completion-event.d.ts +3 -0
- package/dist/schemas/completion-event.js +1 -0
- package/dist/schemas/completion-stream.d.ts +1 -0
- package/dist/schemas/download-asset.d.ts +13 -3
- package/dist/schemas/engine-addon-map.d.ts +3 -0
- package/dist/schemas/engine-addon-map.js +18 -5
- package/dist/schemas/get-model-info.d.ts +4 -0
- package/dist/schemas/get-model-info.js +2 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/llamacpp-config.d.ts +12 -2
- package/dist/schemas/load-model.d.ts +6152 -10764
- package/dist/schemas/load-model.js +75 -7
- package/dist/schemas/model-src-utils.d.ts +22 -2
- package/dist/schemas/model-types.d.ts +46 -6
- package/dist/schemas/model-types.js +28 -5
- package/dist/schemas/ocr.d.ts +5 -0
- package/dist/schemas/plugin.d.ts +20 -5
- package/dist/schemas/plugin.js +21 -4
- package/dist/schemas/registry.d.ts +44 -0
- package/dist/schemas/registry.js +5 -0
- package/dist/schemas/reload-config.d.ts +22 -2
- package/dist/schemas/sdcpp-config.d.ts +316 -1
- package/dist/schemas/sdcpp-config.js +232 -33
- package/dist/schemas/sdk-config.d.ts +654 -1324
- package/dist/schemas/sdk-config.js +16 -1
- package/dist/schemas/sdk-errors-client.d.ts +7 -0
- package/dist/schemas/sdk-errors-client.js +36 -1
- package/dist/schemas/sdk-errors-server.d.ts +3 -1
- package/dist/schemas/sdk-errors-server.js +20 -5
- package/dist/schemas/text-to-speech.d.ts +79 -696
- package/dist/schemas/text-to-speech.js +46 -19
- package/dist/schemas/transcription-config.d.ts +37 -226
- package/dist/schemas/transcription-config.js +76 -15
- package/dist/schemas/transcription.d.ts +63 -11
- package/dist/schemas/transcription.js +56 -2
- package/dist/schemas/translation-config.d.ts +60 -10
- package/dist/schemas/vla.d.ts +87 -0
- package/dist/schemas/vla.js +108 -0
- package/dist/scripts/run-unit-tests.js +8 -2
- package/dist/server/bare/ops/transcribe.d.ts +2 -1
- package/dist/server/bare/ops/transcribe.js +59 -34
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +6 -0
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +30 -0
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +32 -0
- package/dist/server/bare/plugins/ggml-classification/plugin.js +55 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +12 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +75 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +54 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +57 -0
- package/dist/server/bare/plugins/index.d.ts +3 -1
- package/dist/server/bare/plugins/index.js +3 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +3 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +29 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +65 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +26 -0
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +25 -0
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +5 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +67 -246
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +66 -97
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +199 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +200 -2
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +61 -8
- package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.js +2 -15
- package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.js +2 -1
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +75 -0
- package/dist/server/bare/plugins/tts-ggml/plugin.js +189 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +29 -4
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +12 -1
- package/dist/server/bare/registry/model-config-utils.js +7 -0
- package/dist/server/bare/runtime/request-context.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.js +9 -9
- package/dist/server/bare/types/addon-responses.d.ts +1 -0
- package/dist/server/env.js +4 -1
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/index.js +1 -1
- package/dist/server/plugins/registry.d.ts +1 -0
- package/dist/server/plugins/registry.js +5 -0
- package/dist/server/rpc/handler-registry.js +4 -0
- package/dist/server/rpc/handler-selection.d.ts +9 -0
- package/dist/server/rpc/handler-selection.js +14 -0
- package/dist/server/rpc/handler-utils.js +5 -13
- package/dist/server/rpc/handlers/classify.d.ts +3 -0
- package/dist/server/rpc/handlers/classify.js +4 -0
- package/dist/server/rpc/handlers/index.d.ts +2 -0
- package/dist/server/rpc/handlers/index.js +2 -0
- package/dist/server/rpc/handlers/load-model/handler.js +4 -1
- package/dist/server/rpc/handlers/load-model/resolve.js +9 -0
- package/dist/server/rpc/handlers/video-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/video-stream.js +4 -0
- package/dist/server/rpc/profiling/operation-metrics.js +23 -0
- package/dist/server/utils/config-transform.js +1 -1
- package/dist/server/utils/tools/parsers/qwen35.js +7 -3
- package/dist/server/worker.js +14 -11
- package/dist/utils/errors-client.d.ts +23 -0
- package/dist/utils/errors-client.js +40 -0
- package/dist/utils/errors-server.d.ts +30 -2
- package/dist/utils/errors-server.js +51 -3
- package/package.json +66 -80
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -490
- package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -272
- package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
- package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
- /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.d.ts +0 -0
- /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.d.ts +0 -0
|
@@ -22,12 +22,16 @@ function coerceParamValue(raw, schema) {
|
|
|
22
22
|
throw new Error(`invalid integer value: "${trimmed}"`);
|
|
23
23
|
return n;
|
|
24
24
|
}
|
|
25
|
-
case "boolean":
|
|
26
|
-
|
|
25
|
+
case "boolean": {
|
|
26
|
+
// Qwen3.5/3.6 intermittently emit Python-style capitalised booleans
|
|
27
|
+
// (`True`/`False`); accept any casing so a valid call isn't dropped.
|
|
28
|
+
const v = trimmed.toLowerCase();
|
|
29
|
+
if (v === "true")
|
|
27
30
|
return true;
|
|
28
|
-
if (
|
|
31
|
+
if (v === "false")
|
|
29
32
|
return false;
|
|
30
33
|
throw new Error(`invalid boolean value: "${trimmed}"`);
|
|
34
|
+
}
|
|
31
35
|
case "array":
|
|
32
36
|
case "object":
|
|
33
37
|
return JSON.parse(trimmed);
|
package/dist/server/worker.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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)");
|
|
@@ -41,6 +41,14 @@ export declare class RPCConnectionFailedError extends QvacErrorBase {
|
|
|
41
41
|
export declare class RPCInitTimeoutError extends QvacErrorBase {
|
|
42
42
|
constructor(timeoutMs: number, cause?: unknown);
|
|
43
43
|
}
|
|
44
|
+
export declare class WorkerCrashedError extends QvacErrorBase {
|
|
45
|
+
readonly exitCode: number | null;
|
|
46
|
+
readonly exitSignal: NodeJS.Signals | null;
|
|
47
|
+
constructor(exitCode: number | null, exitSignal: NodeJS.Signals | null, cause?: unknown);
|
|
48
|
+
}
|
|
49
|
+
export declare class WorkerShutdownError extends QvacErrorBase {
|
|
50
|
+
constructor(cause?: unknown);
|
|
51
|
+
}
|
|
44
52
|
export declare class ProviderStartFailedError extends QvacErrorBase {
|
|
45
53
|
constructor(details?: string, cause?: unknown);
|
|
46
54
|
}
|
|
@@ -68,9 +76,24 @@ export declare class WorkerFileNotFoundError extends QvacErrorBase {
|
|
|
68
76
|
export declare class PearWorkerEntryRequiredError extends QvacErrorBase {
|
|
69
77
|
constructor(workerEntry: string, cause?: unknown);
|
|
70
78
|
}
|
|
79
|
+
export declare class WorkerPluginsNotRegisteredError extends QvacErrorBase {
|
|
80
|
+
constructor(cause?: unknown);
|
|
81
|
+
}
|
|
71
82
|
export declare class BundleVerificationFailedError extends QvacErrorBase {
|
|
72
83
|
constructor(bundlePath: string, cause?: unknown);
|
|
73
84
|
}
|
|
85
|
+
export declare class BarePackNotInstalledError extends QvacErrorBase {
|
|
86
|
+
constructor(cause?: unknown);
|
|
87
|
+
}
|
|
88
|
+
export declare class BarePackError extends QvacErrorBase {
|
|
89
|
+
constructor(exitCode: number, entryPath: string, outputPath: string, cause?: unknown);
|
|
90
|
+
}
|
|
91
|
+
export declare class InvalidPluginSpecifierError extends QvacErrorBase {
|
|
92
|
+
constructor(specifiers: string[], cause?: unknown);
|
|
93
|
+
}
|
|
94
|
+
export declare class BareImportsMapNotFoundError extends QvacErrorBase {
|
|
95
|
+
constructor(sdkName: string, expectedPath: string, cause?: unknown);
|
|
96
|
+
}
|
|
74
97
|
export declare class ConfigFileNotFoundError extends QvacErrorBase {
|
|
75
98
|
constructor(searchPaths: string, cause?: unknown);
|
|
76
99
|
}
|
|
@@ -74,6 +74,20 @@ export class RPCInitTimeoutError extends QvacErrorBase {
|
|
|
74
74
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.RPC_INIT_TIMEOUT, [timeoutMs], cause));
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
export class WorkerCrashedError extends QvacErrorBase {
|
|
78
|
+
exitCode;
|
|
79
|
+
exitSignal;
|
|
80
|
+
constructor(exitCode, exitSignal, cause) {
|
|
81
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_CRASHED, [String(exitCode), String(exitSignal)], cause));
|
|
82
|
+
this.exitCode = exitCode;
|
|
83
|
+
this.exitSignal = exitSignal;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export class WorkerShutdownError extends QvacErrorBase {
|
|
87
|
+
constructor(cause) {
|
|
88
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_SHUTDOWN, undefined, cause));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
77
91
|
// ============== Provider/Delegation Errors ==============
|
|
78
92
|
export class ProviderStartFailedError extends QvacErrorBase {
|
|
79
93
|
constructor(details, cause) {
|
|
@@ -121,11 +135,37 @@ export class PearWorkerEntryRequiredError extends QvacErrorBase {
|
|
|
121
135
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.PEAR_WORKER_ENTRY_REQUIRED, [workerEntry], cause));
|
|
122
136
|
}
|
|
123
137
|
}
|
|
138
|
+
export class WorkerPluginsNotRegisteredError extends QvacErrorBase {
|
|
139
|
+
constructor(cause) {
|
|
140
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_PLUGINS_NOT_REGISTERED, [], cause));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
124
143
|
export class BundleVerificationFailedError extends QvacErrorBase {
|
|
125
144
|
constructor(bundlePath, cause) {
|
|
126
145
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BUNDLE_VERIFICATION_FAILED, [bundlePath], cause));
|
|
127
146
|
}
|
|
128
147
|
}
|
|
148
|
+
export class BarePackNotInstalledError extends QvacErrorBase {
|
|
149
|
+
constructor(cause) {
|
|
150
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_NOT_INSTALLED, undefined, cause));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export class BarePackError extends QvacErrorBase {
|
|
154
|
+
constructor(exitCode, entryPath, outputPath, cause) {
|
|
155
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_ERROR, [exitCode, entryPath, outputPath], cause));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export class InvalidPluginSpecifierError extends QvacErrorBase {
|
|
159
|
+
constructor(specifiers, cause) {
|
|
160
|
+
const list = specifiers.map((s) => ` - ${s}`).join("\n");
|
|
161
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.INVALID_PLUGIN_SPECIFIER, [list], cause));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export class BareImportsMapNotFoundError extends QvacErrorBase {
|
|
165
|
+
constructor(sdkName, expectedPath, cause) {
|
|
166
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_IMPORTS_MAP_NOT_FOUND, [sdkName, expectedPath], cause));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
129
169
|
export class ConfigFileNotFoundError extends QvacErrorBase {
|
|
130
170
|
constructor(searchPaths, cause) {
|
|
131
171
|
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
|
|
56
|
-
constructor(
|
|
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
|
|
67
|
-
constructor(
|
|
68
|
-
super(createErrorOptions(SDK_SERVER_ERROR_CODES.
|
|
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.
|
|
3
|
+
"version": "0.12.1",
|
|
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/
|
|
93
|
-
"import": "./dist/server/bare/plugins/
|
|
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 &&
|
|
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 &&
|
|
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.
|
|
177
|
-
"@qvac/embed-llamacpp": "^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.
|
|
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.
|
|
184
|
-
"@qvac/registry-client": "^0.
|
|
185
|
-
"@qvac/transcription-parakeet": "^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": "^
|
|
188
|
-
"@qvac/tts-
|
|
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
|
-
"
|
|
228
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
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
|
-
"
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
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.
|
|
262
|
-
|
|
269
|
+
"react-native-bare-kit": "^0.14.0"
|
|
270
|
+
},
|
|
271
|
+
"peerDependencies": {
|
|
272
|
+
"tsx": "*"
|
|
263
273
|
},
|
|
264
274
|
"peerDependenciesMeta": {
|
|
265
|
-
"
|
|
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
|
},
|