@qvac/sdk 0.17.0 → 0.18.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 +83 -18
- package/README.md +19 -0
- package/dist/client/api/audio-gen.d.ts +17 -0
- package/dist/client/api/audio-gen.js +17 -0
- package/dist/client/api/finetune.d.ts +2 -0
- package/dist/client/api/finetune.js +7 -1
- package/dist/client/api/index.d.ts +1 -1
- package/dist/client/api/index.js +1 -1
- package/dist/client/api/load-model.d.ts +8 -0
- package/dist/client/api/transcribe.d.ts +19 -2
- package/dist/client/api/transcribe.js +66 -27
- package/dist/client/api/translate.d.ts +3 -2
- package/dist/client/api/translate.js +42 -21
- package/dist/client/api/vla.d.ts +42 -1
- package/dist/client/api/vla.js +50 -1
- package/dist/commands/bundle/entry-gen.d.ts +4 -0
- package/dist/commands/bundle/entry-gen.js +6 -0
- package/dist/commands/bundle/index.js +19 -12
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +52 -0
- package/dist/examples/audiogen/generate-cover.d.ts +2 -0
- package/dist/examples/audiogen/generate-cover.js +100 -0
- package/dist/examples/llamacpp-fallback.d.ts +2 -0
- package/dist/examples/llamacpp-fallback.js +34 -0
- package/dist/examples/multi-job-completion.d.ts +28 -0
- package/dist/examples/multi-job-completion.js +128 -0
- package/dist/examples/profiling/basic.js +32 -1
- package/dist/examples/system-resources.d.ts +2 -0
- package/dist/examples/system-resources.js +86 -0
- package/dist/examples/tts/audio8.d.ts +2 -0
- package/dist/examples/tts/audio8.js +54 -0
- package/dist/examples/tts/cosyvoice3.d.ts +2 -0
- package/dist/examples/tts/cosyvoice3.js +52 -0
- package/dist/examples/vla-groot.js +92 -49
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/models/registry/models.d.ts +782 -6
- package/dist/models/registry/models.js +2664 -1859
- package/dist/schemas/audio-gen.d.ts +103 -0
- package/dist/schemas/audio-gen.js +135 -4
- package/dist/schemas/common.d.ts +550 -11
- package/dist/schemas/constants-registry.d.ts +18 -4
- package/dist/schemas/constants-registry.js +16 -3
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/llamacpp-config.d.ts +10 -10
- package/dist/schemas/llamacpp-config.js +12 -5
- package/dist/schemas/load-model.d.ts +3678 -323
- package/dist/schemas/load-model.js +21 -3
- package/dist/schemas/sdk-config.d.ts +60 -24
- package/dist/schemas/sdk-errors-server.d.ts +1 -0
- package/dist/schemas/sdk-errors-server.js +5 -0
- package/dist/schemas/text-to-speech.d.ts +1086 -110
- package/dist/schemas/text-to-speech.js +194 -4
- package/dist/schemas/tools.d.ts +0 -16
- package/dist/schemas/tools.js +0 -15
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription-config.js +10 -4
- package/dist/schemas/transcription.d.ts +3 -0
- package/dist/schemas/vla.d.ts +83 -0
- package/dist/schemas/vla.js +105 -2
- package/dist/scripts/link-workspace-inference.d.ts +2 -0
- package/dist/scripts/link-workspace-inference.js +31 -0
- package/dist/server/bare/ops/cancel.d.ts +1 -1
- package/dist/server/bare/ops/cancel.js +1 -1
- package/dist/server/bare/ops/kv-cache-retention.js +11 -0
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +40 -12
- package/dist/server/bare/ops/transcribe.d.ts +2 -2
- package/dist/server/bare/ops/transcribe.js +54 -48
- package/dist/server/bare/ops/translate-stats.d.ts +5 -0
- package/dist/server/bare/ops/translate-stats.js +11 -0
- package/dist/server/bare/ops/translate.js +66 -38
- package/dist/server/bare/ops/unload-model.js +30 -24
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.d.ts +20 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.js +153 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +52 -1
- package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +28 -0
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +3 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.js +9 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +37 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +21 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +16 -15
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +6 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +10 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +131 -123
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +110 -20
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +49 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +308 -143
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +55 -36
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +1 -7
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +2 -3
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +6 -5
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +27 -16
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +23 -3
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +302 -4
- package/dist/server/bare/plugins/tts-ggml/plugin.js +131 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +48 -39
- package/dist/server/bare/registry/model-registry.d.ts +1 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +29 -15
- package/dist/server/bare/runtime/request-registry.d.ts +27 -0
- package/dist/server/bare/runtime/request-registry.js +246 -76
- package/dist/server/bare/types/addon-responses.d.ts +4 -12
- package/dist/server/rpc/handlers/load-model/handler.js +2 -2
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/resolve-session.js +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +12 -2
- package/dist/server/rpc/handlers/load-model/resolve.js +90 -12
- package/dist/server/utils/audio/decoder.d.ts +37 -1
- package/dist/server/utils/audio/decoder.js +81 -51
- package/dist/server/utils/config-transform.d.ts +3 -0
- package/dist/server/utils/config-transform.js +6 -0
- package/dist/server/utils/index.d.ts +0 -1
- package/dist/server/utils/index.js +0 -1
- package/dist/server/utils/shard-utils.d.ts +1 -0
- package/dist/server/utils/shard-utils.js +14 -0
- package/dist/server/utils/tool-integration.d.ts +3 -10
- package/dist/server/utils/tool-integration.js +3 -12
- package/dist/utils/errors-server.d.ts +3 -0
- package/dist/utils/errors-server.js +5 -0
- package/package.json +12 -14
- package/dist/examples/llamacpp-dynamic-tools.d.ts +0 -2
- package/dist/examples/llamacpp-dynamic-tools.js +0 -152
- package/dist/models/update-models/codegen.d.ts +0 -3
- package/dist/models/update-models/codegen.js +0 -196
- package/dist/models/update-models/companions.d.ts +0 -30
- package/dist/models/update-models/companions.js +0 -296
- package/dist/models/update-models/history.d.ts +0 -24
- package/dist/models/update-models/history.js +0 -107
- package/dist/models/update-models/index.d.ts +0 -2
- package/dist/models/update-models/index.js +0 -123
- package/dist/models/update-models/naming.d.ts +0 -4
- package/dist/models/update-models/naming.js +0 -396
- package/dist/models/update-models/processing.d.ts +0 -8
- package/dist/models/update-models/processing.js +0 -65
- package/dist/models/update-models/registry.d.ts +0 -5
- package/dist/models/update-models/registry.js +0 -87
- package/dist/models/update-models/shards.d.ts +0 -4
- package/dist/models/update-models/shards.js +0 -57
- package/dist/models/update-models/types.d.ts +0 -88
- package/dist/models/update-models/types.js +0 -1
- package/dist/models/update-models/utils.d.ts +0 -3
- package/dist/models/update-models/utils.js +0 -21
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +0 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +0 -30
- package/dist/server/utils/expand-gguf-shards.d.ts +0 -3
- package/dist/server/utils/expand-gguf-shards.js +0 -22
|
@@ -10,42 +10,65 @@ export interface TurnHandle {
|
|
|
10
10
|
* to pick the message tail for the next addon call.
|
|
11
11
|
*/
|
|
12
12
|
readonly savedCount: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the cached prefix already holds a rendered static tool block, so
|
|
15
|
+
* this turn can leave it out of its payload. False on a fresh prime and
|
|
16
|
+
* whenever the previous turn couldn't confirm the block reached the model.
|
|
17
|
+
*/
|
|
18
|
+
readonly toolBlockCached: boolean;
|
|
13
19
|
}
|
|
14
20
|
export interface BeginCustomTurnInput {
|
|
15
21
|
kind: 'custom';
|
|
16
22
|
/** User-provided session key (`completion({ kvCache: "session-a" })`). */
|
|
17
23
|
customKey: string;
|
|
18
|
-
/** Hash of system prompt +
|
|
24
|
+
/** Hash of system prompt + complete tool definitions. */
|
|
19
25
|
configHash: string;
|
|
20
26
|
/**
|
|
21
|
-
* Prime the cache by sending system prompt
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
27
|
+
* Prime the cache by sending the system prompt to the addon. Tools are not
|
|
28
|
+
* primed — a prefix with no user turn is not a renderable conversation for
|
|
29
|
+
* every template — so they travel with a turn instead. Called when the cache
|
|
30
|
+
* doesn't exist in-memory OR on disk. Kept as an injected closure so this
|
|
31
|
+
* module has no dependency on the model registry / addon.
|
|
25
32
|
*/
|
|
26
33
|
primeIfMissing: (cachePath: string) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Request abort signal. When it aborts while this turn is queued behind a
|
|
36
|
+
* same-file peer's write lock, the wait is abandoned so the request's scope
|
|
37
|
+
* unwinds and releases its admission slot instead of blocking on the holder.
|
|
38
|
+
*/
|
|
39
|
+
signal?: AbortSignal;
|
|
27
40
|
}
|
|
28
41
|
export interface BeginAutoTurnInput {
|
|
29
42
|
kind: 'auto';
|
|
30
|
-
/** Hash of system prompt +
|
|
43
|
+
/** Hash of system prompt + complete tool definitions. */
|
|
31
44
|
configHash: string;
|
|
32
45
|
/** Conversation history used to compute the pre-response cache key. */
|
|
33
46
|
history: CacheMessage[];
|
|
34
47
|
/** See `BeginCustomTurnInput.primeIfMissing`. */
|
|
35
48
|
primeIfMissing: (cachePath: string) => Promise<void>;
|
|
49
|
+
/** See `BeginCustomTurnInput.signal`. */
|
|
50
|
+
signal?: AbortSignal;
|
|
36
51
|
}
|
|
37
52
|
export type BeginTurnInput = BeginCustomTurnInput | BeginAutoTurnInput;
|
|
38
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Whether the committed prefix holds a rendered static tool block. The
|
|
55
|
+
* handler owns this because only it knows whether the payload carried the
|
|
56
|
+
* block and whether the message list was one the template renders tools for.
|
|
57
|
+
*/
|
|
58
|
+
interface ToolBlockCommit {
|
|
59
|
+
toolBlockCached: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface StaticCommitResult extends ToolBlockCommit {
|
|
39
62
|
kind: 'static';
|
|
40
63
|
/** `history.length + 1` — recorded at the turn's current `cachePath`. */
|
|
41
64
|
messageCount: number;
|
|
42
65
|
}
|
|
43
|
-
export interface AutoRenameCommitResult {
|
|
66
|
+
export interface AutoRenameCommitResult extends ToolBlockCommit {
|
|
44
67
|
kind: 'autoRename';
|
|
45
68
|
/**
|
|
46
69
|
* Destination path the addon's pre-response cache file should be
|
|
47
70
|
* renamed to (computed from `cacheMessages + responseText`). The
|
|
48
|
-
* stale entry at the source path is dropped from `
|
|
71
|
+
* stale entry at the source path is dropped from `cachedPrefixes`
|
|
49
72
|
* and the new count is recorded at this target path.
|
|
50
73
|
*/
|
|
51
74
|
targetCachePath: string;
|
|
@@ -74,7 +97,7 @@ export interface KvCacheSession {
|
|
|
74
97
|
/**
|
|
75
98
|
* Roll back an in-flight turn — atomically deletes the on-disk cache
|
|
76
99
|
* file, clears the in-memory `initializedCaches` entry, forgets the
|
|
77
|
-
* `
|
|
100
|
+
* `cachedPrefixes` entry, releases the active-path ref, and
|
|
78
101
|
* removes orphaned marker metadata. Idempotent: a turn that has
|
|
79
102
|
* already been committed or rolled back is a no-op on subsequent
|
|
80
103
|
* calls. Handlers register this via `ctx.scope.defer(...)` so it
|
|
@@ -116,19 +139,21 @@ export declare function createKvCacheSession(modelId: string, options?: {
|
|
|
116
139
|
* Layers cleared, in order:
|
|
117
140
|
* 1. On-disk: `deleteCache(...)` removes the matching directory
|
|
118
141
|
* tree (or wipes and recreates the root for `all: true`).
|
|
119
|
-
* 2. `
|
|
142
|
+
* 2. `cachedPrefixes`: prefix-cleanup by the removed directory
|
|
120
143
|
* so any per-cache count under the deleted tree is forgotten.
|
|
121
|
-
* 3. `initializedCaches`:
|
|
122
|
-
*
|
|
144
|
+
* 3. `initializedCaches`: prefix-cleanup by the same removed
|
|
145
|
+
* directory, since it is keyed by the resolved cache path.
|
|
123
146
|
*
|
|
124
|
-
* Concurrency with in-flight turns: this delete
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* `
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
147
|
+
* Concurrency with in-flight turns: this delete does not take the
|
|
148
|
+
* per-cache-path write locks, so it races any turn holding a `TurnHandle`
|
|
149
|
+
* for the same key. Deleting a key that is in active use is unsupported.
|
|
150
|
+
* Each individual mutation is idempotent (`unlink` no-ops if missing,
|
|
151
|
+
* `Map.delete` / `Set.delete` no-op on absent keys), but the layers are
|
|
152
|
+
* cleared without a lock, so an interleaving that lands the delete's
|
|
153
|
+
* in-memory cleanup after a concurrent turn has already renamed/committed
|
|
154
|
+
* its file splits state: the file stays on disk while its saved-count and
|
|
155
|
+
* init flag are cleared, so the next turn sees the file, skips priming, and
|
|
156
|
+
* reports `savedCount=0`. Callers must not delete a key that is in active use.
|
|
132
157
|
*/
|
|
133
158
|
export declare function deleteKvCacheState(target: {
|
|
134
159
|
kvCacheKey: string;
|
|
@@ -148,8 +173,9 @@ export declare function deleteKvCacheState(target: {
|
|
|
148
173
|
export declare const __kvCacheSessionTestHooks: {
|
|
149
174
|
getSavedCount(cachePath: string): number | undefined;
|
|
150
175
|
setSavedCountForTest(cachePath: string, count: number): void;
|
|
151
|
-
|
|
152
|
-
|
|
176
|
+
getToolBlockCachedForTest(cachePath: string): boolean;
|
|
177
|
+
hasInitializedPath(cachePath: string): boolean;
|
|
178
|
+
getActivePathCountForTest(cachePath: string): number;
|
|
153
179
|
getLastAutoCacheSweepMsForTest(): number;
|
|
154
180
|
setLastAutoCacheSweepMsForTest(value: number): void;
|
|
155
181
|
resetForTest(): void;
|