@qvac/sdk 0.22.0 → 0.23.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.
Files changed (150) hide show
  1. package/NOTICE +123 -83
  2. package/README.md +22 -460
  3. package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
  4. package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +76 -0
  5. package/dist/examples/diffusion-img2vid-ltx.js +7 -14
  6. package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
  7. package/dist/examples/diffusion-qwen-image-21.js +104 -0
  8. package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
  9. package/dist/examples/finetune/llamacpp-finetune.js +9 -4
  10. package/dist/examples/llamacpp-multimodal.js +3 -1
  11. package/dist/examples/mcp-websearch.js +1 -1
  12. package/dist/examples/plugins.js +1 -1
  13. package/dist/examples/rerank.d.ts +2 -0
  14. package/dist/examples/rerank.js +33 -0
  15. package/dist/examples/tools/llamacpp-deferred-tools.js +5 -5
  16. package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
  17. package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
  18. package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
  19. package/dist/scripts/contract/build-contract.d.ts +1 -1
  20. package/dist/scripts/contract/constants-registry.d.ts +2 -0
  21. package/dist/scripts/contract/constants-registry.js +2 -1
  22. package/dist/scripts/contract/method-shapes.d.ts +1 -0
  23. package/dist/scripts/contract/method-shapes.js +1 -0
  24. package/dist/src/client/api/assess-model-fit.js +1 -1
  25. package/dist/src/client/api/audio-edit.js +2 -2
  26. package/dist/src/client/api/audio-gen-result.js +2 -2
  27. package/dist/src/client/api/audio-gen.js +2 -2
  28. package/dist/src/client/api/audio-understand.js +2 -2
  29. package/dist/src/client/api/batch-completion.js +2 -2
  30. package/dist/src/client/api/bci-transcribe.js +3 -3
  31. package/dist/src/client/api/cancel.js +1 -1
  32. package/dist/src/client/api/classify.js +1 -1
  33. package/dist/src/client/api/completion-stream.d.ts +2 -1
  34. package/dist/src/client/api/completion-stream.js +5 -3
  35. package/dist/src/client/api/decide.d.ts +1 -1
  36. package/dist/src/client/api/decide.js +3 -3
  37. package/dist/src/client/api/delete-cache.js +1 -1
  38. package/dist/src/client/api/diffusion.d.ts +18 -1
  39. package/dist/src/client/api/diffusion.js +19 -2
  40. package/dist/src/client/api/download-asset.js +3 -3
  41. package/dist/src/client/api/embed.js +2 -2
  42. package/dist/src/client/api/finetune.js +3 -3
  43. package/dist/src/client/api/get-loaded-model-info.js +1 -1
  44. package/dist/src/client/api/get-model-info.js +1 -1
  45. package/dist/src/client/api/get-system-resources.js +1 -1
  46. package/dist/src/client/api/heartbeat.js +1 -1
  47. package/dist/src/client/api/index.d.ts +4 -3
  48. package/dist/src/client/api/index.js +4 -3
  49. package/dist/src/client/api/invoke-plugin.js +1 -1
  50. package/dist/src/client/api/load-model.js +4 -4
  51. package/dist/src/client/api/logging-stream.d.ts +11 -2
  52. package/dist/src/client/api/logging-stream.js +12 -3
  53. package/dist/src/client/api/ocr.js +1 -1
  54. package/dist/src/client/api/rag.js +2 -2
  55. package/dist/src/client/api/registry.d.ts +2 -1
  56. package/dist/src/client/api/registry.js +6 -5
  57. package/dist/src/client/api/rerank.d.ts +22 -0
  58. package/dist/src/client/api/rerank.js +39 -0
  59. package/dist/src/client/api/resume.js +1 -1
  60. package/dist/src/client/api/rpc-server.js +2 -2
  61. package/dist/src/client/api/state.js +1 -1
  62. package/dist/src/client/api/subscribe-logs.js +3 -2
  63. package/dist/src/client/api/suspend.js +1 -1
  64. package/dist/src/client/api/text-to-speech.js +3 -3
  65. package/dist/src/client/api/transcribe.d.ts +1 -1
  66. package/dist/src/client/api/transcribe.js +2 -2
  67. package/dist/src/client/api/translate.js +2 -2
  68. package/dist/src/client/api/unload-model.js +2 -2
  69. package/dist/src/client/api/upscale.js +1 -1
  70. package/dist/src/client/api/vector-index.d.ts +1 -1
  71. package/dist/src/client/api/vector-index.js +1 -1
  72. package/dist/src/client/api/video.js +3 -3
  73. package/dist/src/client/api/world-result.js +2 -2
  74. package/dist/src/client/api/world.d.ts +1 -1
  75. package/dist/src/client/api/world.js +2 -2
  76. package/dist/src/client/logging-stream-registry.js +9 -6
  77. package/dist/src/client/plugins-factory.d.ts +1 -1
  78. package/dist/src/client/plugins-factory.js +1 -1
  79. package/dist/src/client/rpc/expo-rpc-client.js +3 -3
  80. package/dist/src/client/rpc/ipc-socket-path.d.ts +11 -0
  81. package/dist/src/client/rpc/ipc-socket-path.js +30 -0
  82. package/dist/src/client/rpc/node-rpc-client.js +14 -25
  83. package/dist/src/client/rpc/rpc-client.d.ts +3 -2
  84. package/dist/src/client/rpc/rpc-client.js +46 -12
  85. package/dist/src/client/rpc/rpc-error.js +4 -1
  86. package/dist/src/commands/bundle/constants.js +1 -0
  87. package/dist/src/commands/bundle/entry-gen.js +1 -1
  88. package/dist/src/commands/bundle/index.d.ts +1 -1
  89. package/dist/src/commands/bundle/index.js +11 -11
  90. package/dist/src/commands/bundle/plugins.js +1 -1
  91. package/dist/src/commands/host-prebuilds/index.d.ts +3 -3
  92. package/dist/src/commands/host-prebuilds/index.js +4 -4
  93. package/dist/src/commands/index.d.ts +12 -12
  94. package/dist/src/commands/index.js +7 -7
  95. package/dist/src/commands/verify/abi.d.ts +1 -1
  96. package/dist/src/commands/verify/abi.js +1 -1
  97. package/dist/src/commands/verify/bare-kit-runtime.d.ts +1 -1
  98. package/dist/src/commands/verify/bare-kit-runtime.js +1 -1
  99. package/dist/src/commands/verify/bundle-source.d.ts +1 -1
  100. package/dist/src/commands/verify/bundle-source.js +3 -3
  101. package/dist/src/commands/verify/engines-advice.d.ts +4 -4
  102. package/dist/src/commands/verify/engines-advice.js +4 -4
  103. package/dist/src/commands/verify/index.d.ts +5 -5
  104. package/dist/src/commands/verify/index.js +7 -7
  105. package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
  106. package/dist/src/commands/verify/node-modules-source.js +1 -1
  107. package/dist/src/commands/verify/prebuilds.d.ts +1 -1
  108. package/dist/src/commands/verify/prebuilds.js +2 -2
  109. package/dist/src/commands/verify/resource-collectors.js +2 -2
  110. package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
  111. package/dist/src/expo/plugins/link-addons.js +1 -1
  112. package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  113. package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  114. package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
  115. package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
  116. package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
  117. package/dist/src/expo/plugins/withMobileBundle.d.ts +4 -4
  118. package/dist/src/expo/plugins/withMobileBundle.js +6 -6
  119. package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
  120. package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -1
  121. package/dist/src/index.d.ts +4 -4
  122. package/dist/src/index.js +3 -3
  123. package/dist/src/logging/addon.d.ts +1 -1
  124. package/dist/src/logging/base-logger.js +1 -1
  125. package/dist/src/logging/utils.js +1 -1
  126. package/dist/src/pear/pre.js +2 -0
  127. package/dist/src/plugin-ids.d.ts +2 -1
  128. package/dist/src/plugin-ids.js +2 -0
  129. package/dist/src/schemas/public.d.ts +1 -1
  130. package/dist/src/schemas/public.js +1 -1
  131. package/dist/src/schemas/sdk-errors-server.d.ts +1 -0
  132. package/dist/src/schemas/sdk-errors-server.js +6 -1
  133. package/dist/src/server/rpc/rpc-utils.d.ts +5 -0
  134. package/dist/src/server/rpc/rpc-utils.js +7 -0
  135. package/dist/src/server/utils/qvac-paths.js +1 -1
  136. package/dist/src/server/utils/worker-lock.js +1 -1
  137. package/dist/src/utils/aggregate-events.d.ts +1 -1
  138. package/dist/src/utils/aggregate-events.js +2 -2
  139. package/dist/src/utils/errors-server.d.ts +6 -0
  140. package/dist/src/utils/errors-server.js +12 -0
  141. package/dist/src/utils/mcp-adapter.d.ts +1 -1
  142. package/dist/src/utils/mcp-adapter.js +1 -1
  143. package/dist/src/utils/tool-helpers.js +1 -1
  144. package/dist/src/worker/handle-request.js +4 -2
  145. package/dist/src/worker/handler-utils.js +1 -1
  146. package/dist/src/worker/index.js +3 -1
  147. package/dist/src/worker/lifecycle.js +1 -1
  148. package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
  149. package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
  150. package/package.json +46 -40
