@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
@@ -317,21 +317,35 @@ function generateDiffusionName({ filename, modelName, quantization, params, tags
317
317
  }
318
318
  function generateParakeetName({ filename, lowerPath, quantization, }) {
319
319
  const lower = filename.toLowerCase();
320
- // Detect model variant from registry path
321
320
  let variant = "";
322
- if (lowerPath.includes("parakeet-tdt") || lowerPath.includes("parakeet/")) {
323
- variant = "TDT";
321
+ if (lower.includes("sortformer") || lower.includes("diar_streaming")) {
322
+ variant = "SORTFORMER";
324
323
  }
325
- else if (lowerPath.includes("parakeet-ctc")) {
324
+ else if (lower.includes("ctc") || lowerPath.includes("parakeet-ctc")) {
326
325
  variant = "CTC";
327
326
  }
328
- else if (lowerPath.includes("eou") || lowerPath.includes("parakeet-rs")) {
327
+ else if (lower.includes("eou") || lowerPath.includes("parakeet-rs")) {
329
328
  variant = "EOU";
330
329
  }
331
- else if (lowerPath.includes("sortformer")) {
332
- variant = "SORTFORMER";
330
+ else if (lower.includes("tdt") || lowerPath.includes("parakeet-tdt")) {
331
+ variant = "TDT";
332
+ }
333
+ if (lower.endsWith(".gguf")) {
334
+ const paramsMatch = filename.match(/(?:^|[-_])(\d+(?:\.\d+)?[mb])(?=[-_.])/i);
335
+ const versionMatch = filename.match(/[-_]v(\d+(?:\.\d+)?)/i);
336
+ const speakerMatch = filename.match(/(\d+spk)/i);
337
+ const paramsHint = paramsMatch ? paramsMatch[1] : "";
338
+ const versionHint = versionMatch ? `V${versionMatch[1]}` : "";
339
+ const speakerHint = speakerMatch ? speakerMatch[1] : "";
340
+ const nameParts = [
341
+ variant,
342
+ paramsHint,
343
+ speakerHint,
344
+ versionHint,
345
+ quantization,
346
+ ].filter((p) => p && p !== "");
347
+ return `PARAKEET_${nameParts.map(cleanPart).join("_")}`;
333
348
  }
334
- // Detect file role from filename
335
349
  let fileRole = "";
336
350
  if (lower.includes("encoder") && (lower.endsWith(".data") || lower.endsWith(".onnx.data"))) {
337
351
  fileRole = "ENCODER_DATA";
@@ -5,6 +5,9 @@
5
5
  * 1. Generate `qvac/worker.pear.entry.mjs` with selected plugins
6
6
  * 2. Persist `pear.stage.entrypoints` to package.json for routing
7
7
  *
8
+ * Note: `qvac verify bundle` is not wired here yet — run it manually
9
+ * (locally and/or in CI) before `pear stage` / `pear run`.
10
+ *
8
11
  * @example package.json configuration
9
12
  * ```json
10
13
  * {
package/dist/pear/pre.js CHANGED
@@ -5,6 +5,9 @@
5
5
  * 1. Generate `qvac/worker.pear.entry.mjs` with selected plugins
6
6
  * 2. Persist `pear.stage.entrypoints` to package.json for routing
7
7
  *
8
+ * Note: `qvac verify bundle` is not wired here yet — run it manually
9
+ * (locally and/or in CI) before `pear stage` / `pear run`.
10
+ *
8
11
  * @example package.json configuration
9
12
  * ```json
10
13
  * {
@@ -29,18 +32,22 @@ const BUILTIN_PLUGINS = [
29
32
  "@qvac/sdk/llamacpp-embedding/plugin",
30
33
  "@qvac/sdk/whispercpp-transcription/plugin",
31
34
  "@qvac/sdk/nmtcpp-translation/plugin",
32
- "@qvac/sdk/onnx-tts/plugin",
35
+ "@qvac/sdk/tts-ggml/plugin",
33
36
  "@qvac/sdk/onnx-ocr/plugin",
34
37
  "@qvac/sdk/sdcpp-generation/plugin",
38
+ "@qvac/sdk/ggml-vla/plugin",
39
+ "@qvac/sdk/ggml-classification/plugin",
35
40
  ];
36
41
  const BUILTIN_PLUGIN_EXPORTS = {
37
42
  "llamacpp-completion": "llmPlugin",
38
43
  "llamacpp-embedding": "embeddingsPlugin",
39
44
  "whispercpp-transcription": "whisperPlugin",
40
45
  "nmtcpp-translation": "nmtPlugin",
41
- "onnx-tts": "ttsPlugin",
46
+ "tts-ggml": "ttsPlugin",
42
47
  "onnx-ocr": "ocrPlugin",
43
48
  "sdcpp-generation": "diffusionPlugin",
49
+ "ggml-vla": "vlaPlugin",
50
+ "ggml-classification": "classificationPlugin",
44
51
  };
45
52
  const SDK_NAME = "@qvac/sdk";
46
53
  const DEFAULT_PEAR_WORKER = "worker.js";
@@ -1,55 +1,199 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * Public-API base for the broad-cancel escape hatch. Kept exported so
4
+ * the bare-side `cancel({ modelId, kind? })` helper can parse the
5
+ * `modelId` field consistently with the wire envelope.
6
+ */
2
7
  export declare const cancelInferenceBaseSchema: z.ZodObject<{
3
8
  modelId: z.ZodString;
4
9
  }, z.core.$strip>;
5
- declare const cancelParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ /**
11
+ * Coarse kind narrowing for the broad-cancel escape hatch. Matches the
12
+ * server-side `RequestKind` union in `server/bare/runtime/request-context.ts`
13
+ * — keep the two lists in sync. The kind is optional; omitting it
14
+ * cancels every in-flight request on the model regardless of kind
15
+ * (the "cancel everything on this model" sweep used by model-unload
16
+ * and app-shutdown paths).
17
+ */
18
+ declare const cancelKindSchema: z.ZodEnum<{
19
+ completion: "completion";
20
+ embeddings: "embeddings";
21
+ transcribe: "transcribe";
22
+ translate: "translate";
23
+ diffusion: "diffusion";
24
+ tts: "tts";
25
+ ocr: "ocr";
26
+ vla: "vla";
27
+ finetune: "finetune";
28
+ loadModel: "loadModel";
29
+ downloadAsset: "downloadAsset";
30
+ rag: "rag";
31
+ }>;
32
+ /**
33
+ * Targeted cancel by `requestId` — the primary cancel path in
34
+ * SDK 0.11.0. Pair with the `requestId` field exposed on
35
+ * `CompletionRun` (and the decorated promises returned by
36
+ * `loadModel(...)`, `downloadAsset(...)`, `embed(...)`,
37
+ * `transcribe(...)`, `rag*(...)` etc.) to cancel a specific in-flight
38
+ * request rather than every request running on a given model.
39
+ *
40
+ * `clearCache` is honoured only when the targeted request is a
41
+ * `downloadAsset` — it propagates onto the underlying download
42
+ * transfer so the partial file is deleted when the last subscriber
43
+ * leaves. Ignored for other kinds.
44
+ */
45
+ declare const cancelByRequestIdParamsSchema: z.ZodObject<{
46
+ operation: z.ZodLiteral<"request">;
47
+ requestId: z.ZodString;
48
+ clearCache: z.ZodOptional<z.ZodBoolean>;
49
+ }, z.core.$strip>;
50
+ /**
51
+ * Broad cancel escape hatch — abort every in-flight request running on
52
+ * a model (optionally narrowed by `kind`). Kept indefinitely as the
53
+ * non-`requestId` cancel surface for model-unload, app-shutdown, and
54
+ * admin sweeps where the caller doesn't have a `requestId` to hand.
55
+ *
56
+ * Replaces the legacy per-kind discriminator arms (`"inference"`,
57
+ * `"embeddings"`, `"downloadAsset"`, `"rag"`) with a single `"broad"`
58
+ * arm plus an optional `kind` field. The old arms went away as part
59
+ * of the 0.11.0 cleanup once every handler was on the registry; the
60
+ * wire shape collapse is a `[bc]` for any external caller hand-rolling
61
+ * the old RPC envelope. The public-API `cancel(...)` function in
62
+ * `client/api/cancel.ts` keeps the old `{ operation: "inference", modelId }`
63
+ * / `{ operation: "embeddings", modelId }` forms callable and translates
64
+ * them into this new shape at the client boundary, so consumers using
65
+ * the official SDK client see no change.
66
+ */
67
+ declare const cancelBroadParamsSchema: z.ZodObject<{
68
+ operation: z.ZodLiteral<"broad">;
6
69
  modelId: z.ZodString;
7
- operation: z.ZodLiteral<"inference">;
8
- }, z.core.$strip>, z.ZodObject<{
9
- operation: z.ZodLiteral<"downloadAsset">;
10
- downloadKey: z.ZodString;
70
+ kind: z.ZodOptional<z.ZodEnum<{
71
+ completion: "completion";
72
+ embeddings: "embeddings";
73
+ transcribe: "transcribe";
74
+ translate: "translate";
75
+ diffusion: "diffusion";
76
+ tts: "tts";
77
+ ocr: "ocr";
78
+ vla: "vla";
79
+ finetune: "finetune";
80
+ loadModel: "loadModel";
81
+ downloadAsset: "downloadAsset";
82
+ rag: "rag";
83
+ }>>;
84
+ }, z.core.$strip>;
85
+ declare const cancelParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
+ operation: z.ZodLiteral<"request">;
87
+ requestId: z.ZodString;
11
88
  clearCache: z.ZodOptional<z.ZodBoolean>;
12
- delegate: z.ZodOptional<z.ZodObject<{
13
- providerPublicKey: z.ZodString;
14
- timeout: z.ZodOptional<z.ZodNumber>;
15
- healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
16
- }, z.core.$strip>>;
17
- }, z.core.$strip>, z.ZodObject<{
18
- operation: z.ZodLiteral<"rag">;
19
- workspace: z.ZodOptional<z.ZodString>;
20
89
  }, z.core.$strip>, z.ZodObject<{
90
+ operation: z.ZodLiteral<"broad">;
21
91
  modelId: z.ZodString;
22
- operation: z.ZodLiteral<"embeddings">;
92
+ kind: z.ZodOptional<z.ZodEnum<{
93
+ completion: "completion";
94
+ embeddings: "embeddings";
95
+ transcribe: "transcribe";
96
+ translate: "translate";
97
+ diffusion: "diffusion";
98
+ tts: "tts";
99
+ ocr: "ocr";
100
+ vla: "vla";
101
+ finetune: "finetune";
102
+ loadModel: "loadModel";
103
+ downloadAsset: "downloadAsset";
104
+ rag: "rag";
105
+ }>>;
23
106
  }, z.core.$strip>], "operation">;
24
107
  export declare const cancelRequestSchema: z.ZodIntersection<z.ZodObject<{
25
108
  type: z.ZodLiteral<"cancel">;
26
109
  }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
27
- modelId: z.ZodString;
28
- operation: z.ZodLiteral<"inference">;
29
- }, z.core.$strip>, z.ZodObject<{
30
- operation: z.ZodLiteral<"downloadAsset">;
31
- downloadKey: z.ZodString;
110
+ operation: z.ZodLiteral<"request">;
111
+ requestId: z.ZodString;
32
112
  clearCache: z.ZodOptional<z.ZodBoolean>;
33
- delegate: z.ZodOptional<z.ZodObject<{
34
- providerPublicKey: z.ZodString;
35
- timeout: z.ZodOptional<z.ZodNumber>;
36
- healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
37
- }, z.core.$strip>>;
38
- }, z.core.$strip>, z.ZodObject<{
39
- operation: z.ZodLiteral<"rag">;
40
- workspace: z.ZodOptional<z.ZodString>;
41
113
  }, z.core.$strip>, z.ZodObject<{
114
+ operation: z.ZodLiteral<"broad">;
42
115
  modelId: z.ZodString;
43
- operation: z.ZodLiteral<"embeddings">;
116
+ kind: z.ZodOptional<z.ZodEnum<{
117
+ completion: "completion";
118
+ embeddings: "embeddings";
119
+ transcribe: "transcribe";
120
+ translate: "translate";
121
+ diffusion: "diffusion";
122
+ tts: "tts";
123
+ ocr: "ocr";
124
+ vla: "vla";
125
+ finetune: "finetune";
126
+ loadModel: "loadModel";
127
+ downloadAsset: "downloadAsset";
128
+ rag: "rag";
129
+ }>>;
44
130
  }, z.core.$strip>], "operation">>;
45
131
  export declare const cancelResponseSchema: z.ZodObject<{
46
132
  type: z.ZodLiteral<"cancel">;
47
133
  success: z.ZodBoolean;
134
+ cancelled: z.ZodOptional<z.ZodNumber>;
48
135
  error: z.ZodOptional<z.ZodString>;
49
136
  }, z.core.$strip>;
137
+ /**
138
+ * Sugar for the most common new path — `cancel({ requestId })`. The
139
+ * client accepts either this shape (no `operation`) or the explicit
140
+ * `{ operation: "request", requestId }` and normalises before sending.
141
+ */
142
+ export declare const cancelByRequestIdSugarSchema: z.ZodObject<{
143
+ requestId: z.ZodString;
144
+ clearCache: z.ZodOptional<z.ZodBoolean>;
145
+ }, z.core.$strict>;
146
+ /**
147
+ * Sugar for the broad-cancel escape hatch — `cancel({ modelId, kind? })`.
148
+ * Translates to `{ operation: "broad", modelId, kind? }` at the client
149
+ * boundary.
150
+ */
151
+ export declare const cancelBroadSugarSchema: z.ZodObject<{
152
+ modelId: z.ZodString;
153
+ kind: z.ZodOptional<z.ZodEnum<{
154
+ completion: "completion";
155
+ embeddings: "embeddings";
156
+ transcribe: "transcribe";
157
+ translate: "translate";
158
+ diffusion: "diffusion";
159
+ tts: "tts";
160
+ ocr: "ocr";
161
+ vla: "vla";
162
+ finetune: "finetune";
163
+ loadModel: "loadModel";
164
+ downloadAsset: "downloadAsset";
165
+ rag: "rag";
166
+ }>>;
167
+ }, z.core.$strict>;
168
+ /**
169
+ * Legacy per-kind broad-cancel sugars retained at the public-API
170
+ * boundary so existing callers of `cancel({ operation: "inference",
171
+ * modelId })` / `cancel({ operation: "embeddings", modelId })` keep
172
+ * working without code changes. The client wrapper translates these
173
+ * into the new `{ operation: "broad", modelId, kind: ... }` wire
174
+ * shape. New callers should prefer `cancel({ requestId })` or
175
+ * `cancel({ modelId, kind? })`.
176
+ */
177
+ export declare const cancelLegacyInferenceSugarSchema: z.ZodObject<{
178
+ operation: z.ZodLiteral<"inference">;
179
+ modelId: z.ZodString;
180
+ }, z.core.$strip>;
181
+ export declare const cancelLegacyEmbeddingsSugarSchema: z.ZodObject<{
182
+ operation: z.ZodLiteral<"embeddings">;
183
+ modelId: z.ZodString;
184
+ }, z.core.$strip>;
50
185
  export type CancelParams = z.infer<typeof cancelParamsSchema>;
51
186
  export type CancelInferenceBaseParams = z.infer<typeof cancelInferenceBaseSchema>;
187
+ export type CancelByRequestIdParams = z.infer<typeof cancelByRequestIdParamsSchema>;
188
+ export type CancelBroadParams = z.infer<typeof cancelBroadParamsSchema>;
189
+ export type CancelByRequestIdSugar = z.infer<typeof cancelByRequestIdSugarSchema>;
190
+ export type CancelBroadSugar = z.infer<typeof cancelBroadSugarSchema>;
191
+ export type CancelLegacyInferenceSugar = z.infer<typeof cancelLegacyInferenceSugarSchema>;
192
+ export type CancelLegacyEmbeddingsSugar = z.infer<typeof cancelLegacyEmbeddingsSugarSchema>;
193
+ export type CancelKind = z.infer<typeof cancelKindSchema>;
52
194
  export type CancelRequest = z.infer<typeof cancelRequestSchema>;
53
195
  export type CancelResponse = z.infer<typeof cancelResponseSchema>;
196
+ /** Public client-API input — accepts the wire union *or* the requestId/broad sugars and the legacy per-kind sugars. */
197
+ export type CancelClientInput = CancelParams | CancelByRequestIdSugar | CancelBroadSugar | CancelLegacyInferenceSugar | CancelLegacyEmbeddingsSugar;
54
198
  export {};
55
199
  //# sourceMappingURL=cancel.d.ts.map
@@ -1,39 +1,140 @@
1
1
  import { z } from "zod";
2
- import { delegateBaseSchema } from "./delegate.js";
3
2
  const cancelBaseSchema = z.object({
4
3
  type: z.literal("cancel"),
5
4
  });
5
+ /**
6
+ * Public-API base for the broad-cancel escape hatch. Kept exported so
7
+ * the bare-side `cancel({ modelId, kind? })` helper can parse the
8
+ * `modelId` field consistently with the wire envelope.
9
+ */
6
10
  export const cancelInferenceBaseSchema = z.object({
7
11
  modelId: z.string().describe("The model ID to cancel inference for"),
8
12
  });
9
- const cancelInferenceParamsSchema = cancelInferenceBaseSchema.extend({
10
- operation: z.literal("inference").describe("Operation type"),
11
- });
12
- const cancelDownloadParamsSchema = z.object({
13
- operation: z.literal("downloadAsset").describe("Operation type"),
14
- downloadKey: z.string().describe("The download key to cancel"),
13
+ /**
14
+ * Coarse kind narrowing for the broad-cancel escape hatch. Matches the
15
+ * server-side `RequestKind` union in `server/bare/runtime/request-context.ts`
16
+ * — keep the two lists in sync. The kind is optional; omitting it
17
+ * cancels every in-flight request on the model regardless of kind
18
+ * (the "cancel everything on this model" sweep used by model-unload
19
+ * and app-shutdown paths).
20
+ */
21
+ const cancelKindSchema = z
22
+ .enum([
23
+ "completion",
24
+ "embeddings",
25
+ "transcribe",
26
+ "translate",
27
+ "diffusion",
28
+ "tts",
29
+ "ocr",
30
+ "vla",
31
+ "finetune",
32
+ "loadModel",
33
+ "downloadAsset",
34
+ "rag",
35
+ ])
36
+ .describe("Optional kind narrowing for the broad cancel. Omitting it cancels every in-flight request on the model.");
37
+ /**
38
+ * Targeted cancel by `requestId` — the primary cancel path in
39
+ * SDK 0.11.0. Pair with the `requestId` field exposed on
40
+ * `CompletionRun` (and the decorated promises returned by
41
+ * `loadModel(...)`, `downloadAsset(...)`, `embed(...)`,
42
+ * `transcribe(...)`, `rag*(...)` etc.) to cancel a specific in-flight
43
+ * request rather than every request running on a given model.
44
+ *
45
+ * `clearCache` is honoured only when the targeted request is a
46
+ * `downloadAsset` — it propagates onto the underlying download
47
+ * transfer so the partial file is deleted when the last subscriber
48
+ * leaves. Ignored for other kinds.
49
+ */
50
+ const cancelByRequestIdParamsSchema = z.object({
51
+ operation: z.literal("request").describe("Operation type"),
52
+ requestId: z
53
+ .string()
54
+ .min(1)
55
+ .describe("Identifier of the specific in-flight request to cancel — the value exposed on the result object returned by long-running calls (e.g. `completion(...)`, `loadModel(...)`, `downloadAsset(...)`)."),
15
56
  clearCache: z
16
57
  .boolean()
17
58
  .optional()
18
- .describe("If true, deletes the partial download file"),
19
- delegate: delegateBaseSchema.optional(),
20
- });
21
- const cancelRagParamsSchema = z.object({
22
- operation: z.literal("rag").describe("Operation type"),
23
- workspace: z.string().optional().describe("The RAG workspace to cancel"),
59
+ .describe("Download-only: if true, deletes the partial download file when the subscriber leaves. Ignored for non-download kinds."),
24
60
  });
25
- const cancelEmbeddingsParamsSchema = cancelInferenceBaseSchema.extend({
26
- operation: z.literal("embeddings").describe("Operation type"),
61
+ /**
62
+ * Broad cancel escape hatch — abort every in-flight request running on
63
+ * a model (optionally narrowed by `kind`). Kept indefinitely as the
64
+ * non-`requestId` cancel surface for model-unload, app-shutdown, and
65
+ * admin sweeps where the caller doesn't have a `requestId` to hand.
66
+ *
67
+ * Replaces the legacy per-kind discriminator arms (`"inference"`,
68
+ * `"embeddings"`, `"downloadAsset"`, `"rag"`) with a single `"broad"`
69
+ * arm plus an optional `kind` field. The old arms went away as part
70
+ * of the 0.11.0 cleanup once every handler was on the registry; the
71
+ * wire shape collapse is a `[bc]` for any external caller hand-rolling
72
+ * the old RPC envelope. The public-API `cancel(...)` function in
73
+ * `client/api/cancel.ts` keeps the old `{ operation: "inference", modelId }`
74
+ * / `{ operation: "embeddings", modelId }` forms callable and translates
75
+ * them into this new shape at the client boundary, so consumers using
76
+ * the official SDK client see no change.
77
+ */
78
+ const cancelBroadParamsSchema = z.object({
79
+ operation: z.literal("broad").describe("Operation type"),
80
+ modelId: z
81
+ .string()
82
+ .describe("Cancel every in-flight request on this model"),
83
+ kind: cancelKindSchema.optional(),
27
84
  });
28
85
  const cancelParamsSchema = z.discriminatedUnion("operation", [
29
- cancelInferenceParamsSchema,
30
- cancelDownloadParamsSchema,
31
- cancelRagParamsSchema,
32
- cancelEmbeddingsParamsSchema,
86
+ cancelByRequestIdParamsSchema,
87
+ cancelBroadParamsSchema,
33
88
  ]);
34
89
  export const cancelRequestSchema = z.intersection(cancelBaseSchema, cancelParamsSchema);
35
90
  export const cancelResponseSchema = z.object({
36
91
  type: z.literal("cancel"),
37
92
  success: z.boolean(),
93
+ /**
94
+ * Number of in-flight contexts that this call flipped to
95
+ * `cancelling` (already-cancelled contexts are not counted, so
96
+ * callers can rely on the value to log "n requests cancelled" once
97
+ * without double-counting). Always present on `success: true`.
98
+ */
99
+ cancelled: z.number().int().nonnegative().optional(),
38
100
  error: z.string().optional(),
39
101
  });
102
+ /**
103
+ * Sugar for the most common new path — `cancel({ requestId })`. The
104
+ * client accepts either this shape (no `operation`) or the explicit
105
+ * `{ operation: "request", requestId }` and normalises before sending.
106
+ */
107
+ export const cancelByRequestIdSugarSchema = z
108
+ .object({
109
+ requestId: z.string().min(1),
110
+ clearCache: z.boolean().optional(),
111
+ })
112
+ .strict();
113
+ /**
114
+ * Sugar for the broad-cancel escape hatch — `cancel({ modelId, kind? })`.
115
+ * Translates to `{ operation: "broad", modelId, kind? }` at the client
116
+ * boundary.
117
+ */
118
+ export const cancelBroadSugarSchema = z
119
+ .object({
120
+ modelId: z.string().min(1),
121
+ kind: cancelKindSchema.optional(),
122
+ })
123
+ .strict();
124
+ /**
125
+ * Legacy per-kind broad-cancel sugars retained at the public-API
126
+ * boundary so existing callers of `cancel({ operation: "inference",
127
+ * modelId })` / `cancel({ operation: "embeddings", modelId })` keep
128
+ * working without code changes. The client wrapper translates these
129
+ * into the new `{ operation: "broad", modelId, kind: ... }` wire
130
+ * shape. New callers should prefer `cancel({ requestId })` or
131
+ * `cancel({ modelId, kind? })`.
132
+ */
133
+ export const cancelLegacyInferenceSugarSchema = z.object({
134
+ operation: z.literal("inference"),
135
+ modelId: z.string().min(1),
136
+ });
137
+ export const cancelLegacyEmbeddingsSugarSchema = z.object({
138
+ operation: z.literal("embeddings"),
139
+ modelId: z.string().min(1),
140
+ });
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ export declare const classificationConfigSchema: z.ZodObject<{
3
+ modelPath: z.ZodOptional<z.ZodString>;
4
+ topK: z.ZodOptional<z.ZodNumber>;
5
+ nativeLogger: z.ZodOptional<z.ZodBoolean>;
6
+ }, z.core.$strip>;
7
+ export declare const classifyParamsSchema: z.ZodObject<{
8
+ modelId: z.ZodString;
9
+ image: z.ZodString;
10
+ topK: z.ZodOptional<z.ZodNumber>;
11
+ width: z.ZodOptional<z.ZodNumber>;
12
+ height: z.ZodOptional<z.ZodNumber>;
13
+ channels: z.ZodOptional<z.ZodLiteral<3>>;
14
+ }, z.core.$strip>;
15
+ export declare const classifyRequestSchema: z.ZodObject<{
16
+ modelId: z.ZodString;
17
+ image: z.ZodString;
18
+ topK: z.ZodOptional<z.ZodNumber>;
19
+ width: z.ZodOptional<z.ZodNumber>;
20
+ height: z.ZodOptional<z.ZodNumber>;
21
+ channels: z.ZodOptional<z.ZodLiteral<3>>;
22
+ type: z.ZodLiteral<"classify">;
23
+ }, z.core.$strip>;
24
+ export declare const classificationResultSchema: z.ZodObject<{
25
+ label: z.ZodString;
26
+ confidence: z.ZodNumber;
27
+ }, z.core.$strip>;
28
+ export declare const classifyResponseSchema: z.ZodObject<{
29
+ type: z.ZodLiteral<"classify">;
30
+ results: z.ZodArray<z.ZodObject<{
31
+ label: z.ZodString;
32
+ confidence: z.ZodNumber;
33
+ }, z.core.$strip>>;
34
+ done: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.core.$strip>;
36
+ export type ClassificationConfig = z.infer<typeof classificationConfigSchema>;
37
+ export type ClassifyParams = z.infer<typeof classifyParamsSchema>;
38
+ export type ClassifyRequest = z.infer<typeof classifyRequestSchema>;
39
+ export type ClassificationResult = z.infer<typeof classificationResultSchema>;
40
+ export type ClassifyResponse = z.infer<typeof classifyResponseSchema>;
41
+ export interface ClassifyClientParams {
42
+ modelId: string;
43
+ /** JPEG or PNG buffer. */
44
+ image: Uint8Array;
45
+ topK?: number;
46
+ /** Raw RGB image width (required for raw bytes). */
47
+ width?: number;
48
+ /** Raw RGB image height (required for raw bytes). */
49
+ height?: number;
50
+ /** Channel count — must be 3 for raw RGB. */
51
+ channels?: 3;
52
+ }
53
+ //# sourceMappingURL=classification.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export const classificationConfigSchema = z.object({
3
+ /** Absolute path to the GGUF weights file. Defaults to the bundled model inside @qvac/classification-ggml. */
4
+ modelPath: z.string().optional(),
5
+ /** Limit returned results to the top-K classes. Default: all classes. */
6
+ topK: z.number().int().optional(),
7
+ /** Forward native C++ log lines through the SDK logger. Off by default. */
8
+ nativeLogger: z.boolean().optional(),
9
+ });
10
+ export const classifyParamsSchema = z.object({
11
+ modelId: z.string(),
12
+ /** JPEG or PNG buffer encoded as base64, or raw RGB bytes. */
13
+ image: z.string(),
14
+ topK: z.number().int().optional(),
15
+ /** Raw RGB image width (required for raw bytes). */
16
+ width: z.number().int().optional(),
17
+ /** Raw RGB image height (required for raw bytes). */
18
+ height: z.number().int().optional(),
19
+ /** Channel count — must be 3 for raw RGB. */
20
+ channels: z.literal(3).optional(),
21
+ });
22
+ export const classifyRequestSchema = classifyParamsSchema.extend({
23
+ type: z.literal("classify"),
24
+ });
25
+ export const classificationResultSchema = z.object({
26
+ label: z.string(),
27
+ confidence: z.number(),
28
+ });
29
+ export const classifyResponseSchema = z.object({
30
+ type: z.literal("classify"),
31
+ results: z.array(classificationResultSchema),
32
+ done: z.boolean().optional(),
33
+ });