@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
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { send } from '../../client/rpc/rpc-client.js';
|
|
2
2
|
import { DEFAULT_VECTOR_INDEX_STORAGE, findVectorRowLengthMismatch, toWireVectorIds } from '@qvac/inference/surface';
|
|
3
3
|
import { InvalidOperationError, InvalidResponseError, RequestValidationFailedError } from '../../utils/errors-client.js';
|
|
4
|
+
import { decoratePromise } from '../../utils/decorate-promise.js';
|
|
5
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
4
6
|
/**
|
|
5
7
|
* Builds the two public functions over a transport. The default export pair
|
|
6
|
-
* below binds them to the RPC client;
|
|
8
|
+
* below binds them to the RPC client; a session binds them to its own
|
|
9
|
+
* stamped transport, and tests bind a fake.
|
|
7
10
|
*/
|
|
8
11
|
export function createVectorIndexClient(transport) {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
// Every operation is sent under a client-minted id, so a pending one can be
|
|
13
|
+
// cancelled by id before it settles.
|
|
14
|
+
async function call(request, requestId, options) {
|
|
15
|
+
const response = await transport({ ...request, requestId }, options);
|
|
11
16
|
if (response.type !== 'vectorIndex') {
|
|
12
17
|
throw new InvalidResponseError('vectorIndex');
|
|
13
18
|
}
|
|
@@ -16,9 +21,15 @@ export function createVectorIndexClient(transport) {
|
|
|
16
21
|
}
|
|
17
22
|
return response;
|
|
18
23
|
}
|
|
24
|
+
function operation(run) {
|
|
25
|
+
const requestId = generateClientRequestId();
|
|
26
|
+
return decoratePromise(run(requestId), { requestId });
|
|
27
|
+
}
|
|
19
28
|
function createHandle(opened) {
|
|
20
29
|
const { indexId, dim, storage } = opened;
|
|
21
30
|
let length = opened.length;
|
|
31
|
+
let calibrated = opened.calibrated;
|
|
32
|
+
let stagedSearch = opened.stagedSearch;
|
|
22
33
|
let disposed = false;
|
|
23
34
|
// Row lengths are checked here so a mismatch fails before any request is
|
|
24
35
|
// sent and before the worker touches native memory.
|
|
@@ -30,17 +41,21 @@ export function createVectorIndexClient(transport) {
|
|
|
30
41
|
}
|
|
31
42
|
// The flag is set only after the worker confirms, so a failed dispose
|
|
32
43
|
// can be retried instead of leaking the index until worker shutdown.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
function dispose(options) {
|
|
45
|
+
return operation(async (requestId) => {
|
|
46
|
+
if (disposed)
|
|
47
|
+
return;
|
|
48
|
+
await call({ type: 'vectorIndex', operation: 'dispose', indexId }, requestId, options);
|
|
49
|
+
disposed = true;
|
|
50
|
+
});
|
|
38
51
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
function search(params, options) {
|
|
53
|
+
return operation(async (requestId) => {
|
|
54
|
+
const queries = 'queries' in params ? params.queries : [params.query];
|
|
55
|
+
assertRows(queries, 'queries');
|
|
56
|
+
const response = await call({ type: 'vectorIndex', operation: 'search', indexId, queries, k: params.k }, requestId, options);
|
|
57
|
+
return 'queries' in params ? response.results : (response.results[0] ?? []);
|
|
58
|
+
});
|
|
44
59
|
}
|
|
45
60
|
const handle = {
|
|
46
61
|
indexId,
|
|
@@ -49,31 +64,64 @@ export function createVectorIndexClient(transport) {
|
|
|
49
64
|
get length() {
|
|
50
65
|
return length;
|
|
51
66
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
get calibrated() {
|
|
68
|
+
return calibrated;
|
|
69
|
+
},
|
|
70
|
+
get stagedSearch() {
|
|
71
|
+
return stagedSearch;
|
|
72
|
+
},
|
|
73
|
+
setStagedSearch(params, options) {
|
|
74
|
+
return operation(async (requestId) => {
|
|
75
|
+
const response = await call({
|
|
76
|
+
type: 'vectorIndex',
|
|
77
|
+
operation: 'setStagedSearch',
|
|
78
|
+
indexId,
|
|
79
|
+
enabled: params.enabled
|
|
80
|
+
}, requestId, options);
|
|
81
|
+
stagedSearch = response.stagedSearch;
|
|
82
|
+
return { stagedSearch };
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
add(params, options) {
|
|
86
|
+
return operation(async (requestId) => {
|
|
87
|
+
assertRows(params.vectors, 'vectors');
|
|
88
|
+
const response = await call({
|
|
89
|
+
type: 'vectorIndex',
|
|
90
|
+
operation: 'add',
|
|
91
|
+
indexId,
|
|
92
|
+
ids: toWireVectorIds(params.ids),
|
|
93
|
+
vectors: params.vectors
|
|
94
|
+
}, requestId, options);
|
|
95
|
+
length = response.length;
|
|
96
|
+
calibrated = response.calibrated;
|
|
97
|
+
stagedSearch = response.stagedSearch;
|
|
98
|
+
return { length };
|
|
99
|
+
});
|
|
63
100
|
},
|
|
64
101
|
search,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
102
|
+
remove(params, options) {
|
|
103
|
+
return operation(async (requestId) => {
|
|
104
|
+
const response = await call({ type: 'vectorIndex', operation: 'remove', indexId, ids: toWireVectorIds(params.ids) }, requestId, options);
|
|
105
|
+
length = response.length;
|
|
106
|
+
return response.removed;
|
|
107
|
+
});
|
|
69
108
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
109
|
+
contains(params, options) {
|
|
110
|
+
return operation(async (requestId) => {
|
|
111
|
+
const response = await call({
|
|
112
|
+
type: 'vectorIndex',
|
|
113
|
+
operation: 'contains',
|
|
114
|
+
indexId,
|
|
115
|
+
ids: toWireVectorIds(params.ids)
|
|
116
|
+
}, requestId, options);
|
|
117
|
+
return response.present;
|
|
118
|
+
});
|
|
73
119
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
120
|
+
write(params, options) {
|
|
121
|
+
return operation(async (requestId) => {
|
|
122
|
+
const response = await call({ type: 'vectorIndex', operation: 'write', indexId, path: params.path }, requestId, options);
|
|
123
|
+
return { path: response.path };
|
|
124
|
+
});
|
|
77
125
|
},
|
|
78
126
|
dispose
|
|
79
127
|
};
|
|
@@ -88,18 +136,22 @@ export function createVectorIndexClient(transport) {
|
|
|
88
136
|
return handle;
|
|
89
137
|
}
|
|
90
138
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
139
|
+
createVectorIndex(params, options) {
|
|
140
|
+
return operation(async (requestId) => {
|
|
141
|
+
const response = await call({
|
|
142
|
+
type: 'vectorIndex',
|
|
143
|
+
operation: 'create',
|
|
144
|
+
dim: params.dim,
|
|
145
|
+
storage: params.storage ?? DEFAULT_VECTOR_INDEX_STORAGE
|
|
146
|
+
}, requestId, options);
|
|
147
|
+
return createHandle(response);
|
|
148
|
+
});
|
|
99
149
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
150
|
+
loadVectorIndex(params, options) {
|
|
151
|
+
return operation(async (requestId) => {
|
|
152
|
+
const response = await call({ type: 'vectorIndex', operation: 'load', path: params.path }, requestId, options);
|
|
153
|
+
return createHandle(response);
|
|
154
|
+
});
|
|
103
155
|
}
|
|
104
156
|
};
|
|
105
157
|
}
|
|
@@ -115,10 +167,10 @@ const client = createVectorIndexClient(send);
|
|
|
115
167
|
* documents.
|
|
116
168
|
*
|
|
117
169
|
* @param params - Index parameters
|
|
118
|
-
* @param params.dim - Vector dimensionality, for example 1024 for GTE Large. TurboVec storage needs a multiple of 8 no greater than
|
|
170
|
+
* @param params.dim - Vector dimensionality, for example 1024 for GTE Large. TurboVec storage needs a multiple of 8 no greater than 16384.
|
|
119
171
|
* @param params.storage - Storage mode from `VectorIndexStorage`; defaults to `TURBOVEC_Q4`. `TURBOVEC_Q2` halves memory again at lower recall; `F32`, `Q8`, and `Q4` are exact or generically quantised stores for dimensions TurboVec cannot hold.
|
|
120
172
|
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
121
|
-
* @returns A handle whose methods add, search, remove, snapshot, and dispose the index.
|
|
173
|
+
* @returns A handle whose methods add, search, remove, snapshot, and dispose the index. The pending promise carries `requestId` for `cancel({ requestId })`.
|
|
122
174
|
* @throws {VectorIndexProviderUnavailableError} When no registered plugin exposes a vector index provider
|
|
123
175
|
* @throws {VectorIndexFailedError} When the native index rejects the dimension or storage mode
|
|
124
176
|
*
|
|
@@ -128,7 +180,7 @@ const client = createVectorIndexClient(send);
|
|
|
128
180
|
* ['1', 'Saturn moon Titan has lakes of liquid methane.'],
|
|
129
181
|
* ['2', 'Solar panels turn sunlight into electricity.']
|
|
130
182
|
* ])
|
|
131
|
-
* const { embedding } = await
|
|
183
|
+
* const { embedding } = await embedBatch({ modelId, inputs: [...documents.values()] })
|
|
132
184
|
*
|
|
133
185
|
* await using index = await createVectorIndex({ dim: embedding[0].length })
|
|
134
186
|
* await index.add({ ids: [...documents.keys()], vectors: embedding })
|
|
@@ -16,6 +16,7 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
16
16
|
cfg_scale?: number | undefined;
|
|
17
17
|
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
18
18
|
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
19
|
+
vae_tile_size?: string | number | undefined;
|
|
19
20
|
cache_preset?: string | undefined;
|
|
20
21
|
stg_scale?: number | undefined;
|
|
21
22
|
stg_block?: number | undefined;
|
|
@@ -29,7 +30,6 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
29
30
|
high_noise_flow_shift?: number | undefined;
|
|
30
31
|
moe_boundary?: number | undefined;
|
|
31
32
|
vace_strength?: number | undefined;
|
|
32
|
-
vae_tile_size?: string | number | undefined;
|
|
33
33
|
vae_tile_overlap?: number | undefined;
|
|
34
34
|
temporal_tiling?: boolean | undefined;
|
|
35
35
|
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
@@ -57,6 +57,7 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
57
57
|
cfg_scale?: number | undefined;
|
|
58
58
|
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
59
59
|
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
60
|
+
vae_tile_size?: string | number | undefined;
|
|
60
61
|
cache_preset?: string | undefined;
|
|
61
62
|
stg_scale?: number | undefined;
|
|
62
63
|
stg_block?: number | undefined;
|
|
@@ -70,7 +71,6 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
70
71
|
high_noise_flow_shift?: number | undefined;
|
|
71
72
|
moe_boundary?: number | undefined;
|
|
72
73
|
vace_strength?: number | undefined;
|
|
73
|
-
vae_tile_size?: string | number | undefined;
|
|
74
74
|
vae_tile_overlap?: number | undefined;
|
|
75
75
|
temporal_tiling?: boolean | undefined;
|
|
76
76
|
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
@@ -98,6 +98,7 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
98
98
|
cfg_scale?: number | undefined;
|
|
99
99
|
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
100
100
|
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
101
|
+
vae_tile_size?: string | number | undefined;
|
|
101
102
|
cache_preset?: string | undefined;
|
|
102
103
|
stg_scale?: number | undefined;
|
|
103
104
|
stg_block?: number | undefined;
|
|
@@ -111,7 +112,6 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
111
112
|
high_noise_flow_shift?: number | undefined;
|
|
112
113
|
moe_boundary?: number | undefined;
|
|
113
114
|
vace_strength?: number | undefined;
|
|
114
|
-
vae_tile_size?: string | number | undefined;
|
|
115
115
|
vae_tile_overlap?: number | undefined;
|
|
116
116
|
temporal_tiling?: boolean | undefined;
|
|
117
117
|
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
@@ -139,6 +139,7 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
139
139
|
cfg_scale?: number | undefined;
|
|
140
140
|
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
141
141
|
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
142
|
+
vae_tile_size?: string | number | undefined;
|
|
142
143
|
cache_preset?: string | undefined;
|
|
143
144
|
stg_scale?: number | undefined;
|
|
144
145
|
stg_block?: number | undefined;
|
|
@@ -152,7 +153,6 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
152
153
|
high_noise_flow_shift?: number | undefined;
|
|
153
154
|
moe_boundary?: number | undefined;
|
|
154
155
|
vace_strength?: number | undefined;
|
|
155
|
-
vae_tile_size?: string | number | undefined;
|
|
156
156
|
vae_tile_overlap?: number | undefined;
|
|
157
157
|
temporal_tiling?: boolean | undefined;
|
|
158
158
|
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
@@ -180,6 +180,7 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
180
180
|
cfg_scale?: number | undefined;
|
|
181
181
|
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
182
182
|
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
183
|
+
vae_tile_size?: string | number | undefined;
|
|
183
184
|
cache_preset?: string | undefined;
|
|
184
185
|
stg_scale?: number | undefined;
|
|
185
186
|
stg_block?: number | undefined;
|
|
@@ -193,7 +194,6 @@ export declare function createVideoStreamRequest(params: VideoClientParams, requ
|
|
|
193
194
|
high_noise_flow_shift?: number | undefined;
|
|
194
195
|
moe_boundary?: number | undefined;
|
|
195
196
|
vace_strength?: number | undefined;
|
|
196
|
-
vae_tile_size?: string | number | undefined;
|
|
197
197
|
vae_tile_overlap?: number | undefined;
|
|
198
198
|
temporal_tiling?: boolean | undefined;
|
|
199
199
|
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VideoClientParams, type VideoStats } from '@qvac/inference/surface';
|
|
1
|
+
import { type VideoClientParams, type VideoStats, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
export interface VideoProgressTick {
|
|
3
3
|
step: number;
|
|
4
4
|
totalSteps: number;
|
|
@@ -14,6 +14,7 @@ export interface VideoResult {
|
|
|
14
14
|
* Generates a video using a loaded video diffusion model.
|
|
15
15
|
*
|
|
16
16
|
* @param params - Video request parameters (model, prompt, dimensions, frame count, fps, sampler, seed, etc.).
|
|
17
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
17
18
|
* @returns A result object exposing `requestId` (stable identifier for this in-flight generation), `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated video buffers, typically a single AVI file), and `stats` (promise of generation statistics).
|
|
18
19
|
*
|
|
19
20
|
* Supports `txt2vid` (text-to-video) and `img2vid` (image-to-video) for Wan,
|
|
@@ -123,5 +124,5 @@ export interface VideoResult {
|
|
|
123
124
|
* await cancel(requestId);
|
|
124
125
|
* ```
|
|
125
126
|
*/
|
|
126
|
-
export declare function video(params: VideoClientParams): VideoResult;
|
|
127
|
+
export declare function video(params: VideoClientParams, options?: RPCOptions): VideoResult;
|
|
127
128
|
//# sourceMappingURL=video.d.ts.map
|
|
@@ -7,6 +7,7 @@ import { decodeBase64 } from '../../utils/encoding.js';
|
|
|
7
7
|
* Generates a video using a loaded video diffusion model.
|
|
8
8
|
*
|
|
9
9
|
* @param params - Video request parameters (model, prompt, dimensions, frame count, fps, sampler, seed, etc.).
|
|
10
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
10
11
|
* @returns A result object exposing `requestId` (stable identifier for this in-flight generation), `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated video buffers, typically a single AVI file), and `stats` (promise of generation statistics).
|
|
11
12
|
*
|
|
12
13
|
* Supports `txt2vid` (text-to-video) and `img2vid` (image-to-video) for Wan,
|
|
@@ -116,7 +117,7 @@ import { decodeBase64 } from '../../utils/encoding.js';
|
|
|
116
117
|
* await cancel(requestId);
|
|
117
118
|
* ```
|
|
118
119
|
*/
|
|
119
|
-
export function video(params) {
|
|
120
|
+
export function video(params, options) {
|
|
120
121
|
const requestId = generateClientRequestId();
|
|
121
122
|
const request = createVideoStreamRequest(params, requestId);
|
|
122
123
|
let statsResolver = () => { };
|
|
@@ -140,7 +141,7 @@ export function video(params) {
|
|
|
140
141
|
outputsPromise.catch(() => { });
|
|
141
142
|
async function processResponses() {
|
|
142
143
|
try {
|
|
143
|
-
for await (const response of streamRpc(request)) {
|
|
144
|
+
for await (const response of streamRpc(request, options)) {
|
|
144
145
|
if (response &&
|
|
145
146
|
typeof response === 'object' &&
|
|
146
147
|
'type' in response &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaHparams } from '@qvac/inference/surface';
|
|
1
|
+
import { type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaHparams, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
/**
|
|
3
3
|
* Run VLA inference on a loaded model (SmolVLA, π₀.₅, or GR00T) and return the
|
|
4
4
|
* produced action chunk plus per-stage timings.
|
|
@@ -31,9 +31,11 @@ import { type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSel
|
|
|
31
31
|
* (`Float32Array` of length `hparams.chunkSize * hparams.maxActionDim`).
|
|
32
32
|
* Optional for SmolVLA / π₀.₅ (addon samples its own prior when omitted).
|
|
33
33
|
* Required for GR00T (`hparams.imageInputMode === 'patches'`).
|
|
34
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
34
35
|
* @returns A `VlaClientRunResult` with the produced `actions` Float32Array
|
|
35
36
|
* (length `chunkSize * actionDim`), the corresponding `chunkSize` /
|
|
36
|
-
* `actionDim` returned by the addon, and optional per-stage `stats`.
|
|
37
|
+
* `actionDim` returned by the addon, and optional per-stage `stats`. The
|
|
38
|
+
* promise carries `requestId` synchronously for `cancel({ requestId })`.
|
|
37
39
|
*
|
|
38
40
|
* @example
|
|
39
41
|
* ```typescript
|
|
@@ -54,7 +56,9 @@ import { type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSel
|
|
|
54
56
|
* });
|
|
55
57
|
* ```
|
|
56
58
|
*/
|
|
57
|
-
export declare function vla(params: VlaClientRunParams): Promise<VlaClientRunResult
|
|
59
|
+
export declare function vla(params: VlaClientRunParams, options?: RPCOptions): Promise<VlaClientRunResult> & {
|
|
60
|
+
requestId: string;
|
|
61
|
+
};
|
|
58
62
|
/**
|
|
59
63
|
* Fetch the loaded VLA model's hyperparameters and the active ggml backend
|
|
60
64
|
* name. Useful to size token / state / noise buffers before calling `vla()`.
|
|
@@ -66,7 +70,7 @@ export declare function vla(params: VlaClientRunParams): Promise<VlaClientRunRes
|
|
|
66
70
|
*/
|
|
67
71
|
export declare function vlaHparams(params: {
|
|
68
72
|
modelId: string;
|
|
69
|
-
}): Promise<{
|
|
73
|
+
}, options?: RPCOptions): Promise<{
|
|
70
74
|
hparams: VlaHparams;
|
|
71
75
|
backendName: string | null;
|
|
72
76
|
}>;
|
|
@@ -108,7 +112,7 @@ export declare function vlaHparams(params: {
|
|
|
108
112
|
export declare function vlaSetEmbodiment(params: {
|
|
109
113
|
modelId: string;
|
|
110
114
|
embodiment: VlaEmbodimentSelection;
|
|
111
|
-
}): Promise<{
|
|
115
|
+
}, options?: RPCOptions): Promise<{
|
|
112
116
|
hparams: VlaHparams;
|
|
113
117
|
}>;
|
|
114
118
|
//# sourceMappingURL=vla.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { vlaHparamsResponseSchema, vlaRunResponseSchema, vlaSetEmbodimentResponseSchema } from '@qvac/inference/surface';
|
|
2
2
|
import { decodeBase64, encodeBase64 } from '../../utils/encoding.js';
|
|
3
|
+
import { decoratePromise } from '../../utils/decorate-promise.js';
|
|
4
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
3
5
|
import { invokePlugin } from './invoke-plugin.js';
|
|
4
6
|
const VLA_RUN_HANDLER = 'vlaRun';
|
|
5
7
|
const VLA_HPARAMS_HANDLER = 'vlaHparams';
|
|
@@ -45,9 +47,11 @@ function f32FromBase64(b64) {
|
|
|
45
47
|
* (`Float32Array` of length `hparams.chunkSize * hparams.maxActionDim`).
|
|
46
48
|
* Optional for SmolVLA / π₀.₅ (addon samples its own prior when omitted).
|
|
47
49
|
* Required for GR00T (`hparams.imageInputMode === 'patches'`).
|
|
50
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
48
51
|
* @returns A `VlaClientRunResult` with the produced `actions` Float32Array
|
|
49
52
|
* (length `chunkSize * actionDim`), the corresponding `chunkSize` /
|
|
50
|
-
* `actionDim` returned by the addon, and optional per-stage `stats`.
|
|
53
|
+
* `actionDim` returned by the addon, and optional per-stage `stats`. The
|
|
54
|
+
* promise carries `requestId` synchronously for `cancel({ requestId })`.
|
|
51
55
|
*
|
|
52
56
|
* @example
|
|
53
57
|
* ```typescript
|
|
@@ -68,7 +72,11 @@ function f32FromBase64(b64) {
|
|
|
68
72
|
* });
|
|
69
73
|
* ```
|
|
70
74
|
*/
|
|
71
|
-
export
|
|
75
|
+
export function vla(params, options) {
|
|
76
|
+
const requestId = generateClientRequestId();
|
|
77
|
+
return decoratePromise(runVla(params, requestId, options), { requestId });
|
|
78
|
+
}
|
|
79
|
+
async function runVla(params, requestId, options) {
|
|
72
80
|
const wireRequest = {
|
|
73
81
|
type: 'vlaRun',
|
|
74
82
|
modelId: params.modelId,
|
|
@@ -85,8 +93,9 @@ export async function vla(params) {
|
|
|
85
93
|
const result = await invokePlugin({
|
|
86
94
|
modelId: params.modelId,
|
|
87
95
|
handler: VLA_RUN_HANDLER,
|
|
88
|
-
params: wireRequest
|
|
89
|
-
|
|
96
|
+
params: wireRequest,
|
|
97
|
+
requestId
|
|
98
|
+
}, options);
|
|
90
99
|
const parsed = vlaRunResponseSchema.parse(result);
|
|
91
100
|
return {
|
|
92
101
|
actions: f32FromBase64(parsed.actions),
|
|
@@ -104,7 +113,7 @@ export async function vla(params) {
|
|
|
104
113
|
* (`"CPU"` / `"Vulkan"` / `"Metal"` / `"OpenCL"` / `null` if the addon
|
|
105
114
|
* has not surfaced one).
|
|
106
115
|
*/
|
|
107
|
-
export async function vlaHparams(params) {
|
|
116
|
+
export async function vlaHparams(params, options) {
|
|
108
117
|
const wireRequest = {
|
|
109
118
|
type: 'vlaHparams',
|
|
110
119
|
modelId: params.modelId
|
|
@@ -113,7 +122,7 @@ export async function vlaHparams(params) {
|
|
|
113
122
|
modelId: params.modelId,
|
|
114
123
|
handler: VLA_HPARAMS_HANDLER,
|
|
115
124
|
params: wireRequest
|
|
116
|
-
});
|
|
125
|
+
}, options);
|
|
117
126
|
return vlaHparamsResponseSchema.parse(result);
|
|
118
127
|
}
|
|
119
128
|
/**
|
|
@@ -151,7 +160,7 @@ export async function vlaHparams(params) {
|
|
|
151
160
|
* console.log(hparams.selectedEmbodimentTag, hparams.numCameras);
|
|
152
161
|
* ```
|
|
153
162
|
*/
|
|
154
|
-
export async function vlaSetEmbodiment(params) {
|
|
163
|
+
export async function vlaSetEmbodiment(params, options) {
|
|
155
164
|
const wireRequest = {
|
|
156
165
|
type: 'vlaSetEmbodiment',
|
|
157
166
|
modelId: params.modelId,
|
|
@@ -161,6 +170,6 @@ export async function vlaSetEmbodiment(params) {
|
|
|
161
170
|
modelId: params.modelId,
|
|
162
171
|
handler: VLA_SET_EMBODIMENT_HANDLER,
|
|
163
172
|
params: wireRequest
|
|
164
|
-
});
|
|
173
|
+
}, options);
|
|
165
174
|
return vlaSetEmbodimentResponseSchema.parse(result);
|
|
166
175
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorldSceneClientParams, WorldStepClientParams } from '@qvac/inference/surface';
|
|
1
|
+
import type { RPCOptions, WorldSceneClientParams, WorldStepClientParams } from '@qvac/inference/surface';
|
|
2
2
|
import { type WorldSceneResult, type WorldSceneResultWithPack, type WorldStepResult } from '../../client/api/world-result.js';
|
|
3
3
|
/**
|
|
4
4
|
* Builds a world for an ABot-World session: the prompt and first frame are
|
|
@@ -72,11 +72,11 @@ import { type WorldSceneResult, type WorldSceneResultWithPack, type WorldStepRes
|
|
|
72
72
|
*/
|
|
73
73
|
export declare function worldCreateScene(params: WorldSceneClientParams & {
|
|
74
74
|
returnPack: true;
|
|
75
|
-
}): WorldSceneResultWithPack;
|
|
75
|
+
}, options?: RPCOptions): WorldSceneResultWithPack;
|
|
76
76
|
export declare function worldCreateScene(params: WorldSceneClientParams & {
|
|
77
77
|
returnPack?: false | undefined;
|
|
78
|
-
}): WorldSceneResult;
|
|
79
|
-
export declare function worldCreateScene(params: WorldSceneClientParams): WorldSceneResult | WorldSceneResultWithPack;
|
|
78
|
+
}, options?: RPCOptions): WorldSceneResult;
|
|
79
|
+
export declare function worldCreateScene(params: WorldSceneClientParams, options?: RPCOptions): WorldSceneResult | WorldSceneResultWithPack;
|
|
80
80
|
/**
|
|
81
81
|
* Generates the next block of an ABot-World walk under the keys held for it.
|
|
82
82
|
*
|
|
@@ -140,5 +140,5 @@ export declare function worldCreateScene(params: WorldSceneClientParams): WorldS
|
|
|
140
140
|
* }
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
|
-
export declare function worldStep(params: WorldStepClientParams): WorldStepResult;
|
|
143
|
+
export declare function worldStep(params: WorldStepClientParams, options?: RPCOptions): WorldStepResult;
|
|
144
144
|
//# sourceMappingURL=world.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stream as streamRpc } from '../../client/rpc/rpc-client.js';
|
|
2
2
|
import { createWorldSceneResult, createWorldStepResult } from '../../client/api/world-result.js';
|
|
3
|
-
export function worldCreateScene(params) {
|
|
4
|
-
return createWorldSceneResult(params, streamRpc);
|
|
3
|
+
export function worldCreateScene(params, options) {
|
|
4
|
+
return createWorldSceneResult(params, (request) => streamRpc(request, options));
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Generates the next block of an ABot-World walk under the keys held for it.
|
|
@@ -66,6 +66,6 @@ export function worldCreateScene(params) {
|
|
|
66
66
|
* }
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
|
-
export function worldStep(params) {
|
|
70
|
-
return createWorldStepResult(params, streamRpc);
|
|
69
|
+
export function worldStep(params, options) {
|
|
70
|
+
return createWorldStepResult(params, (request) => streamRpc(request, options));
|
|
71
71
|
}
|
|
@@ -4,14 +4,16 @@ interface RPCClient {
|
|
|
4
4
|
request(command: number): any;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* Config is loaded once and becomes immutable on the
|
|
7
|
+
* Sends the worker its first message: config, runtime context and the folder
|
|
8
|
+
* that holds `.qvac`. Config is loaded once and becomes immutable on the
|
|
9
|
+
* worker side.
|
|
9
10
|
*
|
|
10
11
|
* @param rpc - The RPC client instance
|
|
11
12
|
* @param resolveConfig - Runtime-specific config resolver function
|
|
12
|
-
* @param runtimeContext -
|
|
13
|
+
* @param runtimeContext - Runtime context (platform, device info)
|
|
14
|
+
* @param homeDir - Folder the worker keeps `.qvac` in
|
|
13
15
|
*/
|
|
14
|
-
export declare function initializeConfig(rpc: RPCClient, resolveConfig: ResolveConfigFn, runtimeContext
|
|
16
|
+
export declare function initializeConfig(rpc: RPCClient, resolveConfig: ResolveConfigFn, runtimeContext: RuntimeContext, homeDir: string): Promise<void>;
|
|
15
17
|
/**
|
|
16
18
|
* Legacy function for backward compatibility
|
|
17
19
|
* @deprecated Use initializeConfig instead
|
|
@@ -9,11 +9,12 @@ function applyClientLoggerSettings(config) {
|
|
|
9
9
|
setGlobalConsoleOutput(config.loggerConsoleOutput);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
async function sendInitMessage(rpc, config, runtimeContext) {
|
|
12
|
+
async function sendInitMessage(rpc, config, runtimeContext, homeDir) {
|
|
13
13
|
const initMessage = {
|
|
14
14
|
type: '__init_config',
|
|
15
15
|
config,
|
|
16
|
-
runtimeContext
|
|
16
|
+
runtimeContext,
|
|
17
|
+
homeDir
|
|
17
18
|
};
|
|
18
19
|
const req = rpc.request(1);
|
|
19
20
|
req.send(JSON.stringify(initMessage), 'utf8');
|
|
@@ -24,33 +25,29 @@ async function sendInitMessage(rpc, config, runtimeContext) {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
-
* Config is loaded once and becomes immutable on the
|
|
28
|
+
* Sends the worker its first message: config, runtime context and the folder
|
|
29
|
+
* that holds `.qvac`. Config is loaded once and becomes immutable on the
|
|
30
|
+
* worker side.
|
|
29
31
|
*
|
|
30
32
|
* @param rpc - The RPC client instance
|
|
31
33
|
* @param resolveConfig - Runtime-specific config resolver function
|
|
32
|
-
* @param runtimeContext -
|
|
34
|
+
* @param runtimeContext - Runtime context (platform, device info)
|
|
35
|
+
* @param homeDir - Folder the worker keeps `.qvac` in
|
|
33
36
|
*/
|
|
34
|
-
export async function initializeConfig(rpc, resolveConfig, runtimeContext) {
|
|
37
|
+
export async function initializeConfig(rpc, resolveConfig, runtimeContext, homeDir) {
|
|
35
38
|
const config = await resolveConfig();
|
|
36
|
-
// Nothing to initialize
|
|
37
|
-
if (!config && !runtimeContext) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
// Apply client-side logger settings
|
|
41
39
|
if (config) {
|
|
42
40
|
applyClientLoggerSettings(config);
|
|
43
41
|
logger.info('📦 Initializing SDK config');
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
logger.info('📱 Runtime context:', runtimeContext);
|
|
47
|
-
}
|
|
43
|
+
logger.info('📱 Runtime context:', runtimeContext);
|
|
48
44
|
try {
|
|
49
|
-
await sendInitMessage(rpc, config, runtimeContext);
|
|
45
|
+
await sendInitMessage(rpc, config, runtimeContext, homeDir);
|
|
50
46
|
logger.info('✅ Initialization complete');
|
|
51
47
|
}
|
|
52
48
|
catch (error) {
|
|
53
49
|
logger.error('❌ Initialization failed:', error);
|
|
50
|
+
throw error;
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
/**
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { RPCOptions } from '@qvac/inference/surface';
|
|
1
2
|
import { type Logger } from '../logging/index.js';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
3
|
+
import { loggingStream } from './api/logging-stream.js';
|
|
4
|
+
export declare function startLoggingStreamForModel(modelId: string, modelLogger: Logger, options?: RPCOptions, openStream?: typeof loggingStream): void;
|
|
5
|
+
/** Stops the logging stream the caller behind `options` opened for the model. */
|
|
6
|
+
export declare function stopLoggingStreamForModel(modelId: string, options?: RPCOptions): void;
|
|
7
|
+
export declare function hasActiveStreamForModel(modelId: string, options?: RPCOptions): boolean;
|
|
5
8
|
//# sourceMappingURL=logging-stream-registry.d.ts.map
|