@@ -1,4 +1,4 @@
1
- import type { ExpoConfig } from 'expo/config/index.js';
1
+ import type { ExpoConfig } from 'expo/config';
2
2
  /**
3
3
  * Expo plugin to configure Android architecture to arm64-v8a only.
4
4
  * Reduces APK size by excluding other architectures (x86, x86_64, armeabi-v7a).
@@ -1,4 +1,4 @@
1
- import type { ExpoConfig } from 'expo/config/index.js';
1
+ import type { ExpoConfig } from 'expo/config';
2
2
  /**
3
3
  * Expo plugin to set NDK version in android/build.gradle.
4
4
  * Ensures NDK 29 is used to match the addon build version.
@@ -13,17 +13,23 @@ function withAndroidNdkVersion(config) {
13
13
  'android',
14
14
  function (config) {
15
15
  const buildGradlePath = path.join(config.modRequest.platformProjectRoot, 'build.gradle');
16
- if (fs.existsSync(buildGradlePath)) {
17
- let buildGradle = fs.readFileSync(buildGradlePath, 'utf8');
18
- if (buildGradle.includes('ndkVersion')) {
19
- buildGradle = buildGradle.replace(/ndkVersion\s*=\s*["'][^"']+["']/g, `ndkVersion = "${ndkVersion}"`);
20
- }
21
- else {
22
- buildGradle = buildGradle.replace(/(buildscript\s*\{)/, `$1\n ext {\n ndkVersion = "${ndkVersion}"\n }`);
23
- }
24
- fs.writeFileSync(buildGradlePath, buildGradle);
25
- console.log(`[withAndroidNdkVersion] 🔧 QVAC: Set Android NDK version to ${ndkVersion}`);
16
+ let buildGradle;
17
+ try {
18
+ buildGradle = fs.readFileSync(buildGradlePath, 'utf8');
26
19
  }
20
+ catch (err) {
21
+ if (err.code === 'ENOENT')
22
+ return config;
23
+ throw err;
24
+ }
25
+ if (buildGradle.includes('ndkVersion')) {
26
+ buildGradle = buildGradle.replace(/ndkVersion\s*=\s*["'][^"']+["']/g, `ndkVersion = "${ndkVersion}"`);
27
+ }
28
+ else {
29
+ buildGradle = buildGradle.replace(/(buildscript\s*\{)/, `$1\n ext {\n ndkVersion = "${ndkVersion}"\n }`);
30
+ }
31
+ fs.writeFileSync(buildGradlePath, buildGradle);
32
+ console.log(`[withAndroidNdkVersion] 🔧 QVAC: Set Android NDK version to ${ndkVersion}`);
27
33
  return config;
28
34
  }
29
35
  ]);
@@ -1,4 +1,4 @@
1
- import type { ExpoConfig } from 'expo/config/index.js';
1
+ import type { ExpoConfig } from 'expo/config';
2
2
  /**
3
3
  * Expo plugin that stubs expo-device-info when expo-device is not a declared
4
4
  * dependency of the consuming app. Expo autolinking resolves modules from
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
- import { resolveSDKPackageDir } from './resolve-sdk-package-dir.js';
4
- import { getProjectRootFromBaseConfig } from './get-project-root.js';
3
+ import { resolveSDKPackageDir } from '../../expo/plugins/resolve-sdk-package-dir.js';
4
+ import { getProjectRootFromBaseConfig } from '../../expo/plugins/get-project-root.js';
5
5
  let didRun = false;
6
6
  /**
7
7
  * Expo plugin that stubs expo-device-info when expo-device is not a declared
@@ -29,8 +29,19 @@ function withDeviceInfo(config) {
29
29
  }
30
30
  if (!hasExpoDevice) {
31
31
  const deviceInfoPath = path.join(qvacSdkPath, 'dist', 'client', 'rpc', 'expo-device-info.js');
32
- if (fs.existsSync(deviceInfoPath)) {
33
- fs.writeFileSync(deviceInfoPath, [
32
+ // r+ so a build without this module is left alone; truncate because the stub is shorter.
33
+ let fd;
34
+ try {
35
+ fd = fs.openSync(deviceInfoPath, 'r+');
36
+ }
37
+ catch (err) {
38
+ if (err.code === 'ENOENT')
39
+ return config;
40
+ throw err;
41
+ }
42
+ try {
43
+ fs.ftruncateSync(fd, 0);
44
+ fs.writeFileSync(fd, [
34
45
  `"use strict";`,
35
46
  `Object.defineProperty(exports, "__esModule", { value: true });`,
36
47
  `async function getDeviceInfo() {`,
@@ -38,8 +49,11 @@ function withDeviceInfo(config) {
38
49
  `}`,
39
50
  `exports.getDeviceInfo = getDeviceInfo;`
40
51
  ].join('\n'));
41
- console.log('[withDeviceInfo] 🔧 QVAC: expo-device not in app dependencies, stubbed device info');
42
52
  }
53
+ finally {
54
+ fs.closeSync(fd);
55
+ }
56
+ console.log('[withDeviceInfo] 🔧 QVAC: expo-device not in app dependencies, stubbed device info');
43
57
  }
44
58
  else {
45
59
  console.log('[withDeviceInfo] 🔧 QVAC: expo-device in app dependencies, using expo-device info');
@@ -1,9 +1,9 @@
1
1
  import configPlugins from '@expo/config-plugins';
2
- import type { ExpoConfig } from 'expo/config/index.js';
2
+ import type { ExpoConfig } from 'expo/config';
3
3
  /**
4
- * Desktop-only spawn path, deferred so bare-pack does not walk `bare-process`
5
- * -> `bare-posix` (no `android-arm64` prebuild). Mobile runs the engine fitter
6
- * in process instead, so it never reaches this.
4
+ * Desktop-only spawn path. `bare-runtime` maps `process` to `bare-process`
5
+ * under Bare, which pulls `bare-posix` (no `android-arm64` prebuild), so
6
+ * bare-pack must not walk it.
7
7
  */
