@qvac/sdk 0.8.0 → 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 -13
- package/dist/client/api/cancel.js +6 -16
- 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 +1 -5
- package/dist/client/api/index.js +1 -5
- 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 +1 -1
- package/dist/client/api/ping.js +2 -3
- 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.js +4 -39
- 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.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/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 -6
- package/dist/schemas/cancel.js +0 -5
- package/dist/schemas/common.d.ts +164 -2973
- package/dist/schemas/common.js +1 -23
- package/dist/schemas/completion-stream.d.ts +60 -31
- package/dist/schemas/completion-stream.js +44 -20
- package/dist/schemas/delegate.d.ts +0 -1
- package/dist/schemas/delegate.js +0 -1
- 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 +1 -19
- package/dist/schemas/index.js +1 -19
- 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 -14358
- 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/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 +46 -157
- 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 -14
- package/dist/server/bare/registry/model-registry.js +12 -32
- 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 +6 -18
- 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 +21 -59
- 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 -141
- package/NOTICE +0 -358
- 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/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/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/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/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 -204
- 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 -215
- package/dist/server/rpc/handler-registry.d.ts +0 -3
- package/dist/server/rpc/handler-registry.js +0 -90
- package/dist/server/rpc/handler-utils.d.ts +0 -23
- package/dist/server/rpc/handler-utils.js +0 -128
- 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/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 -564
- 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/ping.d.ts +0 -3
- package/dist/server/rpc/handlers/ping.js +0 -3
- 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/{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
package/dist/schemas/plugin.d.ts
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ModelSrcInput } from "./model-src-utils";
|
|
3
|
-
/**
|
|
4
|
-
* Definition for a plugin handler with explicit Zod schemas.
|
|
5
|
-
* Each handler must define its request/response schemas for validation.
|
|
6
|
-
*/
|
|
7
|
-
export interface PluginHandlerDefinition<TRequest extends z.ZodType = z.ZodType, TResponse extends z.ZodType = z.ZodType> {
|
|
8
|
-
requestSchema: TRequest;
|
|
9
|
-
responseSchema: TResponse;
|
|
10
|
-
streaming: boolean;
|
|
11
|
-
/** The handler function - receives validated request, returns validated response */
|
|
12
|
-
handler: TRequest extends z.ZodType<infer I> ? TResponse extends z.ZodType<infer O> ? (request: I) => Promise<O> | AsyncGenerator<O> : never : never;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Parameters passed to createModel when loading a plugin model.
|
|
16
|
-
*
|
|
17
|
-
* Core fields are always present. The `artifacts` map contains
|
|
18
|
-
* additional file paths required by specific plugins (e.g., projection
|
|
19
|
-
* models, VAD models, config files).
|
|
20
|
-
*
|
|
21
|
-
* Built-in artifact keys:
|
|
22
|
-
* - `projectionModelPath` - LLM multimodal projection model
|
|
23
|
-
* - `vadModelPath` - Whisper voice activity detection model
|
|
24
|
-
* - `tokenizerPath`, `speechEncoderPath`, `embedTokensPath`, `conditionalDecoderPath`, `languageModelPath` - TTS (Chatterbox) model files
|
|
25
|
-
* - `referenceAudioPath` - TTS (Chatterbox) path to reference WAV file for voice cloning
|
|
26
|
-
* - `tokenizerPath`, `textEncoderPath`, `latentDenoiserPath`, `voiceDecoderPath` - TTS (Supertonic) model files
|
|
27
|
-
* - `voicePath` - TTS (Supertonic) path to voice .bin file (e.g. voices/M1.bin)
|
|
28
|
-
* - `speed`, `numInferenceSteps` - TTS (Supertonic) options
|
|
29
|
-
* - `detectorModelPath` - OCR detector model
|
|
30
|
-
*
|
|
31
|
-
* Custom plugins can define their own artifact keys.
|
|
32
|
-
*/
|
|
33
|
-
export interface CreateModelParams {
|
|
34
|
-
modelId: string;
|
|
35
|
-
modelPath: string;
|
|
36
|
-
modelConfig?: Record<string, unknown> | undefined;
|
|
37
|
-
modelName?: string | undefined;
|
|
38
|
-
artifacts?: Record<string, string> | undefined;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Minimal contract for plugin models.
|
|
42
|
-
* All models must implement `load()`. `unload()` is optional.
|
|
43
|
-
*/
|
|
44
|
-
export interface PluginModel {
|
|
45
|
-
load(force?: boolean): Promise<void>;
|
|
46
|
-
unload?(): void | Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
export interface PluginModelResult {
|
|
49
|
-
model: PluginModel;
|
|
50
|
-
loader: unknown;
|
|
51
|
-
}
|
|
52
|
-
export interface PluginLogging {
|
|
53
|
-
module: unknown;
|
|
54
|
-
namespace: string;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Function to resolve a model source (URL or path) to a local file path.
|
|
58
|
-
* Passed to resolveConfig hook to allow plugins to resolve their artifacts.
|
|
59
|
-
*/
|
|
60
|
-
export type ResolveModelPath = (src: ModelSrcInput) => Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Context passed to plugin resolveConfig hook.
|
|
63
|
-
* Provides resolution utilities and request metadata.
|
|
64
|
-
*/
|
|
65
|
-
export interface ResolveContext {
|
|
66
|
-
resolveModelPath: ResolveModelPath;
|
|
67
|
-
modelSrc: string;
|
|
68
|
-
modelType: string;
|
|
69
|
-
modelName?: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Result from plugin resolveConfig hook.
|
|
73
|
-
* Contains transformed config and optional resolved artifacts.
|
|
74
|
-
*/
|
|
75
|
-
export interface ResolveResult<TConfig = Record<string, unknown>, K extends string = string> {
|
|
76
|
-
config: TConfig;
|
|
77
|
-
artifacts?: Partial<Record<K, string>>;
|
|
78
|
-
}
|
|
79
|
-
export interface QvacPlugin<TConfig = Record<string, unknown>, TArtifactKeys extends string = string> {
|
|
80
|
-
modelType: string;
|
|
81
|
-
displayName: string;
|
|
82
|
-
addonPackage: string;
|
|
83
|
-
loadConfigSchema: z.ZodType;
|
|
84
|
-
createModel: (params: CreateModelParams) => PluginModelResult;
|
|
85
|
-
handlers: Record<string, PluginHandlerDefinition>;
|
|
86
|
-
logging?: PluginLogging | undefined;
|
|
87
|
-
/** When true, skips file-existence validation for modelPath. Use for plugins that derive paths from config. */
|
|
88
|
-
skipPrimaryModelPathValidation?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Optional hook to resolve model sources in modelConfig to local paths.
|
|
91
|
-
* Called before createModel if the plugin needs to download/resolve artifacts.
|
|
92
|
-
* Returns transformed config and optional artifact paths.
|
|
93
|
-
*/
|
|
94
|
-
resolveConfig?: (modelConfig: TConfig, ctx: ResolveContext) => Promise<ResolveResult<TConfig, TArtifactKeys>>;
|
|
95
|
-
}
|
|
96
|
-
export declare const pluginInvokeRequestSchema: z.ZodObject<{
|
|
97
|
-
type: z.ZodLiteral<"pluginInvoke">;
|
|
98
|
-
modelId: z.ZodString;
|
|
99
|
-
handler: z.ZodString;
|
|
100
|
-
params: z.ZodUnknown;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
export declare const pluginInvokeResponseSchema: z.ZodObject<{
|
|
103
|
-
type: z.ZodLiteral<"pluginInvoke">;
|
|
104
|
-
result: z.ZodUnknown;
|
|
105
|
-
}, z.core.$strip>;
|
|
106
|
-
export declare const pluginInvokeStreamRequestSchema: z.ZodObject<{
|
|
107
|
-
type: z.ZodLiteral<"pluginInvokeStream">;
|
|
108
|
-
modelId: z.ZodString;
|
|
109
|
-
handler: z.ZodString;
|
|
110
|
-
params: z.ZodUnknown;
|
|
111
|
-
}, z.core.$strip>;
|
|
112
|
-
export declare const pluginInvokeStreamResponseSchema: z.ZodObject<{
|
|
113
|
-
type: z.ZodLiteral<"pluginInvokeStream">;
|
|
114
|
-
result: z.ZodUnknown;
|
|
115
|
-
done: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
-
}, z.core.$strip>;
|
|
117
|
-
export type PluginInvokeRequest = z.infer<typeof pluginInvokeRequestSchema>;
|
|
118
|
-
export type PluginInvokeResponse = z.infer<typeof pluginInvokeResponseSchema>;
|
|
119
|
-
export type PluginInvokeStreamRequest = z.infer<typeof pluginInvokeStreamRequestSchema>;
|
|
120
|
-
export type PluginInvokeStreamResponse = z.infer<typeof pluginInvokeStreamResponseSchema>;
|
|
121
|
-
/**
|
|
122
|
-
* Helper function to define a plugin with full type inference.
|
|
123
|
-
* This is an identity function that provides type checking.
|
|
124
|
-
*/
|
|
125
|
-
export declare function definePlugin<T extends QvacPlugin>(plugin: T): T;
|
|
126
|
-
/**
|
|
127
|
-
* Helper function to define a handler with full type inference.
|
|
128
|
-
* This is an identity function that provides type checking.
|
|
129
|
-
*/
|
|
130
|
-
export declare function defineHandler<TRequest extends z.ZodType, TResponse extends z.ZodType>(definition: PluginHandlerDefinition<TRequest, TResponse>): PluginHandlerDefinition<TRequest, TResponse>;
|
|
131
|
-
export declare const pluginHandlerDefinitionRuntimeSchema: z.ZodObject<{
|
|
132
|
-
requestSchema: z.ZodObject<{
|
|
133
|
-
safeParse: z.ZodCustom<Function, Function>;
|
|
134
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
135
|
-
responseSchema: z.ZodObject<{
|
|
136
|
-
safeParse: z.ZodCustom<Function, Function>;
|
|
137
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
138
|
-
streaming: z.ZodBoolean;
|
|
139
|
-
handler: z.ZodCustom<Function, Function>;
|
|
140
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
141
|
-
export declare const pluginDefinitionRuntimeSchema: z.ZodObject<{
|
|
142
|
-
modelType: z.ZodString;
|
|
143
|
-
displayName: z.ZodString;
|
|
144
|
-
addonPackage: z.ZodString;
|
|
145
|
-
loadConfigSchema: z.ZodObject<{
|
|
146
|
-
safeParse: z.ZodCustom<Function, Function>;
|
|
147
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
148
|
-
createModel: z.ZodCustom<Function, Function>;
|
|
149
|
-
handlers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
150
|
-
requestSchema: z.ZodObject<{
|
|
151
|
-
safeParse: z.ZodCustom<Function, Function>;
|
|
152
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
153
|
-
responseSchema: z.ZodObject<{
|
|
154
|
-
safeParse: z.ZodCustom<Function, Function>;
|
|
155
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
156
|
-
streaming: z.ZodBoolean;
|
|
157
|
-
handler: z.ZodCustom<Function, Function>;
|
|
158
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
159
|
-
logging: z.ZodOptional<z.ZodObject<{
|
|
160
|
-
module: z.ZodOptional<z.ZodUnknown>;
|
|
161
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
162
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
163
|
-
resolveConfig: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
164
|
-
skipPrimaryModelPathValidation: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
166
|
-
/**
|
|
167
|
-
* LLM text completion plugin (llama.cpp).
|
|
168
|
-
* Provides: completion, streaming chat, tool calling.
|
|
169
|
-
*/
|
|
170
|
-
export declare const PLUGIN_LLM: "@qvac/sdk/llamacpp-completion/plugin";
|
|
171
|
-
/**
|
|
172
|
-
* Text embedding plugin (llama.cpp).
|
|
173
|
-
* Provides: vector embeddings for RAG and semantic search.
|
|
174
|
-
*/
|
|
175
|
-
export declare const PLUGIN_EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
|
|
176
|
-
/**
|
|
177
|
-
* Speech-to-text transcription plugin (whisper.cpp).
|
|
178
|
-
* Provides: audio transcription, language detection.
|
|
179
|
-
*/
|
|
180
|
-
export declare const PLUGIN_WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
|
|
181
|
-
/**
|
|
182
|
-
* Speech-to-text transcription plugin (Parakeet ONNX).
|
|
183
|
-
* Provides: audio transcription using NVIDIA Parakeet models.
|
|
184
|
-
*/
|
|
185
|
-
export declare const PLUGIN_PARAKEET: "@qvac/sdk/parakeet-transcription/plugin";
|
|
186
|
-
/**
|
|
187
|
-
* Neural machine translation plugin (nmt.cpp).
|
|
188
|
-
* Provides: text translation between languages.
|
|
189
|
-
*/
|
|
190
|
-
export declare const PLUGIN_NMT: "@qvac/sdk/nmtcpp-translation/plugin";
|
|
191
|
-
/**
|
|
192
|
-
* Text-to-speech synthesis plugin (ONNX).
|
|
193
|
-
* Provides: speech synthesis from text.
|
|
194
|
-
*/
|
|
195
|
-
export declare const PLUGIN_TTS: "@qvac/sdk/onnx-tts/plugin";
|
|
196
|
-
/**
|
|
197
|
-
* Optical character recognition plugin (ONNX).
|
|
198
|
-
* Provides: text extraction from images.
|
|
199
|
-
*/
|
|
200
|
-
export declare const PLUGIN_OCR: "@qvac/sdk/onnx-ocr/plugin";
|
|
201
|
-
/**
|
|
202
|
-
* All built-in SDK plugins.
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* // Use all defaults plus a custom plugin:
|
|
206
|
-
* const config = {
|
|
207
|
-
* plugins: [...SDK_DEFAULT_PLUGINS, myCustomPlugin],
|
|
208
|
-
* };
|
|
209
|
-
*/
|
|
210
|
-
export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/plugin", "@qvac/sdk/nmtcpp-translation/plugin", "@qvac/sdk/onnx-tts/plugin", "@qvac/sdk/onnx-ocr/plugin"];
|
|
211
|
-
export type BuiltinPlugin = (typeof SDK_DEFAULT_PLUGINS)[number];
|
|
212
|
-
/** Native addon package for LLM completion (llama.cpp) */
|
|
213
|
-
export declare const ADDON_LLM: "@qvac/llm-llamacpp";
|
|
214
|
-
/** Native addon package for text embeddings (llama.cpp) */
|
|
215
|
-
export declare const ADDON_EMBEDDING: "@qvac/embed-llamacpp";
|
|
216
|
-
/** Native addon package for Whisper transcription (whisper.cpp) */
|
|
217
|
-
export declare const ADDON_WHISPER: "@qvac/transcription-whispercpp";
|
|
218
|
-
/** Native addon package for Parakeet transcription (ONNX) */
|
|
219
|
-
export declare const ADDON_PARAKEET: "@qvac/transcription-parakeet";
|
|
220
|
-
/** Native addon package for NMT translation (nmt.cpp) */
|
|
221
|
-
export declare const ADDON_NMT: "@qvac/translation-nmtcpp";
|
|
222
|
-
/** Native addon package for TTS (ONNX) */
|
|
223
|
-
export declare const ADDON_TTS: "@qvac/tts-onnx";
|
|
224
|
-
/** Native addon package for OCR (ONNX) */
|
|
225
|
-
export declare const ADDON_OCR: "@qvac/ocr-onnx";
|
|
226
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/schemas/plugin.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Non-streaming plugin invoke
|
|
3
|
-
export const pluginInvokeRequestSchema = z.object({
|
|
4
|
-
type: z.literal("pluginInvoke"),
|
|
5
|
-
modelId: z.string(),
|
|
6
|
-
handler: z.string(),
|
|
7
|
-
params: z.unknown(),
|
|
8
|
-
});
|
|
9
|
-
export const pluginInvokeResponseSchema = z.object({
|
|
10
|
-
type: z.literal("pluginInvoke"),
|
|
11
|
-
result: z.unknown(),
|
|
12
|
-
});
|
|
13
|
-
// Streaming plugin invoke
|
|
14
|
-
export const pluginInvokeStreamRequestSchema = z.object({
|
|
15
|
-
type: z.literal("pluginInvokeStream"),
|
|
16
|
-
modelId: z.string(),
|
|
17
|
-
handler: z.string(),
|
|
18
|
-
params: z.unknown(),
|
|
19
|
-
});
|
|
20
|
-
export const pluginInvokeStreamResponseSchema = z.object({
|
|
21
|
-
type: z.literal("pluginInvokeStream"),
|
|
22
|
-
result: z.unknown(),
|
|
23
|
-
done: z.boolean().optional(),
|
|
24
|
-
});
|
|
25
|
-
// ============================================
|
|
26
|
-
// Type Helpers
|
|
27
|
-
// ============================================
|
|
28
|
-
/**
|
|
29
|
-
* Helper function to define a plugin with full type inference.
|
|
30
|
-
* This is an identity function that provides type checking.
|
|
31
|
-
*/
|
|
32
|
-
export function definePlugin(plugin) {
|
|
33
|
-
return plugin;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Helper function to define a handler with full type inference.
|
|
37
|
-
* This is an identity function that provides type checking.
|
|
38
|
-
*/
|
|
39
|
-
export function defineHandler(definition) {
|
|
40
|
-
return definition;
|
|
41
|
-
}
|
|
42
|
-
// ============================================
|
|
43
|
-
// Worker runtime validation
|
|
44
|
-
// ============================================
|
|
45
|
-
const functionRuntimeSchema = z.instanceof(Function, {
|
|
46
|
-
error: "must be a function",
|
|
47
|
-
});
|
|
48
|
-
const zodSchemaLikeRuntimeSchema = z
|
|
49
|
-
.object({
|
|
50
|
-
safeParse: functionRuntimeSchema,
|
|
51
|
-
})
|
|
52
|
-
.catchall(z.unknown());
|
|
53
|
-
export const pluginHandlerDefinitionRuntimeSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
requestSchema: zodSchemaLikeRuntimeSchema,
|
|
56
|
-
responseSchema: zodSchemaLikeRuntimeSchema,
|
|
57
|
-
streaming: z.boolean({ error: "streaming must be a boolean" }),
|
|
58
|
-
handler: functionRuntimeSchema,
|
|
59
|
-
})
|
|
60
|
-
.catchall(z.unknown());
|
|
61
|
-
export const pluginDefinitionRuntimeSchema = z
|
|
62
|
-
.object({
|
|
63
|
-
modelType: z
|
|
64
|
-
.string({ error: "modelType must be a string" })
|
|
65
|
-
.min(1, "modelType must be a non-empty string"),
|
|
66
|
-
displayName: z
|
|
67
|
-
.string({ error: "displayName must be a string" })
|
|
68
|
-
.min(1, "displayName must be a non-empty string"),
|
|
69
|
-
addonPackage: z
|
|
70
|
-
.string({ error: "addonPackage must be a string" })
|
|
71
|
-
.min(1, "addonPackage must be a non-empty string"),
|
|
72
|
-
loadConfigSchema: zodSchemaLikeRuntimeSchema,
|
|
73
|
-
createModel: functionRuntimeSchema,
|
|
74
|
-
handlers: z.record(z.string(), pluginHandlerDefinitionRuntimeSchema),
|
|
75
|
-
logging: z
|
|
76
|
-
.object({
|
|
77
|
-
module: z.unknown().optional(),
|
|
78
|
-
namespace: z.string().optional(),
|
|
79
|
-
})
|
|
80
|
-
.catchall(z.unknown())
|
|
81
|
-
.optional(),
|
|
82
|
-
resolveConfig: functionRuntimeSchema.optional(),
|
|
83
|
-
skipPrimaryModelPathValidation: z.boolean().optional(),
|
|
84
|
-
})
|
|
85
|
-
.catchall(z.unknown());
|
|
86
|
-
// ============================================
|
|
87
|
-
// Built-in Plugins
|
|
88
|
-
// ============================================
|
|
89
|
-
/**
|
|
90
|
-
* LLM text completion plugin (llama.cpp).
|
|
91
|
-
* Provides: completion, streaming chat, tool calling.
|
|
92
|
-
*/
|
|
93
|
-
export const PLUGIN_LLM = "@qvac/sdk/llamacpp-completion/plugin";
|
|
94
|
-
/**
|
|
95
|
-
* Text embedding plugin (llama.cpp).
|
|
96
|
-
* Provides: vector embeddings for RAG and semantic search.
|
|
97
|
-
*/
|
|
98
|
-
export const PLUGIN_EMBEDDING = "@qvac/sdk/llamacpp-embedding/plugin";
|
|
99
|
-
/**
|
|
100
|
-
* Speech-to-text transcription plugin (whisper.cpp).
|
|
101
|
-
* Provides: audio transcription, language detection.
|
|
102
|
-
*/
|
|
103
|
-
export const PLUGIN_WHISPER = "@qvac/sdk/whispercpp-transcription/plugin";
|
|
104
|
-
/**
|
|
105
|
-
* Speech-to-text transcription plugin (Parakeet ONNX).
|
|
106
|
-
* Provides: audio transcription using NVIDIA Parakeet models.
|
|
107
|
-
*/
|
|
108
|
-
export const PLUGIN_PARAKEET = "@qvac/sdk/parakeet-transcription/plugin";
|
|
109
|
-
/**
|
|
110
|
-
* Neural machine translation plugin (nmt.cpp).
|
|
111
|
-
* Provides: text translation between languages.
|
|
112
|
-
*/
|
|
113
|
-
export const PLUGIN_NMT = "@qvac/sdk/nmtcpp-translation/plugin";
|
|
114
|
-
/**
|
|
115
|
-
* Text-to-speech synthesis plugin (ONNX).
|
|
116
|
-
* Provides: speech synthesis from text.
|
|
117
|
-
*/
|
|
118
|
-
export const PLUGIN_TTS = "@qvac/sdk/onnx-tts/plugin";
|
|
119
|
-
/**
|
|
120
|
-
* Optical character recognition plugin (ONNX).
|
|
121
|
-
* Provides: text extraction from images.
|
|
122
|
-
*/
|
|
123
|
-
export const PLUGIN_OCR = "@qvac/sdk/onnx-ocr/plugin";
|
|
124
|
-
/**
|
|
125
|
-
* All built-in SDK plugins.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* // Use all defaults plus a custom plugin:
|
|
129
|
-
* const config = {
|
|
130
|
-
* plugins: [...SDK_DEFAULT_PLUGINS, myCustomPlugin],
|
|
131
|
-
* };
|
|
132
|
-
*/
|
|
133
|
-
export const SDK_DEFAULT_PLUGINS = [
|
|
134
|
-
PLUGIN_LLM,
|
|
135
|
-
PLUGIN_EMBEDDING,
|
|
136
|
-
PLUGIN_WHISPER,
|
|
137
|
-
PLUGIN_PARAKEET,
|
|
138
|
-
PLUGIN_NMT,
|
|
139
|
-
PLUGIN_TTS,
|
|
140
|
-
PLUGIN_OCR,
|
|
141
|
-
];
|
|
142
|
-
// ============================================
|
|
143
|
-
// Addon Packages
|
|
144
|
-
// ============================================
|
|
145
|
-
/** Native addon package for LLM completion (llama.cpp) */
|
|
146
|
-
export const ADDON_LLM = "@qvac/llm-llamacpp";
|
|
147
|
-
/** Native addon package for text embeddings (llama.cpp) */
|
|
148
|
-
export const ADDON_EMBEDDING = "@qvac/embed-llamacpp";
|
|
149
|
-
/** Native addon package for Whisper transcription (whisper.cpp) */
|
|
150
|
-
export const ADDON_WHISPER = "@qvac/transcription-whispercpp";
|
|
151
|
-
/** Native addon package for Parakeet transcription (ONNX) */
|
|
152
|
-
export const ADDON_PARAKEET = "@qvac/transcription-parakeet";
|
|
153
|
-
/** Native addon package for NMT translation (nmt.cpp) */
|
|
154
|
-
export const ADDON_NMT = "@qvac/translation-nmtcpp";
|
|
155
|
-
/** Native addon package for TTS (ONNX) */
|
|
156
|
-
export const ADDON_TTS = "@qvac/tts-onnx";
|
|
157
|
-
/** Native addon package for OCR (ONNX) */
|
|
158
|
-
export const ADDON_OCR = "@qvac/ocr-onnx";
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/** Internal envelope key for profiling metadata in RPC payloads */
|
|
3
|
-
export declare const PROFILING_KEY = "__profiling";
|
|
4
|
-
/** Marker key for profiling-only trailer frames in streaming responses */
|
|
5
|
-
export declare const PROFILING_TRAILER_KEY = "__profilingTrailer";
|
|
6
|
-
/**
|
|
7
|
-
* Symbol key for attaching delegation breakdown to response objects.
|
|
8
|
-
*/
|
|
9
|
-
export declare const DELEGATION_BREAKDOWN_KEY: unique symbol;
|
|
10
|
-
/**
|
|
11
|
-
* Symbol key for attaching operation event to response objects.
|
|
12
|
-
*/
|
|
13
|
-
export declare const OPERATION_EVENT_KEY: unique symbol;
|
|
14
|
-
export declare const profilerModeSchema: z.ZodEnum<{
|
|
15
|
-
summary: "summary";
|
|
16
|
-
verbose: "verbose";
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Server-side timing breakdown (server → client).
|
|
20
|
-
* Attached to profiling response when includeServerBreakdown is enabled.
|
|
21
|
-
*/
|
|
22
|
-
export declare const serverBreakdownSchema: z.ZodObject<{
|
|
23
|
-
requestJsonParseMs: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
requestZodValidationMs: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
handlerExecutionMs: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
responseZodValidationMs: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
responseStringifyMs: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
totalServerMs: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
/**
|
|
31
|
-
* Delegation timing breakdown (consumer server → client).
|
|
32
|
-
* Captures timing for server-to-provider delegation hops.
|
|
33
|
-
* Note: Only injected for unary requests; streaming delegation
|
|
34
|
-
* records server-side but does not inject into response.
|
|
35
|
-
*/
|
|
36
|
-
export declare const delegationBreakdownSchema: z.ZodObject<{
|
|
37
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
38
|
-
connectionMs: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
requestStringifyMs: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
serverWaitMs: z.ZodOptional<z.ZodNumber>;
|
|
41
|
-
responseJsonParseMs: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
totalDelegationMs: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
export declare const operationEventSchema: z.ZodObject<{
|
|
45
|
-
op: z.ZodString;
|
|
46
|
-
kind: z.ZodLiteral<"handler">;
|
|
47
|
-
ms: z.ZodNumber;
|
|
48
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
49
|
-
gauges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
50
|
-
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
51
|
-
count: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
export declare const profilingRequestMetaSchema: z.ZodObject<{
|
|
54
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
-
id: z.ZodOptional<z.ZodString>;
|
|
56
|
-
includeServer: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
summary: "summary";
|
|
59
|
-
verbose: "verbose";
|
|
60
|
-
}>>;
|
|
61
|
-
}, z.core.$strip>;
|
|
62
|
-
export declare const profilingResponseMetaSchema: z.ZodObject<{
|
|
63
|
-
id: z.ZodString;
|
|
64
|
-
server: z.ZodOptional<z.ZodObject<{
|
|
65
|
-
requestJsonParseMs: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
requestZodValidationMs: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
handlerExecutionMs: z.ZodOptional<z.ZodNumber>;
|
|
68
|
-
responseZodValidationMs: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
responseStringifyMs: z.ZodOptional<z.ZodNumber>;
|
|
70
|
-
totalServerMs: z.ZodOptional<z.ZodNumber>;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
delegation: z.ZodOptional<z.ZodObject<{
|
|
73
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
74
|
-
connectionMs: z.ZodOptional<z.ZodNumber>;
|
|
75
|
-
requestStringifyMs: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
serverWaitMs: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
responseJsonParseMs: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
totalDelegationMs: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
}, z.core.$strip>>;
|
|
80
|
-
operation: z.ZodOptional<z.ZodObject<{
|
|
81
|
-
op: z.ZodString;
|
|
82
|
-
kind: z.ZodLiteral<"handler">;
|
|
83
|
-
ms: z.ZodNumber;
|
|
84
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
85
|
-
gauges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
86
|
-
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
87
|
-
count: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>>;
|
|
89
|
-
}, z.core.$strip>;
|
|
90
|
-
export declare const perCallProfilingSchema: z.ZodObject<{
|
|
91
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
-
includeServerBreakdown: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
94
|
-
summary: "summary";
|
|
95
|
-
verbose: "verbose";
|
|
96
|
-
}>>;
|
|
97
|
-
}, z.core.$strip>;
|
|
98
|
-
export type ProfilingResponseMeta = z.infer<typeof profilingResponseMetaSchema>;
|
|
99
|
-
export type ProfilerMode = z.infer<typeof profilerModeSchema>;
|
|
100
|
-
export type ProfilingRequestMeta = z.infer<typeof profilingRequestMetaSchema>;
|
|
101
|
-
export type ServerBreakdown = z.infer<typeof serverBreakdownSchema>;
|
|
102
|
-
export type DelegationBreakdown = z.infer<typeof delegationBreakdownSchema>;
|
|
103
|
-
export type PerCallProfiling = z.infer<typeof perCallProfilingSchema>;
|
|
104
|
-
export type OperationEvent = z.infer<typeof operationEventSchema>;
|
|
105
|
-
//# sourceMappingURL=profiling.d.ts.map
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/** Internal envelope key for profiling metadata in RPC payloads */
|
|
3
|
-
export const PROFILING_KEY = "__profiling";
|
|
4
|
-
/** Marker key for profiling-only trailer frames in streaming responses */
|
|
5
|
-
export const PROFILING_TRAILER_KEY = "__profilingTrailer";
|
|
6
|
-
/**
|
|
7
|
-
* Symbol key for attaching delegation breakdown to response objects.
|
|
8
|
-
*/
|
|
9
|
-
export const DELEGATION_BREAKDOWN_KEY = Symbol.for("@qvac/sdk:delegation-breakdown");
|
|
10
|
-
/**
|
|
11
|
-
* Symbol key for attaching operation event to response objects.
|
|
12
|
-
*/
|
|
13
|
-
export const OPERATION_EVENT_KEY = Symbol.for("@qvac/sdk:operation-event");
|
|
14
|
-
export const profilerModeSchema = z.enum(["summary", "verbose"]);
|
|
15
|
-
/**
|
|
16
|
-
* Server-side timing breakdown (server → client).
|
|
17
|
-
* Attached to profiling response when includeServerBreakdown is enabled.
|
|
18
|
-
*/
|
|
19
|
-
export const serverBreakdownSchema = z.object({
|
|
20
|
-
requestJsonParseMs: z.number().optional(),
|
|
21
|
-
requestZodValidationMs: z.number().optional(),
|
|
22
|
-
handlerExecutionMs: z.number().optional(),
|
|
23
|
-
responseZodValidationMs: z.number().optional(),
|
|
24
|
-
responseStringifyMs: z.number().optional(),
|
|
25
|
-
totalServerMs: z.number().optional(),
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* Delegation timing breakdown (consumer server → client).
|
|
29
|
-
* Captures timing for server-to-provider delegation hops.
|
|
30
|
-
* Note: Only injected for unary requests; streaming delegation
|
|
31
|
-
* records server-side but does not inject into response.
|
|
32
|
-
*/
|
|
33
|
-
export const delegationBreakdownSchema = z.object({
|
|
34
|
-
profileId: z.string().optional(),
|
|
35
|
-
connectionMs: z.number().optional(),
|
|
36
|
-
requestStringifyMs: z.number().optional(),
|
|
37
|
-
serverWaitMs: z.number().optional(),
|
|
38
|
-
responseJsonParseMs: z.number().optional(),
|
|
39
|
-
totalDelegationMs: z.number().optional(),
|
|
40
|
-
});
|
|
41
|
-
export const operationEventSchema = z.object({
|
|
42
|
-
op: z.string(),
|
|
43
|
-
kind: z.literal("handler"),
|
|
44
|
-
ms: z.number(),
|
|
45
|
-
profileId: z.string().optional(),
|
|
46
|
-
gauges: z.record(z.string(), z.number()).optional(),
|
|
47
|
-
tags: z.record(z.string(), z.string()).optional(),
|
|
48
|
-
count: z.number().optional(),
|
|
49
|
-
});
|
|
50
|
-
export const profilingRequestMetaSchema = z.object({
|
|
51
|
-
enabled: z.boolean().optional(),
|
|
52
|
-
id: z.string().optional(),
|
|
53
|
-
includeServer: z.boolean().optional(),
|
|
54
|
-
mode: profilerModeSchema.optional(),
|
|
55
|
-
});
|
|
56
|
-
export const profilingResponseMetaSchema = z.object({
|
|
57
|
-
id: z.string(),
|
|
58
|
-
server: serverBreakdownSchema.optional(),
|
|
59
|
-
delegation: delegationBreakdownSchema.optional(),
|
|
60
|
-
operation: operationEventSchema.optional(),
|
|
61
|
-
});
|
|
62
|
-
export const perCallProfilingSchema = z.object({
|
|
63
|
-
enabled: z.boolean().optional(),
|
|
64
|
-
includeServerBreakdown: z.boolean().optional(),
|
|
65
|
-
mode: profilerModeSchema.optional(),
|
|
66
|
-
});
|