@qvac/sdk 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +194 -97
- package/README.md +29 -470
- package/dist/examples/asr/parakeet-sortformer.js +24 -14
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +105 -0
- package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
- package/dist/examples/asr/whispercpp-prompt.js +9 -5
- package/dist/examples/assess-model-fit.d.ts +7 -9
- package/dist/examples/assess-model-fit.js +22 -43
- package/dist/examples/calc-tokens.d.ts +2 -0
- package/dist/examples/calc-tokens.js +21 -0
- package/dist/examples/classification/classify-image.js +11 -5
- package/dist/examples/completion-stop-reason.d.ts +3 -3
- package/dist/examples/completion-stop-reason.js +4 -4
- package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
- package/dist/examples/diffusion-flux3-klein.js +102 -0
- package/dist/examples/diffusion-img2vid-ltx.js +7 -14
- package/dist/examples/diffusion-moss-image.d.ts +2 -0
- package/dist/examples/diffusion-moss-image.js +126 -0
- package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
- package/dist/examples/diffusion-qwen-image-21.js +115 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
- package/dist/examples/embed-multimodal.d.ts +2 -0
- package/dist/examples/embed-multimodal.js +80 -0
- package/dist/examples/embed-p2p.js +2 -2
- package/dist/examples/finetune/llamacpp-finetune.js +9 -4
- package/dist/examples/image/megaloc.d.ts +2 -0
- package/dist/examples/image/megaloc.js +37 -0
- package/dist/examples/llamacpp-multimodal.js +21 -1
- package/dist/examples/mcp-websearch.js +1 -1
- package/dist/examples/plugins.js +1 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
- package/dist/examples/rag/rag-turbovec.js +2 -2
- package/dist/examples/rerank.d.ts +2 -0
- package/dist/examples/rerank.js +33 -0
- package/dist/examples/sessions.d.ts +17 -0
- package/dist/examples/sessions.js +63 -0
- package/dist/examples/tools/llamacpp-deferred-tools.js +12 -8
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
- package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
- package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
- package/dist/scripts/check-resource-collectors-packaging.js +7 -6
- package/dist/scripts/contract/build-contract.d.ts +2 -1
- package/dist/scripts/contract/build-contract.js +13 -1
- package/dist/scripts/contract/constants-registry.d.ts +19 -0
- package/dist/scripts/contract/constants-registry.js +9 -2
- package/dist/scripts/contract/method-shapes.d.ts +5 -0
- package/dist/scripts/contract/method-shapes.js +5 -0
- package/dist/scripts/enforce-inference-versions.d.ts +1 -1
- package/dist/scripts/enforce-inference-versions.js +28 -18
- package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
- package/dist/src/client/api/assess-model-fit.d.ts +17 -17
- package/dist/src/client/api/assess-model-fit.js +19 -32
- package/dist/src/client/api/audio-edit.d.ts +5 -3
- package/dist/src/client/api/audio-edit.js +7 -5
- package/dist/src/client/api/audio-gen-result.js +136 -47
- package/dist/src/client/api/audio-gen.d.ts +40 -3
- package/dist/src/client/api/audio-gen.js +42 -5
- package/dist/src/client/api/audio-understand.d.ts +2 -2
- package/dist/src/client/api/audio-understand.js +4 -4
- package/dist/src/client/api/batch-completion.js +4 -3
- package/dist/src/client/api/bci-transcribe.js +3 -3
- package/dist/src/client/api/calc-tokens.d.ts +33 -0
- package/dist/src/client/api/calc-tokens.js +44 -0
- package/dist/src/client/api/cancel.d.ts +2 -2
- package/dist/src/client/api/cancel.js +3 -3
- package/dist/src/client/api/classify.d.ts +12 -5
- package/dist/src/client/api/classify.js +18 -6
- package/dist/src/client/api/client-request-id.d.ts +0 -15
- package/dist/src/client/api/client-request-id.js +15 -12
- package/dist/src/client/api/completion-stream.d.ts +9 -1
- package/dist/src/client/api/completion-stream.js +14 -3
- package/dist/src/client/api/decide.d.ts +1 -1
- package/dist/src/client/api/decide.js +3 -3
- package/dist/src/client/api/delete-cache.d.ts +9 -2
- package/dist/src/client/api/delete-cache.js +14 -4
- package/dist/src/client/api/diffusion.d.ts +38 -5
- package/dist/src/client/api/diffusion.js +42 -7
- package/dist/src/client/api/download-asset.js +3 -3
- package/dist/src/client/api/embed.d.ts +82 -29
- package/dist/src/client/api/embed.js +66 -21
- package/dist/src/client/api/finetune.js +3 -3
- package/dist/src/client/api/get-loaded-model-info.js +1 -1
- package/dist/src/client/api/get-model-info.d.ts +2 -2
- package/dist/src/client/api/get-model-info.js +3 -3
- package/dist/src/client/api/get-system-resources.d.ts +2 -2
- package/dist/src/client/api/get-system-resources.js +3 -3
- package/dist/src/client/api/heartbeat.d.ts +3 -2
- package/dist/src/client/api/heartbeat.js +4 -3
- package/dist/src/client/api/index.d.ts +8 -6
- package/dist/src/client/api/index.js +6 -4
- package/dist/src/client/api/invoke-plugin.d.ts +8 -2
- package/dist/src/client/api/invoke-plugin.js +18 -3
- package/dist/src/client/api/load-model.js +9 -6
- package/dist/src/client/api/logging-stream.d.ts +11 -2
- package/dist/src/client/api/logging-stream.js +12 -3
- package/dist/src/client/api/ocr.d.ts +5 -3
- package/dist/src/client/api/ocr.js +45 -22
- package/dist/src/client/api/rag.d.ts +1 -1
- package/dist/src/client/api/rag.js +3 -3
- package/dist/src/client/api/registry.d.ts +19 -8
- package/dist/src/client/api/registry.js +43 -17
- package/dist/src/client/api/rerank.d.ts +22 -0
- package/dist/src/client/api/rerank.js +39 -0
- package/dist/src/client/api/resume.d.ts +2 -1
- package/dist/src/client/api/resume.js +3 -3
- package/dist/src/client/api/rpc-server.d.ts +4 -4
- package/dist/src/client/api/rpc-server.js +12 -12
- package/dist/src/client/api/state.d.ts +2 -2
- package/dist/src/client/api/state.js +3 -3
- package/dist/src/client/api/subscribe-logs.d.ts +2 -2
- package/dist/src/client/api/subscribe-logs.js +4 -3
- package/dist/src/client/api/suspend.d.ts +4 -2
- package/dist/src/client/api/suspend.js +5 -4
- package/dist/src/client/api/text-to-speech.d.ts +14 -5
- package/dist/src/client/api/text-to-speech.js +86 -32
- package/dist/src/client/api/transcribe.d.ts +7 -3
- package/dist/src/client/api/transcribe.js +9 -3
- package/dist/src/client/api/translate.js +2 -2
- package/dist/src/client/api/unload-model.d.ts +19 -7
- package/dist/src/client/api/unload-model.js +31 -13
- package/dist/src/client/api/upscale.d.ts +6 -3
- package/dist/src/client/api/upscale.js +10 -5
- package/dist/src/client/api/vector-index.d.ts +51 -17
- package/dist/src/client/api/vector-index.js +101 -49
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +3 -2
- package/dist/src/client/api/video.js +6 -5
- package/dist/src/client/api/vla.d.ts +9 -5
- package/dist/src/client/api/vla.js +17 -8
- package/dist/src/client/api/world-result.js +2 -2
- package/dist/src/client/api/world.d.ts +6 -6
- package/dist/src/client/api/world.js +6 -6
- package/dist/src/client/init-hooks.d.ts +6 -4
- package/dist/src/client/init-hooks.js +12 -15
- package/dist/src/client/logging-stream-registry.d.ts +6 -3
- package/dist/src/client/logging-stream-registry.js +36 -14
- package/dist/src/client/plugins-factory.d.ts +1 -1
- package/dist/src/client/plugins-factory.js +1 -1
- package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
- package/dist/src/client/rpc/bundle-stamp.js +75 -0
- package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
- package/dist/src/client/rpc/expo-home-dir.js +4 -0
- package/dist/src/client/rpc/expo-rpc-client.js +192 -138
- package/dist/src/client/rpc/node-rpc-client.js +324 -426
- package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
- package/dist/src/client/rpc/pear-runtime.js +12 -0
- package/dist/src/client/rpc/rpc-client.d.ts +6 -4
- package/dist/src/client/rpc/rpc-client.js +168 -31
- package/dist/src/client/rpc/rpc-error.js +24 -2
- package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
- package/dist/src/client/rpc/unbundled-harness.js +27 -0
- package/dist/src/client/rpc/worker-failure.d.ts +27 -0
- package/dist/src/client/rpc/worker-failure.js +61 -0
- package/dist/src/client/session-registry.d.ts +75 -0
- package/dist/src/client/session-registry.js +149 -0
- package/dist/src/client/session.d.ts +125 -0
- package/dist/src/client/session.js +148 -0
- package/dist/src/commands/bundle/addons.d.ts +14 -0
- package/dist/src/commands/bundle/addons.js +65 -0
- package/dist/src/commands/bundle/constants.js +2 -0
- package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
- package/dist/src/commands/bundle/entry-gen.js +18 -51
- package/dist/src/commands/bundle/index.d.ts +60 -14
- package/dist/src/commands/bundle/index.js +350 -126
- package/dist/src/commands/bundle/link.d.ts +58 -0
- package/dist/src/commands/bundle/link.js +135 -0
- package/dist/src/commands/bundle/node-support.d.ts +13 -0
- package/dist/src/commands/bundle/node-support.js +23 -0
- package/dist/src/commands/bundle/plugins.js +1 -1
- package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
- package/dist/src/commands/bundle/read-bundle.js +27 -0
- package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
- package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
- package/dist/src/commands/bundle/scratch.d.ts +35 -0
- package/dist/src/commands/bundle/scratch.js +178 -0
- package/dist/src/commands/bundle/targets.d.ts +14 -0
- package/dist/src/commands/bundle/targets.js +37 -0
- package/dist/src/commands/host-prebuilds/index.d.ts +8 -7
- package/dist/src/commands/host-prebuilds/index.js +13 -11
- package/dist/src/commands/index.d.ts +13 -12
- package/dist/src/commands/index.js +7 -7
- package/dist/src/commands/verify/abi.d.ts +21 -15
- package/dist/src/commands/verify/abi.js +12 -80
- package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
- package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
- package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
- package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
- package/dist/src/commands/verify/bundle-source.d.ts +1 -1
- package/dist/src/commands/verify/bundle-source.js +27 -23
- package/dist/src/commands/verify/engines-advice.d.ts +6 -12
- package/dist/src/commands/verify/engines-advice.js +9 -56
- package/dist/src/commands/verify/index.d.ts +34 -33
- package/dist/src/commands/verify/index.js +96 -204
- package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/src/commands/verify/node-modules-source.js +1 -1
- package/dist/src/commands/verify/prebuilds.d.ts +4 -6
- package/dist/src/commands/verify/prebuilds.js +3 -4
- package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
- package/dist/src/commands/verify/resource-collectors.js +3 -52
- package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
- package/dist/src/commands/verify/sidecar-runtime.js +51 -0
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
- package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
- package/dist/src/expo/plugins/withBareKit.js +204 -0
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
- package/dist/src/expo/plugins/withMobileBundle.d.ts +5 -12
- package/dist/src/expo/plugins/withMobileBundle.js +38 -59
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +2 -1
- package/dist/src/expo/plugins/withQvacSDK.js +3 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +10 -14
- package/dist/src/logging/addon.d.ts +1 -1
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +11 -3
- package/dist/src/plugin-ids.d.ts +3 -1
- package/dist/src/plugin-ids.js +4 -0
- package/dist/src/schemas/public.d.ts +1 -1
- package/dist/src/schemas/public.js +1 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
- package/dist/src/schemas/sdk-errors-client.js +30 -36
- package/dist/src/schemas/sdk-errors-server.d.ts +12 -1
- package/dist/src/schemas/sdk-errors-server.js +65 -2
- package/dist/src/server/rpc/rpc-utils.d.ts +26 -0
- package/dist/src/server/rpc/rpc-utils.js +41 -0
- package/dist/src/utils/aggregate-events.d.ts +1 -1
- package/dist/src/utils/aggregate-events.js +2 -2
- package/dist/src/utils/errors-client.d.ts +37 -29
- package/dist/src/utils/errors-client.js +50 -41
- package/dist/src/utils/errors-server.d.ts +65 -1
- package/dist/src/utils/errors-server.js +122 -1
- package/dist/src/utils/mcp-adapter.d.ts +1 -1
- package/dist/src/utils/mcp-adapter.js +1 -1
- package/dist/src/utils/tool-helpers.js +1 -1
- package/dist/src/utils/withTimeout.js +34 -17
- package/dist/src/worker/handle-request.js +26 -21
- package/dist/src/worker/handler-utils.d.ts +2 -6
- package/dist/src/worker/handler-utils.js +2 -20
- package/dist/src/worker/index.d.ts +2 -4
- package/dist/src/worker/index.js +24 -34
- package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
- package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
- package/dist/src/worker/shim.d.ts +4 -0
- package/dist/src/worker/shim.js +7 -0
- package/dist/src/worker/start.d.ts +9 -0
- package/dist/src/worker/start.js +16 -0
- package/dist/src/worker/unbundled-shim.d.ts +2 -0
- package/dist/src/worker/unbundled-shim.js +4 -0
- package/docs/system-resources-support-matrix.md +27 -19
- package/package.json +91 -74
- package/src/electron-forge/index.cjs +65 -91
- package/dist/examples/model-fit-ui/server.d.ts +0 -24
- package/dist/examples/model-fit-ui/server.js +0 -221
- package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
- package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
- package/dist/src/client/rpc/init-timeout.d.ts +0 -26
- package/dist/src/client/rpc/init-timeout.js +0 -25
- package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
- package/dist/src/client/rpc/worker-startup-error.js +0 -13
- package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
- package/dist/src/commands/bundle/bare-pack.js +0 -77
- package/dist/src/commands/bundle/manifest.d.ts +0 -25
- package/dist/src/commands/bundle/manifest.js +0 -192
- package/dist/src/expo/plugins/link-addons.d.ts +0 -18
- package/dist/src/expo/plugins/link-addons.js +0 -65
- package/dist/src/pear/pre.d.ts +0 -21
- package/dist/src/pear/pre.js +0 -448
- package/dist/src/server/env.d.ts +0 -22
- package/dist/src/server/env.js +0 -59
- package/dist/src/server/utils/qvac-paths.d.ts +0 -2
- package/dist/src/server/utils/qvac-paths.js +0 -5
- package/dist/src/server/utils/worker-lock.d.ts +0 -3
- package/dist/src/server/utils/worker-lock.js +0 -67
- package/dist/src/worker/create-server.d.ts +0 -8
- package/dist/src/worker/create-server.js +0 -51
- package/dist/src/worker/lifecycle.d.ts +0 -23
- package/dist/src/worker/lifecycle.js +0 -149
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ErrorCodesMap } from '@qvac/error';
|
|
2
|
-
import '@qvac/inference/surface';
|
|
3
2
|
export declare const SDK_SERVER_ERROR_CODES: {
|
|
4
3
|
readonly MODEL_ALREADY_REGISTERED: 52001;
|
|
5
4
|
readonly MODEL_NOT_FOUND: 52002;
|
|
@@ -40,6 +39,7 @@ export declare const SDK_SERVER_ERROR_CODES: {
|
|
|
40
39
|
readonly REQUEST_REJECTED_BY_POLICY: 52420;
|
|
41
40
|
readonly CONTEXT_OVERFLOW: 52421;
|
|
42
41
|
readonly INVALID_AUDIO_INPUT: 52422;
|
|
42
|
+
readonly AUDIO_ENCODE_FAILED: 52424;
|
|
43
43
|
readonly RAG_SAVE_FAILED: 52800;
|
|
44
44
|
readonly RAG_SEARCH_FAILED: 52801;
|
|
45
45
|
readonly RAG_DELETE_FAILED: 52802;
|
|
@@ -52,6 +52,7 @@ export declare const SDK_SERVER_ERROR_CODES: {
|
|
|
52
52
|
readonly RAG_LIST_WORKSPACES_FAILED: 52809;
|
|
53
53
|
readonly RAG_CHUNK_FAILED: 52810;
|
|
54
54
|
readonly RAG_WORKSPACE_NOT_OPEN: 52811;
|
|
55
|
+
readonly RAG_WORKSPACE_BUSY: 52812;
|
|
55
56
|
readonly VECTOR_INDEX_PROVIDER_UNAVAILABLE: 52850;
|
|
56
57
|
readonly VECTOR_INDEX_NOT_FOUND: 52851;
|
|
57
58
|
readonly VECTOR_INDEX_INVALID_VECTORS: 52852;
|
|
@@ -78,6 +79,9 @@ export declare const SDK_SERVER_ERROR_CODES: {
|
|
|
78
79
|
readonly INVALID_DELETE_CACHE_PARAMS: 53201;
|
|
79
80
|
readonly CACHE_DIR_NOT_ABSOLUTE: 53202;
|
|
80
81
|
readonly CACHE_DIR_NOT_WRITABLE: 53203;
|
|
82
|
+
readonly INVALID_SEED_FROM_PARAMS: 53204;
|
|
83
|
+
readonly KV_CACHE_SEED_SOURCE_NOT_FOUND: 53205;
|
|
84
|
+
readonly KV_CACHE_SEED_SHARING_DISABLED: 53206;
|
|
81
85
|
readonly SET_CONFIG_FAILED: 53350;
|
|
82
86
|
readonly CONFIG_ALREADY_SET: 53351;
|
|
83
87
|
readonly FFMPEG_NOT_AVAILABLE: 53500;
|
|
@@ -99,8 +103,15 @@ export declare const SDK_SERVER_ERROR_CODES: {
|
|
|
99
103
|
readonly LIFECYCLE_SUSPEND_FAILED: 53600;
|
|
100
104
|
readonly LIFECYCLE_RESUME_FAILED: 53601;
|
|
101
105
|
readonly LIFECYCLE_OPERATION_BLOCKED: 53602;
|
|
106
|
+
readonly SESSION_ID_CONFLICT: 53620;
|
|
107
|
+
readonly SESSION_NOT_OPEN: 53621;
|
|
108
|
+
readonly MODEL_LEASED: 53622;
|
|
109
|
+
readonly OWNER_ONLY: 53623;
|
|
110
|
+
readonly MODEL_RECONFIGURED: 53624;
|
|
102
111
|
readonly PATH_TRAVERSAL: 53900;
|
|
103
112
|
readonly QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950;
|
|
113
|
+
readonly QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951;
|
|
114
|
+
readonly QVAC_MODEL_REGISTRY_BUSY: 53952;
|
|
104
115
|
};
|
|
105
116
|
declare const serverErrorDefinitions: ErrorCodesMap;
|
|
106
117
|
export { serverErrorDefinitions as SDK_SERVER_ERROR_DEFINITIONS };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addCodes, isCodeRegistered } from '@qvac/error';
|
|
2
2
|
// Load @qvac/inference's registration first, then add only codes not already present, so a
|
|
3
3
|
// shared @qvac/error instance (packed consumers, the Bare worker) is not double-registered.
|
|
4
|
-
import '@qvac/inference/surface';
|
|
4
|
+
import { modelRegistryBusyMessage } from '@qvac/inference/surface';
|
|
5
5
|
// Server-side error codes (52,001-54,000 range for this SDK)
|
|
6
6
|
export const SDK_SERVER_ERROR_CODES = {
|
|
7
7
|
// Model Registry Errors (52,001-52,199)
|
|
@@ -46,6 +46,7 @@ export const SDK_SERVER_ERROR_CODES = {
|
|
|
46
46
|
REQUEST_REJECTED_BY_POLICY: 52420,
|
|
47
47
|
CONTEXT_OVERFLOW: 52421,
|
|
48
48
|
INVALID_AUDIO_INPUT: 52422,
|
|
49
|
+
AUDIO_ENCODE_FAILED: 52424,
|
|
49
50
|
// RAG Operations (52,800-52,999)
|
|
50
51
|
RAG_SAVE_FAILED: 52800,
|
|
51
52
|
RAG_SEARCH_FAILED: 52801,
|
|
@@ -59,6 +60,7 @@ export const SDK_SERVER_ERROR_CODES = {
|
|
|
59
60
|
RAG_LIST_WORKSPACES_FAILED: 52809,
|
|
60
61
|
RAG_CHUNK_FAILED: 52810,
|
|
61
62
|
RAG_WORKSPACE_NOT_OPEN: 52811,
|
|
63
|
+
RAG_WORKSPACE_BUSY: 52812,
|
|
62
64
|
// Vector index (52,850-52,899)
|
|
63
65
|
VECTOR_INDEX_PROVIDER_UNAVAILABLE: 52850,
|
|
64
66
|
VECTOR_INDEX_NOT_FOUND: 52851,
|
|
@@ -88,6 +90,9 @@ export const SDK_SERVER_ERROR_CODES = {
|
|
|
88
90
|
INVALID_DELETE_CACHE_PARAMS: 53201,
|
|
89
91
|
CACHE_DIR_NOT_ABSOLUTE: 53202,
|
|
90
92
|
CACHE_DIR_NOT_WRITABLE: 53203,
|
|
93
|
+
INVALID_SEED_FROM_PARAMS: 53204,
|
|
94
|
+
KV_CACHE_SEED_SOURCE_NOT_FOUND: 53205,
|
|
95
|
+
KV_CACHE_SEED_SHARING_DISABLED: 53206,
|
|
91
96
|
// Config Operations (53,350-53,499)
|
|
92
97
|
SET_CONFIG_FAILED: 53350,
|
|
93
98
|
CONFIG_ALREADY_SET: 53351,
|
|
@@ -114,11 +119,19 @@ export const SDK_SERVER_ERROR_CODES = {
|
|
|
114
119
|
LIFECYCLE_SUSPEND_FAILED: 53600,
|
|
115
120
|
LIFECYCLE_RESUME_FAILED: 53601,
|
|
116
121
|
LIFECYCLE_OPERATION_BLOCKED: 53602,
|
|
122
|
+
// Caller sessions and model leases (53,620-53,649)
|
|
123
|
+
SESSION_ID_CONFLICT: 53620,
|
|
124
|
+
SESSION_NOT_OPEN: 53621,
|
|
125
|
+
MODEL_LEASED: 53622,
|
|
126
|
+
OWNER_ONLY: 53623,
|
|
127
|
+
MODEL_RECONFIGURED: 53624,
|
|
117
128
|
// Security (53,900-53,949)
|
|
118
129
|
PATH_TRAVERSAL: 53900,
|
|
119
130
|
// QVAC Model Registry Operations (53,950-54,000)
|
|
120
131
|
// Note: Registry client errors (19,001-20,000) are re-thrown directly
|
|
121
|
-
QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950
|
|
132
|
+
QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950,
|
|
133
|
+
QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951,
|
|
134
|
+
QVAC_MODEL_REGISTRY_BUSY: 53952
|
|
122
135
|
};
|
|
123
136
|
const serverErrorDefinitions = {
|
|
124
137
|
// Model Registry Errors (52,001-52,199)
|
|
@@ -306,6 +319,10 @@ const serverErrorDefinitions = {
|
|
|
306
319
|
name: 'INVALID_AUDIO_INPUT',
|
|
307
320
|
message: (details) => `Invalid audio input${details ? `: ${details}` : ''}`
|
|
308
321
|
},
|
|
322
|
+
[SDK_SERVER_ERROR_CODES.AUDIO_ENCODE_FAILED]: {
|
|
323
|
+
name: 'AUDIO_ENCODE_FAILED',
|
|
324
|
+
message: (format, details) => `Failed to encode audio as ${format}${details ? `: ${details}` : ''}`
|
|
325
|
+
},
|
|
309
326
|
// RAG Operations (52,800-52,999)
|
|
310
327
|
[SDK_SERVER_ERROR_CODES.RAG_SAVE_FAILED]: {
|
|
311
328
|
name: 'RAG_SAVE_FAILED',
|
|
@@ -355,6 +372,10 @@ const serverErrorDefinitions = {
|
|
|
355
372
|
name: 'RAG_WORKSPACE_NOT_OPEN',
|
|
356
373
|
message: (workspace) => `RAG workspace '${workspace}' is not open`
|
|
357
374
|
},
|
|
375
|
+
[SDK_SERVER_ERROR_CODES.RAG_WORKSPACE_BUSY]: {
|
|
376
|
+
name: 'RAG_WORKSPACE_BUSY',
|
|
377
|
+
message: (workspace) => `RAG workspace '${workspace}' is running another session's operation; retry when it finishes`
|
|
378
|
+
},
|
|
358
379
|
// Vector index (52,850-52,899)
|
|
359
380
|
[SDK_SERVER_ERROR_CODES.VECTOR_INDEX_PROVIDER_UNAVAILABLE]: {
|
|
360
381
|
name: 'VECTOR_INDEX_PROVIDER_UNAVAILABLE',
|
|
@@ -463,6 +484,18 @@ const serverErrorDefinitions = {
|
|
|
463
484
|
name: 'CACHE_DIR_NOT_WRITABLE',
|
|
464
485
|
message: (cacheDir, details) => `Cache directory is not writable: ${cacheDir}${details ? `. ${details}` : ''}`
|
|
465
486
|
},
|
|
487
|
+
[SDK_SERVER_ERROR_CODES.INVALID_SEED_FROM_PARAMS]: {
|
|
488
|
+
name: 'INVALID_SEED_FROM_PARAMS',
|
|
489
|
+
message: 'seedFrom needs a caller-managed kvCache key other than itself'
|
|
490
|
+
},
|
|
491
|
+
[SDK_SERVER_ERROR_CODES.KV_CACHE_SEED_SOURCE_NOT_FOUND]: {
|
|
492
|
+
name: 'KV_CACHE_SEED_SOURCE_NOT_FOUND',
|
|
493
|
+
message: (seedFrom, modelId) => `No cache named "${seedFrom}" exists for model "${modelId}" with this system prompt`
|
|
494
|
+
},
|
|
495
|
+
[SDK_SERVER_ERROR_CODES.KV_CACHE_SEED_SHARING_DISABLED]: {
|
|
496
|
+
name: 'KV_CACHE_SEED_SHARING_DISABLED',
|
|
497
|
+
message: (modelId) => `seedFrom has no effect on model "${modelId}": it was not loaded with cache_share_across_keys true`
|
|
498
|
+
},
|
|
466
499
|
// Config Operations (53,350-53,499)
|
|
467
500
|
[SDK_SERVER_ERROR_CODES.SET_CONFIG_FAILED]: {
|
|
468
501
|
name: 'SET_CONFIG_FAILED',
|
|
@@ -555,6 +588,27 @@ const serverErrorDefinitions = {
|
|
|
555
588
|
name: 'LIFECYCLE_OPERATION_BLOCKED',
|
|
556
589
|
message: (requestType, lifecycleState) => `Operation "${requestType}" is blocked while runtime state is "${lifecycleState}"`
|
|
557
590
|
},
|
|
591
|
+
// Caller sessions and model leases (53,620-53,649)
|
|
592
|
+
[SDK_SERVER_ERROR_CODES.SESSION_ID_CONFLICT]: {
|
|
593
|
+
name: 'SESSION_ID_CONFLICT',
|
|
594
|
+
message: (sessionId) => `Session id "${sessionId}" is already open`
|
|
595
|
+
},
|
|
596
|
+
[SDK_SERVER_ERROR_CODES.SESSION_NOT_OPEN]: {
|
|
597
|
+
name: 'SESSION_NOT_OPEN',
|
|
598
|
+
message: (sessionId) => `Session "${sessionId}" is not open`
|
|
599
|
+
},
|
|
600
|
+
[SDK_SERVER_ERROR_CODES.MODEL_LEASED]: {
|
|
601
|
+
name: 'MODEL_LEASED',
|
|
602
|
+
message: (modelId, leaseCount) => `Model "${modelId}" is held by ${leaseCount} other session(s); it cannot be reconfigured while another session uses it`
|
|
603
|
+
},
|
|
604
|
+
[SDK_SERVER_ERROR_CODES.OWNER_ONLY]: {
|
|
605
|
+
name: 'OWNER_ONLY',
|
|
606
|
+
message: (operation, sessionId) => `Operation "${operation}" is reserved for the runtime owner; session "${sessionId}" cannot call it`
|
|
607
|
+
},
|
|
608
|
+
[SDK_SERVER_ERROR_CODES.MODEL_RECONFIGURED]: {
|
|
609
|
+
name: 'MODEL_RECONFIGURED',
|
|
610
|
+
message: (modelId) => `Model "${modelId}" was reconfigured after it was loaded and no longer has the configuration this load asks for; load it again once it is unloaded`
|
|
611
|
+
},
|
|
558
612
|
// Security (53,900-53,949)
|
|
559
613
|
[SDK_SERVER_ERROR_CODES.PATH_TRAVERSAL]: {
|
|
560
614
|
name: 'PATH_TRAVERSAL',
|
|
@@ -565,6 +619,15 @@ const serverErrorDefinitions = {
|
|
|
565
619
|
[SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_QUERY_FAILED]: {
|
|
566
620
|
name: 'QVAC_MODEL_REGISTRY_QUERY_FAILED',
|
|
567
621
|
message: (details) => `QVAC model registry query failed${details ? `: ${details}` : ''}`
|
|
622
|
+
},
|
|
623
|
+
[SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND]: {
|
|
624
|
+
name: 'QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND',
|
|
625
|
+
message: (registrySource, registryPath) => `QVAC model registry has no model at ${registrySource}/${registryPath}`
|
|
626
|
+
},
|
|
627
|
+
// Owned by @qvac/inference, which registers it first; kept here for the contract export.
|
|
628
|
+
[SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_BUSY]: {
|
|
629
|
+
name: 'QVAC_MODEL_REGISTRY_BUSY',
|
|
630
|
+
message: modelRegistryBusyMessage
|
|
568
631
|
}
|
|
569
632
|
};
|
|
570
633
|
const serverDefinitionsToRegister = Object.fromEntries(Object.entries(serverErrorDefinitions).filter(([code]) => !isCodeRegistered(Number(code))));
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
+
import RPC from 'bare-rpc';
|
|
2
|
+
import { type AbortSignal } from 'bare-abort-controller';
|
|
1
3
|
export declare function getNextCommandId(): number;
|
|
4
|
+
/**
|
|
5
|
+
* The worker's RPC session. Each incoming request gets a `signal` that aborts
|
|
6
|
+
* when the client cancels the request or the session ends.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createWorkerRpc(stream: ConstructorParameters<typeof RPC>[0], onRequest: (req: RPC.IncomingRequest) => void | Promise<void>): RPC;
|
|
9
|
+
/**
|
|
10
|
+
* Aborts when the client cancels the request or goes away (`req.signal`), or
|
|
11
|
+
* when `responseStream` closes. A client without bare-rpc 2 cancellation, such
|
|
12
|
+
* as one on an older bare-rpc, stops a stream by destroying its end, which
|
|
13
|
+
* closes the stream without a cancel. The stream also closes after a normal
|
|
14
|
+
* end, once the engine has finished with the signal.
|
|
15
|
+
*/
|
|
16
|
+
export declare function signalOnCancelOrStreamClose(req: {
|
|
17
|
+
signal: AbortSignal | null;
|
|
18
|
+
}, responseStream: {
|
|
19
|
+
on(event: 'close', listener: () => void): unknown;
|
|
20
|
+
}): AbortSignal;
|
|
2
21
|
export declare function isTerminalChunk<T>(value: T): value is T & {
|
|
3
22
|
done: true;
|
|
4
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* When the client goes away, bare-rpc destroys a response stream that is
|
|
26
|
+
* still open with the channel or cancel error. No one is left to read that
|
|
27
|
+
* error, and an `error` event without a listener is thrown as an uncaught
|
|
28
|
+
* exception, so it is logged here instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createResponseStreamLoggingErrors(req: RPC.IncomingRequest): RPC.OutgoingStream;
|
|
5
31
|
//# sourceMappingURL=rpc-utils.d.ts.map
|
|
@@ -1,8 +1,49 @@
|
|
|
1
|
+
import RPC from 'bare-rpc';
|
|
2
|
+
import { AbortController } from 'bare-abort-controller';
|
|
3
|
+
import { getServerLogger } from '../../logging/index.js';
|
|
4
|
+
const logger = getServerLogger();
|
|
1
5
|
let commandCounter = 0;
|
|
2
6
|
export function getNextCommandId() {
|
|
3
7
|
commandCounter = (commandCounter + 1) % Number.MAX_SAFE_INTEGER;
|
|
4
8
|
return commandCounter;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The worker's RPC session. Each incoming request gets a `signal` that aborts
|
|
12
|
+
* when the client cancels the request or the session ends.
|
|
13
|
+
*/
|
|
14
|
+
export function createWorkerRpc(stream, onRequest) {
|
|
15
|
+
return new RPC(stream, onRequest, { AbortController });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Aborts when the client cancels the request or goes away (`req.signal`), or
|
|
19
|
+
* when `responseStream` closes. A client without bare-rpc 2 cancellation, such
|
|
20
|
+
* as one on an older bare-rpc, stops a stream by destroying its end, which
|
|
21
|
+
* closes the stream without a cancel. The stream also closes after a normal
|
|
22
|
+
* end, once the engine has finished with the signal.
|
|
23
|
+
*/
|
|
24
|
+
export function signalOnCancelOrStreamClose(req, responseStream) {
|
|
25
|
+
const controller = new AbortController();
|
|
26
|
+
const abort = () => controller.abort(undefined);
|
|
27
|
+
if (req.signal?.aborted)
|
|
28
|
+
abort();
|
|
29
|
+
else
|
|
30
|
+
req.signal?.addEventListener('abort', abort, { once: true });
|
|
31
|
+
responseStream.on('close', abort);
|
|
32
|
+
return controller.signal;
|
|
33
|
+
}
|
|
6
34
|
export function isTerminalChunk(value) {
|
|
7
35
|
return typeof value === 'object' && value !== null && 'done' in value && value.done === true;
|
|
8
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* When the client goes away, bare-rpc destroys a response stream that is
|
|
39
|
+
* still open with the channel or cancel error. No one is left to read that
|
|
40
|
+
* error, and an `error` event without a listener is thrown as an uncaught
|
|
41
|
+
* exception, so it is logged here instead.
|
|
42
|
+
*/
|
|
43
|
+
export function createResponseStreamLoggingErrors(req) {
|
|
44
|
+
const responseStream = req.createResponseStream();
|
|
45
|
+
responseStream.on('error', (error) => {
|
|
46
|
+
logger.debug('Response stream closed with an error:', error);
|
|
47
|
+
});
|
|
48
|
+
return responseStream;
|
|
49
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall, ToolCallError } from '@qvac/inference/surface';
|
|
2
|
-
import { type ToolHandlerMap } from '
|
|
2
|
+
import { type ToolHandlerMap } from '../utils/tool-helpers.js';
|
|
3
3
|
export type AggregatedEvents = {
|
|
4
4
|
contentText: string;
|
|
5
5
|
thinkingText: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeAssistantCacheContent } from '
|
|
2
|
-
import { attachHandlersToToolCalls } from '
|
|
1
|
+
import { normalizeAssistantCacheContent } from '../utils/cache-normalize.js';
|
|
2
|
+
import { attachHandlersToToolCalls } from '../utils/tool-helpers.js';
|
|
3
3
|
export function aggregateEvents(events) {
|
|
4
4
|
let contentText = '';
|
|
5
5
|
let thinkingText = '';
|
|
@@ -38,35 +38,49 @@ export declare class RPCResponseStreamNotCreatedError extends QvacErrorBase {
|
|
|
38
38
|
export declare class RPCConnectionFailedError extends QvacErrorBase {
|
|
39
39
|
constructor(details: string, cause?: unknown);
|
|
40
40
|
}
|
|
41
|
-
export declare class RPCInitTimeoutError extends QvacErrorBase {
|
|
42
|
-
constructor(timeoutMs: number, cause?: unknown);
|
|
43
|
-
}
|
|
44
41
|
export declare class WorkerCrashedError extends QvacErrorBase {
|
|
45
42
|
readonly exitCode: number | null;
|
|
46
43
|
readonly exitSignal: NodeJS.Signals | null;
|
|
47
44
|
constructor(exitCode: number | null, exitSignal: NodeJS.Signals | null, cause?: unknown);
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
50
|
-
* A worker that failed before
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* on the post-handshake path.
|
|
47
|
+
* A worker that failed to start: before signalling ready, or while applying its
|
|
48
|
+
* configuration. `cause` is the worker's own error. `exitCode` and `exitSignal`
|
|
49
|
+
* are set when the worker process exited without one.
|
|
54
50
|
*/
|
|
55
51
|
export declare class WorkerStartupError extends QvacErrorBase {
|
|
56
|
-
/** False while the process is still running and simply has not connected. */
|
|
57
|
-
readonly workerExited: boolean;
|
|
58
52
|
readonly exitCode: number | null;
|
|
59
53
|
readonly exitSignal: NodeJS.Signals | null;
|
|
60
|
-
/**
|
|
61
|
-
readonly
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
/** The worker did not finish starting within `rpcInitTimeoutMs`. */
|
|
55
|
+
readonly timedOut: boolean;
|
|
56
|
+
/** The end of a desktop worker process's stderr, when it wrote any. */
|
|
57
|
+
readonly stderrTail: string | undefined;
|
|
58
|
+
constructor(details: string, failure: {
|
|
59
|
+
exitCode: number | null;
|
|
60
|
+
exitSignal: NodeJS.Signals | null;
|
|
61
|
+
timedOut: boolean;
|
|
62
|
+
stderrTail?: string | undefined;
|
|
63
|
+
}, cause?: unknown);
|
|
66
64
|
}
|
|
67
65
|
export declare class WorkerShutdownError extends QvacErrorBase {
|
|
68
66
|
constructor(cause?: unknown);
|
|
69
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The session handle can no longer reach its worker-side session: the caller
|
|
70
|
+
* closed it, the owner shut the runtime down, or the worker exited. Raised
|
|
71
|
+
* locally, before any wire traffic.
|
|
72
|
+
*/
|
|
73
|
+
export declare class SessionInvalidatedError extends QvacErrorBase {
|
|
74
|
+
readonly sessionId: string;
|
|
75
|
+
readonly reason: 'closed' | 'shutdown' | 'crashed';
|
|
76
|
+
constructor(sessionId: string, reason: 'closed' | 'shutdown' | 'crashed', cause?: unknown);
|
|
77
|
+
}
|
|
78
|
+
/** A model id that a now-invalid session loaded; the model is gone with it. */
|
|
79
|
+
export declare class ModelHandleInvalidatedError extends QvacErrorBase {
|
|
80
|
+
readonly modelId: string;
|
|
81
|
+
readonly sessionId: string;
|
|
82
|
+
constructor(modelId: string, sessionId: string, cause?: unknown);
|
|
83
|
+
}
|
|
70
84
|
export declare class SDKNotFoundInNodeModulesError extends QvacErrorBase {
|
|
71
85
|
constructor(cause?: unknown);
|
|
72
86
|
}
|
|
@@ -76,33 +90,27 @@ export declare class MultipleSDKInstallationsError extends QvacErrorBase {
|
|
|
76
90
|
export declare class WorkerFileNotFoundError extends QvacErrorBase {
|
|
77
91
|
constructor(workerPath: string, cause?: unknown);
|
|
78
92
|
}
|
|
79
|
-
export declare class PearWorkerEntryRequiredError extends QvacErrorBase {
|
|
80
|
-
constructor(workerEntry: string, cause?: unknown);
|
|
81
|
-
}
|
|
82
|
-
export declare class WorkerPluginsNotRegisteredError extends QvacErrorBase {
|
|
83
|
-
constructor(cause?: unknown);
|
|
84
|
-
}
|
|
85
93
|
export declare class BundleVerificationFailedError extends QvacErrorBase {
|
|
86
94
|
constructor(bundlePath: string, cause?: unknown);
|
|
87
95
|
}
|
|
88
|
-
export declare class
|
|
89
|
-
constructor(cause
|
|
90
|
-
}
|
|
91
|
-
export declare class BarePackError extends QvacErrorBase {
|
|
92
|
-
constructor(exitCode: number, entryPath: string, outputPath: string, cause?: unknown);
|
|
96
|
+
export declare class BundleFailedError extends QvacErrorBase {
|
|
97
|
+
constructor(entryPath: string, cause: unknown);
|
|
93
98
|
}
|
|
94
99
|
export declare class BarePackNodeUnsupportedError extends QvacErrorBase {
|
|
95
100
|
constructor(nodeVersion: string, requiredRange: string, cause?: unknown);
|
|
96
101
|
}
|
|
102
|
+
export declare class BundleTargetNotInstalledError extends QvacErrorBase {
|
|
103
|
+
constructor(target: string, packageName: string, cause?: unknown);
|
|
104
|
+
}
|
|
105
|
+
export declare class ReactNativeBareKitUnsupportedError extends QvacErrorBase {
|
|
106
|
+
constructor(installedVersion: string, requiredRange: string, cause?: unknown);
|
|
107
|
+
}
|
|
97
108
|
export declare class InvalidPluginSpecifierError extends QvacErrorBase {
|
|
98
109
|
constructor(specifiers: string[], cause?: unknown);
|
|
99
110
|
}
|
|
100
111
|
export declare class BareImportsMapNotFoundError extends QvacErrorBase {
|
|
101
112
|
constructor(sdkName: string, expectedPath: string, cause?: unknown);
|
|
102
113
|
}
|
|
103
|
-
export declare class BareRuntimeBinaryNotFoundError extends QvacErrorBase {
|
|
104
|
-
constructor(platform: string, arch: string, cause?: unknown);
|
|
105
|
-
}
|
|
106
114
|
/**
|
|
107
115
|
* Addon platform packages are missing and cannot be installed automatically:
|
|
108
116
|
* no supported package manager was detected, two installed versions of one
|
|
@@ -69,11 +69,6 @@ export class RPCConnectionFailedError extends QvacErrorBase {
|
|
|
69
69
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.RPC_CONNECTION_FAILED, [details], cause));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
export class RPCInitTimeoutError extends QvacErrorBase {
|
|
73
|
-
constructor(timeoutMs, cause) {
|
|
74
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.RPC_INIT_TIMEOUT, [timeoutMs], cause));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
72
|
export class WorkerCrashedError extends QvacErrorBase {
|
|
78
73
|
exitCode;
|
|
79
74
|
exitSignal;
|
|
@@ -84,24 +79,23 @@ export class WorkerCrashedError extends QvacErrorBase {
|
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
81
|
/**
|
|
87
|
-
* A worker that failed before
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* on the post-handshake path.
|
|
82
|
+
* A worker that failed to start: before signalling ready, or while applying its
|
|
83
|
+
* configuration. `cause` is the worker's own error. `exitCode` and `exitSignal`
|
|
84
|
+
* are set when the worker process exited without one.
|
|
91
85
|
*/
|
|
92
86
|
export class WorkerStartupError extends QvacErrorBase {
|
|
93
|
-
/** False while the process is still running and simply has not connected. */
|
|
94
|
-
workerExited;
|
|
95
87
|
exitCode;
|
|
96
88
|
exitSignal;
|
|
97
|
-
/**
|
|
89
|
+
/** The worker did not finish starting within `rpcInitTimeoutMs`. */
|
|
90
|
+
timedOut;
|
|
91
|
+
/** The end of a desktop worker process's stderr, when it wrote any. */
|
|
98
92
|
stderrTail;
|
|
99
|
-
constructor(details,
|
|
100
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_STARTUP_FAILED, [details
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.stderrTail = stderrTail;
|
|
93
|
+
constructor(details, failure, cause) {
|
|
94
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_STARTUP_FAILED, [details], cause));
|
|
95
|
+
this.exitCode = failure.exitCode;
|
|
96
|
+
this.exitSignal = failure.exitSignal;
|
|
97
|
+
this.timedOut = failure.timedOut;
|
|
98
|
+
this.stderrTail = failure.stderrTail;
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
101
|
export class WorkerShutdownError extends QvacErrorBase {
|
|
@@ -109,6 +103,30 @@ export class WorkerShutdownError extends QvacErrorBase {
|
|
|
109
103
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_SHUTDOWN, undefined, cause));
|
|
110
104
|
}
|
|
111
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* The session handle can no longer reach its worker-side session: the caller
|
|
108
|
+
* closed it, the owner shut the runtime down, or the worker exited. Raised
|
|
109
|
+
* locally, before any wire traffic.
|
|
110
|
+
*/
|
|
111
|
+
export class SessionInvalidatedError extends QvacErrorBase {
|
|
112
|
+
sessionId;
|
|
113
|
+
reason;
|
|
114
|
+
constructor(sessionId, reason, cause) {
|
|
115
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.SESSION_INVALIDATED, [sessionId, reason], cause));
|
|
116
|
+
this.sessionId = sessionId;
|
|
117
|
+
this.reason = reason;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** A model id that a now-invalid session loaded; the model is gone with it. */
|
|
121
|
+
export class ModelHandleInvalidatedError extends QvacErrorBase {
|
|
122
|
+
modelId;
|
|
123
|
+
sessionId;
|
|
124
|
+
constructor(modelId, sessionId, cause) {
|
|
125
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.MODEL_HANDLE_INVALIDATED, [modelId, sessionId], cause));
|
|
126
|
+
this.modelId = modelId;
|
|
127
|
+
this.sessionId = sessionId;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
112
130
|
// ============== Build/Bundle Errors ==============
|
|
113
131
|
export class SDKNotFoundInNodeModulesError extends QvacErrorBase {
|
|
114
132
|
constructor(cause) {
|
|
@@ -125,29 +143,15 @@ export class WorkerFileNotFoundError extends QvacErrorBase {
|
|
|
125
143
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_FILE_NOT_FOUND, [workerPath], cause));
|
|
126
144
|
}
|
|
127
145
|
}
|
|
128
|
-
export class PearWorkerEntryRequiredError extends QvacErrorBase {
|
|
129
|
-
constructor(workerEntry, cause) {
|
|
130
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.PEAR_WORKER_ENTRY_REQUIRED, [workerEntry], cause));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
export class WorkerPluginsNotRegisteredError extends QvacErrorBase {
|
|
134
|
-
constructor(cause) {
|
|
135
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.WORKER_PLUGINS_NOT_REGISTERED, [], cause));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
146
|
export class BundleVerificationFailedError extends QvacErrorBase {
|
|
139
147
|
constructor(bundlePath, cause) {
|
|
140
148
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BUNDLE_VERIFICATION_FAILED, [bundlePath], cause));
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
|
-
export class
|
|
144
|
-
constructor(cause) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
export class BarePackError extends QvacErrorBase {
|
|
149
|
-
constructor(exitCode, entryPath, outputPath, cause) {
|
|
150
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_ERROR, [exitCode, entryPath, outputPath], cause));
|
|
151
|
+
export class BundleFailedError extends QvacErrorBase {
|
|
152
|
+
constructor(entryPath, cause) {
|
|
153
|
+
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
154
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BUNDLE_FAILED, [entryPath, reason], cause));
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
export class BarePackNodeUnsupportedError extends QvacErrorBase {
|
|
@@ -155,6 +159,16 @@ export class BarePackNodeUnsupportedError extends QvacErrorBase {
|
|
|
155
159
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_PACK_NODE_UNSUPPORTED, [nodeVersion, requiredRange], cause));
|
|
156
160
|
}
|
|
157
161
|
}
|
|
162
|
+
export class BundleTargetNotInstalledError extends QvacErrorBase {
|
|
163
|
+
constructor(target, packageName, cause) {
|
|
164
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BUNDLE_TARGET_NOT_INSTALLED, [target, packageName], cause));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export class ReactNativeBareKitUnsupportedError extends QvacErrorBase {
|
|
168
|
+
constructor(installedVersion, requiredRange, cause) {
|
|
169
|
+
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.REACT_NATIVE_BARE_KIT_UNSUPPORTED, [installedVersion, requiredRange], cause));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
158
172
|
export class InvalidPluginSpecifierError extends QvacErrorBase {
|
|
159
173
|
constructor(specifiers, cause) {
|
|
160
174
|
const list = specifiers.map((s) => ` - ${s}`).join('\n');
|
|
@@ -166,11 +180,6 @@ export class BareImportsMapNotFoundError extends QvacErrorBase {
|
|
|
166
180
|
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_IMPORTS_MAP_NOT_FOUND, [sdkName, expectedPath], cause));
|
|
167
181
|
}
|
|
168
182
|
}
|
|
169
|
-
export class BareRuntimeBinaryNotFoundError extends QvacErrorBase {
|
|
170
|
-
constructor(platform, arch, cause) {
|
|
171
|
-
super(createErrorOptions(SDK_CLIENT_ERROR_CODES.BARE_RUNTIME_BINARY_NOT_FOUND, [platform, arch], cause));
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
183
|
/**
|
|
175
184
|
* Addon platform packages are missing and cannot be installed automatically:
|
|
176
185
|
* no supported package manager was detected, two installed versions of one
|
|
@@ -225,6 +225,12 @@ export declare class InvalidImageInputError extends QvacErrorBase {
|
|
|
225
225
|
export declare class InvalidAudioInputError extends QvacErrorBase {
|
|
226
226
|
constructor(details?: string, cause?: unknown);
|
|
227
227
|
}
|
|
228
|
+
export declare class AudioEncodeFailedError extends QvacErrorBase {
|
|
229
|
+
readonly format: string;
|
|
230
|
+
readonly details: string | undefined;
|
|
231
|
+
constructor(format: string, details?: string, cause?: unknown);
|
|
232
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
233
|
+
}
|
|
228
234
|
export declare class RAGSaveFailedError extends QvacErrorBase {
|
|
229
235
|
constructor(details?: string, cause?: unknown);
|
|
230
236
|
}
|
|
@@ -308,6 +314,20 @@ export declare class DeleteCacheFailedError extends QvacErrorBase {
|
|
|
308
314
|
export declare class InvalidDeleteCacheParamsError extends QvacErrorBase {
|
|
309
315
|
constructor(cause?: unknown);
|
|
310
316
|
}
|
|
317
|
+
export declare class InvalidSeedFromParamsError extends QvacErrorBase {
|
|
318
|
+
constructor(cause?: unknown);
|
|
319
|
+
}
|
|
320
|
+
export declare class KvCacheSeedSourceNotFoundError extends QvacErrorBase {
|
|
321
|
+
readonly seedFrom: string;
|
|
322
|
+
readonly modelId: string;
|
|
323
|
+
constructor(seedFrom: string, modelId: string, cause?: unknown);
|
|
324
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
325
|
+
}
|
|
326
|
+
export declare class KvCacheSeedSharingDisabledError extends QvacErrorBase {
|
|
327
|
+
readonly modelId: string;
|
|
328
|
+
constructor(modelId: string, cause?: unknown);
|
|
329
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
330
|
+
}
|
|
311
331
|
export declare class CacheDirNotAbsoluteError extends QvacErrorBase {
|
|
312
332
|
constructor(cause?: unknown);
|
|
313
333
|
}
|
|
@@ -338,6 +358,12 @@ export declare class RAGWorkspaceInUseError extends QvacErrorBase {
|
|
|
338
358
|
export declare class RAGWorkspaceNotOpenError extends QvacErrorBase {
|
|
339
359
|
constructor(workspace: string, cause?: unknown);
|
|
340
360
|
}
|
|
361
|
+
/** A RAG operation on a workspace that another session's operation is using. */
|
|
362
|
+
export declare class RAGWorkspaceBusyError extends QvacErrorBase {
|
|
363
|
+
readonly workspace: string;
|
|
364
|
+
constructor(workspace: string, cause?: unknown);
|
|
365
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
366
|
+
}
|
|
341
367
|
export declare class RPCNoDataReceivedError extends QvacErrorBase {
|
|
342
368
|
constructor(cause?: unknown);
|
|
343
369
|
}
|
|
@@ -380,6 +406,38 @@ export declare class LifecycleSuspendFailedError extends QvacErrorBase {
|
|
|
380
406
|
export declare class LifecycleResumeFailedError extends QvacErrorBase {
|
|
381
407
|
constructor(details?: string, cause?: unknown);
|
|
382
408
|
}
|
|
409
|
+
export declare class SessionIdConflictError extends QvacErrorBase {
|
|
410
|
+
readonly sessionId: string;
|
|
411
|
+
constructor(sessionId: string, cause?: unknown);
|
|
412
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
413
|
+
}
|
|
414
|
+
export declare class SessionNotOpenError extends QvacErrorBase {
|
|
415
|
+
readonly sessionId: string;
|
|
416
|
+
constructor(sessionId: string, cause?: unknown);
|
|
417
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
418
|
+
}
|
|
419
|
+
/** A `reloadConfig` on a model another session holds a lease on. */
|
|
420
|
+
export declare class ModelLeasedError extends QvacErrorBase {
|
|
421
|
+
readonly modelId: string;
|
|
422
|
+
readonly leaseCount: number;
|
|
423
|
+
constructor(modelId: string, leaseCount: number, cause?: unknown);
|
|
424
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
425
|
+
}
|
|
426
|
+
export declare class OwnerOnlyError extends QvacErrorBase {
|
|
427
|
+
readonly operation: string;
|
|
428
|
+
readonly sessionId: string;
|
|
429
|
+
constructor(operation: string, sessionId: string, cause?: unknown);
|
|
430
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* A load whose configuration hash names a model that a reload has since
|
|
434
|
+
* reconfigured, from a session that holds no lease on it.
|
|
435
|
+
*/
|
|
436
|
+
export declare class ModelReconfiguredError extends QvacErrorBase {
|
|
437
|
+
readonly modelId: string;
|
|
438
|
+
constructor(modelId: string, cause?: unknown);
|
|
439
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
440
|
+
}
|
|
383
441
|
export declare class LifecycleOperationBlockedError extends QvacErrorBase {
|
|
384
442
|
constructor(requestType: string, lifecycleState: string);
|
|
385
443
|
}
|
|
@@ -389,5 +447,11 @@ export declare class PathTraversalError extends QvacErrorBase {
|
|
|
389
447
|
export declare class ModelRegistryQueryFailedError extends QvacErrorBase {
|
|
390
448
|
constructor(details?: string, cause?: unknown);
|
|
391
449
|
}
|
|
392
|
-
export
|
|
450
|
+
export declare class ModelRegistryModelNotFoundError extends QvacErrorBase {
|
|
451
|
+
readonly registrySource: string;
|
|
452
|
+
readonly registryPath: string;
|
|
453
|
+
constructor(registrySource: string, registryPath: string, cause?: unknown);
|
|
454
|
+
toErrorResponseFields(): Record<string, unknown>;
|
|
455
|
+
}
|
|
456
|
+
export { RpcServerOperationError, ModelRegistryBusyError } from '@qvac/inference/surface';
|
|
393
457
|
//# sourceMappingURL=errors-server.d.ts.map
|