@qvac/harness 0.3.3 → 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 (301) hide show
  1. package/CHANGELOG.md +700 -126
  2. package/README.md +156 -0
  3. package/dist/harness.bundle +71 -103
  4. package/dist/prebuilds-manifest.json +0 -8
  5. package/dist-lib/index.d.ts +42 -40
  6. package/dist-lib/index.js +307 -117
  7. package/dist-lib/lib/audio-transcode-bare.d.ts +2 -2
  8. package/dist-lib/lib/audio-transcode-bare.js +28 -18
  9. package/dist-lib/lib/audio-transcode-node.d.ts +2 -2
  10. package/dist-lib/lib/capabilities/audio-resample.d.ts +7 -6
  11. package/dist-lib/lib/capabilities/audio-resample.js +30 -18
  12. package/dist-lib/lib/capabilities/completion.d.ts +20 -19
  13. package/dist-lib/lib/capabilities/completion.js +194 -135
  14. package/dist-lib/lib/capabilities/download.d.ts +6 -6
  15. package/dist-lib/lib/capabilities/download.js +15 -8
  16. package/dist-lib/lib/capabilities/embed.js +2 -1
  17. package/dist-lib/lib/capabilities/enhance.d.ts +6 -1
  18. package/dist-lib/lib/capabilities/enhance.js +7 -4
  19. package/dist-lib/lib/capabilities/invoke.js +7 -4
  20. package/dist-lib/lib/capabilities/kv-cache.js +2 -1
  21. package/dist-lib/lib/capabilities/preview-model-source.d.ts +69 -0
  22. package/dist-lib/lib/capabilities/preview-model-source.js +439 -0
  23. package/dist-lib/lib/capabilities/speech-text.js +5 -4
  24. package/dist-lib/lib/capabilities/tool-selection.js +10 -9
  25. package/dist-lib/lib/capabilities/tool-turns.js +30 -16
  26. package/dist-lib/lib/capabilities/usage-breakdown.js +2 -1
  27. package/dist-lib/lib/capabilities/voice.d.ts +5 -1
  28. package/dist-lib/lib/capabilities/voice.js +22 -12
  29. package/dist-lib/lib/connect.d.ts +15 -37
  30. package/dist-lib/lib/connect.js +161 -112
  31. package/dist-lib/lib/context-window.js +25 -21
  32. package/dist-lib/lib/contract-types.d.ts +26 -20
  33. package/dist-lib/lib/diagram-repair.d.ts +4 -4
  34. package/dist-lib/lib/diagram-repair.js +6 -3
  35. package/dist-lib/lib/docx/index.d.ts +3 -2
  36. package/dist-lib/lib/{error-fields.d.ts → guards.d.ts} +1 -0
  37. package/dist-lib/lib/{error-fields.js → guards.js} +3 -0
  38. package/dist-lib/lib/hardware/capability-probe.js +20 -10
  39. package/dist-lib/lib/hardware/gpu-classify.js +6 -3
  40. package/dist-lib/lib/hardware/gpu-probe-addon.js +8 -4
  41. package/dist-lib/lib/hardware/gpu-probe.js +4 -2
  42. package/dist-lib/lib/hardware/gpu-stats.native.cjs +8 -9
  43. package/dist-lib/lib/hardware/parsers.js +8 -4
  44. package/dist-lib/lib/helpers/buffer-burst.js +4 -2
  45. package/dist-lib/lib/helpers/control-tokens.js +4 -2
  46. package/dist-lib/lib/helpers/join-guard.d.ts +2 -2
  47. package/dist-lib/lib/helpers/join-guard.js +4 -2
  48. package/dist-lib/lib/helpers/load-stall.js +4 -2
  49. package/dist-lib/lib/helpers/markup-stream-filter.d.ts +2 -2
  50. package/dist-lib/lib/helpers/markup-stream-filter.js +6 -3
  51. package/dist-lib/lib/helpers/race-abort.js +2 -1
  52. package/dist-lib/lib/helpers/race-timeout.d.ts +5 -0
  53. package/dist-lib/lib/helpers/race-timeout.js +14 -0
  54. package/dist-lib/lib/helpers/run-outcome.d.ts +6 -8
  55. package/dist-lib/lib/helpers/run-outcome.js +36 -20
  56. package/dist-lib/lib/helpers/spawn-path.js +6 -3
  57. package/dist-lib/lib/helpers/text-coalescer.js +6 -3
  58. package/dist-lib/lib/helpers/thinking.js +38 -45
  59. package/dist-lib/lib/helpers/tool-call-markup.d.ts +9 -7
  60. package/dist-lib/lib/helpers/tool-call-markup.js +36 -20
  61. package/dist-lib/lib/helpers/tool-intent.d.ts +3 -2
  62. package/dist-lib/lib/helpers/tool-intent.js +4 -2
  63. package/dist-lib/lib/helpers/tool-label.js +18 -9
  64. package/dist-lib/lib/hooks/built-in/arg-repair.js +23 -13
  65. package/dist-lib/lib/hooks/built-in/egress.js +2 -1
  66. package/dist-lib/lib/hooks/built-in/skill-catalog.js +2 -1
  67. package/dist-lib/lib/hooks/pipeline.d.ts +5 -4
  68. package/dist-lib/lib/hooks/pipeline.js +6 -3
  69. package/dist-lib/lib/hooks/run.js +12 -8
  70. package/dist-lib/lib/model-download-progress.js +10 -8
  71. package/dist-lib/lib/models/context.d.ts +1 -1
  72. package/dist-lib/lib/models/context.js +5 -1
  73. package/dist-lib/lib/models/custom-model-cache.d.ts +13 -0
  74. package/dist-lib/lib/models/custom-model-cache.js +70 -0
  75. package/dist-lib/lib/models/gguf-header.d.ts +31 -0
  76. package/dist-lib/lib/models/gguf-header.js +230 -0
  77. package/dist-lib/lib/models/idle-unload.d.ts +14 -0
  78. package/dist-lib/lib/models/idle-unload.js +51 -0
  79. package/dist-lib/lib/models/kv-cache.d.ts +3 -2
  80. package/dist-lib/lib/models/kv-cache.js +4 -3
  81. package/dist-lib/lib/models/llm-presets.d.ts +2 -2
  82. package/dist-lib/lib/models/llm-presets.js +4 -2
  83. package/dist-lib/lib/models/model-catalog-constants.js +3 -2
  84. package/dist-lib/lib/models/model-catalog.d.ts +19 -21
  85. package/dist-lib/lib/models/model-catalog.js +66 -33
  86. package/dist-lib/lib/models/model-delete.d.ts +4 -1
  87. package/dist-lib/lib/models/model-delete.js +30 -15
  88. package/dist-lib/lib/models/model-handle.js +2 -1
  89. package/dist-lib/lib/models/model-list.d.ts +14 -3
  90. package/dist-lib/lib/models/model-list.js +33 -6
  91. package/dist-lib/lib/models/model-pool.d.ts +44 -10
  92. package/dist-lib/lib/models/model-pool.js +47 -42
  93. package/dist-lib/lib/models/model-source.js +11 -6
  94. package/dist-lib/lib/models/music-catalog.d.ts +2 -2
  95. package/dist-lib/lib/models/nmt-catalog.d.ts +4 -3
  96. package/dist-lib/lib/models/nmt-catalog.js +10 -5
  97. package/dist-lib/lib/models/opencl-cache.d.ts +6 -1
  98. package/dist-lib/lib/models/opencl-cache.js +5 -3
  99. package/dist-lib/lib/models/sdk-faults.d.ts +11 -8
  100. package/dist-lib/lib/models/sdk-faults.js +9 -6
  101. package/dist-lib/lib/models/shards.d.ts +11 -0
  102. package/dist-lib/lib/models/shards.js +15 -0
  103. package/dist-lib/lib/models/tool-dialect.js +10 -5
  104. package/dist-lib/lib/no-redirect-fetch-bare.d.ts +3 -3
  105. package/dist-lib/lib/no-redirect-fetch-bare.js +1 -1
  106. package/dist-lib/lib/no-redirect-fetch-impl.js +6 -3
  107. package/dist-lib/lib/no-redirect-fetch-node.d.ts +1 -1
  108. package/dist-lib/lib/no-redirect-fetch-node.js +9 -9
  109. package/dist-lib/lib/office/index.d.ts +3 -2
  110. package/dist-lib/lib/office/python.d.ts +3 -2
  111. package/dist-lib/lib/office/python.js +2 -1
  112. package/dist-lib/lib/prompt.d.ts +5 -4
  113. package/dist-lib/lib/prompt.js +8 -4
  114. package/dist-lib/lib/queue.js +10 -5
  115. package/dist-lib/lib/resolution-detector.js +21 -11
  116. package/dist-lib/lib/rpc-session.js +2 -1
  117. package/dist-lib/lib/sdk-loader.js +2 -1
  118. package/dist-lib/lib/sdk-storage.js +4 -2
  119. package/dist-lib/lib/serve.js +128 -68
  120. package/dist-lib/lib/spawn.js +7 -4
  121. package/dist-lib/lib/tmp-path.d.ts +7 -6
  122. package/dist-lib/lib/tool-call-display.d.ts +2 -2
  123. package/dist-lib/lib/tools/create-documents.js +18 -10
  124. package/dist-lib/lib/tools/edit-documents.js +23 -13
  125. package/dist-lib/lib/tools/edit-image.d.ts +2 -2
  126. package/dist-lib/lib/tools/edit-image.js +60 -36
  127. package/dist-lib/lib/tools/exec/adapters/adapter.d.ts +10 -10
  128. package/dist-lib/lib/tools/exec/adapters/python/attachments.d.ts +17 -11
  129. package/dist-lib/lib/tools/exec/adapters/python/attachments.js +53 -40
  130. package/dist-lib/lib/tools/exec/adapters/python/create-effect.d.ts +2 -2
  131. package/dist-lib/lib/tools/exec/adapters/python/create-effect.js +60 -32
  132. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.d.ts +33 -22
  133. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.js +58 -29
  134. package/dist-lib/lib/tools/exec/adapters/python/interrupt-timer.d.ts +2 -2
  135. package/dist-lib/lib/tools/exec/adapters/python/loader.js +23 -12
  136. package/dist-lib/lib/tools/exec/adapters/python/memfs.d.ts +13 -11
  137. package/dist-lib/lib/tools/exec/adapters/python/memfs.js +10 -5
  138. package/dist-lib/lib/tools/exec/adapters/python/net-shim.js +3 -1
  139. package/dist-lib/lib/tools/exec/adapters/python/output-policy.d.ts +6 -4
  140. package/dist-lib/lib/tools/exec/adapters/python/output-policy.js +20 -10
  141. package/dist-lib/lib/tools/exec/adapters/python/pyodide.d.ts +2 -2
  142. package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +14 -7
  143. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.d.ts +41 -34
  144. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +316 -166
  145. package/dist-lib/lib/tools/exec/adapters/python/run-session.d.ts +9 -8
  146. package/dist-lib/lib/tools/exec/adapters/python/run-session.js +56 -28
  147. package/dist-lib/lib/tools/exec/adapters/python/wheels.d.ts +8 -10
  148. package/dist-lib/lib/tools/exec/adapters/python/wheels.js +22 -11
  149. package/dist-lib/lib/tools/exec/adapters/python/worker/client.d.ts +3 -2
  150. package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +41 -26
  151. package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +27 -18
  152. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.d.ts +2 -2
  153. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.js +14 -13
  154. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.d.ts +4 -4
  155. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.js +10 -5
  156. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.d.ts +4 -4
  157. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +2 -1
  158. package/dist-lib/lib/tools/exec/obsidian/cli-process.d.ts +6 -1
  159. package/dist-lib/lib/tools/exec/obsidian/cli-process.js +8 -5
  160. package/dist-lib/lib/tools/exec/obsidian/cli.d.ts +6 -6
  161. package/dist-lib/lib/tools/exec/obsidian/cli.js +4 -4
  162. package/dist-lib/lib/tools/exec/obsidian/command.d.ts +3 -2
  163. package/dist-lib/lib/tools/exec/obsidian/command.js +6 -3
  164. package/dist-lib/lib/tools/exec/obsidian/output.js +2 -1
  165. package/dist-lib/lib/tools/exec/obsidian/route.d.ts +4 -6
  166. package/dist-lib/lib/tools/exec/obsidian/route.js +17 -11
  167. package/dist-lib/lib/tools/exec/obsidian/safe-path.js +2 -1
  168. package/dist-lib/lib/tools/exec/obsidian/vault-create.js +15 -7
  169. package/dist-lib/lib/tools/exec/obsidian/vault-paths.d.ts +2 -2
  170. package/dist-lib/lib/tools/exec/obsidian/vault-paths.js +20 -10
  171. package/dist-lib/lib/tools/exec/obsidian/vault-read.js +20 -13
  172. package/dist-lib/lib/tools/exec/obsidian/vault-write.js +24 -12
  173. package/dist-lib/lib/tools/exec/runner.d.ts +14 -14
  174. package/dist-lib/lib/tools/exec/runner.js +5 -3
  175. package/dist-lib/lib/tools/exec/scope.js +52 -28
  176. package/dist-lib/lib/tools/exec/shell-argv.js +31 -18
  177. package/dist-lib/lib/tools/exec/shell-guidance.d.ts +6 -1
  178. package/dist-lib/lib/tools/exec/shell-guidance.js +35 -20
  179. package/dist-lib/lib/tools/exec/video-tools.js +2 -2
  180. package/dist-lib/lib/tools/exec.d.ts +6 -8
  181. package/dist-lib/lib/tools/exec.js +113 -54
  182. package/dist-lib/lib/tools/file-glob.d.ts +4 -5
  183. package/dist-lib/lib/tools/file-glob.js +16 -11
  184. package/dist-lib/lib/tools/fs/glob.js +13 -18
  185. package/dist-lib/lib/tools/fs/remote-protocol.d.ts +10 -10
  186. package/dist-lib/lib/tools/fs/remote.d.ts +3 -2
  187. package/dist-lib/lib/tools/fs/remote.js +13 -7
  188. package/dist-lib/lib/tools/fs/scope.d.ts +8 -3
  189. package/dist-lib/lib/tools/fs/scope.js +20 -12
  190. package/dist-lib/lib/tools/fs/walk.js +6 -3
  191. package/dist-lib/lib/tools/fs/write.d.ts +3 -2
  192. package/dist-lib/lib/tools/generate-image.d.ts +11 -9
  193. package/dist-lib/lib/tools/generate-image.js +73 -37
  194. package/dist-lib/lib/tools/generate-music.d.ts +22 -11
  195. package/dist-lib/lib/tools/generate-music.js +79 -48
  196. package/dist-lib/lib/tools/grep.js +66 -41
  197. package/dist-lib/lib/tools/http-request/encode-fields.js +18 -9
  198. package/dist-lib/lib/tools/http-request/{utils.js → request.js} +20 -11
  199. package/dist-lib/lib/tools/http-request/truncate-response.js +57 -46
  200. package/dist-lib/lib/tools/http-request.d.ts +1 -1
  201. package/dist-lib/lib/tools/http-request.js +33 -18
  202. package/dist-lib/lib/tools/mcp/protocol.d.ts +53 -0
  203. package/dist-lib/lib/tools/mcp/{utils.js → protocol.js} +45 -23
  204. package/dist-lib/lib/tools/mcp-call.d.ts +1 -1
  205. package/dist-lib/lib/tools/mcp-call.js +37 -16
  206. package/dist-lib/lib/tools/operations/builders.js +10 -6
  207. package/dist-lib/lib/tools/operations/compile.js +20 -10
  208. package/dist-lib/lib/tools/operations/decoders.js +12 -6
  209. package/dist-lib/lib/tools/operations/gmail-message.js +3 -2
  210. package/dist-lib/lib/tools/outbound-guard.d.ts +4 -3
  211. package/dist-lib/lib/tools/outbound-guard.js +14 -8
  212. package/dist-lib/lib/tools/private-ip.js +8 -7
  213. package/dist-lib/lib/tools/rag-search.js +14 -7
  214. package/dist-lib/lib/tools/read-files.js +23 -20
  215. package/dist-lib/lib/tools/skill.js +19 -10
  216. package/dist-lib/lib/tools/skills/auth-resolver.d.ts +11 -18
  217. package/dist-lib/lib/tools/skills/auth-resolver.js +30 -18
  218. package/dist-lib/lib/tools/skills/bin-check.d.ts +3 -2
  219. package/dist-lib/lib/tools/skills/bin-check.js +10 -3
  220. package/dist-lib/lib/tools/skills/bundled-dir.js +20 -10
  221. package/dist-lib/lib/tools/skills/bundled-hash.d.ts +3 -2
  222. package/dist-lib/lib/tools/skills/bundled-hash.js +6 -1
  223. package/dist-lib/lib/tools/skills/catalog.d.ts +3 -2
  224. package/dist-lib/lib/tools/skills/catalog.js +33 -28
  225. package/dist-lib/lib/tools/skills/cli-argv.d.ts +3 -2
  226. package/dist-lib/lib/tools/skills/cli-argv.js +55 -52
  227. package/dist-lib/lib/tools/skills/cli-schema-check.js +21 -10
  228. package/dist-lib/lib/tools/skills/cli-schema-load.js +28 -20
  229. package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +6 -6
  230. package/dist-lib/lib/tools/skills/cli-schema.js +2 -1
  231. package/dist-lib/lib/tools/skills/credential-check.d.ts +6 -3
  232. package/dist-lib/lib/tools/skills/credential-check.js +24 -12
  233. package/dist-lib/lib/tools/skills/credential-grants.js +1 -6
  234. package/dist-lib/lib/tools/skills/credential-health.d.ts +5 -1
  235. package/dist-lib/lib/tools/skills/credential-health.js +5 -3
  236. package/dist-lib/lib/tools/skills/frontmatter-parser.js +10 -5
  237. package/dist-lib/lib/tools/skills/manifest-parse.js +84 -64
  238. package/dist-lib/lib/tools/skills/mention.js +7 -6
  239. package/dist-lib/lib/tools/skills/obsidian-readiness.d.ts +2 -2
  240. package/dist-lib/lib/tools/skills/obsidian-readiness.js +11 -3
  241. package/dist-lib/lib/tools/skills/overlay-crud.d.ts +6 -4
  242. package/dist-lib/lib/tools/skills/overlay-crud.js +12 -6
  243. package/dist-lib/lib/tools/skills/overlay-dir.js +4 -2
  244. package/dist-lib/lib/tools/skills/overlay-watch.d.ts +3 -2
  245. package/dist-lib/lib/tools/skills/overlay-watch.js +8 -4
  246. package/dist-lib/lib/tools/skills/setup-routes.js +1 -3
  247. package/dist-lib/lib/tools/skills/skill-settings.js +4 -1
  248. package/dist-lib/lib/tools/skills/skill-state.d.ts +6 -11
  249. package/dist-lib/lib/tools/skills/skill-state.js +48 -29
  250. package/dist-lib/lib/tools/skills/tool-grants.js +6 -3
  251. package/dist-lib/lib/tools/toolsets.js +2 -1
  252. package/dist-lib/lib/tools/translate.d.ts +4 -5
  253. package/dist-lib/lib/tools/translate.js +31 -14
  254. package/dist-lib/lib/tools/url-guard.js +2 -1
  255. package/dist-lib/lib/tools/weather-lookup/place.js +8 -4
  256. package/dist-lib/lib/tools/weather-lookup/report.d.ts +7 -1
  257. package/dist-lib/lib/tools/weather-lookup/report.js +46 -9
  258. package/dist-lib/lib/tools/weather-lookup.js +18 -12
  259. package/dist-lib/lib/tools/web-fetch.js +47 -24
  260. package/dist-lib/lib/tools/web-search.js +8 -3
  261. package/dist-lib/lib/validating-lookup.d.ts +4 -4
  262. package/dist-lib/lib/wav-encode.d.ts +1 -1
  263. package/dist-lib/lib/wav-encode.js +11 -10
  264. package/dist-lib/lib/web-fetch/embedded-state.js +24 -12
  265. package/dist-lib/lib/web-fetch/extract.js +4 -2
  266. package/dist-lib/lib/web-fetch/images.js +8 -4
  267. package/dist-lib/lib/web-fetch/video.d.ts +2 -2
  268. package/dist-lib/lib/web-fetch/video.js +8 -4
  269. package/dist-lib/lib/web-search/engine-registry.d.ts +2 -2
  270. package/dist-lib/lib/web-search/engines/aol.js +1 -1
  271. package/dist-lib/lib/web-search/engines/bing.js +1 -1
  272. package/dist-lib/lib/web-search/engines/brave.js +4 -1
  273. package/dist-lib/lib/web-search/engines/duckduckgo.js +3 -2
  274. package/dist-lib/lib/web-search/engines/google.js +7 -3
  275. package/dist-lib/lib/web-search/engines/wikipedia.js +5 -4
  276. package/dist-lib/lib/web-search/engines/yahoo.js +1 -1
  277. package/dist-lib/lib/web-search/fetch-html.d.ts +5 -4
  278. package/dist-lib/lib/web-search/fetch-html.js +13 -7
  279. package/dist-lib/lib/web-search/orchestrator.d.ts +9 -5
  280. package/dist-lib/lib/web-search/orchestrator.js +3 -3
  281. package/dist-lib/lib/wire.d.ts +3 -2
  282. package/dist-lib/lib/wire.js +23 -15
  283. package/dist-lib/schema/baseline.js +10 -5
  284. package/dist-lib/schema/build.js +2 -1
  285. package/dist-lib/schema/harness.d.ts +15 -2
  286. package/dist-lib/schema/harness.js +55 -2
  287. package/dist-lib/schema/release-tags.d.ts +3 -2
  288. package/dist-lib/schema/release-tags.js +6 -3
  289. package/dist-lib/spec/bind.js +6 -0
  290. package/dist-lib/spec/calls.js +2 -0
  291. package/dist-lib/spec/hrpc/hrpc.json +26 -0
  292. package/dist-lib/spec/hrpc/index.js +27 -3
  293. package/dist-lib/spec/hrpc/messages.js +207 -8
  294. package/dist-lib/spec/hyperschema/index.js +207 -8
  295. package/dist-lib/spec/hyperschema/schema.json +165 -1
  296. package/dist-lib/spec/hyperschema/types.d.ts +42 -1
  297. package/package.json +13 -14
  298. package/worker/harness-sidecar.mjs +16 -22
  299. package/worker/stow-entry.mjs +7 -4
  300. package/dist-lib/lib/tools/mcp/utils.d.ts +0 -47
  301. /package/dist-lib/lib/tools/http-request/{utils.d.ts → request.d.ts} +0 -0
