@qvac/harness 0.1.0 → 0.1.1

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 (460) hide show
  1. package/dist/harness.bundle +8 -59
  2. package/dist/prebuilds-manifest.json +0 -8
  3. package/dist-lib/index.d.ts +240 -0
  4. package/dist-lib/index.js +1063 -0
  5. package/dist-lib/lib/audio-transcode-bare.d.ts +2 -0
  6. package/dist-lib/lib/audio-transcode-bare.js +145 -0
  7. package/dist-lib/lib/audio-transcode-node.d.ts +2 -0
  8. package/dist-lib/lib/audio-transcode-node.js +6 -0
  9. package/dist-lib/lib/capabilities/audio-resample.d.ts +14 -0
  10. package/dist-lib/lib/capabilities/audio-resample.js +72 -0
  11. package/dist-lib/lib/capabilities/completion.d.ts +288 -0
  12. package/dist-lib/lib/capabilities/completion.js +1077 -0
  13. package/dist-lib/lib/capabilities/download.d.ts +46 -0
  14. package/dist-lib/lib/capabilities/download.js +124 -0
  15. package/dist-lib/lib/capabilities/embed.d.ts +20 -0
  16. package/dist-lib/lib/capabilities/embed.js +13 -0
  17. package/dist-lib/lib/capabilities/kv-cache.d.ts +13 -0
  18. package/dist-lib/lib/capabilities/kv-cache.js +21 -0
  19. package/dist-lib/lib/capabilities/prompt-prefix.d.ts +6 -0
  20. package/dist-lib/lib/capabilities/prompt-prefix.js +10 -0
  21. package/dist-lib/lib/capabilities/speech-lexicon.d.ts +5 -0
  22. package/dist-lib/lib/capabilities/speech-lexicon.js +32 -0
  23. package/dist-lib/lib/capabilities/speech-text.d.ts +6 -0
  24. package/dist-lib/lib/capabilities/speech-text.js +79 -0
  25. package/dist-lib/lib/capabilities/tool-names.d.ts +3 -0
  26. package/dist-lib/lib/capabilities/tool-names.js +3 -0
  27. package/dist-lib/lib/capabilities/tool-selection.d.ts +43 -0
  28. package/dist-lib/lib/capabilities/tool-selection.js +60 -0
  29. package/dist-lib/lib/capabilities/tool-turns.d.ts +9 -0
  30. package/dist-lib/lib/capabilities/tool-turns.js +101 -0
  31. package/dist-lib/lib/capabilities/usage-breakdown.d.ts +27 -0
  32. package/dist-lib/lib/capabilities/usage-breakdown.js +44 -0
  33. package/dist-lib/lib/capabilities/vision-history.d.ts +3 -0
  34. package/dist-lib/lib/capabilities/vision-history.js +21 -0
  35. package/dist-lib/lib/capabilities/voice.d.ts +78 -0
  36. package/dist-lib/lib/capabilities/voice.js +189 -0
  37. package/dist-lib/lib/connect.d.ts +76 -0
  38. package/dist-lib/lib/connect.js +789 -0
  39. package/dist-lib/lib/context-window.d.ts +7 -0
  40. package/dist-lib/lib/context-window.js +90 -0
  41. package/dist-lib/lib/contract-types.d.ts +210 -0
  42. package/dist-lib/lib/contract-types.js +1 -0
  43. package/dist-lib/lib/diagram-repair.d.ts +21 -0
  44. package/dist-lib/lib/diagram-repair.js +58 -0
  45. package/dist-lib/lib/dns-lookup.d.ts +1 -0
  46. package/dist-lib/lib/dns-lookup.js +13 -0
  47. package/dist-lib/lib/error-fields.d.ts +2 -0
  48. package/dist-lib/lib/error-fields.js +8 -0
  49. package/dist-lib/lib/fetch-node.d.ts +1 -0
  50. package/dist-lib/lib/fetch-node.js +1 -0
  51. package/dist-lib/lib/hardware/capability-probe.d.ts +9 -0
  52. package/dist-lib/lib/hardware/capability-probe.js +99 -0
  53. package/dist-lib/lib/hardware/gpu-classify.d.ts +2 -0
  54. package/dist-lib/lib/hardware/gpu-classify.js +32 -0
  55. package/dist-lib/lib/hardware/gpu-probe-addon.d.ts +2 -0
  56. package/dist-lib/lib/hardware/gpu-probe-addon.js +42 -0
  57. package/dist-lib/lib/hardware/gpu-stats.bare.d.ts +1 -0
  58. package/dist-lib/lib/hardware/gpu-stats.bare.js +24 -0
  59. package/dist-lib/lib/hardware/gpu-stats.stub.d.ts +1 -0
  60. package/dist-lib/lib/hardware/gpu-stats.stub.js +3 -0
  61. package/dist-lib/lib/hardware/memory-budget.d.ts +8 -0
  62. package/dist-lib/lib/hardware/memory-budget.js +1 -0
  63. package/dist-lib/lib/hardware/parsers.d.ts +7 -0
  64. package/dist-lib/lib/hardware/parsers.js +41 -0
  65. package/dist-lib/lib/headers-bare.d.ts +1 -0
  66. package/dist-lib/lib/headers-bare.js +1 -0
  67. package/dist-lib/lib/headers-node.d.ts +4 -0
  68. package/dist-lib/lib/headers-node.js +1 -0
  69. package/dist-lib/lib/helpers/buffer-burst.d.ts +1 -0
  70. package/dist-lib/lib/helpers/buffer-burst.js +20 -0
  71. package/dist-lib/lib/helpers/control-tokens.d.ts +7 -0
  72. package/dist-lib/lib/helpers/control-tokens.js +32 -0
  73. package/dist-lib/lib/helpers/join-guard.d.ts +6 -0
  74. package/dist-lib/lib/helpers/join-guard.js +46 -0
  75. package/dist-lib/lib/helpers/markup-stream-filter.d.ts +5 -0
  76. package/dist-lib/lib/helpers/markup-stream-filter.js +75 -0
  77. package/dist-lib/lib/helpers/race-abort.d.ts +5 -0
  78. package/dist-lib/lib/helpers/race-abort.js +18 -0
  79. package/dist-lib/lib/helpers/retry-memo.d.ts +5 -0
  80. package/dist-lib/lib/helpers/retry-memo.js +12 -0
  81. package/dist-lib/lib/helpers/run-outcome.d.ts +33 -0
  82. package/dist-lib/lib/helpers/run-outcome.js +204 -0
  83. package/dist-lib/lib/helpers/spawn-path.d.ts +5 -0
  84. package/dist-lib/lib/helpers/spawn-path.js +57 -0
  85. package/dist-lib/lib/helpers/text-coalescer.d.ts +15 -0
  86. package/dist-lib/lib/helpers/text-coalescer.js +34 -0
  87. package/dist-lib/lib/helpers/thinking.d.ts +8 -0
  88. package/dist-lib/lib/helpers/thinking.js +95 -0
  89. package/dist-lib/lib/helpers/tool-call-markup.d.ts +20 -0
  90. package/dist-lib/lib/helpers/tool-call-markup.js +201 -0
  91. package/dist-lib/lib/helpers/tool-intent.d.ts +7 -0
  92. package/dist-lib/lib/helpers/tool-intent.js +21 -0
  93. package/dist-lib/lib/helpers/tool-label.d.ts +8 -0
  94. package/dist-lib/lib/helpers/tool-label.js +131 -0
  95. package/dist-lib/lib/hooks/built-in/arg-repair.d.ts +5 -0
  96. package/dist-lib/lib/hooks/built-in/arg-repair.js +88 -0
  97. package/dist-lib/lib/hooks/built-in/egress.d.ts +5 -0
  98. package/dist-lib/lib/hooks/built-in/egress.js +29 -0
  99. package/dist-lib/lib/hooks/built-in/index.d.ts +3 -0
  100. package/dist-lib/lib/hooks/built-in/index.js +3 -0
  101. package/dist-lib/lib/hooks/built-in/skill-catalog.d.ts +10 -0
  102. package/dist-lib/lib/hooks/built-in/skill-catalog.js +17 -0
  103. package/dist-lib/lib/hooks/pipeline.d.ts +20 -0
  104. package/dist-lib/lib/hooks/pipeline.js +49 -0
  105. package/dist-lib/lib/hooks/registry.d.ts +2 -0
  106. package/dist-lib/lib/hooks/registry.js +6 -0
  107. package/dist-lib/lib/hooks/run.d.ts +5 -0
  108. package/dist-lib/lib/hooks/run.js +83 -0
  109. package/dist-lib/lib/hooks/types.d.ts +57 -0
  110. package/dist-lib/lib/hooks/types.js +1 -0
  111. package/dist-lib/lib/log.d.ts +5 -0
  112. package/dist-lib/lib/log.js +37 -0
  113. package/dist-lib/lib/model-download-progress.d.ts +22 -0
  114. package/dist-lib/lib/model-download-progress.js +95 -0
  115. package/dist-lib/lib/models/context.d.ts +5 -0
  116. package/dist-lib/lib/models/context.js +12 -0
  117. package/dist-lib/lib/models/embed-config.d.ts +14 -0
  118. package/dist-lib/lib/models/embed-config.js +31 -0
  119. package/dist-lib/lib/models/gpu-selection.d.ts +3 -0
  120. package/dist-lib/lib/models/gpu-selection.js +26 -0
  121. package/dist-lib/lib/models/kv-cache.d.ts +4 -0
  122. package/dist-lib/lib/models/kv-cache.js +6 -0
  123. package/dist-lib/lib/models/llm-presets.d.ts +10 -0
  124. package/dist-lib/lib/models/llm-presets.js +58 -0
  125. package/dist-lib/lib/models/model-catalog-constants.d.ts +29 -0
  126. package/dist-lib/lib/models/model-catalog-constants.js +103 -0
  127. package/dist-lib/lib/models/model-catalog.d.ts +125 -0
  128. package/dist-lib/lib/models/model-catalog.js +371 -0
  129. package/dist-lib/lib/models/model-delete.d.ts +18 -0
  130. package/dist-lib/lib/models/model-delete.js +47 -0
  131. package/dist-lib/lib/models/model-handle.d.ts +18 -0
  132. package/dist-lib/lib/models/model-handle.js +33 -0
  133. package/dist-lib/lib/models/model-list.d.ts +42 -0
  134. package/dist-lib/lib/models/model-list.js +123 -0
  135. package/dist-lib/lib/models/model-pool.d.ts +116 -0
  136. package/dist-lib/lib/models/model-pool.js +356 -0
  137. package/dist-lib/lib/models/model-source.d.ts +6 -0
  138. package/dist-lib/lib/models/model-source.js +21 -0
  139. package/dist-lib/lib/models/music-catalog.d.ts +12 -0
  140. package/dist-lib/lib/models/music-catalog.js +26 -0
  141. package/dist-lib/lib/models/opencl-cache.d.ts +5 -0
  142. package/dist-lib/lib/models/opencl-cache.js +50 -0
  143. package/dist-lib/lib/models/sdk-faults.d.ts +21 -0
  144. package/dist-lib/lib/models/sdk-faults.js +66 -0
  145. package/dist-lib/lib/models/tool-dialect.d.ts +2 -0
  146. package/dist-lib/lib/models/tool-dialect.js +19 -0
  147. package/dist-lib/lib/models/tts-model-default.d.ts +3 -0
  148. package/dist-lib/lib/models/tts-model-default.js +13 -0
  149. package/dist-lib/lib/no-redirect-fetch-bare.d.ts +15 -0
  150. package/dist-lib/lib/no-redirect-fetch-bare.js +59 -0
  151. package/dist-lib/lib/no-redirect-fetch-impl.d.ts +39 -0
  152. package/dist-lib/lib/no-redirect-fetch-impl.js +80 -0
  153. package/dist-lib/lib/no-redirect-fetch-node.d.ts +4 -0
  154. package/dist-lib/lib/no-redirect-fetch-node.js +52 -0
  155. package/dist-lib/lib/prompt.d.ts +22 -0
  156. package/dist-lib/lib/prompt.js +77 -0
  157. package/dist-lib/lib/queue.d.ts +9 -0
  158. package/dist-lib/lib/queue.js +48 -0
  159. package/dist-lib/lib/resolution-detector.d.ts +5 -0
  160. package/dist-lib/lib/resolution-detector.js +100 -0
  161. package/dist-lib/lib/rpc-session.d.ts +8 -0
  162. package/dist-lib/lib/rpc-session.js +20 -0
  163. package/dist-lib/lib/sdk-config-loader.node.d.ts +1 -0
  164. package/dist-lib/lib/sdk-config-loader.node.js +1 -0
  165. package/dist-lib/lib/sdk-loader.d.ts +30 -0
  166. package/dist-lib/lib/sdk-loader.js +53 -0
  167. package/dist-lib/lib/sdk-storage.d.ts +8 -0
  168. package/dist-lib/lib/sdk-storage.js +24 -0
  169. package/dist-lib/lib/serve.d.ts +3 -0
  170. package/dist-lib/lib/serve.js +612 -0
  171. package/dist-lib/lib/spawn.d.ts +62 -0
  172. package/dist-lib/lib/spawn.js +71 -0
  173. package/dist-lib/lib/staging.d.ts +4 -0
  174. package/dist-lib/lib/staging.js +28 -0
  175. package/dist-lib/lib/storage.d.ts +18 -0
  176. package/dist-lib/lib/storage.js +26 -0
  177. package/dist-lib/lib/tmp-path.d.ts +7 -0
  178. package/dist-lib/lib/tmp-path.js +17 -0
  179. package/dist-lib/lib/tool-call-display.d.ts +21 -0
  180. package/dist-lib/lib/tool-call-display.js +1 -0
  181. package/dist-lib/lib/tools/catalog.d.ts +13 -0
  182. package/dist-lib/lib/tools/catalog.js +13 -0
  183. package/dist-lib/lib/tools/create-documents.d.ts +3 -0
  184. package/dist-lib/lib/tools/create-documents.js +87 -0
  185. package/dist-lib/lib/tools/edit-documents.d.ts +3 -0
  186. package/dist-lib/lib/tools/edit-documents.js +122 -0
  187. package/dist-lib/lib/tools/edit-image.d.ts +25 -0
  188. package/dist-lib/lib/tools/edit-image.js +271 -0
  189. package/dist-lib/lib/tools/exec/adapters/adapter.d.ts +27 -0
  190. package/dist-lib/lib/tools/exec/adapters/adapter.js +1 -0
  191. package/dist-lib/lib/tools/exec/adapters/python/attachments.d.ts +26 -0
  192. package/dist-lib/lib/tools/exec/adapters/python/attachments.js +160 -0
  193. package/dist-lib/lib/tools/exec/adapters/python/create-effect.d.ts +7 -0
  194. package/dist-lib/lib/tools/exec/adapters/python/create-effect.js +290 -0
  195. package/dist-lib/lib/tools/exec/adapters/python/loader.d.ts +11 -0
  196. package/dist-lib/lib/tools/exec/adapters/python/loader.js +94 -0
  197. package/dist-lib/lib/tools/exec/adapters/python/memfs.d.ts +47 -0
  198. package/dist-lib/lib/tools/exec/adapters/python/memfs.js +85 -0
  199. package/dist-lib/lib/tools/exec/adapters/python/output-policy.d.ts +13 -0
  200. package/dist-lib/lib/tools/exec/adapters/python/output-policy.js +129 -0
  201. package/dist-lib/lib/tools/exec/adapters/python/pyodide.d.ts +19 -0
  202. package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +107 -0
  203. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.d.ts +75 -0
  204. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +1094 -0
  205. package/dist-lib/lib/tools/exec/adapters/python/run-session.d.ts +75 -0
  206. package/dist-lib/lib/tools/exec/adapters/python/run-session.js +273 -0
  207. package/dist-lib/lib/tools/exec/adapters/python/wheels.d.ts +38 -0
  208. package/dist-lib/lib/tools/exec/adapters/python/wheels.js +102 -0
  209. package/dist-lib/lib/tools/exec/adapters/python/worker/client.d.ts +7 -0
  210. package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +188 -0
  211. package/dist-lib/lib/tools/exec/adapters/python/worker/entry.d.ts +1 -0
  212. package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +105 -0
  213. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.d.ts +38 -0
  214. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.js +41 -0
  215. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.d.ts +2 -0
  216. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.js +30 -0
  217. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.d.ts +13 -0
  218. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.js +45 -0
  219. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.d.ts +12 -0
  220. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +20 -0
  221. package/dist-lib/lib/tools/exec/obsidian/cli-process.d.ts +8 -0
  222. package/dist-lib/lib/tools/exec/obsidian/cli-process.js +74 -0
  223. package/dist-lib/lib/tools/exec/obsidian/cli.d.ts +18 -0
  224. package/dist-lib/lib/tools/exec/obsidian/cli.js +153 -0
  225. package/dist-lib/lib/tools/exec/obsidian/command.d.ts +5 -0
  226. package/dist-lib/lib/tools/exec/obsidian/command.js +18 -0
  227. package/dist-lib/lib/tools/exec/obsidian/guidance.d.ts +5 -0
  228. package/dist-lib/lib/tools/exec/obsidian/guidance.js +18 -0
  229. package/dist-lib/lib/tools/exec/obsidian/note-name.d.ts +1 -0
  230. package/dist-lib/lib/tools/exec/obsidian/note-name.js +6 -0
  231. package/dist-lib/lib/tools/exec/obsidian/output.d.ts +1 -0
  232. package/dist-lib/lib/tools/exec/obsidian/output.js +31 -0
  233. package/dist-lib/lib/tools/exec/obsidian/route.d.ts +19 -0
  234. package/dist-lib/lib/tools/exec/obsidian/route.js +85 -0
  235. package/dist-lib/lib/tools/exec/obsidian/safe-path.d.ts +3 -0
  236. package/dist-lib/lib/tools/exec/obsidian/safe-path.js +56 -0
  237. package/dist-lib/lib/tools/exec/obsidian/vault-create.d.ts +1 -0
  238. package/dist-lib/lib/tools/exec/obsidian/vault-create.js +40 -0
  239. package/dist-lib/lib/tools/exec/obsidian/vault-fs.d.ts +3 -0
  240. package/dist-lib/lib/tools/exec/obsidian/vault-fs.js +57 -0
  241. package/dist-lib/lib/tools/exec/obsidian/vault-paths.d.ts +20 -0
  242. package/dist-lib/lib/tools/exec/obsidian/vault-paths.js +171 -0
  243. package/dist-lib/lib/tools/exec/obsidian/vault-read.d.ts +11 -0
  244. package/dist-lib/lib/tools/exec/obsidian/vault-read.js +119 -0
  245. package/dist-lib/lib/tools/exec/obsidian/vault-write.d.ts +7 -0
  246. package/dist-lib/lib/tools/exec/obsidian/vault-write.js +134 -0
  247. package/dist-lib/lib/tools/exec/runner.d.ts +62 -0
  248. package/dist-lib/lib/tools/exec/runner.js +87 -0
  249. package/dist-lib/lib/tools/exec/scope.d.ts +3 -0
  250. package/dist-lib/lib/tools/exec/scope.js +97 -0
  251. package/dist-lib/lib/tools/exec/shell-argv.d.ts +2 -0
  252. package/dist-lib/lib/tools/exec/shell-argv.js +48 -0
  253. package/dist-lib/lib/tools/exec.d.ts +29 -0
  254. package/dist-lib/lib/tools/exec.js +459 -0
  255. package/dist-lib/lib/tools/file-glob.d.ts +15 -0
  256. package/dist-lib/lib/tools/file-glob.js +112 -0
  257. package/dist-lib/lib/tools/fs/drive.d.ts +26 -0
  258. package/dist-lib/lib/tools/fs/drive.js +1 -0
  259. package/dist-lib/lib/tools/fs/glob.d.ts +1 -0
  260. package/dist-lib/lib/tools/fs/glob.js +34 -0
  261. package/dist-lib/lib/tools/fs/local.d.ts +2 -0
  262. package/dist-lib/lib/tools/fs/local.js +29 -0
  263. package/dist-lib/lib/tools/fs/read.d.ts +2 -0
  264. package/dist-lib/lib/tools/fs/read.js +17 -0
  265. package/dist-lib/lib/tools/fs/remote-protocol.d.ts +40 -0
  266. package/dist-lib/lib/tools/fs/remote-protocol.js +1 -0
  267. package/dist-lib/lib/tools/fs/remote.d.ts +17 -0
  268. package/dist-lib/lib/tools/fs/remote.js +131 -0
  269. package/dist-lib/lib/tools/fs/scope.d.ts +37 -0
  270. package/dist-lib/lib/tools/fs/scope.js +130 -0
  271. package/dist-lib/lib/tools/fs/walk.d.ts +15 -0
  272. package/dist-lib/lib/tools/fs/walk.js +38 -0
  273. package/dist-lib/lib/tools/fs/write.d.ts +4 -0
  274. package/dist-lib/lib/tools/fs/write.js +5 -0
  275. package/dist-lib/lib/tools/generate-image.d.ts +111 -0
  276. package/dist-lib/lib/tools/generate-image.js +369 -0
  277. package/dist-lib/lib/tools/generate-music.d.ts +124 -0
  278. package/dist-lib/lib/tools/generate-music.js +522 -0
  279. package/dist-lib/lib/tools/grep.d.ts +5 -0
  280. package/dist-lib/lib/tools/grep.js +158 -0
  281. package/dist-lib/lib/tools/http-methods.d.ts +1 -0
  282. package/dist-lib/lib/tools/http-methods.js +1 -0
  283. package/dist-lib/lib/tools/http-request/encode-fields.d.ts +2 -0
  284. package/dist-lib/lib/tools/http-request/encode-fields.js +69 -0
  285. package/dist-lib/lib/tools/http-request/truncate-response.d.ts +1 -0
  286. package/dist-lib/lib/tools/http-request/truncate-response.js +83 -0
  287. package/dist-lib/lib/tools/http-request/utils.d.ts +27 -0
  288. package/dist-lib/lib/tools/http-request/utils.js +84 -0
  289. package/dist-lib/lib/tools/http-request.d.ts +20 -0
  290. package/dist-lib/lib/tools/http-request.js +177 -0
  291. package/dist-lib/lib/tools/mcp/utils.d.ts +47 -0
  292. package/dist-lib/lib/tools/mcp/utils.js +172 -0
  293. package/dist-lib/lib/tools/mcp-call.d.ts +14 -0
  294. package/dist-lib/lib/tools/mcp-call.js +155 -0
  295. package/dist-lib/lib/tools/model-args.d.ts +1 -0
  296. package/dist-lib/lib/tools/model-args.js +4 -0
  297. package/dist-lib/lib/tools/operations/builders.d.ts +17 -0
  298. package/dist-lib/lib/tools/operations/builders.js +179 -0
  299. package/dist-lib/lib/tools/operations/compile.d.ts +7 -0
  300. package/dist-lib/lib/tools/operations/compile.js +92 -0
  301. package/dist-lib/lib/tools/operations/gmail-message.d.ts +15 -0
  302. package/dist-lib/lib/tools/operations/gmail-message.js +62 -0
  303. package/dist-lib/lib/tools/operations/manifest.d.ts +60 -0
  304. package/dist-lib/lib/tools/operations/manifest.js +50 -0
  305. package/dist-lib/lib/tools/outbound-guard.d.ts +10 -0
  306. package/dist-lib/lib/tools/outbound-guard.js +127 -0
  307. package/dist-lib/lib/tools/private-ip.d.ts +4 -0
  308. package/dist-lib/lib/tools/private-ip.js +126 -0
  309. package/dist-lib/lib/tools/rag-search.d.ts +2 -0
  310. package/dist-lib/lib/tools/rag-search.js +98 -0
  311. package/dist-lib/lib/tools/read-files.d.ts +5 -0
  312. package/dist-lib/lib/tools/read-files.js +153 -0
  313. package/dist-lib/lib/tools/skill.d.ts +10 -0
  314. package/dist-lib/lib/tools/skill.js +123 -0
  315. package/dist-lib/lib/tools/skills/auth-resolver.d.ts +43 -0
  316. package/dist-lib/lib/tools/skills/auth-resolver.js +121 -0
  317. package/dist-lib/lib/tools/skills/bin-check.d.ts +9 -0
  318. package/dist-lib/lib/tools/skills/bin-check.js +56 -0
  319. package/dist-lib/lib/tools/skills/bundled-dir.d.ts +2 -0
  320. package/dist-lib/lib/tools/skills/bundled-dir.js +117 -0
  321. package/dist-lib/lib/tools/skills/bundled-hash.d.ts +4 -0
  322. package/dist-lib/lib/tools/skills/bundled-hash.js +12 -0
  323. package/dist-lib/lib/tools/skills/catalog.d.ts +60 -0
  324. package/dist-lib/lib/tools/skills/catalog.js +203 -0
  325. package/dist-lib/lib/tools/skills/cli-argv.d.ts +9 -0
  326. package/dist-lib/lib/tools/skills/cli-argv.js +147 -0
  327. package/dist-lib/lib/tools/skills/cli-schema-check.d.ts +3 -0
  328. package/dist-lib/lib/tools/skills/cli-schema-check.js +62 -0
  329. package/dist-lib/lib/tools/skills/cli-schema-load.d.ts +4 -0
  330. package/dist-lib/lib/tools/skills/cli-schema-load.js +90 -0
  331. package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +30 -0
  332. package/dist-lib/lib/tools/skills/cli-schema-types.js +1 -0
  333. package/dist-lib/lib/tools/skills/cli-schema.d.ts +7 -0
  334. package/dist-lib/lib/tools/skills/cli-schema.js +35 -0
  335. package/dist-lib/lib/tools/skills/credential-check.d.ts +20 -0
  336. package/dist-lib/lib/tools/skills/credential-check.js +94 -0
  337. package/dist-lib/lib/tools/skills/credential-grants.d.ts +9 -0
  338. package/dist-lib/lib/tools/skills/credential-grants.js +25 -0
  339. package/dist-lib/lib/tools/skills/credential-health.d.ts +8 -0
  340. package/dist-lib/lib/tools/skills/credential-health.js +51 -0
  341. package/dist-lib/lib/tools/skills/credential-slots.d.ts +7 -0
  342. package/dist-lib/lib/tools/skills/credential-slots.js +8 -0
  343. package/dist-lib/lib/tools/skills/frontmatter-parser.d.ts +23 -0
  344. package/dist-lib/lib/tools/skills/frontmatter-parser.js +68 -0
  345. package/dist-lib/lib/tools/skills/index.d.ts +5 -0
  346. package/dist-lib/lib/tools/skills/index.js +5 -0
  347. package/dist-lib/lib/tools/skills/manifest-parse.d.ts +12 -0
  348. package/dist-lib/lib/tools/skills/manifest-parse.js +199 -0
  349. package/dist-lib/lib/tools/skills/manifest.d.ts +47 -0
  350. package/dist-lib/lib/tools/skills/manifest.js +1 -0
  351. package/dist-lib/lib/tools/skills/mention-name.d.ts +1 -0
  352. package/dist-lib/lib/tools/skills/mention-name.js +4 -0
  353. package/dist-lib/lib/tools/skills/mention.d.ts +6 -0
  354. package/dist-lib/lib/tools/skills/mention.js +42 -0
  355. package/dist-lib/lib/tools/skills/obsidian-readiness.d.ts +16 -0
  356. package/dist-lib/lib/tools/skills/obsidian-readiness.js +95 -0
  357. package/dist-lib/lib/tools/skills/overlay-crud.d.ts +18 -0
  358. package/dist-lib/lib/tools/skills/overlay-crud.js +98 -0
  359. package/dist-lib/lib/tools/skills/overlay-dir.d.ts +2 -0
  360. package/dist-lib/lib/tools/skills/overlay-dir.js +22 -0
  361. package/dist-lib/lib/tools/skills/overlay-watch.d.ts +13 -0
  362. package/dist-lib/lib/tools/skills/overlay-watch.js +44 -0
  363. package/dist-lib/lib/tools/skills/scope-key.d.ts +7 -0
  364. package/dist-lib/lib/tools/skills/scope-key.js +7 -0
  365. package/dist-lib/lib/tools/skills/setup-routes.d.ts +4 -0
  366. package/dist-lib/lib/tools/skills/setup-routes.js +14 -0
  367. package/dist-lib/lib/tools/skills/skill-settings.d.ts +16 -0
  368. package/dist-lib/lib/tools/skills/skill-settings.js +33 -0
  369. package/dist-lib/lib/tools/skills/skill-state-constants.d.ts +12 -0
  370. package/dist-lib/lib/tools/skills/skill-state-constants.js +14 -0
  371. package/dist-lib/lib/tools/skills/skill-state.d.ts +40 -0
  372. package/dist-lib/lib/tools/skills/skill-state.js +117 -0
  373. package/dist-lib/lib/tools/skills/tool-grants.d.ts +5 -0
  374. package/dist-lib/lib/tools/skills/tool-grants.js +14 -0
  375. package/dist-lib/lib/tools/toolsets.d.ts +8 -0
  376. package/dist-lib/lib/tools/toolsets.js +20 -0
  377. package/dist-lib/lib/tools/url-guard.d.ts +8 -0
  378. package/dist-lib/lib/tools/url-guard.js +40 -0
  379. package/dist-lib/lib/tools/web-fetch.d.ts +8 -0
  380. package/dist-lib/lib/tools/web-fetch.js +302 -0
  381. package/dist-lib/lib/tools/web-search.d.ts +6 -0
  382. package/dist-lib/lib/tools/web-search.js +55 -0
  383. package/dist-lib/lib/transport.d.ts +12 -0
  384. package/dist-lib/lib/transport.js +59 -0
  385. package/dist-lib/lib/user-agent.d.ts +1 -0
  386. package/dist-lib/lib/user-agent.js +1 -0
  387. package/dist-lib/lib/validating-lookup.d.ts +17 -0
  388. package/dist-lib/lib/validating-lookup.js +25 -0
  389. package/dist-lib/lib/wav-encode.d.ts +5 -0
  390. package/dist-lib/lib/wav-encode.js +24 -0
  391. package/dist-lib/lib/web-fetch/embedded-state.d.ts +1 -0
  392. package/dist-lib/lib/web-fetch/embedded-state.js +131 -0
  393. package/dist-lib/lib/web-fetch/extract.d.ts +6 -0
  394. package/dist-lib/lib/web-fetch/extract.js +65 -0
  395. package/dist-lib/lib/web-fetch/images.d.ts +3 -0
  396. package/dist-lib/lib/web-fetch/images.js +43 -0
  397. package/dist-lib/lib/web-fetch/video.d.ts +5 -0
  398. package/dist-lib/lib/web-fetch/video.js +42 -0
  399. package/dist-lib/lib/web-search/engine-registry.d.ts +7 -0
  400. package/dist-lib/lib/web-search/engine-registry.js +17 -0
  401. package/dist-lib/lib/web-search/engines/aol.d.ts +3 -0
  402. package/dist-lib/lib/web-search/engines/aol.js +81 -0
  403. package/dist-lib/lib/web-search/engines/bing.d.ts +3 -0
  404. package/dist-lib/lib/web-search/engines/bing.js +111 -0
  405. package/dist-lib/lib/web-search/engines/brave.d.ts +3 -0
  406. package/dist-lib/lib/web-search/engines/brave.js +59 -0
  407. package/dist-lib/lib/web-search/engines/duckduckgo.d.ts +3 -0
  408. package/dist-lib/lib/web-search/engines/duckduckgo.js +112 -0
  409. package/dist-lib/lib/web-search/engines/google.d.ts +3 -0
  410. package/dist-lib/lib/web-search/engines/google.js +92 -0
  411. package/dist-lib/lib/web-search/engines/wikipedia.d.ts +3 -0
  412. package/dist-lib/lib/web-search/engines/wikipedia.js +37 -0
  413. package/dist-lib/lib/web-search/engines/yahoo.d.ts +3 -0
  414. package/dist-lib/lib/web-search/engines/yahoo.js +81 -0
  415. package/dist-lib/lib/web-search/fetch-html.d.ts +25 -0
  416. package/dist-lib/lib/web-search/fetch-html.js +97 -0
  417. package/dist-lib/lib/web-search/format-results.d.ts +3 -0
  418. package/dist-lib/lib/web-search/format-results.js +14 -0
  419. package/dist-lib/lib/web-search/html-helpers.d.ts +3 -0
  420. package/dist-lib/lib/web-search/html-helpers.js +24 -0
  421. package/dist-lib/lib/web-search/merge-results.d.ts +2 -0
  422. package/dist-lib/lib/web-search/merge-results.js +53 -0
  423. package/dist-lib/lib/web-search/orchestrator.d.ts +14 -0
  424. package/dist-lib/lib/web-search/orchestrator.js +50 -0
  425. package/dist-lib/lib/web-search/types.d.ts +34 -0
  426. package/dist-lib/lib/web-search/types.js +1 -0
  427. package/dist-lib/lib/web-search/url-helpers.d.ts +1 -0
  428. package/dist-lib/lib/web-search/url-helpers.js +11 -0
  429. package/dist-lib/lib/web-search/url-normalize.d.ts +1 -0
  430. package/dist-lib/lib/web-search/url-normalize.js +25 -0
  431. package/dist-lib/lib/web-search/user-agents.d.ts +3 -0
  432. package/dist-lib/lib/web-search/user-agents.js +3 -0
  433. package/dist-lib/lib/wire.d.ts +50 -0
  434. package/dist-lib/lib/wire.js +145 -0
  435. package/dist-lib/schema/baseline.d.ts +8 -0
  436. package/dist-lib/schema/baseline.js +35 -0
  437. package/dist-lib/schema/build.d.ts +1 -0
  438. package/dist-lib/schema/build.js +39 -0
  439. package/dist-lib/schema/generate.d.ts +20 -0
  440. package/dist-lib/schema/generate.js +149 -0
  441. package/dist-lib/schema/harness.d.ts +2 -0
  442. package/dist-lib/schema/harness.js +745 -0
  443. package/dist-lib/schema/release-tags.d.ts +5 -0
  444. package/dist-lib/schema/release-tags.js +58 -0
  445. package/dist-lib/spec/bind.d.ts +2 -0
  446. package/dist-lib/spec/bind.js +124 -0
  447. package/dist-lib/spec/calls.d.ts +3 -0
  448. package/dist-lib/spec/calls.js +41 -0
  449. package/dist-lib/spec/hrpc/hrpc.json +356 -0
  450. package/dist-lib/spec/hrpc/index.d.ts +3 -0
  451. package/dist-lib/spec/hrpc/index.js +463 -0
  452. package/dist-lib/spec/hrpc/messages.d.ts +4 -0
  453. package/dist-lib/spec/hrpc/messages.js +3102 -0
  454. package/dist-lib/spec/hyperschema/index.js +3102 -0
  455. package/dist-lib/spec/hyperschema/schema.json +2290 -0
  456. package/dist-lib/spec/hyperschema/types.d.ts +554 -0
  457. package/dist-lib/spec/index.d.ts +8 -0
  458. package/dist-lib/spec/index.js +1 -0
  459. package/package.json +239 -64
  460. package/.gitattributes +0 -1
