@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { toolSchema } from
|
|
3
|
-
import { completionEventSchema } from
|
|
4
|
-
import { REASONING_BUDGET_MAX } from
|
|
5
|
-
export { completionStatsSchema
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { toolSchema } from './tools.js';
|
|
3
|
+
import { completionEventSchema } from './completion-event.js';
|
|
4
|
+
import { REASONING_BUDGET_MAX } from './llamacpp-config.js';
|
|
5
|
+
export { completionStatsSchema } from './completion-event.js';
|
|
6
6
|
/**
|
|
7
7
|
* Tool-call output dialect. Auto-detected from the model name; pass via
|
|
8
8
|
* `completion({ toolDialect })` to override.
|
|
@@ -16,53 +16,41 @@ export { completionStatsSchema, } from "./completion-event.js";
|
|
|
16
16
|
* - `"gemma4"`: `<|tool_call>call:NAME{key:<|"|>val<|"|>,...}<tool_call|>`
|
|
17
17
|
*/
|
|
18
18
|
export const toolDialectSchema = z.enum([
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
'hermes',
|
|
20
|
+
'pythonic',
|
|
21
|
+
'json',
|
|
22
|
+
'harmony',
|
|
23
|
+
'qwen35',
|
|
24
|
+
'gemma4'
|
|
25
25
|
]);
|
|
26
26
|
export const attachmentSchema = z.object({
|
|
27
27
|
path: z
|
|
28
28
|
.string()
|
|
29
|
-
.describe(
|
|
29
|
+
.describe('Absolute or SDK-resolvable path to the attachment file (e.g., image for multimodal models).')
|
|
30
30
|
});
|
|
31
31
|
const kvCacheSchema = z.union([
|
|
32
32
|
z.boolean(),
|
|
33
|
-
z.string().min(1,
|
|
33
|
+
z.string().min(1, 'KV cache key cannot be empty string')
|
|
34
34
|
]);
|
|
35
35
|
export const generationParamsSchema = z
|
|
36
36
|
.object({
|
|
37
|
-
temp: z
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.describe("Sampling temperature (typically 0–2)."),
|
|
41
|
-
top_p: z
|
|
42
|
-
.number()
|
|
43
|
-
.optional()
|
|
44
|
-
.describe("Top-p (nucleus) sampling cutoff (0–1)."),
|
|
45
|
-
top_k: z
|
|
46
|
-
.number()
|
|
47
|
-
.optional()
|
|
48
|
-
.describe("Top-k sampling — keep only the top K tokens."),
|
|
37
|
+
temp: z.number().optional().describe('Sampling temperature (typically 0–2).'),
|
|
38
|
+
top_p: z.number().optional().describe('Top-p (nucleus) sampling cutoff (0–1).'),
|
|
39
|
+
top_k: z.number().optional().describe('Top-k sampling — keep only the top K tokens.'),
|
|
49
40
|
predict: z
|
|
50
41
|
.number()
|
|
51
42
|
.optional()
|
|
52
|
-
.describe(
|
|
53
|
-
seed: z.number().optional().describe(
|
|
43
|
+
.describe('Max tokens to predict. `-1` = until stop token, `-2` = until context filled.'),
|
|
44
|
+
seed: z.number().optional().describe('Random seed for reproducibility.'),
|
|
54
45
|
frequency_penalty: z
|
|
55
46
|
.number()
|
|
56
47
|
.optional()
|
|
57
|
-
.describe(
|
|
48
|
+
.describe('Penalty applied to tokens based on frequency so far.'),
|
|
58
49
|
presence_penalty: z
|
|
59
50
|
.number()
|
|
60
51
|
.optional()
|
|
61
|
-
.describe(
|
|
62
|
-
repeat_penalty: z
|
|
63
|
-
.number()
|
|
64
|
-
.optional()
|
|
65
|
-
.describe("Penalty applied to repeated tokens."),
|
|
52
|
+
.describe('Penalty applied to tokens that have already appeared.'),
|
|
53
|
+
repeat_penalty: z.number().optional().describe('Penalty applied to repeated tokens.'),
|
|
66
54
|
reasoning_budget: z
|
|
67
55
|
.number()
|
|
68
56
|
.int()
|
|
@@ -73,110 +61,173 @@ export const generationParamsSchema = z
|
|
|
73
61
|
remove_thinking_from_context: z
|
|
74
62
|
.boolean()
|
|
75
63
|
.optional()
|
|
76
|
-
.describe(
|
|
64
|
+
.describe('When the model emits a reasoning block during generation (e.g. `<think>...</think>` for the Qwen3 family, `<|channel>thought ... <channel|>` for Gemma 4), drop those tokens from the KV cache at end-of-generation so subsequent turns do not accumulate reasoning history. Defaults to `false`. No-op for models without a recognised reasoning channel. Throws on models with recurrent memory (SSM / hybrid SSM such as Qwen3.5), where the cache edit is unsupported.')
|
|
77
65
|
})
|
|
78
66
|
.strict();
|
|
79
67
|
const jsonSchemaObjectSchema = z.record(z.string(), z.unknown());
|
|
80
|
-
export const responseFormatSchema = z.discriminatedUnion(
|
|
81
|
-
z.object({ type: z.literal(
|
|
82
|
-
z.object({ type: z.literal(
|
|
68
|
+
export const responseFormatSchema = z.discriminatedUnion('type', [
|
|
69
|
+
z.object({ type: z.literal('text') }).strict(),
|
|
70
|
+
z.object({ type: z.literal('json_object') }).strict(),
|
|
83
71
|
z
|
|
84
72
|
.object({
|
|
85
|
-
type: z.literal(
|
|
73
|
+
type: z.literal('json_schema'),
|
|
86
74
|
json_schema: z
|
|
87
75
|
.object({
|
|
88
76
|
name: z
|
|
89
77
|
.string()
|
|
90
78
|
.min(1)
|
|
91
|
-
.describe(
|
|
79
|
+
.describe('Schema identifier; OpenAI-compatibility only — not used by the addon.'),
|
|
92
80
|
description: z
|
|
93
81
|
.string()
|
|
94
82
|
.optional()
|
|
95
|
-
.describe(
|
|
83
|
+
.describe('Free-form schema description. Accepted for OpenAI compatibility only — not forwarded to the addon and does not affect generation.'),
|
|
96
84
|
schema: jsonSchemaObjectSchema.describe("JSON Schema the model output must validate against. Forwarded to the addon as-is and converted to GBNF natively by llama.cpp's `json_schema_to_grammar()`."),
|
|
97
85
|
strict: z
|
|
98
86
|
.boolean()
|
|
99
87
|
.optional()
|
|
100
|
-
.describe("Accepted for OpenAI compatibility but does NOT trigger OpenAI's auto-tightening semantics (implicit `additionalProperties: false`, all properties required). The schema is forwarded to the addon verbatim, so callers wanting strict validation must encode it explicitly in `schema`.")
|
|
88
|
+
.describe("Accepted for OpenAI compatibility but does NOT trigger OpenAI's auto-tightening semantics (implicit `additionalProperties: false`, all properties required). The schema is forwarded to the addon verbatim, so callers wanting strict validation must encode it explicitly in `schema`.")
|
|
101
89
|
})
|
|
102
|
-
.strict()
|
|
90
|
+
.strict()
|
|
103
91
|
})
|
|
104
|
-
.strict()
|
|
92
|
+
.strict()
|
|
105
93
|
]);
|
|
106
94
|
export const completionParamsSchema = z.object({
|
|
107
95
|
history: z
|
|
108
96
|
.array(z.object({
|
|
109
|
-
role: z
|
|
110
|
-
|
|
111
|
-
.describe('Message role (e.g., `"user"`, `"assistant"`, `"system"`).'),
|
|
112
|
-
content: z.string().describe("Message content."),
|
|
97
|
+
role: z.string().describe('Message role (e.g., `"user"`, `"assistant"`, `"system"`).'),
|
|
98
|
+
content: z.string().describe('Message content.'),
|
|
113
99
|
attachments: z
|
|
114
100
|
.array(attachmentSchema)
|
|
115
101
|
.optional()
|
|
116
|
-
.describe(
|
|
102
|
+
.describe('Optional file attachments for multimodal models.')
|
|
117
103
|
}))
|
|
118
|
-
.describe(
|
|
119
|
-
modelId: z
|
|
120
|
-
.string()
|
|
121
|
-
.describe("The identifier of the model to use for completion."),
|
|
104
|
+
.describe('Array of conversation messages sent to the model.'),
|
|
105
|
+
modelId: z.string().describe('The identifier of the model to use for completion.'),
|
|
122
106
|
kvCache: kvCacheSchema
|
|
123
107
|
.optional()
|
|
124
|
-
.describe(
|
|
108
|
+
.describe('KV cache configuration — `true` to auto-generate a cache key from history, a string to use a custom key, or `false`/`undefined` to disable.')
|
|
125
109
|
});
|
|
126
110
|
const completionClientParamsBaseSchema = completionParamsSchema.extend({
|
|
127
111
|
tools: z
|
|
128
112
|
.array(toolSchema)
|
|
129
113
|
.optional()
|
|
130
|
-
.describe(
|
|
114
|
+
.describe('Optional array of tools (full `Tool` objects or Zod-schema `ToolInput` definitions) the model can call.'),
|
|
131
115
|
stream: z
|
|
132
116
|
.boolean()
|
|
133
|
-
.describe(
|
|
117
|
+
.describe('Whether to stream tokens (`true`) or return the complete response once (`false`).'),
|
|
134
118
|
kvCache: kvCacheSchema.optional(),
|
|
135
119
|
generationParams: generationParamsSchema
|
|
136
120
|
.optional()
|
|
137
|
-
.describe(
|
|
121
|
+
.describe('Optional sampling / generation parameters.'),
|
|
138
122
|
captureThinking: z
|
|
139
123
|
.boolean()
|
|
140
124
|
.optional()
|
|
141
|
-
.describe(
|
|
125
|
+
.describe('When `true`, capture and emit reasoning/thinking deltas separately from content deltas; requires a model that frames its thinking output.'),
|
|
142
126
|
emitRawDeltas: z
|
|
143
127
|
.boolean()
|
|
144
128
|
.optional()
|
|
145
|
-
.describe(
|
|
129
|
+
.describe('When `true`, also emit raw per-token deltas in the event stream in addition to normalized `contentDelta` events.'),
|
|
146
130
|
toolDialect: toolDialectSchema
|
|
147
131
|
.optional()
|
|
148
132
|
.describe("Override auto-detected tool-call dialect. Use when the SDK's name-based detection picks the wrong parser chain for your model."),
|
|
149
133
|
responseFormat: responseFormatSchema
|
|
150
134
|
.optional()
|
|
151
|
-
.describe(
|
|
135
|
+
.describe('Optional structured-output constraint: `text` (default, free-form), `json_object` (any valid JSON), or `json_schema` (output conforms to the provided JSON Schema). Mutually exclusive with `tools`.'),
|
|
152
136
|
requestId: z
|
|
153
137
|
.string()
|
|
154
138
|
.min(1)
|
|
155
139
|
.optional()
|
|
156
|
-
.describe(
|
|
140
|
+
.describe('Stable identifier for this in-flight request, generated by the client at call time (opaque token, UUIDv4 when available). Surfaced on the `CompletionRun` result so callers can target it with `cancel({ requestId })`. Optional on the wire so legacy clients keep working — the server falls back to a server-generated id when the field is missing. Note: cancel-by-requestId only takes effect once the server has begun the request, so a cancel issued in the same tick as `completion()` may arrive before the request is registered.')
|
|
157
141
|
});
|
|
158
142
|
function refineNoToolsWithStructuredOutput(data, ctx) {
|
|
159
143
|
if (data.responseFormat &&
|
|
160
|
-
data.responseFormat.type !==
|
|
144
|
+
data.responseFormat.type !== 'text' &&
|
|
161
145
|
data.tools &&
|
|
162
146
|
data.tools.length > 0) {
|
|
163
147
|
ctx.addIssue({
|
|
164
|
-
code:
|
|
165
|
-
message:
|
|
166
|
-
path: [
|
|
148
|
+
code: 'custom',
|
|
149
|
+
message: 'responseFormat (json_object/json_schema) cannot be combined with tools; tools already constrain output via their parameter schema.',
|
|
150
|
+
path: ['responseFormat']
|
|
167
151
|
});
|
|
168
152
|
}
|
|
169
153
|
}
|
|
170
154
|
export const completionClientParamsSchema = completionClientParamsBaseSchema.superRefine(refineNoToolsWithStructuredOutput);
|
|
171
155
|
export const completionStreamRequestSchema = completionClientParamsBaseSchema
|
|
172
156
|
.extend({
|
|
173
|
-
type: z.literal(
|
|
157
|
+
type: z.literal('completionStream')
|
|
174
158
|
})
|
|
175
159
|
.superRefine(refineNoToolsWithStructuredOutput);
|
|
176
160
|
export const completionStreamResponseSchema = z
|
|
177
161
|
.object({
|
|
178
|
-
type: z.literal(
|
|
162
|
+
type: z.literal('completionStream'),
|
|
163
|
+
done: z.boolean().optional(),
|
|
164
|
+
events: z.array(completionEventSchema)
|
|
165
|
+
})
|
|
166
|
+
.strict();
|
|
167
|
+
// ============================================
|
|
168
|
+
// Worker-orchestrated completion (duplex)
|
|
169
|
+
// ============================================
|
|
170
|
+
export const completionOrchestrateRequestSchema = completionClientParamsBaseSchema
|
|
171
|
+
.extend({
|
|
172
|
+
type: z.literal('completionOrchestrate'),
|
|
173
|
+
maxToolTurns: z
|
|
174
|
+
.number()
|
|
175
|
+
.int()
|
|
176
|
+
.min(1)
|
|
177
|
+
.max(32)
|
|
178
|
+
.optional()
|
|
179
|
+
.describe('Upper bound on generation turns the worker will run before ending the ' +
|
|
180
|
+
'loop with `stopReason: "maxToolTurns"`. Each turn is one completion ' +
|
|
181
|
+
'pass; a turn that requests tool calls consumes callbacks and starts ' +
|
|
182
|
+
'the next turn. Defaults to 8.')
|
|
183
|
+
})
|
|
184
|
+
.superRefine(refineNoToolsWithStructuredOutput);
|
|
185
|
+
/**
|
|
186
|
+
* Downstream frame of the orchestrated completion duplex stream. Exactly one
|
|
187
|
+
* payload field is set per frame:
|
|
188
|
+
*
|
|
189
|
+
* - `events` — pass-through of the inner completion turn's events (with
|
|
190
|
+
* `turn` identifying which generation pass they belong to).
|
|
191
|
+
* - `toolCallback` — the worker is asking the CLIENT to run a tool. The
|
|
192
|
+
* client executes its registered handler and writes a JSON line
|
|
193
|
+
* (`toolCallbackResultSchema`) up the request stream. The worker blocks
|
|
194
|
+
* this run (not the socket) until the matching `callId` arrives.
|
|
195
|
+
* - `done` — terminal frame; the loop ended (final answer produced, error,
|
|
196
|
+
* cancellation, or the `maxToolTurns` cap).
|
|
197
|
+
*
|
|
198
|
+
* Only a LOCAL worker may emit `toolCallback`: tool handlers execute code on
|
|
199
|
+
* the client machine, so a remote delegate streaming through this shape must
|
|
200
|
+
* never trigger them.
|
|
201
|
+
*/
|
|
202
|
+
export const completionOrchestrateResponseSchema = z
|
|
203
|
+
.object({
|
|
204
|
+
type: z.literal('completionOrchestrate'),
|
|
205
|
+
turn: z.number().int().nonnegative().optional(),
|
|
206
|
+
events: z.array(completionEventSchema).optional(),
|
|
207
|
+
toolCallback: z
|
|
208
|
+
.object({
|
|
209
|
+
callId: z.string().describe('Correlates the upstream result line to this request.'),
|
|
210
|
+
name: z.string(),
|
|
211
|
+
arguments: z.record(z.string(), z.unknown())
|
|
212
|
+
})
|
|
213
|
+
.optional(),
|
|
179
214
|
done: z.boolean().optional(),
|
|
180
|
-
|
|
215
|
+
stopReason: z
|
|
216
|
+
.literal('maxToolTurns')
|
|
217
|
+
.optional()
|
|
218
|
+
.describe('Set on the terminal `done` frame only when the loop stopped because it ' +
|
|
219
|
+
'hit `maxToolTurns` (the model still wanted a tool). Absent on a natural ' +
|
|
220
|
+
'finish, so the caller can tell a truncated run from a completed one.')
|
|
181
221
|
})
|
|
182
222
|
.strict();
|
|
223
|
+
/**
|
|
224
|
+
* Upstream JSON line the client writes after running a tool callback.
|
|
225
|
+
* Newline-delimited on the duplex request stream, after the initial request
|
|
226
|
+
* payload. `error` reports a handler failure; the worker forwards it to the
|
|
227
|
+
* model as the tool result so the loop can recover or finish.
|
|
228
|
+
*/
|
|
229
|
+
export const toolCallbackResultSchema = z.object({
|
|
230
|
+
callId: z.string(),
|
|
231
|
+
result: z.unknown().optional(),
|
|
232
|
+
error: z.string().optional()
|
|
233
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Every public constant `enum` from index.ts that downstream (non-JS)
|
|
4
|
+
* client generators should get as a real, named type instead of a
|
|
5
|
+
* hardcoded string/number. `build-contract.ts` merges each of these
|
|
6
|
+
* directly into `schema.json`'s `$defs` (same `z.toJSONSchema` call, same
|
|
7
|
+
* generator run as every request/response type), tagged with an
|
|
8
|
+
* `x-enum-varnames` hint so datamodel-code-generator preserves the
|
|
9
|
+
* original key names instead of slugging them from the bare value — plain
|
|
10
|
+
* JSON Schema `enum:` only carries values, not names, so without that hint
|
|
11
|
+
* `PluginId`/`Verbosity` (whose keys aren't derivable from their values)
|
|
12
|
+
* would lose their names entirely.
|
|
13
|
+
*
|
|
14
|
+
* A constant only reaches other languages if it's registered here. See
|
|
15
|
+
* `.cursor/rules/sdk/public-constants-contract.mdc`: any new public
|
|
16
|
+
* constant meant for downstream SDKs must be a `z.enum(...)` added here,
|
|
17
|
+
* not just a bare `export const` in its own schema file — otherwise it
|
|
18
|
+
* silently never leaves JS.
|
|
19
|
+
*
|
|
20
|
+
* Scoped to name→value maps (`z.enum`) only. A standalone scalar constant
|
|
21
|
+
* (e.g. `VLA_DEFAULT_IMAGE_SIZE`) has no natural JSON Schema representation
|
|
22
|
+
* as a plain value — a `const`-only schema generates an awkward
|
|
23
|
+
* `RootModel[Literal[...]]` wrapper class in Python, not a usable
|
|
24
|
+
* constant — so scalars aren't covered by this registry.
|
|
25
|
+
*/
|
|
26
|
+
export declare const constantsRegistry: {
|
|
27
|
+
readonly ModelType: z.ZodEnum<{
|
|
28
|
+
readonly llamacppCompletion: "llamacpp-completion";
|
|
29
|
+
readonly whispercppTranscription: "whispercpp-transcription";
|
|
30
|
+
readonly bciWhispercppTranscription: "bci-whispercpp-transcription";
|
|
31
|
+
readonly llamacppEmbedding: "llamacpp-embedding";
|
|
32
|
+
readonly nmtcppTranslation: "nmtcpp-translation";
|
|
33
|
+
readonly onnxTts: "onnx-tts";
|
|
34
|
+
readonly ttsGgml: "tts-ggml";
|
|
35
|
+
readonly parakeetTranscription: "parakeet-transcription";
|
|
36
|
+
readonly ggmlOcr: "ggml-ocr";
|
|
37
|
+
readonly sdcppGeneration: "sdcpp-generation";
|
|
38
|
+
readonly ggmlVla: "ggml-vla";
|
|
39
|
+
readonly ggmlClassification: "ggml-classification";
|
|
40
|
+
}>;
|
|
41
|
+
readonly ToolsMode: z.ZodEnum<{
|
|
42
|
+
readonly static: "static";
|
|
43
|
+
readonly dynamic: "dynamic";
|
|
44
|
+
}>;
|
|
45
|
+
readonly Verbosity: z.ZodEnum<{
|
|
46
|
+
readonly ERROR: 0;
|
|
47
|
+
readonly WARN: 1;
|
|
48
|
+
readonly INFO: 2;
|
|
49
|
+
readonly DEBUG: 3;
|
|
50
|
+
}>;
|
|
51
|
+
readonly PluginId: z.ZodEnum<{
|
|
52
|
+
readonly LLM: "@qvac/sdk/llamacpp-completion/plugin";
|
|
53
|
+
readonly EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
|
|
54
|
+
readonly WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
|
|
55
|
+
readonly BCI: "@qvac/sdk/bci-whispercpp-transcription/plugin";
|
|
56
|
+
readonly NMT: "@qvac/sdk/nmtcpp-translation/plugin";
|
|
57
|
+
readonly TTS: "@qvac/sdk/tts-ggml/plugin";
|
|
58
|
+
readonly OCR: "@qvac/sdk/ggml-ocr/plugin";
|
|
59
|
+
readonly DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
|
|
60
|
+
readonly VLA: "@qvac/sdk/ggml-vla/plugin";
|
|
61
|
+
readonly CLASSIFICATION: "@qvac/sdk/ggml-classification/plugin";
|
|
62
|
+
}>;
|
|
63
|
+
readonly SupportedAudioFormat: z.ZodEnum<{
|
|
64
|
+
[k: string]: string;
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=constants-registry.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ModelType } from './model-types.js';
|
|
3
|
+
import { TOOLS_MODE } from './tools.js';
|
|
4
|
+
import { VERBOSITY } from './llamacpp-config.js';
|
|
5
|
+
import { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_VLA, PLUGIN_CLASSIFICATION } from './plugin.js';
|
|
6
|
+
import { SUPPORTED_AUDIO_FORMATS } from '../constants/audio.js';
|
|
7
|
+
/**
|
|
8
|
+
* Every public constant `enum` from index.ts that downstream (non-JS)
|
|
9
|
+
* client generators should get as a real, named type instead of a
|
|
10
|
+
* hardcoded string/number. `build-contract.ts` merges each of these
|
|
11
|
+
* directly into `schema.json`'s `$defs` (same `z.toJSONSchema` call, same
|
|
12
|
+
* generator run as every request/response type), tagged with an
|
|
13
|
+
* `x-enum-varnames` hint so datamodel-code-generator preserves the
|
|
14
|
+
* original key names instead of slugging them from the bare value — plain
|
|
15
|
+
* JSON Schema `enum:` only carries values, not names, so without that hint
|
|
16
|
+
* `PluginId`/`Verbosity` (whose keys aren't derivable from their values)
|
|
17
|
+
* would lose their names entirely.
|
|
18
|
+
*
|
|
19
|
+
* A constant only reaches other languages if it's registered here. See
|
|
20
|
+
* `.cursor/rules/sdk/public-constants-contract.mdc`: any new public
|
|
21
|
+
* constant meant for downstream SDKs must be a `z.enum(...)` added here,
|
|
22
|
+
* not just a bare `export const` in its own schema file — otherwise it
|
|
23
|
+
* silently never leaves JS.
|
|
24
|
+
*
|
|
25
|
+
* Scoped to name→value maps (`z.enum`) only. A standalone scalar constant
|
|
26
|
+
* (e.g. `VLA_DEFAULT_IMAGE_SIZE`) has no natural JSON Schema representation
|
|
27
|
+
* as a plain value — a `const`-only schema generates an awkward
|
|
28
|
+
* `RootModel[Literal[...]]` wrapper class in Python, not a usable
|
|
29
|
+
* constant — so scalars aren't covered by this registry.
|
|
30
|
+
*/
|
|
31
|
+
export const constantsRegistry = {
|
|
32
|
+
ModelType: z.enum(ModelType),
|
|
33
|
+
ToolsMode: z.enum(TOOLS_MODE),
|
|
34
|
+
Verbosity: z.enum(VERBOSITY),
|
|
35
|
+
PluginId: z.enum({
|
|
36
|
+
LLM: PLUGIN_LLM,
|
|
37
|
+
EMBEDDING: PLUGIN_EMBEDDING,
|
|
38
|
+
WHISPER: PLUGIN_WHISPER,
|
|
39
|
+
BCI: PLUGIN_BCI,
|
|
40
|
+
NMT: PLUGIN_NMT,
|
|
41
|
+
TTS: PLUGIN_TTS,
|
|
42
|
+
OCR: PLUGIN_OCR,
|
|
43
|
+
DIFFUSION: PLUGIN_DIFFUSION,
|
|
44
|
+
VLA: PLUGIN_VLA,
|
|
45
|
+
CLASSIFICATION: PLUGIN_CLASSIFICATION
|
|
46
|
+
}),
|
|
47
|
+
// Derived from SUPPORTED_AUDIO_FORMATS itself (e.g. '.mp3' -> 'MP3') rather
|
|
48
|
+
// than a hand-written record, so the varnames can't drift from the one
|
|
49
|
+
// source of truth every other consumer of SUPPORTED_AUDIO_FORMATS shares.
|
|
50
|
+
SupportedAudioFormat: z.enum(Object.fromEntries(SUPPORTED_AUDIO_FORMATS.map((ext) => [ext.slice(1).toUpperCase(), ext])))
|
|
51
|
+
};
|
package/dist/schemas/delegate.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
const HYPERSWARM_PUBLIC_KEY_HEX = /^[0-9a-fA-F]{64}$/;
|
|
3
3
|
export const delegateBaseSchema = z.object({
|
|
4
4
|
providerPublicKey: z
|
|
5
5
|
.string()
|
|
6
|
-
.regex(HYPERSWARM_PUBLIC_KEY_HEX,
|
|
7
|
-
.describe(
|
|
6
|
+
.regex(HYPERSWARM_PUBLIC_KEY_HEX, 'providerPublicKey must be a 64-character hex string (32-byte ed25519 public key)')
|
|
7
|
+
.describe('Hex-encoded public key of the remote provider to delegate to.'),
|
|
8
8
|
timeout: z
|
|
9
9
|
.number()
|
|
10
10
|
.min(100)
|
|
11
11
|
.optional()
|
|
12
|
-
.describe(
|
|
12
|
+
.describe('Per-call timeout in milliseconds for the delegated request.'),
|
|
13
13
|
healthCheckTimeout: z
|
|
14
14
|
.number()
|
|
15
15
|
.min(100)
|
|
16
16
|
.optional()
|
|
17
|
-
.describe(
|
|
17
|
+
.describe('Timeout in milliseconds for the health-check probe before delegating.')
|
|
18
18
|
});
|
|
19
19
|
export const delegateSchema = delegateBaseSchema
|
|
20
20
|
.extend({
|
|
@@ -22,11 +22,11 @@ export const delegateSchema = delegateBaseSchema
|
|
|
22
22
|
.boolean()
|
|
23
23
|
.optional()
|
|
24
24
|
.default(false)
|
|
25
|
-
.describe(
|
|
25
|
+
.describe('When `true`, fall back to local execution if the delegated provider is unreachable.'),
|
|
26
26
|
forceNewConnection: z
|
|
27
27
|
.boolean()
|
|
28
28
|
.optional()
|
|
29
29
|
.default(false)
|
|
30
|
-
.describe(
|
|
30
|
+
.describe('When `true`, skip any cached delegation connection and open a fresh one.')
|
|
31
31
|
})
|
|
32
32
|
.optional();
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export const deleteCacheRequestSchema = z.union([
|
|
3
|
-
z
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
z
|
|
4
|
+
.object({
|
|
5
|
+
type: z.literal('deleteCache'),
|
|
6
|
+
all: z.literal(true)
|
|
7
|
+
})
|
|
8
|
+
.meta({ title: 'DeleteCacheAllRequest' }),
|
|
9
|
+
z
|
|
10
|
+
.object({
|
|
11
|
+
type: z.literal('deleteCache'),
|
|
9
12
|
kvCacheKey: z.string(),
|
|
10
|
-
modelId: z.string().optional()
|
|
11
|
-
})
|
|
13
|
+
modelId: z.string().optional()
|
|
14
|
+
})
|
|
15
|
+
.meta({ title: 'DeleteCacheKvEntryRequest' })
|
|
12
16
|
]);
|
|
13
17
|
export const deleteCacheResponseSchema = z.object({
|
|
14
|
-
type: z.literal(
|
|
18
|
+
type: z.literal('deleteCache'),
|
|
15
19
|
success: z.boolean(),
|
|
16
|
-
error: z.string().optional()
|
|
20
|
+
error: z.string().optional()
|
|
17
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import type { ModelProgressUpdate } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ModelProgressUpdate } from './load-model';
|
|
3
3
|
export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
4
4
|
assetSrc: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
5
5
|
src: z.ZodString;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { modelSrcInputSchema, modelInputToSrcSchema } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { modelSrcInputSchema, modelInputToSrcSchema } from './model-src-utils.js';
|
|
3
3
|
const downloadAssetOptionsBaseSchema = z.object({
|
|
4
4
|
assetSrc: modelSrcInputSchema,
|
|
5
|
-
seed: z.boolean().optional()
|
|
5
|
+
seed: z.boolean().optional()
|
|
6
6
|
});
|
|
7
7
|
export const downloadAssetOptionsSchema = downloadAssetOptionsBaseSchema.transform((data) => ({
|
|
8
8
|
...data,
|
|
9
|
-
seed: data.seed ?? false
|
|
9
|
+
seed: data.seed ?? false
|
|
10
10
|
}));
|
|
11
11
|
export const downloadAssetOptionsToRequestSchema = downloadAssetOptionsBaseSchema
|
|
12
12
|
.extend({
|
|
13
13
|
onProgress: z.unknown().optional(),
|
|
14
14
|
withProgress: z.boolean().optional(),
|
|
15
|
-
requestId: z.string().min(1).optional()
|
|
15
|
+
requestId: z.string().min(1).optional()
|
|
16
16
|
})
|
|
17
17
|
.transform((data) => {
|
|
18
18
|
const out = {
|
|
19
|
-
type:
|
|
19
|
+
type: 'downloadAsset',
|
|
20
20
|
assetSrc: modelInputToSrcSchema.parse(data.assetSrc),
|
|
21
21
|
withProgress: data.withProgress ?? !!data.onProgress,
|
|
22
|
-
seed: data.seed ?? false
|
|
22
|
+
seed: data.seed ?? false
|
|
23
23
|
};
|
|
24
24
|
if (data.requestId !== undefined)
|
|
25
25
|
out.requestId = data.requestId;
|
|
@@ -27,7 +27,7 @@ export const downloadAssetOptionsToRequestSchema = downloadAssetOptionsBaseSchem
|
|
|
27
27
|
});
|
|
28
28
|
export const downloadAssetRequestSchema = z
|
|
29
29
|
.object({
|
|
30
|
-
type: z.literal(
|
|
30
|
+
type: z.literal('downloadAsset'),
|
|
31
31
|
assetSrc: z.string(),
|
|
32
32
|
withProgress: z.boolean().optional(),
|
|
33
33
|
seed: z.boolean().optional(),
|
|
@@ -35,37 +35,37 @@ export const downloadAssetRequestSchema = z
|
|
|
35
35
|
.string()
|
|
36
36
|
.min(1)
|
|
37
37
|
.optional()
|
|
38
|
-
.describe(
|
|
38
|
+
.describe('Stable identifier for this in-flight download, generated by the client at call time. Optional on the wire so legacy clients keep working — the server falls back to a server-generated id when the field is missing. Exposed on the client-side decorated promise so callers can target this download with `cancel({ requestId })`.')
|
|
39
39
|
})
|
|
40
40
|
.transform((data) => ({
|
|
41
41
|
...data,
|
|
42
|
-
seed: data.seed ?? false
|
|
42
|
+
seed: data.seed ?? false
|
|
43
43
|
}));
|
|
44
44
|
export const downloadAssetResponseSchema = z.object({
|
|
45
|
-
type: z.literal(
|
|
45
|
+
type: z.literal('downloadAsset'),
|
|
46
46
|
success: z.boolean(),
|
|
47
47
|
assetId: z.string().optional(),
|
|
48
|
-
error: z.string().optional()
|
|
48
|
+
error: z.string().optional()
|
|
49
49
|
});
|
|
50
|
-
const downloadTypes = [
|
|
50
|
+
const downloadTypes = ['hyperdrive', 'http', 'registry'];
|
|
51
51
|
export const downloadTypeSchema = z.enum(downloadTypes);
|
|
52
|
-
export const sourceTypeSchema = z.enum([...downloadTypes,
|
|
52
|
+
export const sourceTypeSchema = z.enum([...downloadTypes, 'filesystem']);
|
|
53
53
|
export const downloadMetadataSchema = z.object({
|
|
54
54
|
key: z.string(),
|
|
55
55
|
startTime: z.number(),
|
|
56
|
-
type: downloadTypeSchema
|
|
56
|
+
type: downloadTypeSchema
|
|
57
57
|
});
|
|
58
58
|
export const hyperdriveDownloadMetadataSchema = downloadMetadataSchema.extend({
|
|
59
|
-
type: z.literal(
|
|
59
|
+
type: z.literal('hyperdrive'),
|
|
60
60
|
hyperdriveKey: z.string(),
|
|
61
|
-
modelFileName: z.string()
|
|
61
|
+
modelFileName: z.string()
|
|
62
62
|
});
|
|
63
63
|
export const httpDownloadMetadataSchema = downloadMetadataSchema.extend({
|
|
64
|
-
type: z.literal(
|
|
64
|
+
type: z.literal('http'),
|
|
65
65
|
url: z.url(),
|
|
66
|
-
modelPath: z.string()
|
|
66
|
+
modelPath: z.string()
|
|
67
67
|
});
|
|
68
68
|
export const registryDownloadMetadataSchema = downloadMetadataSchema.extend({
|
|
69
|
-
type: z.literal(
|
|
70
|
-
registryPath: z.string()
|
|
69
|
+
type: z.literal('registry'),
|
|
70
|
+
registryPath: z.string()
|
|
71
71
|
});
|
package/dist/schemas/embed.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const embedParamsSchema: z.ZodObject<{
|
|
3
3
|
modelId: z.ZodString;
|
|
4
4
|
text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
@@ -14,8 +14,8 @@ export declare const embedStatsSchema: z.ZodObject<{
|
|
|
14
14
|
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
15
15
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
17
|
-
cpu: "cpu";
|
|
18
17
|
gpu: "gpu";
|
|
18
|
+
cpu: "cpu";
|
|
19
19
|
}>>;
|
|
20
20
|
contextSize: z.ZodOptional<z.ZodNumber>;
|
|
21
21
|
}, z.core.$strip>;
|
|
@@ -28,8 +28,8 @@ export declare const embedResponseSchema: z.ZodObject<{
|
|
|
28
28
|
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
31
|
-
cpu: "cpu";
|
|
32
31
|
gpu: "gpu";
|
|
32
|
+
cpu: "cpu";
|
|
33
33
|
}>>;
|
|
34
34
|
contextSize: z.ZodOptional<z.ZodNumber>;
|
|
35
35
|
}, z.core.$strip>>;
|