@@ -1,48 +1,55 @@
1
+ import { isRecord } from '../../guards.js';
1
2
  export function parseManifestBlock(block, key = 'metadata') {
2
3
  const json = extractJsonBlock(block, key);
3
- if (!isObj(json) || !isObj(json.openclaw))
4
+ if (!isObj(json) || !isObj(json.openclaw)) {
4
5
  return {};
6
+ }
5
7
  const oc = json.openclaw;
6
8
  const requires = readRequires(oc.requires);
7
9
  const install = readInstall(oc.install);
8
10
  const setup = readSetup(oc.setup);
9
11
  return {
10
- ...(requires ? { requires } : {}),
11
- ...(install ? { install } : {}),
12
- ...(setup ? { setup } : {}),
13
- ...(typeof oc.stub === 'boolean' ? { stub: oc.stub } : {}),
14
- ...(typeof oc.minCapabilityProfile === 'string'
15
- ? { minCapabilityProfile: oc.minCapabilityProfile }
16
- : {}),
17
- ...(typeof oc.emoji === 'string' ? { emoji: oc.emoji } : {})
12
+ requires,
13
+ install,
14
+ setup,
15
+ stub: typeof oc.stub === 'boolean' ? oc.stub : undefined,
16
+ minCapabilityProfile: typeof oc.minCapabilityProfile === 'string' ? oc.minCapabilityProfile : undefined,
17
+ emoji: typeof oc.emoji === 'string' ? oc.emoji : undefined
18
18
  };
19
19
  }