@@ -0,0 +1,103 @@
1
+ export const CAPABILITY_PROFILE_ORDER = [
2
+ 'tiny',
3
+ 'low',
4
+ 'mid',
5
+ 'high',
6
+ 'xhigh'
7
+ ];
8
+ export const QWEN_35_2B = 'Qwen3.5-2B-Q4_K_M';
9
+ export const QWEN_35_4B = 'Qwen3.5-4B-Q4_K_M';
10
+ export const QWEN_35_9B = 'Qwen3.5-9B-Q4_K_M';
11
+ export const QWEN_36_27B = 'Qwen3.6-27B-UD-Q4_K_XL';
12
+ export const QWEN_36_35B_A3B = 'Qwen3.6-35B-A3B-UD-Q4_K_M';
13
+ export const QWEN_38_27B = 'Qwen3.8-27B-UD-Q4_K_XL';
14
+ export const MEDPSY_1_7B = 'medpsy-1.7b-q4_k_m-imat';
15
+ export const MEDPSY_4B = 'medpsy-4b-q4_k_m-imat';
16
+ export function isCapabilityProfile(value) {
17
+ return CAPABILITY_PROFILE_ORDER.includes(value);
18
+ }
19
+ export function meetsMinCapabilityProfile(active, required) {
20
+ return CAPABILITY_PROFILE_ORDER.indexOf(active) >= CAPABILITY_PROFILE_ORDER.indexOf(required);
21
+ }
22
+ const MODEL_NAME_TO_PROFILE = new Map([
23
+ [QWEN_35_2B, 'low'],
24
+ [QWEN_35_4B, 'mid'],
25
+ [QWEN_35_9B, 'high'],
26
+ [QWEN_36_27B, 'xhigh'],
27
+ [QWEN_36_35B_A3B, 'xhigh'],
28
+ [QWEN_38_27B, 'xhigh'],
29
+ [MEDPSY_1_7B, 'low'],
30
+ [MEDPSY_4B, 'mid']
31
+ ]);
32
+ export function modelNameToCapabilityProfile(modelName) {
33
+ return MODEL_NAME_TO_PROFILE.get(modelName);
34
+ }
35
+ const PROFILE_TO_MODEL_NAME = new Map([
36
+ ['tiny', QWEN_35_2B],
37
+ ['low', QWEN_35_2B],
38
+ ['mid', QWEN_35_4B],
39
+ ['high', QWEN_35_9B],
40
+ ['xhigh', QWEN_38_27B]
41
+ ]);
42
+ export function capabilityProfileToModelName(profile) {
43
+ const name = PROFILE_TO_MODEL_NAME.get(profile);
44
+ if (!name)
45
+ throw new Error(`no model for capability profile ${profile}`);
46
+ return name;
47
+ }
48
+ export const AGENT_MODEL_NAMES = [
49
+ QWEN_35_2B,
50
+ QWEN_35_4B,
51
+ QWEN_35_9B,
52
+ QWEN_36_27B,
53
+ QWEN_36_35B_A3B,
54
+ QWEN_38_27B,
55
+ MEDPSY_1_7B,
56
+ MEDPSY_4B
57
+ ];
58
+ export function modelDisplayName(modelName) {
59
+ const quant = /-(?:UD-)?I?Q\d/i.exec(modelName);
60
+ const base = quant ? modelName.slice(0, quant.index) : modelName;
61
+ return base.replace(/-/g, ' ');
62
+ }
63
+ export function capabilityProfileModelLabel(profile) {
64
+ return modelDisplayName(capabilityProfileToModelName(profile));
65
+ }
66
+ const MULTIMODAL_LLMS = new Set([
67
+ QWEN_35_2B,
68
+ QWEN_35_4B,
69
+ QWEN_35_9B,
70
+ QWEN_36_27B,
71
+ QWEN_36_35B_A3B,
72
+ QWEN_38_27B
73
+ ]);
74
+ export function isMultimodalLlm(modelName) {
75
+ return MULTIMODAL_LLMS.has(modelName);
76
+ }
77
+ export const DEFAULT_IMAGE_MODEL_CHOICE = 'sd2';
78
+ export const IMAGE_CHOICE_CATALOG = [
79
+ {
80
+ choice: 'sd2',
81
+ label: 'Stable Diffusion 2.1 (1B Q8)',
82
+ requiresGpu: false,
83
+ supportsMultiImageEdit: false,
84
+ sizeBytesApprox: 2_300_000_000,
85
+ notes: 'Fast, 512x512 sweet spot, SDEdit img2img.'
86
+ },
87
+ {
88
+ choice: 'sdxl',
89
+ label: 'SDXL Base 1.0 (3B Q4)',
90
+ requiresGpu: true,
91
+ supportsMultiImageEdit: false,
92
+ sizeBytesApprox: 3_900_000_000,
93
+ notes: 'Higher quality, 1024x1024 native.'
94
+ },
95
+ {
96
+ choice: 'flux2-klein',
97
+ label: 'FLUX.2 Klein (4B Q4 + Qwen3 + VAE)',
98
+ requiresGpu: true,
99
+ supportsMultiImageEdit: true,
100
+ sizeBytesApprox: 5_100_000_000,
101
+ notes: 'In-context img2img + multi-ref fusion. Set prediction=flux2_flow for editing.'
102
+ }
103
+ ];
@@ -0,0 +1,125 @@
1
+ import type { ModelRegistryEntry, ToolDialect } from '@qvac/sdk';
2
+ import type { ModelAddon } from './model-source.ts';
3
+ export interface SdkModelAsset extends ModelRegistryEntry {
4
+ readonly src: string;
5
+ }
6
+ import { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG, type CapabilityProfile, type ImageModelChoice, type ImageChoiceEntry } from './model-catalog-constants.ts';
7
+ export { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG };
8
+ export type { CapabilityProfile, ImageModelChoice, ImageChoiceEntry };
9
+ export interface LlmCatalogEntry {
10
+ readonly name: string;
11
+ readonly weight: SdkModelAsset;
12
+ readonly capabilityProfile: CapabilityProfile;
13
+ readonly projection?: SdkModelAsset;
14
+ readonly textOnly?: true;
15
+ }
16
+ export declare const LLM_CATALOG: ReadonlyArray<LlmCatalogEntry>;
17
+ export declare function defaultProjectionMap(): Record<string, string>;
18
+ export type ModelCategory = 'tts' | 'transcription' | 'embedding';
19
+ export interface CategoryDefault {
20
+ readonly name: string;
21
+ readonly category: ModelCategory;
22
+ readonly asset: SdkModelAsset;
23
+ }
24
+ export declare const CATEGORY_DEFAULTS: ReadonlyArray<CategoryDefault>;
25
+ export declare function defaultVoiceModel(category: ModelCategory): string;
26
+ export declare function defaultTtsFor(profile: CapabilityProfile): CategoryDefault;
27
+ export declare function infraModelsFor(profile: CapabilityProfile): Array<{
28
+ name: string;
29
+ addon: ModelAddon;
30
+ }>;
31
+ export declare function mediaModelNameFor(category: ModelCategory, profile: CapabilityProfile): string;
32
+ export interface DiffusionCatalogEntry {
33
+ readonly choice: ImageModelChoice;
34
+ readonly name: string;
35
+ readonly model: SdkModelAsset;
36
+ readonly llmModel?: SdkModelAsset;
37
+ readonly vaeModel?: SdkModelAsset;
38
+ readonly prediction?: 'flux2_flow';
39
+ readonly requiresGpu: boolean;
40
+ readonly supportsImg2Img: boolean;
41
+ }
42
+ export declare const DIFFUSION_CATALOG: ReadonlyArray<DiffusionCatalogEntry>;
43
+ export interface DiffusionDownloadMetadata {
44
+ readonly companions: ReadonlyArray<string>;
45
+ readonly assetSizes: Readonly<Record<string, number>>;
46
+ }
47
+ export declare function diffusionDownloadName(model: string): string | null;
48
+ export declare function diffusionDownloadMetadata(model: string, addon: ModelAddon | undefined): DiffusionDownloadMetadata | undefined;
49
+ import { DEFAULT_MUSIC_MODEL_CHOICE, type MusicModelChoice } from './music-catalog.ts';
50
+ export { DEFAULT_MUSIC_MODEL_CHOICE, type MusicModelChoice };
51
+ export interface AudioGenCatalogEntry {
52
+ readonly choice: MusicModelChoice;
53
+ readonly name: string;
54
+ readonly dit: SdkModelAsset;
55
+ readonly textEnc: SdkModelAsset;
56
+ readonly lm: SdkModelAsset;
57
+ readonly vae: SdkModelAsset;
58
+ readonly requiresGpu: boolean;
59
+ readonly defaultSteps: number;
60
+ }
61
+ export declare const AUDIOGEN_CATALOG: ReadonlyArray<AudioGenCatalogEntry>;
62
+ export declare function musicDefaultSteps(choice: string | undefined): number | undefined;
63
+ export declare function musicChoiceForDit(dit: string): MusicModelChoice | undefined;
64
+ export declare function musicSizeBytes(entry: AudioGenCatalogEntry): number;
65
+ export declare function musicModelSet(choice: string | undefined): {
66
+ dit: string;
67
+ textEnc: string;
68
+ lm: string;
69
+ vae: string;
70
+ } | null;
71
+ export interface AudioGenDownloadMetadata {
72
+ readonly companions: ReadonlyArray<string>;
73
+ readonly assetSizes: Readonly<Record<string, number>>;
74
+ }
75
+ export declare function audioGenDownloadMetadata(model: string, addon: ModelAddon | undefined): AudioGenDownloadMetadata | undefined;
76
+ export interface AgentSkillModelInput {
77
+ readonly enabledSkills?: ReadonlyArray<string> | null;
78
+ readonly installedSkills?: ReadonlyArray<string> | null;
79
+ readonly skillsScope?: 'all' | 'selected' | null;
80
+ readonly imageModelChoice?: ImageModelChoice | null;
81
+ readonly musicModelChoice?: MusicModelChoice | null;
82
+ }
83
+ export declare function skillModelsForAgent(agent: AgentSkillModelInput): ReadonlyArray<{
84
+ readonly name: string;
85
+ readonly addon: ModelAddon;
86
+ }>;
87
+ export declare function diffusionSizeBytes(entry: DiffusionCatalogEntry): number;
88
+ export declare function imageModelFor(choice: string | undefined): {
89
+ model: string;
90
+ llmModel?: string | undefined;
91
+ vaeModel?: string | undefined;
92
+ prediction?: 'flux2_flow' | undefined;
93
+ } | null;
94
+ export interface ImageClamps {
95
+ maxDim?: number;
96
+ maxSteps?: number;
97
+ }
98
+ export declare function imageClampsFromEnv(env: Record<string, string | undefined>): ImageClamps | undefined;
99
+ export declare function imageModelFromEnv(env: Record<string, string | undefined>, onIgnoredCompanions?: () => void, onIgnoredPrediction?: () => void): NonNullable<ReturnType<typeof imageModelFor>> | undefined;
100
+ export interface CuratedListable {
101
+ readonly name: string;
102
+ readonly asset: SdkModelAsset;
103
+ readonly companions: SdkModelAsset[];
104
+ readonly projection?: SdkModelAsset;
105
+ }
106
+ export declare function curatedListables(): CuratedListable[];
107
+ export declare function curatedModelAsset(name: string, addon: ModelRegistryEntry['addon']): SdkModelAsset | undefined;
108
+ export interface CustomModelEntry {
109
+ readonly name: string;
110
+ readonly src: string;
111
+ readonly projectionSrc?: string;
112
+ }
113
+ export declare function setCustomModels(entries: ReadonlyArray<CustomModelEntry>): void;
114
+ export declare function customModelSrc(name: string): string | undefined;
115
+ export declare function customToolDialect(name: string): ToolDialect | undefined;
116
+ export declare function customProjectionMap(): Record<string, string>;
117
+ export declare function companionRegistryPaths(): Map<string, string[]>;
118
+ export declare function audioGenModelByName(name: string): SdkModelAsset | undefined;
119
+ export interface MusicListable {
120
+ readonly name: string;
121
+ readonly asset: SdkModelAsset;
122
+ readonly companions: ReadonlyArray<SdkModelAsset>;
123
+ readonly expectedSize: number;
124
+ }
125
+ export declare function musicListables(): MusicListable[];
@@ -0,0 +1,371 @@
1
+ import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_SFT_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, AUDIOGEN_ACESTEP_V15_TURBO_Q8_0, AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0, AUDIOGEN_VAE_BF16, EMBEDDINGGEMMA_300M_Q4_0, FLUX_2_KLEIN_4B_Q4_0, FLUX_2_KLEIN_4B_VAE, HEALTHCARE_1_7B_MEDICAL_Q4_K_M, HEALTHCARE_4B_MEDICAL_Q4_K_M, MMPROJ_QWEN3_5_2B_MULTIMODAL_Q8_0, MMPROJ_QWEN3_5_4B_MULTIMODAL_Q8_0, MMPROJ_QWEN3_5_9B_MULTIMODAL_F16, MMPROJ_QWEN3_6_27B_MULTIMODAL_F16, MMPROJ_QWEN3_6_35B_A3B_MULTIMODAL_F16, MMPROJ_QWEN3_8_27B_MULTIMODAL_F16, QWEN3_5_2B_MULTIMODAL_Q4_K_M, QWEN3_5_4B_MULTIMODAL_Q4_K_M, QWEN3_5_9B_MULTIMODAL_Q4_K_M, PARAKEET_TDT_0_6B_V3_Q8_0, QWEN3_4B_Q4_K_M, QWEN3_6_27B_MULTIMODAL_Q4_K_XL, QWEN3_6_35B_A3B_MULTIMODAL_Q4_K_M, QWEN3_8_27B_MULTIMODAL_UD_Q4_K_XL, SD_V2_1_1B_Q8_0, SDXL_BASE_1_0_3B_Q4_0, TTS_MULTILINGUAL_SUPERTONIC3_Q4_0, TTS_MULTILINGUAL_SUPERTONIC3_Q8_0 } from '@qvac/sdk/models';
2
+ import { detectToolDialect } from "./tool-dialect.js";
3
+ import { defaultTtsModelName } from "./tts-model-default.js";
4
+ import { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG } from "./model-catalog-constants.js";
5
+ export { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG };
6
+ export const LLM_CATALOG = [
7
+ {
8
+ name: QWEN_35_2B,
9
+ weight: QWEN3_5_2B_MULTIMODAL_Q4_K_M,
10
+ capabilityProfile: 'low',
11
+ projection: MMPROJ_QWEN3_5_2B_MULTIMODAL_Q8_0
12
+ },
13
+ {
14
+ name: QWEN_35_4B,
15
+ weight: QWEN3_5_4B_MULTIMODAL_Q4_K_M,
16
+ capabilityProfile: 'mid',
17
+ projection: MMPROJ_QWEN3_5_4B_MULTIMODAL_Q8_0
18
+ },
19
+ {
20
+ name: QWEN_35_9B,
21
+ weight: QWEN3_5_9B_MULTIMODAL_Q4_K_M,
22
+ capabilityProfile: 'high',
23
+ projection: MMPROJ_QWEN3_5_9B_MULTIMODAL_F16
24
+ },
25
+ {
26
+ name: QWEN_36_27B,
27
+ weight: QWEN3_6_27B_MULTIMODAL_Q4_K_XL,
28
+ capabilityProfile: 'xhigh',
29
+ projection: MMPROJ_QWEN3_6_27B_MULTIMODAL_F16
30
+ },
31
+ {
32
+ name: QWEN_36_35B_A3B,
33
+ weight: QWEN3_6_35B_A3B_MULTIMODAL_Q4_K_M,
34
+ capabilityProfile: 'xhigh',
35
+ projection: MMPROJ_QWEN3_6_35B_A3B_MULTIMODAL_F16
36
+ },
37
+ {
38
+ name: MEDPSY_1_7B,
39
+ weight: HEALTHCARE_1_7B_MEDICAL_Q4_K_M,
40
+ capabilityProfile: 'low',
41
+ textOnly: true
42
+ },
43
+ {
44
+ name: MEDPSY_4B,
45
+ weight: HEALTHCARE_4B_MEDICAL_Q4_K_M,
46
+ capabilityProfile: 'mid',
47
+ textOnly: true
48
+ },
49
+ {
50
+ name: QWEN_38_27B,
51
+ weight: QWEN3_8_27B_MULTIMODAL_UD_Q4_K_XL,
52
+ capabilityProfile: 'xhigh',
53
+ projection: MMPROJ_QWEN3_8_27B_MULTIMODAL_F16
54
+ }
55
+ ];
56
+ export function defaultProjectionMap() {
57
+ const map = {};
58
+ for (const entry of LLM_CATALOG) {
59
+ if (entry.projection)
60
+ map[entry.name] = entry.projection.src;
61
+ }
62
+ return map;
63
+ }
64
+ export const CATEGORY_DEFAULTS = [
65
+ { name: 'Supertonic3-Q4_0', category: 'tts', asset: TTS_MULTILINGUAL_SUPERTONIC3_Q4_0 },
66
+ { name: 'Supertonic3-Q8_0', category: 'tts', asset: TTS_MULTILINGUAL_SUPERTONIC3_Q8_0 },
67
+ {
68
+ name: 'Parakeet-TDT-0.6B-v3-Q8_0',
69
+ category: 'transcription',
70
+ asset: PARAKEET_TDT_0_6B_V3_Q8_0
71
+ },
72
+ { name: 'EmbeddingGemma-300M-Q4_0', category: 'embedding', asset: EMBEDDINGGEMMA_300M_Q4_0 }
73
+ ];
74
+ export function defaultVoiceModel(category) {
75
+ const entry = CATEGORY_DEFAULTS.find((candidate) => candidate.category === category);
76
+ if (!entry)
77
+ throw new Error(`no default model for category ${category}`);
78
+ return entry.asset.src;
79
+ }
80
+ export function defaultTtsFor(profile) {
81
+ const name = defaultTtsModelName(profile);
82
+ return CATEGORY_DEFAULTS.find((entry) => entry.name === name);
83
+ }
84
+ export function infraModelsFor(profile) {
85
+ const tts = defaultTtsFor(profile);
86
+ const rest = CATEGORY_DEFAULTS.filter((entry) => entry.category !== 'tts');
87
+ return [tts, ...rest].map((entry) => ({ name: entry.name, addon: entry.asset.addon }));
88
+ }
89
+ export function mediaModelNameFor(category, profile) {
90
+ if (category === 'tts')
91
+ return defaultTtsFor(profile).name;
92
+ const entry = CATEGORY_DEFAULTS.find((candidate) => candidate.category === category);
93
+ if (!entry)
94
+ throw new Error(`no default model for category ${category}`);
95
+ return entry.name;
96
+ }
97
+ const IMAGE_GENERATION_SKILL = 'image-generation';
98
+ export const DIFFUSION_CATALOG = [
99
+ {
100
+ choice: 'sd2',
101
+ name: 'StableDiffusion-2.1-Q8_0',
102
+ model: SD_V2_1_1B_Q8_0,
103
+ requiresGpu: false,
104
+ supportsImg2Img: true
105
+ },
106
+ {
107
+ choice: 'sdxl',
108
+ name: 'SDXL-Base-1.0-Q4_0',
109
+ model: SDXL_BASE_1_0_3B_Q4_0,
110
+ requiresGpu: true,
111
+ supportsImg2Img: true
112
+ },
113
+ {
114
+ choice: 'flux2-klein',
115
+ name: 'FLUX.2-Klein-4B-Q4_0',
116
+ model: FLUX_2_KLEIN_4B_Q4_0,
117
+ llmModel: QWEN3_4B_Q4_K_M,
118
+ vaeModel: FLUX_2_KLEIN_4B_VAE,
119
+ prediction: 'flux2_flow',
120
+ requiresGpu: true,
121
+ supportsImg2Img: true
122
+ }
123
+ ];
124
+ function diffusionAssets(entry) {
125
+ const assets = [entry.model];
126
+ if (entry.llmModel)
127
+ assets.push(entry.llmModel);
128
+ if (entry.vaeModel)
129
+ assets.push(entry.vaeModel);
130
+ return assets;
131
+ }
132
+ function diffusionCatalogEntry(model) {
133
+ return DIFFUSION_CATALOG.find((candidate) => candidate.choice === model ||
134
+ candidate.name === model ||
135
+ candidate.model.name === model ||
136
+ candidate.model.src === model);
137
+ }
138
+ export function diffusionDownloadName(model) {
139
+ return diffusionCatalogEntry(model)?.name ?? null;
140
+ }
141
+ export function diffusionDownloadMetadata(model, addon) {
142
+ if (addon !== 'diffusion')
143
+ return undefined;
144
+ const entry = diffusionCatalogEntry(model);
145
+ if (!entry)
146
+ return undefined;
147
+ const assets = diffusionAssets(entry);
148
+ const assetSizes = {};
149
+ for (const asset of assets)
150
+ assetSizes[asset.src] = asset.expectedSize;
151
+ return {
152
+ companions: assets.slice(1).map((asset) => asset.src),
153
+ assetSizes
154
+ };
155
+ }
156
+ import { DEFAULT_MUSIC_MODEL_CHOICE } from "./music-catalog.js";
157
+ export { DEFAULT_MUSIC_MODEL_CHOICE };
158
+ const MUSIC_GENERATION_SKILL = 'music-generation';
159
+ export const AUDIOGEN_CATALOG = [
160
+ {
161
+ choice: 'turbo',
162
+ name: 'ACE-Step-1.5-Turbo-Q4_K_M',
163
+ dit: AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M,
164
+ textEnc: AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0,
165
+ lm: AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0,
166
+ vae: AUDIOGEN_VAE_BF16,
167
+ requiresGpu: false,
168
+ defaultSteps: 8
169
+ },
170
+ {
171
+ choice: 'turbo-hq',
172
+ name: 'ACE-Step-1.5-Turbo-Q8_0',
173
+ dit: AUDIOGEN_ACESTEP_V15_TURBO_Q8_0,
174
+ textEnc: AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0,
175
+ lm: AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0,
176
+ vae: AUDIOGEN_VAE_BF16,
177
+ requiresGpu: true,
178
+ defaultSteps: 8
179
+ },
180
+ {
181
+ choice: 'sft',
182
+ name: 'ACE-Step-1.5-SFT-Q8_0',
183
+ dit: AUDIOGEN_ACESTEP_V15_SFT_Q8_0,
184
+ textEnc: AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0,
185
+ lm: AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0,
186
+ vae: AUDIOGEN_VAE_BF16,
187
+ requiresGpu: true,
188
+ defaultSteps: 24
189
+ }
190
+ ];
191
+ export function musicDefaultSteps(choice) {
192
+ return AUDIOGEN_CATALOG.find((entry) => entry.choice === choice)?.defaultSteps;
193
+ }
194
+ export function musicChoiceForDit(dit) {
195
+ return AUDIOGEN_CATALOG.find((entry) => entry.dit.src === dit || entry.dit.name === dit)?.choice;
196
+ }
197
+ function audioGenStages(entry) {
198
+ return [entry.dit, entry.textEnc, entry.lm, entry.vae];
199
+ }
200
+ export function musicSizeBytes(entry) {
201
+ return audioGenStages(entry).reduce((sum, asset) => sum + asset.expectedSize, 0);
202
+ }
203
+ export function musicModelSet(choice) {
204
+ const entry = AUDIOGEN_CATALOG.find((candidate) => candidate.choice === choice);
205
+ if (!entry)
206
+ return null;
207
+ return {
208
+ dit: entry.dit.src,
209
+ textEnc: entry.textEnc.src,
210
+ lm: entry.lm.src,
211
+ vae: entry.vae.src
212
+ };
213
+ }
214
+ export function audioGenDownloadMetadata(model, addon) {
215
+ if (addon !== 'audiogen')
216
+ return undefined;
217
+ const entry = AUDIOGEN_CATALOG.find((candidate) => candidate.name === model || candidate.dit.name === model || candidate.dit.src === model);
218
+ if (!entry)
219
+ return undefined;
220
+ const stages = audioGenStages(entry);
221
+ const assetSizes = {};
222
+ for (const asset of stages)
223
+ assetSizes[asset.src] = asset.expectedSize;
224
+ return {
225
+ companions: stages.slice(1).map((asset) => asset.src),
226
+ assetSizes
227
+ };
228
+ }
229
+ function agentHasSkill(agent, skill) {
230
+ const installed = agent.installedSkills?.includes(skill) === true;
231
+ return installed && (agent.skillsScope === 'all' || agent.enabledSkills?.includes(skill) === true);
232
+ }
233
+ export function skillModelsForAgent(agent) {
234
+ const models = [];
235
+ if (agentHasSkill(agent, IMAGE_GENERATION_SKILL)) {
236
+ const choice = agent.imageModelChoice ?? DEFAULT_IMAGE_MODEL_CHOICE;
237
+ const entry = DIFFUSION_CATALOG.find((candidate) => candidate.choice === choice);
238
+ if (entry)
239
+ models.push({ name: entry.name, addon: entry.model.addon });
240
+ }
241
+ if (agentHasSkill(agent, MUSIC_GENERATION_SKILL)) {
242
+ const choice = agent.musicModelChoice ?? DEFAULT_MUSIC_MODEL_CHOICE;
243
+ const entry = AUDIOGEN_CATALOG.find((candidate) => candidate.choice === choice);
244
+ if (entry)
245
+ models.push({ name: entry.name, addon: entry.dit.addon });
246
+ }
247
+ return models;
248
+ }
249
+ export function diffusionSizeBytes(entry) {
250
+ return diffusionAssets(entry).reduce((sum, asset) => sum + asset.expectedSize, 0);
251
+ }
252
+ export function imageModelFor(choice) {
253
+ const entry = DIFFUSION_CATALOG.find((candidate) => candidate.choice === choice);
254
+ if (!entry)
255
+ return null;
256
+ return {
257
+ model: entry.model.src,
258
+ ...(entry.llmModel ? { llmModel: entry.llmModel.src } : {}),
259
+ ...(entry.vaeModel ? { vaeModel: entry.vaeModel.src } : {}),
260
+ ...(entry.prediction ? { prediction: entry.prediction } : {})
261
+ };
262
+ }
263
+ export function imageClampsFromEnv(env) {
264
+ const positive = (value) => {
265
+ const n = Math.floor(Number(value));
266
+ return Number.isFinite(n) && n > 0 ? n : undefined;
267
+ };
268
+ const maxDim = positive(env.QVAC_IMAGE_MAX_DIM);
269
+ const maxSteps = positive(env.QVAC_IMAGE_MAX_STEPS);
270
+ if (!maxDim && !maxSteps)
271
+ return undefined;
272
+ return { ...(maxDim ? { maxDim } : {}), ...(maxSteps ? { maxSteps } : {}) };
273
+ }
274
+ export function imageModelFromEnv(env, onIgnoredCompanions, onIgnoredPrediction) {
275
+ const catalog = imageModelFor(env.QVAC_IMAGE_MODEL);
276
+ if (catalog) {
277
+ if (env.QVAC_IMAGE_LLM || env.QVAC_IMAGE_VAE || env.QVAC_IMAGE_PREDICTION) {
278
+ onIgnoredCompanions?.();
279
+ }
280
+ return catalog;
281
+ }
282
+ if (!env.QVAC_IMAGE_MODEL)
283
+ return undefined;
284
+ const prediction = env.QVAC_IMAGE_PREDICTION || undefined;
285
+ const fluxSet = Boolean(env.QVAC_IMAGE_LLM && env.QVAC_IMAGE_VAE);
286
+ if (prediction && !fluxSet)
287
+ onIgnoredPrediction?.();
288
+ return {
289
+ model: env.QVAC_IMAGE_MODEL,
290
+ llmModel: env.QVAC_IMAGE_LLM || undefined,
291
+ vaeModel: env.QVAC_IMAGE_VAE || undefined,
292
+ prediction: fluxSet ? prediction : undefined
293
+ };
294
+ }
295
+ export function curatedListables() {
296
+ return [
297
+ ...LLM_CATALOG.map((entry) => ({
298
+ name: entry.name,
299
+ asset: entry.weight,
300
+ companions: [],
301
+ projection: entry.projection
302
+ })),
303
+ ...CATEGORY_DEFAULTS.map((entry) => ({ name: entry.name, asset: entry.asset, companions: [] })),
304
+ ...DIFFUSION_CATALOG.map((entry) => ({
305
+ name: entry.name,
306
+ asset: entry.model,
307
+ companions: [entry.llmModel, entry.vaeModel].filter(Boolean)
308
+ }))
309
+ ];
310
+ }
311
+ export function curatedModelAsset(name, addon) {
312
+ return curatedListables().find((entry) => entry.asset.addon === addon && (entry.name === name || entry.asset.name === name))?.asset;
313
+ }
314
+ let CUSTOM_MODELS = new Map();
315
+ export function setCustomModels(entries) {
316
+ CUSTOM_MODELS = new Map(entries.map((entry) => [entry.name, entry]));
317
+ }
318
+ export function customModelSrc(name) {
319
+ return CUSTOM_MODELS.get(name)?.src;
320
+ }
321
+ export function customToolDialect(name) {
322
+ const entry = CUSTOM_MODELS.get(name);
323
+ return entry ? detectToolDialect(entry.src, entry.name) : undefined;
324
+ }
325
+ export function customProjectionMap() {
326
+ const map = {};
327
+ for (const entry of CUSTOM_MODELS.values()) {
328
+ if (entry.projectionSrc)
329
+ map[entry.name] = entry.projectionSrc;
330
+ }
331
+ return map;
332
+ }
333
+ export function companionRegistryPaths() {
334
+ const map = new Map();
335
+ for (const entry of LLM_CATALOG) {
336
+ if (entry.projection)
337
+ map.set(entry.weight.registryPath, [entry.projection.registryPath]);
338
+ }
339
+ for (const entry of DIFFUSION_CATALOG) {
340
+ const companions = [entry.llmModel, entry.vaeModel]
341
+ .filter(Boolean)
342
+ .map((asset) => asset.registryPath);
343
+ if (companions.length)
344
+ map.set(entry.model.registryPath, companions);
345
+ }
346
+ for (const entry of AUDIOGEN_CATALOG) {
347
+ map.set(entry.dit.registryPath, [
348
+ entry.textEnc.registryPath,
349
+ entry.lm.registryPath,
350
+ entry.vae.registryPath
351
+ ]);
352
+ }
353
+ return map;
354
+ }
355
+ export function audioGenModelByName(name) {
356
+ for (const entry of AUDIOGEN_CATALOG) {
357
+ for (const stage of [entry.dit, entry.textEnc, entry.lm, entry.vae]) {
358
+ if (stage.name === name || entry.name === name)
359
+ return name === entry.name ? entry.dit : stage;
360
+ }
361
+ }
362
+ return undefined;
363
+ }
364
+ export function musicListables() {
365
+ return AUDIOGEN_CATALOG.map((entry) => ({
366
+ name: entry.name,
367
+ asset: entry.dit,
368
+ companions: [entry.textEnc, entry.lm, entry.vae],
369
+ expectedSize: musicSizeBytes(entry)
370
+ }));
371
+ }
@@ -0,0 +1,18 @@
1
+ import type * as QvacSdk from '@qvac/sdk';
2
+ export type ModelDeleteSdk = Pick<typeof QvacSdk, 'getModelInfo'>;
3
+ export interface DeletedModelFile {
4
+ readonly path: string;
5
+ readonly bytes: number;
6
+ }
7
+ export interface DeleteModelResult {
8
+ readonly name: string;
9
+ readonly removed: ReadonlyArray<DeletedModelFile>;
10
+ readonly freedBytes: number;
11
+ }
12
+ export interface DeleteModelSummary {
13
+ readonly name: string;
14
+ readonly removed: number;
15
+ readonly freedBytes: number;
16
+ }
17
+ export declare function summarizeDelete(result: DeleteModelResult): DeleteModelSummary;
18
+ export declare function deleteModelFiles(sdk: ModelDeleteSdk, name: string): Promise<DeleteModelResult>;
@@ -0,0 +1,47 @@
1
+ import fs from 'fs';
2
+ import { curatedListables, musicListables } from "./model-catalog.js";
3
+ export function summarizeDelete(result) {
4
+ return { name: result.name, removed: result.removed.length, freedBytes: result.freedBytes };
5
+ }
6
+ export async function deleteModelFiles(sdk, name) {
7
+ const seen = new Set();
8
+ const removed = [];
9
+ for (const catalogName of namesToPurge(name)) {
10
+ const info = await sdk.getModelInfo({ name: catalogName }).catch(() => null);
11
+ if (!info)
12
+ continue;
13
+ for (const file of info.cacheFiles) {
14
+ if (seen.has(file.path))
15
+ continue;
16
+ seen.add(file.path);
17
+ const bytes = await onDiskSize(file.path);
18
+ if (bytes === null)
19
+ continue;
20
+ await fs.promises.rm(file.path, { force: true });
21
+ removed.push({ path: file.path, bytes });
22
+ }
23
+ }
24
+ return { name, removed, freedBytes: removed.reduce((sum, file) => sum + file.bytes, 0) };
25
+ }
26
+ async function onDiskSize(filePath) {
27
+ try {
28
+ const stat = await fs.promises.stat(filePath);
29
+ return stat.isFile() ? stat.size : null;
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ function namesToPurge(name) {
36
+ const curated = curatedListables().find((entry) => entry.name === name || entry.asset.name === name);
37
+ if (curated) {
38
+ const names = [curated.asset.name, ...curated.companions.map((companion) => companion.name)];
39
+ if (curated.projection)
40
+ names.push(curated.projection.name);
41
+ return names;
42
+ }
43
+ const music = musicListables().find((entry) => entry.name === name || entry.asset.name === name);
44
+ if (music)
45
+ return [music.asset.name, ...music.companions.map((stage) => stage.name)];
46
+ return [name];
47
+ }
@@ -0,0 +1,18 @@
1
+ export interface ModelResource {
2
+ model: string;
3
+ modelId: string;
4
+ ctxSize?: number;
5
+ }
6
+ export interface ModelHandleOptions {
7
+ load(): Promise<ModelResource>;
8
+ }
9
+ export declare class ModelHandle {
10
+ private readonly _load;
11
+ private readonly _peek;
12
+ private _tracked;
13
+ private _loading;
14
+ constructor({ load }: ModelHandleOptions);
15
+ load(): Promise<ModelResource>;
16
+ get loading(): boolean;
17
+ peek(): Promise<ModelResource> | null;
18
+ }