@qvac/sdk 0.8.1 → 1.0.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/LICENSE +24 -1
- package/README.md +191 -373
- package/dist/client/api/cancel.d.ts +4 -22
- package/dist/client/api/cancel.js +6 -25
- package/dist/client/api/completion-stream.d.ts +30 -24
- package/dist/client/api/completion-stream.js +70 -121
- package/dist/client/api/delete-cache.js +2 -3
- package/dist/client/api/download-asset.d.ts +5 -6
- package/dist/client/api/download-asset.js +20 -16
- package/dist/client/api/embed.d.ts +4 -21
- package/dist/client/api/embed.js +14 -4
- package/dist/client/api/index.d.ts +2 -6
- package/dist/client/api/index.js +2 -6
- package/dist/client/api/load-model.d.ts +21 -49
- package/dist/client/api/load-model.js +134 -40
- package/dist/client/api/logging-stream.d.ts +4 -7
- package/dist/client/api/logging-stream.js +5 -9
- package/dist/client/api/ping.d.ts +11 -0
- package/dist/client/api/ping.js +18 -0
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +3 -4
- package/dist/client/api/rag.d.ts +21 -216
- package/dist/client/api/rag.js +36 -396
- package/dist/client/api/stop-provider.d.ts +1 -1
- package/dist/client/api/stop-provider.js +3 -4
- package/dist/client/api/text-to-speech.d.ts +2 -2
- package/dist/client/api/text-to-speech.js +3 -3
- package/dist/client/api/transcribe.d.ts +5 -9
- package/dist/client/api/transcribe.js +9 -11
- package/dist/client/api/translate.d.ts +3 -3
- package/dist/client/api/translate.js +15 -15
- package/dist/client/api/unload-model.d.ts +1 -5
- package/dist/client/api/unload-model.js +4 -17
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +13 -14
- package/dist/client/rpc/bare-client.d.ts +139 -3
- package/dist/client/rpc/bare-client.js +16 -117
- package/dist/client/rpc/bare-rpc-client.d.ts +4 -0
- package/dist/client/rpc/bare-rpc-client.js +87 -0
- package/dist/client/rpc/expo-rpc-client.d.ts +1 -2
- package/dist/client/rpc/expo-rpc-client.js +14 -57
- package/dist/client/rpc/node-rpc-client.d.ts +8 -3
- package/dist/client/rpc/node-rpc-client.js +62 -218
- package/dist/client/rpc/rpc-client.d.ts +2 -3
- package/dist/client/rpc/rpc-client.js +49 -184
- package/dist/constants/audio.d.ts +2 -1
- package/dist/constants/audio.js +17 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/examples/delegated-inference/consumer.js +2 -3
- package/dist/examples/download-with-cancel.js +4 -3
- package/dist/examples/embed-hyperdrive.d.ts +2 -0
- package/dist/examples/embed-hyperdrive.js +19 -0
- package/dist/examples/kv-cache-cleanup.js +2 -1
- package/dist/examples/kv-cache-custom-key.js +2 -16
- package/dist/examples/kv-cache-example.js +2 -1
- package/dist/examples/llamacpp-file-logging.d.ts +2 -0
- package/dist/examples/{logging-file-transport.js → llamacpp-file-logging.js} +8 -3
- package/dist/examples/llamacpp-filesystem.js +2 -2
- package/dist/examples/llamacpp-http.js +1 -0
- package/dist/examples/llamacpp-hyperdrive.d.ts +2 -0
- package/dist/examples/{llamacpp-p2p.js → llamacpp-hyperdrive.js} +2 -1
- package/dist/examples/llamacpp-multimodal.js +4 -3
- package/dist/examples/llamacpp-native-tools.js +30 -72
- package/dist/examples/multi-model-demo.js +3 -2
- package/dist/examples/parallel-download.js +14 -46
- package/dist/examples/rag/rag-chromadb.js +1 -0
- package/dist/examples/rag/rag-hyperdb-workspaces.d.ts +2 -0
- package/dist/examples/rag/rag-hyperdb-workspaces.js +107 -0
- package/dist/examples/rag/rag-hyperdb.d.ts +2 -0
- package/dist/examples/rag/{rag-hyperdb/ingest.js → rag-hyperdb.js} +5 -10
- package/dist/examples/rag/rag-lancedb.js +1 -0
- package/dist/examples/rag/rag-sqlite.js +1 -0
- package/dist/examples/seed-hyperdrive.d.ts +2 -0
- package/dist/examples/text-to-speech.d.ts +3 -0
- package/dist/examples/{tts/utils.js → text-to-speech.js} +63 -18
- package/dist/examples/translation/translation-indic.js +1 -4
- package/dist/examples/translation/translation-llm-context.js +1 -0
- package/dist/examples/translation/translation-llm.js +2 -2
- package/dist/examples/translation/translation-opus.js +3 -6
- package/dist/examples/translation/translation-stream.js +3 -3
- package/dist/examples/whispercpp-filesystem.js +43 -0
- package/dist/examples/{transcription/whispercpp-microphone-record.js → whispercpp-microphone-record.js} +9 -8
- package/dist/expo/plugins/index.d.ts +0 -3
- package/dist/expo/plugins/index.js +0 -3
- package/dist/expo/plugins/withMobileBundle.d.ts +2 -5
- package/dist/expo/plugins/withMobileBundle.js +40 -121
- package/dist/expo/plugins/withQvacSDK.d.ts +0 -4
- package/dist/expo/plugins/withQvacSDK.js +1 -26
- package/dist/index.d.ts +4 -9
- package/dist/index.js +5 -11
- package/dist/logging/base-logger.js +16 -26
- package/dist/logging/index.d.ts +1 -7
- package/dist/logging/index.js +1 -7
- package/dist/logging/logger.d.ts +2 -0
- package/dist/logging/logger.js +6 -11
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +3 -6
- package/dist/logging/transport.js +2 -2
- package/dist/logging/types.d.ts +0 -2
- package/dist/logging/utils.d.ts +0 -2
- package/dist/logging/utils.js +0 -62
- package/dist/models/{registry → hyperdrive}/index.js +1 -1
- package/dist/models/hyperdrive/models.d.ts +619 -0
- package/dist/models/hyperdrive/models.js +693 -0
- package/dist/schemas/cancel.d.ts +0 -18
- package/dist/schemas/cancel.js +0 -7
- package/dist/schemas/common.d.ts +166 -3012
- package/dist/schemas/common.js +4 -27
- package/dist/schemas/completion-stream.d.ts +60 -31
- package/dist/schemas/completion-stream.js +44 -20
- package/dist/schemas/delegate.d.ts +0 -9
- package/dist/schemas/delegate.js +2 -6
- package/dist/schemas/download-asset.d.ts +3 -125
- package/dist/schemas/download-asset.js +5 -22
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +2 -9
- package/dist/schemas/index.d.ts +2 -20
- package/dist/schemas/index.js +2 -20
- package/dist/schemas/llamacpp-config.d.ts +12 -243
- package/dist/schemas/llamacpp-config.js +14 -50
- package/dist/schemas/load-model.d.ts +893 -14471
- package/dist/schemas/load-model.js +72 -325
- package/dist/schemas/logging-stream.d.ts +4 -11
- package/dist/schemas/logging-stream.js +3 -4
- package/dist/schemas/ping.d.ts +11 -0
- package/dist/schemas/ping.js +8 -0
- package/dist/schemas/rag.d.ts +52 -183
- package/dist/schemas/rag.js +23 -152
- package/dist/schemas/text-to-speech.d.ts +1 -692
- package/dist/schemas/text-to-speech.js +3 -35
- package/dist/schemas/transcription.d.ts +0 -3
- package/dist/schemas/transcription.js +0 -1
- package/dist/schemas/translate.d.ts +23 -68
- package/dist/schemas/translate.js +11 -37
- package/dist/schemas/translation-config.d.ts +7 -810
- package/dist/schemas/translation-config.js +7 -113
- package/dist/schemas/unload-model.d.ts +0 -2
- package/dist/schemas/unload-model.js +0 -2
- package/dist/schemas/whispercpp-config.d.ts +25 -0
- package/dist/schemas/whispercpp-config.js +18 -0
- package/dist/server/bare/{ops → addons}/cancel.js +1 -2
- package/dist/server/bare/addons/index.d.ts +4 -0
- package/dist/server/bare/addons/index.js +3 -0
- package/dist/server/bare/addons/llamacpp/create-model.d.ts +5 -0
- package/dist/server/bare/addons/llamacpp/create-model.js +67 -0
- package/dist/server/bare/{plugins/llamacpp-completion/ops → addons/llamacpp/handlers}/completion-stream.d.ts +1 -2
- package/dist/server/bare/{plugins/llamacpp-completion/ops → addons/llamacpp/handlers}/completion-stream.js +87 -54
- package/dist/server/bare/addons/llamacpp/handlers/embed.d.ts +4 -0
- package/dist/server/bare/{ops → addons/llamacpp/handlers}/embed.js +7 -22
- package/dist/server/bare/addons/llamacpp/index.d.ts +4 -0
- package/dist/server/bare/addons/llamacpp/index.js +3 -0
- package/dist/server/bare/{ops → addons/llamacpp}/kv-cache-utils.d.ts +1 -4
- package/dist/server/bare/{ops → addons/llamacpp}/kv-cache-utils.js +19 -54
- package/dist/server/bare/addons/load-model.d.ts +3 -0
- package/dist/server/bare/addons/load-model.js +62 -0
- package/dist/server/bare/addons/translation/create-model.d.ts +4 -0
- package/dist/server/bare/addons/translation/create-model.js +45 -0
- package/dist/server/bare/addons/translation/handlers/translate.d.ts +3 -0
- package/dist/server/bare/{ops → addons/translation/handlers}/translate.js +14 -47
- package/dist/server/bare/addons/translation/index.d.ts +3 -0
- package/dist/server/bare/addons/translation/index.js +2 -0
- package/dist/server/bare/addons/tts/create-model.d.ts +6 -0
- package/dist/server/bare/addons/tts/create-model.js +40 -0
- package/dist/server/bare/{plugins/onnx-tts/ops → addons/tts/handlers}/text-to-speech.js +3 -25
- package/dist/server/bare/addons/tts/index.d.ts +3 -0
- package/dist/server/bare/addons/tts/index.js +2 -0
- package/dist/server/bare/addons/unload-model.js +20 -0
- package/dist/server/bare/addons/whispercpp/create-model.d.ts +6 -0
- package/dist/server/bare/addons/whispercpp/create-model.js +55 -0
- package/dist/server/bare/addons/whispercpp/handlers/transcribe-stream.d.ts +3 -0
- package/dist/server/bare/addons/whispercpp/handlers/transcribe-stream.js +48 -0
- package/dist/server/bare/addons/whispercpp/index.d.ts +3 -0
- package/dist/server/bare/addons/whispercpp/index.js +2 -0
- package/dist/server/bare/delegate-rpc-client.d.ts +0 -6
- package/dist/server/bare/delegate-rpc-client.js +45 -187
- package/dist/server/bare/hyperswarm.d.ts +0 -3
- package/dist/server/bare/hyperswarm.js +6 -29
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +10 -9
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +4 -7
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +14 -13
- package/dist/server/bare/rag-hyperdb/handlers/search.js +10 -10
- package/dist/server/bare/rag-hyperdb/index.d.ts +1 -8
- package/dist/server/bare/rag-hyperdb/index.js +1 -8
- package/dist/server/bare/rag-hyperdb/rag-manager.d.ts +5 -0
- package/dist/server/bare/rag-hyperdb/rag-manager.js +65 -0
- package/dist/server/bare/registry/logging-stream-registry.d.ts +7 -24
- package/dist/server/bare/registry/logging-stream-registry.js +20 -99
- package/dist/server/bare/registry/model-registry.d.ts +26 -16
- package/dist/server/bare/registry/model-registry.js +13 -34
- package/dist/server/error-handlers.d.ts +2 -3
- package/dist/server/error-handlers.js +10 -15
- package/dist/server/http-server.d.ts +2 -0
- package/dist/server/http-server.js +189 -0
- package/dist/server/rpc/create-server.js +3 -5
- package/dist/server/rpc/handle-request.d.ts +9 -0
- package/dist/server/rpc/handle-request.js +242 -92
- package/dist/server/rpc/handlers/cancelHandler.js +3 -14
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +1 -3
- package/dist/server/rpc/handlers/completion-stream-delegated.js +8 -20
- package/dist/server/rpc/handlers/completion-stream.js +41 -2
- package/dist/server/rpc/handlers/delete-cache.js +2 -4
- package/dist/server/rpc/handlers/download-asset.js +6 -59
- package/dist/server/rpc/handlers/embed.js +19 -2
- package/dist/server/rpc/handlers/index.d.ts +0 -13
- package/dist/server/rpc/handlers/index.js +0 -13
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +11 -12
- package/dist/server/rpc/handlers/load-model/download-manager.js +28 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +1 -2
- package/dist/server/rpc/handlers/load-model/http.js +55 -424
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +1 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +171 -364
- 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/resolve.d.ts +1 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +29 -110
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -6
- package/dist/server/rpc/handlers/load-model-delegated.js +20 -60
- package/dist/server/rpc/handlers/{load-model/handler.d.ts → load-model.d.ts} +2 -2
- package/dist/server/rpc/handlers/load-model.js +57 -0
- package/dist/server/rpc/handlers/logging-stream.js +4 -4
- package/dist/server/rpc/handlers/provideHandler/connection.js +10 -12
- package/dist/server/rpc/handlers/provideHandler/handler.js +17 -20
- package/dist/server/rpc/handlers/provideHandler/proxy.js +6 -8
- package/dist/server/rpc/handlers/rag.d.ts +2 -2
- package/dist/server/rpc/handlers/rag.js +43 -130
- package/dist/server/rpc/handlers/stopProvideHandler.js +2 -6
- package/dist/server/rpc/handlers/text-to-speech.js +5 -2
- package/dist/server/rpc/handlers/transcribe-stream.js +24 -2
- package/dist/server/rpc/handlers/translate.js +49 -2
- package/dist/server/rpc/handlers/unload-model.js +3 -12
- package/dist/server/rpc/index.d.ts +1 -1
- package/dist/server/utils/audio/decoder.d.ts +1 -2
- package/dist/server/utils/audio/decoder.js +12 -49
- package/dist/server/utils/cache.d.ts +8 -19
- package/dist/server/utils/cache.js +15 -100
- package/dist/server/utils/hash.d.ts +5 -0
- package/dist/server/utils/hash.js +11 -0
- package/dist/server/utils/index.d.ts +2 -7
- package/dist/server/utils/index.js +2 -7
- package/dist/server/utils/tool-parser.js +14 -28
- package/dist/server/worker.d.ts +5 -4
- package/dist/server/worker.js +89 -22
- package/package.json +41 -148
- package/NOTICE +0 -695
- package/bare-imports.json +0 -44
- package/dist/client/api/get-model-info.d.ts +0 -36
- package/dist/client/api/get-model-info.js +0 -14
- package/dist/client/api/heartbeat.d.ts +0 -30
- package/dist/client/api/heartbeat.js +0 -38
- package/dist/client/api/invoke-plugin.d.ts +0 -15
- package/dist/client/api/invoke-plugin.js +0 -38
- package/dist/client/api/ocr.d.ts +0 -31
- package/dist/client/api/ocr.js +0 -88
- package/dist/client/api/registry.d.ts +0 -14
- package/dist/client/api/registry.js +0 -37
- package/dist/client/config-loader/config-utils.d.ts +0 -5
- package/dist/client/config-loader/config-utils.js +0 -20
- package/dist/client/config-loader/resolve-config.bare.d.ts +0 -9
- package/dist/client/config-loader/resolve-config.bare.js +0 -87
- package/dist/client/config-loader/resolve-config.expo.d.ts +0 -11
- package/dist/client/config-loader/resolve-config.expo.js +0 -62
- package/dist/client/config-loader/resolve-config.node.d.ts +0 -10
- package/dist/client/config-loader/resolve-config.node.js +0 -145
- package/dist/client/init-hooks.d.ts +0 -21
- package/dist/client/init-hooks.js +0 -66
- package/dist/client/rpc/expo-device-info.d.ts +0 -6
- package/dist/client/rpc/expo-device-info.js +0 -32
- package/dist/client/rpc/profiling/index.d.ts +0 -2
- package/dist/client/rpc/profiling/index.js +0 -1
- package/dist/client/rpc/profiling/profiler.d.ts +0 -27
- package/dist/client/rpc/profiling/profiler.js +0 -139
- package/dist/constants/registry.d.ts +0 -2
- package/dist/constants/registry.js +0 -1
- package/dist/examples/cache-management.d.ts +0 -2
- package/dist/examples/cache-management.js +0 -97
- package/dist/examples/config/blind-relay/blind-relay.config.d.ts +0 -5
- package/dist/examples/config/blind-relay/blind-relay.config.js +0 -7
- package/dist/examples/config/default/default.config.d.ts +0 -8
- package/dist/examples/config/default/default.config.js +0 -6
- package/dist/examples/config/plugins/plugins.config.d.ts +0 -5
- package/dist/examples/config/plugins/plugins.config.js +0 -4
- package/dist/examples/config-reload.d.ts +0 -2
- package/dist/examples/config-reload.js +0 -49
- package/dist/examples/default-config-usage.d.ts +0 -17
- package/dist/examples/default-config-usage.js +0 -47
- package/dist/examples/delegated-inference/consumer-profiled.d.ts +0 -2
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -67
- package/dist/examples/download-with-blind-relays.d.ts +0 -2
- package/dist/examples/download-with-blind-relays.js +0 -49
- package/dist/examples/embed-p2p.d.ts +0 -2
- package/dist/examples/embed-p2p.js +0 -54
- package/dist/examples/llamacpp-p2p.d.ts +0 -2
- package/dist/examples/llamacpp-sharded.d.ts +0 -2
- package/dist/examples/llamacpp-sharded.js +0 -53
- package/dist/examples/logging-file-transport.d.ts +0 -2
- package/dist/examples/logging-streaming.d.ts +0 -2
- package/dist/examples/logging-streaming.js +0 -75
- package/dist/examples/mcp-websearch.d.ts +0 -13
- package/dist/examples/mcp-websearch.js +0 -176
- package/dist/examples/ocr-fasttext.d.ts +0 -2
- package/dist/examples/ocr-fasttext.js +0 -52
- package/dist/examples/plugins.d.ts +0 -14
- package/dist/examples/plugins.js +0 -129
- package/dist/examples/profiling/basic.d.ts +0 -2
- package/dist/examples/profiling/basic.js +0 -71
- package/dist/examples/profiling/per-call.d.ts +0 -2
- package/dist/examples/profiling/per-call.js +0 -30
- package/dist/examples/quickstart.d.ts +0 -2
- package/dist/examples/quickstart.js +0 -28
- package/dist/examples/rag/rag-hyperdb/cancellation.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -75
- package/dist/examples/rag/rag-hyperdb/ingest.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/pipeline.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -74
- package/dist/examples/rag/rag-hyperdb/workspaces.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -178
- package/dist/examples/registry-query.d.ts +0 -2
- package/dist/examples/registry-query.js +0 -87
- package/dist/examples/seed-p2p.d.ts +0 -2
- package/dist/examples/transcription/parakeet-ctc-filesystem.d.ts +0 -2
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +0 -40
- package/dist/examples/transcription/parakeet-microphone-record.d.ts +0 -2
- package/dist/examples/transcription/parakeet-microphone-record.js +0 -95
- package/dist/examples/transcription/parakeet-sortformer.d.ts +0 -2
- package/dist/examples/transcription/parakeet-sortformer.js +0 -115
- package/dist/examples/transcription/parakeet-tdt-filesystem.d.ts +0 -2
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +0 -44
- package/dist/examples/transcription/whispercpp-filesystem.js +0 -69
- package/dist/examples/transcription/whispercpp-prompt.d.ts +0 -2
- package/dist/examples/transcription/whispercpp-prompt.js +0 -67
- package/dist/examples/translation/translation-bergamot-batch.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot-batch.js +0 -49
- package/dist/examples/translation/translation-bergamot-pivot.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot-pivot.js +0 -73
- package/dist/examples/translation/translation-bergamot.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot.js +0 -39
- package/dist/examples/translation/translation-llm-afriquegemma.d.ts +0 -2
- package/dist/examples/translation/translation-llm-afriquegemma.js +0 -39
- package/dist/examples/tts/chatterbox.d.ts +0 -2
- package/dist/examples/tts/chatterbox.js +0 -59
- package/dist/examples/tts/supertonic.d.ts +0 -2
- package/dist/examples/tts/supertonic.js +0 -51
- package/dist/examples/tts/utils.d.ts +0 -17
- package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +0 -15
- package/dist/expo/plugins/resolve-sdk-package-dir.js +0 -31
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +0 -8
- package/dist/expo/plugins/withAndroidArchitecture.js +0 -52
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +0 -8
- package/dist/expo/plugins/withAndroidNdkVersion.js +0 -31
- package/dist/expo/plugins/withDeviceInfo.d.ts +0 -10
- package/dist/expo/plugins/withDeviceInfo.js +0 -48
- package/dist/logging/addon.d.ts +0 -6
- package/dist/logging/addon.js +0 -75
- package/dist/logging/client-logger.d.ts +0 -3
- package/dist/logging/client-logger.js +0 -24
- package/dist/logging/namespaces.d.ts +0 -6
- package/dist/logging/namespaces.js +0 -6
- package/dist/logging/registry.d.ts +0 -31
- package/dist/logging/registry.js +0 -62
- package/dist/logging/server-logger.d.ts +0 -3
- package/dist/logging/server-logger.js +0 -16
- package/dist/models/registry/models.d.ts +0 -10417
- package/dist/models/registry/models.js +0 -10757
- package/dist/models/update-models/codegen.d.ts +0 -3
- package/dist/models/update-models/codegen.js +0 -135
- package/dist/models/update-models/history.d.ts +0 -24
- package/dist/models/update-models/history.js +0 -107
- package/dist/models/update-models/index.d.ts +0 -2
- package/dist/models/update-models/index.js +0 -125
- package/dist/models/update-models/naming.d.ts +0 -4
- package/dist/models/update-models/naming.js +0 -370
- package/dist/models/update-models/processing.d.ts +0 -8
- package/dist/models/update-models/processing.js +0 -67
- package/dist/models/update-models/registry.d.ts +0 -4
- package/dist/models/update-models/registry.js +0 -67
- package/dist/models/update-models/shards.d.ts +0 -4
- package/dist/models/update-models/shards.js +0 -57
- package/dist/models/update-models/types.d.ts +0 -60
- package/dist/models/update-models/types.js +0 -1
- package/dist/models/update-models/utils.d.ts +0 -3
- package/dist/models/update-models/utils.js +0 -21
- package/dist/pear/pre.d.ts +0 -18
- package/dist/pear/pre.js +0 -433
- package/dist/profiling/aggregator.d.ts +0 -15
- package/dist/profiling/aggregator.js +0 -100
- package/dist/profiling/clock.d.ts +0 -12
- package/dist/profiling/clock.js +0 -51
- package/dist/profiling/controller.d.ts +0 -33
- package/dist/profiling/controller.js +0 -123
- package/dist/profiling/envelope.d.ts +0 -10
- package/dist/profiling/envelope.js +0 -36
- package/dist/profiling/events.d.ts +0 -20
- package/dist/profiling/events.js +0 -37
- package/dist/profiling/exporters.d.ts +0 -10
- package/dist/profiling/exporters.js +0 -236
- package/dist/profiling/index.d.ts +0 -36
- package/dist/profiling/index.js +0 -31
- package/dist/profiling/ring-buffer.d.ts +0 -19
- package/dist/profiling/ring-buffer.js +0 -83
- package/dist/profiling/types.d.ts +0 -47
- package/dist/profiling/types.js +0 -1
- package/dist/schemas/archive.d.ts +0 -9
- package/dist/schemas/archive.js +0 -17
- package/dist/schemas/engine-addon-map.d.ts +0 -5
- package/dist/schemas/engine-addon-map.js +0 -52
- package/dist/schemas/get-model-info.d.ts +0 -120
- package/dist/schemas/get-model-info.js +0 -58
- package/dist/schemas/heartbeat.d.ts +0 -17
- package/dist/schemas/heartbeat.js +0 -10
- package/dist/schemas/json-schema.d.ts +0 -16
- package/dist/schemas/json-schema.js +0 -2
- package/dist/schemas/mcp-adapter.d.ts +0 -47
- package/dist/schemas/mcp-adapter.js +0 -1
- package/dist/schemas/model-src-utils.d.ts +0 -148
- package/dist/schemas/model-src-utils.js +0 -35
- package/dist/schemas/model-types.d.ts +0 -183
- package/dist/schemas/model-types.js +0 -168
- package/dist/schemas/ocr.d.ts +0 -125
- package/dist/schemas/ocr.js +0 -57
- package/dist/schemas/path-validation.d.ts +0 -10
- package/dist/schemas/path-validation.js +0 -22
- package/dist/schemas/plugin.d.ts +0 -226
- package/dist/schemas/plugin.js +0 -158
- package/dist/schemas/profiling.d.ts +0 -105
- package/dist/schemas/profiling.js +0 -66
- package/dist/schemas/registry.d.ts +0 -356
- package/dist/schemas/registry.js +0 -93
- package/dist/schemas/reload-config.d.ts +0 -476
- package/dist/schemas/reload-config.js +0 -44
- package/dist/schemas/runtime-context.d.ts +0 -19
- package/dist/schemas/runtime-context.js +0 -7
- package/dist/schemas/sdk-config.d.ts +0 -2973
- package/dist/schemas/sdk-config.js +0 -136
- package/dist/schemas/sdk-errors-client.d.ts +0 -31
- package/dist/schemas/sdk-errors-client.js +0 -143
- package/dist/schemas/sdk-errors-registry.d.ts +0 -6
- package/dist/schemas/sdk-errors-registry.js +0 -8
- package/dist/schemas/sdk-errors-server.d.ts +0 -89
- package/dist/schemas/sdk-errors-server.js +0 -451
- package/dist/schemas/shard.d.ts +0 -21
- package/dist/schemas/shard.js +0 -17
- package/dist/schemas/tools.d.ts +0 -65
- package/dist/schemas/tools.js +0 -43
- package/dist/schemas/transcription-config.d.ts +0 -383
- package/dist/schemas/transcription-config.js +0 -95
- package/dist/scripts/run-security-tests-bare.d.ts +0 -2
- package/dist/scripts/run-security-tests-bare.js +0 -78
- package/dist/scripts/run-security-tests.d.ts +0 -2
- package/dist/scripts/run-security-tests.js +0 -22
- package/dist/scripts/run-unit-tests.d.ts +0 -2
- package/dist/scripts/run-unit-tests.js +0 -17
- package/dist/server/bare/ops/embed.d.ts +0 -12
- package/dist/server/bare/ops/load-model.d.ts +0 -9
- package/dist/server/bare/ops/load-model.js +0 -85
- package/dist/server/bare/ops/transcribe.d.ts +0 -3
- package/dist/server/bare/ops/transcribe.js +0 -75
- package/dist/server/bare/ops/translate.d.ts +0 -5
- package/dist/server/bare/ops/unload-model.js +0 -41
- package/dist/server/bare/plugins/index.d.ts +0 -8
- package/dist/server/bare/plugins/index.js +0 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +0 -6
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +0 -34
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +0 -220
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +0 -155
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +0 -54
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +0 -87
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +0 -367
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +0 -201
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.d.ts +0 -10
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.js +0 -110
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +0 -86
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +0 -117
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -373
- package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -182
- package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
- package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +0 -317
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +0 -154
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +0 -237
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +0 -86
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +0 -7
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +0 -14
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +0 -18
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +0 -4
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +0 -16
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.d.ts +0 -7
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +0 -39
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +0 -15
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +0 -136
- package/dist/server/bare/registry/config-registry.d.ts +0 -14
- package/dist/server/bare/registry/config-registry.js +0 -82
- package/dist/server/bare/registry/model-config-registry.d.ts +0 -4
- package/dist/server/bare/registry/model-config-registry.js +0 -15
- package/dist/server/bare/registry/model-config-utils.d.ts +0 -15
- package/dist/server/bare/registry/model-config-utils.js +0 -112
- package/dist/server/bare/registry/registry-client.d.ts +0 -5
- package/dist/server/bare/registry/registry-client.js +0 -37
- package/dist/server/bare/registry/runtime-context-registry.d.ts +0 -7
- package/dist/server/bare/registry/runtime-context-registry.js +0 -26
- package/dist/server/bare/utils/audio-input.d.ts +0 -10
- package/dist/server/bare/utils/audio-input.js +0 -33
- package/dist/server/bare/utils/loader-adapter.d.ts +0 -7
- package/dist/server/bare/utils/loader-adapter.js +0 -9
- package/dist/server/env.d.ts +0 -22
- package/dist/server/env.js +0 -57
- package/dist/server/plugins/index.d.ts +0 -2
- package/dist/server/plugins/index.js +0 -1
- package/dist/server/plugins/registry.d.ts +0 -9
- package/dist/server/plugins/registry.js +0 -79
- package/dist/server/rpc/delegate-transport.d.ts +0 -19
- package/dist/server/rpc/delegate-transport.js +0 -236
- package/dist/server/rpc/delegate-utils.d.ts +0 -2
- package/dist/server/rpc/delegate-utils.js +0 -5
- package/dist/server/rpc/handler-registry.d.ts +0 -3
- package/dist/server/rpc/handler-registry.js +0 -113
- package/dist/server/rpc/handler-utils.d.ts +0 -23
- package/dist/server/rpc/handler-utils.js +0 -170
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/cancel-delegated.js +0 -71
- package/dist/server/rpc/handlers/get-model-info.d.ts +0 -3
- package/dist/server/rpc/handlers/get-model-info.js +0 -164
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/heartbeat-delegated.js +0 -32
- package/dist/server/rpc/handlers/heartbeat.d.ts +0 -3
- package/dist/server/rpc/handlers/heartbeat.js +0 -3
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +0 -6
- package/dist/server/rpc/handlers/load-model/download-stats.js +0 -87
- package/dist/server/rpc/handlers/load-model/handler.js +0 -187
- package/dist/server/rpc/handlers/load-model/registry.d.ts +0 -11
- package/dist/server/rpc/handlers/load-model/registry.js +0 -548
- package/dist/server/rpc/handlers/load-model/types.d.ts +0 -29
- package/dist/server/rpc/handlers/load-model/types.js +0 -1
- package/dist/server/rpc/handlers/ocr-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/ocr-stream.js +0 -4
- package/dist/server/rpc/handlers/plugin-dispatch.d.ts +0 -15
- package/dist/server/rpc/handlers/plugin-dispatch.js +0 -59
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +0 -4
- package/dist/server/rpc/handlers/plugin-invoke.js +0 -92
- package/dist/server/rpc/handlers/registry.d.ts +0 -5
- package/dist/server/rpc/handlers/registry.js +0 -157
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +0 -3
- package/dist/server/rpc/handlers/unload-model-delegated.js +0 -32
- package/dist/server/rpc/profiling/context.d.ts +0 -18
- package/dist/server/rpc/profiling/context.js +0 -38
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +0 -32
- package/dist/server/rpc/profiling/delegation-profiler.js +0 -154
- package/dist/server/rpc/profiling/index.d.ts +0 -5
- package/dist/server/rpc/profiling/index.js +0 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +0 -25
- package/dist/server/rpc/profiling/operation-metrics.js +0 -199
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +0 -18
- package/dist/server/rpc/profiling/operation-wrappers.js +0 -124
- package/dist/server/rpc/profiling/profiler.d.ts +0 -13
- package/dist/server/rpc/profiling/profiler.js +0 -97
- package/dist/server/utils/archive.d.ts +0 -4
- package/dist/server/utils/archive.js +0 -179
- package/dist/server/utils/checksum.d.ts +0 -4
- package/dist/server/utils/checksum.js +0 -31
- package/dist/server/utils/config-transform.d.ts +0 -3
- package/dist/server/utils/config-transform.js +0 -23
- package/dist/server/utils/formatting.d.ts +0 -19
- package/dist/server/utils/formatting.js +0 -61
- package/dist/server/utils/gguf-tensor-extractor.d.ts +0 -15
- package/dist/server/utils/gguf-tensor-extractor.js +0 -314
- package/dist/server/utils/path-security.d.ts +0 -12
- package/dist/server/utils/path-security.js +0 -25
- package/dist/server/utils/shard-utils.d.ts +0 -48
- package/dist/server/utils/shard-utils.js +0 -125
- package/dist/server/utils/tool-integration.d.ts +0 -13
- package/dist/server/utils/tool-integration.js +0 -43
- package/dist/server/worker-core.d.ts +0 -6
- package/dist/server/worker-core.js +0 -88
- package/dist/utils/errors-base.d.ts +0 -3
- package/dist/utils/errors-base.js +0 -13
- package/dist/utils/errors-client.d.ts +0 -137
- package/dist/utils/errors-client.js +0 -240
- package/dist/utils/errors-server.d.ts +0 -236
- package/dist/utils/errors-server.js +0 -412
- package/dist/utils/global-singleton.d.ts +0 -2
- package/dist/utils/global-singleton.js +0 -10
- package/dist/utils/mcp-adapter.d.ts +0 -12
- package/dist/utils/mcp-adapter.js +0 -103
- package/dist/utils/object.d.ts +0 -2
- package/dist/utils/object.js +0 -3
- package/dist/utils/path-sanitize.d.ts +0 -17
- package/dist/utils/path-sanitize.js +0 -54
- package/dist/utils/tool-helpers.d.ts +0 -25
- package/dist/utils/tool-helpers.js +0 -112
- package/expo/plugins/patches/android-link.mjs +0 -63
- package/expo/plugins/patches/ios-link.mjs +0 -63
- /package/dist/examples/{seed-p2p.js → seed-hyperdrive.js} +0 -0
- /package/dist/examples/{transcription/whispercpp-filesystem.d.ts → whispercpp-filesystem.d.ts} +0 -0
- /package/dist/examples/{transcription/whispercpp-microphone-record.d.ts → whispercpp-microphone-record.d.ts} +0 -0
- /package/dist/models/{registry → hyperdrive}/index.d.ts +0 -0
- /package/dist/server/bare/{ops → addons}/cancel.d.ts +0 -0
- /package/dist/server/bare/{plugins/onnx-tts/ops → addons/tts/handlers}/text-to-speech.d.ts +0 -0
- /package/dist/server/bare/{ops → addons}/unload-model.d.ts +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import fs from "bare-fs";
|
|
2
|
-
import path from "bare-path";
|
|
3
|
-
import { getEnv } from "../../env.js";
|
|
4
|
-
import { CacheDirNotAbsoluteError, CacheDirNotWritableError, ConfigAlreadySetError, } from "../../../utils/errors-server.js";
|
|
5
|
-
import { getServerLogger, setGlobalConsoleOutput, setGlobalLogLevel, } from "../../../logging/index.js";
|
|
6
|
-
const logger = getServerLogger();
|
|
7
|
-
const configRegistry = {
|
|
8
|
-
cacheDirectory: undefined,
|
|
9
|
-
swarmRelays: undefined,
|
|
10
|
-
loggerLevel: undefined,
|
|
11
|
-
loggerConsoleOutput: undefined,
|
|
12
|
-
httpDownloadConcurrency: undefined,
|
|
13
|
-
deviceDefaults: undefined,
|
|
14
|
-
};
|
|
15
|
-
let configIsSet = false;
|
|
16
|
-
/**
|
|
17
|
-
* Sets the SDK configuration. This can only be called ONCE during initialization.
|
|
18
|
-
* After the first call, the config becomes immutable and any subsequent calls will throw.
|
|
19
|
-
*
|
|
20
|
-
* @param config - The configuration to set
|
|
21
|
-
* @throws {ConfigAlreadySetError} If config has already been set
|
|
22
|
-
* @throws {CacheDirNotAbsoluteError} If cacheDirectory is not an absolute path
|
|
23
|
-
* @throws {CacheDirNotWritableError} If cacheDirectory is not writable
|
|
24
|
-
*/
|
|
25
|
-
export function setSDKConfig(config) {
|
|
26
|
-
// Enforce immutability - config can only be set once
|
|
27
|
-
if (configIsSet) {
|
|
28
|
-
throw new ConfigAlreadySetError();
|
|
29
|
-
}
|
|
30
|
-
if (config.cacheDirectory !== undefined && config.cacheDirectory !== null) {
|
|
31
|
-
if (!path.isAbsolute(config.cacheDirectory)) {
|
|
32
|
-
throw new CacheDirNotAbsoluteError();
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
fs.mkdirSync(config.cacheDirectory, { recursive: true });
|
|
36
|
-
const testFile = path.join(config.cacheDirectory, ".qvac-test");
|
|
37
|
-
fs.writeFileSync(testFile, "test");
|
|
38
|
-
fs.unlinkSync(testFile);
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
throw new CacheDirNotWritableError(config.cacheDirectory, error instanceof Error ? error.message : String(error), error);
|
|
42
|
-
}
|
|
43
|
-
configRegistry.cacheDirectory = config.cacheDirectory;
|
|
44
|
-
logger.info(`✅ Cache directory set to: ${config.cacheDirectory}`);
|
|
45
|
-
}
|
|
46
|
-
if (config.swarmRelays !== undefined && config.swarmRelays !== null) {
|
|
47
|
-
configRegistry.swarmRelays = config.swarmRelays;
|
|
48
|
-
logger.info(`✅ Swarm relays configured: ${config.swarmRelays.length} relay(s)`);
|
|
49
|
-
}
|
|
50
|
-
if (config.loggerLevel !== undefined && config.loggerLevel !== null) {
|
|
51
|
-
configRegistry.loggerLevel = config.loggerLevel;
|
|
52
|
-
setGlobalLogLevel(config.loggerLevel);
|
|
53
|
-
logger.info(`Log level set to: ${config.loggerLevel}`);
|
|
54
|
-
}
|
|
55
|
-
if (config.loggerConsoleOutput !== undefined &&
|
|
56
|
-
config.loggerConsoleOutput !== null) {
|
|
57
|
-
configRegistry.loggerConsoleOutput = config.loggerConsoleOutput;
|
|
58
|
-
setGlobalConsoleOutput(config.loggerConsoleOutput);
|
|
59
|
-
logger.info(`Console output ${config.loggerConsoleOutput ? "enabled" : "disabled"}`);
|
|
60
|
-
}
|
|
61
|
-
if (config.httpDownloadConcurrency !== undefined &&
|
|
62
|
-
config.httpDownloadConcurrency !== null) {
|
|
63
|
-
configRegistry.httpDownloadConcurrency = config.httpDownloadConcurrency;
|
|
64
|
-
logger.info(`HTTP download concurrency set to: ${config.httpDownloadConcurrency}`);
|
|
65
|
-
}
|
|
66
|
-
if (config.deviceDefaults !== undefined && config.deviceDefaults !== null) {
|
|
67
|
-
configRegistry.deviceDefaults = config.deviceDefaults;
|
|
68
|
-
logger.info(`✅ Device defaults configured: ${config.deviceDefaults.length} pattern(s)`);
|
|
69
|
-
}
|
|
70
|
-
// Mark config as set - now it's immutable
|
|
71
|
-
configIsSet = true;
|
|
72
|
-
}
|
|
73
|
-
export function getSDKConfig() {
|
|
74
|
-
return { ...configRegistry };
|
|
75
|
-
}
|
|
76
|
-
function getDefaultCacheDir() {
|
|
77
|
-
const homeDir = getEnv().HOME_DIR;
|
|
78
|
-
return path.join(homeDir, ".qvac", "models");
|
|
79
|
-
}
|
|
80
|
-
export function getConfiguredCacheDir() {
|
|
81
|
-
return configRegistry.cacheDirectory || getDefaultCacheDir();
|
|
82
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CanonicalModelType } from "../../../schemas/index";
|
|
2
|
-
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext, } from "./model-config-utils";
|
|
3
|
-
export declare function resolveModelConfig<T>(modelType: CanonicalModelType, userInput: Record<string, unknown>): T;
|
|
4
|
-
//# sourceMappingURL=model-config-registry.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getSDKConfig } from "./config-registry.js";
|
|
2
|
-
import { getRuntimeContext } from "./runtime-context-registry.js";
|
|
3
|
-
import { getServerLogger } from "../../../logging/index.js";
|
|
4
|
-
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext, } from "./model-config-utils.js";
|
|
5
|
-
import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext, } from "./model-config-utils.js";
|
|
6
|
-
const logger = getServerLogger();
|
|
7
|
-
export function resolveModelConfig(modelType, userInput) {
|
|
8
|
-
const ctx = getRuntimeContext();
|
|
9
|
-
const userPatterns = getSDKConfig().deviceDefaults ?? [];
|
|
10
|
-
return resolveModelConfigWithContext(modelType, userInput, ctx, userPatterns, BUILTIN_DEVICE_PATTERNS, (log) => {
|
|
11
|
-
if (log.appliedPatterns.length > 0) {
|
|
12
|
-
logger.debug(`[device-defaults] ${modelType}: applied [${log.appliedPatterns.join(" → ")}]`);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ZodSchema } from "zod";
|
|
2
|
-
import { type CanonicalModelType, type DevicePattern, type DeviceMatch, type RuntimeContext } from "../../../schemas/index";
|
|
3
|
-
export declare const CANONICAL_TO_ALIAS: Record<CanonicalModelType, string>;
|
|
4
|
-
export declare const MODEL_CONFIG_SCHEMAS: Partial<Record<CanonicalModelType, ZodSchema>>;
|
|
5
|
-
export declare const BUILTIN_DEVICE_PATTERNS: DevicePattern[];
|
|
6
|
-
export declare function matchesPattern(ctx: RuntimeContext, match: DeviceMatch): boolean;
|
|
7
|
-
export declare function findAllMatchingPatterns(ctx: RuntimeContext, patterns: DevicePattern[]): DevicePattern[];
|
|
8
|
-
export declare function getDefaultsFromPattern(modelType: CanonicalModelType, pattern: DevicePattern): Record<string, unknown> | undefined;
|
|
9
|
-
export type ConfigResolutionLog = {
|
|
10
|
-
appliedPatterns: string[];
|
|
11
|
-
mergedDefaults: Record<string, unknown>;
|
|
12
|
-
finalConfig: Record<string, unknown>;
|
|
13
|
-
};
|
|
14
|
-
export declare function resolveModelConfigWithContext<T>(modelType: CanonicalModelType, userInput: Record<string, unknown>, ctx: RuntimeContext, userPatterns: DevicePattern[], builtinPatterns?: DevicePattern[], onLog?: (log: ConfigResolutionLog) => void): T;
|
|
15
|
-
//# sourceMappingURL=model-config-utils.d.ts.map
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { ModelType, } from "../../../schemas/index.js";
|
|
2
|
-
import { llmConfigSchema, embedConfigSchema } from "../../../schemas/llamacpp-config.js";
|
|
3
|
-
import { whisperConfigSchema, parakeetRuntimeConfigSchema, } from "../../../schemas/transcription-config.js";
|
|
4
|
-
import { ocrConfigSchema } from "../../../schemas/ocr.js";
|
|
5
|
-
export const CANONICAL_TO_ALIAS = {
|
|
6
|
-
[ModelType.llamacppCompletion]: "llm",
|
|
7
|
-
[ModelType.llamacppEmbedding]: "embeddings",
|
|
8
|
-
[ModelType.whispercppTranscription]: "whisper",
|
|
9
|
-
[ModelType.parakeetTranscription]: "parakeet",
|
|
10
|
-
[ModelType.nmtcppTranslation]: "nmt",
|
|
11
|
-
[ModelType.onnxTts]: "tts",
|
|
12
|
-
[ModelType.onnxOcr]: "ocr",
|
|
13
|
-
};
|
|
14
|
-
export const MODEL_CONFIG_SCHEMAS = {
|
|
15
|
-
[ModelType.llamacppCompletion]: llmConfigSchema,
|
|
16
|
-
[ModelType.llamacppEmbedding]: embedConfigSchema,
|
|
17
|
-
[ModelType.whispercppTranscription]: whisperConfigSchema,
|
|
18
|
-
[ModelType.parakeetTranscription]: parakeetRuntimeConfigSchema.passthrough(),
|
|
19
|
-
[ModelType.onnxOcr]: ocrConfigSchema,
|
|
20
|
-
};
|
|
21
|
-
// Ordered general → specific (later patterns override earlier)
|
|
22
|
-
export const BUILTIN_DEVICE_PATTERNS = [
|
|
23
|
-
{
|
|
24
|
-
name: "Android devices (SDK default)",
|
|
25
|
-
match: {
|
|
26
|
-
platform: "android",
|
|
27
|
-
},
|
|
28
|
-
defaults: {
|
|
29
|
-
[ModelType.llamacppEmbedding]: { flashAttention: "off" },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "Pixel devices (SDK default)",
|
|
34
|
-
match: {
|
|
35
|
-
platform: "android",
|
|
36
|
-
deviceBrand: "google",
|
|
37
|
-
deviceModelPrefix: "Pixel",
|
|
38
|
-
},
|
|
39
|
-
defaults: {
|
|
40
|
-
[ModelType.llamacppCompletion]: { device: "cpu" },
|
|
41
|
-
[ModelType.llamacppEmbedding]: { device: "cpu" },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
export function matchesPattern(ctx, match) {
|
|
46
|
-
if (match.platform !== undefined && ctx.platform !== match.platform) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
if (match.deviceBrand !== undefined &&
|
|
50
|
-
ctx.deviceBrand?.toLowerCase() !== match.deviceBrand.toLowerCase()) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
if (match.deviceModelPrefix !== undefined &&
|
|
54
|
-
!(ctx.deviceModel?.startsWith(match.deviceModelPrefix) ?? false)) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
if (match.deviceModelContains !== undefined &&
|
|
58
|
-
!(ctx.deviceModel?.includes(match.deviceModelContains) ?? false)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
export function findAllMatchingPatterns(ctx, patterns) {
|
|
64
|
-
return patterns.filter((pattern) => matchesPattern(ctx, pattern.match));
|
|
65
|
-
}
|
|
66
|
-
export function getDefaultsFromPattern(modelType, pattern) {
|
|
67
|
-
let defaults = pattern.defaults[modelType];
|
|
68
|
-
if (!defaults) {
|
|
69
|
-
const aliasKey = CANONICAL_TO_ALIAS[modelType];
|
|
70
|
-
if (aliasKey && aliasKey in pattern.defaults) {
|
|
71
|
-
defaults = pattern.defaults[aliasKey];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return defaults;
|
|
75
|
-
}
|
|
76
|
-
export function resolveModelConfigWithContext(modelType, userInput, ctx, userPatterns, builtinPatterns = BUILTIN_DEVICE_PATTERNS, onLog) {
|
|
77
|
-
// Find ALL matching patterns (general → specific order preserved)
|
|
78
|
-
const matchingBuiltin = findAllMatchingPatterns(ctx, builtinPatterns);
|
|
79
|
-
const matchingUser = findAllMatchingPatterns(ctx, userPatterns);
|
|
80
|
-
// Merge in order: builtin patterns → user patterns → user input
|
|
81
|
-
// Later values override earlier (more specific wins)
|
|
82
|
-
const appliedPatterns = [];
|
|
83
|
-
let mergedDefaults = {};
|
|
84
|
-
for (const pattern of matchingBuiltin) {
|
|
85
|
-
const defaults = getDefaultsFromPattern(modelType, pattern);
|
|
86
|
-
if (defaults) {
|
|
87
|
-
appliedPatterns.push(pattern.name);
|
|
88
|
-
mergedDefaults = { ...mergedDefaults, ...defaults };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
for (const pattern of matchingUser) {
|
|
92
|
-
const defaults = getDefaultsFromPattern(modelType, pattern);
|
|
93
|
-
if (defaults) {
|
|
94
|
-
appliedPatterns.push(pattern.name);
|
|
95
|
-
mergedDefaults = { ...mergedDefaults, ...defaults };
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const merged = {
|
|
99
|
-
...mergedDefaults,
|
|
100
|
-
...userInput,
|
|
101
|
-
};
|
|
102
|
-
const schema = MODEL_CONFIG_SCHEMAS[modelType];
|
|
103
|
-
const finalConfig = schema ? schema.parse(merged) : merged;
|
|
104
|
-
if (onLog) {
|
|
105
|
-
onLog({
|
|
106
|
-
appliedPatterns,
|
|
107
|
-
mergedDefaults,
|
|
108
|
-
finalConfig: finalConfig,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return finalConfig;
|
|
112
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { QVACRegistryClient } from "@qvac/registry-client";
|
|
2
|
-
export declare function getRegistryClient(): Promise<QVACRegistryClient>;
|
|
3
|
-
export declare function closeRegistryClient(): Promise<void>;
|
|
4
|
-
export declare function hasActiveRegistryClient(): boolean;
|
|
5
|
-
//# sourceMappingURL=registry-client.d.ts.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { QVACRegistryClient } from "@qvac/registry-client";
|
|
2
|
-
import { getCacheDir } from "../../utils/cache.js";
|
|
3
|
-
import { getServerLogger } from "../../../logging/index.js";
|
|
4
|
-
import { DEFAULT_REGISTRY_CORE_KEY } from "../../../constants/index.js";
|
|
5
|
-
const logger = getServerLogger();
|
|
6
|
-
let registryClient = null;
|
|
7
|
-
export async function getRegistryClient() {
|
|
8
|
-
if (registryClient) {
|
|
9
|
-
logger.debug("Registry client reused");
|
|
10
|
-
return registryClient;
|
|
11
|
-
}
|
|
12
|
-
logger.info("🔗 Creating new registry client...");
|
|
13
|
-
registryClient = new QVACRegistryClient({
|
|
14
|
-
registryCoreKey: DEFAULT_REGISTRY_CORE_KEY,
|
|
15
|
-
storage: getCacheDir(`registry-corestore/${DEFAULT_REGISTRY_CORE_KEY}`),
|
|
16
|
-
});
|
|
17
|
-
await registryClient.ready();
|
|
18
|
-
logger.info("✅ Registry client ready");
|
|
19
|
-
return registryClient;
|
|
20
|
-
}
|
|
21
|
-
export async function closeRegistryClient() {
|
|
22
|
-
if (!registryClient)
|
|
23
|
-
return;
|
|
24
|
-
const client = registryClient;
|
|
25
|
-
registryClient = null;
|
|
26
|
-
logger.info("🔌 Closing registry client...");
|
|
27
|
-
try {
|
|
28
|
-
await client.close();
|
|
29
|
-
logger.info("✅ Registry client closed");
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
logger.error("❌ Error closing registry client:", error instanceof Error ? error.message : String(error));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export function hasActiveRegistryClient() {
|
|
36
|
-
return registryClient !== null;
|
|
37
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RuntimeContext } from "../../../schemas/index";
|
|
2
|
-
export declare function setRuntimeContext(ctx: RuntimeContext): void;
|
|
3
|
-
export declare function getRuntimeContext(): RuntimeContext;
|
|
4
|
-
export declare function isMobile(): boolean;
|
|
5
|
-
export declare function isAndroid(): boolean;
|
|
6
|
-
export declare function isIOS(): boolean;
|
|
7
|
-
//# sourceMappingURL=runtime-context-registry.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// ============================================
|
|
2
|
-
// Runtime context state
|
|
3
|
-
// ============================================
|
|
4
|
-
let context = {};
|
|
5
|
-
let isSet = false;
|
|
6
|
-
export function setRuntimeContext(ctx) {
|
|
7
|
-
if (isSet)
|
|
8
|
-
return;
|
|
9
|
-
context = ctx;
|
|
10
|
-
isSet = true;
|
|
11
|
-
}
|
|
12
|
-
export function getRuntimeContext() {
|
|
13
|
-
return context;
|
|
14
|
-
}
|
|
15
|
-
// ============================================
|
|
16
|
-
// Convenience helpers
|
|
17
|
-
// ============================================
|
|
18
|
-
export function isMobile() {
|
|
19
|
-
return context.runtime === "react-native";
|
|
20
|
-
}
|
|
21
|
-
export function isAndroid() {
|
|
22
|
-
return context.platform === "android";
|
|
23
|
-
}
|
|
24
|
-
export function isIOS() {
|
|
25
|
-
return context.platform === "ios";
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Readable } from "bare-stream";
|
|
2
|
-
import type { AudioInput, AudioFormat } from "../../../schemas/index";
|
|
3
|
-
/**
|
|
4
|
-
* Converts an AudioInput (base64 or filePath) into a Readable stream,
|
|
5
|
-
* decoding the audio when necessary.
|
|
6
|
-
*
|
|
7
|
-
* Shared by all transcription plugins (Whisper, Parakeet, etc.).
|
|
8
|
-
*/
|
|
9
|
-
export declare function createAudioStream(audioChunk: AudioInput, audioFormat: AudioFormat): Promise<Readable>;
|
|
10
|
-
//# sourceMappingURL=audio-input.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Readable } from "bare-stream";
|
|
2
|
-
import fs from "bare-fs";
|
|
3
|
-
import { needsDecoding, decodeAudioToStream, } from "../../utils/audio/decoder.js";
|
|
4
|
-
import { AudioFileNotFoundError, InvalidAudioChunkError, } from "../../../utils/errors-server.js";
|
|
5
|
-
/**
|
|
6
|
-
* Converts an AudioInput (base64 or filePath) into a Readable stream,
|
|
7
|
-
* decoding the audio when necessary.
|
|
8
|
-
*
|
|
9
|
-
* Shared by all transcription plugins (Whisper, Parakeet, etc.).
|
|
10
|
-
*/
|
|
11
|
-
export async function createAudioStream(audioChunk, audioFormat) {
|
|
12
|
-
switch (audioChunk.type) {
|
|
13
|
-
case "base64": {
|
|
14
|
-
const audioBuffer = Buffer.from(audioChunk.value, "base64");
|
|
15
|
-
return Readable.from([audioBuffer]);
|
|
16
|
-
}
|
|
17
|
-
case "filePath": {
|
|
18
|
-
const filePath = audioChunk.value;
|
|
19
|
-
try {
|
|
20
|
-
fs.accessSync(filePath);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
throw new AudioFileNotFoundError(filePath, error);
|
|
24
|
-
}
|
|
25
|
-
if (needsDecoding(filePath)) {
|
|
26
|
-
return decodeAudioToStream(filePath, audioFormat);
|
|
27
|
-
}
|
|
28
|
-
return fs.createReadStream(filePath);
|
|
29
|
-
}
|
|
30
|
-
default:
|
|
31
|
-
throw new InvalidAudioChunkError();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type FilesystemDL from "@qvac/dl-filesystem";
|
|
2
|
-
/**
|
|
3
|
-
* Adapts FilesystemDL to addon Loader interface by adding download stub.
|
|
4
|
-
* download() is never called when using filesystem loader.
|
|
5
|
-
*/
|
|
6
|
-
export declare function asLoader<T>(loader: FilesystemDL): T;
|
|
7
|
-
//# sourceMappingURL=loader-adapter.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapts FilesystemDL to addon Loader interface by adding download stub.
|
|
3
|
-
* download() is never called when using filesystem loader.
|
|
4
|
-
*/
|
|
5
|
-
export function asLoader(loader) {
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
7
|
-
loader.download = () => Promise.reject(new Error("download not supported"));
|
|
8
|
-
return loader;
|
|
9
|
-
}
|
package/dist/server/env.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Initialize the worker environment. Call once at worker startup.
|
|
3
|
-
* Returns whether RPC config was parsed from arguments.
|
|
4
|
-
*/
|
|
5
|
-
export declare function initEnv(): {
|
|
6
|
-
hasRPCConfig: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Get the worker environment. Must call initEnv() first.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getEnv(): {
|
|
12
|
-
HOME_DIR: string;
|
|
13
|
-
QVAC_IPC_SOCKET_PATH?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Get the validated env config. Must call initEnv() first.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getValidatedEnv(): {
|
|
19
|
-
HOME_DIR: string;
|
|
20
|
-
QVAC_IPC_SOCKET_PATH?: string | undefined;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=env.d.ts.map
|
package/dist/server/env.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import process from "bare-process";
|
|
2
|
-
import { isBareKit } from "which-runtime";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const envSchema = z.object({
|
|
5
|
-
QVAC_IPC_SOCKET_PATH: z.string().optional(),
|
|
6
|
-
HOME_DIR: z.string(),
|
|
7
|
-
});
|
|
8
|
-
let validatedEnv = null;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize the worker environment. Call once at worker startup.
|
|
11
|
-
* Returns whether RPC config was parsed from arguments.
|
|
12
|
-
*/
|
|
13
|
-
export function initEnv() {
|
|
14
|
-
const defaultHomeDir = process.env["HOME"] || process.env["USERPROFILE"] || "/tmp";
|
|
15
|
-
let envConfig = {
|
|
16
|
-
HOME_DIR: defaultHomeDir,
|
|
17
|
-
};
|
|
18
|
-
let hasRPCConfig = false;
|
|
19
|
-
if (isBareKit && process.argv[0]) {
|
|
20
|
-
envConfig["HOME_DIR"] = process.argv[0];
|
|
21
|
-
}
|
|
22
|
-
// Try to parse any argument as JSON config (fail gracefully)
|
|
23
|
-
if (process.argv[2]) {
|
|
24
|
-
try {
|
|
25
|
-
const rpcArgs = JSON.parse(process.argv[2]);
|
|
26
|
-
envConfig = { ...envConfig, ...rpcArgs };
|
|
27
|
-
hasRPCConfig = true;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
// Not JSON or invalid - use defaults (direct mode)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
validatedEnv = envSchema.parse(envConfig);
|
|
34
|
-
return { hasRPCConfig };
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get the worker environment. Must call initEnv() first.
|
|
38
|
-
*/
|
|
39
|
-
export function getEnv() {
|
|
40
|
-
if (!validatedEnv) {
|
|
41
|
-
// Fallback initialization for cases where initEnv wasn't called
|
|
42
|
-
initEnv();
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
...process.env,
|
|
46
|
-
...validatedEnv,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get the validated env config. Must call initEnv() first.
|
|
51
|
-
*/
|
|
52
|
-
export function getValidatedEnv() {
|
|
53
|
-
if (!validatedEnv) {
|
|
54
|
-
initEnv();
|
|
55
|
-
}
|
|
56
|
-
return validatedEnv;
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerPlugin, getPlugin, getPluginHandler, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin, } from "./registry.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type QvacPlugin, type PluginHandlerDefinition } from "../../schemas/plugin";
|
|
2
|
-
export declare function registerPlugin(plugin: QvacPlugin): void;
|
|
3
|
-
export declare function getPlugin(modelType: string): QvacPlugin | undefined;
|
|
4
|
-
export declare function getPluginHandler(modelType: string, handlerName: string): PluginHandlerDefinition | undefined;
|
|
5
|
-
export declare function hasPlugin(modelType: string): boolean;
|
|
6
|
-
export declare function unregisterPlugin(modelType: string): boolean;
|
|
7
|
-
export declare function getAllPlugins(): QvacPlugin[];
|
|
8
|
-
export declare function clearPlugins(): void;
|
|
9
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { pluginDefinitionRuntimeSchema, } from "../../schemas/plugin.js";
|
|
2
|
-
import { isModelTypeAlias } from "../../schemas/index.js";
|
|
3
|
-
import { PluginAlreadyRegisteredError, PluginDefinitionInvalidError, PluginLoggingInvalidError, PluginModelTypeReservedError, } from "../../utils/errors-server.js";
|
|
4
|
-
import { createAddonLoggerCallback } from "../../logging/addon.js";
|
|
5
|
-
const plugins = new Map();
|
|
6
|
-
function getModelTypeForError(plugin) {
|
|
7
|
-
if (!plugin || typeof plugin !== "object")
|
|
8
|
-
return "(unknown)";
|
|
9
|
-
if (!("modelType" in plugin))
|
|
10
|
-
return "(unknown)";
|
|
11
|
-
const modelType = plugin.modelType;
|
|
12
|
-
return typeof modelType === "string" && modelType.length > 0
|
|
13
|
-
? modelType
|
|
14
|
-
: "(unknown)";
|
|
15
|
-
}
|
|
16
|
-
function validatePluginDefinition(plugin) {
|
|
17
|
-
const result = pluginDefinitionRuntimeSchema.safeParse(plugin);
|
|
18
|
-
if (result.success)
|
|
19
|
-
return;
|
|
20
|
-
const details = result.error.issues
|
|
21
|
-
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
22
|
-
.join(", ");
|
|
23
|
-
throw new PluginDefinitionInvalidError(getModelTypeForError(plugin), details);
|
|
24
|
-
}
|
|
25
|
-
export function registerPlugin(plugin) {
|
|
26
|
-
validatePluginDefinition(plugin);
|
|
27
|
-
if (isModelTypeAlias(plugin.modelType)) {
|
|
28
|
-
throw new PluginModelTypeReservedError(plugin.modelType);
|
|
29
|
-
}
|
|
30
|
-
if (plugins.has(plugin.modelType)) {
|
|
31
|
-
throw new PluginAlreadyRegisteredError(plugin.modelType);
|
|
32
|
-
}
|
|
33
|
-
// Validate logging module shape if provided
|
|
34
|
-
if (plugin.logging?.module) {
|
|
35
|
-
const loggingModule = plugin.logging.module;
|
|
36
|
-
if (typeof loggingModule["setLogger"] !== "function") {
|
|
37
|
-
throw new PluginLoggingInvalidError(plugin.modelType, "logging.module must have a setLogger(callback) function");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
plugins.set(plugin.modelType, plugin);
|
|
41
|
-
if (plugin.logging?.module && plugin.logging?.namespace) {
|
|
42
|
-
const loggingModule = plugin.logging.module;
|
|
43
|
-
loggingModule.setLogger(createAddonLoggerCallback(plugin.logging.namespace));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export function getPlugin(modelType) {
|
|
47
|
-
return plugins.get(modelType);
|
|
48
|
-
}
|
|
49
|
-
export function getPluginHandler(modelType, handlerName) {
|
|
50
|
-
const plugin = plugins.get(modelType);
|
|
51
|
-
if (!plugin)
|
|
52
|
-
return undefined;
|
|
53
|
-
return plugin.handlers[handlerName];
|
|
54
|
-
}
|
|
55
|
-
export function hasPlugin(modelType) {
|
|
56
|
-
return plugins.has(modelType);
|
|
57
|
-
}
|
|
58
|
-
export function unregisterPlugin(modelType) {
|
|
59
|
-
const plugin = plugins.get(modelType);
|
|
60
|
-
if (!plugin)
|
|
61
|
-
return false;
|
|
62
|
-
if (plugin.logging?.module) {
|
|
63
|
-
const loggingModule = plugin.logging.module;
|
|
64
|
-
loggingModule.releaseLogger?.();
|
|
65
|
-
}
|
|
66
|
-
return plugins.delete(modelType);
|
|
67
|
-
}
|
|
68
|
-
export function getAllPlugins() {
|
|
69
|
-
return Array.from(plugins.values());
|
|
70
|
-
}
|
|
71
|
-
export function clearPlugins() {
|
|
72
|
-
for (const plugin of plugins.values()) {
|
|
73
|
-
if (plugin.logging?.module) {
|
|
74
|
-
const loggingModule = plugin.logging.module;
|
|
75
|
-
loggingModule.releaseLogger?.();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
plugins.clear();
|
|
79
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server-side RPC transport for delegated requests.
|
|
3
|
-
*
|
|
4
|
-
* This module provides `send` and `stream` functions for server-side
|
|
5
|
-
* delegation to remote peers (via HyperSwarm RPC).
|
|
6
|
-
*/
|
|
7
|
-
import type RPC from "bare-rpc";
|
|
8
|
-
import { DELEGATION_BREAKDOWN_KEY, OPERATION_EVENT_KEY, type Request, type Response, type RPCOptions, type DelegationBreakdown, type OperationEvent } from "../../schemas/index";
|
|
9
|
-
import type { DelegatedHandlerOptions } from "./profiling/index";
|
|
10
|
-
export interface DelegateOptions extends RPCOptions, DelegatedHandlerOptions {
|
|
11
|
-
peerKey?: string;
|
|
12
|
-
}
|
|
13
|
-
export type ResponseWithDelegation = Response & {
|
|
14
|
-
[DELEGATION_BREAKDOWN_KEY]?: DelegationBreakdown;
|
|
15
|
-
[OPERATION_EVENT_KEY]?: OperationEvent;
|
|
16
|
-
};
|
|
17
|
-
export declare function send<T extends Request>(request: T, rpc: RPC, options?: DelegateOptions): Promise<Response>;
|
|
18
|
-
export declare function stream<T extends Request>(request: T, rpc: RPC, options?: DelegateOptions): AsyncGenerator<Response>;
|
|
19
|
-
//# sourceMappingURL=delegate-transport.d.ts.map
|