@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,6 +1,6 @@
|
|
|
1
|
-
import { unloadModel } from '
|
|
2
|
-
import { getRegistryStats } from '
|
|
3
|
-
import { hasActiveProviders } from '
|
|
1
|
+
import { unloadModel } from '../../../server/bare/ops/unload-model.js';
|
|
2
|
+
import { getRegistryStats } from '../../../server/bare/registry/model-registry.js';
|
|
3
|
+
import { hasActiveProviders } from '../../../server/bare/hyperswarm.js';
|
|
4
4
|
import { getServerLogger } from '../../../logging/index.js';
|
|
5
5
|
const logger = getServerLogger();
|
|
6
6
|
export async function handleUnloadModel(request) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { UpscaleStreamRequest, UpscaleStreamResponse } from '../../../schemas/sdcpp-config';
|
|
1
|
+
import type { UpscaleStreamRequest, UpscaleStreamResponse } from '../../../schemas/sdcpp-config.js';
|
|
2
2
|
export declare function handleUpscaleStream(request: UpscaleStreamRequest): AsyncGenerator<UpscaleStreamResponse>;
|
|
3
3
|
//# sourceMappingURL=upscale-stream.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchPluginStream } from '
|
|
1
|
+
import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
|
|
2
2
|
export async function* handleUpscaleStream(request) {
|
|
3
3
|
yield* dispatchPluginStream(request.modelId, 'upscaleStream', request);
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { VideoStreamRequest, VideoStreamResponse } from '../../../schemas/sdcpp-config';
|
|
1
|
+
import type { VideoStreamRequest, VideoStreamResponse } from '../../../schemas/sdcpp-config.js';
|
|
2
2
|
export declare function handleVideoStream(request: VideoStreamRequest): AsyncGenerator<VideoStreamResponse>;
|
|
3
3
|
//# sourceMappingURL=video-stream.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchPluginStream } from '
|
|
1
|
+
import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
|
|
2
2
|
export async function* handleVideoStream(request) {
|
|
3
3
|
yield* dispatchPluginStream(request.modelId, 'videoStream', request);
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createBareKitRPCServer, createIPCClient } from './create-server';
|
|
2
|
-
export { handleRequest } from './handle-request';
|
|
1
|
+
export { createBareKitRPCServer, createIPCClient } from './create-server.js';
|
|
2
|
+
export { handleRequest } from './handle-request.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call shape of every RPC method, keyed by the request `type` literal.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay free of handler imports: the contract export
|
|
5
|
+
* (`scripts/export-contract.ts`) loads it under Node, where the handler
|
|
6
|
+
* graph's native bare-* modules cannot be required. `handler-registry.ts`
|
|
7
|
+
* is type-bound to this map, so a registry entry whose key or `type`
|
|
8
|
+
* diverges from it fails to compile.
|
|
9
|
+
*/
|
|
10
|
+
export declare const methodShapes: {
|
|
11
|
+
readonly audioGenStream: "stream";
|
|
12
|
+
readonly batchCompletionStream: "stream";
|
|
13
|
+
readonly bciTranscribe: "stream";
|
|
14
|
+
readonly bciTranscribeStream: "duplex";
|
|
15
|
+
readonly cancel: "reply";
|
|
16
|
+
readonly classify: "stream";
|
|
17
|
+
readonly completionOrchestrate: "duplex";
|
|
18
|
+
readonly completionStream: "stream";
|
|
19
|
+
readonly deleteCache: "reply";
|
|
20
|
+
readonly diffusionStream: "stream";
|
|
21
|
+
readonly downloadAsset: "reply";
|
|
22
|
+
readonly embed: "reply";
|
|
23
|
+
readonly finetune: "reply";
|
|
24
|
+
readonly getLoadedModelInfo: "reply";
|
|
25
|
+
readonly getModelInfo: "reply";
|
|
26
|
+
readonly getSystemResources: "reply";
|
|
27
|
+
readonly heartbeat: "reply";
|
|
28
|
+
readonly loadModel: "reply";
|
|
29
|
+
readonly loggingStream: "stream";
|
|
30
|
+
readonly modelRegistryGetModel: "reply";
|
|
31
|
+
readonly modelRegistryList: "reply";
|
|
32
|
+
readonly modelRegistrySearch: "reply";
|
|
33
|
+
readonly ocrStream: "stream";
|
|
34
|
+
readonly pluginInvoke: "reply";
|
|
35
|
+
readonly pluginInvokeStream: "stream";
|
|
36
|
+
readonly provide: "reply";
|
|
37
|
+
readonly rag: "reply";
|
|
38
|
+
readonly resume: "reply";
|
|
39
|
+
readonly state: "reply";
|
|
40
|
+
readonly stopProvide: "reply";
|
|
41
|
+
readonly suspend: "reply";
|
|
42
|
+
readonly textToSpeech: "stream";
|
|
43
|
+
readonly textToSpeechStream: "duplex";
|
|
44
|
+
readonly transcribe: "stream";
|
|
45
|
+
readonly transcribeStream: "duplex";
|
|
46
|
+
readonly translate: "stream";
|
|
47
|
+
readonly unloadModel: "reply";
|
|
48
|
+
readonly upscaleStream: "stream";
|
|
49
|
+
readonly videoStream: "stream";
|
|
50
|
+
};
|
|
51
|
+
export type MethodName = keyof typeof methodShapes;
|
|
52
|
+
export type MethodCallShape = (typeof methodShapes)[MethodName];
|
|
53
|
+
//# sourceMappingURL=method-shapes.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call shape of every RPC method, keyed by the request `type` literal.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay free of handler imports: the contract export
|
|
5
|
+
* (`scripts/export-contract.ts`) loads it under Node, where the handler
|
|
6
|
+
* graph's native bare-* modules cannot be required. `handler-registry.ts`
|
|
7
|
+
* is type-bound to this map, so a registry entry whose key or `type`
|
|
8
|
+
* diverges from it fails to compile.
|
|
9
|
+
*/
|
|
10
|
+
export const methodShapes = {
|
|
11
|
+
audioGenStream: 'stream',
|
|
12
|
+
batchCompletionStream: 'stream',
|
|
13
|
+
bciTranscribe: 'stream',
|
|
14
|
+
bciTranscribeStream: 'duplex',
|
|
15
|
+
cancel: 'reply',
|
|
16
|
+
classify: 'stream',
|
|
17
|
+
completionOrchestrate: 'duplex',
|
|
18
|
+
completionStream: 'stream',
|
|
19
|
+
deleteCache: 'reply',
|
|
20
|
+
diffusionStream: 'stream',
|
|
21
|
+
downloadAsset: 'reply',
|
|
22
|
+
embed: 'reply',
|
|
23
|
+
finetune: 'reply',
|
|
24
|
+
getLoadedModelInfo: 'reply',
|
|
25
|
+
getModelInfo: 'reply',
|
|
26
|
+
getSystemResources: 'reply',
|
|
27
|
+
heartbeat: 'reply',
|
|
28
|
+
loadModel: 'reply',
|
|
29
|
+
loggingStream: 'stream',
|
|
30
|
+
modelRegistryGetModel: 'reply',
|
|
31
|
+
modelRegistryList: 'reply',
|
|
32
|
+
modelRegistrySearch: 'reply',
|
|
33
|
+
ocrStream: 'stream',
|
|
34
|
+
pluginInvoke: 'reply',
|
|
35
|
+
pluginInvokeStream: 'stream',
|
|
36
|
+
provide: 'reply',
|
|
37
|
+
rag: 'reply',
|
|
38
|
+
resume: 'reply',
|
|
39
|
+
state: 'reply',
|
|
40
|
+
stopProvide: 'reply',
|
|
41
|
+
suspend: 'reply',
|
|
42
|
+
textToSpeech: 'stream',
|
|
43
|
+
textToSpeechStream: 'duplex',
|
|
44
|
+
transcribe: 'stream',
|
|
45
|
+
transcribeStream: 'duplex',
|
|
46
|
+
translate: 'stream',
|
|
47
|
+
unloadModel: 'reply',
|
|
48
|
+
upscaleStream: 'stream',
|
|
49
|
+
videoStream: 'stream'
|
|
50
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getServerLogger } from '../../../logging/index.js';
|
|
2
|
+
import { BACKEND_DIAGNOSTICS_KEY, inferenceBackendDiagnosticsSchema } from '../../../schemas/index.js';
|
|
3
|
+
const logger = getServerLogger();
|
|
4
|
+
export function readBackendDiagnostics(target) {
|
|
5
|
+
if (!target || typeof target !== 'object')
|
|
6
|
+
return undefined;
|
|
7
|
+
const diagnostics = target[BACKEND_DIAGNOSTICS_KEY];
|
|
8
|
+
if (diagnostics === undefined)
|
|
9
|
+
return undefined;
|
|
10
|
+
const result = inferenceBackendDiagnosticsSchema.safeParse(diagnostics);
|
|
11
|
+
if (!result.success) {
|
|
12
|
+
logger.debug('Ignoring invalid backend diagnostics', result.error);
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return result.data;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProfilingRequestMeta, type DelegationBreakdown, type OperationEvent } from '../../../schemas/index';
|
|
1
|
+
import { type ProfilingRequestMeta, type DelegationBreakdown, type OperationEvent } from '../../../schemas/index.js';
|
|
2
2
|
export interface ServerProfilingContext {
|
|
3
3
|
meta: ProfilingRequestMeta;
|
|
4
4
|
requestStart: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type BaseTimings } from '../../../profiling/index';
|
|
2
|
-
import type { ProfilingRequestMeta, ProfilingResponseMeta, DelegationBreakdown } from '../../../schemas/index';
|
|
1
|
+
import { type BaseTimings } from '../../../profiling/index.js';
|
|
2
|
+
import type { ProfilingRequestMeta, ProfilingResponseMeta, DelegationBreakdown } from '../../../schemas/index.js';
|
|
3
3
|
export interface DelegatedHandlerOptions {
|
|
4
4
|
profilingMeta?: ProfilingRequestMeta;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createServerProfiler, type ServerProfiler } from './profiler';
|
|
2
|
-
export { profileReplyHandler, profileStreamHandler } from './operation-wrappers';
|
|
3
|
-
export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from './operation-metrics';
|
|
4
|
-
export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, type DelegationTimings, type DelegationStreamTimings, type DelegatedHandlerOptions } from './delegation-profiler';
|
|
1
|
+
export { createServerProfiler, type ServerProfiler } from './profiler.js';
|
|
2
|
+
export { profileReplyHandler, profileStreamHandler } from './operation-wrappers.js';
|
|
3
|
+
export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from './operation-metrics.js';
|
|
4
|
+
export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, type DelegationTimings, type DelegationStreamTimings, type DelegatedHandlerOptions } from './delegation-profiler.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Declarative extraction of operation-level metrics from request/response data.
|
|
3
3
|
* Used by operation wrappers to capture handler-specific profiling events.
|
|
4
4
|
*/
|
|
5
|
-
import type { ProfilingEvent, ProfilingEventKind } from '../../../profiling/types';
|
|
6
|
-
import type { DownloadStats } from '
|
|
5
|
+
import type { ProfilingEvent, ProfilingEventKind } from '../../../profiling/types.js';
|
|
6
|
+
import type { DownloadStats } from '../../../server/rpc/handlers/load-model/types.js';
|
|
7
7
|
export type MetricExtractor<T> = (data: T) => Record<string, number> | undefined;
|
|
8
8
|
export type TagExtractor<T> = (data: T) => Record<string, string> | undefined;
|
|
9
9
|
export interface OperationMetricsConfig<TRequest = unknown, TResponse = unknown> {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import {} from '../../../schemas/index.js';
|
|
6
6
|
import { readModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
7
|
+
import { readBackendDiagnostics } from './backend-diagnostics.js';
|
|
7
8
|
const metricsRegistry = new Map();
|
|
8
9
|
function extractDownloadStatsGauges(stats, gauges) {
|
|
9
10
|
if (stats?.downloadTimeMs !== undefined) {
|
|
@@ -21,14 +22,18 @@ export function registerOperationMetrics(config) {
|
|
|
21
22
|
}
|
|
22
23
|
export function buildOperationEvent(op, profileId, ts, executionMs, request, finalResponse, ttfb) {
|
|
23
24
|
const config = metricsRegistry.get(op);
|
|
25
|
+
const backend = readBackendDiagnostics(finalResponse);
|
|
24
26
|
if (!config) {
|
|
25
|
-
|
|
27
|
+
const event = {
|
|
26
28
|
ts,
|
|
27
29
|
op,
|
|
28
30
|
kind: 'handler',
|
|
29
31
|
profileId,
|
|
30
32
|
ms: executionMs
|
|
31
33
|
};
|
|
34
|
+
if (backend)
|
|
35
|
+
event.backend = backend;
|
|
36
|
+
return event;
|
|
32
37
|
}
|
|
33
38
|
const gauges = {};
|
|
34
39
|
if (ttfb !== undefined) {
|
|
@@ -64,6 +69,9 @@ export function buildOperationEvent(op, profileId, ts, executionMs, request, fin
|
|
|
64
69
|
if (hasGauges) {
|
|
65
70
|
event.gauges = gauges;
|
|
66
71
|
}
|
|
72
|
+
if (backend) {
|
|
73
|
+
event.backend = backend;
|
|
74
|
+
}
|
|
67
75
|
if (hasTags) {
|
|
68
76
|
event.tags = tags;
|
|
69
77
|
}
|
|
@@ -233,6 +241,16 @@ registerOperationMetrics({
|
|
|
233
241
|
const gauges = {};
|
|
234
242
|
if (res.stats.generationMs !== undefined)
|
|
235
243
|
gauges['generationMs'] = res.stats.generationMs;
|
|
244
|
+
if (res.stats.conditionerMs !== undefined)
|
|
245
|
+
gauges['conditionerMs'] = res.stats.conditionerMs;
|
|
246
|
+
if (res.stats.denoiseMs !== undefined)
|
|
247
|
+
gauges['denoiseMs'] = res.stats.denoiseMs;
|
|
248
|
+
if (res.stats.vaeMs !== undefined)
|
|
249
|
+
gauges['vaeMs'] = res.stats.vaeMs;
|
|
250
|
+
if (res.stats.postProcessMs !== undefined)
|
|
251
|
+
gauges['postProcessMs'] = res.stats.postProcessMs;
|
|
252
|
+
if (res.stats.stepsPerSecond !== undefined)
|
|
253
|
+
gauges['stepsPerSecond'] = res.stats.stepsPerSecond;
|
|
236
254
|
if (res.stats.totalSteps !== undefined)
|
|
237
255
|
gauges['totalSteps'] = res.stats.totalSteps;
|
|
238
256
|
if (res.stats.totalImages !== undefined)
|
|
@@ -252,6 +270,16 @@ registerOperationMetrics({
|
|
|
252
270
|
const gauges = {};
|
|
253
271
|
if (res.stats.generationMs !== undefined)
|
|
254
272
|
gauges['generationMs'] = res.stats.generationMs;
|
|
273
|
+
if (res.stats.conditionerMs !== undefined)
|
|
274
|
+
gauges['conditionerMs'] = res.stats.conditionerMs;
|
|
275
|
+
if (res.stats.denoiseMs !== undefined)
|
|
276
|
+
gauges['denoiseMs'] = res.stats.denoiseMs;
|
|
277
|
+
if (res.stats.vaeMs !== undefined)
|
|
278
|
+
gauges['vaeMs'] = res.stats.vaeMs;
|
|
279
|
+
if (res.stats.postProcessMs !== undefined)
|
|
280
|
+
gauges['postProcessMs'] = res.stats.postProcessMs;
|
|
281
|
+
if (res.stats.stepsPerSecond !== undefined)
|
|
282
|
+
gauges['stepsPerSecond'] = res.stats.stepsPerSecond;
|
|
255
283
|
if (res.stats.totalSteps !== undefined)
|
|
256
284
|
gauges['totalSteps'] = res.stats.totalSteps;
|
|
257
285
|
if (res.stats.totalVideos !== undefined)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generic wrappers for profiling handler execution.
|
|
3
3
|
* Used to wrap dispatch/invoke functions with timing capture.
|
|
4
4
|
*/
|
|
5
|
-
import { type PerCallProfiling } from '../../../schemas/index';
|
|
5
|
+
import { type PerCallProfiling } from '../../../schemas/index.js';
|
|
6
6
|
export interface ProfiledReplyOptions<TRequest> {
|
|
7
7
|
op: string;
|
|
8
8
|
request: TRequest;
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { PROFILING_KEY, OPERATION_EVENT_KEY } from '../../../schemas/index.js';
|
|
6
6
|
import { nowMs, generateProfileId } from '../../../profiling/clock.js';
|
|
7
|
-
import { record, shouldProfile } from '../../../profiling/controller.js';
|
|
7
|
+
import { record, shouldIncludeResourceGauges, shouldProfile } from '../../../profiling/controller.js';
|
|
8
|
+
import { getWorkerResourceCollector } from '../../../server/bare/resources/worker-collector.js';
|
|
8
9
|
import { buildOperationEvent } from './operation-metrics.js';
|
|
9
|
-
import { isTerminalChunk } from '../rpc-utils';
|
|
10
|
+
import { isTerminalChunk } from '../rpc-utils.js';
|
|
10
11
|
function getRequestProfilingMeta(request) {
|
|
11
12
|
if (!request || typeof request !== 'object') {
|
|
12
13
|
return undefined;
|
|
@@ -17,21 +18,47 @@ function getRequestProfilingMeta(request) {
|
|
|
17
18
|
}
|
|
18
19
|
return meta;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function resolveOperationProfiling(options) {
|
|
21
22
|
if (options.perCall) {
|
|
22
|
-
return options.perCall;
|
|
23
|
+
return { perCall: options.perCall, resourceOrigin: 'local' };
|
|
23
24
|
}
|
|
24
25
|
const meta = getRequestProfilingMeta(options.request);
|
|
25
26
|
if (!meta) {
|
|
26
|
-
return undefined;
|
|
27
|
+
return { perCall: undefined, resourceOrigin: 'local' };
|
|
27
28
|
}
|
|
28
29
|
if (meta.enabled === false) {
|
|
29
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
perCall: { enabled: false },
|
|
32
|
+
resourceOrigin: meta.resourceOrigin ?? 'local'
|
|
33
|
+
};
|
|
30
34
|
}
|
|
31
35
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
perCall: {
|
|
37
|
+
enabled: true,
|
|
38
|
+
includeServerBreakdown: meta.includeServer,
|
|
39
|
+
includeResourceGauges: meta.includeResources,
|
|
40
|
+
mode: meta.mode
|
|
41
|
+
},
|
|
42
|
+
resourceOrigin: meta.resourceOrigin ?? 'local'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function toProfilerResourceGauge(sample, sampledAt, origin) {
|
|
46
|
+
const gpus = sample.gpus.status === 'supported'
|
|
47
|
+
? {
|
|
48
|
+
...sample.gpus,
|
|
49
|
+
value: sample.gpus.value.map((gpu) => ({
|
|
50
|
+
id: gpu.id,
|
|
51
|
+
compute: gpu.compute,
|
|
52
|
+
memoryUsedBytes: gpu.memoryUsedBytes
|
|
53
|
+
}))
|
|
54
|
+
}
|
|
55
|
+
: sample.gpus;
|
|
56
|
+
return {
|
|
57
|
+
origin,
|
|
58
|
+
sampledAt,
|
|
59
|
+
cpu: sample.cpu,
|
|
60
|
+
memory: sample.memory,
|
|
61
|
+
gpus
|
|
35
62
|
};
|
|
36
63
|
}
|
|
37
64
|
function buildAndRecordOperationEvent(params) {
|
|
@@ -44,12 +71,18 @@ function buildAndRecordOperationEvent(params) {
|
|
|
44
71
|
if (params.count !== undefined && params.count > 0) {
|
|
45
72
|
event.count = params.count;
|
|
46
73
|
}
|
|
74
|
+
if (shouldIncludeResourceGauges(params.profiling.perCall)) {
|
|
75
|
+
const resources = getWorkerResourceCollector()?.sample();
|
|
76
|
+
if (resources) {
|
|
77
|
+
event.resources = toProfilerResourceGauge(resources, nowMs(), params.profiling.resourceOrigin);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
47
80
|
record(event);
|
|
48
81
|
return event;
|
|
49
82
|
}
|
|
50
83
|
export async function profileReplyHandler(options, handler) {
|
|
51
|
-
const
|
|
52
|
-
if (!shouldProfile(options.op, perCall)) {
|
|
84
|
+
const profiling = resolveOperationProfiling(options);
|
|
85
|
+
if (!shouldProfile(options.op, profiling.perCall)) {
|
|
53
86
|
return handler();
|
|
54
87
|
}
|
|
55
88
|
const profileId = generateProfileId();
|
|
@@ -59,6 +92,7 @@ export async function profileReplyHandler(options, handler) {
|
|
|
59
92
|
const executionMs = nowMs() - startTs;
|
|
60
93
|
const event = buildAndRecordOperationEvent({
|
|
61
94
|
options,
|
|
95
|
+
profiling,
|
|
62
96
|
profileId,
|
|
63
97
|
startTs,
|
|
64
98
|
executionMs,
|
|
@@ -74,6 +108,7 @@ export async function profileReplyHandler(options, handler) {
|
|
|
74
108
|
const executionMs = nowMs() - startTs;
|
|
75
109
|
buildAndRecordOperationEvent({
|
|
76
110
|
options,
|
|
111
|
+
profiling,
|
|
77
112
|
profileId,
|
|
78
113
|
startTs,
|
|
79
114
|
executionMs,
|
|
@@ -83,8 +118,8 @@ export async function profileReplyHandler(options, handler) {
|
|
|
83
118
|
}
|
|
84
119
|
}
|
|
85
120
|
export async function* profileStreamHandler(options, handler) {
|
|
86
|
-
const
|
|
87
|
-
if (!shouldProfile(options.op, perCall)) {
|
|
121
|
+
const profiling = resolveOperationProfiling(options);
|
|
122
|
+
if (!shouldProfile(options.op, profiling.perCall)) {
|
|
88
123
|
return yield* handler();
|
|
89
124
|
}
|
|
90
125
|
const profileId = generateProfileId();
|
|
@@ -102,6 +137,7 @@ export async function* profileStreamHandler(options, handler) {
|
|
|
102
137
|
const executionMs = nowMs() - startTs;
|
|
103
138
|
buildAndRecordOperationEvent({
|
|
104
139
|
options,
|
|
140
|
+
profiling,
|
|
105
141
|
profileId,
|
|
106
142
|
startTs,
|
|
107
143
|
executionMs,
|
|
@@ -122,6 +158,7 @@ export async function* profileStreamHandler(options, handler) {
|
|
|
122
158
|
const executionMs = nowMs() - startTs;
|
|
123
159
|
const event = buildAndRecordOperationEvent({
|
|
124
160
|
options,
|
|
161
|
+
profiling,
|
|
125
162
|
profileId,
|
|
126
163
|
startTs,
|
|
127
164
|
executionMs,
|
|
@@ -142,6 +179,7 @@ export async function* profileStreamHandler(options, handler) {
|
|
|
142
179
|
const executionMs = nowMs() - startTs;
|
|
143
180
|
buildAndRecordOperationEvent({
|
|
144
181
|
options,
|
|
182
|
+
profiling,
|
|
145
183
|
profileId,
|
|
146
184
|
startTs,
|
|
147
185
|
executionMs,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Response, type ProfilingRequestMeta } from '../../../schemas/index';
|
|
2
|
-
import { type ServerProfilingContext } from './context';
|
|
1
|
+
import { type Response, type ProfilingRequestMeta } from '../../../schemas/index.js';
|
|
2
|
+
import { type ServerProfilingContext } from './context.js';
|
|
3
3
|
export type ServerProfiler = {
|
|
4
4
|
markRequestParsed: (ms: number) => void;
|
|
5
5
|
markRequestValidated: (ms: number) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { HandlerEntry } from './handler-utils';
|
|
1
|
+
import type { HandlerEntry } from './handler-utils.js';
|
|
2
2
|
export declare function shouldUseStreamErrorTransport(entry: HandlerEntry | undefined, rawRequest: Record<string, unknown> | undefined): boolean;
|
|
3
3
|
//# sourceMappingURL=transport-selector.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { createGunzip } from 'bare-zlib';
|
|
|
5
5
|
import tarStream from 'tar-stream';
|
|
6
6
|
import { detectShardedModel, generateShardFilenames, extractTensorsFromShards, validateShardedModelCache } from './shard-utils.js';
|
|
7
7
|
import { ModelLoadFailedError, ArchiveExtractionFailedError, ArchiveUnsupportedTypeError, ArchiveMissingShardsError, DownloadCancelledError } from '../../utils/errors-server.js';
|
|
8
|
-
import { isPathWithinBase } from '
|
|
8
|
+
import { isPathWithinBase } from '../../server/utils/path-security.js';
|
|
9
9
|
import { getServerLogger } from '../../logging/index.js';
|
|
10
10
|
import { SUPPORTED_ARCHIVE_EXTENSIONS, filenameToArchiveTypeSchema } from '../../schemas/archive.js';
|
|
11
11
|
const logger = getServerLogger();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable } from 'bare-stream';
|
|
2
|
-
import { type AudioFormat } from '../../../schemas/index';
|
|
2
|
+
import { type AudioFormat } from '../../../schemas/index.js';
|
|
3
3
|
export declare function needsDecoding(filePath: string): boolean;
|
|
4
4
|
export declare function decodeAudioToStream(inputPath: string, audioFormat?: AudioFormat): Promise<Readable>;
|
|
5
5
|
//# sourceMappingURL=decoder.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'bare-fs';
|
|
2
2
|
import path from 'bare-path';
|
|
3
3
|
import { FFmpegDecoder } from '@qvac/decoder-audio';
|
|
4
|
-
import { FORMATS_NEEDING_DECODE } from '@qvac/decoder-audio/constants
|
|
4
|
+
import { FORMATS_NEEDING_DECODE } from '@qvac/decoder-audio/constants';
|
|
5
5
|
import { Readable } from 'bare-stream';
|
|
6
6
|
import { getServerLogger } from '../../../logging/index.js';
|
|
7
7
|
import {} from '../../../schemas/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CacheMessage } from './types';
|
|
1
|
+
import type { CacheMessage } from './types.js';
|
|
2
2
|
export declare function getAutoCacheLookupHistory(currentHistory: CacheMessage[]): CacheMessage[];
|
|
3
3
|
export declare function buildAutoCacheSaveHistory(currentHistory: CacheMessage[], assistantResponse: string): CacheMessage[];
|
|
4
4
|
//# sourceMappingURL=auto-history.d.ts.map
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import { normalizeAssistantCacheContent } from '../../../utils/cache-normalize.js';
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
function normalizeCacheMessage(message) {
|
|
3
|
+
const { attachments, ...normalized } = message;
|
|
4
|
+
if (message.role === 'assistant') {
|
|
5
|
+
normalized.content = normalizeAssistantCacheContent(message.content);
|
|
5
6
|
}
|
|
6
|
-
return {
|
|
7
|
+
return {
|
|
8
|
+
...normalized,
|
|
9
|
+
...(attachments && attachments.length > 0 ? { attachments } : {})
|
|
10
|
+
};
|
|
7
11
|
}
|
|
8
12
|
export function getAutoCacheLookupHistory(currentHistory) {
|
|
9
13
|
if (currentHistory.length <= 1) {
|
|
10
14
|
return [];
|
|
11
15
|
}
|
|
12
|
-
return currentHistory.slice(0, -1).map(
|
|
16
|
+
return currentHistory.slice(0, -1).map(normalizeCacheMessage);
|
|
13
17
|
}
|
|
14
18
|
export function buildAutoCacheSaveHistory(currentHistory, assistantResponse) {
|
|
15
19
|
return [
|
|
16
|
-
...currentHistory,
|
|
17
|
-
{
|
|
20
|
+
...currentHistory.map(normalizeCacheMessage),
|
|
21
|
+
normalizeCacheMessage({
|
|
18
22
|
role: 'assistant',
|
|
19
|
-
content:
|
|
20
|
-
}
|
|
23
|
+
content: assistantResponse
|
|
24
|
+
})
|
|
21
25
|
];
|
|
22
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShardFileMetadata } from '../../../schemas/index';
|
|
1
|
+
import type { ShardFileMetadata } from '../../../schemas/index.js';
|
|
2
2
|
export declare function getCacheDir(subDir: string): string;
|
|
3
3
|
export declare function getModelsCacheDir(): string;
|
|
4
4
|
export declare function getKVCacheDir(): string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs, { promises as fsPromises } from 'bare-fs';
|
|
2
2
|
import path from 'bare-path';
|
|
3
|
-
import { getConfiguredCacheDir } from '
|
|
4
|
-
import { getQvacPath } from '
|
|
5
|
-
import { calculateFileChecksum } from '
|
|
6
|
-
import { validateAndJoinPath } from '
|
|
7
|
-
import { generateShortHash } from '
|
|
3
|
+
import { getConfiguredCacheDir } from '../../../server/bare/registry/config-registry.js';
|
|
4
|
+
import { getQvacPath } from '../../../server/utils/qvac-paths.js';
|
|
5
|
+
import { calculateFileChecksum } from '../../../server/utils/checksum.js';
|
|
6
|
+
import { validateAndJoinPath } from '../../../server/utils/path-security.js';
|
|
7
|
+
import { generateShortHash } from '../../../server/utils/formatting.js';
|
|
8
8
|
import { getServerLogger } from '../../../logging/index.js';
|
|
9
9
|
import { nowMs } from '../../../profiling/index.js';
|
|
10
|
-
import { resolveClearStorageTarget } from '
|
|
10
|
+
import { resolveClearStorageTarget } from '../../../server/utils/clear-storage.js';
|
|
11
11
|
const logger = getServerLogger();
|
|
12
12
|
export function getCacheDir(subDir) {
|
|
13
13
|
const cacheDir = getQvacPath(subDir);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DownloadHooks } from '
|
|
1
|
+
import type { DownloadHooks } from '../../server/rpc/handlers/load-model/types.js';
|
|
2
2
|
export declare function calculateFileChecksum(filePath: string): Promise<string>;
|
|
3
3
|
export declare function measureChecksum(filePath: string, hooks?: DownloadHooks): Promise<string>;
|
|
4
4
|
//# sourceMappingURL=checksum.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CompletionEvent, CompletionError, CompletionStats, NormalizerConfig, StopReason, ToolCall } from '../../schemas/index';
|
|
1
|
+
import type { CompletionEvent, CompletionError, CompletionStats, NormalizerConfig, StopReason, ToolCall } from '../../schemas/index.js';
|
|
2
|
+
export declare const MAX_TOOL_FRAME_CHARS = 1048576;
|
|
2
3
|
export type CompletionNormalizer = ReturnType<typeof createCompletionNormalizer>;
|
|
3
4
|
export declare function createCompletionNormalizer(config: NormalizerConfig): {
|
|
4
5
|
push: (token: string) => CompletionEvent[];
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { parseToolCalls } from '
|
|
1
|
+
import { parseToolCalls } from '../../server/utils/tools/index.js';
|
|
2
|
+
export const MAX_TOOL_FRAME_CHARS = 1_048_576;
|
|
3
|
+
const DSML_INVOKE_FRAMES = [' ', '\n', '\t', '\r'].map((sep) => ({
|
|
4
|
+
open: `<|DSML|invoke${sep}`,
|
|
5
|
+
close: '</|DSML|invoke>'
|
|
6
|
+
}));
|
|
2
7
|
const DIALECT_SPECS = {
|
|
3
8
|
hermes: {
|
|
4
9
|
toolFrames: [{ open: '<tool_call>', close: '</tool_call>' }]
|
|
@@ -41,6 +46,13 @@ const DIALECT_SPECS = {
|
|
|
41
46
|
gemma4: {
|
|
42
47
|
toolFrames: [{ open: '<|tool_call>', close: '<tool_call|>' }],
|
|
43
48
|
thinkingFrames: [{ open: '<|channel>thought', close: '<channel|>' }]
|
|
49
|
+
},
|
|
50
|
+
dsml: {
|
|
51
|
+
toolFrames: [
|
|
52
|
+
{ open: '<|DSML|tool_calls>', close: '</|DSML|tool_calls>' },
|
|
53
|
+
{ open: '<|DSML|function_calls>', close: '</|DSML|function_calls>' },
|
|
54
|
+
...DSML_INVOKE_FRAMES
|
|
55
|
+
]
|
|
44
56
|
}
|
|
45
57
|
};
|
|
46
58
|
// Capture-gated reasoning marker — the generic `<think>...</think>`
|
|
@@ -217,6 +229,22 @@ export function createCompletionNormalizer(config) {
|
|
|
217
229
|
emitContent(events, raw);
|
|
218
230
|
}
|
|
219
231
|
}
|
|
232
|
+
function abandonToolFrame(events) {
|
|
233
|
+
const raw = toolCallBuffer + toolFramingTail;
|
|
234
|
+
toolCallBuffer = '';
|
|
235
|
+
toolFramingTail = '';
|
|
236
|
+
activeToolFrame = null;
|
|
237
|
+
state = 'content';
|
|
238
|
+
events.push({
|
|
239
|
+
type: 'toolError',
|
|
240
|
+
seq: nextSeq(),
|
|
241
|
+
error: {
|
|
242
|
+
code: 'PARSE_ERROR',
|
|
243
|
+
message: `Tool call frame exceeded ${MAX_TOOL_FRAME_CHARS} characters without a close marker`
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
emitContent(events, raw);
|
|
247
|
+
}
|
|
220
248
|
function getStateTail() {
|
|
221
249
|
switch (state) {
|
|
222
250
|
case 'content':
|
|
@@ -254,6 +282,8 @@ export function createCompletionNormalizer(config) {
|
|
|
254
282
|
toolCallBuffer += buf.slice(0, safeLen);
|
|
255
283
|
toolFramingTail = buf.slice(safeLen);
|
|
256
284
|
buf = '';
|
|
285
|
+
if (toolCallBuffer.length > MAX_TOOL_FRAME_CHARS)
|
|
286
|
+
abandonToolFrame(events);
|
|
257
287
|
continue;
|
|
258
288
|
}
|
|
259
289
|
if (state === 'thinkingFraming') {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type ModelTypeInput } from '../../schemas/index';
|
|
1
|
+
import { type ModelTypeInput } from '../../schemas/index.js';
|
|
2
2
|
export declare function transformConfigForReload(modelType: ModelTypeInput, config: unknown): unknown;
|
|
3
3
|
//# sourceMappingURL=config-transform.d.ts.map
|