@probelabs/visor 0.1.106 → 0.1.111

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 (530) hide show
  1. package/README.md +71 -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 +624 -0
  7. package/defaults/visor.tests.yaml +685 -0
  8. package/defaults/visor.yaml +483 -0
  9. package/dist/action-cli-bridge.d.ts +11 -82
  10. package/dist/action-cli-bridge.d.ts.map +1 -1
  11. package/dist/ai-review-service.d.ts +28 -9
  12. package/dist/ai-review-service.d.ts.map +1 -1
  13. package/dist/check-execution-engine.d.ts +19 -331
  14. package/dist/check-execution-engine.d.ts.map +1 -1
  15. package/dist/cli-main.d.ts.map +1 -1
  16. package/dist/cli.d.ts +0 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/config.d.ts +16 -0
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/cron-scheduler.d.ts +3 -3
  21. package/dist/cron-scheduler.d.ts.map +1 -1
  22. package/dist/debug-visualizer/ws-server.d.ts +7 -1
  23. package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
  24. package/dist/defaults/code-refiner.yaml +114 -0
  25. package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
  26. package/dist/defaults/override.yaml +52 -0
  27. package/dist/defaults/task-refinement.yaml +624 -0
  28. package/dist/defaults/visor.tests.yaml +685 -0
  29. package/dist/defaults/visor.yaml +483 -0
  30. package/dist/docs/DEPLOYMENT.md +118 -0
  31. package/dist/docs/GITHUB_CHECKS.md +280 -0
  32. package/dist/docs/NPM_USAGE.md +208 -0
  33. package/dist/docs/action-reference.md +19 -0
  34. package/dist/docs/advanced-ai.md +237 -0
  35. package/dist/docs/ai-configuration.md +535 -0
  36. package/dist/docs/ai-custom-tools-usage.md +261 -0
  37. package/dist/docs/ai-custom-tools.md +392 -0
  38. package/dist/docs/author-permissions.md +610 -0
  39. package/dist/docs/bot-transports-rfc.md +23 -0
  40. package/dist/docs/ci-cli-mode.md +34 -0
  41. package/dist/docs/claude-code.md +74 -0
  42. package/dist/docs/command-provider.md +559 -0
  43. package/dist/docs/commands.md +8 -0
  44. package/dist/docs/configuration.md +324 -0
  45. package/dist/docs/custom-tools.md +424 -0
  46. package/dist/docs/dashboards/README.md +23 -0
  47. package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
  48. package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
  49. package/dist/docs/debug-visualizer-progress.md +572 -0
  50. package/dist/docs/debug-visualizer-rfc.md +691 -0
  51. package/dist/docs/debug-visualizer.md +114 -0
  52. package/dist/docs/debugging.md +636 -0
  53. package/dist/docs/default-output-schema.md +28 -0
  54. package/dist/docs/dependencies.md +369 -0
  55. package/dist/docs/dev-playbook.md +9 -0
  56. package/dist/docs/engine-pause-resume-rfc.md +192 -0
  57. package/dist/docs/engine-state-machine-plan.md +333 -0
  58. package/dist/docs/event-driven-github-integration-rfc.md +743 -0
  59. package/dist/docs/event-triggers.md +292 -0
  60. package/dist/docs/execution-statistics-rfc.md +290 -0
  61. package/dist/docs/fact-validator-gap-analysis.md +178 -0
  62. package/dist/docs/fact-validator-implementation-plan.md +1235 -0
  63. package/dist/docs/fail-if.md +95 -0
  64. package/dist/docs/failure-conditions-implementation.md +271 -0
  65. package/dist/docs/failure-conditions-schema.md +173 -0
  66. package/dist/docs/failure-routing-rfc.md +193 -0
  67. package/dist/docs/failure-routing.md +507 -0
  68. package/dist/docs/foreach-dependency-propagation.md +473 -0
  69. package/dist/docs/github-ops.md +89 -0
  70. package/dist/docs/goto-forward-run-plan.md +113 -0
  71. package/dist/docs/guides/criticality-modes.md +332 -0
  72. package/dist/docs/guides/fault-management-and-contracts.md +738 -0
  73. package/dist/docs/guides/workflow-style-guide.md +224 -0
  74. package/dist/docs/http.md +299 -0
  75. package/dist/docs/human-input-provider.md +372 -0
  76. package/dist/docs/lifecycle-hooks.md +253 -0
  77. package/dist/docs/limits.md +64 -0
  78. package/dist/docs/liquid-templates.md +490 -0
  79. package/dist/docs/loop-routing-refactor.md +89 -0
  80. package/dist/docs/mcp-provider.md +557 -0
  81. package/dist/docs/mcp.md +124 -0
  82. package/dist/docs/memory.md +903 -0
  83. package/dist/docs/observability.md +12 -0
  84. package/dist/docs/output-formats.md +20 -0
  85. package/dist/docs/output-formatting.md +29 -0
  86. package/dist/docs/output-history.md +383 -0
  87. package/dist/docs/performance.md +6 -0
  88. package/dist/docs/pluggable.md +124 -0
  89. package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
  90. package/dist/docs/providers/git-checkout.md +589 -0
  91. package/dist/docs/recipes.md +474 -0
  92. package/dist/docs/rfc/git-checkout-step.md +601 -0
  93. package/dist/docs/rfc/on_init-hook.md +1294 -0
  94. package/dist/docs/rfc/workspace-isolation.md +216 -0
  95. package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
  96. package/dist/docs/router-patterns.md +339 -0
  97. package/dist/docs/schema-next-pr.md +10 -0
  98. package/dist/docs/schema-templates.md +68 -0
  99. package/dist/docs/script.md +34 -0
  100. package/dist/docs/sdk.md +222 -0
  101. package/dist/docs/security.md +7 -0
  102. package/dist/docs/suppressions.md +89 -0
  103. package/dist/docs/tag-filtering.md +258 -0
  104. package/dist/docs/telemetry-setup.md +119 -0
  105. package/dist/docs/telemetry-tracing-rfc.md +275 -0
  106. package/dist/docs/test-framework-rfc.md +680 -0
  107. package/dist/docs/testing/assertions.md +85 -0
  108. package/dist/docs/testing/ci.md +44 -0
  109. package/dist/docs/testing/cli.md +41 -0
  110. package/dist/docs/testing/cookbook.md +172 -0
  111. package/dist/docs/testing/dsl-reference.md +199 -0
  112. package/dist/docs/testing/fixtures-and-mocks.md +91 -0
  113. package/dist/docs/testing/flows.md +92 -0
  114. package/dist/docs/testing/getting-started.md +93 -0
  115. package/dist/docs/testing/troubleshooting.md +55 -0
  116. package/dist/docs/timeouts.md +50 -0
  117. package/dist/docs/troubleshooting.md +7 -0
  118. package/dist/docs/visor-sdk-rfc.md +186 -0
  119. package/dist/docs/workflows.md +569 -0
  120. package/dist/engine/on-finish/orchestrator.d.ts +19 -0
  121. package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
  122. package/dist/engine/on-finish/utils.d.ts +44 -0
  123. package/dist/engine/on-finish/utils.d.ts.map +1 -0
  124. package/dist/event-bus/event-bus.d.ts +13 -0
  125. package/dist/event-bus/event-bus.d.ts.map +1 -0
  126. package/dist/event-bus/types.d.ts +71 -0
  127. package/dist/event-bus/types.d.ts.map +1 -0
  128. package/dist/examples/.claude/agents/code-reviewer.md +69 -0
  129. package/dist/examples/.mcp.json +34 -0
  130. package/dist/examples/CALCULATOR-SDK.md +364 -0
  131. package/dist/examples/README.md +384 -0
  132. package/dist/examples/ai-custom-tools-example.yaml +206 -0
  133. package/dist/examples/ai-custom-tools-simple.yaml +76 -0
  134. package/dist/examples/ai-retry-fallback-config.yaml +180 -0
  135. package/dist/examples/ai-with-bash.yaml +126 -0
  136. package/dist/examples/ai-with-mcp.yaml +82 -0
  137. package/dist/examples/basic-human-input.yaml +15 -0
  138. package/dist/examples/bedrock-config.yaml +77 -0
  139. package/dist/examples/calculator-config.yaml +133 -0
  140. package/dist/examples/calculator-json-output-guide.md +311 -0
  141. package/dist/examples/calculator-sdk-automated.ts +340 -0
  142. package/dist/examples/calculator-sdk-example.ts +275 -0
  143. package/dist/examples/calculator-sdk-json.ts +331 -0
  144. package/dist/examples/calculator-sdk-real.ts +374 -0
  145. package/dist/examples/calculator-sdk-test.ts +148 -0
  146. package/dist/examples/claude-code-config.yaml +191 -0
  147. package/dist/examples/cron-webhook-config.yaml +215 -0
  148. package/dist/examples/custom-template.liquid +57 -0
  149. package/dist/examples/custom-tools-example.yaml +281 -0
  150. package/dist/examples/enhanced-config.yaml +165 -0
  151. package/dist/examples/environments/visor.base.yaml +92 -0
  152. package/dist/examples/environments/visor.dev.yaml +33 -0
  153. package/dist/examples/environments/visor.prod.yaml +95 -0
  154. package/dist/examples/environments/visor.staging.yaml +46 -0
  155. package/dist/examples/fact-validator.yaml +361 -0
  156. package/dist/examples/fail-if-simple.yaml +90 -0
  157. package/dist/examples/failure-conditions-advanced.yaml +136 -0
  158. package/dist/examples/failure-conditions-basic.yaml +48 -0
  159. package/dist/examples/failure-conditions-github-style.yaml +119 -0
  160. package/dist/examples/failure-conditions-migration.yaml +74 -0
  161. package/dist/examples/for-loop-example.yaml +176 -0
  162. package/dist/examples/forEach-example.yaml +120 -0
  163. package/dist/examples/git-checkout-basic.yaml +32 -0
  164. package/dist/examples/git-checkout-compare.yaml +59 -0
  165. package/dist/examples/git-checkout-cross-repo.yaml +76 -0
  166. package/dist/examples/github-workflow-with-tags.yml +163 -0
  167. package/dist/examples/http-integration-config.yaml +240 -0
  168. package/dist/examples/https-server-config.yaml +209 -0
  169. package/dist/examples/human-input-example.yaml +63 -0
  170. package/dist/examples/if-conditions.yaml +173 -0
  171. package/dist/examples/jira-simple-example.yaml +56 -0
  172. package/dist/examples/jira-single-issue-workflow.yaml +166 -0
  173. package/dist/examples/jira-workflow-mcp.yaml +182 -0
  174. package/dist/examples/mcp/analyzer.py +119 -0
  175. package/dist/examples/mcp-provider-example.yaml +301 -0
  176. package/dist/examples/memory-counter.yaml +99 -0
  177. package/dist/examples/memory-error-collection.yaml +104 -0
  178. package/dist/examples/memory-exec-js.yaml +247 -0
  179. package/dist/examples/memory-namespace-isolation.yaml +184 -0
  180. package/dist/examples/memory-retry-counter.yaml +65 -0
  181. package/dist/examples/memory-state-machine.yaml +170 -0
  182. package/dist/examples/on-init-import-demo.yaml +179 -0
  183. package/dist/examples/outputs-raw-basic.yaml +26 -0
  184. package/dist/examples/project-with-tools.yaml +174 -0
  185. package/dist/examples/prompts/architecture-analysis.liquid +116 -0
  186. package/dist/examples/prompts/security-comprehensive.liquid +107 -0
  187. package/dist/examples/quick-start-tags.yaml +53 -0
  188. package/dist/examples/reusable-tools.yaml +92 -0
  189. package/dist/examples/reusable-workflows.yaml +88 -0
  190. package/dist/examples/routing-basic.yaml +35 -0
  191. package/dist/examples/routing-dynamic-js.yaml +46 -0
  192. package/dist/examples/routing-foreach.yaml +34 -0
  193. package/dist/examples/routing-goto-event.yaml +34 -0
  194. package/dist/examples/routing-on-success.yaml +25 -0
  195. package/dist/examples/run-calculator-demo.sh +71 -0
  196. package/dist/examples/sdk-basic.mjs +10 -0
  197. package/dist/examples/sdk-cjs.cjs +10 -0
  198. package/dist/examples/sdk-comprehensive.mjs +175 -0
  199. package/dist/examples/sdk-manual-config.mjs +65 -0
  200. package/dist/examples/sdk-typescript.js +81 -0
  201. package/dist/examples/sdk-typescript.ts +92 -0
  202. package/dist/examples/session-reuse-config.yaml +151 -0
  203. package/dist/examples/session-reuse-self.yaml +81 -0
  204. package/dist/examples/slack-simple-chat.yaml +775 -0
  205. package/dist/examples/templates/security-report.liquid +137 -0
  206. package/dist/examples/tools-library.yaml +281 -0
  207. package/dist/examples/transform-example.yaml +199 -0
  208. package/dist/examples/visor-with-tags.yaml +198 -0
  209. package/dist/examples/webhook-pipeline-config.yaml +218 -0
  210. package/dist/examples/workflows/calculator-workflow.yaml +163 -0
  211. package/dist/examples/workflows/code-quality.yaml +222 -0
  212. package/dist/examples/workflows/quick-pr-check.yaml +90 -0
  213. package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
  214. package/dist/failure-condition-evaluator.d.ts +3 -0
  215. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  216. package/dist/frontends/github-frontend.d.ts +58 -0
  217. package/dist/frontends/github-frontend.d.ts.map +1 -0
  218. package/dist/frontends/host.d.ts +47 -0
  219. package/dist/frontends/host.d.ts.map +1 -0
  220. package/dist/frontends/ndjson-sink.d.ts +12 -0
  221. package/dist/frontends/ndjson-sink.d.ts.map +1 -0
  222. package/dist/frontends/slack-frontend.d.ts +58 -0
  223. package/dist/frontends/slack-frontend.d.ts.map +1 -0
  224. package/dist/generated/config-schema.d.ts +967 -57
  225. package/dist/generated/config-schema.d.ts.map +1 -1
  226. package/dist/generated/config-schema.json +1033 -56
  227. package/dist/github-check-service.d.ts +4 -6
  228. package/dist/github-check-service.d.ts.map +1 -1
  229. package/dist/github-comments.d.ts +2 -4
  230. package/dist/github-comments.d.ts.map +1 -1
  231. package/dist/index.d.ts.map +1 -1
  232. package/dist/index.js +134327 -99004
  233. package/dist/liquid-extensions.d.ts.map +1 -1
  234. package/dist/logger.d.ts +2 -0
  235. package/dist/logger.d.ts.map +1 -1
  236. package/dist/memory-store.d.ts +6 -0
  237. package/dist/memory-store.d.ts.map +1 -1
  238. package/dist/output/assistant-json/template.liquid +0 -0
  239. package/dist/output/traces/run-2026-01-20T19-22-58-043Z.ndjson +138 -0
  240. package/dist/output/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
  241. package/dist/output-formatters.d.ts +1 -1
  242. package/dist/output-formatters.d.ts.map +1 -1
  243. package/dist/providers/ai-check-provider.d.ts +12 -0
  244. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  245. package/dist/providers/check-provider-registry.d.ts +6 -0
  246. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  247. package/dist/providers/check-provider.interface.d.ts +43 -1
  248. package/dist/providers/check-provider.interface.d.ts.map +1 -1
  249. package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
  250. package/dist/providers/command-check-provider.d.ts +1 -1
  251. package/dist/providers/command-check-provider.d.ts.map +1 -1
  252. package/dist/providers/custom-tool-executor.d.ts +61 -0
  253. package/dist/providers/custom-tool-executor.d.ts.map +1 -0
  254. package/dist/providers/git-checkout-provider.d.ts +25 -0
  255. package/dist/providers/git-checkout-provider.d.ts.map +1 -0
  256. package/dist/providers/github-ops-provider.d.ts.map +1 -1
  257. package/dist/providers/http-client-provider.d.ts +4 -4
  258. package/dist/providers/http-client-provider.d.ts.map +1 -1
  259. package/dist/providers/human-input-check-provider.d.ts +5 -0
  260. package/dist/providers/human-input-check-provider.d.ts.map +1 -1
  261. package/dist/providers/index.d.ts +1 -0
  262. package/dist/providers/index.d.ts.map +1 -1
  263. package/dist/providers/log-check-provider.d.ts +2 -5
  264. package/dist/providers/log-check-provider.d.ts.map +1 -1
  265. package/dist/providers/mcp-check-provider.d.ts +10 -4
  266. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  267. package/dist/providers/mcp-custom-sse-server.d.ts +66 -0
  268. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -0
  269. package/dist/providers/memory-check-provider.d.ts +2 -8
  270. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  271. package/dist/providers/script-check-provider.d.ts +25 -0
  272. package/dist/providers/script-check-provider.d.ts.map +1 -0
  273. package/dist/providers/workflow-check-provider.d.ts +56 -0
  274. package/dist/providers/workflow-check-provider.d.ts.map +1 -0
  275. package/dist/reviewer.d.ts +2 -1
  276. package/dist/reviewer.d.ts.map +1 -1
  277. package/dist/sdk/check-provider-registry-534KL5HT.mjs +27 -0
  278. package/dist/sdk/chunk-23L3QRYX.mjs +16872 -0
  279. package/dist/sdk/chunk-23L3QRYX.mjs.map +1 -0
  280. package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-3OMWVM6J.mjs} +11 -1
  281. package/dist/sdk/chunk-3OMWVM6J.mjs.map +1 -0
  282. package/dist/sdk/chunk-7UK3NIIT.mjs +482 -0
  283. package/dist/sdk/chunk-7UK3NIIT.mjs.map +1 -0
  284. package/dist/sdk/chunk-AGIZJ4UZ.mjs +173 -0
  285. package/dist/sdk/chunk-AGIZJ4UZ.mjs.map +1 -0
  286. package/dist/sdk/chunk-AIVFBIS4.mjs +1371 -0
  287. package/dist/sdk/chunk-AIVFBIS4.mjs.map +1 -0
  288. package/dist/sdk/chunk-AK6BVWIT.mjs +426 -0
  289. package/dist/sdk/chunk-AK6BVWIT.mjs.map +1 -0
  290. package/dist/sdk/chunk-AUT26LHW.mjs +139 -0
  291. package/dist/sdk/chunk-AUT26LHW.mjs.map +1 -0
  292. package/dist/sdk/chunk-BOVFH3LI.mjs +232 -0
  293. package/dist/sdk/chunk-BOVFH3LI.mjs.map +1 -0
  294. package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
  295. package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
  296. package/dist/sdk/chunk-HTOKWMPO.mjs +157 -0
  297. package/dist/sdk/chunk-HTOKWMPO.mjs.map +1 -0
  298. package/dist/sdk/chunk-NAW3DB3I.mjs +197 -0
  299. package/dist/sdk/chunk-NAW3DB3I.mjs.map +1 -0
  300. package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
  301. package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
  302. package/dist/sdk/chunk-QR7MOMJH.mjs +558 -0
  303. package/dist/sdk/chunk-QR7MOMJH.mjs.map +1 -0
  304. package/dist/sdk/chunk-QY2XYPEV.mjs +3556 -0
  305. package/dist/sdk/chunk-QY2XYPEV.mjs.map +1 -0
  306. package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
  307. package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
  308. package/dist/sdk/chunk-SIWNBRTK.mjs +800 -0
  309. package/dist/sdk/chunk-SIWNBRTK.mjs.map +1 -0
  310. package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
  311. package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
  312. package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
  313. package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
  314. package/dist/sdk/command-executor-TYUV6HUS.mjs +14 -0
  315. package/dist/sdk/config-YNC2EOOT.mjs +16 -0
  316. package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
  317. package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
  318. package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
  319. package/dist/sdk/failure-condition-evaluator-YGTF2GHG.mjs +17 -0
  320. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
  321. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
  322. package/dist/sdk/github-frontend-SIAEOCON.mjs +1420 -0
  323. package/dist/sdk/github-frontend-SIAEOCON.mjs.map +1 -0
  324. package/dist/sdk/host-DXUYTNMU.mjs +52 -0
  325. package/dist/sdk/host-DXUYTNMU.mjs.map +1 -0
  326. package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-PKWCKK7E.mjs} +8 -2
  327. package/dist/sdk/memory-store-XGBB7LX7.mjs +12 -0
  328. package/dist/sdk/memory-store-XGBB7LX7.mjs.map +1 -0
  329. package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
  330. package/dist/sdk/metrics-7PP3EJUH.mjs.map +1 -0
  331. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
  332. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
  333. package/dist/sdk/prompt-state-YRJY6QAL.mjs +16 -0
  334. package/dist/sdk/prompt-state-YRJY6QAL.mjs.map +1 -0
  335. package/dist/sdk/renderer-schema-LPKN5UJS.mjs +51 -0
  336. package/dist/sdk/renderer-schema-LPKN5UJS.mjs.map +1 -0
  337. package/dist/sdk/routing-6N45MJ4F.mjs +24 -0
  338. package/dist/sdk/routing-6N45MJ4F.mjs.map +1 -0
  339. package/dist/sdk/sdk.d.mts +541 -22
  340. package/dist/sdk/sdk.d.ts +541 -22
  341. package/dist/sdk/sdk.js +27963 -16505
  342. package/dist/sdk/sdk.js.map +1 -1
  343. package/dist/sdk/sdk.mjs +1116 -2169
  344. package/dist/sdk/sdk.mjs.map +1 -1
  345. package/dist/sdk/session-registry-4E6YRQ77.mjs +10 -0
  346. package/dist/sdk/session-registry-4E6YRQ77.mjs.map +1 -0
  347. package/dist/sdk/slack-frontend-BVKW3GD5.mjs +735 -0
  348. package/dist/sdk/slack-frontend-BVKW3GD5.mjs.map +1 -0
  349. package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
  350. package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
  351. package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-GSLPPLCD.mjs} +2 -2
  352. package/dist/sdk/tracer-init-GSLPPLCD.mjs.map +1 -0
  353. package/dist/sdk/workflow-registry-R6KSACFR.mjs +12 -0
  354. package/dist/sdk/workflow-registry-R6KSACFR.mjs.map +1 -0
  355. package/dist/sdk.d.ts.map +1 -1
  356. package/dist/slack/adapter.d.ts +36 -0
  357. package/dist/slack/adapter.d.ts.map +1 -0
  358. package/dist/slack/cache-prewarmer.d.ts +31 -0
  359. package/dist/slack/cache-prewarmer.d.ts.map +1 -0
  360. package/dist/slack/client.d.ts +77 -0
  361. package/dist/slack/client.d.ts.map +1 -0
  362. package/dist/slack/markdown.d.ts +45 -0
  363. package/dist/slack/markdown.d.ts.map +1 -0
  364. package/dist/slack/prompt-state.d.ts +33 -0
  365. package/dist/slack/prompt-state.d.ts.map +1 -0
  366. package/dist/slack/rate-limiter.d.ts +56 -0
  367. package/dist/slack/rate-limiter.d.ts.map +1 -0
  368. package/dist/slack/signature.d.ts +2 -0
  369. package/dist/slack/signature.d.ts.map +1 -0
  370. package/dist/slack/socket-runner.d.ts +42 -0
  371. package/dist/slack/socket-runner.d.ts.map +1 -0
  372. package/dist/slack/thread-cache.d.ts +51 -0
  373. package/dist/slack/thread-cache.d.ts.map +1 -0
  374. package/dist/snapshot-store.d.ts +59 -0
  375. package/dist/snapshot-store.d.ts.map +1 -0
  376. package/dist/state-machine/context/build-engine-context.d.ts +17 -0
  377. package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
  378. package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
  379. package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
  380. package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
  381. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
  382. package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
  383. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
  384. package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
  385. package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
  386. package/dist/state-machine/dispatch/on-init-handlers.d.ts +43 -0
  387. package/dist/state-machine/dispatch/on-init-handlers.d.ts.map +1 -0
  388. package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
  389. package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
  390. package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
  391. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
  392. package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
  393. package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
  394. package/dist/state-machine/execution/summary.d.ts +8 -0
  395. package/dist/state-machine/execution/summary.d.ts.map +1 -0
  396. package/dist/state-machine/runner.d.ts +79 -0
  397. package/dist/state-machine/runner.d.ts.map +1 -0
  398. package/dist/state-machine/states/check-running.d.ts +14 -0
  399. package/dist/state-machine/states/check-running.d.ts.map +1 -0
  400. package/dist/state-machine/states/completed.d.ts +12 -0
  401. package/dist/state-machine/states/completed.d.ts.map +1 -0
  402. package/dist/state-machine/states/error.d.ts +11 -0
  403. package/dist/state-machine/states/error.d.ts.map +1 -0
  404. package/dist/state-machine/states/init.d.ts +11 -0
  405. package/dist/state-machine/states/init.d.ts.map +1 -0
  406. package/dist/state-machine/states/level-dispatch.d.ts +17 -0
  407. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
  408. package/dist/state-machine/states/plan-ready.d.ts +12 -0
  409. package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
  410. package/dist/state-machine/states/routing.d.ts +52 -0
  411. package/dist/state-machine/states/routing.d.ts.map +1 -0
  412. package/dist/state-machine/states/wave-planning.d.ts +14 -0
  413. package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
  414. package/dist/state-machine/workflow-projection.d.ts +47 -0
  415. package/dist/state-machine/workflow-projection.d.ts.map +1 -0
  416. package/dist/state-machine-execution-engine.d.ts +159 -0
  417. package/dist/state-machine-execution-engine.d.ts.map +1 -0
  418. package/dist/telemetry/opentelemetry.d.ts.map +1 -1
  419. package/dist/telemetry/state-capture.d.ts +5 -0
  420. package/dist/telemetry/state-capture.d.ts.map +1 -1
  421. package/dist/test-runner/assertions.d.ts +59 -0
  422. package/dist/test-runner/assertions.d.ts.map +1 -0
  423. package/dist/test-runner/core/environment.d.ts +8 -0
  424. package/dist/test-runner/core/environment.d.ts.map +1 -0
  425. package/dist/test-runner/core/fixture.d.ts +3 -0
  426. package/dist/test-runner/core/fixture.d.ts.map +1 -0
  427. package/dist/test-runner/core/flow-stage.d.ts +32 -0
  428. package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
  429. package/dist/test-runner/core/mocks.d.ts +8 -0
  430. package/dist/test-runner/core/mocks.d.ts.map +1 -0
  431. package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
  432. package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
  433. package/dist/test-runner/evaluators.d.ts +45 -0
  434. package/dist/test-runner/evaluators.d.ts.map +1 -0
  435. package/dist/test-runner/fixture-loader.d.ts +30 -0
  436. package/dist/test-runner/fixture-loader.d.ts.map +1 -0
  437. package/dist/test-runner/index.d.ts +127 -0
  438. package/dist/test-runner/index.d.ts.map +1 -0
  439. package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
  440. package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
  441. package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
  442. package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
  443. package/dist/test-runner/recorders/slack-recorder.d.ts +17 -0
  444. package/dist/test-runner/recorders/slack-recorder.d.ts.map +1 -0
  445. package/dist/test-runner/utils/selectors.d.ts +2 -0
  446. package/dist/test-runner/utils/selectors.d.ts.map +1 -0
  447. package/dist/test-runner/validator.d.ts +8 -0
  448. package/dist/test-runner/validator.d.ts.map +1 -0
  449. package/dist/traces/run-2026-01-20T19-22-58-043Z.ndjson +138 -0
  450. package/dist/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
  451. package/dist/types/bot.d.ts +109 -0
  452. package/dist/types/bot.d.ts.map +1 -0
  453. package/dist/types/cli.d.ts +8 -1
  454. package/dist/types/cli.d.ts.map +1 -1
  455. package/dist/types/config.d.ts +459 -9
  456. package/dist/types/config.d.ts.map +1 -1
  457. package/dist/types/engine.d.ts +177 -0
  458. package/dist/types/engine.d.ts.map +1 -0
  459. package/dist/types/execution.d.ts +73 -0
  460. package/dist/types/execution.d.ts.map +1 -0
  461. package/dist/types/git-checkout.d.ts +76 -0
  462. package/dist/types/git-checkout.d.ts.map +1 -0
  463. package/dist/types/github.d.ts +51 -0
  464. package/dist/types/github.d.ts.map +1 -0
  465. package/dist/types/workflow.d.ts +237 -0
  466. package/dist/types/workflow.d.ts.map +1 -0
  467. package/dist/utils/command-executor.d.ts +43 -0
  468. package/dist/utils/command-executor.d.ts.map +1 -0
  469. package/dist/utils/comment-metadata.d.ts +21 -0
  470. package/dist/utils/comment-metadata.d.ts.map +1 -0
  471. package/dist/utils/config-loader.d.ts.map +1 -1
  472. package/dist/utils/config-merger.d.ts.map +1 -1
  473. package/dist/utils/env-exposure.d.ts +3 -0
  474. package/dist/utils/env-exposure.d.ts.map +1 -0
  475. package/dist/utils/file-exclusion.d.ts.map +1 -1
  476. package/dist/utils/interactive-prompt.d.ts +1 -1
  477. package/dist/utils/interactive-prompt.d.ts.map +1 -1
  478. package/dist/utils/json-text-extractor.d.ts +17 -0
  479. package/dist/utils/json-text-extractor.d.ts.map +1 -0
  480. package/dist/utils/sandbox.d.ts +10 -0
  481. package/dist/utils/sandbox.d.ts.map +1 -1
  482. package/dist/utils/script-memory-ops.d.ts +21 -0
  483. package/dist/utils/script-memory-ops.d.ts.map +1 -0
  484. package/dist/utils/template-context.d.ts +8 -0
  485. package/dist/utils/template-context.d.ts.map +1 -0
  486. package/dist/utils/tracer-init.d.ts.map +1 -1
  487. package/dist/utils/workspace-manager.d.ts +118 -0
  488. package/dist/utils/workspace-manager.d.ts.map +1 -0
  489. package/dist/utils/worktree-cleanup.d.ts +33 -0
  490. package/dist/utils/worktree-cleanup.d.ts.map +1 -0
  491. package/dist/utils/worktree-manager.d.ts +153 -0
  492. package/dist/utils/worktree-manager.d.ts.map +1 -0
  493. package/dist/webhook-server.d.ts +3 -3
  494. package/dist/webhook-server.d.ts.map +1 -1
  495. package/dist/workflow-executor.d.ts +81 -0
  496. package/dist/workflow-executor.d.ts.map +1 -0
  497. package/dist/workflow-registry.d.ts +79 -0
  498. package/dist/workflow-registry.d.ts.map +1 -0
  499. package/package.json +12 -5
  500. package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  501. package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
  502. package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
  503. package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
  504. package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
  505. package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
  506. package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
  507. package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
  508. package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
  509. package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
  510. package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
  511. package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
  512. package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
  513. package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
  514. package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
  515. package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
  516. package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
  517. package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
  518. package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
  519. package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
  520. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
  521. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
  522. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
  523. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
  524. package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  525. /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → check-provider-registry-534KL5HT.mjs.map} +0 -0
  526. /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → command-executor-TYUV6HUS.mjs.map} +0 -0
  527. /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → config-YNC2EOOT.mjs.map} +0 -0
  528. /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
  529. /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → failure-condition-evaluator-YGTF2GHG.mjs.map} +0 -0
  530. /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → liquid-extensions-PKWCKK7E.mjs.map} +0 -0
