@qvac/sdk 0.14.1 → 0.16.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 (829) hide show
  1. package/NOTICE +47 -45
  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 +10 -1
  38. package/dist/client/api/ocr.js +20 -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 -25
  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 +8 -5
  63. package/dist/client/api/video.js +23 -18
  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 +15 -11
  67. package/dist/client/api/vla.js +27 -23
  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 +19 -13
  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.js +4 -4
  107. package/dist/commands/bundle/index.js +45 -47
  108. package/dist/commands/bundle/manifest.d.ts +1 -1
  109. package/dist/commands/bundle/manifest.js +44 -46
  110. package/dist/commands/bundle/plugins.d.ts +2 -2
  111. package/dist/commands/bundle/plugins.js +7 -7
  112. package/dist/commands/bundle/resolve-sdk-import.js +6 -13
  113. package/dist/commands/index.d.ts +4 -4
  114. package/dist/commands/index.js +2 -2
  115. package/dist/commands/verify/abi.d.ts +9 -9
  116. package/dist/commands/verify/abi.js +31 -31
  117. package/dist/commands/verify/addon-source.d.ts +1 -1
  118. package/dist/commands/verify/addon-source.js +13 -14
  119. package/dist/commands/verify/bundle-source.d.ts +1 -1
  120. package/dist/commands/verify/bundle-source.js +7 -7
  121. package/dist/commands/verify/index.d.ts +3 -3
  122. package/dist/commands/verify/index.js +18 -17
  123. package/dist/commands/verify/node-modules-source.d.ts +1 -1
  124. package/dist/commands/verify/node-modules-source.js +11 -11
  125. package/dist/commands/verify/prebuilds.d.ts +3 -3
  126. package/dist/commands/verify/prebuilds.js +8 -8
  127. package/dist/constants/audio.d.ts +1 -1
  128. package/dist/constants/audio.js +1 -1
  129. package/dist/constants/index.d.ts +2 -2
  130. package/dist/constants/index.js +2 -2
  131. package/dist/constants/registry.js +1 -1
  132. package/dist/examples/audio/mic-input.d.ts +1 -1
  133. package/dist/examples/audio/mic-input.js +31 -31
  134. package/dist/examples/batch-completion.d.ts +38 -0
  135. package/dist/examples/batch-completion.js +100 -0
  136. package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
  137. package/dist/examples/bci/bci-filesystem.js +17 -17
  138. package/dist/examples/cache-management.js +32 -32
  139. package/dist/examples/cancel-by-request-id.js +11 -11
  140. package/dist/examples/classification/classify-image.js +5 -5
  141. package/dist/examples/completion-events.js +16 -18
  142. package/dist/examples/completion-stop-reason.js +13 -13
  143. package/dist/examples/concurrent-completion-collision.js +20 -20
  144. package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
  145. package/dist/examples/config/default/default.config.js +2 -2
  146. package/dist/examples/config/plugins/plugins.config.js +2 -2
  147. package/dist/examples/config-reload.js +14 -14
  148. package/dist/examples/default-config-usage.js +10 -13
  149. package/dist/examples/delegated-inference/composite.js +23 -23
  150. package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
  151. package/dist/examples/delegated-inference/consumer.js +11 -11
  152. package/dist/examples/delegated-inference/provider.js +24 -24
  153. package/dist/examples/diffusion-esrgan-upscale.js +19 -19
  154. package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
  155. package/dist/examples/diffusion-flux2-klein.js +14 -14
  156. package/dist/examples/diffusion-ideogram.d.ts +2 -0
  157. package/dist/examples/diffusion-ideogram.js +108 -0
  158. package/dist/examples/diffusion-img2img.js +13 -13
  159. package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
  160. package/dist/examples/diffusion-img2vid-ltx.js +98 -0
  161. package/dist/examples/diffusion-img2vid.js +22 -23
  162. package/dist/examples/diffusion-simple.js +7 -7
  163. package/dist/examples/diffusion-txt2img.js +13 -14
  164. package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
  165. package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
  166. package/dist/examples/diffusion-txt2vid.js +18 -18
  167. package/dist/examples/download-with-blind-relays.js +7 -8
  168. package/dist/examples/download-with-cancel.js +9 -9
  169. package/dist/examples/embed-multi-gpu.js +9 -9
  170. package/dist/examples/embed-p2p.js +24 -24
  171. package/dist/examples/finetune/llamacpp-finetune.js +21 -21
  172. package/dist/examples/kv-cache-cleanup.js +34 -34
  173. package/dist/examples/kv-cache-custom-key.js +30 -30
  174. package/dist/examples/kv-cache-example.js +18 -20
  175. package/dist/examples/llamacpp-cache.js +33 -33
  176. package/dist/examples/llamacpp-dynamic-tools.js +38 -38
  177. package/dist/examples/llamacpp-filesystem.js +13 -15
  178. package/dist/examples/llamacpp-http.js +12 -14
  179. package/dist/examples/llamacpp-multi-gpu.js +12 -12
  180. package/dist/examples/llamacpp-multimodal.js +16 -16
  181. package/dist/examples/llamacpp-p2p.js +11 -11
  182. package/dist/examples/llamacpp-sharded.js +12 -12
  183. package/dist/examples/llamacpp-structured-output.js +37 -37
  184. package/dist/examples/logging-file-transport.js +19 -21
  185. package/dist/examples/logging-global.js +8 -8
  186. package/dist/examples/logging-streaming.js +19 -17
  187. package/dist/examples/mcp-websearch.js +44 -44
  188. package/dist/examples/multi-model-demo.js +33 -33
  189. package/dist/examples/ocr-fasttext.js +17 -17
  190. package/dist/examples/parallel-download.js +11 -13
  191. package/dist/examples/plugins.js +43 -43
  192. package/dist/examples/profiling/basic.js +34 -36
  193. package/dist/examples/profiling/per-call.js +16 -16
  194. package/dist/examples/quickstart.bare.js +4 -6
  195. package/dist/examples/quickstart.js +7 -7
  196. package/dist/examples/rag/rag-chromadb.js +26 -26
  197. package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
  198. package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
  199. package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
  200. package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
  201. package/dist/examples/rag/rag-lancedb.js +29 -32
  202. package/dist/examples/rag/rag-sqlite.js +25 -25
  203. package/dist/examples/registry-query.js +15 -15
  204. package/dist/examples/seed-p2p.js +8 -8
  205. package/dist/examples/suspend-resume.js +20 -20
  206. package/dist/examples/tools/llamacpp-native-tools.js +25 -25
  207. package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
  208. package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
  209. package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
  210. package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
  211. package/dist/examples/tools/shared.d.ts +2 -2
  212. package/dist/examples/tools/shared.js +17 -17
  213. package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
  214. package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
  215. package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
  216. package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
  217. package/dist/examples/transcription/parakeet-sortformer.js +21 -21
  218. package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.d.ts +2 -0
  219. package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.js +203 -0
  220. package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
  221. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
  222. package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
  223. package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
  224. package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
  225. package/dist/examples/transcription/whispercpp-prompt.js +18 -18
  226. package/dist/examples/translation/translation-bergamot-batch.js +17 -17
  227. package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
  228. package/dist/examples/translation/translation-bergamot.js +11 -11
  229. package/dist/examples/translation/translation-indic.js +10 -10
  230. package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
  231. package/dist/examples/translation/translation-llm-context.js +10 -10
  232. package/dist/examples/translation/translation-llm.js +13 -13
  233. package/dist/examples/translation/translation-stream.js +11 -11
  234. package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
  235. package/dist/examples/tts/chatterbox-enhanced.js +55 -0
  236. package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
  237. package/dist/examples/tts/chatterbox-multilingual.js +54 -0
  238. package/dist/examples/tts/chatterbox.js +18 -18
  239. package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
  240. package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
  241. package/dist/examples/tts/supertonic-enhanced.js +57 -0
  242. package/dist/examples/tts/supertonic-multilingual.js +19 -19
  243. package/dist/examples/tts/supertonic.js +18 -18
  244. package/dist/examples/tts/utils.js +24 -32
  245. package/dist/examples/vla-groot.d.ts +2 -0
  246. package/dist/examples/vla-groot.js +118 -0
  247. package/dist/examples/vla-pi05.js +14 -14
  248. package/dist/examples/vla-smolvla.js +14 -14
  249. package/dist/examples/voice-assistant/voice-assistant.js +46 -46
  250. package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
  251. package/dist/expo/plugins/get-project-root.d.ts +2 -2
  252. package/dist/expo/plugins/get-project-root.js +1 -1
  253. package/dist/expo/plugins/index.d.ts +11 -11
  254. package/dist/expo/plugins/index.js +10 -10
  255. package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
  256. package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  257. package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
  258. package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  259. package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
  260. package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
  261. package/dist/expo/plugins/withDeviceInfo.js +13 -13
  262. package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
  263. package/dist/expo/plugins/withMobileBundle.js +34 -42
  264. package/dist/expo/plugins/withOpenCL.d.ts +1 -1
  265. package/dist/expo/plugins/withOpenCL.js +14 -16
  266. package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
  267. package/dist/expo/plugins/withQvacSDK.js +12 -12
  268. package/dist/index.d.ts +16 -16
  269. package/dist/index.js +16 -17
  270. package/dist/logging/addon.d.ts +1 -1
  271. package/dist/logging/addon.js +13 -13
  272. package/dist/logging/base-logger.d.ts +2 -2
  273. package/dist/logging/base-logger.js +6 -6
  274. package/dist/logging/client-logger.d.ts +1 -1
  275. package/dist/logging/client-logger.js +3 -3
  276. package/dist/logging/index.d.ts +9 -9
  277. package/dist/logging/index.js +8 -8
  278. package/dist/logging/logger.d.ts +1 -1
  279. package/dist/logging/logger.js +4 -4
  280. package/dist/logging/namespaces.d.ts +1 -1
  281. package/dist/logging/namespaces.js +5 -5
  282. package/dist/logging/registry.d.ts +2 -2
  283. package/dist/logging/registry.js +3 -3
  284. package/dist/logging/server-logger.d.ts +1 -1
  285. package/dist/logging/server-logger.js +2 -2
  286. package/dist/logging/stream-logger.d.ts +1 -1
  287. package/dist/logging/stream-logger.js +4 -4
  288. package/dist/logging/transport.d.ts +1 -1
  289. package/dist/logging/types.d.ts +1 -1
  290. package/dist/logging/utils.d.ts +2 -2
  291. package/dist/logging/utils.js +40 -41
  292. package/dist/models/registry/index.d.ts +1 -1
  293. package/dist/models/registry/index.js +5 -5
  294. package/dist/models/registry/models.d.ts +5622 -9241
  295. package/dist/models/registry/models.js +13215 -17030
  296. package/dist/models/update-models/codegen.d.ts +1 -1
  297. package/dist/models/update-models/codegen.js +8 -8
  298. package/dist/models/update-models/companions.d.ts +6 -1
  299. package/dist/models/update-models/companions.js +104 -39
  300. package/dist/models/update-models/history.d.ts +1 -1
  301. package/dist/models/update-models/history.js +11 -11
  302. package/dist/models/update-models/index.js +32 -34
  303. package/dist/models/update-models/naming.d.ts +2 -2
  304. package/dist/models/update-models/naming.js +181 -186
  305. package/dist/models/update-models/processing.d.ts +2 -2
  306. package/dist/models/update-models/processing.js +17 -19
  307. package/dist/models/update-models/registry.d.ts +2 -2
  308. package/dist/models/update-models/registry.js +9 -9
  309. package/dist/models/update-models/shards.d.ts +1 -1
  310. package/dist/models/update-models/shards.js +3 -3
  311. package/dist/models/update-models/types.d.ts +1 -1
  312. package/dist/models/update-models/utils.js +5 -5
  313. package/dist/pear/pre.js +84 -84
  314. package/dist/profiling/aggregator.d.ts +1 -1
  315. package/dist/profiling/aggregator.js +6 -6
  316. package/dist/profiling/clock.d.ts +1 -1
  317. package/dist/profiling/clock.js +10 -10
  318. package/dist/profiling/controller.d.ts +2 -2
  319. package/dist/profiling/controller.js +11 -12
  320. package/dist/profiling/envelope.d.ts +1 -1
  321. package/dist/profiling/envelope.js +4 -6
  322. package/dist/profiling/events.d.ts +2 -2
  323. package/dist/profiling/events.js +8 -10
  324. package/dist/profiling/exporters.d.ts +1 -1
  325. package/dist/profiling/exporters.js +81 -79
  326. package/dist/profiling/index.d.ts +8 -8
  327. package/dist/profiling/index.js +7 -7
  328. package/dist/profiling/model-execution.js +2 -1
  329. package/dist/profiling/ring-buffer.js +2 -2
  330. package/dist/profiling/types.d.ts +3 -3
  331. package/dist/schemas/archive.d.ts +1 -1
  332. package/dist/schemas/archive.js +8 -14
  333. package/dist/schemas/batch-completion-stream.d.ts +463 -0
  334. package/dist/schemas/batch-completion-stream.js +124 -0
  335. package/dist/schemas/bci-config.d.ts +1 -1
  336. package/dist/schemas/bci-config.js +7 -7
  337. package/dist/schemas/bci.d.ts +3 -3
  338. package/dist/schemas/bci.js +25 -31
  339. package/dist/schemas/cancel.d.ts +6 -1
  340. package/dist/schemas/cancel.js +33 -34
  341. package/dist/schemas/classification.d.ts +1 -1
  342. package/dist/schemas/classification.js +7 -7
  343. package/dist/schemas/common.d.ts +578 -28
  344. package/dist/schemas/common.js +42 -37
  345. package/dist/schemas/completion-event.d.ts +11 -8
  346. package/dist/schemas/completion-event.js +27 -26
  347. package/dist/schemas/completion-stream.d.ts +190 -5
  348. package/dist/schemas/completion-stream.js +118 -67
  349. package/dist/schemas/constants-registry.d.ts +67 -0
  350. package/dist/schemas/constants-registry.js +51 -0
  351. package/dist/schemas/delegate.d.ts +1 -1
  352. package/dist/schemas/delegate.js +7 -7
  353. package/dist/schemas/delete-cache.d.ts +1 -1
  354. package/dist/schemas/delete-cache.js +15 -11
  355. package/dist/schemas/download-asset.d.ts +2 -2
  356. package/dist/schemas/download-asset.js +21 -21
  357. package/dist/schemas/embed.d.ts +3 -3
  358. package/dist/schemas/embed.js +16 -27
  359. package/dist/schemas/engine-addon-map.d.ts +3 -2
  360. package/dist/schemas/engine-addon-map.js +25 -25
  361. package/dist/schemas/error.d.ts +1 -1
  362. package/dist/schemas/error.js +12 -13
  363. package/dist/schemas/finetune.d.ts +1 -1
  364. package/dist/schemas/finetune.js +41 -44
  365. package/dist/schemas/get-loaded-model-info.d.ts +17 -1
  366. package/dist/schemas/get-loaded-model-info.js +22 -14
  367. package/dist/schemas/get-model-info.d.ts +1 -1
  368. package/dist/schemas/get-model-info.js +48 -91
  369. package/dist/schemas/heartbeat.d.ts +1 -1
  370. package/dist/schemas/heartbeat.js +6 -6
  371. package/dist/schemas/index.d.ts +52 -51
  372. package/dist/schemas/index.js +52 -51
  373. package/dist/schemas/json-schema.d.ts +1 -1
  374. package/dist/schemas/llamacpp-config.d.ts +57 -29
  375. package/dist/schemas/llamacpp-config.js +43 -35
  376. package/dist/schemas/load-model.d.ts +1537 -185
  377. package/dist/schemas/load-model.js +126 -129
  378. package/dist/schemas/logging-stream.d.ts +1 -1
  379. package/dist/schemas/logging-stream.js +6 -12
  380. package/dist/schemas/mcp-adapter.d.ts +1 -1
  381. package/dist/schemas/model-src-utils.d.ts +1 -1
  382. package/dist/schemas/model-src-utils.js +13 -13
  383. package/dist/schemas/model-types.d.ts +1 -1
  384. package/dist/schemas/model-types.js +27 -27
  385. package/dist/schemas/ocr.d.ts +1 -1
  386. package/dist/schemas/ocr.js +18 -18
  387. package/dist/schemas/path-validation.d.ts +1 -1
  388. package/dist/schemas/path-validation.js +4 -4
  389. package/dist/schemas/plugin.d.ts +13 -14
  390. package/dist/schemas/plugin.js +51 -51
  391. package/dist/schemas/profiling.d.ts +1 -1
  392. package/dist/schemas/profiling.js +16 -16
  393. package/dist/schemas/provide.d.ts +1 -1
  394. package/dist/schemas/provide.js +8 -8
  395. package/dist/schemas/rag.d.ts +3 -3
  396. package/dist/schemas/rag.js +65 -70
  397. package/dist/schemas/registry.d.ts +1 -1
  398. package/dist/schemas/registry.js +44 -66
  399. package/dist/schemas/reload-config.d.ts +1 -1
  400. package/dist/schemas/reload-config.js +16 -18
  401. package/dist/schemas/resume.d.ts +1 -1
  402. package/dist/schemas/resume.js +3 -3
  403. package/dist/schemas/runtime-context.d.ts +1 -1
  404. package/dist/schemas/runtime-context.js +4 -4
  405. package/dist/schemas/sdcpp-config.d.ts +248 -9
  406. package/dist/schemas/sdcpp-config.js +395 -291
  407. package/dist/schemas/sdk-config.d.ts +833 -71
  408. package/dist/schemas/sdk-config.js +25 -29
  409. package/dist/schemas/sdk-errors-client.d.ts +1 -1
  410. package/dist/schemas/sdk-errors-client.js +80 -80
  411. package/dist/schemas/sdk-errors-registry.js +1 -1
  412. package/dist/schemas/sdk-errors-server.d.ts +1 -1
  413. package/dist/schemas/sdk-errors-server.js +202 -199
  414. package/dist/schemas/shard.d.ts +1 -1
  415. package/dist/schemas/shard.js +4 -4
  416. package/dist/schemas/state.d.ts +1 -1
  417. package/dist/schemas/state.js +5 -10
  418. package/dist/schemas/stop-provide.d.ts +1 -1
  419. package/dist/schemas/stop-provide.js +4 -4
  420. package/dist/schemas/suspend.d.ts +1 -1
  421. package/dist/schemas/suspend.js +3 -3
  422. package/dist/schemas/text-to-speech.d.ts +469 -3
  423. package/dist/schemas/text-to-speech.js +151 -109
  424. package/dist/schemas/tools.d.ts +2 -2
  425. package/dist/schemas/tools.js +18 -24
  426. package/dist/schemas/transcription-config.d.ts +1 -1
  427. package/dist/schemas/transcription-config.js +18 -18
  428. package/dist/schemas/transcription.d.ts +5 -5
  429. package/dist/schemas/transcription.js +31 -33
  430. package/dist/schemas/translate.d.ts +3 -3
  431. package/dist/schemas/translate.js +49 -72
  432. package/dist/schemas/translation-config.d.ts +1 -1
  433. package/dist/schemas/translation-config.js +116 -123
  434. package/dist/schemas/unload-model.d.ts +1 -1
  435. package/dist/schemas/unload-model.js +6 -6
  436. package/dist/schemas/vla.d.ts +11 -1
  437. package/dist/schemas/vla.js +52 -32
  438. package/dist/scripts/contract/build-contract.d.ts +38 -0
  439. package/dist/scripts/contract/build-contract.js +620 -0
  440. package/dist/scripts/contract/build-error-codes.d.ts +17 -0
  441. package/dist/scripts/contract/build-error-codes.js +17 -0
  442. package/dist/scripts/contract/build-model-type-maps.d.ts +22 -0
  443. package/dist/scripts/contract/build-model-type-maps.js +16 -0
  444. package/dist/scripts/contract/build-models-registry.d.ts +17 -0
  445. package/dist/scripts/contract/build-models-registry.js +31 -0
  446. package/dist/scripts/contract/plugin-contract.d.ts +23 -0
  447. package/dist/scripts/contract/plugin-contract.js +28 -0
  448. package/dist/scripts/export-contract.d.ts +2 -0
  449. package/dist/scripts/export-contract.js +27 -0
  450. package/dist/scripts/export-plugin-contract.d.ts +2 -0
  451. package/dist/scripts/export-plugin-contract.js +18 -0
  452. package/dist/scripts/run-security-tests.js +9 -10
  453. package/dist/scripts/run-unit-tests.js +11 -12
  454. package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
  455. package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
  456. package/dist/server/bare/delegate-rpc-client.js +32 -34
  457. package/dist/server/bare/hyperswarm.d.ts +3 -3
  458. package/dist/server/bare/hyperswarm.js +14 -14
  459. package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
  460. package/dist/server/bare/ops/bci-transcribe.js +44 -44
  461. package/dist/server/bare/ops/cancel.d.ts +2 -2
  462. package/dist/server/bare/ops/cancel.js +6 -6
  463. package/dist/server/bare/ops/embed.d.ts +1 -1
  464. package/dist/server/bare/ops/embed.js +26 -16
  465. package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
  466. package/dist/server/bare/ops/kv-cache-utils.js +17 -19
  467. package/dist/server/bare/ops/load-model.d.ts +2 -2
  468. package/dist/server/bare/ops/load-model.js +14 -18
  469. package/dist/server/bare/ops/transcribe.d.ts +3 -3
  470. package/dist/server/bare/ops/transcribe.js +62 -62
  471. package/dist/server/bare/ops/translate.d.ts +1 -1
  472. package/dist/server/bare/ops/translate.js +53 -31
  473. package/dist/server/bare/ops/unload-model.d.ts +1 -1
  474. package/dist/server/bare/ops/unload-model.js +12 -12
  475. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
  476. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
  477. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +4 -3
  478. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
  479. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
  480. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
  481. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
  482. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
  483. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
  484. package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
  485. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
  486. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
  487. package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
  488. package/dist/server/bare/plugins/ggml-ocr/plugin.js +33 -54
  489. package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +6 -0
  490. package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +73 -0
  491. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
  492. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
  493. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
  494. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
  495. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +6 -1
  496. package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
  497. package/dist/server/bare/plugins/index.d.ts +11 -11
  498. package/dist/server/bare/plugins/index.js +11 -11
  499. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
  500. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
  501. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
  502. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
  503. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
  504. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
  505. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
  506. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
  507. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
  508. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +65 -80
  509. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
  510. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
  511. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
  512. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
  513. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
  514. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +8 -0
  515. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +12 -6
  516. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +193 -19
  517. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
  518. package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
  519. package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
  520. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +9 -4
  521. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
  522. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
  523. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
  524. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
  525. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
  526. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
  527. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
  528. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
  529. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
  530. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
  531. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
  532. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -1
  533. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +71 -44
  534. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +132 -4
  535. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +148 -70
  536. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
  537. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
  538. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
  539. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +18 -34
  540. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +9 -2
  541. package/dist/server/bare/plugins/tts-ggml/plugin.js +97 -49
  542. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
  543. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
  544. package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
  545. package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
  546. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
  547. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
  548. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
  549. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
  550. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
  551. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
  552. package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
  553. package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
  554. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
  555. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
  556. package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
  557. package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
  558. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
  559. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
  560. package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
  561. package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
  562. package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
  563. package/dist/server/bare/rag-hyperdb/index.js +11 -11
  564. package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
  565. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
  566. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
  567. package/dist/server/bare/registry/config-registry.d.ts +1 -1
  568. package/dist/server/bare/registry/config-registry.js +13 -16
  569. package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
  570. package/dist/server/bare/registry/logging-stream-registry.js +2 -2
  571. package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
  572. package/dist/server/bare/registry/model-config-registry.js +6 -6
  573. package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
  574. package/dist/server/bare/registry/model-config-utils.js +35 -35
  575. package/dist/server/bare/registry/model-registry.d.ts +3 -3
  576. package/dist/server/bare/registry/model-registry.js +11 -11
  577. package/dist/server/bare/registry/registry-client.d.ts +1 -1
  578. package/dist/server/bare/registry/registry-client.js +18 -18
  579. package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
  580. package/dist/server/bare/registry/runtime-context-registry.js +3 -3
  581. package/dist/server/bare/runtime/disposable-scope.js +3 -3
  582. package/dist/server/bare/runtime/index.d.ts +7 -7
  583. package/dist/server/bare/runtime/index.js +3 -3
  584. package/dist/server/bare/runtime/request-context.d.ts +4 -4
  585. package/dist/server/bare/runtime/request-id.js +1 -1
  586. package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
  587. package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
  588. package/dist/server/bare/runtime/request-registry.d.ts +27 -12
  589. package/dist/server/bare/runtime/request-registry.js +39 -34
  590. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  591. package/dist/server/bare/runtime/with-request-context.js +11 -11
  592. package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
  593. package/dist/server/bare/runtime-lifecycle.js +27 -31
  594. package/dist/server/bare/types/addon-responses.d.ts +7 -4
  595. package/dist/server/bare/utils/audio-input.d.ts +2 -2
  596. package/dist/server/bare/utils/audio-input.js +7 -7
  597. package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
  598. package/dist/server/bare/utils/transcribe-metadata.js +4 -4
  599. package/dist/server/bare/utils/tts-stats.d.ts +9 -5
  600. package/dist/server/bare/utils/tts-stats.js +8 -2
  601. package/dist/server/env.js +8 -8
  602. package/dist/server/error-handlers.d.ts +3 -3
  603. package/dist/server/error-handlers.js +11 -11
  604. package/dist/server/plugins/index.d.ts +1 -1
  605. package/dist/server/plugins/index.js +1 -1
  606. package/dist/server/plugins/registry.d.ts +1 -1
  607. package/dist/server/plugins/registry.js +12 -14
  608. package/dist/server/rpc/create-server.d.ts +1 -1
  609. package/dist/server/rpc/create-server.js +34 -13
  610. package/dist/server/rpc/delegate-transport.d.ts +3 -3
  611. package/dist/server/rpc/delegate-transport.js +43 -44
  612. package/dist/server/rpc/handle-request.d.ts +1 -1
  613. package/dist/server/rpc/handle-request.js +28 -30
  614. package/dist/server/rpc/handler-registry.d.ts +1 -1
  615. package/dist/server/rpc/handler-registry.js +102 -92
  616. package/dist/server/rpc/handler-selection.d.ts +3 -3
  617. package/dist/server/rpc/handler-selection.js +3 -3
  618. package/dist/server/rpc/handler-utils.d.ts +7 -7
  619. package/dist/server/rpc/handler-utils.js +32 -35
  620. package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
  621. package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
  622. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
  623. package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
  624. package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
  625. package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
  626. package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
  627. package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
  628. package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
  629. package/dist/server/rpc/handlers/cancelHandler.js +11 -11
  630. package/dist/server/rpc/handlers/classify.d.ts +1 -1
  631. package/dist/server/rpc/handlers/classify.js +2 -2
  632. package/dist/server/rpc/handlers/completion-orchestrate.d.ts +42 -0
  633. package/dist/server/rpc/handlers/completion-orchestrate.js +190 -0
  634. package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
  635. package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
  636. package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
  637. package/dist/server/rpc/handlers/completion-stream.js +2 -2
  638. package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
  639. package/dist/server/rpc/handlers/delete-cache.js +10 -10
  640. package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
  641. package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
  642. package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
  643. package/dist/server/rpc/handlers/download-asset.js +20 -20
  644. package/dist/server/rpc/handlers/embed.d.ts +1 -1
  645. package/dist/server/rpc/handlers/embed.js +2 -2
  646. package/dist/server/rpc/handlers/finetune.d.ts +1 -1
  647. package/dist/server/rpc/handlers/finetune.js +8 -6
  648. package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
  649. package/dist/server/rpc/handlers/get-loaded-model-info.js +15 -9
  650. package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
  651. package/dist/server/rpc/handlers/get-model-info.js +20 -20
  652. package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
  653. package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
  654. package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
  655. package/dist/server/rpc/handlers/heartbeat.js +1 -1
  656. package/dist/server/rpc/handlers/index.d.ts +35 -31
  657. package/dist/server/rpc/handlers/index.js +36 -32
  658. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
  659. package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
  660. package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
  661. package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
  662. package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
  663. package/dist/server/rpc/handlers/load-model/handler.js +42 -43
  664. package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
  665. package/dist/server/rpc/handlers/load-model/http.js +100 -107
  666. package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
  667. package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
  668. package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
  669. package/dist/server/rpc/handlers/load-model/index.js +2 -2
  670. package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
  671. package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
  672. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
  673. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
  674. package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
  675. package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
  676. package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
  677. package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
  678. package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
  679. package/dist/server/rpc/handlers/load-model/registry.js +50 -56
  680. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
  681. package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
  682. package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
  683. package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
  684. package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
  685. package/dist/server/rpc/handlers/load-model/types.js +7 -7
  686. package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
  687. package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
  688. package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
  689. package/dist/server/rpc/handlers/logging-stream.js +3 -3
  690. package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
  691. package/dist/server/rpc/handlers/ocr-stream.js +2 -2
  692. package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
  693. package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
  694. package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
  695. package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
  696. package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
  697. package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
  698. package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
  699. package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
  700. package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
  701. package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
  702. package/dist/server/rpc/handlers/provideHandler.js +1 -1
  703. package/dist/server/rpc/handlers/rag.d.ts +1 -1
  704. package/dist/server/rpc/handlers/rag.js +50 -50
  705. package/dist/server/rpc/handlers/registry.d.ts +1 -1
  706. package/dist/server/rpc/handlers/registry.js +34 -36
  707. package/dist/server/rpc/handlers/resume.d.ts +1 -1
  708. package/dist/server/rpc/handlers/resume.js +3 -3
  709. package/dist/server/rpc/handlers/state.d.ts +1 -1
  710. package/dist/server/rpc/handlers/state.js +3 -3
  711. package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
  712. package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
  713. package/dist/server/rpc/handlers/suspend.d.ts +1 -1
  714. package/dist/server/rpc/handlers/suspend.js +3 -3
  715. package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
  716. package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
  717. package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
  718. package/dist/server/rpc/handlers/text-to-speech.js +2 -2
  719. package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
  720. package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
  721. package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
  722. package/dist/server/rpc/handlers/transcribe.js +2 -2
  723. package/dist/server/rpc/handlers/translate.d.ts +1 -1
  724. package/dist/server/rpc/handlers/translate.js +2 -2
  725. package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
  726. package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
  727. package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
  728. package/dist/server/rpc/handlers/unload-model.js +10 -10
  729. package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
  730. package/dist/server/rpc/handlers/upscale-stream.js +2 -2
  731. package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
  732. package/dist/server/rpc/handlers/video-stream.js +2 -2
  733. package/dist/server/rpc/index.d.ts +2 -2
  734. package/dist/server/rpc/index.js +2 -2
  735. package/dist/server/rpc/method-shapes.d.ts +51 -0
  736. package/dist/server/rpc/method-shapes.js +48 -0
  737. package/dist/server/rpc/profiling/context.d.ts +1 -1
  738. package/dist/server/rpc/profiling/context.js +9 -10
  739. package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
  740. package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
  741. package/dist/server/rpc/profiling/index.d.ts +4 -4
  742. package/dist/server/rpc/profiling/index.js +4 -4
  743. package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
  744. package/dist/server/rpc/profiling/operation-metrics.js +122 -102
  745. package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
  746. package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
  747. package/dist/server/rpc/profiling/profiler.d.ts +2 -2
  748. package/dist/server/rpc/profiling/profiler.js +9 -13
  749. package/dist/server/rpc/rpc-utils.js +1 -4
  750. package/dist/server/rpc/transport-selector.d.ts +1 -1
  751. package/dist/server/rpc/transport-selector.js +4 -4
  752. package/dist/server/utils/archive.js +27 -29
  753. package/dist/server/utils/audio/decoder.d.ts +2 -2
  754. package/dist/server/utils/audio/decoder.js +11 -11
  755. package/dist/server/utils/cache/auto-history.d.ts +1 -1
  756. package/dist/server/utils/cache/auto-history.js +15 -11
  757. package/dist/server/utils/cache/paths.d.ts +2 -2
  758. package/dist/server/utils/cache/paths.js +14 -14
  759. package/dist/server/utils/checksum.d.ts +1 -1
  760. package/dist/server/utils/checksum.js +10 -12
  761. package/dist/server/utils/clear-storage.d.ts +1 -1
  762. package/dist/server/utils/clear-storage.js +8 -11
  763. package/dist/server/utils/completion-normalizer.d.ts +1 -1
  764. package/dist/server/utils/completion-normalizer.js +106 -113
  765. package/dist/server/utils/config-transform.d.ts +1 -1
  766. package/dist/server/utils/config-transform.js +2 -2
  767. package/dist/server/utils/expand-gguf-shards.js +4 -4
  768. package/dist/server/utils/formatting.js +6 -12
  769. package/dist/server/utils/gguf-tensor-extractor.js +17 -21
  770. package/dist/server/utils/index.d.ts +11 -11
  771. package/dist/server/utils/index.js +11 -11
  772. package/dist/server/utils/multi-gpu-mobile.js +1 -1
  773. package/dist/server/utils/path-security.d.ts +1 -1
  774. package/dist/server/utils/path-security.js +6 -6
  775. package/dist/server/utils/qvac-paths.js +3 -3
  776. package/dist/server/utils/response-format.d.ts +1 -1
  777. package/dist/server/utils/response-format.js +4 -4
  778. package/dist/server/utils/shard-utils.d.ts +1 -1
  779. package/dist/server/utils/shard-utils.js +14 -16
  780. package/dist/server/utils/tool-integration.d.ts +1 -1
  781. package/dist/server/utils/tool-integration.js +5 -9
  782. package/dist/server/utils/tools/dialect.d.ts +1 -1
  783. package/dist/server/utils/tools/dialect.js +7 -7
  784. package/dist/server/utils/tools/index.d.ts +2 -2
  785. package/dist/server/utils/tools/index.js +2 -2
  786. package/dist/server/utils/tools/parser.d.ts +1 -1
  787. package/dist/server/utils/tools/parser.js +14 -14
  788. package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
  789. package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
  790. package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
  791. package/dist/server/utils/tools/parsers/harmony.js +9 -11
  792. package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
  793. package/dist/server/utils/tools/parsers/hermes.js +16 -16
  794. package/dist/server/utils/tools/parsers/json.d.ts +2 -2
  795. package/dist/server/utils/tools/parsers/json.js +14 -14
  796. package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
  797. package/dist/server/utils/tools/parsers/pythonic.js +43 -43
  798. package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
  799. package/dist/server/utils/tools/parsers/qwen35.js +20 -20
  800. package/dist/server/utils/tools/shared.d.ts +1 -1
  801. package/dist/server/utils/tools/shared.js +10 -12
  802. package/dist/server/utils/worker-lock.js +10 -10
  803. package/dist/server/worker-core.d.ts +1 -1
  804. package/dist/server/worker-core.js +44 -43
  805. package/dist/server/worker.js +9 -9
  806. package/dist/utils/aggregate-events.d.ts +2 -2
  807. package/dist/utils/aggregate-events.js +17 -19
  808. package/dist/utils/cache-normalize.js +1 -4
  809. package/dist/utils/encoding.js +1 -1
  810. package/dist/utils/errors-base.d.ts +1 -1
  811. package/dist/utils/errors-base.js +1 -1
  812. package/dist/utils/errors-client.d.ts +1 -1
  813. package/dist/utils/errors-client.js +5 -5
  814. package/dist/utils/errors-server.d.ts +3 -3
  815. package/dist/utils/errors-server.js +19 -18
  816. package/dist/utils/load-model-validation.js +3 -3
  817. package/dist/utils/mcp-adapter.d.ts +4 -4
  818. package/dist/utils/mcp-adapter.js +31 -38
  819. package/dist/utils/path-sanitize.js +14 -17
  820. package/dist/utils/tool-helpers.d.ts +2 -2
  821. package/dist/utils/tool-helpers.js +25 -26
  822. package/dist/utils/withTimeout.d.ts +7 -0
  823. package/dist/utils/withTimeout.js +11 -1
  824. package/dist/utils/zod-error.d.ts +1 -1
  825. package/dist/utils/zod-error.js +1 -1
  826. package/electron-forge/index.cjs +274 -317
  827. package/expo/plugins/patches/android-link.mjs +25 -30
  828. package/expo/plugins/patches/ios-link.mjs +25 -30
  829. package/package.json +21 -17
