@qvac/sdk 0.10.2 → 0.12.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.
Files changed (326) hide show
  1. package/NOTICE +1455 -29
  2. package/README.md +2 -0
  3. package/dist/client/api/cancel.d.ts +24 -32
  4. package/dist/client/api/cancel.js +58 -31
  5. package/dist/client/api/classify.d.ts +23 -0
  6. package/dist/client/api/classify.js +43 -0
  7. package/dist/client/api/client-request-id.d.ts +17 -0
  8. package/dist/client/api/client-request-id.js +27 -0
  9. package/dist/client/api/completion-stream.d.ts +1 -1
  10. package/dist/client/api/completion-stream.js +34 -3
  11. package/dist/client/api/diffusion.d.ts +46 -0
  12. package/dist/client/api/diffusion.js +50 -1
  13. package/dist/client/api/download-asset.d.ts +12 -2
  14. package/dist/client/api/download-asset.js +21 -3
  15. package/dist/client/api/embed.d.ts +8 -4
  16. package/dist/client/api/embed.js +14 -1
  17. package/dist/client/api/get-model-info.d.ts +1 -1
  18. package/dist/client/api/index.d.ts +5 -0
  19. package/dist/client/api/index.js +5 -0
  20. package/dist/client/api/load-model.d.ts +12 -4
  21. package/dist/client/api/load-model.js +49 -2
  22. package/dist/client/api/rag.d.ts +9 -3
  23. package/dist/client/api/rag.js +23 -3
  24. package/dist/client/api/transcribe.d.ts +23 -8
  25. package/dist/client/api/transcribe.js +69 -4
  26. package/dist/client/api/unload-model.d.ts +5 -2
  27. package/dist/client/api/unload-model.js +9 -4
  28. package/dist/client/api/upscale.d.ts +45 -0
  29. package/dist/client/api/upscale.js +99 -0
  30. package/dist/client/api/video.d.ts +64 -0
  31. package/dist/client/api/video.js +147 -0
  32. package/dist/client/api/vla-helpers.d.ts +45 -0
  33. package/dist/client/api/vla-helpers.js +130 -0
  34. package/dist/client/api/vla.d.ts +65 -0
  35. package/dist/client/api/vla.js +109 -0
  36. package/dist/client/config-loader/resolve-config.node.d.ts +16 -0
  37. package/dist/client/config-loader/resolve-config.node.js +77 -23
  38. package/dist/client/plugins-factory.d.ts +8 -0
  39. package/dist/client/plugins-factory.js +10 -0
  40. package/dist/client/rpc/bare-client.js +62 -66
  41. package/dist/client/rpc/ensure-worker-ready.d.ts +9 -0
  42. package/dist/client/rpc/ensure-worker-ready.js +17 -0
  43. package/dist/client/rpc/expo-rpc-client.js +2 -1
  44. package/dist/client/rpc/node-rpc-client.js +22 -8
  45. package/dist/client/rpc/rpc-client.d.ts +2 -2
  46. package/dist/client/rpc/rpc-client.js +10 -4
  47. package/dist/client/rpc/rpc-error.d.ts +9 -0
  48. package/dist/client/rpc/rpc-error.js +105 -0
  49. package/dist/commands/bundle/bare-pack.d.ts +13 -0
  50. package/dist/commands/bundle/bare-pack.js +54 -0
  51. package/dist/commands/bundle/constants.d.ts +7 -0
  52. package/dist/commands/bundle/constants.js +23 -0
  53. package/dist/commands/bundle/entry-gen.d.ts +2 -0
  54. package/dist/commands/bundle/entry-gen.js +48 -0
  55. package/dist/commands/bundle/index.d.ts +20 -0
  56. package/dist/commands/bundle/index.js +141 -0
  57. package/dist/commands/bundle/manifest.d.ts +21 -0
  58. package/dist/commands/bundle/manifest.js +193 -0
  59. package/dist/commands/bundle/plugins.d.ts +9 -0
  60. package/dist/commands/bundle/plugins.js +51 -0
  61. package/dist/commands/index.d.ts +5 -0
  62. package/dist/commands/index.js +2 -0
  63. package/dist/commands/verify/abi.d.ts +52 -0
  64. package/dist/commands/verify/abi.js +125 -0
  65. package/dist/commands/verify/addon-source.d.ts +43 -0
  66. package/dist/commands/verify/addon-source.js +75 -0
  67. package/dist/commands/verify/bundle-source.d.ts +12 -0
  68. package/dist/commands/verify/bundle-source.js +53 -0
  69. package/dist/commands/verify/index.d.ts +59 -0
  70. package/dist/commands/verify/index.js +371 -0
  71. package/dist/commands/verify/node-modules-source.d.ts +11 -0
  72. package/dist/commands/verify/node-modules-source.js +76 -0
  73. package/dist/commands/verify/prebuilds.d.ts +15 -0
  74. package/dist/commands/verify/prebuilds.js +39 -0
  75. package/dist/examples/cancel-by-request-id.d.ts +38 -0
  76. package/dist/examples/cancel-by-request-id.js +103 -0
  77. package/dist/examples/classification/classify-image.d.ts +2 -0
  78. package/dist/examples/classification/classify-image.js +23 -0
  79. package/dist/examples/diffusion-esrgan-upscale.d.ts +2 -0
  80. package/dist/examples/diffusion-esrgan-upscale.js +78 -0
  81. package/dist/examples/diffusion-txt2vid.d.ts +2 -0
  82. package/dist/examples/diffusion-txt2vid.js +81 -0
  83. package/dist/examples/download-with-cancel.js +10 -10
  84. package/dist/examples/embed-multi-gpu.d.ts +2 -0
  85. package/dist/examples/embed-multi-gpu.js +46 -0
  86. package/dist/examples/llamacpp-multi-gpu.d.ts +2 -0
  87. package/dist/examples/llamacpp-multi-gpu.js +57 -0
  88. package/dist/examples/plugins.js +3 -7
  89. package/dist/examples/rag/rag-hyperdb/cancellation.js +20 -17
  90. package/dist/examples/tools/llamacpp-tools-gemma4.d.ts +2 -0
  91. package/dist/examples/tools/llamacpp-tools-gemma4.js +73 -0
  92. package/dist/examples/tools/llamacpp-tools-qwen35.d.ts +2 -0
  93. package/dist/examples/tools/llamacpp-tools-qwen35.js +69 -0
  94. package/dist/examples/transcription/parakeet-ctc-filesystem.js +18 -12
  95. package/dist/examples/transcription/parakeet-microphone-record.js +7 -12
  96. package/dist/examples/transcription/parakeet-microphone-stream.d.ts +2 -0
  97. package/dist/examples/transcription/parakeet-microphone-stream.js +79 -0
  98. package/dist/examples/transcription/parakeet-sortformer-streaming.d.ts +2 -0
  99. package/dist/examples/transcription/parakeet-sortformer-streaming.js +121 -0
  100. package/dist/examples/transcription/parakeet-sortformer.js +58 -55
  101. package/dist/examples/transcription/parakeet-tdt-filesystem.js +18 -15
  102. package/dist/examples/transcription/whispercpp-microphone-conversation.d.ts +2 -0
  103. package/dist/examples/transcription/whispercpp-microphone-conversation.js +107 -0
  104. package/dist/examples/tts/chatterbox.js +7 -16
  105. package/dist/examples/tts/llm-to-tts-streaming.js +3 -10
  106. package/dist/examples/tts/supertonic-multilingual.js +4 -12
  107. package/dist/examples/tts/supertonic.js +5 -12
  108. package/dist/examples/vla-smolvla.d.ts +2 -0
  109. package/dist/examples/vla-smolvla.js +75 -0
  110. package/dist/examples/voice-assistant/voice-assistant.js +3 -10
  111. package/dist/expo/plugins/find-in-ancestor-node-modules.d.ts +14 -0
  112. package/dist/expo/plugins/find-in-ancestor-node-modules.js +24 -0
  113. package/dist/expo/plugins/get-project-root.d.ts +22 -0
  114. package/dist/expo/plugins/get-project-root.js +23 -0
  115. package/dist/expo/plugins/index.d.ts +4 -0
  116. package/dist/expo/plugins/index.js +4 -0
  117. package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +9 -2
  118. package/dist/expo/plugins/resolve-sdk-package-dir.js +38 -11
  119. package/dist/expo/plugins/withDeviceInfo.js +2 -1
  120. package/dist/expo/plugins/withMobileBundle.d.ts +5 -4
  121. package/dist/expo/plugins/withMobileBundle.js +42 -58
  122. package/dist/index.d.ts +6 -2
  123. package/dist/index.js +23 -2
  124. package/dist/models/registry/models.d.ts +3725 -514
  125. package/dist/models/registry/models.js +7269 -3910
  126. package/dist/models/update-models/naming.js +22 -8
  127. package/dist/pear/pre.d.ts +3 -0
  128. package/dist/pear/pre.js +9 -2
  129. package/dist/schemas/cancel.d.ts +172 -28
  130. package/dist/schemas/cancel.js +120 -19
  131. package/dist/schemas/classification.d.ts +53 -0
  132. package/dist/schemas/classification.js +33 -0
  133. package/dist/schemas/common.d.ts +860 -1379
  134. package/dist/schemas/common.js +8 -1
  135. package/dist/schemas/completion-event.d.ts +17 -0
  136. package/dist/schemas/completion-event.js +12 -1
  137. package/dist/schemas/completion-stream.d.ts +16 -1
  138. package/dist/schemas/completion-stream.js +25 -7
  139. package/dist/schemas/download-asset.d.ts +25 -9
  140. package/dist/schemas/download-asset.js +17 -6
  141. package/dist/schemas/embed.d.ts +1 -0
  142. package/dist/schemas/embed.js +5 -0
  143. package/dist/schemas/engine-addon-map.d.ts +3 -0
  144. package/dist/schemas/engine-addon-map.js +18 -5
  145. package/dist/schemas/error.d.ts +31 -0
  146. package/dist/schemas/error.js +29 -1
  147. package/dist/schemas/finetune.d.ts +2 -0
  148. package/dist/schemas/finetune.js +5 -0
  149. package/dist/schemas/get-model-info.d.ts +10 -6
  150. package/dist/schemas/get-model-info.js +2 -0
  151. package/dist/schemas/index.d.ts +3 -0
  152. package/dist/schemas/index.js +3 -0
  153. package/dist/schemas/llamacpp-config.d.ts +64 -8
  154. package/dist/schemas/llamacpp-config.js +12 -0
  155. package/dist/schemas/load-model.d.ts +4644 -8605
  156. package/dist/schemas/load-model.js +90 -7
  157. package/dist/schemas/model-src-utils.d.ts +34 -14
  158. package/dist/schemas/model-types.d.ts +54 -14
  159. package/dist/schemas/model-types.js +28 -5
  160. package/dist/schemas/ocr.d.ts +8 -3
  161. package/dist/schemas/plugin.d.ts +60 -6
  162. package/dist/schemas/plugin.js +31 -5
  163. package/dist/schemas/rag.d.ts +9 -0
  164. package/dist/schemas/rag.js +17 -9
  165. package/dist/schemas/registry.d.ts +74 -30
  166. package/dist/schemas/registry.js +5 -0
  167. package/dist/schemas/reload-config.d.ts +34 -14
  168. package/dist/schemas/sdcpp-config.d.ts +445 -16
  169. package/dist/schemas/sdcpp-config.js +387 -26
  170. package/dist/schemas/sdk-config.d.ts +2431 -2723
  171. package/dist/schemas/sdk-config.js +16 -1
  172. package/dist/schemas/sdk-errors-client.d.ts +6 -0
  173. package/dist/schemas/sdk-errors-client.js +31 -1
  174. package/dist/schemas/sdk-errors-server.d.ts +8 -1
  175. package/dist/schemas/sdk-errors-server.js +45 -5
  176. package/dist/schemas/text-to-speech.d.ts +81 -698
  177. package/dist/schemas/text-to-speech.js +46 -19
  178. package/dist/schemas/transcription-config.d.ts +40 -229
  179. package/dist/schemas/transcription-config.js +76 -15
  180. package/dist/schemas/transcription.d.ts +108 -2
  181. package/dist/schemas/transcription.js +81 -0
  182. package/dist/schemas/translate.d.ts +2 -0
  183. package/dist/schemas/translate.js +13 -2
  184. package/dist/schemas/translation-config.d.ts +90 -40
  185. package/dist/schemas/unload-model.d.ts +2 -1
  186. package/dist/schemas/unload-model.js +4 -1
  187. package/dist/schemas/vla.d.ts +87 -0
  188. package/dist/schemas/vla.js +108 -0
  189. package/dist/scripts/run-unit-tests.js +22 -3
  190. package/dist/server/bare/ops/cancel.d.ts +27 -1
  191. package/dist/server/bare/ops/cancel.js +36 -10
  192. package/dist/server/bare/ops/embed.d.ts +3 -3
  193. package/dist/server/bare/ops/embed.js +144 -28
  194. package/dist/server/bare/ops/kv-cache-utils.d.ts +0 -7
  195. package/dist/server/bare/ops/kv-cache-utils.js +8 -47
  196. package/dist/server/bare/ops/transcribe.d.ts +11 -5
  197. package/dist/server/bare/ops/transcribe.js +230 -50
  198. package/dist/server/bare/ops/translate.d.ts +1 -1
  199. package/dist/server/bare/ops/translate.js +197 -88
  200. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +6 -0
  201. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +30 -0
  202. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +32 -0
  203. package/dist/server/bare/plugins/ggml-classification/plugin.js +55 -0
  204. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +3 -0
  205. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +12 -0
  206. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +3 -0
  207. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +75 -0
  208. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +54 -0
  209. package/dist/server/bare/plugins/ggml-vla/plugin.js +57 -0
  210. package/dist/server/bare/plugins/index.d.ts +3 -1
  211. package/dist/server/bare/plugins/index.js +3 -1
  212. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +12 -3
  213. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +173 -172
  214. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +29 -0
  215. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +65 -0
  216. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +125 -21
  217. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +154 -0
  218. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +448 -0
  219. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +21 -73
  220. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +18 -101
  221. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +36 -3
  222. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +183 -85
  223. package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +10 -0
  224. package/dist/server/bare/plugins/llamacpp-completion/transform.js +34 -0
  225. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +7 -0
  226. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +10 -1
  227. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +42 -15
  228. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +5 -1
  229. package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +8 -3
  230. package/dist/server/bare/plugins/onnx-ocr/plugin.js +3 -0
  231. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +73 -244
  232. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +68 -96
  233. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +8 -0
  234. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +3 -0
  235. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +40 -0
  236. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -0
  237. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +199 -0
  238. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +288 -15
  239. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +150 -7
  240. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.js +2 -15
  241. package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.js +2 -1
  242. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +75 -0
  243. package/dist/server/bare/plugins/tts-ggml/plugin.js +189 -0
  244. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +47 -3
  245. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +61 -14
  246. package/dist/server/bare/rag-hyperdb/index.d.ts +1 -1
  247. package/dist/server/bare/rag-hyperdb/index.js +1 -1
  248. package/dist/server/bare/rag-hyperdb/rag-operation-manager.d.ts +26 -4
  249. package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +65 -28
  250. package/dist/server/bare/registry/model-config-utils.js +7 -0
  251. package/dist/server/bare/runtime/disposable-scope.d.ts +36 -0
  252. package/dist/server/bare/runtime/disposable-scope.js +69 -0
  253. package/dist/server/bare/runtime/index.d.ts +8 -0
  254. package/dist/server/bare/runtime/index.js +3 -0
  255. package/dist/server/bare/runtime/request-context.d.ts +49 -0
  256. package/dist/server/bare/runtime/request-context.js +1 -0
  257. package/dist/server/bare/runtime/request-id.d.ts +12 -0
  258. package/dist/server/bare/runtime/request-id.js +14 -0
  259. package/dist/server/bare/runtime/request-registry-singleton.d.ts +4 -0
  260. package/dist/server/bare/runtime/request-registry-singleton.js +27 -0
  261. package/dist/server/bare/runtime/request-registry.d.ts +136 -0
  262. package/dist/server/bare/runtime/request-registry.js +297 -0
  263. package/dist/server/bare/runtime/with-request-context.d.ts +22 -0
  264. package/dist/server/bare/runtime/with-request-context.js +53 -0
  265. package/dist/server/bare/runtime-lifecycle.js +9 -9
  266. package/dist/server/bare/types/addon-responses.d.ts +12 -1
  267. package/dist/server/env.js +4 -1
  268. package/dist/server/plugins/index.d.ts +1 -1
  269. package/dist/server/plugins/index.js +1 -1
  270. package/dist/server/plugins/registry.d.ts +1 -0
  271. package/dist/server/plugins/registry.js +5 -0
  272. package/dist/server/rpc/handler-registry.js +30 -7
  273. package/dist/server/rpc/handler-selection.d.ts +9 -0
  274. package/dist/server/rpc/handler-selection.js +14 -0
  275. package/dist/server/rpc/handler-utils.js +5 -13
  276. package/dist/server/rpc/handlers/cancel-delegated.js +28 -31
  277. package/dist/server/rpc/handlers/cancelHandler.d.ts +30 -1
  278. package/dist/server/rpc/handlers/cancelHandler.js +54 -22
  279. package/dist/server/rpc/handlers/classify.d.ts +3 -0
  280. package/dist/server/rpc/handlers/classify.js +4 -0
  281. package/dist/server/rpc/handlers/delete-cache.d.ts +9 -0
  282. package/dist/server/rpc/handlers/delete-cache.js +13 -15
  283. package/dist/server/rpc/handlers/download-asset.js +133 -40
  284. package/dist/server/rpc/handlers/index.d.ts +4 -0
  285. package/dist/server/rpc/handlers/index.js +4 -0
  286. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +60 -2
  287. package/dist/server/rpc/handlers/load-model/download-manager.js +141 -8
  288. package/dist/server/rpc/handlers/load-model/handler.js +216 -98
  289. package/dist/server/rpc/handlers/load-model/http.js +3 -3
  290. package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -1
  291. package/dist/server/rpc/handlers/load-model/registry.js +1 -1
  292. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +20 -1
  293. package/dist/server/rpc/handlers/load-model/resolve-session.js +6 -5
  294. package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -2
  295. package/dist/server/rpc/handlers/load-model/resolve.js +18 -6
  296. package/dist/server/rpc/handlers/load-model/types.d.ts +24 -0
  297. package/dist/server/rpc/handlers/rag.js +133 -15
  298. package/dist/server/rpc/handlers/upscale-stream.d.ts +3 -0
  299. package/dist/server/rpc/handlers/upscale-stream.js +4 -0
  300. package/dist/server/rpc/handlers/video-stream.d.ts +3 -0
  301. package/dist/server/rpc/handlers/video-stream.js +4 -0
  302. package/dist/server/rpc/profiling/operation-metrics.js +23 -0
  303. package/dist/server/utils/completion-normalizer.js +8 -0
  304. package/dist/server/utils/config-transform.js +1 -1
  305. package/dist/server/utils/tools/dialect.js +4 -0
  306. package/dist/server/utils/tools/parser.js +16 -1
  307. package/dist/server/utils/tools/parsers/gemma4native.d.ts +4 -0
  308. package/dist/server/utils/tools/parsers/gemma4native.js +60 -0
  309. package/dist/server/utils/tools/parsers/qwen35.d.ts +4 -0
  310. package/dist/server/utils/tools/parsers/qwen35.js +120 -0
  311. package/dist/server/worker.js +14 -11
  312. package/dist/utils/aggregate-events.d.ts +9 -0
  313. package/dist/utils/aggregate-events.js +18 -3
  314. package/dist/utils/decorate-promise.d.ts +34 -0
  315. package/dist/utils/decorate-promise.js +35 -0
  316. package/dist/utils/errors-client.d.ts +18 -0
  317. package/dist/utils/errors-client.js +31 -0
  318. package/dist/utils/errors-server.d.ts +115 -2
  319. package/dist/utils/errors-server.js +148 -3
  320. package/package.json +68 -77
  321. package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -490
  322. package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -266
  323. package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
  324. package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
  325. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.d.ts +0 -0
  326. /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.d.ts +0 -0
