@qvac/harness 0.4.0 → 0.5.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 (299) hide show
  1. package/CHANGELOG.md +689 -141
  2. package/README.md +29 -7
  3. package/dist/harness.bundle +71 -50
  4. package/dist-lib/index.d.ts +36 -39
  5. package/dist-lib/index.js +279 -114
  6. package/dist-lib/lib/audio-transcode-bare.d.ts +2 -2
  7. package/dist-lib/lib/audio-transcode-bare.js +28 -18
  8. package/dist-lib/lib/audio-transcode-node.d.ts +2 -2
  9. package/dist-lib/lib/capabilities/audio-resample.d.ts +7 -6
  10. package/dist-lib/lib/capabilities/audio-resample.js +30 -18
  11. package/dist-lib/lib/capabilities/completion.d.ts +20 -19
  12. package/dist-lib/lib/capabilities/completion.js +193 -132
  13. package/dist-lib/lib/capabilities/download.d.ts +6 -6
  14. package/dist-lib/lib/capabilities/download.js +15 -8
  15. package/dist-lib/lib/capabilities/embed.js +2 -1
  16. package/dist-lib/lib/capabilities/enhance.d.ts +6 -1
  17. package/dist-lib/lib/capabilities/enhance.js +7 -4
  18. package/dist-lib/lib/capabilities/invoke.js +7 -4
  19. package/dist-lib/lib/capabilities/kv-cache.js +2 -1
  20. package/dist-lib/lib/capabilities/preview-model-source.d.ts +9 -7
  21. package/dist-lib/lib/capabilities/preview-model-source.js +80 -28
  22. package/dist-lib/lib/capabilities/speech-text.js +5 -4
  23. package/dist-lib/lib/capabilities/tool-selection.js +10 -9
  24. package/dist-lib/lib/capabilities/tool-turns.js +30 -16
  25. package/dist-lib/lib/capabilities/usage-breakdown.js +2 -1
  26. package/dist-lib/lib/capabilities/voice.d.ts +5 -1
  27. package/dist-lib/lib/capabilities/voice.js +22 -12
  28. package/dist-lib/lib/connect.d.ts +11 -32
  29. package/dist-lib/lib/connect.js +152 -112
  30. package/dist-lib/lib/context-window.js +25 -21
  31. package/dist-lib/lib/contract-types.d.ts +22 -15
  32. package/dist-lib/lib/diagram-repair.d.ts +4 -4
  33. package/dist-lib/lib/diagram-repair.js +6 -3
  34. package/dist-lib/lib/docx/index.d.ts +3 -2
  35. package/dist-lib/lib/{error-fields.d.ts → guards.d.ts} +1 -0
  36. package/dist-lib/lib/{error-fields.js → guards.js} +3 -0
  37. package/dist-lib/lib/hardware/capability-probe.js +20 -10
  38. package/dist-lib/lib/hardware/gpu-classify.js +6 -3
  39. package/dist-lib/lib/hardware/gpu-probe-addon.js +8 -4
  40. package/dist-lib/lib/hardware/gpu-probe.js +4 -2
  41. package/dist-lib/lib/hardware/gpu-stats.native.cjs +8 -9
  42. package/dist-lib/lib/hardware/parsers.js +8 -4
  43. package/dist-lib/lib/helpers/buffer-burst.js +4 -2
  44. package/dist-lib/lib/helpers/control-tokens.js +4 -2
  45. package/dist-lib/lib/helpers/join-guard.d.ts +2 -2
  46. package/dist-lib/lib/helpers/join-guard.js +4 -2
  47. package/dist-lib/lib/helpers/load-stall.js +4 -2
  48. package/dist-lib/lib/helpers/markup-stream-filter.d.ts +2 -2
  49. package/dist-lib/lib/helpers/markup-stream-filter.js +6 -3
  50. package/dist-lib/lib/helpers/race-abort.js +2 -1
  51. package/dist-lib/lib/helpers/race-timeout.d.ts +5 -0
  52. package/dist-lib/lib/helpers/race-timeout.js +14 -0
  53. package/dist-lib/lib/helpers/run-outcome.d.ts +6 -8
  54. package/dist-lib/lib/helpers/run-outcome.js +36 -20
  55. package/dist-lib/lib/helpers/spawn-path.js +6 -3
  56. package/dist-lib/lib/helpers/text-coalescer.js +6 -3
  57. package/dist-lib/lib/helpers/thinking.js +38 -45
  58. package/dist-lib/lib/helpers/tool-call-markup.d.ts +9 -7
  59. package/dist-lib/lib/helpers/tool-call-markup.js +36 -20
  60. package/dist-lib/lib/helpers/tool-intent.d.ts +3 -2
  61. package/dist-lib/lib/helpers/tool-intent.js +4 -2
  62. package/dist-lib/lib/helpers/tool-label.js +18 -9
  63. package/dist-lib/lib/hooks/built-in/arg-repair.js +23 -13
  64. package/dist-lib/lib/hooks/built-in/egress.js +2 -1
  65. package/dist-lib/lib/hooks/built-in/skill-catalog.js +2 -1
  66. package/dist-lib/lib/hooks/pipeline.d.ts +5 -4
  67. package/dist-lib/lib/hooks/pipeline.js +6 -3
  68. package/dist-lib/lib/hooks/run.js +12 -8
  69. package/dist-lib/lib/model-download-progress.js +10 -8
  70. package/dist-lib/lib/models/context.d.ts +1 -1
  71. package/dist-lib/lib/models/context.js +5 -1
  72. package/dist-lib/lib/models/custom-model-cache.d.ts +10 -1
  73. package/dist-lib/lib/models/custom-model-cache.js +43 -15
  74. package/dist-lib/lib/models/gguf-header.d.ts +3 -2
  75. package/dist-lib/lib/models/gguf-header.js +44 -22
  76. package/dist-lib/lib/models/idle-unload.d.ts +14 -0
  77. package/dist-lib/lib/models/idle-unload.js +51 -0
  78. package/dist-lib/lib/models/kv-cache.d.ts +3 -2
  79. package/dist-lib/lib/models/kv-cache.js +4 -3
  80. package/dist-lib/lib/models/llm-presets.d.ts +2 -2
  81. package/dist-lib/lib/models/llm-presets.js +4 -2
  82. package/dist-lib/lib/models/model-catalog-constants.js +3 -2
  83. package/dist-lib/lib/models/model-catalog.d.ts +13 -20
  84. package/dist-lib/lib/models/model-catalog.js +59 -31
  85. package/dist-lib/lib/models/model-delete.js +18 -8
  86. package/dist-lib/lib/models/model-handle.js +2 -1
  87. package/dist-lib/lib/models/model-list.d.ts +8 -3
  88. package/dist-lib/lib/models/model-list.js +11 -6
  89. package/dist-lib/lib/models/model-pool.d.ts +44 -10
  90. package/dist-lib/lib/models/model-pool.js +47 -42
  91. package/dist-lib/lib/models/model-source.js +10 -5
  92. package/dist-lib/lib/models/music-catalog.d.ts +2 -2
  93. package/dist-lib/lib/models/nmt-catalog.d.ts +4 -3
  94. package/dist-lib/lib/models/nmt-catalog.js +10 -5
  95. package/dist-lib/lib/models/opencl-cache.d.ts +6 -1
  96. package/dist-lib/lib/models/opencl-cache.js +5 -3
  97. package/dist-lib/lib/models/sdk-faults.d.ts +11 -8
  98. package/dist-lib/lib/models/sdk-faults.js +9 -6
  99. package/dist-lib/lib/models/shards.d.ts +11 -0
  100. package/dist-lib/lib/models/shards.js +15 -0
  101. package/dist-lib/lib/models/tool-dialect.js +10 -5
  102. package/dist-lib/lib/no-redirect-fetch-bare.d.ts +3 -3
  103. package/dist-lib/lib/no-redirect-fetch-bare.js +1 -1
  104. package/dist-lib/lib/no-redirect-fetch-impl.js +6 -3
  105. package/dist-lib/lib/no-redirect-fetch-node.d.ts +1 -1
  106. package/dist-lib/lib/no-redirect-fetch-node.js +9 -9
  107. package/dist-lib/lib/office/index.d.ts +3 -2
  108. package/dist-lib/lib/office/python.d.ts +3 -2
  109. package/dist-lib/lib/office/python.js +2 -1
  110. package/dist-lib/lib/prompt.d.ts +5 -4
  111. package/dist-lib/lib/prompt.js +8 -4
  112. package/dist-lib/lib/queue.js +10 -5
  113. package/dist-lib/lib/resolution-detector.js +21 -11
  114. package/dist-lib/lib/rpc-session.js +2 -1
  115. package/dist-lib/lib/sdk-loader.js +2 -1
  116. package/dist-lib/lib/sdk-storage.js +4 -2
  117. package/dist-lib/lib/serve.js +110 -66
  118. package/dist-lib/lib/spawn.js +7 -4
  119. package/dist-lib/lib/tmp-path.d.ts +7 -6
  120. package/dist-lib/lib/tool-call-display.d.ts +2 -2
  121. package/dist-lib/lib/tools/create-documents.js +18 -10
  122. package/dist-lib/lib/tools/edit-documents.js +23 -13
  123. package/dist-lib/lib/tools/edit-image.d.ts +2 -2
  124. package/dist-lib/lib/tools/edit-image.js +60 -36
  125. package/dist-lib/lib/tools/exec/adapters/adapter.d.ts +10 -10
  126. package/dist-lib/lib/tools/exec/adapters/python/attachments.d.ts +17 -11
  127. package/dist-lib/lib/tools/exec/adapters/python/attachments.js +53 -40
  128. package/dist-lib/lib/tools/exec/adapters/python/create-effect.d.ts +2 -2
  129. package/dist-lib/lib/tools/exec/adapters/python/create-effect.js +60 -32
  130. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.d.ts +33 -22
  131. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.js +58 -29
  132. package/dist-lib/lib/tools/exec/adapters/python/interrupt-timer.d.ts +2 -2
  133. package/dist-lib/lib/tools/exec/adapters/python/loader.js +23 -12
  134. package/dist-lib/lib/tools/exec/adapters/python/memfs.d.ts +13 -11
  135. package/dist-lib/lib/tools/exec/adapters/python/memfs.js +10 -5
  136. package/dist-lib/lib/tools/exec/adapters/python/net-shim.js +3 -1
  137. package/dist-lib/lib/tools/exec/adapters/python/output-policy.d.ts +6 -4
  138. package/dist-lib/lib/tools/exec/adapters/python/output-policy.js +20 -10
  139. package/dist-lib/lib/tools/exec/adapters/python/pyodide.d.ts +2 -2
  140. package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +14 -7
  141. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.d.ts +41 -34
  142. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +316 -166
  143. package/dist-lib/lib/tools/exec/adapters/python/run-session.d.ts +9 -8
  144. package/dist-lib/lib/tools/exec/adapters/python/run-session.js +56 -28
  145. package/dist-lib/lib/tools/exec/adapters/python/wheels.d.ts +8 -10
  146. package/dist-lib/lib/tools/exec/adapters/python/wheels.js +22 -11
  147. package/dist-lib/lib/tools/exec/adapters/python/worker/client.d.ts +3 -2
  148. package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +41 -26
  149. package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +27 -18
  150. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.d.ts +2 -2
  151. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.js +14 -13
  152. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.d.ts +4 -4
  153. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.js +10 -5
  154. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.d.ts +4 -4
  155. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +2 -1
  156. package/dist-lib/lib/tools/exec/obsidian/cli-process.d.ts +6 -1
  157. package/dist-lib/lib/tools/exec/obsidian/cli-process.js +8 -5
  158. package/dist-lib/lib/tools/exec/obsidian/cli.d.ts +6 -6
  159. package/dist-lib/lib/tools/exec/obsidian/cli.js +4 -4
  160. package/dist-lib/lib/tools/exec/obsidian/command.d.ts +3 -2
  161. package/dist-lib/lib/tools/exec/obsidian/command.js +6 -3
  162. package/dist-lib/lib/tools/exec/obsidian/output.js +2 -1
  163. package/dist-lib/lib/tools/exec/obsidian/route.d.ts +4 -6
  164. package/dist-lib/lib/tools/exec/obsidian/route.js +17 -11
  165. package/dist-lib/lib/tools/exec/obsidian/safe-path.js +2 -1
  166. package/dist-lib/lib/tools/exec/obsidian/vault-create.js +15 -7
  167. package/dist-lib/lib/tools/exec/obsidian/vault-paths.d.ts +2 -2
  168. package/dist-lib/lib/tools/exec/obsidian/vault-paths.js +20 -10
  169. package/dist-lib/lib/tools/exec/obsidian/vault-read.js +20 -13
  170. package/dist-lib/lib/tools/exec/obsidian/vault-write.js +24 -12
  171. package/dist-lib/lib/tools/exec/runner.d.ts +14 -14
  172. package/dist-lib/lib/tools/exec/runner.js +5 -3
  173. package/dist-lib/lib/tools/exec/scope.js +52 -28
  174. package/dist-lib/lib/tools/exec/shell-argv.js +31 -18
  175. package/dist-lib/lib/tools/exec/shell-guidance.d.ts +6 -1
  176. package/dist-lib/lib/tools/exec/shell-guidance.js +35 -20
  177. package/dist-lib/lib/tools/exec/video-tools.js +2 -2
  178. package/dist-lib/lib/tools/exec.d.ts +6 -8
  179. package/dist-lib/lib/tools/exec.js +113 -54
  180. package/dist-lib/lib/tools/file-glob.d.ts +4 -5
  181. package/dist-lib/lib/tools/file-glob.js +16 -11
  182. package/dist-lib/lib/tools/fs/glob.js +13 -18
  183. package/dist-lib/lib/tools/fs/remote-protocol.d.ts +10 -10
  184. package/dist-lib/lib/tools/fs/remote.d.ts +3 -2
  185. package/dist-lib/lib/tools/fs/remote.js +13 -7
  186. package/dist-lib/lib/tools/fs/scope.d.ts +8 -3
  187. package/dist-lib/lib/tools/fs/scope.js +20 -12
  188. package/dist-lib/lib/tools/fs/walk.js +6 -3
  189. package/dist-lib/lib/tools/fs/write.d.ts +3 -2
  190. package/dist-lib/lib/tools/generate-image.d.ts +11 -9
  191. package/dist-lib/lib/tools/generate-image.js +73 -37
  192. package/dist-lib/lib/tools/generate-music.d.ts +22 -11
  193. package/dist-lib/lib/tools/generate-music.js +79 -48
  194. package/dist-lib/lib/tools/grep.js +66 -41
  195. package/dist-lib/lib/tools/http-request/encode-fields.js +18 -9
  196. package/dist-lib/lib/tools/http-request/{utils.js → request.js} +20 -11
  197. package/dist-lib/lib/tools/http-request/truncate-response.js +57 -46
  198. package/dist-lib/lib/tools/http-request.d.ts +1 -1
  199. package/dist-lib/lib/tools/http-request.js +33 -18
  200. package/dist-lib/lib/tools/mcp/protocol.d.ts +53 -0
  201. package/dist-lib/lib/tools/mcp/{utils.js → protocol.js} +45 -23
  202. package/dist-lib/lib/tools/mcp-call.d.ts +1 -1
  203. package/dist-lib/lib/tools/mcp-call.js +37 -16
  204. package/dist-lib/lib/tools/operations/builders.js +10 -6
  205. package/dist-lib/lib/tools/operations/compile.js +20 -10
  206. package/dist-lib/lib/tools/operations/decoders.js +12 -6
  207. package/dist-lib/lib/tools/operations/gmail-message.js +3 -2
  208. package/dist-lib/lib/tools/outbound-guard.d.ts +4 -3
  209. package/dist-lib/lib/tools/outbound-guard.js +14 -8
  210. package/dist-lib/lib/tools/private-ip.js +8 -7
  211. package/dist-lib/lib/tools/rag-search.js +14 -7
  212. package/dist-lib/lib/tools/read-files.js +23 -20
  213. package/dist-lib/lib/tools/skill.js +19 -10
  214. package/dist-lib/lib/tools/skills/auth-resolver.d.ts +11 -18
  215. package/dist-lib/lib/tools/skills/auth-resolver.js +30 -18
  216. package/dist-lib/lib/tools/skills/bin-check.d.ts +3 -2
  217. package/dist-lib/lib/tools/skills/bin-check.js +10 -3
  218. package/dist-lib/lib/tools/skills/bundled-dir.js +20 -10
  219. package/dist-lib/lib/tools/skills/bundled-hash.d.ts +3 -2
  220. package/dist-lib/lib/tools/skills/bundled-hash.js +6 -1
  221. package/dist-lib/lib/tools/skills/catalog.d.ts +3 -2
  222. package/dist-lib/lib/tools/skills/catalog.js +33 -28
  223. package/dist-lib/lib/tools/skills/cli-argv.d.ts +3 -2
  224. package/dist-lib/lib/tools/skills/cli-argv.js +55 -52
  225. package/dist-lib/lib/tools/skills/cli-schema-check.js +21 -10
  226. package/dist-lib/lib/tools/skills/cli-schema-load.js +28 -20
  227. package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +6 -6
  228. package/dist-lib/lib/tools/skills/cli-schema.js +2 -1
  229. package/dist-lib/lib/tools/skills/credential-check.d.ts +6 -3
  230. package/dist-lib/lib/tools/skills/credential-check.js +24 -12
  231. package/dist-lib/lib/tools/skills/credential-grants.js +1 -6
  232. package/dist-lib/lib/tools/skills/credential-health.d.ts +5 -1
  233. package/dist-lib/lib/tools/skills/credential-health.js +5 -3
  234. package/dist-lib/lib/tools/skills/frontmatter-parser.js +10 -5
  235. package/dist-lib/lib/tools/skills/manifest-parse.js +84 -64
  236. package/dist-lib/lib/tools/skills/mention.js +7 -6
  237. package/dist-lib/lib/tools/skills/obsidian-readiness.d.ts +2 -2
  238. package/dist-lib/lib/tools/skills/obsidian-readiness.js +11 -3
  239. package/dist-lib/lib/tools/skills/overlay-crud.d.ts +6 -4
  240. package/dist-lib/lib/tools/skills/overlay-crud.js +12 -6
  241. package/dist-lib/lib/tools/skills/overlay-dir.js +4 -2
  242. package/dist-lib/lib/tools/skills/overlay-watch.d.ts +3 -2
  243. package/dist-lib/lib/tools/skills/overlay-watch.js +8 -4
  244. package/dist-lib/lib/tools/skills/setup-routes.js +1 -3
  245. package/dist-lib/lib/tools/skills/skill-settings.js +4 -1
  246. package/dist-lib/lib/tools/skills/skill-state.d.ts +6 -11
  247. package/dist-lib/lib/tools/skills/skill-state.js +48 -29
  248. package/dist-lib/lib/tools/skills/tool-grants.js +6 -3
  249. package/dist-lib/lib/tools/toolsets.js +2 -1
  250. package/dist-lib/lib/tools/translate.d.ts +4 -5
  251. package/dist-lib/lib/tools/translate.js +31 -14
  252. package/dist-lib/lib/tools/url-guard.js +2 -1
  253. package/dist-lib/lib/tools/weather-lookup/place.js +8 -4
  254. package/dist-lib/lib/tools/weather-lookup/report.d.ts +7 -1
  255. package/dist-lib/lib/tools/weather-lookup/report.js +46 -9
  256. package/dist-lib/lib/tools/weather-lookup.js +18 -12
  257. package/dist-lib/lib/tools/web-fetch.js +47 -24
  258. package/dist-lib/lib/tools/web-search.js +8 -3
  259. package/dist-lib/lib/validating-lookup.d.ts +4 -4
  260. package/dist-lib/lib/wav-encode.d.ts +1 -1
  261. package/dist-lib/lib/wav-encode.js +11 -10
  262. package/dist-lib/lib/web-fetch/embedded-state.js +24 -12
  263. package/dist-lib/lib/web-fetch/extract.js +4 -2
  264. package/dist-lib/lib/web-fetch/images.js +8 -4
  265. package/dist-lib/lib/web-fetch/video.d.ts +2 -2
  266. package/dist-lib/lib/web-fetch/video.js +8 -4
  267. package/dist-lib/lib/web-search/engine-registry.d.ts +2 -2
  268. package/dist-lib/lib/web-search/engines/aol.js +1 -1
  269. package/dist-lib/lib/web-search/engines/bing.js +1 -1
  270. package/dist-lib/lib/web-search/engines/brave.js +4 -1
  271. package/dist-lib/lib/web-search/engines/duckduckgo.js +3 -2
  272. package/dist-lib/lib/web-search/engines/google.js +7 -3
  273. package/dist-lib/lib/web-search/engines/wikipedia.js +5 -4
  274. package/dist-lib/lib/web-search/engines/yahoo.js +1 -1
  275. package/dist-lib/lib/web-search/fetch-html.d.ts +5 -4
  276. package/dist-lib/lib/web-search/fetch-html.js +13 -7
  277. package/dist-lib/lib/web-search/orchestrator.d.ts +9 -5
  278. package/dist-lib/lib/web-search/orchestrator.js +3 -3
  279. package/dist-lib/lib/wire.d.ts +3 -2
  280. package/dist-lib/lib/wire.js +23 -15
  281. package/dist-lib/schema/baseline.js +10 -5
  282. package/dist-lib/schema/build.js +2 -1
  283. package/dist-lib/schema/harness.d.ts +15 -2
  284. package/dist-lib/schema/harness.js +14 -2
  285. package/dist-lib/schema/release-tags.d.ts +3 -2
  286. package/dist-lib/schema/release-tags.js +6 -3
  287. package/dist-lib/spec/bind.js +3 -0
  288. package/dist-lib/spec/calls.js +1 -0
  289. package/dist-lib/spec/hrpc/hrpc.json +13 -0
  290. package/dist-lib/spec/hrpc/index.js +15 -3
  291. package/dist-lib/spec/hrpc/messages.js +39 -8
  292. package/dist-lib/spec/hyperschema/index.js +39 -8
  293. package/dist-lib/spec/hyperschema/schema.json +30 -1
  294. package/dist-lib/spec/hyperschema/types.d.ts +9 -1
  295. package/package.json +13 -14
  296. package/worker/harness-sidecar.mjs +15 -22
  297. package/worker/stow-entry.mjs +7 -4
  298. package/dist-lib/lib/tools/mcp/utils.d.ts +0 -47
  299. /package/dist-lib/lib/tools/http-request/{utils.d.ts → request.d.ts} +0 -0
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 14
2
+ // Schema Version: 15
3
3
  /* eslint-disable camelcase */