@@ -1,8 +1,8 @@
1
- import { loadModel, unloadModel, GTE_LARGE_FP16, ragIngest, ragSearch, ragCloseWorkspace, } from "@qvac/sdk";
1
+ import { loadModel, unloadModel, GTE_LARGE_FP16, ragIngest, ragSearch, ragCloseWorkspace } from '@qvac/sdk';
2
2
  try {
3
3
  // Get query from command line or use default
4
- const query = process.argv[2] || "machine learning algorithms";
5
- const workspace = "ingest-example";
4
+ const query = process.argv[2] || 'machine learning algorithms';
5
+ const workspace = 'ingest-example';
6
6
  console.log(`▸ Query: "${query}"`);
7
7
  const modelId = await loadModel({
8
8
  modelSrc: GTE_LARGE_FP16,
@@ -11,35 +11,35 @@ try {
11
11
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
12
12
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
13
13
  if (p.percentage >= 100)
14
- process.stderr.write("\n");
15
- },
14
+ process.stderr.write('\n');
15
+ }
16
16
  });
17
17
  const samples = [
18
- "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.",
19
- "Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.",
20
- "Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.",
21
- "Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.",
22
- "Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.",
23
- "Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.",
24
- "Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.",
25
- "Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.",
18
+ 'Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.',
19
+ 'Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.',
20
+ 'Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.',
21
+ 'Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.',
22
+ 'Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.',
23
+ 'Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.',
24
+ 'Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.',
25
+ 'Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.'
26
26
  ];
