@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,92 +0,0 @@
|
|
|
1
|
-
import { getModelEntry } from "../../bare/registry/model-registry.js";
|
|
2
|
-
import { getPlugin, getPluginHandler } from "../../plugins/index.js";
|
|
3
|
-
import { profileReplyHandler, profileStreamHandler, } from "../profiling/index.js";
|
|
4
|
-
import { PluginNotFoundError, PluginHandlerNotFoundError, PluginHandlerTypeMismatchError, PluginRequestValidationFailedError, PluginResponseValidationFailedError, ModelIsDelegatedError, ModelNotFoundError, } from "../../../utils/errors-server.js";
|
|
5
|
-
import { getServerLogger } from "../../../logging/index.js";
|
|
6
|
-
const logger = getServerLogger();
|
|
7
|
-
function resolvePluginHandler(modelId, handlerName) {
|
|
8
|
-
const modelEntry = getModelEntry(modelId);
|
|
9
|
-
if (!modelEntry) {
|
|
10
|
-
throw new ModelNotFoundError(modelId);
|
|
11
|
-
}
|
|
12
|
-
if (modelEntry.isDelegated || !modelEntry.local) {
|
|
13
|
-
throw new ModelIsDelegatedError(modelId);
|
|
14
|
-
}
|
|
15
|
-
const modelType = modelEntry.local.modelType;
|
|
16
|
-
const plugin = getPlugin(modelType);
|
|
17
|
-
if (!plugin) {
|
|
18
|
-
throw new PluginNotFoundError(modelType);
|
|
19
|
-
}
|
|
20
|
-
const handlerDef = getPluginHandler(modelType, handlerName);
|
|
21
|
-
if (!handlerDef) {
|
|
22
|
-
const availableHandlers = Object.keys(plugin.handlers);
|
|
23
|
-
throw new PluginHandlerNotFoundError(modelType, handlerName, availableHandlers);
|
|
24
|
-
}
|
|
25
|
-
return { modelType, plugin, handlerDef };
|
|
26
|
-
}
|
|
27
|
-
export async function handlePluginInvoke(request) {
|
|
28
|
-
return profileReplyHandler({ op: "pluginInvoke", request }, async () => {
|
|
29
|
-
const { modelId, handler: handlerName, params } = request;
|
|
30
|
-
logger.debug(`[pluginInvoke] modelId=${modelId} handler=${handlerName}`);
|
|
31
|
-
const { handlerDef } = resolvePluginHandler(modelId, handlerName);
|
|
32
|
-
if (handlerDef.streaming) {
|
|
33
|
-
throw new PluginHandlerTypeMismatchError(handlerName, "reply", "streaming");
|
|
34
|
-
}
|
|
35
|
-
const parseResult = handlerDef.requestSchema.safeParse(params);
|
|
36
|
-
if (!parseResult.success) {
|
|
37
|
-
const details = parseResult.error.issues
|
|
38
|
-
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
39
|
-
.join(", ");
|
|
40
|
-
throw new PluginRequestValidationFailedError(handlerName, details);
|
|
41
|
-
}
|
|
42
|
-
const result = await handlerDef.handler(parseResult.data);
|
|
43
|
-
const responseParseResult = handlerDef.responseSchema.safeParse(result);
|
|
44
|
-
if (!responseParseResult.success) {
|
|
45
|
-
const details = responseParseResult.error.issues
|
|
46
|
-
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
47
|
-
.join(", ");
|
|
48
|
-
throw new PluginResponseValidationFailedError(handlerName, details);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
type: "pluginInvoke",
|
|
52
|
-
result: responseParseResult.data,
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
export async function* handlePluginInvokeStream(request) {
|
|
57
|
-
yield* profileStreamHandler({ op: "pluginInvokeStream", request }, async function* () {
|
|
58
|
-
const { modelId, handler: handlerName, params } = request;
|
|
59
|
-
logger.debug(`[pluginInvokeStream] modelId=${modelId} handler=${handlerName}`);
|
|
60
|
-
const { handlerDef } = resolvePluginHandler(modelId, handlerName);
|
|
61
|
-
if (!handlerDef.streaming) {
|
|
62
|
-
throw new PluginHandlerTypeMismatchError(handlerName, "streaming", "reply");
|
|
63
|
-
}
|
|
64
|
-
const parseResult = handlerDef.requestSchema.safeParse(params);
|
|
65
|
-
if (!parseResult.success) {
|
|
66
|
-
const details = parseResult.error.issues
|
|
67
|
-
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
68
|
-
.join(", ");
|
|
69
|
-
throw new PluginRequestValidationFailedError(handlerName, details);
|
|
70
|
-
}
|
|
71
|
-
const generator = handlerDef.handler(parseResult.data);
|
|
72
|
-
for await (const chunk of generator) {
|
|
73
|
-
const responseParseResult = handlerDef.responseSchema.safeParse(chunk);
|
|
74
|
-
if (!responseParseResult.success) {
|
|
75
|
-
const details = responseParseResult.error.issues
|
|
76
|
-
.map((i) => `${String(i.path.join("."))}: ${i.message}`)
|
|
77
|
-
.join(", ");
|
|
78
|
-
throw new PluginResponseValidationFailedError(handlerName, details);
|
|
79
|
-
}
|
|
80
|
-
yield {
|
|
81
|
-
type: "pluginInvokeStream",
|
|
82
|
-
result: responseParseResult.data,
|
|
83
|
-
done: false,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
yield {
|
|
87
|
-
type: "pluginInvokeStream",
|
|
88
|
-
result: null,
|
|
89
|
-
done: true,
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ModelRegistryListResponse, ModelRegistrySearchRequest, ModelRegistrySearchResponse, ModelRegistryGetModelRequest, ModelRegistryGetModelResponse } from "../../../schemas/index";
|
|
2
|
-
export declare function handleModelRegistryList(): Promise<ModelRegistryListResponse>;
|
|
3
|
-
export declare function handleModelRegistrySearch(request: ModelRegistrySearchRequest): Promise<ModelRegistrySearchResponse>;
|
|
4
|
-
export declare function handleModelRegistryGetModel(request: ModelRegistryGetModelRequest): Promise<ModelRegistryGetModelResponse>;
|
|
5
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { REGISTRY_ERROR_CODES } from "../../../schemas/sdk-errors-registry.js";
|
|
2
|
-
import { getAddonFromEngine, resolveCanonicalEngine, } from "../../../schemas/engine-addon-map.js";
|
|
3
|
-
import { getRegistryClient } from "../../bare/registry/registry-client.js";
|
|
4
|
-
import { getServerLogger } from "../../../logging/index.js";
|
|
5
|
-
import { ModelRegistryQueryFailedError } from "../../../utils/errors-server.js";
|
|
6
|
-
const logger = getServerLogger();
|
|
7
|
-
function toHexString(value) {
|
|
8
|
-
if (!value)
|
|
9
|
-
return "";
|
|
10
|
-
if (Buffer.isBuffer(value))
|
|
11
|
-
return value.toString("hex");
|
|
12
|
-
if (typeof value === "string")
|
|
13
|
-
return value;
|
|
14
|
-
if (typeof value === "object" && "data" in value) {
|
|
15
|
-
return Buffer.from(value.data).toString("hex");
|
|
16
|
-
}
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
function processRegistryModel(model) {
|
|
20
|
-
const engine = resolveCanonicalEngine(model.engine || "");
|
|
21
|
-
if (!engine) {
|
|
22
|
-
logger.warn(`Skipping model with unknown engine "${model.engine}": ${model.path}`);
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const filename = model.path.split("/").pop() || model.path;
|
|
26
|
-
const blobBinding = model.blobBinding;
|
|
27
|
-
const blobCoreKey = toHexString(blobBinding?.coreKey);
|
|
28
|
-
const blobBlockOffset = blobBinding?.blockOffset ?? 0;
|
|
29
|
-
const blobBlockLength = blobBinding?.blockLength ?? 0;
|
|
30
|
-
const blobByteOffset = blobBinding?.byteOffset ?? 0;
|
|
31
|
-
const expectedSize = blobBinding?.byteLength ?? 0;
|
|
32
|
-
// sha256 lives on blobBinding at runtime (per hyperschema), fall back to top-level
|
|
33
|
-
const sha256Checksum = blobBinding?.["sha256"] ||
|
|
34
|
-
model.sha256 ||
|
|
35
|
-
"";
|
|
36
|
-
const addon = getAddonFromEngine(engine);
|
|
37
|
-
// Use the filename without extension as the display name
|
|
38
|
-
const name = filename.replace(/\.\w+$/, "");
|
|
39
|
-
return {
|
|
40
|
-
name,
|
|
41
|
-
registryPath: model.path,
|
|
42
|
-
registrySource: model.source,
|
|
43
|
-
blobCoreKey,
|
|
44
|
-
blobBlockOffset,
|
|
45
|
-
blobBlockLength,
|
|
46
|
-
blobByteOffset,
|
|
47
|
-
modelId: filename,
|
|
48
|
-
addon,
|
|
49
|
-
expectedSize,
|
|
50
|
-
sha256Checksum,
|
|
51
|
-
engine,
|
|
52
|
-
quantization: model.quantization || "",
|
|
53
|
-
params: model.params || "",
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export async function handleModelRegistryList() {
|
|
57
|
-
logger.debug("Handling QVAC model registry list request");
|
|
58
|
-
try {
|
|
59
|
-
const client = await getRegistryClient();
|
|
60
|
-
const registryModels = await client.findBy();
|
|
61
|
-
const models = registryModels
|
|
62
|
-
.map(processRegistryModel)
|
|
63
|
-
.filter((m) => m !== null);
|
|
64
|
-
logger.debug(`QVAC model registry list returned ${models.length} models`);
|
|
65
|
-
return {
|
|
66
|
-
type: "modelRegistryList",
|
|
67
|
-
success: true,
|
|
68
|
-
models,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
logger.error("QVAC model registry list failed:", error);
|
|
73
|
-
// Re-throw registry client errors directly (19001-19003)
|
|
74
|
-
const qvacError = error;
|
|
75
|
-
if (qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CONNECT ||
|
|
76
|
-
qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CLOSE ||
|
|
77
|
-
qvacError.code === REGISTRY_ERROR_CODES.MODEL_NOT_FOUND) {
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
80
|
-
// Wrap unknown errors in SDK error
|
|
81
|
-
throw new ModelRegistryQueryFailedError(error instanceof Error ? error.message : "Unknown error", error);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export async function handleModelRegistrySearch(request) {
|
|
85
|
-
logger.debug("Handling QVAC model registry search request", request);
|
|
86
|
-
try {
|
|
87
|
-
const client = await getRegistryClient();
|
|
88
|
-
const registryModels = await client.findBy({
|
|
89
|
-
...(request.quantization && { quantization: request.quantization }),
|
|
90
|
-
});
|
|
91
|
-
let models = registryModels
|
|
92
|
-
.map(processRegistryModel)
|
|
93
|
-
.filter((m) => m !== null);
|
|
94
|
-
if (request.engine) {
|
|
95
|
-
const canonicalEngine = resolveCanonicalEngine(request.engine);
|
|
96
|
-
models = models.filter((m) => m.engine === (canonicalEngine ?? request.engine));
|
|
97
|
-
}
|
|
98
|
-
if (request.filter) {
|
|
99
|
-
const filterLower = request.filter.toLowerCase();
|
|
100
|
-
models = models.filter((m) => m.name.toLowerCase().includes(filterLower) ||
|
|
101
|
-
m.registryPath.toLowerCase().includes(filterLower) ||
|
|
102
|
-
m.addon.toLowerCase().includes(filterLower) ||
|
|
103
|
-
m.engine.toLowerCase().includes(filterLower));
|
|
104
|
-
}
|
|
105
|
-
if (request.addon) {
|
|
106
|
-
models = models.filter((m) => m.addon === request.addon);
|
|
107
|
-
}
|
|
108
|
-
logger.debug(`QVAC model registry search returned ${models.length} models`);
|
|
109
|
-
return {
|
|
110
|
-
type: "modelRegistrySearch",
|
|
111
|
-
success: true,
|
|
112
|
-
models,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
logger.error("QVAC model registry search failed:", error);
|
|
117
|
-
// Re-throw registry client errors directly (19001-19003)
|
|
118
|
-
const qvacError = error;
|
|
119
|
-
if (qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CONNECT ||
|
|
120
|
-
qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CLOSE ||
|
|
121
|
-
qvacError.code === REGISTRY_ERROR_CODES.MODEL_NOT_FOUND) {
|
|
122
|
-
throw error;
|
|
123
|
-
}
|
|
124
|
-
throw new ModelRegistryQueryFailedError(error instanceof Error ? error.message : "Unknown error", error);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
export async function handleModelRegistryGetModel(request) {
|
|
128
|
-
logger.debug("Handling QVAC model registry get model request", request);
|
|
129
|
-
try {
|
|
130
|
-
const client = await getRegistryClient();
|
|
131
|
-
const rawModel = await client.getModel(request.registryPath, request.registrySource);
|
|
132
|
-
if (!rawModel) {
|
|
133
|
-
throw new ModelRegistryQueryFailedError(`Model not found: ${request.registrySource}/${request.registryPath}`);
|
|
134
|
-
}
|
|
135
|
-
const model = processRegistryModel(rawModel);
|
|
136
|
-
if (!model) {
|
|
137
|
-
throw new ModelRegistryQueryFailedError(`Model has unknown engine "${rawModel.engine}": ${request.registryPath}`);
|
|
138
|
-
}
|
|
139
|
-
logger.debug("QVAC model registry get model found:", model.name);
|
|
140
|
-
return {
|
|
141
|
-
type: "modelRegistryGetModel",
|
|
142
|
-
success: true,
|
|
143
|
-
model,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
logger.error("QVAC model registry get model failed:", error);
|
|
148
|
-
// Re-throw registry client errors directly (19001-19003)
|
|
149
|
-
const qvacError = error;
|
|
150
|
-
if (qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CONNECT ||
|
|
151
|
-
qvacError.code === REGISTRY_ERROR_CODES.FAILED_TO_CLOSE ||
|
|
152
|
-
qvacError.code === REGISTRY_ERROR_CODES.MODEL_NOT_FOUND) {
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
155
|
-
throw new ModelRegistryQueryFailedError(error instanceof Error ? error.message : "Unknown error", error);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getModelEntry, unregisterModel } from "../../bare/registry/model-registry.js";
|
|
2
|
-
import { getRPC } from "../../bare/delegate-rpc-client.js";
|
|
3
|
-
import { send } from "../delegate-transport.js";
|
|
4
|
-
import { hasActiveProviders } from "../../bare/hyperswarm.js";
|
|
5
|
-
import { getRegistryStats } from "../../bare/registry/model-registry.js";
|
|
6
|
-
import { ModelIsDelegatedError } from "../../../utils/errors-server.js";
|
|
7
|
-
import { getServerLogger } from "../../../logging/index.js";
|
|
8
|
-
const logger = getServerLogger();
|
|
9
|
-
export async function handleUnloadModelDelegated(request) {
|
|
10
|
-
const entry = getModelEntry(request.modelId);
|
|
11
|
-
if (!entry?.isDelegated || !entry.delegated) {
|
|
12
|
-
throw new ModelIsDelegatedError(request.modelId);
|
|
13
|
-
}
|
|
14
|
-
const { topic, providerPublicKey, timeout, healthCheckTimeout } = entry.delegated;
|
|
15
|
-
unregisterModel(request.modelId);
|
|
16
|
-
try {
|
|
17
|
-
logger.info(`Sending delegated unload for model ${request.modelId} to provider: ${providerPublicKey}`);
|
|
18
|
-
const rpc = await getRPC(topic, providerPublicKey, { timeout, healthCheckTimeout });
|
|
19
|
-
await send({ type: "unloadModel", modelId: request.modelId, clearStorage: false }, rpc, { timeout, peerKey: providerPublicKey });
|
|
20
|
-
logger.info(`Delegated model ${request.modelId} unloaded on provider`);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
logger.error(`Failed to unload delegated model ${request.modelId} on provider:`, error);
|
|
24
|
-
}
|
|
25
|
-
const stats = getRegistryStats();
|
|
26
|
-
return {
|
|
27
|
-
type: "unloadModel",
|
|
28
|
-
success: true,
|
|
29
|
-
hasActiveModels: stats.totalModels > 0,
|
|
30
|
-
hasActiveProviders: hasActiveProviders(),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ProfilingRequestMeta, type DelegationBreakdown, type OperationEvent } from "../../../schemas/index";
|
|
2
|
-
export interface ServerProfilingContext {
|
|
3
|
-
meta: ProfilingRequestMeta;
|
|
4
|
-
requestStart: number;
|
|
5
|
-
jsonParseMs?: number;
|
|
6
|
-
zodValidationMs?: number;
|
|
7
|
-
handlerExecutionMs?: number;
|
|
8
|
-
responseZodValidationMs?: number;
|
|
9
|
-
responseStringifyMs?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function createProfilingContext(meta: ProfilingRequestMeta): ServerProfilingContext;
|
|
12
|
-
export interface ProfilingInjectionOptions {
|
|
13
|
-
ctx?: ServerProfilingContext;
|
|
14
|
-
delegation?: DelegationBreakdown;
|
|
15
|
-
operation?: OperationEvent;
|
|
16
|
-
}
|
|
17
|
-
export declare function injectProfilingIntoString(jsonString: string, options: ProfilingInjectionOptions): string;
|
|
18
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { PROFILING_KEY, } from "../../../schemas/index.js";
|
|
2
|
-
import { nowMs } from "../../../profiling/index.js";
|
|
3
|
-
export function createProfilingContext(meta) {
|
|
4
|
-
return { meta, requestStart: nowMs() };
|
|
5
|
-
}
|
|
6
|
-
function buildServerBreakdown(ctx) {
|
|
7
|
-
return {
|
|
8
|
-
requestJsonParseMs: ctx.jsonParseMs,
|
|
9
|
-
requestZodValidationMs: ctx.zodValidationMs,
|
|
10
|
-
handlerExecutionMs: ctx.handlerExecutionMs,
|
|
11
|
-
responseZodValidationMs: ctx.responseZodValidationMs,
|
|
12
|
-
responseStringifyMs: ctx.responseStringifyMs,
|
|
13
|
-
totalServerMs: nowMs() - ctx.requestStart,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export function injectProfilingIntoString(jsonString, options) {
|
|
17
|
-
const { ctx, delegation, operation } = options;
|
|
18
|
-
const includeServer = ctx?.meta.includeServer ?? false;
|
|
19
|
-
const hasContent = includeServer || !!delegation || !!operation;
|
|
20
|
-
if (!hasContent || !jsonString.endsWith("}")) {
|
|
21
|
-
return jsonString;
|
|
22
|
-
}
|
|
23
|
-
const id = ctx?.meta.id ?? delegation?.profileId ?? operation?.profileId ?? "";
|
|
24
|
-
const profilingMeta = { id };
|
|
25
|
-
if (includeServer && ctx) {
|
|
26
|
-
profilingMeta["server"] = buildServerBreakdown(ctx);
|
|
27
|
-
}
|
|
28
|
-
if (delegation) {
|
|
29
|
-
const { profileId: _unused, ...delegationWithoutId } = delegation;
|
|
30
|
-
void _unused;
|
|
31
|
-
profilingMeta["delegation"] = delegationWithoutId;
|
|
32
|
-
}
|
|
33
|
-
if (operation) {
|
|
34
|
-
profilingMeta["operation"] = operation;
|
|
35
|
-
}
|
|
36
|
-
return (jsonString.slice(0, -1) +
|
|
37
|
-
`,"${PROFILING_KEY}":${JSON.stringify(profilingMeta)}}`);
|
|
38
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type BaseTimings } from "../../../profiling/index";
|
|
2
|
-
import type { ProfilingRequestMeta, ProfilingResponseMeta, DelegationBreakdown } from "../../../schemas/index";
|
|
3
|
-
export interface DelegatedHandlerOptions {
|
|
4
|
-
profilingMeta?: ProfilingRequestMeta;
|
|
5
|
-
}
|
|
6
|
-
interface BaseDelegationTimings extends BaseTimings {
|
|
7
|
-
requestStringifyMs?: number;
|
|
8
|
-
sendStart?: number;
|
|
9
|
-
}
|
|
10
|
-
export interface DelegationTimings extends BaseDelegationTimings {
|
|
11
|
-
firstResponseAt?: number;
|
|
12
|
-
responseJsonParseMs?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface DelegationStreamTimings extends BaseDelegationTimings {
|
|
15
|
-
firstChunkAt?: number;
|
|
16
|
-
lastChunkAt?: number;
|
|
17
|
-
chunkCount: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function shouldProfileDelegation(op: string, incomingMeta?: ProfilingRequestMeta): boolean;
|
|
20
|
-
export declare function createDelegationTimings(profileId: string, requestType: string): DelegationTimings;
|
|
21
|
-
export declare function createDelegationStreamTimings(profileId: string, requestType: string): DelegationStreamTimings;
|
|
22
|
-
export declare function cacheDelegationConnectionTime(peerKey: string, durationMs: number): void;
|
|
23
|
-
export declare function flushServerConnectionEvent(peerKey: string): void;
|
|
24
|
-
export declare function consumeBreakdownConnectionTime(peerKey: string): number | undefined;
|
|
25
|
-
export declare function buildDelegationBreakdown(timings: DelegationTimings, connectionMs?: number): DelegationBreakdown;
|
|
26
|
-
export declare function buildDelegationStreamBreakdown(timings: DelegationStreamTimings): DelegationBreakdown;
|
|
27
|
-
export declare function recordDelegationEvents(timings: DelegationTimings, serverMeta?: ProfilingResponseMeta, connectionMs?: number): DelegationBreakdown;
|
|
28
|
-
export declare function recordDelegationStreamEvents(timings: DelegationStreamTimings, serverMeta?: ProfilingResponseMeta): void;
|
|
29
|
-
export declare function clearPeerConnectionTracking(peerKey: string): void;
|
|
30
|
-
export declare function resetDelegationConnectionTracking(): void;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=delegation-profiler.d.ts.map
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { nowMs, record, shouldProfile, recordPhase, recordServerBreakdownPhases, } from "../../../profiling/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Per-peer connection tracking for delegation.
|
|
4
|
-
* Separate tracking for server-side event recording vs breakdown injection.
|
|
5
|
-
*
|
|
6
|
-
* Flow:
|
|
7
|
-
* 1. Connection happens → cacheDelegationConnectionTime stores ms
|
|
8
|
-
* 2. First profiled call (stream or unary) → flushServerConnectionEvent records server event
|
|
9
|
-
* 3. First unary call → consumeBreakdownConnectionTime returns ms for breakdown injection
|
|
10
|
-
*/
|
|
11
|
-
const pendingConnectionTimes = new Map();
|
|
12
|
-
const serverConnectionRecorded = new Map();
|
|
13
|
-
const breakdownConnectionMs = new Map();
|
|
14
|
-
const breakdownConnectionInjected = new Map();
|
|
15
|
-
export function shouldProfileDelegation(op, incomingMeta) {
|
|
16
|
-
if (incomingMeta?.enabled === false) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if (incomingMeta?.enabled === true) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
return shouldProfile(op);
|
|
23
|
-
}
|
|
24
|
-
export function createDelegationTimings(profileId, requestType) {
|
|
25
|
-
return { profileId, requestType, requestStart: nowMs() };
|
|
26
|
-
}
|
|
27
|
-
export function createDelegationStreamTimings(profileId, requestType) {
|
|
28
|
-
return { profileId, requestType, requestStart: nowMs(), chunkCount: 0 };
|
|
29
|
-
}
|
|
30
|
-
export function cacheDelegationConnectionTime(peerKey, durationMs) {
|
|
31
|
-
if (serverConnectionRecorded.get(peerKey))
|
|
32
|
-
return;
|
|
33
|
-
if (pendingConnectionTimes.has(peerKey))
|
|
34
|
-
return;
|
|
35
|
-
pendingConnectionTimes.set(peerKey, durationMs);
|
|
36
|
-
}
|
|
37
|
-
export function flushServerConnectionEvent(peerKey) {
|
|
38
|
-
if (serverConnectionRecorded.get(peerKey))
|
|
39
|
-
return;
|
|
40
|
-
const ms = pendingConnectionTimes.get(peerKey);
|
|
41
|
-
if (ms === undefined)
|
|
42
|
-
return;
|
|
43
|
-
pendingConnectionTimes.delete(peerKey);
|
|
44
|
-
serverConnectionRecorded.set(peerKey, true);
|
|
45
|
-
if (!breakdownConnectionInjected.get(peerKey)) {
|
|
46
|
-
breakdownConnectionMs.set(peerKey, ms);
|
|
47
|
-
}
|
|
48
|
-
record({
|
|
49
|
-
ts: nowMs(),
|
|
50
|
-
op: "delegation",
|
|
51
|
-
kind: "delegation",
|
|
52
|
-
phase: "connection",
|
|
53
|
-
ms,
|
|
54
|
-
tags: { peer: peerKey.slice(0, 16) },
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
export function consumeBreakdownConnectionTime(peerKey) {
|
|
58
|
-
if (breakdownConnectionInjected.get(peerKey))
|
|
59
|
-
return undefined;
|
|
60
|
-
const ms = breakdownConnectionMs.get(peerKey);
|
|
61
|
-
if (ms === undefined)
|
|
62
|
-
return undefined;
|
|
63
|
-
breakdownConnectionMs.delete(peerKey);
|
|
64
|
-
breakdownConnectionInjected.set(peerKey, true);
|
|
65
|
-
return ms;
|
|
66
|
-
}
|
|
67
|
-
export function buildDelegationBreakdown(timings, connectionMs) {
|
|
68
|
-
const now = nowMs();
|
|
69
|
-
const breakdown = {
|
|
70
|
-
profileId: timings.profileId,
|
|
71
|
-
};
|
|
72
|
-
if (connectionMs !== undefined) {
|
|
73
|
-
breakdown.connectionMs = connectionMs;
|
|
74
|
-
}
|
|
75
|
-
if (timings.requestStringifyMs !== undefined) {
|
|
76
|
-
breakdown.requestStringifyMs = timings.requestStringifyMs;
|
|
77
|
-
}
|
|
78
|
-
if (timings.sendStart !== undefined &&
|
|
79
|
-
timings.firstResponseAt !== undefined) {
|
|
80
|
-
breakdown.serverWaitMs = timings.firstResponseAt - timings.sendStart;
|
|
81
|
-
}
|
|
82
|
-
if (timings.responseJsonParseMs !== undefined) {
|
|
83
|
-
breakdown.responseJsonParseMs = timings.responseJsonParseMs;
|
|
84
|
-
}
|
|
85
|
-
breakdown.totalDelegationMs = now - timings.requestStart;
|
|
86
|
-
return breakdown;
|
|
87
|
-
}
|
|
88
|
-
export function buildDelegationStreamBreakdown(timings) {
|
|
89
|
-
const now = nowMs();
|
|
90
|
-
const breakdown = {
|
|
91
|
-
profileId: timings.profileId,
|
|
92
|
-
};
|
|
93
|
-
if (timings.requestStringifyMs !== undefined) {
|
|
94
|
-
breakdown.requestStringifyMs = timings.requestStringifyMs;
|
|
95
|
-
}
|
|
96
|
-
if (timings.sendStart !== undefined && timings.firstChunkAt !== undefined) {
|
|
97
|
-
breakdown.serverWaitMs = timings.firstChunkAt - timings.sendStart;
|
|
98
|
-
}
|
|
99
|
-
breakdown.totalDelegationMs = now - timings.requestStart;
|
|
100
|
-
return breakdown;
|
|
101
|
-
}
|
|
102
|
-
export function recordDelegationEvents(timings, serverMeta, connectionMs) {
|
|
103
|
-
const now = nowMs();
|
|
104
|
-
const base = {
|
|
105
|
-
ts: now,
|
|
106
|
-
op: timings.requestType,
|
|
107
|
-
kind: "delegation",
|
|
108
|
-
profileId: timings.profileId,
|
|
109
|
-
};
|
|
110
|
-
const breakdown = buildDelegationBreakdown(timings, connectionMs);
|
|
111
|
-
recordPhase(base, "request.stringify", breakdown.requestStringifyMs);
|
|
112
|
-
recordPhase(base, "serverWait", breakdown.serverWaitMs);
|
|
113
|
-
recordPhase(base, "response.jsonParse", breakdown.responseJsonParseMs);
|
|
114
|
-
recordPhase(base, "totalDelegationTime", breakdown.totalDelegationMs);
|
|
115
|
-
if (serverMeta?.server) {
|
|
116
|
-
recordServerBreakdownPhases(base, serverMeta.server, "delegated");
|
|
117
|
-
}
|
|
118
|
-
return breakdown;
|
|
119
|
-
}
|
|
120
|
-
export function recordDelegationStreamEvents(timings, serverMeta) {
|
|
121
|
-
const now = nowMs();
|
|
122
|
-
const totalTime = now - timings.requestStart;
|
|
123
|
-
const base = {
|
|
124
|
-
ts: now,
|
|
125
|
-
op: timings.requestType,
|
|
126
|
-
kind: "delegation",
|
|
127
|
-
profileId: timings.profileId,
|
|
128
|
-
};
|
|
129
|
-
recordPhase(base, "request.stringify", timings.requestStringifyMs);
|
|
130
|
-
if (timings.sendStart !== undefined && timings.firstChunkAt !== undefined) {
|
|
131
|
-
recordPhase(base, "ttfb", timings.firstChunkAt - timings.sendStart);
|
|
132
|
-
}
|
|
133
|
-
if (timings.firstChunkAt !== undefined && timings.lastChunkAt !== undefined) {
|
|
134
|
-
recordPhase(base, "streamDuration", timings.lastChunkAt - timings.firstChunkAt);
|
|
135
|
-
}
|
|
136
|
-
recordPhase(base, "totalDelegationTime", totalTime, {
|
|
137
|
-
count: timings.chunkCount,
|
|
138
|
-
});
|
|
139
|
-
if (serverMeta?.server) {
|
|
140
|
-
recordServerBreakdownPhases(base, serverMeta.server, "delegated");
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
export function clearPeerConnectionTracking(peerKey) {
|
|
144
|
-
pendingConnectionTimes.delete(peerKey);
|
|
145
|
-
serverConnectionRecorded.delete(peerKey);
|
|
146
|
-
breakdownConnectionMs.delete(peerKey);
|
|
147
|
-
breakdownConnectionInjected.delete(peerKey);
|
|
148
|
-
}
|
|
149
|
-
export function resetDelegationConnectionTracking() {
|
|
150
|
-
pendingConnectionTimes.clear();
|
|
151
|
-
serverConnectionRecorded.clear();
|
|
152
|
-
breakdownConnectionMs.clear();
|
|
153
|
-
breakdownConnectionInjected.clear();
|
|
154
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { createServerProfiler, type ServerProfiler } from "./profiler";
|
|
2
|
-
export { profileReplyHandler, profileStreamHandler, } from "./operation-wrappers";
|
|
3
|
-
export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig, } from "./operation-metrics";
|
|
4
|
-
export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, type DelegationTimings, type DelegationStreamTimings, type DelegatedHandlerOptions, } from "./delegation-profiler";
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { createServerProfiler } from "./profiler.js";
|
|
2
|
-
export { profileReplyHandler, profileStreamHandler, } from "./operation-wrappers.js";
|
|
3
|
-
export { registerOperationMetrics, buildOperationEvent, } from "./operation-metrics.js";
|
|
4
|
-
export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, } from "./delegation-profiler.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Declarative extraction of operation-level metrics from request/response data.
|
|
3
|
-
* Used by operation wrappers to capture handler-specific profiling events.
|
|
4
|
-
*/
|
|
5
|
-
import type { ProfilingEvent, ProfilingEventKind } from "../../../profiling/types";
|
|
6
|
-
import type { DownloadStats } from "../handlers/load-model/types";
|
|
7
|
-
export type MetricExtractor<T> = (data: T) => Record<string, number> | undefined;
|
|
8
|
-
export type TagExtractor<T> = (data: T) => Record<string, string> | undefined;
|
|
9
|
-
export interface OperationMetricsConfig<TRequest = unknown, TResponse = unknown> {
|
|
10
|
-
op: string;
|
|
11
|
-
kind: ProfilingEventKind;
|
|
12
|
-
fromRequest?: MetricExtractor<TRequest>;
|
|
13
|
-
fromFinalChunk?: MetricExtractor<TResponse>;
|
|
14
|
-
fromResult?: MetricExtractor<TResponse>;
|
|
15
|
-
getTags?: (request: TRequest) => Record<string, string>;
|
|
16
|
-
getTagsFromResult?: TagExtractor<TResponse>;
|
|
17
|
-
}
|
|
18
|
-
export interface DownloadAssetProfilingMeta {
|
|
19
|
-
sourceType?: string;
|
|
20
|
-
downloadStats?: DownloadStats;
|
|
21
|
-
totalDownloadTimeMs?: number;
|
|
22
|
-
}
|
|
23
|
-
export declare function registerOperationMetrics<TRequest, TResponse>(config: OperationMetricsConfig<TRequest, TResponse>): void;
|
|
24
|
-
export declare function buildOperationEvent(op: string, profileId: string, ts: number, executionMs: number, request?: unknown, finalResponse?: unknown, ttfb?: number): ProfilingEvent | undefined;
|
|
25
|
-
//# sourceMappingURL=operation-metrics.d.ts.map
|