4
4
  /* eslint-disable quotes */
5
5
  /* eslint-disable space-before-function-paren */
6
6
 
7
7
  import { c } from 'hyperschema/runtime'
8
8
 
9
- const VERSION = 14
9
+ const VERSION = 15
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -1610,17 +1610,19 @@ const encoding31 = {
1610
1610
  c.string.preencode(state, m.type)
1611
1611
  c.string.preencode(state, m.registryPath)
1612
1612
  c.string.preencode(state, m.registrySource)
1613
- state.end++ // max flag is 8 so always one byte
1613
+ state.end++ // max flag is 16 so always one byte
1614
1614
  c.uint.preencode(state, m.expectedSize)
1615
1615
 
1616
1616
  if (m.actualSize) c.uint.preencode(state, m.actualSize)
1617
+ if (version >= 15 && m.label) c.string.preencode(state, m.label)
1617
1618
  },
1618
1619
  encode(state, m) {
1619
1620
  const flags =
1620
1621
  (m.isCached ? 1 : 0) |
1621
1622
  (m.isLoaded ? 2 : 0) |
1622
1623
  (m.supportsImages ? 4 : 0) |
1623
- (m.actualSize ? 8 : 0)
1624
+ (m.actualSize ? 8 : 0) |
1625
+ ((version >= 15 && m.label) ? 16 : 0)
1624
1626
 
1625
1627
  c.string.encode(state, m.name)
1626
1628
  c.string.encode(state, m.type)
@@ -1630,6 +1632,7 @@ const encoding31 = {
1630
1632
  c.uint.encode(state, m.expectedSize)
1631
1633
 
1632
1634
  if (m.actualSize) c.uint.encode(state, m.actualSize)
1635
+ if (version >= 15 && m.label) c.string.encode(state, m.label)
1633
1636
  },
1634
1637
  decode(state) {
1635
1638
  const r0 = c.string.decode(state)
@@ -1647,7 +1650,8 @@ const encoding31 = {
1647
1650
  isLoaded: (flags & 2) !== 0,
1648
1651
  supportsImages: (flags & 4) !== 0,
1649
1652
  expectedSize: c.uint.decode(state),
1650
- actualSize: (flags & 8) !== 0 ? c.uint.decode(state) : 0
1653
+ actualSize: (flags & 8) !== 0 ? c.uint.decode(state) : 0,
1654
+ label: (version >= 15 && (flags & 16) !== 0) ? c.string.decode(state) : null
1651
1655
  }
1652
1656
  }
1653
1657
  }
