@qvac/sdk 0.18.2 → 0.19.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 +12 -1
- package/README.md +46 -10
- package/bare-imports.json +2 -3
- package/dist/examples/abot-world.d.ts +2 -0
- package/dist/examples/abot-world.js +124 -0
- package/dist/examples/asr/parakeet-unified-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-unified-filesystem.js +50 -0
- package/dist/examples/assess-model-fit.d.ts +14 -0
- package/dist/examples/assess-model-fit.js +71 -0
- package/dist/examples/audiogen/generate-cover.js +2 -1
- package/dist/examples/audiogen/generate-music-minimax.d.ts +2 -0
- package/dist/examples/audiogen/generate-music-minimax.js +117 -0
- package/dist/examples/audiogen/generate-music.js +2 -1
- package/dist/examples/cache-management.js +1 -2
- package/dist/examples/classification/classify-image.js +1 -3
- package/dist/examples/config-reload.js +1 -1
- package/dist/examples/diffusion-ic-lora-ltx.d.ts +2 -0
- package/dist/examples/diffusion-ic-lora-ltx.js +76 -0
- package/dist/examples/mcp-websearch.js +1 -3
- package/dist/examples/model-fit-ui/server.d.ts +24 -0
- package/dist/examples/model-fit-ui/server.js +192 -0
- package/dist/examples/multi-job-completion.d.ts +2 -3
- package/dist/examples/multi-job-completion.js +2 -3
- package/dist/examples/parallel-download.js +4 -4
- package/dist/examples/plugins.js +1 -1
- package/dist/examples/profiling/basic.js +0 -1
- package/dist/examples/system-resources.js +2 -0
- package/dist/examples/translation/translation-bergamot-batch-stream.d.ts +2 -0
- package/dist/examples/translation/translation-bergamot-batch-stream.js +43 -0
- package/dist/examples/translation/translation-bergamot-batch.js +2 -5
- package/dist/examples/vla-groot.js +1 -1
- package/dist/scripts/check-resource-collectors-packaging.d.ts +2 -2
- package/dist/scripts/check-resource-collectors-packaging.js +3 -3
- package/dist/scripts/contract/build-contract.d.ts +1 -1
- package/dist/scripts/contract/build-contract.js +5 -5
- package/dist/scripts/contract/build-error-codes.js +3 -3
- package/dist/scripts/contract/build-model-type-maps.js +1 -2
- package/dist/scripts/contract/build-models-registry.d.ts +2 -2
- package/dist/scripts/contract/build-models-registry.js +2 -2
- package/dist/scripts/contract/constants-registry.d.ts +86 -0
- package/dist/scripts/contract/constants-registry.js +62 -0
- package/dist/scripts/contract/method-shapes.d.ts +53 -0
- package/dist/scripts/contract/method-shapes.js +50 -0
- package/dist/scripts/contract/plugin-contract.d.ts +1 -1
- package/dist/scripts/contract/plugin-contract.js +1 -1
- package/dist/scripts/enforce-inference-peer-dependencies.d.ts +2 -0
- package/dist/scripts/enforce-inference-peer-dependencies.js +39 -0
- package/dist/scripts/export-contract.js +1 -1
- package/dist/scripts/export-plugin-contract.js +1 -1
- package/dist/scripts/run-unit-tests.js +6 -1
- package/dist/src/client/api/assess-model-fit.d.ts +17 -0
- package/dist/src/client/api/assess-model-fit.js +38 -0
- package/dist/src/client/api/audio-gen-result.d.ts +4 -0
- package/dist/src/client/api/audio-gen-result.js +143 -0
- package/dist/src/client/api/audio-gen.d.ts +66 -0
- package/dist/src/client/api/audio-gen.js +68 -0
- package/dist/src/client/api/batch-completion.d.ts +28 -0
- package/dist/src/client/api/batch-completion.js +345 -0
- package/dist/src/client/api/bci-transcribe.d.ts +57 -0
- package/dist/src/client/api/bci-transcribe.js +173 -0
- package/dist/src/client/api/cancel.d.ts +35 -0
- package/dist/src/client/api/cancel.js +83 -0
- package/dist/src/client/api/classify.d.ts +25 -0
- package/dist/src/client/api/classify.js +48 -0
- package/dist/src/client/api/completion-stream.d.ts +107 -0
- package/dist/src/client/api/completion-stream.js +351 -0
- package/dist/src/client/api/delete-cache.js +49 -0
- package/dist/src/client/api/diffusion.d.ts +93 -0
- package/dist/src/client/api/diffusion.js +177 -0
- package/dist/src/client/api/download-asset.d.ts +52 -0
- package/dist/src/client/api/download-asset.js +89 -0
- package/dist/src/client/api/embed.d.ts +42 -0
- package/dist/src/client/api/embed.js +30 -0
- package/dist/src/client/api/finetune.d.ts +92 -0
- package/dist/src/client/api/finetune.js +144 -0
- package/dist/src/client/api/get-loaded-model-info.d.ts +26 -0
- package/dist/src/client/api/get-loaded-model-info.js +37 -0
- package/dist/src/client/api/get-model-info.d.ts +11 -0
- package/dist/src/client/api/get-model-info.js +22 -0
- package/dist/src/client/api/get-system-resources.d.ts +3 -0
- package/dist/src/client/api/get-system-resources.js +17 -0
- package/dist/src/client/api/heartbeat.d.ts +13 -0
- package/dist/src/client/api/heartbeat.js +21 -0
- package/dist/src/client/api/index.d.ts +37 -0
- package/dist/src/client/api/index.js +36 -0
- package/dist/src/client/api/invoke-plugin.d.ts +31 -0
- package/dist/src/client/api/invoke-plugin.js +54 -0
- package/dist/src/client/api/load-model.d.ts +184 -0
- package/dist/src/client/api/load-model.js +128 -0
- package/dist/src/client/api/logging-stream.d.ts +24 -0
- package/dist/src/client/api/logging-stream.js +36 -0
- package/dist/src/client/api/ocr.d.ts +40 -0
- package/dist/src/client/api/ocr.js +97 -0
- package/dist/src/client/api/rag.d.ts +257 -0
- package/dist/src/client/api/rag.js +490 -0
- package/dist/src/client/api/registry.d.ts +40 -0
- package/dist/src/client/api/registry.js +63 -0
- package/dist/src/client/api/resume.d.ts +27 -0
- package/dist/src/client/api/resume.js +33 -0
- package/dist/src/client/api/state.d.ts +23 -0
- package/dist/src/client/api/state.js +29 -0
- package/dist/src/client/api/subscribe-logs.d.ts +28 -0
- package/dist/src/client/api/suspend.d.ts +27 -0
- package/dist/src/client/api/suspend.js +33 -0
- package/dist/src/client/api/text-to-speech.d.ts +74 -0
- package/dist/src/client/api/text-to-speech.js +463 -0
- package/dist/src/client/api/transcribe.d.ts +93 -0
- package/dist/src/client/api/transcribe.js +295 -0
- package/dist/src/client/api/translate.d.ts +51 -0
- package/dist/src/client/api/translate.js +133 -0
- package/dist/src/client/api/unload-model.d.ts +18 -0
- package/dist/src/client/api/unload-model.js +42 -0
- package/dist/src/client/api/upscale.d.ts +45 -0
- package/dist/src/client/api/upscale.js +99 -0
- package/dist/src/client/api/video-request.d.ts +208 -0
- package/dist/src/client/api/video-request.js +18 -0
- package/dist/src/client/api/video.d.ts +107 -0
- package/dist/src/client/api/video.js +187 -0
- package/dist/src/client/api/vla-helpers.d.ts +59 -0
- package/dist/src/client/api/vla-helpers.js +139 -0
- package/dist/src/client/api/vla.d.ts +114 -0
- package/dist/src/client/api/vla.js +166 -0
- package/dist/src/client/api/world-result.d.ts +72 -0
- package/dist/src/client/api/world-result.js +296 -0
- package/dist/src/client/api/world.d.ts +144 -0
- package/dist/src/client/api/world.js +71 -0
- package/dist/src/client/config-loader/config-utils.d.ts +5 -0
- package/dist/src/client/config-loader/config-utils.js +18 -0
- package/dist/src/client/config-loader/resolve-config.expo.js +60 -0
- package/dist/src/client/config-loader/resolve-config.node.js +198 -0
- package/dist/src/client/init-hooks.d.ts +21 -0
- package/dist/src/client/init-hooks.js +62 -0
- package/dist/src/client/plugins-factory.d.ts +7 -0
- package/dist/src/client/plugins-factory.js +9 -0
- package/dist/src/client/rpc/bare-client.d.ts +6 -0
- package/dist/src/client/rpc/bare-client.js +21 -0
- package/dist/src/client/rpc/expo-rpc-client.js +195 -0
- package/dist/src/client/rpc/init-timeout.d.ts +26 -0
- package/dist/src/client/rpc/init-timeout.js +25 -0
- package/dist/src/client/rpc/node-rpc-client.js +525 -0
- package/dist/src/client/rpc/profiling/profiler.d.ts +27 -0
- package/dist/src/client/rpc/profiling/profiler.js +134 -0
- package/dist/src/client/rpc/rpc-client.d.ts +19 -0
- package/dist/src/client/rpc/rpc-client.js +550 -0
- package/dist/src/client/rpc/rpc-error.d.ts +28 -0
- package/dist/src/client/rpc/rpc-error.js +159 -0
- package/dist/src/client/rpc/worker-startup-error.d.ts +12 -0
- package/dist/src/client/rpc/worker-startup-error.js +13 -0
- package/dist/src/commands/bundle/entry-gen.js +54 -0
- package/dist/src/commands/bundle/index.js +148 -0
- package/dist/src/commands/bundle/plugins.d.ts +9 -0
- package/dist/src/commands/bundle/plugins.js +51 -0
- package/dist/src/commands/bundle/resolve-sdk-import.js +58 -0
- package/dist/src/commands/index.d.ts +5 -0
- package/dist/src/commands/index.js +2 -0
- package/dist/src/commands/verify/abi.d.ts +52 -0
- package/dist/src/commands/verify/abi.js +125 -0
- package/dist/src/commands/verify/bundle-source.d.ts +12 -0
- package/dist/src/commands/verify/bundle-source.js +53 -0
- package/dist/src/commands/verify/index.d.ts +59 -0
- package/dist/src/commands/verify/index.js +372 -0
- package/dist/src/commands/verify/node-modules-source.d.ts +11 -0
- package/dist/src/commands/verify/node-modules-source.js +76 -0
- package/dist/src/commands/verify/prebuilds.d.ts +16 -0
- package/dist/src/commands/verify/prebuilds.js +36 -0
- package/dist/src/commands/verify/resource-collectors.js +261 -0
- package/dist/src/deprecate.d.ts +2 -0
- package/dist/src/deprecate.js +9 -0
- package/dist/src/expo/plugins/withAndroidNdkVersion.js +31 -0
- package/dist/src/expo/plugins/withDeviceInfo.js +49 -0
- package/dist/src/expo/plugins/withMobileBundle.d.ts +24 -0
- package/dist/src/expo/plugins/withMobileBundle.js +152 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.js +59 -0
- package/dist/src/logging/addon.d.ts +6 -0
- package/dist/src/logging/logging-stream-registry.js +137 -0
- package/dist/src/logging/namespaces.d.ts +7 -0
- package/dist/src/logging/namespaces.js +8 -0
- package/dist/src/logging/registry.d.ts +31 -0
- package/dist/src/logging/registry.js +62 -0
- package/dist/src/logging/stream-logger.js +12 -0
- package/dist/src/logging/utils.d.ts +6 -0
- package/dist/src/models/registry/index.d.ts +2 -0
- package/dist/src/models/registry/index.js +4 -0
- package/dist/src/pear/pre.js +446 -0
- package/dist/src/plugin-ids.d.ts +14 -0
- package/dist/src/plugin-ids.js +27 -0
- package/dist/src/plugin-utils.d.ts +2 -0
- package/dist/src/plugin-utils.js +4 -0
- package/dist/src/schemas/public.d.ts +3 -0
- package/dist/src/schemas/public.js +11 -0
- package/dist/src/schemas/sdk-errors-client.d.ts +41 -0
- package/dist/src/schemas/sdk-errors-client.js +192 -0
- package/dist/src/schemas/sdk-errors-server.d.ts +101 -0
- package/dist/src/schemas/sdk-errors-server.js +540 -0
- package/dist/src/server/error-handlers.js +32 -0
- package/dist/src/server/plugins/index.d.ts +2 -0
- package/dist/src/server/plugins/index.js +1 -0
- package/dist/src/server/rpc/profiling/context.d.ts +17 -0
- package/dist/src/server/rpc/profiling/context.js +31 -0
- package/dist/src/server/rpc/profiling/index.d.ts +2 -0
- package/dist/src/server/rpc/profiling/index.js +1 -0
- package/dist/src/server/rpc/profiling/profiler.d.ts +13 -0
- package/dist/src/server/rpc/profiling/profiler.js +78 -0
- package/dist/src/server/rpc/rpc-utils.d.ts +5 -0
- package/dist/src/server/utils/qvac-paths.js +5 -0
- package/dist/src/server/utils/worker-lock.js +67 -0
- package/dist/src/utils/aggregate-events.d.ts +26 -0
- package/dist/src/utils/aggregate-events.js +73 -0
- package/dist/src/utils/errors-client.d.ts +181 -0
- package/dist/src/utils/errors-client.js +305 -0
- package/dist/src/utils/errors-server.d.ts +380 -0
- package/dist/src/utils/errors-server.js +621 -0
- package/dist/src/utils/load-model-validation.js +17 -0
- package/dist/src/utils/mcp-adapter.d.ts +12 -0
- package/dist/src/utils/mcp-adapter.js +96 -0
- package/dist/src/utils/tool-helpers.d.ts +25 -0
- package/dist/src/utils/tool-helpers.js +111 -0
- package/dist/src/worker/create-server.js +46 -0
- package/dist/src/worker/handle-request.js +180 -0
- package/dist/src/worker/handler-utils.d.ts +16 -0
- package/dist/src/worker/handler-utils.js +41 -0
- package/dist/src/worker/index.d.ts +5 -0
- package/dist/src/worker/index.js +45 -0
- package/dist/src/worker/legacy-worker-entry.d.ts +2 -0
- package/dist/src/worker/legacy-worker-entry.js +3 -0
- package/dist/src/worker/lifecycle.d.ts +23 -0
- package/dist/src/worker/lifecycle.js +141 -0
- package/dist/src/worker/plugins/audiogen-ggml.d.ts +2 -0
- package/dist/src/worker/plugins/audiogen-ggml.js +1 -0
- package/dist/src/worker/plugins/bci-whispercpp-transcription.d.ts +2 -0
- package/dist/src/worker/plugins/bci-whispercpp-transcription.js +1 -0
- package/dist/src/worker/plugins/ggml-classification.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-classification.js +1 -0
- package/dist/src/worker/plugins/ggml-ocr.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-ocr.js +1 -0
- package/dist/src/worker/plugins/ggml-vla.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-vla.js +1 -0
- package/dist/src/worker/plugins/llamacpp-completion.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-completion.js +1 -0
- package/dist/src/worker/plugins/llamacpp-embedding.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-embedding.js +1 -0
- package/dist/src/worker/plugins/nmtcpp-translation.d.ts +2 -0
- package/dist/src/worker/plugins/nmtcpp-translation.js +1 -0
- package/dist/src/worker/plugins/parakeet-transcription.d.ts +2 -0
- package/dist/src/worker/plugins/parakeet-transcription.js +1 -0
- package/dist/src/worker/plugins/sdcpp-generation.d.ts +2 -0
- package/dist/src/worker/plugins/sdcpp-generation.js +1 -0
- package/dist/src/worker/plugins/tts-ggml.d.ts +2 -0
- package/dist/src/worker/plugins/tts-ggml.js +1 -0
- package/dist/src/worker/plugins/whispercpp-transcription.d.ts +2 -0
- package/dist/src/worker/plugins/whispercpp-transcription.js +1 -0
- package/dist/src/worker/worker-core.d.ts +7 -0
- package/dist/src/worker/worker-core.js +8 -0
- package/docs/system-resources-support-matrix.md +46 -27
- package/package.json +82 -87
- package/dist/client/api/audio-gen-result.d.ts +0 -4
- package/dist/client/api/audio-gen-result.js +0 -132
- package/dist/client/api/audio-gen.d.ts +0 -46
- package/dist/client/api/audio-gen.js +0 -48
- package/dist/client/api/batch-completion.d.ts +0 -15
- package/dist/client/api/batch-completion.js +0 -332
- package/dist/client/api/bci-transcribe.d.ts +0 -57
- package/dist/client/api/bci-transcribe.js +0 -173
- package/dist/client/api/cancel.d.ts +0 -35
- package/dist/client/api/cancel.js +0 -83
- package/dist/client/api/classify.d.ts +0 -23
- package/dist/client/api/classify.js +0 -46
- package/dist/client/api/completion-stream.d.ts +0 -107
- package/dist/client/api/completion-stream.js +0 -351
- package/dist/client/api/delete-cache.js +0 -49
- package/dist/client/api/diffusion.d.ts +0 -93
- package/dist/client/api/diffusion.js +0 -175
- package/dist/client/api/download-asset.d.ts +0 -50
- package/dist/client/api/download-asset.js +0 -87
- package/dist/client/api/embed.d.ts +0 -42
- package/dist/client/api/embed.js +0 -30
- package/dist/client/api/finetune.d.ts +0 -92
- package/dist/client/api/finetune.js +0 -144
- package/dist/client/api/get-loaded-model-info.d.ts +0 -25
- package/dist/client/api/get-loaded-model-info.js +0 -36
- package/dist/client/api/get-model-info.d.ts +0 -44
- package/dist/client/api/get-model-info.js +0 -22
- package/dist/client/api/get-system-resources.d.ts +0 -3
- package/dist/client/api/get-system-resources.js +0 -16
- package/dist/client/api/heartbeat.d.ts +0 -30
- package/dist/client/api/heartbeat.js +0 -38
- package/dist/client/api/index.d.ts +0 -36
- package/dist/client/api/index.js +0 -35
- package/dist/client/api/invoke-plugin.d.ts +0 -31
- package/dist/client/api/invoke-plugin.js +0 -54
- package/dist/client/api/load-model.d.ts +0 -178
- package/dist/client/api/load-model.js +0 -130
- package/dist/client/api/logging-stream.d.ts +0 -24
- package/dist/client/api/logging-stream.js +0 -36
- package/dist/client/api/ocr.d.ts +0 -40
- package/dist/client/api/ocr.js +0 -97
- package/dist/client/api/provide.d.ts +0 -24
- package/dist/client/api/provide.js +0 -33
- package/dist/client/api/rag.d.ts +0 -252
- package/dist/client/api/rag.js +0 -485
- package/dist/client/api/registry.d.ts +0 -40
- package/dist/client/api/registry.js +0 -63
- package/dist/client/api/resume.d.ts +0 -30
- package/dist/client/api/resume.js +0 -36
- package/dist/client/api/state.d.ts +0 -23
- package/dist/client/api/state.js +0 -29
- package/dist/client/api/stop-provider.d.ts +0 -21
- package/dist/client/api/stop-provider.js +0 -31
- package/dist/client/api/subscribe-logs.d.ts +0 -28
- package/dist/client/api/suspend.d.ts +0 -31
- package/dist/client/api/suspend.js +0 -37
- package/dist/client/api/text-to-speech.d.ts +0 -66
- package/dist/client/api/text-to-speech.js +0 -455
- package/dist/client/api/transcribe.d.ts +0 -93
- package/dist/client/api/transcribe.js +0 -295
- package/dist/client/api/translate.d.ts +0 -49
- package/dist/client/api/translate.js +0 -125
- package/dist/client/api/unload-model.d.ts +0 -18
- package/dist/client/api/unload-model.js +0 -44
- package/dist/client/api/upscale.d.ts +0 -45
- package/dist/client/api/upscale.js +0 -99
- package/dist/client/api/video.d.ts +0 -87
- package/dist/client/api/video.js +0 -175
- package/dist/client/api/vla-helpers.d.ts +0 -45
- package/dist/client/api/vla-helpers.js +0 -125
- package/dist/client/api/vla.d.ts +0 -114
- package/dist/client/api/vla.js +0 -166
- package/dist/client/config-loader/config-utils.d.ts +0 -5
- package/dist/client/config-loader/config-utils.js +0 -18
- package/dist/client/config-loader/resolve-config.bare.d.ts +0 -9
- package/dist/client/config-loader/resolve-config.bare.js +0 -74
- package/dist/client/config-loader/resolve-config.expo.js +0 -62
- package/dist/client/config-loader/resolve-config.node.js +0 -199
- package/dist/client/init-hooks.d.ts +0 -21
- package/dist/client/init-hooks.js +0 -66
- package/dist/client/plugins-factory.d.ts +0 -8
- package/dist/client/plugins-factory.js +0 -10
- package/dist/client/rpc/bare-client.d.ts +0 -17
- package/dist/client/rpc/bare-client.js +0 -251
- package/dist/client/rpc/expo-rpc-client.js +0 -196
- package/dist/client/rpc/node-rpc-client.js +0 -505
- package/dist/client/rpc/profiling/profiler.d.ts +0 -27
- package/dist/client/rpc/profiling/profiler.js +0 -140
- package/dist/client/rpc/rpc-client.d.ts +0 -19
- package/dist/client/rpc/rpc-client.js +0 -551
- package/dist/client/rpc/rpc-error.d.ts +0 -28
- package/dist/client/rpc/rpc-error.js +0 -150
- package/dist/commands/bundle/entry-gen.js +0 -54
- package/dist/commands/bundle/index.js +0 -148
- package/dist/commands/bundle/plugins.d.ts +0 -9
- package/dist/commands/bundle/plugins.js +0 -51
- package/dist/commands/bundle/resolve-sdk-import.js +0 -53
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.js +0 -2
- package/dist/commands/verify/abi.d.ts +0 -52
- package/dist/commands/verify/abi.js +0 -125
- package/dist/commands/verify/bundle-source.d.ts +0 -12
- package/dist/commands/verify/bundle-source.js +0 -53
- package/dist/commands/verify/index.d.ts +0 -59
- package/dist/commands/verify/index.js +0 -372
- package/dist/commands/verify/node-modules-source.d.ts +0 -11
- package/dist/commands/verify/node-modules-source.js +0 -76
- package/dist/commands/verify/prebuilds.d.ts +0 -16
- package/dist/commands/verify/prebuilds.js +0 -36
- package/dist/commands/verify/resource-collectors.js +0 -261
- package/dist/constants/audio.d.ts +0 -2
- package/dist/constants/audio.js +0 -1
- package/dist/constants/index.d.ts +0 -3
- package/dist/constants/index.js +0 -2
- package/dist/constants/registry.d.ts +0 -2
- package/dist/constants/registry.js +0 -1
- package/dist/examples/delegated-inference/composite.d.ts +0 -2
- package/dist/examples/delegated-inference/composite.js +0 -96
- package/dist/examples/delegated-inference/consumer-profiled.d.ts +0 -2
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -59
- package/dist/examples/delegated-inference/consumer.d.ts +0 -2
- package/dist/examples/delegated-inference/consumer.js +0 -55
- package/dist/examples/delegated-inference/provider.d.ts +0 -2
- package/dist/examples/delegated-inference/provider.js +0 -52
- package/dist/examples/quickstart.bare.d.ts +0 -2
- package/dist/examples/quickstart.bare.js +0 -16
- package/dist/expo/plugins/withAndroidNdkVersion.js +0 -31
- package/dist/expo/plugins/withDeviceInfo.js +0 -49
- package/dist/expo/plugins/withMobileBundle.d.ts +0 -12
- package/dist/expo/plugins/withMobileBundle.js +0 -117
- package/dist/index.d.ts +0 -17
- package/dist/index.js +0 -44
- package/dist/logging/addon.d.ts +0 -6
- package/dist/logging/namespaces.d.ts +0 -7
- package/dist/logging/namespaces.js +0 -8
- package/dist/logging/registry.d.ts +0 -31
- package/dist/logging/registry.js +0 -62
- package/dist/logging/stream-logger.js +0 -12
- package/dist/logging/utils.d.ts +0 -6
- package/dist/models/registry/index.d.ts +0 -19
- package/dist/models/registry/index.js +0 -21
- package/dist/models/registry/models.d.ts +0 -23457
- package/dist/models/registry/models.js +0 -24713
- package/dist/pear/pre.js +0 -446
- package/dist/profiling/aggregator.d.ts +0 -15
- package/dist/profiling/aggregator.js +0 -100
- package/dist/profiling/backend-diagnostics.d.ts +0 -8
- package/dist/profiling/backend-diagnostics.js +0 -21
- package/dist/profiling/clock.d.ts +0 -12
- package/dist/profiling/clock.js +0 -51
- package/dist/profiling/controller.d.ts +0 -35
- package/dist/profiling/controller.js +0 -130
- package/dist/profiling/envelope.d.ts +0 -11
- package/dist/profiling/envelope.js +0 -45
- package/dist/profiling/events.d.ts +0 -20
- package/dist/profiling/events.js +0 -35
- package/dist/profiling/exporters.d.ts +0 -10
- package/dist/profiling/exporters.js +0 -243
- package/dist/profiling/index.d.ts +0 -86
- package/dist/profiling/index.js +0 -81
- package/dist/profiling/model-execution.d.ts +0 -16
- package/dist/profiling/model-execution.js +0 -34
- package/dist/profiling/ring-buffer.d.ts +0 -19
- package/dist/profiling/ring-buffer.js +0 -83
- package/dist/profiling/types.d.ts +0 -53
- package/dist/profiling/types.js +0 -1
- package/dist/schemas/archive.d.ts +0 -9
- package/dist/schemas/archive.js +0 -11
- package/dist/schemas/audio-gen.d.ts +0 -356
- package/dist/schemas/audio-gen.js +0 -200
- package/dist/schemas/batch-completion-stream.d.ts +0 -468
- package/dist/schemas/batch-completion-stream.js +0 -124
- package/dist/schemas/bci-config.d.ts +0 -75
- package/dist/schemas/bci-config.js +0 -58
- package/dist/schemas/bci.d.ts +0 -179
- package/dist/schemas/bci.js +0 -89
- package/dist/schemas/cancel.d.ts +0 -209
- package/dist/schemas/cancel.js +0 -140
- package/dist/schemas/classification.d.ts +0 -53
- package/dist/schemas/classification.js +0 -33
- package/dist/schemas/common.d.ts +0 -6960
- package/dist/schemas/common.js +0 -138
- package/dist/schemas/completion-event.d.ts +0 -249
- package/dist/schemas/completion-event.js +0 -94
- package/dist/schemas/completion-stream.d.ts +0 -476
- package/dist/schemas/completion-stream.js +0 -236
- package/dist/schemas/constants-registry.d.ts +0 -83
- package/dist/schemas/constants-registry.js +0 -65
- package/dist/schemas/delegate.d.ts +0 -16
- package/dist/schemas/delegate.js +0 -32
- package/dist/schemas/delete-cache.d.ts +0 -17
- package/dist/schemas/delete-cache.js +0 -21
- package/dist/schemas/download-asset.d.ts +0 -225
- package/dist/schemas/download-asset.js +0 -71
- package/dist/schemas/embed.d.ts +0 -42
- package/dist/schemas/embed.js +0 -35
- package/dist/schemas/engine-addon-map.d.ts +0 -21
- package/dist/schemas/engine-addon-map.js +0 -78
- package/dist/schemas/error.d.ts +0 -44
- package/dist/schemas/error.js +0 -67
- package/dist/schemas/finetune.d.ts +0 -622
- package/dist/schemas/finetune.js +0 -163
- package/dist/schemas/get-loaded-model-info.d.ts +0 -70
- package/dist/schemas/get-loaded-model-info.js +0 -52
- package/dist/schemas/get-model-info.d.ts +0 -130
- package/dist/schemas/get-model-info.js +0 -91
- package/dist/schemas/heartbeat.d.ts +0 -16
- package/dist/schemas/heartbeat.js +0 -10
- package/dist/schemas/index.d.ts +0 -55
- package/dist/schemas/index.js +0 -55
- package/dist/schemas/json-schema.d.ts +0 -16
- package/dist/schemas/json-schema.js +0 -2
- package/dist/schemas/llamacpp-config.d.ts +0 -404
- package/dist/schemas/llamacpp-config.js +0 -219
- package/dist/schemas/load-model.d.ts +0 -28991
- package/dist/schemas/load-model.js +0 -647
- package/dist/schemas/logging-stream.d.ts +0 -34
- package/dist/schemas/logging-stream.js +0 -17
- package/dist/schemas/mcp-adapter.d.ts +0 -47
- package/dist/schemas/mcp-adapter.js +0 -1
- package/dist/schemas/model-src-utils.d.ts +0 -193
- package/dist/schemas/model-src-utils.js +0 -61
- package/dist/schemas/model-types.d.ts +0 -276
- package/dist/schemas/model-types.js +0 -223
- package/dist/schemas/ocr.d.ts +0 -138
- package/dist/schemas/ocr.js +0 -59
- package/dist/schemas/path-validation.d.ts +0 -10
- package/dist/schemas/path-validation.js +0 -22
- package/dist/schemas/plugin.d.ts +0 -342
- package/dist/schemas/plugin.js +0 -242
- package/dist/schemas/profiling.d.ts +0 -696
- package/dist/schemas/profiling.js +0 -100
- package/dist/schemas/provide.d.ts +0 -41
- package/dist/schemas/provide.js +0 -22
- package/dist/schemas/public.d.ts +0 -3
- package/dist/schemas/public.js +0 -6
- package/dist/schemas/rag.d.ts +0 -302
- package/dist/schemas/rag.js +0 -212
- package/dist/schemas/registry.d.ts +0 -454
- package/dist/schemas/registry.js +0 -104
- package/dist/schemas/reload-config.d.ts +0 -586
- package/dist/schemas/reload-config.js +0 -42
- package/dist/schemas/resume.d.ts +0 -10
- package/dist/schemas/resume.js +0 -7
- package/dist/schemas/runtime-context.d.ts +0 -19
- package/dist/schemas/runtime-context.js +0 -7
- package/dist/schemas/sdcpp-config.d.ts +0 -1127
- package/dist/schemas/sdcpp-config.js +0 -748
- package/dist/schemas/sdk-config.d.ts +0 -5059
- package/dist/schemas/sdk-config.js +0 -167
- package/dist/schemas/sdk-errors-client.d.ts +0 -44
- package/dist/schemas/sdk-errors-client.js +0 -208
- package/dist/schemas/sdk-errors-registry.d.ts +0 -6
- package/dist/schemas/sdk-errors-registry.js +0 -8
- package/dist/schemas/sdk-errors-server.d.ts +0 -102
- package/dist/schemas/sdk-errors-server.js +0 -534
- package/dist/schemas/shard.d.ts +0 -21
- package/dist/schemas/shard.js +0 -17
- package/dist/schemas/state.d.ts +0 -23
- package/dist/schemas/state.js +0 -9
- package/dist/schemas/stop-provide.d.ts +0 -12
- package/dist/schemas/stop-provide.js +0 -11
- package/dist/schemas/suspend.d.ts +0 -10
- package/dist/schemas/suspend.js +0 -7
- package/dist/schemas/system-resources.d.ts +0 -3967
- package/dist/schemas/system-resources.js +0 -149
- package/dist/schemas/text-to-speech.d.ts +0 -2329
- package/dist/schemas/text-to-speech.js +0 -554
- package/dist/schemas/tools.d.ts +0 -65
- package/dist/schemas/tools.js +0 -37
- package/dist/schemas/transcription-config.d.ts +0 -164
- package/dist/schemas/transcription-config.js +0 -162
- package/dist/schemas/transcription.d.ts +0 -264
- package/dist/schemas/transcription.js +0 -145
- package/dist/schemas/translate.d.ts +0 -139
- package/dist/schemas/translate.js +0 -103
- package/dist/schemas/translation-config.d.ts +0 -1032
- package/dist/schemas/translation-config.js +0 -170
- package/dist/schemas/unload-model.d.ts +0 -22
- package/dist/schemas/unload-model.js +0 -18
- package/dist/schemas/vla.d.ts +0 -194
- package/dist/schemas/vla.js +0 -254
- package/dist/scripts/run-security-tests.d.ts +0 -2
- package/dist/scripts/run-security-tests.js +0 -21
- package/dist/server/bare/delegate-connect-diagnostics.d.ts +0 -9
- package/dist/server/bare/delegate-connect-diagnostics.js +0 -38
- package/dist/server/bare/delegate-rpc-client.d.ts +0 -10
- package/dist/server/bare/delegate-rpc-client.js +0 -219
- package/dist/server/bare/hyperswarm.d.ts +0 -10
- package/dist/server/bare/hyperswarm.js +0 -103
- package/dist/server/bare/ops/bci-transcribe.d.ts +0 -13
- package/dist/server/bare/ops/bci-transcribe.js +0 -248
- package/dist/server/bare/ops/cancel.d.ts +0 -29
- package/dist/server/bare/ops/cancel.js +0 -46
- package/dist/server/bare/ops/embed.d.ts +0 -16
- package/dist/server/bare/ops/embed.js +0 -193
- package/dist/server/bare/ops/kv-cache-retention.d.ts +0 -12
- package/dist/server/bare/ops/kv-cache-retention.js +0 -132
- package/dist/server/bare/ops/kv-cache-utils.d.ts +0 -22
- package/dist/server/bare/ops/kv-cache-utils.js +0 -148
- package/dist/server/bare/ops/load-model.d.ts +0 -9
- package/dist/server/bare/ops/load-model.js +0 -82
- package/dist/server/bare/ops/transcribe.d.ts +0 -20
- package/dist/server/bare/ops/transcribe.js +0 -349
- package/dist/server/bare/ops/translate-stats.d.ts +0 -5
- package/dist/server/bare/ops/translate-stats.js +0 -11
- package/dist/server/bare/ops/translate.d.ts +0 -8
- package/dist/server/bare/ops/translate.js +0 -284
- package/dist/server/bare/ops/unload-model.d.ts +0 -3
- package/dist/server/bare/ops/unload-model.js +0 -51
- package/dist/server/bare/plugins/asr-ggml/config.d.ts +0 -32
- package/dist/server/bare/plugins/asr-ggml/config.js +0 -46
- package/dist/server/bare/plugins/asr-ggml/logging.d.ts +0 -11
- package/dist/server/bare/plugins/asr-ggml/logging.js +0 -12
- package/dist/server/bare/plugins/audiogen-ggml/config.d.ts +0 -18
- package/dist/server/bare/plugins/audiogen-ggml/config.js +0 -23
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.d.ts +0 -20
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.js +0 -153
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.d.ts +0 -3
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +0 -213
- package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +0 -241
- package/dist/server/bare/plugins/audiogen-ggml/plugin.js +0 -58
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +0 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +0 -13
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +0 -174
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +0 -111
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +0 -75
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +0 -11
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +0 -6
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +0 -30
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +0 -32
- package/dist/server/bare/plugins/ggml-classification/plugin.js +0 -55
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +0 -8
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +0 -119
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +0 -103
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +0 -112
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +0 -6
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +0 -73
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +0 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +0 -12
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +0 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +0 -79
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.d.ts +0 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.js +0 -9
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +0 -103
- package/dist/server/bare/plugins/ggml-vla/plugin.js +0 -74
- package/dist/server/bare/plugins/index.d.ts +0 -13
- package/dist/server/bare/plugins/index.js +0 -12
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +0 -32
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +0 -100
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +0 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +0 -36
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +0 -27
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +0 -58
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +0 -47
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +0 -382
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +0 -29
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +0 -65
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +0 -11
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +0 -299
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +0 -190
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +0 -746
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +0 -58
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +0 -58
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +0 -672
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +0 -503
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +0 -10
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +0 -28
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +0 -77
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +0 -100
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +0 -458
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +0 -144
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +0 -32
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +0 -114
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +0 -134
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +0 -141
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +0 -3
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +0 -63
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +0 -3
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +0 -40
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +0 -6
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +0 -238
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +0 -758
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +0 -310
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.d.ts +0 -7
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +0 -50
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +0 -7
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +0 -104
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +0 -7
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +0 -89
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +0 -495
- package/dist/server/bare/plugins/tts-ggml/plugin.js +0 -436
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +0 -347
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +0 -178
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +0 -7
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +0 -11
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +0 -14
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +0 -19
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +0 -4
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +0 -16
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +0 -15
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/search.js +0 -16
- package/dist/server/bare/rag-hyperdb/index.d.ts +0 -12
- package/dist/server/bare/rag-hyperdb/index.js +0 -11
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.d.ts +0 -29
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +0 -76
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +0 -15
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +0 -143
- package/dist/server/bare/registry/config-registry.d.ts +0 -14
- package/dist/server/bare/registry/config-registry.js +0 -90
- package/dist/server/bare/registry/logging-stream-registry.js +0 -137
- package/dist/server/bare/registry/model-config-registry.d.ts +0 -4
- package/dist/server/bare/registry/model-config-registry.js +0 -15
- package/dist/server/bare/registry/model-config-utils.d.ts +0 -15
- package/dist/server/bare/registry/model-config-utils.js +0 -128
- package/dist/server/bare/registry/model-registry.d.ts +0 -76
- package/dist/server/bare/registry/model-registry.js +0 -130
- package/dist/server/bare/registry/registry-client.d.ts +0 -5
- package/dist/server/bare/registry/registry-client.js +0 -118
- package/dist/server/bare/registry/runtime-context-registry.d.ts +0 -7
- package/dist/server/bare/registry/runtime-context-registry.js +0 -26
- package/dist/server/bare/resources/collector.d.ts +0 -644
- package/dist/server/bare/resources/collector.js +0 -226
- package/dist/server/bare/resources/native.d.ts +0 -3
- package/dist/server/bare/resources/native.js +0 -35
- package/dist/server/bare/resources/normalize.d.ts +0 -13
- package/dist/server/bare/resources/normalize.js +0 -73
- package/dist/server/bare/resources/types.d.ts +0 -66
- package/dist/server/bare/resources/types.js +0 -1
- package/dist/server/bare/resources/worker-collector.d.ts +0 -5
- package/dist/server/bare/resources/worker-collector.js +0 -15
- package/dist/server/bare/runtime/disposable-scope.d.ts +0 -36
- package/dist/server/bare/runtime/disposable-scope.js +0 -69
- package/dist/server/bare/runtime/index.d.ts +0 -8
- package/dist/server/bare/runtime/index.js +0 -3
- package/dist/server/bare/runtime/request-context.d.ts +0 -49
- package/dist/server/bare/runtime/request-context.js +0 -1
- package/dist/server/bare/runtime/request-id.d.ts +0 -12
- package/dist/server/bare/runtime/request-id.js +0 -14
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +0 -4
- package/dist/server/bare/runtime/request-registry-singleton.js +0 -77
- package/dist/server/bare/runtime/request-registry.d.ts +0 -222
- package/dist/server/bare/runtime/request-registry.js +0 -715
- package/dist/server/bare/runtime/with-request-context.d.ts +0 -22
- package/dist/server/bare/runtime/with-request-context.js +0 -53
- package/dist/server/bare/runtime-lifecycle.d.ts +0 -38
- package/dist/server/bare/runtime-lifecycle.js +0 -163
- package/dist/server/bare/types/addon-responses.d.ts +0 -51
- package/dist/server/bare/types/addon-responses.js +0 -1
- package/dist/server/bare/utils/asr-events.d.ts +0 -15
- package/dist/server/bare/utils/asr-events.js +0 -30
- package/dist/server/bare/utils/audio-input.d.ts +0 -10
- package/dist/server/bare/utils/audio-input.js +0 -33
- package/dist/server/bare/utils/transcribe-metadata.d.ts +0 -21
- package/dist/server/bare/utils/transcribe-metadata.js +0 -28
- package/dist/server/bare/utils/tts-stats.d.ts +0 -26
- package/dist/server/bare/utils/tts-stats.js +0 -16
- package/dist/server/error-handlers.js +0 -32
- package/dist/server/plugins/index.d.ts +0 -2
- package/dist/server/plugins/index.js +0 -1
- package/dist/server/plugins/registry.d.ts +0 -10
- package/dist/server/plugins/registry.js +0 -107
- package/dist/server/rpc/create-server.js +0 -46
- package/dist/server/rpc/delegate-transport.d.ts +0 -19
- package/dist/server/rpc/delegate-transport.js +0 -237
- package/dist/server/rpc/handle-request.js +0 -172
- package/dist/server/rpc/handler-registry.d.ts +0 -3
- package/dist/server/rpc/handler-registry.js +0 -179
- package/dist/server/rpc/handler-selection.d.ts +0 -9
- package/dist/server/rpc/handler-selection.js +0 -14
- package/dist/server/rpc/handler-utils.d.ts +0 -30
- package/dist/server/rpc/handler-utils.js +0 -183
- package/dist/server/rpc/handlers/audio-gen-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/audio-gen-stream.js +0 -4
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +0 -80
- package/dist/server/rpc/handlers/batch-completion-stream.js +0 -4
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +0 -4
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +0 -3
- package/dist/server/rpc/handlers/bci-transcribe.js +0 -4
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/cancel-delegated.js +0 -66
- package/dist/server/rpc/handlers/cancelHandler.d.ts +0 -32
- package/dist/server/rpc/handlers/cancelHandler.js +0 -69
- package/dist/server/rpc/handlers/classify.d.ts +0 -3
- package/dist/server/rpc/handlers/classify.js +0 -4
- package/dist/server/rpc/handlers/completion-orchestrate.d.ts +0 -42
- package/dist/server/rpc/handlers/completion-orchestrate.js +0 -190
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +0 -5
- package/dist/server/rpc/handlers/completion-stream-delegated.js +0 -51
- package/dist/server/rpc/handlers/completion-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/completion-stream.js +0 -4
- package/dist/server/rpc/handlers/delete-cache.d.ts +0 -12
- package/dist/server/rpc/handlers/delete-cache.js +0 -37
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/diffusion-stream.js +0 -4
- package/dist/server/rpc/handlers/download-asset.d.ts +0 -3
- package/dist/server/rpc/handlers/download-asset.js +0 -146
- package/dist/server/rpc/handlers/embed.d.ts +0 -3
- package/dist/server/rpc/handlers/embed.js +0 -4
- package/dist/server/rpc/handlers/finetune.d.ts +0 -3
- package/dist/server/rpc/handlers/finetune.js +0 -18
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +0 -3
- package/dist/server/rpc/handlers/get-loaded-model-info.js +0 -45
- package/dist/server/rpc/handlers/get-model-info.d.ts +0 -3
- package/dist/server/rpc/handlers/get-model-info.js +0 -173
- package/dist/server/rpc/handlers/get-system-resources.d.ts +0 -3
- package/dist/server/rpc/handlers/get-system-resources.js +0 -53
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/heartbeat-delegated.js +0 -32
- package/dist/server/rpc/handlers/heartbeat.d.ts +0 -3
- package/dist/server/rpc/handlers/heartbeat.js +0 -3
- package/dist/server/rpc/handlers/index.d.ts +0 -76
- package/dist/server/rpc/handlers/index.js +0 -75
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +0 -98
- package/dist/server/rpc/handlers/load-model/download-manager.js +0 -308
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +0 -8
- package/dist/server/rpc/handlers/load-model/download-stats.js +0 -126
- package/dist/server/rpc/handlers/load-model/handler.d.ts +0 -3
- package/dist/server/rpc/handlers/load-model/handler.js +0 -287
- package/dist/server/rpc/handlers/load-model/http.d.ts +0 -4
- package/dist/server/rpc/handlers/load-model/http.js +0 -856
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +0 -5
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +0 -561
- package/dist/server/rpc/handlers/load-model/index.d.ts +0 -3
- package/dist/server/rpc/handlers/load-model/index.js +0 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +0 -27
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +0 -18
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +0 -23
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +0 -206
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +0 -24
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +0 -112
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +0 -11
- package/dist/server/rpc/handlers/load-model/registry-metadata.js +0 -23
- package/dist/server/rpc/handlers/load-model/registry.d.ts +0 -5
- package/dist/server/rpc/handlers/load-model/registry.js +0 -298
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +0 -34
- package/dist/server/rpc/handlers/load-model/resolve-session.js +0 -62
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +0 -16
- package/dist/server/rpc/handlers/load-model/resolve.js +0 -237
- package/dist/server/rpc/handlers/load-model/types.d.ts +0 -60
- package/dist/server/rpc/handlers/load-model/types.js +0 -28
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +0 -7
- package/dist/server/rpc/handlers/load-model-delegated.js +0 -132
- package/dist/server/rpc/handlers/logging-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/logging-stream.js +0 -39
- package/dist/server/rpc/handlers/ocr-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/ocr-stream.js +0 -4
- package/dist/server/rpc/handlers/plugin-dispatch.d.ts +0 -3
- package/dist/server/rpc/handlers/plugin-dispatch.js +0 -63
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +0 -4
- package/dist/server/rpc/handlers/plugin-invoke.js +0 -81
- package/dist/server/rpc/handlers/provideHandler/connection.d.ts +0 -3
- package/dist/server/rpc/handlers/provideHandler/connection.js +0 -38
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +0 -3
- package/dist/server/rpc/handlers/provideHandler/handler.js +0 -66
- package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +0 -3
- package/dist/server/rpc/handlers/provideHandler/proxy.js +0 -24
- package/dist/server/rpc/handlers/provideHandler.d.ts +0 -2
- package/dist/server/rpc/handlers/provideHandler.js +0 -2
- package/dist/server/rpc/handlers/rag.d.ts +0 -3
- package/dist/server/rpc/handlers/rag.js +0 -272
- package/dist/server/rpc/handlers/registry.d.ts +0 -5
- package/dist/server/rpc/handlers/registry.js +0 -155
- package/dist/server/rpc/handlers/resume.d.ts +0 -3
- package/dist/server/rpc/handlers/resume.js +0 -11
- package/dist/server/rpc/handlers/state.d.ts +0 -3
- package/dist/server/rpc/handlers/state.js +0 -7
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +0 -3
- package/dist/server/rpc/handlers/stopProvideHandler.js +0 -29
- package/dist/server/rpc/handlers/suspend.d.ts +0 -3
- package/dist/server/rpc/handlers/suspend.js +0 -11
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/text-to-speech-stream.js +0 -4
- package/dist/server/rpc/handlers/text-to-speech.d.ts +0 -3
- package/dist/server/rpc/handlers/text-to-speech.js +0 -4
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/transcribe-stream.js +0 -4
- package/dist/server/rpc/handlers/transcribe.d.ts +0 -3
- package/dist/server/rpc/handlers/transcribe.js +0 -4
- package/dist/server/rpc/handlers/translate.d.ts +0 -3
- package/dist/server/rpc/handlers/translate.js +0 -4
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +0 -3
- package/dist/server/rpc/handlers/unload-model-delegated.js +0 -32
- package/dist/server/rpc/handlers/unload-model.d.ts +0 -3
- package/dist/server/rpc/handlers/unload-model.js +0 -29
- package/dist/server/rpc/handlers/upscale-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/upscale-stream.js +0 -4
- package/dist/server/rpc/handlers/video-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/video-stream.js +0 -4
- package/dist/server/rpc/index.d.ts +0 -3
- package/dist/server/rpc/index.js +0 -2
- package/dist/server/rpc/method-shapes.d.ts +0 -53
- package/dist/server/rpc/method-shapes.js +0 -50
- package/dist/server/rpc/profiling/backend-diagnostics.d.ts +0 -3
- package/dist/server/rpc/profiling/backend-diagnostics.js +0 -16
- package/dist/server/rpc/profiling/context.d.ts +0 -18
- package/dist/server/rpc/profiling/context.js +0 -37
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +0 -32
- package/dist/server/rpc/profiling/delegation-profiler.js +0 -153
- package/dist/server/rpc/profiling/index.d.ts +0 -5
- package/dist/server/rpc/profiling/index.js +0 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +0 -25
- package/dist/server/rpc/profiling/operation-metrics.js +0 -361
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +0 -18
- package/dist/server/rpc/profiling/operation-wrappers.js +0 -196
- package/dist/server/rpc/profiling/profiler.d.ts +0 -13
- package/dist/server/rpc/profiling/profiler.js +0 -93
- package/dist/server/rpc/rpc-utils.d.ts +0 -5
- package/dist/server/rpc/transport-selector.d.ts +0 -3
- package/dist/server/rpc/transport-selector.js +0 -18
- package/dist/server/utils/archive.d.ts +0 -4
- package/dist/server/utils/archive.js +0 -177
- package/dist/server/utils/audio/decoder.d.ts +0 -41
- package/dist/server/utils/audio/decoder.js +0 -108
- package/dist/server/utils/cache/auto-history.d.ts +0 -4
- package/dist/server/utils/cache/auto-history.js +0 -26
- package/dist/server/utils/cache/paths.d.ts +0 -43
- package/dist/server/utils/cache/paths.js +0 -133
- package/dist/server/utils/cache/types.d.ts +0 -8
- package/dist/server/utils/cache/types.js +0 -1
- package/dist/server/utils/checksum.d.ts +0 -4
- package/dist/server/utils/checksum.js +0 -30
- package/dist/server/utils/clear-storage.d.ts +0 -5
- package/dist/server/utils/clear-storage.js +0 -14
- package/dist/server/utils/completion-normalizer.d.ts +0 -18
- package/dist/server/utils/completion-normalizer.js +0 -453
- package/dist/server/utils/config-transform.d.ts +0 -6
- package/dist/server/utils/config-transform.js +0 -27
- package/dist/server/utils/formatting.d.ts +0 -19
- package/dist/server/utils/formatting.js +0 -56
- package/dist/server/utils/gguf-tensor-extractor.d.ts +0 -15
- package/dist/server/utils/gguf-tensor-extractor.js +0 -310
- package/dist/server/utils/index.d.ts +0 -11
- package/dist/server/utils/index.js +0 -10
- package/dist/server/utils/multi-gpu-mobile.d.ts +0 -5
- package/dist/server/utils/multi-gpu-mobile.js +0 -10
- package/dist/server/utils/path-security.d.ts +0 -12
- package/dist/server/utils/path-security.js +0 -25
- package/dist/server/utils/qvac-paths.js +0 -5
- package/dist/server/utils/response-format.d.ts +0 -3
- package/dist/server/utils/response-format.js +0 -20
- package/dist/server/utils/shard-utils.d.ts +0 -49
- package/dist/server/utils/shard-utils.js +0 -137
- package/dist/server/utils/tool-integration.d.ts +0 -17
- package/dist/server/utils/tool-integration.js +0 -20
- package/dist/server/utils/tools/dialect.d.ts +0 -8
- package/dist/server/utils/tools/dialect.js +0 -20
- package/dist/server/utils/tools/index.d.ts +0 -3
- package/dist/server/utils/tools/index.js +0 -2
- package/dist/server/utils/tools/parser.d.ts +0 -6
- package/dist/server/utils/tools/parser.js +0 -69
- package/dist/server/utils/tools/parsers/dsml.d.ts +0 -4
- package/dist/server/utils/tools/parsers/dsml.js +0 -176
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +0 -4
- package/dist/server/utils/tools/parsers/gemma4native.js +0 -65
- package/dist/server/utils/tools/parsers/harmony.d.ts +0 -4
- package/dist/server/utils/tools/parsers/harmony.js +0 -57
- package/dist/server/utils/tools/parsers/hermes.d.ts +0 -4
- package/dist/server/utils/tools/parsers/hermes.js +0 -122
- package/dist/server/utils/tools/parsers/json.d.ts +0 -6
- package/dist/server/utils/tools/parsers/json.js +0 -115
- package/dist/server/utils/tools/parsers/pythonic.d.ts +0 -4
- package/dist/server/utils/tools/parsers/pythonic.js +0 -267
- package/dist/server/utils/tools/parsers/qwen35.d.ts +0 -4
- package/dist/server/utils/tools/parsers/qwen35.js +0 -124
- package/dist/server/utils/tools/shared.d.ts +0 -18
- package/dist/server/utils/tools/shared.js +0 -52
- package/dist/server/utils/worker-lock.js +0 -67
- package/dist/server/worker-core.d.ts +0 -23
- package/dist/server/worker-core.js +0 -206
- package/dist/server/worker.d.ts +0 -5
- package/dist/server/worker.js +0 -34
- package/dist/utils/aggregate-events.d.ts +0 -26
- package/dist/utils/aggregate-events.js +0 -73
- package/dist/utils/errors-client.d.ts +0 -178
- package/dist/utils/errors-client.js +0 -310
- package/dist/utils/errors-server.d.ts +0 -376
- package/dist/utils/errors-server.js +0 -610
- package/dist/utils/load-model-validation.js +0 -18
- package/dist/utils/mcp-adapter.d.ts +0 -12
- package/dist/utils/mcp-adapter.js +0 -96
- package/dist/utils/tool-helpers.d.ts +0 -25
- package/dist/utils/tool-helpers.js +0 -111
- /package/dist/{client → src/client}/api/client-request-id.d.ts +0 -0
- /package/dist/{client → src/client}/api/client-request-id.js +0 -0
- /package/dist/{client → src/client}/api/delete-cache.d.ts +0 -0
- /package/dist/{client → src/client}/api/subscribe-logs.js +0 -0
- /package/dist/{client → src/client}/config-loader/resolve-config.expo.d.ts +0 -0
- /package/dist/{client → src/client}/config-loader/resolve-config.node.d.ts +0 -0
- /package/dist/{client → src/client}/index.d.ts +0 -0
- /package/dist/{client → src/client}/index.js +0 -0
- /package/dist/{client → src/client}/logging-stream-registry.d.ts +0 -0
- /package/dist/{client → src/client}/logging-stream-registry.js +0 -0
- /package/dist/{client → src/client}/parse-input.d.ts +0 -0
- /package/dist/{client → src/client}/parse-input.js +0 -0
- /package/dist/{client → src/client}/rpc/ensure-worker-ready.d.ts +0 -0
- /package/dist/{client → src/client}/rpc/ensure-worker-ready.js +0 -0
- /package/dist/{client → src/client}/rpc/expo-device-info.d.ts +0 -0
- /package/dist/{client → src/client}/rpc/expo-device-info.js +0 -0
- /package/dist/{client → src/client}/rpc/expo-rpc-client.d.ts +0 -0
- /package/dist/{client → src/client}/rpc/node-rpc-client.d.ts +0 -0
- /package/dist/{client → src/client}/rpc/profiling/index.d.ts +0 -0
- /package/dist/{client → src/client}/rpc/profiling/index.js +0 -0
- /package/dist/{commands → src/commands}/bundle/bare-pack.d.ts +0 -0
- /package/dist/{commands → src/commands}/bundle/bare-pack.js +0 -0
- /package/dist/{commands → src/commands}/bundle/constants.d.ts +0 -0
- /package/dist/{commands → src/commands}/bundle/constants.js +0 -0
- /package/dist/{commands → src/commands}/bundle/entry-gen.d.ts +0 -0
- /package/dist/{commands → src/commands}/bundle/index.d.ts +0 -0
- /package/dist/{commands → src/commands}/bundle/manifest.d.ts +0 -0
- /package/dist/{commands → src/commands}/bundle/manifest.js +0 -0
- /package/dist/{commands → src/commands}/bundle/resolve-sdk-import.d.ts +0 -0
- /package/dist/{commands → src/commands}/verify/addon-source.d.ts +0 -0
- /package/dist/{commands → src/commands}/verify/addon-source.js +0 -0
- /package/dist/{commands → src/commands}/verify/resource-collectors.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/find-in-ancestor-node-modules.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/find-in-ancestor-node-modules.js +0 -0
- /package/dist/{expo → src/expo}/plugins/get-project-root.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/get-project-root.js +0 -0
- /package/dist/{expo → src/expo}/plugins/index.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/index.js +0 -0
- /package/dist/{expo → src/expo}/plugins/resolve-sdk-package-dir.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/resolve-sdk-package-dir.js +0 -0
- /package/dist/{expo → src/expo}/plugins/withAndroidArchitecture.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/withAndroidArchitecture.js +0 -0
- /package/dist/{expo → src/expo}/plugins/withAndroidNdkVersion.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/withDeviceInfo.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/withOpenCL.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/withOpenCL.js +0 -0
- /package/dist/{expo → src/expo}/plugins/withQvacSDK.d.ts +0 -0
- /package/dist/{expo → src/expo}/plugins/withQvacSDK.js +0 -0
- /package/dist/{logging → src/logging}/addon.js +0 -0
- /package/dist/{logging → src/logging}/base-logger.d.ts +0 -0
- /package/dist/{logging → src/logging}/base-logger.js +0 -0
- /package/dist/{logging → src/logging}/client-logger.d.ts +0 -0
- /package/dist/{logging → src/logging}/client-logger.js +0 -0
- /package/dist/{logging → src/logging}/index.d.ts +0 -0
- /package/dist/{logging → src/logging}/index.js +0 -0
- /package/dist/{logging → src/logging}/logger.d.ts +0 -0
- /package/dist/{logging → src/logging}/logger.js +0 -0
- /package/dist/{server/bare/registry → src/logging}/logging-stream-registry.d.ts +0 -0
- /package/dist/{logging → src/logging}/server-logger.d.ts +0 -0
- /package/dist/{logging → src/logging}/server-logger.js +0 -0
- /package/dist/{logging → src/logging}/stream-logger.d.ts +0 -0
- /package/dist/{logging → src/logging}/transport.d.ts +0 -0
- /package/dist/{logging → src/logging}/transport.js +0 -0
- /package/dist/{logging → src/logging}/types.d.ts +0 -0
- /package/dist/{logging → src/logging}/types.js +0 -0
- /package/dist/{logging → src/logging}/utils.js +0 -0
- /package/dist/{pear → src/pear}/pre.d.ts +0 -0
- /package/dist/{server → src/server}/env.d.ts +0 -0
- /package/dist/{server → src/server}/env.js +0 -0
- /package/dist/{server → src/server}/error-handlers.d.ts +0 -0
- /package/dist/{server → src/server}/rpc/progress-throttle.d.ts +0 -0
- /package/dist/{server → src/server}/rpc/progress-throttle.js +0 -0
- /package/dist/{server → src/server}/rpc/rpc-utils.js +0 -0
- /package/dist/{server → src/server}/utils/qvac-paths.d.ts +0 -0
- /package/dist/{server → src/server}/utils/worker-lock.d.ts +0 -0
- /package/dist/{utils → src/utils}/cache-normalize.d.ts +0 -0
- /package/dist/{utils → src/utils}/cache-normalize.js +0 -0
- /package/dist/{utils → src/utils}/decorate-promise.d.ts +0 -0
- /package/dist/{utils → src/utils}/decorate-promise.js +0 -0
- /package/dist/{utils → src/utils}/encoding.d.ts +0 -0
- /package/dist/{utils → src/utils}/encoding.js +0 -0
- /package/dist/{utils → src/utils}/errors-base.d.ts +0 -0
- /package/dist/{utils → src/utils}/errors-base.js +0 -0
- /package/dist/{utils → src/utils}/global-singleton.d.ts +0 -0
- /package/dist/{utils → src/utils}/global-singleton.js +0 -0
- /package/dist/{utils → src/utils}/load-model-validation.d.ts +0 -0
- /package/dist/{utils → src/utils}/object.d.ts +0 -0
- /package/dist/{utils → src/utils}/object.js +0 -0
- /package/dist/{utils → src/utils}/path-sanitize.d.ts +0 -0
- /package/dist/{utils → src/utils}/path-sanitize.js +0 -0
- /package/dist/{utils → src/utils}/withTimeout.d.ts +0 -0
- /package/dist/{utils → src/utils}/withTimeout.js +0 -0
- /package/dist/{utils → src/utils}/zod-error.d.ts +0 -0
- /package/dist/{utils → src/utils}/zod-error.js +0 -0
- /package/dist/{server/rpc → src/worker}/create-server.d.ts +0 -0
- /package/dist/{server/rpc → src/worker}/handle-request.d.ts +0 -0
- /package/{electron-forge → src/electron-forge}/index.cjs +0 -0
- /package/{expo → src/expo}/plugins/patches/android-link.mjs +0 -0
- /package/{expo → src/expo}/plugins/patches/ios-link.mjs +0 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { send, stream } from '../rpc/rpc-client.js';
|
|
2
|
+
import { InvalidResponseError, InvalidOperationError, StreamEndedError, RAGChunkFailedError, RAGSaveFailedError, RAGSearchFailedError, RAGDeleteFailedError, RAGCloseWorkspaceFailedError, RAGListWorkspacesFailedError } from '../../utils/errors-client.js';
|
|
3
|
+
import { generateClientRequestId } from './client-request-id.js';
|
|
4
|
+
import { decoratePromise } from '../../utils/decorate-promise.js';
|
|
5
|
+
// ============== Chunk ==============
|
|
6
|
+
/**
|
|
7
|
+
* Chunks documents into smaller pieces for embedding.
|
|
8
|
+
* Part of the segregated flow: ragChunk() → embed() → ragSaveEmbeddings()
|
|
9
|
+
*
|
|
10
|
+
* @param params - The parameters for chunking
|
|
11
|
+
* @param params.documents - Documents to chunk (string or array)
|
|
12
|
+
* @param params.chunkOpts - Chunking options (chunkSize, chunkOverlap, chunkStrategy)
|
|
13
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
14
|
+
* @returns Array of chunk results with id and content
|
|
15
|
+
* @throws {RAGChunkFailedError} When the operation fails
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const chunks = await ragChunk({
|
|
20
|
+
* documents: ["Long document text here..."],
|
|
21
|
+
* chunkOpts: {
|
|
22
|
+
* chunkSize: 256,
|
|
23
|
+
* chunkOverlap: 50,
|
|
24
|
+
* chunkStrategy: "paragraph",
|
|
25
|
+
* },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export async function ragChunk(params, options) {
|
|
30
|
+
const request = {
|
|
31
|
+
type: 'rag',
|
|
32
|
+
operation: 'chunk',
|
|
33
|
+
...params
|
|
34
|
+
};
|
|
35
|
+
const response = await send(request, options);
|
|
36
|
+
if (response.type !== 'rag') {
|
|
37
|
+
throw new InvalidResponseError('rag');
|
|
38
|
+
}
|
|
39
|
+
if (!response.success) {
|
|
40
|
+
throw new RAGChunkFailedError(response.error);
|
|
41
|
+
}
|
|
42
|
+
if (response.operation !== 'chunk') {
|
|
43
|
+
throw new InvalidOperationError();
|
|
44
|
+
}
|
|
45
|
+
return response.chunks;
|
|
46
|
+
}
|
|
47
|
+
// ============== Ingest ==============
|
|
48
|
+
/**
|
|
49
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
50
|
+
*
|
|
51
|
+
* Ingests documents into the RAG vector database.
|
|
52
|
+
* Full pipeline: chunk → embed → save
|
|
53
|
+
*
|
|
54
|
+
* **Workspace lifecycle:** This operation implicitly opens (or creates) the workspace.
|
|
55
|
+
* The workspace remains open until closed.
|
|
56
|
+
*
|
|
57
|
+
* @param params - The embedding model, documents, optional chunking settings,
|
|
58
|
+
* workspace (default: `"default"`), and progress callback configuration.
|
|
59
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
60
|
+
* @returns Processing results and dropped indices
|
|
61
|
+
* @throws {RAGSaveFailedError} When the operation fails
|
|
62
|
+
* @throws {StreamEndedError} When streaming ends unexpectedly (only when using onProgress)
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // Simple ingest
|
|
67
|
+
* const result = await ragIngest({
|
|
68
|
+
* modelId,
|
|
69
|
+
* documents: ["Document 1", "Document 2"],
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* // With progress tracking
|
|
73
|
+
* const result = await ragIngest({
|
|
74
|
+
* modelId,
|
|
75
|
+
* documents: ["Document 1", "Document 2"],
|
|
76
|
+
* workspace: "my-docs",
|
|
77
|
+
* onProgress: (stage, current, total) => {
|
|
78
|
+
* console.log(`[${stage}] ${current}/${total}`);
|
|
79
|
+
* },
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export function ragIngest(params, options) {
|
|
84
|
+
const requestId = generateClientRequestId();
|
|
85
|
+
const inner = runRagIngest(params, requestId, options);
|
|
86
|
+
return decoratePromise(inner, { requestId });
|
|
87
|
+
}
|
|
88
|
+
async function runRagIngest(params, requestId, options) {
|
|
89
|
+
const { onProgress, ...requestParams } = params;
|
|
90
|
+
const request = {
|
|
91
|
+
type: 'rag',
|
|
92
|
+
operation: 'ingest',
|
|
93
|
+
...requestParams,
|
|
94
|
+
chunk: requestParams.chunk ?? true,
|
|
95
|
+
withProgress: onProgress ? true : undefined,
|
|
96
|
+
requestId
|
|
97
|
+
};
|
|
98
|
+
if (onProgress) {
|
|
99
|
+
// Use streaming for progress updates
|
|
100
|
+
for await (const event of stream(request, options)) {
|
|
101
|
+
if (event.type === 'rag:progress' && event.operation === 'ingest') {
|
|
102
|
+
const progress = event;
|
|
103
|
+
onProgress(progress.stage, progress.current, progress.total);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (event.type === 'rag' && event.operation === 'ingest') {
|
|
107
|
+
if (!event.success) {
|
|
108
|
+
throw new RAGSaveFailedError(event.error);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
processed: event.processed,
|
|
112
|
+
droppedIndices: event.droppedIndices
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
throw new StreamEndedError();
|
|
117
|
+
}
|
|
118
|
+
const response = await send(request, options);
|
|
119
|
+
if (response.type !== 'rag') {
|
|
120
|
+
throw new InvalidResponseError('rag');
|
|
121
|
+
}
|
|
122
|
+
if (!response.success) {
|
|
123
|
+
throw new RAGSaveFailedError(response.error);
|
|
124
|
+
}
|
|
125
|
+
if (response.operation !== 'ingest') {
|
|
126
|
+
throw new InvalidOperationError();
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
processed: response.processed,
|
|
130
|
+
droppedIndices: response.droppedIndices
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// ============== SaveEmbeddings ==============
|
|
134
|
+
/**
|
|
135
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
136
|
+
*
|
|
137
|
+
* Saves pre-embedded documents to the RAG vector database.
|
|
138
|
+
* Part of the segregated flow: chunk() → embed() → saveEmbeddings()
|
|
139
|
+
*
|
|
140
|
+
* **Workspace lifecycle:** This operation implicitly opens (or creates) the workspace.
|
|
141
|
+
* The workspace remains open until closed.
|
|
142
|
+
*
|
|
143
|
+
* @param params - The pre-embedded documents, workspace (default:
|
|
144
|
+
* `"default"`), and optional progress callback configuration.
|
|
145
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
146
|
+
* @returns Array of save results
|
|
147
|
+
* @throws {RAGSaveFailedError} When the operation fails
|
|
148
|
+
* @throws {StreamEndedError} When streaming ends unexpectedly (only when using onProgress)
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* // Segregated flow
|
|
153
|
+
* const chunks = await ragChunk({ documents: ["text1", "text2"] });
|
|
154
|
+
* const { embedding: embeddings } = await embed({ modelId, text: chunks.map(c => c.content) });
|
|
155
|
+
* const embeddedDocs = chunks.map((chunk, i) => ({
|
|
156
|
+
* ...chunk,
|
|
157
|
+
* embedding: embeddings[i],
|
|
158
|
+
* embeddingModelId: modelId,
|
|
159
|
+
* }));
|
|
160
|
+
* const result = await ragSaveEmbeddings({
|
|
161
|
+
* documents: embeddedDocs,
|
|
162
|
+
* workspace: "my-workspace",
|
|
163
|
+
* });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export function ragSaveEmbeddings(params, options) {
|
|
167
|
+
const requestId = generateClientRequestId();
|
|
168
|
+
const inner = runRagSaveEmbeddings(params, requestId, options);
|
|
169
|
+
return decoratePromise(inner, { requestId });
|
|
170
|
+
}
|
|
171
|
+
async function runRagSaveEmbeddings(params, requestId, options) {
|
|
172
|
+
const { onProgress, ...requestParams } = params;
|
|
173
|
+
const request = {
|
|
174
|
+
type: 'rag',
|
|
175
|
+
operation: 'saveEmbeddings',
|
|
176
|
+
...requestParams,
|
|
177
|
+
withProgress: onProgress ? true : undefined,
|
|
178
|
+
requestId
|
|
179
|
+
};
|
|
180
|
+
if (onProgress) {
|
|
181
|
+
for await (const event of stream(request, options)) {
|
|
182
|
+
if (event.type === 'rag:progress' && event.operation === 'saveEmbeddings') {
|
|
183
|
+
const progress = event;
|
|
184
|
+
onProgress(progress.stage, progress.current, progress.total);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (event.type === 'rag' && event.operation === 'saveEmbeddings') {
|
|
188
|
+
if (!event.success) {
|
|
189
|
+
throw new RAGSaveFailedError(event.error);
|
|
190
|
+
}
|
|
191
|
+
return event.processed;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
throw new StreamEndedError();
|
|
195
|
+
}
|
|
196
|
+
const response = await send(request, options);
|
|
197
|
+
if (response.type !== 'rag') {
|
|
198
|
+
throw new InvalidResponseError('rag');
|
|
199
|
+
}
|
|
200
|
+
if (!response.success) {
|
|
201
|
+
throw new RAGSaveFailedError(response.error);
|
|
202
|
+
}
|
|
203
|
+
if (response.operation !== 'saveEmbeddings') {
|
|
204
|
+
throw new InvalidOperationError();
|
|
205
|
+
}
|
|
206
|
+
return response.processed;
|
|
207
|
+
}
|
|
208
|
+
// ============== Search ==============
|
|
209
|
+
/**
|
|
210
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
211
|
+
*
|
|
212
|
+
* Searches for similar documents in the RAG vector database.
|
|
213
|
+
*
|
|
214
|
+
* **Workspace lifecycle:** This operation requires an existing workspace. If the workspace
|
|
215
|
+
* doesn't exist, returns an empty array.
|
|
216
|
+
*
|
|
217
|
+
* @param params - The parameters for searching
|
|
218
|
+
* @param params.modelId - The identifier of the embedding model to use
|
|
219
|
+
* @param params.query - The search query text
|
|
220
|
+
* @param params.topK - Number of top results to retrieve (default: 5)
|
|
221
|
+
* @param params.n - Number of centroids to use for IVF index search (default: 3)
|
|
222
|
+
* @param params.workspace - Workspace to search in (default: "default").
|
|
223
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
224
|
+
* @returns Array of search results with id, content, and score. Empty array if workspace doesn't exist.
|
|
225
|
+
* @throws {RAGSearchFailedError} When the operation fails
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* const results = await ragSearch({
|
|
230
|
+
* modelId,
|
|
231
|
+
* query: "AI and machine learning",
|
|
232
|
+
* topK: 5,
|
|
233
|
+
* workspace: "my-docs",
|
|
234
|
+
* });
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
export async function ragSearch(params, options) {
|
|
238
|
+
const request = {
|
|
239
|
+
type: 'rag',
|
|
240
|
+
operation: 'search',
|
|
241
|
+
...params,
|
|
242
|
+
topK: params.topK ?? 5,
|
|
243
|
+
n: params.n ?? 3
|
|
244
|
+
};
|
|
245
|
+
const response = await send(request, options);
|
|
246
|
+
if (response.type !== 'rag') {
|
|
247
|
+
throw new InvalidResponseError('rag');
|
|
248
|
+
}
|
|
249
|
+
if (!response.success) {
|
|
250
|
+
throw new RAGSearchFailedError(response.error);
|
|
251
|
+
}
|
|
252
|
+
if (response.operation !== 'search') {
|
|
253
|
+
throw new InvalidOperationError();
|
|
254
|
+
}
|
|
255
|
+
return response.results;
|
|
256
|
+
}
|
|
257
|
+
// ============== Delete Embeddings ==============
|
|
258
|
+
/**
|
|
259
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
260
|
+
*
|
|
261
|
+
* Deletes document embeddings from the RAG vector database.
|
|
262
|
+
*
|
|
263
|
+
* **Workspace lifecycle:** This operation requires an existing workspace.
|
|
264
|
+
*
|
|
265
|
+
* @param params - The parameters for deleting embeddings
|
|
266
|
+
* @param params.ids - Array of document IDs to delete
|
|
267
|
+
* @param params.workspace - Workspace to delete from (default: "default")
|
|
268
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
269
|
+
* @throws {RAGDeleteFailedError} When the operation fails or workspace doesn't exist
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* await ragDeleteEmbeddings({
|
|
274
|
+
* ids: ["doc-1", "doc-2"],
|
|
275
|
+
* workspace: "my-docs",
|
|
276
|
+
* });
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
export async function ragDeleteEmbeddings(params, options) {
|
|
280
|
+
const request = {
|
|
281
|
+
type: 'rag',
|
|
282
|
+
operation: 'deleteEmbeddings',
|
|
283
|
+
...params
|
|
284
|
+
};
|
|
285
|
+
const response = await send(request, options);
|
|
286
|
+
if (response.type !== 'rag') {
|
|
287
|
+
throw new InvalidResponseError('rag');
|
|
288
|
+
}
|
|
289
|
+
if (!response.success) {
|
|
290
|
+
throw new RAGDeleteFailedError(response.error);
|
|
291
|
+
}
|
|
292
|
+
if (response.operation !== 'deleteEmbeddings') {
|
|
293
|
+
throw new InvalidOperationError();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
// ============== Reindex ==============
|
|
297
|
+
/**
|
|
298
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
299
|
+
*
|
|
300
|
+
* Reindexes the RAG database to optimize search performance.
|
|
301
|
+
* For HyperDB, this rebalances centroids using k-means clustering.
|
|
302
|
+
*
|
|
303
|
+
* **Workspace lifecycle:** This operation requires an existing workspace.
|
|
304
|
+
*
|
|
305
|
+
* **Note:** Reindex requires a minimum number of documents to perform clustering.
|
|
306
|
+
* For HyperDB, this is 16 documents by default. If there are insufficient documents,
|
|
307
|
+
* `reindexed` will be `false` with `details` explaining the reason.
|
|
308
|
+
*
|
|
309
|
+
* @param params - The existing workspace to reindex (default: `"default"`)
|
|
310
|
+
* and optional progress callback.
|
|
311
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
312
|
+
* @returns Reindex result with `reindexed` boolean and optional `details`
|
|
313
|
+
* @throws {RAGSaveFailedError} When the operation fails or workspace doesn't exist
|
|
314
|
+
* @throws {StreamEndedError} When streaming ends unexpectedly (only when using onProgress)
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ```typescript
|
|
318
|
+
* // Simple reindex
|
|
319
|
+
* const result = await ragReindex({
|
|
320
|
+
* workspace: "my-docs",
|
|
321
|
+
* });
|
|
322
|
+
*
|
|
323
|
+
* // Check result
|
|
324
|
+
* if (!result.reindexed) {
|
|
325
|
+
* console.log("Reindex skipped:", result.details?.reason);
|
|
326
|
+
* }
|
|
327
|
+
*
|
|
328
|
+
* // With progress tracking
|
|
329
|
+
* const result = await ragReindex({
|
|
330
|
+
* workspace: "my-docs",
|
|
331
|
+
* onProgress: (stage, current, total) => {
|
|
332
|
+
* console.log(`[${stage}] ${current}/${total}`);
|
|
333
|
+
* },
|
|
334
|
+
* });
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
export function ragReindex(params, options) {
|
|
338
|
+
const requestId = generateClientRequestId();
|
|
339
|
+
const inner = runRagReindex(params, requestId, options);
|
|
340
|
+
return decoratePromise(inner, { requestId });
|
|
341
|
+
}
|
|
342
|
+
async function runRagReindex(params, requestId, options) {
|
|
343
|
+
const { onProgress, ...requestParams } = params;
|
|
344
|
+
const request = {
|
|
345
|
+
type: 'rag',
|
|
346
|
+
operation: 'reindex',
|
|
347
|
+
...requestParams,
|
|
348
|
+
withProgress: onProgress ? true : undefined,
|
|
349
|
+
requestId
|
|
350
|
+
};
|
|
351
|
+
if (onProgress) {
|
|
352
|
+
for await (const event of stream(request, options)) {
|
|
353
|
+
if (event.type === 'rag:progress' && event.operation === 'reindex') {
|
|
354
|
+
const progress = event;
|
|
355
|
+
onProgress(progress.stage, progress.current, progress.total);
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (event.type === 'rag' && event.operation === 'reindex') {
|
|
359
|
+
if (!event.success) {
|
|
360
|
+
throw new RAGSaveFailedError(event.error);
|
|
361
|
+
}
|
|
362
|
+
return event.result;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
throw new StreamEndedError();
|
|
366
|
+
}
|
|
367
|
+
const response = await send(request, options);
|
|
368
|
+
if (response.type !== 'rag') {
|
|
369
|
+
throw new InvalidResponseError('rag');
|
|
370
|
+
}
|
|
371
|
+
if (!response.success) {
|
|
372
|
+
throw new RAGSaveFailedError(response.error);
|
|
373
|
+
}
|
|
374
|
+
if (response.operation !== 'reindex') {
|
|
375
|
+
throw new InvalidOperationError();
|
|
376
|
+
}
|
|
377
|
+
return response.result;
|
|
378
|
+
}
|
|
379
|
+
// ============== List Workspaces ==============
|
|
380
|
+
/**
|
|
381
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
382
|
+
*
|
|
383
|
+
* Lists all RAG workspaces with their open status.
|
|
384
|
+
*
|
|
385
|
+
* Returns all workspaces that exist on disk. The `open` field indicates whether
|
|
386
|
+
* the workspace is currently loaded in memory and holding active resources
|
|
387
|
+
* (Corestore, HyperDB adapter, and possibly a RAG instance).
|
|
388
|
+
*
|
|
389
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
390
|
+
* @returns Array of workspace info with name and open status
|
|
391
|
+
* @throws {RAGListWorkspacesFailedError} When the operation fails
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```typescript
|
|
395
|
+
* const workspaces = await ragListWorkspaces();
|
|
396
|
+
* // [{ name: "default", open: true }, { name: "my-docs", open: false }]
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
export async function ragListWorkspaces(options) {
|
|
400
|
+
const request = {
|
|
401
|
+
type: 'rag',
|
|
402
|
+
operation: 'listWorkspaces'
|
|
403
|
+
};
|
|
404
|
+
const response = await send(request, options);
|
|
405
|
+
if (response.type !== 'rag') {
|
|
406
|
+
throw new InvalidResponseError('rag');
|
|
407
|
+
}
|
|
408
|
+
if (!response.success) {
|
|
409
|
+
throw new RAGListWorkspacesFailedError(response.error);
|
|
410
|
+
}
|
|
411
|
+
if (response.operation !== 'listWorkspaces') {
|
|
412
|
+
throw new InvalidOperationError();
|
|
413
|
+
}
|
|
414
|
+
return response.workspaces;
|
|
415
|
+
}
|
|
416
|
+
// ============== Close Workspace ==============
|
|
417
|
+
/**
|
|
418
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
419
|
+
*
|
|
420
|
+
* Closes a RAG workspace, releasing in-memory resources (Corestore, HyperDB adapter, RAG instance).
|
|
421
|
+
*
|
|
422
|
+
* **Workspace lifecycle:** Workspaces are implicitly opened.
|
|
423
|
+
* This function explicitly closes them, releasing memory and file locks. The workspace data
|
|
424
|
+
* remains on disk unless `deleteOnClose` is set to true.
|
|
425
|
+
*
|
|
426
|
+
* @param params - The workspace to close (default: `"default"`) and whether
|
|
427
|
+
* its on-disk data should also be deleted.
|
|
428
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
429
|
+
* @throws {RAGCloseWorkspaceFailedError} When the operation fails
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* // Close a specific workspace
|
|
434
|
+
* await ragCloseWorkspace({ workspace: "my-docs" });
|
|
435
|
+
*
|
|
436
|
+
* // Close and delete in one call
|
|
437
|
+
* await ragCloseWorkspace({ workspace: "my-docs", deleteOnClose: true });
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
export async function ragCloseWorkspace(params, options) {
|
|
441
|
+
const request = {
|
|
442
|
+
type: 'rag',
|
|
443
|
+
operation: 'closeWorkspace',
|
|
444
|
+
...params
|
|
445
|
+
};
|
|
446
|
+
const response = await send(request, options);
|
|
447
|
+
if (response.type !== 'rag') {
|
|
448
|
+
throw new InvalidResponseError('rag');
|
|
449
|
+
}
|
|
450
|
+
if (!response.success) {
|
|
451
|
+
throw new RAGCloseWorkspaceFailedError(response.error);
|
|
452
|
+
}
|
|
453
|
+
if (response.operation !== 'closeWorkspace') {
|
|
454
|
+
throw new InvalidOperationError();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
// ============== Delete Workspace ==============
|
|
458
|
+
/**
|
|
459
|
+
* @prototype The built-in RAG vector store is not production grade. For production, use an external vector DB (see the RAG guide).
|
|
460
|
+
*
|
|
461
|
+
* Deletes a RAG workspace and all its data.
|
|
462
|
+
* The workspace must not be currently loaded/in-use.
|
|
463
|
+
*
|
|
464
|
+
* @param params - The parameters for deletion
|
|
465
|
+
* @param params.workspace - Name of the workspace to delete
|
|
466
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
467
|
+
* @throws {RAGDeleteFailedError} When the workspace doesn't exist or is currently loaded
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```typescript
|
|
471
|
+
* await ragDeleteWorkspace({ workspace: "my-docs" });
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
474
|
+
export async function ragDeleteWorkspace(params, options) {
|
|
475
|
+
const request = {
|
|
476
|
+
type: 'rag',
|
|
477
|
+
operation: 'deleteWorkspace',
|
|
478
|
+
...params
|
|
479
|
+
};
|
|
480
|
+
const response = await send(request, options);
|
|
481
|
+
if (response.type !== 'rag') {
|
|
482
|
+
throw new InvalidResponseError('rag');
|
|
483
|
+
}
|
|
484
|
+
if (!response.success) {
|
|
485
|
+
throw new RAGDeleteFailedError(response.error);
|
|
486
|
+
}
|
|
487
|
+
if (response.operation !== 'deleteWorkspace') {
|
|
488
|
+
throw new InvalidOperationError();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ModelRegistryEntry, ModelRegistryEntryAddon } from '@qvac/inference/surface';
|
|
2
|
+
export type { ModelRegistryEntry, ModelRegistryEntryAddon };
|
|
3
|
+
export interface ModelRegistrySearchParams {
|
|
4
|
+
filter?: string;
|
|
5
|
+
engine?: string;
|
|
6
|
+
quantization?: string;
|
|
7
|
+
modelType?: ModelRegistryEntryAddon;
|
|
8
|
+
addon?: ModelRegistryEntryAddon;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns all available models from the QVAC distributed model registry.
|
|
12
|
+
*
|
|
13
|
+
* @returns A promise resolving to an array of `ModelRegistryEntry` describing every model the SDK's connected registry knows about.
|
|
14
|
+
* @throws {ModelRegistryQueryFailedError} When the registry query fails.
|
|
15
|
+
*/
|
|
16
|
+
declare function modelRegistryList(): Promise<ModelRegistryEntry[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Searches the model registry with optional filters for model type, engine, and quantization.
|
|
19
|
+
*
|
|
20
|
+
* @param params - Search filters (all optional).
|
|
21
|
+
* @param params.filter - Free-text filter matched against model metadata.
|
|
22
|
+
* @param params.engine - Inference engine identifier (e.g., `"llamacpp-completion"`).
|
|
23
|
+
* @param params.quantization - Quantization identifier (e.g., `"Q4_K_M"`).
|
|
24
|
+
* @param params.modelType - Alias for `addon`; kept for backward compatibility.
|
|
25
|
+
* @param params.addon - Model addon / category to restrict results to.
|
|
26
|
+
* @returns A promise resolving to the matching `ModelRegistryEntry` entries.
|
|
27
|
+
* @throws {ModelRegistryQueryFailedError} When the registry query fails.
|
|
28
|
+
*/
|
|
29
|
+
declare function modelRegistrySearch(params?: ModelRegistrySearchParams): Promise<ModelRegistryEntry[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Fetches a single model entry from the registry by its path and source.
|
|
32
|
+
*
|
|
33
|
+
* @param registryPath - Registry-relative path of the model to fetch.
|
|
34
|
+
* @param registrySource - Registry source identifier (e.g., `"huggingface"`, `"local"`).
|
|
35
|
+
* @returns A promise resolving to the matching `ModelRegistryEntry`.
|
|
36
|
+
* @throws {ModelRegistryQueryFailedError} When the model cannot be located or the registry query fails.
|
|
37
|
+
*/
|
|
38
|
+
declare function modelRegistryGetModel(registryPath: string, registrySource: string): Promise<ModelRegistryEntry>;
|
|
39
|
+
export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel };
|
|
40
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { send } from '../rpc/rpc-client.js';
|
|
2
|
+
import { ModelRegistryQueryFailedError } from '../../utils/errors-client.js';
|
|
3
|
+
function validateRegistryResponse(response, fallbackError) {
|
|
4
|
+
if (!response.success) {
|
|
5
|
+
throw new ModelRegistryQueryFailedError(response.error ?? fallbackError ?? 'Unknown registry error');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns all available models from the QVAC distributed model registry.
|
|
10
|
+
*
|
|
11
|
+
* @returns A promise resolving to an array of `ModelRegistryEntry` describing every model the SDK's connected registry knows about.
|
|
12
|
+
* @throws {ModelRegistryQueryFailedError} When the registry query fails.
|
|
13
|
+
*/
|
|
14
|
+
async function modelRegistryList() {
|
|
15
|
+
const request = {
|
|
16
|
+
type: 'modelRegistryList'
|
|
17
|
+
};
|
|
18
|
+
const response = (await send(request));
|
|
19
|
+
validateRegistryResponse(response);
|
|
20
|
+
return response.models;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Searches the model registry with optional filters for model type, engine, and quantization.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Search filters (all optional).
|
|
26
|
+
* @param params.filter - Free-text filter matched against model metadata.
|
|
27
|
+
* @param params.engine - Inference engine identifier (e.g., `"llamacpp-completion"`).
|
|
28
|
+
* @param params.quantization - Quantization identifier (e.g., `"Q4_K_M"`).
|
|
29
|
+
* @param params.modelType - Alias for `addon`; kept for backward compatibility.
|
|
30
|
+
* @param params.addon - Model addon / category to restrict results to.
|
|
31
|
+
* @returns A promise resolving to the matching `ModelRegistryEntry` entries.
|
|
32
|
+
* @throws {ModelRegistryQueryFailedError} When the registry query fails.
|
|
33
|
+
*/
|
|
34
|
+
async function modelRegistrySearch(params = {}) {
|
|
35
|
+
const { modelType, ...rest } = params;
|
|
36
|
+
const request = {
|
|
37
|
+
type: 'modelRegistrySearch',
|
|
38
|
+
...rest,
|
|
39
|
+
addon: modelType ?? rest.addon
|
|
40
|
+
};
|
|
41
|
+
const response = (await send(request));
|
|
42
|
+
validateRegistryResponse(response);
|
|
43
|
+
return response.models;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Fetches a single model entry from the registry by its path and source.
|
|
47
|
+
*
|
|
48
|
+
* @param registryPath - Registry-relative path of the model to fetch.
|
|
49
|
+
* @param registrySource - Registry source identifier (e.g., `"huggingface"`, `"local"`).
|
|
50
|
+
* @returns A promise resolving to the matching `ModelRegistryEntry`.
|
|
51
|
+
* @throws {ModelRegistryQueryFailedError} When the model cannot be located or the registry query fails.
|
|
52
|
+
*/
|
|
53
|
+
async function modelRegistryGetModel(registryPath, registrySource) {
|
|
54
|
+
const request = {
|
|
55
|
+
type: 'modelRegistryGetModel',
|
|
56
|
+
registryPath,
|
|
57
|
+
registrySource
|
|
58
|
+
};
|
|
59
|
+
const response = (await send(request));
|
|
60
|
+
validateRegistryResponse(response, `Model not found: ${registrySource}/${registryPath}`);
|
|
61
|
+
return response.model;
|
|
62
|
+
}
|
|
63
|
+
export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resumes the SDK runtime: restores all suspended Hyperswarm and Corestore
|
|
3
|
+
* resources and releases the lifecycle gate so all SDK operations are allowed
|
|
4
|
+
* again.
|
|
5
|
+
*
|
|
6
|
+
* Safe to call from any lifecycle state — `resume()` is never blocked by the
|
|
7
|
+
* lifecycle gate (along with `suspend()` and `state()`). Idempotent. Also
|
|
8
|
+
* serves as the recovery path after a partial suspend failure.
|
|
9
|
+
*
|
|
10
|
+
* After `resume()` resolves successfully, runtime state is `"active"` and
|
|
11
|
+
* non-lifecycle SDK operations are accepted normally.
|
|
12
|
+
*
|
|
13
|
+
* Behavior of in-flight operations from before the previous `suspend()`:
|
|
14
|
+
* - P2P / Hyperdrive downloads: continue automatically once their underlying
|
|
15
|
+
* swarm/corestore is restored
|
|
16
|
+
*
|
|
17
|
+
* @throws {RPCError} When one or more resources fail to resume. On partial
|
|
18
|
+
* failure the runtime stays `"suspended"` (operations remain blocked) so
|
|
19
|
+
* callers can retry `resume()`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Foreground handler
|
|
23
|
+
* await resume();
|
|
24
|
+
* console.log(await state()); // "active"
|
|
25
|
+
*/
|
|
26
|
+
export declare function resume(): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { send } from '../rpc/rpc-client.js';
|
|
2
|
+
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resumes the SDK runtime: restores all suspended Hyperswarm and Corestore
|
|
5
|
+
* resources and releases the lifecycle gate so all SDK operations are allowed
|
|
6
|
+
* again.
|
|
7
|
+
*
|
|
8
|
+
* Safe to call from any lifecycle state — `resume()` is never blocked by the
|
|
9
|
+
* lifecycle gate (along with `suspend()` and `state()`). Idempotent. Also
|
|
10
|
+
* serves as the recovery path after a partial suspend failure.
|
|
11
|
+
*
|
|
12
|
+
* After `resume()` resolves successfully, runtime state is `"active"` and
|
|
13
|
+
* non-lifecycle SDK operations are accepted normally.
|
|
14
|
+
*
|
|
15
|
+
* Behavior of in-flight operations from before the previous `suspend()`:
|
|
16
|
+
* - P2P / Hyperdrive downloads: continue automatically once their underlying
|
|
17
|
+
* swarm/corestore is restored
|
|
18
|
+
*
|
|
19
|
+
* @throws {RPCError} When one or more resources fail to resume. On partial
|
|
20
|
+
* failure the runtime stays `"suspended"` (operations remain blocked) so
|
|
21
|
+
* callers can retry `resume()`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Foreground handler
|
|
25
|
+
* await resume();
|
|
26
|
+
* console.log(await state()); // "active"
|
|
27
|
+
*/
|
|
28
|
+
export async function resume() {
|
|
29
|
+
const response = await send({ type: 'resume' });
|
|
30
|
+
if (response.type !== 'resume') {
|
|
31
|
+
throw new InvalidResponseError('resume');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LifecycleState } from '@qvac/inference/surface';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the current runtime lifecycle state.
|
|
4
|
+
*
|
|
5
|
+
* Safe to call from any lifecycle state — `state()` is never blocked by the
|
|
6
|
+
* lifecycle gate (along with `suspend()` and `resume()`).
|
|
7
|
+
*
|
|
8
|
+
* @returns The current lifecycle state:
|
|
9
|
+
* - `"active"`: all SDK operations are allowed
|
|
10
|
+
* - `"suspending"` | `"suspended"` | `"resuming"`: non-lifecycle operations
|
|
11
|
+
* throw `LifecycleOperationBlockedError`
|
|
12
|
+
*
|
|
13
|
+
* @throws {InvalidResponseError} When the response envelope does not match the request type.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Branch on lifecycle state before issuing work
|
|
17
|
+
* const current = await state();
|
|
18
|
+
* if (current !== "active") {
|
|
19
|
+
* await resume();
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
export declare function state(): Promise<LifecycleState>;
|
|
23
|
+
//# sourceMappingURL=state.d.ts.map
|