@qvac/sdk 0.12.2 → 0.13.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 +55 -1225
- package/README.md +12 -0
- package/dist/client/api/bci-transcribe.d.ts +57 -0
- package/dist/client/api/bci-transcribe.js +172 -0
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.js +1 -0
- package/dist/client/api/video.d.ts +26 -6
- package/dist/client/api/video.js +30 -7
- package/dist/client/api/vla.d.ts +11 -7
- package/dist/client/api/vla.js +11 -7
- package/dist/client/rpc/bare-client.js +2 -2
- package/dist/commands/bundle/constants.js +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +77 -0
- package/dist/examples/bci/bci-filesystem.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem.js +63 -0
- package/dist/examples/cache-management.js +0 -1
- package/dist/examples/cancel-by-request-id.js +0 -1
- package/dist/examples/classification/classify-image.js +1 -1
- package/dist/examples/completion-events.js +6 -2
- package/dist/examples/completion-stop-reason.d.ts +25 -0
- package/dist/examples/completion-stop-reason.js +65 -0
- package/dist/examples/concurrent-completion-collision.d.ts +2 -0
- package/dist/examples/concurrent-completion-collision.js +98 -0
- package/dist/examples/config-reload.js +1 -2
- package/dist/examples/default-config-usage.js +0 -1
- package/dist/examples/delegated-inference/composite.js +0 -1
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -1
- package/dist/examples/delegated-inference/consumer.js +0 -1
- package/dist/examples/diffusion-esrgan-upscale.js +1 -3
- package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
- package/dist/examples/diffusion-flux2-klein.js +2 -2
- package/dist/examples/diffusion-img2img.js +1 -1
- package/dist/examples/diffusion-img2vid.d.ts +2 -0
- package/dist/examples/diffusion-img2vid.js +78 -0
- package/dist/examples/diffusion-simple.js +1 -1
- package/dist/examples/diffusion-txt2img.js +8 -3
- package/dist/examples/diffusion-txt2vid.js +2 -3
- package/dist/examples/download-with-blind-relays.js +0 -1
- package/dist/examples/embed-multi-gpu.js +1 -2
- package/dist/examples/embed-p2p.js +4 -2
- package/dist/examples/finetune/llamacpp-finetune.js +5 -3
- package/dist/examples/kv-cache-cleanup.js +0 -1
- package/dist/examples/kv-cache-custom-key.js +0 -1
- package/dist/examples/kv-cache-example.js +4 -2
- package/dist/examples/llamacpp-cache.js +0 -1
- package/dist/examples/llamacpp-dynamic-tools.js +4 -2
- package/dist/examples/llamacpp-filesystem.js +1 -1
- package/dist/examples/llamacpp-http.js +1 -1
- package/dist/examples/llamacpp-multi-gpu.js +2 -2
- package/dist/examples/llamacpp-multimodal.js +0 -1
- package/dist/examples/llamacpp-p2p.js +0 -1
- package/dist/examples/llamacpp-sharded.js +1 -1
- package/dist/examples/llamacpp-structured-output.js +0 -1
- package/dist/examples/logging-file-transport.js +0 -1
- package/dist/examples/logging-streaming.js +0 -2
- package/dist/examples/mcp-websearch.js +0 -1
- package/dist/examples/multi-model-demo.js +0 -2
- package/dist/examples/ocr-fasttext.js +0 -1
- package/dist/examples/plugins.js +1 -4
- package/dist/examples/profiling/basic.js +3 -2
- package/dist/examples/profiling/per-call.js +0 -1
- package/dist/examples/quickstart.js +0 -1
- package/dist/examples/rag/rag-chromadb.js +0 -1
- package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -1
- package/dist/examples/rag/rag-hyperdb/ingest.js +0 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -1
- package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -1
- package/dist/examples/rag/rag-lancedb.js +0 -1
- package/dist/examples/rag/rag-sqlite.js +0 -1
- package/dist/examples/suspend-resume.js +0 -1
- package/dist/examples/tools/llamacpp-native-tools.js +0 -1
- package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
- package/dist/examples/tools/llamacpp-tools-pythonic.js +2 -2
- package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +1 -1
- package/dist/examples/transcription/parakeet-microphone-record.js +0 -1
- package/dist/examples/transcription/parakeet-microphone-stream.js +0 -1
- package/dist/examples/transcription/parakeet-sortformer.js +1 -2
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +1 -1
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +10 -6
- package/dist/examples/transcription/whispercpp-filesystem.js +4 -2
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +0 -1
- package/dist/examples/transcription/whispercpp-microphone-record.js +0 -1
- package/dist/examples/transcription/whispercpp-prompt.js +0 -1
- package/dist/examples/translation/translation-bergamot-batch.js +1 -2
- package/dist/examples/translation/translation-bergamot-pivot.js +3 -4
- package/dist/examples/translation/translation-bergamot.js +1 -2
- package/dist/examples/translation/translation-indic.js +1 -2
- package/dist/examples/translation/translation-llm-afriquegemma.js +3 -4
- package/dist/examples/translation/translation-llm-context.js +1 -2
- package/dist/examples/translation/translation-llm.js +2 -3
- package/dist/examples/translation/translation-stream.js +2 -3
- package/dist/examples/tts/chatterbox.js +1 -2
- package/dist/examples/tts/llm-to-tts-streaming.js +2 -4
- package/dist/examples/tts/supertonic-multilingual.js +1 -2
- package/dist/examples/tts/supertonic.js +1 -2
- package/dist/examples/vla-pi05.d.ts +2 -0
- package/dist/examples/vla-pi05.js +84 -0
- package/dist/examples/vla-smolvla.js +1 -1
- package/dist/examples/voice-assistant/voice-assistant.js +1 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -7
- package/dist/models/registry/models.d.ts +869 -186
- package/dist/models/registry/models.js +3160 -2453
- package/dist/models/update-models/companions.d.ts +7 -0
- package/dist/models/update-models/companions.js +56 -0
- package/dist/models/update-models/naming.js +10 -0
- package/dist/pear/pre.js +2 -0
- package/dist/schemas/bci-config.d.ts +36 -0
- package/dist/schemas/bci-config.js +56 -0
- package/dist/schemas/bci.d.ts +177 -0
- package/dist/schemas/bci.js +95 -0
- package/dist/schemas/common.d.ts +395 -51
- package/dist/schemas/common.js +5 -0
- package/dist/schemas/completion-event.d.ts +1 -0
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/embed.d.ts +2 -0
- package/dist/schemas/embed.js +1 -0
- package/dist/schemas/engine-addon-map.d.ts +1 -0
- package/dist/schemas/engine-addon-map.js +4 -1
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/llamacpp-config.d.ts +6 -2
- package/dist/schemas/load-model.d.ts +1841 -267
- package/dist/schemas/load-model.js +34 -1
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/plugin.d.ts +13 -5
- package/dist/schemas/plugin.js +13 -4
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/sdcpp-config.d.ts +75 -8
- package/dist/schemas/sdcpp-config.js +56 -10
- package/dist/schemas/sdk-config.d.ts +342 -0
- package/dist/schemas/text-to-speech.d.ts +8 -0
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription.d.ts +12 -0
- package/dist/schemas/transcription.js +8 -0
- package/dist/schemas/translation-config.d.ts +44 -16
- package/dist/schemas/translation-config.js +2 -0
- package/dist/schemas/vla.d.ts +14 -0
- package/dist/schemas/vla.js +26 -3
- package/dist/server/bare/delegate-connect-diagnostics.d.ts +9 -0
- package/dist/server/bare/delegate-connect-diagnostics.js +44 -0
- package/dist/server/bare/delegate-rpc-client.js +10 -12
- package/dist/server/bare/hyperswarm.js +1 -0
- package/dist/server/bare/ops/bci-transcribe.d.ts +13 -0
- package/dist/server/bare/ops/bci-transcribe.js +248 -0
- package/dist/server/bare/ops/embed.js +2 -1
- package/dist/server/bare/ops/kv-cache-utils.js +4 -3
- package/dist/server/bare/ops/transcribe.js +6 -2
- package/dist/server/bare/ops/translate.js +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +130 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +116 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +4 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +7 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
- package/dist/server/bare/plugins/index.d.ts +1 -0
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +22 -29
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +38 -7
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +14 -0
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +8 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +7 -1
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +58 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +9 -4
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +10 -0
- package/dist/server/bare/registry/model-config-utils.js +3 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +11 -4
- package/dist/server/bare/runtime/request-registry.d.ts +60 -16
- package/dist/server/bare/runtime/request-registry.js +258 -15
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +1 -1
- package/dist/server/bare/types/addon-responses.d.ts +5 -0
- package/dist/server/rpc/handler-registry.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe.js +4 -0
- package/dist/server/rpc/handlers/download-asset.js +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +3 -3
- package/dist/server/rpc/handlers/index.d.ts +4 -0
- package/dist/server/rpc/handlers/index.js +4 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +1 -1
- package/dist/server/rpc/handlers/load-model/http.js +6 -6
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry.js +1 -0
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +5 -5
- package/dist/server/utils/checksum.js +2 -1
- package/dist/server/utils/formatting.js +2 -1
- package/dist/server/utils/multi-gpu-mobile.d.ts +5 -0
- package/dist/server/utils/multi-gpu-mobile.js +10 -0
- package/dist/server/worker.js +2 -1
- package/dist/utils/aggregate-events.d.ts +2 -1
- package/dist/utils/aggregate-events.js +11 -3
- package/dist/utils/errors-server.d.ts +6 -4
- package/dist/utils/errors-server.js +6 -4
- package/electron-forge/index.cjs +820 -0
- package/package.json +68 -35
- package/dist/scripts/run-security-tests-bare.d.ts +0 -2
- package/dist/scripts/run-security-tests-bare.js +0 -78
|
@@ -111,13 +111,13 @@ function omitOnProgress(obj) {
|
|
|
111
111
|
* "still mine?" guard so an older op's deferred cleanup cannot stomp
|
|
112
112
|
* a newer op's mapping.
|
|
113
113
|
*/
|
|
114
|
-
function beginRagContext(workspace, requestId) {
|
|
114
|
+
async function beginRagContext(workspace, requestId) {
|
|
115
115
|
const registry = getRequestRegistry();
|
|
116
116
|
const prev = getActiveRagRequest(workspace);
|
|
117
117
|
if (prev !== undefined && prev !== requestId) {
|
|
118
118
|
registry.cancel({ requestId: prev, reason: "rag-workspace-preempt" });
|
|
119
119
|
}
|
|
120
|
-
const ctx = registry.begin({
|
|
120
|
+
const ctx = await registry.begin({
|
|
121
121
|
requestId,
|
|
122
122
|
kind: "rag",
|
|
123
123
|
});
|
|
@@ -146,7 +146,7 @@ async function handleRagInternal(request, onProgress) {
|
|
|
146
146
|
try {
|
|
147
147
|
const workspace = request.workspace ?? DEFAULT_WORKSPACE;
|
|
148
148
|
const requestId = request.requestId ?? generateServerRequestId();
|
|
149
|
-
const ctx = __addDisposableResource(env_1, beginRagContext(workspace, requestId), true);
|
|
149
|
+
const ctx = __addDisposableResource(env_1, await beginRagContext(workspace, requestId), true);
|
|
150
150
|
const log = withRequestContext(getServerLogger(), ctx);
|
|
151
151
|
log.debug("ingest start");
|
|
152
152
|
const handlerOptions = createHandlerOptions("ingest", workspace, ctx.signal, onProgress);
|
|
@@ -175,7 +175,7 @@ async function handleRagInternal(request, onProgress) {
|
|
|
175
175
|
try {
|
|
176
176
|
const workspace = request.workspace ?? DEFAULT_WORKSPACE;
|
|
177
177
|
const requestId = request.requestId ?? generateServerRequestId();
|
|
178
|
-
const ctx = __addDisposableResource(env_2, beginRagContext(workspace, requestId), true);
|
|
178
|
+
const ctx = __addDisposableResource(env_2, await beginRagContext(workspace, requestId), true);
|
|
179
179
|
const log = withRequestContext(getServerLogger(), ctx);
|
|
180
180
|
log.debug("saveEmbeddings start");
|
|
181
181
|
const handlerOptions = createHandlerOptions("saveEmbeddings", workspace, ctx.signal, onProgress);
|
|
@@ -220,7 +220,7 @@ async function handleRagInternal(request, onProgress) {
|
|
|
220
220
|
try {
|
|
221
221
|
const workspace = request.workspace ?? DEFAULT_WORKSPACE;
|
|
222
222
|
const requestId = request.requestId ?? generateServerRequestId();
|
|
223
|
-
const ctx = __addDisposableResource(env_3, beginRagContext(workspace, requestId), true);
|
|
223
|
+
const ctx = __addDisposableResource(env_3, await beginRagContext(workspace, requestId), true);
|
|
224
224
|
const log = withRequestContext(getServerLogger(), ctx);
|
|
225
225
|
log.debug("reindex start");
|
|
226
226
|
const handlerOptions = createHandlerOptions("reindex", workspace, ctx.signal, onProgress);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import fs from "bare-fs";
|
|
2
2
|
import crypto from "bare-crypto";
|
|
3
3
|
import { nowMs } from "../../profiling/index.js";
|
|
4
|
+
import {} from "bare-buffer";
|
|
4
5
|
export async function calculateFileChecksum(filePath) {
|
|
5
6
|
return new Promise((resolve, reject) => {
|
|
6
7
|
try {
|
|
7
|
-
const hash = crypto.createHash("
|
|
8
|
+
const hash = crypto.createHash("sha-256");
|
|
8
9
|
const stream = fs.createReadStream(filePath);
|
|
9
10
|
stream.on("data", (chunk) => {
|
|
10
11
|
hash.update(chunk);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import crypto from "bare-crypto";
|
|
2
|
+
import { Buffer } from "bare-buffer";
|
|
2
3
|
/**
|
|
3
4
|
* Generate a short hash (16 characters) from any input string
|
|
4
5
|
*/
|
|
5
6
|
export function generateShortHash(input) {
|
|
6
7
|
const hash = crypto
|
|
7
|
-
.createHash("
|
|
8
|
+
.createHash("sha-256")
|
|
8
9
|
.update(Buffer.from(input, "utf8"))
|
|
9
10
|
.digest("hex");
|
|
10
11
|
return hash.substring(0, 16);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const MULTI_GPU_KEYS: readonly ["main-gpu", "split-mode", "tensor-split"];
|
|
2
|
+
type MultiGpuKey = (typeof MULTI_GPU_KEYS)[number];
|
|
3
|
+
export declare function stripMultiGpuKeys(config: Record<string, unknown>): readonly MultiGpuKey[];
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=multi-gpu-mobile.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const MULTI_GPU_KEYS = ["main-gpu", "split-mode", "tensor-split"];
|
|
2
|
+
// Deletes any multi-GPU keys from `config` IN PLACE and returns the removed
|
|
3
|
+
// keys. Mutation is intentional: callers strip before the config reaches the
|
|
4
|
+
// model constructor. gpu_layers (single-GPU layer offload) is intentionally
|
|
5
|
+
// absent from MULTI_GPU_KEYS.
|
|
6
|
+
export function stripMultiGpuKeys(config) {
|
|
7
|
+
const stripped = MULTI_GPU_KEYS.filter((k) => k in config);
|
|
8
|
+
stripped.forEach((k) => delete config[k]);
|
|
9
|
+
return stripped;
|
|
10
|
+
}
|
package/dist/server/worker.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { initializeWorkerCore, ensureRPCSetup } from "./worker-core.js";
|
|
5
5
|
import { registerPlugins } from "./plugins/index.js";
|
|
6
6
|
import { getServerLogger } from "../logging/index.js";
|
|
7
|
-
import { llmPlugin, embeddingsPlugin, whisperPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, vlaPlugin, classificationPlugin, } from "./bare/plugins/index.js";
|
|
7
|
+
import { llmPlugin, embeddingsPlugin, whisperPlugin, bciPlugin, parakeetPlugin, nmtPlugin, ttsPlugin, ocrPlugin, diffusionPlugin, vlaPlugin, classificationPlugin, } from "./bare/plugins/index.js";
|
|
8
8
|
const { hasRPCConfig } = initializeWorkerCore();
|
|
9
9
|
const logger = getServerLogger();
|
|
10
10
|
logger.info("🐻 Hello from Bare");
|
|
@@ -12,6 +12,7 @@ registerPlugins([
|
|
|
12
12
|
llmPlugin,
|
|
13
13
|
embeddingsPlugin,
|
|
14
14
|
whisperPlugin,
|
|
15
|
+
bciPlugin,
|
|
15
16
|
parakeetPlugin,
|
|
16
17
|
nmtPlugin,
|
|
17
18
|
ttsPlugin,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, ToolCall } from "../schemas/index";
|
|
1
|
+
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall } from "../schemas/index";
|
|
2
2
|
import { type ToolHandlerMap } from "./tool-helpers";
|
|
3
3
|
export type AggregatedEvents = {
|
|
4
4
|
contentText: string;
|
|
@@ -7,6 +7,7 @@ export type AggregatedEvents = {
|
|
|
7
7
|
toolCalls: ToolCall[];
|
|
8
8
|
rawFullText: string | undefined;
|
|
9
9
|
error: CompletionError | undefined;
|
|
10
|
+
stopReason: StopReason | undefined;
|
|
10
11
|
/**
|
|
11
12
|
* True when the terminal `completionDone` carried
|
|
12
13
|
* `stopReason: "cancelled"`. The client wrapper rejects the
|
|
@@ -6,6 +6,7 @@ export function aggregateEvents(events) {
|
|
|
6
6
|
let stats;
|
|
7
7
|
let rawFullText;
|
|
8
8
|
let error;
|
|
9
|
+
let stopReason;
|
|
9
10
|
let cancelled = false;
|
|
10
11
|
const toolCalls = [];
|
|
11
12
|
for (const event of events) {
|
|
@@ -31,8 +32,13 @@ export function aggregateEvents(events) {
|
|
|
31
32
|
if (event.stopReason === "error" && "error" in event) {
|
|
32
33
|
error = event.error;
|
|
33
34
|
}
|
|
34
|
-
else
|
|
35
|
-
|
|
35
|
+
else {
|
|
36
|
+
if (event.stopReason !== undefined) {
|
|
37
|
+
stopReason = event.stopReason;
|
|
38
|
+
}
|
|
39
|
+
if (event.stopReason === "cancelled") {
|
|
40
|
+
cancelled = true;
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
}
|
|
@@ -43,11 +49,12 @@ export function aggregateEvents(events) {
|
|
|
43
49
|
toolCalls,
|
|
44
50
|
rawFullText,
|
|
45
51
|
error,
|
|
52
|
+
stopReason,
|
|
46
53
|
cancelled,
|
|
47
54
|
};
|
|
48
55
|
}
|
|
49
56
|
export function buildFinalFromEvents(events, handlers) {
|
|
50
|
-
const { contentText, thinkingText, stats, toolCalls, rawFullText, error, cancelled, } = aggregateEvents(events);
|
|
57
|
+
const { contentText, thinkingText, stats, toolCalls, rawFullText, error, stopReason, cancelled, } = aggregateEvents(events);
|
|
51
58
|
const attachedToolCalls = attachHandlersToToolCalls(toolCalls, handlers);
|
|
52
59
|
const fullText = rawFullText ?? contentText;
|
|
53
60
|
const cacheableAssistantContent = attachedToolCalls.length === 0
|
|
@@ -62,6 +69,7 @@ export function buildFinalFromEvents(events, handlers) {
|
|
|
62
69
|
...(cacheableAssistantContent !== undefined && {
|
|
63
70
|
cacheableAssistantContent,
|
|
64
71
|
}),
|
|
72
|
+
...(stopReason !== undefined && { stopReason }),
|
|
65
73
|
};
|
|
66
74
|
return { final, error, cancelled };
|
|
67
75
|
}
|
|
@@ -128,10 +128,12 @@ export declare class RequestNotFoundError extends QvacErrorBase {
|
|
|
128
128
|
toErrorResponseFields(): Record<string, unknown>;
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Thrown by `RequestRegistry.begin(...)` when a registered concurrency
|
|
132
|
-
* policy
|
|
133
|
-
*
|
|
134
|
-
*
|
|
131
|
+
* Thrown by `await RequestRegistry.begin(...)` when a registered concurrency
|
|
132
|
+
* policy refuses the request. Under the default queue policy a same-model
|
|
133
|
+
* request waits FIFO rather than rejecting, so this fires on the bounded-queue
|
|
134
|
+
* cases: an explicit `onOverflow: "reject"`, the per-model queue-depth cap, or
|
|
135
|
+
* a `queueTimeoutMs` elapsing while waiting for a slot. Distinct from
|
|
136
|
+
* `RequestIdConflictError`, which only fires on UUID collisions.
|
|
135
137
|
*/
|
|
136
138
|
export declare class RequestRejectedByPolicyError extends QvacErrorBase {
|
|
137
139
|
readonly requestId: string;
|
|
@@ -191,10 +191,12 @@ export class RequestNotFoundError extends QvacErrorBase {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
* Thrown by `RequestRegistry.begin(...)` when a registered concurrency
|
|
195
|
-
* policy
|
|
196
|
-
*
|
|
197
|
-
*
|
|
194
|
+
* Thrown by `await RequestRegistry.begin(...)` when a registered concurrency
|
|
195
|
+
* policy refuses the request. Under the default queue policy a same-model
|
|
196
|
+
* request waits FIFO rather than rejecting, so this fires on the bounded-queue
|
|
197
|
+
* cases: an explicit `onOverflow: "reject"`, the per-model queue-depth cap, or
|
|
198
|
+
* a `queueTimeoutMs` elapsing while waiting for a slot. Distinct from
|
|
199
|
+
* `RequestIdConflictError`, which only fires on UUID collisions.
|
|
198
200
|
*/
|
|
199
201
|
export class RequestRejectedByPolicyError extends QvacErrorBase {
|
|
200
202
|
requestId;
|