@probelabs/visor 0.1.106 → 0.1.107

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 (450) hide show
  1. package/README.md +65 -2
  2. package/action.yml +1 -1
  3. package/defaults/code-refiner.yaml +114 -0
  4. package/defaults/{.visor.yaml → code-review.yaml} +35 -226
  5. package/defaults/override.yaml +52 -0
  6. package/defaults/task-refinement.yaml +620 -0
  7. package/defaults/visor.tests.yaml +674 -0
  8. package/defaults/visor.yaml +482 -0
  9. package/dist/663.index.js +2 -3
  10. package/dist/80.index.js +2 -3
  11. package/dist/action-cli-bridge.d.ts +11 -82
  12. package/dist/action-cli-bridge.d.ts.map +1 -1
  13. package/dist/ai-review-service.d.ts +15 -0
  14. package/dist/ai-review-service.d.ts.map +1 -1
  15. package/dist/check-execution-engine.d.ts +19 -331
  16. package/dist/check-execution-engine.d.ts.map +1 -1
  17. package/dist/cli-main.d.ts.map +1 -1
  18. package/dist/cli.d.ts +0 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/config.d.ts +16 -0
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/cron-scheduler.d.ts +3 -3
  23. package/dist/cron-scheduler.d.ts.map +1 -1
  24. package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
  25. package/dist/defaults/code-refiner.yaml +114 -0
  26. package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
  27. package/dist/defaults/override.yaml +52 -0
  28. package/dist/defaults/task-refinement.yaml +620 -0
  29. package/dist/defaults/visor.tests.yaml +674 -0
  30. package/dist/defaults/visor.yaml +482 -0
  31. package/dist/docs/DEPLOYMENT.md +118 -0
  32. package/dist/docs/GITHUB_CHECKS.md +280 -0
  33. package/dist/docs/NPM_USAGE.md +208 -0
  34. package/dist/docs/action-reference.md +19 -0
  35. package/dist/docs/advanced-ai.md +178 -0
  36. package/dist/docs/ai-configuration.md +468 -0
  37. package/dist/docs/author-permissions.md +610 -0
  38. package/dist/docs/ci-cli-mode.md +34 -0
  39. package/dist/docs/claude-code.md +74 -0
  40. package/dist/docs/command-provider.md +559 -0
  41. package/dist/docs/commands.md +8 -0
  42. package/dist/docs/configuration.md +303 -0
  43. package/dist/docs/custom-tools.md +424 -0
  44. package/dist/docs/dashboards/README.md +23 -0
  45. package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
  46. package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
  47. package/dist/docs/debug-visualizer-progress.md +572 -0
  48. package/dist/docs/debug-visualizer-rfc.md +691 -0
  49. package/dist/docs/debug-visualizer.md +114 -0
  50. package/dist/docs/debugging.md +636 -0
  51. package/dist/docs/default-output-schema.md +28 -0
  52. package/dist/docs/dependencies.md +369 -0
  53. package/dist/docs/dev-playbook.md +9 -0
  54. package/dist/docs/engine-state-machine-plan.md +333 -0
  55. package/dist/docs/event-driven-github-integration-rfc.md +743 -0
  56. package/dist/docs/event-triggers.md +292 -0
  57. package/dist/docs/execution-statistics-rfc.md +290 -0
  58. package/dist/docs/fact-validator-gap-analysis.md +178 -0
  59. package/dist/docs/fact-validator-implementation-plan.md +1235 -0
  60. package/dist/docs/fail-if.md +95 -0
  61. package/dist/docs/failure-conditions-implementation.md +271 -0
  62. package/dist/docs/failure-conditions-schema.md +173 -0
  63. package/dist/docs/failure-routing-rfc.md +193 -0
  64. package/dist/docs/failure-routing.md +507 -0
  65. package/dist/docs/foreach-dependency-propagation.md +473 -0
  66. package/dist/docs/github-ops.md +89 -0
  67. package/dist/docs/goto-forward-run-plan.md +113 -0
  68. package/dist/docs/guides/criticality-modes.md +332 -0
  69. package/dist/docs/guides/fault-management-and-contracts.md +738 -0
  70. package/dist/docs/guides/workflow-style-guide.md +224 -0
  71. package/dist/docs/http.md +299 -0
  72. package/dist/docs/human-input-provider.md +372 -0
  73. package/dist/docs/limits.md +64 -0
  74. package/dist/docs/liquid-templates.md +347 -0
  75. package/dist/docs/loop-routing-refactor.md +89 -0
  76. package/dist/docs/mcp-provider.md +557 -0
  77. package/dist/docs/mcp.md +124 -0
  78. package/dist/docs/memory.md +903 -0
  79. package/dist/docs/observability.md +12 -0
  80. package/dist/docs/output-formats.md +20 -0
  81. package/dist/docs/output-formatting.md +29 -0
  82. package/dist/docs/output-history.md +383 -0
  83. package/dist/docs/performance.md +6 -0
  84. package/dist/docs/pluggable.md +124 -0
  85. package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
  86. package/dist/docs/recipes.md +21 -0
  87. package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
  88. package/dist/docs/schema-next-pr.md +10 -0
  89. package/dist/docs/schema-templates.md +68 -0
  90. package/dist/docs/script.md +34 -0
  91. package/dist/docs/sdk.md +222 -0
  92. package/dist/docs/security.md +7 -0
  93. package/dist/docs/suppressions.md +89 -0
  94. package/dist/docs/tag-filtering.md +258 -0
  95. package/dist/docs/telemetry-setup.md +119 -0
  96. package/dist/docs/telemetry-tracing-rfc.md +275 -0
  97. package/dist/docs/test-framework-rfc.md +680 -0
  98. package/dist/docs/testing/assertions.md +85 -0
  99. package/dist/docs/testing/ci.md +44 -0
  100. package/dist/docs/testing/cli.md +41 -0
  101. package/dist/docs/testing/cookbook.md +172 -0
  102. package/dist/docs/testing/dsl-reference.md +199 -0
  103. package/dist/docs/testing/fixtures-and-mocks.md +91 -0
  104. package/dist/docs/testing/flows.md +92 -0
  105. package/dist/docs/testing/getting-started.md +93 -0
  106. package/dist/docs/testing/troubleshooting.md +55 -0
  107. package/dist/docs/timeouts.md +50 -0
  108. package/dist/docs/troubleshooting.md +7 -0
  109. package/dist/docs/visor-sdk-rfc.md +186 -0
  110. package/dist/docs/workflows.md +569 -0
  111. package/dist/engine/on-finish/orchestrator.d.ts +19 -0
  112. package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
  113. package/dist/engine/on-finish/utils.d.ts +44 -0
  114. package/dist/engine/on-finish/utils.d.ts.map +1 -0
  115. package/dist/event-bus/event-bus.d.ts +13 -0
  116. package/dist/event-bus/event-bus.d.ts.map +1 -0
  117. package/dist/event-bus/types.d.ts +57 -0
  118. package/dist/event-bus/types.d.ts.map +1 -0
  119. package/dist/examples/.claude/agents/code-reviewer.md +69 -0
  120. package/dist/examples/.mcp.json +34 -0
  121. package/dist/examples/CALCULATOR-SDK.md +364 -0
  122. package/dist/examples/README.md +384 -0
  123. package/dist/examples/ai-retry-fallback-config.yaml +180 -0
  124. package/dist/examples/ai-with-bash.yaml +126 -0
  125. package/dist/examples/ai-with-mcp.yaml +82 -0
  126. package/dist/examples/basic-human-input.yaml +15 -0
  127. package/dist/examples/bedrock-config.yaml +77 -0
  128. package/dist/examples/calculator-config.yaml +133 -0
  129. package/dist/examples/calculator-json-output-guide.md +311 -0
  130. package/dist/examples/calculator-sdk-automated.ts +340 -0
  131. package/dist/examples/calculator-sdk-example.ts +275 -0
  132. package/dist/examples/calculator-sdk-json.ts +331 -0
  133. package/dist/examples/calculator-sdk-real.ts +374 -0
  134. package/dist/examples/calculator-sdk-test.ts +148 -0
  135. package/dist/examples/claude-code-config.yaml +191 -0
  136. package/dist/examples/cron-webhook-config.yaml +215 -0
  137. package/dist/examples/custom-template.liquid +57 -0
  138. package/dist/examples/custom-tools-example.yaml +281 -0
  139. package/dist/examples/enhanced-config.yaml +165 -0
  140. package/dist/examples/environments/visor.base.yaml +92 -0
  141. package/dist/examples/environments/visor.dev.yaml +33 -0
  142. package/dist/examples/environments/visor.prod.yaml +95 -0
  143. package/dist/examples/environments/visor.staging.yaml +46 -0
  144. package/dist/examples/fact-validator.yaml +361 -0
  145. package/dist/examples/fail-if-simple.yaml +90 -0
  146. package/dist/examples/failure-conditions-advanced.yaml +136 -0
  147. package/dist/examples/failure-conditions-basic.yaml +48 -0
  148. package/dist/examples/failure-conditions-github-style.yaml +119 -0
  149. package/dist/examples/failure-conditions-migration.yaml +74 -0
  150. package/dist/examples/for-loop-example.yaml +176 -0
  151. package/dist/examples/forEach-example.yaml +120 -0
  152. package/dist/examples/github-workflow-with-tags.yml +163 -0
  153. package/dist/examples/http-integration-config.yaml +240 -0
  154. package/dist/examples/https-server-config.yaml +209 -0
  155. package/dist/examples/human-input-example.yaml +63 -0
  156. package/dist/examples/if-conditions.yaml +173 -0
  157. package/dist/examples/jira-simple-example.yaml +56 -0
  158. package/dist/examples/jira-single-issue-workflow.yaml +166 -0
  159. package/dist/examples/jira-workflow-mcp.yaml +182 -0
  160. package/dist/examples/mcp/analyzer.py +119 -0
  161. package/dist/examples/mcp-provider-example.yaml +301 -0
  162. package/dist/examples/memory-counter.yaml +99 -0
  163. package/dist/examples/memory-error-collection.yaml +104 -0
  164. package/dist/examples/memory-exec-js.yaml +247 -0
  165. package/dist/examples/memory-namespace-isolation.yaml +184 -0
  166. package/dist/examples/memory-retry-counter.yaml +65 -0
  167. package/dist/examples/memory-state-machine.yaml +170 -0
  168. package/dist/examples/outputs-raw-basic.yaml +26 -0
  169. package/dist/examples/project-with-tools.yaml +174 -0
  170. package/dist/examples/prompts/architecture-analysis.liquid +116 -0
  171. package/dist/examples/prompts/security-comprehensive.liquid +107 -0
  172. package/dist/examples/quick-start-tags.yaml +53 -0
  173. package/dist/examples/routing-basic.yaml +35 -0
  174. package/dist/examples/routing-dynamic-js.yaml +46 -0
  175. package/dist/examples/routing-foreach.yaml +34 -0
  176. package/dist/examples/routing-goto-event.yaml +34 -0
  177. package/dist/examples/routing-on-success.yaml +25 -0
  178. package/dist/examples/run-calculator-demo.sh +71 -0
  179. package/dist/examples/sdk-basic.mjs +10 -0
  180. package/dist/examples/sdk-cjs.cjs +10 -0
  181. package/dist/examples/sdk-comprehensive.mjs +175 -0
  182. package/dist/examples/sdk-manual-config.mjs +65 -0
  183. package/dist/examples/sdk-typescript.js +81 -0
  184. package/dist/examples/sdk-typescript.ts +92 -0
  185. package/dist/examples/session-reuse-config.yaml +151 -0
  186. package/dist/examples/templates/security-report.liquid +137 -0
  187. package/dist/examples/tools-library.yaml +281 -0
  188. package/dist/examples/transform-example.yaml +199 -0
  189. package/dist/examples/visor-with-tags.yaml +198 -0
  190. package/dist/examples/webhook-pipeline-config.yaml +218 -0
  191. package/dist/examples/workflows/calculator-workflow.yaml +163 -0
  192. package/dist/examples/workflows/code-quality.yaml +222 -0
  193. package/dist/examples/workflows/quick-pr-check.yaml +90 -0
  194. package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
  195. package/dist/failure-condition-evaluator.d.ts +1 -0
  196. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  197. package/dist/frontends/github-frontend.d.ts +38 -0
  198. package/dist/frontends/github-frontend.d.ts.map +1 -0
  199. package/dist/frontends/host.d.ts +43 -0
  200. package/dist/frontends/host.d.ts.map +1 -0
  201. package/dist/frontends/ndjson-sink.d.ts +12 -0
  202. package/dist/frontends/ndjson-sink.d.ts.map +1 -0
  203. package/dist/generated/config-schema.d.ts +564 -22
  204. package/dist/generated/config-schema.d.ts.map +1 -1
  205. package/dist/generated/config-schema.json +612 -24
  206. package/dist/github-check-service.d.ts +4 -6
  207. package/dist/github-check-service.d.ts.map +1 -1
  208. package/dist/github-comments.d.ts +0 -4
  209. package/dist/github-comments.d.ts.map +1 -1
  210. package/dist/index.d.ts.map +1 -1
  211. package/dist/index.js +70335 -62514
  212. package/dist/liquid-extensions.d.ts.map +1 -1
  213. package/dist/logger.d.ts +1 -0
  214. package/dist/logger.d.ts.map +1 -1
  215. package/dist/memory-store.d.ts +6 -0
  216. package/dist/memory-store.d.ts.map +1 -1
  217. package/dist/output/assistant-json/template.liquid +0 -0
  218. package/dist/output/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
  219. package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
  220. package/dist/output-formatters.d.ts +1 -1
  221. package/dist/output-formatters.d.ts.map +1 -1
  222. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  223. package/dist/providers/check-provider-registry.d.ts +6 -0
  224. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  225. package/dist/providers/check-provider.interface.d.ts +34 -1
  226. package/dist/providers/check-provider.interface.d.ts.map +1 -1
  227. package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
  228. package/dist/providers/command-check-provider.d.ts +1 -1
  229. package/dist/providers/command-check-provider.d.ts.map +1 -1
  230. package/dist/providers/custom-tool-executor.d.ts +61 -0
  231. package/dist/providers/custom-tool-executor.d.ts.map +1 -0
  232. package/dist/providers/github-ops-provider.d.ts.map +1 -1
  233. package/dist/providers/http-client-provider.d.ts +1 -4
  234. package/dist/providers/http-client-provider.d.ts.map +1 -1
  235. package/dist/providers/human-input-check-provider.d.ts +3 -0
  236. package/dist/providers/human-input-check-provider.d.ts.map +1 -1
  237. package/dist/providers/index.d.ts +1 -0
  238. package/dist/providers/index.d.ts.map +1 -1
  239. package/dist/providers/log-check-provider.d.ts +2 -5
  240. package/dist/providers/log-check-provider.d.ts.map +1 -1
  241. package/dist/providers/mcp-check-provider.d.ts +9 -3
  242. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  243. package/dist/providers/memory-check-provider.d.ts +2 -8
  244. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  245. package/dist/providers/script-check-provider.d.ts +25 -0
  246. package/dist/providers/script-check-provider.d.ts.map +1 -0
  247. package/dist/providers/workflow-check-provider.d.ts +56 -0
  248. package/dist/providers/workflow-check-provider.d.ts.map +1 -0
  249. package/dist/reviewer.d.ts +2 -1
  250. package/dist/reviewer.d.ts.map +1 -1
  251. package/dist/sdk/chunk-37ZSCMFC.mjs +482 -0
  252. package/dist/sdk/chunk-37ZSCMFC.mjs.map +1 -0
  253. package/dist/sdk/chunk-6Y4YTKCF.mjs +197 -0
  254. package/dist/sdk/chunk-6Y4YTKCF.mjs.map +1 -0
  255. package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
  256. package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
  257. package/dist/sdk/chunk-IEO6CFLG.mjs +1215 -0
  258. package/dist/sdk/chunk-IEO6CFLG.mjs.map +1 -0
  259. package/dist/sdk/chunk-JEHPDJIF.mjs +223 -0
  260. package/dist/sdk/chunk-JEHPDJIF.mjs.map +1 -0
  261. package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
  262. package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
  263. package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-OOZITMRU.mjs} +1 -1
  264. package/dist/sdk/chunk-OOZITMRU.mjs.map +1 -0
  265. package/dist/sdk/chunk-OWUVOILT.mjs +557 -0
  266. package/dist/sdk/chunk-OWUVOILT.mjs.map +1 -0
  267. package/dist/sdk/chunk-OZJ263FM.mjs +986 -0
  268. package/dist/sdk/chunk-OZJ263FM.mjs.map +1 -0
  269. package/dist/sdk/chunk-PTL3K3PN.mjs +3128 -0
  270. package/dist/sdk/chunk-PTL3K3PN.mjs.map +1 -0
  271. package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
  272. package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
  273. package/dist/sdk/chunk-VMPLF6FT.mjs +127 -0
  274. package/dist/sdk/chunk-VMPLF6FT.mjs.map +1 -0
  275. package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
  276. package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
  277. package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
  278. package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
  279. package/dist/sdk/config-M4ZNO6NU.mjs +14 -0
  280. package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
  281. package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
  282. package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
  283. package/dist/sdk/failure-condition-evaluator-NBO5YRXW.mjs +16 -0
  284. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
  285. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
  286. package/dist/sdk/github-frontend-4AWRJT7D.mjs +1242 -0
  287. package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +1 -0
  288. package/dist/sdk/host-7GBC3S7L.mjs +49 -0
  289. package/dist/sdk/host-7GBC3S7L.mjs.map +1 -0
  290. package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-C7EG3YKH.mjs} +7 -2
  291. package/dist/sdk/memory-store-GJACZC2A.mjs +11 -0
  292. package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
  293. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
  294. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
  295. package/dist/sdk/renderer-schema-6RF26VUS.mjs +50 -0
  296. package/dist/sdk/renderer-schema-6RF26VUS.mjs.map +1 -0
  297. package/dist/sdk/routing-RP56JTV2.mjs +23 -0
  298. package/dist/sdk/routing-RP56JTV2.mjs.map +1 -0
  299. package/dist/sdk/sdk.d.mts +326 -21
  300. package/dist/sdk/sdk.d.ts +326 -21
  301. package/dist/sdk/sdk.js +21403 -16366
  302. package/dist/sdk/sdk.js.map +1 -1
  303. package/dist/sdk/sdk.mjs +13510 -2096
  304. package/dist/sdk/sdk.mjs.map +1 -1
  305. package/dist/sdk/session-registry-N5FFYFTM.mjs +10 -0
  306. package/dist/sdk/session-registry-N5FFYFTM.mjs.map +1 -0
  307. package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
  308. package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
  309. package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-WP4X46IF.mjs} +2 -2
  310. package/dist/sdk/tracer-init-WP4X46IF.mjs.map +1 -0
  311. package/dist/sdk/workflow-registry-2YIIXQCK.mjs +11 -0
  312. package/dist/sdk/workflow-registry-2YIIXQCK.mjs.map +1 -0
  313. package/dist/sdk.d.ts.map +1 -1
  314. package/dist/snapshot-store.d.ts +59 -0
  315. package/dist/snapshot-store.d.ts.map +1 -0
  316. package/dist/state-machine/context/build-engine-context.d.ts +9 -0
  317. package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
  318. package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
  319. package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
  320. package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
  321. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
  322. package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
  323. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
  324. package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
  325. package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
  326. package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
  327. package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
  328. package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
  329. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
  330. package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
  331. package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
  332. package/dist/state-machine/execution/summary.d.ts +8 -0
  333. package/dist/state-machine/execution/summary.d.ts.map +1 -0
  334. package/dist/state-machine/runner.d.ts +73 -0
  335. package/dist/state-machine/runner.d.ts.map +1 -0
  336. package/dist/state-machine/states/check-running.d.ts +14 -0
  337. package/dist/state-machine/states/check-running.d.ts.map +1 -0
  338. package/dist/state-machine/states/completed.d.ts +12 -0
  339. package/dist/state-machine/states/completed.d.ts.map +1 -0
  340. package/dist/state-machine/states/error.d.ts +11 -0
  341. package/dist/state-machine/states/error.d.ts.map +1 -0
  342. package/dist/state-machine/states/init.d.ts +11 -0
  343. package/dist/state-machine/states/init.d.ts.map +1 -0
  344. package/dist/state-machine/states/level-dispatch.d.ts +17 -0
  345. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
  346. package/dist/state-machine/states/plan-ready.d.ts +12 -0
  347. package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
  348. package/dist/state-machine/states/routing.d.ts +52 -0
  349. package/dist/state-machine/states/routing.d.ts.map +1 -0
  350. package/dist/state-machine/states/wave-planning.d.ts +14 -0
  351. package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
  352. package/dist/state-machine/workflow-projection.d.ts +47 -0
  353. package/dist/state-machine/workflow-projection.d.ts.map +1 -0
  354. package/dist/state-machine-execution-engine.d.ts +147 -0
  355. package/dist/state-machine-execution-engine.d.ts.map +1 -0
  356. package/dist/telemetry/opentelemetry.d.ts.map +1 -1
  357. package/dist/test-runner/assertions.d.ts +59 -0
  358. package/dist/test-runner/assertions.d.ts.map +1 -0
  359. package/dist/test-runner/core/environment.d.ts +8 -0
  360. package/dist/test-runner/core/environment.d.ts.map +1 -0
  361. package/dist/test-runner/core/fixture.d.ts +3 -0
  362. package/dist/test-runner/core/fixture.d.ts.map +1 -0
  363. package/dist/test-runner/core/flow-stage.d.ts +32 -0
  364. package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
  365. package/dist/test-runner/core/mocks.d.ts +8 -0
  366. package/dist/test-runner/core/mocks.d.ts.map +1 -0
  367. package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
  368. package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
  369. package/dist/test-runner/evaluators.d.ts +12 -0
  370. package/dist/test-runner/evaluators.d.ts.map +1 -0
  371. package/dist/test-runner/fixture-loader.d.ts +30 -0
  372. package/dist/test-runner/fixture-loader.d.ts.map +1 -0
  373. package/dist/test-runner/index.d.ts +120 -0
  374. package/dist/test-runner/index.d.ts.map +1 -0
  375. package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
  376. package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
  377. package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
  378. package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
  379. package/dist/test-runner/utils/selectors.d.ts +2 -0
  380. package/dist/test-runner/utils/selectors.d.ts.map +1 -0
  381. package/dist/test-runner/validator.d.ts +8 -0
  382. package/dist/test-runner/validator.d.ts.map +1 -0
  383. package/dist/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
  384. package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
  385. package/dist/types/cli.d.ts +4 -1
  386. package/dist/types/cli.d.ts.map +1 -1
  387. package/dist/types/config.d.ts +278 -5
  388. package/dist/types/config.d.ts.map +1 -1
  389. package/dist/types/engine.d.ts +172 -0
  390. package/dist/types/engine.d.ts.map +1 -0
  391. package/dist/types/execution.d.ts +73 -0
  392. package/dist/types/execution.d.ts.map +1 -0
  393. package/dist/types/github.d.ts +51 -0
  394. package/dist/types/github.d.ts.map +1 -0
  395. package/dist/types/workflow.d.ts +237 -0
  396. package/dist/types/workflow.d.ts.map +1 -0
  397. package/dist/utils/command-executor.d.ts +43 -0
  398. package/dist/utils/command-executor.d.ts.map +1 -0
  399. package/dist/utils/comment-metadata.d.ts +21 -0
  400. package/dist/utils/comment-metadata.d.ts.map +1 -0
  401. package/dist/utils/config-loader.d.ts.map +1 -1
  402. package/dist/utils/config-merger.d.ts.map +1 -1
  403. package/dist/utils/env-exposure.d.ts +3 -0
  404. package/dist/utils/env-exposure.d.ts.map +1 -0
  405. package/dist/utils/file-exclusion.d.ts.map +1 -1
  406. package/dist/utils/interactive-prompt.d.ts +1 -1
  407. package/dist/utils/interactive-prompt.d.ts.map +1 -1
  408. package/dist/utils/sandbox.d.ts.map +1 -1
  409. package/dist/utils/script-memory-ops.d.ts +21 -0
  410. package/dist/utils/script-memory-ops.d.ts.map +1 -0
  411. package/dist/utils/template-context.d.ts +7 -0
  412. package/dist/utils/template-context.d.ts.map +1 -0
  413. package/dist/webhook-server.d.ts +3 -3
  414. package/dist/webhook-server.d.ts.map +1 -1
  415. package/dist/workflow-executor.d.ts +81 -0
  416. package/dist/workflow-executor.d.ts.map +1 -0
  417. package/dist/workflow-registry.d.ts +79 -0
  418. package/dist/workflow-registry.d.ts.map +1 -0
  419. package/package.json +10 -5
  420. package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  421. package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
  422. package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
  423. package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
  424. package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
  425. package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
  426. package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
  427. package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
  428. package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
  429. package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
  430. package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
  431. package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
  432. package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
  433. package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
  434. package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
  435. package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
  436. package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
  437. package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
  438. package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
  439. package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
  440. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
  441. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
  442. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
  443. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
  444. package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  445. /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → config-M4ZNO6NU.mjs.map} +0 -0
  446. /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
  447. /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → failure-condition-evaluator-NBO5YRXW.mjs.map} +0 -0
  448. /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → liquid-extensions-C7EG3YKH.mjs.map} +0 -0
  449. /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → memory-store-GJACZC2A.mjs.map} +0 -0
  450. /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → metrics-7PP3EJUH.mjs.map} +0 -0
