@qvac/sdk 0.15.0 → 0.17.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 +87 -84
- package/README.md +65 -0
- package/dist/client/api/audio-gen-result.d.ts +4 -0
- package/dist/client/api/audio-gen-result.js +132 -0
- package/dist/client/api/audio-gen.d.ts +29 -0
- package/dist/client/api/audio-gen.js +31 -0
- package/dist/client/api/batch-completion.d.ts +2 -2
- package/dist/client/api/batch-completion.js +2 -2
- package/dist/client/api/bci-transcribe.d.ts +1 -1
- package/dist/client/api/bci-transcribe.js +3 -3
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +1 -1
- package/dist/client/api/classify.d.ts +1 -1
- package/dist/client/api/classify.js +1 -1
- package/dist/client/api/completion-stream.d.ts +3 -3
- package/dist/client/api/completion-stream.js +3 -3
- package/dist/client/api/delete-cache.js +1 -1
- package/dist/client/api/diffusion.d.ts +1 -1
- package/dist/client/api/diffusion.js +1 -1
- package/dist/client/api/download-asset.d.ts +1 -1
- package/dist/client/api/download-asset.js +3 -3
- package/dist/client/api/embed.d.ts +1 -1
- package/dist/client/api/embed.js +2 -2
- package/dist/client/api/finetune.d.ts +1 -1
- package/dist/client/api/finetune.js +2 -2
- package/dist/client/api/get-loaded-model-info.d.ts +2 -2
- package/dist/client/api/get-loaded-model-info.js +1 -1
- package/dist/client/api/get-model-info.d.ts +2 -2
- package/dist/client/api/get-model-info.js +1 -1
- package/dist/client/api/get-system-resources.d.ts +3 -0
- package/dist/client/api/get-system-resources.js +16 -0
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +1 -1
- package/dist/client/api/index.d.ts +35 -33
- package/dist/client/api/index.js +2 -0
- package/dist/client/api/invoke-plugin.d.ts +1 -1
- package/dist/client/api/invoke-plugin.js +1 -1
- package/dist/client/api/load-model.d.ts +2 -2
- package/dist/client/api/load-model.js +4 -4
- package/dist/client/api/logging-stream.d.ts +1 -1
- package/dist/client/api/logging-stream.js +1 -1
- package/dist/client/api/ocr.d.ts +10 -1
- package/dist/client/api/ocr.js +10 -1
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +1 -1
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +2 -2
- package/dist/client/api/registry.d.ts +1 -1
- package/dist/client/api/registry.js +1 -1
- package/dist/client/api/resume.js +1 -1
- package/dist/client/api/state.d.ts +1 -1
- package/dist/client/api/state.js +1 -1
- package/dist/client/api/stop-provider.js +1 -1
- package/dist/client/api/subscribe-logs.d.ts +1 -1
- package/dist/client/api/suspend.js +1 -1
- package/dist/client/api/text-to-speech.d.ts +3 -2
- package/dist/client/api/text-to-speech.js +31 -9
- package/dist/client/api/transcribe.d.ts +1 -1
- package/dist/client/api/transcribe.js +2 -2
- package/dist/client/api/translate.d.ts +1 -1
- package/dist/client/api/translate.js +7 -18
- package/dist/client/api/unload-model.d.ts +1 -1
- package/dist/client/api/unload-model.js +2 -2
- package/dist/client/api/upscale.d.ts +1 -1
- package/dist/client/api/upscale.js +1 -1
- package/dist/client/api/video.d.ts +8 -5
- package/dist/client/api/video.js +9 -6
- package/dist/client/api/vla.d.ts +15 -11
- package/dist/client/api/vla.js +14 -10
- package/dist/client/config-loader/config-utils.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/init-hooks.d.ts +1 -1
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/plugins-factory.d.ts +2 -2
- package/dist/client/plugins-factory.js +1 -1
- package/dist/client/rpc/bare-client.d.ts +1 -1
- package/dist/client/rpc/bare-client.js +3 -3
- package/dist/client/rpc/expo-rpc-client.js +3 -3
- package/dist/client/rpc/node-rpc-client.js +2 -2
- package/dist/client/rpc/profiling/index.d.ts +1 -1
- package/dist/client/rpc/profiling/profiler.d.ts +2 -2
- package/dist/client/rpc/profiling/profiler.js +4 -0
- package/dist/client/rpc/rpc-client.d.ts +1 -1
- package/dist/client/rpc/rpc-client.js +7 -4
- package/dist/client/rpc/rpc-error.d.ts +1 -1
- package/dist/client/rpc/rpc-error.js +7 -1
- package/dist/commands/bundle/bare-pack.d.ts +1 -1
- package/dist/commands/bundle/constants.js +1 -0
- package/dist/commands/bundle/entry-gen.js +1 -1
- package/dist/commands/bundle/index.js +6 -6
- package/dist/commands/bundle/manifest.d.ts +1 -1
- package/dist/commands/bundle/plugins.d.ts +2 -2
- package/dist/commands/bundle/plugins.js +1 -1
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +2 -2
- package/dist/commands/verify/abi.d.ts +1 -1
- package/dist/commands/verify/abi.js +1 -1
- package/dist/commands/verify/bundle-source.d.ts +1 -1
- package/dist/commands/verify/bundle-source.js +2 -2
- package/dist/commands/verify/index.d.ts +3 -3
- package/dist/commands/verify/index.js +5 -5
- package/dist/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/commands/verify/node-modules-source.js +1 -1
- package/dist/commands/verify/prebuilds.d.ts +2 -1
- package/dist/commands/verify/prebuilds.js +8 -11
- package/dist/commands/verify/resource-collectors.d.ts +88 -0
- package/dist/commands/verify/resource-collectors.js +261 -0
- package/dist/constants/audio.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/examples/{transcription → asr}/parakeet-ctc-filesystem.js +2 -3
- package/dist/examples/{transcription → asr}/parakeet-microphone-record.js +2 -2
- package/dist/examples/{transcription → asr}/parakeet-microphone-stream.js +2 -2
- package/dist/examples/{transcription → asr}/parakeet-sortformer-streaming.js +2 -2
- package/dist/examples/{transcription → asr}/parakeet-sortformer.js +1 -1
- package/dist/examples/asr/parakeet-tdt-filesystem-chunked.d.ts +2 -0
- package/dist/examples/asr/parakeet-tdt-filesystem-chunked.js +203 -0
- package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem.js +2 -2
- package/dist/examples/{transcription → asr}/whispercpp-filesystem-streaming.js +1 -1
- package/dist/examples/{transcription → asr}/whispercpp-filesystem.js +1 -1
- package/dist/examples/{transcription → asr}/whispercpp-microphone-conversation.js +1 -1
- package/dist/examples/{transcription → asr}/whispercpp-microphone-record.js +2 -2
- package/dist/examples/{transcription → asr}/whispercpp-prompt.js +1 -1
- package/dist/examples/audiogen/generate-music.d.ts +2 -0
- package/dist/examples/audiogen/generate-music.js +112 -0
- package/dist/examples/cache-management.js +1 -1
- package/dist/examples/config-reload.js +1 -1
- package/dist/examples/diffusion-ideogram.d.ts +2 -0
- package/dist/examples/diffusion-ideogram.js +108 -0
- package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-ltx.js +98 -0
- package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
- package/dist/examples/diffusion-txt2vid-wan22.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid-wan22.js +96 -0
- package/dist/examples/logging-streaming.js +5 -1
- package/dist/examples/quickstart.bare.js +1 -1
- package/dist/examples/rag/rag-mongodb.d.ts +2 -0
- package/dist/examples/rag/rag-mongodb.js +180 -0
- package/dist/examples/tools/llamacpp-tools-auto-dialect.d.ts +2 -0
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +77 -0
- package/dist/examples/tts/parler.d.ts +2 -0
- package/dist/examples/tts/parler.js +51 -0
- package/dist/examples/vla-groot.d.ts +2 -0
- package/dist/examples/vla-groot.js +120 -0
- package/dist/examples/voice-assistant/voice-assistant.js +2 -2
- package/dist/expo/plugins/index.d.ts +11 -11
- package/dist/expo/plugins/withDeviceInfo.js +2 -2
- package/dist/expo/plugins/withMobileBundle.js +3 -3
- package/dist/index.d.ts +16 -16
- package/dist/index.js +4 -4
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/base-logger.d.ts +1 -1
- package/dist/logging/base-logger.js +1 -1
- package/dist/logging/client-logger.d.ts +1 -1
- package/dist/logging/index.d.ts +9 -9
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/namespaces.d.ts +1 -1
- package/dist/logging/registry.d.ts +1 -1
- package/dist/logging/server-logger.d.ts +1 -1
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/transport.d.ts +1 -1
- package/dist/logging/utils.d.ts +1 -1
- package/dist/logging/utils.js +1 -1
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/models.d.ts +6443 -9832
- package/dist/models/registry/models.js +4076 -7658
- package/dist/models/update-models/codegen.d.ts +1 -1
- package/dist/models/update-models/companions.d.ts +1 -1
- package/dist/models/update-models/history.d.ts +1 -1
- package/dist/models/update-models/history.js +4 -4
- package/dist/models/update-models/naming.d.ts +1 -1
- package/dist/models/update-models/naming.js +12 -2
- package/dist/models/update-models/processing.d.ts +1 -1
- package/dist/models/update-models/processing.js +1 -1
- package/dist/models/update-models/registry.d.ts +2 -2
- package/dist/models/update-models/shards.d.ts +1 -1
- package/dist/models/update-models/types.d.ts +1 -1
- package/dist/pear/pre.js +2 -0
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/backend-diagnostics.d.ts +8 -0
- package/dist/profiling/backend-diagnostics.js +21 -0
- package/dist/profiling/controller.d.ts +4 -2
- package/dist/profiling/controller.js +8 -0
- package/dist/profiling/envelope.d.ts +3 -2
- package/dist/profiling/envelope.js +13 -2
- package/dist/profiling/events.d.ts +2 -2
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/index.d.ts +9 -8
- package/dist/profiling/index.js +3 -2
- package/dist/profiling/types.d.ts +6 -0
- package/dist/schemas/audio-gen.d.ts +253 -0
- package/dist/schemas/audio-gen.js +69 -0
- package/dist/schemas/batch-completion-stream.d.ts +11 -6
- package/dist/schemas/bci-config.d.ts +2 -0
- package/dist/schemas/bci.d.ts +1 -1
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/common.d.ts +1938 -58
- package/dist/schemas/common.js +9 -1
- package/dist/schemas/completion-event.d.ts +5 -2
- package/dist/schemas/completion-event.js +3 -0
- package/dist/schemas/completion-stream.d.ts +195 -3
- package/dist/schemas/completion-stream.js +72 -2
- package/dist/schemas/constants-registry.d.ts +69 -0
- package/dist/schemas/constants-registry.js +52 -0
- package/dist/schemas/delete-cache.js +7 -3
- package/dist/schemas/download-asset.d.ts +8 -4
- package/dist/schemas/engine-addon-map.d.ts +3 -1
- package/dist/schemas/engine-addon-map.js +6 -2
- package/dist/schemas/finetune.js +6 -3
- package/dist/schemas/get-loaded-model-info.d.ts +18 -0
- package/dist/schemas/get-loaded-model-info.js +14 -6
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +53 -51
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/llamacpp-config.d.ts +30 -6
- package/dist/schemas/llamacpp-config.js +1 -6
- package/dist/schemas/load-model.d.ts +7654 -2919
- package/dist/schemas/load-model.js +45 -6
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/plugin.d.ts +17 -8
- package/dist/schemas/plugin.js +16 -6
- package/dist/schemas/profiling.d.ts +587 -0
- package/dist/schemas/profiling.js +22 -0
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/reload-config.js +3 -1
- package/dist/schemas/sdcpp-config.d.ts +296 -0
- package/dist/schemas/sdcpp-config.js +165 -17
- package/dist/schemas/sdk-config.d.ts +958 -40
- package/dist/schemas/sdk-errors-server.js +3 -1
- package/dist/schemas/system-resources.d.ts +3967 -0
- package/dist/schemas/system-resources.js +149 -0
- package/dist/schemas/text-to-speech.d.ts +340 -6
- package/dist/schemas/text-to-speech.js +136 -17
- package/dist/schemas/tools.d.ts +1 -1
- package/dist/schemas/tools.js +2 -1
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/translate.d.ts +2 -2
- package/dist/schemas/translate.js +12 -6
- package/dist/schemas/translation-config.d.ts +30 -10
- package/dist/schemas/vla.d.ts +10 -0
- package/dist/schemas/vla.js +31 -11
- package/dist/scripts/check-resource-collectors-packaging.d.ts +33 -0
- package/dist/scripts/check-resource-collectors-packaging.js +136 -0
- package/dist/scripts/contract/build-contract.d.ts +38 -0
- package/dist/scripts/contract/build-contract.js +620 -0
- package/dist/scripts/contract/build-error-codes.d.ts +17 -0
- package/dist/scripts/contract/build-error-codes.js +17 -0
- package/dist/scripts/contract/build-model-type-maps.d.ts +22 -0
- package/dist/scripts/contract/build-model-type-maps.js +16 -0
- package/dist/scripts/contract/build-models-registry.d.ts +17 -0
- package/dist/scripts/contract/build-models-registry.js +31 -0
- package/dist/scripts/contract/plugin-contract.d.ts +23 -0
- package/dist/scripts/contract/plugin-contract.js +28 -0
- package/dist/scripts/export-contract.d.ts +2 -0
- package/dist/scripts/export-contract.js +27 -0
- package/dist/scripts/export-plugin-contract.d.ts +2 -0
- package/dist/scripts/export-plugin-contract.js +18 -0
- package/dist/server/bare/delegate-rpc-client.d.ts +1 -1
- package/dist/server/bare/delegate-rpc-client.js +3 -3
- package/dist/server/bare/hyperswarm.d.ts +1 -1
- package/dist/server/bare/hyperswarm.js +2 -2
- package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
- package/dist/server/bare/ops/bci-transcribe.js +4 -4
- package/dist/server/bare/ops/cancel.d.ts +2 -2
- package/dist/server/bare/ops/cancel.js +2 -2
- package/dist/server/bare/ops/embed.d.ts +1 -1
- package/dist/server/bare/ops/embed.js +3 -3
- package/dist/server/bare/ops/kv-cache-retention.d.ts +12 -0
- package/dist/server/bare/ops/kv-cache-retention.js +121 -0
- package/dist/server/bare/ops/kv-cache-utils.d.ts +2 -1
- package/dist/server/bare/ops/kv-cache-utils.js +26 -5
- package/dist/server/bare/ops/load-model.d.ts +2 -2
- package/dist/server/bare/ops/load-model.js +7 -5
- package/dist/server/bare/ops/transcribe.d.ts +2 -2
- package/dist/server/bare/ops/transcribe.js +20 -40
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +21 -12
- package/dist/server/bare/ops/unload-model.d.ts +1 -1
- package/dist/server/bare/ops/unload-model.js +5 -5
- package/dist/server/bare/plugins/asr-ggml/config.d.ts +32 -0
- package/dist/server/bare/plugins/asr-ggml/config.js +46 -0
- package/dist/server/bare/plugins/asr-ggml/logging.d.ts +11 -0
- package/dist/server/bare/plugins/asr-ggml/logging.js +12 -0
- package/dist/server/bare/plugins/audiogen-ggml/config.d.ts +18 -0
- package/dist/server/bare/plugins/audiogen-ggml/config.js +23 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.d.ts +3 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +162 -0
- package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +213 -0
- package/dist/server/bare/plugins/audiogen-ggml/plugin.js +58 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +8 -5
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +4 -4
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +1 -1
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +2 -2
- package/dist/server/bare/plugins/ggml-classification/plugin.js +1 -1
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +2 -2
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +4 -2
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +4 -25
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +6 -0
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +73 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +1 -1
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +8 -3
- package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
- package/dist/server/bare/plugins/index.d.ts +12 -11
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +3 -3
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +5 -5
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +11 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +16 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +3 -3
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +26 -35
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +3 -3
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +20 -10
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +217 -80
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +8 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +8 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +20 -8
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +16 -16
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +8 -3
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +5 -5
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +12 -2
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +3 -3
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +6 -6
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +13 -20
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +4 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +40 -5
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +155 -5
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +109 -23
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.d.ts +7 -0
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +30 -0
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +8 -5
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +16 -22
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +120 -5
- package/dist/server/bare/plugins/tts-ggml/plugin.js +63 -5
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +8 -6
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +17 -25
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +2 -2
- package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
- package/dist/server/bare/rag-hyperdb/index.js +11 -11
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +1 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +4 -4
- package/dist/server/bare/registry/config-registry.d.ts +1 -1
- package/dist/server/bare/registry/config-registry.js +1 -1
- package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-config-registry.js +4 -4
- package/dist/server/bare/registry/model-config-utils.d.ts +1 -1
- package/dist/server/bare/registry/model-config-utils.js +3 -0
- package/dist/server/bare/registry/model-registry.d.ts +15 -4
- package/dist/server/bare/registry/registry-client.js +2 -2
- package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
- package/dist/server/bare/resources/collector.d.ts +644 -0
- package/dist/server/bare/resources/collector.js +226 -0
- package/dist/server/bare/resources/native.d.ts +3 -0
- package/dist/server/bare/resources/native.js +35 -0
- package/dist/server/bare/resources/normalize.d.ts +13 -0
- package/dist/server/bare/resources/normalize.js +73 -0
- package/dist/server/bare/resources/types.d.ts +66 -0
- package/dist/server/bare/resources/types.js +1 -0
- package/dist/server/bare/resources/worker-collector.d.ts +5 -0
- package/dist/server/bare/resources/worker-collector.js +15 -0
- package/dist/server/bare/runtime/index.d.ts +7 -7
- package/dist/server/bare/runtime/index.js +3 -3
- package/dist/server/bare/runtime/request-context.d.ts +2 -2
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.js +11 -1
- package/dist/server/bare/runtime/request-registry.d.ts +2 -2
- package/dist/server/bare/runtime/request-registry.js +1 -1
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
- package/dist/server/bare/types/addon-responses.d.ts +8 -34
- package/dist/server/bare/utils/asr-events.d.ts +15 -0
- package/dist/server/bare/utils/asr-events.js +30 -0
- package/dist/server/bare/utils/audio-input.d.ts +1 -1
- package/dist/server/bare/utils/audio-input.js +1 -1
- package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
- package/dist/server/bare/utils/tts-stats.d.ts +9 -5
- package/dist/server/bare/utils/tts-stats.js +6 -0
- package/dist/server/error-handlers.d.ts +1 -1
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/registry.d.ts +1 -1
- package/dist/server/plugins/registry.js +35 -8
- package/dist/server/rpc/create-server.js +23 -1
- package/dist/server/rpc/delegate-transport.d.ts +2 -2
- package/dist/server/rpc/delegate-transport.js +5 -10
- package/dist/server/rpc/handle-request.js +3 -3
- package/dist/server/rpc/handler-registry.d.ts +1 -1
- package/dist/server/rpc/handler-registry.js +45 -36
- package/dist/server/rpc/handler-selection.d.ts +2 -2
- package/dist/server/rpc/handler-utils.d.ts +2 -2
- package/dist/server/rpc/handler-utils.js +5 -5
- package/dist/server/rpc/handlers/audio-gen-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/audio-gen-stream.js +4 -0
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +3 -1
- package/dist/server/rpc/handlers/batch-completion-stream.js +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.js +1 -1
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.js +3 -3
- package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/cancelHandler.js +3 -3
- package/dist/server/rpc/handlers/classify.d.ts +1 -1
- package/dist/server/rpc/handlers/classify.js +1 -1
- package/dist/server/rpc/handlers/completion-orchestrate.d.ts +42 -0
- package/dist/server/rpc/handlers/completion-orchestrate.js +190 -0
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.js +3 -3
- package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/completion-stream.js +1 -1
- package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
- package/dist/server/rpc/handlers/delete-cache.js +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.js +1 -1
- package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
- package/dist/server/rpc/handlers/download-asset.js +4 -4
- package/dist/server/rpc/handlers/embed.d.ts +1 -1
- package/dist/server/rpc/handlers/embed.js +1 -1
- package/dist/server/rpc/handlers/finetune.d.ts +1 -1
- package/dist/server/rpc/handlers/finetune.js +2 -2
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-loaded-model-info.js +10 -4
- package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +4 -4
- package/dist/server/rpc/handlers/get-system-resources.d.ts +3 -0
- package/dist/server/rpc/handlers/get-system-resources.js +53 -0
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/heartbeat-delegated.js +2 -2
- package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
- package/dist/server/rpc/handlers/index.d.ts +38 -32
- package/dist/server/rpc/handlers/index.js +6 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/download-manager.js +1 -1
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +12 -8
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +4 -4
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +5 -5
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +3 -3
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +4 -4
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +3 -3
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/registry.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/registry.js +6 -6
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/resolve-session.js +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/resolve.js +2 -2
- package/dist/server/rpc/handlers/load-model/types.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.js +3 -3
- package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/logging-stream.js +1 -1
- package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/ocr-stream.js +1 -1
- package/dist/server/rpc/handlers/plugin-dispatch.js +3 -3
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
- package/dist/server/rpc/handlers/plugin-invoke.js +3 -3
- package/dist/server/rpc/handlers/provideHandler/connection.js +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.js +1 -1
- package/dist/server/rpc/handlers/provideHandler/proxy.js +1 -1
- package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +4 -4
- package/dist/server/rpc/handlers/registry.d.ts +1 -1
- package/dist/server/rpc/handlers/registry.js +1 -1
- package/dist/server/rpc/handlers/resume.d.ts +1 -1
- package/dist/server/rpc/handlers/resume.js +1 -1
- package/dist/server/rpc/handlers/state.d.ts +1 -1
- package/dist/server/rpc/handlers/state.js +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.js +1 -1
- package/dist/server/rpc/handlers/suspend.d.ts +1 -1
- package/dist/server/rpc/handlers/suspend.js +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.js +1 -1
- package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech.js +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.js +1 -1
- package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe.js +1 -1
- package/dist/server/rpc/handlers/translate.d.ts +1 -1
- package/dist/server/rpc/handlers/translate.js +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.js +5 -5
- package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model.js +3 -3
- package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/upscale-stream.js +1 -1
- package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/video-stream.js +1 -1
- package/dist/server/rpc/index.d.ts +2 -2
- package/dist/server/rpc/method-shapes.d.ts +53 -0
- package/dist/server/rpc/method-shapes.js +50 -0
- package/dist/server/rpc/profiling/backend-diagnostics.d.ts +3 -0
- package/dist/server/rpc/profiling/backend-diagnostics.js +16 -0
- package/dist/server/rpc/profiling/context.d.ts +1 -1
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/index.d.ts +4 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
- package/dist/server/rpc/profiling/operation-metrics.js +29 -1
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +51 -13
- package/dist/server/rpc/profiling/profiler.d.ts +2 -2
- package/dist/server/rpc/transport-selector.d.ts +1 -1
- package/dist/server/utils/archive.js +1 -1
- package/dist/server/utils/audio/decoder.d.ts +1 -1
- package/dist/server/utils/audio/decoder.js +1 -1
- package/dist/server/utils/cache/auto-history.d.ts +1 -1
- package/dist/server/utils/cache/auto-history.js +13 -9
- package/dist/server/utils/cache/paths.d.ts +1 -1
- package/dist/server/utils/cache/paths.js +6 -6
- package/dist/server/utils/checksum.d.ts +1 -1
- package/dist/server/utils/completion-normalizer.d.ts +2 -1
- package/dist/server/utils/completion-normalizer.js +31 -1
- package/dist/server/utils/config-transform.d.ts +1 -1
- package/dist/server/utils/config-transform.js +5 -7
- package/dist/server/utils/index.d.ts +11 -11
- package/dist/server/utils/path-security.d.ts +1 -1
- package/dist/server/utils/qvac-paths.js +1 -1
- package/dist/server/utils/response-format.d.ts +1 -1
- package/dist/server/utils/shard-utils.d.ts +1 -1
- package/dist/server/utils/tool-integration.d.ts +1 -1
- package/dist/server/utils/tool-integration.js +2 -2
- package/dist/server/utils/tools/dialect.d.ts +1 -1
- package/dist/server/utils/tools/dialect.js +2 -0
- package/dist/server/utils/tools/index.d.ts +2 -2
- package/dist/server/utils/tools/parser.d.ts +1 -1
- package/dist/server/utils/tools/parser.js +16 -8
- package/dist/server/utils/tools/parsers/dsml.d.ts +4 -0
- package/dist/server/utils/tools/parsers/dsml.js +176 -0
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
- package/dist/server/utils/tools/parsers/gemma4native.js +1 -1
- package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
- package/dist/server/utils/tools/parsers/harmony.js +1 -1
- package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
- package/dist/server/utils/tools/parsers/hermes.js +1 -1
- package/dist/server/utils/tools/parsers/json.d.ts +2 -2
- package/dist/server/utils/tools/parsers/json.js +1 -1
- package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
- package/dist/server/utils/tools/parsers/pythonic.js +1 -1
- package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
- package/dist/server/utils/tools/parsers/qwen35.js +1 -1
- package/dist/server/utils/tools/shared.d.ts +1 -1
- package/dist/server/utils/worker-lock.js +1 -1
- package/dist/server/worker-core.js +14 -10
- package/dist/server/worker.js +4 -3
- package/dist/utils/aggregate-events.d.ts +2 -2
- package/dist/utils/aggregate-events.js +2 -2
- package/dist/utils/errors-client.d.ts +0 -3
- package/dist/utils/errors-client.js +0 -5
- package/dist/utils/errors-server.d.ts +1 -1
- package/dist/utils/mcp-adapter.d.ts +4 -4
- package/dist/utils/mcp-adapter.js +1 -1
- package/dist/utils/tool-helpers.d.ts +1 -1
- package/dist/utils/tool-helpers.js +1 -1
- package/docs/system-resources-support-matrix.md +103 -0
- package/package.json +37 -19
- /package/dist/examples/{transcription → asr}/parakeet-ctc-filesystem.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/parakeet-microphone-record.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/parakeet-microphone-stream.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/parakeet-sortformer-streaming.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/parakeet-sortformer.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/whispercpp-filesystem-streaming.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/whispercpp-filesystem.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/whispercpp-microphone-conversation.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/whispercpp-microphone-record.d.ts +0 -0
- /package/dist/examples/{transcription → asr}/whispercpp-prompt.d.ts +0 -0
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { normalizeModelType, ModelType } from '../../schemas/index.js';
|
|
2
|
+
import { buildParakeetReloadConfig, buildWhisperReloadConfig } from '../../server/bare/plugins/asr-ggml/config.js';
|
|
2
3
|
export function transformConfigForReload(modelType, config) {
|
|
3
4
|
const canonicalType = normalizeModelType(modelType);
|
|
4
5
|
switch (canonicalType) {
|
|
5
6
|
case ModelType.whispercppTranscription: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
whisperConfig: whisperParams,
|
|
11
|
-
...(miscConfig && { miscConfig })
|
|
12
|
-
};
|
|
7
|
+
return buildWhisperReloadConfig(config);
|
|
8
|
+
}
|
|
9
|
+
case ModelType.parakeetTranscription: {
|
|
10
|
+
return buildParakeetReloadConfig(config);
|
|
13
11
|
}
|
|
14
12
|
case ModelType.llamacppCompletion:
|
|
15
13
|
case ModelType.llamacppEmbedding:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './archive';
|
|
2
|
-
export * from './cache/types';
|
|
3
|
-
export * from './cache/auto-history';
|
|
4
|
-
export * from './cache/paths';
|
|
5
|
-
export * from './checksum';
|
|
6
|
-
export * from './config-transform';
|
|
7
|
-
export * from './expand-gguf-shards';
|
|
8
|
-
export * from './formatting';
|
|
9
|
-
export * from './gguf-tensor-extractor';
|
|
10
|
-
export * from './path-security';
|
|
11
|
-
export * from './shard-utils';
|
|
1
|
+
export * from './archive.js';
|
|
2
|
+
export * from './cache/types.js';
|
|
3
|
+
export * from './cache/auto-history.js';
|
|
4
|
+
export * from './cache/paths.js';
|
|
5
|
+
export * from './checksum.js';
|
|
6
|
+
export * from './config-transform.js';
|
|
7
|
+
export * from './expand-gguf-shards.js';
|
|
8
|
+
export * from './formatting.js';
|
|
9
|
+
export * from './gguf-tensor-extractor.js';
|
|
10
|
+
export * from './path-security.js';
|
|
11
|
+
export * from './shard-utils.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { sanitizePathComponent } from '../../utils/path-sanitize';
|
|
1
|
+
export { sanitizePathComponent } from '../../utils/path-sanitize.js';
|
|
2
2
|
/**
|
|
3
3
|
* Check whether a target path is contained within a base directory.
|
|
4
4
|
* Both paths are resolved to absolute before comparison.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResponseFormat } from '../../schemas/index';
|
|
1
|
+
import type { ResponseFormat } from '../../schemas/index.js';
|
|
2
2
|
export declare function getResponseFormatJsonSchema(responseFormat: ResponseFormat): string | undefined;
|
|
3
3
|
//# sourceMappingURL=response-format.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { detectToolDialectFromName } from '
|
|
2
|
-
import { getModelInfo } from '
|
|
1
|
+
import { detectToolDialectFromName } from '../../server/utils/tools/index.js';
|
|
2
|
+
import { getModelInfo } from '../../server/bare/registry/model-registry.js';
|
|
3
3
|
/**
|
|
4
4
|
* Static tools mode: prepend tools right after the system message (or at the
|
|
5
5
|
* very start when no system message is present). The tool block stays in the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ToolDialect } from '../../../schemas/index';
|
|
1
|
+
import type { ToolDialect } from '../../../schemas/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Detects the tool-call dialect from a model's registry name and file path.
|
|
4
4
|
* Defaults to "hermes" (its parser chain also covers unknown JSON-payload
|
|
@@ -12,6 +12,8 @@ export function detectToolDialectFromName(name, path) {
|
|
|
12
12
|
return 'gemma4';
|
|
13
13
|
if (/gpt[_-]?oss/.test(tag))
|
|
14
14
|
return 'harmony';
|
|
15
|
+
if (/deepseek[-_. ]?v(?:4|3[._-]?2)(?![0-9])/.test(tag))
|
|
16
|
+
return 'dsml';
|
|
15
17
|
if (/lfm[_-]?\d/.test(tag))
|
|
16
18
|
return 'pythonic';
|
|
17
19
|
return 'hermes';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { detectToolDialectFromName } from './dialect';
|
|
2
|
-
export { parseToolCalls } from './parser';
|
|
1
|
+
export { detectToolDialectFromName } from './dialect.js';
|
|
2
|
+
export { parseToolCalls } from './parser.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool, ToolCall, ToolCallError, ToolDialect } from '../../../schemas/index';
|
|
1
|
+
import type { Tool, ToolCall, ToolCallError, ToolDialect } from '../../../schemas/index.js';
|
|
2
2
|
export declare function parseToolCalls(text: string, tools: Tool[], dialect?: ToolDialect): {
|
|
3
3
|
toolCalls: ToolCall[];
|
|
4
4
|
errors: ToolCallError[];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { stripThinkingBlocks } from '
|
|
2
|
-
import { parseGemmaFormat, parseGenericFormat, parseLlamacppFormat } from '
|
|
3
|
-
import { parseHermesFormat } from '
|
|
4
|
-
import { parsePythonicFormat } from '
|
|
5
|
-
import { parseHarmonyFormat } from '
|
|
6
|
-
import { parseQwen35Format } from '
|
|
7
|
-
import { parseGemma4NativeFormat } from '
|
|
1
|
+
import { stripThinkingBlocks } from '../../../server/utils/tools/shared.js';
|
|
2
|
+
import { parseGemmaFormat, parseGenericFormat, parseLlamacppFormat } from '../../../server/utils/tools/parsers/json.js';
|
|
3
|
+
import { parseHermesFormat } from '../../../server/utils/tools/parsers/hermes.js';
|
|
4
|
+
import { parsePythonicFormat } from '../../../server/utils/tools/parsers/pythonic.js';
|
|
5
|
+
import { parseHarmonyFormat } from '../../../server/utils/tools/parsers/harmony.js';
|
|
6
|
+
import { parseQwen35Format } from '../../../server/utils/tools/parsers/qwen35.js';
|
|
7
|
+
import { parseGemma4NativeFormat } from '../../../server/utils/tools/parsers/gemma4native.js';
|
|
8
|
+
import { parseDsmlFormat } from '../../../server/utils/tools/parsers/dsml.js';
|
|
8
9
|
function pickFormatParsers(dialect) {
|
|
9
10
|
switch (dialect) {
|
|
10
11
|
case 'pythonic':
|
|
@@ -25,8 +26,14 @@ function pickFormatParsers(dialect) {
|
|
|
25
26
|
// No JSON fallback: Gemma4 emits only its native channel-thought dialect
|
|
26
27
|
// and never falls back to JSON-envelope formats.
|
|
27
28
|
return [parseGemma4NativeFormat];
|
|
29
|
+
case 'dsml':
|
|
30
|
+
// Hermes fallback: DeepSeek templates fall back to OpenAI-style JSON when
|
|
31
|
+
// the DSML block fails to materialise.
|
|
32
|
+
return [parseDsmlFormat, parseHermesFormat, parseLlamacppFormat];
|
|
28
33
|
default:
|
|
29
|
-
//
|
|
34
|
+
// DSML first: the `<|DSML|` token is unique to DeepSeek and can't
|
|
35
|
+
// false-match another dialect.
|
|
36
|
+
// Gemma4 next: `<|tool_call>` is uniquely distinctive and can't
|
|
30
37
|
// false-match other dialects.
|
|
31
38
|
// Harmony next: `to=functions.` is also uniquely Harmony.
|
|
32
39
|
// Qwen35 before Hermes: defers to Hermes when JSON is inside <tool_call>,
|
|
@@ -34,6 +41,7 @@ function pickFormatParsers(dialect) {
|
|
|
34
41
|
// Pythonic last: its bare `[name(...)]` form can match payloads that
|
|
35
42
|
// look like other dialects.
|
|
36
43
|
return [
|
|
44
|
+
parseDsmlFormat,
|
|
37
45
|
parseGemma4NativeFormat,
|
|
38
46
|
parseHarmonyFormat,
|
|
39
47
|
parseQwen35Format,
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { generateStableToolCallId, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
|
+
// DeepSeek marks DSML tags with a fullwidth vertical line (U+FF5C `|`), not
|
|
3
|
+
// the ASCII pipe used by the visually similar `<|...|>` markers of the harmony
|
|
4
|
+
// and gemma4 dialects — the two must not be conflated. V4 wraps calls in
|
|
5
|
+
// `tool_calls`; V3.2 used `function_calls`. Both carry the same invoke/
|
|
6
|
+
// parameter grammar, so only the wrapper name differs.
|
|
7
|
+
const OPENER_REGEX = /<|DSML|(?:tool_calls|function_calls|invoke)/;
|
|
8
|
+
const INVOKE_OPEN_REGEX = /<|DSML|invoke([ \t\r\n][^>]*)?>/g;
|
|
9
|
+
const INVOKE_CLOSE_TAG = '</|DSML|invoke>';
|
|
10
|
+
const PARAMETER_REGEX = /<|DSML|parameter([ \t\r\n][^>]*)?>([\s\S]*?)<\/|DSML|parameter>/g;
|
|
11
|
+
const NAME_ATTR_REGEX = /(?:^|\s)name="([^"]*)"/;
|
|
12
|
+
const STRING_ATTR_REGEX = /(?:^|\s)string="(true|false)"/i;
|
|
13
|
+
const FALLBACK_DIALECT_REGEX = /<tool_call>|"name"\s*:/;
|
|
14
|
+
function coerceBySchemaType(value, type) {
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'number': {
|
|
17
|
+
const n = Number(value);
|
|
18
|
+
if (value.length === 0 || Number.isNaN(n))
|
|
19
|
+
throw new Error(`invalid number value: "${value}"`);
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
case 'integer': {
|
|
23
|
+
const n = Number(value);
|
|
24
|
+
if (value.length === 0 || Number.isNaN(n) || !Number.isInteger(n))
|
|
25
|
+
throw new Error(`invalid integer value: "${value}"`);
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
case 'boolean': {
|
|
29
|
+
const v = value.toLowerCase();
|
|
30
|
+
if (v === 'true')
|
|
31
|
+
return true;
|
|
32
|
+
if (v === 'false')
|
|
33
|
+
return false;
|
|
34
|
+
throw new Error(`invalid boolean value: "${value}"`);
|
|
35
|
+
}
|
|
36
|
+
case 'array':
|
|
37
|
+
case 'object':
|
|
38
|
+
return JSON.parse(value);
|
|
39
|
+
default:
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function coerceParamValue(raw, isString, type) {
|
|
44
|
+
const trimmed = raw.trim();
|
|
45
|
+
if (isString === undefined)
|
|
46
|
+
return coerceBySchemaType(trimmed, type);
|
|
47
|
+
if (isString === 'true')
|
|
48
|
+
return trimmed;
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(trimmed);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
throw new Error(`invalid JSON for string="false" parameter: ${err instanceof Error ? err.message : String(err)}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function collectInvokes(text) {
|
|
57
|
+
const openers = Array.from(text.matchAll(INVOKE_OPEN_REGEX));
|
|
58
|
+
return openers.map((opener, i) => {
|
|
59
|
+
const start = opener.index;
|
|
60
|
+
const bodyStart = start + opener[0].length;
|
|
61
|
+
const limit = openers[i + 1]?.index ?? text.length;
|
|
62
|
+
const rel = text.slice(bodyStart, limit).indexOf(INVOKE_CLOSE_TAG);
|
|
63
|
+
const closed = rel !== -1;
|
|
64
|
+
const closeAt = bodyStart + rel;
|
|
65
|
+
const end = closed ? closeAt + INVOKE_CLOSE_TAG.length : limit;
|
|
66
|
+
return {
|
|
67
|
+
attrs: opener[1] ?? '',
|
|
68
|
+
body: closed ? text.slice(bodyStart, closeAt) : '',
|
|
69
|
+
closed,
|
|
70
|
+
start,
|
|
71
|
+
consumedEnd: closed ? end : bodyStart,
|
|
72
|
+
raw: text.slice(start, end).trim()
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function textOutsideInvokes(text, invokes) {
|
|
77
|
+
const parts = [];
|
|
78
|
+
let cursor = 0;
|
|
79
|
+
for (const invoke of invokes) {
|
|
80
|
+
parts.push(text.slice(cursor, invoke.start));
|
|
81
|
+
cursor = invoke.consumedEnd;
|
|
82
|
+
}
|
|
83
|
+
parts.push(text.slice(cursor));
|
|
84
|
+
return parts.join('\n');
|
|
85
|
+
}
|
|
86
|
+
// Parses DeepSeek's DSML tool-call dialect (V3.2 / V4):
|
|
87
|
+
// <|DSML|tool_calls>
|
|
88
|
+
// <|DSML|invoke name="NAME">
|
|
89
|
+
// <|DSML|parameter name="KEY" string="true">VALUE</|DSML|parameter>
|
|
90
|
+
// </|DSML|invoke>
|
|
91
|
+
// </|DSML|tool_calls>
|
|
92
|
+
export function parseDsmlFormat(text, tools) {
|
|
93
|
+
const toolCalls = [];
|
|
94
|
+
const errors = [];
|
|
95
|
+
if (!OPENER_REGEX.test(text)) {
|
|
96
|
+
return { matched: false, toolCalls, errors };
|
|
97
|
+
}
|
|
98
|
+
// Invokes are collected from the whole text rather than per block: a block
|
|
99
|
+
// cut off before its close tag still carries complete invokes, and a single
|
|
100
|
+
// pass recovers them without re-counting the ones inside closed blocks.
|
|
101
|
+
const invokes = collectInvokes(text);
|
|
102
|
+
if (invokes.length === 0) {
|
|
103
|
+
if (FALLBACK_DIALECT_REGEX.test(text)) {
|
|
104
|
+
return { matched: false, toolCalls, errors };
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
matched: true,
|
|
108
|
+
toolCalls,
|
|
109
|
+
errors: [
|
|
110
|
+
{
|
|
111
|
+
code: 'PARSE_ERROR',
|
|
112
|
+
message: 'DSML tool call block contains no <|DSML|invoke name="NAME"> element',
|
|
113
|
+
raw: text.trim()
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
for (const invoke of invokes) {
|
|
119
|
+
const raw = invoke.raw;
|
|
120
|
+
if (!invoke.closed) {
|
|
121
|
+
errors.push({
|
|
122
|
+
code: 'PARSE_ERROR',
|
|
123
|
+
message: `DSML invoke is missing its ${INVOKE_CLOSE_TAG} close tag`,
|
|
124
|
+
raw
|
|
125
|
+
});
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const name = NAME_ATTR_REGEX.exec(invoke.attrs)?.[1]?.trim();
|
|
129
|
+
if (!name) {
|
|
130
|
+
errors.push({
|
|
131
|
+
code: 'PARSE_ERROR',
|
|
132
|
+
message: 'DSML invoke is missing a name attribute',
|
|
133
|
+
raw
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const properties = tools.find((t) => t.name === name)?.parameters?.properties ?? {};
|
|
138
|
+
const args = {};
|
|
139
|
+
let parseError;
|
|
140
|
+
for (const param of invoke.body.matchAll(PARAMETER_REGEX)) {
|
|
141
|
+
const attrs = param[1] ?? '';
|
|
142
|
+
const key = NAME_ATTR_REGEX.exec(attrs)?.[1]?.trim();
|
|
143
|
+
if (!key) {
|
|
144
|
+
parseError = 'DSML parameter is missing a name attribute';
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
const isString = STRING_ATTR_REGEX.exec(attrs)?.[1]?.toLowerCase();
|
|
148
|
+
try {
|
|
149
|
+
args[key] = coerceParamValue(param[2], isString, properties[key]?.type);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
parseError = `${key}: ${err instanceof Error ? err.message : String(err)}`;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (parseError !== undefined) {
|
|
157
|
+
errors.push({ code: 'PARSE_ERROR', message: parseError, raw });
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const validation = validateToolArguments(name, args, tools);
|
|
161
|
+
if (!validation.isValid && validation.error) {
|
|
162
|
+
errors.push({ ...validation.error, raw });
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
toolCalls.push({
|
|
166
|
+
id: generateStableToolCallId(name, args),
|
|
167
|
+
name,
|
|
168
|
+
arguments: args,
|
|
169
|
+
raw
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (toolCalls.length === 0 && FALLBACK_DIALECT_REGEX.test(textOutsideInvokes(text, invokes))) {
|
|
173
|
+
return { matched: false, toolCalls: [], errors: [] };
|
|
174
|
+
}
|
|
175
|
+
return { matched: true, toolCalls, errors };
|
|
176
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parseGemma4NativeFormat(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
//# sourceMappingURL=gemma4native.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
// Transliterates Gemma 4's JS-literal argument body to valid JSON so it can
|
|
3
3
|
// be parsed with JSON.parse. The body uses:
|
|
4
4
|
// - <|"|>...<|"|> instead of "..." for string values
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parseHarmonyFormat(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
//# sourceMappingURL=harmony.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
const HARMONY_FRAME_RE = /to=functions\.([\w-]+)\s+<\|constrain\|>json<\|message\|>([\s\S]*?)(?=<\|call\|>|$)/g;
|
|
3
3
|
export function parseHarmonyFormat(text, tools) {
|
|
4
4
|
const toolCalls = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parseHermesFormat(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
//# sourceMappingURL=hermes.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, isValidToolCall, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, isValidToolCall, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
// Qwen3.5/3.6 can fuse its two tool templates into one frame, embedding the
|
|
3
3
|
// XML `<function=NAME>` token as a bare string key inside the JSON envelope:
|
|
4
4
|
// {"function=NAME","arguments":{...}} (invalid JSON, not parseable as-is)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parseGemmaFormat(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
export declare function parseLlamacppFormat(text: string, tools: Tool[]): ParserResult;
|
|
5
5
|
export declare function parseGenericFormat(text: string, tools: Tool[]): ParserResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, isValidToolCall, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, isValidToolCall, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
export function parseGemmaFormat(text, tools) {
|
|
3
3
|
const toolCalls = [];
|
|
4
4
|
const errors = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parsePythonicFormat(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
//# sourceMappingURL=pythonic.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
// Pythonic `[name(k=v), ...]` arrays. LFM 2.x is auto-routed; Llama-style
|
|
3
3
|
// tokens are kept for callers that opt in via `completion({ toolDialect:
|
|
4
4
|
// "pythonic" })` for a model known to emit Pythonic. Pure string parsing —
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '../../../../schemas/index';
|
|
2
|
-
import { type ParserResult } from '
|
|
1
|
+
import type { Tool } from '../../../../schemas/index.js';
|
|
2
|
+
import { type ParserResult } from '../../../../server/utils/tools/shared.js';
|
|
3
3
|
export declare function parseQwen35Format(text: string, tools: Tool[]): ParserResult;
|
|
4
4
|
//# sourceMappingURL=qwen35.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateStableToolCallId, validateToolArguments } from '
|
|
1
|
+
import { generateStableToolCallId, validateToolArguments } from '../../../../server/utils/tools/shared.js';
|
|
2
2
|
// Coerce raw parameter text to the type declared in the tool's JSON schema.
|
|
3
3
|
// String values are raw (not JSON-quoted); arrays/objects are valid JSON.
|
|
4
4
|
function coerceParamValue(raw, schema) {
|
|
@@ -2,7 +2,7 @@ import fs from 'bare-fs';
|
|
|
2
2
|
import path from 'bare-path';
|
|
3
3
|
import os from 'bare-os';
|
|
4
4
|
import { getServerLogger } from '../../logging/index.js';
|
|
5
|
-
import { getQvacPath } from '
|
|
5
|
+
import { getQvacPath } from '../../server/utils/qvac-paths.js';
|
|
6
6
|
const logger = getServerLogger();
|
|
7
7
|
const LOCK_FILENAME = '.worker.lock';
|
|
8
8
|
function getLockFilePath() {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import os from 'bare-os';
|
|
2
2
|
import Signal from 'bare-signals';
|
|
3
|
-
import { createBareKitRPCServer, createIPCClient } from '
|
|
4
|
-
import { destroySwarm } from '
|
|
5
|
-
import { initEnv, getValidatedEnv } from '
|
|
6
|
-
import { closeAllRagInstances } from '
|
|
7
|
-
import { cleanupDownloads } from '
|
|
8
|
-
import { unloadAllModels } from '
|
|
9
|
-
import { closeRegistryClient } from '
|
|
10
|
-
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '
|
|
3
|
+
import { createBareKitRPCServer, createIPCClient } from '../server/rpc/create-server.js';
|
|
4
|
+
import { destroySwarm } from '../server/bare/hyperswarm.js';
|
|
5
|
+
import { initEnv, getValidatedEnv } from '../server/env.js';
|
|
6
|
+
import { closeAllRagInstances } from '../server/bare/rag-hyperdb/index.js';
|
|
7
|
+
import { cleanupDownloads } from '../server/rpc/handlers/load-model/download-manager.js';
|
|
8
|
+
import { unloadAllModels } from '../server/bare/registry/model-registry.js';
|
|
9
|
+
import { closeRegistryClient } from '../server/bare/registry/registry-client.js';
|
|
10
|
+
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '../server/bare/registry/logging-stream-registry.js';
|
|
11
11
|
import { clearAllAddonLoggers, getServerLogger, SDK_LOG_ID, SDK_ALL_LOG_ID } from '../logging/index.js';
|
|
12
|
-
import { clearPlugins } from '
|
|
13
|
-
import { acquireWorkerLock, releaseWorkerLock } from '
|
|
12
|
+
import { clearPlugins } from '../server/plugins/index.js';
|
|
13
|
+
import { acquireWorkerLock, releaseWorkerLock } from '../server/utils/worker-lock.js';
|
|
14
|
+
import { nativeResourceCollectorDependencies } from '../server/bare/resources/native.js';
|
|
15
|
+
import { destroyWorkerResourceCollector, initializeWorkerResourceCollector } from '../server/bare/resources/worker-collector.js';
|
|
14
16
|
let coreInitialized = false;
|
|
15
17
|
let rpcInitialized = false;
|
|
16
18
|
// Set true when the cleanup body has run at least once. Lets both
|
|
@@ -57,6 +59,7 @@ export function initializeWorkerCore() {
|
|
|
57
59
|
startLogBuffering(SDK_ALL_LOG_ID);
|
|
58
60
|
const { hasRPCConfig } = initEnv();
|
|
59
61
|
acquireWorkerLock();
|
|
62
|
+
initializeWorkerResourceCollector(nativeResourceCollectorDependencies);
|
|
60
63
|
setupShutdownHandlers();
|
|
61
64
|
coreInitialized = true;
|
|
62
65
|
logger.debug('Worker core initialized');
|
|
@@ -122,6 +125,7 @@ async function runCleanup() {
|
|
|
122
125
|
if (cleanupRan)
|
|
123
126
|
return;
|
|
124
127
|
cleanupRan = true;
|
|
128
|
+
destroyWorkerResourceCollector();
|
|
125
129
|
clearRegistries();
|
|
126
130
|
await Promise.allSettled([
|
|
127
131
|
destroySwarm(),
|
package/dist/server/worker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Default worker entry point that registers ALL built-in plugins.
|
|
3
3
|
*/
|
|
4
|
-
import { initializeWorkerCore, ensureRPCSetup } from '
|
|
5
|
-
import { registerPlugins } from '
|
|
4
|
+
import { initializeWorkerCore, ensureRPCSetup } from '../server/worker-core.js';
|
|
5
|
+
import { registerPlugins } from '../server/plugins/index.js';
|
|
6
6
|
import { getServerLogger } from '../logging/index.js';
|
|
7
|
-
import { llmPlugin, embeddingsPlugin, whisperPlugin, bciPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, vlaPlugin, classificationPlugin } from '
|
|
7
|
+
import { llmPlugin, embeddingsPlugin, whisperPlugin, bciPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, audioGenPlugin, vlaPlugin, classificationPlugin } from '../server/bare/plugins/index.js';
|
|
8
8
|
const { hasRPCConfig } = initializeWorkerCore();
|
|
9
9
|
const logger = getServerLogger();
|
|
10
10
|
logger.info('🐻 Hello from Bare');
|
|
@@ -18,6 +18,7 @@ registerPlugins([
|
|
|
18
18
|
ttsPlugin,
|
|
19
19
|
ocrPlugin,
|
|
20
20
|
diffusionPlugin,
|
|
21
|
+
audioGenPlugin,
|
|
21
22
|
vlaPlugin,
|
|
22
23
|
classificationPlugin
|
|
23
24
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall } from '../schemas/index';
|
|
2
|
-
import { type ToolHandlerMap } from '
|
|
1
|
+
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall } from '../schemas/index.js';
|
|
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 = '';
|
|
@@ -124,9 +124,6 @@ export declare class TranscriptionFailedError extends QvacErrorBase {
|
|
|
124
124
|
export declare class TextToSpeechStreamFailedError extends QvacErrorBase {
|
|
125
125
|
constructor(details?: string, cause?: unknown);
|
|
126
126
|
}
|
|
127
|
-
export declare class TranslationFailedError extends QvacErrorBase {
|
|
128
|
-
constructor(details?: string, cause?: unknown);
|
|
129
|
-
}
|
|
130
127
|
export declare class CancelFailedError extends QvacErrorBase {
|
|
131
128
|
constructor(details?: string, cause?: unknown);
|
|
132
129
|
}
|
|
@@ -219,11 +219,6 @@ export class TextToSpeechStreamFailedError extends QvacErrorBase {
|
|
|
219
219
|
super(createErrorOptions(SDK_SERVER_ERROR_CODES.TEXT_TO_SPEECH_STREAM_FAILED, details ? [details] : undefined, cause));
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
export class TranslationFailedError extends QvacErrorBase {
|
|
223
|
-
constructor(details, cause) {
|
|
224
|
-
super(createErrorOptions(SDK_SERVER_ERROR_CODES.TRANSLATION_FAILED, details ? [details] : undefined, cause));
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
222
|
export class CancelFailedError extends QvacErrorBase {
|
|
228
223
|
constructor(details, cause) {
|
|
229
224
|
super(createErrorOptions(SDK_SERVER_ERROR_CODES.CANCEL_FAILED, details ? [details] : undefined, cause));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QvacErrorBase } from '@qvac/error';
|
|
2
|
-
import type { CompletionStats, ToolCallWithCall } from '../schemas/index';
|
|
2
|
+
import type { CompletionStats, ToolCallWithCall } from '../schemas/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Partial completion payload attached to `InferenceCancelledError` when a
|
|
5
5
|
* cancel hits mid-stream. Mirrors the named fields on `CompletionFinal`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Tool } from '../schemas/tools';
|
|
2
|
-
import type { McpClientInput } from '../schemas/mcp-adapter';
|
|
3
|
-
import type { ToolHandler } from '
|
|
4
|
-
export type { McpClient, McpClientInput } from '../schemas/mcp-adapter';
|
|
1
|
+
import type { Tool } from '../schemas/tools.js';
|
|
2
|
+
import type { McpClientInput } from '../schemas/mcp-adapter.js';
|
|
3
|
+
import type { ToolHandler } from '../utils/tool-helpers.js';
|
|
4
|
+
export type { McpClient, McpClientInput } from '../schemas/mcp-adapter.js';
|
|
5
5
|
export type ToolHandlerMap = Map<string, ToolHandler>;
|
|
6
6
|
export type McpToolsResult = {
|
|
7
7
|
tools: Tool[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mapValues } from '
|
|
1
|
+
import { mapValues } from '../utils/object.js';
|
|
2
2
|
const VALID_TYPES = ['string', 'number', 'integer', 'boolean', 'object', 'array'];
|
|
3
3
|
function isValidType(value) {
|
|
4
4
|
return typeof value === 'string' && VALID_TYPES.includes(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import { type Tool, type ToolCall, type ToolCallWithCall } from '../schemas/tools';
|
|
2
|
+
import { type Tool, type ToolCall, type ToolCallWithCall } from '../schemas/tools.js';
|
|
3
3
|
type ZodObjectType = z.ZodObject<z.ZodRawShape>;
|
|
4
4
|
export type ToolHandler = (args: Record<string, unknown>) => Promise<unknown>;
|
|
5
5
|
export type ToolInput<T extends ZodObjectType = ZodObjectType> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toolSchema } from '../schemas/tools.js';
|
|
2
|
-
import { InvalidToolsArrayError, InvalidToolSchemaError } from '
|
|
2
|
+
import { InvalidToolsArrayError, InvalidToolSchemaError } from '../utils/errors-client.js';
|
|
3
3
|
function zodTypeToJsonSchemaType(type) {
|
|
4
4
|
switch (type) {
|
|
5
5
|
case 'string':
|