@@ -2635,17 +2639,21 @@ const encoding65 = {
2635
2639
  preencode(state, m) {
2636
2640
  c.string.preencode(state, m.name)
2637
2641
  c.string.preencode(state, m.src)
2638
- state.end++ // max flag is 4 so always one byte
2642
+ state.end++ // max flag is 16 so always one byte
2639
2643
 
2640
2644
  if (version >= 5 && m.projectionSrc) c.string.preencode(state, m.projectionSrc)
2641
2645
  if (version >= 14 && m.taskType) c.string.preencode(state, m.taskType)
2642
2646
  if (version >= 14 && m.expectedSize) c.uint.preencode(state, m.expectedSize)
2647
+ if (version >= 15 && m.label) c.string.preencode(state, m.label)
2648
+ if (version >= 15 && m.contextLength) c.uint.preencode(state, m.contextLength)
2643
2649
  },
2644
2650
  encode(state, m) {
2645
2651
  const flags =
2646
2652
  ((version >= 5 && m.projectionSrc) ? 1 : 0) |
2647
2653
  ((version >= 14 && m.taskType) ? 2 : 0) |
2648
- ((version >= 14 && m.expectedSize) ? 4 : 0)
2654
+ ((version >= 14 && m.expectedSize) ? 4 : 0) |
2655
+ ((version >= 15 && m.label) ? 8 : 0) |
2656
+ ((version >= 15 && m.contextLength) ? 16 : 0)
2649
2657
 
2650
2658
  c.string.encode(state, m.name)
2651
2659
  c.string.encode(state, m.src)
@@ -2654,6 +2662,8 @@ const encoding65 = {
2654
2662
  if (version >= 5 && m.projectionSrc) c.string.encode(state, m.projectionSrc)
2655
2663
  if (version >= 14 && m.taskType) c.string.encode(state, m.taskType)
2656
2664
  if (version >= 14 && m.expectedSize) c.uint.encode(state, m.expectedSize)
2665
+ if (version >= 15 && m.label) c.string.encode(state, m.label)
2666
+ if (version >= 15 && m.contextLength) c.uint.encode(state, m.contextLength)
2657
2667
  },
2658
2668
  decode(state) {
2659
2669
  const r0 = c.string.decode(state)
@@ -2665,7 +2675,9 @@ const encoding65 = {
2665
2675
  src: r1,
2666
2676
  projectionSrc: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null,
2667
2677
  taskType: (version >= 14 && (flags & 2) !== 0) ? c.string.decode(state) : null,
2668
- expectedSize: (version >= 14 && (flags & 4) !== 0) ? c.uint.decode(state) : 0
2678
+ expectedSize: (version >= 14 && (flags & 4) !== 0) ? c.uint.decode(state) : 0,
2679
+ label: (version >= 15 && (flags & 8) !== 0) ? c.string.decode(state) : null,
2680
+ contextLength: (version >= 15 && (flags & 16) !== 0) ? c.uint.decode(state) : 0
2669
2681
  }
2670
2682
  }
2671
2683
  }
@@ -3336,6 +3348,23 @@ const encoding87 = {
3336
3348
  }
3337
3349
  }