20
20
  function extractJsonBlock(block, key) {
21
21
  const at = block.indexOf(`${key}:`);
22
- if (at === -1)
22
+ if (at === -1) {
23
23
  return null;
24
+ }
24
25
  const rest = block.slice(at + key.length + 1);
25
26
  const start = rest.indexOf('{');
26
- if (start === -1)
27
+ if (start === -1) {
27
28
  return null;
29
+ }
28
30
  let depth = 0;
29
31
  let inString = false;
30
32
  let escaped = false;
31
33
  for (let i = start; i < rest.length; i++) {
32
34
  const ch = rest[i];
33
35
  if (inString) {
34
- if (escaped)
36
+ if (escaped) {
35
37
  escaped = false;
36
- else if (ch === '\\')
38
+ }
39
+ else if (ch === '\\') {
37
40
  escaped = true;
38
- else if (ch === '"')
41
+ }
42
+ else if (ch === '"') {
39
43
  inString = false;
44
+ }
40
45
  continue;
41
46
  }
42
- if (ch === '"')
47
+ if (ch === '"') {
43
48
  inString = true;
44
- else if (ch === '{')
49
+ }
50
+ else if (ch === '{') {
45
51
  depth++;
52
+ }
46
53
  else if (ch === '}' && --depth === 0) {
47
54
  try {
48
55
  return JSON.parse(rest.slice(start, i + 1));
@@ -54,8 +61,13 @@ function extractJsonBlock(block, key) {
54
61
  }
55
62
  return null;
56
63
  }
64
+ function verifyBody(body) {
65
+ if (typeof body === 'string')
66
+ return body;
67
+ return isObj(body) ? JSON.stringify(body) : undefined;
68
+ }
57
69
  function isObj(v) {
58
- return typeof v === 'object' && v !== null && !Array.isArray(v);
70
+ return isRecord(v) && !Array.isArray(v);
59
71
  }
60
72
  function strArr(v) {
61
73
  if (!Array.isArray(v))
@@ -71,10 +83,10 @@ function readRequires(v) {
71
83
  const credentialChecks = readCredentialChecks(v.credentialChecks);
72
84
  return bins || mins || credentials || credentialChecks
73
85
  ? {
74
- ...(bins ? { bins } : {}),
75
- ...(mins ? { binMinVersions: mins } : {}),
76
- ...(credentials ? { credentials } : {}),
77
- ...(credentialChecks ? { credentialChecks } : {})
86
+ bins,
87
+ binMinVersions: mins,
88
+ credentials,
89
+ credentialChecks
78
90
  }
79
91
  : undefined;
80
92
  }
@@ -87,7 +99,7 @@ function readBinMinVersions(v) {
87
99
  continue;
88
100
  out[bin] = {
89
101
  min: spec.min,
90
- ...(typeof spec.command === 'string' ? { command: spec.command } : {})
102
+ command: typeof spec.command === 'string' ? spec.command : undefined
91
103
  };
92
104
  }
93
105
  return Object.keys(out).length > 0 ? out : undefined;
@@ -102,8 +114,8 @@ function readCredentialChecks(v) {
102
114
  const headers = readStringRecord(check.headers);
103
115
  out[key] = {
104
116
  url: check.url,
105
- ...(typeof check.method === 'string' ? { method: check.method } : {}),
106
- ...(headers && Object.keys(headers).length > 0 ? { headers } : {})
117
+ method: typeof check.method === 'string' ? check.method : undefined,
118
+ headers
107
119
  };
108
120
  }
109
121
  return Object.keys(out).length > 0 ? out : undefined;
@@ -113,8 +125,9 @@ function readStringRecord(v) {
113
125
  return undefined;
114
126
  const out = {};
115
127
  for (const [key, value] of Object.entries(v)) {
116
- if (typeof value === 'string')
128
+ if (typeof value === 'string') {
117
129
  out[key] = value;
130
+ }
118
131
  }
119
132
  return Object.keys(out).length > 0 ? out : undefined;
120
133
  }
@@ -134,10 +147,10 @@ export function readInstall(v) {
134
147
  id: raw.id,
135
148
  kind: raw.kind,
136
149
  label: raw.label,
137
- ...(typeof raw.formula === 'string' ? { formula: raw.formula } : {}),
138
- ...(bins ? { bins } : {}),
139
- ...(typeof raw.command === 'string' ? { command: raw.command } : {}),
140
- ...(typeof raw.manual === 'boolean' ? { manual: raw.manual } : {})
150
+ formula: typeof raw.formula === 'string' ? raw.formula : undefined,
151
+ bins,
152
+ command: typeof raw.command === 'string' ? raw.command : undefined,
153
+ manual: typeof raw.manual === 'boolean' ? raw.manual : undefined
141
154
  });
142
155
  }
143
156
  return steps.length > 0 ? steps : undefined;
@@ -151,35 +164,35 @@ export function readSetup(v) {
151
164
  return undefined;
152
165
  const summary = typeof v.summary === 'string' ? v.summary : undefined;
153
166
  const routes = readRoutes(v.routes);
154
- return summary || routes
155
- ? { ...(summary ? { summary } : {}), ...(routes ? { routes } : {}) }
156
- : undefined;
167
+ return summary || routes ? { summary: summary || undefined, routes } : undefined;
157
168
  }
158
169
  function readRoutes(v) {
159
170
  if (!Array.isArray(v))
160
171
  return undefined;
161
172
  const routes = [];
162
173
  for (const raw of v) {
163
- if (!isObj(raw) || !isRouteKind(raw.kind) || typeof raw.label !== 'string')
174
+ if (!isObj(raw) || !isRouteKind(raw.kind) || typeof raw.label !== 'string') {
164
175
  continue;
176
+ }
165
177
  const steps = strArr(raw.steps);
166
178
  const configSteps = strArr(raw.configSteps);
167
179
  const fields = readFields(raw.fields);
168
180
  const oauth = readOAuth(raw.oauth);
169
- if (raw.kind === 'oauth' && !oauth)
181
+ if (raw.kind === 'oauth' && !oauth) {
170
182
  continue;
183
+ }
171
184
  routes.push({
172
185
  kind: raw.kind,
173
186
  label: raw.label,
174
- ...(typeof raw.provider === 'string' ? { provider: raw.provider } : {}),
175
- ...(typeof raw.credentialKey === 'string' ? { credentialKey: raw.credentialKey } : {}),
176
- ...(typeof raw.description === 'string' ? { description: raw.description } : {}),
177
- ...(typeof raw.helpUrl === 'string' ? { helpUrl: raw.helpUrl } : {}),
178
- ...(steps ? { steps } : {}),
179
- ...(configSteps ? { configSteps } : {}),
180
- ...(fields ? { fields } : {}),
181
- ...(typeof raw.satisfied === 'boolean' ? { satisfied: raw.satisfied } : {}),
182
- ...(oauth ? { oauth } : {})
187
+ provider: typeof raw.provider === 'string' ? raw.provider : undefined,
188
+ credentialKey: typeof raw.credentialKey === 'string' ? raw.credentialKey : undefined,
189
+ description: typeof raw.description === 'string' ? raw.description : undefined,
190
+ helpUrl: typeof raw.helpUrl === 'string' ? raw.helpUrl : undefined,
191
+ steps,
192
+ configSteps,
193
+ fields,
194
+ satisfied: typeof raw.satisfied === 'boolean' ? raw.satisfied : undefined,
195
+ oauth
183
196
  });
184
197
  }
185
198
  return routes.length > 0 ? routes : undefined;
@@ -218,8 +231,9 @@ function readAuthParams(v) {
218
231
  : []))
219
232
  : v;
220
233
  const record = readStringRecord(raw);
221
- if (!record)
234
+ if (!record) {
222
235
  return undefined;
236
+ }
223
237
  const out = Object.fromEntries(Object.entries(record).filter(([key]) => !OAUTH_RESERVED_PARAMS.has(key)));
224
238
  return Object.keys(out).length > 0 ? out : undefined;
225
239
  }
@@ -228,38 +242,42 @@ function siteOf(url) {
228
242
  return new URL(url).hostname.split('.').slice(-2).join('.');
229
243
  }
230
244
  function readVerifyRule(v) {
231
- if (!isObj(v) || typeof v.error !== 'string' || !OAUTH_ERROR_CODE.test(v.error))
245
+ if (!isObj(v) || typeof v.error !== 'string' || !OAUTH_ERROR_CODE.test(v.error)) {
232
246
  return undefined;
247
+ }
233
248
  const status = Array.isArray(v.status)
234
249
  ? v.status.filter((s) => Number.isInteger(s) && s >= 100 && s < 600)
235
250
  : [];
236
251
  const field = typeof v.field === 'string' && v.field.length > 0 ? v.field : undefined;
237
- if (status.length === 0 && !field)
252
+ if (status.length === 0 && !field) {
238
253
  return undefined;
254
+ }
239
255
  return {
240
256
  error: v.error,
241
- ...(status.length > 0 ? { status } : {}),
242
- ...(field ? { field } : {}),
243
- ...(field && typeof v.notEqual === 'string' ? { notEqual: v.notEqual } : {})
257
+ status: status.length > 0 ? status : undefined,
258
+ field,
259
+ notEqual: field && typeof v.notEqual === 'string' ? v.notEqual : undefined
244
260
  };
245
261
  }
246
262
  function readVerify(v, tokenUrl) {
247
263
  if (!isObj(v))
248
264
  return undefined;
249
265
  const url = httpsUrl(v.url);
250
- if (!url || siteOf(url) !== siteOf(tokenUrl))
266
+ if (!url || siteOf(url) !== siteOf(tokenUrl)) {
251
267
  return undefined;
268
+ }
252
269
  if (v.method !== undefined && v.method !== null && v.method !== 'GET' && v.method !== 'POST') {
253
270
  return undefined;
254
271
  }
255
272
  const reject = Array.isArray(v.reject) ? v.reject.flatMap((r) => readVerifyRule(r) ?? []) : [];
256
- if (reject.length === 0)
273
+ if (reject.length === 0) {
257
274
  return undefined;
258
- const body = typeof v.body === 'string' ? v.body : isObj(v.body) ? JSON.stringify(v.body) : undefined;
275
+ }
276
+ const body = verifyBody(v.body);
259
277
  return {
260
278
  url,
261
- ...(v.method === 'GET' || v.method === 'POST' ? { method: v.method } : {}),
262
- ...(body !== undefined ? { body } : {}),
279
+ method: v.method === 'GET' || v.method === 'POST' ? v.method : undefined,
280
+ body,
263
281
  reject
264
282
  };
265
283
  }
@@ -276,8 +294,9 @@ function readOAuth(v) {
276
294
  return undefined;
277
295
  }
278
296
  const scopes = v.scopes === undefined || v.scopes === null ? [] : strArr(v.scopes);
279
- if (!scopes)
297
+ if (!scopes) {
280
298
  return undefined;
299
+ }
281
300
  const extraAuthParams = readAuthParams(v.extraAuthParams);
282
301
  const registrationEndpoint = httpsUrl(v.registrationEndpoint);
283
302
  const verify = readVerify(v.verify, tokenUrl);
@@ -287,11 +306,11 @@ function readOAuth(v) {
287
306
  tokenUrl,
288
307
  scopes,
289
308
  tokenAuth: v.tokenAuth,
290
- ...(extraAuthParams ? { extraAuthParams } : {}),
291
- ...(registrationEndpoint ? { registrationEndpoint } : {}),
292
- ...(isPort(v.port) ? { port: v.port } : {}),
293
- ...(typeof v.sharedIosSession === 'boolean' ? { sharedIosSession: v.sharedIosSession } : {}),
294
- ...(verify ? { verify } : {})
309
+ extraAuthParams,
310
+ registrationEndpoint,
311
+ port: isPort(v.port) ? v.port : undefined,
312
+ sharedIosSession: typeof v.sharedIosSession === 'boolean' ? v.sharedIosSession : undefined,
313
+ verify
295
314
  };
296
315
  }
