@qvac/sdk 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +115 -58
- package/README.md +10 -13
- package/dist/examples/asr/parakeet-sortformer.js +24 -14
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +40 -11
- package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
- package/dist/examples/asr/whispercpp-prompt.js +9 -5
- package/dist/examples/assess-model-fit.d.ts +7 -9
- package/dist/examples/assess-model-fit.js +22 -43
- package/dist/examples/calc-tokens.d.ts +2 -0
- package/dist/examples/calc-tokens.js +21 -0
- package/dist/examples/classification/classify-image.js +11 -5
- package/dist/examples/completion-stop-reason.d.ts +3 -3
- package/dist/examples/completion-stop-reason.js +4 -4
- package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
- package/dist/examples/diffusion-flux3-klein.js +102 -0
- package/dist/examples/diffusion-moss-image.d.ts +2 -0
- package/dist/examples/diffusion-moss-image.js +126 -0
- package/dist/examples/diffusion-qwen-image-21.js +15 -4
- package/dist/examples/embed-multimodal.d.ts +2 -0
- package/dist/examples/embed-multimodal.js +80 -0
- package/dist/examples/embed-p2p.js +2 -2
- package/dist/examples/image/megaloc.d.ts +2 -0
- package/dist/examples/image/megaloc.js +37 -0
- package/dist/examples/llamacpp-multimodal.js +18 -0
- package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
- package/dist/examples/rag/rag-turbovec.js +2 -2
- package/dist/examples/sessions.d.ts +17 -0
- package/dist/examples/sessions.js +63 -0
- package/dist/examples/tools/llamacpp-deferred-tools.js +8 -4
- package/dist/scripts/check-resource-collectors-packaging.js +7 -6
- package/dist/scripts/contract/build-contract.d.ts +2 -1
- package/dist/scripts/contract/build-contract.js +13 -1
- package/dist/scripts/contract/constants-registry.d.ts +17 -0
- package/dist/scripts/contract/constants-registry.js +8 -2
- package/dist/scripts/contract/method-shapes.d.ts +4 -0
- package/dist/scripts/contract/method-shapes.js +4 -0
- package/dist/scripts/enforce-inference-versions.d.ts +1 -1
- package/dist/scripts/enforce-inference-versions.js +28 -18
- package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
- package/dist/src/client/api/assess-model-fit.d.ts +17 -17
- package/dist/src/client/api/assess-model-fit.js +18 -31
- package/dist/src/client/api/audio-edit.d.ts +5 -3
- package/dist/src/client/api/audio-edit.js +5 -3
- package/dist/src/client/api/audio-gen-result.js +134 -45
- package/dist/src/client/api/audio-gen.d.ts +40 -3
- package/dist/src/client/api/audio-gen.js +40 -3
- package/dist/src/client/api/audio-understand.d.ts +2 -2
- package/dist/src/client/api/audio-understand.js +2 -2
- package/dist/src/client/api/batch-completion.js +2 -1
- package/dist/src/client/api/calc-tokens.d.ts +33 -0
- package/dist/src/client/api/calc-tokens.js +44 -0
- package/dist/src/client/api/cancel.d.ts +2 -2
- package/dist/src/client/api/cancel.js +2 -2
- package/dist/src/client/api/classify.d.ts +12 -5
- package/dist/src/client/api/classify.js +17 -5
- package/dist/src/client/api/client-request-id.d.ts +0 -15
- package/dist/src/client/api/client-request-id.js +15 -12
- package/dist/src/client/api/completion-stream.d.ts +8 -1
- package/dist/src/client/api/completion-stream.js +10 -1
- package/dist/src/client/api/delete-cache.d.ts +9 -2
- package/dist/src/client/api/delete-cache.js +13 -3
- package/dist/src/client/api/diffusion.d.ts +20 -4
- package/dist/src/client/api/diffusion.js +23 -5
- package/dist/src/client/api/embed.d.ts +82 -29
- package/dist/src/client/api/embed.js +64 -19
- package/dist/src/client/api/get-model-info.d.ts +2 -2
- package/dist/src/client/api/get-model-info.js +2 -2
- package/dist/src/client/api/get-system-resources.d.ts +2 -2
- package/dist/src/client/api/get-system-resources.js +2 -2
- package/dist/src/client/api/heartbeat.d.ts +3 -2
- package/dist/src/client/api/heartbeat.js +3 -2
- package/dist/src/client/api/index.d.ts +4 -3
- package/dist/src/client/api/index.js +2 -1
- package/dist/src/client/api/invoke-plugin.d.ts +8 -2
- package/dist/src/client/api/invoke-plugin.js +17 -2
- package/dist/src/client/api/load-model.js +5 -2
- package/dist/src/client/api/ocr.d.ts +5 -3
- package/dist/src/client/api/ocr.js +44 -21
- package/dist/src/client/api/rag.d.ts +1 -1
- package/dist/src/client/api/rag.js +1 -1
- package/dist/src/client/api/registry.d.ts +17 -7
- package/dist/src/client/api/registry.js +37 -12
- package/dist/src/client/api/resume.d.ts +2 -1
- package/dist/src/client/api/resume.js +2 -2
- package/dist/src/client/api/rpc-server.d.ts +4 -4
- package/dist/src/client/api/rpc-server.js +10 -10
- package/dist/src/client/api/state.d.ts +2 -2
- package/dist/src/client/api/state.js +2 -2
- package/dist/src/client/api/subscribe-logs.d.ts +2 -2
- package/dist/src/client/api/subscribe-logs.js +2 -2
- package/dist/src/client/api/suspend.d.ts +4 -2
- package/dist/src/client/api/suspend.js +4 -3
- package/dist/src/client/api/text-to-speech.d.ts +14 -5
- package/dist/src/client/api/text-to-speech.js +83 -29
- package/dist/src/client/api/transcribe.d.ts +6 -2
- package/dist/src/client/api/transcribe.js +7 -1
- package/dist/src/client/api/unload-model.d.ts +19 -7
- package/dist/src/client/api/unload-model.js +29 -11
- package/dist/src/client/api/upscale.d.ts +6 -3
- package/dist/src/client/api/upscale.js +9 -4
- package/dist/src/client/api/vector-index.d.ts +50 -16
- package/dist/src/client/api/vector-index.js +100 -48
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +3 -2
- package/dist/src/client/api/video.js +3 -2
- package/dist/src/client/api/vla.d.ts +9 -5
- package/dist/src/client/api/vla.js +17 -8
- package/dist/src/client/api/world.d.ts +5 -5
- package/dist/src/client/api/world.js +4 -4
- package/dist/src/client/init-hooks.d.ts +6 -4
- package/dist/src/client/init-hooks.js +12 -15
- package/dist/src/client/logging-stream-registry.d.ts +6 -3
- package/dist/src/client/logging-stream-registry.js +31 -12
- package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
- package/dist/src/client/rpc/bundle-stamp.js +75 -0
- package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
- package/dist/src/client/rpc/expo-home-dir.js +4 -0
- package/dist/src/client/rpc/expo-rpc-client.js +189 -135
- package/dist/src/client/rpc/node-rpc-client.js +322 -413
- package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
- package/dist/src/client/rpc/pear-runtime.js +12 -0
- package/dist/src/client/rpc/rpc-client.d.ts +5 -4
- package/dist/src/client/rpc/rpc-client.js +126 -23
- package/dist/src/client/rpc/rpc-error.js +21 -2
- package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
- package/dist/src/client/rpc/unbundled-harness.js +27 -0
- package/dist/src/client/rpc/worker-failure.d.ts +27 -0
- package/dist/src/client/rpc/worker-failure.js +61 -0
- package/dist/src/client/session-registry.d.ts +75 -0
- package/dist/src/client/session-registry.js +149 -0
- package/dist/src/client/session.d.ts +125 -0
- package/dist/src/client/session.js +148 -0
- package/dist/src/commands/bundle/addons.d.ts +14 -0
- package/dist/src/commands/bundle/addons.js +65 -0
- package/dist/src/commands/bundle/constants.js +1 -0
- package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
- package/dist/src/commands/bundle/entry-gen.js +17 -50
- package/dist/src/commands/bundle/index.d.ts +59 -13
- package/dist/src/commands/bundle/index.js +345 -121
- package/dist/src/commands/bundle/link.d.ts +58 -0
- package/dist/src/commands/bundle/link.js +135 -0
- package/dist/src/commands/bundle/node-support.d.ts +13 -0
- package/dist/src/commands/bundle/node-support.js +23 -0
- package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
- package/dist/src/commands/bundle/read-bundle.js +27 -0
- package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
- package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
- package/dist/src/commands/bundle/scratch.d.ts +35 -0
- package/dist/src/commands/bundle/scratch.js +178 -0
- package/dist/src/commands/bundle/targets.d.ts +14 -0
- package/dist/src/commands/bundle/targets.js +37 -0
- package/dist/src/commands/host-prebuilds/index.d.ts +5 -4
- package/dist/src/commands/host-prebuilds/index.js +9 -7
- package/dist/src/commands/index.d.ts +4 -3
- package/dist/src/commands/verify/abi.d.ts +20 -14
- package/dist/src/commands/verify/abi.js +11 -79
- package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
- package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
- package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
- package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
- package/dist/src/commands/verify/bundle-source.js +25 -21
- package/dist/src/commands/verify/engines-advice.d.ts +2 -8
- package/dist/src/commands/verify/engines-advice.js +7 -54
- package/dist/src/commands/verify/index.d.ts +30 -29
- package/dist/src/commands/verify/index.js +92 -200
- package/dist/src/commands/verify/prebuilds.d.ts +3 -5
- package/dist/src/commands/verify/prebuilds.js +1 -2
- package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
- package/dist/src/commands/verify/resource-collectors.js +1 -50
- package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
- package/dist/src/commands/verify/sidecar-runtime.js +51 -0
- package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
- package/dist/src/expo/plugins/withBareKit.js +204 -0
- package/dist/src/expo/plugins/withMobileBundle.d.ts +4 -11
- package/dist/src/expo/plugins/withMobileBundle.js +36 -57
- package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -0
- package/dist/src/expo/plugins/withQvacSDK.js +3 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +10 -14
- package/dist/src/logging/utils.js +10 -2
- package/dist/src/plugin-ids.d.ts +2 -1
- package/dist/src/plugin-ids.js +2 -0
- package/dist/src/schemas/public.d.ts +1 -1
- package/dist/src/schemas/public.js +1 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
- package/dist/src/schemas/sdk-errors-client.js +30 -36
- package/dist/src/schemas/sdk-errors-server.d.ts +11 -1
- package/dist/src/schemas/sdk-errors-server.js +60 -2
- package/dist/src/server/rpc/rpc-utils.d.ts +25 -4
- package/dist/src/server/rpc/rpc-utils.js +39 -5
- package/dist/src/utils/errors-client.d.ts +37 -29
- package/dist/src/utils/errors-client.js +50 -41
- package/dist/src/utils/errors-server.d.ts +59 -1
- package/dist/src/utils/errors-server.js +110 -1
- package/dist/src/utils/withTimeout.js +34 -17
- package/dist/src/worker/handle-request.js +25 -22
- package/dist/src/worker/handler-utils.d.ts +2 -6
- package/dist/src/worker/handler-utils.js +2 -20
- package/dist/src/worker/index.d.ts +2 -4
- package/dist/src/worker/index.js +23 -35
- package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
- package/dist/src/worker/shim.d.ts +4 -0
- package/dist/src/worker/shim.js +7 -0
- package/dist/src/worker/start.d.ts +9 -0
- package/dist/src/worker/start.js +16 -0
- package/dist/src/worker/unbundled-shim.d.ts +2 -0
- package/dist/src/worker/unbundled-shim.js +4 -0
- package/docs/system-resources-support-matrix.md +27 -19
- package/package.json +62 -51
- package/src/electron-forge/index.cjs +65 -91
- package/dist/examples/model-fit-ui/server.d.ts +0 -24
- package/dist/examples/model-fit-ui/server.js +0 -221
- package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
- package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
- package/dist/src/client/rpc/init-timeout.d.ts +0 -26
- package/dist/src/client/rpc/init-timeout.js +0 -25
- package/dist/src/client/rpc/ipc-socket-path.d.ts +0 -11
- package/dist/src/client/rpc/ipc-socket-path.js +0 -30
- package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
- package/dist/src/client/rpc/worker-startup-error.js +0 -13
- package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
- package/dist/src/commands/bundle/bare-pack.js +0 -77
- package/dist/src/commands/bundle/manifest.d.ts +0 -25
- package/dist/src/commands/bundle/manifest.js +0 -192
- package/dist/src/expo/plugins/link-addons.d.ts +0 -18
- package/dist/src/expo/plugins/link-addons.js +0 -65
- package/dist/src/pear/pre.d.ts +0 -21
- package/dist/src/pear/pre.js +0 -450
- package/dist/src/server/env.d.ts +0 -22
- package/dist/src/server/env.js +0 -59
- package/dist/src/server/utils/qvac-paths.d.ts +0 -2
- package/dist/src/server/utils/qvac-paths.js +0 -5
- package/dist/src/server/utils/worker-lock.d.ts +0 -3
- package/dist/src/server/utils/worker-lock.js +0 -67
- package/dist/src/worker/create-server.d.ts +0 -8
- package/dist/src/worker/create-server.js +0 -51
- package/dist/src/worker/lifecycle.d.ts +0 -23
- package/dist/src/worker/lifecycle.js +0 -149
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import configPlugins from '@expo/config-plugins';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { BARE_KIT_RESOURCES, NATIVE_MODULES } from '../../commands/bundle/link.js';
|
|
4
|
+
const { IOSConfig, WarningAggregator, withAppBuildGradle, withGradleProperties, withPlugins, withProjectBuildGradle, withSettingsGradle, withXcodeProject } = configPlugins;
|
|
5
|
+
const PLUGIN = '@qvac/sdk/expo-plugin';
|
|
6
|
+
const ANDROID_MODULE = path.basename(NATIVE_MODULES.android.dir);
|
|
7
|
+
const IOS_PACKAGE = path.basename(NATIVE_MODULES.ios.dir);
|
|
8
|
+
const JITPACK = 'https://www.jitpack.io';
|
|
9
|
+
/** bare-kit-kotlin is built with Kotlin 2.4, which Expo builds from SDK 58. */
|
|
10
|
+
const MIN_KOTLIN_VERSION = '2.4.20';
|
|
11
|
+
/**
|
|
12
|
+
* Expo plugin: adds the Bare Kit module that `withMobileBundle` writes to the
|
|
13
|
+
* app, as a Gradle module on Android and a local Swift package on iOS, and
|
|
14
|
+
* raises the app's Kotlin to the version Bare Kit needs. Fails when
|
|
15
|
+
* expo-bare-kit is also configured, since both write Bare Kit and the native
|
|
16
|
+
* addons into the app.
|
|
17
|
+
*/
|
|
18
|
+
function withBareKit(config) {
|
|
19
|
+
if (hasPlugin(config, 'expo-bare-kit')) {
|
|
20
|
+
throw new Error(`QVAC: ${PLUGIN} cannot be used with expo-bare-kit, since both add Bare Kit and its native ` +
|
|
21
|
+
'addons to the app. Remove expo-bare-kit from the plugins.');
|
|
22
|
+
}
|
|
23
|
+
return withPlugins(config, [withAndroidModule, withJitPack, withKotlinVersion, withIosPackage]);
|
|
24
|
+
}
|
|
25
|
+
function hasPlugin(config, name) {
|
|
26
|
+
return (config.plugins ?? []).some((plugin) => Array.isArray(plugin) ? plugin[0] === name : plugin === name);
|
|
27
|
+
}
|
|
28
|
+
export function includeModule(settings) {
|
|
29
|
+
const include = `include ':${ANDROID_MODULE}'`;
|
|
30
|
+
return settings.includes(include) ? settings : `${settings}\n${include}\n`;
|
|
31
|
+
}
|
|
32
|
+
export function addModuleDependency(appBuildGradle) {
|
|
33
|
+
const dependency = `implementation project(':${ANDROID_MODULE}')`;
|
|
34
|
+
if (appBuildGradle.includes(dependency))
|
|
35
|
+
return appBuildGradle;
|
|
36
|
+
return appBuildGradle.replace(/dependencies\s*{/, (match) => `${match}\n ${dependency}`);
|
|
37
|
+
}
|
|
38
|
+
/** bare-kit-kotlin is published on JitPack. */
|
|
39
|
+
export function addJitPack(buildGradle) {
|
|
40
|
+
const repository = `maven { url '${JITPACK}' }`;
|
|
41
|
+
if (buildGradle.includes(repository))
|
|
42
|
+
return buildGradle;
|
|
43
|
+
return buildGradle.replace(/allprojects\s*{\s*repositories\s*{/, (match) => `${match}\n ${repository}`);
|
|
44
|
+
}
|
|
45
|
+
export function raiseKotlinVersion(properties) {
|
|
46
|
+
const key = 'android.kotlinVersion';
|
|
47
|
+
const property = properties.find((item) => item.type === 'property' && item.key === key);
|
|
48
|
+
if (property === undefined) {
|
|
49
|
+
properties.push({ type: 'property', key, value: MIN_KOTLIN_VERSION });
|
|
50
|
+
}
|
|
51
|
+
else if (property.type === 'property' &&
|
|
52
|
+
compareVersions(property.value, MIN_KOTLIN_VERSION) < 0) {
|
|
53
|
+
property.value = MIN_KOTLIN_VERSION;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Compares the numeric parts of two versions; a suffix such as `-RC` is ignored. */
|
|
57
|
+
function compareVersions(a, b) {
|
|
58
|
+
const numbers = (version) => version.split('.').map((part) => parseInt(part, 10) || 0);
|
|
59
|
+
const x = numbers(a);
|
|
60
|
+
const y = numbers(b);
|
|
61
|
+
for (let i = 0; i < Math.max(x.length, y.length); i++) {
|
|
62
|
+
const difference = (x[i] ?? 0) - (y[i] ?? 0);
|
|
63
|
+
if (difference !== 0)
|
|
64
|
+
return difference;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function withKotlinVersion(config) {
|
|
69
|
+
return withGradleProperties(config, (config) => {
|
|
70
|
+
raiseKotlinVersion(config.modResults);
|
|
71
|
+
return config;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function withAndroidModule(config) {
|
|
75
|
+
config = withSettingsGradle(config, (config) => {
|
|
76
|
+
config.modResults.contents = includeModule(config.modResults.contents);
|
|
77
|
+
return config;
|
|
78
|
+
});
|
|
79
|
+
return withAppBuildGradle(config, (config) => {
|
|
80
|
+
if (!isGroovy(config.modResults.language, 'app build.gradle'))
|
|
81
|
+
return config;
|
|
82
|
+
config.modResults.contents = addModuleDependency(config.modResults.contents);
|
|
83
|
+
warnUnless(config.modResults.contents, `:${ANDROID_MODULE}`, 'a dependencies block in app build.gradle');
|
|
84
|
+
return config;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function withJitPack(config) {
|
|
88
|
+
return withProjectBuildGradle(config, (config) => {
|
|
89
|
+
if (!isGroovy(config.modResults.language, 'build.gradle'))
|
|
90
|
+
return config;
|
|
91
|
+
config.modResults.contents = addJitPack(config.modResults.contents);
|
|
92
|
+
warnUnless(config.modResults.contents, JITPACK, 'allprojects.repositories in build.gradle');
|
|
93
|
+
return config;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** Warns when `contents` lacks `expected`, which the plugin adds to `place`. */
|
|
97
|
+
function warnUnless(contents, expected, place) {
|
|
98
|
+
if (contents.includes(expected))
|
|
99
|
+
return;
|
|
100
|
+
WarningAggregator.addWarningAndroid(PLUGIN, `Cannot find ${place} to add Bare Kit to; add ${expected} there yourself`);
|
|
101
|
+
}
|
|
102
|
+
function isGroovy(language, file) {
|
|
103
|
+
if (language === 'groovy')
|
|
104
|
+
return true;
|
|
105
|
+
WarningAggregator.addWarningAndroid(PLUGIN, `Cannot add Bare Kit to a non-Groovy ${file}`);
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
function withIosPackage(config) {
|
|
109
|
+
return withXcodeProject(config, (config) => {
|
|
110
|
+
// The Swift package is written only on macOS, which signs its frameworks.
|
|
111
|
+
if (process.platform !== 'darwin')
|
|
112
|
+
return config;
|
|
113
|
+
const project = config.modResults;
|
|
114
|
+
const { uuid } = IOSConfig.XcodeUtils.getApplicationNativeTarget({
|
|
115
|
+
project: config.modResults,
|
|
116
|
+
projectName: config.modRequest.projectName
|
|
117
|
+
});
|
|
118
|
+
addSwiftPackage(project, uuid, IOS_PACKAGE);
|
|
119
|
+
addFolderResource(project, uuid, `${IOS_PACKAGE}/${BARE_KIT_RESOURCES}`);
|
|
120
|
+
return config;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function unquote(value) {
|
|
124
|
+
return typeof value === 'string' ? value.replace(/^"|"$/g, '') : value;
|
|
125
|
+
}
|
|
126
|
+
/** Links the product of the local Swift package at `relativePath`, named the same, into `target`. */
|
|
127
|
+
export function addSwiftPackage(project, target, relativePath) {
|
|
128
|
+
const objects = project.hash.project.objects;
|
|
129
|
+
const nativeTarget = objects.PBXNativeTarget[target];
|
|
130
|
+
if (nativeTarget === undefined)
|
|
131
|
+
throw new Error(`QVAC: unknown Xcode target '${target}'`);
|
|
132
|
+
const packages = (objects.XCLocalSwiftPackageReference ??= {});
|
|
133
|
+
const products = (objects.XCSwiftPackageProductDependency ??= {});
|
|
134
|
+
const comment = `XCLocalSwiftPackageReference "${relativePath}"`;
|
|
135
|
+
let packageId = Object.entries(packages).find(([, value]) => typeof value === 'object' &&
|
|
136
|
+
unquote(value.relativePath) === relativePath)?.[0];
|
|
137
|
+
if (packageId === undefined) {
|
|
138
|
+
packageId = project.generateUuid();
|
|
139
|
+
packages[packageId] = {
|
|
140
|
+
isa: 'XCLocalSwiftPackageReference',
|
|
141
|
+
relativePath: `"${relativePath}"`
|
|
142
|
+
};
|
|
143
|
+
packages[`${packageId}_comment`] = comment;
|
|
144
|
+
const root = project.getFirstProject().firstProject;
|
|
145
|
+
(root.packageReferences ??= []).push({ value: packageId, comment });
|
|
146
|
+
}
|
|
147
|
+
const dependencies = (nativeTarget.packageProductDependencies ??= []);
|
|
148
|
+
const linked = dependencies.some(({ value }) => {
|
|
149
|
+
const dependency = products[value];
|
|
150
|
+
return dependency?.package === packageId && dependency.productName === relativePath;
|
|
151
|
+
});
|
|
152
|
+
if (linked)
|
|
153
|
+
return;
|
|
154
|
+
const dependency = project.generateUuid();
|
|
155
|
+
products[dependency] = {
|
|
156
|
+
isa: 'XCSwiftPackageProductDependency',
|
|
157
|
+
package: packageId,
|
|
158
|
+
package_comment: comment,
|
|
159
|
+
productName: relativePath
|
|
160
|
+
};
|
|
161
|
+
products[`${dependency}_comment`] = relativePath;
|
|
162
|
+
dependencies.push({ value: dependency, comment: relativePath });
|
|
163
|
+
const file = project.generateUuid();
|
|
164
|
+
objects.PBXBuildFile[file] = {
|
|
165
|
+
isa: 'PBXBuildFile',
|
|
166
|
+
productRef: dependency,
|
|
167
|
+
productRef_comment: relativePath
|
|
168
|
+
};
|
|
169
|
+
objects.PBXBuildFile[`${file}_comment`] = `${relativePath} in Frameworks`;
|
|
170
|
+
const phase = project.pbxFrameworksBuildPhaseObj(target);
|
|
171
|
+
if (phase === null) {
|
|
172
|
+
throw new Error(`QVAC: Xcode target '${nativeTarget.name}' has no Frameworks phase`);
|
|
173
|
+
}
|
|
174
|
+
phase.files.push({ value: file, comment: `${relativePath} in Frameworks` });
|
|
175
|
+
}
|
|
176
|
+
/** Copies the folder at `relativePath` into the app bundle as is. */
|
|
177
|
+
export function addFolderResource(project, target, relativePath) {
|
|
178
|
+
const objects = project.hash.project.objects;
|
|
179
|
+
const exists = Object.values(objects.PBXFileReference).some((value) => typeof value === 'object' && unquote(value.path) === relativePath);
|
|
180
|
+
if (exists)
|
|
181
|
+
return;
|
|
182
|
+
const name = path.posix.basename(relativePath);
|
|
183
|
+
const file = project.generateUuid();
|
|
184
|
+
objects.PBXFileReference[file] = {
|
|
185
|
+
isa: 'PBXFileReference',
|
|
186
|
+
lastKnownFileType: 'folder',
|
|
187
|
+
name: `"${name}"`,
|
|
188
|
+
path: `"${relativePath}"`,
|
|
189
|
+
sourceTree: '"<group>"'
|
|
190
|
+
};
|
|
191
|
+
objects.PBXFileReference[`${file}_comment`] = name;
|
|
192
|
+
objects.PBXGroup[project.getFirstProject().firstProject.mainGroup].children.push({
|
|
193
|
+
value: file,
|
|
194
|
+
comment: name
|
|
195
|
+
});
|
|
196
|
+
const build = project.generateUuid();
|
|
197
|
+
objects.PBXBuildFile[build] = { isa: 'PBXBuildFile', fileRef: file, fileRef_comment: name };
|
|
198
|
+
objects.PBXBuildFile[`${build}_comment`] = `${name} in Resources`;
|
|
199
|
+
const phase = project.pbxResourcesBuildPhaseObj(target);
|
|
200
|
+
if (phase === null)
|
|
201
|
+
throw new Error(`QVAC: Xcode target '${target}' has no Resources phase`);
|
|
202
|
+
phase.files.push({ value: build, comment: `${name} in Resources` });
|
|
203
|
+
}
|
|
204
|
+
export default withBareKit;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
2
|
import type { ExpoConfig } from 'expo/config';
|
|
3
|
-
/**
|
|
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
|
-
*/
|
|
8
|
-
declare const MOBILE_UNSUPPORTED_MODULES: string[];
|
|
9
3
|
type MobilePlatform = 'android' | 'ios';
|
|
10
4
|
declare const MOBILE_HOSTS_BY_PLATFORM: Record<MobilePlatform, string[]>;
|
|
11
5
|
/** Every mobile host, in platform order. The bundle covers all of them. */
|
|
@@ -20,15 +14,14 @@ type MobileBundleOptions = {
|
|
|
20
14
|
installMissingPrebuilds?: boolean;
|
|
21
15
|
};
|
|
22
16
|
/**
|
|
23
|
-
* Expo plugin:
|
|
24
|
-
* platform being
|
|
25
|
-
*
|
|
26
|
-
* `qvac.config.*` if present.
|
|
17
|
+
* Expo plugin: bundle and verify the worker, write Bare Kit and the native
|
|
18
|
+
* addons for the platform being built, then copy the worker into the SDK.
|
|
19
|
+
* Uses `qvac.config.*` if present.
|
|
27
20
|
*/
|
|
28
21
|
declare function withMobileBundle(config: ExpoConfig, options?: MobileBundleOptions): ExpoConfig;
|
|
29
22
|
declare function buildMobileBundle<T extends configPlugins.ExportedConfigWithProps<unknown>>(config: T, options: MobileBundleOptions): Promise<T>;
|
|
30
23
|
declare function mobileHostsForPlatform(platform: string): string[];
|
|
31
|
-
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM,
|
|
24
|
+
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, buildMobileBundle, mobileHostsForPlatform };
|
|
32
25
|
export type { MobileBundleOptions, MobilePlatform };
|
|
33
26
|
export default withMobileBundle;
|
|
34
27
|
//# sourceMappingURL=withMobileBundle.d.ts.map
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
|
-
import { bundleSdk
|
|
5
|
-
import {
|
|
4
|
+
import { bundleSdk } from '../../commands/index.js';
|
|
5
|
+
import { discardStaged, replaceAll, scratchFolderFor } from '../../commands/bundle/scratch.js';
|
|
6
6
|
import { CONFIG_CANDIDATES } from '../../client/config-loader/resolve-config.node.js';
|
|
7
7
|
import { resolveSDKPackageDir } from '../../expo/plugins/resolve-sdk-package-dir.js';
|
|
8
8
|
import { getProjectRootFromMod } from '../../expo/plugins/get-project-root.js';
|
|
9
|
-
import { linkAddons } from '../../expo/plugins/link-addons.js';
|
|
10
|
-
import { BundleVerificationFailedError } from '../../utils/errors-client.js';
|
|
11
9
|
const { withDangerousMod } = configPlugins;
|
|
12
10
|
/** Modules to defer from mobile bundles (not available at bundle time) */
|
|
13
11
|
const DEFERRED_MODULES = ['expo-file-system', 'react-native-bare-kit'];
|
|
14
|
-
/**
|
|
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
|
-
*/
|
|
19
|
-
const MOBILE_UNSUPPORTED_MODULES = ['bare-runtime/spawn'];
|
|
20
12
|
const MOBILE_HOSTS_BY_PLATFORM = {
|
|
21
13
|
android: ['android-arm64'],
|
|
22
14
|
ios: ['ios-arm64', 'ios-arm64-simulator', 'ios-x64-simulator']
|
|
23
15
|
};
|
|
24
16
|
/** Every mobile host, in platform order. The bundle covers all of them. */
|
|
25
17
|
const MOBILE_HOSTS = [...MOBILE_HOSTS_BY_PLATFORM.android, ...MOBILE_HOSTS_BY_PLATFORM.ios];
|
|
18
|
+
/** The generated harness and its bundle, served as `@qvac/sdk/worker.mobile`. */
|
|
19
|
+
const WORKER_MOBILE_FILES = ['index.js', 'index.d.ts', 'index.bundle.mjs'];
|
|
26
20
|
/**
|
|
27
|
-
* Expo plugin:
|
|
28
|
-
* platform being
|
|
29
|
-
*
|
|
30
|
-
* `qvac.config.*` if present.
|
|
21
|
+
* Expo plugin: bundle and verify the worker, write Bare Kit and the native
|
|
22
|
+
* addons for the platform being built, then copy the worker into the SDK.
|
|
23
|
+
* Uses `qvac.config.*` if present.
|
|
31
24
|
*/
|
|
32
25
|
function withMobileBundle(config, options = {}) {
|
|
33
26
|
config = withDangerousMod(config, ['android', (mod) => buildMobileBundle(mod, options)]);
|
|
@@ -37,7 +30,6 @@ function withMobileBundle(config, options = {}) {
|
|
|
37
30
|
async function buildMobileBundle(config, options) {
|
|
38
31
|
const projectRoot = getProjectRootFromMod(config);
|
|
39
32
|
const sdkPackage = resolveSDKPackageDir(projectRoot);
|
|
40
|
-
const outputPath = path.join(sdkPackage.dir, 'dist', 'worker.mobile.bundle.js');
|
|
41
33
|
const platformHosts = mobileHostsForPlatform(config.modRequest.platform);
|
|
42
34
|
const configPath = findConfigFile(projectRoot);
|
|
43
35
|
if (configPath) {
|
|
@@ -46,26 +38,28 @@ async function buildMobileBundle(config, options) {
|
|
|
46
38
|
else {
|
|
47
39
|
console.log('🕚 QVAC: No config found, generating default bundle (all plugins)...');
|
|
48
40
|
}
|
|
49
|
-
const deferredModules = [
|
|
50
|
-
...DEFERRED_MODULES,
|
|
51
|
-
...MOBILE_UNSUPPORTED_MODULES,
|
|
52
|
-
`${sdkPackage.name}/worker.mobile.bundle`
|
|
53
|
-
];
|
|
41
|
+
const deferredModules = [...DEFERRED_MODULES, `${sdkPackage.name}/worker.mobile`];
|
|
54
42
|
// The bundle is one shared artifact both platforms import, so it is built
|
|
55
43
|
// for every mobile host: a dual-platform `expo prebuild` runs this mod twice
|
|
56
44
|
// and the second run would otherwise overwrite the first platform's bundle
|
|
57
45
|
// with one that resolved the other platform's conditions.
|
|
58
|
-
const
|
|
59
|
-
const generatedBundle = path.join(projectRoot, 'qvac', 'worker.bundle.js');
|
|
60
|
-
await runVerifier(projectRoot, generatedBundle, configPath, platformHosts);
|
|
61
|
-
fs.copyFileSync(generatedBundle, outputPath);
|
|
62
|
-
const linked = await linkAddons({
|
|
46
|
+
const result = await bundleSdk({
|
|
63
47
|
projectRoot,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
sdkPath: sdkPackage.dir,
|
|
49
|
+
...(configPath ? { configPath } : {}),
|
|
50
|
+
target: 'react-native',
|
|
51
|
+
hosts: MOBILE_HOSTS,
|
|
52
|
+
defer: deferredModules,
|
|
53
|
+
quiet: true,
|
|
54
|
+
installMissingPrebuilds: options.installMissingPrebuilds === true,
|
|
55
|
+
link: platformHosts
|
|
67
56
|
});
|
|
68
|
-
|
|
57
|
+
if (result.installedPrebuilds.length > 0) {
|
|
58
|
+
const names = result.installedPrebuilds.map((pkg) => `${pkg.name}@${pkg.version}`).join(', ');
|
|
59
|
+
console.log(`📦 QVAC: Installed addon platform packages: ${names}`);
|
|
60
|
+
}
|
|
61
|
+
console.log(`🔗 QVAC: Linked ${result.linked.length} native addon files for ${platformHosts.join(', ')}`);
|
|
62
|
+
await copyWorker(result.outputDir, path.join(sdkPackage.dir, 'dist', 'worker-mobile'));
|
|
69
63
|
console.log('🫡 QVAC: Mobile bundle generated, verified and linked');
|
|
70
64
|
return config;
|
|
71
65
|
}
|
|
@@ -85,35 +79,20 @@ function findConfigFile(projectRoot) {
|
|
|
85
79
|
}
|
|
86
80
|
return null;
|
|
87
81
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
/** Copies the worker into `outDir`, which keeps its previous files until every copy is done. */
|
|
83
|
+
async function copyWorker(workerDir, outDir) {
|
|
84
|
+
const scratch = await scratchFolderFor(outDir);
|
|
85
|
+
const staged = [{ dir: outDir, next: scratch }];
|
|
86
|
+
try {
|
|
87
|
+
fs.mkdirSync(scratch, { recursive: true });
|
|
88
|
+
for (const file of WORKER_MOBILE_FILES) {
|
|
89
|
+
fs.copyFileSync(path.join(workerDir, file), path.join(scratch, file));
|
|
90
|
+
}
|
|
91
|
+
await replaceAll(staged);
|
|
98
92
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const result = await bundleSdk({
|
|
102
|
-
projectRoot,
|
|
103
|
-
sdkPath: qvacSdkPath,
|
|
104
|
-
...(configPath ? { configPath } : {}),
|
|
105
|
-
hosts,
|
|
106
|
-
defer: deferredModules,
|
|
107
|
-
quiet: true,
|
|
108
|
-
installMissingPrebuilds,
|
|
109
|
-
// runVerifier checks engines.bare right after, with progress output.
|
|
110
|
-
checkEngines: false
|
|
111
|
-
});
|
|
112
|
-
if (result.installedPrebuilds.length > 0) {
|
|
113
|
-
const names = result.installedPrebuilds.map((pkg) => `${pkg.name}@${pkg.version}`).join(', ');
|
|
114
|
-
console.log(`📦 QVAC: Installed addon platform packages: ${names}`);
|
|
93
|
+
finally {
|
|
94
|
+
await discardStaged(staged);
|
|
115
95
|
}
|
|
116
|
-
return result.entryPaths.worker;
|
|
117
96
|
}
|
|
118
|
-
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM,
|
|
97
|
+
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, buildMobileBundle, mobileHostsForPlatform };
|
|
119
98
|
export default withMobileBundle;
|
|
@@ -4,6 +4,7 @@ type QvacSDKPluginOptions = MobileBundleOptions;
|
|
|
4
4
|
/**
|
|
5
5
|
* Main Qvac SDK Expo plugin that combines all necessary mobile configurations:
|
|
6
6
|
* - Mobile worker bundle generation
|
|
7
|
+
* - Bare Kit and the native addons as a Gradle module and a Swift package
|
|
7
8
|
* - Device info stubbing when expo-device is not installed
|
|
8
9
|
* - Android build properties (minSdkVersion, NDK, proguard)
|
|
9
10
|
* - Android NDK version pinning in build.gradle
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
2
|
import withAndroidArchitecture from './withAndroidArchitecture.js';
|
|
3
3
|
import withAndroidNdkVersion from './withAndroidNdkVersion.js';
|
|
4
|
+
import withBareKit from './withBareKit.js';
|
|
4
5
|
import withDeviceInfo from './withDeviceInfo.js';
|
|
5
6
|
import withMobileBundle, {} from './withMobileBundle.js';
|
|
6
7
|
import withOpenCL from './withOpenCL.js';
|
|
@@ -8,6 +9,7 @@ const { withPlugins } = configPlugins;
|
|
|
8
9
|
/**
|
|
9
10
|
* Main Qvac SDK Expo plugin that combines all necessary mobile configurations:
|
|
10
11
|
* - Mobile worker bundle generation
|
|
12
|
+
* - Bare Kit and the native addons as a Gradle module and a Swift package
|
|
11
13
|
* - Device info stubbing when expo-device is not installed
|
|
12
14
|
* - Android build properties (minSdkVersion, NDK, proguard)
|
|
13
15
|
* - Android NDK version pinning in build.gradle
|
|
@@ -20,6 +22,7 @@ const { withPlugins } = configPlugins;
|
|
|
20
22
|
function withQvacSDK(config, options = {}) {
|
|
21
23
|
return withPlugins(config, [
|
|
22
24
|
[withMobileBundle, options],
|
|
25
|
+
withBareKit,
|
|
23
26
|
withDeviceInfo,
|
|
24
27
|
[
|
|
25
28
|
'expo-build-properties',
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
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';
|
|
1
|
+
export { batchCompletion, completion, deleteCache, calcTokens, type CalcTokensClientParams, loadModel, downloadAsset, heartbeat, unloadModel, type UnloadModelResult, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, embedBatch, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, createVectorIndex, loadVectorIndex, type VectorIndex, type VectorIndexOperation, 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
|
+
export { openSession, type QvacSession, type OpenSessionOptions } from './client/session.js';
|
|
3
4
|
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 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
|
+
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 CalcTokensParams, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, type EmbedInput, type EmbedInputPart, type EmbedMediaSource, type EmbedLegacyParams as EmbedParams, type EmbedClientParams, type EmbedClientInput, type EmbedBatchClientParams as EmbedBatchParams, type EmbedBatchClientParams, type ImageEmbeddingConfig, type ImageEmbeddingStats, 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 HistoryContent, type HistoryContentPart, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type TranscribeSpeakerSegment, type TranscribeToken, 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, TTS_PARLER_COREML_COMPUTE_UNITS, TTS_LAVASR_COREML_COMPUTE_UNITS, TTS_SUPERTONIC_PRECISIONS, 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 VectorIndexSetStagedSearchParams, 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 ModelFitVerdict, type ModelFitModelResult, type ModelFitDevice, type ModelFitStats, type LlamaFitStats, type ModelFitPool, type ModelFitProbe, type LoadedInstance, type CacheFileInfo, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, resolveToolSearchSource, type ToolSearchOptions, type ToolSearchSource, 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, AUDIOGEN_OUTPUT_FORMATS, AUDIOGEN_MINIMAX_COREML_COMPUTE_UNITS, type AudioGenEngine, type AudioGenTaskType, type AudioGenTrack, type AudioGenAudioInput, type AudioGenClientParams, type AudioGenConfig, type AudioGenRuntimeConfig, type AudioGenProgress, type AudioGenAudio, type AudioGenEncodedAudio, type AudioGenOutputFormat, type AudioGenMinimaxCoremlComputeUnits, 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, requestParent, type PluginHandlerContext, 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
6
|
export { SDK_CLIENT_ERROR_CODES } from './schemas/sdk-errors-client.js';
|
|
6
7
|
export { SDK_SERVER_ERROR_CODES } from './schemas/sdk-errors-server.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
|
+
export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_IMAGE_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
9
|
export { type ToolInput, type ToolHandler } from './utils/tool-helpers.js';
|
|
9
10
|
export { MODEL_TYPES, ModelType } from '@qvac/inference/surface';
|
|
10
11
|
export * from '@qvac/inference/models';
|
|
11
12
|
export { SUPPORTED_AUDIO_FORMATS } from '@qvac/inference/surface';
|
|
12
13
|
export { InferenceCancelledError } from './utils/errors-server.js';
|
|
13
14
|
export type { InferenceCancelledPartial } from './utils/errors-server.js';
|
|
14
|
-
export { ContextOverflowError, type ContextOverflowErrorSizes, ModelRegistryModelNotFoundError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
|
|
15
|
-
export {
|
|
15
|
+
export { ContextOverflowError, type ContextOverflowErrorSizes, ModelRegistryModelNotFoundError, ModelRegistryBusyError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError, AudioEncodeFailedError, InvalidSeedFromParamsError, KvCacheSeedSourceNotFoundError, KvCacheSeedSharingDisabledError, SessionIdConflictError, SessionNotOpenError, ModelLeasedError, ModelReconfiguredError, OwnerOnlyError, RAGWorkspaceBusyError } from './utils/errors-server.js';
|
|
16
|
+
export { WorkerCrashedError, WorkerShutdownError, WorkerStartupError, RequestValidationFailedError, StreamEndedError, TextToSpeechStreamFailedError, SessionInvalidatedError, ModelHandleInvalidatedError } from './utils/errors-client.js';
|
|
16
17
|
export { getLogger, SDK_LOG_ID, SDK_ALL_LOG_ID } from './logging/index.js';
|
|
17
18
|
export type { Logger, LogTransport, LoggerOptions } from './logging/index.js';
|
|
18
19
|
export { profiler, attachBackendDiagnostics } from '@qvac/inference/surface';
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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, 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';
|
|
2
|
+
export { batchCompletion, completion, deleteCache, calcTokens, loadModel, downloadAsset, heartbeat, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, embedBatch, 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
|
+
export { openSession } from './client/session.js';
|
|
4
5
|
export { plugins } from './client/plugins-factory.js';
|
|
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';
|
|
6
|
+
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, TTS_PARLER_COREML_COMPUTE_UNITS, TTS_LAVASR_COREML_COMPUTE_UNITS, TTS_SUPERTONIC_PRECISIONS, RAG_ERROR_CODES, VectorIndexStorage, DEFAULT_VECTOR_INDEX_STORAGE, toolSchema, TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools, resolveToolSearchSource, 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, AUDIOGEN_OUTPUT_FORMATS, AUDIOGEN_MINIMAX_COREML_COMPUTE_UNITS, definePlugin, defineHandler, defineDuplexHandler, requestParent, PluginDefinitionInvalidError } from '@qvac/inference/surface';
|
|
6
7
|
// SDK-owned error-code objects: `SDK_CLIENT_ERROR_CODES` holds transport/client
|
|
7
8
|
// codes absent from @qvac/inference, and `SDK_SERVER_ERROR_CODES` carries the
|
|
8
9
|
// client-side error definitions (`addCodes` message registry) that
|
|
@@ -10,7 +11,7 @@ export { VERBOSITY, ASR_BACKEND_IDS, TTS_ENGINES, TTS_PARLER_EMOTIONS, TTS_PACES
|
|
|
10
11
|
export { SDK_CLIENT_ERROR_CODES } from './schemas/sdk-errors-client.js';
|
|
11
12
|
export { SDK_SERVER_ERROR_CODES } from './schemas/sdk-errors-server.js';
|
|
12
13
|
// Built-in plugin ids under the public @qvac/sdk name (see `@/plugin-ids`).
|
|
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
|
+
export { PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_IMAGE_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
15
|
export {} from './utils/tool-helpers.js';
|
|
15
16
|
// Model types - canonical naming with backward-compatible aliases
|
|
16
17
|
export { MODEL_TYPES, ModelType } from '@qvac/inference/surface';
|
|
@@ -37,18 +38,13 @@ export { SUPPORTED_AUDIO_FORMATS } from '@qvac/inference/surface';
|
|
|
37
38
|
// `err instanceof <Class>` works on the consumer side, not just on
|
|
38
39
|
// the worker side.
|
|
39
40
|
export { InferenceCancelledError } from './utils/errors-server.js';
|
|
40
|
-
export { ContextOverflowError, ModelRegistryModelNotFoundError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from './utils/errors-server.js';
|
|
41
|
+
export { ContextOverflowError, ModelRegistryModelNotFoundError, ModelRegistryBusyError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError, AudioEncodeFailedError, InvalidSeedFromParamsError, KvCacheSeedSourceNotFoundError, KvCacheSeedSharingDisabledError, SessionIdConflictError, SessionNotOpenError, ModelLeasedError, ModelReconfiguredError, OwnerOnlyError, RAGWorkspaceBusyError } from './utils/errors-server.js';
|
|
41
42
|
// `WorkerCrashedError` and `WorkerShutdownError` are thrown by the
|
|
42
43
|
// rpc-client life-signal race when the bare worker exits unexpectedly
|
|
43
|
-
// or close()
|
|
44
|
-
// `WorkerStartupError` is the
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// crashed worker from a slow one without parsing the message.
|
|
48
|
-
// `BareRuntimeBinaryNotFoundError` is thrown when the worker fails to
|
|
49
|
-
// spawn because the platform's `bare-runtime-<platform>-<arch>` package is
|
|
50
|
-
// missing (common under pnpm). Exported so consumers can pattern-match with
|
|
51
|
-
// `instanceof`.
|
|
44
|
+
// or close() runs while a caller is in flight.
|
|
45
|
+
// `WorkerStartupError` is thrown when the worker fails to start; its `cause` is
|
|
46
|
+
// the worker's own error, and it carries the exit code or signal of a worker
|
|
47
|
+
// process that exited and whether `rpcInitTimeoutMs` ran out.
|
|
52
48
|
// `StreamEndedError` is raised by the streaming result helpers (upscale, world)
|
|
53
49
|
// when the RPC stream closes without a terminal `done` frame. Exported for the
|
|
54
50
|
// same reason as the rest of this block: matching on it requires the class.
|
|
@@ -56,7 +52,7 @@ export { ContextOverflowError, ModelRegistryModelNotFoundError, RequestIdConflic
|
|
|
56
52
|
// invalid stream/sentenceStream combination, and what the duplex TTS session
|
|
57
53
|
// throws on a write after end — its own JSDoc named it long before it was
|
|
58
54
|
// exported.
|
|
59
|
-
export {
|
|
55
|
+
export { WorkerCrashedError, WorkerShutdownError, WorkerStartupError, RequestValidationFailedError, StreamEndedError, TextToSpeechStreamFailedError, SessionInvalidatedError, ModelHandleInvalidatedError } from './utils/errors-client.js';
|
|
60
56
|
// Logging exports
|
|
61
57
|
export { getLogger, SDK_LOG_ID, SDK_ALL_LOG_ID } from './logging/index.js';
|
|
62
58
|
// Profiler exports
|
|
@@ -65,13 +65,21 @@ export function summarizeRequest(request) {
|
|
|
65
65
|
summary['image'] = `[${img.type}: ${img.value.length} bytes]`;
|
|
66
66
|
return summary;
|
|
67
67
|
}
|
|
68
|
-
if (request.type === 'embed') {
|
|
68
|
+
if (request.type === 'embed' || request.type === 'embedBatch') {
|
|
69
|
+
if (request.input !== undefined) {
|
|
70
|
+
summary['input'] = '[1 embedding input]';
|
|
71
|
+
return summary;
|
|
72
|
+
}
|
|
73
|
+
if (request.inputs !== undefined) {
|
|
74
|
+
summary['inputs'] = `[${request.inputs.length} embedding inputs]`;
|
|
75
|
+
return summary;
|
|
76
|
+
}
|
|
69
77
|
const text = request['text'];
|
|
70
78
|
if (Array.isArray(text)) {
|
|
71
79
|
const totalLen = text.reduce((sum, t) => sum + t.length, 0);
|
|
72
80
|
summary['text'] = `[${text.length} items, ${totalLen} chars]`;
|
|
73
81
|
}
|
|
74
|
-
else if (text.length > 200) {
|
|
82
|
+
else if (text !== undefined && text.length > 200) {
|
|
75
83
|
summary['text'] = `[${text.length} chars]`;
|
|
76
84
|
}
|
|
77
85
|
else {
|
package/dist/src/plugin-ids.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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
3
|
export declare const PLUGIN_RERANK: "@qvac/sdk/llamacpp-rerank/plugin";
|
|
4
|
+
export declare const PLUGIN_IMAGE_EMBEDDING: "@qvac/sdk/ggml-image-embedding/plugin";
|
|
4
5
|
export declare const PLUGIN_EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
|
|
5
6
|
export declare const PLUGIN_WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
|
|
6
7
|
export declare const PLUGIN_BCI: "@qvac/sdk/bci-whispercpp-transcription/plugin";
|
|
@@ -12,6 +13,6 @@ export declare const PLUGIN_DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
|
|
|
12
13
|
export declare const PLUGIN_AUDIOGEN: "@qvac/sdk/audiogen-ggml/plugin";
|
|
13
14
|
export declare const PLUGIN_VLA: "@qvac/sdk/ggml-vla/plugin";
|
|
14
15
|
export declare const PLUGIN_CLASSIFICATION: "@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"];
|
|
16
|
+
export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/ggml-image-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"];
|
|
16
17
|
export type BuiltinPlugin = (typeof SDK_DEFAULT_PLUGINS)[number];
|
|
17
18
|
//# sourceMappingURL=plugin-ids.d.ts.map
|
package/dist/src/plugin-ids.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export const PLUGIN_LLM = '@qvac/sdk/llamacpp-completion/plugin';
|
|
3
3
|
export const PLUGIN_DECISION = '@qvac/sdk/llamacpp-decision/plugin';
|
|
4
4
|
export const PLUGIN_RERANK = '@qvac/sdk/llamacpp-rerank/plugin';
|
|
5
|
+
export const PLUGIN_IMAGE_EMBEDDING = '@qvac/sdk/ggml-image-embedding/plugin';
|
|
5
6
|
export const PLUGIN_EMBEDDING = '@qvac/sdk/llamacpp-embedding/plugin';
|
|
6
7
|
export const PLUGIN_WHISPER = '@qvac/sdk/whispercpp-transcription/plugin';
|
|
7
8
|
export const PLUGIN_BCI = '@qvac/sdk/bci-whispercpp-transcription/plugin';
|
|
@@ -17,6 +18,7 @@ export const PLUGIN_CLASSIFICATION = '@qvac/sdk/ggml-classification/plugin';
|
|
|
17
18
|
export const SDK_DEFAULT_PLUGINS = [
|
|
18
19
|
PLUGIN_LLM,
|
|
19
20
|
PLUGIN_EMBEDDING,
|
|
21
|
+
PLUGIN_IMAGE_EMBEDDING,
|
|
20
22
|
PLUGIN_DECISION,
|
|
21
23
|
PLUGIN_RERANK,
|
|
22
24
|
PLUGIN_WHISPER,
|
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
1
|
+
export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, rerankConfigBaseSchema as llamacppRerankConfigSchema, imageEmbeddingConfigSchema as ggmlImageEmbeddingConfigSchema, type ImageEmbeddingConfig as GgmlImageEmbeddingConfig, 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, rerankConfigBaseSchema as llamacppRerankConfigSchema, modelSrcInputSchema as modelSourceSchema } from '@qvac/inference/surface';
|
|
5
|
+
export { llmConfigBaseSchema as llamacppCompletionConfigSchema, embedConfigBaseSchema as llamacppEmbeddingConfigSchema, decisionConfigBaseSchema as llamacppDecisionConfigSchema, rerankConfigBaseSchema as llamacppRerankConfigSchema, imageEmbeddingConfigSchema as ggmlImageEmbeddingConfigSchema, 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
|