@qvac/sdk 0.14.0 → 0.15.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 +27 -11
- 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 +1 -1
- package/dist/client/api/ocr.js +11 -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 -14
- 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 +1 -1
- package/dist/client/api/video.js +16 -14
- 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 +1 -1
- package/dist/client/api/vla.js +13 -13
- 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 +14 -14
- 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.d.ts +1 -1
- package/dist/commands/bundle/entry-gen.js +10 -10
- package/dist/commands/bundle/index.js +47 -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.d.ts +6 -0
- package/dist/commands/bundle/resolve-sdk-import.js +53 -0
- 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-img2img.js +13 -13
- 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.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 +16 -18
- 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.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-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 +429 -122
- package/dist/models/registry/models.js +13693 -13369
- 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 +177 -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 +194 -25
- package/dist/schemas/common.js +40 -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 +4 -3
- package/dist/schemas/completion-stream.js +51 -67
- 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 +8 -8
- 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 +2 -2
- package/dist/schemas/engine-addon-map.js +24 -24
- 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 +35 -41
- package/dist/schemas/get-loaded-model-info.d.ts +1 -1
- package/dist/schemas/get-loaded-model-info.js +10 -10
- 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 +33 -25
- package/dist/schemas/llamacpp-config.js +43 -30
- package/dist/schemas/load-model.d.ts +160 -128
- package/dist/schemas/load-model.js +120 -126
- 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 +9 -10
- package/dist/schemas/plugin.js +47 -47
- 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 +14 -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 +9 -9
- package/dist/schemas/sdcpp-config.js +298 -300
- package/dist/schemas/sdk-config.d.ts +55 -43
- 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 +200 -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 +455 -3
- package/dist/schemas/text-to-speech.js +146 -110
- package/dist/schemas/tools.d.ts +1 -1
- package/dist/schemas/tools.js +17 -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 +38 -67
- 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 +1 -1
- package/dist/schemas/vla.js +30 -30
- 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 +39 -30
- 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 +2 -2
- 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 +38 -38
- 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 +1 -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 +55 -59
- 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.js +4 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +186 -17
- 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 +3 -3
- 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 +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +42 -44
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +4 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +69 -63
- 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 +22 -24
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +3 -2
- package/dist/server/bare/plugins/tts-ggml/plugin.js +95 -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 +5 -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 +1 -1
- package/dist/server/bare/utils/tts-stats.js +3 -3
- 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 +11 -12
- 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 +97 -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-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 +9 -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 +33 -31
- package/dist/server/rpc/handlers/index.js +34 -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/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 +102 -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 +5 -5
- 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 +17 -16
|
@@ -1,66 +1,62 @@
|
|
|
1
|
-
import { parseToolCalls } from
|
|
1
|
+
import { parseToolCalls } from './tools/index.js';
|
|
2
2
|
const DIALECT_SPECS = {
|
|
3
3
|
hermes: {
|
|
4
|
-
toolFrames: [{ open:
|
|
4
|
+
toolFrames: [{ open: '<tool_call>', close: '</tool_call>' }]
|
|
5
5
|
},
|
|
6
6
|
// No streaming framing — tool calls are only recovered at finalization.
|
|
7
7
|
json: {
|
|
8
|
-
toolFrames: []
|
|
8
|
+
toolFrames: []
|
|
9
9
|
},
|
|
10
10
|
pythonic: {
|
|
11
11
|
toolFrames: [
|
|
12
|
-
{ open:
|
|
12
|
+
{ open: '<|tool_call_start|>', close: '<|tool_call_end|>' },
|
|
13
13
|
{
|
|
14
|
-
open:
|
|
15
|
-
close:
|
|
16
|
-
}
|
|
17
|
-
]
|
|
14
|
+
open: '<|start_header_id|>tool_call<|end_header_id|>',
|
|
15
|
+
close: '<|eot_id|>'
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
18
|
},
|
|
19
19
|
harmony: {
|
|
20
|
-
toolFrames: [
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
thinkingFrames: [
|
|
24
|
-
{ open: "<|channel|>analysis<|message|>", close: "<|end|>" },
|
|
25
|
-
],
|
|
20
|
+
toolFrames: [{ open: '<|channel|>commentary to=functions.', close: '<|call|>' }],
|
|
21
|
+
thinkingFrames: [{ open: '<|channel|>analysis<|message|>', close: '<|end|>' }],
|
|
26
22
|
contentFrames: [
|
|
27
|
-
{ open:
|
|
28
|
-
{ open:
|
|
23
|
+
{ open: '<|channel|>final<|message|>', close: '<|return|>' },
|
|
24
|
+
{ open: '<|channel|>assistant<|message|>', close: '<|end|>' }
|
|
29
25
|
],
|
|
30
26
|
// Role headers and stray Harmony control tokens between frames.
|
|
31
27
|
dropTokens: [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
'<|message|>',
|
|
29
|
+
'<|end|>',
|
|
30
|
+
'<|start|>assistant',
|
|
31
|
+
'<|start|>system',
|
|
32
|
+
'<|start|>user',
|
|
33
|
+
'<|return|>'
|
|
38
34
|
],
|
|
39
|
-
contentDropTokens: [
|
|
35
|
+
contentDropTokens: ['<|channel|>']
|
|
40
36
|
},
|
|
41
37
|
qwen35: {
|
|
42
38
|
// Same <tool_call>…</tool_call> framing as hermes; inner content is XML.
|
|
43
|
-
toolFrames: [{ open:
|
|
39
|
+
toolFrames: [{ open: '<tool_call>', close: '</tool_call>' }]
|
|
44
40
|
},
|
|
45
41
|
gemma4: {
|
|
46
|
-
toolFrames: [{ open:
|
|
47
|
-
thinkingFrames: [{ open:
|
|
48
|
-
}
|
|
42
|
+
toolFrames: [{ open: '<|tool_call>', close: '<tool_call|>' }],
|
|
43
|
+
thinkingFrames: [{ open: '<|channel>thought', close: '<channel|>' }]
|
|
44
|
+
}
|
|
49
45
|
};
|
|
50
46
|
// Capture-gated reasoning marker — the generic `<think>...</think>`
|
|
51
47
|
// convention used by reasoning-tuned models. When the gate is off the
|
|
52
48
|
// markers pass through into `contentDelta` unchanged (preserves the
|
|
53
49
|
// pre-dialect behavior).
|
|
54
|
-
const BUILTIN_THINKING = { open:
|
|
50
|
+
const BUILTIN_THINKING = { open: '<think>', close: '</think>' };
|
|
55
51
|
export function createCompletionNormalizer(config) {
|
|
56
52
|
let seq = 0;
|
|
57
|
-
let state =
|
|
58
|
-
let rawText =
|
|
53
|
+
let state = 'content';
|
|
54
|
+
let rawText = '';
|
|
59
55
|
const contentParts = [];
|
|
60
56
|
const thinkingParts = [];
|
|
61
57
|
// Tool frame: buffer keeps the open + close markers in place so
|
|
62
58
|
// `parseToolCalls` can match its own dialect markers.
|
|
63
|
-
let toolCallBuffer =
|
|
59
|
+
let toolCallBuffer = '';
|
|
64
60
|
let activeToolFrame = null;
|
|
65
61
|
// Thinking frame: tracks which frame's close marker we're scanning for
|
|
66
62
|
// (could be the built-in `<think>` or a dialect-specific frame like
|
|
@@ -70,25 +66,22 @@ export function createCompletionNormalizer(config) {
|
|
|
70
66
|
let activeContentFrame = null;
|
|
71
67
|
// Trailing chars that could be a prefix of a watched marker, so markers
|
|
72
68
|
// split across token pushes aren't missed by indexOf.
|
|
73
|
-
let contentTail =
|
|
74
|
-
let toolFramingTail =
|
|
75
|
-
let thinkingFramingTail =
|
|
76
|
-
let contentFramingTail =
|
|
69
|
+
let contentTail = '';
|
|
70
|
+
let toolFramingTail = '';
|
|
71
|
+
let thinkingFramingTail = '';
|
|
72
|
+
let contentFramingTail = '';
|
|
77
73
|
const streamedToolCallKeys = new Set();
|
|
78
|
-
const toolsEnabled = config.tools.length > 0 && config.capabilities.toolCalling !==
|
|
79
|
-
const useToolFraming = toolsEnabled && config.capabilities.toolCalling ===
|
|
74
|
+
const toolsEnabled = config.tools.length > 0 && config.capabilities.toolCalling !== 'none';
|
|
75
|
+
const useToolFraming = toolsEnabled && config.capabilities.toolCalling === 'textParse';
|
|
80
76
|
// Register `<think>` only when both capability + capture opt in.
|
|
81
77
|
// Dialect protocol markers always register; capture only gates emission.
|
|
82
|
-
const useBuiltinThinkTags = config.captureThinking &&
|
|
83
|
-
|
|
84
|
-
const dialect = config.toolDialect ?? "hermes";
|
|
78
|
+
const useBuiltinThinkTags = config.captureThinking && config.capabilities.thinkingFraming === 'thinkTags';
|
|
79
|
+
const dialect = config.toolDialect ?? 'hermes';
|
|
85
80
|
const dialectSpec = DIALECT_SPECS[dialect];
|
|
86
|
-
const toolFrames = useToolFraming
|
|
87
|
-
? dialectSpec.toolFrames
|
|
88
|
-
: [];
|
|
81
|
+
const toolFrames = useToolFraming ? dialectSpec.toolFrames : [];
|
|
89
82
|
const thinkingFrames = [
|
|
90
83
|
...(useBuiltinThinkTags ? [BUILTIN_THINKING] : []),
|
|
91
|
-
...(dialectSpec.thinkingFrames ?? [])
|
|
84
|
+
...(dialectSpec.thinkingFrames ?? [])
|
|
92
85
|
];
|
|
93
86
|
const contentFrames = dialectSpec.contentFrames ?? [];
|
|
94
87
|
const dropTokens = dialectSpec.dropTokens ?? [];
|
|
@@ -104,9 +97,9 @@ export function createCompletionNormalizer(config) {
|
|
|
104
97
|
contentMarkers.push(f.open);
|
|
105
98
|
}
|
|
106
99
|
}
|
|
107
|
-
registerFrames(toolFrames,
|
|
108
|
-
registerFrames(thinkingFrames,
|
|
109
|
-
registerFrames(contentFrames,
|
|
100
|
+
registerFrames(toolFrames, 'tool');
|
|
101
|
+
registerFrames(thinkingFrames, 'thinking');
|
|
102
|
+
registerFrames(contentFrames, 'content');
|
|
110
103
|
for (const t of dropTokens) {
|
|
111
104
|
if (markerToEntry.has(t) || dropTokenSet.has(t))
|
|
112
105
|
continue;
|
|
@@ -119,12 +112,12 @@ export function createCompletionNormalizer(config) {
|
|
|
119
112
|
function emitContent(events, text) {
|
|
120
113
|
let normalized = text;
|
|
121
114
|
for (const token of contentDropTokens) {
|
|
122
|
-
normalized = normalized.split(token).join(
|
|
115
|
+
normalized = normalized.split(token).join('');
|
|
123
116
|
}
|
|
124
117
|
if (!normalized)
|
|
125
118
|
return;
|
|
126
119
|
contentParts.push(normalized);
|
|
127
|
-
events.push({ type:
|
|
120
|
+
events.push({ type: 'contentDelta', seq: nextSeq(), text: normalized });
|
|
128
121
|
}
|
|
129
122
|
// Capture-gated: thinking frames may register even when `captureThinking`
|
|
130
123
|
// is false (e.g. harmony's analysis channel, to strip markers from
|
|
@@ -134,7 +127,7 @@ export function createCompletionNormalizer(config) {
|
|
|
134
127
|
return;
|
|
135
128
|
if (config.captureThinking) {
|
|
136
129
|
thinkingParts.push(text);
|
|
137
|
-
events.push({ type:
|
|
130
|
+
events.push({ type: 'thinkingDelta', seq: nextSeq(), text });
|
|
138
131
|
}
|
|
139
132
|
}
|
|
140
133
|
function getToolCallKey(call) {
|
|
@@ -142,12 +135,12 @@ export function createCompletionNormalizer(config) {
|
|
|
142
135
|
}
|
|
143
136
|
function emitStreamedToolCall(events, call) {
|
|
144
137
|
streamedToolCallKeys.add(getToolCallKey(call));
|
|
145
|
-
events.push({ type:
|
|
138
|
+
events.push({ type: 'toolCall', seq: nextSeq(), call });
|
|
146
139
|
}
|
|
147
140
|
function emitFinalToolCall(events, call) {
|
|
148
141
|
if (streamedToolCallKeys.has(getToolCallKey(call)))
|
|
149
142
|
return;
|
|
150
|
-
events.push({ type:
|
|
143
|
+
events.push({ type: 'toolCall', seq: nextSeq(), call });
|
|
151
144
|
}
|
|
152
145
|
// Length of the longest suffix of `buf` that is also a prefix of any marker.
|
|
153
146
|
function trailingPartialMarkerLen(buf, markers) {
|
|
@@ -177,9 +170,9 @@ export function createCompletionNormalizer(config) {
|
|
|
177
170
|
function flushToolBuffer(events, closed) {
|
|
178
171
|
const raw = toolCallBuffer;
|
|
179
172
|
const frame = activeToolFrame;
|
|
180
|
-
toolCallBuffer =
|
|
173
|
+
toolCallBuffer = '';
|
|
181
174
|
activeToolFrame = null;
|
|
182
|
-
toolFramingTail =
|
|
175
|
+
toolFramingTail = '';
|
|
183
176
|
if (!frame)
|
|
184
177
|
return;
|
|
185
178
|
// Empty-payload guard. Strip frame markers and check the inner is
|
|
@@ -193,9 +186,9 @@ export function createCompletionNormalizer(config) {
|
|
|
193
186
|
}
|
|
194
187
|
if (inner.trim().length === 0) {
|
|
195
188
|
events.push({
|
|
196
|
-
type:
|
|
189
|
+
type: 'toolError',
|
|
197
190
|
seq: nextSeq(),
|
|
198
|
-
error: { code:
|
|
191
|
+
error: { code: 'PARSE_ERROR', message: 'Empty tool_call frame' }
|
|
199
192
|
});
|
|
200
193
|
return;
|
|
201
194
|
}
|
|
@@ -205,20 +198,20 @@ export function createCompletionNormalizer(config) {
|
|
|
205
198
|
if (toolCalls.length === 0) {
|
|
206
199
|
if (errors.length > 0) {
|
|
207
200
|
for (const error of errors) {
|
|
208
|
-
events.push({ type:
|
|
201
|
+
events.push({ type: 'toolError', seq: nextSeq(), error });
|
|
209
202
|
}
|
|
210
203
|
}
|
|
211
204
|
else {
|
|
212
205
|
events.push({
|
|
213
|
-
type:
|
|
206
|
+
type: 'toolError',
|
|
214
207
|
seq: nextSeq(),
|
|
215
208
|
error: {
|
|
216
|
-
code:
|
|
209
|
+
code: 'PARSE_ERROR',
|
|
217
210
|
message: closed
|
|
218
|
-
?
|
|
219
|
-
:
|
|
220
|
-
raw
|
|
221
|
-
}
|
|
211
|
+
? 'Failed to parse tool call from framed region'
|
|
212
|
+
: 'Incomplete tool call frame at stream end',
|
|
213
|
+
raw
|
|
214
|
+
}
|
|
222
215
|
});
|
|
223
216
|
}
|
|
224
217
|
emitContent(events, raw);
|
|
@@ -226,33 +219,33 @@ export function createCompletionNormalizer(config) {
|
|
|
226
219
|
}
|
|
227
220
|
function getStateTail() {
|
|
228
221
|
switch (state) {
|
|
229
|
-
case
|
|
222
|
+
case 'content':
|
|
230
223
|
return contentTail;
|
|
231
|
-
case
|
|
224
|
+
case 'thinkingFraming':
|
|
232
225
|
return thinkingFramingTail;
|
|
233
|
-
case
|
|
226
|
+
case 'toolFraming':
|
|
234
227
|
return toolFramingTail;
|
|
235
|
-
case
|
|
228
|
+
case 'contentFraming':
|
|
236
229
|
return contentFramingTail;
|
|
237
230
|
}
|
|
238
231
|
}
|
|
239
232
|
function processSegment(events, text) {
|
|
240
233
|
let buf = getStateTail() + text;
|
|
241
|
-
contentTail =
|
|
242
|
-
thinkingFramingTail =
|
|
243
|
-
toolFramingTail =
|
|
244
|
-
contentFramingTail =
|
|
234
|
+
contentTail = '';
|
|
235
|
+
thinkingFramingTail = '';
|
|
236
|
+
toolFramingTail = '';
|
|
237
|
+
contentFramingTail = '';
|
|
245
238
|
while (buf.length > 0) {
|
|
246
|
-
if (state ===
|
|
239
|
+
if (state === 'toolFraming') {
|
|
247
240
|
if (!activeToolFrame) {
|
|
248
|
-
state =
|
|
241
|
+
state = 'content';
|
|
249
242
|
continue;
|
|
250
243
|
}
|
|
251
244
|
const hit = buf.indexOf(activeToolFrame.close);
|
|
252
245
|
if (hit >= 0) {
|
|
253
246
|
toolCallBuffer += buf.slice(0, hit + activeToolFrame.close.length);
|
|
254
247
|
buf = buf.slice(hit + activeToolFrame.close.length);
|
|
255
|
-
state =
|
|
248
|
+
state = 'content';
|
|
256
249
|
flushToolBuffer(events, true);
|
|
257
250
|
continue;
|
|
258
251
|
}
|
|
@@ -260,12 +253,12 @@ export function createCompletionNormalizer(config) {
|
|
|
260
253
|
const safeLen = buf.length - tailLen;
|
|
261
254
|
toolCallBuffer += buf.slice(0, safeLen);
|
|
262
255
|
toolFramingTail = buf.slice(safeLen);
|
|
263
|
-
buf =
|
|
256
|
+
buf = '';
|
|
264
257
|
continue;
|
|
265
258
|
}
|
|
266
|
-
if (state ===
|
|
259
|
+
if (state === 'thinkingFraming') {
|
|
267
260
|
if (!activeThinkingFrame) {
|
|
268
|
-
state =
|
|
261
|
+
state = 'content';
|
|
269
262
|
continue;
|
|
270
263
|
}
|
|
271
264
|
const closeMarker = activeThinkingFrame.close;
|
|
@@ -274,19 +267,19 @@ export function createCompletionNormalizer(config) {
|
|
|
274
267
|
emitThinking(events, buf.slice(0, closeIdx));
|
|
275
268
|
buf = buf.slice(closeIdx + closeMarker.length);
|
|
276
269
|
activeThinkingFrame = null;
|
|
277
|
-
state =
|
|
270
|
+
state = 'content';
|
|
278
271
|
continue;
|
|
279
272
|
}
|
|
280
273
|
const tailLen = trailingPartialMarkerLen(buf, [closeMarker]);
|
|
281
274
|
const safeLen = buf.length - tailLen;
|
|
282
275
|
emitThinking(events, buf.slice(0, safeLen));
|
|
283
276
|
thinkingFramingTail = buf.slice(safeLen);
|
|
284
|
-
buf =
|
|
277
|
+
buf = '';
|
|
285
278
|
continue;
|
|
286
279
|
}
|
|
287
|
-
if (state ===
|
|
280
|
+
if (state === 'contentFraming') {
|
|
288
281
|
if (!activeContentFrame) {
|
|
289
|
-
state =
|
|
282
|
+
state = 'content';
|
|
290
283
|
continue;
|
|
291
284
|
}
|
|
292
285
|
const closeMarker = activeContentFrame.close;
|
|
@@ -294,16 +287,16 @@ export function createCompletionNormalizer(config) {
|
|
|
294
287
|
if (closeIdx >= 0) {
|
|
295
288
|
emitContent(events, buf.slice(0, closeIdx));
|
|
296
289
|
activeContentFrame = null;
|
|
297
|
-
contentFramingTail =
|
|
290
|
+
contentFramingTail = '';
|
|
298
291
|
buf = buf.slice(closeIdx + closeMarker.length);
|
|
299
|
-
state =
|
|
292
|
+
state = 'content';
|
|
300
293
|
continue;
|
|
301
294
|
}
|
|
302
295
|
const tailLen = trailingPartialMarkerLen(buf, [closeMarker]);
|
|
303
296
|
const safeLen = buf.length - tailLen;
|
|
304
297
|
emitContent(events, buf.slice(0, safeLen));
|
|
305
298
|
contentFramingTail = buf.slice(safeLen);
|
|
306
|
-
buf =
|
|
299
|
+
buf = '';
|
|
307
300
|
continue;
|
|
308
301
|
}
|
|
309
302
|
const hit = findEarliestMarker(buf, contentMarkers);
|
|
@@ -315,18 +308,18 @@ export function createCompletionNormalizer(config) {
|
|
|
315
308
|
continue;
|
|
316
309
|
}
|
|
317
310
|
const entry = markerToEntry.get(hit.marker);
|
|
318
|
-
if (entry.kind ===
|
|
311
|
+
if (entry.kind === 'tool') {
|
|
319
312
|
toolCallBuffer = hit.marker;
|
|
320
313
|
activeToolFrame = entry.spec;
|
|
321
|
-
state =
|
|
314
|
+
state = 'toolFraming';
|
|
322
315
|
}
|
|
323
|
-
else if (entry.kind ===
|
|
316
|
+
else if (entry.kind === 'thinking') {
|
|
324
317
|
activeThinkingFrame = entry.spec;
|
|
325
|
-
state =
|
|
318
|
+
state = 'thinkingFraming';
|
|
326
319
|
}
|
|
327
320
|
else {
|
|
328
321
|
activeContentFrame = entry.spec;
|
|
329
|
-
state =
|
|
322
|
+
state = 'contentFraming';
|
|
330
323
|
}
|
|
331
324
|
continue;
|
|
332
325
|
}
|
|
@@ -334,14 +327,14 @@ export function createCompletionNormalizer(config) {
|
|
|
334
327
|
const safeLen = buf.length - tailLen;
|
|
335
328
|
emitContent(events, buf.slice(0, safeLen));
|
|
336
329
|
contentTail = buf.slice(safeLen);
|
|
337
|
-
buf =
|
|
330
|
+
buf = '';
|
|
338
331
|
}
|
|
339
332
|
}
|
|
340
333
|
function push(token) {
|
|
341
334
|
const events = [];
|
|
342
335
|
rawText += token;
|
|
343
336
|
if (config.emitRawDeltas) {
|
|
344
|
-
events.push({ type:
|
|
337
|
+
events.push({ type: 'rawDelta', seq: nextSeq(), text: token });
|
|
345
338
|
}
|
|
346
339
|
processSegment(events, token);
|
|
347
340
|
return events;
|
|
@@ -350,38 +343,38 @@ export function createCompletionNormalizer(config) {
|
|
|
350
343
|
const events = [];
|
|
351
344
|
// Drain pending tail bytes so we don't lose trailing chars when the
|
|
352
345
|
// stream ends mid-marker.
|
|
353
|
-
if (state ===
|
|
346
|
+
if (state === 'content' && contentTail) {
|
|
354
347
|
emitContent(events, contentTail);
|
|
355
|
-
contentTail =
|
|
348
|
+
contentTail = '';
|
|
356
349
|
}
|
|
357
|
-
else if (state ===
|
|
350
|
+
else if (state === 'thinkingFraming' && thinkingFramingTail) {
|
|
358
351
|
emitThinking(events, thinkingFramingTail);
|
|
359
|
-
thinkingFramingTail =
|
|
352
|
+
thinkingFramingTail = '';
|
|
360
353
|
}
|
|
361
|
-
else if (state ===
|
|
354
|
+
else if (state === 'toolFraming' && toolFramingTail) {
|
|
362
355
|
toolCallBuffer += toolFramingTail;
|
|
363
|
-
toolFramingTail =
|
|
356
|
+
toolFramingTail = '';
|
|
364
357
|
}
|
|
365
|
-
else if (state ===
|
|
358
|
+
else if (state === 'contentFraming' && contentFramingTail) {
|
|
366
359
|
// Cutoff inside a partial close marker — emit tail as content.
|
|
367
360
|
emitContent(events, contentFramingTail);
|
|
368
|
-
contentFramingTail =
|
|
361
|
+
contentFramingTail = '';
|
|
369
362
|
}
|
|
370
|
-
if (state ===
|
|
363
|
+
if (state === 'toolFraming' && activeToolFrame) {
|
|
371
364
|
if (opts?.error) {
|
|
372
365
|
emitContent(events, toolCallBuffer);
|
|
373
|
-
toolCallBuffer =
|
|
366
|
+
toolCallBuffer = '';
|
|
374
367
|
activeToolFrame = null;
|
|
375
368
|
}
|
|
376
369
|
else {
|
|
377
370
|
flushToolBuffer(events, false);
|
|
378
371
|
}
|
|
379
372
|
}
|
|
380
|
-
else if (state ===
|
|
373
|
+
else if (state === 'contentFraming') {
|
|
381
374
|
activeContentFrame = null;
|
|
382
375
|
}
|
|
383
376
|
activeThinkingFrame = null;
|
|
384
|
-
state =
|
|
377
|
+
state = 'content';
|
|
385
378
|
if (!opts?.error) {
|
|
386
379
|
if (opts?.toolCalls) {
|
|
387
380
|
for (const call of opts.toolCalls) {
|
|
@@ -391,39 +384,39 @@ export function createCompletionNormalizer(config) {
|
|
|
391
384
|
}
|
|
392
385
|
if (opts?.stats) {
|
|
393
386
|
events.push({
|
|
394
|
-
type:
|
|
387
|
+
type: 'completionStats',
|
|
395
388
|
seq: nextSeq(),
|
|
396
|
-
stats: opts.stats
|
|
389
|
+
stats: opts.stats
|
|
397
390
|
});
|
|
398
391
|
}
|
|
399
392
|
const raw = { fullText: rawText };
|
|
400
393
|
if (opts?.error) {
|
|
401
394
|
events.push({
|
|
402
|
-
type:
|
|
395
|
+
type: 'completionDone',
|
|
403
396
|
seq: nextSeq(),
|
|
404
|
-
stopReason:
|
|
397
|
+
stopReason: 'error',
|
|
405
398
|
error: opts.error,
|
|
406
|
-
raw
|
|
399
|
+
raw
|
|
407
400
|
});
|
|
408
401
|
}
|
|
409
402
|
else if (opts?.stopReason) {
|
|
410
403
|
events.push({
|
|
411
|
-
type:
|
|
404
|
+
type: 'completionDone',
|
|
412
405
|
seq: nextSeq(),
|
|
413
406
|
stopReason: opts.stopReason,
|
|
414
|
-
raw
|
|
407
|
+
raw
|
|
415
408
|
});
|
|
416
409
|
}
|
|
417
410
|
else {
|
|
418
|
-
events.push({ type:
|
|
411
|
+
events.push({ type: 'completionDone', seq: nextSeq(), raw });
|
|
419
412
|
}
|
|
420
413
|
return events;
|
|
421
414
|
}
|
|
422
415
|
function getAccumulated() {
|
|
423
416
|
return {
|
|
424
417
|
rawText,
|
|
425
|
-
contentText: contentParts.join(
|
|
426
|
-
thinkingText: thinkingParts.length > 0 ? thinkingParts.join(
|
|
418
|
+
contentText: contentParts.join(''),
|
|
419
|
+
thinkingText: thinkingParts.length > 0 ? thinkingParts.join('') : undefined
|
|
427
420
|
};
|
|
428
421
|
}
|
|
429
422
|
return { push, finish, getAccumulated };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeModelType, ModelType
|
|
1
|
+
import { normalizeModelType, ModelType } from '../../schemas/index.js';
|
|
2
2
|
export function transformConfigForReload(modelType, config) {
|
|
3
3
|
const canonicalType = normalizeModelType(modelType);
|
|
4
4
|
switch (canonicalType) {
|
|
@@ -8,7 +8,7 @@ export function transformConfigForReload(modelType, config) {
|
|
|
8
8
|
const { contextParams, miscConfig, ...whisperParams } = whisperConfig;
|
|
9
9
|
return {
|
|
10
10
|
whisperConfig: whisperParams,
|
|
11
|
-
...(miscConfig && { miscConfig })
|
|
11
|
+
...(miscConfig && { miscConfig })
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
case ModelType.llamacppCompletion:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const SHARD_PATTERN = /^(.+)-(\d{5})-of-(\d{5})\.gguf$/;
|
|
2
2
|
/** Expand a sharded GGUF path into `.tensors.txt` plus all shards. */
|
|
3
3
|
export function expandGGUFIntoShards(modelPath) {
|
|
4
|
-
const lastSep = Math.max(modelPath.lastIndexOf(
|
|
5
|
-
const dir = lastSep >= 0 ? modelPath.slice(0, lastSep) :
|
|
6
|
-
const sep = lastSep >= 0 ? modelPath.charAt(lastSep) :
|
|
4
|
+
const lastSep = Math.max(modelPath.lastIndexOf('/'), modelPath.lastIndexOf('\\'));
|
|
5
|
+
const dir = lastSep >= 0 ? modelPath.slice(0, lastSep) : '';
|
|
6
|
+
const sep = lastSep >= 0 ? modelPath.charAt(lastSep) : '/';
|
|
7
7
|
const filename = lastSep >= 0 ? modelPath.slice(lastSep + 1) : modelPath;
|
|
8
8
|
const match = filename.match(SHARD_PATTERN);
|
|
9
9
|
if (!match || !match[1] || !match[3])
|
|
@@ -16,7 +16,7 @@ export function expandGGUFIntoShards(modelPath) {
|
|
|
16
16
|
const join = (name) => (dir ? `${dir}${sep}${name}` : name);
|
|
17
17
|
const shards = [join(`${baseFilename}.tensors.txt`)];
|
|
18
18
|
for (let i = 1; i <= totalShards; i++) {
|
|
19
|
-
shards.push(join(`${baseFilename}-${String(i).padStart(5,
|
|
19
|
+
shards.push(join(`${baseFilename}-${String(i).padStart(5, '0')}-of-${totalDigits}.gguf`));
|
|
20
20
|
}
|
|
21
21
|
return shards;
|
|
22
22
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import crypto from
|
|
2
|
-
import { Buffer } from
|
|
1
|
+
import crypto from 'bare-crypto';
|
|
2
|
+
import { Buffer } from 'bare-buffer';
|
|
3
3
|
/**
|
|
4
4
|
* Generate a short hash (16 characters) from any input string
|
|
5
5
|
*/
|
|
6
6
|
export function generateShortHash(input) {
|
|
7
|
-
const hash = crypto
|
|
8
|
-
.createHash("sha-256")
|
|
9
|
-
.update(Buffer.from(input, "utf8"))
|
|
10
|
-
.digest("hex");
|
|
7
|
+
const hash = crypto.createHash('sha-256').update(Buffer.from(input, 'utf8')).digest('hex');
|
|
11
8
|
return hash.substring(0, 16);
|
|
12
9
|
}
|
|
13
10
|
function isModelDescriptor(value) {
|
|
14
|
-
return (typeof value ===
|
|
15
|
-
value !== null &&
|
|
16
|
-
"src" in value &&
|
|
17
|
-
typeof (value).src === "string");
|
|
11
|
+
return (typeof value === 'object' && value !== null && 'src' in value && typeof value.src === 'string');
|
|
18
12
|
}
|
|
19
13
|
function normalizeValue(value) {
|
|
20
14
|
if (isModelDescriptor(value)) {
|
|
@@ -23,7 +17,7 @@ function normalizeValue(value) {
|
|
|
23
17
|
if (Array.isArray(value)) {
|
|
24
18
|
return value.map(normalizeValue);
|
|
25
19
|
}
|
|
26
|
-
if (typeof value ===
|
|
20
|
+
if (typeof value === 'object' && value !== null) {
|
|
27
21
|
return normalizeConfig(value);
|
|
28
22
|
}
|
|
29
23
|
return value;
|
|
@@ -42,7 +36,7 @@ function normalizeConfig(config) {
|
|
|
42
36
|
*/
|
|
43
37
|
export function canonicalConfigString(config) {
|
|
44
38
|
if (!config)
|
|
45
|
-
return
|
|
39
|
+
return '{}';
|
|
46
40
|
return JSON.stringify(normalizeConfig(config));
|
|
47
41
|
}
|
|
48
42
|
/**
|