3338
3350
 
3351
+ // @harness/set-model-idle-timeout-request
3352
+ const encoding88 = {
3353
+ preencode(state, m) {
3354
+ c.uint.preencode(state, m.ms)
3355
+ },
3356
+ encode(state, m) {
3357
+ c.uint.encode(state, m.ms)
3358
+ },
3359
+ decode(state) {
3360
+ const r0 = c.uint.decode(state)
3361
+
3362
+ return {
3363
+ ms: r0
3364
+ }
3365
+ }
3366
+ }
3367
+
3339
3368
  // @harness/completion-frame.grantedDrives, deferred due to recusive use
3340
3369
  const encoding11_23 = c.array(c.frame(encoding60))
3341
3370
  // @harness/skill.setupV2, deferred due to recusive use
@@ -3574,6 +3603,8 @@ function getEncoding(name) {
3574
3603
  return encoding86
3575
3604
  case '@harness/preview-model-source-response':
3576
3605
  return encoding87
3606
+ case '@harness/set-model-idle-timeout-request':
3607
+ return encoding88
3577
3608
  default:
3578
3609
  throw new Error('Encoder not found ' + name)
3579
3610
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 14,
2
+ "version": 15,
3
3
  "schema": [
4
4
  {
5
5
  "name": "empty",
@@ -1336,6 +1336,11 @@
1336
1336
  "name": "actualSize",
1337
1337
  "type": "uint",
1338
1338
  "version": 1
1339
+ },
1340
+ {
1341
+ "name": "label",
1342
+ "type": "string",
1343
+ "version": 15
1339
1344
  }
1340
1345
  ]
1341
1346
  },
