@qvac/sdk 0.14.0 → 0.15.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 (798) hide show
  1. package/NOTICE +27 -11
  2. package/README.md +34 -35
  3. package/dist/client/api/batch-completion.d.ts +15 -0
  4. package/dist/client/api/batch-completion.js +332 -0
  5. package/dist/client/api/bci-transcribe.d.ts +1 -1
  6. package/dist/client/api/bci-transcribe.js +31 -31
  7. package/dist/client/api/cancel.d.ts +1 -1
  8. package/dist/client/api/cancel.js +18 -18
  9. package/dist/client/api/classify.d.ts +1 -1
  10. package/dist/client/api/classify.js +9 -6
  11. package/dist/client/api/client-request-id.js +1 -1
  12. package/dist/client/api/completion-stream.d.ts +3 -3
  13. package/dist/client/api/completion-stream.js +18 -18
  14. package/dist/client/api/delete-cache.js +9 -9
  15. package/dist/client/api/diffusion.d.ts +1 -1
  16. package/dist/client/api/diffusion.js +17 -11
  17. package/dist/client/api/download-asset.d.ts +1 -1
  18. package/dist/client/api/download-asset.js +11 -11
  19. package/dist/client/api/embed.d.ts +1 -1
  20. package/dist/client/api/embed.js +10 -10
  21. package/dist/client/api/finetune.d.ts +1 -1
  22. package/dist/client/api/finetune.js +25 -27
  23. package/dist/client/api/get-loaded-model-info.d.ts +2 -2
  24. package/dist/client/api/get-loaded-model-info.js +8 -8
  25. package/dist/client/api/get-model-info.d.ts +1 -1
  26. package/dist/client/api/get-model-info.js +7 -7
  27. package/dist/client/api/heartbeat.d.ts +2 -2
  28. package/dist/client/api/heartbeat.js +7 -7
  29. package/dist/client/api/index.d.ts +33 -32
  30. package/dist/client/api/index.js +33 -32
  31. package/dist/client/api/invoke-plugin.d.ts +1 -1
  32. package/dist/client/api/invoke-plugin.js +10 -10
  33. package/dist/client/api/load-model.d.ts +1 -1
  34. package/dist/client/api/load-model.js +32 -32
  35. package/dist/client/api/logging-stream.d.ts +1 -1
  36. package/dist/client/api/logging-stream.js +6 -6
  37. package/dist/client/api/ocr.d.ts +1 -1
  38. package/dist/client/api/ocr.js +11 -11
  39. package/dist/client/api/provide.d.ts +1 -1
  40. package/dist/client/api/provide.js +7 -7
  41. package/dist/client/api/rag.d.ts +1 -1
  42. package/dist/client/api/rag.js +65 -66
  43. package/dist/client/api/registry.d.ts +1 -1
  44. package/dist/client/api/registry.js +8 -8
  45. package/dist/client/api/resume.js +5 -5
  46. package/dist/client/api/state.d.ts +1 -1
  47. package/dist/client/api/state.js +5 -5
  48. package/dist/client/api/stop-provider.js +6 -6
  49. package/dist/client/api/subscribe-logs.d.ts +1 -1
  50. package/dist/client/api/subscribe-logs.js +3 -3
  51. package/dist/client/api/suspend.js +5 -5
  52. package/dist/client/api/text-to-speech.d.ts +1 -1
  53. package/dist/client/api/text-to-speech.js +37 -39
  54. package/dist/client/api/transcribe.d.ts +2 -2
  55. package/dist/client/api/transcribe.js +44 -45
  56. package/dist/client/api/translate.d.ts +1 -1
  57. package/dist/client/api/translate.js +14 -14
  58. package/dist/client/api/unload-model.d.ts +1 -1
  59. package/dist/client/api/unload-model.js +11 -11
  60. package/dist/client/api/upscale.d.ts +1 -1
  61. package/dist/client/api/upscale.js +9 -9
  62. package/dist/client/api/video.d.ts +1 -1
  63. package/dist/client/api/video.js +16 -14
  64. package/dist/client/api/vla-helpers.d.ts +2 -2
  65. package/dist/client/api/vla-helpers.js +6 -11
  66. package/dist/client/api/vla.d.ts +1 -1
  67. package/dist/client/api/vla.js +13 -13
  68. package/dist/client/config-loader/config-utils.d.ts +1 -1
  69. package/dist/client/config-loader/config-utils.js +3 -3
  70. package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
  71. package/dist/client/config-loader/resolve-config.bare.js +11 -11
  72. package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
  73. package/dist/client/config-loader/resolve-config.expo.js +6 -6
  74. package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
  75. package/dist/client/config-loader/resolve-config.node.js +27 -27
  76. package/dist/client/index.d.ts +1 -1
  77. package/dist/client/index.js +1 -1
  78. package/dist/client/init-hooks.d.ts +1 -1
  79. package/dist/client/init-hooks.js +12 -12
  80. package/dist/client/logging-stream-registry.d.ts +1 -1
  81. package/dist/client/logging-stream-registry.js +6 -6
  82. package/dist/client/parse-input.d.ts +1 -1
  83. package/dist/client/parse-input.js +3 -3
  84. package/dist/client/plugins-factory.d.ts +2 -2
  85. package/dist/client/plugins-factory.js +2 -2
  86. package/dist/client/rpc/bare-client.d.ts +2 -1
  87. package/dist/client/rpc/bare-client.js +37 -39
  88. package/dist/client/rpc/ensure-worker-ready.js +4 -4
  89. package/dist/client/rpc/expo-device-info.d.ts +1 -1
  90. package/dist/client/rpc/expo-device-info.js +11 -11
  91. package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
  92. package/dist/client/rpc/expo-rpc-client.js +38 -47
  93. package/dist/client/rpc/node-rpc-client.d.ts +2 -1
  94. package/dist/client/rpc/node-rpc-client.js +103 -75
  95. package/dist/client/rpc/profiling/index.d.ts +1 -1
  96. package/dist/client/rpc/profiling/index.js +1 -1
  97. package/dist/client/rpc/profiling/profiler.d.ts +2 -2
  98. package/dist/client/rpc/profiling/profiler.js +31 -34
  99. package/dist/client/rpc/rpc-client.d.ts +2 -2
  100. package/dist/client/rpc/rpc-client.js +113 -72
  101. package/dist/client/rpc/rpc-error.d.ts +1 -1
  102. package/dist/client/rpc/rpc-error.js +14 -14
  103. package/dist/commands/bundle/bare-pack.d.ts +1 -1
  104. package/dist/commands/bundle/bare-pack.js +20 -20
  105. package/dist/commands/bundle/constants.js +21 -21
  106. package/dist/commands/bundle/entry-gen.d.ts +1 -1
  107. package/dist/commands/bundle/entry-gen.js +10 -10
  108. package/dist/commands/bundle/index.js +47 -47
  109. package/dist/commands/bundle/manifest.d.ts +1 -1
  110. package/dist/commands/bundle/manifest.js +44 -46
  111. package/dist/commands/bundle/plugins.d.ts +2 -2
  112. package/dist/commands/bundle/plugins.js +7 -7
  113. package/dist/commands/bundle/resolve-sdk-import.d.ts +6 -0
  114. package/dist/commands/bundle/resolve-sdk-import.js +53 -0
  115. package/dist/commands/index.d.ts +4 -4
  116. package/dist/commands/index.js +2 -2
  117. package/dist/commands/verify/abi.d.ts +9 -9
  118. package/dist/commands/verify/abi.js +31 -31
  119. package/dist/commands/verify/addon-source.d.ts +1 -1
  120. package/dist/commands/verify/addon-source.js +13 -14
  121. package/dist/commands/verify/bundle-source.d.ts +1 -1
  122. package/dist/commands/verify/bundle-source.js +7 -7
  123. package/dist/commands/verify/index.d.ts +3 -3
  124. package/dist/commands/verify/index.js +18 -17
  125. package/dist/commands/verify/node-modules-source.d.ts +1 -1
  126. package/dist/commands/verify/node-modules-source.js +11 -11
  127. package/dist/commands/verify/prebuilds.d.ts +3 -3
  128. package/dist/commands/verify/prebuilds.js +8 -8
  129. package/dist/constants/audio.d.ts +1 -1
  130. package/dist/constants/audio.js +1 -1
  131. package/dist/constants/index.d.ts +2 -2
  132. package/dist/constants/index.js +2 -2
  133. package/dist/constants/registry.js +1 -1
  134. package/dist/examples/audio/mic-input.d.ts +1 -1
  135. package/dist/examples/audio/mic-input.js +31 -31
  136. package/dist/examples/batch-completion.d.ts +38 -0
  137. package/dist/examples/batch-completion.js +100 -0
  138. package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
  139. package/dist/examples/bci/bci-filesystem.js +17 -17
  140. package/dist/examples/cache-management.js +32 -32
  141. package/dist/examples/cancel-by-request-id.js +11 -11
  142. package/dist/examples/classification/classify-image.js +5 -5
  143. package/dist/examples/completion-events.js +16 -18
  144. package/dist/examples/completion-stop-reason.js +13 -13
  145. package/dist/examples/concurrent-completion-collision.js +20 -20
  146. package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
  147. package/dist/examples/config/default/default.config.js +2 -2
  148. package/dist/examples/config/plugins/plugins.config.js +2 -2
  149. package/dist/examples/config-reload.js +14 -14
  150. package/dist/examples/default-config-usage.js +10 -13
  151. package/dist/examples/delegated-inference/composite.js +23 -23
  152. package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
  153. package/dist/examples/delegated-inference/consumer.js +11 -11
  154. package/dist/examples/delegated-inference/provider.js +24 -24
  155. package/dist/examples/diffusion-esrgan-upscale.js +19 -19
  156. package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
  157. package/dist/examples/diffusion-flux2-klein.js +14 -14
  158. package/dist/examples/diffusion-img2img.js +13 -13
  159. package/dist/examples/diffusion-img2vid.js +22 -23
  160. package/dist/examples/diffusion-simple.js +7 -7
  161. package/dist/examples/diffusion-txt2img.js +13 -14
  162. package/dist/examples/diffusion-txt2vid.js +18 -18
  163. package/dist/examples/download-with-blind-relays.js +7 -8
  164. package/dist/examples/download-with-cancel.js +9 -9
  165. package/dist/examples/embed-multi-gpu.js +9 -9
  166. package/dist/examples/embed-p2p.js +24 -24
  167. package/dist/examples/finetune/llamacpp-finetune.js +21 -21
  168. package/dist/examples/kv-cache-cleanup.js +34 -34
  169. package/dist/examples/kv-cache-custom-key.js +30 -30
  170. package/dist/examples/kv-cache-example.js +18 -20
  171. package/dist/examples/llamacpp-cache.js +33 -33
  172. package/dist/examples/llamacpp-dynamic-tools.js +38 -38
  173. package/dist/examples/llamacpp-filesystem.js +13 -15
  174. package/dist/examples/llamacpp-http.js +12 -14
  175. package/dist/examples/llamacpp-multi-gpu.js +12 -12
  176. package/dist/examples/llamacpp-multimodal.js +16 -16
  177. package/dist/examples/llamacpp-p2p.js +11 -11
  178. package/dist/examples/llamacpp-sharded.js +12 -12
  179. package/dist/examples/llamacpp-structured-output.js +37 -37
  180. package/dist/examples/logging-file-transport.js +19 -21
  181. package/dist/examples/logging-global.js +8 -8
  182. package/dist/examples/logging-streaming.js +16 -18
  183. package/dist/examples/mcp-websearch.js +44 -44
  184. package/dist/examples/multi-model-demo.js +33 -33
  185. package/dist/examples/ocr-fasttext.js +17 -17
  186. package/dist/examples/parallel-download.js +11 -13
  187. package/dist/examples/plugins.js +43 -43
  188. package/dist/examples/profiling/basic.js +34 -36
  189. package/dist/examples/profiling/per-call.js +16 -16
  190. package/dist/examples/quickstart.bare.js +4 -6
  191. package/dist/examples/quickstart.js +7 -7
  192. package/dist/examples/rag/rag-chromadb.js +26 -26
  193. package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
  194. package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
  195. package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
  196. package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
  197. package/dist/examples/rag/rag-lancedb.js +29 -32
  198. package/dist/examples/rag/rag-sqlite.js +25 -25
  199. package/dist/examples/registry-query.js +15 -15
  200. package/dist/examples/seed-p2p.js +8 -8
  201. package/dist/examples/suspend-resume.js +20 -20
  202. package/dist/examples/tools/llamacpp-native-tools.js +25 -25
  203. package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
  204. package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
  205. package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
  206. package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
  207. package/dist/examples/tools/shared.d.ts +2 -2
  208. package/dist/examples/tools/shared.js +17 -17
  209. package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
  210. package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
  211. package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
  212. package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
  213. package/dist/examples/transcription/parakeet-sortformer.js +21 -21
  214. package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
  215. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
  216. package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
  217. package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
  218. package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
  219. package/dist/examples/transcription/whispercpp-prompt.js +18 -18
  220. package/dist/examples/translation/translation-bergamot-batch.js +17 -17
  221. package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
  222. package/dist/examples/translation/translation-bergamot.js +11 -11
  223. package/dist/examples/translation/translation-indic.js +10 -10
  224. package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
  225. package/dist/examples/translation/translation-llm-context.js +10 -10
  226. package/dist/examples/translation/translation-llm.js +13 -13
  227. package/dist/examples/translation/translation-stream.js +11 -11
  228. package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
  229. package/dist/examples/tts/chatterbox-enhanced.js +55 -0
  230. package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
  231. package/dist/examples/tts/chatterbox-multilingual.js +54 -0
  232. package/dist/examples/tts/chatterbox.js +18 -18
  233. package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
  234. package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
  235. package/dist/examples/tts/supertonic-enhanced.js +57 -0
  236. package/dist/examples/tts/supertonic-multilingual.js +19 -19
  237. package/dist/examples/tts/supertonic.js +18 -18
  238. package/dist/examples/tts/utils.js +24 -32
  239. package/dist/examples/vla-pi05.js +14 -14
  240. package/dist/examples/vla-smolvla.js +14 -14
  241. package/dist/examples/voice-assistant/voice-assistant.js +46 -46
  242. package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
  243. package/dist/expo/plugins/get-project-root.d.ts +2 -2
  244. package/dist/expo/plugins/get-project-root.js +1 -1
  245. package/dist/expo/plugins/index.d.ts +11 -11
  246. package/dist/expo/plugins/index.js +10 -10
  247. package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
  248. package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  249. package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
  250. package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  251. package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
  252. package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
  253. package/dist/expo/plugins/withDeviceInfo.js +13 -13
  254. package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
  255. package/dist/expo/plugins/withMobileBundle.js +34 -42
  256. package/dist/expo/plugins/withOpenCL.d.ts +1 -1
  257. package/dist/expo/plugins/withOpenCL.js +14 -16
  258. package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
  259. package/dist/expo/plugins/withQvacSDK.js +12 -12
  260. package/dist/index.d.ts +16 -16
  261. package/dist/index.js +16 -17
  262. package/dist/logging/addon.d.ts +1 -1
  263. package/dist/logging/addon.js +13 -13
  264. package/dist/logging/base-logger.d.ts +2 -2
  265. package/dist/logging/base-logger.js +6 -6
  266. package/dist/logging/client-logger.d.ts +1 -1
  267. package/dist/logging/client-logger.js +3 -3
  268. package/dist/logging/index.d.ts +9 -9
  269. package/dist/logging/index.js +8 -8
  270. package/dist/logging/logger.d.ts +1 -1
  271. package/dist/logging/logger.js +4 -4
  272. package/dist/logging/namespaces.d.ts +1 -1
  273. package/dist/logging/namespaces.js +5 -5
  274. package/dist/logging/registry.d.ts +2 -2
  275. package/dist/logging/registry.js +3 -3
  276. package/dist/logging/server-logger.d.ts +1 -1
  277. package/dist/logging/server-logger.js +2 -2
  278. package/dist/logging/stream-logger.d.ts +1 -1
  279. package/dist/logging/stream-logger.js +4 -4
  280. package/dist/logging/transport.d.ts +1 -1
  281. package/dist/logging/types.d.ts +1 -1
  282. package/dist/logging/utils.d.ts +2 -2
  283. package/dist/logging/utils.js +40 -41
  284. package/dist/models/registry/index.d.ts +1 -1
  285. package/dist/models/registry/index.js +5 -5
  286. package/dist/models/registry/models.d.ts +429 -122
  287. package/dist/models/registry/models.js +13693 -13369
  288. package/dist/models/update-models/codegen.d.ts +1 -1
  289. package/dist/models/update-models/codegen.js +8 -8
  290. package/dist/models/update-models/companions.d.ts +6 -1
  291. package/dist/models/update-models/companions.js +104 -39
  292. package/dist/models/update-models/history.d.ts +1 -1
  293. package/dist/models/update-models/history.js +11 -11
  294. package/dist/models/update-models/index.js +32 -34
  295. package/dist/models/update-models/naming.d.ts +2 -2
  296. package/dist/models/update-models/naming.js +177 -186
  297. package/dist/models/update-models/processing.d.ts +2 -2
  298. package/dist/models/update-models/processing.js +17 -19
  299. package/dist/models/update-models/registry.d.ts +2 -2
  300. package/dist/models/update-models/registry.js +9 -9
  301. package/dist/models/update-models/shards.d.ts +1 -1
  302. package/dist/models/update-models/shards.js +3 -3
  303. package/dist/models/update-models/types.d.ts +1 -1
  304. package/dist/models/update-models/utils.js +5 -5
  305. package/dist/pear/pre.js +84 -84
  306. package/dist/profiling/aggregator.d.ts +1 -1
  307. package/dist/profiling/aggregator.js +6 -6
  308. package/dist/profiling/clock.d.ts +1 -1
  309. package/dist/profiling/clock.js +10 -10
  310. package/dist/profiling/controller.d.ts +2 -2
  311. package/dist/profiling/controller.js +11 -12
  312. package/dist/profiling/envelope.d.ts +1 -1
  313. package/dist/profiling/envelope.js +4 -6
  314. package/dist/profiling/events.d.ts +2 -2
  315. package/dist/profiling/events.js +8 -10
  316. package/dist/profiling/exporters.d.ts +1 -1
  317. package/dist/profiling/exporters.js +81 -79
  318. package/dist/profiling/index.d.ts +8 -8
  319. package/dist/profiling/index.js +7 -7
  320. package/dist/profiling/model-execution.js +2 -1
  321. package/dist/profiling/ring-buffer.js +2 -2
  322. package/dist/profiling/types.d.ts +3 -3
  323. package/dist/schemas/archive.d.ts +1 -1
  324. package/dist/schemas/archive.js +8 -14
  325. package/dist/schemas/batch-completion-stream.d.ts +463 -0
  326. package/dist/schemas/batch-completion-stream.js +124 -0
  327. package/dist/schemas/bci-config.d.ts +1 -1
  328. package/dist/schemas/bci-config.js +7 -7
  329. package/dist/schemas/bci.d.ts +3 -3
  330. package/dist/schemas/bci.js +25 -31
  331. package/dist/schemas/cancel.d.ts +6 -1
  332. package/dist/schemas/cancel.js +33 -34
  333. package/dist/schemas/classification.d.ts +1 -1
  334. package/dist/schemas/classification.js +7 -7
  335. package/dist/schemas/common.d.ts +194 -25
  336. package/dist/schemas/common.js +40 -37
  337. package/dist/schemas/completion-event.d.ts +11 -8
  338. package/dist/schemas/completion-event.js +27 -26
  339. package/dist/schemas/completion-stream.d.ts +4 -3
  340. package/dist/schemas/completion-stream.js +51 -67
  341. package/dist/schemas/delegate.d.ts +1 -1
  342. package/dist/schemas/delegate.js +7 -7
  343. package/dist/schemas/delete-cache.d.ts +1 -1
  344. package/dist/schemas/delete-cache.js +8 -8
  345. package/dist/schemas/download-asset.d.ts +2 -2
  346. package/dist/schemas/download-asset.js +21 -21
  347. package/dist/schemas/embed.d.ts +3 -3
  348. package/dist/schemas/embed.js +16 -27
  349. package/dist/schemas/engine-addon-map.d.ts +2 -2
  350. package/dist/schemas/engine-addon-map.js +24 -24
  351. package/dist/schemas/error.d.ts +1 -1
  352. package/dist/schemas/error.js +12 -13
  353. package/dist/schemas/finetune.d.ts +1 -1
  354. package/dist/schemas/finetune.js +35 -41
  355. package/dist/schemas/get-loaded-model-info.d.ts +1 -1
  356. package/dist/schemas/get-loaded-model-info.js +10 -10
  357. package/dist/schemas/get-model-info.d.ts +1 -1
  358. package/dist/schemas/get-model-info.js +48 -91
  359. package/dist/schemas/heartbeat.d.ts +1 -1
  360. package/dist/schemas/heartbeat.js +6 -6
  361. package/dist/schemas/index.d.ts +52 -51
  362. package/dist/schemas/index.js +52 -51
  363. package/dist/schemas/json-schema.d.ts +1 -1
  364. package/dist/schemas/llamacpp-config.d.ts +33 -25
  365. package/dist/schemas/llamacpp-config.js +43 -30
  366. package/dist/schemas/load-model.d.ts +160 -128
  367. package/dist/schemas/load-model.js +120 -126
  368. package/dist/schemas/logging-stream.d.ts +1 -1
  369. package/dist/schemas/logging-stream.js +6 -12
  370. package/dist/schemas/mcp-adapter.d.ts +1 -1
  371. package/dist/schemas/model-src-utils.d.ts +1 -1
  372. package/dist/schemas/model-src-utils.js +13 -13
  373. package/dist/schemas/model-types.d.ts +1 -1
  374. package/dist/schemas/model-types.js +27 -27
  375. package/dist/schemas/ocr.d.ts +1 -1
  376. package/dist/schemas/ocr.js +18 -18
  377. package/dist/schemas/path-validation.d.ts +1 -1
  378. package/dist/schemas/path-validation.js +4 -4
  379. package/dist/schemas/plugin.d.ts +9 -10
  380. package/dist/schemas/plugin.js +47 -47
  381. package/dist/schemas/profiling.d.ts +1 -1
  382. package/dist/schemas/profiling.js +16 -16
  383. package/dist/schemas/provide.d.ts +1 -1
  384. package/dist/schemas/provide.js +8 -8
  385. package/dist/schemas/rag.d.ts +3 -3
  386. package/dist/schemas/rag.js +65 -70
  387. package/dist/schemas/registry.d.ts +1 -1
  388. package/dist/schemas/registry.js +44 -66
  389. package/dist/schemas/reload-config.d.ts +1 -1
  390. package/dist/schemas/reload-config.js +14 -18
  391. package/dist/schemas/resume.d.ts +1 -1
  392. package/dist/schemas/resume.js +3 -3
  393. package/dist/schemas/runtime-context.d.ts +1 -1
  394. package/dist/schemas/runtime-context.js +4 -4
  395. package/dist/schemas/sdcpp-config.d.ts +9 -9
  396. package/dist/schemas/sdcpp-config.js +298 -300
  397. package/dist/schemas/sdk-config.d.ts +55 -43
  398. package/dist/schemas/sdk-config.js +25 -29
  399. package/dist/schemas/sdk-errors-client.d.ts +1 -1
  400. package/dist/schemas/sdk-errors-client.js +80 -80
  401. package/dist/schemas/sdk-errors-registry.js +1 -1
  402. package/dist/schemas/sdk-errors-server.d.ts +1 -1
  403. package/dist/schemas/sdk-errors-server.js +200 -199
  404. package/dist/schemas/shard.d.ts +1 -1
  405. package/dist/schemas/shard.js +4 -4
  406. package/dist/schemas/state.d.ts +1 -1
  407. package/dist/schemas/state.js +5 -10
  408. package/dist/schemas/stop-provide.d.ts +1 -1
  409. package/dist/schemas/stop-provide.js +4 -4
  410. package/dist/schemas/suspend.d.ts +1 -1
  411. package/dist/schemas/suspend.js +3 -3
  412. package/dist/schemas/text-to-speech.d.ts +455 -3
  413. package/dist/schemas/text-to-speech.js +146 -110
  414. package/dist/schemas/tools.d.ts +1 -1
  415. package/dist/schemas/tools.js +17 -24
  416. package/dist/schemas/transcription-config.d.ts +1 -1
  417. package/dist/schemas/transcription-config.js +18 -18
  418. package/dist/schemas/transcription.d.ts +5 -5
  419. package/dist/schemas/transcription.js +31 -33
  420. package/dist/schemas/translate.d.ts +3 -3
  421. package/dist/schemas/translate.js +38 -67
  422. package/dist/schemas/translation-config.d.ts +1 -1
  423. package/dist/schemas/translation-config.js +116 -123
  424. package/dist/schemas/unload-model.d.ts +1 -1
  425. package/dist/schemas/unload-model.js +6 -6
  426. package/dist/schemas/vla.d.ts +1 -1
  427. package/dist/schemas/vla.js +30 -30
  428. package/dist/scripts/run-security-tests.js +9 -10
  429. package/dist/scripts/run-unit-tests.js +11 -12
  430. package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
  431. package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
  432. package/dist/server/bare/delegate-rpc-client.js +32 -34
  433. package/dist/server/bare/hyperswarm.d.ts +3 -3
  434. package/dist/server/bare/hyperswarm.js +14 -14
  435. package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
  436. package/dist/server/bare/ops/bci-transcribe.js +44 -44
  437. package/dist/server/bare/ops/cancel.d.ts +2 -2
  438. package/dist/server/bare/ops/cancel.js +6 -6
  439. package/dist/server/bare/ops/embed.d.ts +1 -1
  440. package/dist/server/bare/ops/embed.js +26 -16
  441. package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
  442. package/dist/server/bare/ops/kv-cache-utils.js +17 -19
  443. package/dist/server/bare/ops/load-model.d.ts +2 -2
  444. package/dist/server/bare/ops/load-model.js +14 -18
  445. package/dist/server/bare/ops/transcribe.d.ts +3 -3
  446. package/dist/server/bare/ops/transcribe.js +62 -62
  447. package/dist/server/bare/ops/translate.d.ts +1 -1
  448. package/dist/server/bare/ops/translate.js +39 -30
  449. package/dist/server/bare/ops/unload-model.d.ts +1 -1
  450. package/dist/server/bare/ops/unload-model.js +12 -12
  451. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
  452. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
  453. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -2
  454. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
  455. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
  456. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
  457. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
  458. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
  459. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
  460. package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
  461. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
  462. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
  463. package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
  464. package/dist/server/bare/plugins/ggml-ocr/plugin.js +38 -38
  465. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
  466. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
  467. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
  468. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
  469. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +1 -1
  470. package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
  471. package/dist/server/bare/plugins/index.d.ts +11 -11
  472. package/dist/server/bare/plugins/index.js +11 -11
  473. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
  474. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
  475. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
  476. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
  477. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
  478. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
  479. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
  480. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
  481. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
  482. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +55 -59
  483. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
  484. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
  485. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
  486. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
  487. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
  488. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +4 -6
  489. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +186 -17
  490. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
  491. package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
  492. package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
  493. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +3 -3
  494. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
  495. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
  496. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
  497. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
  498. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
  499. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
  500. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
  501. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
  502. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
  503. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
  504. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
  505. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +1 -1
  506. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +42 -44
  507. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +4 -4
  508. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +69 -63
  509. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
  510. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
  511. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
  512. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +22 -24
  513. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +3 -2
  514. package/dist/server/bare/plugins/tts-ggml/plugin.js +95 -49
  515. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
  516. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
  517. package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
  518. package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
  519. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
  520. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
  521. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
  522. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
  523. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
  524. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
  525. package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
  526. package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
  527. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
  528. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
  529. package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
  530. package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
  531. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
  532. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
  533. package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
  534. package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
  535. package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
  536. package/dist/server/bare/rag-hyperdb/index.js +11 -11
  537. package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
  538. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
  539. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
  540. package/dist/server/bare/registry/config-registry.d.ts +1 -1
  541. package/dist/server/bare/registry/config-registry.js +13 -16
  542. package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
  543. package/dist/server/bare/registry/logging-stream-registry.js +2 -2
  544. package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
  545. package/dist/server/bare/registry/model-config-registry.js +6 -6
  546. package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
  547. package/dist/server/bare/registry/model-config-utils.js +35 -35
  548. package/dist/server/bare/registry/model-registry.d.ts +3 -3
  549. package/dist/server/bare/registry/model-registry.js +11 -11
  550. package/dist/server/bare/registry/registry-client.d.ts +1 -1
  551. package/dist/server/bare/registry/registry-client.js +18 -18
  552. package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
  553. package/dist/server/bare/registry/runtime-context-registry.js +3 -3
  554. package/dist/server/bare/runtime/disposable-scope.js +3 -3
  555. package/dist/server/bare/runtime/index.d.ts +7 -7
  556. package/dist/server/bare/runtime/index.js +3 -3
  557. package/dist/server/bare/runtime/request-context.d.ts +4 -4
  558. package/dist/server/bare/runtime/request-id.js +1 -1
  559. package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
  560. package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
  561. package/dist/server/bare/runtime/request-registry.d.ts +27 -12
  562. package/dist/server/bare/runtime/request-registry.js +39 -34
  563. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  564. package/dist/server/bare/runtime/with-request-context.js +11 -11
  565. package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
  566. package/dist/server/bare/runtime-lifecycle.js +27 -31
  567. package/dist/server/bare/types/addon-responses.d.ts +5 -4
  568. package/dist/server/bare/utils/audio-input.d.ts +2 -2
  569. package/dist/server/bare/utils/audio-input.js +7 -7
  570. package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
  571. package/dist/server/bare/utils/transcribe-metadata.js +4 -4
  572. package/dist/server/bare/utils/tts-stats.d.ts +1 -1
  573. package/dist/server/bare/utils/tts-stats.js +3 -3
  574. package/dist/server/env.js +8 -8
  575. package/dist/server/error-handlers.d.ts +3 -3
  576. package/dist/server/error-handlers.js +11 -11
  577. package/dist/server/plugins/index.d.ts +1 -1
  578. package/dist/server/plugins/index.js +1 -1
  579. package/dist/server/plugins/registry.d.ts +1 -1
  580. package/dist/server/plugins/registry.js +12 -14
  581. package/dist/server/rpc/create-server.d.ts +1 -1
  582. package/dist/server/rpc/create-server.js +11 -12
  583. package/dist/server/rpc/delegate-transport.d.ts +3 -3
  584. package/dist/server/rpc/delegate-transport.js +43 -44
  585. package/dist/server/rpc/handle-request.d.ts +1 -1
  586. package/dist/server/rpc/handle-request.js +28 -30
  587. package/dist/server/rpc/handler-registry.d.ts +1 -1
  588. package/dist/server/rpc/handler-registry.js +97 -92
  589. package/dist/server/rpc/handler-selection.d.ts +3 -3
  590. package/dist/server/rpc/handler-selection.js +3 -3
  591. package/dist/server/rpc/handler-utils.d.ts +7 -7
  592. package/dist/server/rpc/handler-utils.js +32 -35
  593. package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
  594. package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
  595. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
  596. package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
  597. package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
  598. package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
  599. package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
  600. package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
  601. package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
  602. package/dist/server/rpc/handlers/cancelHandler.js +11 -11
  603. package/dist/server/rpc/handlers/classify.d.ts +1 -1
  604. package/dist/server/rpc/handlers/classify.js +2 -2
  605. package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
  606. package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
  607. package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
  608. package/dist/server/rpc/handlers/completion-stream.js +2 -2
  609. package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
  610. package/dist/server/rpc/handlers/delete-cache.js +10 -10
  611. package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
  612. package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
  613. package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
  614. package/dist/server/rpc/handlers/download-asset.js +20 -20
  615. package/dist/server/rpc/handlers/embed.d.ts +1 -1
  616. package/dist/server/rpc/handlers/embed.js +2 -2
  617. package/dist/server/rpc/handlers/finetune.d.ts +1 -1
  618. package/dist/server/rpc/handlers/finetune.js +8 -6
  619. package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
  620. package/dist/server/rpc/handlers/get-loaded-model-info.js +9 -9
  621. package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
  622. package/dist/server/rpc/handlers/get-model-info.js +20 -20
  623. package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
  624. package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
  625. package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
  626. package/dist/server/rpc/handlers/heartbeat.js +1 -1
  627. package/dist/server/rpc/handlers/index.d.ts +33 -31
  628. package/dist/server/rpc/handlers/index.js +34 -32
  629. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
  630. package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
  631. package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
  632. package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
  633. package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
  634. package/dist/server/rpc/handlers/load-model/handler.js +42 -43
  635. package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
  636. package/dist/server/rpc/handlers/load-model/http.js +100 -107
  637. package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
  638. package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
  639. package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
  640. package/dist/server/rpc/handlers/load-model/index.js +2 -2
  641. package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
  642. package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
  643. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
  644. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
  645. package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
  646. package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
  647. package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
  648. package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
  649. package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
  650. package/dist/server/rpc/handlers/load-model/registry.js +50 -56
  651. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
  652. package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
  653. package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
  654. package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
  655. package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
  656. package/dist/server/rpc/handlers/load-model/types.js +7 -7
  657. package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
  658. package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
  659. package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
  660. package/dist/server/rpc/handlers/logging-stream.js +3 -3
  661. package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
  662. package/dist/server/rpc/handlers/ocr-stream.js +2 -2
  663. package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
  664. package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
  665. package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
  666. package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
  667. package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
  668. package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
  669. package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
  670. package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
  671. package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
  672. package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
  673. package/dist/server/rpc/handlers/provideHandler.js +1 -1
  674. package/dist/server/rpc/handlers/rag.d.ts +1 -1
  675. package/dist/server/rpc/handlers/rag.js +50 -50
  676. package/dist/server/rpc/handlers/registry.d.ts +1 -1
  677. package/dist/server/rpc/handlers/registry.js +34 -36
  678. package/dist/server/rpc/handlers/resume.d.ts +1 -1
  679. package/dist/server/rpc/handlers/resume.js +3 -3
  680. package/dist/server/rpc/handlers/state.d.ts +1 -1
  681. package/dist/server/rpc/handlers/state.js +3 -3
  682. package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
  683. package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
  684. package/dist/server/rpc/handlers/suspend.d.ts +1 -1
  685. package/dist/server/rpc/handlers/suspend.js +3 -3
  686. package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
  687. package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
  688. package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
  689. package/dist/server/rpc/handlers/text-to-speech.js +2 -2
  690. package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
  691. package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
  692. package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
  693. package/dist/server/rpc/handlers/transcribe.js +2 -2
  694. package/dist/server/rpc/handlers/translate.d.ts +1 -1
  695. package/dist/server/rpc/handlers/translate.js +2 -2
  696. package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
  697. package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
  698. package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
  699. package/dist/server/rpc/handlers/unload-model.js +10 -10
  700. package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
  701. package/dist/server/rpc/handlers/upscale-stream.js +2 -2
  702. package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
  703. package/dist/server/rpc/handlers/video-stream.js +2 -2
  704. package/dist/server/rpc/index.d.ts +2 -2
  705. package/dist/server/rpc/index.js +2 -2
  706. package/dist/server/rpc/profiling/context.d.ts +1 -1
  707. package/dist/server/rpc/profiling/context.js +9 -10
  708. package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
  709. package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
  710. package/dist/server/rpc/profiling/index.d.ts +4 -4
  711. package/dist/server/rpc/profiling/index.js +4 -4
  712. package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
  713. package/dist/server/rpc/profiling/operation-metrics.js +102 -102
  714. package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
  715. package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
  716. package/dist/server/rpc/profiling/profiler.d.ts +2 -2
  717. package/dist/server/rpc/profiling/profiler.js +9 -13
  718. package/dist/server/rpc/rpc-utils.js +1 -4
  719. package/dist/server/rpc/transport-selector.d.ts +1 -1
  720. package/dist/server/rpc/transport-selector.js +4 -4
  721. package/dist/server/utils/archive.js +27 -29
  722. package/dist/server/utils/audio/decoder.d.ts +2 -2
  723. package/dist/server/utils/audio/decoder.js +11 -11
  724. package/dist/server/utils/cache/auto-history.d.ts +1 -1
  725. package/dist/server/utils/cache/auto-history.js +5 -5
  726. package/dist/server/utils/cache/paths.d.ts +2 -2
  727. package/dist/server/utils/cache/paths.js +14 -14
  728. package/dist/server/utils/checksum.d.ts +1 -1
  729. package/dist/server/utils/checksum.js +10 -12
  730. package/dist/server/utils/clear-storage.d.ts +1 -1
  731. package/dist/server/utils/clear-storage.js +8 -11
  732. package/dist/server/utils/completion-normalizer.d.ts +1 -1
  733. package/dist/server/utils/completion-normalizer.js +106 -113
  734. package/dist/server/utils/config-transform.d.ts +1 -1
  735. package/dist/server/utils/config-transform.js +2 -2
  736. package/dist/server/utils/expand-gguf-shards.js +4 -4
  737. package/dist/server/utils/formatting.js +6 -12
  738. package/dist/server/utils/gguf-tensor-extractor.js +17 -21
  739. package/dist/server/utils/index.d.ts +11 -11
  740. package/dist/server/utils/index.js +11 -11
  741. package/dist/server/utils/multi-gpu-mobile.js +1 -1
  742. package/dist/server/utils/path-security.d.ts +1 -1
  743. package/dist/server/utils/path-security.js +6 -6
  744. package/dist/server/utils/qvac-paths.js +3 -3
  745. package/dist/server/utils/response-format.d.ts +1 -1
  746. package/dist/server/utils/response-format.js +4 -4
  747. package/dist/server/utils/shard-utils.d.ts +1 -1
  748. package/dist/server/utils/shard-utils.js +14 -16
  749. package/dist/server/utils/tool-integration.d.ts +1 -1
  750. package/dist/server/utils/tool-integration.js +5 -9
  751. package/dist/server/utils/tools/dialect.d.ts +1 -1
  752. package/dist/server/utils/tools/dialect.js +7 -7
  753. package/dist/server/utils/tools/index.d.ts +2 -2
  754. package/dist/server/utils/tools/index.js +2 -2
  755. package/dist/server/utils/tools/parser.d.ts +1 -1
  756. package/dist/server/utils/tools/parser.js +14 -14
  757. package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
  758. package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
  759. package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
  760. package/dist/server/utils/tools/parsers/harmony.js +9 -11
  761. package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
  762. package/dist/server/utils/tools/parsers/hermes.js +16 -16
  763. package/dist/server/utils/tools/parsers/json.d.ts +2 -2
  764. package/dist/server/utils/tools/parsers/json.js +14 -14
  765. package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
  766. package/dist/server/utils/tools/parsers/pythonic.js +43 -43
  767. package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
  768. package/dist/server/utils/tools/parsers/qwen35.js +20 -20
  769. package/dist/server/utils/tools/shared.d.ts +1 -1
  770. package/dist/server/utils/tools/shared.js +10 -12
  771. package/dist/server/utils/worker-lock.js +10 -10
  772. package/dist/server/worker-core.d.ts +1 -1
  773. package/dist/server/worker-core.js +44 -43
  774. package/dist/server/worker.js +9 -9
  775. package/dist/utils/aggregate-events.d.ts +2 -2
  776. package/dist/utils/aggregate-events.js +17 -19
  777. package/dist/utils/cache-normalize.js +1 -4
  778. package/dist/utils/encoding.js +1 -1
  779. package/dist/utils/errors-base.d.ts +1 -1
  780. package/dist/utils/errors-base.js +1 -1
  781. package/dist/utils/errors-client.d.ts +1 -1
  782. package/dist/utils/errors-client.js +5 -5
  783. package/dist/utils/errors-server.d.ts +3 -3
  784. package/dist/utils/errors-server.js +19 -18
  785. package/dist/utils/load-model-validation.js +3 -3
  786. package/dist/utils/mcp-adapter.d.ts +4 -4
  787. package/dist/utils/mcp-adapter.js +31 -38
  788. package/dist/utils/path-sanitize.js +14 -17
  789. package/dist/utils/tool-helpers.d.ts +2 -2
  790. package/dist/utils/tool-helpers.js +25 -26
  791. package/dist/utils/withTimeout.d.ts +7 -0
  792. package/dist/utils/withTimeout.js +11 -1
  793. package/dist/utils/zod-error.d.ts +1 -1
  794. package/dist/utils/zod-error.js +1 -1
  795. package/electron-forge/index.cjs +274 -317
  796. package/expo/plugins/patches/android-link.mjs +25 -30
  797. package/expo/plugins/patches/ios-link.mjs +25 -30
  798. package/package.json +17 -16
