@qvac/sdk 0.14.1 → 0.16.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 +47 -45
- package/README.md +34 -35
- package/dist/client/api/batch-completion.d.ts +15 -0
- package/dist/client/api/batch-completion.js +332 -0
- package/dist/client/api/bci-transcribe.d.ts +1 -1
- package/dist/client/api/bci-transcribe.js +31 -31
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +18 -18
- package/dist/client/api/classify.d.ts +1 -1
- package/dist/client/api/classify.js +9 -6
- package/dist/client/api/client-request-id.js +1 -1
- package/dist/client/api/completion-stream.d.ts +3 -3
- package/dist/client/api/completion-stream.js +18 -18
- package/dist/client/api/delete-cache.js +9 -9
- package/dist/client/api/diffusion.d.ts +1 -1
- package/dist/client/api/diffusion.js +17 -11
- package/dist/client/api/download-asset.d.ts +1 -1
- package/dist/client/api/download-asset.js +11 -11
- package/dist/client/api/embed.d.ts +1 -1
- package/dist/client/api/embed.js +10 -10
- package/dist/client/api/finetune.d.ts +1 -1
- package/dist/client/api/finetune.js +25 -27
- package/dist/client/api/get-loaded-model-info.d.ts +2 -2
- package/dist/client/api/get-loaded-model-info.js +8 -8
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/get-model-info.js +7 -7
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +7 -7
- package/dist/client/api/index.d.ts +33 -32
- package/dist/client/api/index.js +33 -32
- package/dist/client/api/invoke-plugin.d.ts +1 -1
- package/dist/client/api/invoke-plugin.js +10 -10
- package/dist/client/api/load-model.d.ts +1 -1
- package/dist/client/api/load-model.js +32 -32
- package/dist/client/api/logging-stream.d.ts +1 -1
- package/dist/client/api/logging-stream.js +6 -6
- package/dist/client/api/ocr.d.ts +10 -1
- package/dist/client/api/ocr.js +20 -11
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +7 -7
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +65 -66
- package/dist/client/api/registry.d.ts +1 -1
- package/dist/client/api/registry.js +8 -8
- package/dist/client/api/resume.js +5 -5
- package/dist/client/api/state.d.ts +1 -1
- package/dist/client/api/state.js +5 -5
- package/dist/client/api/stop-provider.js +6 -6
- package/dist/client/api/subscribe-logs.d.ts +1 -1
- package/dist/client/api/subscribe-logs.js +3 -3
- package/dist/client/api/suspend.js +5 -5
- package/dist/client/api/text-to-speech.d.ts +1 -1
- package/dist/client/api/text-to-speech.js +37 -39
- package/dist/client/api/transcribe.d.ts +2 -2
- package/dist/client/api/transcribe.js +44 -45
- package/dist/client/api/translate.d.ts +1 -1
- package/dist/client/api/translate.js +14 -25
- package/dist/client/api/unload-model.d.ts +1 -1
- package/dist/client/api/unload-model.js +11 -11
- package/dist/client/api/upscale.d.ts +1 -1
- package/dist/client/api/upscale.js +9 -9
- package/dist/client/api/video.d.ts +8 -5
- package/dist/client/api/video.js +23 -18
- package/dist/client/api/vla-helpers.d.ts +2 -2
- package/dist/client/api/vla-helpers.js +6 -11
- package/dist/client/api/vla.d.ts +15 -11
- package/dist/client/api/vla.js +27 -23
- package/dist/client/config-loader/config-utils.d.ts +1 -1
- package/dist/client/config-loader/config-utils.js +3 -3
- package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.bare.js +11 -11
- package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.expo.js +6 -6
- package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.node.js +27 -27
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/init-hooks.d.ts +1 -1
- package/dist/client/init-hooks.js +12 -12
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +6 -6
- package/dist/client/parse-input.d.ts +1 -1
- package/dist/client/parse-input.js +3 -3
- package/dist/client/plugins-factory.d.ts +2 -2
- package/dist/client/plugins-factory.js +2 -2
- package/dist/client/rpc/bare-client.d.ts +2 -1
- package/dist/client/rpc/bare-client.js +37 -39
- package/dist/client/rpc/ensure-worker-ready.js +4 -4
- package/dist/client/rpc/expo-device-info.d.ts +1 -1
- package/dist/client/rpc/expo-device-info.js +11 -11
- package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
- package/dist/client/rpc/expo-rpc-client.js +38 -47
- package/dist/client/rpc/node-rpc-client.d.ts +2 -1
- package/dist/client/rpc/node-rpc-client.js +103 -75
- package/dist/client/rpc/profiling/index.d.ts +1 -1
- package/dist/client/rpc/profiling/index.js +1 -1
- package/dist/client/rpc/profiling/profiler.d.ts +2 -2
- package/dist/client/rpc/profiling/profiler.js +31 -34
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +113 -72
- package/dist/client/rpc/rpc-error.d.ts +1 -1
- package/dist/client/rpc/rpc-error.js +19 -13
- package/dist/commands/bundle/bare-pack.d.ts +1 -1
- package/dist/commands/bundle/bare-pack.js +20 -20
- package/dist/commands/bundle/constants.js +21 -21
- package/dist/commands/bundle/entry-gen.js +4 -4
- package/dist/commands/bundle/index.js +45 -47
- package/dist/commands/bundle/manifest.d.ts +1 -1
- package/dist/commands/bundle/manifest.js +44 -46
- package/dist/commands/bundle/plugins.d.ts +2 -2
- package/dist/commands/bundle/plugins.js +7 -7
- package/dist/commands/bundle/resolve-sdk-import.js +6 -13
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +2 -2
- package/dist/commands/verify/abi.d.ts +9 -9
- package/dist/commands/verify/abi.js +31 -31
- package/dist/commands/verify/addon-source.d.ts +1 -1
- package/dist/commands/verify/addon-source.js +13 -14
- package/dist/commands/verify/bundle-source.d.ts +1 -1
- package/dist/commands/verify/bundle-source.js +7 -7
- package/dist/commands/verify/index.d.ts +3 -3
- package/dist/commands/verify/index.js +18 -17
- package/dist/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/commands/verify/node-modules-source.js +11 -11
- package/dist/commands/verify/prebuilds.d.ts +3 -3
- package/dist/commands/verify/prebuilds.js +8 -8
- package/dist/constants/audio.d.ts +1 -1
- package/dist/constants/audio.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/registry.js +1 -1
- package/dist/examples/audio/mic-input.d.ts +1 -1
- package/dist/examples/audio/mic-input.js +31 -31
- package/dist/examples/batch-completion.d.ts +38 -0
- package/dist/examples/batch-completion.js +100 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
- package/dist/examples/bci/bci-filesystem.js +17 -17
- package/dist/examples/cache-management.js +32 -32
- package/dist/examples/cancel-by-request-id.js +11 -11
- package/dist/examples/classification/classify-image.js +5 -5
- package/dist/examples/completion-events.js +16 -18
- package/dist/examples/completion-stop-reason.js +13 -13
- package/dist/examples/concurrent-completion-collision.js +20 -20
- package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
- package/dist/examples/config/default/default.config.js +2 -2
- package/dist/examples/config/plugins/plugins.config.js +2 -2
- package/dist/examples/config-reload.js +14 -14
- package/dist/examples/default-config-usage.js +10 -13
- package/dist/examples/delegated-inference/composite.js +23 -23
- package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
- package/dist/examples/delegated-inference/consumer.js +11 -11
- package/dist/examples/delegated-inference/provider.js +24 -24
- package/dist/examples/diffusion-esrgan-upscale.js +19 -19
- package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
- package/dist/examples/diffusion-flux2-klein.js +14 -14
- package/dist/examples/diffusion-ideogram.d.ts +2 -0
- package/dist/examples/diffusion-ideogram.js +108 -0
- package/dist/examples/diffusion-img2img.js +13 -13
- package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-ltx.js +98 -0
- package/dist/examples/diffusion-img2vid.js +22 -23
- package/dist/examples/diffusion-simple.js +7 -7
- package/dist/examples/diffusion-txt2img.js +13 -14
- package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
- package/dist/examples/diffusion-txt2vid.js +18 -18
- package/dist/examples/download-with-blind-relays.js +7 -8
- package/dist/examples/download-with-cancel.js +9 -9
- package/dist/examples/embed-multi-gpu.js +9 -9
- package/dist/examples/embed-p2p.js +24 -24
- package/dist/examples/finetune/llamacpp-finetune.js +21 -21
- package/dist/examples/kv-cache-cleanup.js +34 -34
- package/dist/examples/kv-cache-custom-key.js +30 -30
- package/dist/examples/kv-cache-example.js +18 -20
- package/dist/examples/llamacpp-cache.js +33 -33
- package/dist/examples/llamacpp-dynamic-tools.js +38 -38
- package/dist/examples/llamacpp-filesystem.js +13 -15
- package/dist/examples/llamacpp-http.js +12 -14
- package/dist/examples/llamacpp-multi-gpu.js +12 -12
- package/dist/examples/llamacpp-multimodal.js +16 -16
- package/dist/examples/llamacpp-p2p.js +11 -11
- package/dist/examples/llamacpp-sharded.js +12 -12
- package/dist/examples/llamacpp-structured-output.js +37 -37
- package/dist/examples/logging-file-transport.js +19 -21
- package/dist/examples/logging-global.js +8 -8
- package/dist/examples/logging-streaming.js +19 -17
- package/dist/examples/mcp-websearch.js +44 -44
- package/dist/examples/multi-model-demo.js +33 -33
- package/dist/examples/ocr-fasttext.js +17 -17
- package/dist/examples/parallel-download.js +11 -13
- package/dist/examples/plugins.js +43 -43
- package/dist/examples/profiling/basic.js +34 -36
- package/dist/examples/profiling/per-call.js +16 -16
- package/dist/examples/quickstart.bare.js +4 -6
- package/dist/examples/quickstart.js +7 -7
- package/dist/examples/rag/rag-chromadb.js +26 -26
- package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
- package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
- package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
- package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
- package/dist/examples/rag/rag-lancedb.js +29 -32
- package/dist/examples/rag/rag-sqlite.js +25 -25
- package/dist/examples/registry-query.js +15 -15
- package/dist/examples/seed-p2p.js +8 -8
- package/dist/examples/suspend-resume.js +20 -20
- package/dist/examples/tools/llamacpp-native-tools.js +25 -25
- package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
- package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
- package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
- package/dist/examples/tools/shared.d.ts +2 -2
- package/dist/examples/tools/shared.js +17 -17
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
- package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
- package/dist/examples/transcription/parakeet-sortformer.js +21 -21
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.d.ts +2 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.js +203 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
- package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
- package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
- package/dist/examples/transcription/whispercpp-prompt.js +18 -18
- package/dist/examples/translation/translation-bergamot-batch.js +17 -17
- package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
- package/dist/examples/translation/translation-bergamot.js +11 -11
- package/dist/examples/translation/translation-indic.js +10 -10
- package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
- package/dist/examples/translation/translation-llm-context.js +10 -10
- package/dist/examples/translation/translation-llm.js +13 -13
- package/dist/examples/translation/translation-stream.js +11 -11
- package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
- package/dist/examples/tts/chatterbox-enhanced.js +55 -0
- package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
- package/dist/examples/tts/chatterbox-multilingual.js +54 -0
- package/dist/examples/tts/chatterbox.js +18 -18
- package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
- package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
- package/dist/examples/tts/supertonic-enhanced.js +57 -0
- package/dist/examples/tts/supertonic-multilingual.js +19 -19
- package/dist/examples/tts/supertonic.js +18 -18
- package/dist/examples/tts/utils.js +24 -32
- package/dist/examples/vla-groot.d.ts +2 -0
- package/dist/examples/vla-groot.js +118 -0
- package/dist/examples/vla-pi05.js +14 -14
- package/dist/examples/vla-smolvla.js +14 -14
- package/dist/examples/voice-assistant/voice-assistant.js +46 -46
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
- package/dist/expo/plugins/get-project-root.d.ts +2 -2
- package/dist/expo/plugins/get-project-root.js +1 -1
- package/dist/expo/plugins/index.d.ts +11 -11
- package/dist/expo/plugins/index.js +10 -10
- package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
- package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/expo/plugins/withDeviceInfo.js +13 -13
- package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
- package/dist/expo/plugins/withMobileBundle.js +34 -42
- package/dist/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/expo/plugins/withOpenCL.js +14 -16
- package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/expo/plugins/withQvacSDK.js +12 -12
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -17
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +13 -13
- package/dist/logging/base-logger.d.ts +2 -2
- package/dist/logging/base-logger.js +6 -6
- package/dist/logging/client-logger.d.ts +1 -1
- package/dist/logging/client-logger.js +3 -3
- package/dist/logging/index.d.ts +9 -9
- package/dist/logging/index.js +8 -8
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +4 -4
- package/dist/logging/namespaces.d.ts +1 -1
- package/dist/logging/namespaces.js +5 -5
- package/dist/logging/registry.d.ts +2 -2
- package/dist/logging/registry.js +3 -3
- package/dist/logging/server-logger.d.ts +1 -1
- package/dist/logging/server-logger.js +2 -2
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +4 -4
- package/dist/logging/transport.d.ts +1 -1
- package/dist/logging/types.d.ts +1 -1
- package/dist/logging/utils.d.ts +2 -2
- package/dist/logging/utils.js +40 -41
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +5 -5
- package/dist/models/registry/models.d.ts +5622 -9241
- package/dist/models/registry/models.js +13215 -17030
- package/dist/models/update-models/codegen.d.ts +1 -1
- package/dist/models/update-models/codegen.js +8 -8
- package/dist/models/update-models/companions.d.ts +6 -1
- package/dist/models/update-models/companions.js +104 -39
- package/dist/models/update-models/history.d.ts +1 -1
- package/dist/models/update-models/history.js +11 -11
- package/dist/models/update-models/index.js +32 -34
- package/dist/models/update-models/naming.d.ts +2 -2
- package/dist/models/update-models/naming.js +181 -186
- package/dist/models/update-models/processing.d.ts +2 -2
- package/dist/models/update-models/processing.js +17 -19
- package/dist/models/update-models/registry.d.ts +2 -2
- package/dist/models/update-models/registry.js +9 -9
- package/dist/models/update-models/shards.d.ts +1 -1
- package/dist/models/update-models/shards.js +3 -3
- package/dist/models/update-models/types.d.ts +1 -1
- package/dist/models/update-models/utils.js +5 -5
- package/dist/pear/pre.js +84 -84
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +6 -6
- package/dist/profiling/clock.d.ts +1 -1
- package/dist/profiling/clock.js +10 -10
- package/dist/profiling/controller.d.ts +2 -2
- package/dist/profiling/controller.js +11 -12
- package/dist/profiling/envelope.d.ts +1 -1
- package/dist/profiling/envelope.js +4 -6
- package/dist/profiling/events.d.ts +2 -2
- package/dist/profiling/events.js +8 -10
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +81 -79
- package/dist/profiling/index.d.ts +8 -8
- package/dist/profiling/index.js +7 -7
- package/dist/profiling/model-execution.js +2 -1
- package/dist/profiling/ring-buffer.js +2 -2
- package/dist/profiling/types.d.ts +3 -3
- package/dist/schemas/archive.d.ts +1 -1
- package/dist/schemas/archive.js +8 -14
- package/dist/schemas/batch-completion-stream.d.ts +463 -0
- package/dist/schemas/batch-completion-stream.js +124 -0
- package/dist/schemas/bci-config.d.ts +1 -1
- package/dist/schemas/bci-config.js +7 -7
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +25 -31
- package/dist/schemas/cancel.d.ts +6 -1
- package/dist/schemas/cancel.js +33 -34
- package/dist/schemas/classification.d.ts +1 -1
- package/dist/schemas/classification.js +7 -7
- package/dist/schemas/common.d.ts +578 -28
- package/dist/schemas/common.js +42 -37
- package/dist/schemas/completion-event.d.ts +11 -8
- package/dist/schemas/completion-event.js +27 -26
- package/dist/schemas/completion-stream.d.ts +190 -5
- package/dist/schemas/completion-stream.js +118 -67
- package/dist/schemas/constants-registry.d.ts +67 -0
- package/dist/schemas/constants-registry.js +51 -0
- package/dist/schemas/delegate.d.ts +1 -1
- package/dist/schemas/delegate.js +7 -7
- package/dist/schemas/delete-cache.d.ts +1 -1
- package/dist/schemas/delete-cache.js +15 -11
- package/dist/schemas/download-asset.d.ts +2 -2
- package/dist/schemas/download-asset.js +21 -21
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +16 -27
- package/dist/schemas/engine-addon-map.d.ts +3 -2
- package/dist/schemas/engine-addon-map.js +25 -25
- package/dist/schemas/error.d.ts +1 -1
- package/dist/schemas/error.js +12 -13
- package/dist/schemas/finetune.d.ts +1 -1
- package/dist/schemas/finetune.js +41 -44
- package/dist/schemas/get-loaded-model-info.d.ts +17 -1
- package/dist/schemas/get-loaded-model-info.js +22 -14
- package/dist/schemas/get-model-info.d.ts +1 -1
- package/dist/schemas/get-model-info.js +48 -91
- package/dist/schemas/heartbeat.d.ts +1 -1
- package/dist/schemas/heartbeat.js +6 -6
- package/dist/schemas/index.d.ts +52 -51
- package/dist/schemas/index.js +52 -51
- package/dist/schemas/json-schema.d.ts +1 -1
- package/dist/schemas/llamacpp-config.d.ts +57 -29
- package/dist/schemas/llamacpp-config.js +43 -35
- package/dist/schemas/load-model.d.ts +1537 -185
- package/dist/schemas/load-model.js +126 -129
- package/dist/schemas/logging-stream.d.ts +1 -1
- package/dist/schemas/logging-stream.js +6 -12
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-src-utils.d.ts +1 -1
- package/dist/schemas/model-src-utils.js +13 -13
- package/dist/schemas/model-types.d.ts +1 -1
- package/dist/schemas/model-types.js +27 -27
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/ocr.js +18 -18
- package/dist/schemas/path-validation.d.ts +1 -1
- package/dist/schemas/path-validation.js +4 -4
- package/dist/schemas/plugin.d.ts +13 -14
- package/dist/schemas/plugin.js +51 -51
- package/dist/schemas/profiling.d.ts +1 -1
- package/dist/schemas/profiling.js +16 -16
- package/dist/schemas/provide.d.ts +1 -1
- package/dist/schemas/provide.js +8 -8
- package/dist/schemas/rag.d.ts +3 -3
- package/dist/schemas/rag.js +65 -70
- package/dist/schemas/registry.d.ts +1 -1
- package/dist/schemas/registry.js +44 -66
- package/dist/schemas/reload-config.d.ts +1 -1
- package/dist/schemas/reload-config.js +16 -18
- package/dist/schemas/resume.d.ts +1 -1
- package/dist/schemas/resume.js +3 -3
- package/dist/schemas/runtime-context.d.ts +1 -1
- package/dist/schemas/runtime-context.js +4 -4
- package/dist/schemas/sdcpp-config.d.ts +248 -9
- package/dist/schemas/sdcpp-config.js +395 -291
- package/dist/schemas/sdk-config.d.ts +833 -71
- package/dist/schemas/sdk-config.js +25 -29
- package/dist/schemas/sdk-errors-client.d.ts +1 -1
- package/dist/schemas/sdk-errors-client.js +80 -80
- package/dist/schemas/sdk-errors-registry.js +1 -1
- package/dist/schemas/sdk-errors-server.d.ts +1 -1
- package/dist/schemas/sdk-errors-server.js +202 -199
- package/dist/schemas/shard.d.ts +1 -1
- package/dist/schemas/shard.js +4 -4
- package/dist/schemas/state.d.ts +1 -1
- package/dist/schemas/state.js +5 -10
- package/dist/schemas/stop-provide.d.ts +1 -1
- package/dist/schemas/stop-provide.js +4 -4
- package/dist/schemas/suspend.d.ts +1 -1
- package/dist/schemas/suspend.js +3 -3
- package/dist/schemas/text-to-speech.d.ts +469 -3
- package/dist/schemas/text-to-speech.js +151 -109
- package/dist/schemas/tools.d.ts +2 -2
- package/dist/schemas/tools.js +18 -24
- package/dist/schemas/transcription-config.d.ts +1 -1
- package/dist/schemas/transcription-config.js +18 -18
- package/dist/schemas/transcription.d.ts +5 -5
- package/dist/schemas/transcription.js +31 -33
- package/dist/schemas/translate.d.ts +3 -3
- package/dist/schemas/translate.js +49 -72
- package/dist/schemas/translation-config.d.ts +1 -1
- package/dist/schemas/translation-config.js +116 -123
- package/dist/schemas/unload-model.d.ts +1 -1
- package/dist/schemas/unload-model.js +6 -6
- package/dist/schemas/vla.d.ts +11 -1
- package/dist/schemas/vla.js +52 -32
- 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/scripts/run-security-tests.js +9 -10
- package/dist/scripts/run-unit-tests.js +11 -12
- package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
- package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
- package/dist/server/bare/delegate-rpc-client.js +32 -34
- package/dist/server/bare/hyperswarm.d.ts +3 -3
- package/dist/server/bare/hyperswarm.js +14 -14
- package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
- package/dist/server/bare/ops/bci-transcribe.js +44 -44
- package/dist/server/bare/ops/cancel.d.ts +2 -2
- package/dist/server/bare/ops/cancel.js +6 -6
- package/dist/server/bare/ops/embed.d.ts +1 -1
- package/dist/server/bare/ops/embed.js +26 -16
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +17 -19
- package/dist/server/bare/ops/load-model.d.ts +2 -2
- package/dist/server/bare/ops/load-model.js +14 -18
- package/dist/server/bare/ops/transcribe.d.ts +3 -3
- package/dist/server/bare/ops/transcribe.js +62 -62
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +53 -31
- package/dist/server/bare/ops/unload-model.d.ts +1 -1
- package/dist/server/bare/ops/unload-model.js +12 -12
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +4 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +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 +8 -8
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
- 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 +27 -26
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +33 -54
- 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 +3 -3
- 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 +23 -23
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +6 -1
- package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
- package/dist/server/bare/plugins/index.d.ts +11 -11
- package/dist/server/bare/plugins/index.js +11 -11
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +65 -80
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
- 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 +12 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +193 -19
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +9 -4
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +71 -44
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +132 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +148 -70
- 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 +19 -21
- 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 +18 -34
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +9 -2
- package/dist/server/bare/plugins/tts-ggml/plugin.js +97 -49
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
- 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 +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
- 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 +3 -3
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
- package/dist/server/bare/registry/config-registry.d.ts +1 -1
- package/dist/server/bare/registry/config-registry.js +13 -16
- package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
- package/dist/server/bare/registry/logging-stream-registry.js +2 -2
- package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-config-registry.js +6 -6
- package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
- package/dist/server/bare/registry/model-config-utils.js +35 -35
- package/dist/server/bare/registry/model-registry.d.ts +3 -3
- package/dist/server/bare/registry/model-registry.js +11 -11
- package/dist/server/bare/registry/registry-client.d.ts +1 -1
- package/dist/server/bare/registry/registry-client.js +18 -18
- package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
- package/dist/server/bare/registry/runtime-context-registry.js +3 -3
- package/dist/server/bare/runtime/disposable-scope.js +3 -3
- 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 +4 -4
- package/dist/server/bare/runtime/request-id.js +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
- package/dist/server/bare/runtime/request-registry.d.ts +27 -12
- package/dist/server/bare/runtime/request-registry.js +39 -34
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +11 -11
- package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.js +27 -31
- package/dist/server/bare/types/addon-responses.d.ts +7 -4
- package/dist/server/bare/utils/audio-input.d.ts +2 -2
- package/dist/server/bare/utils/audio-input.js +7 -7
- package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
- package/dist/server/bare/utils/transcribe-metadata.js +4 -4
- package/dist/server/bare/utils/tts-stats.d.ts +9 -5
- package/dist/server/bare/utils/tts-stats.js +8 -2
- package/dist/server/env.js +8 -8
- package/dist/server/error-handlers.d.ts +3 -3
- package/dist/server/error-handlers.js +11 -11
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/index.js +1 -1
- package/dist/server/plugins/registry.d.ts +1 -1
- package/dist/server/plugins/registry.js +12 -14
- package/dist/server/rpc/create-server.d.ts +1 -1
- package/dist/server/rpc/create-server.js +34 -13
- package/dist/server/rpc/delegate-transport.d.ts +3 -3
- package/dist/server/rpc/delegate-transport.js +43 -44
- package/dist/server/rpc/handle-request.d.ts +1 -1
- package/dist/server/rpc/handle-request.js +28 -30
- package/dist/server/rpc/handler-registry.d.ts +1 -1
- package/dist/server/rpc/handler-registry.js +102 -92
- package/dist/server/rpc/handler-selection.d.ts +3 -3
- package/dist/server/rpc/handler-selection.js +3 -3
- package/dist/server/rpc/handler-utils.d.ts +7 -7
- package/dist/server/rpc/handler-utils.js +32 -35
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
- package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
- package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/cancelHandler.js +11 -11
- package/dist/server/rpc/handlers/classify.d.ts +1 -1
- package/dist/server/rpc/handlers/classify.js +2 -2
- 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 +14 -14
- package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/completion-stream.js +2 -2
- package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
- package/dist/server/rpc/handlers/delete-cache.js +10 -10
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
- package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
- package/dist/server/rpc/handlers/download-asset.js +20 -20
- package/dist/server/rpc/handlers/embed.d.ts +1 -1
- package/dist/server/rpc/handlers/embed.js +2 -2
- package/dist/server/rpc/handlers/finetune.d.ts +1 -1
- package/dist/server/rpc/handlers/finetune.js +8 -6
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-loaded-model-info.js +15 -9
- package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +20 -20
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
- package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
- package/dist/server/rpc/handlers/heartbeat.js +1 -1
- package/dist/server/rpc/handlers/index.d.ts +35 -31
- package/dist/server/rpc/handlers/index.js +36 -32
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
- package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
- package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +42 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +100 -107
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
- package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/registry.js +50 -56
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
- package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/types.js +7 -7
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
- package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/logging-stream.js +3 -3
- package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/ocr-stream.js +2 -2
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
- package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
- package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
- package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler.js +1 -1
- package/dist/server/rpc/handlers/rag.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +50 -50
- package/dist/server/rpc/handlers/registry.d.ts +1 -1
- package/dist/server/rpc/handlers/registry.js +34 -36
- package/dist/server/rpc/handlers/resume.d.ts +1 -1
- package/dist/server/rpc/handlers/resume.js +3 -3
- package/dist/server/rpc/handlers/state.d.ts +1 -1
- package/dist/server/rpc/handlers/state.js +3 -3
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
- package/dist/server/rpc/handlers/suspend.d.ts +1 -1
- package/dist/server/rpc/handlers/suspend.js +3 -3
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
- package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech.js +2 -2
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe.js +2 -2
- package/dist/server/rpc/handlers/translate.d.ts +1 -1
- package/dist/server/rpc/handlers/translate.js +2 -2
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
- package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model.js +10 -10
- package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/upscale-stream.js +2 -2
- package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/video-stream.js +2 -2
- package/dist/server/rpc/index.d.ts +2 -2
- package/dist/server/rpc/index.js +2 -2
- package/dist/server/rpc/method-shapes.d.ts +51 -0
- package/dist/server/rpc/method-shapes.js +48 -0
- package/dist/server/rpc/profiling/context.d.ts +1 -1
- package/dist/server/rpc/profiling/context.js +9 -10
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
- package/dist/server/rpc/profiling/index.d.ts +4 -4
- package/dist/server/rpc/profiling/index.js +4 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
- package/dist/server/rpc/profiling/operation-metrics.js +122 -102
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
- package/dist/server/rpc/profiling/profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/profiler.js +9 -13
- package/dist/server/rpc/rpc-utils.js +1 -4
- package/dist/server/rpc/transport-selector.d.ts +1 -1
- package/dist/server/rpc/transport-selector.js +4 -4
- package/dist/server/utils/archive.js +27 -29
- package/dist/server/utils/audio/decoder.d.ts +2 -2
- package/dist/server/utils/audio/decoder.js +11 -11
- package/dist/server/utils/cache/auto-history.d.ts +1 -1
- package/dist/server/utils/cache/auto-history.js +15 -11
- package/dist/server/utils/cache/paths.d.ts +2 -2
- package/dist/server/utils/cache/paths.js +14 -14
- package/dist/server/utils/checksum.d.ts +1 -1
- package/dist/server/utils/checksum.js +10 -12
- package/dist/server/utils/clear-storage.d.ts +1 -1
- package/dist/server/utils/clear-storage.js +8 -11
- package/dist/server/utils/completion-normalizer.d.ts +1 -1
- package/dist/server/utils/completion-normalizer.js +106 -113
- package/dist/server/utils/config-transform.d.ts +1 -1
- package/dist/server/utils/config-transform.js +2 -2
- package/dist/server/utils/expand-gguf-shards.js +4 -4
- package/dist/server/utils/formatting.js +6 -12
- package/dist/server/utils/gguf-tensor-extractor.js +17 -21
- package/dist/server/utils/index.d.ts +11 -11
- package/dist/server/utils/index.js +11 -11
- package/dist/server/utils/multi-gpu-mobile.js +1 -1
- package/dist/server/utils/path-security.d.ts +1 -1
- package/dist/server/utils/path-security.js +6 -6
- package/dist/server/utils/qvac-paths.js +3 -3
- package/dist/server/utils/response-format.d.ts +1 -1
- package/dist/server/utils/response-format.js +4 -4
- package/dist/server/utils/shard-utils.d.ts +1 -1
- package/dist/server/utils/shard-utils.js +14 -16
- package/dist/server/utils/tool-integration.d.ts +1 -1
- package/dist/server/utils/tool-integration.js +5 -9
- package/dist/server/utils/tools/dialect.d.ts +1 -1
- package/dist/server/utils/tools/dialect.js +7 -7
- package/dist/server/utils/tools/index.d.ts +2 -2
- package/dist/server/utils/tools/index.js +2 -2
- package/dist/server/utils/tools/parser.d.ts +1 -1
- package/dist/server/utils/tools/parser.js +14 -14
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
- package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
- package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
- package/dist/server/utils/tools/parsers/harmony.js +9 -11
- package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
- package/dist/server/utils/tools/parsers/hermes.js +16 -16
- package/dist/server/utils/tools/parsers/json.d.ts +2 -2
- package/dist/server/utils/tools/parsers/json.js +14 -14
- package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
- package/dist/server/utils/tools/parsers/pythonic.js +43 -43
- package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
- package/dist/server/utils/tools/parsers/qwen35.js +20 -20
- package/dist/server/utils/tools/shared.d.ts +1 -1
- package/dist/server/utils/tools/shared.js +10 -12
- package/dist/server/utils/worker-lock.js +10 -10
- package/dist/server/worker-core.d.ts +1 -1
- package/dist/server/worker-core.js +44 -43
- package/dist/server/worker.js +9 -9
- package/dist/utils/aggregate-events.d.ts +2 -2
- package/dist/utils/aggregate-events.js +17 -19
- package/dist/utils/cache-normalize.js +1 -4
- package/dist/utils/encoding.js +1 -1
- package/dist/utils/errors-base.d.ts +1 -1
- package/dist/utils/errors-base.js +1 -1
- package/dist/utils/errors-client.d.ts +1 -1
- package/dist/utils/errors-client.js +5 -5
- package/dist/utils/errors-server.d.ts +3 -3
- package/dist/utils/errors-server.js +19 -18
- package/dist/utils/load-model-validation.js +3 -3
- package/dist/utils/mcp-adapter.d.ts +4 -4
- package/dist/utils/mcp-adapter.js +31 -38
- package/dist/utils/path-sanitize.js +14 -17
- package/dist/utils/tool-helpers.d.ts +2 -2
- package/dist/utils/tool-helpers.js +25 -26
- package/dist/utils/withTimeout.d.ts +7 -0
- package/dist/utils/withTimeout.js +11 -1
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.js +1 -1
- package/electron-forge/index.cjs +274 -317
- package/expo/plugins/patches/android-link.mjs +25 -30
- package/expo/plugins/patches/ios-link.mjs +25 -30
- package/package.json +21 -17
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { toolCallbackResultSchema } from '../../../schemas/completion-stream.js';
|
|
2
|
+
import { aggregateEvents } from '../../../utils/aggregate-events.js';
|
|
3
|
+
import { CompletionFailedError } from '../../../utils/errors-server.js';
|
|
4
|
+
import { dispatchPluginStream } from './plugin-dispatch.js';
|
|
5
|
+
const DEFAULT_MAX_TOOL_TURNS = 8;
|
|
6
|
+
// Generous ceiling on one client-side tool execution: long enough for a slow
|
|
7
|
+
// MCP round trip, short enough that a client that stopped reading can't pin a
|
|
8
|
+
// model slot forever.
|
|
9
|
+
const TOOL_RESULT_TIMEOUT_MS = 5 * 60 * 1000;
|
|
10
|
+
// A single tool result is small JSON; anything past this without a newline is a
|
|
11
|
+
// malformed/hostile client trying to grow the buffer without bound. Fail loudly
|
|
12
|
+
// instead of accumulating forever.
|
|
13
|
+
const MAX_TOOL_RESULT_LINE_BYTES = 16 * 1024 * 1024;
|
|
14
|
+
/**
|
|
15
|
+
* Reads newline-delimited JSON tool results off the duplex request stream
|
|
16
|
+
* and resolves per-callId waiters. Chunk boundaries don't align with lines,
|
|
17
|
+
* so a partial tail is buffered until its newline arrives.
|
|
18
|
+
*
|
|
19
|
+
* The pump is torn down by `close()` (called from a `finally` when
|
|
20
|
+
* orchestration ends, however it ends) so the upstream iterator is returned
|
|
21
|
+
* and the reader stops holding the request stream open.
|
|
22
|
+
*/
|
|
23
|
+
export class ToolResultReader {
|
|
24
|
+
buffer = '';
|
|
25
|
+
results = new Map();
|
|
26
|
+
waiters = new Map();
|
|
27
|
+
failed;
|
|
28
|
+
closed = false;
|
|
29
|
+
iterator;
|
|
30
|
+
constructor(inputStream) {
|
|
31
|
+
this.iterator = inputStream[Symbol.asyncIterator]();
|
|
32
|
+
void this.pump();
|
|
33
|
+
}
|
|
34
|
+
async pump() {
|
|
35
|
+
try {
|
|
36
|
+
while (!this.closed) {
|
|
37
|
+
const next = await this.iterator.next();
|
|
38
|
+
if (next.done)
|
|
39
|
+
break;
|
|
40
|
+
this.buffer += next.value.toString();
|
|
41
|
+
let nl;
|
|
42
|
+
while ((nl = this.buffer.indexOf('\n')) !== -1) {
|
|
43
|
+
const line = this.buffer.slice(0, nl);
|
|
44
|
+
this.buffer = this.buffer.slice(nl + 1);
|
|
45
|
+
if (line.trim())
|
|
46
|
+
this.accept(line);
|
|
47
|
+
}
|
|
48
|
+
if (this.buffer.length > MAX_TOOL_RESULT_LINE_BYTES) {
|
|
49
|
+
throw new CompletionFailedError('tool result frame exceeds the maximum size');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (!this.closed && this.buffer.trim())
|
|
53
|
+
this.accept(this.buffer);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
this.failWaiters(error instanceof Error ? error : new Error(String(error)));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
failWaiters(error) {
|
|
60
|
+
this.failed = error;
|
|
61
|
+
// Wake every waiter; each rethrows via waitFor's failure check.
|
|
62
|
+
for (const [callId, resolve] of this.waiters) {
|
|
63
|
+
this.waiters.delete(callId);
|
|
64
|
+
resolve({ callId, error: error.message });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
accept(line) {
|
|
68
|
+
const parsed = toolCallbackResultSchema.parse(JSON.parse(line));
|
|
69
|
+
const waiter = this.waiters.get(parsed.callId);
|
|
70
|
+
if (waiter) {
|
|
71
|
+
this.waiters.delete(parsed.callId);
|
|
72
|
+
waiter(parsed);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.results.set(parsed.callId, parsed);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async waitFor(callId, timeoutMs = TOOL_RESULT_TIMEOUT_MS) {
|
|
79
|
+
const buffered = this.results.get(callId);
|
|
80
|
+
if (buffered) {
|
|
81
|
+
this.results.delete(callId);
|
|
82
|
+
return buffered;
|
|
83
|
+
}
|
|
84
|
+
if (this.failed)
|
|
85
|
+
throw this.failed;
|
|
86
|
+
return await new Promise((resolve, reject) => {
|
|
87
|
+
const timer = setTimeout(() => {
|
|
88
|
+
this.waiters.delete(callId);
|
|
89
|
+
reject(new CompletionFailedError(`tool callback ${callId} timed out`));
|
|
90
|
+
}, timeoutMs);
|
|
91
|
+
this.waiters.set(callId, (result) => {
|
|
92
|
+
clearTimeout(timer);
|
|
93
|
+
resolve(result);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Stop the pump and release the upstream iterator. Idempotent. Pending
|
|
99
|
+
* waiters are failed so a caller blocked in `waitFor` can't hang after the
|
|
100
|
+
* stream is torn down.
|
|
101
|
+
*/
|
|
102
|
+
close() {
|
|
103
|
+
if (this.closed)
|
|
104
|
+
return;
|
|
105
|
+
this.closed = true;
|
|
106
|
+
this.buffer = '';
|
|
107
|
+
this.results.clear();
|
|
108
|
+
if (!this.failed)
|
|
109
|
+
this.failWaiters(new CompletionFailedError('tool result stream closed'));
|
|
110
|
+
void this.iterator.return?.();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The orchestration core, pure over its collaborators so it unit-tests
|
|
115
|
+
* without the plugin registry: runs completion turns, forwards their events
|
|
116
|
+
* downstream, and when a turn requests tool calls, emits `toolCallback`
|
|
117
|
+
* frames and blocks on the client's results before starting the next turn
|
|
118
|
+
* with the extended history.
|
|
119
|
+
*/
|
|
120
|
+
export async function* orchestrateCompletion(request, runTurn, reader) {
|
|
121
|
+
// Pull the loop bound out of the per-turn base; everything else (including
|
|
122
|
+
// `requestId`) flows into each inner completionStream turn. Threading the
|
|
123
|
+
// orchestrate `requestId` down is what makes `cancel({ requestId })` reach
|
|
124
|
+
// the turn that's currently generating — the expensive part a Stop button
|
|
125
|
+
// targets. Turns run strictly sequentially: turn N's request-registry entry
|
|
126
|
+
// is disposed (on the `for await` break below) before turn N+1 calls
|
|
127
|
+
// `begin(...)`, so reusing the id can't collide in `entries`. A cancel that
|
|
128
|
+
// lands between turns (during a tool-result wait) is caught by the
|
|
129
|
+
// registry's cancel-before-begin tripwire and aborts the next turn's
|
|
130
|
+
// `begin(...)`. Each turn's `history` and `type` are set below.
|
|
131
|
+
const { maxToolTurns, ...turnBase } = request;
|
|
132
|
+
const maxTurns = maxToolTurns ?? DEFAULT_MAX_TOOL_TURNS;
|
|
133
|
+
let history = [...request.history];
|
|
134
|
+
for (let turn = 0; turn < maxTurns; turn++) {
|
|
135
|
+
const turnEvents = [];
|
|
136
|
+
const innerRequest = {
|
|
137
|
+
...turnBase,
|
|
138
|
+
history,
|
|
139
|
+
type: 'completionStream'
|
|
140
|
+
};
|
|
141
|
+
for await (const response of runTurn(innerRequest)) {
|
|
142
|
+
turnEvents.push(...response.events);
|
|
143
|
+
yield { type: 'completionOrchestrate', turn, events: response.events };
|
|
144
|
+
if (response.done)
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
const { toolCalls, rawFullText, contentText, error, cancelled } = aggregateEvents(turnEvents);
|
|
148
|
+
// Terminal turn: the model answered (or failed/was cancelled) without
|
|
149
|
+
// requesting tools — the client folds the forwarded events itself.
|
|
150
|
+
if (error || cancelled || toolCalls.length === 0) {
|
|
151
|
+
yield { type: 'completionOrchestrate', done: true };
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
// The assistant's tool-call turn goes back verbatim so the model sees
|
|
155
|
+
// its own call syntax; each result follows as a `tool` message.
|
|
156
|
+
history = [...history, { role: 'assistant', content: rawFullText ?? contentText }];
|
|
157
|
+
for (const call of toolCalls) {
|
|
158
|
+
yield {
|
|
159
|
+
type: 'completionOrchestrate',
|
|
160
|
+
turn,
|
|
161
|
+
toolCallback: { callId: call.id, name: call.name, arguments: call.arguments }
|
|
162
|
+
};
|
|
163
|
+
const result = await reader.waitFor(call.id);
|
|
164
|
+
const content = result.error !== undefined
|
|
165
|
+
? JSON.stringify({ error: result.error })
|
|
166
|
+
: JSON.stringify(result.result ?? null);
|
|
167
|
+
history = [...history, { role: 'tool', content }];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Turn cap reached without a natural end. Emit a terminal done frame with a
|
|
171
|
+
// stopReason so the client can tell this was truncated (the model still
|
|
172
|
+
// wanted a tool) rather than a natural finish; the last turn's events carry
|
|
173
|
+
// whatever the model produced.
|
|
174
|
+
yield { type: 'completionOrchestrate', done: true, stopReason: 'maxToolTurns' };
|
|
175
|
+
}
|
|
176
|
+
export async function* handleCompletionOrchestrate(request, inputStream) {
|
|
177
|
+
const reader = new ToolResultReader(inputStream);
|
|
178
|
+
const runTurn = async function* (innerRequest) {
|
|
179
|
+
yield* dispatchPluginStream(innerRequest.modelId, 'completionStream', innerRequest);
|
|
180
|
+
};
|
|
181
|
+
try {
|
|
182
|
+
yield* orchestrateCompletion(request, runTurn, reader);
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
// Tear the reader down however orchestration ends -- natural finish, turn
|
|
186
|
+
// cap, error, or the client abandoning the stream -- so the pump stops and
|
|
187
|
+
// the request stream isn't held open.
|
|
188
|
+
reader.close();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompletionStreamRequest, CompletionStreamResponse } from
|
|
2
|
-
import type { DelegatedHandlerOptions } from
|
|
1
|
+
import type { CompletionStreamRequest, CompletionStreamResponse } from '../../../schemas/index';
|
|
2
|
+
import type { DelegatedHandlerOptions } from '../profiling/index';
|
|
3
3
|
export type HandleCompletionStreamDelegatedOptions = DelegatedHandlerOptions;
|
|
4
4
|
export declare function handleCompletionStreamDelegated(request: CompletionStreamRequest, options?: HandleCompletionStreamDelegatedOptions): AsyncGenerator<CompletionStreamResponse>;
|
|
5
5
|
//# sourceMappingURL=completion-stream-delegated.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getModelEntry } from
|
|
2
|
-
import { getRPC } from
|
|
3
|
-
import { stream } from
|
|
4
|
-
import { ModelIsDelegatedError } from
|
|
5
|
-
import { getServerLogger } from
|
|
1
|
+
import { getModelEntry } from '../../bare/registry/model-registry.js';
|
|
2
|
+
import { getRPC } from '../../bare/delegate-rpc-client.js';
|
|
3
|
+
import { stream } from '../delegate-transport.js';
|
|
4
|
+
import { ModelIsDelegatedError } from '../../../utils/errors-server.js';
|
|
5
|
+
import { getServerLogger } from '../../../logging/index.js';
|
|
6
6
|
const logger = getServerLogger();
|
|
7
7
|
export async function* handleCompletionStreamDelegated(request, options) {
|
|
8
8
|
const { profilingMeta } = options ?? {};
|
|
@@ -13,7 +13,7 @@ export async function* handleCompletionStreamDelegated(request, options) {
|
|
|
13
13
|
}
|
|
14
14
|
const { providerPublicKey, timeout, healthCheckTimeout } = entry.delegated;
|
|
15
15
|
try {
|
|
16
|
-
logger.debug(`📤 Sending delegated completionStream request to provider: ${providerPublicKey}${timeout ? `, timeout: ${timeout}ms` :
|
|
16
|
+
logger.debug(`📤 Sending delegated completionStream request to provider: ${providerPublicKey}${timeout ? `, timeout: ${timeout}ms` : ''}`);
|
|
17
17
|
const rpc = await getRPC(providerPublicKey, { timeout, healthCheckTimeout });
|
|
18
18
|
// Build delegate options with profiling metadata
|
|
19
19
|
const delegateOpts = { peerKey: providerPublicKey };
|
|
@@ -31,21 +31,21 @@ export async function* handleCompletionStreamDelegated(request, options) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
|
-
logger.error(
|
|
34
|
+
logger.error('Error in delegated completion stream:', error);
|
|
35
35
|
const message = error instanceof Error ? error.message : String(error);
|
|
36
36
|
yield {
|
|
37
|
-
type:
|
|
37
|
+
type: 'completionStream',
|
|
38
38
|
done: true,
|
|
39
39
|
events: [
|
|
40
40
|
{
|
|
41
|
-
type:
|
|
41
|
+
type: 'completionDone',
|
|
42
42
|
seq: 0,
|
|
43
|
-
stopReason:
|
|
43
|
+
stopReason: 'error',
|
|
44
44
|
error: {
|
|
45
|
-
message: `Error communicating with provider: ${message}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]
|
|
45
|
+
message: `Error communicating with provider: ${message}`
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CompletionStreamRequest, CompletionStreamResponse } from
|
|
1
|
+
import type { CompletionStreamRequest, CompletionStreamResponse } from '../../../schemas/index';
|
|
2
2
|
export declare function handleCompletionStream(request: CompletionStreamRequest): AsyncGenerator<CompletionStreamResponse>;
|
|
3
3
|
//# sourceMappingURL=completion-stream.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchPluginStream } from
|
|
1
|
+
import { dispatchPluginStream } from './plugin-dispatch.js';
|
|
2
2
|
export async function* handleCompletionStream(request) {
|
|
3
|
-
yield* dispatchPluginStream(request.modelId,
|
|
3
|
+
yield* dispatchPluginStream(request.modelId, 'completionStream', request);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeleteCacheRequest, DeleteCacheResponse } from
|
|
1
|
+
import type { DeleteCacheRequest, DeleteCacheResponse } from '../../../schemas/index';
|
|
2
2
|
/**
|
|
3
3
|
* RPC handler for `deleteCache(...)`. The three KV-cache bookkeeping
|
|
4
4
|
* layers (on-disk `.bin`, `initializedCaches`, `cachedMessageCounts`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { deleteKvCacheState } from
|
|
2
|
-
import { getServerLogger } from
|
|
1
|
+
import { deleteKvCacheState } from '../../bare/plugins/llamacpp-completion/ops/kv-cache-session.js';
|
|
2
|
+
import { getServerLogger } from '../../../logging/index.js';
|
|
3
3
|
const logger = getServerLogger();
|
|
4
4
|
/**
|
|
5
5
|
* RPC handler for `deleteCache(...)`. The three KV-cache bookkeeping
|
|
@@ -12,26 +12,26 @@ const logger = getServerLogger();
|
|
|
12
12
|
*/
|
|
13
13
|
export async function handleDeleteCache(request) {
|
|
14
14
|
try {
|
|
15
|
-
if (
|
|
15
|
+
if ('all' in request && request.all) {
|
|
16
16
|
await deleteKvCacheState({ all: true });
|
|
17
17
|
}
|
|
18
|
-
else if (
|
|
18
|
+
else if ('kvCacheKey' in request) {
|
|
19
19
|
await deleteKvCacheState({
|
|
20
20
|
kvCacheKey: request.kvCacheKey,
|
|
21
|
-
...(request.modelId !== undefined && { modelId: request.modelId })
|
|
21
|
+
...(request.modelId !== undefined && { modelId: request.modelId })
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
|
-
type:
|
|
26
|
-
success: true
|
|
25
|
+
type: 'deleteCache',
|
|
26
|
+
success: true
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
|
-
logger.error(
|
|
30
|
+
logger.error('Error deleting cache:', error);
|
|
31
31
|
return {
|
|
32
|
-
type:
|
|
32
|
+
type: 'deleteCache',
|
|
33
33
|
success: false,
|
|
34
|
-
error: error instanceof Error ? error.message :
|
|
34
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DiffusionStreamRequest, DiffusionStreamResponse } from
|
|
1
|
+
import type { DiffusionStreamRequest, DiffusionStreamResponse } from '../../../schemas/sdcpp-config';
|
|
2
2
|
export declare function handleDiffusionStream(request: DiffusionStreamRequest): AsyncGenerator<DiffusionStreamResponse>;
|
|
3
3
|
//# sourceMappingURL=diffusion-stream.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchPluginStream } from
|
|
1
|
+
import { dispatchPluginStream } from './plugin-dispatch.js';
|
|
2
2
|
export async function* handleDiffusionStream(request) {
|
|
3
|
-
yield* dispatchPluginStream(request.modelId,
|
|
3
|
+
yield* dispatchPluginStream(request.modelId, 'diffusionStream', request);
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DownloadAssetRequest, DownloadAssetResponse, ModelProgressUpdate } from
|
|
1
|
+
import type { DownloadAssetRequest, DownloadAssetResponse, ModelProgressUpdate } from '../../../schemas/index';
|
|
2
2
|
export declare function handleDownloadAsset(request: DownloadAssetRequest, progressCallback?: (update: ModelProgressUpdate) => void): Promise<DownloadAssetResponse>;
|
|
3
3
|
//# sourceMappingURL=download-asset.d.ts.map
|
|
@@ -50,14 +50,14 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { PROFILING_KEY, OPERATION_EVENT_KEY
|
|
54
|
-
import { resolveModelPath, resolveModelPathWithStats
|
|
55
|
-
import { buildDownloadProfilingFields
|
|
56
|
-
import { nowMs, generateProfileId } from
|
|
57
|
-
import { getServerLogger } from
|
|
58
|
-
import { getRequestRegistry, withRequestContext
|
|
59
|
-
import { generateServerRequestId } from
|
|
60
|
-
import { InferenceCancelledError } from
|
|
53
|
+
import { PROFILING_KEY, OPERATION_EVENT_KEY } from '../../../schemas/index.js';
|
|
54
|
+
import { resolveModelPath, resolveModelPathWithStats } from './load-model/resolve.js';
|
|
55
|
+
import { buildDownloadProfilingFields } from './load-model/types.js';
|
|
56
|
+
import { nowMs, generateProfileId } from '../../../profiling/clock.js';
|
|
57
|
+
import { getServerLogger } from '../../../logging/index.js';
|
|
58
|
+
import { getRequestRegistry, withRequestContext } from '../../bare/runtime/index.js';
|
|
59
|
+
import { generateServerRequestId } from '../../bare/runtime/request-id.js';
|
|
60
|
+
import { InferenceCancelledError } from '../../../utils/errors-server.js';
|
|
61
61
|
const logger = getServerLogger();
|
|
62
62
|
export async function handleDownloadAsset(request, progressCallback) {
|
|
63
63
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
@@ -72,7 +72,7 @@ export async function handleDownloadAsset(request, progressCallback) {
|
|
|
72
72
|
// non-match for this kind.
|
|
73
73
|
const ctx = __addDisposableResource(env_1, await getRequestRegistry().begin({
|
|
74
74
|
requestId,
|
|
75
|
-
kind:
|
|
75
|
+
kind: 'downloadAsset'
|
|
76
76
|
}), true);
|
|
77
77
|
const log = withRequestContext(getServerLogger(), ctx);
|
|
78
78
|
log.debug(`downloadAsset start assetSrc=${assetSrc}`);
|
|
@@ -80,8 +80,8 @@ export async function handleDownloadAsset(request, progressCallback) {
|
|
|
80
80
|
requestBinding: {
|
|
81
81
|
signal: ctx.signal,
|
|
82
82
|
scope: ctx.scope,
|
|
83
|
-
requestId
|
|
84
|
-
}
|
|
83
|
+
requestId
|
|
84
|
+
}
|
|
85
85
|
};
|
|
86
86
|
try {
|
|
87
87
|
const totalDownloadStart = profilingEnabled ? nowMs() : 0;
|
|
@@ -96,22 +96,22 @@ export async function handleDownloadAsset(request, progressCallback) {
|
|
|
96
96
|
await resolveModelPath(assetSrc, progressCallback, seed, ctx.signal, hooks);
|
|
97
97
|
}
|
|
98
98
|
const response = {
|
|
99
|
-
type:
|
|
99
|
+
type: 'downloadAsset',
|
|
100
100
|
success: true,
|
|
101
|
-
assetId: assetSrc
|
|
101
|
+
assetId: assetSrc
|
|
102
102
|
};
|
|
103
103
|
if (profilingEnabled) {
|
|
104
104
|
const totalDownloadTimeMs = nowMs() - totalDownloadStart;
|
|
105
105
|
const profileId = profilingMeta?.id ?? generateProfileId();
|
|
106
106
|
const { gauges, tags } = buildDownloadProfilingFields(downloadStats, sourceType);
|
|
107
|
-
gauges[
|
|
107
|
+
gauges['totalDownloadTime'] = totalDownloadTimeMs;
|
|
108
108
|
const operationEvent = {
|
|
109
|
-
op:
|
|
110
|
-
kind:
|
|
109
|
+
op: 'downloadAsset',
|
|
110
|
+
kind: 'handler',
|
|
111
111
|
ms: totalDownloadTimeMs,
|
|
112
112
|
profileId,
|
|
113
113
|
gauges: Object.keys(gauges).length > 0 ? gauges : undefined,
|
|
114
|
-
tags: Object.keys(tags).length > 0 ? tags : undefined
|
|
114
|
+
tags: Object.keys(tags).length > 0 ? tags : undefined
|
|
115
115
|
};
|
|
116
116
|
response[OPERATION_EVENT_KEY] = operationEvent;
|
|
117
117
|
}
|
|
@@ -126,11 +126,11 @@ export async function handleDownloadAsset(request, progressCallback) {
|
|
|
126
126
|
log.info(`downloadAsset cancelled requestId=${requestId}`);
|
|
127
127
|
throw error;
|
|
128
128
|
}
|
|
129
|
-
logger.error(
|
|
129
|
+
logger.error('Error downloading asset:', error);
|
|
130
130
|
return {
|
|
131
|
-
type:
|
|
131
|
+
type: 'downloadAsset',
|
|
132
132
|
success: false,
|
|
133
|
-
error: error instanceof Error ? error.message :
|
|
133
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { EmbedRequest, EmbedResponse } from
|
|
1
|
+
import type { EmbedRequest, EmbedResponse } from '../../../schemas/index';
|
|
2
2
|
export declare function handleEmbed(request: EmbedRequest): Promise<EmbedResponse>;
|
|
3
3
|
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchPluginReply } from
|
|
1
|
+
import { dispatchPluginReply } from './plugin-dispatch.js';
|
|
2
2
|
export async function handleEmbed(request) {
|
|
3
|
-
return dispatchPluginReply(request.modelId,
|
|
3
|
+
return dispatchPluginReply(request.modelId, 'embed', request);
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FinetuneProgressResponse, FinetuneRequest, FinetuneResult } from
|
|
1
|
+
import type { FinetuneProgressResponse, FinetuneRequest, FinetuneResult } from '../../../schemas/index';
|
|
2
2
|
export declare function handleFinetune(request: FinetuneRequest, progressCallback?: (update: FinetuneProgressResponse) => void): Promise<FinetuneResult>;
|
|
3
3
|
//# sourceMappingURL=finetune.d.ts.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { dispatchPluginReply } from
|
|
2
|
-
import { startFinetune } from
|
|
1
|
+
import { dispatchPluginReply } from './plugin-dispatch.js';
|
|
2
|
+
import { startFinetune } from '../../bare/plugins/llamacpp-completion/ops/finetune.js';
|
|
3
3
|
export async function handleFinetune(request, progressCallback) {
|
|
4
4
|
if (progressCallback &&
|
|
5
|
-
(request.operation ===
|
|
5
|
+
(request.operation === 'start' ||
|
|
6
|
+
request.operation === 'resume' ||
|
|
7
|
+
request.operation === undefined)) {
|
|
6
8
|
return startFinetune(request, (progress) => {
|
|
7
9
|
const update = {
|
|
8
|
-
type:
|
|
10
|
+
type: 'finetune:progress',
|
|
9
11
|
modelId: request.modelId,
|
|
10
|
-
...progress
|
|
12
|
+
...progress
|
|
11
13
|
};
|
|
12
14
|
progressCallback(update);
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
|
-
return dispatchPluginReply(request.modelId,
|
|
17
|
+
return dispatchPluginReply(request.modelId, 'finetune', request);
|
|
16
18
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { GetLoadedModelInfoRequest, GetLoadedModelInfoResponse } from
|
|
1
|
+
import type { GetLoadedModelInfoRequest, GetLoadedModelInfoResponse } from '../../../schemas/index';
|
|
2
2
|
export declare function handleGetLoadedModelInfo(request: GetLoadedModelInfoRequest): GetLoadedModelInfoResponse;
|
|
3
3
|
//# sourceMappingURL=get-loaded-model-info.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { getModelEntry } from
|
|
2
|
-
import { getPlugin } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { getModelEntry } from '../../bare/registry/model-registry.js';
|
|
2
|
+
import { getPlugin } from '../../plugins/registry.js';
|
|
3
|
+
import { detectToolDialectFromName } from '../../utils/tools/index.js';
|
|
4
|
+
import { ModelNotFoundError } from '../../../utils/errors-server.js';
|
|
5
|
+
import { getServerLogger } from '../../../logging/index.js';
|
|
5
6
|
const logger = getServerLogger();
|
|
6
7
|
export function handleGetLoadedModelInfo(request) {
|
|
7
8
|
const { modelId } = request;
|
|
@@ -15,25 +16,30 @@ export function handleGetLoadedModelInfo(request) {
|
|
|
15
16
|
isDelegated: true,
|
|
16
17
|
handlers: [],
|
|
17
18
|
providerInfo: {
|
|
18
|
-
providerPublicKey: entry.delegated.providerPublicKey
|
|
19
|
-
}
|
|
19
|
+
providerPublicKey: entry.delegated.providerPublicKey
|
|
20
|
+
}
|
|
20
21
|
};
|
|
21
|
-
return { type:
|
|
22
|
+
return { type: 'getLoadedModelInfo', info };
|
|
22
23
|
}
|
|
23
24
|
const plugin = getPlugin(entry.local.modelType);
|
|
24
25
|
if (!plugin) {
|
|
25
26
|
logger.warn(`getLoadedModelInfo: no plugin registered for modelType "${entry.local.modelType}" on loaded model "${modelId}"`);
|
|
26
27
|
}
|
|
28
|
+
const handlers = plugin ? Object.keys(plugin.handlers) : [];
|
|
27
29
|
const info = {
|
|
28
30
|
modelId: entry.id,
|
|
29
31
|
isDelegated: false,
|
|
30
32
|
modelType: entry.local.modelType,
|
|
31
|
-
handlers
|
|
33
|
+
handlers,
|
|
32
34
|
loadedAt: entry.local.loadedAt,
|
|
33
35
|
...(plugin && { displayName: plugin.displayName }),
|
|
34
36
|
...(plugin && { addonPackage: plugin.addonPackage }),
|
|
35
37
|
...(entry.local.name && { name: entry.local.name }),
|
|
36
38
|
...(entry.local.path && { path: entry.local.path }),
|
|
39
|
+
// Same detection the completion normalizer uses, so callers see the dialect it parses.
|
|
40
|
+
...(handlers.includes('completionStream') && {
|
|
41
|
+
toolDialect: detectToolDialectFromName(entry.local.name, entry.local.path)
|
|
42
|
+
})
|
|
37
43
|
};
|
|
38
|
-
return { type:
|
|
44
|
+
return { type: 'getLoadedModelInfo', info };
|
|
39
45
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { GetModelInfoRequest, GetModelInfoResponse } from
|
|
1
|
+
import type { GetModelInfoRequest, GetModelInfoResponse } from '../../../schemas/index';
|
|
2
2
|
export declare function handleGetModelInfo(request: GetModelInfoRequest): Promise<GetModelInfoResponse>;
|
|
3
3
|
//# sourceMappingURL=get-model-info.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { models } from
|
|
2
|
-
import { getAllModelIds, getModelEntry
|
|
3
|
-
import { generateShortHash } from
|
|
4
|
-
import { promises as fsPromises } from
|
|
5
|
-
import { getShardPath, getModelsCacheDir, getSingleFileCachePath
|
|
6
|
-
import { validateAndJoinPath } from
|
|
7
|
-
import { ModelNotFoundError } from
|
|
1
|
+
import { models } from '../../../models/registry/models.js';
|
|
2
|
+
import { getAllModelIds, getModelEntry } from '../../bare/registry/model-registry.js';
|
|
3
|
+
import { generateShortHash } from '../../utils/index.js';
|
|
4
|
+
import { promises as fsPromises } from 'bare-fs';
|
|
5
|
+
import { getShardPath, getModelsCacheDir, getSingleFileCachePath } from '../../utils/cache/paths.js';
|
|
6
|
+
import { validateAndJoinPath } from '../../utils/path-security.js';
|
|
7
|
+
import { ModelNotFoundError } from '../../../utils/errors-server.js';
|
|
8
8
|
export async function handleGetModelInfo(request) {
|
|
9
9
|
const { name } = request;
|
|
10
10
|
const catalogEntry = models.find((m) => m.name === name);
|
|
@@ -31,7 +31,7 @@ export async function handleGetModelInfo(request) {
|
|
|
31
31
|
const instance = {
|
|
32
32
|
registryId: id,
|
|
33
33
|
loadedAt: entry.local.loadedAt,
|
|
34
|
-
config: entry.local.config
|
|
34
|
+
config: entry.local.config
|
|
35
35
|
};
|
|
36
36
|
loadedInstances.push(instance);
|
|
37
37
|
}
|
|
@@ -57,18 +57,18 @@ export async function handleGetModelInfo(request) {
|
|
|
57
57
|
cacheFiles,
|
|
58
58
|
actualSize,
|
|
59
59
|
cachedAt,
|
|
60
|
-
loadedInstances: loadedInstances.length > 0 ? loadedInstances : undefined
|
|
60
|
+
loadedInstances: loadedInstances.length > 0 ? loadedInstances : undefined
|
|
61
61
|
};
|
|
62
62
|
return {
|
|
63
|
-
type:
|
|
64
|
-
modelInfo
|
|
63
|
+
type: 'getModelInfo',
|
|
64
|
+
modelInfo
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
async function handleShardedModel(cacheKey, shardMetadata) {
|
|
68
68
|
const fileEntries = shardMetadata.map((s) => ({
|
|
69
69
|
filename: s.filename,
|
|
70
70
|
expectedSize: s.expectedSize,
|
|
71
|
-
sha256Checksum: s.sha256Checksum
|
|
71
|
+
sha256Checksum: s.sha256Checksum
|
|
72
72
|
}));
|
|
73
73
|
const paths = shardMetadata.map((s) => getShardPath(cacheKey, s.filename));
|
|
74
74
|
return checkCacheStatus(fileEntries, paths);
|
|
@@ -80,21 +80,21 @@ async function handleCompanionSetModel(companionSet, primaryRegistryPath, addon)
|
|
|
80
80
|
filename: f.targetName,
|
|
81
81
|
expectedSize: f.expectedSize,
|
|
82
82
|
sha256Checksum: f.sha256Checksum,
|
|
83
|
-
key: f.key
|
|
83
|
+
key: f.key
|
|
84
84
|
}));
|
|
85
|
-
const canonicalPaths = files.map((f) => validateAndJoinPath(baseCache,
|
|
85
|
+
const canonicalPaths = files.map((f) => validateAndJoinPath(baseCache, 'sets', setKey, f.targetName));
|
|
86
86
|
const canonicalResult = await checkCacheStatus(fileEntries, canonicalPaths, primaryKey);
|
|
87
87
|
if (canonicalResult.isCached)
|
|
88
88
|
return canonicalResult;
|
|
89
|
-
const isOnnxSet = files.some((f) => f.primary === true && f.targetName.endsWith(
|
|
89
|
+
const isOnnxSet = files.some((f) => f.primary === true && f.targetName.endsWith('.onnx'));
|
|
90
90
|
if (isOnnxSet) {
|
|
91
91
|
const legacyCacheKey = generateShortHash(primaryRegistryPath);
|
|
92
|
-
const legacyPaths = files.map((f) => validateAndJoinPath(baseCache,
|
|
92
|
+
const legacyPaths = files.map((f) => validateAndJoinPath(baseCache, 'onnx', legacyCacheKey, f.targetName));
|
|
93
93
|
const legacyResult = await checkCacheStatus(fileEntries, legacyPaths, primaryKey);
|
|
94
94
|
if (legacyResult.isCached)
|
|
95
95
|
return legacyResult;
|
|
96
96
|
}
|
|
97
|
-
else if (addon ===
|
|
97
|
+
else if (addon === 'nmt') {
|
|
98
98
|
// Legacy flat-cache compatibility for Bergamot-style companion sets.
|
|
99
99
|
// This is valid only for families whose runtime still works with explicit
|
|
100
100
|
// per-file absolute paths; it is not a generic rule for all companion sets.
|
|
@@ -147,7 +147,7 @@ async function checkCacheStatus(files, paths, primaryKey) {
|
|
|
147
147
|
sha256Checksum: file.sha256Checksum,
|
|
148
148
|
isCached: fileCached,
|
|
149
149
|
actualSize: fileActualSize,
|
|
150
|
-
cachedAt: fileCachedAt
|
|
150
|
+
cachedAt: fileCachedAt
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
if (!primaryPath && cacheFiles.length > 0) {
|
|
@@ -156,7 +156,7 @@ async function checkCacheStatus(files, paths, primaryKey) {
|
|
|
156
156
|
const result = {
|
|
157
157
|
cacheFiles,
|
|
158
158
|
isCached: allCached,
|
|
159
|
-
primaryPath
|
|
159
|
+
primaryPath
|
|
160
160
|
};
|
|
161
161
|
if (allCached) {
|
|
162
162
|
result.actualSize = totalActualSize;
|
|
@@ -167,7 +167,7 @@ async function checkCacheStatus(files, paths, primaryKey) {
|
|
|
167
167
|
return result;
|
|
168
168
|
}
|
|
169
169
|
async function handleSingleFileModel(registryPath, expectedSize, sha256Checksum) {
|
|
170
|
-
const filename = registryPath.split(
|
|
170
|
+
const filename = registryPath.split('/').pop() || registryPath;
|
|
171
171
|
const filePath = getSingleFileCachePath(registryPath);
|
|
172
172
|
return checkCacheStatus([{ filename, expectedSize, sha256Checksum }], [filePath]);
|
|
173
173
|
}
|