@@ -2139,6 +2144,16 @@
2139
2144
  "name": "expectedSize",
2140
2145
  "type": "uint",
2141
2146
  "version": 14
2147
+ },
2148
+ {
2149
+ "name": "label",
2150
+ "type": "string",
2151
+ "version": 15
2152
+ },
2153
+ {
2154
+ "name": "contextLength",
2155
+ "type": "uint",
2156
+ "version": 15
2142
2157
  }
2143
2158
  ]
2144
2159
  },
@@ -2688,6 +2703,20 @@
2688
2703
  "version": 14
2689
2704
  }
2690
2705
  ]
2706
+ },
2707
+ {
2708
+ "name": "set-model-idle-timeout-request",
2709
+ "namespace": "harness",
2710
+ "compact": false,
2711
+ "flagsPosition": -1,
2712
+ "fields": [
2713
+ {
2714
+ "name": "ms",
2715
+ "required": true,
2716
+ "type": "uint",
2717
+ "version": 15
2718
+ }
2719
+ ]
2691
2720
  }
2692
2721
  ]
2693
2722
  }
@@ -1,5 +1,5 @@
1
1
  // This file is autogenerated by hyperschema-ts
2
- // Schema version: 14
2
+ // Schema version: 15
3
3
  // Do not edit manually.