27
- console.log("▸ Ingesting documents...");
27
+ console.log('▸ Ingesting documents...');
28
28
  const result = await ragIngest({
29
29
  modelId,
30
30
  workspace,
31
31
  documents: samples,
32
- chunk: false,
32
+ chunk: false
33
33
  });
34
34
  console.log(`▸ Ingested ${result.processed.length} documents`);
35
- console.log("▸ Searching for similar documents...");
35
+ console.log('▸ Searching for similar documents...');
36
36
  const results = await ragSearch({
37
37
  modelId,
38
38
  workspace,
39
39
  query,
40
- topK: 3,
40
+ topK: 3
41
41
  });
42
- console.log("▸ Top 3 most similar documents:");
42
+ console.log('▸ Top 3 most similar documents:');
43
43
  results.forEach((result, index) => {
44
44
  console.log(`${index + 1}. (Score: ${result.score})`);
45
45
  console.log(` ${result.content}`);
@@ -51,6 +51,6 @@ try {
51
51
  await unloadModel({ modelId });
52
52
  }
53
53
  catch (error) {
54
- console.error("✖", error);
54
+ console.error('✖', error);
55
55
  process.exit(1);
56
56
  }
@@ -1,10 +1,10 @@
1
- import { loadModel, unloadModel, embed, GTE_LARGE_FP16, ragChunk, ragSaveEmbeddings, ragSearch, ragCloseWorkspace, } from "@qvac/sdk";
1
+ import { loadModel, unloadModel, embed, GTE_LARGE_FP16, ragChunk, ragSaveEmbeddings, ragSearch, ragCloseWorkspace } from '@qvac/sdk';
2
2
  try {
3
3
  // Get query from command line or use default
4
- const query = process.argv[2] || "machine learning algorithms";
5
- console.log("▸ RAG Pipeline Example (Segregated Flow)");
4
+ const query = process.argv[2] || 'machine learning algorithms';
5
+ console.log('▸ RAG Pipeline Example (Segregated Flow)');
6
6
  console.log(`▸ Query: "${query}"`);
7
- const workspace = "pipeline-example";
7
+ const workspace = 'pipeline-example';
8
8
  const modelId = await loadModel({
9
9
  modelSrc: GTE_LARGE_FP16,
10
10
  onProgress: (p) => {
@@ -12,53 +12,53 @@ try {
12
12
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
13
13
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
14
14
  if (p.percentage >= 100)
15
- process.stderr.write("\n");
16
- },
15
+ process.stderr.write('\n');
16
+ }
17
17
  });
18
18
  const samples = [
19
- "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.",
20
- "Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.",
21
- "Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.",
22
- "Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.",
23
- "Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.",
24
- "Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.",
25
- "Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.",
26
- "Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.",
19
+ 'Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.',
20
+ 'Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.',
21
+ 'Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.',
22
+ 'Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.',
23
+ 'Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.',
24
+ 'Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.',
25
+ 'Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.',
26
+ 'Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.'
27
27
  ];
28
- console.log("▸ Step 1: Chunking documents...");
28
+ console.log('▸ Step 1: Chunking documents...');
29
29
  const chunks = await ragChunk({
30
30
  documents: samples,
31
31
  chunkOpts: {
32
32
  chunkSize: 128,
33
- chunkOverlap: 20,
34
- },
33
+ chunkOverlap: 20
34
+ }
35
35
  });
36
36
  console.log(`▸ Created ${chunks.length} chunks`);
37
- console.log("▸ Step 2: Generating embeddings (batch)...");
37
+ console.log('▸ Step 2: Generating embeddings (batch)...');
38
38
  const texts = chunks.map((chunk) => chunk.content);
39
39
  const { embedding: embeddings } = await embed({ modelId, text: texts });
40
40
  const embeddedDocs = chunks.map((chunk, i) => ({
41
41
  id: chunk.id,
42
42
  content: chunk.content,
43
43
  embedding: embeddings[i],
44
- embeddingModelId: modelId,
44
+ embeddingModelId: modelId
45
45
  }));
46
46
  console.log(`▸ Generated ${embeddedDocs.length} embeddings`);
47
- console.log("▸ Step 3: Saving to vector database...");
47
+ console.log('▸ Step 3: Saving to vector database...');
48
48
  const saveResult = await ragSaveEmbeddings({
49
49
  workspace,
50
- documents: embeddedDocs,
50
+ documents: embeddedDocs
51
51
  });
52
- const saved = saveResult.filter((r) => r.status === "fulfilled").length;
52
+ const saved = saveResult.filter((r) => r.status === 'fulfilled').length;
53
53
  console.log(`▸ Saved ${saved}/${saveResult.length} documents`);
54
- console.log("▸ Step 4: Searching...");
54
+ console.log('▸ Step 4: Searching...');
55
55
  const results = await ragSearch({
56
56
  workspace,
57
57
  modelId,
58
58
  query,
59
- topK: 3,
59
+ topK: 3
60
60
  });
61
- console.log("▸ Top 3 most similar documents:");
61
+ console.log('▸ Top 3 most similar documents:');
62
62
  results.forEach((result, index) => {
63
63
  console.log(`${index + 1}. (Score: ${result.score})`);
64
64
  console.log(` ${result.content}`);
@@ -70,6 +70,6 @@ try {
70
70
  await unloadModel({ modelId });
71
71
  }
72
72
  catch (error) {
73
- console.error("✖", error);
73
+ console.error('✖', error);
74
74
  process.exit(1);
75
75
  }
@@ -1,6 +1,6 @@
1
- import { loadModel, unloadModel, GTE_LARGE_FP16, ragIngest, ragSearch, ragDeleteEmbeddings, ragListWorkspaces, ragCloseWorkspace, ragReindex, } from "@qvac/sdk";
1
+ import { loadModel, unloadModel, GTE_LARGE_FP16, ragIngest, ragSearch, ragDeleteEmbeddings, ragListWorkspaces, ragCloseWorkspace, ragReindex } from '@qvac/sdk';
2
2
  try {
3
- console.log("▸ RAG Workspaces with Chunking Example");
3
+ console.log('▸ RAG Workspaces with Chunking Example');
4
4
  // Load model
5
5
  const modelId = await loadModel({
6
6
  modelSrc: GTE_LARGE_FP16,
@@ -9,8 +9,8 @@ try {
9
9
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
10
10
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
11
11
  if (p.percentage >= 100)
12
- process.stderr.write("\n");
13
- },
12
+ process.stderr.write('\n');
13
+ }
14
14
  });
15
15
  // Medical articles (will be chunked)
16
16
  const medicalArticles = [
@@ -65,45 +65,45 @@ try {
65
65
  stress management techniques are crucial components of recovery.
66
66
 
67
67
  Early intervention improves outcomes significantly. Reducing stigma around mental health
68
- encourages people to seek help when needed.`,
68
+ encourages people to seek help when needed.`
69
69
  ];
70
70
  // Tech documents (shorter, won't be chunked)
71
71
  const techDocs = [
72
- "Artificial intelligence is transforming industries through automation and advanced data analysis capabilities.",
73
- "Deep learning neural networks enable breakthroughs in computer vision and natural language processing.",
72
+ 'Artificial intelligence is transforming industries through automation and advanced data analysis capabilities.',
73
+ 'Deep learning neural networks enable breakthroughs in computer vision and natural language processing.'
74
74
  ];
75
75
  // Ingest medical articles with chunking
76
- console.log("▸ Ingesting medical articles with chunking...");
76
+ console.log('▸ Ingesting medical articles with chunking...');
77
77
  const medicalResult = await ragIngest({
78
78
  modelId,
79
- workspace: "medical",
79
+ workspace: 'medical',
80
80
  documents: medicalArticles,
81
81
  chunk: true,
82
82
  chunkOpts: {
83
83
  chunkSize: 50,
84
84
  chunkOverlap: 10,
85
- chunkStrategy: "paragraph",
86
- splitStrategy: "token",
87
- },
85
+ chunkStrategy: 'paragraph',
86
+ splitStrategy: 'token'
87
+ }
88
88
  });
89
89
  console.log(`▸ Created ${medicalResult.processed.length} chunks from medical articles`);
90
90
  // Ingest tech docs without chunking
91
- console.log("\n▸ Ingesting tech documents...");
91
+ console.log('\n▸ Ingesting tech documents...');
92
92
  const techResult = await ragIngest({
93
93
  modelId,
94
- workspace: "technology",
94
+ workspace: 'technology',
95
95
  documents: techDocs,
96
- chunk: false,
96
+ chunk: false
97
97
  });
98
98
  console.log(`▸ Ingested ${techResult.processed.length} tech documents`);
99
99
  // Test searches
100
100
  const searches = [
101
- { workspace: "medical", query: "COVID symptoms fever", label: "Medical" },
102
- { workspace: "medical", query: "vaccine technology", label: "Medical" },
103
- { workspace: "technology", query: "neural networks", label: "Tech" },
104
- { workspace: "technology", query: "COVID", label: "Tech (isolation test)" },
101
+ { workspace: 'medical', query: 'COVID symptoms fever', label: 'Medical' },
102
+ { workspace: 'medical', query: 'vaccine technology', label: 'Medical' },
103
+ { workspace: 'technology', query: 'neural networks', label: 'Tech' },
104
+ { workspace: 'technology', query: 'COVID', label: 'Tech (isolation test)' }
105
105
  ];
106
- console.log("\n▸ Running searches:");
106
+ console.log('\n▸ Running searches:');
107
107
  for (const { workspace, query, label } of searches) {
108
108
  const results = await ragSearch({ modelId, workspace, query, topK: 1 });
109
109
  console.log(`\n${label}: "${query}"`);
@@ -119,63 +119,63 @@ try {
119
119
  console.log("\n▸ Testing 'general' workspace...");
120
120
  await ragIngest({
121
121
  modelId,
122
- workspace: "general",
123
- documents: ["General workspace content for testing"],
124
- chunk: false,
122
+ workspace: 'general',
123
+ documents: ['General workspace content for testing'],
124
+ chunk: false
125
125
  });
126
126
  const generalSearch = await ragSearch({
127
127
  modelId,
128
- workspace: "general",
129
- query: "general workspace",
128
+ workspace: 'general',
129
+ query: 'general workspace'
130
130
  });
131
- console.log(`▸ General workspace: ${generalSearch?.[0]?.content === "General workspace content for testing" ? "Working" : "Failed"}`);
131
+ console.log(`▸ General workspace: ${generalSearch?.[0]?.content === 'General workspace content for testing' ? 'Working' : 'Failed'}`);
132
132
  // Reindexing - regenerate embeddings for an existing workspace
133
- console.log("\n▸ Reindexing medical workspace...");
133
+ console.log('\n▸ Reindexing medical workspace...');
134
134
  const reindexResult = await ragReindex({
135
- workspace: "medical",
135
+ workspace: 'medical',
136
136
  modelId,
137
137
  onProgress: (stage, current, total) => {
138
138
  console.log(`▸ ${stage} ${current}/${total}`);
139
- },
139
+ }
140
140
  });
141
- console.log(`▸ ${reindexResult.reindexed ? "Reindex completed" : "Reindex returned false"} for medical workspace`);
141
+ console.log(`▸ ${reindexResult.reindexed ? 'Reindex completed' : 'Reindex returned false'} for medical workspace`);
142
142
  if (reindexResult.details) {
143
- console.log("▸ Details:", reindexResult.details);
143
+ console.log('▸ Details:', reindexResult.details);
144
144
  }
145
145
  // Verify reindexed data still works
146
146
  const reindexVerify = await ragSearch({
147
147
  modelId,
148
- workspace: "medical",
149
- query: "COVID symptoms",
150
- topK: 1,
148
+ workspace: 'medical',
149
+ query: 'COVID symptoms',
150
+ topK: 1
151
151
  });
152
- console.log(`▸ Verification search: ${reindexVerify.length > 0 ? "Working" : "Failed"}`);
152
+ console.log(`▸ Verification search: ${reindexVerify.length > 0 ? 'Working' : 'Failed'}`);
153
153
  // Cleanup example
154
- const firstChunk = medicalResult.processed.find((p) => p.status === "fulfilled" && p.id);
154
+ const firstChunk = medicalResult.processed.find((p) => p.status === 'fulfilled' && p.id);
155
155
  if (firstChunk?.id) {
156
156
  await ragDeleteEmbeddings({
157
- workspace: "medical",
158
- ids: [firstChunk.id],
157
+ workspace: 'medical',
158
+ ids: [firstChunk.id]
159
159
  });
160
- console.log("\n▸ Deleted one medical chunk");
160
+ console.log('\n▸ Deleted one medical chunk');
161
161
  }
162
162
  // List all workspaces
163
- console.log("\n▸ Listing workspaces...");
163
+ console.log('\n▸ Listing workspaces...');
164
164
  const workspaces = await ragListWorkspaces();
165
165
  workspaces.forEach((ws) => {
166
- console.log(`▸ ${ws.name} (${ws.open ? "open" : "closed"})`);
166
+ console.log(`▸ ${ws.name} (${ws.open ? 'open' : 'closed'})`);
167
167
  });
168
168
  // Close and delete all workspaces created in this example
169
- console.log("\n▸ Closing and deleting workspaces...");
170
- await ragCloseWorkspace({ workspace: "medical", deleteOnClose: true });
169
+ console.log('\n▸ Closing and deleting workspaces...');
170
+ await ragCloseWorkspace({ workspace: 'medical', deleteOnClose: true });
171
171
  console.log("▸ Deleted 'medical' workspace");
172
- await ragCloseWorkspace({ workspace: "technology", deleteOnClose: true });
172
+ await ragCloseWorkspace({ workspace: 'technology', deleteOnClose: true });
173
173
  console.log("▸ Deleted 'technology' workspace");
174
- await ragCloseWorkspace({ workspace: "general", deleteOnClose: true });
174
+ await ragCloseWorkspace({ workspace: 'general', deleteOnClose: true });
175
175
  console.log("▸ Deleted 'general' workspace");
176
176
  await unloadModel({ modelId });
177
177
  }
178
178
  catch (error) {
179
- console.error("✖", error);
179
+ console.error('✖', error);
180
180
  process.exit(1);
181
181
  }
@@ -1,11 +1,11 @@
1
- import { embed, loadModel, unloadModel, GTE_LARGE_FP16 } from "@qvac/sdk";
2
- import * as lancedb from "@lancedb/lancedb";
3
- import * as a from "apache-arrow";
1
+ import { embed, loadModel, unloadModel, GTE_LARGE_FP16 } from '@qvac/sdk';
2
+ import * as lancedb from '@lancedb/lancedb';
3
+ import * as a from 'apache-arrow';
4
4
  try {
5
5
  // Get query from command line or use default
6
- const query = process.argv[2] || "machine learning algorithms";
6
+ const query = process.argv[2] || 'machine learning algorithms';
7
7
  console.log(`▸ Query: "${query}"`);
8
- const db = await lancedb.connect(".rag-lancedb");
8
+ const db = await lancedb.connect('.rag-lancedb');
9
9
  const modelId = await loadModel({
10
10
  modelSrc: GTE_LARGE_FP16,
11
11
  onProgress: (p) => {
@@ -13,85 +13,82 @@ try {
13
13
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
14
14
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
15
15
  if (p.percentage >= 100)
16
- process.stderr.write("\n");
17
- },
16
+ process.stderr.write('\n');
17
+ }
18
18
  });
19
19
  const samples = [
20
20
  {
21
21
  id: 1,
22
- text: "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.",
22
+ text: 'Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.'
23
23
  },
24
24
  {
25
25
  id: 2,
26
- text: "Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.",
26
+ text: 'Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.'
27
27
  },
28
28
  {
29
29
  id: 3,
30
- text: "Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.",
30
+ text: 'Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.'
31
31
  },
32
32
  {
33
33
  id: 4,
34
- text: "Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.",
34
+ text: 'Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.'
35
35
  },
36
36
  {
37
37
  id: 5,
38
- text: "Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.",
38
+ text: 'Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.'
39
39
  },
40
40
  {
41
41
  id: 6,
42
- text: "Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.",
42
+ text: 'Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.'
43
43
  },
44
44
  {
45
45
  id: 7,
46
- text: "Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.",
46
+ text: 'Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.'
47
47
  },
48
48
  {
49
49
  id: 8,
50
- text: "Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.",
51
- },
50
+ text: 'Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.'
51
+ }
52
52
  ];
53
53
  const schema = new a.Schema([
54
- new a.Field("id", new a.Int32()),
55
- new a.Field("text", new a.Utf8()),
56
- new a.Field("vector", new a.FixedSizeList(1024, new a.Field("item", new a.Float32()))),
54
+ new a.Field('id', new a.Int32()),
55
+ new a.Field('text', new a.Utf8()),
56
+ new a.Field('vector', new a.FixedSizeList(1024, new a.Field('item', new a.Float32())))
57
57
  ]);
58
58
  // Create or recreate the table
59
59
  try {
60
- await db.dropTable("documents");
60
+ await db.dropTable('documents');
61
61
  }
62
62
  catch (e) {
63
63
  console.warn(`▸ Table doesn't exist, no need to drop: ${String(e)}`);
64
64
  }
65
- const documentsTable = await db.createEmptyTable("documents", schema);
66
- console.log("▸ Embedding documents...");
65
+ const documentsTable = await db.createEmptyTable('documents', schema);
66
+ console.log('▸ Embedding documents...');
67
67
  const documents = [];
68
68
  for (const sample of samples) {
69
69
  const { embedding } = await embed({ modelId, text: sample.text });
70
70
  const record = {
71
71
  id: sample.id,
72
72
  text: sample.text,
73
- vector: embedding,
73
+ vector: embedding
74
74
  };
75
75
  documents.push(record);
76
76
  }
77
77
  await documentsTable.add(documents);
78
- console.log("▸ Searching for similar documents...");
78
+ console.log('▸ Searching for similar documents...');
79
79
  const { embedding: queryEmbedding } = await embed({ modelId, text: query });
80
- const results = (await documentsTable
81
- .vectorSearch(queryEmbedding)
82
- .limit(1)
83
- .toArray());
84
- console.log("\n▸ Top 3 most similar documents:");
80
+ const results = (await documentsTable.vectorSearch(queryEmbedding).limit(1).toArray());
81
+ console.log('\n▸ Top 3 most similar documents:');
85
82
  results.forEach((result, index) => {
86
- console.log("=".repeat(50) + " Top result:");
83
+ console.log('='.repeat(50) + ' Top result:');
87
84
  console.log(`\n${index + 1}. (Score: ${result._distance?.toFixed(4)})`);
88
85
  console.log(` ${result.text}`);
89
- console.log("=".repeat(100));
86
+ console.log('='.repeat(100));
90
87
  console.log();
91
88
  });
92
89
  await unloadModel({ modelId });
93
90
  }
94
91
  catch (error) {
95
- console.error("✖", error);
92
+ console.error('✖', error);
96
93
  process.exit(1);
97
94
  }
@@ -1,12 +1,12 @@
1
- import { embed, loadModel, unloadModel, GTE_LARGE_FP16 } from "@qvac/sdk";
2
- import sqlite3InitModule from "@sqliteai/sqlite-wasm";
1
+ import { embed, loadModel, unloadModel, GTE_LARGE_FP16 } from '@qvac/sdk';
2
+ import sqlite3InitModule from '@sqliteai/sqlite-wasm';
3
3
  try {
4
4
  // Get query from command line or use default
5
- const query = process.argv[2] || "machine learning algorithms";
5
+ const query = process.argv[2] || 'machine learning algorithms';
6
6
  console.log(`▸ Query: "${query}"`);
7
7
  // Initialize SQLite with vector extension
8
8
  const sqlite3 = await sqlite3InitModule();
9
- const db = new sqlite3.oo1.DB(":memory:", "c");
9
+ const db = new sqlite3.oo1.DB(':memory:', 'c');
10
10
  const modelId = await loadModel({
11
11
  modelSrc: GTE_LARGE_FP16,
12
12
  onProgress: (p) => {
@@ -14,42 +14,42 @@ try {
14
14
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
15
15
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
16
16
  if (p.percentage >= 100)
17
- process.stderr.write("\n");
18
- },
17
+ process.stderr.write('\n');
18
+ }
19
19
  });
20
20
  const samples = [
21
21
  {
22
22
  id: 1,
23
- text: "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.",
23
+ text: 'Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn and make predictions from data without being explicitly programmed for every task.'
24
24
  },
25
25
  {
26
26
  id: 2,
27
- text: "Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.",
27
+ text: 'Deep learning uses neural networks with multiple layers to process and learn from complex data patterns, enabling breakthroughs in image recognition and natural language processing.'
28
28
  },
29
29
  {
30
30
  id: 3,
31
- text: "Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.",
31
+ text: 'Natural language processing combines computational linguistics with machine learning to help computers understand, interpret, and generate human language in a meaningful way.'
32
32
  },
33
33
  {
34
34
  id: 4,
35
- text: "Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.",
35
+ text: 'Computer vision enables machines to interpret and understand visual information from the world, using techniques like image classification, object detection, and facial recognition.'
36
36
  },
37
37
  {
38
38
  id: 5,
39
- text: "Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.",
39
+ text: 'Quantum computing leverages quantum mechanical phenomena to process information in fundamentally different ways than classical computers, potentially solving certain problems exponentially faster.'
40
40
  },
41
41
  {
42
42
  id: 6,
43
- text: "Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.",
43
+ text: 'Blockchain technology creates decentralized, immutable ledgers that enable secure peer-to-peer transactions without requiring a central authority or intermediary.'
44
44
  },
45
45
  {
46
46
  id: 7,
47
- text: "Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.",
47
+ text: 'Cloud computing delivers computing services over the internet, allowing users to access resources like storage, processing power, and applications on-demand from anywhere.'
48
48
  },
49
49
  {
50
50
  id: 8,
51
- text: "Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.",
52
- },
51
+ text: 'Cybersecurity protects digital systems, networks, and data from malicious attacks, unauthorized access, and various forms of cyber threats through multiple layers of defense.'
52
+ }
53
53
  ];
54
54
  // Create table for documents with vector storage
55
55
  db.exec(`
@@ -59,12 +59,12 @@ try {
59
59
  embedding BLOB NOT NULL
60
60
  )
61
61
  `);
62
- console.log("▸ Embedding documents...");
62
+ console.log('▸ Embedding documents...');
63
63
  for (const sample of samples) {
64
64
  const { embedding } = await embed({ modelId, text: sample.text });
65
65
  db.exec({
66
- sql: "INSERT INTO documents VALUES (?, ?, vector_as_f32(?))",
67
- bind: [sample.id, sample.text, JSON.stringify(embedding)],
66
+ sql: 'INSERT INTO documents VALUES (?, ?, vector_as_f32(?))',
67
+ bind: [sample.id, sample.text, JSON.stringify(embedding)]
68
68
  });
69
69
  }
70
70
  // Initialize and optimize vector index
@@ -74,7 +74,7 @@ try {
74
74
  // [Optional] Preload quantized vectors in memory for optimal performance
75
75
  db.exec(`SELECT vector_quantize_preload('documents', 'embedding')`);
76
76
  // Search for similar documents
77
- console.log("▸ Searching for similar documents...");
77
+ console.log('▸ Searching for similar documents...');
78
78
  const { embedding: queryEmbedding } = await embed({ modelId, text: query });
79
79
  const results = [];
80
80
  // Perform vector search
@@ -86,24 +86,24 @@ try {
86
86
  ON d.id = v.rowid
87
87
  `,
88
88
  bind: [JSON.stringify(queryEmbedding)],
89
- rowMode: "object",
89
+ rowMode: 'object',
90
90
  callback: (row) => {
91
91
  const typedRow = row;
92
92
  results.push(typedRow);
93
- },
93
+ }
94
94
  });
95
- console.log("\n▸ Top 3 most similar documents:");
95
+ console.log('\n▸ Top 3 most similar documents:');
96
96
  results.forEach((result, index) => {
97
- console.log("=".repeat(50) + " Top result:");
97
+ console.log('='.repeat(50) + ' Top result:');
98
98
  console.log(`\n${index + 1}. [ID: ${result.id}] (Score: ${result.distance.toFixed(4)})`);
99
99
  console.log(` ${result.text}`);
100
- console.log("=".repeat(100));
100
+ console.log('='.repeat(100));
101
101
  console.log();
102
102
  });
103
103
  await unloadModel({ modelId });
104
104
  db.close();
105
105
  }
106
106
  catch (error) {
107
- console.error("✖", error);
107
+ console.error('✖', error);
108
108
  process.exit(1);
109
109
  }