297
316
  export function toWireSetup(setup) {
@@ -318,14 +337,15 @@ function readFields(v) {
318
337
  return undefined;
319
338
  const fields = [];
320
339
  for (const raw of v) {
321
- if (!isObj(raw) || typeof raw.key !== 'string' || typeof raw.label !== 'string')
340
+ if (!isObj(raw) || typeof raw.key !== 'string' || typeof raw.label !== 'string') {
322
341
  continue;
342
+ }
323
343
  fields.push({
324
344
  key: raw.key,
325
345
  label: raw.label,
326
- ...(typeof raw.placeholder === 'string' ? { placeholder: raw.placeholder } : {}),
327
- ...(typeof raw.secret === 'boolean' ? { secret: raw.secret } : {}),
328
- ...(typeof raw.required === 'boolean' ? { required: raw.required } : {})
346
+ placeholder: typeof raw.placeholder === 'string' ? raw.placeholder : undefined,
347
+ secret: typeof raw.secret === 'boolean' ? raw.secret : undefined,
348
+ required: typeof raw.required === 'boolean' ? raw.required : undefined
329
349
  });
330
350
  }
331
351
  return fields.length > 0 ? fields : undefined;
@@ -3,8 +3,9 @@ import { skillMentionName } from './mention-name.js';
3
3
  export { skillMentionName };
4
4
  export function resolveSkillMention(text, catalog) {
5
5
  const name = skillMentionName(text);
6
- if (!name)
6
+ if (!name) {
7
7
  return null;
8
+ }
8
9
  return catalog.find((skill) => skill.name.toLowerCase() === name) ?? null;
9
10
  }
10
11
  const MIN_IMPLICIT_NAME_LENGTH = 4;
@@ -19,15 +20,15 @@ export function resolveImplicitSkill(text, activeSkills) {
19
20
  let best = null;
20
21
  let bestLength = 0;
21
22
  for (const skill of activeSkills) {
22
- const names = skill.preloadOnName === false
23
- ? (skill.aliases ?? [])
24
- : [skill.name, ...(skill.aliases ?? [])];
23
+ const names = skill.preloadOnName === false ? (skill.aliases ?? []) : [skill.name, ...(skill.aliases ?? [])];
25
24
  for (const word of names) {
26
25
  const candidate = word.toLowerCase();
27
- if (candidate.length < MIN_IMPLICIT_NAME_LENGTH)
26
+ if (candidate.length < MIN_IMPLICIT_NAME_LENGTH) {
28
27
  continue;
29
- if (!matchesName(text, candidate))
28
+ }
29
+ if (!matchesName(text, candidate)) {
30
30
  continue;
31
+ }
31
32
  const weight = candidate.replace(/\+/g, '').length;
32
33
  if (weight > bestLength) {
33
34
  best = skill;
@@ -4,11 +4,11 @@ export declare const OBSIDIAN_BIN_CANDIDATES: Readonly<Record<string, readonly s
4
4
  export declare const OBSIDIAN_CONFIG_CANDIDATES: Readonly<Record<string, readonly string[]>>;
5
5
  export declare function expandObsidianPath(candidate: string, env?: Record<string, string | undefined>, home?: string): string;
6
6
  export declare function firstExistingPath(candidates: readonly string[], expand: (candidate: string) => string, exists: (candidate: string) => boolean): string | null;
7
- export type ObsidianPathProbe = {
7
+ export interface ObsidianPathProbe {
8
8
  expand?: (candidate: string) => string;
9
9
  exists?: (candidate: string) => boolean;
10
10
  readText?: (candidate: string) => string;
11
- };
11
+ }
12
12
  export declare function obsidianInstallState(platform: string | undefined, probe?: ObsidianPathProbe): 'installed' | 'missing';
13
13
  export declare function parseObsidianCliEnabled(text: string): boolean | null;
14
14
  export declare function obsidianCliState(platform: string | undefined, probe?: ObsidianPathProbe): 'enabled' | 'disabled' | 'unknown';
@@ -43,8 +43,9 @@ export function expandObsidianPath(candidate, env = environment(), home = homedi
43
43
  export function firstExistingPath(candidates, expand, exists) {
44
44
  for (const candidate of candidates) {
45
45
  const expanded = expand(candidate);
46
- if (expanded && exists(expanded))
46
+ if (expanded && exists(expanded)) {
47
47
  return expanded;
48
+ }
48
49
  }
49
50
  return null;
50
51
  }
@@ -57,6 +58,9 @@ export function obsidianInstallState(platform, probe = {}) {
57
58
  export function parseObsidianCliEnabled(text) {
58
59
  try {
59
60
  const value = JSON.parse(text);
61
+ if (typeof value !== 'object' || value === null || !('cli' in value)) {
62
+ return null;
63
+ }
60
64
  return typeof value.cli === 'boolean' ? value.cli : null;
61
65
  }
62
66
  catch {
@@ -68,11 +72,15 @@ export function obsidianCliState(platform, probe = {}) {
68
72
  const exists = probe.exists ?? ((candidate) => fs.existsSync(candidate));
69
73
  const readText = probe.readText ?? ((candidate) => fs.readFileSync(candidate, 'utf8'));
70
74
  const config = firstExistingPath(OBSIDIAN_CONFIG_CANDIDATES[platform ?? ''] ?? [], expand, exists);
71
- if (!config)
75
+ if (!config) {
72
76
  return 'unknown';
77
+ }
73
78
  try {
74
79
  const enabled = parseObsidianCliEnabled(readText(config));
75
- return enabled === null ? 'unknown' : enabled ? 'enabled' : 'disabled';
80
+ if (enabled === null) {
81
+ return 'unknown';
82
+ }
83
+ return enabled ? 'enabled' : 'disabled';
76
84
  }
77
85
  catch {
78
86
  return 'unknown';
@@ -10,9 +10,11 @@ export interface SkillFileContent {
10
10
  export declare function listManagedSkills(baseDir: string, overlayDir: string | null): Promise<ManagedSkill[]>;
11
11
  export declare function readSkillFile(baseDir: string, overlayDir: string | null, name: string): Promise<SkillFileContent | null>;
12
12
  export declare function writeSkillFile(overlayDir: string, name: string, content: string): Promise<string>;
13
- export declare function copyBaseForEdit(baseDir: string, overlayDir: string, name: string): Promise<{
13
+ export interface CopyBaseResult {
14
14
  copied: boolean;
15
- }>;
16
- export declare function deleteOverlaySkill(overlayDir: string, name: string): Promise<{
15
+ }
16
+ export declare function copyBaseForEdit(baseDir: string, overlayDir: string, name: string): Promise<CopyBaseResult>;
17
+ export interface DeleteOverlayResult {
17
18
  removed: boolean;
18
- }>;
19
+ }
20
+ export declare function deleteOverlaySkill(overlayDir: string, name: string): Promise<DeleteOverlayResult>;
@@ -41,8 +41,9 @@ export async function readSkillFile(baseDir, overlayDir, name) {
41
41
  assertSafeName(name);
42
42
  if (overlayDir) {
43
43
  const over = await readIfPresent(path.join(overlayDir, name, 'SKILL.md'));
44
- if (over !== null)
44
+ if (over !== null) {
45
45
  return { content: over, origin: 'overlay' };
46
+ }
46
47
  }
47
48
  const base = await readIfPresent(path.join(baseDir, name, 'SKILL.md'));
48
49
  return base !== null ? { content: base, origin: 'base' } : null;
@@ -60,19 +61,22 @@ export async function writeSkillFile(overlayDir, name, content) {
60
61
  export async function copyBaseForEdit(baseDir, overlayDir, name) {
61
62
  assertSafeName(name);
62
63
  const dest = path.join(overlayDir, name);
63
- if (await exists(dest))
64
+ if (await exists(dest)) {
64
65
  return { copied: false };
66
+ }
65
67
  const src = path.join(baseDir, name);
66
- if (!(await exists(src)))
68
+ if (!(await exists(src))) {
67
69
  throw new Error(`skill not found: ${name}`);
70
+ }
68
71
  await copyDir(src, dest);
69
72
  return { copied: true };
70
73
  }
71
74
  export async function deleteOverlaySkill(overlayDir, name) {
72
75
  assertSafeName(name);
73
76
  const dir = path.join(overlayDir, name);
74
- if (!(await exists(dir)))
77
+ if (!(await exists(dir))) {
75
78
  return { removed: false };
79
+ }
76
80
  await fs.promises.rm(dir, { recursive: true, force: true });
77
81
  return { removed: true };
78
82
  }
@@ -90,9 +94,11 @@ async function copyDir(src, dest) {
90
94
  for (const entry of await fs.promises.readdir(src, { withFileTypes: true })) {
91
95
  const from = path.join(src, entry.name);
92
96
  const to = path.join(dest, entry.name);
93
- if (entry.isDirectory())
97
+ if (entry.isDirectory()) {
94
98
  await copyDir(from, to);
95
- else if (entry.isFile())
99
+ }
100
+ else if (entry.isFile()) {
96
101
  await fs.promises.writeFile(to, await fs.promises.readFile(from));
102
+ }
97
103
  }
98
104
  }
@@ -6,8 +6,9 @@ const SDK_CONFIG_PATH_ENV = 'QVAC_CONFIG_PATH';
6
6
  const OVERLAY_DIR_NAME = 'skills';
7
7
  export function resolveSkillsOverlayDir(env = process.env) {
8
8
  const configPath = env[SDK_CONFIG_PATH_ENV];
9
- if (!configPath)
9
+ if (!configPath) {
10
10
  return null;
11
+ }
11
12
  return path.join(path.dirname(configPath), OVERLAY_DIR_NAME);
12
13
  }
13
14
  export function ensureSkillsOverlayDir(env = process.env) {
@@ -16,7 +17,8 @@ export function ensureSkillsOverlayDir(env = process.env) {
16
17
  }
17
18
  async function materialize(dir) {
18
19
  await fs.promises.mkdir(dir, { recursive: true });
19
- if (os.platform() !== 'win32')
20
+ if (os.platform() !== 'win32') {
20
21
  await fs.promises.chmod(dir, 0o700);
22
+ }
21
23
  return dir;
22
24
  }
@@ -7,7 +7,8 @@ export type OverlayChangeStream = AsyncIterable<{
7
7
  destroy?: () => void;
8
8
  };
9
9
  export type WatchStreamFactory = (overlayDir: string) => OverlayChangeStream;
10
- export declare function watchSkillsOverlay(overlayDir: string, onChange: () => void, opts?: {
10
+ export interface WatchSkillsOverlayOptions {
11
11
  debounceMs?: number;
12
12
  createStream?: WatchStreamFactory;
13
- }): OverlayWatcher;
13
+ }
14
+ export declare function watchSkillsOverlay(overlayDir: string, onChange: () => void, opts?: WatchSkillsOverlayOptions): OverlayWatcher;
@@ -9,19 +9,22 @@ export function watchSkillsOverlay(overlayDir, onChange, opts = {}) {
9
9
  const schedule = () => {
10
10
  if (stopped)
11
11
  return;
12
- if (timer)
12
+ if (timer) {
13
13
  clearTimeout(timer);
14
+ }
14
15
  timer = setTimeout(() => {
15
16
  timer = null;
16
- if (!stopped)
17
+ if (!stopped) {
17
18
  onChange();
19
+ }
18
20
  }, debounceMs);
19
21
  };
20
22
  void (async () => {
21
23
  try {
22
24
  for await (const batch of stream) {
23
- if (batch?.diff && batch.diff.length > 0)
25
+ if (batch?.diff && batch.diff.length > 0) {
24
26
  schedule();
27
+ }
25
28
  }
26
29
  }
27
30
  catch {
@@ -32,8 +35,9 @@ export function watchSkillsOverlay(overlayDir, onChange, opts = {}) {
32
35
  if (stopped)
33
36
  return;
34
37
  stopped = true;
35
- if (timer)
38
+ if (timer) {
36
39
  clearTimeout(timer);
40
+ }
37
41
  timer = null;
38
42
  stream.destroy?.();
39
43
  }
@@ -4,9 +4,7 @@ export function deriveSetup(entry, state) {
4
4
  return undefined;
5
5
  return {
6
6
  ...entry.setup,
7
- ...(entry.setup.routes
8
- ? { routes: entry.setup.routes.map((route) => withSatisfied(route, state)) }
9
- : {})
7
+ routes: entry.setup.routes?.map((route) => withSatisfied(route, state))
10
8
  };
11
9
  }
12
10
  function withSatisfied(route, state) {
@@ -19,7 +19,10 @@ function envToken(value) {
19
19
  return value.toUpperCase().replace(/[^A-Z0-9]/g, '_');
20
20
  }
21
21
  function settingKeyToken(value) {
22
- return value.toUpperCase().replace(/-/g, '_H_').replace(/[^A-Z0-9_]/g, '_');
22
+ return value
23
+ .toUpperCase()
24
+ .replace(/-/g, '_H_')
25
+ .replace(/[^A-Z0-9_]/g, '_');
23
26
  }
24
27
  export function settingsEnv(skill, settings) {
25
28
  const env = {};
@@ -25,16 +25,11 @@ export interface SkillStateInputs {
25
25
  readonly obsidianProbe?: ObsidianPathProbe;
26
26
  readonly binOnPath?: (bin: string, platform?: string) => boolean;
27
27
  }
28
- export declare function isStub(entry: {
29
- readonly stub?: boolean;
30
- }): boolean;
31
- export declare function isToolSupported(entry: {
28
+ export declare function isStub(entry: Pick<SkillStateEntry, 'stub'>): boolean;
29
+ export interface SkillToolsEntry {
32
30
  readonly tools: readonly string[];
33
- }, installedTools: ReadonlySet<string>): boolean;
34
- export declare function supportsPlatform(entry: {
35
- readonly platform: readonly string[];
36
- }, platform: string | undefined): boolean;
37
- export declare function isModelCompatible(entry: {
38
- readonly minCapabilityProfile?: string;
39
- }, activeProfile: CapabilityProfile | undefined): boolean;
31
+ }
32
+ export declare function isToolSupported(entry: SkillToolsEntry, installedTools: ReadonlySet<string>): boolean;
33
+ export declare function supportsPlatform(entry: Pick<SkillStateEntry, 'platform'>, platform: string | undefined): boolean;
34
+ export declare function isModelCompatible(entry: Pick<SkillStateEntry, 'minCapabilityProfile'>, activeProfile: CapabilityProfile | undefined): boolean;
40
35
  export declare function resolveSkillState(entry: SkillStateEntry, inputs?: SkillStateInputs): Promise<SkillState>;