@@ -0,0 +1,303 @@
1
+ ## ⚙️ Configuration & Extends
2
+
3
+ Use `.visor.yaml` to add/override workflow steps in your repo and extend shared configurations. Visor's merge logic makes it flexible for teams and orgs.
4
+
5
+ > **Note on Terminology**: Visor now uses `steps:` instead of `checks:` in configuration files to better reflect its workflow orchestration capabilities. Both keys work identically for backward compatibility, but `steps:` is recommended for new configurations.
6
+
7
+ ### Validating Configuration
8
+
9
+ Before running checks, validate your configuration file to catch errors early:
10
+
11
+ ```bash
12
+ # Validate default config location (.visor.yaml)
13
+ visor validate
14
+
15
+ # Validate specific config file
16
+ visor validate --config .visor.yaml
17
+
18
+ # Validate example configs
19
+ visor validate --config examples/enhanced-config.yaml
20
+ ```
21
+
22
+ The `validate` command checks for:
23
+ - **Missing required fields** (e.g., `version`)
24
+ - **Invalid check types** (must be: `ai`, `claude-code`, `command`, `http`, `http_input`, `http_client`, `noop`, `log`, `github`)
25
+ - **Invalid event triggers** (e.g., `scheduled` should be `schedule`)
26
+ - **Incorrect field names** and typos
27
+ - **Schema compliance** for all configuration options
28
+
29
+ Example validation output:
30
+ ```
31
+ 🔍 Visor Configuration Validator
32
+
33
+ 📂 Validating configuration: .visor.yaml
34
+
35
+ ✅ Configuration is valid!
36
+
37
+ 📋 Summary:
38
+ Version: 1.0
39
+ Checks: 5
40
+
41
+ 📝 Configured checks:
42
+ • security (type: ai)
43
+ • performance (type: ai)
44
+ • style (type: command)
45
+ • notify (type: http)
46
+ • monitor (type: http_input)
47
+ ```
48
+
49
+ If there are errors, you'll get detailed messages with hints:
50
+ ```
51
+ ❌ Configuration validation failed!
52
+
53
+ Error: Invalid check type "webhook". Must be: ai, claude-code, command, http, http_input, http_client, noop, log, github
54
+
55
+ 💡 Hint: The 'webhook' type has been renamed to 'http' for output and 'http_input' for input.
56
+ ```
57
+
58
+ ### Check-Level AI Configuration
59
+
60
+ Override global AI settings at the check level:
61
+
62
+ ```yaml
63
+ # Global AI settings (optional)
64
+ ai_provider: anthropic # or google, openai, bedrock
65
+ ai_model: claude-3-sonnet
66
+ ai_temperature: 0.2
67
+
68
+ steps:
69
+ performance-review:
70
+ type: ai
71
+ ai:
72
+ provider: google
73
+ model: gemini-1.5-pro
74
+ temperature: 0.1
75
+ prompt: "Analyze performance metrics and provide optimization suggestions"
76
+
77
+ security-review:
78
+ type: ai
79
+ ai_provider: bedrock # Use AWS Bedrock for this step
80
+ ai_model: anthropic.claude-sonnet-4-20250514-v1:0
81
+ prompt: "Analyze code for security vulnerabilities"
82
+ ```
83
+
84
+ ### Environment Variables
85
+
86
+ Inject environment variables globally or per-check via `env`:
87
+
88
+ ```yaml
89
+ # Global environment variables
90
+ env:
91
+ OPENAI_API_KEY: "${{ env.OPENAI_API_KEY }}"
92
+ ANTHROPIC_API_KEY: "${{ env.ANTHROPIC_API_KEY }}"
93
+ GOOGLE_API_KEY: "${{ env.GOOGLE_API_KEY }}"
94
+ # AWS Bedrock credentials
95
+ AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}"
96
+ AWS_SECRET_ACCESS_KEY: "${{ env.AWS_SECRET_ACCESS_KEY }}"
97
+ AWS_REGION: "${{ env.AWS_REGION }}"
98
+ SLACK_WEBHOOK: "${{ env.SLACK_WEBHOOK }}"
99
+
100
+ steps:
101
+ custom-notify:
102
+ type: http
103
+ url: "https://hooks.slack.com/services/..."
104
+ method: POST
105
+ body: |
106
+ { "text": "Build complete for {{ pr.title }}" }
107
+ env:
108
+ SLACK_WEBHOOK: "${{ env.SLACK_WEBHOOK }}"
109
+
110
+ custom-ai-step:
111
+ type: ai
112
+ ai_provider: anthropic
113
+ ai_model: claude-3-opus
114
+ env:
115
+ ANTHROPIC_API_KEY: "${{ env.ANTHROPIC_API_KEY }}"
116
+ prompt: |
117
+ Analyze with Anthropic using env-provided credentials
118
+ ```
119
+
120
+ #### Environment Variable Syntax
121
+
122
+ - `${{ env.NAME }}` or `${NAME}` reference process env vars
123
+ - Missing variables resolve to empty strings (validated at runtime)
124
+ - Works in both global and per-check `env` blocks
125
+
126
+ ```yaml
127
+ env:
128
+ NODE_ENV: "${{ env.NODE_ENV }}"
129
+ FEATURE_FLAGS: "${FEATURE_FLAGS}"
130
+
131
+ steps:
132
+ example:
133
+ type: ai
134
+ prompt: |
135
+ Environment: ${{ env.NODE_ENV }}
136
+ Features: ${{ env.FEATURE_FLAGS }}
137
+ ```
138
+
139
+ ### Configuration Inheritance with `extends`
140
+
141
+ Build on existing configs and share standards:
142
+
143
+ ```yaml
144
+ # .visor.yaml - project config
145
+ extends: ./base-config.yaml # Single extend
146
+
147
+ # OR multiple extends (merged left-to-right)
148
+ extends:
149
+ - default # Built-in defaults
150
+ - ./team-standards.yaml # Team standards
151
+ - ./project-specific.yaml # Project overrides
152
+
153
+ steps:
154
+ my-custom-check:
155
+ type: ai
156
+ prompt: "Project-specific analysis..."
157
+ ```
158
+
159
+ #### Example: Team Configuration
160
+
161
+ team-config.yaml
162
+ ```yaml
163
+ version: "1.0"
164
+ ai_provider: openai
165
+ ai_model: gpt-4
166
+
167
+ steps:
168
+ security-scan:
169
+ type: ai
170
+ prompt: "Perform security analysis following OWASP guidelines"
171
+ on: [pr_opened, pr_updated]
172
+
173
+ code-quality:
174
+ type: ai
175
+ prompt: "Check code quality and best practices"
176
+ on: [pr_opened, pr_updated]
177
+ ```
178
+
179
+ project-config.yaml
180
+ ```yaml
181
+ extends: ./team-config.yaml
182
+
183
+ ai_model: gpt-4-turbo # Override team default
184
+
185
+ steps:
186
+ code-quality:
187
+ on: [] # Disable a check
188
+
189
+ performance-check:
190
+ type: ai
191
+ prompt: "Analyze performance implications"
192
+ on: [pr_opened]
193
+ ```
194
+
195
+ #### Remote Configuration (with Security)
196
+
197
+ Explicitly allow remote URLs for `extends`:
198
+
199
+ ```bash
200
+ visor --check all \
201
+ --allowed-remote-patterns "https://github.com/myorg/,https://raw.githubusercontent.com/myorg/"
202
+ ```
203
+
204
+ Then reference in config:
205
+ ```yaml
206
+ extends: https://raw.githubusercontent.com/myorg/configs/main/base.yaml
207
+ ```
208
+
209
+ #### Security Features
210
+ 1. Path traversal protection for local files
211
+ 2. URL allowlist for remote configs (empty by default)
212
+ 3. Disable remote extends entirely with `--no-remote-extends`
213
+
214
+ #### Merge Behavior
215
+ - Simple values: child overrides parent
216
+ - Objects: deep merge
217
+ - Arrays: replaced entirely
218
+ - Checks: disable with `on: []`
219
+
220
+ ### Appending to Prompts with `appendPrompt`
221
+
222
+ ```yaml
223
+ extends: ./base-config.yaml
224
+
225
+ steps:
226
+ security-review:
227
+ appendPrompt: "Also check for SQL injection and hardcoded secrets"
228
+ ```
229
+
230
+ Notes:
231
+ - `appendPrompt` is joined with parent `prompt` via double newline
232
+ - If no parent `prompt`, `appendPrompt` becomes the prompt
233
+ - Use `prompt` to replace entirely
234
+
235
+ ### Priority Order
236
+
237
+ 1. Check-level settings (highest)
238
+ 2. Current file configuration
239
+ 3. Extended configurations (left → right)
240
+ 4. Global configuration
241
+ 5. Environment variables
242
+ 6. Defaults (lowest)
243
+
244
+ ### Production Environment Setup
245
+
246
+ ```bash
247
+ export OPENAI_API_KEY="sk-your-openai-key"
248
+ export ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
249
+ export GOOGLE_API_KEY="your-google-api-key"
250
+ export GITHUB_TOKEN="ghp_your-github-token"
251
+ export SECURITY_MODEL="claude-3-opus"
252
+ export PERFORMANCE_MODEL="gpt-4-turbo"
253
+ export PREFERRED_AI_PROVIDER="anthropic"
254
+ export ANALYSIS_TIMEOUT="60000"
255
+ ```
256
+
257
+ Reference from config:
258
+
259
+ ```yaml
260
+ env:
261
+ OPENAI_KEY: "${{ env.OPENAI_API_KEY }}"
262
+ ANTHROPIC_KEY: "${{ env.ANTHROPIC_API_KEY }}"
263
+ GITHUB_ACCESS_TOKEN: "${{ env.GITHUB_TOKEN }}"
264
+
265
+ steps:
266
+ production-security:
267
+ type: ai
268
+ ai_model: "${{ env.SECURITY_MODEL }}"
269
+ ai_provider: "${{ env.PREFERRED_AI_PROVIDER }}"
270
+ env:
271
+ API_KEY: "${{ env.ANTHROPIC_KEY }}"
272
+ TIMEOUT: "${{ env.ANALYSIS_TIMEOUT }}"
273
+ prompt: |
274
+ Production security analysis with ${{ env.ANALYSIS_TIMEOUT }}ms timeout
275
+ ```
276
+
277
+ ### Native GitHub Provider
278
+
279
+ Use `type: github` to perform labels/comments via GitHub API (Octokit). This avoids shelling out to `gh` and supports safe label sanitization.
280
+
281
+ Keys:
282
+ - `op`: one of `labels.add`, `labels.remove`, `comment.create`.
283
+ - `values`/`value`: string or array to pass to the op (e.g., label names or comment lines). Empty strings are ignored automatically.
284
+ - `value_js` (optional): JavaScript snippet to compute values dynamically. Not required for filtering empties.
285
+
286
+ Example:
287
+ ```yaml
288
+ steps:
289
+ apply-overview-labels:
290
+ type: github
291
+ tags: [github]
292
+ depends_on: [overview]
293
+ on: [pr_opened, pr_updated]
294
+ op: labels.add
295
+ values:
296
+ - "{{ outputs.overview.tags.label | default: '' | safe_label }}"
297
+ - "{{ outputs.overview.tags['review-effort'] | default: '' | prepend: 'review/effort:' | safe_label }}"
298
+ ```
299
+
300
+ Notes:
301
+ - Requires `GITHUB_TOKEN` (or `github-token` Action input) and `GITHUB_REPOSITORY` in environment.
302
+ - Use Liquid `safe_label` / `safe_label_list` to constrain labels to `[A-Za-z0-9:/\- ]` (alphanumerics, colon, slash, hyphen, and space).
303
+ - Provider errors surface as issues (e.g., `github/missing_token`, `github/op_failed`) and won't abort the whole run.
@@ -0,0 +1,424 @@
1
+ # Custom Tools in YAML Configuration
2
+
3
+ ## Overview
4
+
5
+ Custom tools allow you to define reusable command-line tools directly in your YAML configuration. These tools can then be used in MCP (Model Context Protocol) blocks throughout your configuration, making it easy to integrate any command-line tool or script into your workflow.
6
+
7
+ ## Features
8
+
9
+ - **Define tools in YAML**: No need to create separate scripts or programs
10
+ - **Input validation**: Define JSON Schema for tool parameters
11
+ - **Template support**: Use Liquid templates for dynamic command generation
12
+ - **Transform outputs**: Process tool output with Liquid templates or JavaScript
13
+ - **Reusable**: Define once, use multiple times across your configuration
14
+ - **Importable**: Share tools across projects using the `extends` mechanism
15
+ - **Type-safe**: Full TypeScript support with input/output schemas
16
+ - **MCP-compatible**: Tools follow the Model Context Protocol specification
17
+
18
+ ## Basic Tool Definition
19
+
20
+ ```yaml
21
+ tools:
22
+ my-tool:
23
+ name: my-tool
24
+ description: Description of what the tool does
25
+ exec: 'echo "Hello World"'
26
+ ```
27
+
28
+ ## Complete Tool Schema
29
+
30
+ ```yaml
31
+ tools:
32
+ tool-name:
33
+ # MCP-compatible fields (these map directly to MCP tool interface)
34
+ name: tool-name # Required: Tool identifier (MCP: name)
35
+ description: Tool description # Recommended: Human-readable description (MCP: description)
36
+
37
+ # Input schema (JSON Schema format) - MCP: inputSchema
38
+ # This follows the JSON Schema specification and is used for:
39
+ # 1. Validating tool inputs before execution
40
+ # 2. Providing type information to AI models
41
+ # 3. Auto-generating documentation
42
+ inputSchema:
43
+ type: object
44
+ properties:
45
+ param1:
46
+ type: string
47
+ description: Parameter description # Describe each parameter for AI models
48
+ param2:
49
+ type: number
50
+ description: Optional parameter
51
+ required: [param1] # List required parameters
52
+ additionalProperties: false # Strict mode: reject unknown parameters
53
+
54
+ # Custom tool execution fields
55
+ exec: 'command {{ args.param1 }}' # Required: Command to execute (supports Liquid)
56
+ stdin: '{{ args.param2 }}' # Optional: Data to pipe to stdin (supports Liquid)
57
+
58
+ cwd: /path/to/directory # Optional: Working directory
59
+ env: # Optional: Environment variables
60
+ MY_VAR: value
61
+
62
+ timeout: 30000 # Optional: Timeout in milliseconds (default: 30000)
63
+ parseJson: true # Optional: Parse output as JSON
64
+
65
+ # Transform output with Liquid template
66
+ transform: '{ "result": {{ output | json }} }'
67
+
68
+ # OR transform with JavaScript
69
+ transform_js: |
70
+ return {
71
+ processed: output.trim().toUpperCase()
72
+ };
73
+
74
+ # Output schema for validation (optional) - MCP: outputSchema
75
+ # Not currently enforced but useful for documentation
76
+ outputSchema:
77
+ type: object
78
+ properties:
79
+ result:
80
+ type: string
81
+ description: The processed result
82
+ ```
83
+
84
+ ## MCP Compatibility
85
+
86
+ Custom tools are designed to be fully compatible with the Model Context Protocol (MCP) specification. When you define a custom tool, it automatically becomes available as an MCP tool with the following mapping:
87
+
88
+ | Custom Tool Field | MCP Tool Field | Purpose |
89
+ |------------------|----------------|---------|
90
+ | `name` | `name` | Unique identifier for the tool |
91
+ | `description` | `description` | Human-readable description for AI models and documentation |
92
+ | `inputSchema` | `inputSchema` | JSON Schema defining expected parameters |
93
+ | `outputSchema` | `outputSchema` | JSON Schema for output validation (informational) |
94
+
95
+ ### Why MCP Compatibility Matters
96
+
97
+ 1. **AI Model Integration**: Tools with proper descriptions and schemas can be automatically understood and used by AI models
98
+ 2. **Type Safety**: Input schemas provide runtime validation and type checking
99
+ 3. **Documentation**: Schemas serve as self-documenting interfaces
100
+ 4. **Interoperability**: Tools can potentially be used with other MCP-compatible systems
101
+
102
+ ### Best Practices for MCP Compatibility
103
+
104
+ 1. **Always provide descriptions**: Help AI models understand what your tool does
105
+ ```yaml
106
+ tools:
107
+ analyze-code:
108
+ name: analyze-code
109
+ description: "Analyzes source code for complexity metrics and potential issues"
110
+ ```
111
+
112
+ 2. **Use detailed input schemas**: Include descriptions for each parameter
113
+ ```yaml
114
+ inputSchema:
115
+ type: object
116
+ properties:
117
+ file:
118
+ type: string
119
+ description: "Path to the source code file to analyze"
120
+ metrics:
121
+ type: array
122
+ description: "List of metrics to calculate"
123
+ items:
124
+ type: string
125
+ enum: ["complexity", "lines", "dependencies"]
126
+ required: ["file"]
127
+ ```
128
+
129
+ 3. **Consider output schemas**: While not enforced, they document expected outputs
130
+ ```yaml
131
+ outputSchema:
132
+ type: object
133
+ properties:
134
+ complexity:
135
+ type: number
136
+ description: "Cyclomatic complexity score"
137
+ issues:
138
+ type: array
139
+ description: "List of detected issues"
140
+ ```
141
+
142
+ ## Using Custom Tools
143
+
144
+ Once defined, custom tools can be used in any MCP block by setting `transport: custom`:
145
+
146
+ ```yaml
147
+ steps:
148
+ my-check:
149
+ type: mcp
150
+ transport: custom # Use custom transport
151
+ method: my-tool # Tool name
152
+ methodArgs: # Tool arguments
153
+ param1: "value1"
154
+ param2: 42
155
+ ```
156
+
157
+ ## Template Context
158
+
159
+ Tools have access to a rich template context through Liquid templates:
160
+
161
+ ### In `exec` and `stdin`:
162
+ - `{{ args }}` - The arguments passed to the tool
163
+ - `{{ pr }}` - Pull request information (number, title, author, etc.)
164
+ - `{{ files }}` - List of files in the PR
165
+ - `{{ outputs }}` - Outputs from previous checks
166
+ - `{{ env }}` - Environment variables
167
+
168
+ ### In `transform` and `transform_js`:
169
+ - All of the above, plus:
170
+ - `{{ output }}` - The raw command output
171
+ - `{{ stdout }}` - Standard output
172
+ - `{{ stderr }}` - Standard error
173
+ - `{{ exitCode }}` - Command exit code
174
+
175
+ ## Examples
176
+
177
+ ### 1. Simple Grep Tool
178
+
179
+ ```yaml
180
+ tools:
181
+ grep-todos:
182
+ name: grep-todos
183
+ description: Find TODO comments in code
184
+ inputSchema:
185
+ type: object
186
+ properties:
187
+ pattern:
188
+ type: string
189
+ files:
190
+ type: array
191
+ items:
192
+ type: string
193
+ exec: 'grep -n "{{ args.pattern }}" {{ args.files | join: " " }}'
194
+ ```
195
+
196
+ ### 2. JSON Processing Tool
197
+
198
+ ```yaml
199
+ tools:
200
+ analyze-package:
201
+ name: analyze-package
202
+ description: Analyze package.json dependencies
203
+ inputSchema:
204
+ type: object
205
+ properties:
206
+ file:
207
+ type: string
208
+ exec: 'cat {{ args.file }}'
209
+ parseJson: true
210
+ transform_js: |
211
+ const deps = Object.keys(output.dependencies || {});
212
+ const devDeps = Object.keys(output.devDependencies || {});
213
+ return {
214
+ totalDeps: deps.length + devDeps.length,
215
+ prodDeps: deps.length,
216
+ devDeps: devDeps.length
217
+ };
218
+ ```
219
+
220
+ ### 3. Multi-Step Tool with Error Handling
221
+
222
+ ```yaml
223
+ tools:
224
+ build-and-test:
225
+ name: build-and-test
226
+ description: Build project and run tests
227
+ exec: |
228
+ npm run build && npm test
229
+ timeout: 300000 # 5 minutes
230
+ transform_js: |
231
+ if (exitCode !== 0) {
232
+ return {
233
+ success: false,
234
+ error: stderr || 'Build or tests failed'
235
+ };
236
+ }
237
+ return {
238
+ success: true,
239
+ output: output
240
+ };
241
+ ```
242
+
243
+ ### 4. Tool with Dynamic Command Generation
244
+
245
+ ```yaml
246
+ tools:
247
+ flexible-linter:
248
+ name: flexible-linter
249
+ description: Run appropriate linter based on file type
250
+ inputSchema:
251
+ type: object
252
+ properties:
253
+ file:
254
+ type: string
255
+ exec: |
256
+ {% assign ext = args.file | split: "." | last %}
257
+ {% case ext %}
258
+ {% when "js", "ts" %}
259
+ eslint {{ args.file }}
260
+ {% when "py" %}
261
+ pylint {{ args.file }}
262
+ {% when "go" %}
263
+ golint {{ args.file }}
264
+ {% else %}
265
+ echo "No linter for .{{ ext }} files"
266
+ {% endcase %}
267
+ ```
268
+
269
+ ## Tool Libraries and Extends
270
+
271
+ ### Creating a Tool Library
272
+
273
+ Create a file with just tool definitions:
274
+
275
+ ```yaml
276
+ # tools-library.yaml
277
+ version: "1.0"
278
+
279
+ tools:
280
+ tool1:
281
+ name: tool1
282
+ exec: 'command1'
283
+
284
+ tool2:
285
+ name: tool2
286
+ exec: 'command2'
287
+ ```
288
+
289
+ ### Importing Tools
290
+
291
+ Use the `extends` mechanism to import tools:
292
+
293
+ ```yaml
294
+ version: "1.0"
295
+ extends: ./tools-library.yaml
296
+
297
+ # Additional tools can be defined here
298
+ tools:
299
+ local-tool:
300
+ name: local-tool
301
+ exec: 'local-command'
302
+
303
+ # Use both imported and local tools
304
+ steps:
305
+ check1:
306
+ type: mcp
307
+ transport: custom
308
+ method: tool1 # From tools-library.yaml
309
+
310
+ check2:
311
+ type: mcp
312
+ transport: custom
313
+ method: local-tool # Defined locally
314
+ ```
315
+
316
+ ### Multiple Extends
317
+
318
+ You can import from multiple sources:
319
+
320
+ ```yaml
321
+ extends:
322
+ - ./base-tools.yaml
323
+ - ./security-tools.yaml
324
+ - https://example.com/shared-tools.yaml
325
+ ```
326
+
327
+ Tools are merged with later sources overriding earlier ones.
328
+
329
+ ## Integration with Other Features
330
+
331
+ ### Using with forEach
332
+
333
+ ```yaml
334
+ steps:
335
+ lint-all-files:
336
+ type: mcp
337
+ transport: custom
338
+ method: my-linter
339
+ forEach: "{{ files }}"
340
+ methodArgs:
341
+ file: "{{ item.filename }}"
342
+ ```
343
+
344
+ ### Conditional Execution
345
+
346
+ ```yaml
347
+ steps:
348
+ optional-check:
349
+ type: mcp
350
+ transport: custom
351
+ method: my-tool
352
+ if: "files.some(f => f.filename.endsWith('.js'))"
353
+ methodArgs:
354
+ target: "src/"
355
+ ```
356
+
357
+ ### Chaining with on_success/on_failure
358
+
359
+ ```yaml
360
+ steps:
361
+ main-check:
362
+ type: mcp
363
+ transport: custom
364
+ method: build-tool
365
+ on_success:
366
+ - type: mcp
367
+ transport: custom
368
+ method: test-tool
369
+ on_failure:
370
+ - type: mcp
371
+ transport: custom
372
+ method: cleanup-tool
373
+ ```
374
+
375
+ ## Best Practices
376
+
377
+ 1. **Use Input Schemas**: Always define `inputSchema` to validate tool inputs
378
+ 2. **Handle Errors**: Use `transform_js` to check exit codes and handle errors
379
+ 3. **Set Timeouts**: Configure appropriate timeouts for long-running commands
380
+ 4. **Parse JSON**: Use `parseJson: true` for tools that output JSON
381
+ 5. **Document Tools**: Provide clear descriptions for each tool
382
+ 6. **Create Libraries**: Group related tools in separate YAML files
383
+ 7. **Version Control**: Store tool libraries in version control for sharing
384
+ 8. **Test Tools**: Test tools independently before using in complex workflows
385
+
386
+ ## Security Considerations
387
+
388
+ - Tools execute with the same permissions as the Visor process
389
+ - Be cautious with user input in tool commands
390
+ - Use input validation to prevent command injection
391
+ - Avoid exposing sensitive data in tool outputs
392
+ - Consider using environment variables for secrets
393
+
394
+ ## Troubleshooting
395
+
396
+ ### Tool Not Found
397
+
398
+ If you get "Tool not found" errors:
399
+ 1. Ensure the tool is defined in the `tools` section
400
+ 2. Check that the tool name matches exactly
401
+ 3. Verify extends paths are correct
402
+
403
+ ### Command Failures
404
+
405
+ For command execution issues:
406
+ 1. Test the command manually first
407
+ 2. Check working directory (`cwd`) settings
408
+ 3. Verify required binaries are installed
409
+ 4. Check timeout settings for long operations
410
+
411
+ ### Template Errors
412
+
413
+ For Liquid template problems:
414
+ 1. Validate template syntax
415
+ 2. Check that variables exist in context
416
+ 3. Use filters correctly (e.g., `| json`, `| join`)
417
+
418
+ ### Transform Errors
419
+
420
+ For JavaScript transform issues:
421
+ 1. Ensure valid JavaScript syntax
422
+ 2. Always return a value
423
+ 3. Handle undefined/null cases
424
+ 4. Use try-catch for error handling