8
8
  declare const MOBILE_UNSUPPORTED_MODULES: string[];
9
9
  type MobilePlatform = 'android' | 'ios';
@@ -4,17 +4,17 @@ import * as path from 'path';
4
4
  import { bundleSdk, verifyBundle, hasErrors, formatVerifyBundleResult } from '../../commands/index.js';
5
5
  import { createCommandLogger } from '../../commands/command-logger.js';
6
6
  import { CONFIG_CANDIDATES } from '../../client/config-loader/resolve-config.node.js';
7
- import { resolveSDKPackageDir } from './resolve-sdk-package-dir.js';
8
- import { getProjectRootFromMod } from './get-project-root.js';
9
- import { linkAddons } from './link-addons.js';
7
+ import { resolveSDKPackageDir } from '../../expo/plugins/resolve-sdk-package-dir.js';
8
+ import { getProjectRootFromMod } from '../../expo/plugins/get-project-root.js';
9
+ import { linkAddons } from '../../expo/plugins/link-addons.js';
10
10
  import { BundleVerificationFailedError } from '../../utils/errors-client.js';
11
11
  const { withDangerousMod } = configPlugins;
12
12
  /** Modules to defer from mobile bundles (not available at bundle time) */
13
13
  const DEFERRED_MODULES = ['expo-file-system', 'react-native-bare-kit'];
14
14
  /**
15
- * Desktop-only spawn path, deferred so bare-pack does not walk `bare-process`
16
- * -> `bare-posix` (no `android-arm64` prebuild). Mobile runs the engine fitter
17
- * in process instead, so it never reaches this.
15
+ * Desktop-only spawn path. `bare-runtime` maps `process` to `bare-process`
16
+ * under Bare, which pulls `bare-posix` (no `android-arm64` prebuild), so
17
+ * bare-pack must not walk it.
18
18
  */
19
19
  const MOBILE_UNSUPPORTED_MODULES = ['bare-runtime/spawn'];