4
4
 
5
5
  export interface HarnessEmpty {
@@ -256,6 +256,7 @@ export interface HarnessModelInfo {
256
256
  supportsImages?: boolean
257
257
  expectedSize: number
258
258
  actualSize?: number
259
+ label?: string | null
259
260
  }
260
261
 
261
262
  export interface HarnessListModelsRequest {
@@ -427,6 +428,8 @@ export interface HarnessCustomModel {
427
428
  projectionSrc?: string | null
428
429
  taskType?: string | null
429
430
  expectedSize?: number
431
+ label?: string | null
432
+ contextLength?: number
430
433
  }
431
434
 
432
435
  export interface HarnessSetCustomModelsRequest {
@@ -561,6 +564,10 @@ export interface HarnessPreviewModelSourceResponse {
561
564
  mmprojSrc?: string | null
562
565
  }
563
566
 
567
+ export interface HarnessSetModelIdleTimeoutRequest {
568
+ ms: number
569
+ }
570
+
564
571
  export interface SchemaTypes {
565
572
  "@harness/empty": HarnessEmpty
566
573
  "@harness/ok-response": HarnessOkResponse
@@ -650,4 +657,5 @@ export interface SchemaTypes {
650
657
  "@harness/preview-model-source-request": HarnessPreviewModelSourceRequest
651
658
  "@harness/model-source-file": HarnessModelSourceFile
652
659
  "@harness/preview-model-source-response": HarnessPreviewModelSourceResponse
660
+ "@harness/set-model-idle-timeout-request": HarnessSetModelIdleTimeoutRequest
653
661
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/harness",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "An AI harness implementing generate(context) via @qvac/sdk. Knows nothing about workbench, hyperdb, or chunks — just inference in, events out.",
6
6
  "exports": {
@@ -420,17 +420,17 @@
420
420
  "types": "./dist-lib/lib/tools/http-request/encode-fields.d.ts",
421
421
  "default": "./dist-lib/lib/tools/http-request/encode-fields.js"
422
422
  },
423
+ "./lib/tools/http-request/request.ts": {
424
+ "types": "./dist-lib/lib/tools/http-request/request.d.ts",
425
+ "default": "./dist-lib/lib/tools/http-request/request.js"
426
+ },
423
427
  "./lib/tools/http-request/truncate-response.ts": {
424
428
  "types": "./dist-lib/lib/tools/http-request/truncate-response.d.ts",
425
429
  "default": "./dist-lib/lib/tools/http-request/truncate-response.js"
426
430
  },
427
- "./lib/tools/http-request/utils.ts": {
428
- "types": "./dist-lib/lib/tools/http-request/utils.d.ts",
429
- "default": "./dist-lib/lib/tools/http-request/utils.js"
430
- },
431
- "./lib/tools/mcp/utils.ts": {
432
- "types": "./dist-lib/lib/tools/mcp/utils.d.ts",
433
- "default": "./dist-lib/lib/tools/mcp/utils.js"
431
+ "./lib/tools/mcp/protocol.ts": {
432
+ "types": "./dist-lib/lib/tools/mcp/protocol.d.ts",
433
+ "default": "./dist-lib/lib/tools/mcp/protocol.js"
434
434
  },
435
435
  "./lib/tools/model-args.ts": {
436
436
  "types": "./dist-lib/lib/tools/model-args.d.ts",
@@ -600,7 +600,7 @@
600
600
  "scripts": {
601
601
  "build:schema": "bare schema/build.ts",
602
602
  "test": "npm run vendor:wheels && npm run test:bare && npm run test:addons",
603
- "test:bare": "QVAC_NO_SKILL_BIN_PROBE=1 prettytap -- brittle-bare test/all.ts",
603
+ "test:bare": "QVAC_NO_SKILL_BIN_PROBE=1 brittle-jobs 'test/{,!(helpers)/}*.ts'",
604
604
  "format": "prettier . --write",
605
605
  "lint": "prettier . --check && lunte && tsc --noEmit",
606
606
  "build:bundle": "node scripts/build-bundle.mjs",
@@ -699,7 +699,7 @@
699
699
  "@qvac/sdk": "0.20.0",
700
700
  "@qvac/skills": "0.1.9",
701
701
  "asenion": "^0.1.0",
702
- "b4a": "^1.8.1",
702
+ "b4a": "^1.9.0",
703
703
  "bare-abort-controller": "^1.1.2",
704
704
  "bare-buffer": "^3.6.1",
705
705
  "bare-channel": "^5.2.4",
@@ -747,21 +747,21 @@
747
747
  "zod": "^4.3.6"
748
748
  },
749
749
  "devDependencies": {
750
- "@types/b4a": "^1.6.5",
751
750
  "bare-bundle": "^1.10.0",
752
751
  "bare-module-lexer": "^1.6.3",
753
752
  "bare-runtime": "^1.30.0",
754
753
  "bare-semver": "^1.1.0",
755
754
  "brittle": "^4.0.2",
755
+ "brittle-jobs": "^0.2.1",
756
756
  "corestore": "^7.11.0",
757
757
  "holepunch-types": "^0.2.1",
758
758
  "hyperdrive": "^13.3.3",
759
759
  "jsdom": "~30.0.1",
760
- "lunte": "^1.8.3",
760
+ "lunte": "^1.8.4",
761
+ "lunte-plugin-qvac": "^0.1.0",
761
762
  "mermaid": "~11.16.1",
762
763
  "prettier": "^3.6.2",
763
764
  "prettier-config-holepunch": "^2.0.0",
764
- "prettytap": "^0.2.0",
765
765
  "terser": "^5.51.2",
766
766
  "typescript": "^7.0.2"
767
767
  },
@@ -771,7 +771,6 @@
771
771
  "localwatch@1.4.3": "patches/localwatch@1.4.3.patch",
772
772
  "hypercore-blob-server@1.15.0": "patches/hypercore-blob-server@1.15.0.patch",
773
773
  "bare-stow@0.1.5": "patches/bare-stow@0.1.5.patch",
774
- "brittle@4.1.0": "patches/brittle@4.1.0.patch",
775
774
  "@qvac/inference@0.20.0": "patches/@qvac%2Finference@0.20.0.patch"
776
775
  },
777
776
  "repository": {
@@ -1,10 +1,4 @@
1
- // bare-stow entry: serves the Harness over the ipc duplex bare-stow wires.
2
- // argv (empty = absent): [2] skillsDir, [3] SDK storage JSON (required: the fs deny list fences it), [4] embedding config JSON,
3
- // [5] imageModel JSON, [6] imageClamps JSON,
4
- // [7] '1' to enable harness logging (written to `harness.log`, beside assistant.log),
5
- // [8] llm config JSON (llmDevice/llmGpuLayers/contextSize/kvCacheK/kvCacheV/completionModelCap),
6
- // [9] musicModel JSON, [10] musicClamps JSON, [11] vendored python wheels dir,
7
- // [12] host-supplied GPU stats JSON.
1
+ // bare-stow entry: argv slots are the ones spawnHarness forwards in lib/spawn.ts; empty is absent
8
2
  import '../dist-lib/lib/hardware/gpu-probe-entry.js'
9
3
  import FileLog from 'bare-file-logger'
10
4
  import fs from 'fs'
@@ -41,10 +35,7 @@ const SCOPE = '[harness]'
41
35
  // when the file will not open, everything still has somewhere to go that is not the pipe
42
36
  const DISCARD = { info() {}, debug() {}, warn() {}, error() {} }
43
37
 
44
- // On Windows the host does not read our stdout, and writing past the OS buffer takes the
45
- // Bare thread with it: the event loop stops, nothing raises, and a download never produces
46
- // a byte. Elsewhere the same write only queues in memory (measured), which is why it only
47
- // showed up there. Every line goes to a file instead, via the FileLog the assistant uses.
38
+ // on Windows unread stdout past the OS buffer silently halts the Bare thread, so log to a file
48
39
  function openHarnessLog(path) {
49
40
  try {
50
41
  fs.mkdirSync(dirname(path), { recursive: true })
@@ -54,8 +45,7 @@ function openHarnessLog(path) {
54
45
  }
55
46
  }
56
47
 
57
- // Ungated by the host's log flag: the SDK and its addons log through `console`, and a
58
- // chatty dependency must not be able to wedge this process.
48
+ // ungated by the log flag: the SDK and addons log via console, and chatter must not wedge us
59
49
  function captureConsole(log) {
60
50
  console.log = console.info = (...args) => log.info(SCOPE, ...args)
61
51
  console.debug = (...args) => log.debug(SCOPE, ...args)
@@ -73,17 +63,16 @@ async function alignSdkConsoleWithHost(hostWantsLogs) {
73
63
  }
74
64
  }
75
65
 
66
+ // lunte-disable-next-line qvac/no-default-export -- the stow entry calls this module's default
76
67
  export default async function start(ipc, ready) {
77
68
  let harness
78
69
  let dying = false
79
- // close() cancels in-flight SDK model loads (see Harness._close) so exit is not
80
- // parked behind a multi-GB load; a wedged native call still ends at the host's
81
- // kill deadline (bare-supervisor/stow reap)
70
+ // close() cancels in-flight SDK loads so exit is not parked; the host's kill deadline backstops
82
71
  const die = () => {
83
72
  if (dying) return
84
73
  dying = true
85
74
  Promise.resolve(harness?.close())
86
- .catch(() => {})
75
+ .catch(noop)
87
76
  .then(() => Bare.exit(0))
88
77
  }
89
78
  Bare.IPC.on('end', die).on('close', die)
@@ -92,9 +81,7 @@ export default async function start(ipc, ready) {
92
81
  const deniedRoots = deniedRootsFor(sdkStorage.home)
93
82
  const hostWantsLogs = Bare.argv[7] === '1'
94
83
  setHarnessLog(hostWantsLogs)
95
- // before the first await, so nothing logs ahead of the sink. The SDK home sits in
96
- // the storage root, which is where the host writes assistant.log — harness.log
97
- // belongs next to it.
84
+ // before the first await so nothing logs ahead of the sink; the host writes assistant.log beside it
98
85
  const log = openHarnessLog(join(dirname(sdkStorage.home), 'harness.log')) ?? DISCARD
99
86
  setHarnessLogSink((line) => log.info(SCOPE, line))
100
87
  captureConsole(log)
@@ -109,7 +96,9 @@ export default async function start(ipc, ready) {
109
96
  const musicClamps = Bare.argv[10] ? JSON.parse(Bare.argv[10]) : undefined
110
97
  const gpuStats = Bare.argv[12] ? JSON.parse(Bare.argv[12]) : undefined
111
98
  // Only the host knows where the shipped wheels landed.
112
- if (Bare.argv[11]) process.env.QVAC_PYTHON_WHEELS_DIR = Bare.argv[11]
99
+ if (Bare.argv[11]) {
100
+ process.env.QVAC_PYTHON_WHEELS_DIR = Bare.argv[11]
101
+ }
113
102
 
114
103
  configureSdkStorage(sdkStorage)
115
104
  process.env.QVAC_PYODIDE_CACHE_DIR = `${sdkStorage.home}/pyodide-cache`
@@ -148,14 +137,16 @@ export default async function start(ipc, ready) {
148
137
  if (skillCatalog) {
149
138
  tools.push(...compileOperationTools(skillCatalog, { httpRequestTool, mcpCallTool }))
150
139
  }
140
+
151
141
  if (skillsDir) {
152
142
  tools.push(
153
143
  createSkillTool({
154
144
  skillsDir,
155
- ...(credentialed ? { credentialStore: credentialed.credentialStore } : {})
145
+ credentialStore: credentialed?.credentialStore
156
146
  })
157
147
  )
158
148
  }
149
+
159
150
  harness = new Harness({
160
151
  gpuStats,
161
152
  tools,
@@ -180,3 +171,5 @@ export default async function start(ipc, ready) {
180
171
 
181
172
  return () => {}
182
173
  }
174
+
175
+ function noop() {}
@@ -1,6 +1,5 @@
1
1
  /* global Bare */
2
- // bare-stow's generated bundle shim (lib/shim.js) as a plain file, so the
3
- // sidecar can be spawned without stowing one.
2
+ // bare-stow's generated shim (lib/shim.js) as a plain file, so the sidecar spawns unstowed
4
3
  import '../dist-lib/lib/hardware/gpu-probe-entry.js'
5
4
  import protocol from 'bare-stow/protocol'
6
5
 
@@ -22,12 +21,16 @@ async function shutdown(code, err = null) {
22
21
  exited = true
23
22
 
24
23
  try {
25
- if (stop) await stop()
24
+ if (stop) {
25
+ await stop()
26
+ }
26
27
  } catch (e) {
27
28
  err = err || e
28
29
  }
29
30
 
30
- if (err) ipc.send('error', { message: err.message, stack: err.stack })
31
+ if (err) {
32
+ ipc.send('error', { message: err.message, stack: err.stack })
33
+ }
31
34
 
32
35
  await ipc.send('exit', { code })
33
36
 
@@ -1,47 +0,0 @@
1
- import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
2
- import type { ToolExecuteContext } from '../../capabilities/completion.ts';
3
- import { type FetchInit } from '../http-request/utils.ts';
4
- export declare const MCP_PROTOCOL_VERSION = "2025-03-26";
5
- export declare const TIMEOUT_MS = 30000;
6
- export type McpFetchFn = (url: URL, init: FetchInit) => Promise<{
7
- status: number;
8
- statusText?: string;
9
- headers: {
10
- get(name: string): string | null;
11
- };
12
- text(): Promise<string> | string;
13
- }>;
14
- export declare function isNotification(method: string): boolean;
15
- export declare function isMetadataMethod(method: unknown): boolean;
16
- export declare function normalizeMethod(method: string, params: Record<string, unknown> | undefined): {
17
- method: string;
18
- params: Record<string, unknown> | undefined;
19
- };
20
- export declare function flattenMcpResponse(body: string): {
21
- error: string;
22
- } | {
23
- body: string;
24
- };
25
- export declare function sessionKey(url: string, ctx: ToolExecuteContext | undefined, credentialKey?: string): string;
26
- export declare function getSession(key: string): string;
27
- export declare function deleteSession(key: string): void;
28
- export declare function cacheSession(key: string, sessionId: string): void;
29
- export declare function post(fetch: McpFetchFn, url: URL, method: string, params: Record<string, unknown> | undefined, authHeader: string | null, sessionId: string | undefined, signal: BareAbortSignal): Promise<{
30
- status: number;
31
- statusText?: string;
32
- headers: {
33
- get(name: string): string | null;
34
- };
35
- text(): Promise<string> | string;
36
- }>;
37
- export declare function readBody(response: {
38
- text(): Promise<string> | string;
39
- headers: {
40
- get(name: string): string | null;
41
- };
42
- }): Promise<string>;
43
- export declare function needsSession(status: number, cached: string): boolean;
44
- export declare function establishSession(fetch: McpFetchFn, url: URL, authHeader: string | null, signal: BareAbortSignal): Promise<string | {
45
- error: string;
46
- stateless?: true;
47
- }>;