@@ -19,13 +19,14 @@ import { deleteCacheRequestSchema, deleteCacheResponseSchema, } from "./delete-c
19
19
  import { getModelInfoRequestSchema, getModelInfoResponseSchema, } from "./get-model-info.js";
20
20
  import { getLoadedModelInfoRequestSchema, getLoadedModelInfoResponseSchema, } from "./get-loaded-model-info.js";
21
21
  import { ocrStreamRequestSchema, ocrStreamResponseSchema } from "./ocr.js";
22
- import { diffusionStreamRequestSchema, diffusionStreamResponseSchema, } from "./sdcpp-config.js";
22
+ import { diffusionStreamRequestSchema, diffusionStreamResponseSchema, videoStreamRequestSchema, videoStreamResponseSchema, upscaleStreamRequestSchema, upscaleStreamResponseSchema, } from "./sdcpp-config.js";
23
23
  import { finetuneRequestSchema, finetuneResponseSchema, finetuneProgressResponseSchema, } from "./finetune.js";
24
24
  import { pluginInvokeRequestSchema, pluginInvokeResponseSchema, pluginInvokeStreamRequestSchema, pluginInvokeStreamResponseSchema, } from "./plugin.js";
25
25
  import { modelRegistryListRequestSchema, modelRegistryListResponseSchema, modelRegistrySearchRequestSchema, modelRegistrySearchResponseSchema, modelRegistryGetModelRequestSchema, modelRegistryGetModelResponseSchema, } from "./registry.js";