20
20
  const MOBILE_HOSTS_BY_PLATFORM = {
@@ -1,4 +1,4 @@
1
- import type { ExpoConfig } from 'expo/config/index.js';
1
+ import type { ExpoConfig } from 'expo/config';
2
2
  /**
3
3
  * Plugin to add OpenCL native library support to Android build
4
4
  * This plugin was written by the most helpful folk in the QVAC team: Luis Moromisato.
@@ -1,4 +1,4 @@
1
- import type { ExpoConfig } from 'expo/config/index.js';
1
+ import type { ExpoConfig } from 'expo/config';
2
2
  import { type MobileBundleOptions } from './withMobileBundle.js';
3
3
  type QvacSDKPluginOptions = MobileBundleOptions;
4
4
  /**
@@ -1,17 +1,17 @@
1
- export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, type VectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, type ServerLogHandler, ocr, invokePlugin, invokePluginStream, diffusion, type DiffusionProgressTick, classify, decide, video, type VideoProgressTick, upscale, worldCreateScene, worldStep, type WorldStepResult, type WorldStepProgressTick, type WorldSceneResult, type WorldSceneResultWithPack, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand, type FinetuneHandle } from './client/api/index.js';
1
+ export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, type VectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, type ServerLogHandler, ocr, invokePlugin, invokePluginStream, diffusion, type DiffusionProgressTick, classify, decide, rerank, video, type VideoProgressTick, upscale, worldCreateScene, worldStep, type WorldStepResult, type WorldStepProgressTick, type WorldSceneResult, type WorldSceneResultWithPack, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand, type FinetuneHandle } from './client/api/index.js';
2
2
  export { close } from './client/index.js';
3
3
  export { plugins } from './client/plugins-factory.js';
4
- export { type LifecycleState, type ModelProgressUpdate, type LoadModelOptions, type LoadCustomPluginModelOptions, type DownloadAssetOptions, type Tool, type ToolCall, type ToolCallWithCall, type ToolCallError, type ToolCallEvent, type CompletionEvent, type CompletionFinal, type CompletionRun, type CompletionStats, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, type DecideParams, type DecisionState, type DecisionQuestion, type DecisionAnswer, type DecisionResult, type DecisionResponse, type DecisionConfig, type TranscribeStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type TranscribeSpeakerSegment, ASR_BACKEND_IDS, type AsrBackendId, type BciConfig, type BciTranscribeClientParams, type BciTranscribeStreamClientParams, type BciTranscribeStreamSession, type BciTranscribeStreamMetadataSession, type BciStreamOpts, type NeuralInput, type TextToSpeechStreamSession, type TextToSpeechStreamResponse, type TextToSpeechStreamClientParams, type TtsClientParamsInput, type TextToSpeechStreamResult, type TtsSentenceChunkUpdate, type TtsResponse, type TtsStats, TTS_ENGINES, type TtsEngine, TTS_PARLER_EMOTIONS, type TtsParlerEmotion, type TtsParlerLoadConfig, type TtsParlerRuntimeConfig, TTS_PACES, TTS_SENTENCE_DELIMITER_PRESETS, type TtsSentenceDelimiterPreset, TTS_CHATTERBOX_LANGUAGES, type TtsChatterboxLanguage, type TtsChatterboxLoadConfig, type TtsChatterboxRuntimeConfig, TTS_SUPERTONIC_LANGUAGES, type TtsSupertonicLanguage, type TtsSupertonicLoadConfig, type TtsSupertonicRuntimeConfig, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, type TtsPace, type TtsCosyvoice3Emotion, type TtsCosyvoice3Instruct, type TtsCosyvoice3LoadConfig, type TtsCosyvoice3RuntimeConfig, type TtsAudio8LoadConfig, type TtsAudio8RuntimeConfig, type TtsMossLoadConfig, type TtsMossSoundEffectLoadConfig, type TtsMossSpeechLoadConfig, type TtsMossSoundEffectRuntimeConfig, type TtsMossSpeechRuntimeConfig, type TtsMossRuntimeConfig, type CompletionParams, type ToolDialect, type RagSearchResult, type RagSaveEmbeddingsResult, type RagReindexResult, type RagEmbeddedDoc, type RagDoc, type RagWorkspaceInfo, type RagCloseWorkspaceParams, type RagDeleteWorkspaceParams, type RagIngestStage, type RagReindexStage, type RagSaveStage, RAG_ERROR_CODES, VectorIndexStorage, DEFAULT_VECTOR_INDEX_STORAGE, type VectorId, type VectorIndexHit, type CreateVectorIndexParams, type LoadVectorIndexParams, type VectorIndexAddParams, type VectorIndexIdsParams, type VectorIndexSearchParams, type VectorIndexWriteParams, type QvacConfig, type ModelInfo, type GetModelInfoParams, type GetLoadedModelInfoParams, type LoadedModelInfo, type GetSystemResourcesInput, type ResourceScope, type ResourceProvenance, type ResourceMetric, type GraphicsDriver, type GraphicsDriverCapabilities, type BackendProbeResult, type BackendDevice, type BackendDriver, type BackendFallback, type InferenceBackendDiagnostics, type CPUResourceCapabilities, type GPUResourceCapabilities, type SystemResourceCapabilities, type GPUResourceSample, type SystemResourceSample, type SystemResources, type AssessModelFitInput, type TranscriptionFitWorkload, type TtsFitWorkload, type AssessModelFitResult, type LoadedInstance, type CacheFileInfo, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, type McpClient, type McpClientInput, type OCRClientParams, type OCRTextBlock, type OCROptions, type ClassifyClientParams, type ClassificationResult, type DiffusionClientParams, type DiffusionStreamResponse, type DiffusionStats, AUDIOGEN_ENGINES, AUDIOGEN_TASK_TYPES, AUDIOGEN_TRACKS, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, AUDIOGEN_MAX_AUDIO_CODES, AUDIOGEN_EDIT_OPERATIONS, AUDIOGEN_REPAINT_MODES, type AudioGenEngine, type AudioGenTaskType, type AudioGenTrack, type AudioGenAudioInput, type AudioGenClientParams, type AudioGenConfig, type AudioGenRuntimeConfig, type AudioGenProgress, type AudioGenAudio, type AudioGenStats, type AudioGenGenerationMetadata, type AudioGenResult, type AudioGenStreamResponse, type AudioGenEditOperationType, type AudioGenRepaintMode, type AudioEditPrompt, type AudioEditFlowEditOperation, type AudioEditRepaintOperation, type AudioEditOperation, type AudioEditClientParams, type AudioEditStreamResponse, type AudioUnderstandClientParams, type AudioUnderstandResponse, type AudioGenUnderstandResult, type AudioUnderstandResult, type VideoClientParams, type VideoStreamResponse, type VideoStats, type UpscaleClientParams, type UpscaleStreamResponse, type UpscaleStats, type WalkKey, type WalkKeysInput, type WorldStepClientParams, type WorldStepStreamResponse, type WorldStepStats, type WorldSceneClientParams, type WorldSceneStreamResponse, type WorldSceneStats, type VlaConfig, type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaEmbodimentSelector, type VlaHparams, type VlaStats, definePlugin, defineHandler, defineDuplexHandler, PluginDefinitionInvalidError, type QvacPlugin, type CreateModelParams, type PluginModelResult, type ModelRegistryEntry, type ModelRegistryEntryAddon, type ProfilerMode, type FinetuneValidation, type FinetuneRunParams, type FinetuneGetStateParams, type FinetuneStopParams, type FinetuneParams, type FinetuneStatus, type FinetuneProgress, type FinetuneStats, type FinetuneResult } from '@qvac/inference/surface';
4
+ export { type LifecycleState, type ModelProgressUpdate, type LoadModelOptions, type LoadCustomPluginModelOptions, type DownloadAssetOptions, type Tool, type ToolCall, type ToolCallWithCall, type ToolCallError, type ToolCallEvent, type CompletionEvent, type CompletionFinal, type CompletionRun, type CompletionStats, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, type DecideParams, type DecisionState, type DecisionQuestion, type DecisionAnswer, type DecisionResult, type DecisionResponse, type DecisionConfig, type RerankParams, type RerankScores, type RerankConfig, type TranscribeStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type TranscribeSpeakerSegment, ASR_BACKEND_IDS, type AsrBackendId, type BciConfig, type BciTranscribeClientParams, type BciTranscribeStreamClientParams, type BciTranscribeStreamSession, type BciTranscribeStreamMetadataSession, type BciStreamOpts, type NeuralInput, type TextToSpeechStreamSession, type TextToSpeechStreamResponse, type TextToSpeechStreamClientParams, type TtsClientParamsInput, type TextToSpeechStreamResult, type TtsSentenceChunkUpdate, type TtsResponse, type TtsStats, TTS_ENGINES, type TtsEngine, TTS_PARLER_EMOTIONS, type TtsParlerEmotion, type TtsParlerLoadConfig, type TtsParlerRuntimeConfig, TTS_PACES, TTS_SENTENCE_DELIMITER_PRESETS, type TtsSentenceDelimiterPreset, TTS_CHATTERBOX_LANGUAGES, type TtsChatterboxLanguage, type TtsChatterboxLoadConfig, type TtsChatterboxRuntimeConfig, TTS_SUPERTONIC_LANGUAGES, type TtsSupertonicLanguage, type TtsSupertonicLoadConfig, type TtsSupertonicRuntimeConfig, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, type TtsPace, type TtsCosyvoice3Emotion, type TtsCosyvoice3Instruct, type TtsCosyvoice3LoadConfig, type TtsCosyvoice3RuntimeConfig, type TtsAudio8LoadConfig, type TtsAudio8RuntimeConfig, type TtsMossLoadConfig, type TtsMossSoundEffectLoadConfig, type TtsMossSpeechLoadConfig, type TtsMossSoundEffectRuntimeConfig, type TtsMossSpeechRuntimeConfig, type TtsMossRuntimeConfig, type CompletionParams, type ToolDialect, type RagSearchResult, type RagSaveEmbeddingsResult, type RagReindexResult, type RagEmbeddedDoc, type RagDoc, type RagWorkspaceInfo, type RagCloseWorkspaceParams, type RagDeleteWorkspaceParams, type RagIngestStage, type RagReindexStage, type RagSaveStage, RAG_ERROR_CODES, VectorIndexStorage, DEFAULT_VECTOR_INDEX_STORAGE, type VectorId, type VectorIndexHit, type CreateVectorIndexParams, type LoadVectorIndexParams, type VectorIndexAddParams, type VectorIndexIdsParams, type VectorIndexSearchParams, type VectorIndexWriteParams, type QvacConfig, type ModelInfo, type GetModelInfoParams, type GetLoadedModelInfoParams, type LoadedModelInfo, type GetSystemResourcesInput, type ResourceScope, type ResourceProvenance, type ResourceMetric, type GraphicsDriver, type GraphicsDriverCapabilities, type BackendProbeResult, type BackendDevice, type BackendDriver, type BackendFallback, type InferenceBackendDiagnostics, type CPUResourceCapabilities, type GPUResourceCapabilities, type SystemResourceCapabilities, type GPUResourceSample, type SystemResourceSample, type SystemResources, type AssessModelFitInput, type TranscriptionFitWorkload, type TtsFitWorkload, type AssessModelFitResult, type LoadedInstance, type CacheFileInfo, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, type McpClient, type McpClientInput, type OCRClientParams, type OCRTextBlock, type OCROptions, type ClassifyClientParams, type ClassificationResult, type DiffusionClientParams, type DiffusionStreamResponse, type DiffusionStats, AUDIOGEN_ENGINES, AUDIOGEN_TASK_TYPES, AUDIOGEN_TRACKS, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, AUDIOGEN_MAX_AUDIO_CODES, AUDIOGEN_EDIT_OPERATIONS, AUDIOGEN_REPAINT_MODES, type AudioGenEngine, type AudioGenTaskType, type AudioGenTrack, type AudioGenAudioInput, type AudioGenClientParams, type AudioGenConfig, type AudioGenRuntimeConfig, type AudioGenProgress, type AudioGenAudio, type AudioGenStats, type AudioGenGenerationMetadata, type AudioGenResult, type AudioGenStreamResponse, type AudioGenEditOperationType, type AudioGenRepaintMode, type AudioEditPrompt, type AudioEditFlowEditOperation, type AudioEditRepaintOperation, type AudioEditOperation, type AudioEditClientParams, type AudioEditStreamResponse, type AudioUnderstandClientParams, type AudioUnderstandResponse, type AudioGenUnderstandResult, type AudioUnderstandResult, type VideoClientParams, type VideoStreamResponse, type VideoStats, type UpscaleClientParams, type UpscaleStreamResponse, type UpscaleStats, type WalkKey, type WalkKeysInput, type WorldStepClientParams, type WorldStepStreamResponse, type WorldStepStats, type WorldSceneClientParams, type WorldSceneStreamResponse, type WorldSceneStats, type VlaConfig, type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaEmbodimentSelector, type VlaHparams, type VlaStats, definePlugin, defineHandler, defineDuplexHandler, PluginDefinitionInvalidError, type QvacPlugin, type CreateModelParams, type PluginModelResult, type ModelRegistryEntry, type ModelRegistryEntryAddon, type ProfilerMode, type FinetuneValidation, type FinetuneRunParams, type FinetuneGetStateParams, type FinetuneStopParams, type FinetuneParams, type FinetuneStatus, type FinetuneProgress, type FinetuneStats, type FinetuneResult } from '@qvac/inference/surface';
5
5
  export { SDK_CLIENT_ERROR_CODES } from './schemas/sdk-errors-client.js';
6
6
  export { SDK_SERVER_ERROR_CODES } from './schemas/sdk-errors-server.js';
7
- export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_DECISION, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_MOSS_TRANSCRIBE, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS, type BuiltinPlugin } from './plugin-ids.js';
7
+ export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_DECISION, PLUGIN_RERANK, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_MOSS_TRANSCRIBE, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS, type BuiltinPlugin } from './plugin-ids.js';
8
8
  export { type ToolInput, type ToolHandler } from './utils/tool-helpers.js';
9
9
  export { MODEL_TYPES, ModelType } from '@qvac/inference/surface';
10
10
  export * from '@qvac/inference/models';
11
11
  export { SUPPORTED_AUDIO_FORMATS } from '@qvac/inference/surface';
12
12
  export { InferenceCancelledError } from './utils/errors-server.js';
13
13
  export type { InferenceCancelledPartial } from './utils/errors-server.js';
14
- export { ContextOverflowError, type ContextOverflowErrorSizes, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
14
+ export { ContextOverflowError, type ContextOverflowErrorSizes, ModelRegistryModelNotFoundError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
15
15
  export { BareRuntimeBinaryNotFoundError, WorkerCrashedError, WorkerShutdownError, WorkerStartupError, RequestValidationFailedError, StreamEndedError, TextToSpeechStreamFailedError } from './utils/errors-client.js';
16
16
  export { getLogger, SDK_LOG_ID, SDK_ALL_LOG_ID } from './logging/index.js';
17
17
  export type { Logger, LogTransport, LoggerOptions } from './logging/index.js';
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Public API exports only
2
- export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, decide, video, upscale, worldCreateScene, worldStep, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand } from './client/api/index.js';
2
+ export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, startRpcServer, stopRpcServer, discoverRpcServers, getSystemResources, assessModelFit, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, decide, rerank, video, upscale, worldCreateScene, worldStep, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, audioEdit, audioUnderstand } from './client/api/index.js';
3
3
  export { close } from './client/index.js';
4
4
  export { plugins } from './client/plugins-factory.js';
5
5
  export { VERBOSITY, ASR_BACKEND_IDS, TTS_ENGINES, TTS_PARLER_EMOTIONS, TTS_PACES, TTS_SENTENCE_DELIMITER_PRESETS, TTS_CHATTERBOX_LANGUAGES, TTS_SUPERTONIC_LANGUAGES, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, RAG_ERROR_CODES, VectorIndexStorage, DEFAULT_VECTOR_INDEX_STORAGE, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, AUDIOGEN_ENGINES, AUDIOGEN_TASK_TYPES, AUDIOGEN_TRACKS, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, AUDIOGEN_MAX_AUDIO_CODES, AUDIOGEN_EDIT_OPERATIONS, AUDIOGEN_REPAINT_MODES, definePlugin, defineHandler, defineDuplexHandler, PluginDefinitionInvalidError } from '@qvac/inference/surface';
@@ -10,7 +10,7 @@ export { VERBOSITY, ASR_BACKEND_IDS, TTS_ENGINES, TTS_PARLER_EMOTIONS, TTS_PACES
10
10
  export { SDK_CLIENT_ERROR_CODES } from './schemas/sdk-errors-client.js';
11
11
  export { SDK_SERVER_ERROR_CODES } from './schemas/sdk-errors-server.js';
12
12
  // Built-in plugin ids under the public @qvac/sdk name (see `@/plugin-ids`).
13
- export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_DECISION, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_MOSS_TRANSCRIBE, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './plugin-ids.js';
13
+ export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_DECISION, PLUGIN_RERANK, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_MOSS_TRANSCRIBE, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './plugin-ids.js';
14
14
  export {} from './utils/tool-helpers.js';
15
15
  // Model types - canonical naming with backward-compatible aliases
16
16
  export { MODEL_TYPES, ModelType } from '@qvac/inference/surface';
@@ -37,7 +37,7 @@ export { SUPPORTED_AUDIO_FORMATS } from '@qvac/inference/surface';
37
37
  // `err instanceof <Class>` works on the consumer side, not just on
38
38
  // the worker side.
39
39
  export { InferenceCancelledError } from './utils/errors-server.js';
40
- export { ContextOverflowError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
40
+ export { ContextOverflowError, ModelRegistryModelNotFoundError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
41
41
  // `WorkerCrashedError` and `WorkerShutdownError` are thrown by the
42
42
  // rpc-client life-signal race when the bare worker exits unexpectedly
43
43
  // or close()/process-exit teardown runs while a caller is in flight.
@@ -1,4 +1,4 @@
1
- import type { Logger } from './index.js';
1
+ import type { Logger } from '../logging/index.js';
2
2
  export declare function registerAddonLogger(modelId: string, namespace: string, logger: Logger): void;
3
3
  export declare function unregisterAddonLogger(modelId: string): void;
4
4
  export declare function createAddonLoggerCallback(namespace: string): (priority: number, message: string) => void;
@@ -1,5 +1,5 @@
1
1
  import QvacLogger, {} from '@qvac/logging';
2
- import { LOG_LEVELS } from '@qvac/logging/constants.js';
2
+ import { LOG_LEVELS } from '@qvac/logging/constants';
3
3
  import { isLevelEnabled, formatArg } from './utils.js';
4
4
  import { registerLogger } from './registry.js';
5
5
  export function createBaseLogger(namespace, options, extensions) {
@@ -1,4 +1,4 @@
1
- import { LEVEL_PRIORITIES, LOG_LEVELS } from '@qvac/logging/constants.js';
1
+ import { LEVEL_PRIORITIES, LOG_LEVELS } from '@qvac/logging/constants';
2
2
  import stringify from 'fast-safe-stringify';
3
3
  export function isLevelEnabled(messageLevel, currentLevel) {
4
4
  // "off" suppresses every emission (console, streams, and transports alike),
@@ -31,6 +31,7 @@ const BUILTIN_PLUGINS = [
31
31
  '@qvac/sdk/llamacpp-completion/plugin',
32
32
  '@qvac/sdk/llamacpp-embedding/plugin',
33
33
  '@qvac/sdk/llamacpp-decision/plugin',
34
+ '@qvac/sdk/llamacpp-rerank/plugin',
34
35
  '@qvac/sdk/whispercpp-transcription/plugin',
35
36
  '@qvac/sdk/bci-whispercpp-transcription/plugin',
36
37
  '@qvac/sdk/nmtcpp-translation/plugin',
@@ -45,6 +46,7 @@ const BUILTIN_PLUGIN_EXPORTS = {
45
46
  'llamacpp-completion': 'llmPlugin',
46
47
  'llamacpp-embedding': 'embeddingsPlugin',
47
48
  'llamacpp-decision': 'decisionPlugin',
49
+ 'llamacpp-rerank': 'rerankPlugin',
48
50
  'whispercpp-transcription': 'whisperPlugin',
49
51
  'bci-whispercpp-transcription': 'bciPlugin',
50
52
  'nmtcpp-translation': 'nmtPlugin',
@@ -1,5 +1,6 @@
1
1
  export declare const PLUGIN_LLM: "@qvac/sdk/llamacpp-completion/plugin";
2
2
  export declare const PLUGIN_DECISION: "@qvac/sdk/llamacpp-decision/plugin";
3
+ export declare const PLUGIN_RERANK: "@qvac/sdk/llamacpp-rerank/plugin";
3
4
  export declare const PLUGIN_EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
4
5
  export declare const PLUGIN_WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
5
6
  export declare const PLUGIN_BCI: "@qvac/sdk/bci-whispercpp-transcription/plugin";
@@ -11,6 +12,6 @@ export declare const PLUGIN_DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
11
12
  export declare const PLUGIN_AUDIOGEN: "@qvac/sdk/audiogen-ggml/plugin";
12
13
  export declare const PLUGIN_VLA: "@qvac/sdk/ggml-vla/plugin";
13
14
  export declare const PLUGIN_CLASSIFICATION: "@qvac/sdk/ggml-classification/plugin";
14
- export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/llamacpp-decision/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/bci-whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/plugin", "@qvac/sdk/moss-transcribe/plugin", "@qvac/sdk/nmtcpp-translation/plugin", "@qvac/sdk/tts-ggml/plugin", "@qvac/sdk/ggml-ocr/plugin", "@qvac/sdk/sdcpp-generation/plugin", "@qvac/sdk/audiogen-ggml/plugin", "@qvac/sdk/ggml-vla/plugin", "@qvac/sdk/ggml-classification/plugin"];
15
+ export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/llamacpp-decision/plugin", "@qvac/sdk/llamacpp-rerank/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/bci-whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/plugin", "@qvac/sdk/moss-transcribe/plugin", "@qvac/sdk/nmtcpp-translation/plugin", "@qvac/sdk/tts-ggml/plugin", "@qvac/sdk/ggml-ocr/plugin", "@qvac/sdk/sdcpp-generation/plugin", "@qvac/sdk/audiogen-ggml/plugin", "@qvac/sdk/ggml-vla/plugin", "@qvac/sdk/ggml-classification/plugin"];
15
16
  export type BuiltinPlugin = (typeof SDK_DEFAULT_PLUGINS)[number];
16
17
  //# sourceMappingURL=plugin-ids.d.ts.map
@@ -1,6 +1,7 @@
1
1
  // Built-in plugin ids under the public @qvac/sdk name.
2
2
  export const PLUGIN_LLM = '@qvac/sdk/llamacpp-completion/plugin';
3
3
  export const PLUGIN_DECISION = '@qvac/sdk/llamacpp-decision/plugin';
4
+ export const PLUGIN_RERANK = '@qvac/sdk/llamacpp-rerank/plugin';
4
5
  export const PLUGIN_EMBEDDING = '@qvac/sdk/llamacpp-embedding/plugin';
5
6
  export const PLUGIN_WHISPER = '@qvac/sdk/whispercpp-transcription/plugin';
6
7
  export const PLUGIN_BCI = '@qvac/sdk/bci-whispercpp-transcription/plugin';
@@ -17,6 +18,7 @@ export const SDK_DEFAULT_PLUGINS = [
17
18
  PLUGIN_LLM,
18
19
  PLUGIN_EMBEDDING,
19
20
  PLUGIN_DECISION,
21
+ PLUGIN_RERANK,
20
22
  PLUGIN_WHISPER,
21
23
  PLUGIN_BCI,
22
24
  PLUGIN_PARAKEET,
@@ -1,4 +1,4 @@
1
- export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, modelSrcInputSchema as modelSourceSchema, type LlmConfigInput as LlamacppCompletionConfig, type EmbedConfigInput as LlamacppEmbeddingConfig, type DecisionConfigInput as LlamacppDecisionConfig, type ModelSrcInput as ModelSource } from '@qvac/inference/surface';
1
+ export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, rerankConfigBaseSchema as llamacppRerankConfigSchema, modelSrcInputSchema as modelSourceSchema, type LlmConfigInput as LlamacppCompletionConfig, type EmbedConfigInput as LlamacppEmbeddingConfig, type DecisionConfigInput as LlamacppDecisionConfig, type RerankConfigInput as LlamacppRerankConfig, type ModelSrcInput as ModelSource } from '@qvac/inference/surface';
2
2
  export { configSchemaForModelType, MODEL_CONFIG_SCHEMA_BY_TYPE } from '@qvac/inference/surface';
3
3
  export { modelFitPolicySchema, type ModelFitPolicy } from '@qvac/inference/surface';
4
4
  //# sourceMappingURL=public.d.ts.map
@@ -2,7 +2,7 @@
2
2
  // (aliased from @qvac/inference's schemas) so consumers such as the CLI can import
3
3
  // a model's `modelConfig` schema and read its field descriptions without depending
4
4
  // on internal identifiers.
5
- export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, modelSrcInputSchema as modelSourceSchema } from '@qvac/inference/surface';
5
+ export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, rerankConfigBaseSchema as llamacppRerankConfigSchema, modelSrcInputSchema as modelSourceSchema } from '@qvac/inference/surface';
6
6
  // Resolve any model's `modelConfig` schema by model type (canonical, alias, or
7
7
  // engine string) and read its field descriptions — the map is the single source
8
8
  // of truth, so a newly added model type is available here automatically. Lets
@@ -101,6 +101,7 @@ export declare const SDK_SERVER_ERROR_CODES: {
101
101
  readonly LIFECYCLE_OPERATION_BLOCKED: 53602;
102
102
  readonly PATH_TRAVERSAL: 53900;
103
103
  readonly QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950;
104
+ readonly QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951;
104
105
  };
105
106
  declare const serverErrorDefinitions: ErrorCodesMap;
106
107
  export { serverErrorDefinitions as SDK_SERVER_ERROR_DEFINITIONS };
@@ -118,7 +118,8 @@ export const SDK_SERVER_ERROR_CODES = {
118
118
  PATH_TRAVERSAL: 53900,
119
119
  // QVAC Model Registry Operations (53,950-54,000)
120
120
  // Note: Registry client errors (19,001-20,000) are re-thrown directly
121
- QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950
121
+ QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950,
122
+ QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951
122
123
  };
123
124
  const serverErrorDefinitions = {
124
125
  // Model Registry Errors (52,001-52,199)
@@ -565,6 +566,10 @@ const serverErrorDefinitions = {
565
566
  [SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_QUERY_FAILED]: {
566
567
  name: 'QVAC_MODEL_REGISTRY_QUERY_FAILED',
567
568
  message: (details) => `QVAC model registry query failed${details ? `: ${details}` : ''}`
569
+ },
570
+ [SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND]: {
571
+ name: 'QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND',
572
+ message: (registrySource, registryPath) => `QVAC model registry has no model at ${registrySource}/${registryPath}`
568
573
  }
569
574
  };
570
575
  const serverDefinitionsToRegister = Object.fromEntries(Object.entries(serverErrorDefinitions).filter(([code]) => !isCodeRegistered(Number(code))));
@@ -1,5 +1,10 @@
1
+ import { type AbortSignal } from 'bare-abort-controller';
1
2
  export declare function getNextCommandId(): number;
2
3
  export declare function isTerminalChunk<T>(value: T): value is T & {
3
4
  done: true;
4
5
  };
6
+ /** Aborts when the client destroys its end of `wire` (and after a normal end). */
7
+ export declare function signalOnWireClose(wire: {
8
+ on(event: 'close', listener: () => void): unknown;
9
+ }): AbortSignal;
5
10
  //# sourceMappingURL=rpc-utils.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { AbortController } from 'bare-abort-controller';
1
2
  let commandCounter = 0;
2
3
  export function getNextCommandId() {
3
4
  commandCounter = (commandCounter + 1) % Number.MAX_SAFE_INTEGER;
@@ -6,3 +7,9 @@ export function getNextCommandId() {
6
7
  export function isTerminalChunk(value) {
7
8
  return typeof value === 'object' && value !== null && 'done' in value && value.done === true;
8
9
  }
10
+ /** Aborts when the client destroys its end of `wire` (and after a normal end). */
11
+ export function signalOnWireClose(wire) {
12
+ const controller = new AbortController();
13
+ wire.on('close', () => controller.abort(undefined));
14
+ return controller.signal;
15
+ }
@@ -1,5 +1,5 @@
1
1
  import path from 'bare-path';
2
- import { getEnv } from '../env.js';
2
+ import { getEnv } from '../../server/env.js';
3
3
  export function getQvacPath(...subPaths) {
4
4
  return path.join(getEnv().HOME_DIR, '.qvac', ...subPaths);
5
5
  }
@@ -2,7 +2,7 @@ import fs from 'bare-fs';
2
2
  import path from 'bare-path';
3
3
  import os from 'bare-os';
4
4
  import { getServerLogger } from '../../logging/index.js';
5
- import { getQvacPath } from './qvac-paths.js';
5
+ import { getQvacPath } from '../../server/utils/qvac-paths.js';
6
6
  const logger = getServerLogger();
7
7
  const LOCK_FILENAME = '.worker.lock';
8
8
  function getLockFilePath() {
@@ -1,5 +1,5 @@
1
1
  import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall, ToolCallError } from '@qvac/inference/surface';
2
- import { type ToolHandlerMap } from './tool-helpers.js';
2
+ import { type ToolHandlerMap } from '../utils/tool-helpers.js';
3
3
  export type AggregatedEvents = {
4
4
  contentText: string;
5
5
  thinkingText: string;
@@ -1,5 +1,5 @@
1
- import { normalizeAssistantCacheContent } from './cache-normalize.js';
2
- import { attachHandlersToToolCalls } from './tool-helpers.js';
1
+ import { normalizeAssistantCacheContent } from '../utils/cache-normalize.js';
2
+ import { attachHandlersToToolCalls } from '../utils/tool-helpers.js';
3
3
  export function aggregateEvents(events) {
4
4
  let contentText = '';
5
5
  let thinkingText = '';
@@ -389,5 +389,11 @@ export declare class PathTraversalError extends QvacErrorBase {
389
389
  export declare class ModelRegistryQueryFailedError extends QvacErrorBase {
390
390
  constructor(details?: string, cause?: unknown);
391
391
  }
392
+ export declare class ModelRegistryModelNotFoundError extends QvacErrorBase {
393
+ readonly registrySource: string;
394
+ readonly registryPath: string;
395
+ constructor(registrySource: string, registryPath: string, cause?: unknown);
396
+ toErrorResponseFields(): Record<string, unknown>;
397
+ }
392
398
  export { RpcServerOperationError } from '@qvac/inference/surface';
393
399
  //# sourceMappingURL=errors-server.d.ts.map
@@ -640,4 +640,16 @@ export class ModelRegistryQueryFailedError extends QvacErrorBase {
640
640
  super(createErrorOptions(SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_QUERY_FAILED, details ? [details] : undefined, cause));
641
641
  }
642
642
  }
643
+ export class ModelRegistryModelNotFoundError extends QvacErrorBase {
644
+ registrySource;
645
+ registryPath;
646
+ constructor(registrySource, registryPath, cause) {
647
+ super(createErrorOptions(SDK_SERVER_ERROR_CODES.QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND, [registrySource, registryPath], cause));
648
+ this.registrySource = registrySource;
649
+ this.registryPath = registryPath;
650
+ }
651
+ toErrorResponseFields() {
652
+ return { registrySource: this.registrySource, registryPath: this.registryPath };
653
+ }
654
+ }
643
655
  export { RpcServerOperationError } from '@qvac/inference/surface';
@@ -1,6 +1,6 @@
1
1
  import type { Tool } from '@qvac/inference/surface';
2
2
  import type { McpClientInput } from '@qvac/inference/surface';
3
- import type { ToolHandler } from './tool-helpers.js';
3
+ import type { ToolHandler } from '../utils/tool-helpers.js';
4
4
  export type { McpClient, McpClientInput } from '@qvac/inference/surface';
5
5
  export type ToolHandlerMap = Map<string, ToolHandler>;
6
6
  export type McpToolsResult = {
@@ -1,4 +1,4 @@
1
- import { mapValues } from './object.js';
1
+ import { mapValues } from '../utils/object.js';
2
2
  const VALID_TYPES = ['string', 'number', 'integer', 'boolean', 'object', 'array', 'null'];
3
3
  function isValidType(value) {
4
4
  if (Array.isArray(value))
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { toolSchema } from '@qvac/inference/surface';
3
- import { InvalidToolsArrayError, InvalidToolSchemaError } from './errors-client.js';
3
+ import { InvalidToolsArrayError, InvalidToolSchemaError } from '../utils/errors-client.js';
4
4
  // Zod's integer bounds; they add nothing a tool grammar needs.
5
5
  const SAFE_INTEGER_BOUNDS = new Set([Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]);
6
6
  function dropSafeIntegerBounds(node) {
@@ -4,7 +4,7 @@ import { sendErrorResponse, sendStreamErrorResponse } from '../server/error-hand
4
4
  import { PluginHandlerTypeMismatchError } from '../utils/errors-server.js';
5
5
  import { handleInitConfig, isInitConfigMessage, handleShutdown, isShutdownMessage } from './handler-utils.js';
6
6
  import { createServerProfiler } from '../server/rpc/profiling/index.js';
7
- import { isTerminalChunk } from '../server/rpc/rpc-utils.js';
7
+ import { isTerminalChunk, signalOnWireClose } from '../server/rpc/rpc-utils.js';
8
8
  import { createProgressThrottle } from '../server/rpc/progress-throttle.js';
9
9
  export async function handleRequest(req) {
10
10
  let profiler;
@@ -65,6 +65,8 @@ async function streamToWire(req, request, profiler, throttleProgress) {
65
65
  const wire = req.createResponseStream();
66
66
  profiler.startHandler();
67
67
  let sentFinalChunk = false;
68
+ // Lets an `endsOnAbort` handler (log stream) release its source when the client aborts.
69
+ const signal = signalOnWireClose(wire);
68
70
  // A progress stream (a reply op that streams because of `withProgress`) can
69
71
  // emit hundreds of updates, so batch them on a time window before writing to
70
72
  // keep IPC and UI churn down. Native data streams like completion tokens pass
@@ -75,7 +77,7 @@ async function streamToWire(req, request, profiler, throttleProgress) {
75
77
  })
76
78
  : undefined;
77
79
  try {
78
- for await (const response of stream(request)) {
80
+ for await (const response of stream(request, { signal })) {
79
81
  if (isTerminalChunk(response)) {
80
82
  throttle?.flush();
81
83
  profiler.endHandler();
@@ -28,7 +28,7 @@ export function isShutdownMessage(data) {
28
28
  }
29
29
  export async function handleShutdown(req) {
30
30
  try {
31
- const { cleanupForTerminate } = await import('./lifecycle.js');
31
+ const { cleanupForTerminate } = await import('../worker/lifecycle.js');
32
32
  await cleanupForTerminate();
33
33
  req.reply(JSON.stringify({ success: true }), 'utf-8');
34
34
  }
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Default worker entry point that registers ALL built-in plugins.
3
3
  */
4
- import { initializeWorker, ensureRPCSetup } from './lifecycle.js';
4
+ import { initializeWorker, ensureRPCSetup } from '../worker/lifecycle.js';
5
5
  import { getServerLogger } from '../logging/index.js';
6
6
  import { registerPlugins } from '@qvac/inference/plugins';
7
7
  import { llmPlugin } from '@qvac/inference/llamacpp-completion/plugin';
8
8
  import { decisionPlugin } from '@qvac/inference/llamacpp-decision/plugin';
9
+ import { rerankPlugin } from '@qvac/inference/llamacpp-rerank/plugin';
9
10
  import { embeddingsPlugin } from '@qvac/inference/llamacpp-embedding/plugin';
10
11
  import { whisperPlugin } from '@qvac/inference/whispercpp-transcription/plugin';
11
12
  import { bciPlugin } from '@qvac/inference/bci-whispercpp-transcription/plugin';
@@ -25,6 +26,7 @@ registerPlugins([
25
26
  llmPlugin,
26
27
  embeddingsPlugin,
27
28
  decisionPlugin,
29
+ rerankPlugin,
28
30
  whisperPlugin,
29
31
  bciPlugin,
30
32
  parakeetPlugin,
@@ -1,6 +1,6 @@
1
1
  import os from 'bare-os';
2
2
  import Signal from 'bare-signals';
3
- import { createBareKitRPCServer, createIPCClient } from './create-server.js';
3
+ import { createBareKitRPCServer, createIPCClient } from '../worker/create-server.js';
4
4
  import { initEnv, getValidatedEnv } from '../server/env.js';
5
5
  import { initialize as initializeEngine, close as closeEngine, cleanupForTerminate as cleanupEngineForTerminate } from '@qvac/inference/engine';
6
6
  import { getServerLogger } from '../logging/index.js';
@@ -0,0 +1,2 @@
1
+ export * from '@qvac/inference/llamacpp-rerank/plugin';
2
+ //# sourceMappingURL=llamacpp-rerank.d.ts.map
@@ -0,0 +1 @@
1
+ export * from '@qvac/inference/llamacpp-rerank/plugin';