@@ -0,0 +1,384 @@
1
+ # Visor Examples
2
+
3
+ This directory contains SDK examples (programmatic usage) and configuration examples (YAML files).
4
+
5
+ ## 🚀 SDK Examples (Programmatic Usage)
6
+
7
+ Use Visor from Node.js without shelling out.
8
+
9
+ ### Running SDK Examples
10
+
11
+ ```bash
12
+ # Build SDK first
13
+ npm run build:sdk
14
+
15
+ # Basic SDK examples
16
+ node examples/sdk-basic.mjs # Minimal (5 lines)
17
+ node examples/sdk-cjs.cjs # CommonJS
18
+ node examples/sdk-manual-config.mjs # Manual config
19
+ node examples/sdk-comprehensive.mjs # Complex with dependencies
20
+
21
+ # TypeScript (full type safety with SDK types)
22
+ npx tsc examples/sdk-typescript.ts --module esnext --target es2022 --moduleResolution bundler --esModuleInterop --skipLibCheck && node examples/sdk-typescript.js
23
+ ```
24
+
25
+ ### 🧮 Human-Input Calculator Examples
26
+
27
+ Interactive calculator demonstrating human-in-the-loop workflows:
28
+
29
+ ```bash
30
+ # Interactive calculator with table output
31
+ bun examples/calculator-sdk-real.ts
32
+
33
+ # Calculator with JSON output (programmatic processing)
34
+ bun examples/calculator-sdk-json.ts
35
+
36
+ # Fully automated calculator (for testing/automation)
37
+ bun examples/calculator-sdk-automated.ts
38
+ bun examples/calculator-sdk-automated.ts 10 5 + # With args
39
+
40
+ # YAML config version
41
+ ./dist/index.js --config examples/calculator-config.yaml --message "10" --check get-number1
42
+ ```
43
+
44
+ **Features demonstrated:**
45
+ - ✅ Human input via `human-input` check type
46
+ - ✅ Memory provider for state management
47
+ - ✅ JavaScript execution in memory provider
48
+ - ✅ Dependency chains with fail_if validation
49
+ - ✅ JSON output for programmatic processing
50
+ - ✅ Custom visualization in SDK scripts
51
+ - ✅ Suppressing stdout/stderr for clean JSON responses
52
+
53
+ See `docs/sdk.md` for full SDK documentation.
54
+
55
+ ---
56
+
57
+ ## 📝 Configuration Examples (YAML)
58
+
59
+ Example configurations demonstrating various Visor features and use cases.
60
+
61
+ ## 📁 Files Overview
62
+
63
+ ### Basic Examples
64
+ - **`quick-start-tags.yaml`** - Simple configuration showing basic tag usage
65
+ - **`visor-with-tags.yaml`** - Comprehensive configuration with all tag features
66
+ - **`routing-basic.yaml`** - Failure routing with retry + goto ancestor
67
+ - **`routing-on-success.yaml`** - on_success post-steps + single jump-back
68
+ - **`routing-foreach.yaml`** - forEach remediation with run + retry
69
+ - **`routing-dynamic-js.yaml`** - Dynamic routing via goto_js/run_js
70
+
71
+ ### GitHub Actions Workflows
72
+ - **`github-workflow-with-tags.yml`** - Progressive code review workflow using tags
73
+
74
+ ### Environment Configurations
75
+ - **`environments/visor.base.yaml`** - Base configuration with all check definitions
76
+ - **`environments/visor.dev.yaml`** - Development environment (fast, local checks)
77
+ - **`environments/visor.staging.yaml`** - Staging environment (balanced checks)
78
+ - **`environments/visor.prod.yaml`** - Production environment (comprehensive validation)
79
+
80
+ ## 🚀 Quick Start
81
+
82
+ ### 1. Basic Tag Usage
83
+
84
+ Start with the simple configuration:
85
+
86
+ ```bash
87
+ # Copy the quick-start example
88
+ cp examples/quick-start-tags.yaml .visor.yaml
89
+
90
+ # Run local checks
91
+ visor --tags local,fast
92
+
93
+ # Run comprehensive checks
94
+ visor --tags remote,comprehensive
95
+ ```
96
+
97
+ ### 2. Environment-Based Configuration
98
+
99
+ Use different configurations for different environments:
100
+
101
+ ```bash
102
+ # Development
103
+ visor --config examples/environments/visor.dev.yaml
104
+
105
+ # Staging
106
+ visor --config examples/environments/visor.staging.yaml
107
+
108
+ # Production
109
+ visor --config examples/environments/visor.prod.yaml
110
+ ```
111
+
112
+ ### 3. GitHub Actions Integration
113
+
114
+ Copy the workflow to your repository:
115
+
116
+ ```bash
117
+ cp examples/github-workflow-with-tags.yml .github/workflows/code-review.yml
118
+ ```
119
+
120
+ ## 🏷️ Tag Strategy Guide
121
+
122
+ ### Recommended Tag Taxonomy
123
+
124
+ #### Environment Tags
125
+ - `local` - Runs on developer machines
126
+ - `remote` - Runs in CI/CD
127
+ - `dev` - Development environment
128
+ - `staging` - Staging environment
129
+ - `prod` - Production environment
130
+
131
+ #### Speed Tags
132
+ - `fast` - Completes in < 30 seconds
133
+ - `slow` - Takes > 30 seconds
134
+ - `comprehensive` - Thorough but time-consuming
135
+
136
+ #### Category Tags
137
+ - `security` - Security-related checks
138
+ - `performance` - Performance analysis
139
+ - `quality` - Code quality and style
140
+ - `testing` - Test-related checks
141
+ - `documentation` - Documentation checks
142
+
143
+ #### Priority Tags
144
+ - `critical` - Must pass for deployment
145
+ - `optional` - Nice to have but not blocking
146
+ - `experimental` - Beta features
147
+
148
+ ### Tag Combination Examples
149
+
150
+ ```bash
151
+ # Fast security checks for local development
152
+ visor --tags local,fast,security
153
+
154
+ # All critical checks for production
155
+ visor --tags prod,critical
156
+
157
+ # Comprehensive review excluding experimental
158
+ visor --tags comprehensive --exclude-tags experimental
159
+
160
+ # Just the essentials
161
+ visor --tags critical,fast
162
+ ```
163
+
164
+ ## 📊 Execution Profiles
165
+
166
+ ### Profile 1: Developer (Local)
167
+ ```yaml
168
+ tag_filter:
169
+ include: ["local", "fast"]
170
+ exclude: ["slow", "experimental"]
171
+ ```
172
+ - **Goal**: Quick feedback during development
173
+ - **Runtime**: < 1 minute
174
+ - **Use Case**: Pre-commit hooks, local testing
175
+
176
+ ### Profile 2: Pull Request (CI)
177
+ ```yaml
178
+ tag_filter:
179
+ include: ["remote", "critical"]
180
+ exclude: ["experimental"]
181
+ ```
182
+ - **Goal**: Validate changes before merge
183
+ - **Runtime**: 2-5 minutes
184
+ - **Use Case**: GitHub Actions on PR
185
+
186
+ ### Profile 3: Pre-Production (Staging)
187
+ ```yaml
188
+ tag_filter:
189
+ include: ["staging", "comprehensive"]
190
+ exclude: ["experimental", "optional"]
191
+ ```
192
+ - **Goal**: Thorough validation before production
193
+ - **Runtime**: 5-10 minutes
194
+ - **Use Case**: Staging deployment pipeline
195
+
196
+ ### Profile 4: Production Release
197
+ ```yaml
198
+ tag_filter:
199
+ include: ["prod", "critical", "comprehensive"]
200
+ exclude: ["experimental"]
201
+ ```
202
+ - **Goal**: Maximum confidence for production
203
+ - **Runtime**: 10+ minutes
204
+ - **Use Case**: Production deployment gate
205
+
206
+ ## 🔧 Advanced Patterns
207
+
208
+ ### Pattern 1: Progressive Enhancement
209
+
210
+ Start with fast checks and progressively run more comprehensive ones:
211
+
212
+ ```yaml
213
+ # Stage 1: Critical issues (fail fast)
214
+ visor --tags critical,fast --fail-fast
215
+
216
+ # Stage 2: Security scan (if stage 1 passes)
217
+ visor --tags security --exclude-tags fast
218
+
219
+ # Stage 3: Comprehensive review (if all pass)
220
+ visor --tags comprehensive --exclude-tags security,critical
221
+ ```
222
+
223
+ ### Pattern 2: Conditional Execution
224
+
225
+ Run checks based on file changes:
226
+
227
+ ```yaml
228
+ steps:
229
+ frontend-checks:
230
+ tags: ["frontend", "conditional"]
231
+ on: [pr_opened]
232
+ if: "filesChanged.some(f => f.endsWith('.tsx'))"
233
+
234
+ backend-checks:
235
+ tags: ["backend", "conditional"]
236
+ on: [pr_opened]
237
+ if: "filesChanged.some(f => f.endsWith('.py'))"
238
+ ```
239
+
240
+ ### Pattern 3: Dependency Chains with Tags
241
+
242
+ ```yaml
243
+ steps:
244
+ quick-scan:
245
+ tags: ["local", "fast"]
246
+
247
+ deep-scan:
248
+ tags: ["remote", "slow"]
249
+ depends_on: [quick-scan] # Only if quick-scan is included
250
+
251
+ report:
252
+ tags: ["reporting"]
253
+ depends_on: [quick-scan, deep-scan] # Uses whatever ran
254
+ ```
255
+
256
+ ## 🎯 Best Practices
257
+
258
+ 1. **Start Simple**: Begin with `local`/`remote` or `fast`/`slow`
259
+ 2. **Be Consistent**: Use the same tags across all projects
260
+ 3. **Document Tags**: Maintain a tag glossary in your docs
261
+ 4. **Review Regularly**: Audit and update tags as needs change
262
+ 5. **Measure Impact**: Track execution times and adjust tags accordingly
263
+
264
+ ## 💡 Tips
265
+
266
+ - Use `visor --help` to see all available options
267
+ - Combine `--tags` and `--exclude-tags` for precise control
268
+ - Set default `tag_filter` in config to avoid repetition
269
+ - Use environment-specific configs with `extends` for DRY principles
270
+ - Test tag filters with `--debug` to see which checks run
271
+
272
+ ## 📚 Further Reading
273
+
274
+ - [Main README](../README.md) - Complete Visor documentation
275
+ - [Configuration Guide](../docs/configuration.md) - Detailed config options
276
+ - [GitHub Actions Guide](../docs/github-actions.md) - CI/CD integration
277
+ ### 4. Human Input Examples
278
+
279
+ Interactive workflows with human-in-the-loop:
280
+
281
+ ```bash
282
+ # Basic human input patterns
283
+ visor --config examples/human-input-example.yaml
284
+
285
+ # Interactive calculator (demonstrates memory + JS + human input)
286
+ visor --config examples/calculator-config.yaml
287
+
288
+ # Run with inline message
289
+ visor --config examples/human-input-example.yaml --check approval-gate --message "yes"
290
+
291
+ # Run with file input (auto-detected)
292
+ echo "yes" > approval.txt
293
+ visor --config examples/human-input-example.yaml --check approval-gate --message approval.txt
294
+
295
+ # Run with piped input
296
+ echo "yes" | visor --config examples/human-input-example.yaml --check approval-gate
297
+ ```
298
+
299
+ **Calculator Example:**
300
+ The calculator demonstrates a complete workflow:
301
+ 1. Prompts for first number
302
+ 2. Prompts for second number
303
+ 3. Prompts for operation (+, -, *, /)
304
+ 4. Stores values in memory
305
+ 5. Calculates result using JavaScript
306
+ 6. Displays formatted result
307
+
308
+ **SDK Usage:**
309
+
310
+ Two SDK examples are provided:
311
+
312
+ 1. **`calculator-sdk-real.ts`** - Complete, runnable SDK example:
313
+ - Real imports from Visor SDK
314
+ - Config defined inline (no YAML needed)
315
+ - Custom readline-based input hook
316
+ - Full CheckExecutionEngine usage
317
+ - Works in interactive or automated mode
318
+
319
+ ```bash
320
+ # Interactive mode
321
+ ts-node examples/calculator-sdk-real.ts
322
+
323
+ # Automated mode (for testing)
324
+ ts-node examples/calculator-sdk-real.ts 42 7 +
325
+ ```
326
+
327
+ 2. **`calculator-sdk-example.ts`** - Documentation/template example:
328
+ - Shows the structure and patterns
329
+ - Includes comments and explanations
330
+ - Generates YAML config for CLI usage
331
+
332
+ **SDK Pattern:**
333
+ ```typescript
334
+ import { HumanInputCheckProvider } from '../src/providers/human-input-check-provider';
335
+ import { CheckExecutionEngine } from '../src/check-execution-engine';
336
+ import { VisorConfig } from '../src/types/config';
337
+
338
+ // Define config inline
339
+ const config: VisorConfig = {
340
+ version: "1.0",
341
+ checks: {
342
+ "my-check": {
343
+ type: "human-input",
344
+ prompt: "Enter value:"
345
+ }
346
+ },
347
+ output: { pr_comment: { format: "markdown", group_by: "check", collapse: false } }
348
+ };
349
+
350
+ // Set custom hook
351
+ HumanInputCheckProvider.setHooks({
352
+ onHumanInput: async (request) => {
353
+ return await myCustomHandler(request);
354
+ }
355
+ });
356
+
357
+ // Run checks
358
+ const engine = new CheckExecutionEngine();
359
+ const results = await engine.executeChecks(prInfo, config, Object.keys(config.checks));
360
+ ```
361
+
362
+ ### 5. Failure Routing Examples
363
+
364
+ Run the examples directly from the repo root:
365
+
366
+ ```bash
367
+ # Basic retry + goto ancestor
368
+ npx -y @probelabs/visor@latest --config examples/routing-basic.yaml --output table
369
+
370
+ # on_success: run notify and jump back once to re-run unit-tests
371
+ npx -y @probelabs/visor@latest --config examples/routing-on-success.yaml --output table
372
+
373
+ # forEach remediation: mark missing items then retry
374
+ npx -y @probelabs/visor@latest --config examples/routing-foreach.yaml --output table
375
+
376
+ # Dynamic routing with *_js hooks
377
+ npx -y @probelabs/visor@latest --config examples/routing-dynamic-js.yaml --output table
378
+ ```
379
+
380
+ Notes:
381
+ - These examples create small temporary files in the repo (prefixed with `.visor_demo_`).
382
+ Run `git clean -fdx` or delete the files manually to reset.
383
+ - The `routing` block supports `max_loops` and default retry policies; step-level settings override defaults.
384
+ - See `docs/failure-routing-rfc.md` for full semantics.
@@ -0,0 +1,206 @@
1
+ version: "1.0"
2
+
3
+ # Example: Using Custom Tools with AI Checks
4
+ # This demonstrates how to expose custom shell-based tools to AI via ephemeral SSE MCP servers
5
+
6
+ # Define custom tools that AI can use
7
+ tools:
8
+ # Tool 1: Search for patterns in code
9
+ grep-pattern:
10
+ name: grep-pattern
11
+ description: Search for specific patterns in TypeScript files
12
+ inputSchema:
13
+ type: object
14
+ properties:
15
+ pattern:
16
+ type: string
17
+ description: The pattern to search for (regex supported)
18
+ files:
19
+ type: string
20
+ description: File glob pattern (default is *.ts)
21
+ required: [pattern]
22
+ exec: |
23
+ grep -rn "{{ args.pattern }}" {{ args.files | default: "*.ts" }} 2>/dev/null || echo "No matches found"
24
+ parseJson: false
25
+ timeout: 5000
26
+
27
+ # Tool 2: Count TODO comments
28
+ count-todos:
29
+ name: count-todos
30
+ description: Count TODO, FIXME, and HACK comments in the codebase
31
+ inputSchema:
32
+ type: object
33
+ properties:
34
+ directory:
35
+ type: string
36
+ description: Directory to search (default is src/)
37
+ required: []
38
+ exec: |
39
+ echo "TODO: $(grep -r "TODO" {{ args.directory | default: "src/" }} 2>/dev/null | wc -l | tr -d ' ')"
40
+ echo "FIXME: $(grep -r "FIXME" {{ args.directory | default: "src/" }} 2>/dev/null | wc -l | tr -d ' ')"
41
+ echo "HACK: $(grep -r "HACK" {{ args.directory | default: "src/" }} 2>/dev/null | wc -l | tr -d ' ')"
42
+ parseJson: false
43
+ timeout: 10000
44
+
45
+ # Tool 3: Check for security issues
46
+ check-secrets:
47
+ name: check-secrets
48
+ description: Scan for potential hardcoded secrets and API keys
49
+ inputSchema:
50
+ type: object
51
+ properties:
52
+ file:
53
+ type: string
54
+ description: Specific file to check (optional)
55
+ required: []
56
+ exec: |
57
+ FILES="{{ args.file | default: '.' }}"
58
+ echo "Scanning for potential secrets in: $FILES"
59
+ grep -rn -E "(api[_-]?key|secret|password|token)\s*[:=]" $FILES 2>/dev/null | head -20 || echo "No obvious secrets found"
60
+ parseJson: false
61
+ timeout: 10000
62
+
63
+ # Tool 4: List recent git changes
64
+ git-recent-changes:
65
+ name: git-recent-changes
66
+ description: Get list of recently changed files
67
+ inputSchema:
68
+ type: object
69
+ properties:
70
+ count:
71
+ type: number
72
+ description: Number of commits to look back (default is 5)
73
+ required: []
74
+ exec: |
75
+ git log -{{ args.count | default: 5 }} --name-only --pretty=format:"Commit: %h - %s" 2>/dev/null || echo "Not a git repository"
76
+ parseJson: false
77
+ timeout: 5000
78
+
79
+ # Tool 5: Get file stats
80
+ file-stats:
81
+ name: file-stats
82
+ description: Get statistics about a specific file
83
+ inputSchema:
84
+ type: object
85
+ properties:
86
+ filename:
87
+ type: string
88
+ description: The file to analyze
89
+ required: [filename]
90
+ exec: |
91
+ if [ -f "{{ args.filename }}" ]; then
92
+ echo "File: {{ args.filename }}"
93
+ echo "Lines: $(wc -l < "{{ args.filename }}" | tr -d ' ')"
94
+ echo "Size: $(wc -c < "{{ args.filename }}" | tr -d ' ') bytes"
95
+ echo "Last modified: $(stat -f "%Sm" "{{ args.filename }}" 2>/dev/null || stat -c "%y" "{{ args.filename }}" 2>/dev/null)"
96
+ else
97
+ echo "Error: File not found - {{ args.filename }}"
98
+ fi
99
+ parseJson: false
100
+ timeout: 3000
101
+
102
+ # Define AI checks that use these custom tools
103
+ steps:
104
+ # Check 1: Security review using custom tools
105
+ security-scan:
106
+ type: ai
107
+ prompt: |
108
+ You are a security-focused code reviewer. You have access to specialized tools.
109
+
110
+ Your mission:
111
+ 1. Use the 'check-secrets' tool to scan for hardcoded secrets
112
+ 2. Use the 'grep-pattern' tool to find unsafe function calls like eval(), exec(), or system()
113
+ 3. Report any security issues you find
114
+
115
+ Provide a security assessment with severity levels (critical, high, medium, low).
116
+ ai_custom_tools:
117
+ - check-secrets
118
+ - grep-pattern
119
+ ai:
120
+ provider: anthropic
121
+ model: claude-3-5-sonnet-20241022
122
+ debug: true
123
+ on:
124
+ - manual
125
+
126
+ # Check 2: Code quality review using custom tools
127
+ code-quality:
128
+ type: ai
129
+ prompt: |
130
+ You are a code quality reviewer. You have specialized analysis tools.
131
+
132
+ Tasks:
133
+ 1. Use 'count-todos' to get an overview of pending work
134
+ 2. Use 'git-recent-changes' to understand recent activity
135
+ 3. Use 'grep-pattern' to find console.log statements that should be removed
136
+
137
+ Provide recommendations for improving code quality.
138
+ ai_custom_tools:
139
+ - count-todos
140
+ - git-recent-changes
141
+ - grep-pattern
142
+ ai:
143
+ provider: anthropic
144
+ model: claude-3-5-sonnet-20241022
145
+ on:
146
+ - manual
147
+
148
+ # Check 3: File-specific analysis
149
+ analyze-file:
150
+ type: ai
151
+ prompt: |
152
+ You are analyzing a specific file in the codebase.
153
+
154
+ Use the 'file-stats' tool to get information about: src/index.ts
155
+ Then use 'grep-pattern' to find all exported functions in that file.
156
+
157
+ Provide a summary of what this file does based on your analysis.
158
+ ai_custom_tools:
159
+ - file-stats
160
+ - grep-pattern
161
+ ai:
162
+ provider: anthropic
163
+ model: claude-3-5-sonnet-20241022
164
+ on:
165
+ - manual
166
+
167
+ # Check 4: Comprehensive review combining custom tools and MCP servers
168
+ comprehensive-review:
169
+ type: ai
170
+ prompt: |
171
+ You are performing a comprehensive code review with access to multiple tools.
172
+
173
+ Custom tools available:
174
+ - check-secrets: Scan for hardcoded secrets
175
+ - count-todos: Count pending work items
176
+ - grep-pattern: Search for patterns
177
+ - git-recent-changes: See recent commits
178
+ - file-stats: Get file information
179
+
180
+ Use these tools strategically to provide a thorough review of the codebase.
181
+ Focus on security, code quality, and technical debt.
182
+ ai_custom_tools:
183
+ - check-secrets
184
+ - count-todos
185
+ - grep-pattern
186
+ - git-recent-changes
187
+ - file-stats
188
+ ai_mcp_servers:
189
+ # You can combine custom tools with external MCP servers
190
+ filesystem:
191
+ command: npx
192
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/workspace"]
193
+ ai:
194
+ provider: anthropic
195
+ model: claude-3-5-sonnet-20241022
196
+ debug: true
197
+ on:
198
+ - manual
199
+
200
+ # Output configuration
201
+ output:
202
+ pr_comment:
203
+ enabled: true
204
+ format: markdown
205
+ group_by: check
206
+ collapse: false
@@ -0,0 +1,76 @@
1
+ version: "1.0"
2
+
3
+ # Example: Using Custom Tools with AI (Reusing ai_mcp_servers)
4
+ # This shows the PREFERRED way to expose custom tools - no new config section needed!
5
+
6
+ # Define custom tools
7
+ tools:
8
+ grep-pattern:
9
+ name: grep-pattern
10
+ description: Search for specific patterns in TypeScript files
11
+ inputSchema:
12
+ type: object
13
+ properties:
14
+ pattern:
15
+ type: string
16
+ description: The pattern to search for (regex supported)
17
+ required: [pattern]
18
+ exec: 'grep -rn "{{ args.pattern }}" *.ts 2>/dev/null || echo "No matches"'
19
+ parseJson: false
20
+
21
+ check-secrets:
22
+ name: check-secrets
23
+ description: Scan for hardcoded secrets and API keys
24
+ inputSchema:
25
+ type: object
26
+ properties: {}
27
+ exec: |
28
+ grep -rn -E "(api[_-]?key|secret|password|token)\s*[:=]" . 2>/dev/null | head -10 || echo "No secrets found"
29
+ parseJson: false
30
+
31
+ count-todos:
32
+ name: count-todos
33
+ description: Count TODO comments in the codebase
34
+ inputSchema:
35
+ type: object
36
+ properties: {}
37
+ exec: 'grep -r "TODO" src/ 2>/dev/null | wc -l'
38
+ parseJson: false
39
+
40
+ steps:
41
+ # PREFERRED: Use "tools:" in ai_mcp_servers
42
+ security-review:
43
+ type: ai
44
+ prompt: |
45
+ You have access to custom security scanning tools.
46
+ Use check-secrets to scan for hardcoded credentials.
47
+ Use grep-pattern to find dangerous function calls.
48
+ ai_mcp_servers:
49
+ # Use "tools:" to reference custom tools - they'll be served via ephemeral SSE!
50
+ custom-tools:
51
+ tools: [check-secrets, grep-pattern] # ← Magic happens here!
52
+ # You can still combine with external MCP servers
53
+ filesystem:
54
+ command: npx
55
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
56
+ ai:
57
+ provider: anthropic
58
+ model: claude-3-5-sonnet-20241022
59
+ debug: true
60
+
61
+ # ALSO WORKS: Legacy ai_custom_tools format (for backward compatibility)
62
+ code-quality:
63
+ type: ai
64
+ prompt: |
65
+ Use count-todos to analyze pending work items.
66
+ ai_custom_tools: [count-todos] # ← Also works, but ai_mcp_servers is preferred
67
+ ai:
68
+ provider: anthropic
69
+ model: claude-3-5-sonnet-20241022
70
+
71
+ output:
72
+ pr_comment:
73
+ enabled: true
74
+ format: markdown
75
+ group_by: check
76
+ collapse: false