26
26
  import { suspendRequestSchema, suspendResponseSchema } from "./suspend.js";
27
27
  import { resumeRequestSchema, resumeResponseSchema } from "./resume.js";
28
28
  import { stateRequestSchema, stateResponseSchema } from "./state.js";
29
+ import { classifyRequestSchema, classifyResponseSchema, } from "./classification.js";
29
30
  export const requestSchema = z.union([
30
31
  heartbeatRequestSchema,
31
32
  loadModelRequestSchema,
@@ -48,6 +49,8 @@ export const requestSchema = z.union([
48
49
  getLoadedModelInfoRequestSchema,
49
50
  ocrStreamRequestSchema,
50
51
  diffusionStreamRequestSchema,
52
+ videoStreamRequestSchema,
53
+ upscaleStreamRequestSchema,
51
54
  finetuneRequestSchema,
52
55
  pluginInvokeRequestSchema,
53
56
  pluginInvokeStreamRequestSchema,
@@ -57,6 +60,7 @@ export const requestSchema = z.union([
57
60
  suspendRequestSchema,
58
61
  resumeRequestSchema,
59
62
  stateRequestSchema,
63
+ classifyRequestSchema,
60
64
  ]);
61
65
  export const responseSchema = z.discriminatedUnion("type", [
62
66
  heartbeatResponseSchema,
@@ -83,6 +87,8 @@ export const responseSchema = z.discriminatedUnion("type", [
83
87
  getLoadedModelInfoResponseSchema,
84
88
  ocrStreamResponseSchema,
85
89
  diffusionStreamResponseSchema,
90
+ videoStreamResponseSchema,
91
+ upscaleStreamResponseSchema,
86
92
  finetuneResponseSchema,
87
93
  finetuneProgressResponseSchema,
88
94
  pluginInvokeResponseSchema,
@@ -93,6 +99,7 @@ export const responseSchema = z.discriminatedUnion("type", [
93
99
  suspendResponseSchema,
94
100
  resumeResponseSchema,
95
101
  stateResponseSchema,
102
+ classifyResponseSchema,
96
103
  ]);
97
104
  export const rpcOptionsSchema = z.object({
98
105
  timeout: z
@@ -5,6 +5,7 @@ export declare const completionStatsSchema: z.ZodObject<{
5
5
  timeToFirstToken: z.ZodOptional<z.ZodNumber>;
6
6
  tokensPerSecond: z.ZodOptional<z.ZodNumber>;
7
7
  cacheTokens: z.ZodOptional<z.ZodNumber>;
8
+ promptTokens: z.ZodOptional<z.ZodNumber>;
8
9
  generatedTokens: z.ZodOptional<z.ZodNumber>;
9
10
  backendDevice: z.ZodOptional<z.ZodEnum<{
10
11
  cpu: "cpu";
@@ -58,6 +59,7 @@ export declare const statsEventSchema: z.ZodObject<{
58
59
  timeToFirstToken: z.ZodOptional<z.ZodNumber>;
59
60
  tokensPerSecond: z.ZodOptional<z.ZodNumber>;
60
61
  cacheTokens: z.ZodOptional<z.ZodNumber>;
62
+ promptTokens: z.ZodOptional<z.ZodNumber>;
61
63
  generatedTokens: z.ZodOptional<z.ZodNumber>;
62
64
  backendDevice: z.ZodOptional<z.ZodEnum<{
63
65
  cpu: "cpu";
@@ -69,6 +71,7 @@ export declare const completionErrorSchema: z.ZodObject<{
69
71
  message: z.ZodString;
70
72
  }, z.core.$strip>;
71
73
  declare const stopReasonEnum: z.ZodEnum<{
74
+ cancelled: "cancelled";
72
75
  eos: "eos";
73
76
  length: "length";
74
77
  stopSequence: "stopSequence";
@@ -87,6 +90,7 @@ export declare const doneEventSchema: z.ZodUnion<readonly [z.ZodObject<{
87
90
  type: z.ZodLiteral<"completionDone">;
88
91
  seq: z.ZodNumber;
89
92
  stopReason: z.ZodOptional<z.ZodEnum<{
93
+ cancelled: "cancelled";
90
94
  eos: "eos";
91
95
  length: "length";
92
96
  stopSequence: "stopSequence";
@@ -135,6 +139,7 @@ export declare const completionEventSchema: z.ZodUnion<readonly [z.ZodObject<{
135
139
  timeToFirstToken: z.ZodOptional<z.ZodNumber>;
136
140
  tokensPerSecond: z.ZodOptional<z.ZodNumber>;
137
141
  cacheTokens: z.ZodOptional<z.ZodNumber>;
142
+ promptTokens: z.ZodOptional<z.ZodNumber>;
138
143
  generatedTokens: z.ZodOptional<z.ZodNumber>;
139
144
  backendDevice: z.ZodOptional<z.ZodEnum<{
140
145
  cpu: "cpu";
@@ -155,6 +160,7 @@ export declare const completionEventSchema: z.ZodUnion<readonly [z.ZodObject<{
155
160
  type: z.ZodLiteral<"completionDone">;
156
161
  seq: z.ZodNumber;
157
162
  stopReason: z.ZodOptional<z.ZodEnum<{
163
+ cancelled: "cancelled";
158
164
  eos: "eos";
159
165
  length: "length";
160
166
  stopSequence: "stopSequence";
@@ -197,6 +203,17 @@ export type CompletionFinal = {
197
203
  cacheableAssistantContent?: string;
198
204
  };
199
205
  export type CompletionRun = {
206
+ /**
207
+ * Stable identifier for this run, generated client-side at call time
208
+ * (UUIDv4 when `crypto.randomUUID` is available, otherwise an opaque
209
+ * random hex token) and available synchronously the moment
210
+ * `completion(...)` returns. Pass it to `cancel({ requestId })` to
211
+ * target this specific request without affecting any other inference
212
+ * running on the same model. The cancel only takes effect once the
213
+ * server has begun the request, so a cancel issued in the same tick
214
+ * as `completion(...)` may race the begin and is logged as a no-match.
215
+ */
216
+ requestId: string;
200
217
  /** Ordered stream of typed completion events — the canonical consumption API. */
201
218
  events: AsyncIterable<CompletionEvent>;
202
219
  /** Resolves when the stream ends with aggregated content, thinking, tool calls, stats, and raw output. */
@@ -4,6 +4,7 @@ export const completionStatsSchema = z.object({
4
4
  timeToFirstToken: z.number().optional(),
5
5
  tokensPerSecond: z.number().optional(),
6
6
  cacheTokens: z.number().optional(),
7
+ promptTokens: z.number().optional(),
7
8
  generatedTokens: z.number().optional(),
8
9
  backendDevice: z.enum(["cpu", "gpu"]).optional(),
9
10
  });
@@ -44,7 +45,17 @@ export const completionErrorSchema = z.object({
44
45
  const rawOutputSchema = z.object({
45
46
  fullText: z.string(),
46
47
  });
47
- const stopReasonEnum = z.enum(["eos", "length", "stopSequence"]);
48
+ // `"cancelled"` is a clean termination, not a mid-stream failure: the
49
+ // stream ended on purpose because the request was aborted, just not at
50
+ // EOS. It rides the success-done path (alongside "eos" / "length" /
51
+ // "stopSequence") so consumers iterating `events` see the stream end
52
+ // naturally. The companion error path (`errorDoneSchema` below) keeps
53
+ // `stopReason: "error"` for actual mid-stream failures where the
54
+ // partial state is unsafe to use. The promise-aggregates on the
55
+ // client-side `CompletionRun` (`final` / `text` / `toolCalls` / `stats`)
56
+ // reject with `InferenceCancelledError` carrying the partial state — see
57
+ // `client/api/completion-stream.ts` for the rejection plumbing.
58
+ const stopReasonEnum = z.enum(["eos", "length", "stopSequence", "cancelled"]);
48
59
  const successDoneSchema = z
49
60
  .object({
50
61
  type: z.literal("completionDone"),
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export { completionStatsSchema, type CompletionStats } from "./completion-event";
2
+ export { completionStatsSchema, type CompletionStats, } from "./completion-event";
3
3
  /**
4
4
  * Tool-call output dialect. Auto-detected from the model name; pass via
5
5
  * `completion({ toolDialect })` to override.
@@ -9,12 +9,16 @@ export { completionStatsSchema, type CompletionStats } from "./completion-event"
9
9
  * - `"pythonic"`: `[get_weather(city="Tokyo")]` (optionally `<|tool_call_start|>...<|tool_call_end|>`-wrapped)
10
10
  * - `"json"`: `{"name":"get_weather","arguments":{"city":"Tokyo"}}` or `{"tool_calls":[{"name":"...","arguments":{...}}]}`
11
11
  * - `"harmony"`: `<|channel|>commentary to=functions.get_weather <|constrain|>json<|message|>{"city":"Tokyo"}<|call|>`
12
+ * - `"qwen35"`: `<tool_call><function=NAME><parameter=KEY>VALUE</parameter></function></tool_call>`
13
+ * - `"gemma4"`: `<|tool_call>call:NAME{key:<|"|>val<|"|>,...}<tool_call|>`
12
14
  */
13
15
  export declare const toolDialectSchema: z.ZodEnum<{
14
16
  hermes: "hermes";
15
17
  pythonic: "pythonic";
16
18
  json: "json";
17
19
  harmony: "harmony";
20
+ qwen35: "qwen35";
21
+ gemma4: "gemma4";
18
22
  }>;
19
23
  export declare const attachmentSchema: z.ZodObject<{
20
24
  path: z.ZodString;
@@ -28,6 +32,7 @@ export declare const generationParamsSchema: z.ZodObject<{
28
32
  frequency_penalty: z.ZodOptional<z.ZodNumber>;
29
33
  presence_penalty: z.ZodOptional<z.ZodNumber>;
30
34
  repeat_penalty: z.ZodOptional<z.ZodNumber>;
35
+ reasoning_budget: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
31
36
  }, z.core.$strict>;
32
37
  export declare const responseFormatSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
38
  type: z.ZodLiteral<"text">;
@@ -94,6 +99,7 @@ export declare const completionClientParamsSchema: z.ZodObject<{
94
99
  frequency_penalty: z.ZodOptional<z.ZodNumber>;
95
100
  presence_penalty: z.ZodOptional<z.ZodNumber>;
96
101
  repeat_penalty: z.ZodOptional<z.ZodNumber>;
102
+ reasoning_budget: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
97
103
  }, z.core.$strict>>;
98
104
  captureThinking: z.ZodOptional<z.ZodBoolean>;
99
105
  emitRawDeltas: z.ZodOptional<z.ZodBoolean>;
@@ -102,6 +108,8 @@ export declare const completionClientParamsSchema: z.ZodObject<{
102
108
  pythonic: "pythonic";
103
109
  json: "json";
104
110
  harmony: "harmony";
111
+ qwen35: "qwen35";
112
+ gemma4: "gemma4";
105
113
  }>>;
106
114
  responseFormat: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
107
115
  type: z.ZodLiteral<"text">;
@@ -116,6 +124,7 @@ export declare const completionClientParamsSchema: z.ZodObject<{
116
124
  strict: z.ZodOptional<z.ZodBoolean>;
117
125
  }, z.core.$strict>;
118
126
  }, z.core.$strict>], "type">>;
127
+ requestId: z.ZodOptional<z.ZodString>;
119
128
  }, z.core.$strip>;
120
129
  export declare const completionStreamRequestSchema: z.ZodObject<{
121
130
  history: z.ZodArray<z.ZodObject<{
@@ -158,6 +167,7 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
158
167
  frequency_penalty: z.ZodOptional<z.ZodNumber>;
159
168
  presence_penalty: z.ZodOptional<z.ZodNumber>;
160
169
  repeat_penalty: z.ZodOptional<z.ZodNumber>;
170
+ reasoning_budget: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
161
171
  }, z.core.$strict>>;
162
172
  captureThinking: z.ZodOptional<z.ZodBoolean>;
163
173
  emitRawDeltas: z.ZodOptional<z.ZodBoolean>;
@@ -166,6 +176,8 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
166
176
  pythonic: "pythonic";
167
177
  json: "json";
168
178
  harmony: "harmony";
179
+ qwen35: "qwen35";
180
+ gemma4: "gemma4";
169
181
  }>>;
170
182
  responseFormat: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
171
183
  type: z.ZodLiteral<"text">;
@@ -180,6 +192,7 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
180
192
  strict: z.ZodOptional<z.ZodBoolean>;
181
193
  }, z.core.$strict>;
182
194
  }, z.core.$strict>], "type">>;
195
+ requestId: z.ZodOptional<z.ZodString>;
183
196
  type: z.ZodLiteral<"completionStream">;
184
197
  }, z.core.$strip>;
185
198
  export declare const completionStreamResponseSchema: z.ZodObject<{
@@ -225,6 +238,7 @@ export declare const completionStreamResponseSchema: z.ZodObject<{
225
238
  timeToFirstToken: z.ZodOptional<z.ZodNumber>;
226
239
  tokensPerSecond: z.ZodOptional<z.ZodNumber>;
227
240
  cacheTokens: z.ZodOptional<z.ZodNumber>;
241
+ promptTokens: z.ZodOptional<z.ZodNumber>;
228
242
  generatedTokens: z.ZodOptional<z.ZodNumber>;
229
243
  backendDevice: z.ZodOptional<z.ZodEnum<{
230
244
  cpu: "cpu";
@@ -245,6 +259,7 @@ export declare const completionStreamResponseSchema: z.ZodObject<{
245
259
  type: z.ZodLiteral<"completionDone">;
246
260
  seq: z.ZodNumber;
247
261
  stopReason: z.ZodOptional<z.ZodEnum<{
262
+ cancelled: "cancelled";
248
263
  eos: "eos";
249
264
  length: "length";
250
265
  stopSequence: "stopSequence";
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { toolSchema } from "./tools.js";
3
3
  import { completionEventSchema } from "./completion-event.js";
4
- export { completionStatsSchema } from "./completion-event.js";
4
+ export { completionStatsSchema, } from "./completion-event.js";
5
5
  /**
6
6
  * Tool-call output dialect. Auto-detected from the model name; pass via
7
7
  * `completion({ toolDialect })` to override.
@@ -11,8 +11,17 @@ export { completionStatsSchema } from "./completion-event.js";
11
11
  * - `"pythonic"`: `[get_weather(city="Tokyo")]` (optionally `<|tool_call_start|>...<|tool_call_end|>`-wrapped)
12
12
  * - `"json"`: `{"name":"get_weather","arguments":{"city":"Tokyo"}}` or `{"tool_calls":[{"name":"...","arguments":{...}}]}`
13
13
  * - `"harmony"`: `<|channel|>commentary to=functions.get_weather <|constrain|>json<|message|>{"city":"Tokyo"}<|call|>`
14
+ * - `"qwen35"`: `<tool_call><function=NAME><parameter=KEY>VALUE</parameter></function></tool_call>`
15
+ * - `"gemma4"`: `<|tool_call>call:NAME{key:<|"|>val<|"|>,...}<tool_call|>`
14
16
  */
15
- export const toolDialectSchema = z.enum(["hermes", "pythonic", "json", "harmony"]);
17
+ export const toolDialectSchema = z.enum([
18
+ "hermes",
19
+ "pythonic",
20
+ "json",
21
+ "harmony",
22
+ "qwen35",
23
+ "gemma4"
24
+ ]);
16
25
  export const attachmentSchema = z.object({
17
26
  path: z
18
27
  .string()
@@ -40,10 +49,7 @@ export const generationParamsSchema = z
40
49
  .number()
41
50
  .optional()
42
51
  .describe("Max tokens to predict. `-1` = until stop token, `-2` = until context filled."),
43
- seed: z
44
- .number()
45
- .optional()
46
- .describe("Random seed for reproducibility."),
52
+ seed: z.number().optional().describe("Random seed for reproducibility."),
47
53
  frequency_penalty: z
48
54
  .number()
49
55
  .optional()
@@ -56,6 +62,10 @@ export const generationParamsSchema = z
56
62
  .number()
57
63
  .optional()
58
64
  .describe("Penalty applied to repeated tokens."),
65
+ reasoning_budget: z
66
+ .union([z.literal(-1), z.literal(0)])
67
+ .optional()
68
+ .describe("Per-request reasoning channel budget. `-1` keeps the model's reasoning channel on; `0` disables it for this request. Equivalent to the load-time `reasoning_budget` config but scoped to a single `run()` call; the prior value is restored afterwards."),
59
69
  })
60
70
  .strict();
61
71
  const jsonSchemaObjectSchema = z.record(z.string(), z.unknown());
@@ -67,7 +77,10 @@ export const responseFormatSchema = z.discriminatedUnion("type", [
67
77
  type: z.literal("json_schema"),
68
78
  json_schema: z
69
79
  .object({
70
- name: z.string().min(1).describe("Schema identifier; OpenAI-compatibility only — not used by the addon."),
80
+ name: z
81
+ .string()
82
+ .min(1)
83
+ .describe("Schema identifier; OpenAI-compatibility only — not used by the addon."),
71
84
  description: z
72
85
  .string()
73
86
  .optional()
@@ -128,6 +141,11 @@ const completionClientParamsBaseSchema = completionParamsSchema.extend({
128
141
  responseFormat: responseFormatSchema
129
142
  .optional()
130
143
  .describe("Optional structured-output constraint: `text` (default, free-form), `json_object` (any valid JSON), or `json_schema` (output conforms to the provided JSON Schema). Mutually exclusive with `tools`."),
144
+ requestId: z
145
+ .string()
146
+ .min(1)
147
+ .optional()
148
+ .describe("Stable identifier for this in-flight request, generated by the client at call time (opaque token, UUIDv4 when available). Surfaced on the `CompletionRun` result so callers can target it with `cancel({ requestId })`. Optional on the wire so legacy clients keep working — the server falls back to a server-generated id when the field is missing. Note: cancel-by-requestId only takes effect once the server has begun the request, so a cancel issued in the same tick as `completion()` may arrive before the request is registered."),
131
149
  });
132
150
  function refineNoToolsWithStructuredOutput(data, ctx) {
133
151
  if (data.responseFormat &&
@@ -14,21 +14,26 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
14
14
  sha256Checksum: z.ZodOptional<z.ZodString>;
15
15
  addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
16
16
  embeddings: "embeddings";
17
+ diffusion: "diffusion";
18
+ tts: "tts";
19
+ ocr: "ocr";
20
+ vla: "vla";
17
21
  "llamacpp-completion": "llamacpp-completion";
18
22
  "whispercpp-transcription": "whispercpp-transcription";
19
23
  "llamacpp-embedding": "llamacpp-embedding";
20
24
  "nmtcpp-translation": "nmtcpp-translation";
21
25
  "onnx-tts": "onnx-tts";
26
+ "tts-ggml": "tts-ggml";
22
27
  "parakeet-transcription": "parakeet-transcription";
23
28
  "onnx-ocr": "onnx-ocr";
24
29
  "sdcpp-generation": "sdcpp-generation";
30
+ "ggml-vla": "ggml-vla";
31
+ "ggml-classification": "ggml-classification";
25
32
  llm: "llm";
26
33
  whisper: "whisper";
27
34
  nmt: "nmt";
28
35
  parakeet: "parakeet";
29
- tts: "tts";
30
- ocr: "ocr";
31
- diffusion: "diffusion";
36
+ classification: "classification";
32
37
  }>, z.ZodLiteral<"vad">]>>;
33
38
  }, z.core.$strip>]>;
34
39
  seed: z.ZodOptional<z.ZodBoolean>;
@@ -45,7 +50,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
45
50
  engine?: string | undefined;
46
51
  expectedSize?: number | undefined;
47
52
  sha256Checksum?: string | undefined;
48
- addon?: "embeddings" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
53
+ addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
49
54
  };
50
55
  }, {
51
56
  assetSrc: string | {
@@ -59,7 +64,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
59
64
  engine?: string | undefined;
60
65
  expectedSize?: number | undefined;
61
66
  sha256Checksum?: string | undefined;
62
- addon?: "embeddings" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
67
+ addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
63
68
  };
64
69
  seed?: boolean | undefined;
65
70
  }>>;
@@ -77,31 +82,38 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
77
82
  sha256Checksum: z.ZodOptional<z.ZodString>;
78
83
  addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
79
84
  embeddings: "embeddings";
85
+ diffusion: "diffusion";
86
+ tts: "tts";
87
+ ocr: "ocr";
88
+ vla: "vla";
80
89
  "llamacpp-completion": "llamacpp-completion";
81
90
  "whispercpp-transcription": "whispercpp-transcription";
82
91
  "llamacpp-embedding": "llamacpp-embedding";
83
92
  "nmtcpp-translation": "nmtcpp-translation";
84
93
  "onnx-tts": "onnx-tts";
94
+ "tts-ggml": "tts-ggml";
85
95
  "parakeet-transcription": "parakeet-transcription";
86
96
  "onnx-ocr": "onnx-ocr";
87
97
  "sdcpp-generation": "sdcpp-generation";
98
+ "ggml-vla": "ggml-vla";
99
+ "ggml-classification": "ggml-classification";
88
100
  llm: "llm";
89
101
  whisper: "whisper";
90
102
  nmt: "nmt";
91
103
  parakeet: "parakeet";
92
- tts: "tts";
93
- ocr: "ocr";
94
- diffusion: "diffusion";
104
+ classification: "classification";
95
105
  }>, z.ZodLiteral<"vad">]>>;
96
106
  }, z.core.$strip>]>;
97
107
  seed: z.ZodOptional<z.ZodBoolean>;
98
108
  onProgress: z.ZodOptional<z.ZodUnknown>;
99
109
  withProgress: z.ZodOptional<z.ZodBoolean>;
110
+ requestId: z.ZodOptional<z.ZodString>;
100
111
  }, z.core.$strip>, z.ZodTransform<{
101
112
  type: "downloadAsset";
102
113
  assetSrc: string;
103
114
  withProgress: boolean;
104
115
  seed: boolean;
116
+ requestId?: string;
105
117
  }, {
106
118
  assetSrc: string | {
107
119
  src: string;
@@ -114,27 +126,31 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
114
126
  engine?: string | undefined;
115
127
  expectedSize?: number | undefined;
116
128
  sha256Checksum?: string | undefined;
117
- addon?: "embeddings" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
129
+ addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
118
130
  };
119
131
  seed?: boolean | undefined;
120
132
  onProgress?: unknown;
121
133
  withProgress?: boolean | undefined;
134
+ requestId?: string | undefined;
122
135
  }>>;
123
136
  export declare const downloadAssetRequestSchema: z.ZodPipe<z.ZodObject<{
124
137
  type: z.ZodLiteral<"downloadAsset">;
125
138
  assetSrc: z.ZodString;
126
139
  withProgress: z.ZodOptional<z.ZodBoolean>;
127
140
  seed: z.ZodOptional<z.ZodBoolean>;
141
+ requestId: z.ZodOptional<z.ZodString>;
128
142
  }, z.core.$strip>, z.ZodTransform<{
129
143
  seed: boolean;
130
144
  type: "downloadAsset";
131
145
  assetSrc: string;
132
146
  withProgress?: boolean | undefined;
147
+ requestId?: string | undefined;
133
148
  }, {
134
149
  type: "downloadAsset";
135
150
  assetSrc: string;
136
151
  withProgress?: boolean | undefined;
137
152
  seed?: boolean | undefined;
153
+ requestId?: string | undefined;
138
154
  }>>;
139
155
  export declare const downloadAssetResponseSchema: z.ZodObject<{
140
156
  type: z.ZodLiteral<"downloadAsset">;
@@ -12,19 +12,30 @@ export const downloadAssetOptionsToRequestSchema = downloadAssetOptionsBaseSchem
12
12
  .extend({
13
13
  onProgress: z.unknown().optional(),
14
14
  withProgress: z.boolean().optional(),
15
+ requestId: z.string().min(1).optional(),
15
16
  })
16
- .transform((data) => ({
17
- type: "downloadAsset",
18
- assetSrc: modelInputToSrcSchema.parse(data.assetSrc),
19
- withProgress: data.withProgress ?? !!data.onProgress,
20
- seed: data.seed ?? false,
21
- }));
17
+ .transform((data) => {
18
+ const out = {
19
+ type: "downloadAsset",
20
+ assetSrc: modelInputToSrcSchema.parse(data.assetSrc),
21
+ withProgress: data.withProgress ?? !!data.onProgress,
22
+ seed: data.seed ?? false,
23
+ };
24
+ if (data.requestId !== undefined)
25
+ out.requestId = data.requestId;
26
+ return out;
27
+ });
22
28
  export const downloadAssetRequestSchema = z
23
29
  .object({
24
30
  type: z.literal("downloadAsset"),
25
31
  assetSrc: z.string(),
26
32
  withProgress: z.boolean().optional(),
27
33
  seed: z.boolean().optional(),
34
+ requestId: z
35
+ .string()
36
+ .min(1)
37
+ .optional()
38
+ .describe("Stable identifier for this in-flight download, generated by the client at call time. Optional on the wire so legacy clients keep working — the server falls back to a server-generated id when the field is missing. Exposed on the client-side decorated promise so callers can target this download with `cancel({ requestId })`."),
28
39
  })
29
40
  .transform((data) => ({
30
41
  ...data,
@@ -7,6 +7,7 @@ export declare const embedRequestSchema: z.ZodObject<{
7
7
  modelId: z.ZodString;
8
8
  text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
9
9
  type: z.ZodLiteral<"embed">;
10
+ requestId: z.ZodOptional<z.ZodString>;
10
11
  }, z.core.$strip>;
11
12
  export declare const embedStatsSchema: z.ZodObject<{
12
13
  totalTime: z.ZodOptional<z.ZodNumber>;
@@ -12,6 +12,11 @@ export const embedParamsSchema = z.object({
12
12
  });
13
13
  export const embedRequestSchema = embedParamsSchema.extend({
14
14
  type: z.literal("embed"),
15
+ requestId: z
16
+ .string()
17
+ .min(1)
18
+ .optional()
19
+ .describe("Stable identifier for this in-flight embed, generated by the client at call time. Surfaces on the registry so callers can target it with `cancel({ requestId })`. Optional on the wire — the server falls back to a server-generated id when the field is missing."),
15
20
  });
16
21
  export const embedStatsSchema = z.object({
17
22
  totalTime: z
@@ -5,9 +5,12 @@ export declare const ENGINE_TO_ADDON: {
5
5
  readonly "llamacpp-embedding": "embeddings";
6
6
  readonly "nmtcpp-translation": "nmt";
7
7
  readonly "onnx-tts": "tts";
8
+ readonly "tts-ggml": "tts";
8
9
  readonly "onnx-ocr": "ocr";
9
10
  readonly "parakeet-transcription": "parakeet";
10
11
  readonly "sdcpp-generation": "diffusion";
12
+ readonly "ggml-vla": "vla";
13
+ readonly "ggml-classification": "classification";
11
14
  readonly "onnx-vad": "vad";
12
15
  };
13
16
  export declare function resolveCanonicalEngine(engine: string): ModelRegistryEngine | null;
@@ -1,5 +1,5 @@
1
1
  import { ModelType } from "./model-types.js";
2
- import { ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_WHISPER, } from "./plugin.js";
2
+ import { ADDON_CLASSIFICATION, ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_VLA, ADDON_WHISPER, } from "./plugin.js";
3
3
  import { modelRegistryEngineSchema, } from "./registry.js";
4
4
  // Canonical engine → addon mapping (exhaustive). `as const` preserves
5
5
  // per-key literals so the addon can be derived from the engine at the type level.
@@ -9,9 +9,12 @@ export const ENGINE_TO_ADDON = {
9
9
  [ModelType.llamacppEmbedding]: "embeddings",
10
10
  [ModelType.nmtcppTranslation]: "nmt",
11
11
  [ModelType.onnxTts]: "tts",
12
+ [ModelType.ttsGgml]: "tts",
12
13
  [ModelType.onnxOcr]: "ocr",
13
14
  [ModelType.parakeetTranscription]: "parakeet",
14
15
  [ModelType.sdcppGeneration]: "diffusion",
16
+ [ModelType.ggmlVla]: "vla",
17
+ [ModelType.ggmlClassification]: "classification",
15
18
  "onnx-vad": "vad",
16
19
  };
17
20
  // Legacy engine names → canonical engine.
@@ -21,29 +24,39 @@ const LEGACY_ENGINE_TO_CANONICAL = {
21
24
  [ADDON_WHISPER]: ModelType.whispercppTranscription,
22
25
  [ADDON_EMBEDDING]: ModelType.llamacppEmbedding,
23
26
  [ADDON_NMT]: ModelType.nmtcppTranslation,
24
- [ADDON_TTS]: ModelType.onnxTts,
27
+ [ADDON_TTS]: ModelType.ttsGgml,
25
28
  [ADDON_OCR]: ModelType.onnxOcr,
26
29
  [ADDON_PARAKEET]: ModelType.parakeetTranscription,
27
30
  "@qvac/translation-llamacpp": ModelType.nmtcppTranslation,
28
31
  "@qvac/vad-silero": "onnx-vad",
29
- "@qvac/tts": ModelType.onnxTts,
32
+ // Legacy package / tag names from the ONNX era — resolve to the GGML engine.
33
+ "@qvac/tts": ModelType.ttsGgml,
34
+ "@qvac/tts-onnx": ModelType.ttsGgml,
30
35
  // Tag-style names (used by some older registry entries)
31
36
  generation: ModelType.llamacppCompletion,
32
37
  transcription: ModelType.whispercppTranscription,
33
38
  embedding: ModelType.llamacppEmbedding,
34
39
  translation: ModelType.nmtcppTranslation,
35
40
  vad: "onnx-vad",
36
- tts: ModelType.onnxTts,
41
+ tts: ModelType.ttsGgml,
37
42
  ocr: ModelType.onnxOcr,
38
43
  [ADDON_DIFFUSION]: ModelType.sdcppGeneration,
39
44
  diffusion: ModelType.sdcppGeneration,
45
+ [ADDON_VLA]: ModelType.ggmlVla,
46
+ vla: ModelType.ggmlVla,
47
+ [ADDON_CLASSIFICATION]: ModelType.ggmlClassification,
48
+ classification: ModelType.ggmlClassification,
40
49
  };
41
50
  // Resolves any engine string (legacy or canonical) to a validated canonical engine.
42
51
  // Returns null if the engine is not recognized.
43
52
  export function resolveCanonicalEngine(engine) {
44
53
  const direct = modelRegistryEngineSchema.safeParse(engine);
45
- if (direct.success)
54
+ if (direct.success) {
55
+ // Registry rows and cached metadata may still say "onnx-tts"; route to GGML.
56
+ if (direct.data === ModelType.onnxTts)
57
+ return ModelType.ttsGgml;
46
58
  return direct.data;
59
+ }
47
60
  const canonical = LEGACY_ENGINE_TO_CANONICAL[engine];
48
61
  if (canonical)
49
62
  return canonical;
@@ -1,4 +1,20 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * Wire shape for errors thrown across the RPC boundary. The fields are
4
+ * the union of (a) the legacy `QvacErrorBase` serialisation (`name`,
5
+ * `code`, `message`, `stack`, `cause`, `timestamp`) and (b) the new
6
+ * `typedFields` map (0.11.0+) carrying per-class structured data the
7
+ * client-side reconstructor uses to rebuild the original typed error.
8
+ *
9
+ * `typedFields` is opaque on the wire — `z.unknown()` — and the
10
+ * per-class reconstructor in `client/rpc/rpc-error.ts` casts each
11
+ * member at the boundary. The single-map shape keeps the schema
12
+ * compact regardless of how many typed-error classes the SDK
13
+ * eventually surfaces across RPC. New typed-error classes that need
14
+ * cross-RPC reconstruction add a `toErrorResponseFields()` method on
15
+ * the server side and a row to the reconstructor map on the client
16
+ * side; the schema itself doesn't change.
17
+ */
2
18
  export declare const errorResponseSchema: z.ZodObject<{
3
19
  type: z.ZodLiteral<"error">;
4
20
  message: z.ZodString;
@@ -7,7 +23,22 @@ export declare const errorResponseSchema: z.ZodObject<{
7
23
  name: z.ZodOptional<z.ZodString>;
8
24
  code: z.ZodOptional<z.ZodNumber>;
9
25
  cause: z.ZodOptional<z.ZodUnknown>;
26
+ typedFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
27
  }, z.core.$strip>;
11
28
  export type ErrorResponse = z.infer<typeof errorResponseSchema>;
29
+ /**
30
+ * A `QvacErrorBase` subclass that opts into typed-field serialisation
31
+ * across the RPC boundary. The method returns the subset of own
32
+ * properties the client-side reconstructor needs to rebuild the
33
+ * original class with its named constructor arguments populated.
34
+ *
35
+ * Co-located with each class (see `utils/errors-server.ts`) so adding
36
+ * a new cross-RPC typed error is a three-step change in one PR: define
37
+ * the class, implement the method, add a reconstructor entry in
38
+ * `client/rpc/rpc-error.ts`.
39
+ */
40
+ export interface TypedErrorSerializer {
41
+ toErrorResponseFields(): Record<string, unknown>;
42
+ }
12
43
  export declare function createErrorResponse(error: unknown): ErrorResponse;
13
44
  //# sourceMappingURL=error.d.ts.map