@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,71 @@
1
+ #!/bin/bash
2
+
3
+ # Interactive Calculator Demo Script
4
+ # This script demonstrates the calculator example using piped input
5
+
6
+ echo "╔═══════════════════════════════════════════╗"
7
+ echo "║ Visor Calculator Demo ║"
8
+ echo "║ Human Input + Memory + JavaScript ║"
9
+ echo "╚═══════════════════════════════════════════╝"
10
+ echo ""
11
+
12
+ echo "This demo will calculate: 42 + 7"
13
+ echo ""
14
+ echo "Running with piped input (non-interactive):"
15
+ echo " First number: 42"
16
+ echo " Second number: 7"
17
+ echo " Operation: +"
18
+ echo ""
19
+ echo "Press Enter to run..."
20
+ read
21
+
22
+ # Note: This would work if visor was built and the checks run sequentially
23
+ # For now, this is a demonstration of how it would work
24
+
25
+ echo "Command that would run:"
26
+ echo ""
27
+ echo " echo '42' | visor --config examples/calculator-config.yaml --check get-number1"
28
+ echo " echo '7' | visor --config examples/calculator-config.yaml --check get-number2"
29
+ echo " echo '+' | visor --config examples/calculator-config.yaml --check get-operation"
30
+ echo ""
31
+
32
+ echo "Or interactively:"
33
+ echo ""
34
+ echo " visor --config examples/calculator-config.yaml"
35
+ echo ""
36
+
37
+ echo "This would prompt you for each input with a beautiful UI like:"
38
+ echo ""
39
+ echo "┌─────────────────────────────────────────┐"
40
+ echo "│ 💬 Human Input Required │"
41
+ echo "├─────────────────────────────────────────┤"
42
+ echo "│ │"
43
+ echo "│ Enter the first number: │"
44
+ echo "│ │"
45
+ echo "│ ┌─────────────────────────────────────┐ │"
46
+ echo "│ │ e.g., 42 │ │"
47
+ echo "│ │ │ │"
48
+ echo "│ │ (Type your response and press Enter)│ │"
49
+ echo "│ └─────────────────────────────────────┘ │"
50
+ echo "│ │"
51
+ echo "└─────────────────────────────────────────┘"
52
+ echo ""
53
+ echo "> 42"
54
+ echo ""
55
+
56
+ echo "Then the result would be:"
57
+ echo ""
58
+ echo "╔════════════════════════════════════════╗"
59
+ echo "║ CALCULATION RESULT ║"
60
+ echo "╠════════════════════════════════════════╣"
61
+ echo "║ ║"
62
+ echo "║ 42 + 7 = 49 ║"
63
+ echo "║ ║"
64
+ echo "╚════════════════════════════════════════╝"
65
+ echo ""
66
+
67
+ echo "✨ Once Visor is built, you can run the actual calculator with:"
68
+ echo ""
69
+ echo " npm run build"
70
+ echo " ./dist/cli-main.js --config examples/calculator-config.yaml"
71
+ echo ""
@@ -0,0 +1,10 @@
1
+ import { loadConfig, runChecks } from '../dist/sdk/sdk.mjs';
2
+
3
+ async function main() {
4
+ // Load config from object - validation and defaults applied automatically
5
+ const config = await loadConfig({ version: '1.0', checks: {} });
6
+ const res = await runChecks({ config, checks: [], output: { format: 'json' }, debug: false });
7
+ console.log(JSON.stringify({ totalIssues: res.reviewSummary.issues?.length || 0 }, null, 2));
8
+ }
9
+
10
+ main().catch(err => { console.error(err); process.exit(1); });
@@ -0,0 +1,10 @@
1
+ const { loadConfig, runChecks } = require('../dist/sdk/sdk.js');
2
+
3
+ async function main() {
4
+ // Load config from object - validation and defaults applied automatically
5
+ const config = await loadConfig({ version: '1.0', checks: {} });
6
+ const res = await runChecks({ config, checks: [], output: { format: 'json' } });
7
+ console.log('Issues:', res.reviewSummary.issues?.length || 0);
8
+ }
9
+
10
+ main().catch(err => { console.error(err); process.exit(1); });
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Comprehensive SDK Example
3
+ *
4
+ * Demonstrates:
5
+ * - loadConfig() with raw object
6
+ * - Complex check dependencies (depends_on)
7
+ * - Check execution order
8
+ * - Different check types
9
+ * - Tag filtering
10
+ * - Parallel execution control
11
+ * - Error handling and results inspection
12
+ */
13
+
14
+ import { loadConfig, runChecks, resolveChecks } from '../dist/sdk/sdk.mjs';
15
+
16
+ async function main() {
17
+ console.log('=== Visor SDK - Comprehensive Example ===\n');
18
+
19
+ // Create a complex config with dependencies
20
+ const config = await loadConfig({
21
+ version: '1.0',
22
+ checks: {
23
+ // Step 1: Setup/preparation check
24
+ 'setup': {
25
+ type: 'command',
26
+ exec: 'echo "Setup: Installing dependencies..."',
27
+ tags: ['setup'],
28
+ },
29
+
30
+ // Step 2: Run tests (depends on setup)
31
+ 'unit-tests': {
32
+ type: 'command',
33
+ exec: 'echo "Running unit tests..."',
34
+ depends_on: ['setup'],
35
+ tags: ['tests'],
36
+ },
37
+
38
+ // Step 3: Integration tests (depends on setup)
39
+ 'integration-tests': {
40
+ type: 'command',
41
+ exec: 'echo "Running integration tests..."',
42
+ depends_on: ['setup'],
43
+ tags: ['tests'],
44
+ },
45
+
46
+ // Step 4: Security scan (depends on setup)
47
+ 'security-scan': {
48
+ type: 'command',
49
+ exec: 'echo "Running security scan..."',
50
+ depends_on: ['setup'],
51
+ tags: ['security', 'critical'],
52
+ },
53
+
54
+ // Step 5: Linting (depends on setup)
55
+ 'lint': {
56
+ type: 'command',
57
+ exec: 'echo "Running linter..."',
58
+ depends_on: ['setup'],
59
+ tags: ['quality'],
60
+ },
61
+
62
+ // Step 6: Build (depends on all tests passing)
63
+ 'build': {
64
+ type: 'command',
65
+ exec: 'echo "Building application..."',
66
+ depends_on: ['unit-tests', 'integration-tests', 'lint'],
67
+ tags: ['build'],
68
+ },
69
+
70
+ // Step 7: Deploy check (depends on build and security)
71
+ 'deploy-check': {
72
+ type: 'command',
73
+ exec: 'echo "Checking deployment readiness..."',
74
+ depends_on: ['build', 'security-scan'],
75
+ tags: ['deployment'],
76
+ },
77
+
78
+ // Step 8: Final report (depends on everything)
79
+ 'report': {
80
+ type: 'command',
81
+ exec: 'echo "Generating final report..."',
82
+ depends_on: ['deploy-check'],
83
+ tags: ['reporting'],
84
+ },
85
+ },
86
+ max_parallelism: 3,
87
+ fail_fast: false,
88
+ });
89
+
90
+ console.log('📋 Config loaded with', Object.keys(config.checks).length, 'checks\n');
91
+
92
+ // Example 1: Resolve dependencies
93
+ console.log('=== Example 1: Dependency Resolution ===');
94
+ const reportDeps = resolveChecks(['report'], config);
95
+ console.log('To run "report", these checks execute in order:');
96
+ reportDeps.forEach((check, idx) => {
97
+ console.log(` ${idx + 1}. ${check}`);
98
+ });
99
+
100
+ // Example 2: Run specific checks
101
+ console.log('\n=== Example 2: Run Specific Checks ===');
102
+ const testResult = await runChecks({
103
+ config,
104
+ checks: ['setup', 'unit-tests', 'integration-tests'],
105
+ output: { format: 'json' },
106
+ debug: false,
107
+ });
108
+ console.log('✅ Executed:', testResult.checksExecuted.join(', '));
109
+ console.log('⏱️ Time:', testResult.executionTime, 'ms');
110
+
111
+ // Example 3: Tag filtering
112
+ console.log('\n=== Example 3: Tag Filtering ===');
113
+ const securityResult = await runChecks({
114
+ config,
115
+ checks: Object.keys(config.checks),
116
+ tagFilter: { include: ['critical'] },
117
+ output: { format: 'json' },
118
+ debug: false,
119
+ });
120
+ console.log('✅ Critical checks:', securityResult.checksExecuted.join(', '));
121
+ console.log('⏱️ Time:', securityResult.executionTime, 'ms');
122
+
123
+ // Example 4: Full pipeline
124
+ console.log('\n=== Example 4: Full Pipeline ===');
125
+ const fullResult = await runChecks({
126
+ config,
127
+ checks: Object.keys(config.checks),
128
+ output: { format: 'json' },
129
+ maxParallelism: 3,
130
+ debug: false,
131
+ });
132
+
133
+ console.log('📊 Results:');
134
+ console.log(' Checks:', fullResult.checksExecuted.length);
135
+ console.log(' Time:', fullResult.executionTime, 'ms');
136
+ console.log(' Issues:', fullResult.reviewSummary.issues?.length || 0);
137
+
138
+ console.log('\n Execution order:');
139
+ fullResult.checksExecuted.forEach((check, idx) => {
140
+ console.log(` ${idx + 1}. ${check}`);
141
+ });
142
+
143
+ // Example 5: Strict validation
144
+ console.log('\n=== Example 5: Strict Validation ===');
145
+ try {
146
+ await loadConfig({
147
+ version: '1.0',
148
+ checks: { test: { type: 'command', exec: 'echo test' } },
149
+ typo_field: 'error!',
150
+ }, { strict: true });
151
+ console.log('❌ Should have thrown');
152
+ } catch (error) {
153
+ console.log('✅ Caught:', error.message.substring(0, 50) + '...');
154
+ }
155
+
156
+ // Example 6: Dependency graph
157
+ console.log('\n=== Example 6: Dependency Graph ===');
158
+ for (const name of Object.keys(config.checks)) {
159
+ const deps = config.checks[name].depends_on || [];
160
+ const tags = config.checks[name].tags || [];
161
+ const tagStr = tags.length ? ` [${tags.join(',')}]` : '';
162
+ if (deps.length) {
163
+ console.log(` ${name}${tagStr} → ${deps.join(', ')}`);
164
+ } else {
165
+ console.log(` ${name}${tagStr} → (root)`);
166
+ }
167
+ }
168
+
169
+ console.log('\n✅ All examples complete!\n');
170
+ }
171
+
172
+ main().catch(err => {
173
+ console.error('❌ Error:', err.message);
174
+ process.exit(1);
175
+ });
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Example: SDK with manually constructed config object
3
+ * This demonstrates using loadConfig() with a raw config object
4
+ * instead of loading from a file.
5
+ */
6
+
7
+ import { loadConfig, runChecks } from '../dist/sdk/sdk.mjs';
8
+
9
+ async function main() {
10
+ // Load and validate config from an object (not a file!)
11
+ // loadConfig() validates, applies defaults, and returns a complete config
12
+ const config = await loadConfig({
13
+ version: '1.0',
14
+ checks: {
15
+ 'security-check': {
16
+ type: 'command',
17
+ exec: 'echo "Running security scan..."',
18
+ },
19
+ 'lint-check': {
20
+ type: 'command',
21
+ exec: 'echo "Running linter..."',
22
+ depends_on: ['security-check'],
23
+ },
24
+ },
25
+ });
26
+
27
+ console.log('Running checks with manually constructed config...\n');
28
+
29
+ // Run all checks defined in the config
30
+ const result = await runChecks({
31
+ config,
32
+ checks: Object.keys(config.checks),
33
+ output: { format: 'json' },
34
+ debug: false,
35
+ });
36
+
37
+ // Display results
38
+ console.log('Execution summary:');
39
+ console.log(` Total checks executed: ${result.checksExecuted.length}`);
40
+ console.log(` Total issues found: ${result.reviewSummary.issues?.length || 0}`);
41
+ console.log(` Execution time: ${result.executionTime}ms`);
42
+ console.log(` Timestamp: ${result.timestamp}`);
43
+
44
+ // Display check results
45
+ console.log('\nCheck results:');
46
+ for (const checkName of result.checksExecuted) {
47
+ console.log(` ✓ ${checkName}`);
48
+ }
49
+
50
+ // Display any issues found
51
+ if (result.reviewSummary.issues && result.reviewSummary.issues.length > 0) {
52
+ console.log('\nIssues found:');
53
+ result.reviewSummary.issues.forEach((issue, idx) => {
54
+ console.log(` ${idx + 1}. [${issue.severity}] ${issue.message}`);
55
+ console.log(` File: ${issue.file}:${issue.line}`);
56
+ });
57
+ }
58
+
59
+ return result;
60
+ }
61
+
62
+ main().catch((err) => {
63
+ console.error('Error:', err);
64
+ process.exit(1);
65
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ * TypeScript SDK Example
3
+ *
4
+ * Demonstrates:
5
+ * - Type-safe config construction
6
+ * - TypeScript type inference
7
+ * - Compile-time type checking
8
+ * - Using exported types
9
+ */
10
+ // Import from the package for full TypeScript type definitions
11
+ // In a real project, you would use: '@probelabs/visor/sdk'
12
+ // For this example, we import from the built SDK with type definitions
13
+ import { loadConfig, runChecks } from '../dist/sdk/sdk.js';
14
+ async function main() {
15
+ console.log('=== Visor SDK - TypeScript Example ===\n');
16
+ // Type-safe config construction (note: VisorConfig is exported from SDK)
17
+ const rawConfig = {
18
+ version: '1.0',
19
+ checks: {
20
+ 'type-check': {
21
+ type: 'command',
22
+ exec: 'echo "Running TypeScript compiler..."',
23
+ tags: ['typescript', 'build'],
24
+ },
25
+ 'unit-tests': {
26
+ type: 'command',
27
+ exec: 'echo "Running unit tests..."',
28
+ depends_on: ['type-check'],
29
+ tags: ['testing'],
30
+ },
31
+ 'build': {
32
+ type: 'command',
33
+ exec: 'echo "Building application..."',
34
+ depends_on: ['type-check', 'unit-tests'],
35
+ tags: ['build'],
36
+ },
37
+ },
38
+ max_parallelism: 2,
39
+ fail_fast: false,
40
+ };
41
+ // Load and validate config with full type safety
42
+ const config = await loadConfig(rawConfig);
43
+ console.log('✅ Config validated and loaded');
44
+ console.log(` Checks: ${Object.keys(config.checks).length}`);
45
+ console.log(` Max parallelism: ${config.max_parallelism}\n`);
46
+ // Run checks with type-safe options
47
+ const result = await runChecks({
48
+ config,
49
+ checks: ['type-check', 'unit-tests', 'build'],
50
+ output: { format: 'json' },
51
+ maxParallelism: 2,
52
+ debug: false,
53
+ tagFilter: { include: ['typescript', 'testing', 'build'] },
54
+ });
55
+ // Type-safe result inspection
56
+ console.log('📊 Results:');
57
+ console.log(` Checks executed: ${result.checksExecuted.length}`);
58
+ console.log(` Execution time: ${result.executionTime}ms`);
59
+ console.log(` Issues found: ${result.reviewSummary.issues?.length ?? 0}`);
60
+ console.log(` Timestamp: ${result.timestamp}`);
61
+ // Type-safe iteration over results
62
+ console.log('\n Executed checks:');
63
+ result.checksExecuted.forEach((checkName, index) => {
64
+ console.log(` ${index + 1}. ${checkName}`);
65
+ });
66
+ // Demonstrate type checking with issues
67
+ if (result.reviewSummary.issues && result.reviewSummary.issues.length > 0) {
68
+ console.log('\n Issues:');
69
+ result.reviewSummary.issues.forEach((issue) => {
70
+ // TypeScript knows the structure of issue
71
+ console.log(` ${issue.file}:${issue.line} - ${issue.message}`);
72
+ console.log(` Severity: ${issue.severity}`);
73
+ });
74
+ }
75
+ console.log('\n✅ TypeScript example complete!\n');
76
+ }
77
+ // Run with proper error handling
78
+ main().catch((error) => {
79
+ console.error('❌ Error:', error.message);
80
+ process.exit(1);
81
+ });
@@ -0,0 +1,92 @@
1
+ /**
2
+ * TypeScript SDK Example
3
+ *
4
+ * Demonstrates:
5
+ * - Type-safe config construction
6
+ * - TypeScript type inference
7
+ * - Compile-time type checking
8
+ * - Using exported types
9
+ */
10
+
11
+ // Import from the package for full TypeScript type definitions
12
+ // In a real project, you would use: '@probelabs/visor/sdk'
13
+ // For this example, we import from the built SDK with type definitions
14
+ import { loadConfig, runChecks, type VisorConfig, type RunOptions } from '../dist/sdk/sdk.js';
15
+
16
+ async function main(): Promise<void> {
17
+ console.log('=== Visor SDK - TypeScript Example ===\n');
18
+
19
+ // Type-safe config construction (note: VisorConfig is exported from SDK)
20
+ const rawConfig: Partial<VisorConfig> = {
21
+ version: '1.0',
22
+ checks: {
23
+ 'type-check': {
24
+ type: 'command',
25
+ exec: 'echo "Running TypeScript compiler..."',
26
+ tags: ['typescript', 'build'],
27
+ },
28
+ 'unit-tests': {
29
+ type: 'command',
30
+ exec: 'echo "Running unit tests..."',
31
+ depends_on: ['type-check'],
32
+ tags: ['testing'],
33
+ },
34
+ 'build': {
35
+ type: 'command',
36
+ exec: 'echo "Building application..."',
37
+ depends_on: ['type-check', 'unit-tests'],
38
+ tags: ['build'],
39
+ },
40
+ },
41
+ max_parallelism: 2,
42
+ fail_fast: false,
43
+ };
44
+
45
+ // Load and validate config with full type safety
46
+ const config = await loadConfig(rawConfig);
47
+
48
+ console.log('✅ Config validated and loaded');
49
+ console.log(` Checks: ${Object.keys(config.checks).length}`);
50
+ console.log(` Max parallelism: ${config.max_parallelism}\n`);
51
+
52
+ // Run checks with type-safe options
53
+ const result = await runChecks({
54
+ config,
55
+ checks: ['type-check', 'unit-tests', 'build'],
56
+ output: { format: 'json' },
57
+ maxParallelism: 2,
58
+ debug: false,
59
+ tagFilter: { include: ['typescript', 'testing', 'build'] },
60
+ });
61
+
62
+ // Type-safe result inspection
63
+ console.log('📊 Results:');
64
+ console.log(` Checks executed: ${result.checksExecuted.length}`);
65
+ console.log(` Execution time: ${result.executionTime}ms`);
66
+ console.log(` Issues found: ${result.reviewSummary.issues?.length ?? 0}`);
67
+ console.log(` Timestamp: ${result.timestamp}`);
68
+
69
+ // Type-safe iteration over results
70
+ console.log('\n Executed checks:');
71
+ result.checksExecuted.forEach((checkName: string, index: number) => {
72
+ console.log(` ${index + 1}. ${checkName}`);
73
+ });
74
+
75
+ // Demonstrate type checking with issues
76
+ if (result.reviewSummary.issues && result.reviewSummary.issues.length > 0) {
77
+ console.log('\n Issues:');
78
+ result.reviewSummary.issues.forEach((issue) => {
79
+ // TypeScript knows the structure of issue
80
+ console.log(` ${issue.file}:${issue.line} - ${issue.message}`);
81
+ console.log(` Severity: ${issue.severity}`);
82
+ });
83
+ }
84
+
85
+ console.log('\n✅ TypeScript example complete!\n');
86
+ }
87
+
88
+ // Run with proper error handling
89
+ main().catch((error: Error) => {
90
+ console.error('❌ Error:', error.message);
91
+ process.exit(1);
92
+ });
@@ -0,0 +1,151 @@
1
+ # Example configuration demonstrating AI session reuse functionality
2
+ # This allows subsequent checks to continue conversations with AI models
3
+
4
+ version: "1.0"
5
+
6
+ # Example 1: Simple session reuse for follow-up analysis
7
+ steps:
8
+ # Initial security analysis - creates a new AI session
9
+ security-analysis:
10
+ type: ai
11
+ prompt: |
12
+ You are a security expert reviewing code changes. Analyze the provided code for:
13
+
14
+ 1. Authentication and authorization issues
15
+ 2. Input validation vulnerabilities
16
+ 3. Data exposure risks
17
+ 4. Cryptographic weaknesses
18
+ 5. Injection vulnerabilities
19
+
20
+ Provide specific examples and recommendations for each issue found.
21
+ on:
22
+ - pr_opened
23
+ - pr_updated
24
+ ai:
25
+ provider: anthropic # or google, openai
26
+ model: claude-3-sonnet-20240229
27
+
28
+ # Follow-up check that reuses the previous AI session
29
+ security-remediation:
30
+ type: ai
31
+ prompt: |
32
+ Based on our previous security analysis discussion, now provide:
33
+
34
+ 1. Detailed remediation steps for each identified security issue
35
+ 2. Code examples showing secure implementations
36
+ 3. Best practices specific to this codebase
37
+ 4. Priority ranking of fixes needed
38
+
39
+ Build upon the context we established in our previous conversation.
40
+ on:
41
+ - pr_opened
42
+ - pr_updated
43
+ depends_on:
44
+ - security-analysis
45
+ reuse_ai_session: true # This will reuse the AI session from security-analysis
46
+
47
+ # Example 2: Multi-level session reuse chain
48
+ architecture-review:
49
+ type: ai
50
+ prompt: |
51
+ Analyze the architectural patterns and design decisions in this code.
52
+ Identify the main components, their interactions, and design quality.
53
+ on:
54
+ - pr_opened
55
+ ai:
56
+ provider: anthropic
57
+ model: claude-3-sonnet-20240229
58
+
59
+ performance-analysis:
60
+ type: ai
61
+ prompt: |
62
+ Continuing our architectural discussion, now focus on performance aspects.
63
+ Consider the architectural patterns we identified and analyze:
64
+
65
+ 1. Performance bottlenecks
66
+ 2. Scalability concerns
67
+ 3. Resource usage efficiency
68
+ 4. Optimization opportunities
69
+ on:
70
+ - pr_opened
71
+ depends_on:
72
+ - architecture-review
73
+ reuse_ai_session: true
74
+
75
+ recommendations-summary:
76
+ type: ai
77
+ prompt: |
78
+ Based on our complete analysis covering architecture and performance,
79
+ provide a prioritized summary of recommendations with:
80
+
81
+ 1. Critical issues requiring immediate attention
82
+ 2. Medium-term improvements
83
+ 3. Long-term architectural considerations
84
+ 4. Implementation roadmap
85
+ on:
86
+ - pr_opened
87
+ depends_on:
88
+ - performance-analysis
89
+ reuse_ai_session: true
90
+
91
+ # Example 3: Mixed session reuse and independent checks
92
+ code-style:
93
+ type: ai
94
+ prompt: |
95
+ Review code style, formatting, and maintainability concerns.
96
+ Focus on readability, naming conventions, and code organization.
97
+ on:
98
+ - pr_opened
99
+ ai:
100
+ provider: openai
101
+ model: gpt-4
102
+
103
+ documentation-review:
104
+ type: ai
105
+ prompt: |
106
+ Review documentation quality including:
107
+ - Code comments
108
+ - README updates
109
+ - API documentation
110
+ - Inline documentation
111
+ on:
112
+ - pr_opened
113
+ # This runs independently - no session reuse
114
+
115
+ comprehensive-summary:
116
+ type: ai
117
+ prompt: |
118
+ Create a comprehensive summary combining insights from all previous analyses.
119
+ Provide an executive summary with key findings and recommendations.
120
+ on:
121
+ - pr_opened
122
+ depends_on:
123
+ - security-remediation
124
+ - recommendations-summary
125
+ - code-style
126
+ - documentation-review
127
+ reuse_ai_session: true # Reuses session from security-remediation (first dependency)
128
+
129
+ # Output configuration
130
+ output:
131
+ pr_comment:
132
+ format: markdown
133
+ group_by: check
134
+ collapse: true
135
+ debug:
136
+ enabled: true
137
+ includePrompts: false
138
+ includeRawResponses: false
139
+ includeTiming: true
140
+ includeProviderInfo: true
141
+
142
+ # Execution settings
143
+ max_parallelism: 3 # Session reuse checks will still run sequentially when needed
144
+ fail_fast: false
145
+
146
+ # Notes:
147
+ # 1. reuse_ai_session: true REQUIRES depends_on to be specified
148
+ # 2. Checks with session reuse will force sequential execution within their dependency chain
149
+ # 3. Session IDs are automatically managed and cleaned up after execution
150
+ # 4. Sessions maintain conversation context, allowing for more sophisticated analysis
151
+ # 5. Mix session reuse with independent checks for optimal performance and context