@qvac/sdk 0.21.0 → 0.22.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 +35 -1
- package/README.md +167 -24
- package/dist/examples/abot-world.js +1 -1
- package/dist/examples/advisory-model-fit.d.ts +0 -58
- package/dist/examples/advisory-model-fit.js +23 -150
- package/dist/examples/asr/moss-transcribe-filesystem.d.ts +2 -0
- package/dist/examples/asr/moss-transcribe-filesystem.js +84 -0
- package/dist/examples/asr/moss-transcribe-fit.d.ts +2 -0
- package/dist/examples/asr/moss-transcribe-fit.js +40 -0
- package/dist/examples/asr/nemotron-diarization-filesystem.d.ts +2 -0
- package/dist/examples/asr/nemotron-diarization-filesystem.js +64 -0
- package/dist/examples/asr/parakeet-ctc-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-microphone-record.js +1 -1
- package/dist/examples/asr/parakeet-microphone-stream.js +1 -1
- package/dist/examples/asr/parakeet-nemotron-filesystem.js +3 -3
- package/dist/examples/asr/parakeet-sortformer-streaming.js +2 -2
- package/dist/examples/asr/parakeet-sortformer.js +1 -1
- package/dist/examples/asr/parakeet-tdt-filesystem-chunked.js +2 -2
- package/dist/examples/asr/parakeet-tdt-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-unified-coreml.js +2 -2
- package/dist/examples/asr/parakeet-unified-filesystem.js +2 -2
- package/dist/examples/asr/whispercpp-filesystem-streaming.js +1 -1
- package/dist/examples/asr/whispercpp-filesystem.js +1 -1
- package/dist/examples/asr/whispercpp-microphone-record.js +1 -1
- package/dist/examples/asr/whispercpp-prompt.js +1 -1
- package/dist/examples/assess-model-fit.js +3 -6
- package/dist/examples/audiogen/edit-music.js +2 -2
- package/dist/examples/audiogen/generate-cover.js +2 -2
- package/dist/examples/audiogen/generate-music-minimax.js +1 -1
- package/dist/examples/audiogen/generate-music.js +1 -1
- package/dist/examples/audiogen/understand-music.js +2 -2
- package/dist/examples/batch-completion.d.ts +1 -1
- package/dist/examples/batch-completion.js +1 -1
- package/dist/examples/bci/bci-filesystem-streaming.js +2 -2
- package/dist/examples/bci/bci-filesystem.js +2 -2
- package/dist/examples/concurrent-completion-collision.js +1 -1
- package/dist/examples/config-reload.js +1 -1
- package/dist/examples/decisions.d.ts +2 -0
- package/dist/examples/decisions.js +38 -0
- package/dist/examples/diffusion-esrgan-upscale.js +1 -1
- package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
- package/dist/examples/diffusion-img2img.js +1 -1
- package/dist/examples/diffusion-img2vid-ltx.js +1 -1
- package/dist/examples/diffusion-img2vid-minimax-h3.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-minimax-h3.js +72 -0
- package/dist/examples/diffusion-img2vid.js +1 -1
- package/dist/examples/llamacpp-filesystem.js +1 -1
- package/dist/examples/llamacpp-multi-gpu.js +2 -2
- package/dist/examples/llamacpp-structured-output.js +1 -1
- package/dist/examples/mcp-websearch.d.ts +2 -2
- package/dist/examples/mcp-websearch.js +3 -3
- package/dist/examples/model-fit-ui/server.d.ts +1 -1
- package/dist/examples/model-fit-ui/server.js +1 -1
- package/dist/examples/multi-job-completion.d.ts +1 -1
- package/dist/examples/multi-job-completion.js +1 -1
- package/dist/examples/ocr-fasttext.js +1 -1
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +1 -1
- package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
- package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
- package/dist/examples/tts/llm-to-tts-streaming.d.ts +2 -2
- package/dist/examples/tts/llm-to-tts-streaming.js +2 -2
- package/dist/examples/tts/moss-sound-effect-controls.d.ts +2 -0
- package/dist/examples/tts/moss-sound-effect-controls.js +88 -0
- package/dist/examples/tts/moss-sound-effect.d.ts +2 -0
- package/dist/examples/tts/moss-sound-effect.js +86 -0
- package/dist/examples/tts/moss-speech-audio.d.ts +2 -0
- package/dist/examples/tts/moss-speech-audio.js +159 -0
- package/dist/examples/tts/moss-speech.d.ts +2 -0
- package/dist/examples/tts/moss-speech.js +70 -0
- package/dist/examples/vla-groot.js +2 -2
- package/dist/examples/vla-pi05.js +2 -2
- package/dist/examples/vla-smolvla.js +2 -2
- package/dist/examples/voice-assistant/voice-assistant.js +1 -1
- package/dist/scripts/contract/build-contract.d.ts +3 -1
- package/dist/scripts/contract/build-contract.js +40 -2
- package/dist/scripts/contract/build-model-type-maps.d.ts +6 -1
- package/dist/scripts/contract/build-model-type-maps.js +3 -2
- package/dist/scripts/contract/constants-registry.d.ts +4 -0
- package/dist/scripts/contract/constants-registry.js +3 -1
- package/dist/scripts/contract/method-shapes.d.ts +1 -0
- package/dist/scripts/contract/method-shapes.js +1 -0
- package/dist/scripts/export-contract.js +20 -7
- package/dist/scripts/run-unit-tests.js +10 -5
- package/dist/src/client/api/assess-model-fit.d.ts +5 -5
- package/dist/src/client/api/assess-model-fit.js +5 -6
- package/dist/src/client/api/audio-edit.d.ts +14 -2
- package/dist/src/client/api/audio-edit.js +14 -2
- package/dist/src/client/api/audio-gen.d.ts +10 -2
- package/dist/src/client/api/audio-gen.js +10 -2
- package/dist/src/client/api/audio-understand.d.ts +1 -1
- package/dist/src/client/api/audio-understand.js +1 -1
- package/dist/src/client/api/batch-completion.js +1 -1
- package/dist/src/client/api/completion-stream.js +1 -1
- package/dist/src/client/api/decide.d.ts +31 -0
- package/dist/src/client/api/decide.js +29 -0
- package/dist/src/client/api/index.d.ts +1 -0
- package/dist/src/client/api/index.js +1 -0
- package/dist/src/client/api/load-model.d.ts +1 -0
- package/dist/src/client/api/text-to-speech.d.ts +1 -0
- package/dist/src/client/api/text-to-speech.js +15 -22
- package/dist/src/client/api/transcribe.js +5 -2
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +23 -3
- package/dist/src/client/api/video.js +23 -3
- package/dist/src/commands/bundle/bare-pack.d.ts +8 -0
- package/dist/src/commands/bundle/bare-pack.js +28 -5
- package/dist/src/commands/bundle/constants.js +2 -0
- package/dist/src/commands/bundle/index.d.ts +7 -6
- package/dist/src/commands/bundle/index.js +126 -43
- package/dist/src/commands/bundle/manifest.d.ts +2 -0
- package/dist/src/commands/bundle/manifest.js +3 -2
- package/dist/src/commands/host-prebuilds/index.d.ts +15 -7
- package/dist/src/commands/host-prebuilds/index.js +35 -16
- package/dist/src/commands/index.d.ts +1 -1
- package/dist/src/commands/index.js +1 -1
- package/dist/src/commands/verify/addon-source.d.ts +12 -0
- package/dist/src/commands/verify/addon-source.js +36 -3
- package/dist/src/commands/verify/bare-kit-runtimes.js +2 -1
- package/dist/src/commands/verify/node-modules-source.js +10 -1
- package/dist/src/{expo/plugins/patches/qvac-platform-addons.d.ts → commands/verify/platform-addons.d.ts} +6 -10
- package/dist/src/{expo/plugins/patches/qvac-platform-addons.js → commands/verify/platform-addons.js} +2 -45
- package/dist/src/commands/verify/prebuilds.d.ts +7 -10
- package/dist/src/commands/verify/prebuilds.js +43 -34
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/link-addons.d.ts +18 -0
- package/dist/src/expo/plugins/link-addons.js +65 -0
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withMobileBundle.d.ts +11 -21
- package/dist/src/expo/plugins/withMobileBundle.js +22 -112
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +2 -2
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +1 -1
- package/dist/src/pear/pre.js +2 -0
- package/dist/src/plugin-ids.d.ts +3 -1
- package/dist/src/plugin-ids.js +4 -0
- package/dist/src/schemas/public.d.ts +2 -1
- package/dist/src/schemas/public.js +2 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +3 -0
- package/dist/src/schemas/sdk-errors-client.js +16 -0
- package/dist/src/schemas/sdk-errors-server.d.ts +1 -0
- package/dist/src/schemas/sdk-errors-server.js +5 -0
- package/dist/src/utils/errors-client.d.ts +10 -0
- package/dist/src/utils/errors-client.js +18 -0
- package/dist/src/utils/mcp-adapter.js +12 -8
- package/dist/src/utils/tool-helpers.d.ts +1 -1
- package/dist/src/utils/tool-helpers.js +20 -52
- package/dist/src/worker/create-server.d.ts +1 -0
- package/dist/src/worker/create-server.js +5 -0
- package/dist/src/worker/index.js +4 -0
- package/dist/src/worker/lifecycle.js +9 -1
- package/dist/src/worker/plugins/llamacpp-decision.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-decision.js +1 -0
- package/dist/src/worker/plugins/moss-transcribe.d.ts +2 -0
- package/dist/src/worker/plugins/moss-transcribe.js +1 -0
- package/package.json +39 -35
- package/src/electron-forge/index.cjs +12 -71
- package/dist/scripts/link-workspace-inference.d.ts +0 -2
- package/dist/scripts/link-workspace-inference.js +0 -31
- package/src/expo/plugins/patches/android-link.mjs +0 -67
- package/src/expo/plugins/patches/ios-link.mjs +0 -67
- package/src/expo/plugins/patches/qvac-platform-addons.ts +0 -124
|
@@ -1,49 +1,54 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { formatAddonId } from './addon-source.js';
|
|
4
|
-
import { HOST_ADDON_IMPORT, resolveAddonPlatformPackage } from '
|
|
4
|
+
import { HOST_ADDON_IMPORT, resolveAddonPlatformPackage } from './platform-addons.js';
|
|
5
5
|
/** Platforms no install host reports, so their platform packages must be declared. */
|
|
6
6
|
const MOBILE_PLATFORMS = new Set(['android', 'ios']);
|
|
7
7
|
export function isMobileHost(host) {
|
|
8
8
|
return MOBILE_PLATFORMS.has(host.split('-')[0] ?? '');
|
|
9
9
|
}
|
|
10
10
|
const PREBUILDS_DIR = 'prebuilds';
|
|
11
|
-
const
|
|
11
|
+
const INNER_ADDON_DIR = 'addon';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Where an addon's `<host>` prebuild may live:
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* A local `prebuilds/` always wins, matching the precedence the addons apply
|
|
23
|
-
* in their own `binding.js` (`require.addon()` first, platform package second).
|
|
15
|
+
* - `<packageRoot>/prebuilds/<host>` for an ordinary addon, including the
|
|
16
|
+
* per-platform packages themselves.
|
|
17
|
+
* - For a split addon, the platform package its `#host-addon` map names for
|
|
18
|
+
* this host: `<platformRoot>/prebuilds/<host>` when that package is an
|
|
19
|
+
* addon, `<platformRoot>/addon/prebuilds/<host>` when it wraps an inner
|
|
20
|
+
* addon. Empty when the package is not installed.
|
|
24
21
|
*/
|
|
25
22
|
export async function resolvePrebuildLocations(addon, host) {
|
|
26
|
-
const locations = [
|
|
27
|
-
{ hostDir: path.join(addon.packageRoot, PREBUILDS_DIR, host) }
|
|
28
|
-
];
|
|
29
23
|
const platformPackage = await platformPackageForHost(addon, host);
|
|
30
|
-
if (platformPackage === null)
|
|
31
|
-
return
|
|
24
|
+
if (platformPackage === null) {
|
|
25
|
+
return [{ hostDir: path.join(addon.packageRoot, PREBUILDS_DIR, host) }];
|
|
26
|
+
}
|
|
32
27
|
const platformRoot = await findInstalledPackage(await realPackageRoot(addon.packageRoot), platformPackage);
|
|
33
|
-
if (platformRoot
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
if (platformRoot === null)
|
|
29
|
+
return [];
|
|
30
|
+
const manifest = await readPackageManifest(platformRoot);
|
|
31
|
+
const addonRoot = manifest?.addon === true ? platformRoot : path.join(platformRoot, INNER_ADDON_DIR);
|
|
32
|
+
const location = {
|
|
33
|
+
hostDir: path.join(addonRoot, PREBUILDS_DIR, host),
|
|
34
|
+
platformPackage
|
|
35
|
+
};
|
|
36
|
+
const installedVersion = manifest?.version;
|
|
37
|
+
if (addon.version !== undefined &&
|
|
38
|
+
installedVersion !== undefined &&
|
|
39
|
+
installedVersion !== addon.version) {
|
|
40
|
+
location.mismatchedVersion = installedVersion;
|
|
41
|
+
}
|
|
42
|
+
if (addonRoot !== platformRoot) {
|
|
43
|
+
const nestedVersion = (await readPackageManifest(addonRoot))?.version;
|
|
44
|
+
if (location.mismatchedVersion === undefined &&
|
|
45
|
+
addon.version !== undefined &&
|
|
46
|
+
nestedVersion !== undefined &&
|
|
47
|
+
nestedVersion !== addon.version) {
|
|
48
|
+
location.mismatchedVersion = nestedVersion;
|
|
43
49
|
}
|
|
44
|
-
locations.push(location);
|
|
45
50
|
}
|
|
46
|
-
return
|
|
51
|
+
return [location];
|
|
47
52
|
}
|
|
48
53
|
/**
|
|
49
54
|
* The directory the addon really lives in. Under pnpm's isolated layout
|
|
@@ -101,9 +106,11 @@ async function anyLocationHasPrebuild(locations) {
|
|
|
101
106
|
return false;
|
|
102
107
|
}
|
|
103
108
|
function describeMissingPrebuild(addon, host, locations, platformPackage, platformLocation) {
|
|
104
|
-
const expected = locations.
|
|
109
|
+
const expected = locations.length > 0
|
|
110
|
+
? locations.map((location) => path.join(location.hostDir, '*.bare')).join(' or ')
|
|
111
|
+
: `${platformPackage ?? addon.name} to be installed with ${path.join(PREBUILDS_DIR, host, '*.bare')}`;
|
|
105
112
|
return (`${formatAddonId(addon)} is missing a prebuild for ${host} ` +
|
|
106
|
-
`(expected ${expected
|
|
113
|
+
`(expected ${expected}).` +
|
|
107
114
|
missingPlatformPackageHint(addon, platformPackage, platformLocation));
|
|
108
115
|
}
|
|
109
116
|
function missingPlatformPackageHint(addon, platformPackage, platformLocation) {
|
|
@@ -123,13 +130,15 @@ function missingPlatformPackageHint(addon, platformPackage, platformLocation) {
|
|
|
123
130
|
async function platformPackageForHost(addon, host) {
|
|
124
131
|
return resolveAddonPlatformPackage(addon.name, await readHostAddonMap(addon), host);
|
|
125
132
|
}
|
|
126
|
-
async function
|
|
133
|
+
async function readPackageManifest(packageRoot) {
|
|
127
134
|
try {
|
|
128
135
|
const parsed = JSON.parse(await fsp.readFile(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
129
136
|
if (typeof parsed !== 'object' || parsed === null)
|
|
130
137
|
return undefined;
|
|
131
|
-
const version = parsed
|
|
132
|
-
return typeof version === 'string'
|
|
138
|
+
const { version, addon } = parsed;
|
|
139
|
+
return typeof version === 'string'
|
|
140
|
+
? { version, addon: addon === true }
|
|
141
|
+
: { addon: addon === true };
|
|
133
142
|
}
|
|
134
143
|
catch {
|
|
135
144
|
return undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Logger } from '../../logging/types.js';
|
|
2
|
+
export interface LinkAddonsOptions {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
entryPath: string;
|
|
5
|
+
hosts: string[];
|
|
6
|
+
logger: Logger;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Links the native addons the worker entry loads into react-native-bare-kit
|
|
10
|
+
* for each phone platform in `hosts`, replacing what the platform had.
|
|
11
|
+
*/
|
|
12
|
+
export declare function linkAddons(options: LinkAddonsOptions): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Addons that ship a library under the same name write it to the same path,
|
|
15
|
+
* and the copy linked last is the one the app loads.
|
|
16
|
+
*/
|
|
17
|
+
export declare function warnOverwritten(written: string[], out: string, logger: Logger): void;
|
|
18
|
+
//# sourceMappingURL=link-addons.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { promises as fsp } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import link from 'bare-link';
|
|
4
|
+
import { findInAncestorNodeModules } from './find-in-ancestor-node-modules.js';
|
|
5
|
+
import { AddonLinkFailedError } from '../../utils/errors-client.js';
|
|
6
|
+
/** Where react-native-bare-kit builds each platform's linked addons from. */
|
|
7
|
+
const PLATFORMS = [
|
|
8
|
+
{ prefix: 'android-', out: ['android', 'src', 'main', 'addons'] },
|
|
9
|
+
{ prefix: 'ios-', out: ['ios', 'addons'] }
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Links the native addons the worker entry loads into react-native-bare-kit
|
|
13
|
+
* for each phone platform in `hosts`, replacing what the platform had.
|
|
14
|
+
*/
|
|
15
|
+
export async function linkAddons(options) {
|
|
16
|
+
const { projectRoot, entryPath, hosts, logger } = options;
|
|
17
|
+
const bareKitDir = findInAncestorNodeModules(projectRoot, 'react-native-bare-kit');
|
|
18
|
+
if (bareKitDir === null) {
|
|
19
|
+
logger.warn('react-native-bare-kit is not installed; the native addons were not linked.');
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
const written = [];
|
|
23
|
+
for (const platform of PLATFORMS) {
|
|
24
|
+
const platformHosts = hosts.filter((host) => host.startsWith(platform.prefix));
|
|
25
|
+
if (platformHosts.length === 0)
|
|
26
|
+
continue;
|
|
27
|
+
// bare-link signs Apple frameworks with codesign.
|
|
28
|
+
if (platform.prefix === 'ios-' && process.platform !== 'darwin') {
|
|
29
|
+
logger.warn(`Linking iOS addons needs macOS; skipped ${platformHosts.join(', ')}.`);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const out = path.join(bareKitDir, ...platform.out);
|
|
33
|
+
await fsp.rm(out, { recursive: true, force: true });
|
|
34
|
+
const platformWritten = [];
|
|
35
|
+
try {
|
|
36
|
+
for await (const resource of link(entryPath, { hosts: platformHosts, out })) {
|
|
37
|
+
logger.debug(`Linked ${path.relative(projectRoot, resource)}`);
|
|
38
|
+
platformWritten.push(resource);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new AddonLinkFailedError(platformHosts, error);
|
|
43
|
+
}
|
|
44
|
+
warnOverwritten(platformWritten, out, logger);
|
|
45
|
+
written.push(...platformWritten);
|
|
46
|
+
}
|
|
47
|
+
return written;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Addons that ship a library under the same name write it to the same path,
|
|
51
|
+
* and the copy linked last is the one the app loads.
|
|
52
|
+
*/
|
|
53
|
+
export function warnOverwritten(written, out, logger) {
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
const overwritten = new Set();
|
|
56
|
+
for (const file of written) {
|
|
57
|
+
if (seen.has(file))
|
|
58
|
+
overwritten.add(file);
|
|
59
|
+
seen.add(file);
|
|
60
|
+
}
|
|
61
|
+
if (overwritten.size === 0)
|
|
62
|
+
return;
|
|
63
|
+
const files = [...overwritten].map((file) => path.relative(out, file)).sort();
|
|
64
|
+
logger.warn(`Several native addons ship ${files.join(', ')}; only the copy linked last is kept.`);
|
|
65
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
|
-
import type { ExpoConfig } from 'expo/config';
|
|
2
|
+
import type { ExpoConfig } from 'expo/config/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Desktop-only spawn path, deferred so bare-pack does not walk `bare-process`
|
|
5
5
|
* -> `bare-posix` (no `android-arm64` prebuild). Mobile runs the engine fitter
|
|
@@ -10,35 +10,25 @@ type MobilePlatform = 'android' | 'ios';
|
|
|
10
10
|
declare const MOBILE_HOSTS_BY_PLATFORM: Record<MobilePlatform, string[]>;
|
|
11
11
|
/** Every mobile host, in platform order. The bundle covers all of them. */
|
|
12
12
|
declare const MOBILE_HOSTS: string[];
|
|
13
|
-
type BareKitLinkerPaths = {
|
|
14
|
-
android: string | null;
|
|
15
|
-
ios: string | null;
|
|
16
|
-
};
|
|
17
13
|
type MobileBundleOptions = {
|
|
18
14
|
/**
|
|
19
|
-
* Install the
|
|
20
|
-
*
|
|
21
|
-
*
|
|
15
|
+
* Install the platform packages the app's split addons need for every
|
|
16
|
+
* mobile host the bundle covers (both platforms: the bundle is shared) with
|
|
17
|
+
* the app's package manager, pinned in package.json. Off by default:
|
|
18
|
+
* `expo prebuild` then fails and names each package to add.
|
|
22
19
|
*/
|
|
23
20
|
installMissingPrebuilds?: boolean;
|
|
24
21
|
};
|
|
25
22
|
/**
|
|
26
|
-
* Expo plugin:
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
23
|
+
* Expo plugin: bundles the worker for every mobile host, verifies it for the
|
|
24
|
+
* platform being prebuilt, copies it to `<sdkPackageDir>/dist/worker.mobile.bundle.js`,
|
|
25
|
+
* and links the native addons it loads into react-native-bare-kit. Uses
|
|
26
|
+
* `qvac.config.*` if present.
|
|
30
27
|
*/
|
|
31
28
|
declare function withMobileBundle(config: ExpoConfig, options?: MobileBundleOptions): ExpoConfig;
|
|
32
29
|
declare function buildMobileBundle<T extends configPlugins.ExportedConfigWithProps<unknown>>(config: T, options: MobileBundleOptions): Promise<T>;
|
|
33
30
|
declare function mobileHostsForPlatform(platform: string): string[];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Patches react-native-bare-kit linkers to use the addons manifest and returns
|
|
38
|
-
* the paths for each platform that was successfully patched.
|
|
39
|
-
*/
|
|
40
|
-
declare function patchBareKitLinkers(projectRoot: string, qvacSdkPath: string): BareKitLinkerPaths;
|
|
41
|
-
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, MOBILE_UNSUPPORTED_MODULES, buildMobileBundle, mobileHostsForPlatform, patchBareKitLinkers, runIOSAddonLinker };
|
|
42
|
-
export type { BareKitLinkerPaths, MobileBundleOptions, MobilePlatform };
|
|
31
|
+
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, MOBILE_UNSUPPORTED_MODULES, buildMobileBundle, mobileHostsForPlatform };
|
|
32
|
+
export type { MobileBundleOptions, MobilePlatform };
|
|
43
33
|
export default withMobileBundle;
|
|
44
34
|
//# sourceMappingURL=withMobileBundle.d.ts.map
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
2
|
import * as fs from 'fs';
|
|
4
3
|
import * as path from 'path';
|
|
5
|
-
import { execPath } from 'process';
|
|
6
4
|
import { bundleSdk, verifyBundle, hasErrors, formatVerifyBundleResult } from '../../commands/index.js';
|
|
7
5
|
import { createCommandLogger } from '../../commands/command-logger.js';
|
|
8
|
-
import { installMissingHostPrebuilds } from '../../commands/host-prebuilds/index.js';
|
|
9
|
-
import { collectAddonsFromBundle } from '../../commands/verify/bundle-source.js';
|
|
10
6
|
import { CONFIG_CANDIDATES } from '../../client/config-loader/resolve-config.node.js';
|
|
11
7
|
import { resolveSDKPackageDir } from './resolve-sdk-package-dir.js';
|
|
12
8
|
import { getProjectRootFromMod } from './get-project-root.js';
|
|
13
|
-
import {
|
|
9
|
+
import { linkAddons } from './link-addons.js';
|
|
14
10
|
import { BundleVerificationFailedError } from '../../utils/errors-client.js';
|
|
15
11
|
const { withDangerousMod } = configPlugins;
|
|
16
12
|
/** Modules to defer from mobile bundles (not available at bundle time) */
|
|
@@ -25,15 +21,13 @@ const MOBILE_HOSTS_BY_PLATFORM = {
|
|
|
25
21
|
android: ['android-arm64'],
|
|
26
22
|
ios: ['ios-arm64', 'ios-arm64-simulator', 'ios-x64-simulator']
|
|
27
23
|
};
|
|
28
|
-
/** Compiled resolver copied beside each patched linker as this filename. */
|
|
29
|
-
const PLATFORM_ADDON_RESOLVER = 'qvac-platform-addons.mjs';
|
|
30
24
|
/** Every mobile host, in platform order. The bundle covers all of them. */
|
|
31
25
|
const MOBILE_HOSTS = [...MOBILE_HOSTS_BY_PLATFORM.android, ...MOBILE_HOSTS_BY_PLATFORM.ios];
|
|
32
26
|
/**
|
|
33
|
-
* Expo plugin:
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
27
|
+
* Expo plugin: bundles the worker for every mobile host, verifies it for the
|
|
28
|
+
* platform being prebuilt, copies it to `<sdkPackageDir>/dist/worker.mobile.bundle.js`,
|
|
29
|
+
* and links the native addons it loads into react-native-bare-kit. Uses
|
|
30
|
+
* `qvac.config.*` if present.
|
|
37
31
|
*/
|
|
38
32
|
function withMobileBundle(config, options = {}) {
|
|
39
33
|
config = withDangerousMod(config, ['android', (mod) => buildMobileBundle(mod, options)]);
|
|
@@ -61,38 +55,18 @@ async function buildMobileBundle(config, options) {
|
|
|
61
55
|
// for every mobile host: a dual-platform `expo prebuild` runs this mod twice
|
|
62
56
|
// and the second run would otherwise overwrite the first platform's bundle
|
|
63
57
|
// with one that resolved the other platform's conditions.
|
|
64
|
-
const
|
|
65
|
-
let linkerPaths = await bundle();
|
|
58
|
+
const entryPath = await runBundler(projectRoot, sdkPackage.dir, configPath, deferredModules, MOBILE_HOSTS, options.installMissingPrebuilds === true);
|
|
66
59
|
const generatedBundle = path.join(projectRoot, 'qvac', 'worker.bundle.js');
|
|
67
|
-
if (options.installMissingPrebuilds === true) {
|
|
68
|
-
// Take the addons from the bundle graph, which records where each linked
|
|
69
|
-
// addon really is; looking their names up in the project would miss the
|
|
70
|
-
// SDK's addons under pnpm or bun's isolated layout.
|
|
71
|
-
const { installed } = await installMissingHostPrebuilds({
|
|
72
|
-
projectRoot,
|
|
73
|
-
hosts: platformHosts,
|
|
74
|
-
addons: await collectAddonsFromBundle({
|
|
75
|
-
bundlePath: generatedBundle,
|
|
76
|
-
projectRoot,
|
|
77
|
-
hosts: platformHosts
|
|
78
|
-
}),
|
|
79
|
-
quiet: false,
|
|
80
|
-
logger: createCommandLogger({})
|
|
81
|
-
});
|
|
82
|
-
if (installed.length > 0) {
|
|
83
|
-
const names = installed.map((pkg) => `${pkg.name}@${pkg.version}`).join(', ');
|
|
84
|
-
console.log(`📦 QVAC: Installed addon platform packages: ${names}`);
|
|
85
|
-
// bare-pack resolved `#host-addon` to the addon's fallback module for
|
|
86
|
-
// hosts whose platform package was missing.
|
|
87
|
-
linkerPaths = await bundle();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
60
|
await runVerifier(projectRoot, generatedBundle, configPath, platformHosts);
|
|
91
61
|
fs.copyFileSync(generatedBundle, outputPath);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
62
|
+
const linked = await linkAddons({
|
|
63
|
+
projectRoot,
|
|
64
|
+
entryPath,
|
|
65
|
+
hosts: platformHosts,
|
|
66
|
+
logger: createCommandLogger({})
|
|
67
|
+
});
|
|
68
|
+
console.log(`🔗 QVAC: Linked ${linked.length} native addon files for ${platformHosts.join(', ')}`);
|
|
69
|
+
console.log('🫡 QVAC: Mobile bundle generated, verified and linked');
|
|
96
70
|
return config;
|
|
97
71
|
}
|
|
98
72
|
function mobileHostsForPlatform(platform) {
|
|
@@ -123,87 +97,23 @@ async function runVerifier(projectRoot, generatedBundle, configPath, hosts) {
|
|
|
123
97
|
throw new BundleVerificationFailedError(generatedBundle, new Error(formatVerifyBundleResult(result)));
|
|
124
98
|
}
|
|
125
99
|
}
|
|
126
|
-
async function runBundler(projectRoot, qvacSdkPath, configPath, deferredModules, hosts) {
|
|
127
|
-
const
|
|
128
|
-
await bundleSdk({
|
|
100
|
+
async function runBundler(projectRoot, qvacSdkPath, configPath, deferredModules, hosts, installMissingPrebuilds) {
|
|
101
|
+
const result = await bundleSdk({
|
|
129
102
|
projectRoot,
|
|
130
103
|
sdkPath: qvacSdkPath,
|
|
131
104
|
...(configPath ? { configPath } : {}),
|
|
132
105
|
hosts,
|
|
133
106
|
defer: deferredModules,
|
|
134
107
|
quiet: true,
|
|
108
|
+
installMissingPrebuilds,
|
|
135
109
|
// runVerifier checks engines.bare right after, with progress output.
|
|
136
110
|
checkEngines: false
|
|
137
111
|
});
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async function runIOSAddonLinker(linkerPath) {
|
|
142
|
-
await new Promise((resolve, reject) => {
|
|
143
|
-
const proc = spawn(execPath, [linkerPath], {
|
|
144
|
-
stdio: ['ignore', 'inherit', 'pipe']
|
|
145
|
-
});
|
|
146
|
-
let stderr = '';
|
|
147
|
-
proc.stderr.setEncoding('utf8');
|
|
148
|
-
proc.stderr.on('data', (chunk) => {
|
|
149
|
-
stderr += chunk;
|
|
150
|
-
});
|
|
151
|
-
proc.on('close', (code) => {
|
|
152
|
-
if (code === 0) {
|
|
153
|
-
resolve();
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const details = stderr.trim();
|
|
157
|
-
reject(new Error(`QVAC: iOS native addon linker exited with code ${code ?? 1}${details ? `: ${details}` : ''}`));
|
|
158
|
-
});
|
|
159
|
-
proc.on('error', reject);
|
|
160
|
-
});
|
|
161
|
-
console.log('✅ QVAC: Refreshed iOS native addons from the generated manifest');
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Patches react-native-bare-kit linkers to use the addons manifest and returns
|
|
165
|
-
* the paths for each platform that was successfully patched.
|
|
166
|
-
*/
|
|
167
|
-
function patchBareKitLinkers(projectRoot, qvacSdkPath) {
|
|
168
|
-
const bareKitPath = findInAncestorNodeModules(projectRoot, 'react-native-bare-kit');
|
|
169
|
-
if (bareKitPath === null) {
|
|
170
|
-
console.warn('⚠️ QVAC: react-native-bare-kit not found in any ancestor node_modules, ' +
|
|
171
|
-
'skipping linker patch. The bundle will link all native addons ' +
|
|
172
|
-
'rather than only those required by your bundle.');
|
|
173
|
-
return { android: null, ios: null };
|
|
174
|
-
}
|
|
175
|
-
const patchesDir = path.join(qvacSdkPath, 'src', 'expo', 'plugins', 'patches');
|
|
176
|
-
const resolver = compiledPlatformAddonResolver(qvacSdkPath);
|
|
177
|
-
if (!fs.existsSync(patchesDir)) {
|
|
178
|
-
console.log(`⚠️ QVAC: patches directory not found (${patchesDir}), skipping linker patch`);
|
|
179
|
-
return { android: null, ios: null };
|
|
180
|
-
}
|
|
181
|
-
return {
|
|
182
|
-
android: copyLinkerPatch(patchesDir, resolver, path.join(bareKitPath, 'android'), 'android-link.mjs'),
|
|
183
|
-
ios: copyLinkerPatch(patchesDir, resolver, path.join(bareKitPath, 'ios'), 'ios-link.mjs')
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Copies one linker patch and the split-addon resolver it imports, returning the
|
|
188
|
-
* installed linker path. The resolver has to sit beside the linker: the patch is
|
|
189
|
-
* installed into react-native-bare-kit and imports it relatively.
|
|
190
|
-
*/
|
|
191
|
-
function copyLinkerPatch(patchesDir, resolver, targetDir, patchName) {
|
|
192
|
-
const patch = path.join(patchesDir, patchName);
|
|
193
|
-
if (!fs.existsSync(patch) || !fs.existsSync(resolver)) {
|
|
194
|
-
// Installing the patch without the resolver it imports would break linking
|
|
195
|
-
// outright, so leave the stock linker in place instead.
|
|
196
|
-
console.log(`⚠️ QVAC: linker patch incomplete (${patch}), leaving the stock linker`);
|
|
197
|
-
return null;
|
|
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}`);
|
|
198
115
|
}
|
|
199
|
-
|
|
200
|
-
fs.copyFileSync(patch, target);
|
|
201
|
-
fs.copyFileSync(resolver, path.join(targetDir, PLATFORM_ADDON_RESOLVER));
|
|
202
|
-
console.log(`✅ QVAC: Patched ${path.basename(targetDir)}/link.mjs for manifest-aware linking`);
|
|
203
|
-
return target;
|
|
204
|
-
}
|
|
205
|
-
function compiledPlatformAddonResolver(qvacSdkPath) {
|
|
206
|
-
return path.join(qvacSdkPath, 'dist', 'src', 'expo', 'plugins', 'patches', 'qvac-platform-addons.js');
|
|
116
|
+
return result.entryPaths.worker;
|
|
207
117
|
}
|
|
208
|
-
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, MOBILE_UNSUPPORTED_MODULES, buildMobileBundle, mobileHostsForPlatform
|
|
118
|
+
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, MOBILE_UNSUPPORTED_MODULES, buildMobileBundle, mobileHostsForPlatform };
|
|
209
119
|
export default withMobileBundle;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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, 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, 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 TranscribeStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, 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 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 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 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 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_WHISPER, PLUGIN_BCI, 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_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';
|
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, 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, 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_WHISPER, PLUGIN_BCI, 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_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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import QvacLogger, {} from '@qvac/logging';
|
|
2
|
-
import { LOG_LEVELS } from '@qvac/logging/constants';
|
|
2
|
+
import { LOG_LEVELS } from '@qvac/logging/constants.js';
|
|
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';
|
|
1
|
+
import { LEVEL_PRIORITIES, LOG_LEVELS } from '@qvac/logging/constants.js';
|
|
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),
|
package/dist/src/pear/pre.js
CHANGED
|
@@ -30,6 +30,7 @@ const CONFIG_CANDIDATES = [
|
|
|
30
30
|
const BUILTIN_PLUGINS = [
|
|
31
31
|
'@qvac/sdk/llamacpp-completion/plugin',
|
|
32
32
|
'@qvac/sdk/llamacpp-embedding/plugin',
|
|
33
|
+
'@qvac/sdk/llamacpp-decision/plugin',
|
|
33
34
|
'@qvac/sdk/whispercpp-transcription/plugin',
|
|
34
35
|
'@qvac/sdk/bci-whispercpp-transcription/plugin',
|
|
35
36
|
'@qvac/sdk/nmtcpp-translation/plugin',
|
|
@@ -43,6 +44,7 @@ const BUILTIN_PLUGINS = [
|
|
|
43
44
|
const BUILTIN_PLUGIN_EXPORTS = {
|
|
44
45
|
'llamacpp-completion': 'llmPlugin',
|
|
45
46
|
'llamacpp-embedding': 'embeddingsPlugin',
|
|
47
|
+
'llamacpp-decision': 'decisionPlugin',
|
|
46
48
|
'whispercpp-transcription': 'whisperPlugin',
|
|
47
49
|
'bci-whispercpp-transcription': 'bciPlugin',
|
|
48
50
|
'nmtcpp-translation': 'nmtPlugin',
|
package/dist/src/plugin-ids.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare const PLUGIN_LLM: "@qvac/sdk/llamacpp-completion/plugin";
|
|
2
|
+
export declare const PLUGIN_DECISION: "@qvac/sdk/llamacpp-decision/plugin";
|
|
2
3
|
export declare const PLUGIN_EMBEDDING: "@qvac/sdk/llamacpp-embedding/plugin";
|
|
3
4
|
export declare const PLUGIN_WHISPER: "@qvac/sdk/whispercpp-transcription/plugin";
|
|
4
5
|
export declare const PLUGIN_BCI: "@qvac/sdk/bci-whispercpp-transcription/plugin";
|
|
6
|
+
export declare const PLUGIN_MOSS_TRANSCRIBE: "@qvac/sdk/moss-transcribe/plugin";
|
|
5
7
|
export declare const PLUGIN_NMT: "@qvac/sdk/nmtcpp-translation/plugin";
|
|
6
8
|
export declare const PLUGIN_TTS: "@qvac/sdk/tts-ggml/plugin";
|
|
7
9
|
export declare const PLUGIN_OCR: "@qvac/sdk/ggml-ocr/plugin";
|
|
@@ -9,6 +11,6 @@ export declare const PLUGIN_DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
|
|
|
9
11
|
export declare const PLUGIN_AUDIOGEN: "@qvac/sdk/audiogen-ggml/plugin";
|
|
10
12
|
export declare const PLUGIN_VLA: "@qvac/sdk/ggml-vla/plugin";
|
|
11
13
|
export declare const PLUGIN_CLASSIFICATION: "@qvac/sdk/ggml-classification/plugin";
|
|
12
|
-
export declare const SDK_DEFAULT_PLUGINS: readonly ["@qvac/sdk/llamacpp-completion/plugin", "@qvac/sdk/llamacpp-embedding/plugin", "@qvac/sdk/whispercpp-transcription/plugin", "@qvac/sdk/bci-whispercpp-transcription/plugin", "@qvac/sdk/parakeet-transcription/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"];
|
|
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"];
|
|
13
15
|
export type BuiltinPlugin = (typeof SDK_DEFAULT_PLUGINS)[number];
|
|
14
16
|
//# sourceMappingURL=plugin-ids.d.ts.map
|
package/dist/src/plugin-ids.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Built-in plugin ids under the public @qvac/sdk name.
|
|
2
2
|
export const PLUGIN_LLM = '@qvac/sdk/llamacpp-completion/plugin';
|
|
3
|
+
export const PLUGIN_DECISION = '@qvac/sdk/llamacpp-decision/plugin';
|
|
3
4
|
export const PLUGIN_EMBEDDING = '@qvac/sdk/llamacpp-embedding/plugin';
|
|
4
5
|
export const PLUGIN_WHISPER = '@qvac/sdk/whispercpp-transcription/plugin';
|
|
5
6
|
export const PLUGIN_BCI = '@qvac/sdk/bci-whispercpp-transcription/plugin';
|
|
7
|
+
export const PLUGIN_MOSS_TRANSCRIBE = '@qvac/sdk/moss-transcribe/plugin';
|
|
6
8
|
const PLUGIN_PARAKEET = '@qvac/sdk/parakeet-transcription/plugin';
|
|
7
9
|
export const PLUGIN_NMT = '@qvac/sdk/nmtcpp-translation/plugin';
|
|
8
10
|
export const PLUGIN_TTS = '@qvac/sdk/tts-ggml/plugin';
|
|
@@ -14,9 +16,11 @@ export const PLUGIN_CLASSIFICATION = '@qvac/sdk/ggml-classification/plugin';
|
|
|
14
16
|
export const SDK_DEFAULT_PLUGINS = [
|
|
15
17
|
PLUGIN_LLM,
|
|
16
18
|
PLUGIN_EMBEDDING,
|
|
19
|
+
PLUGIN_DECISION,
|
|
17
20
|
PLUGIN_WHISPER,
|
|
18
21
|
PLUGIN_BCI,
|
|
19
22
|
PLUGIN_PARAKEET,
|
|
23
|
+
PLUGIN_MOSS_TRANSCRIBE,
|
|
20
24
|
PLUGIN_NMT,
|
|
21
25
|
PLUGIN_TTS,
|
|
22
26
|
PLUGIN_OCR,
|