@@ -1,17 +1,17 @@
1
- import EmbedLlamacpp, {} from "@qvac/embed-llamacpp";
2
- import embedAddonLogging from "@qvac/embed-llamacpp/addonLogging.js";
3
- import { definePlugin, defineHandler, embedRequestSchema, embedResponseSchema, ModelType, embedConfigBaseSchema, ADDON_EMBEDDING, } from "../../../../schemas/index.js";
4
- import { createStreamLogger, registerAddonLogger, getServerLogger } from "../../../../logging/index.js";
5
- import { expandGGUFIntoShards } from "../../../utils/index.js";
6
- import { embed } from "../../ops/embed.js";
7
- import { forwardModelExecution } from "../../../../profiling/model-execution.js";
8
- import { isMobile } from "../../registry/runtime-context-registry.js";
9
- import { stripMultiGpuKeys } from "../../../utils/multi-gpu-mobile.js";
1
+ import EmbedLlamacpp, {} from '@qvac/embed-llamacpp';
2
+ import embedAddonLogging from '@qvac/embed-llamacpp/addonLogging.js';
3
+ import { definePlugin, defineHandler, embedRequestSchema, embedResponseSchema, ModelType, embedConfigBaseSchema, ADDON_EMBEDDING } from '../../../../schemas/index.js';
4
+ import { createStreamLogger, registerAddonLogger, getServerLogger } from '../../../../logging/index.js';
5
+ import { expandGGUFIntoShards } from '../../../utils/index.js';
6
+ import { embed } from '../../ops/embed.js';
7
+ import { forwardModelExecution } from '../../../../profiling/model-execution.js';
8
+ import { isMobile } from '../../registry/runtime-context-registry.js';
9
+ import { stripMultiGpuKeys } from '../../../utils/multi-gpu-mobile.js';
10
10
  function transformEmbedConfig(embedConfig) {
11
11
  const config = {
12
12
  device: embedConfig.device,
13
13
  gpu_layers: `${embedConfig.gpuLayers}`,
14
- batch_size: `${embedConfig.batchSize}`,
14
+ batch_size: `${embedConfig.batchSize}`
15
15
  };
16
16
  if (embedConfig.flashAttention) {
17
17
  config.flash_attn = embedConfig.flashAttention;
@@ -22,22 +22,20 @@ function transformEmbedConfig(embedConfig) {
22
22
  if (embedConfig.attention) {
23
23
  config.attention = embedConfig.attention;
24
24
  }
25
- if (typeof embedConfig.embdNormalize === "number") {
25
+ if (typeof embedConfig.embdNormalize === 'number') {
26
26
  config.embd_normalize = `${embedConfig.embdNormalize}`;
27
27
  }
28
28
  if (embedConfig.mainGpu !== undefined) {
29
- config["main-gpu"] =
30
- typeof embedConfig.mainGpu === "number"
31
- ? `${embedConfig.mainGpu}`
32
- : embedConfig.mainGpu;
29
+ config['main-gpu'] =
30
+ typeof embedConfig.mainGpu === 'number' ? `${embedConfig.mainGpu}` : embedConfig.mainGpu;
33
31
  }
34
32
  if (embedConfig.splitMode) {
35
- config["split-mode"] = embedConfig.splitMode;
33
+ config['split-mode'] = embedConfig.splitMode;
36
34
  }
37
35
  if (embedConfig.tensorSplit) {
38
- config["tensor-split"] = embedConfig.tensorSplit;
36
+ config['tensor-split'] = embedConfig.tensorSplit;
39
37
  }
40
- if (typeof embedConfig.verbosity === "number") {
38
+ if (typeof embedConfig.verbosity === 'number') {
41
39
  config.verbosity = `${embedConfig.verbosity}`;
42
40
  }
43
41
  if (embedConfig.openclCacheDir) {
@@ -52,7 +50,7 @@ function createEmbeddingsModel(modelId, modelPath, embedConfig) {
52
50
  if (isMobile()) {
53
51
  const stripped = stripMultiGpuKeys(config);
54
52
  if (stripped.length > 0) {
55
- getServerLogger().warn(`[${ModelType.llamacppEmbedding}:${modelId}] Multi-GPU parameters (${stripped.join(", ")}) are not supported on mobile (single-GPU device) — removing from config; model will load with single-GPU defaults`);
53
+ getServerLogger().warn(`[${ModelType.llamacppEmbedding}:${modelId}] Multi-GPU parameters (${stripped.join(', ')}) are not supported on mobile (single-GPU device) — removing from config; model will load with single-GPU defaults`);
56
54
  }
57
55
  }
58
56
  const modelFiles = expandGGUFIntoShards(modelPath);
@@ -60,13 +58,13 @@ function createEmbeddingsModel(modelId, modelPath, embedConfig) {
60
58
  files: { model: modelFiles },
61
59
  config,
62
60
  logger,
63
- opts: { stats: true },
61
+ opts: { stats: true }
64
62
  });
65
63
  return { model };
66
64
  }
67
65
  export const embeddingsPlugin = definePlugin({
68
66
  modelType: ModelType.llamacppEmbedding,
69
- displayName: "Embeddings (llama.cpp)",
67
+ displayName: 'Embeddings (llama.cpp)',
70
68
  addonPackage: ADDON_EMBEDDING,
71
69
  loadConfigSchema: embedConfigBaseSchema,
72
70
  createModel(params) {
@@ -81,23 +79,23 @@ export const embeddingsPlugin = definePlugin({
81
79
  streaming: false,
82
80
  // Model-wide hard cancel via `addon.cancel()` on the llama.cpp
83
81
  // embedding addon. Compute is interrupted when fired.
84
- cancel: { scope: "model", hard: true },
82
+ cancel: { scope: 'model', hard: true },
85
83
  handler: async function (request) {
86
84
  const embedResult = await embed({
87
85
  modelId: request.modelId,
88
- text: request.text,
86
+ text: request.text
89
87
  }, request.requestId);
90
88
  return forwardModelExecution({
91
- type: "embed",
89
+ type: 'embed',
92
90
  success: true,
93
91
  embedding: embedResult.embedding,
94
- ...(embedResult.stats && { stats: embedResult.stats }),
92
+ ...(embedResult.stats && { stats: embedResult.stats })
95
93
  }, embedResult);
96
- },
97
- }),
94
+ }
95
+ })
98
96
  },
99
97
  logging: {
100
98
  module: embedAddonLogging,
101
- namespace: ModelType.llamacppEmbedding,
102
- },
99
+ namespace: ModelType.llamacppEmbedding
100
+ }
103
101
  });
@@ -1,4 +1,4 @@
1
- import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult } from "../../../../schemas/index";
1
+ import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult } from '../../../../schemas/index';
2
2
  export declare const nmtPlugin: {
3
3
  modelType: "nmtcpp-translation";
4
4
  displayName: string;
@@ -1,11 +1,11 @@
1
- import nmtAddonLogging from "@qvac/translation-nmtcpp/addonLogging.js";
2
- import TranslationNmtcpp, {} from "@qvac/translation-nmtcpp";
3
- import { definePlugin, defineHandler, translateRequestSchema, translateResponseSchema, ModelType, nmtConfigBaseSchema, ADDON_NMT, BERGAMOT_CJK_LANG_PAIRS, } from "../../../../schemas/index.js";
4
- import { createStreamLogger, registerAddonLogger } from "../../../../logging/index.js";
5
- import path from "bare-path";
6
- import { translate } from "../../ops/translate.js";
7
- import { attachModelExecutionMs } from "../../../../profiling/model-execution.js";
8
- import { resolveBergamotVocab, } from "./resolve-vocab.js";
1
+ import nmtAddonLogging from '@qvac/translation-nmtcpp/addonLogging.js';
2
+ import TranslationNmtcpp, {} from '@qvac/translation-nmtcpp';
3
+ import { definePlugin, defineHandler, translateRequestSchema, translateResponseSchema, ModelType, nmtConfigBaseSchema, ADDON_NMT, BERGAMOT_CJK_LANG_PAIRS } from '../../../../schemas/index.js';
4
+ import { createStreamLogger, registerAddonLogger } from '../../../../logging/index.js';
5
+ import path from 'bare-path';
6
+ import { translate } from '../../ops/translate.js';
7
+ import { attachModelExecutionMs } from '../../../../profiling/model-execution.js';
8
+ import { resolveBergamotVocab } from './resolve-vocab.js';
9
9
  /**
10
10
  * Derive absolute vocab paths from a resolved Bergamot model path.
11
11
  * Works for both companion-set layout (colocated files) and any layout where
@@ -22,7 +22,7 @@ function deriveColocatedBergamotVocabPaths(modelPath) {
22
22
  if (BERGAMOT_CJK_LANG_PAIRS.includes(langPair)) {
23
23
  return {
24
24
  srcVocabPath: path.join(dirPath, `srcvocab.${langPair}.spm`),
25
- dstVocabPath: path.join(dirPath, `trgvocab.${langPair}.spm`),
25
+ dstVocabPath: path.join(dirPath, `trgvocab.${langPair}.spm`)
26
26
  };
27
27
  }
28
28
  const sharedPath = path.join(dirPath, `vocab.${langPair}.spm`);
@@ -31,14 +31,14 @@ function deriveColocatedBergamotVocabPaths(modelPath) {
31
31
  function createNmtModel(modelId, modelPath, nmtConfig, srcVocabPath, dstVocabPath, pivotModelPath, pivotSrcVocabPath, pivotDstVocabPath) {
32
32
  const logger = createStreamLogger(modelId, ModelType.nmtcppTranslation);
33
33
  registerAddonLogger(modelId, ModelType.nmtcppTranslation, logger);
34
- const { mode, from, to, engine, beamsize, lengthpenalty, maxlength, repetitionpenalty, norepeatngramsize, temperature, topk, topp, } = nmtConfig;
34
+ const { mode, from, to, engine, beamsize, lengthpenalty, maxlength, repetitionpenalty, norepeatngramsize, temperature, topk, topp } = nmtConfig;
35
35
  const files = {
36
36
  model: modelPath,
37
37
  ...(srcVocabPath && { srcVocab: srcVocabPath }),
38
38
  ...(dstVocabPath && { dstVocab: dstVocabPath }),
39
39
  ...(pivotModelPath && { pivotModel: pivotModelPath }),
40
40
  ...(pivotSrcVocabPath && { pivotSrcVocab: pivotSrcVocabPath }),
41
- ...(pivotDstVocabPath && { pivotDstVocab: pivotDstVocabPath }),
41
+ ...(pivotDstVocabPath && { pivotDstVocab: pivotDstVocabPath })
42
42
  };
43
43
  const generationParams = {
44
44
  beamsize,
@@ -48,41 +48,42 @@ function createNmtModel(modelId, modelPath, nmtConfig, srcVocabPath, dstVocabPat
48
48
  norepeatngramsize,
49
49
  temperature,
50
50
  topk,
51
- topp,
51
+ topp
52
52
  };
53
53
  const config = {
54
54
  modelType: TranslationNmtcpp.ModelTypes[engine],
55
55
  ...generationParams,
56
- ...(nmtConfig.engine === "Bergamot" && {
56
+ ...(nmtConfig.engine === 'Bergamot' && {
57
57
  ...(nmtConfig.normalize !== undefined && {
58
- normalize: nmtConfig.normalize,
58
+ normalize: nmtConfig.normalize
59
59
  }),
60
- ...(nmtConfig.pivotModel && pivotModelPath && {
60
+ ...(nmtConfig.pivotModel &&
61
+ pivotModelPath && {
61
62
  pivotConfig: (() => {
62
63
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
63
64
  const { modelSrc, dstVocabSrc, srcVocabSrc, ...pivotGenConfig } = nmtConfig.pivotModel;
64
65
  return pivotGenConfig;
65
- })(),
66
- }),
67
- }),
66
+ })()
67
+ })
68
+ })
68
69
  };
69
70
  const model = new TranslationNmtcpp({
70
71
  files,
71
72
  params: { mode, srcLang: from, dstLang: to },
72
73
  config,
73
74
  logger,
74
- opts: { stats: true },
75
+ opts: { stats: true }
75
76
  });
76
77
  return { model };
77
78
  }
78
79
  export const nmtPlugin = definePlugin({
79
80
  modelType: ModelType.nmtcppTranslation,
80
- displayName: "NMT (nmtcpp)",
81
+ displayName: 'NMT (nmtcpp)',
81
82
  addonPackage: ADDON_NMT,
82
83
  loadConfigSchema: nmtConfigBaseSchema,
83
84
  async resolveConfig(cfg, ctx) {
84
85
  const { srcVocabSrc, dstVocabSrc, pivotModel, ...nmtConfig } = cfg;
85
- if (nmtConfig.engine !== "Bergamot") {
86
+ if (nmtConfig.engine !== 'Bergamot') {
86
87
  return { config: nmtConfig };
87
88
  }
88
89
  const bergamotConfig = { ...nmtConfig, ...(pivotModel && { pivotModel }) };
@@ -92,14 +93,12 @@ export const nmtPlugin = definePlugin({
92
93
  const nmtConfig = (params.modelConfig ?? {});
93
94
  const artifacts = params.artifacts ?? {};
94
95
  const derived = deriveColocatedBergamotVocabPaths(params.modelPath);
95
- const srcVocabPath = artifacts["srcVocabPath"] ?? derived?.srcVocabPath;
96
- const dstVocabPath = artifacts["dstVocabPath"] ?? derived?.dstVocabPath;
97
- const pivotModelPath = artifacts["pivotModelPath"];
98
- const pivotDerived = pivotModelPath
99
- ? deriveColocatedBergamotVocabPaths(pivotModelPath)
100
- : null;
101
- const pivotSrcVocabPath = artifacts["pivotSrcVocabPath"] ?? pivotDerived?.srcVocabPath;
102
- const pivotDstVocabPath = artifacts["pivotDstVocabPath"] ?? pivotDerived?.dstVocabPath;
96
+ const srcVocabPath = artifacts['srcVocabPath'] ?? derived?.srcVocabPath;
97
+ const dstVocabPath = artifacts['dstVocabPath'] ?? derived?.dstVocabPath;
98
+ const pivotModelPath = artifacts['pivotModelPath'];
99
+ const pivotDerived = pivotModelPath ? deriveColocatedBergamotVocabPaths(pivotModelPath) : null;
100
+ const pivotSrcVocabPath = artifacts['pivotSrcVocabPath'] ?? pivotDerived?.srcVocabPath;
101
+ const pivotDstVocabPath = artifacts['pivotDstVocabPath'] ?? pivotDerived?.dstVocabPath;
103
102
  const { model } = createNmtModel(params.modelId, params.modelPath, nmtConfig, srcVocabPath, dstVocabPath, pivotModelPath, pivotSrcVocabPath, pivotDstVocabPath);
104
103
  return { model };
105
104
  },
@@ -111,34 +110,34 @@ export const nmtPlugin = definePlugin({
111
110
  // nmtcpp does not expose a cancel surface today — SDK falls
112
111
  // back to soft-cancel (stop yielding, drop result, skip
113
112
  // post-processing; the C++ work runs to completion).
114
- cancel: { scope: "none" },
113
+ cancel: { scope: 'none' },
115
114
  handler: async function* (request) {
116
115
  const stream = translate(request, request.requestId);
117
116
  try {
118
117
  let result = await stream.next();
119
118
  while (!result.done) {
120
119
  yield {
121
- type: "translate",
122
- token: result.value,
120
+ type: 'translate',
121
+ token: result.value
123
122
  };
124
123
  result = await stream.next();
125
124
  }
126
125
  const { modelExecutionMs, stats } = result.value;
127
126
  yield attachModelExecutionMs({
128
- type: "translate",
129
- token: "",
127
+ type: 'translate',
128
+ token: '',
130
129
  done: true,
131
- ...(stats && { stats }),
130
+ ...(stats && { stats })
132
131
  }, modelExecutionMs);
133
132
  }
134
133
  finally {
135
134
  await stream.return?.(undefined);
136
135
  }
137
- },
138
- }),
136
+ }
137
+ })
139
138
  },
140
139
  logging: {
141
140
  module: nmtAddonLogging,
142
- namespace: ModelType.nmtcppTranslation,
143
- },
141
+ namespace: ModelType.nmtcppTranslation
142
+ }
144
143
  });
@@ -1,4 +1,4 @@
1
- import { type ModelSrcInput, type NmtConfig, type ResolveContext, type ResolveResult } from "../../../../schemas/index";
1
+ import { type ModelSrcInput, type NmtConfig, type ResolveContext, type ResolveResult } from '../../../../schemas/index';
2
2
  export interface PivotModelConfig {
3
3
  modelSrc: string;
4
4
  srcVocabSrc?: ModelSrcInput;
@@ -1,10 +1,10 @@
1
- import { BERGAMOT_CJK_LANG_PAIRS, } from "../../../../schemas/index.js";
2
- import { ModelLoadFailedError } from "../../../../utils/errors-server.js";
1
+ import { BERGAMOT_CJK_LANG_PAIRS } from '../../../../schemas/index.js';
2
+ import { ModelLoadFailedError } from '../../../../utils/errors-server.js';
3
3
  export function buildBergamotVocabSources(basePath, langPair) {
4
4
  if (BERGAMOT_CJK_LANG_PAIRS.includes(langPair)) {
5
5
  return {
6
6
  srcVocabSrc: `${basePath}srcvocab.${langPair}.spm`,
7
- dstVocabSrc: `${basePath}trgvocab.${langPair}.spm`,
7
+ dstVocabSrc: `${basePath}trgvocab.${langPair}.spm`
8
8
  };
9
9
  }
10
10
  const sharedVocab = `${basePath}vocab.${langPair}.spm`;
@@ -42,9 +42,9 @@ export async function resolveBergamotVocab(nmtConfig, ctx, srcVocabSrc, dstVocab
42
42
  let srcSrc = srcVocabSrc;
43
43
  let dstSrc = dstVocabSrc;
44
44
  if (!srcSrc || !dstSrc) {
45
- const derived = ctx.modelSrc.startsWith("pear://")
45
+ const derived = ctx.modelSrc.startsWith('pear://')
46
46
  ? deriveBergamotVocabSources(ctx.modelSrc)
47
- : ctx.modelSrc.startsWith("registry://")
47
+ : ctx.modelSrc.startsWith('registry://')
48
48
  ? deriveBergamotRegistryVocabSources(ctx.modelSrc)
49
49
  : null;
50
50
  if (derived) {
@@ -53,29 +53,29 @@ export async function resolveBergamotVocab(nmtConfig, ctx, srcVocabSrc, dstVocab
53
53
  }
54
54
  }
55
55
  if (!srcSrc || !dstSrc) {
56
- throw new ModelLoadFailedError("Bergamot requires srcVocabSrc and dstVocabSrc. Provide them in modelConfig or use a pear:// or registry:// model source for auto-derivation.");
56
+ throw new ModelLoadFailedError('Bergamot requires srcVocabSrc and dstVocabSrc. Provide them in modelConfig or use a pear:// or registry:// model source for auto-derivation.');
57
57
  }
58
58
  if (!pivotModel) {
59
- const modelIsRegistry = ctx.modelSrc.startsWith("registry://");
59
+ const modelIsRegistry = ctx.modelSrc.startsWith('registry://');
60
60
  const vocabsAreDerived = !srcVocabSrc && !dstVocabSrc;
61
61
  if (modelIsRegistry && vocabsAreDerived) {
62
62
  return { config: nmtConfig };
63
63
  }
64
64
  const [srcVocabPath, dstVocabPath] = await Promise.all([
65
65
  ctx.resolveModelPath(srcSrc),
66
- ctx.resolveModelPath(dstSrc),
66
+ ctx.resolveModelPath(dstSrc)
67
67
  ]);
68
68
  return {
69
69
  config: nmtConfig,
70
- artifacts: { srcVocabPath, dstVocabPath },
70
+ artifacts: { srcVocabPath, dstVocabPath }
71
71
  };
72
72
  }
73
73
  let pivotSrcSrc = pivotModel.srcVocabSrc;
74
74
  let pivotDstSrc = pivotModel.dstVocabSrc;
75
75
  if (!pivotSrcSrc || !pivotDstSrc) {
76
- const pivotDerived = pivotModel.modelSrc.startsWith("pear://")
76
+ const pivotDerived = pivotModel.modelSrc.startsWith('pear://')
77
77
  ? deriveBergamotVocabSources(pivotModel.modelSrc)
78
- : pivotModel.modelSrc.startsWith("registry://")
78
+ : pivotModel.modelSrc.startsWith('registry://')
79
79
  ? deriveBergamotRegistryVocabSources(pivotModel.modelSrc)
80
80
  : null;
81
81
  if (pivotDerived) {
@@ -84,25 +84,22 @@ export async function resolveBergamotVocab(nmtConfig, ctx, srcVocabSrc, dstVocab
84
84
  }
85
85
  }
86
86
  if (!pivotSrcSrc || !pivotDstSrc) {
87
- throw new ModelLoadFailedError("Bergamot pivot model requires srcVocabSrc and dstVocabSrc. Provide them in modelConfig or use a pear:// or registry:// model source for auto-derivation.");
87
+ throw new ModelLoadFailedError('Bergamot pivot model requires srcVocabSrc and dstVocabSrc. Provide them in modelConfig or use a pear:// or registry:// model source for auto-derivation.');
88
88
  }
89
- const modelIsRegistry = ctx.modelSrc.startsWith("registry://");
90
- const pivotIsRegistry = pivotModel.modelSrc.startsWith("registry://");
89
+ const modelIsRegistry = ctx.modelSrc.startsWith('registry://');
90
+ const pivotIsRegistry = pivotModel.modelSrc.startsWith('registry://');
91
91
  const primaryVocabsAreDerived = !srcVocabSrc && !dstVocabSrc;
92
92
  const pivotVocabsAreDerived = !pivotModel.srcVocabSrc && !pivotModel.dstVocabSrc;
93
- if (modelIsRegistry &&
94
- pivotIsRegistry &&
95
- primaryVocabsAreDerived &&
96
- pivotVocabsAreDerived) {
93
+ if (modelIsRegistry && pivotIsRegistry && primaryVocabsAreDerived && pivotVocabsAreDerived) {
97
94
  const pivotModelPath = await ctx.resolveModelPath(pivotModel.modelSrc);
98
95
  return { config: nmtConfig, artifacts: { pivotModelPath } };
99
96
  }
100
- const [srcVocabPath, dstVocabPath, pivotSrcVocabPath, pivotDstVocabPath, pivotModelPath,] = await Promise.all([
97
+ const [srcVocabPath, dstVocabPath, pivotSrcVocabPath, pivotDstVocabPath, pivotModelPath] = await Promise.all([
101
98
  ctx.resolveModelPath(srcSrc),
102
99
  ctx.resolveModelPath(dstSrc),
103
100
  ctx.resolveModelPath(pivotSrcSrc),
104
101
  ctx.resolveModelPath(pivotDstSrc),
105
- ctx.resolveModelPath(pivotModel.modelSrc),
102
+ ctx.resolveModelPath(pivotModel.modelSrc)
106
103
  ]);
107
104
  return {
108
105
  config: nmtConfig,
@@ -111,7 +108,7 @@ export async function resolveBergamotVocab(nmtConfig, ctx, srcVocabSrc, dstVocab
111
108
  dstVocabPath,
112
109
  pivotSrcVocabPath,
113
110
  pivotDstVocabPath,
114
- pivotModelPath,
115
- },
111
+ pivotModelPath
112
+ }
116
113
  };
117
114
  }
@@ -1,4 +1,4 @@
1
- import { type ParakeetConfig, type CreateModelParams, type PluginModelResult, type ResolveResult } from "../../../../schemas/index";
1
+ import { type ParakeetConfig, type CreateModelParams, type PluginModelResult, type ResolveResult } from '../../../../schemas/index';
2
2
  export declare const parakeetPlugin: {
3
3
  modelType: "parakeet-transcription";
4
4
  displayName: string;
@@ -1,10 +1,10 @@
1
- import parakeetAddonLogging from "@qvac/transcription-parakeet/addonLogging.js";
2
- import TranscriptionParakeet, {} from "@qvac/transcription-parakeet";
3
- import { definePlugin, defineHandler, defineDuplexHandler, transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, ModelType, parakeetLoadConfigSchema, LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS, ADDON_PARAKEET, } from "../../../../schemas/index.js";
4
- import { createStreamLogger, registerAddonLogger } from "../../../../logging/index.js";
5
- import { ModelLoadFailedError, TranscriptionFailedError, LegacyParakeetModelDeprecatedError, } from "../../../../utils/errors-server.js";
6
- import { transcribe, transcribeStream } from "../../ops/transcribe.js";
7
- import { attachModelExecutionMs } from "../../../../profiling/model-execution.js";
1
+ import parakeetAddonLogging from '@qvac/transcription-parakeet/addonLogging.js';
2
+ import TranscriptionParakeet, {} from '@qvac/transcription-parakeet';
3
+ import { definePlugin, defineHandler, defineDuplexHandler, transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, ModelType, parakeetLoadConfigSchema, LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS, ADDON_PARAKEET } from '../../../../schemas/index.js';
4
+ import { createStreamLogger, registerAddonLogger } from '../../../../logging/index.js';
5
+ import { ModelLoadFailedError, TranscriptionFailedError, LegacyParakeetModelDeprecatedError } from '../../../../utils/errors-server.js';
6
+ import { transcribe, transcribeStream } from '../../ops/transcribe.js';
7
+ import { attachModelExecutionMs } from '../../../../profiling/model-execution.js';
8
8
  function resolveParakeetConfig(cfg) {
9
9
  const cfgRecord = cfg;
10
10
  const legacyFields = LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS.filter((name) => cfgRecord[name] !== undefined);
@@ -17,28 +17,28 @@ function createParakeetModel(params) {
17
17
  const config = (params.modelConfig ?? {});
18
18
  const modelPath = params.modelPath;
19
19
  if (!modelPath) {
20
- throw new ModelLoadFailedError("Parakeet requires a GGUF model source");
20
+ throw new ModelLoadFailedError('Parakeet requires a GGUF model source');
21
21
  }
22
22
  const logger = createStreamLogger(params.modelId, ModelType.parakeetTranscription);
23
23
  registerAddonLogger(params.modelId, ModelType.parakeetTranscription, logger);
24
24
  const files = {
25
- model: modelPath,
25
+ model: modelPath
26
26
  };
27
27
  const parakeetConfig = Object.fromEntries(Object.entries(config).filter(([, value]) => value !== undefined));
28
28
  const addonConfig = {
29
29
  enableStats: true,
30
- parakeetConfig,
30
+ parakeetConfig
31
31
  };
32
32
  const model = new TranscriptionParakeet({
33
33
  files,
34
34
  config: addonConfig,
35
- logger,
35
+ logger
36
36
  });
37
37
  return { model };
38
38
  }
39
39
  export const parakeetPlugin = definePlugin({
40
40
  modelType: ModelType.parakeetTranscription,
41
- displayName: "Parakeet (NVIDIA NeMo GGML)",
41
+ displayName: 'Parakeet (NVIDIA NeMo GGML)',
42
42
  addonPackage: ADDON_PARAKEET,
43
43
  loadConfigSchema: parakeetLoadConfigSchema,
44
44
  resolveConfig(cfg) {
@@ -52,7 +52,7 @@ export const parakeetPlugin = definePlugin({
52
52
  requestSchema: transcribeRequestSchema,
53
53
  responseSchema: transcribeResponseSchema,
54
54
  streaming: true,
55
- cancel: { scope: "model", hard: true },
55
+ cancel: { scope: 'model', hard: true },
56
56
  handler: async function* (request) {
57
57
  if (request.metadata === true) {
58
58
  throw new TranscriptionFailedError(`Parakeet transcription does not support metadata: true; only the whisper engine emits per-segment metadata. Use a whisper model to receive segments.`);
@@ -60,36 +60,36 @@ export const parakeetPlugin = definePlugin({
60
60
  const stream = transcribe({
61
61
  modelId: request.modelId,
62
62
  audioChunk: request.audioChunk,
63
- prompt: request.prompt,
63
+ prompt: request.prompt
64
64
  }, request.requestId);
65
65
  try {
66
66
  let result = await stream.next();
67
67
  while (!result.done) {
68
68
  yield {
69
- type: "transcribe",
70
- text: result.value,
69
+ type: 'transcribe',
70
+ text: result.value
71
71
  };
72
72
  result = await stream.next();
73
73
  }
74
74
  const { modelExecutionMs, stats } = result.value;
75
75
  yield attachModelExecutionMs({
76
- type: "transcribe",
77
- text: "",
76
+ type: 'transcribe',
77
+ text: '',
78
78
  done: true,
79
- ...(stats && { stats }),
79
+ ...(stats && { stats })
80
80
  }, modelExecutionMs);
81
81
  }
82
82
  finally {
83
83
  await stream.return?.(undefined);
84
84
  }
85
- },
85
+ }
86
86
  }),
87
87
  transcribeStream: defineDuplexHandler({
88
88
  requestSchema: transcribeStreamRequestSchema,
89
89
  responseSchema: transcribeStreamResponseSchema,
90
90
  streaming: true,
91
91
  duplex: true,
92
- cancel: { scope: "model", hard: true },
92
+ cancel: { scope: 'model', hard: true },
93
93
  // TODO(QVAC-17869-followup): wire `AbortSignal` through the duplex
94
94
  // handler signature so the worker learns about consumer disconnects
95
95
  // without depending on `inputStream.end()` (which does not fire if the
@@ -103,35 +103,35 @@ export const parakeetPlugin = definePlugin({
103
103
  }
104
104
  const streamOpts = {
105
105
  ...(request.parakeetStreamingConfig && {
106
- parakeetStreamingConfig: request.parakeetStreamingConfig,
107
- }),
106
+ parakeetStreamingConfig: request.parakeetStreamingConfig
107
+ })
108
108
  };
109
109
  const iterator = transcribeStream(request.modelId, inputStream, undefined, false, streamOpts, request.requestId);
110
110
  for await (const value of iterator) {
111
- if (typeof value === "object" && value !== null && "type" in value) {
112
- if (value.type === "endOfTurn") {
111
+ if (typeof value === 'object' && value !== null && 'type' in value) {
112
+ if (value.type === 'endOfTurn') {
113
113
  yield {
114
- type: "transcribeStream",
115
- endOfTurn: { source: "parakeet" },
114
+ type: 'transcribeStream',
115
+ endOfTurn: { source: 'parakeet' }
116
116
  };
117
117
  }
118
118
  continue;
119
119
  }
120
120
  yield {
121
- type: "transcribeStream",
122
- text: value,
121
+ type: 'transcribeStream',
122
+ text: value
123
123
  };
124
124
  }
125
125
  yield {
126
- type: "transcribeStream",
127
- text: "",
128
- done: true,
126
+ type: 'transcribeStream',
127
+ text: '',
128
+ done: true
129
129
  };
130
- },
131
- }),
130
+ }
131
+ })
132
132
  },
133
133
  logging: {
134
134
  module: parakeetAddonLogging,
135
- namespace: ModelType.parakeetTranscription,
136
- },
135
+ namespace: ModelType.parakeetTranscription
136
+ }
137
137
  });
@@ -1,3 +1,3 @@
1
- import type { DiffusionRequest, DiffusionStreamResponse } from "../../../../../schemas/sdcpp-config";
1
+ import type { DiffusionRequest, DiffusionStreamResponse } from '../../../../../schemas/sdcpp-config';
2
2
  export declare function diffusion(request: DiffusionRequest): AsyncGenerator<DiffusionStreamResponse>;
3
3
  //# sourceMappingURL=diffusion.d.ts.map
@@ -1,11 +1,9 @@
1
- import { getModel } from "../../../registry/model-registry.js";
1
+ import { getModel } from '../../../registry/model-registry.js';
2
2
  export async function* diffusion(request) {
3
3
  const model = getModel(request.modelId);
4
- const init_image = request.init_image
5
- ? Buffer.from(request.init_image, "base64")
6
- : undefined;
4
+ const init_image = request.init_image ? Buffer.from(request.init_image, 'base64') : undefined;
7
5
  const init_images = request.init_images
8
- ? request.init_images.map((b64) => Buffer.from(b64, "base64"))
6
+ ? request.init_images.map((b64) => Buffer.from(b64, 'base64'))
9
7
  : undefined;
10
8
  const response = await model.run({
11
9
  prompt: request.prompt,
@@ -28,26 +26,26 @@ export async function* diffusion(request) {
28
26
  auto_resize_ref_image: request.auto_resize_ref_image,
29
27
  strength: request.strength,
30
28
  lora: request.lora,
31
- upscale: request.upscale === false ? undefined : request.upscale,
29
+ upscale: request.upscale === false ? undefined : request.upscale
32
30
  });
33
31
  let outputIndex = 0;
34
32
  for await (const chunk of response.iterate()) {
35
33
  if (chunk instanceof Uint8Array) {
36
34
  yield {
37
- type: "diffusionStream",
38
- data: Buffer.from(chunk).toString("base64"),
39
- outputIndex: outputIndex++,
35
+ type: 'diffusionStream',
36
+ data: Buffer.from(chunk).toString('base64'),
37
+ outputIndex: outputIndex++
40
38
  };
41
39
  }
42
- else if (typeof chunk === "string") {
40
+ else if (typeof chunk === 'string') {
43
41
  try {
44
42
  const tick = JSON.parse(chunk);
45
- if ("step" in tick) {
43
+ if ('step' in tick) {
46
44
  yield {
47
- type: "diffusionStream",
48
- step: tick["step"],
49
- totalSteps: tick["total"],
50
- elapsedMs: tick["elapsed_ms"],
45
+ type: 'diffusionStream',
46
+ step: tick['step'],
47
+ totalSteps: tick['total'],
48
+ elapsedMs: tick['elapsed_ms']
51
49
  };
52
50
  }
53
51
  }
@@ -58,8 +56,8 @@ export async function* diffusion(request) {
58
56
  }
59
57
  const responseWithStats = response;
60
58
  yield {
61
- type: "diffusionStream",
59
+ type: 'diffusionStream',
62
60
  done: true,
63
- stats: responseWithStats.stats ?? undefined,
61
+ stats: responseWithStats.stats ?? undefined
64
62
  };
65
63
  }
@@ -1,3 +1,3 @@
1
- import type { UpscaleRequest, UpscaleStreamResponse } from "../../../../../schemas/sdcpp-config";
1
+ import type { UpscaleRequest, UpscaleStreamResponse } from '../../../../../schemas/sdcpp-config';
2
2
  export declare function upscale(request: UpscaleRequest): AsyncGenerator<UpscaleStreamResponse>;
3
3
  //# sourceMappingURL=upscale.d.ts.map